Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Italy support #140

Merged
merged 6 commits into from
Aug 2, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ The following games are currently supported:
- v1.0, v1.1
- Pokémon Rojo Fuego (Spain)
- Pokémon Rouge Feu (France)
- Pokemon - Rosso Fuoco (Italy)

With more non-english version support potentially coming in the future!

Expand Down
3 changes: 2 additions & 1 deletion README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ CURRENTLY SUPPORTED GAMES:
- Pokémon LeafGreen (U)
- v1.0, v1.1
- Pokémon Rojo Fuego (Spain)
- Pokémon Rouge Feu (France)
- Pokémon Rouge Feu (France)
- Pokemon - Rosso Fuoco (Italy)
124 changes: 102 additions & 22 deletions ironmon_tracker/GameSettings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ function GameSettings.initialize()
GameSettings.setGameAsEmerald()
elseif gamecode == 0x42505245 then
GameSettings.setGameAsFireRed(gameversion)
elseif gamecode == 0x42505249 then
GameSettings.setGameAsFireRedItaly(gameversion)
elseif gamecode == 0x42505253 then
GameSettings.setGameAsFireRedSpanish(gameversion)
elseif gamecode == 0x42505246 then
Expand Down Expand Up @@ -107,6 +109,15 @@ function GameSettings.setGameInfo(gamecode)
BADGE_PREFIX = "FRLG",
BADGE_XOFFSETS = { 0, -2, -2, 0, 1, 1, 0, 1 },
},
[0x42505249] = {
GAME_NUMBER = 3,
GAME_NAME = "Pokemon - Rosso Fuoco (Italy)",
VERSION_GROUP = 2,
PSTATS = 0x2024284,
ESTATS = 0x202402C,
BADGE_PREFIX = "FRLG",
BADGE_XOFFSETS = { 0, -2, -2, 0, 1, 1, 0, 1 },
},
[0x42505253] = {
GAME_NUMBER = 3,
GAME_NAME = "Pokemon Rojo Fuego (Spain)",
Expand Down Expand Up @@ -535,28 +546,97 @@ function GameSettings.setGameAsFireRed(gameversion)
end
end

function GameSettings.setGameAsFireRedItaly(gameversion)
if gameversion == 0x00640000 then
print("ROM Detected: Pokemon - Rosso Fuoco")
GameSettings.gBaseStats = 0x0824d864
GameSettings.sMonSummaryScreen = 0x0203b140
GameSettings.sSpecialFlags = 0x020370e0
GameSettings.sBattlerAbilities = 0x02039a30
GameSettings.gBattlerAttacker = 0x02023d6b
GameSettings.gBattlerPartyIndexesSelfSlotOne = 0x02023bce
GameSettings.gBattlerPartyIndexesEnemySlotOne = GameSettings.gBattlerPartyIndexesSelfSlotOne + 0x2
GameSettings.gBattlerPartyIndexesSelfSlotTwo = GameSettings.gBattlerPartyIndexesSelfSlotOne + 0x4
GameSettings.gBattlerPartyIndexesEnemySlotTwo = GameSettings.gBattlerPartyIndexesSelfSlotOne + 0x6
GameSettings.gBattleMons = 0x02023be4
GameSettings.gBattlescriptCurrInstr = 0x02023d74

GameSettings.BattleScript_FocusPunchSetUp = 0x081d647f + 0x10 -- TODO: offset for this game is untested
GameSettings.BattleScript_LearnMoveLoop = 0x081d5e7B --those values were tricky to find
GameSettings.BattleScript_LearnMoveReturn = 0x081D5ECD -- expect them to not always be right
GameSettings.gMoveToLearn = 0x02024022
GameSettings.gBattleOutcome = 0x02023e8a

GameSettings.FriendshipRequiredToEvo = 0x08042db0 + 0x13E -- GetEvolutionTargetSpecies (untested)

--the only diffrance looks like in here gSaveBlock1ptr and gSaveBlock2ptr
GameSettings.gSaveBlock1ptr = 0x03004F58
GameSettings.gSaveBlock2ptr = 0x03004F5C
GameSettings.gameStatsOffset = 0x1200
GameSettings.EncryptionKeyOffset = 0xF20
GameSettings.badgeOffset = 0xEE0 + 0x104 -- [SaveBlock1's flags offset] + [Badge flag offset: (SYSTEM_FLAGS + FLAG_BADGE01_GET) / 8]
GameSettings.bagPocket_Items_offset = 0x310 --tested for bag items didnt check for berries should be same though
GameSettings.bagPocket_Berries_offset = 0x54c
GameSettings.bagPocket_Items_Size = 42
GameSettings.bagPocket_Berries_Size = 43

-- https://raw.githubusercontent.com/pret/pokefirered/symbols/pokefirered_rev1.sym
--base for abilitys is fire red v1.1 looks like diff between abilitys is same
--this was not stright forward to get so expect to find errors here
GameSettings.ABILITIES = {
[0x081d66e9] = 2, -- BattleScript_DrizzleActivates + 0x0 Drizzle
[0x081d6704] = 3, -- BattleScript_SpeedBoostActivates + 0x7 Speed Boost
[0x081d680b] = 5, -- BattleScript_SturdyPreventsOHKO + 0x0 Sturdy
[0x081d6819] = 6, -- BattleScript_DampStopsExplosion + 0x0 Damp
[0x081d42b3] = 7, -- BattleScript_LimberProtected + 0x0 Limber (untested)
[0x081d68ae] = 12, -- BattleScript_ObliviousPreventsAttraction + 0x0 Oblivious (untested)
[0x081d6909] = 16, -- BattleScript_ColorChangeActivates + 0x3 Color Change
--[0x081d42b3] = 17, -- BattleScript_ImmunityProtected + 0x0 Immunity (untested) not working in eng version
[0x081d686a] = 18, -- BattleScript_FlashFireBoost + 0x3 Flash Fire
[0x081d581c] = 20, -- BattleScript_OwnTempoPrevents + 0x0 Own Tempo
[0x081d6777] = 22, -- BattleScript_DoIntimidateActivationAnim + 0x0 Intimidate
[0x081d3ea3] = 24, -- BattleScript_RoughSkinActivates + 0x10 Rough Skin
[0x081d6938] = 28, -- BattleScript_SynchronizeActivates + 0x0 Synchronize (untested)
[0x081d6880] = 29, -- BattleScript_AbilityNoStatLoss + 0x0 Clear Body & White Smoke
[0x081d670b] = 36, -- BattleScript_TraceActivates + 0x0 Trace
[0x081d68e0] = 43, -- BattleScript_SoundproofProtected + 0x8 Soundproof
[0x081d5f23] = 44, -- BattleScript_RainDishActivates + 0x3 Rain Dish
[0x081d6729] = 45, -- BattleScript_SandstreamActivates + 0x0 Sand Stream
[0x081d68ee] = 52, -- BattleScript_AbilityNoSpecificStatLoss + 0x6 Hyper Cutter
[0x081d3f32] = 54, -- BattleScript_MoveUsedLoafingAround + 0x5 Truant
[0x081d6931] = 56, -- BattleScript_CuteCharmActivates + 0x9 Cute Charm
[0x081d68f8] = 60, -- BattleScript_StickyHoldActivates + 0x0 Sticky Hold
[0x081d430b] = 61, -- BattleScript_ShedSkinActivates + 0x3 Shed Skin
[0x081d67e3] = 70, -- BattleScript_DroughtActivates + 0x0 Drought
[0x081d3e30] = 72, -- BattleScript_CantMakeAsleep + 0x8 Vital Spirit
}
dofile(Main.DataFolder .. "/Languages/ItalyData.lua")
ItalyData.updateToItalyData()
end
end

function GameSettings.setGameAsFireRedSpanish(gameversion)
if gameversion == 0x005A0000 then
print("ROM Detected: Pokemon Rojo Fuego")
GameSettings.gBaseStats = 0x082547f4
GameSettings.gBaseStats = 0x0824ff4c
GameSettings.sMonSummaryScreen = 0x0203b140
GameSettings.sSpecialFlags = 0x020370e0 -- not sure if its the real value used for.its used for rse only anyway so not that important
GameSettings.sBattlerAbilities = 0x02039a30 --not used in tracker so no idea
GameSettings.sSpecialFlags = 0x020370e0
GameSettings.sBattlerAbilities = 0x02039a30
GameSettings.gBattlerAttacker = 0x02023d6b
GameSettings.gBattlerPartyIndexesSelfSlotOne = 0x02023bce
GameSettings.gBattlerPartyIndexesEnemySlotOne = GameSettings.gBattlerPartyIndexesSelfSlotOne + 0x2
GameSettings.gBattlerPartyIndexesSelfSlotTwo = GameSettings.gBattlerPartyIndexesSelfSlotOne + 0x4 --not tested
GameSettings.gBattlerPartyIndexesEnemySlotTwo = GameSettings.gBattlerPartyIndexesSelfSlotOne + 0x6 -- not tested
GameSettings.gBattlerPartyIndexesSelfSlotTwo = GameSettings.gBattlerPartyIndexesSelfSlotOne + 0x4
GameSettings.gBattlerPartyIndexesEnemySlotTwo = GameSettings.gBattlerPartyIndexesSelfSlotOne + 0x6
GameSettings.gBattleMons = 0x02023be4
GameSettings.gBattlescriptCurrInstr = 0x02023d74 --seems like they are same as fr but not sure
--this section is not tested but everything was the same so lets hope
GameSettings.BattleScript_FocusPunchSetUp = 0x081d9085 + 0x10 -- TODO: offset for this game is untested
GameSettings.BattleScript_LearnMoveLoop = 0x081d8a81
GameSettings.BattleScript_LearnMoveReturn = 0x081d8ad3
GameSettings.gBattlescriptCurrInstr = 0x02023d74

GameSettings.BattleScript_FocusPunchSetUp = 0x081d8b47 + 0x10 -- TODO: offset for this game is untested
GameSettings.BattleScript_LearnMoveLoop = 0x081D8543
GameSettings.BattleScript_LearnMoveReturn = 0x081D8595
GameSettings.gMoveToLearn = 0x02024022
GameSettings.gBattleOutcome = 0x02023e8a

GameSettings.FriendshipRequiredToEvo = 0x08042ED8 + 0x13E -- GetEvolutionTargetSpecies (untested)
GameSettings.FriendshipRequiredToEvo = 0x08042db0 + 0x13E -- GetEvolutionTargetSpecies (untested)

--the only diffrance looks like in here gSaveBlock1ptr and gSaveBlock2ptr
GameSettings.gSaveBlock1ptr = 0x03004F58
Expand Down Expand Up @@ -607,25 +687,25 @@ end
function GameSettings.setGameAsFireRedFrench(gameversion)
if gameversion == 0x00670000 then
print("ROM Detected: Pokemon Rouge Feu")
GameSettings.gBaseStats = 0x082547f4
GameSettings.gBaseStats = 0x0824ebd4
GameSettings.sMonSummaryScreen = 0x0203b140
GameSettings.sSpecialFlags = 0x020370e0 -- not sure if its the real value used for.its used for rse only anyway so not that important
GameSettings.sBattlerAbilities = 0x02039a30 --not used in tracker so no idea
GameSettings.sSpecialFlags = 0x020370e0
GameSettings.sBattlerAbilities = 0x02039a30
GameSettings.gBattlerAttacker = 0x02023d6b
GameSettings.gBattlerPartyIndexesSelfSlotOne = 0x02023bce
GameSettings.gBattlerPartyIndexesEnemySlotOne = GameSettings.gBattlerPartyIndexesSelfSlotOne + 0x2
GameSettings.gBattlerPartyIndexesSelfSlotTwo = GameSettings.gBattlerPartyIndexesSelfSlotOne + 0x4 --not tested
GameSettings.gBattlerPartyIndexesEnemySlotTwo = GameSettings.gBattlerPartyIndexesSelfSlotOne + 0x6 -- not tested
GameSettings.gBattlerPartyIndexesSelfSlotTwo = GameSettings.gBattlerPartyIndexesSelfSlotOne + 0x4
GameSettings.gBattlerPartyIndexesEnemySlotTwo = GameSettings.gBattlerPartyIndexesSelfSlotOne + 0x6
GameSettings.gBattleMons = 0x02023be4
GameSettings.gBattlescriptCurrInstr = 0x02023d74 --seems like they are same as fr but not sure
--this section is not tested but everything was the same so lets hope
GameSettings.BattleScript_FocusPunchSetUp = 0x081d9085 + 0x10 -- TODO: offset for this game is untested
GameSettings.BattleScript_LearnMoveLoop = 0x081d8a81
GameSettings.BattleScript_LearnMoveReturn = 0x081d8ad3
GameSettings.gBattlescriptCurrInstr = 0x02023d74

GameSettings.BattleScript_FocusPunchSetUp = 0x081d77e7 + 0x10 -- TODO: offset for this game is untested
GameSettings.BattleScript_LearnMoveLoop = 0x081D7DEB
GameSettings.BattleScript_LearnMoveReturn = 0x081D7E3D
GameSettings.gMoveToLearn = 0x02024022
GameSettings.gBattleOutcome = 0x02023e8a

GameSettings.FriendshipRequiredToEvo = 0x08042ED8 + 0x13E -- GetEvolutionTargetSpecies (untested)
GameSettings.FriendshipRequiredToEvo = 0x08042d9c + 0x13E -- GetEvolutionTargetSpecies (untested)

--the only diffrance looks like in here gSaveBlock1ptr and gSaveBlock2ptr
GameSettings.gSaveBlock1ptr = 0x03004F58
Expand Down
Loading