all repos — mgba @ c942758af0bcae60e934ddc9ef6d62959dff7683

mGBA Game Boy Advance Emulator

GBA Memory: Implement 16- and 32-bit loads from SRAM
Jeffrey Pfau jeffrey@endrift.com
Tue, 23 Dec 2014 02:59:26 -0800
commit

c942758af0bcae60e934ddc9ef6d62959dff7683

parent

65bb4b4996d2daf47550e213e76080552ce909f6

2 files changed, 8 insertions(+), 4 deletions(-)

jump to
M CHANGESCHANGES

@@ -32,6 +32,7 @@ - Qt: Handle a game crash without crashing

- 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
M src/gba/gba-memory.csrc/gba/gba-memory.c

@@ -222,8 +222,10 @@ value |= value << 16; \

} #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 @@ }

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);