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 @@
#include "rom.h"
struct ppu {
- uint8_t oam[64*4];
uint8_t vram[2048];
+ uint8_t oam[64*4];
+ uint8_t oam_addr; /* $2003 */
uint8_t palette[16*2];
uint16_t cycles, scanlines;
struct rom *rom;
+ uint8_t last_read;
+
+ struct ppu_regs {
+ uint16_t v : 15; /* current vram address */
+ uint16_t t : 15; /* temporary vram address */
+ uint8_t x : 3; /* fine x scroll */
+ uint8_t w : 1; /* first/second write toggle */
+ uint8_t padding : 6;
+ } regs;
+
struct ppu_ctrl { /* $2000 */
uint8_t nmi_enable : 1;
uint8_t master_slave : 1;
@@ -36,8 +47,6 @@ struct ppu {
uint8_t sprite_overflow : 1;
uint8_t pad : 5;
} status;
- uint8_t oam_addr; /* $2003 */
- uint8_t oam_data; /* $2004 */
};
extern struct ppu ppu;