Add function for loading from I/O

This commit is contained in:
Jeffrey Pfau 2013-04-14 23:30:11 -07:00
parent ecc4775c31
commit fe5a8d6254
3 changed files with 13 additions and 3 deletions

View File

@ -3,7 +3,16 @@
void GBAIOWrite(struct GBA* gba, uint32_t address, uint16_t value) {
switch (address) {
default:
GBALog(GBA_LOG_STUB, "Stub I/O register: %03x", address);
GBALog(GBA_LOG_STUB, "Stub I/O register write: %03x", address);
break;
}
}
uint16_t GBAIORead(struct GBA* gba, uint32_t address) {
switch (address) {
default:
GBALog(GBA_LOG_STUB, "Stub I/O register read: %03x", address);
break;
}
return 0;
}

View File

@ -142,5 +142,6 @@ enum GBAIORegisters {
};
void GBAIOWrite(struct GBA* gba, uint32_t address, uint16_t value);
uint16_t GBAIORead(struct GBA* gba, uint32_t address);
#endif

View File

@ -137,7 +137,7 @@ int16_t GBALoad16(struct ARMMemory* memory, uint32_t address) {
case BASE_WORKING_IRAM:
return ((int16_t*) gbaMemory->iwram)[(address & (SIZE_WORKING_IRAM - 1)) >> 1];
case BASE_IO:
break;
return GBAIORead(gbaMemory->p, address & (SIZE_IO - 1));
case BASE_PALETTE_RAM:
break;
case BASE_VRAM:
@ -171,7 +171,7 @@ uint16_t GBALoadU16(struct ARMMemory* memory, uint32_t address) {
case BASE_WORKING_IRAM:
return ((uint16_t*) gbaMemory->iwram)[(address & (SIZE_WORKING_IRAM - 1)) >> 1];
case BASE_IO:
break;
return GBAIORead(gbaMemory->p, address & (SIZE_IO - 1));
case BASE_PALETTE_RAM:
break;
case BASE_VRAM: