Labels for I/O regions in the switch statement

This commit is contained in:
Jeffrey Pfau 2013-04-19 23:04:01 -07:00
parent 5d81a4eb18
commit f72c195739
1 changed files with 5 additions and 0 deletions

View File

@ -8,9 +8,12 @@ void GBAIOInit(struct GBA* gba) {
void GBAIOWrite(struct GBA* gba, uint32_t address, uint16_t value) {
switch (address) {
// Video
case REG_DISPSTAT:
GBAVideoWriteDISPSTAT(&gba->video, value);
break;
// DMA
case REG_DMA0CNT_LO:
GBAMemoryWriteDMACNT_LO(&gba->memory, 0, value);
break;
@ -36,6 +39,7 @@ void GBAIOWrite(struct GBA* gba, uint32_t address, uint16_t value) {
value = GBAMemoryWriteDMACNT_HI(&gba->memory, 3, value);
break;
// Timers
case REG_TM0CNT_LO:
GBATimerWriteTMCNT_LO(gba, 0, value);
return;
@ -66,6 +70,7 @@ void GBAIOWrite(struct GBA* gba, uint32_t address, uint16_t value) {
GBATimerWriteTMCNT_HI(gba, 3, value);
break;
// Interrupts and misc
case REG_WAITCNT:
GBAAdjustWaitstates(&gba->memory, value);
break;