From e14776a4739f525ac2c5531fca94142454683563 Mon Sep 17 00:00:00 2001 From: vin Date: Sun, 1 Sep 2024 19:44:40 -0400 Subject: add basic implementation of ppu write registers --- ppu.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'ppu.h') 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; -- cgit v1.2.3