Remove special treatment for DISPSTAT

This commit is contained in:
Jeffrey Pfau 2014-03-29 22:53:52 -07:00
parent 8e51ffbf2c
commit 683e90fa06
3 changed files with 3 additions and 9 deletions

View File

@ -355,10 +355,6 @@ void GBAIOWrite32(struct GBA* gba, uint32_t address, uint32_t value) {
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 @@ uint16_t GBAIORead(struct GBA* gba, uint32_t address) {
// Write-only register
return 0;
case REG_DISPCNT:
case REG_DISPSTAT:
case REG_VCOUNT:
case REG_BG0CNT:
case REG_BG1CNT:

View File

@ -134,6 +134,8 @@ int32_t GBAVideoProcessEvents(struct GBAVideo* video, int32_t cycles) {
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;
}
@ -154,10 +156,6 @@ void GBAVideoWriteDISPSTAT(struct GBAVideo* video, uint16_t value) {
}
}
uint16_t GBAVideoReadDISPSTAT(struct GBAVideo* video) {
return (video->inVblank) | (video->inHblank << 1) | (video->vcounter << 2);
}
static void GBAVideoDummyRendererInit(struct GBAVideoRenderer* renderer) {
(void)(renderer);
// Nothing to do

View File

@ -218,7 +218,6 @@ void GBAVideoAssociateRenderer(struct GBAVideo* video, struct GBAVideoRenderer*
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);