Skip to content

Commit

Permalink
Added Suport For FireRed / LeafGreen
Browse files Browse the repository at this point in the history
  • Loading branch information
NPO-197 committed Jun 21, 2022
1 parent 076fa92 commit 8c24a28
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
65 changes: 65 additions & 0 deletions PokemonROMInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ class ROMID(Enum):
Ruby = 9
Sapphire = 10
GoldSilver =11
FireRed = 12
LeafGreen = 13

class TCformat(Enum):
#2D array Effectivenes format, a custom format that Crystal roms are modifyed to accept.
MatrixFormatGen2 = 1
Expand Down Expand Up @@ -241,6 +244,68 @@ def __init__(self,ROMID,filesize,chartdataoffset,typechartformat,checkdata,newda
]
)

FireRedInfo = RomInfo(ROMID.FireRed,0x1000000,0xAF0000,TCformat.ListFormatGen3,
checkdata =[
#Similar to Ruby/Sapphire but the offsets are different
#Pointers to the original type chart data
[0x01E958,bytearray.fromhex('C0 F0 24 08')], #TypeCalc Pointer 1
[0x01EA98,bytearray.fromhex('C0 F0 24 08')], #TypeCalc Pointer 2
[0x01EB6C,bytearray.fromhex('C0 F0 24 08')], #AI trainer switch out
[0x01EED0,bytearray.fromhex('C0 F0 24 08')], #Used in levetate/wonderguard? 1
[0x01EFD4,bytearray.fromhex('C0 F0 24 08')], #Used in levetate/wonderguard? 2
[0x01F0D4,bytearray.fromhex('C0 F0 24 08')], #"Good" trainer AI
[0x023CEC,bytearray.fromhex('C0 F0 24 08')], #??? (Something in battle_script_command)
[0x029FA4,bytearray.fromhex('C0 F0 24 08')], #Used in conversion 2
[0x039E4C,bytearray.fromhex('C0 F0 24 08')], #AI trainer switch in?
#Unused Section of ROM
[0xAF0000,bytearray([0xFF]*873)] #We need at most 873 ""empty"" bytes
],
newdata = [
#There are 9 pointers used by various functions that point to the Old Type Chart
#We want to change them to point to the new type chart at 0x08af0000
[0x01E958,bytearray.fromhex('00 00 AF 08')], #TypeCalc Pointer 1
[0x01EA98,bytearray.fromhex('00 00 AF 08')], #TypeCalc Pointer 2
[0x01EB6C,bytearray.fromhex('00 00 AF 08')], #AI trainer switch out
[0x01EED0,bytearray.fromhex('00 00 AF 08')], #Used in levetate/wonderguard? 1
[0x01EFD4,bytearray.fromhex('00 00 AF 08')], #Used in levetate/wonderguard? 2
[0x01F0D4,bytearray.fromhex('00 00 AF 08')], #"Good" trainer AI
[0x023CEC,bytearray.fromhex('00 00 AF 08')], #??? (Something in battle_script_command)
[0x029FA4,bytearray.fromhex('00 00 AF 08')], #Used in conversion 2
[0x039E4C,bytearray.fromhex('00 00 AF 08')], #AI trainer switch in?
]
)

LeafGreenInfo = RomInfo(ROMID.LeafGreen,0x1000000,0xAF0000,TCformat.ListFormatGen3,
checkdata =[
#Same as FireRed but the original type chart is in a slightly different location
#Pointers to the original type chart data
[0x01E958,bytearray.fromhex('9C F0 24 08')], #TypeCalc Pointer 1
[0x01EA98,bytearray.fromhex('9C F0 24 08')], #TypeCalc Pointer 2
[0x01EB6C,bytearray.fromhex('9C F0 24 08')], #AI trainer switch out
[0x01EED0,bytearray.fromhex('9C F0 24 08')], #Used in levetate/wonderguard? 1
[0x01EFD4,bytearray.fromhex('9C F0 24 08')], #Used in levetate/wonderguard? 2
[0x01F0D4,bytearray.fromhex('9C F0 24 08')], #"Good" trainer AI
[0x023CEC,bytearray.fromhex('9C F0 24 08')], #??? (Something in battle_script_command)
[0x029FA4,bytearray.fromhex('9C F0 24 08')], #Used in conversion 2
[0x039E4C,bytearray.fromhex('9C F0 24 08')], #AI trainer switch in?
#Unused Section of ROM
[0xAF0000,bytearray([0xFF]*873)] #We need at most 873 ""empty"" bytes
],
newdata = [
#There are 9 pointers used by various functions that point to the Old Type Chart
#We want to change them to point to the new type chart at 0x08af0000
[0x01E958,bytearray.fromhex('00 00 AF 08')], #TypeCalc Pointer 1
[0x01EA98,bytearray.fromhex('00 00 AF 08')], #TypeCalc Pointer 2
[0x01EB6C,bytearray.fromhex('00 00 AF 08')], #AI trainer switch out
[0x01EED0,bytearray.fromhex('00 00 AF 08')], #Used in levetate/wonderguard? 1
[0x01EFD4,bytearray.fromhex('00 00 AF 08')], #Used in levetate/wonderguard? 2
[0x01F0D4,bytearray.fromhex('00 00 AF 08')], #"Good" trainer AI
[0x023CEC,bytearray.fromhex('00 00 AF 08')], #??? (Something in battle_script_command)
[0x029FA4,bytearray.fromhex('00 00 AF 08')], #Used in conversion 2
[0x039E4C,bytearray.fromhex('00 00 AF 08')], #AI trainer switch in?
]
)

EmeraldInfo = RomInfo(ROMID.Emerald,0x1000000,0xAF0000,TCformat.ListFormatGen3,
checkdata = [
#Same as Ruby/Sapphire but with different offests and one extra pointer used in the Battle Dome.
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Currently supports:
- Pokemon - Crystal Version (UE) (V1.0) [C][!].gbc `sha1: f4cd194bdee0d04ca4eac29e09b8e4e9d818c133`
- Pokemon Ruby Version.gba `sha1: f28b6ffc97847e94a6c21a63cacf633ee5c8df1e`
- Pokemon Sapphire Version.gba `sha1: 3ccbbd45f8553c36463f13b938e833f652b793e4`
- Pokemon - FireRed Version(Rev 1).gba `sha1: dd5945db9b930750cb39d00c84da8571feebf417`
- Pokemon - LeafGreen Version(Rev 1).gba `sha1: 7862c67bdecbe21d1d69ce082ce34327e1c6ed5e`
- Pokemon Emerald Version.gba `sha1: f3ae088181bf583e55daf962a92bb46f4f1d07b7`

As well as the following "speedchoice" ROMs:
Expand Down

0 comments on commit 8c24a28

Please sign in to comment.