all repos — mgba @ 683e90fa06abf5168d65c049e51216cf325ef3fc

mGBA Game Boy Advance Emulator

Remove special treatment for DISPSTAT
Jeffrey Pfau jeffrey@endrift.com
Sat, 29 Mar 2014 22:53:52 -0700
commit

683e90fa06abf5168d65c049e51216cf325ef3fc

parent

8e51ffbf2cd114f17a4c370d45862c3873a8aebe

3 files changed, 3 insertions(+), 9 deletions(-)

jump to
M src/gba/gba-io.csrc/gba/gba-io.c

@@ -355,10 +355,6 @@ }

uint16_t GBAIORead(struct GBA* gba, uint32_t address) { switch (address) { - case REG_DISPSTAT: - return gba->memory.io[REG_DISPSTAT >> 1] | GBAVideoReadDISPSTAT(&gba->video); - break; - case REG_TM0CNT_LO: GBATimerUpdateRegister(gba, 0); break;

@@ -390,6 +386,7 @@ case REG_DMA3CNT_LO:

// Write-only register return 0; case REG_DISPCNT: + case REG_DISPSTAT: case REG_VCOUNT: case REG_BG0CNT: case REG_BG1CNT:
M src/gba/gba-video.csrc/gba/gba-video.c

@@ -134,6 +134,8 @@ }

video->eventDiff = 0; } + video->p->memory.io[REG_DISPSTAT >> 1] &= 0xFFF8; + video->p->memory.io[REG_DISPSTAT >> 1] |= (video->inVblank) | (video->inHblank << 1) | (video->vcounter << 2); return video->nextEvent; }

@@ -152,10 +154,6 @@ if (video->nextVcounterIRQ < video->nextEvent) {

video->nextVcounterIRQ += VIDEO_TOTAL_LENGTH; } } -} - -uint16_t GBAVideoReadDISPSTAT(struct GBAVideo* video) { - return (video->inVblank) | (video->inHblank << 1) | (video->vcounter << 2); } static void GBAVideoDummyRendererInit(struct GBAVideoRenderer* renderer) {
M src/gba/gba-video.hsrc/gba/gba-video.h

@@ -218,7 +218,6 @@ void GBAVideoAssociateRenderer(struct GBAVideo* video, struct GBAVideoRenderer* renderer);

int32_t GBAVideoProcessEvents(struct GBAVideo* video, int32_t cycles); void GBAVideoWriteDISPSTAT(struct GBAVideo* video, uint16_t value); -uint16_t GBAVideoReadDISPSTAT(struct GBAVideo* video); struct GBASerializedState; void GBAVideoSerialize(struct GBAVideo* video, struct GBASerializedState* state);