diff --git a/Makefile b/Makefile index f5484be..52d2814 100644 --- a/Makefile +++ b/Makefile @@ -59,7 +59,6 @@ LIBPCCS := $(CURDIR)/PCCS # #--------------------------------------------------------------------------------- TARGET := $(notdir $(CURDIR))_mb -LOADERNAME := $(notdir $(CURDIR))_standalone BUILD := build GENERATED_DIR := $(BUILD)/generated SOURCES := source @@ -138,6 +137,11 @@ 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 #--------------------------------------------------------------------------------- @@ -158,13 +162,9 @@ export OFILES_GRAPHICS := $(PNGFILES:.png=.o) export OFILES := $(OFILES_SOURCES) $(OFILES_GRAPHICS) -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 HFILES := $(addsuffix .h,$(subst .,_,$(BINFILES))) $(PNGFILES:.png=.h) \ + $(CURDIR)/$(GENERATED_DIR)/translated_text.h \ + $(CURDIR)/$(GENERATED_DIR)/fonts.h export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir)) \ $(foreach dir,$(LIBDIRS),-I$(dir)/include) \ @@ -238,7 +238,6 @@ $(BUILD_STAMP): generate_data | $(BUILD) @mkdir -p loader/data @cp $(TARGET).gba loader/data/multiboot_rom.bin @$(MAKE) -C loader - @cp loader/loader.gba $(LOADERNAME).gba @touch $@ $(BUILD): @@ -250,8 +249,6 @@ 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 tools/text_helper/build @rm -fr $(GENERATED_DIR) @@ -283,9 +280,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 f7efdf5..f680140 100644 --- a/README.md +++ b/README.md @@ -19,24 +19,14 @@ 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 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. +- 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. 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 deleted file mode 100644 index 5ca0021..0000000 Binary files a/audio/main_menu.xm and /dev/null differ diff --git a/docs/EZ_Flash_Omega_DE.md b/docs/EZ_Flash_Omega_DE.md index 18de35a..a865902 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 Poke_Transporter_GB_standalone.gba is stored on the microSD card of the EZ Flash Omega DE +- Make sure the loader.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 Poke_Transporter_GB_standalone.gba +- Insert the EZ Flash in GBA 1 and launch loader.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 deleted file mode 100644 index d94c2fd..0000000 --- a/include/sound.h +++ /dev/null @@ -1,94 +0,0 @@ -#ifndef _SOUND_H -#define _SOUND_H - -#include - -#include "soundbank.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void* PTGBSFXHandle; - -/** - * @brief The API's defined here are a thin abstraction layer over the sound engine functions. - * This allows the underlying sound engine to be swapped out without affecting the rest of the codebase. - */ - -/** - * @brief This function initializes the sound engine and sets up a VBLANK handler - * to process audio every frame. It should be called during the initialization phase of the program. - */ -bool sound_init(void); - -/** - * @brief This function starts playing the song at the given index. - * If loop is true, the song will loop indefinitely until stopped or another song is played. - * - * @param song_index The index of the song to play. - * @param loop Whether the song should loop indefinitely. - */ -void play_song(u32 song_index, bool loop); - -/** - * @brief This function checks if a song is currently playing. - * - * @return true if a song is playing, false otherwise. - */ -bool is_song_playing(void); - -/** - * @brief This function stops the currently playing song. - */ -void stop_song(void); - -/** - * @brief This function plays the sound effect at the given index. - * Sound effects are typically short audio clips that play in response to specific events in the game, - * such as button presses or character actions. - * These are usually raw PCM samples (e.g., WAV files) - * - * To play a MOD- S3M- XM- or IT format based sound effect, - * use the play_jingle function instead. - */ -PTGBSFXHandle play_sound_effect(u32 sound_effect_index); - -/** - * @brief This function stops the given sound effect from playing and invalidates the handle - */ -void stop_sound_effect(PTGBSFXHandle handle); - -/** - * @brief This function stops all currently playing sound effects and resets - */ -void stop_all_sound_effects(void); - -/** - * @brief This function marks the sound effect as unimportant, - * allowing the sound engine to stop it if it needs to free up channels for new sound effects. - * - * It also invalidates the handle, so it should not be used after calling this function. - */ -void release_sound_effect(PTGBSFXHandle handle); - -/** - * @brief This function plays a jingle at the given index. - * A jingle is a sound effect that is based on a tracker format like MOD, S3M, XM, or IT. - * They can be played simultaneously with songs. - * If you want to play PCM-based sound effects (e.g., WAV files), use the play_sound_effect function instead. - * - * Note that jingles must be limited to 4 channels only. (https://blocksds.skylyrac.net/maxmod/group__gba__jingle__playback.html) - */ -void play_jingle(u32 jingle_index); - -/** - * @brief Checks if a jingle is actively playing. - */ -bool is_jingle_playing(void); - -#ifdef __cplusplus -} -#endif - -#endif \ No newline at end of file diff --git a/source/custom_malloc.cpp b/source/custom_malloc.cpp index 2c5079a..e521f8c 100644 --- a/source/custom_malloc.cpp +++ b/source/custom_malloc.cpp @@ -201,9 +201,6 @@ 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) { @@ -336,8 +333,6 @@ 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 25fb047..9c69ab7 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -1,5 +1,6 @@ #include #include +// #include //Music #include "libstd_replacements.h" #include "flash_mem.h" #include "interrupt.h" @@ -29,7 +30,6 @@ #include "libraries/Pokemon-Gen3-to-Gen-X/include/save.h" #include "text_data_table.h" #include "custom_malloc.h" -#include "sound.h" /* @@ -53,6 +53,36 @@ 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)) @@ -76,6 +106,8 @@ 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; @@ -84,7 +116,9 @@ void initalization_script(void) // Sound bank init irq_init(NULL); irq_enable(II_VBLANK); - sound_init(); + // irq_set(II_VBLANK, mmVBlank, 0); //Music + // mmInitDefault((mm_addr)soundbank_bin, 8); //Music + // mmStart(MOD_FLATOUTLIES, MM_PLAY_LOOP); //Music // Graphics init oam_init(obj_buffer, 128); @@ -303,7 +337,6 @@ 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 deleted file mode 100644 index 29bf420..0000000 --- a/source/sound.c +++ /dev/null @@ -1,68 +0,0 @@ -#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 c2266aa..40a4886 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,11 +7,5 @@ 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 a188f17..6ded699 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 deleted file mode 100644 index c325239..0000000 --- a/tools/payload-generator/src/gb_rom_values/gb_rom_values_ger.cpp +++ /dev/null @@ -1,282 +0,0 @@ -#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 deleted file mode 100644 index 5688413..0000000 --- a/tools/payload-generator/src/gb_rom_values/gb_rom_values_ita.cpp +++ /dev/null @@ -1,282 +0,0 @@ -#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 deleted file mode 100644 index 7d21742..0000000 --- a/tools/payload-generator/src/gb_rom_values/gb_rom_values_spa.cpp +++ /dev/null @@ -1,282 +0,0 @@ -#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 1234c19..fe447ec 100644 --- a/tools/payload-generator/src/main.cpp +++ b/tools/payload-generator/src/main.cpp @@ -26,19 +26,11 @@ 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_ger, - gb_rom_values_ita, - gb_rom_values_spa, - }; + gb_rom_values_fre}; const u16 rom_value_sizes[] = { gb_rom_values_eng_size, - gb_rom_values_fre_size, - gb_rom_values_ger_size, - gb_rom_values_ita_size, - gb_rom_values_spa_size, - }; + gb_rom_values_fre_size}; const u8 num_elements = sizeof(rom_value_sizes) / sizeof(u16); @@ -91,7 +83,7 @@ void generate_payloads_for(uint8_t generation, bool yellow_version, const char * void test_payloads(const char *full_path) { - uint8_t buffer[4096]; // 4096 bytes is enough for the payloads + uint8_t buffer[2048]; // 2048 bytes is enough for the payloads uint8_t reference_payload_buffer[PAYLOAD_SIZE]; uint8_t reconstructed_payload_buffer[PAYLOAD_SIZE]; FILE *file; @@ -108,19 +100,11 @@ 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_ger, - gb_rom_values_ita, - gb_rom_values_spa, - }; + gb_rom_values_fre}; const u16 rom_value_sizes[] = { gb_rom_values_eng_size, - gb_rom_values_fre_size, - gb_rom_values_ger_size, - gb_rom_values_ita_size, - gb_rom_values_spa_size, - }; + gb_rom_values_fre_size}; const u8 num_elements = sizeof(rom_value_sizes) / sizeof(u16); @@ -204,7 +188,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");