GBA Memory: Implement 16- and 32-bit loads from SRAM

This commit is contained in:
Jeffrey Pfau 2014-12-23 02:59:26 -08:00
parent 65bb4b4996
commit c942758af0
2 changed files with 8 additions and 4 deletions

View File

@ -32,6 +32,7 @@ Misc:
- GBA Audio: Change internal audio sample buffer from 32-bit to 16-bit samples
- Qt: Set default log level to FATAL, ERROR and WARN
- Qt: Clarify some phrasing in the menus
- GBA Memory: Implement 16- and 32-bit loads from SRAM
0.1.0: (2014-12-13)
- Initial release

View File

@ -222,8 +222,10 @@ static void GBASetActiveRegion(struct ARMCore* cpu, uint32_t address) {
}
#define LOAD_SRAM \
GBALog(gba, GBA_LOG_STUB, "Unimplemented memory Load32: 0x%08X", address); \
value = 0xFFFFFFFF;
wait = memory->waitstatesNonseq16[address >> BASE_OFFSET]; \
value = GBALoad8(cpu, address, 0); \
value |= value << 8; \
value |= value << 16;
int32_t GBALoad32(struct ARMCore* cpu, uint32_t address, int* cycleCounter) {
struct GBA* gba = (struct GBA*) cpu->master;
@ -352,8 +354,9 @@ int16_t GBALoad16(struct ARMCore* cpu, uint32_t address, int* cycleCounter) {
break;
case REGION_CART_SRAM:
case REGION_CART_SRAM_MIRROR:
GBALog(gba, GBA_LOG_STUB, "Unimplemented memory Load16: 0x%08X", address);
value = 0xFFFF;
wait = memory->waitstatesNonseq16[address >> BASE_OFFSET];
value = GBALoad8(cpu, address, 0);
value |= value << 8;
break;
default:
GBALog(gba, GBA_LOG_GAME_ERROR, "Bad memory Load16: 0x%08X", address);