add cheat tables and memory map

This commit is contained in:
Matteias Collet 2021-07-24 08:55:18 +02:00
parent 3d95331f55
commit 90de6f0edb
7 changed files with 635 additions and 0 deletions

3
.gitattributes vendored
View file

@ -10,6 +10,8 @@
*.vue text eol=crlf
*.xml text eol=crlf linguist-detectable
*.yml text eol=crlf
*.ct text eol=crlf
*.CEA text eol=crlf
# Special files
.dockerignore text eol=crlf
@ -20,3 +22,4 @@ LICENSE text eol=crlf
*.jpg binary
*.png binary
*.zip binary
*.xslx binary

View file

@ -23,6 +23,12 @@ The codes are stored in the `Codes.xml` file. If you want to add or change codes
When adding new codes keep in mind that the English title/description are mandatory.
#### Reserved Memory
Some codes store some states in the games memory starting from address 0x81F70000. To avoid collisions use a memory range in the unallocated ranges:
![](./docs/reserved_memory.png)
### Adding translations
1. Create a new file `<lang>.json` in `site/.vuepress/i18n`, where `<lang>` is the language code you want to add. Copy the contents of `en-US.json` into your file and translate each entry in the JSON file.

BIN
docs/Reserved_Memory.xlsx Normal file

Binary file not shown.

BIN
docs/reserved_memory.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View file

@ -0,0 +1,82 @@
alloc(TypeName,256)
alloc(ByteSize,4)
alloc(ConvertRoutine,1024)
alloc(ConvertBackRoutine,1024)
TypeName:
db '2 Byte Big Endian',0
ByteSize:
dd 2
//The convert routine should hold a routine that converts the data to an integer (in eax)
//function declared as: stdcall int ConvertRoutine(unsigned char *input);
//Note: Keep in mind that this routine can be called by multiple threads at the same time.
ConvertRoutine:
//jmp dllname.functionname
[64-bit]
//or manual:
//parameters: (64-bit)
//rcx=address of input
xor eax,eax
mov ax,[rcx] //eax now contains the bytes 'input' pointed to
xchg ah,al //convert to big endian
ret
[/64-bit]
[32-bit]
//jmp dllname.functionname
//or manual:
//parameters: (32-bit)
push ebp
mov ebp,esp
//[ebp+8]=input
//example:
mov eax,[ebp+8] //place the address that contains the bytes into eax
mov ax,[eax] //place the bytes into eax so it's handled as a normal 4 byte value
and eax,ffff //cleanup
xchg ah,al //convert to big endian
pop ebp
ret 4
[/32-bit]
//The convert back routine should hold a routine that converts the given integer back to a row of bytes (e.g when the user wats to write a new value)
//function declared as: stdcall void ConvertBackRoutine(int i, unsigned char *output);
ConvertBackRoutine:
//jmp dllname.functionname
//or manual:
[64-bit]
//parameters: (64-bit)
//ecx=input
//rdx=address of output
//example:
xchg ch,cl //convert the little endian input into a big endian input
mov [rdx],cx //place the integer the 4 bytes pointed to by rdx
ret
[/64-bit]
[32-bit]
//parameters: (32-bit)
push ebp
mov ebp,esp
//[ebp+8]=input
//[ebp+c]=address of output
//example:
push eax
push ebx
mov eax,[ebp+8] //load the value into eax
mov ebx,[ebp+c] //load the address into ebx
//convert the value to big endian
xchg ah,al
mov [ebx],ax //write the value into the address
pop ebx
pop eax
pop ebp
ret 8
[/32-bit]

View file

@ -0,0 +1,82 @@
alloc(TypeName,256)
alloc(ByteSize,4)
alloc(ConvertRoutine,1024)
alloc(ConvertBackRoutine,1024)
TypeName:
db '4 Byte Big Endian',0
ByteSize:
dd 4
//The convert routine should hold a routine that converts the data to an integer (in eax)
//function declared as: stdcall int ConvertRoutine(unsigned char *input);
//Note: Keep in mind that this routine can be called by multiple threads at the same time.
ConvertRoutine:
//jmp dllname.functionname
[64-bit]
//or manual:
//parameters: (64-bit)
//rcx=address of input
xor eax,eax
mov eax,[rcx] //eax now contains the bytes 'input' pointed to
bswap eax //convert to big endian
ret
[/64-bit]
[32-bit]
//jmp dllname.functionname
//or manual:
//parameters: (32-bit)
push ebp
mov ebp,esp
//[ebp+8]=input
//example:
mov eax,[ebp+8] //place the address that contains the bytes into eax
mov eax,[eax] //place the bytes into eax so it's handled as a normal 4 byte value
bswap eax
pop ebp
ret 4
[/32-bit]
//The convert back routine should hold a routine that converts the given integer back to a row of bytes (e.g when the user wats to write a new value)
//function declared as: stdcall void ConvertBackRoutine(int i, unsigned char *output);
ConvertBackRoutine:
//jmp dllname.functionname
//or manual:
[64-bit]
//parameters: (64-bit)
//ecx=input
//rdx=address of output
//example:
bswap ecx //convert the little endian input into a big endian input
mov [rdx],ecx //place the integer the 4 bytes pointed to by rdx
ret
[/64-bit]
[32-bit]
//parameters: (32-bit)
push ebp
mov ebp,esp
//[ebp+8]=input
//[ebp+c]=address of output
//example:
push eax
push ebx
mov eax,[ebp+8] //load the value into eax
mov ebx,[ebp+c] //load the address into ebx
//convert the value to big endian
bswap eax
mov [ebx],eax //write the value into the address
pop ebx
pop eax
pop ebp
ret 8
[/32-bit]

462
utils/Sunshine.CT Normal file
View file

@ -0,0 +1,462 @@
<?xml version="1.0" encoding="utf-8"?>
<CheatTable CheatEngineTableVersion="31">
<CheatEntries>
<CheatEntry>
<ID>24</ID>
<Description>"Base Address Lookup"</Description>
<Options moHideChildren="1"/>
<LastState Activated="1"/>
<VariableType>Auto Assembler Script</VariableType>
<AssemblerScript>// 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)
</AssemblerScript>
<Hotkeys>
<Hotkey>
<Action>Toggle Activation</Action>
<Keys>
<Key>97</Key>
</Keys>
<ID>0</ID>
</Hotkey>
</Hotkeys>
<CheatEntries>
<CheatEntry>
<ID>50</ID>
<Description>"Practice Code Values (Start at PRACTICE_CODE_MEMORY_OFFSET / 0x817F0000)"</Description>
<Options moHideChildren="1"/>
<LastState Value="" Activated="1" RealAddress="00000000"/>
<Color>FF0000</Color>
<GroupHeader>1</GroupHeader>
<CheatEntries>
<CheatEntry>
<ID>57</ID>
<Description>"0x000 Level Select Stage Data"</Description>
<LastState Value="00 00 00 00 00 00 00 00" RealAddress="26EE9590000"/>
<ShowAsHex>1</ShowAsHex>
<VariableType>Array of byte</VariableType>
<ByteLength>8</ByteLength>
<Address>BASE_ADDRESS+PRACTICE_CODE_MEMORY_OFFSET</Address>
</CheatEntry>
<CheatEntry>
<ID>53</ID>
<Description>"0x008 Stored Position (Mario)"</Description>
<LastState Value="00 00 00 00 00 00 00 00 00 00 00 00" RealAddress="26EE9590008"/>
<ShowAsHex>1</ShowAsHex>
<VariableType>Array of byte</VariableType>
<ByteLength>12</ByteLength>
<Address>BASE_ADDRESS+PRACTICE_CODE_MEMORY_OFFSET+8</Address>
</CheatEntry>
<CheatEntry>
<ID>54</ID>
<Description>"0x014 Stored Angle (Mario)"</Description>
<LastState Value="00 00" RealAddress="26EE9590014"/>
<ShowAsHex>1</ShowAsHex>
<VariableType>Array of byte</VariableType>
<ByteLength>2</ByteLength>
<Address>BASE_ADDRESS+PRACTICE_CODE_MEMORY_OFFSET+14</Address>
</CheatEntry>
<CheatEntry>
<ID>56</ID>
<Description>"0x016 Stored Position (Camera)"</Description>
<LastState Value="00 00 00 00 00 00" RealAddress="26EE9590016"/>
<ShowAsHex>1</ShowAsHex>
<VariableType>Array of byte</VariableType>
<ByteLength>6</ByteLength>
<Address>BASE_ADDRESS+PRACTICE_CODE_MEMORY_OFFSET+16</Address>
</CheatEntry>
<CheatEntry>
<ID>63</ID>
<Description>"0x020 Stored Coins"</Description>
<LastState Value="00000002" RealAddress="26EE9590020"/>
<ShowAsHex>1</ShowAsHex>
<VariableType>Custom</VariableType>
<CustomType>4 Byte Big Endian</CustomType>
<Address>BASE_ADDRESS+PRACTICE_CODE_MEMORY_OFFSET+20</Address>
</CheatEntry>
<CheatEntry>
<ID>58</ID>
<Description>"0x100 Reset Stopwatch In Demo Screen Flag"</Description>
<LastState Value="00" RealAddress="26EE9590100"/>
<ShowAsHex>1</ShowAsHex>
<VariableType>Byte</VariableType>
<Address>BASE_ADDRESS+PRACTICE_CODE_MEMORY_OFFSET+100</Address>
</CheatEntry>
<CheatEntry>
<ID>59</ID>
<Description>"0x101 Disable Custom IG Timer Flag"</Description>
<LastState Value="00" RealAddress="26EE9590101"/>
<ShowAsHex>1</ShowAsHex>
<VariableType>Byte</VariableType>
<Address>BASE_ADDRESS+PRACTICE_CODE_MEMORY_OFFSET+101</Address>
</CheatEntry>
<CheatEntry>
<ID>62</ID>
<Description>"0x102 Stopwatch Save State"</Description>
<LastState Value="00 00 00 00 00 00 00 00" RealAddress="26EE9590102"/>
<ShowAsHex>1</ShowAsHex>
<VariableType>Array of byte</VariableType>
<ByteLength>8</ByteLength>
<Address>BASE_ADDRESS+PRACTICE_CODE_MEMORY_OFFSET+102</Address>
</CheatEntry>
<CheatEntry>
<ID>60</ID>
<Description>"0x10C Stop Timer Flag"</Description>
<LastState Value="00" RealAddress="26EE959010C"/>
<ShowAsHex>1</ShowAsHex>
<VariableType>Byte</VariableType>
<Address>BASE_ADDRESS+PRACTICE_CODE_MEMORY_OFFSET+10C</Address>
</CheatEntry>
</CheatEntries>
</CheatEntry>
<CheatEntry>
<ID>0</ID>
<Description>"Current Base Address"</Description>
<LastState Value="50534D47" RealAddress="26EE7DA0000"/>
<ShowAsHex>1</ShowAsHex>
<Color>C0C0C0</Color>
<VariableType>4 Bytes</VariableType>
<Address>BASE_ADDRESS</Address>
</CheatEntry>
<CheatEntry>
<ID>27</ID>
<Description>"Coin Count"</Description>
<LastState Value="2" RealAddress="26EE83109C0"/>
<Color>008000</Color>
<VariableType>Custom</VariableType>
<CustomType>4 Byte Big Endian</CustomType>
<Address>BASE_ADDRESS+COIN_COUNT_OFFSET</Address>
</CheatEntry>
<CheatEntry>
<ID>25</ID>
<Description>"Life Count"</Description>
<LastState Value="3" RealAddress="26EE8310964"/>
<Color>008000</Color>
<VariableType>Custom</VariableType>
<CustomType>4 Byte Big Endian</CustomType>
<Address>BASE_ADDRESS+LIFE_COUNT_OFFSET</Address>
</CheatEntry>
<CheatEntry>
<ID>29</ID>
<Description>"Mario's Position"</Description>
<Options moHideChildren="1"/>
<LastState Activated="1"/>
<Color>C08000</Color>
<VariableType>Auto Assembler Script</VariableType>
<AssemblerScript>// 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)
</AssemblerScript>
<Hotkeys>
<Hotkey>
<Action>Toggle Activation</Action>
<Keys>
<Key>97</Key>
</Keys>
<ID>0</ID>
</Hotkey>
</Hotkeys>
<CheatEntries>
<CheatEntry>
<ID>30</ID>
<Description>"Marios Position"</Description>
<LastState Value="00 00 00 00 00 00 00 00 00 00 00 00" RealAddress="26EE8FA2ACC"/>
<ShowAsHex>1</ShowAsHex>
<VariableType>Array of byte</VariableType>
<ByteLength>12</ByteLength>
<Address>POS_ADDRESS</Address>
</CheatEntry>
</CheatEntries>
</CheatEntry>
<CheatEntry>
<ID>34</ID>
<Description>"Controller Inputs"</Description>
<Options moHideChildren="1"/>
<LastState Value="" Activated="1" RealAddress="00000000"/>
<Color>C08000</Color>
<GroupHeader>1</GroupHeader>
<CheatEntries>
<CheatEntry>
<ID>40</ID>
<Description>"A"</Description>
<DropDownList DescriptionOnly="1" DisplayValueAsItem="1">0:-
1:Pressed
</DropDownList>
<LastState Value="0" RealAddress="26EE819BBF4"/>
<VariableType>Binary</VariableType>
<BitStart>0</BitStart>
<BitLength>1</BitLength>
<ShowAsBinary>0</ShowAsBinary>
<Address>BASE_ADDRESS+INPUT_OFFSET</Address>
</CheatEntry>
<CheatEntry>
<ID>41</ID>
<Description>"B"</Description>
<DropDownList DescriptionOnly="1" DisplayValueAsItem="1">0:-
1:Pressed
</DropDownList>
<LastState Value="0" RealAddress="26EE819BBF4"/>
<VariableType>Binary</VariableType>
<BitStart>1</BitStart>
<BitLength>1</BitLength>
<ShowAsBinary>0</ShowAsBinary>
<Address>BASE_ADDRESS+INPUT_OFFSET</Address>
</CheatEntry>
<CheatEntry>
<ID>38</ID>
<Description>"X"</Description>
<DropDownList DescriptionOnly="1" DisplayValueAsItem="1">0:-
1:Pressed
</DropDownList>
<LastState Value="0" RealAddress="26EE819BBF4"/>
<VariableType>Binary</VariableType>
<BitStart>2</BitStart>
<BitLength>1</BitLength>
<ShowAsBinary>0</ShowAsBinary>
<Address>BASE_ADDRESS+INPUT_OFFSET</Address>
</CheatEntry>
<CheatEntry>
<ID>39</ID>
<Description>"Y"</Description>
<DropDownList DescriptionOnly="1" DisplayValueAsItem="1">0:-
1:Pressed
</DropDownList>
<LastState Value="0" RealAddress="26EE819BBF4"/>
<VariableType>Binary</VariableType>
<BitStart>3</BitStart>
<BitLength>1</BitLength>
<ShowAsBinary>0</ShowAsBinary>
<Address>BASE_ADDRESS+INPUT_OFFSET</Address>
</CheatEntry>
<CheatEntry>
<ID>49</ID>
<Description>"Start"</Description>
<DropDownList DescriptionOnly="1" DisplayValueAsItem="1">0:-
1:Pressed
</DropDownList>
<LastState Value="0" RealAddress="26EE819BBF4"/>
<VariableType>Binary</VariableType>
<BitStart>4</BitStart>
<BitLength>1</BitLength>
<ShowAsBinary>0</ShowAsBinary>
<Address>BASE_ADDRESS+INPUT_OFFSET</Address>
</CheatEntry>
<CheatEntry>
<ID>48</ID>
<Description>"Z"</Description>
<DropDownList DescriptionOnly="1" DisplayValueAsItem="1">0:-
1:Pressed
</DropDownList>
<LastState Value="0" RealAddress="26EE819BBF5"/>
<VariableType>Binary</VariableType>
<BitStart>4</BitStart>
<BitLength>1</BitLength>
<ShowAsBinary>0</ShowAsBinary>
<Address>BASE_ADDRESS+INPUT_OFFSET+1</Address>
</CheatEntry>
<CheatEntry>
<ID>32</ID>
<Description>"DPAD UP"</Description>
<DropDownList DescriptionOnly="1" DisplayValueAsItem="1">0:-
1:Pressed
</DropDownList>
<LastState Value="0" RealAddress="26EE819BBF5"/>
<ShowAsHex>1</ShowAsHex>
<VariableType>Binary</VariableType>
<BitStart>3</BitStart>
<BitLength>1</BitLength>
<ShowAsBinary>0</ShowAsBinary>
<Address>BASE_ADDRESS+INPUT_OFFSET + 1</Address>
</CheatEntry>
<CheatEntry>
<ID>35</ID>
<Description>"DPAD DOWN"</Description>
<DropDownList DescriptionOnly="1" DisplayValueAsItem="1">0:-
1:Pressed
</DropDownList>
<LastState Value="0" RealAddress="26EE819BBF5"/>
<VariableType>Binary</VariableType>
<BitStart>2</BitStart>
<BitLength>1</BitLength>
<ShowAsBinary>0</ShowAsBinary>
<Address>BASE_ADDRESS+INPUT_OFFSET + 1</Address>
</CheatEntry>
<CheatEntry>
<ID>36</ID>
<Description>"DPAD LEFT"</Description>
<DropDownList DescriptionOnly="1" DisplayValueAsItem="1">0:-
1:Pressed
</DropDownList>
<LastState Value="0" RealAddress="26EE819BBF5"/>
<VariableType>Binary</VariableType>
<BitStart>0</BitStart>
<BitLength>1</BitLength>
<ShowAsBinary>0</ShowAsBinary>
<Address>BASE_ADDRESS+INPUT_OFFSET + 1</Address>
</CheatEntry>
<CheatEntry>
<ID>37</ID>
<Description>"DPAD RIGHT"</Description>
<DropDownList DescriptionOnly="1" DisplayValueAsItem="1">0:-
1:Pressed
</DropDownList>
<LastState Value="0" RealAddress="26EE819BBF5"/>
<VariableType>Binary</VariableType>
<BitStart>1</BitStart>
<BitLength>1</BitLength>
<ShowAsBinary>0</ShowAsBinary>
<Address>BASE_ADDRESS+INPUT_OFFSET + 1</Address>
</CheatEntry>
<CheatEntry>
<ID>42</ID>
<Description>"L"</Description>
<DropDownList DescriptionOnly="1" DisplayValueAsItem="1">0:-
1:Pressed
</DropDownList>
<LastState Value="0" RealAddress="26EE819BBF5"/>
<VariableType>Binary</VariableType>
<BitStart>6</BitStart>
<BitLength>1</BitLength>
<ShowAsBinary>0</ShowAsBinary>
<Address>BASE_ADDRESS+INPUT_OFFSET + 1</Address>
</CheatEntry>
<CheatEntry>
<ID>44</ID>
<Description>"L (Analog)"</Description>
<LastState Value="0" RealAddress="26EE819BBFA"/>
<VariableType>Byte</VariableType>
<Address>BASE_ADDRESS+INPUT_OFFSET + 6</Address>
</CheatEntry>
<CheatEntry>
<ID>43</ID>
<Description>"R"</Description>
<DropDownList DescriptionOnly="1" DisplayValueAsItem="1">0:-
1:Pressed
</DropDownList>
<LastState Value="0" RealAddress="26EE819BBF5"/>
<VariableType>Binary</VariableType>
<BitStart>5</BitStart>
<BitLength>1</BitLength>
<ShowAsBinary>0</ShowAsBinary>
<Address>BASE_ADDRESS+INPUT_OFFSET + 1</Address>
</CheatEntry>
<CheatEntry>
<ID>45</ID>
<Description>"R (Analog)"</Description>
<LastState Value="0" RealAddress="26EE819BBFB"/>
<VariableType>Byte</VariableType>
<Address>BASE_ADDRESS+INPUT_OFFSET + 7</Address>
</CheatEntry>
<CheatEntry>
<ID>46</ID>
<Description>"L Stick"</Description>
<LastState Value="0" RealAddress="26EE819BBF6"/>
<VariableType>Custom</VariableType>
<CustomType>2 Byte Big Endian</CustomType>
<Address>BASE_ADDRESS+INPUT_OFFSET + 2</Address>
</CheatEntry>
<CheatEntry>
<ID>47</ID>
<Description>"R-Stick"</Description>
<LastState Value="0" RealAddress="26EE819BBF8"/>
<VariableType>Custom</VariableType>
<CustomType>2 Byte Big Endian</CustomType>
<Address>BASE_ADDRESS+INPUT_OFFSET+4</Address>
</CheatEntry>
</CheatEntries>
</CheatEntry>
</CheatEntries>
</CheatEntry>
</CheatEntries>
<CheatCodes>
<CodeEntry Color="80000008" GroupHeader="1">
<Description>Group 0</Description>
</CodeEntry>
</CheatCodes>
<UserdefinedSymbols>
<SymbolEntry>
<Name>label5</Name>
<Address>004E3739</Address>
</SymbolEntry>
<SymbolEntry>
<Name>label1</Name>
<Address>01733513</Address>
</SymbolEntry>
<SymbolEntry>
<Name>xlivekiller</Name>
<Address>59151605</Address>
</SymbolEntry>
</UserdefinedSymbols>
<Comments>Grey -&gt; Informational</Comments>
</CheatTable>