Skip to content

Commit

Permalink
Fixed cheats that conflicted with LayeredFS
Browse files Browse the repository at this point in the history
Updated EXP Multiplier, Camera Zoom and Pokémon Spawner codes to comply
with LayeredFS support.
  • Loading branch information
AnalogMan151 committed May 21, 2017
1 parent 469fc3d commit 19cb7e2
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 42 deletions.
4 changes: 2 additions & 2 deletions Sources/exp_multipliers.c
Original file line number Diff line number Diff line change
Expand Up @@ -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[] =
Expand Down
21 changes: 2 additions & 19 deletions Sources/illegal_cheats.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down
5 changes: 4 additions & 1 deletion Sources/menu.c
Original file line number Diff line number Diff line change
@@ -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];

Expand Down
4 changes: 2 additions & 2 deletions Sources/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = {
Expand Down
16 changes: 0 additions & 16 deletions Sources/movement_modifiers.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions Sources/pokemon_spawner.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 19cb7e2

Please sign in to comment.