GBA Thread: Automatically load patches, if detected
Jeffrey Pfau jeffrey@endrift.com
Tue, 04 Aug 2015 19:35:14 -0700
2 files changed,
11 insertions(+),
0 deletions(-)
M
CHANGES
→
CHANGES
@@ -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.c
→
src/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);