all repos — mgba @ 071fe7ff2dc0a7cc396408f6558b4ad2d430a909

mGBA Game Boy Advance Emulator

GBA Thread: Automatically load patches, if detected
Jeffrey Pfau jeffrey@endrift.com
Tue, 04 Aug 2015 19:35:14 -0700
commit

071fe7ff2dc0a7cc396408f6558b4ad2d430a909

parent

6dda6cc8414103fd7bd901e588e55a892d669ad5

2 files changed, 11 insertions(+), 0 deletions(-)

jump to
M CHANGESCHANGES

@@ -29,6 +29,7 @@ - Controller profiles now store shortcut settings

- Default controller profiles for several common controllers - Libretro now supports BIOS, rumble and solar sensor - Implement BIOS call Stop, for sleep mode + - Automatically load patches, if found Bugfixes: - ARM7: Fix SWI and IRQ timings - GBA Audio: Force audio FIFOs to 32-bit
M src/gba/supervisor/thread.csrc/gba/supervisor/thread.c

@@ -419,6 +419,16 @@ }

threadContext->save = VDirOptionalOpenFile(threadContext->stateDir, threadContext->fname, "sram", ".sav", O_CREAT | O_RDWR); + if (!threadContext->patch) { + threadContext->patch = VDirOptionalOpenFile(threadContext->stateDir, threadContext->fname, "patch", ".ups", O_RDONLY); + } + if (!threadContext->patch) { + threadContext->patch = VDirOptionalOpenFile(threadContext->stateDir, threadContext->fname, "patch", ".ips", O_RDONLY); + } + if (!threadContext->patch) { + threadContext->patch = VDirOptionalOpenFile(threadContext->stateDir, threadContext->fname, "patch", ".bps", O_RDONLY); + } + MutexInit(&threadContext->stateMutex); ConditionInit(&threadContext->stateCond);