2011-01-18 10:17:48 +00:00
|
|
|
public:
|
2015-12-06 21:11:41 +00:00
|
|
|
auto mmio_read(uint addr) -> uint8;
|
|
|
|
auto mmio_write(uint addr, uint8 data) -> void;
|
2011-01-18 10:17:48 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
2010-09-01 13:18:10 +00:00
|
|
|
struct Regs {
|
|
|
|
//internal
|
|
|
|
uint8 ppu1_mdr;
|
|
|
|
uint8 ppu2_mdr;
|
|
|
|
|
|
|
|
uint16 vram_readbuffer;
|
|
|
|
uint8 oam_latchdata;
|
|
|
|
uint8 cgram_latchdata;
|
2010-09-01 13:20:05 +00:00
|
|
|
uint8 bgofs_latchdata;
|
2010-09-01 13:18:10 +00:00
|
|
|
uint8 mode7_latchdata;
|
|
|
|
|
2010-09-01 13:20:05 +00:00
|
|
|
bool counters_latched;
|
|
|
|
bool latch_hcounter;
|
|
|
|
bool latch_vcounter;
|
|
|
|
|
2010-09-01 13:18:10 +00:00
|
|
|
//$2100
|
|
|
|
bool display_disable;
|
2015-12-06 21:11:41 +00:00
|
|
|
uint display_brightness;
|
2010-09-01 13:18:10 +00:00
|
|
|
|
|
|
|
//$2102-$2103
|
|
|
|
uint16 oam_baseaddr;
|
|
|
|
uint16 oam_addr;
|
|
|
|
bool oam_priority;
|
|
|
|
|
2010-09-01 13:20:05 +00:00
|
|
|
//$2105
|
|
|
|
bool bg3_priority;
|
2015-12-06 21:11:41 +00:00
|
|
|
uint bgmode;
|
2010-09-01 13:20:05 +00:00
|
|
|
|
|
|
|
//$210d
|
|
|
|
uint16 mode7_hoffset;
|
|
|
|
|
|
|
|
//$210e
|
|
|
|
uint16 mode7_voffset;
|
|
|
|
|
2010-09-01 13:18:10 +00:00
|
|
|
//$2115
|
|
|
|
bool vram_incmode;
|
2015-12-06 21:11:41 +00:00
|
|
|
uint vram_mapping;
|
|
|
|
uint vram_incsize;
|
2010-09-01 13:18:10 +00:00
|
|
|
|
|
|
|
//$2116-$2117
|
|
|
|
uint16 vram_addr;
|
|
|
|
|
|
|
|
//$211a
|
2015-12-06 21:11:41 +00:00
|
|
|
uint mode7_repeat;
|
2010-09-01 13:18:10 +00:00
|
|
|
bool mode7_vflip;
|
|
|
|
bool mode7_hflip;
|
|
|
|
|
|
|
|
//$211b-$2120
|
|
|
|
uint16 m7a;
|
|
|
|
uint16 m7b;
|
|
|
|
uint16 m7c;
|
|
|
|
uint16 m7d;
|
|
|
|
uint16 m7x;
|
|
|
|
uint16 m7y;
|
|
|
|
|
|
|
|
//$2121
|
|
|
|
uint16 cgram_addr;
|
2010-09-01 13:20:05 +00:00
|
|
|
|
2010-09-01 13:22:05 +00:00
|
|
|
//$2126-$212a
|
2015-12-06 21:11:41 +00:00
|
|
|
uint window_one_left;
|
|
|
|
uint window_one_right;
|
|
|
|
uint window_two_left;
|
|
|
|
uint window_two_right;
|
2010-09-01 13:22:05 +00:00
|
|
|
|
2010-09-01 13:20:05 +00:00
|
|
|
//$2133
|
|
|
|
bool mode7_extbg;
|
|
|
|
bool pseudo_hires;
|
|
|
|
bool overscan;
|
|
|
|
bool interlace;
|
|
|
|
|
|
|
|
//$213c
|
|
|
|
uint16 hcounter;
|
|
|
|
|
|
|
|
//$213d
|
|
|
|
uint16 vcounter;
|
2010-09-01 13:18:10 +00:00
|
|
|
} regs;
|
|
|
|
|
2015-12-06 21:11:41 +00:00
|
|
|
auto get_vram_addr() -> uint16;
|
|
|
|
auto vram_read(uint addr) -> uint8;
|
|
|
|
auto vram_write(uint addr, uint8 data) -> void;
|
2010-09-01 13:18:10 +00:00
|
|
|
|
2015-12-06 21:11:41 +00:00
|
|
|
auto oam_read(uint addr) -> uint8;
|
|
|
|
auto oam_write(uint addr, uint8 data) -> void;
|
2010-09-01 13:18:10 +00:00
|
|
|
|
2015-12-06 21:11:41 +00:00
|
|
|
auto cgram_read(uint addr) -> uint8;
|
|
|
|
auto cgram_write(uint addr, uint8 data) -> void;
|
2010-09-01 13:18:10 +00:00
|
|
|
|
2015-12-06 21:11:41 +00:00
|
|
|
auto mmio_update_video_mode() -> void;
|
|
|
|
auto mmio_reset() -> void;
|