Pass off video registers to renderer

This commit is contained in:
Jeffrey Pfau 2013-04-21 12:39:33 -07:00
parent 573fcead5d
commit cdddcbf7aa
2 changed files with 90 additions and 82 deletions

View File

@ -7,6 +7,9 @@ void GBAIOInit(struct GBA* gba) {
}
void GBAIOWrite(struct GBA* gba, uint32_t address, uint16_t value) {
if (address < REG_SOUND1CNT_LO && address != REG_DISPSTAT) {
gba->video.renderer->writeVideoRegister(gba->video.renderer, address, value);
} else {
switch (address) {
// Video
case REG_DISPSTAT:
@ -95,6 +98,7 @@ void GBAIOWrite(struct GBA* gba, uint32_t address, uint16_t value) {
GBALog(GBA_LOG_STUB, "Stub I/O register write: %03x", address);
break;
}
}
gba->memory.io[address >> 1] = value;
}

View File

@ -36,6 +36,10 @@ static void GBAVideoSoftwareRendererDeinit(struct GBAVideoRenderer* renderer) {
static uint16_t GBAVideoSoftwareRendererWriteVideoRegister(struct GBAVideoRenderer* renderer, uint32_t address, uint16_t value) {
struct GBAVideoSoftwareRenderer* softwareRenderer = (struct GBAVideoSoftwareRenderer*) renderer;
switch (address) {
default:
GBALog(GBA_LOG_STUB, "Stub video register write: %03x", address);
}
return value;
}