diff --git a/include/background_engine.h b/include/background_engine.h index 651567e..e6224ed 100644 --- a/include/background_engine.h +++ b/include/background_engine.h @@ -13,7 +13,8 @@ #define BG_TEXT REG_BG3CNT void background_frame(int global_frame_count); -void create_textbox_new(int text_section, int text_key, bool eraseMainBox); +void create_textbox(int text_section, int text_key, bool eraseMainBox); +void create_textbox(int startTileX, int startTileY, int text_space_width, int text_space_height, bool eraseMainBox); void show_textbox(); void hide_textbox(); #endif \ No newline at end of file diff --git a/source/background_engine.cpp b/source/background_engine.cpp index bfe7a74..99e653f 100644 --- a/source/background_engine.cpp +++ b/source/background_engine.cpp @@ -20,13 +20,19 @@ void background_frame(int global_frame_count) } // This could honestly be an object... might want to do that in the future, depending on how complex using this gets -void create_textbox_new(int text_section, int text_key, bool eraseMainBox) +void create_textbox(int text_section, int text_key, bool eraseMainBox) { int box_type = text_box_type_tables[text_section][text_key]; int startTileX = box_type_info[box_type][BOX_TYPE_VAL_START_TILE_X]; int startTileY = box_type_info[box_type][BOX_TYPE_VAL_START_TILE_Y]; int text_space_width = box_type_info[box_type][BOX_TYPE_VAL_PIXELS_PER_LINE]; int text_space_height = box_type_info[box_type][BOX_TYPE_VAL_NUM_OF_LINES] * 16; + + create_textbox(startTileX, startTileY, text_space_width, text_space_height, eraseMainBox); +} + +void create_textbox(int startTileX, int startTileY, int text_space_width, int text_space_height, bool eraseMainBox) +{ if (eraseMainBox) { erase_textbox_tiles(); diff --git a/source/dbg/debug_mode.cpp b/source/dbg/debug_mode.cpp index 4b6a95f..0ccaf30 100644 --- a/source/dbg/debug_mode.cpp +++ b/source/dbg/debug_mode.cpp @@ -8,7 +8,7 @@ debug_options g_debug_options = .ignore_game_pak_sprites = (false && DEBUG_MODE), .ignore_link_cable = (false && DEBUG_MODE), .ignore_mg_e4_flags = (true && DEBUG_MODE), - .ignore_unreceived_pkmn = (false && DEBUG_MODE), + .ignore_unreceived_pkmn = (true && DEBUG_MODE), .force_tutorial = (false && DEBUG_MODE), .dont_hide_invalid_pkmn = (false && DEBUG_MODE), .ignore_dex_completion = (false && DEBUG_MODE), diff --git a/source/gameboy_colour.cpp b/source/gameboy_colour.cpp index 2bda29d..998d6ea 100644 --- a/source/gameboy_colour.cpp +++ b/source/gameboy_colour.cpp @@ -98,6 +98,7 @@ int link_cable_memory_section_index = 0; void print(const char *format, ...) { + // I don't think this function is called anymore... va_list args; va_start(args, format); @@ -123,10 +124,13 @@ void print(const char *format, ...) va_end(args); tte_erase_rect(0, 0, H_MAX, V_MAX); + for (int j = 0; j < 10; j++) { + tte_erase_rect(0, 0, H_MAX, V_MAX); + tte_set_pos(0, 0); ptgb_write_simple(reinterpret_cast("#{cx:0xE000}"), true); - ptgb_write_simple(reinterpret_cast(spi_text_out_array[j]), true); + ptgb_write_simple((byte*)(spi_text_out_array[j]), true); } } @@ -362,7 +366,6 @@ int loop(byte *box_data_storage, byte *curr_payload, GB_ROM *curr_gb_rom, PokeBo #define NUM_LINES 8 int counter = 0; char stuff[NUM_LINES][LINE_WIDTH]; - while (true) { if (g_debug_options.print_link_data && key_held(KEY_L)) @@ -397,7 +400,7 @@ int loop(byte *box_data_storage, byte *curr_payload, GB_ROM *curr_gb_rom, PokeBo n2hexstr(&stuff[NUM_LINES - 1][18], out_data & 0xFF, 2); stuff[NUM_LINES - 1][20] = '\0'; - // create_textbox(0, 0, 125, 80, false); + create_textbox(0, 0, 125, 128, false); ptgb_write_debug(debug_charset, *stuff, true); } else if (g_debug_options.write_cable_data_to_save) diff --git a/source/global_frame_controller.cpp b/source/global_frame_controller.cpp index 0e8c2c0..098fd9e 100644 --- a/source/global_frame_controller.cpp +++ b/source/global_frame_controller.cpp @@ -9,6 +9,7 @@ #include "string.h" #include "text_data_table.h" #include "translated_text.h" +#include "dbg/debug_mode.h" int global_frame_count = 0; bool rand_enabled = true; @@ -208,6 +209,12 @@ void link_animation_state(int state) break; } curr_link_animation_state = state; + + if (g_debug_options.print_link_data) + { + obj_hide(cart_shell); + obj_hide(cart_label); + } } void determine_fennel_blink() diff --git a/source/text_engine.cpp b/source/text_engine.cpp index 51359b1..be7c4c5 100644 --- a/source/text_engine.cpp +++ b/source/text_engine.cpp @@ -270,8 +270,9 @@ void set_text_exit() int ptgb_write_textbox(const byte *text, bool instant, bool waitForUser, int text_section, int text_key, bool eraseMainBox) { + tte_erase_rect(0, 0, H_MAX, V_MAX); erase_textbox_tiles(); - create_textbox_new(text_section, text_key, eraseMainBox); + create_textbox(text_section, text_key, eraseMainBox); int out = ptgb_write(text, instant, 9999, text_box_type_tables[text_section][text_key]); // This is kinda silly but it'll work. if (waitForUser) {