Merging pull request

This commit is contained in:
The Gears of Progress 2026-01-08 17:17:05 -05:00
parent 602870065a
commit 2b7aeebe6b
7 changed files with 876 additions and 8 deletions

View File

@ -4,7 +4,7 @@
#define VERSION "v1.2.1"
#define PTGB_BUILD_LANGUAGE 2
#define DEBUG_MODE false
#define DEBUG_MODE true
#define PRINT_LINK_DATA (false && DEBUG_MODE)
#define INSTANT_TEXT_SPEED (false && DEBUG_MODE)

View File

@ -7,5 +7,11 @@ extern const struct GB_ROM gb_rom_values_eng[];
extern const u16 gb_rom_values_eng_size;
extern const struct GB_ROM gb_rom_values_fre[];
extern const u16 gb_rom_values_fre_size;
extern const struct GB_ROM gb_rom_values_ger[];
extern const u16 gb_rom_values_ger_size;
extern const struct GB_ROM gb_rom_values_ita[];
extern const u16 gb_rom_values_ita_size;
extern const struct GB_ROM gb_rom_values_spa[];
extern const u16 gb_rom_values_spa_size;
#endif

View File

@ -231,7 +231,7 @@ const struct GB_ROM gb_rom_values_fre[] = {
.textBorderHeight = 1,
.padding_2 = 0
},
{
{ // FRE_CRYSTAL
.language = FRE_ID,
.version = CRYSTAL_ID,
.generation = 2,

View File

@ -0,0 +1,282 @@
#include "gb_rom_values/gb_rom_values.h"
const struct GB_ROM gb_rom_values_ger[] = {
{ // GER_RED
.language = GER_ID,
.version = RED_ID,
.generation = 1,
.method = METHOD_NEWLINE,
.payload_size = 637,
.box_data_size = 0x462,
.print_string_start = 0xC456,
.stack_overwrite_location = 0xDFDD,
.short_pkmn_name = 0xE3,
.pointer_pkmn_name = 0xFC,
.padding_1 = 0,
.clearScreen = 0x190F,
.CableClub_TextBoxBorder = 0x5ACD,
.placeString = 0x1955,
.Serial_ExchangeBytes = 0x216F,
._RemovePokemon = 0x7B66,
.SaveSAVtoSRAM1 = 0x1C77BB,
.SaveSAVtoSRAM2 = 0x1C77E8,
.OpenSRAM = 0,
.SaveBox = 0,
.Bankswitch = 0x35F0,
.SoftReset = 0x1F49,
.CloseSRAM = 0,
.garbageDataLocation = 0x1F8E,
.wRemoveMonFromBox = 0xCF9A,
.wBoxCount = 0xDA85,
.wWhichPokemon = 0xCF95,
.wBoxDataStart = 0xDA85,
.wBoxDataEnd = 0xDEE7,
.wSerialEnemyDataBlock = 0xD898,
.wEnemyMonSpecies = 0xCFEA,
.wSerialEnemyMonsPatchList = 0xC5D0,
.wSerialOtherGameboyRandomNumberListBlock = 0xCD81,
.hSerialConnectionStatus = 0xFFAA,
.transferStringLocation = 0xC444,
.textBorderUppLeft = 0xC42F,
.textBorderWidth = 12,
.textBorderHeight = 1,
.padding_2 = 0
},
{ // GER_BLUE
.language = GER_ID,
.version = BLUE_ID,
.generation = 1,
.method = METHOD_NEWLINE,
.payload_size = 637,
.box_data_size = 0x462,
.print_string_start = 0xC456,
.stack_overwrite_location = 0xDFDD,
.short_pkmn_name = 0xE3,
.pointer_pkmn_name = 0xFC,
.padding_1 = 0,
.clearScreen = 0x190C,
.CableClub_TextBoxBorder = 0x5B41,
.placeString = 0x1952,
.Serial_ExchangeBytes = 0x216B,
._RemovePokemon = 0x7BD9,
.SaveSAVtoSRAM1 = 0x1C77B3,
.SaveSAVtoSRAM2 = 0x1C77E0,
.OpenSRAM = 0,
.SaveBox = 0,
.Bankswitch = 0x35F3,
.SoftReset = 0x1F45,
.CloseSRAM = 0,
.garbageDataLocation = 0x1F8E,
.wRemoveMonFromBox = 0xCF9A,
.wBoxCount = 0xDA85,
.wWhichPokemon = 0xCF95,
.wBoxDataStart = 0xDA85,
.wBoxDataEnd = 0xDEE7,
.wSerialEnemyDataBlock = 0xD898,
.wEnemyMonSpecies = 0xCFEA,
.wSerialEnemyMonsPatchList = 0xC5D0,
.wSerialOtherGameboyRandomNumberListBlock = 0xCD81,
.hSerialConnectionStatus = 0xFFAA,
.transferStringLocation = 0xC444,
.textBorderUppLeft = 0xC42F,
.textBorderWidth = 12,
.textBorderHeight = 1,
.padding_2 = 0
},
{ // GER_YELLOW
.language = GER_ID,
.version = YELLOW_ID,
.generation = 1,
.method = METHOD_MEW,
.payload_size = 637,
.box_data_size = 0x462,
.print_string_start = 0xC456,
.stack_overwrite_location = 0xDFDD,
.short_pkmn_name = 0x15,
.pointer_pkmn_name = 0xE3,
.padding_1 = 0,
.clearScreen = 0x16DA,
.CableClub_TextBoxBorder = 0x5BE3, // TextBoxBoarder, since the Cable Club isn't loaded
.placeString = 0x1720,
.Serial_ExchangeBytes = 0x1FC7,
._RemovePokemon = 0x7A69,
.SaveSAVtoSRAM1 = 0x1C7B03,
.SaveSAVtoSRAM2 = 0x1C7B27,
.OpenSRAM = 0x3E9C,
.SaveBox = 0,
.Bankswitch = 0x3E81, // BankswitchCommon
.SoftReset = 0x1D01,
.CloseSRAM = 0x3EAC,
.garbageDataLocation = 0x0161,
.wRemoveMonFromBox = 0xCF94,
.wBoxCount = 0xDA7F,
.wWhichPokemon = 0xCF91,
.wBoxDataStart = 0xDA7F,
.wBoxDataEnd = 0xDEE1,
.wSerialEnemyDataBlock = 0xD892,
.wEnemyMonSpecies = 0xCFE4,
.wSerialEnemyMonsPatchList = 0xC5D0,
.wSerialOtherGameboyRandomNumberListBlock = 0xCD81,
.hSerialConnectionStatus = 0xFFAA,
.transferStringLocation = 0xC444,
.textBorderUppLeft = 0xC42F,
.textBorderWidth = 12,
.textBorderHeight = 1,
.padding_2 = 0
},
{ // GER_GOLD
.language = GER_ID,
.version = GOLD_ID,
.generation = 2,
.method = METHOD_GEN2,
.payload_size = 672,
.box_data_size = 0x44E,
.print_string_start = 0xC442,
.stack_overwrite_location = 0xDFCB, // Found by seeing where 772C is stored in the stack, 772C is the code that calls PlaceString
.short_pkmn_name = 0x4E,
.pointer_pkmn_name = 0,
.padding_1 = 0,
.clearScreen = 0x000EE2,
.CableClub_TextBoxBorder = 0x0A4D88, // LinkTextboxAtHL
.placeString = 0x000F74,
.Serial_ExchangeBytes = 0x0710,
._RemovePokemon = 0x03603F, // RemoveMonFromPartyOrBox
.SaveSAVtoSRAM1 = 0,
.SaveSAVtoSRAM2 = 0,
.OpenSRAM = 0x0030E1,
.SaveBox = 0x054DF6,
.Bankswitch = 0,
.SoftReset = 0x05B0,
.CloseSRAM = 0,
.garbageDataLocation = 0x0654,
.wRemoveMonFromBox = 0x01D008, // wPokemonWithdrawDepositParameter
.wBoxCount = 0x01AD6C, // sBoxCount
.wWhichPokemon = 0x01D005, // wCurPartyMon
.wBoxDataStart = 0xAD6C, // sBoxStart
.wBoxDataEnd = 0xB1BA, // sBoxEnd
.wSerialEnemyDataBlock = 0xDD40, // wOTPartyData
.wEnemyMonSpecies = 0x01D0EF,
.wSerialEnemyMonsPatchList = 0xC5D0, // wOTPatchLists
.wSerialOtherGameboyRandomNumberListBlock = 0xD0EF, // wOTLinkBattleRNData
.hSerialConnectionStatus = 0xFFCD,
.transferStringLocation = 0xC444,
.textBorderUppLeft = 0xC42F,
.textBorderWidth = 12,
.textBorderHeight = 1,
.padding_2 = 0
},
{ // GER_SILVER
.language = GER_ID,
.version = SILVER_ID,
.generation = 2,
.method = METHOD_GEN2,
.payload_size = 672,
.box_data_size = 0x44E,
.print_string_start = 0xC442,
.stack_overwrite_location = 0xDFCB, // Found by seeing where 772C is stored in the stack, 772C is the code that calls PlaceString
.short_pkmn_name = 0x4E,
.pointer_pkmn_name = 0,
.padding_1 = 0,
.clearScreen = 0x000EE2,
.CableClub_TextBoxBorder = 0x0A4D88, // LinkTextboxAtHL
.placeString = 0x000F74,
.Serial_ExchangeBytes = 0x0710,
._RemovePokemon = 0x03603D, // RemoveMonFromPartyOrBox
.SaveSAVtoSRAM1 = 0,
.SaveSAVtoSRAM2 = 0,
.OpenSRAM = 0x0030E1,
.SaveBox = 0x054DF6,
.Bankswitch = 0,
.SoftReset = 0x05B0,
.CloseSRAM = 0,
.garbageDataLocation = 0x0654,
.wRemoveMonFromBox = 0x01D008, // wPokemonWithdrawDepositParameter
.wBoxCount = 0x01AD6C, // sBoxCount
.wWhichPokemon = 0x01D005, // wCurPartyMon
.wBoxDataStart = 0xAD6C, // sBoxStart
.wBoxDataEnd = 0xB1BA, // sBoxEnd
.wSerialEnemyDataBlock = 0xDD40, // wOTPartyData
.wEnemyMonSpecies = 0x01D0EF,
.wSerialEnemyMonsPatchList = 0xC5D0, // wOTPatchLists
.wSerialOtherGameboyRandomNumberListBlock = 0xD0EF, // wOTLinkBattleRNData
.hSerialConnectionStatus = 0xFFCD,
.transferStringLocation = 0xC444,
.textBorderUppLeft = 0xC42F,
.textBorderWidth = 12,
.textBorderHeight = 1,
.padding_2 = 0
},
{ // GER_CRYSTAL
.language = GER_ID,
.version = CRYSTAL_ID,
.generation = 2,
.method = METHOD_GEN2,
.payload_size = 672,
.box_data_size = 0x44E,
.print_string_start = 0xC544,
.stack_overwrite_location = 0xE0BB, // Found by seeing where 7622 is stored in the stack, 7622 is the code that calls PlaceString (PlaceTradePartnerNamesAndParty)
.short_pkmn_name = 0x4E,
.pointer_pkmn_name = 0,
.padding_1 = 0,
.clearScreen = 0x000FDB,
.CableClub_TextBoxBorder = 0x0A4EEF, // LinkTextboxAtHL
.placeString = 0x001078,
.Serial_ExchangeBytes = 0x075F,
._RemovePokemon = 0x036039, // RemoveMonFromPartyOrBox
.SaveSAVtoSRAM1 = 0,
.SaveSAVtoSRAM2 = 0,
.OpenSRAM = 0x002FCB,
.SaveBox = 0x054E0C,
.Bankswitch = 0,
.SoftReset = 0x0150, // Reset
.CloseSRAM = 0,
.garbageDataLocation = 0x0770,
.wRemoveMonFromBox = 0x01D10B, // wPokemonWithdrawDepositParameter
.wBoxCount = 0x01AD10, // sBoxCount
.wWhichPokemon = 0x01D109, // wCurPartyMon
.wBoxDataStart = 0x01AD10, // sBox
.wBoxDataEnd = 0x01B15E, // sBoxEnd
.wSerialEnemyDataBlock = 0xD26B, // wOTPartyData
.wEnemyMonSpecies = 0x01D206,
.wSerialEnemyMonsPatchList = 0xC6D0, // wOTPatchLists
.wSerialOtherGameboyRandomNumberListBlock = 0xD206, // wOTLinkBattleRNData
.hSerialConnectionStatus = 0xFFCB,
.transferStringLocation = 0xC544,
.textBorderUppLeft = 0xC52F,
.textBorderWidth = 12,
.textBorderHeight = 1,
.padding_2 = 0
}
};
const u16 gb_rom_values_ger_size = static_cast<u16>(sizeof(gb_rom_values_ger) / sizeof(struct GB_ROM));

View File

@ -0,0 +1,282 @@
#include "gb_rom_values/gb_rom_values.h"
const struct GB_ROM gb_rom_values_ita[] = {
{ // ITA_RED
.language = ITA_ID,
.version = RED_ID,
.generation = 1,
.method = METHOD_NEWLINE,
.payload_size = 637,
.box_data_size = 0x462,
.print_string_start = 0xC456,
.stack_overwrite_location = 0xDFDD,
.short_pkmn_name = 0xE3,
.pointer_pkmn_name = 0xFC,
.padding_1 = 0,
.clearScreen = 0x190F,
.CableClub_TextBoxBorder = 0x5B0E,
.placeString = 0x1955,
.Serial_ExchangeBytes = 0x216F,
._RemovePokemon = 0x7B7E,
.SaveSAVtoSRAM1 = 0x1C7823,
.SaveSAVtoSRAM2 = 0x1C7850,
.OpenSRAM = 0,
.SaveBox = 0,
.Bankswitch = 0x35EE,
.SoftReset = 0x1F49,
.CloseSRAM = 0,
.garbageDataLocation = 0x1F8E,
.wRemoveMonFromBox = 0xCF9A,
.wBoxCount = 0xDA85,
.wWhichPokemon = 0xCF95,
.wBoxDataStart = 0xDA85,
.wBoxDataEnd = 0xDEE7,
.wSerialEnemyDataBlock = 0xD898,
.wEnemyMonSpecies = 0xCFEA,
.wSerialEnemyMonsPatchList = 0xC5D0,
.wSerialOtherGameboyRandomNumberListBlock = 0xCD81,
.hSerialConnectionStatus = 0xFFAA,
.transferStringLocation = 0xC444,
.textBorderUppLeft = 0xC42F,
.textBorderWidth = 12,
.textBorderHeight = 1,
.padding_2 = 0
},
{ // ITA_BLUE
.language = ITA_ID,
.version = BLUE_ID,
.generation = 1,
.method = METHOD_NEWLINE,
.payload_size = 637,
.box_data_size = 0x462,
.print_string_start = 0xC456,
.stack_overwrite_location = 0xDFDD,
.short_pkmn_name = 0xE3,
.pointer_pkmn_name = 0xFC,
.padding_1 = 0,
.clearScreen = 0x190C,
.CableClub_TextBoxBorder = 0x5B41,
.placeString = 0x1952,
.Serial_ExchangeBytes = 0x216B,
._RemovePokemon = 0x7BD9,
.SaveSAVtoSRAM1 = 0x1C77B3,
.SaveSAVtoSRAM2 = 0x1C77E0,
.OpenSRAM = 0,
.SaveBox = 0,
.Bankswitch = 0x35F3,
.SoftReset = 0x1F45,
.CloseSRAM = 0,
.garbageDataLocation = 0x1F8E,
.wRemoveMonFromBox = 0xCF9A,
.wBoxCount = 0xDA85,
.wWhichPokemon = 0xCF95,
.wBoxDataStart = 0xDA85,
.wBoxDataEnd = 0xDEE7,
.wSerialEnemyDataBlock = 0xD898,
.wEnemyMonSpecies = 0xCFEA,
.wSerialEnemyMonsPatchList = 0xC5D0,
.wSerialOtherGameboyRandomNumberListBlock = 0xCD81,
.hSerialConnectionStatus = 0xFFAA,
.transferStringLocation = 0xC444,
.textBorderUppLeft = 0xC42F,
.textBorderWidth = 12,
.textBorderHeight = 1,
.padding_2 = 0
},
{ // ITA_YELLOW
.language = ITA_ID,
.version = YELLOW_ID,
.generation = 1,
.method = METHOD_MEW,
.payload_size = 637,
.box_data_size = 0x462,
.print_string_start = 0xC456,
.stack_overwrite_location = 0xDFDD,
.short_pkmn_name = 0x15,
.pointer_pkmn_name = 0xE3,
.padding_1 = 0,
.clearScreen = 0x16DA,
.CableClub_TextBoxBorder = 0x5BE3, // TextBoxBoarder, since the Cable Club isn't loaded
.placeString = 0x1720,
.Serial_ExchangeBytes = 0x1FC7,
._RemovePokemon = 0x7A69,
.SaveSAVtoSRAM1 = 0x1C7B03,
.SaveSAVtoSRAM2 = 0x1C7B27,
.OpenSRAM = 0x3E9C,
.SaveBox = 0,
.Bankswitch = 0x3E81, // BankswitchCommon
.SoftReset = 0x1D01,
.CloseSRAM = 0x3EAC,
.garbageDataLocation = 0x0161,
.wRemoveMonFromBox = 0xCF94,
.wBoxCount = 0xDA7F,
.wWhichPokemon = 0xCF91,
.wBoxDataStart = 0xDA7F,
.wBoxDataEnd = 0xDEE1,
.wSerialEnemyDataBlock = 0xD892,
.wEnemyMonSpecies = 0xCFE4,
.wSerialEnemyMonsPatchList = 0xC5D0,
.wSerialOtherGameboyRandomNumberListBlock = 0xCD81,
.hSerialConnectionStatus = 0xFFAA,
.transferStringLocation = 0xC444,
.textBorderUppLeft = 0xC42F,
.textBorderWidth = 12,
.textBorderHeight = 1,
.padding_2 = 0
},
{ // ITA_GOLD
.language = ITA_ID,
.version = GOLD_ID,
.generation = 2,
.method = METHOD_GEN2,
.payload_size = 672,
.box_data_size = 0x44E,
.print_string_start = 0xC442,
.stack_overwrite_location = 0xDFCB, // Found by seeing where 772C is stored in the stack, 772C is the code that calls PlaceString
.short_pkmn_name = 0x4E,
.pointer_pkmn_name = 0,
.padding_1 = 0,
.clearScreen = 0x000EE2,
.CableClub_TextBoxBorder = 0x0A4D88, // LinkTextboxAtHL
.placeString = 0x000F74,
.Serial_ExchangeBytes = 0x0710,
._RemovePokemon = 0x03603F, // RemoveMonFromPartyOrBox
.SaveSAVtoSRAM1 = 0,
.SaveSAVtoSRAM2 = 0,
.OpenSRAM = 0x0030E1,
.SaveBox = 0x054DF6,
.Bankswitch = 0,
.SoftReset = 0x05B0,
.CloseSRAM = 0,
.garbageDataLocation = 0x0654,
.wRemoveMonFromBox = 0x01D008, // wPokemonWithdrawDepositParameter
.wBoxCount = 0x01AD6C, // sBoxCount
.wWhichPokemon = 0x01D005, // wCurPartyMon
.wBoxDataStart = 0xAD6C, // sBoxStart
.wBoxDataEnd = 0xB1BA, // sBoxEnd
.wSerialEnemyDataBlock = 0xDD40, // wOTPartyData
.wEnemyMonSpecies = 0x01D0EF,
.wSerialEnemyMonsPatchList = 0xC5D0, // wOTPatchLists
.wSerialOtherGameboyRandomNumberListBlock = 0xD0EF, // wOTLinkBattleRNData
.hSerialConnectionStatus = 0xFFCD,
.transferStringLocation = 0xC444,
.textBorderUppLeft = 0xC42F,
.textBorderWidth = 12,
.textBorderHeight = 1,
.padding_2 = 0
},
{ // ITA_SILVER
.language = ITA_ID,
.version = SILVER_ID,
.generation = 2,
.method = METHOD_GEN2,
.payload_size = 672,
.box_data_size = 0x44E,
.print_string_start = 0xC442,
.stack_overwrite_location = 0xDFCB, // Found by seeing where 772C is stored in the stack, 772C is the code that calls PlaceString
.short_pkmn_name = 0x4E,
.pointer_pkmn_name = 0,
.padding_1 = 0,
.clearScreen = 0x000EE2,
.CableClub_TextBoxBorder = 0x0A4D88, // LinkTextboxAtHL
.placeString = 0x000F74,
.Serial_ExchangeBytes = 0x0710,
._RemovePokemon = 0x03603D, // RemoveMonFromPartyOrBox
.SaveSAVtoSRAM1 = 0,
.SaveSAVtoSRAM2 = 0,
.OpenSRAM = 0x0030E1,
.SaveBox = 0x054DF6,
.Bankswitch = 0,
.SoftReset = 0x05B0,
.CloseSRAM = 0,
.garbageDataLocation = 0x0654,
.wRemoveMonFromBox = 0x01D008, // wPokemonWithdrawDepositParameter
.wBoxCount = 0x01AD6C, // sBoxCount
.wWhichPokemon = 0x01D005, // wCurPartyMon
.wBoxDataStart = 0xAD6C, // sBoxStart
.wBoxDataEnd = 0xB1BA, // sBoxEnd
.wSerialEnemyDataBlock = 0xDD40, // wOTPartyData
.wEnemyMonSpecies = 0x01D0EF,
.wSerialEnemyMonsPatchList = 0xC5D0, // wOTPatchLists
.wSerialOtherGameboyRandomNumberListBlock = 0xD0EF, // wOTLinkBattleRNData
.hSerialConnectionStatus = 0xFFCD,
.transferStringLocation = 0xC444,
.textBorderUppLeft = 0xC42F,
.textBorderWidth = 12,
.textBorderHeight = 1,
.padding_2 = 0
},
{ // ITA_CRYSTAL
.language = ITA_ID,
.version = CRYSTAL_ID,
.generation = 2,
.method = METHOD_GEN2,
.payload_size = 672,
.box_data_size = 0x44E,
.print_string_start = 0xC544,
.stack_overwrite_location = 0xE0BB, // Found by seeing where 7622 is stored in the stack, 7622 is the code that calls PlaceString (PlaceTradePartnerNamesAndParty)
.short_pkmn_name = 0x4E,
.pointer_pkmn_name = 0,
.padding_1 = 0,
.clearScreen = 0x000FDB,
.CableClub_TextBoxBorder = 0x0A4EEF, // LinkTextboxAtHL
.placeString = 0x001078,
.Serial_ExchangeBytes = 0x075F,
._RemovePokemon = 0x036039, // RemoveMonFromPartyOrBox
.SaveSAVtoSRAM1 = 0,
.SaveSAVtoSRAM2 = 0,
.OpenSRAM = 0x002FCB,
.SaveBox = 0x054E0C,
.Bankswitch = 0,
.SoftReset = 0x0150, // Reset
.CloseSRAM = 0,
.garbageDataLocation = 0x0770,
.wRemoveMonFromBox = 0x01D10B, // wPokemonWithdrawDepositParameter
.wBoxCount = 0x01AD10, // sBoxCount
.wWhichPokemon = 0x01D109, // wCurPartyMon
.wBoxDataStart = 0x01AD10, // sBox
.wBoxDataEnd = 0x01B15E, // sBoxEnd
.wSerialEnemyDataBlock = 0xD26B, // wOTPartyData
.wEnemyMonSpecies = 0x01D206,
.wSerialEnemyMonsPatchList = 0xC6D0, // wOTPatchLists
.wSerialOtherGameboyRandomNumberListBlock = 0xD206, // wOTLinkBattleRNData
.hSerialConnectionStatus = 0xFFCB,
.transferStringLocation = 0xC544,
.textBorderUppLeft = 0xC52F,
.textBorderWidth = 12,
.textBorderHeight = 1,
.padding_2 = 0
}
};
const u16 gb_rom_values_ita_size = static_cast<u16>(sizeof(gb_rom_values_ita) / sizeof(struct GB_ROM));

View File

@ -0,0 +1,282 @@
#include "gb_rom_values/gb_rom_values.h"
const struct GB_ROM gb_rom_values_spa[] = {
{ // SPA_RED
.language = SPA_ID,
.version = RED_ID,
.generation = 1,
.method = METHOD_NEWLINE,
.payload_size = 637,
.box_data_size = 0x462,
.print_string_start = 0xC456,
.stack_overwrite_location = 0xDFDD,
.short_pkmn_name = 0xE3,
.pointer_pkmn_name = 0xFC,
.padding_1 = 0,
.clearScreen = 0x190F,
.CableClub_TextBoxBorder = 0x5B00,
.placeString = 0x1955,
.Serial_ExchangeBytes = 0x216E,
._RemovePokemon = 0x7BBB,
.SaveSAVtoSRAM1 = 0x1C77D0,
.SaveSAVtoSRAM2 = 0x1C77FD,
.OpenSRAM = 0,
.SaveBox = 0,
.Bankswitch = 0x35F5,
.SoftReset = 0x1F48,
.CloseSRAM = 0,
.garbageDataLocation = 0x1F8E,
.wRemoveMonFromBox = 0xCF9A,
.wBoxCount = 0xDA85,
.wWhichPokemon = 0xCF95,
.wBoxDataStart = 0xDA85,
.wBoxDataEnd = 0xDEE7,
.wSerialEnemyDataBlock = 0xD898,
.wEnemyMonSpecies = 0xCFEA,
.wSerialEnemyMonsPatchList = 0xC5D0,
.wSerialOtherGameboyRandomNumberListBlock = 0xCD81,
.hSerialConnectionStatus = 0xFFAA,
.transferStringLocation = 0xC444,
.textBorderUppLeft = 0xC42F,
.textBorderWidth = 12,
.textBorderHeight = 1,
.padding_2 = 0
},
{ // SPA_BLUE
.language = SPA_ID,
.version = BLUE_ID,
.generation = 1,
.method = METHOD_NEWLINE,
.payload_size = 637,
.box_data_size = 0x462,
.print_string_start = 0xC456,
.stack_overwrite_location = 0xDFDD,
.short_pkmn_name = 0xE3,
.pointer_pkmn_name = 0xFC,
.padding_1 = 0,
.clearScreen = 0x190C,
.CableClub_TextBoxBorder = 0x5B41,
.placeString = 0x1952,
.Serial_ExchangeBytes = 0x216B,
._RemovePokemon = 0x7BD9,
.SaveSAVtoSRAM1 = 0x1C77B3,
.SaveSAVtoSRAM2 = 0x1C77E0,
.OpenSRAM = 0,
.SaveBox = 0,
.Bankswitch = 0x35F3,
.SoftReset = 0x1F45,
.CloseSRAM = 0,
.garbageDataLocation = 0x1F8E,
.wRemoveMonFromBox = 0xCF9A,
.wBoxCount = 0xDA85,
.wWhichPokemon = 0xCF95,
.wBoxDataStart = 0xDA85,
.wBoxDataEnd = 0xDEE7,
.wSerialEnemyDataBlock = 0xD898,
.wEnemyMonSpecies = 0xCFEA,
.wSerialEnemyMonsPatchList = 0xC5D0,
.wSerialOtherGameboyRandomNumberListBlock = 0xCD81,
.hSerialConnectionStatus = 0xFFAA,
.transferStringLocation = 0xC444,
.textBorderUppLeft = 0xC42F,
.textBorderWidth = 12,
.textBorderHeight = 1,
.padding_2 = 0
},
{ // SPA_YELLOW
.language = SPA_ID,
.version = YELLOW_ID,
.generation = 1,
.method = METHOD_MEW,
.payload_size = 637,
.box_data_size = 0x462,
.print_string_start = 0xC456,
.stack_overwrite_location = 0xDFDD,
.short_pkmn_name = 0x15,
.pointer_pkmn_name = 0xE3,
.padding_1 = 0,
.clearScreen = 0x16DA,
.CableClub_TextBoxBorder = 0x5BE3, // TextBoxBoarder, since the Cable Club isn't loaded
.placeString = 0x1720,
.Serial_ExchangeBytes = 0x1FC7,
._RemovePokemon = 0x7A69,
.SaveSAVtoSRAM1 = 0x1C7B03,
.SaveSAVtoSRAM2 = 0x1C7B27,
.OpenSRAM = 0x3E9C,
.SaveBox = 0,
.Bankswitch = 0x3E81, // BankswitchCommon
.SoftReset = 0x1D01,
.CloseSRAM = 0x3EAC,
.garbageDataLocation = 0x0161,
.wRemoveMonFromBox = 0xCF94,
.wBoxCount = 0xDA7F,
.wWhichPokemon = 0xCF91,
.wBoxDataStart = 0xDA7F,
.wBoxDataEnd = 0xDEE1,
.wSerialEnemyDataBlock = 0xD892,
.wEnemyMonSpecies = 0xCFE4,
.wSerialEnemyMonsPatchList = 0xC5D0,
.wSerialOtherGameboyRandomNumberListBlock = 0xCD81,
.hSerialConnectionStatus = 0xFFAA,
.transferStringLocation = 0xC444,
.textBorderUppLeft = 0xC42F,
.textBorderWidth = 12,
.textBorderHeight = 1,
.padding_2 = 0
},
{ // SPA_GOLD
.language = SPA_ID,
.version = GOLD_ID,
.generation = 2,
.method = METHOD_GEN2,
.payload_size = 672,
.box_data_size = 0x44E,
.print_string_start = 0xC442,
.stack_overwrite_location = 0xDFCB, // Found by seeing where 772C is stored in the stack, 772C is the code that calls PlaceString
.short_pkmn_name = 0x4E,
.pointer_pkmn_name = 0,
.padding_1 = 0,
.clearScreen = 0x000EE2,
.CableClub_TextBoxBorder = 0x0A4D88, // LinkTextboxAtHL
.placeString = 0x000F74,
.Serial_ExchangeBytes = 0x0710,
._RemovePokemon = 0x03603F, // RemoveMonFromPartyOrBox
.SaveSAVtoSRAM1 = 0,
.SaveSAVtoSRAM2 = 0,
.OpenSRAM = 0x0030E1,
.SaveBox = 0x054DF6,
.Bankswitch = 0,
.SoftReset = 0x05B0,
.CloseSRAM = 0,
.garbageDataLocation = 0x0654,
.wRemoveMonFromBox = 0x01D008, // wPokemonWithdrawDepositParameter
.wBoxCount = 0x01AD6C, // sBoxCount
.wWhichPokemon = 0x01D005, // wCurPartyMon
.wBoxDataStart = 0xAD6C, // sBoxStart
.wBoxDataEnd = 0xB1BA, // sBoxEnd
.wSerialEnemyDataBlock = 0xDD40, // wOTPartyData
.wEnemyMonSpecies = 0x01D0EF,
.wSerialEnemyMonsPatchList = 0xC5D0, // wOTPatchLists
.wSerialOtherGameboyRandomNumberListBlock = 0xD0EF, // wOTLinkBattleRNData
.hSerialConnectionStatus = 0xFFCD,
.transferStringLocation = 0xC444,
.textBorderUppLeft = 0xC42F,
.textBorderWidth = 12,
.textBorderHeight = 1,
.padding_2 = 0
},
{ // SPA_SILVER
.language = SPA_ID,
.version = SILVER_ID,
.generation = 2,
.method = METHOD_GEN2,
.payload_size = 672,
.box_data_size = 0x44E,
.print_string_start = 0xC442,
.stack_overwrite_location = 0xDFCB, // Found by seeing where 772C is stored in the stack, 772C is the code that calls PlaceString
.short_pkmn_name = 0x4E,
.pointer_pkmn_name = 0,
.padding_1 = 0,
.clearScreen = 0x000EE2,
.CableClub_TextBoxBorder = 0x0A4D88, // LinkTextboxAtHL
.placeString = 0x000F74,
.Serial_ExchangeBytes = 0x0710,
._RemovePokemon = 0x03603D, // RemoveMonFromPartyOrBox
.SaveSAVtoSRAM1 = 0,
.SaveSAVtoSRAM2 = 0,
.OpenSRAM = 0x0030E1,
.SaveBox = 0x054DF6,
.Bankswitch = 0,
.SoftReset = 0x05B0,
.CloseSRAM = 0,
.garbageDataLocation = 0x0654,
.wRemoveMonFromBox = 0x01D008, // wPokemonWithdrawDepositParameter
.wBoxCount = 0x01AD6C, // sBoxCount
.wWhichPokemon = 0x01D005, // wCurPartyMon
.wBoxDataStart = 0xAD6C, // sBoxStart
.wBoxDataEnd = 0xB1BA, // sBoxEnd
.wSerialEnemyDataBlock = 0xDD40, // wOTPartyData
.wEnemyMonSpecies = 0x01D0EF,
.wSerialEnemyMonsPatchList = 0xC5D0, // wOTPatchLists
.wSerialOtherGameboyRandomNumberListBlock = 0xD0EF, // wOTLinkBattleRNData
.hSerialConnectionStatus = 0xFFCD,
.transferStringLocation = 0xC444,
.textBorderUppLeft = 0xC42F,
.textBorderWidth = 12,
.textBorderHeight = 1,
.padding_2 = 0
},
{ // SPA_CRYSTAL
.language = SPA_ID,
.version = CRYSTAL_ID,
.generation = 2,
.method = METHOD_GEN2,
.payload_size = 672,
.box_data_size = 0x44E,
.print_string_start = 0xC544,
.stack_overwrite_location = 0xE0BB, // Found by seeing where 7622 is stored in the stack, 7622 is the code that calls PlaceString (PlaceTradePartnerNamesAndParty)
.short_pkmn_name = 0x4E,
.pointer_pkmn_name = 0,
.padding_1 = 0,
.clearScreen = 0x000FDB,
.CableClub_TextBoxBorder = 0x0A4EEF, // LinkTextboxAtHL
.placeString = 0x001078,
.Serial_ExchangeBytes = 0x075F,
._RemovePokemon = 0x036039, // RemoveMonFromPartyOrBox
.SaveSAVtoSRAM1 = 0,
.SaveSAVtoSRAM2 = 0,
.OpenSRAM = 0x002FCB,
.SaveBox = 0x054E0C,
.Bankswitch = 0,
.SoftReset = 0x0150, // Reset
.CloseSRAM = 0,
.garbageDataLocation = 0x0770,
.wRemoveMonFromBox = 0x01D10B, // wPokemonWithdrawDepositParameter
.wBoxCount = 0x01AD10, // sBoxCount
.wWhichPokemon = 0x01D109, // wCurPartyMon
.wBoxDataStart = 0x01AD10, // sBox
.wBoxDataEnd = 0x01B15E, // sBoxEnd
.wSerialEnemyDataBlock = 0xD26B, // wOTPartyData
.wEnemyMonSpecies = 0x01D206,
.wSerialEnemyMonsPatchList = 0xC6D0, // wOTPatchLists
.wSerialOtherGameboyRandomNumberListBlock = 0xD206, // wOTLinkBattleRNData
.hSerialConnectionStatus = 0xFFCB,
.transferStringLocation = 0xC544,
.textBorderUppLeft = 0xC52F,
.textBorderWidth = 12,
.textBorderHeight = 1,
.padding_2 = 0
}
};
const u16 gb_rom_values_spa_size = static_cast<u16>(sizeof(gb_rom_values_spa) / sizeof(struct GB_ROM));

View File

@ -26,11 +26,19 @@ void generate_payloads_for(uint8_t generation, bool yellow_version, const char *
const struct GB_ROM *rom_value_sets[] = {
gb_rom_values_eng,
gb_rom_values_fre};
gb_rom_values_fre,
gb_rom_values_ger,
gb_rom_values_ita,
gb_rom_values_spa,
};
const u16 rom_value_sizes[] = {
gb_rom_values_eng_size,
gb_rom_values_fre_size};
gb_rom_values_fre_size,
gb_rom_values_ger_size,
gb_rom_values_ita_size,
gb_rom_values_spa_size,
};
const u8 num_elements = sizeof(rom_value_sizes) / sizeof(u16);
@ -83,7 +91,7 @@ void generate_payloads_for(uint8_t generation, bool yellow_version, const char *
void test_payloads(const char *full_path)
{
uint8_t buffer[2048]; // 2048 bytes is enough for the payloads
uint8_t buffer[4096]; // 4096 bytes is enough for the payloads
uint8_t reference_payload_buffer[PAYLOAD_SIZE];
uint8_t reconstructed_payload_buffer[PAYLOAD_SIZE];
FILE *file;
@ -100,11 +108,19 @@ void test_payloads(const char *full_path)
const struct GB_ROM *rom_value_sets[] = {
gb_rom_values_eng,
gb_rom_values_fre};
gb_rom_values_fre,
gb_rom_values_ger,
gb_rom_values_ita,
gb_rom_values_spa,
};
const u16 rom_value_sizes[] = {
gb_rom_values_eng_size,
gb_rom_values_fre_size};
gb_rom_values_fre_size,
gb_rom_values_ger_size,
gb_rom_values_ita_size,
gb_rom_values_spa_size,
};
const u8 num_elements = sizeof(rom_value_sizes) / sizeof(u16);
@ -188,7 +204,7 @@ int main(int argc, char **argv)
{
printf("Converting data into bin files!\n[");
const char *output_path = (argc > 1) ? argv[1] : "";
generate_and_test_payloads_for(1, false, output_path, "gb_gen1_payloads_RB.bin");
generate_and_test_payloads_for(1, true, output_path, "gb_gen1_payloads_Y.bin");
generate_and_test_payloads_for(2, false, output_path, "gb_gen2_payloads.bin");