24
"Base Address Lookup"
Auto Assembler Script
// Uncomment the version you're targeting
// GMSE01 (NTSC-U)
// define(INPUT_OFFSET,404454)
// define(COIN_COUNT_OFFSET,578A60)
// define(LIFE_COUNT_OFFSET,578A04)
// define(POS_PTR_OFFSET, 40E10C)
// GMSJ01 (NTSC-J 1.0)
// define(INPUT_OFFSET, 400D50)
// define(LIFE_COUNT_OFFSET, 575224)
// define(COIN_COUNT_OFFSET, 575280)
// define(POS_PTR_OFFSET, 40A39C)
// GMSJ01 (NTSC-J 1.1)
// define(INPUT_OFFSET, 3F5428)
// define(LIFE_COUNT_OFFSET, 569724)
// define(COIN_COUNT_OFFSET, 569780)
// define(POS_PTR_OFFSET, 3FEFAC)
// GMSP01 (PAL)
define(INPUT_OFFSET, 3FBBF4)
define(LIFE_COUNT_OFFSET, 570964)
define(COIN_COUNT_OFFSET, 5709C0)
define(POS_PTR_OFFSET, 4057D4)
registerSymbol(INPUT_OFFSET)
registerSymbol(COIN_COUNT_OFFSET)
registerSymbol(LIFE_COUNT_OFFSET)
registerSymbol(POS_PTR_OFFSET)
[ENABLE]
define(PRACTICE_CODE_MEMORY_OFFSET, 17F0000)
registerSymbol(PRACTICE_CODE_MEMORY_OFFSET)
label(BASE_ADDRESS)
registerSymbol(BASE_ADDRESS)
aobScan(aob1,47 4D 53 ?? 30 31 00 ?? 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 C2 33 9F 3D)
aob1:
BASE_ADDRESS:
[DISABLE]
unregisterSymbol(BASE_ADDRESS)
unregisterSymbol(PRACTICE_CODE_MEMORY_OFFSET)
unregisterSymbol(POS_PTR_OFFSET)
unregisterSymbol(LIFE_COUNT_OFFSET)
unregisterSymbol(COIN_COUNT_OFFSET)
unregisterSymbol(INPUT_OFFSET)
Toggle Activation
97
0
50
"Practice Code Values (Start at PRACTICE_CODE_MEMORY_OFFSET / 0x817F0000)"
FF0000
1
57
"0x000 Level Select Stage Data"
1
Array of byte
8
BASE_ADDRESS+PRACTICE_CODE_MEMORY_OFFSET
53
"0x008 Stored Position (Mario)"
1
Array of byte
12
BASE_ADDRESS+PRACTICE_CODE_MEMORY_OFFSET+8
54
"0x014 Stored Angle (Mario)"
1
Array of byte
2
BASE_ADDRESS+PRACTICE_CODE_MEMORY_OFFSET+14
56
"0x016 Stored Position (Camera)"
1
Array of byte
6
BASE_ADDRESS+PRACTICE_CODE_MEMORY_OFFSET+16
63
"0x020 Stored Coins"
1
Custom
4 Byte Big Endian
BASE_ADDRESS+PRACTICE_CODE_MEMORY_OFFSET+20
58
"0x100 Reset Stopwatch In Demo Screen Flag"
1
Byte
BASE_ADDRESS+PRACTICE_CODE_MEMORY_OFFSET+100
59
"0x101 Disable Custom IG Timer Flag"
1
Byte
BASE_ADDRESS+PRACTICE_CODE_MEMORY_OFFSET+101
62
"0x102 Stopwatch Save State"
1
Array of byte
8
BASE_ADDRESS+PRACTICE_CODE_MEMORY_OFFSET+102
60
"0x10C Stop Timer Flag"
1
Byte
BASE_ADDRESS+PRACTICE_CODE_MEMORY_OFFSET+10C
0
"Current Base Address"
1
C0C0C0
4 Bytes
BASE_ADDRESS
27
"Coin Count"
008000
Custom
4 Byte Big Endian
BASE_ADDRESS+COIN_COUNT_OFFSET
25
"Life Count"
008000
Custom
4 Byte Big Endian
BASE_ADDRESS+LIFE_COUNT_OFFSET
29
"Mario's Position"
C08000
Auto Assembler Script
// Get marios position
[ENABLE]
// Allocate 4 bytes for the position
registerSymbol(INT_POS_ADDRESS)
alloc(INT_POS_ADDRESS, 4)
// Read the address of the controller input
// into INT_CONTROLLER_INPUT_ADDRESS
// Since GC uses big endian we have to reverse
// the 4 bytes of the pointer
INT_POS_ADDRESS:
readMem(BASE_ADDRESS + POS_PTR_OFFSET + 3, 1)
readMem(BASE_ADDRESS + POS_PTR_OFFSET + 2, 1)
readMem(BASE_ADDRESS + POS_PTR_OFFSET + 1, 1)
readMem(BASE_ADDRESS + POS_PTR_OFFSET, 1)
// Calculate the final address for use with Dolphin
define(POS_ADDRESS, BASE_ADDRESS + [INT_POS_ADDRESS] - 80000000)
registerSymbol(POS_ADDRESS)
[DISABLE]
dealloc(INT_POS_ADDRESS)
unregisterSymbol(INT_POS_ADDRESS)
unregisterSymbol(POS_ADDRESS)
Toggle Activation
97
0
30
"Marios Position"
1
Array of byte
12
POS_ADDRESS
34
"Controller Inputs"
C08000
1
40
"A"
0:-
1:Pressed
Binary
0
1
0
BASE_ADDRESS+INPUT_OFFSET
41
"B"
0:-
1:Pressed
Binary
1
1
0
BASE_ADDRESS+INPUT_OFFSET
38
"X"
0:-
1:Pressed
Binary
2
1
0
BASE_ADDRESS+INPUT_OFFSET
39
"Y"
0:-
1:Pressed
Binary
3
1
0
BASE_ADDRESS+INPUT_OFFSET
49
"Start"
0:-
1:Pressed
Binary
4
1
0
BASE_ADDRESS+INPUT_OFFSET
48
"Z"
0:-
1:Pressed
Binary
4
1
0
BASE_ADDRESS+INPUT_OFFSET+1
32
"DPAD UP"
0:-
1:Pressed
1
Binary
3
1
0
BASE_ADDRESS+INPUT_OFFSET + 1
35
"DPAD DOWN"
0:-
1:Pressed
Binary
2
1
0
BASE_ADDRESS+INPUT_OFFSET + 1
36
"DPAD LEFT"
0:-
1:Pressed
Binary
0
1
0
BASE_ADDRESS+INPUT_OFFSET + 1
37
"DPAD RIGHT"
0:-
1:Pressed
Binary
1
1
0
BASE_ADDRESS+INPUT_OFFSET + 1
42
"L"
0:-
1:Pressed
Binary
6
1
0
BASE_ADDRESS+INPUT_OFFSET + 1
44
"L (Analog)"
Byte
BASE_ADDRESS+INPUT_OFFSET + 6
43
"R"
0:-
1:Pressed
Binary
5
1
0
BASE_ADDRESS+INPUT_OFFSET + 1
45
"R (Analog)"
Byte
BASE_ADDRESS+INPUT_OFFSET + 7
46
"L Stick"
Custom
2 Byte Big Endian
BASE_ADDRESS+INPUT_OFFSET + 2
47
"R-Stick"
Custom
2 Byte Big Endian
BASE_ADDRESS+INPUT_OFFSET+4
Group 0
label5
004E3739
label1
01733513
xlivekiller
59151605
Grey -> Informational