forked from AnalogMan151/sumoCheatMenu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
illegal_cheats.c
85 lines (74 loc) · 2.37 KB
/
illegal_cheats.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// Filename: illegal_cheats.c
#include "cheats.h"
#include "hid.h"
#include "hook.h"
/********************************
* *
* Illegal Cheats *
* *
********************************/
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);
new_entry_arg("Learn all from Move Reminder", relearnAnyMove, 0, RELEARNANYMOVE, TOGGLE);
}
// Catch Pokémon during Trial
void catchTrial(void) {
if (!checkAddress(o_catchtrial[0]))
return;
if (READU32(o_catchtrial[0]) == 0xE1A01004) {
WRITEU32(o_catchtrial[1], 0xE3A00001);
WRITEU32(o_catchtrial[0], 0xE3A01000);
}
}
// Catch Trainer's Pokémon
void catchTrainers(void) {
if (!checkAddress(o_catchtrainers + 0xC84))
return;
if (READU32(o_catchtrainers + 0xC84) == 0x0A00000B) {
WRITEU32(o_catchtrainers + 0xC78, 0xE3A0B000);
WRITEU32(o_catchtrainers + 0xC7C, 0xE590000C);
WRITEU32(o_catchtrainers + 0xC80, 0xE5C0B000);
WRITEU32(o_catchtrainers + 0xC84, 0xEA00000B);
}
}
void learnAnyTM(u32 state) {
if (state) {
WRITEU32(o_learnanyTM, 0xE3A00001);
} else {
// Deactivate code
}
}
void relearnAnyMove(u32 state) {
if (state) {
WRITEU32(o_relearnanymove + 0x00000, 0xE3A01C02);
WRITEU32(o_relearnanymove + 0x00004, 0xE28110CF);
WRITEU32(o_relearnanymove + 0x00008, 0xE5851004);
switch(gameVer) {
case 10:
WRITEU32(o_relearnanymove + 0x78E5C, 0xE2850001);
break;
case 11:
WRITEU32(o_relearnanymove + 0x79238, 0xE2850001);
break;
}
} else {
// Deactivate code
}
}