summaryrefslogtreecommitdiff
path: root/ppu.h
diff options
context:
space:
mode:
authorvin <git@vineetk.net>2024-09-01 19:44:40 -0400
committervin <git@vineetk.net>2024-09-01 19:44:40 -0400
commite14776a4739f525ac2c5531fca94142454683563 (patch)
tree8481e175e6308170006c79068dea7ad604fd3d42 /ppu.h
parent2084552c536a8299a3578c8b9b687cff98e6d9a3 (diff)
add basic implementation of ppu write registersHEADmaster
Diffstat (limited to 'ppu.h')
-rw-r--r--ppu.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/ppu.h b/ppu.h
index c5483e1..d7cd93c 100644
--- a/ppu.h
+++ b/ppu.h
@@ -17,11 +17,11 @@ struct ppu {
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;
+ uint16_t v : 15; /* current vram address */
+ uint16_t t : 15; /* temporary vram address */
+ uint16_t scroll_x : 9; /* x scroll position */
+ uint16_t scroll_y : 9; /* y scroll position */
+ uint8_t write_toggle : 1; /* first/second write toggle */
} regs;
struct ppu_ctrl { /* $2000 */
@@ -31,7 +31,7 @@ struct ppu {
uint8_t bg_tile_sel : 1;
uint8_t sprite_tile_sel : 1;
uint8_t inc_mode : 1;
- uint8_t nametable_sel : 2;
+ uint8_t nametable_base : 2;
} ctrl;
struct ppu_mask { /* $2001 */
uint8_t colour_emphasis : 3;