From 12f710dafcbacc598763cb27d5d86076ac74409f Mon Sep 17 00:00:00 2001 From: GearsProgress Date: Mon, 9 Mar 2026 12:09:57 -0400 Subject: [PATCH] Reapply "Release candidate" This reverts commit 67aa92710814dc504529a886957499d953cec47b. --- Makefile | 23 +- README.md | 16 +- audio/main_menu.xm | Bin 0 -> 29137 bytes docs/EZ_Flash_Omega_DE.md | 4 +- include/sound.h | 2 +- source/custom_malloc.cpp | 5 + source/main.cpp | 39 +-- source/sound.c | 68 +++++ .../include/gb_rom_values/gb_rom_values.h | 6 + .../src/gb_rom_values/gb_rom_values_fre.cpp | 2 +- .../src/gb_rom_values/gb_rom_values_ger.cpp | 282 ++++++++++++++++++ .../src/gb_rom_values/gb_rom_values_ita.cpp | 282 ++++++++++++++++++ .../src/gb_rom_values/gb_rom_values_spa.cpp | 282 ++++++++++++++++++ tools/payload-generator/src/main.cpp | 28 +- 14 files changed, 980 insertions(+), 59 deletions(-) create mode 100644 audio/main_menu.xm create mode 100644 source/sound.c create mode 100644 tools/payload-generator/src/gb_rom_values/gb_rom_values_ger.cpp create mode 100644 tools/payload-generator/src/gb_rom_values/gb_rom_values_ita.cpp create mode 100644 tools/payload-generator/src/gb_rom_values/gb_rom_values_spa.cpp 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 0000000000000000000000000000000000000000..5ca0021cd5caa4df089c4301e1adf763f690c242 GIT binary patch literal 29137 zcmeIad7N9WTV#j%q( zPER~N-J`_GDCzlpGM<_A#MA!F#O=-`c9M4FII$J4Wy`Xt%`R#!aRtdD3#>v_Jpd2D z+uwXIilk_pR-DgtrvI=|WEJpm-@Rw~opaB*@1A?-Z-4MT@BhX3{9@zBe(e{3>sR0N znuc_V*OniE6Smu$i4taPvP;p>#&x%Yv4P4{>1-T3)G@2!~kpZ_5K-hb}((TaZlEjMkv{U~kE zy)L?Tq20N!{*hJ}-TAV;ee61=B!76XI_mYJJ}->&GUL9|=KhQHcR?B#koLe{_3qI~FR#5zHsj*#xqC0r`2D)PRNMP6-Ro}cJVh7xx*?8>seIrP4L4dL z*q6jevrAI>(%moL_Wp~;dHI&#kN5MWUts6^F#gXY&glyZzA*l!%=`WaF46E(;+$45 zDbAPfzDP)yXnX$yS61Y0_F#Ygr1*6{qf&VI!y+pq+Vdx)`?IjvQ z<0X5%q;y}p|00=P0@xd1{lWYFCs_X_I{oJo>q}VrN5p!GhL;xWC4eZb^`-kS66+<} zjzIgswesvGgz){5`+D`9NBHn{^8F87XQJ7QQ2F6I3}`)n`2wRO-|*q9WJY>m@Auwv zDL;DgD3@RQ7CL0G@0f5#&R2{weTiGZ+lO!X?prq8#sgRWpzQ(p^&>uBb;&yr$9Iw> z_z(jNXcTj=n+Zn}W@2d=&JEtin-MFJa9a6$S1UvzR_TNgBW(I^kRj9Sircj3N` z+2Q+X2FMD{oY&fgyIw{)=WjWuxC^(SpPRm~enw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g!d}X*c72RXcPVqe2FtG4Nk7a<&D~+OeUBO&IMW#G+;x9`AEBv zfVP>ZfUJPdh(9=FwO`;!Op9>Gb?hC^aUyWRB0TUzG)&km6F{wadI27Bhbqz zL|_*;iN?W>I0Fl3A(RPI;^aLcHZpcbgH3^)4bI^k{*aG2=Z-XO#590|4<3#Qs<3!K zfb9#DFbI?o0;nHR#q7pGd?SrRiSS%P#X`1XFvjNNNFpPagiQ-&j-IrRJc?NAhi3+5 zY?RD-a6E}4rW;9w`9my53j)OnS3**wMuKTbWR;%vdz?igurpEtcpg2{5l|Ir^Tvx0 zbPJs?_uBT#my+~~5J15zLU=_88_wVrB)o!zSCFtFfme|53KCvH!UYMuVh*pE!v!$B L5-0pOGKc>cXDLQ& literal 0 HcmV?d00001 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");