From 06a9d786c26a4305820ddaf709477cf5dff18f6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ed=C3=AAnis=20Freindorfer=20Azevedo?= Date: Tue, 20 Aug 2019 20:58:18 -0300 Subject: [PATCH] Allow UPS patch for GBA games. From my very superficial understanding, the `rom[]` resize happens only when `rom_size` is greater than 0x2000000. We should probably study this better for an actual explanation. - Fix #487. --- src/wx/panel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wx/panel.cpp b/src/wx/panel.cpp index b74d348a..2695ec6e 100644 --- a/src/wx/panel.cpp +++ b/src/wx/panel.cpp @@ -216,7 +216,7 @@ void GameArea::LoadGame(const wxString& name) if (loadpatch) { // don't use real rom size or it might try to resize rom[] // instead, use known size of rom[] - int size = 0x2000000; + int size = 0x2000000 < rom_size ? 0x2000000 : rom_size; applyPatch(pfn.GetFullPath().mb_str(), &rom, &size); // that means we no longer really know rom_size either }