u8 GBVideo::read_VRAM (int addr) const
{
+ return VRAM[addr-VRAM_BASE];
}
u8 GBVideo::read_OAM (int addr) const
{
+ return OAM[addr-OAM_BASE];
}
void GBVideo::write_VRAM(int addr, u8 value)
{
+ VRAM[addr-VRAM_BASE] = value;
}
void GBVideo::write_OAM (int addr, u8 value)
{
+ OAM[addr-OAM_BASE] = value;
}
GameBoy *core;
u8 VRAM[8192];
- u8 OAM[];
+ u8 OAM[160];
public:
+ static const u16 VRAM_BASE = 0x8000;
+ static const u16 OAM_BASE = 0xFE00;
+
+
GBVideo(GameBoy *core):core(core) {}
u8 read_VRAM (int addr) const;