diff --git a/PCCS b/PCCS index 8323de8..d58ba0d 160000 --- a/PCCS +++ b/PCCS @@ -1 +1 @@ -Subproject commit 8323de881a97454a72ca753e9a998f20d80e131a +Subproject commit d58ba0ddea7ff80dfc2301eb500f7bb38f4bfdc5 diff --git a/include/dbg/debug_mode.h b/include/dbg/debug_mode.h index f2a59b9..b248421 100644 --- a/include/dbg/debug_mode.h +++ b/include/dbg/debug_mode.h @@ -116,6 +116,7 @@ extern debug_options g_debug_options; // Compile time options #define ENABLE_DEBUG_MENU true #define ENABLE_TEXT_DEBUG_SCREEN true +#define ENABLE_DEBUG_PKMN_INJECTION true #define USE_CUSTOM_MALLOC 1 // needs to be a value divisible by 4 #define CUSTOM_MALLOC_POOL_SIZE 8192 diff --git a/include/sprite_data.h b/include/sprite_data.h index 515b73a..9ce42b9 100644 --- a/include/sprite_data.h +++ b/include/sprite_data.h @@ -135,6 +135,6 @@ void fennel_speak(int frame); int get_curr_flex_background(); void update_y_offset(); void erase_textbox_tiles(); -void update_front_box_sprite(GBPokemon *curr_pkmn); +void update_front_box_sprite(Pokemon *curr_pkmn); void update_menu_sprite(PokeBox* box, int index, int frame); #endif \ No newline at end of file diff --git a/source/dbg/debug_menu_entries.cpp b/source/dbg/debug_menu_entries.cpp index f9d7ad9..ead3040 100644 --- a/source/dbg/debug_menu_entries.cpp +++ b/source/dbg/debug_menu_entries.cpp @@ -100,7 +100,9 @@ void fill_debug_menu_with_entries(vertical_menu &menu, u16 *charset) define_executable_row(charset, "Text Debug", show_text_debug_screen, 0, nullptr), #endif define_executable_row(charset, "Info", show_debug_info_screen, 0, nullptr), +#if ENABLE_DEBUG_PKMN_INJECTION define_executable_row(charset, "Inject Celebi", dbg_inject_pkmn, 0, nullptr), +#endif define_song_row(charset, "Song"), define_toggle_row(charset, "Print Link", dbg_set_boolean_flag, g_debug_options.print_link_data, &g_debug_options.print_link_data), define_toggle_row(charset, "Instant Text", dbg_set_boolean_flag, g_debug_options.instant_text_speed, &g_debug_options.instant_text_speed), diff --git a/source/dbg/debug_menu_functions.cpp b/source/dbg/debug_menu_functions.cpp index 1e397b8..f253205 100644 --- a/source/dbg/debug_menu_functions.cpp +++ b/source/dbg/debug_menu_functions.cpp @@ -22,6 +22,7 @@ #define BOTTOM V_MAX extern rom_data curr_GBA_rom; +extern u32 global_tile_id_end; static const byte RSEFL_10_ANIV_Celebi_0BF5_ENG_[] = { 0xbe, 0x2b, 0x28, 0x78, 0x0a, 0x00, 0x00, 0x00, 0xbd, 0xbf, 0xc6, 0xbf, 0xbc, 0xc3, 0xff, 0x34, @@ -226,6 +227,16 @@ void dbg_inject_pkmn(void *context, unsigned user_param) Gen3Pokemon celebi(&tables); celebi.loadData(RSEFL_10_ANIV_Celebi_0BF5_ENG_, false); + // front_sprite_tile_id is reserved behind the box sprites + if(!g_debug_options.ignore_game_pak && !g_debug_options.ignore_game_pak_sprites) + { + u32 front_sprite_tile_id = global_tile_id_end + (30 * 16); + load_sprite_compressed(grabbed_front_sprite, (const unsigned int *)*(u32 *)(curr_GBA_rom.loc_gMonFrontPicTable + (0 * 8)), front_sprite_tile_id, PULLED_SPRITE_PAL, ATTR0_SQUARE, ATTR1_SIZE_64x64, 1); + update_front_box_sprite(&celebi); + obj_set_pos(grabbed_front_sprite, 88, 16); + obj_unhide(grabbed_front_sprite, 0); + } + save_manager.setNationalDexUnlocked(true); do @@ -261,6 +272,11 @@ void dbg_inject_pkmn(void *context, unsigned user_param) wait_for_user_to_continue(); + if(!g_debug_options.ignore_game_pak && !g_debug_options.ignore_game_pak_sprites) + { + obj_hide(grabbed_front_sprite); + } + hide_textbox(); tte_erase_rect(LEFT, TOP, RIGHT, BOTTOM); } \ No newline at end of file diff --git a/source/sprite_data.cpp b/source/sprite_data.cpp index 2a01716..b2cfc3e 100644 --- a/source/sprite_data.cpp +++ b/source/sprite_data.cpp @@ -872,7 +872,7 @@ void update_y_offset() obj_set_pos(flag, (8 * 11) + 4, (8 * 4) + 19 + y_offset); } -void update_front_box_sprite(GBPokemon *curr_pkmn) +void update_front_box_sprite(Pokemon *curr_pkmn) { if (g_debug_options.ignore_game_pak || g_debug_options.ignore_game_pak_sprites) {