From 19cb7e268f74c630612fe462c9bb57b6c717e8fe Mon Sep 17 00:00:00 2001 From: AnalogMan151 Date: Sun, 21 May 2017 12:46:19 -0400 Subject: [PATCH] Fixed cheats that conflicted with LayeredFS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updated EXP Multiplier, Camera Zoom and Pokémon Spawner codes to comply with LayeredFS support. --- Sources/exp_multipliers.c | 4 ++-- Sources/illegal_cheats.c | 21 ++------------------- Sources/menu.c | 5 ++++- Sources/misc.c | 4 ++-- Sources/movement_modifiers.c | 16 ---------------- Sources/pokemon_spawner.c | 4 ++-- 6 files changed, 12 insertions(+), 42 deletions(-) diff --git a/Sources/exp_multipliers.c b/Sources/exp_multipliers.c index f83b7cd..cd71d28 100644 --- a/Sources/exp_multipliers.c +++ b/Sources/exp_multipliers.c @@ -31,14 +31,14 @@ void updateEXP(void) { { {0x00595800, 0x0048F1EC}, {0x00597700, 0x00490E4C}, - {0x00597700, 0x00490E74} + {0x0059782C, 0x00490E74} }; u32 data[] = { 0xEB041983, 0xEB041A2B, - 0xEB041A21 + 0xEB041A6C }; static const u8 buffer[] = diff --git a/Sources/illegal_cheats.c b/Sources/illegal_cheats.c index 013ba2d..ca0eff5 100644 --- a/Sources/illegal_cheats.c +++ b/Sources/illegal_cheats.c @@ -9,25 +9,8 @@ * * ********************************/ -u32 o_catchtrial[2] = {0x080B8440, 0x0807638C}, - o_catchtrainers = 0x08035000, - o_learnanyTM = 0x0048F0AC, - o_relearnanymove = 0x0042DCD4; - void illegalMenu(void) { - switch(gameVer) { - case 10: - break; - case 11: - o_catchtrial[0] += 0x04BC; - o_catchtrial[1] += 0x01A4; - o_catchtrainers -= 0x01D0; - o_learnanyTM += 0x1C60; - o_relearnanymove += 0x19C4; - break; - } - new_entry("Catch Trial Pokemon", catchTrial); new_entry("Catch Trainer's Pokemon", catchTrainers); new_entry_arg("Pokemon can learn any TM", learnAnyTM, 0, LEARNANYTM, TOGGLE); @@ -44,7 +27,7 @@ void catchTrial(void) { {0x080B8914, 0x08076530} }; - if (!checkAddress(o_catchtrial[0])) + if (!checkAddress(offset[gameVer][0])) return; if (READU32(offset[gameVer][0]) == 0xE1A01004) { WRITEU32(offset[gameVer][1], 0xE3A00001); @@ -63,7 +46,7 @@ void catchTrainers(void) { 0x08034E30 }; - if (!checkAddress(o_catchtrainers + 0xC84)) + if (!checkAddress(offset[gameVer] + 0xC84)) return; if (READU32(offset[gameVer] + 0xC84) == 0x0A00000B) { WRITEU32(offset[gameVer] + 0xC78, 0xE3A0B000); diff --git a/Sources/menu.c b/Sources/menu.c index 2d8c2e9..e92803b 100644 --- a/Sources/menu.c +++ b/Sources/menu.c @@ -1,7 +1,10 @@ #include "cheats.h" +// Note: Luma3DS LayeredFS writes code up to 0x005977B8. Do not use addresses +// prior to this when storing ASM code for cheats + char *builder_name = "AnalogMan", - version[7] = "v0.6.1", + version[7] = "v0.6.2", updateVer[12] = "Update v?.?", formattedVer[35]; diff --git a/Sources/misc.c b/Sources/misc.c index c0b549b..e49333f 100644 --- a/Sources/misc.c +++ b/Sources/misc.c @@ -88,14 +88,14 @@ void cameraZoom(void) { { {0x00595824, 0x0803797C}, {0x00597724, 0x08037B18}, - {0x00597724, 0x08037B18}, + {0x00597840, 0x08037B18}, }; u32 data[] = { 0xEBFAEBA8, 0xEBFAEB01, - 0xEBFAEB01 + 0xEBFAEB48 }; static const u8 buffer[] = { diff --git a/Sources/movement_modifiers.c b/Sources/movement_modifiers.c index 65efdd8..aef89a7 100644 --- a/Sources/movement_modifiers.c +++ b/Sources/movement_modifiers.c @@ -9,25 +9,9 @@ * * ********************************/ - - -u32 o_runfaster = 0x0039AF74, - o_nevertrip = 0x3419833E, - o_walkthruwalls = 0x0039D140; - - // Movement menu entry void movementMenu(void) { - switch(gameVer) { - case 10: - break; - case 11: ; - o_runfaster += 0x1420; - o_walkthruwalls += 0x1420; - break; - } - new_spoiler("Movement"); new_entry("Run Faster", runFaster); new_entry("Never Trip", neverTrip); diff --git a/Sources/pokemon_spawner.c b/Sources/pokemon_spawner.c index 42ed3ed..77c26cd 100644 --- a/Sources/pokemon_spawner.c +++ b/Sources/pokemon_spawner.c @@ -82,13 +82,13 @@ void generateSpawn(void) { { {0x005957E0, 0x003988DC}, {0x005976E0, 0x00399CB4}, - {0x005976E0, 0x00399CB4} + {0x0059785C, 0x00399CB4} }; u32 data[][3] = { {0xEB07F3BF, 0xEB07F3BB, 0xEB07F3B4}, {0xEB07F689, 0xEB07F685, 0xEB07F67E}, - {0xEB07F689, 0xEB07F685, 0xEB07F67E} + {0xEB07F6E8, 0xEB07F6E4, 0xEB07F6DD} }; if (spawnIsOn)