diff --git a/Makefile b/Makefile index af95f5b..a68159e 100644 --- a/Makefile +++ b/Makefile @@ -77,6 +77,7 @@ LIBPCCS := $(CURDIR)/PCCS # #--------------------------------------------------------------------------------- TARGET := $(notdir $(CURDIR))_mb +LOADERNAME := $(notdir $(CURDIR))_standalone BUILD := build GENERATED_DIR := $(BUILD)/generated SOURCES := source @@ -155,11 +156,6 @@ CPPFILES := $(sort $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) PNGFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.png))) -#ifneq ($(strip $(MUSIC)),) -# export AUDIOFILES := $(foreach dir,$(notdir $(wildcard $(MUSIC)/*.*)),$(CURDIR)/$(MUSIC)/$(dir)) -# BINFILES += soundbank.bin -#endif - #--------------------------------------------------------------------------------- # use CXX for linking C++ projects, CC for standard C #--------------------------------------------------------------------------------- @@ -180,9 +176,13 @@ export OFILES_GRAPHICS := $(PNGFILES:.png=.o) export OFILES := $(OFILES_SOURCES) $(OFILES_GRAPHICS) -export HFILES := $(addsuffix .h,$(subst .,_,$(BINFILES))) $(PNGFILES:.png=.h) \ - $(CURDIR)/$(GENERATED_DIR)/translated_text.h \ - $(CURDIR)/$(GENERATED_DIR)/fonts.h +ifneq ($(strip $(MUSIC)),) + export AUDIOFILES := $(foreach dir,$(notdir $(wildcard $(MUSIC)/*.*)),$(CURDIR)/$(MUSIC)/$(dir)) + BINFILES += soundbank.bin + OFILES += soundbank.bin.o +endif + +export HFILES := $(addsuffix .h,$(subst .,_,$(BINFILES))) $(PNGFILES:.png=.h) export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir)) \ $(foreach dir,$(LIBDIRS),-I$(dir)/include) \ @@ -264,6 +264,7 @@ $(BUILD_STAMP): $(GENERATE_STAMP) | $(BUILD) @mkdir -p loader/data @cp $(TARGET).gba loader/data/multiboot_rom.bin @$(MAKE) -C loader + @cp loader/loader.gba $(LOADERNAME).gba @touch $@ $(BUILD): @@ -275,6 +276,8 @@ clean: @$(MAKE) -C tools/payload-generator clean @$(MAKE) -C loader clean @$(MAKE) -C PCCS clean + @rm -fr $(BUILD) $(TARGET).elf $(TARGET).gba $(LOADERNAME).gba data/ to_compress/ + @rm -f text_helper/output.json @rm -fr $(BUILD) $(TARGET).elf $(TARGET).gba data/ to_compress/ @rm -fr $(GENERATED_DIR) @@ -305,9 +308,9 @@ $(OFILES_SOURCES) : $(HFILES) #--------------------------------------------------------------------------------- # rule to build soundbank from music files #--------------------------------------------------------------------------------- -#soundbank.bin soundbank.h : $(AUDIOFILES) +soundbank.bin soundbank.h : $(AUDIOFILES) #--------------------------------------------------------------------------------- -# @mmutil $^ -osoundbank.bin -hsoundbank.h + @mmutil $^ -osoundbank.bin -hsoundbank.h #--------------------------------------------------------------------------------- # This rule links in binary data with the .bin extension diff --git a/README.md b/README.md index f680140..f7efdf5 100644 --- a/README.md +++ b/README.md @@ -19,14 +19,24 @@ Poke Transporter GB supports original gen III cartridges AND the gen III games i Poké Transporter GB is a Multiboot program for the Game Boy Advance. There are 3 main ways to run the Poké Transporter GB ROM on a Game Boy Advance: -- Use a program such as FIX94's [GBA Link Cable ROM Sender](https://github.com/FIX94/gba-link-cable-rom-sender) on a GameCube or Wii running Homebrew along with a GBA GameCube Link Cable -- Upload the Multiboot ROM to a GBA Flash Cart, launch the game in Multiboot mode (often by holding L when selecting the ROM), and swap the Game Pak after the program loads. -- Copy the loader.gba file to a GBA Flash Cart and swap the Game Pak after the program loads. This is useful for flashcarts that don't support launching multiboot roms directly (SuperCard SD for example), although it should work on any flashcart. +- Use a program such as FIX94's [GBA Link Cable ROM Sender](https://github.com/FIX94/gba-link-cable-rom-sender) on a GameCube or Wii running Homebrew along with a GBA GameCube Link Cable to send the Multiboot rom (Poke_Transporter_GB_mb.gba) to the gba over the link cable. + +- Upload the Multiboot ROM (Poke_Transporter_GB_mb.gba) to a GBA Flash Cart, launch the game in Multiboot mode (often by holding L when selecting the ROM), and swap the Game Pak after the program loads. + +- Copy the Loader ROM (Poke_Transporter_GB_standalone.gba) to a GBA Flash Cart and swap the Game Pak after the program loads. This is useful for flashcarts that don't support launching multiboot roms directly (SuperCard SD for example), although it should work on any flashcart. EZ Flash Omega DE users, read [this](docs/EZ_Flash_Omega_DE.md)! Please note that transfering Pokémon will only work with a Game Boy Color Link Cable. Game Boy Advance Link Cables will not work. +NOTE: If you're using the Loader ROM (Poke_Transporter_GB_standalone.gba) instead of the Multiboot ROM (Poke_Transporter_GB_mb.gba), +you could run into trouble when swapping in the gen3 cartridge: Some cartridges cause the GBA to reset when inserted. + +If you have this problem, you could: +- Use the Multiboot ROM (Poke_Transporter_GB_mb.gba) instead (as described above) + +- Use the 2 GBA method as described [here](docs/EZ_Flash_Omega_DE.md#method-2-2-gbas) + ## Modifications to Transfered Pokémon Poké Transporter GB utilizes the Pokémon Community Conversion Standard for converting Pokémon from Generation 1 and 2 to Generation 3. You can view the documentation for the PCCS [here](https://github.com/GearsProgress/Pokemon-Community-Conversion-Standard)! diff --git a/audio/main_menu.xm b/audio/main_menu.xm new file mode 100644 index 0000000..5ca0021 Binary files /dev/null and b/audio/main_menu.xm differ diff --git a/docs/EZ_Flash_Omega_DE.md b/docs/EZ_Flash_Omega_DE.md index a865902..18de35a 100644 --- a/docs/EZ_Flash_Omega_DE.md +++ b/docs/EZ_Flash_Omega_DE.md @@ -43,10 +43,10 @@ Requirements: - Gameboy Color link cable Steps: -- Make sure the loader.gba is stored on the microSD card of the EZ Flash Omega DE +- Make sure the Poke_Transporter_GB_standalone.gba is stored on the microSD card of the EZ Flash Omega DE - Make sure the pokémon game is stored on your EZ Flash' NOR flash. - Make sure the physical switch on the EZ Flash is set to mode A (the menu should show) -- Insert the EZ Flash in GBA 1 and launch loader.gba. +- Insert the EZ Flash in GBA 1 and launch Poke_Transporter_GB_standalone.gba - Press START on the splash screen. This popup should show: ![multiboot popup 1](images/multiboot_popup_1.png) - Press SELECT. This popup should show: diff --git a/include/sound.h b/include/sound.h index cda4a93..d94c2fd 100644 --- a/include/sound.h +++ b/include/sound.h @@ -9,7 +9,7 @@ extern "C" { #endif -typedef unsigned short PTGBSFXHandle; +typedef void* PTGBSFXHandle; /** * @brief The API's defined here are a thin abstraction layer over the sound engine functions. diff --git a/source/custom_malloc.cpp b/source/custom_malloc.cpp index e521f8c..2c5079a 100644 --- a/source/custom_malloc.cpp +++ b/source/custom_malloc.cpp @@ -201,6 +201,9 @@ void malloc_init_default_pool(void) memset(g_alloc_map, 0, sizeof(g_alloc_map)); // Clear bitmap } +extern "C" +{ + /// @brief The custom implementation of the bitmap allocator described at the top of this module. void* malloc(size_t size) { @@ -333,6 +336,8 @@ void _free_r(struct _reent *r, void* ptr) { return free(ptr); } +} + #else void malloc_init_default_pool(void) diff --git a/source/main.cpp b/source/main.cpp index 53ab27b..3fda236 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -1,6 +1,5 @@ #include #include -// #include //Music #include "libstd_replacements.h" #include "flash_mem.h" #include "interrupt.h" @@ -30,6 +29,7 @@ #include "libraries/Pokemon-Gen3-to-Gen-X/include/save.h" #include "text_data_table.h" #include "custom_malloc.h" +#include "sound.h" /* @@ -53,36 +53,6 @@ bool skip = true; rom_data curr_GBA_rom; Button_Menu yes_no_menu(1, 2, 40, 24, false); -/* -int test_main(void) Music -{ - - irq_init(NULL); - // Initialize maxmod with default settings - // pass soundbank address, and allocate 8 channels. - - irq_set(II_VBLANK, mmVBlank, 0); - irq_enable(II_VBLANK); - - mmInitDefault((mm_addr)soundbank_bin, 8); - - mmStart(MOD_FLATOUTLIES, MM_PLAY_LOOP); - // Song is playing now (well... almost) - while (1) - { - // ..process game logic.. - - // Update Maxmod - mmFrame(); - - // Wait for new frame (SWI 5) - VBlankIntrWait(); - - // ..update graphical data.. - } -} -*/ - // (R + G*32 + B*1024) #define RGB(r, g, b) (r + (g * 32) + (b * 1024)) @@ -106,8 +76,6 @@ void initalization_script(void) { // Initalizations REG_DISPCNT = DCNT_BLANK | DCNT_MODE0 | DCNT_BG0 | DCNT_BG1 | DCNT_BG2 | DCNT_BG3 | DCNT_OBJ | DCNT_OBJ_1D; - irq_init(NULL); - irq_enable(II_VBLANK); // Disable for save data read/write REG_IME = 0; @@ -116,9 +84,7 @@ void initalization_script(void) // Sound bank init irq_init(NULL); irq_enable(II_VBLANK); - // irq_set(II_VBLANK, mmVBlank, 0); //Music - // mmInitDefault((mm_addr)soundbank_bin, 8); //Music - // mmStart(MOD_FLATOUTLIES, MM_PLAY_LOOP); //Music + sound_init(); // Graphics init oam_init(obj_buffer, 128); @@ -337,6 +303,7 @@ int main_menu_loop() general_text.decompress(get_compressed_text_table(GENERAL_INDEX)); + play_song(MOD_MAIN_MENU, true); while (true) { if (update) diff --git a/source/sound.c b/source/sound.c new file mode 100644 index 0000000..29bf420 --- /dev/null +++ b/source/sound.c @@ -0,0 +1,68 @@ +#include +#include "sound.h" +#include "soundbank_bin.h" + +static void sound_irq_handler(void) +{ + mmVBlank(); + mmFrame(); +} + +bool sound_init(void) +{ + irq_add(II_VBLANK, sound_irq_handler); + + mm_addr soundbank = (mm_addr)soundbank_bin; + if (!soundbank) + { + return false; + } + + mmInitDefault(soundbank, 16); + return true; +} + +void play_song(u32 song_index, bool loop) +{ + mmStart(song_index, loop ? MM_PLAY_LOOP : MM_PLAY_ONCE); +} + +bool is_song_playing(void) +{ + return mmActive(); +} + +void stop_song(void) +{ + mmStop(); +} + +PTGBSFXHandle play_sound_effect(u32 sound_effect_index) +{ + return (PTGBSFXHandle)mmEffect(sound_effect_index); +} + +void stop_sound_effect(PTGBSFXHandle handle) +{ + mmEffectCancel((mm_sfxhand)handle); +} + +void stop_all_sound_effects(void) +{ + mmEffectCancelAll(); +} + +void release_sound_effect(PTGBSFXHandle handle) +{ + mmEffectRelease((mm_sfxhand)handle); +} + +void play_jingle(u32 jingle_index) +{ + mmJingle(jingle_index); +} + +bool is_jingle_playing(void) +{ + return mmActiveSub(); +} \ No newline at end of file diff --git a/tools/payload-generator/include/gb_rom_values/gb_rom_values.h b/tools/payload-generator/include/gb_rom_values/gb_rom_values.h index 40a4886..c2266aa 100644 --- a/tools/payload-generator/include/gb_rom_values/gb_rom_values.h +++ b/tools/payload-generator/include/gb_rom_values/gb_rom_values.h @@ -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 \ No newline at end of file diff --git a/tools/payload-generator/src/gb_rom_values/gb_rom_values_fre.cpp b/tools/payload-generator/src/gb_rom_values/gb_rom_values_fre.cpp index 6ded699..a188f17 100644 --- a/tools/payload-generator/src/gb_rom_values/gb_rom_values_fre.cpp +++ b/tools/payload-generator/src/gb_rom_values/gb_rom_values_fre.cpp @@ -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, diff --git a/tools/payload-generator/src/gb_rom_values/gb_rom_values_ger.cpp b/tools/payload-generator/src/gb_rom_values/gb_rom_values_ger.cpp new file mode 100644 index 0000000..c325239 --- /dev/null +++ b/tools/payload-generator/src/gb_rom_values/gb_rom_values_ger.cpp @@ -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(sizeof(gb_rom_values_ger) / sizeof(struct GB_ROM)); \ No newline at end of file diff --git a/tools/payload-generator/src/gb_rom_values/gb_rom_values_ita.cpp b/tools/payload-generator/src/gb_rom_values/gb_rom_values_ita.cpp new file mode 100644 index 0000000..5688413 --- /dev/null +++ b/tools/payload-generator/src/gb_rom_values/gb_rom_values_ita.cpp @@ -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(sizeof(gb_rom_values_ita) / sizeof(struct GB_ROM)); \ No newline at end of file diff --git a/tools/payload-generator/src/gb_rom_values/gb_rom_values_spa.cpp b/tools/payload-generator/src/gb_rom_values/gb_rom_values_spa.cpp new file mode 100644 index 0000000..7d21742 --- /dev/null +++ b/tools/payload-generator/src/gb_rom_values/gb_rom_values_spa.cpp @@ -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(sizeof(gb_rom_values_spa) / sizeof(struct GB_ROM)); \ No newline at end of file diff --git a/tools/payload-generator/src/main.cpp b/tools/payload-generator/src/main.cpp index fe447ec..1234c19 100644 --- a/tools/payload-generator/src/main.cpp +++ b/tools/payload-generator/src/main.cpp @@ -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");