summaryrefslogtreecommitdiff
path: root/ppu.h
diff options
context:
space:
mode:
Diffstat (limited to 'ppu.h')
-rw-r--r--ppu.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/ppu.h b/ppu.h
index ffd66d7..c5483e1 100644
--- a/ppu.h
+++ b/ppu.h
@@ -7,12 +7,23 @@
7#include "rom.h" 7#include "rom.h"
8 8
9struct ppu { 9struct ppu {
10 uint8_t oam[64*4];
11 uint8_t vram[2048]; 10 uint8_t vram[2048];
11 uint8_t oam[64*4];
12 uint8_t oam_addr; /* $2003 */
12 uint8_t palette[16*2]; 13 uint8_t palette[16*2];
13 uint16_t cycles, scanlines; 14 uint16_t cycles, scanlines;
14 struct rom *rom; 15 struct rom *rom;
15 16
17 uint8_t last_read;
18
19 struct ppu_regs {
20 uint16_t v : 15; /* current vram address */
21 uint16_t t : 15; /* temporary vram address */
22 uint8_t x : 3; /* fine x scroll */
23 uint8_t w : 1; /* first/second write toggle */
24 uint8_t padding : 6;
25 } regs;
26
16 struct ppu_ctrl { /* $2000 */ 27 struct ppu_ctrl { /* $2000 */
17 uint8_t nmi_enable : 1; 28 uint8_t nmi_enable : 1;
18 uint8_t master_slave : 1; 29 uint8_t master_slave : 1;
@@ -36,8 +47,6 @@ struct ppu {
36 uint8_t sprite_overflow : 1; 47 uint8_t sprite_overflow : 1;
37 uint8_t pad : 5; 48 uint8_t pad : 5;
38 } status; 49 } status;
39 uint8_t oam_addr; /* $2003 */
40 uint8_t oam_data; /* $2004 */
41}; 50};
42extern struct ppu ppu; 51extern struct ppu ppu;
43 52