BEEP-8 SDK 1.0.0
Loading...
Searching...
No Matches
ppu.h
Go to the documentation of this file.
1
16#pragma once
17
18// ppu / Picture Processing Unit
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23#include <b8/type.h>
24#include <b8/register.h>
25
26// ppu
27#define B8_PPU_ADDR (0xffff8000)
28#define B8_PPU_EXEC _B8_REG(B8_PPU_ADDR + 0x00)
29#define B8_PPU_STAT _B8_REG(B8_PPU_ADDR + 0x04)
30#define B8_PPU_INTCTRL _B8_REG(B8_PPU_ADDR + 0x08)
31#define B8_PPU_RESOLUTION _B8_REG(B8_PPU_ADDR + 0x0c)
32
33#define B8_PPU_CMD_NOP (0x00)
34#define B8_PPU_CMD_FLUSH (0x01)
35#define B8_PPU_CMD_ENABLE (0x02)
36#define B8_PPU_CMD_RECT (0x10)
37#define B8_PPU_CMD_POLY (0x11)
38#define B8_PPU_CMD_SPRITE (0x12)
39#define B8_PPU_CMD_SETPAL (0x13)
40#define B8_PPU_CMD_SETPHYPAL (0x14)
41#define B8_PPU_CMD_BG (0x15)
42#define B8_PPU_CMD_SCISSOR (0x16)
43#define B8_PPU_CMD_VIEWOFFSET (0x17)
44#define B8_PPU_CMD_LOADIMG (0x20)
45#define B8_PPU_CMD_LINE (0x21)
46#define B8_PPU_CMD_JMP (0xf0)
47#define B8_PPU_CMD_HALT (0xff)
48
49#define B8_PPU_COLOR_BLACK (0)
50#define B8_PPU_COLOR_DARK_BLUE (1)
51#define B8_PPU_COLOR_DARK_PURPLE (2)
52#define B8_PPU_COLOR_DARK_GREEN (3)
53#define B8_PPU_COLOR_BROWN (4)
54#define B8_PPU_COLOR_DARK_GREY (5)
55#define B8_PPU_COLOR_LIGHT_GREY (6)
56#define B8_PPU_COLOR_WHITE (7)
57#define B8_PPU_COLOR_RED (8)
58#define B8_PPU_COLOR_ORANGE (9)
59#define B8_PPU_COLOR_YELLOW (10)
60#define B8_PPU_COLOR_GREEN (11)
61#define B8_PPU_COLOR_BLUE (12)
62#define B8_PPU_COLOR_LAVENDER (13)
63#define B8_PPU_COLOR_PINK (14)
64#define B8_PPU_COLOR_LIGHT_PEACH (15)
65
66enum b8PpuColor {
67 B8_BLACK = B8_PPU_COLOR_BLACK, // 0: Black
68 B8_DARK_BLUE = B8_PPU_COLOR_DARK_BLUE, // 1: Dark Blue
69 B8_DARK_PURPLE = B8_PPU_COLOR_DARK_PURPLE, // 2: Dark Purple
70 B8_DARK_GREEN = B8_PPU_COLOR_DARK_GREEN, // 3: Dark Green
71 B8_BROWN = B8_PPU_COLOR_BROWN, // 4: Brown
72 B8_DARK_GREY = B8_PPU_COLOR_DARK_GREY, // 5: Dark Grey
73 B8_LIGHT_GREY = B8_PPU_COLOR_LIGHT_GREY, // 6: Light Grey
74 B8_WHITE = B8_PPU_COLOR_WHITE, // 7: White
75 B8_RED = B8_PPU_COLOR_RED, // 8: Red
76 B8_ORANGE = B8_PPU_COLOR_ORANGE, // 9: Orange
77 B8_YELLOW = B8_PPU_COLOR_YELLOW, // 10: Yellow
78 B8_GREEN = B8_PPU_COLOR_GREEN, // 11: Green
79 B8_BLUE = B8_PPU_COLOR_BLUE, // 12: Blue
80 B8_LAVENDER = B8_PPU_COLOR_LAVENDER, // 13: Lavender
81 B8_PINK = B8_PPU_COLOR_PINK, // 14: Pink
82 B8_LIGHT_PEACH = B8_PPU_COLOR_LIGHT_PEACH, // 15: Light Peach
83 /* --- */
84 B8_TRANSPARENT
85};
86
87#define B8_PPU_EXEC_START (0x1)
88
94#define B8_PPU_BG_WRAP_CLAMP (0x00)
95
101#define B8_PPU_BG_WRAP_CLAMP_TO_EDGE (0x01)
102
108#define B8_PPU_BG_WRAP_REPEAT (0x02)
109
110
111
112#define PACKED_ALIGNED1 __attribute__((__packed__,aligned(1)))
113#define PACKED_ALIGNED4 __attribute__((__packed__,aligned(4)))
114
120typedef struct _b8PpuCmd {
121 u32* buff;
123 u32* sp;
124 u32* tail;
126 u32* ot;
127 u32* ot_prev;
128 u32 otnum;
129 u32* addr_halt;
131
148extern void b8PpuCmdSetBuff(b8PpuCmd* cmd_, u32* buff_, u32 bytesize_);
149
163extern void b8PpuCmdPush(b8PpuCmd* cmd_, u32 word_);
164
168typedef struct PACKED_ALIGNED4 _b8PpuRect {
169 unsigned pal : 4;
170 unsigned na : 20;
171 unsigned code : 8;
173 signed y : 16;
174 signed x : 16;
176 unsigned h : 16;
177 unsigned w : 16;
179
188extern b8PpuRect* b8PpuRectAlloc(b8PpuCmd* cmd_);
189
199extern b8PpuRect* b8PpuRectAllocZ(b8PpuCmd* cmd_, u32 otz_);
200
211extern b8PpuRect* b8PpuRectAllocZPB(b8PpuCmd* cmd_, u32 otz_);
212
216typedef struct PACKED_ALIGNED4 _b8PpuSprite {
217 unsigned pal : 4;
218 unsigned na0 : 20;
219 unsigned code : 8;
221 unsigned srchtile : 5;
222 unsigned vfp : 1;
223 unsigned na1 : 2;
225 unsigned srcwtile : 5;
226 unsigned hfp : 1;
227 unsigned na2 : 2;
229 unsigned srcytile : 6;
230 unsigned na3 : 2;
232 unsigned srcxtile : 6;
233 unsigned na4 : 2;
235 signed y : 16;
236 signed x : 16;
238
248
258extern b8PpuSprite* b8PpuSpriteAllocZ(b8PpuCmd* cmd_, u32 otz_);
259
270extern b8PpuSprite* b8PpuSpriteAllocZPB(b8PpuCmd* cmd_, u32 otz_);
271
275typedef struct PACKED_ALIGNED4 _b8PpuSetpal {
276 unsigned palsel : 4;
277 unsigned wmask : 16;
278 unsigned reserved : 4;
279 unsigned code : 8;
281 unsigned pidx0 : 4;
282 unsigned pidx1 : 4;
283 unsigned pidx2 : 4;
284 unsigned pidx3 : 4;
285 unsigned pidx4 : 4;
286 unsigned pidx5 : 4;
287 unsigned pidx6 : 4;
288 unsigned pidx7 : 4;
290 unsigned pidx8 : 4;
291 unsigned pidx9 : 4;
292 unsigned pidx10 : 4;
293 unsigned pidx11 : 4;
294 unsigned pidx12 : 4;
295 unsigned pidx13 : 4;
296 unsigned pidx14 : 4;
297 unsigned pidx15 : 4;
299
315
332extern b8PpuSetpal* b8PpuSetpalAllocZ(b8PpuCmd* cmd_, u32 otz, u8 flush);
333
351extern b8PpuSetpal* b8PpuSetpalAllocZPB(b8PpuCmd* cmd_, u32 otz, u8 flush);
352
353
357typedef struct PACKED_ALIGNED1 _b8PpuBgTile {
358 unsigned YTILE : 6;
359 unsigned XTILE : 6;
360 unsigned VFP : 1;
361 unsigned HFP : 1;
362 unsigned PAL : 2;
364
371#define B8_PPU_MAX_WTILE (64)
372
379#define B8_PPU_MAX_HTILE (64)
380
384typedef struct PACKED_ALIGNED4 _b8PpuBg {
385 unsigned htile : 4;
386 unsigned na0 : 8;
387 unsigned wtile : 4;
388 unsigned na1 : 8;
389 unsigned code : 8;
393 signed vpix : 16;
394 signed upix : 16;
396 unsigned vwrap : 2;
397 unsigned uwrap : 2;
398 unsigned na2 : 28;
400
409extern b8PpuBg* b8PpuBgAlloc(b8PpuCmd* cmd_);
410
420extern b8PpuBg* b8PpuBgAllocZ(b8PpuCmd* cmd_, u32 otz_);
421
432extern b8PpuBg* b8PpuBgAllocZPB(b8PpuCmd* cmd_, u32 otz_);
433
437typedef struct PACKED_ALIGNED4 _b8PpuPoly {
438 unsigned pal : 4;
439 unsigned na0 : 20;
440 unsigned code : 8;
442 signed y0 : 16;
443 signed x0 : 16;
445 signed y1 : 16;
446 signed x1 : 16;
448 signed y2 : 16;
449 signed x2 : 16;
459extern b8PpuPoly* b8PpuPolyAlloc(b8PpuCmd* cmd_);
460
470extern b8PpuPoly* b8PpuPolyAllocZ(b8PpuCmd* cmd_, u32 otz_);
471
482extern b8PpuPoly* b8PpuPolyAllocZPB(b8PpuCmd* cmd_, u32 otz_);
483
487typedef struct PACKED_ALIGNED4 _b8PpuLine {
488 unsigned pal : 4;
489 unsigned width : 4;
490 unsigned na0 : 16;
491 unsigned code : 8;
493 signed y0 : 16;
494 signed x0 : 16;
496 signed y1 : 16;
497 signed x1 : 16;
499
508extern b8PpuLine* b8PpuLineAlloc(b8PpuCmd* cmd_);
509
519extern b8PpuLine* b8PpuLineAllocZ(b8PpuCmd* cmd_, u32 otz_);
520
531extern b8PpuLine* b8PpuLineAllocZPB(b8PpuCmd* cmd_, u32 otz_);
532
536typedef struct PACKED_ALIGNED4 _b8PpuScissor {
537 unsigned na0 : 24;
538 unsigned code : 8;
540 signed y : 16;
541 signed x : 16;
543 signed h : 16;
544 signed w : 16;
546
558
568extern b8PpuScissor* b8PpuScissorAllocZ(b8PpuCmd* cmd_, u32 otz_);
569
580extern b8PpuScissor* b8PpuScissorAllocZPB(b8PpuCmd* cmd_, u32 otz_);
581
588typedef struct PACKED_ALIGNED4 _b8PpuViewoffset {
589 unsigned na0 : 24;
590 unsigned code : 8;
592 signed y : 16;
593 signed x : 16;
595
606
617extern b8PpuViewoffset* b8PpuViewoffsetAllocZ(b8PpuCmd* cmd_, u32 otz_);
618
630extern b8PpuViewoffset* b8PpuViewoffsetAllocZPB(b8PpuCmd* cmd_, u32 otz_);
631
632typedef struct PACKED_ALIGNED4 _b8PpuNop {
633 unsigned na0 : 24; // N/A
634 unsigned code : 8;
635} b8PpuNop;
636
647extern b8PpuNop* b8PpuNopAlloc(b8PpuCmd* cmd_);
648
661extern b8PpuNop* b8PpuNopAllocZ(b8PpuCmd* cmd_, u32 otz_);
662
675extern b8PpuNop* b8PpuNopAllocZPB(b8PpuCmd* cmd_, u32 otz_);
676
687typedef struct PACKED_ALIGNED4 _b8PpuFlush {
688 unsigned pal : 1;
689 unsigned img : 1;
690 unsigned na0 : 22;
691 unsigned code : 8;
693
706extern b8PpuFlush* b8PpuFlushAlloc(b8PpuCmd* cmd_);
707
721extern b8PpuFlush* b8PpuFlushAllocZ(b8PpuCmd* cmd_, u32 otz_);
722
728typedef struct PACKED_ALIGNED4 _b8PpuHalt {
729 unsigned na0 : 24;
730 unsigned code : 8;
732
743extern b8PpuHalt* b8PpuHaltAlloc(b8PpuCmd* cmd_);
744
758extern b8PpuHalt* b8PpuHaltAllocZ(b8PpuCmd* cmd_, u32 otz_);
759
772extern b8PpuHalt* b8PpuHaltAllocZPB(b8PpuCmd* cmd_, u32 otz_);
773
782typedef struct PACKED_ALIGNED4 _b8PpuEnable {
783 unsigned cul : 1;
784 unsigned na0 : 23;
785 unsigned code : 8;
787
796#define B8_PPU_CMD_ENABLE_CULLING_OF_POLYGONS (1<<0)
797
808
821extern b8PpuEnable* b8PpuEnableAllocZ(b8PpuCmd* cmd_, u32 otz_);
822
835extern b8PpuEnable* b8PpuEnableAllocZPB(b8PpuCmd* cmd_, u32 otz_);
836
846typedef struct PACKED_ALIGNED4 _b8PpuLoadimg {
847 unsigned na0 : 24;
848 unsigned code : 8;
850 const u8* cpuaddr;
852 unsigned na1 : 8;
853 unsigned srcwtile : 6;
854 unsigned na2 : 2;
855 unsigned srcytile : 6;
856 unsigned na3 : 2;
857 unsigned srcxtile : 6;
858 unsigned na4 : 2;
860 unsigned trnhtile : 6;
861 unsigned na5 : 2;
862 unsigned trnwtile : 6;
863 unsigned na6 : 2;
864 unsigned dstytile : 6;
865 unsigned na7 : 2;
866 unsigned dstxtile : 6;
867 unsigned na8 : 2;
869
880
893extern b8PpuLoadimg* b8PpuLoadimgAllocZ(b8PpuCmd* cmd_, u32 otz);
894
907extern b8PpuLoadimg* b8PpuLoadimgAllocZPB(b8PpuCmd* cmd_, u32 otz);
908
915typedef struct PACKED_ALIGNED4 _b8PpuJmp {
916 unsigned cpuaddr4 : 24;
917 unsigned code : 8;
919
927extern b8PpuJmp* b8PpuJmpAlloc(b8PpuCmd* cmd_, u32* cpuaddr_);
928
965extern void b8PpuClearOT(b8PpuCmd* cmd_, u32* ot_, u32* ot_prev_, u32 num_);
966
1022extern void b8PpuPushFrontOT(b8PpuCmd* cmd_, u32 otz_, void* prim_);
1023
1080extern void b8PpuPushBackOT(b8PpuCmd* cmd_, u32 otz_, void* prim_);
1081
1093extern void b8PpuExec( b8PpuCmd* cmd_ );
1094
1101extern void b8PpuEnableVblankInterrupt( void );
1102
1109extern void b8PpuVsyncWait( void );
1110
1119extern void b8PpuGetResolution( u32* ww, u32* hh );
1120
1127extern void b8PpuReset( void );
1128
1129#ifdef __cplusplus
1130}
1131#endif
b8PpuPoly * b8PpuPolyAlloc(b8PpuCmd *cmd_)
Allocates and initializes a polygon drawing command in the PPU command buffer.
Definition ppu.c:152
struct _b8PpuCmd b8PpuCmd
Structure representing a PPU command buffer for the BEEP-8 system.
b8PpuSetpal * b8PpuSetpalAlloc(b8PpuCmd *cmd_)
Allocates and initializes a SETPAL command in the PPU command buffer.
Definition ppu.c:62
void b8PpuCmdSetBuff(b8PpuCmd *cmd_, u32 *buff_, u32 bytesize_)
Sets the buffer for PPU commands.
Definition ppu.c:11
b8PpuLoadimg * b8PpuLoadimgAllocZ(b8PpuCmd *cmd_, u32 otz)
Allocates and initializes an image loading command in the PPU command buffer with a specified Z-order...
Definition ppu.c:302
b8PpuLoadimg * b8PpuLoadimgAlloc(b8PpuCmd *cmd_)
Allocates and initializes an image loading command in the PPU command buffer.
Definition ppu.c:294
void b8PpuPushFrontOT(b8PpuCmd *cmd_, u32 otz_, void *prim_)
Adds a primitive to the front of the Ordering Table (OT) at the specified Z-value.
Definition ppu.c:353
b8PpuLine * b8PpuLineAllocZPB(b8PpuCmd *cmd_, u32 otz_)
Allocates and initializes a line drawing command in the PPU command buffer with a specified Z-order,...
Definition ppu.c:186
b8PpuFlush * b8PpuFlushAllocZ(b8PpuCmd *cmd_, u32 otz_)
Allocates and initializes a flush command in the PPU command buffer with a specified Z-order.
Definition ppu.c:241
b8PpuPoly * b8PpuPolyAllocZ(b8PpuCmd *cmd_, u32 otz_)
Allocates and initializes a polygon drawing command in the PPU command buffer with a specified Z-orde...
Definition ppu.c:160
struct PACKED_ALIGNED4 _b8PpuLoadimg b8PpuLoadimg
Structure representing an image loading command for the PPU (Pixel Processing Unit).
b8PpuBg * b8PpuBgAllocZ(b8PpuCmd *cmd_, u32 otz_)
Allocates and initializes a background drawing command in the PPU command buffer with a specified Z-o...
Definition ppu.c:140
b8PpuSprite * b8PpuSpriteAllocZ(b8PpuCmd *cmd_, u32 otz_)
Allocates and initializes a sprite drawing command in the PPU command buffer with a specified Z-order...
Definition ppu.c:50
b8PpuHalt * b8PpuHaltAlloc(b8PpuCmd *cmd_)
Allocates and initializes a halt command in the PPU command buffer.
Definition ppu.c:253
b8PpuSprite * b8PpuSpriteAllocZPB(b8PpuCmd *cmd_, u32 otz_)
Allocates and initializes a sprite drawing command in the PPU command buffer with a specified Z-order...
Definition ppu.c:56
b8PpuHalt * b8PpuHaltAllocZ(b8PpuCmd *cmd_, u32 otz_)
Allocates and initializes a halt command in the PPU command buffer with a specified Z-order.
Definition ppu.c:261
b8PpuViewoffset * b8PpuViewoffsetAllocZPB(b8PpuCmd *cmd_, u32 otz_)
Allocates and initializes a view offset command in the PPU command buffer with a specified Z-order,...
Definition ppu.c:206
struct PACKED_ALIGNED4 _b8PpuSprite b8PpuSprite
Structure representing a sprite drawing command for the PPU (Pixel Processing Unit).
b8PpuViewoffset * b8PpuViewoffsetAllocZ(b8PpuCmd *cmd_, u32 otz_)
Allocates and initializes a view offset command in the PPU command buffer with a specified Z-order.
Definition ppu.c:200
struct PACKED_ALIGNED4 _b8PpuFlush b8PpuFlush
Structure representing a flush command for the PPU (Pixel Processing Unit).
void b8PpuEnableVblankInterrupt(void)
Enables the V-blank interrupt for the PPU.
Definition ppu.c:108
b8PpuLoadimg * b8PpuLoadimgAllocZPB(b8PpuCmd *cmd_, u32 otz)
Allocates and initializes an image loading command in the PPU command buffer with a specified Z-order...
Definition ppu.c:308
b8PpuJmp * b8PpuJmpAlloc(b8PpuCmd *cmd_, u32 *cpuaddr_)
Allocates and initializes a PPU jump command.
Definition ppu.c:314
b8PpuBg * b8PpuBgAlloc(b8PpuCmd *cmd_)
Allocates and initializes a background drawing command in the PPU command buffer.
Definition ppu.c:132
b8PpuScissor * b8PpuScissorAllocZPB(b8PpuCmd *cmd_, u32 otz_)
Allocates and initializes a scissor (clipping) command in the PPU command buffer with a specified Z-o...
Definition ppu.c:126
struct PACKED_ALIGNED4 _b8PpuBg b8PpuBg
Structure representing a background configuration command for the PPU (Pixel Processing Unit).
b8PpuEnable * b8PpuEnableAllocZ(b8PpuCmd *cmd_, u32 otz_)
Allocates and initializes an enable/disable command in the PPU command buffer with a specified Z-orde...
Definition ppu.c:282
struct PACKED_ALIGNED4 _b8PpuScissor b8PpuScissor
Structure representing a scissor (clipping) command for the PPU (Pixel Processing Unit).
b8PpuNop * b8PpuNopAllocZ(b8PpuCmd *cmd_, u32 otz_)
Allocates and initializes a no-operation (NOP) command in the PPU command buffer with a specified Z-o...
Definition ppu.c:220
struct PACKED_ALIGNED4 _b8PpuLine b8PpuLine
Structure representing a line drawing command for the PPU (Pixel Processing Unit).
b8PpuEnable * b8PpuEnableAlloc(b8PpuCmd *cmd_)
Allocates and initializes an enable/disable command in the PPU command buffer.
Definition ppu.c:273
void b8PpuExec(b8PpuCmd *cmd_)
Executes the PPU commands stored in the buffer.
Definition ppu.c:101
struct PACKED_ALIGNED4 _b8PpuRect b8PpuRect
Structure representing a rectangle drawing command for the PPU (Pixel Processing Unit).
b8PpuPoly * b8PpuPolyAllocZPB(b8PpuCmd *cmd_, u32 otz_)
Allocates and initializes a polygon drawing command in the PPU command buffer with a specified Z-orde...
Definition ppu.c:166
b8PpuRect * b8PpuRectAllocZ(b8PpuCmd *cmd_, u32 otz_)
Allocates and initializes a rectangle drawing command in the PPU command buffer with a specified Z-or...
Definition ppu.c:29
void b8PpuCmdPush(b8PpuCmd *cmd_, u32 word_)
Pushes a command word onto the PPU command buffer.
Definition ppu.c:16
b8PpuNop * b8PpuNopAllocZPB(b8PpuCmd *cmd_, u32 otz_)
Allocates and initializes a no-operation (NOP) command in the PPU command buffer with a specified Z-o...
Definition ppu.c:226
void b8PpuClearOT(b8PpuCmd *cmd_, u32 *ot_, u32 *ot_prev_, u32 num_)
Allocates and initializes an Ordering Table (OT) for the PPU commands.
Definition ppu.c:327
b8PpuNop * b8PpuNopAlloc(b8PpuCmd *cmd_)
Allocates and initializes a no-operation (NOP) command in the PPU command buffer.
Definition ppu.c:212
b8PpuSetpal * b8PpuSetpalAllocZPB(b8PpuCmd *cmd_, u32 otz, u8 flush)
Allocates and initializes a palette setting command in the PPU command buffer with a specified Z-orde...
Definition ppu.c:88
struct PACKED_ALIGNED4 _b8PpuViewoffset b8PpuViewoffset
Structure representing a view offset command for the PPU (Pixel Processing Unit).
b8PpuLine * b8PpuLineAllocZ(b8PpuCmd *cmd_, u32 otz_)
Allocates and initializes a line drawing command in the PPU command buffer with a specified Z-order.
Definition ppu.c:180
b8PpuSetpal * b8PpuSetpalAllocZ(b8PpuCmd *cmd_, u32 otz, u8 flush)
Allocates and initializes a palette setting command in the PPU command buffer with a specified Z-orde...
Definition ppu.c:76
struct PACKED_ALIGNED4 _b8PpuSetpal b8PpuSetpal
Structure representing a palette setting command for the PPU (Pixel Processing Unit).
b8PpuSprite * b8PpuSpriteAlloc(b8PpuCmd *cmd_)
Allocates and initializes a sprite drawing command in the PPU command buffer.
Definition ppu.c:41
void b8PpuPushBackOT(b8PpuCmd *cmd_, u32 otz_, void *prim_)
Adds a primitive to the end of the Ordering Table (OT) at the specified Z-value.
Definition ppu.c:367
b8PpuRect * b8PpuRectAlloc(b8PpuCmd *cmd_)
Allocates and initializes a rectangle drawing command in the PPU command buffer.
Definition ppu.c:21
void b8PpuVsyncWait(void)
Waits for the next V-blank interval.
Definition ppu.c:390
void b8PpuReset(void)
Resets the PPU system.
Definition ppu.c:385
struct PACKED_ALIGNED4 _b8PpuHalt b8PpuHalt
Structure representing a halt command for the PPU (Pixel Processing Unit).
struct PACKED_ALIGNED4 _b8PpuJmp b8PpuJmp
Structure representing a jump command for the PPU (Pixel Processing Unit).
b8PpuViewoffset * b8PpuViewoffsetAlloc(b8PpuCmd *cmd_)
Allocates and initializes a view offset command in the PPU command buffer.
Definition ppu.c:192
struct PACKED_ALIGNED4 _b8PpuPoly b8PpuPoly
Structure representing a polygon drawing command for the PPU (Pixel Processing Unit).
b8PpuScissor * b8PpuScissorAllocZ(b8PpuCmd *cmd_, u32 otz_)
Allocates and initializes a scissor (clipping) command in the PPU command buffer with a specified Z-o...
Definition ppu.c:120
b8PpuFlush * b8PpuFlushAlloc(b8PpuCmd *cmd_)
Allocates and initializes a flush command in the PPU command buffer.
Definition ppu.c:232
b8PpuBg * b8PpuBgAllocZPB(b8PpuCmd *cmd_, u32 otz_)
Allocates and initializes a background drawing command in the PPU command buffer with a specified Z-o...
Definition ppu.c:146
b8PpuHalt * b8PpuHaltAllocZPB(b8PpuCmd *cmd_, u32 otz_)
Allocates and initializes a halt command in the PPU command buffer with a specified Z-order,...
Definition ppu.c:267
struct PACKED_ALIGNED4 _b8PpuEnable b8PpuEnable
Structure representing an enable/disable command for the PPU (Pixel Processing Unit).
b8PpuScissor * b8PpuScissorAlloc(b8PpuCmd *cmd_)
Allocates and initializes a scissor (clipping) command in the PPU command buffer.
Definition ppu.c:112
b8PpuEnable * b8PpuEnableAllocZPB(b8PpuCmd *cmd_, u32 otz_)
Allocates and initializes an enable/disable command in the PPU command buffer with a specified Z-orde...
Definition ppu.c:288
b8PpuLine * b8PpuLineAlloc(b8PpuCmd *cmd_)
Allocates and initializes a line drawing command in the PPU command buffer.
Definition ppu.c:172
void b8PpuGetResolution(u32 *ww, u32 *hh)
Gets the current screen resolution.
Definition ppu.c:394
b8PpuRect * b8PpuRectAllocZPB(b8PpuCmd *cmd_, u32 otz_)
Allocates and initializes a rectangle drawing command in the PPU command buffer with a specified Z-or...
Definition ppu.c:35
struct PACKED_ALIGNED1 _b8PpuBgTile b8PpuBgTile
Structure representing a background tile for the PPU (Pixel Processing Unit).
Peripheral register map definitions for the BEEP-8 system.
Structure representing a background configuration command for the PPU (Pixel Processing Unit).
Definition ppu.h:384
unsigned htile
Definition ppu.h:385
signed upix
Definition ppu.h:394
unsigned wtile
Definition ppu.h:387
signed vpix
Definition ppu.h:393
unsigned na0
Definition ppu.h:386
unsigned na2
Definition ppu.h:398
unsigned code
Definition ppu.h:389
unsigned uwrap
Definition ppu.h:397
unsigned na1
Definition ppu.h:388
unsigned vwrap
Definition ppu.h:396
b8PpuBgTile * cpuaddr
Definition ppu.h:391
Structure representing a background tile for the PPU (Pixel Processing Unit).
Definition ppu.h:357
unsigned XTILE
Definition ppu.h:359
unsigned HFP
Definition ppu.h:361
unsigned YTILE
Definition ppu.h:358
unsigned VFP
Definition ppu.h:360
unsigned PAL
Definition ppu.h:362
Structure representing a PPU command buffer for the BEEP-8 system.
Definition ppu.h:120
u32 * sp
Definition ppu.h:123
u32 * tail
Definition ppu.h:124
u32 * ot
Definition ppu.h:126
u32 otnum
Definition ppu.h:128
u32 * buff
Definition ppu.h:121
u32 bytesize
Definition ppu.h:122
Structure representing an enable/disable command for the PPU (Pixel Processing Unit).
Definition ppu.h:782
unsigned na0
Definition ppu.h:784
unsigned cul
Definition ppu.h:783
unsigned code
Definition ppu.h:785
Structure representing a flush command for the PPU (Pixel Processing Unit).
Definition ppu.h:687
unsigned na0
Definition ppu.h:690
unsigned pal
Definition ppu.h:688
unsigned img
Definition ppu.h:689
unsigned code
Definition ppu.h:691
Structure representing a halt command for the PPU (Pixel Processing Unit).
Definition ppu.h:728
unsigned na0
Definition ppu.h:729
unsigned code
Definition ppu.h:730
Structure representing a jump command for the PPU (Pixel Processing Unit).
Definition ppu.h:915
unsigned cpuaddr4
Definition ppu.h:916
unsigned code
Definition ppu.h:917
Structure representing a line drawing command for the PPU (Pixel Processing Unit).
Definition ppu.h:487
signed y1
Definition ppu.h:496
unsigned code
Definition ppu.h:491
signed x1
Definition ppu.h:497
signed y0
Definition ppu.h:493
signed x0
Definition ppu.h:494
unsigned width
Definition ppu.h:489
unsigned na0
Definition ppu.h:490
unsigned pal
Definition ppu.h:488
Structure representing an image loading command for the PPU (Pixel Processing Unit).
Definition ppu.h:846
unsigned na7
Definition ppu.h:865
unsigned na1
Definition ppu.h:852
unsigned trnhtile
Definition ppu.h:860
unsigned na6
Definition ppu.h:863
unsigned na3
Definition ppu.h:856
unsigned srcwtile
Definition ppu.h:853
unsigned na5
Definition ppu.h:861
unsigned na8
Definition ppu.h:867
unsigned srcytile
Definition ppu.h:855
unsigned na4
Definition ppu.h:858
unsigned trnwtile
Definition ppu.h:862
unsigned code
Definition ppu.h:848
unsigned dstytile
Definition ppu.h:864
unsigned dstxtile
Definition ppu.h:866
unsigned srcxtile
Definition ppu.h:857
unsigned na2
Definition ppu.h:854
const u8 * cpuaddr
Definition ppu.h:850
unsigned na0
Definition ppu.h:847
Definition ppu.h:632
Structure representing a polygon drawing command for the PPU (Pixel Processing Unit).
Definition ppu.h:437
unsigned na0
Definition ppu.h:439
signed y1
Definition ppu.h:445
unsigned pal
Definition ppu.h:438
signed y2
Definition ppu.h:448
signed x1
Definition ppu.h:446
signed y0
Definition ppu.h:442
unsigned code
Definition ppu.h:440
signed x2
Definition ppu.h:449
signed x0
Definition ppu.h:443
Structure representing a rectangle drawing command for the PPU (Pixel Processing Unit).
Definition ppu.h:168
unsigned code
Definition ppu.h:171
unsigned na
Definition ppu.h:170
signed y
Definition ppu.h:173
signed x
Definition ppu.h:174
unsigned pal
Definition ppu.h:169
unsigned w
Definition ppu.h:177
unsigned h
Definition ppu.h:176
Structure representing a scissor (clipping) command for the PPU (Pixel Processing Unit).
Definition ppu.h:536
unsigned code
Definition ppu.h:538
signed w
Definition ppu.h:544
signed x
Definition ppu.h:541
signed y
Definition ppu.h:540
unsigned na0
Definition ppu.h:537
signed h
Definition ppu.h:543
Structure representing a palette setting command for the PPU (Pixel Processing Unit).
Definition ppu.h:275
unsigned pidx1
Definition ppu.h:282
unsigned pidx8
Definition ppu.h:290
unsigned wmask
Definition ppu.h:277
unsigned pidx6
Definition ppu.h:287
unsigned pidx0
Definition ppu.h:281
unsigned reserved
Definition ppu.h:278
unsigned pidx11
Definition ppu.h:293
unsigned pidx10
Definition ppu.h:292
unsigned pidx7
Definition ppu.h:288
unsigned pidx3
Definition ppu.h:284
unsigned pidx4
Definition ppu.h:285
unsigned pidx2
Definition ppu.h:283
unsigned pidx15
Definition ppu.h:297
unsigned palsel
Definition ppu.h:276
unsigned pidx9
Definition ppu.h:291
unsigned pidx12
Definition ppu.h:294
unsigned pidx5
Definition ppu.h:286
unsigned pidx14
Definition ppu.h:296
unsigned code
Definition ppu.h:279
unsigned pidx13
Definition ppu.h:295
Structure representing a sprite drawing command for the PPU (Pixel Processing Unit).
Definition ppu.h:216
unsigned vfp
Definition ppu.h:222
unsigned srcwtile
Definition ppu.h:225
unsigned srcxtile
Definition ppu.h:232
unsigned na2
Definition ppu.h:227
unsigned hfp
Definition ppu.h:226
unsigned na1
Definition ppu.h:223
unsigned code
Definition ppu.h:219
unsigned srcytile
Definition ppu.h:229
unsigned srchtile
Definition ppu.h:221
signed y
Definition ppu.h:235
unsigned pal
Definition ppu.h:217
unsigned na3
Definition ppu.h:230
unsigned na4
Definition ppu.h:233
unsigned na0
Definition ppu.h:218
signed x
Definition ppu.h:236
Structure representing a view offset command for the PPU (Pixel Processing Unit).
Definition ppu.h:588
signed y
Definition ppu.h:592
unsigned na0
Definition ppu.h:589
unsigned code
Definition ppu.h:590
signed x
Definition ppu.h:593