diff --git a/graphics/ptgb_logo_l.grit b/graphics/ptgb_logo_l.grit new file mode 100644 index 0000000..f537117 --- /dev/null +++ b/graphics/ptgb_logo_l.grit @@ -0,0 +1,6 @@ +# +# Logo (left) : 64x64t, 4bpp, SBB-layout, not compressed. +# Pallet bank 1, copy from 16 to 32. +# +-gB4 -ps16 -pe32 + diff --git a/graphics/ptgb_logo_l.png b/graphics/ptgb_logo_l.png new file mode 100644 index 0000000..2477664 Binary files /dev/null and b/graphics/ptgb_logo_l.png differ diff --git a/graphics/ptgb_logo_r.grit b/graphics/ptgb_logo_r.grit new file mode 100644 index 0000000..db20ecb --- /dev/null +++ b/graphics/ptgb_logo_r.grit @@ -0,0 +1,5 @@ +# +# Logo (right) : 64x64t, 4bpp, SBB-layout, not compressed. +# Pallet bank 1, copy from 16 to 32. +# +-gB4 -ps16 -pe32 diff --git a/graphics/ptgb_logo_r.png b/graphics/ptgb_logo_r.png new file mode 100644 index 0000000..a779749 Binary files /dev/null and b/graphics/ptgb_logo_r.png differ diff --git a/graphics/unused graphics/ptgb_logo.png b/graphics/unused graphics/ptgb_logo.png new file mode 100644 index 0000000..0a084ee Binary files /dev/null and b/graphics/unused graphics/ptgb_logo.png differ diff --git a/graphics/unused graphics/ptgb_logo_transparent.png b/graphics/unused graphics/ptgb_logo_transparent.png new file mode 100644 index 0000000..ed0f4be Binary files /dev/null and b/graphics/unused graphics/ptgb_logo_transparent.png differ diff --git a/include/box_menu.h b/include/box_menu.h index 05d9b76..6d1f8f4 100644 --- a/include/box_menu.h +++ b/include/box_menu.h @@ -10,12 +10,19 @@ #include "pokemon_party.h" #include "button_handler.h" +#define CANCEL_BUTTON 1 +#define CONFIRM_BUTTON 2 + class Box_Menu { public: Box_Menu(); int box_main(Pokemon_Party party_data); private: + int curr_button; + int x; + int y; + }; #endif \ No newline at end of file diff --git a/include/debug_mode.h b/include/debug_mode.h index 269ccdc..ada5c05 100644 --- a/include/debug_mode.h +++ b/include/debug_mode.h @@ -1,11 +1,13 @@ #ifndef DEBUG_MODE_H #define DEBUG_MODE_H -#define DEBUG_MODE true -#define IGNORE_GAME_PAK true +#define DEBUG_MODE false +#define IGNORE_GAME_PAK false #define IGNORE_LINK_CABLE false -#define IGNORE_MG_E4_FLAGS true +#define IGNORE_MG_E4_FLAGS false +#define FORCE_TUTORIAL false #define DONT_REMOVE_PKMN false +#define SHOW_INVALID_PKMN false #define DEBUG_GAME LEAFGREEN_ID #define DEBUG_VERS VERS_1_1 diff --git a/include/gb_rom_values/base_gb_rom_struct.h b/include/gb_rom_values/base_gb_rom_struct.h index 0f9c251..451d315 100644 --- a/include/gb_rom_values/base_gb_rom_struct.h +++ b/include/gb_rom_values/base_gb_rom_struct.h @@ -8,7 +8,7 @@ typedef unsigned int u32, word, uint, eint; typedef unsigned long long u64; #define PAYLOAD_SIZE 672 -#define NUM_PAYLOADS 3 +#define NUM_PAYLOADS 1 #define GB_TILE_WIDTH 20 diff --git a/include/gb_rom_values/eng_gb_rom_values.h b/include/gb_rom_values/eng_gb_rom_values.h index cffd0a0..19579fa 100644 --- a/include/gb_rom_values/eng_gb_rom_values.h +++ b/include/gb_rom_values/eng_gb_rom_values.h @@ -127,7 +127,7 @@ const struct GB_ROM ENG_GOLD = { .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, - .enter_vector_location = 0xC7B4, + .enter_vector_location = 0xC5D6, .clearScreen = 0x000EE2, .CableClub_TextBoxBorder = 0x0A4D88, // LinkTextboxAtHL @@ -162,7 +162,7 @@ const struct GB_ROM ENG_GOLD = { }; const struct GB_ROM ENG_SILVER = { .language = ENG_ID, - .version = GOLD_ID, + .version = SILVER_ID, .generation = 2, .method = METHOD_GEN2, .payload_size = 672, @@ -172,7 +172,7 @@ const struct GB_ROM ENG_SILVER = { .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, - .enter_vector_location = 0xC7B4, + .enter_vector_location = 0xC5D6, .clearScreen = 0x000EE2, .CableClub_TextBoxBorder = 0x0A4D88, // LinkTextboxAtHL diff --git a/include/script_array.h b/include/script_array.h index f1fb867..1930509 100644 --- a/include/script_array.h +++ b/include/script_array.h @@ -36,8 +36,9 @@ #define DIA_NO_PAYLOAD 27 #define DIA_IN_BOX 28 #define DIA_MYTHIC_CONVERT 29 +#define DIA_CANCEL 30 -#define DIA_SIZE 30 +#define DIA_SIZE 31 #define DIA_END DIA_SIZE // Commands @@ -56,8 +57,9 @@ #define CMD_CONTINUE_LINK DIA_END + 12 #define CMD_BOX_MENU DIA_END + 13 #define CMD_MYTHIC_MENU DIA_END + 14 +#define CMD_LOAD_SIMP DIA_END + 15 -#define CMD_SIZE 15 +#define CMD_SIZE 16 #define CMDS_END DIA_END + CMD_SIZE // Conditionals diff --git a/include/sprite_data.h b/include/sprite_data.h index 0b74795..fb16378 100644 --- a/include/sprite_data.h +++ b/include/sprite_data.h @@ -97,6 +97,11 @@ extern OBJ_ATTR *button_cancel_right; extern OBJ_ATTR *button_confirm_left; extern OBJ_ATTR *button_confirm_right; +#include "ptgb_logo_l.h" +extern OBJ_ATTR *ptgb_logo_l; +#include "ptgb_logo_r.h" +extern OBJ_ATTR *ptgb_logo_r; + #define BG2VOF_SMALL_TEXTBOX 96 #define BG2VOF_LARGE_TEXTBOX 0 @@ -105,6 +110,7 @@ extern OBJ_ATTR *button_confirm_right; #define BTN_PAL 2 #define BTN_LIT_PAL 3 #define MENU_SPRITE_PAL 4 +#define LOGO_PAL 5 void load_sprite(OBJ_ATTR *sprite, const unsigned int objTiles[], int objTilesLen, u32 &tile_id, u32 pal_bank, int attr0, int attr1, u32 priority); diff --git a/source/box_menu.cpp b/source/box_menu.cpp index 0c44f39..84be809 100644 --- a/source/box_menu.cpp +++ b/source/box_menu.cpp @@ -8,9 +8,6 @@ #include "box_menu.h" #include "pokemon_data.h" -#define CANCEL_BUTTON 1 -#define CONFIRM_BUTTON 2 - Box_Menu::Box_Menu(){}; int Box_Menu::box_main(Pokemon_Party party_data) @@ -30,9 +27,9 @@ int Box_Menu::box_main(Pokemon_Party party_data) confirm_button.set_location(136, 112); cancel_button.show(); confirm_button.show(); - int curr_button = 0; - int x = 0; - int y = 0; + curr_button = 0; + x = 0; + y = 0; bool update_pos = true; obj_unhide(box_select, 0); while (true) @@ -109,6 +106,7 @@ int Box_Menu::box_main(Pokemon_Party party_data) tte_erase_screen(); obj_unhide(prof, 0); REG_BG2VOFS = BG2VOF_SMALL_TEXTBOX; + global_next_frame(); return curr_button; } } diff --git a/source/main.cpp b/source/main.cpp index 39e27a8..340dfe5 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -56,7 +56,7 @@ TODO: int delay_counter = 0; bool skip = true; rom_data curr_rom; -Button_Menu main_menu(3, 1, 96, 32, false); +Button_Menu main_menu(2, 2, 96, 32, false); Button_Menu yes_no_menu(1, 2, 40, 24, false); /* @@ -91,6 +91,7 @@ int test_main(void) Music void load_graphics() { + tte_erase_rect(0, 0, H_MAX, V_MAX); // Load opening background first so it hides everything else load_opening_background(); load_background(); @@ -101,8 +102,9 @@ void load_graphics() main_menu.clear_vector(); main_menu.add_button(Button(btn_t_l, btn_t_r, 48), BTN_TRANSFER); main_menu.add_button(Button(btn_p_l, btn_p_r, 48), BTN_POKEDEX); - //main_menu.add_button(Button(btn_d_l, btn_d_r), BTN_LANGUAGE); + // main_menu.add_button(Button(btn_d_l, btn_d_r), BTN_LANGUAGE); main_menu.add_button(Button(btn_c_l, btn_c_r, 48), BTN_CREDITS); + main_menu.set_xy_min_max(0, H_MAX, 48, V_MAX); // Set up global yes no button yes_no_menu.clear_vector(); @@ -170,7 +172,7 @@ void first_load_message(void) { tte_set_pos(8, 0); tte_set_ink(10); - tte_write("#{cx:0xE000}Hello! Thank you for using\nPok@ Transporter GB!\n\nJust as a word of caution- \nPok@ Transporter GB WILL modify\nyour generation 3 save file.\nThe program is designed to\nnot corrupt anything, but if\nyou do not wish to modify\nyour save file, please turn\noff your Game Boy Advance.\n\nPlease note that Pok@mon\nMirror is still in beta, so\nsave file backups are HIGHLY\nrecommended before using.\nWith that all out of the\nway, please enjoy!\n\n -The Gears of Progress"); + tte_write("#{cx:0xE000}\n\nHello! Thank you for using\nPok@ Transporter GB!\n\nJust as a word of caution- \nPok@ Transporter GB WILL\nmodify both the GameBoy and GameBoy Advance save files.\n\nPlease note that Pok@mon\nMirror is still in beta, so\nsave file backups are HIGHLY\nrecommended before using.\nWith that all out of the\nway, please enjoy!\n\n -The Gears of Progress"); while (!key_hit(KEY_A)) { global_next_frame(); @@ -180,10 +182,11 @@ void first_load_message(void) int credits() { - #define CREDITS_ARRAY_SIZE 15 +#define CREDITS_ARRAY_SIZE 15 int curr_credits_num = 0; std::string credits_array[CREDITS_ARRAY_SIZE] = { - "Developed by:\n\n\nThe Gears\nof Progress", + "Lead developer:\n\nThe Gears of\nProgress\n\nLead graphic design:\n\nJome", + "Development\nassistance:\n\n-im a blisy\n-rileyk64\n-Shao", "Built using:\n\n\n-DevkitPro\n-LibTonc\n-LibGBA", "Inspired by the\nworks of:\n\n-Goppier\n-Lorenzooone\n-im a blisy\n-RETIRE", "Programs used:\n\n\n-HexManiacAdvance\n-PKHeX\n-WC3Tool\n-Usenti\n", @@ -192,10 +195,9 @@ int credits() "ROM data obtained\nfrom decompilations created by the PRET team", "Pok@mon data\nobtained from:\n\n-Bulbapedia\n-Serebii\n-PokeAPI.com", "Discord community\nassistance:\n\n-Hex Maniac Advance\n Development\n-gbadev\n-pret", - "Sprite work:\n\n\n-lite_thespark", "Writing assistance:\n\n\n-Mad", "An immense thanks to\nLorenzooone for\ntheir assistance in\nreading/writing save\ndata. Without them,\nthis project would\nnot have been\npossible.", - "Special thanks:\n\n\nEnn, Roku, Luca,\nArctic, and everyone\nwho has listened to me talk about this\nfor months", + "Special thanks to\nEnn, roku, Sleepy,\nEza, sarahtonin,\nBasabi, Mad, and\neveryone who has\nlistened to me talk\nabout this for\nmonths!", "All Pok@mon names,\nsprites, and names\nof related resources\nare copyright\nNintendo,\nCreatures Inc.,\nand GAME FREAK Inc.", "This project is not endorsed or\nsupported by\nGameFreak/Nintendo.\n\nPlease support the\noriginal developers.", }; @@ -245,7 +247,7 @@ int main(void) initalize_memory_locations(); load_custom_save_data(); - if (get_tutorial_flag() == false) + if (get_tutorial_flag() == false || FORCE_TUTORIAL) { first_load_message(); initalize_save_data(); @@ -280,8 +282,6 @@ int main(void) } REG_BG1CNT = REG_BG1CNT | BG_PRIO(3); - // Set up blend to fade to white/black - key_poll(); // Reset the keys curr_rom.load_rom(); // MAIN LOOP @@ -292,15 +292,22 @@ int main(void) print_mem_section(); curr_rom.print_rom_info(); } + obj_set_pos(ptgb_logo_l, 56, 12); + obj_set_pos(ptgb_logo_r, 56 + 64, 12); + obj_unhide_multi(ptgb_logo_l, 1, 2); switch (main_menu.button_main()) { case (BTN_TRANSFER): + obj_hide_multi(ptgb_logo_l, 2); text_loop(); break; case (BTN_POKEDEX): + obj_hide_multi(ptgb_logo_l, 2); pokedex_loop(); break; case (BTN_CREDITS): + obj_set_pos(ptgb_logo_l, 56, 108); + obj_set_pos(ptgb_logo_r, 56 + 64, 108); credits(); break; default: diff --git a/source/payload_builder.cpp b/source/payload_builder.cpp index f5e10c8..d7e1b20 100644 --- a/source/payload_builder.cpp +++ b/source/payload_builder.cpp @@ -296,7 +296,11 @@ byte *generate_payload(GB_ROM curr_rom, bool debug) payload_storage[offset++] = (curr_rom.Bankswitch >> 0) & 0xFF; payload_storage[offset++] = (curr_rom.Bankswitch >> 8) & 0xFF; - // ld hl, SaveSAVtoSRAM2 + // ld b, 0x1C [memory bank of SaveSAVtoSRAM2] + payload_storage[offset++] = 0x06; + payload_storage[offset++] = (curr_rom.SaveSAVtoSRAM1 >> 16) & 0xFF; + + // ld hl, SaveSAVtoSRAM2 payload_storage[offset++] = 0x21; payload_storage[offset++] = (curr_rom.SaveSAVtoSRAM2 >> 0) & 0xFF; payload_storage[offset++] = (curr_rom.SaveSAVtoSRAM2 >> 8) & 0xFF; @@ -1013,8 +1017,8 @@ byte *generate_payload(GB_ROM curr_rom, bool debug) // jp pkmn list (because saving the box overwrites the data) payload_storage[offset++] = 0xC3; - payload_storage[offset++] = (curr_rom.enter_vector_location >> 0) & 0xFF; - payload_storage[offset++] = (curr_rom.enter_vector_location >> 8) & 0xFF; + payload_storage[offset++] = (0xC7B4 >> 0) & 0xFF; // This will need to not be hard coded for other languages + payload_storage[offset++] = (0xC7B4 >> 8) & 0xFF; // Ditto ^ // 72 total bytes of string/array stuff @@ -1084,11 +1088,11 @@ void write_call(int generation, byte array_data[], int &offset, word call_locati } }; -int main() +int test_main() { freopen("test_payload.txt", "w", stdout); std::cout << std::endl; - byte *payload = generate_payload(ENG_CRYSTAL, true); + byte *payload = generate_payload(ENG_SILVER, true); for (int i = 0; i < PAYLOAD_SIZE; i++) { std::cout << "0x" << std::setfill('0') << std::setw(2) << std::hex << std::uppercase << (unsigned int)payload[i] << ", "; diff --git a/source/pokemon_party.cpp b/source/pokemon_party.cpp index 17f36cd..19ea06a 100644 --- a/source/pokemon_party.cpp +++ b/source/pokemon_party.cpp @@ -11,10 +11,10 @@ const GB_ROM *list_of_gb_roms[NUM_PAYLOADS] = { &ENG_RED_BLUE, - &ENG_YELLOW, - &ENG_GOLD, - &ENG_SILVER, - &ENG_CRYSTAL, + //&ENG_YELLOW, + //&ENG_GOLD, + //&ENG_SILVER, + //&ENG_CRYSTAL, }; byte gen1_debug_box_data[0x462] = { diff --git a/source/script_array.cpp b/source/script_array.cpp index 4a317ca..a5f7ba1 100644 --- a/source/script_array.cpp +++ b/source/script_array.cpp @@ -24,7 +24,7 @@ std::string_view dialogue[DIA_SIZE]; void populate_dialogue() { - dialogue[DIA_OPEN] = "Hey there! I'm Professor\nFennel. As you can see, I'm\na scientist.|In fact, the subject I'm \nresearching is Trainers!|My dream is to collect save files of various trainers, \nbut I haven't had any \nbreakthroughs yet...|So in the meantime, I have a\ndifferent project!|In my home region, there's a\nlocation that can make a\nPok@mon's dreams into\nreality.|This means that any other\nPok@mon they meet in their\ndreams become real!|That's fantastic, but my\ngoal is to do the same-\njust with a trainer's dream\ninstead!|I've successfully been able\nto send a Pok@mon into\nand out of a trainer's\ndream...|but I've been unsuccessful\nin pulling out a new Pok@mon\nwithout...\ncatastrophic results.|That's when I had a\nbreakthrough- I realized if \nI sent in a DITTO,|it could transform into the\nPok@mon found within that\ntrainer's dream!|That's why I need your help!\nI want to bring as many\nPok@mon out of your dreams\nas possible!|There's just over 250\nPok@mon I want to catalogue\nin my Dream Pok@Dex-\nor Dream Dex for short.|But I'll let you keep any\nPok@mon- they're from your\ndreams after all!|I think that's everything...\nwhenever you're ready to\nstart, just let me know!"; + dialogue[DIA_OPEN] = "Hey there! I'm Professor\nFennel. As you can see, I'm\na scientist.|In fact, the subject I'm \nresearching is Trainers!|My dream is to collect save files of various trainers, \nbut I haven't had any \nbreakthroughs yet...|So in the meantime, I've\nbeen working on a different\nproject with one of my old\nfriends!|In my home region, there's a\nlocation that can make a\nPok@mon's dreams into\nreality.|This means that any other\nPok@mon they meet in their\ndreams become real!|That's fantastic, but my\ngoal is to do the same-\njust with a trainer's dream\ninstead!|That's why I need your help!\nI want to bring as many\nPok@mon out of your dreams\nas possible!|There's just over 250\nPok@mon I want to catalogue\nin my Dream Pok@Dex-\nor Dream Dex for short.|But I'll let you keep any\nPok@mon- they're from your\ndreams after all!|I think that's everything...\nwhenever you're ready to\nstart, just let me know!"; dialogue[DIA_E4] = "Hi trainer! I'm thrilled\nyou've decided to help with our research, but we need\nthe best of the best!|Come back after you've\nbeaten the Elite Four and\nbecome the Champion!"; dialogue[DIA_MG_FRLGE] = "Sorry trainer, one more\nthing to take care of before\nwe can begin- you need to\nenable MYSTERY GIFT!|Head to the nearest Pok@\nMart and fill out the\nquestionnaire as follows:\nLINK TOGETHER WITH ALL|After that, you should be\nall set to go!|See you soon!"; dialogue[DIA_MG_RS] = "Sorry trainer, one more\nthing to take care of before\nwe can begin- you need to\nenable MYSTERY EVENT!|Head to the PETALBURG\nPok@mon Center and tell the\nman next to the PC:\nMYSTERY EVENT IS EXCITING|After that, you should be\nall set to go!|See you soon!"; @@ -45,7 +45,8 @@ void populate_dialogue() dialogue[DIA_WHAT_LANG] = "What language is the Game\nBoy Pok@mon game that you're\ntransferring from?"; dialogue[DIA_NO_PAYLOAD] = "I'm sorry, but that version\nin that language is not\ncurrently supported."; dialogue[DIA_IN_BOX] = "Great! Let's take a look at\nthe Pok@mon that will be\ntransfered.|Please remember, once a\nPok@mon is transfered, it\nCANNOT be returned to the\nGame Boy Game Pak.|Select confirm once you're\nready, or select cancel if\nyou want to keep the Pok@mon\non your Game Boy Game Pak."; - dialogue[DIA_MYTHIC_CONVERT] = "It looks like you have a really rare Mythical Pok@mon!|Due to their strength, it seems they've corrupted the machine.|I can stablize them if you'd like, but it'll modify some things like nickname, Original Trainer, and Shininess.|Otherwise I can leave them as is, but there's no guarentee that they'll be transferrable in the future.|Do you want me to stablize them?"; + dialogue[DIA_MYTHIC_CONVERT] = "It looks like you have a\nrare Mythical Pok@mon!|Due to their rarity, it\nseems they've corrupted the\nmachine.|I can stablize them if you'd\nlike, but it'll change some\nthings like name, Original\nTrainer, and Shininess.|Otherwise I can leave them\nas is, but there's no\nguarentee that they'll be\ntransferrable in the future.|Do you want me to stablize\nthem?"; + dialogue[DIA_CANCEL] = "No worries! Feel free to\ncome back if you change your\nmind!|See you around!"; dialogue[DIA_ERROR_COLOSSEUM] = "It looks like you went to\nthe colosseum instead of the\ntrading room!|Let's try that again!"; dialogue[DIA_ERROR_COM_ENDED] = "Communication with the other\ndevice was terminated.|Let's try that again!"; @@ -95,15 +96,17 @@ void populate_script() script[DIA_ERROR_COM_ENDED] = script_obj(dialogue[DIA_ERROR_COM_ENDED], DIA_START); script[COND_ERROR_COLOSSEUM] = script_obj(COND_ERROR_COLOSSEUM, COND_ERROR_DISCONNECT, DIA_ERROR_COLOSSEUM); script[DIA_ERROR_COLOSSEUM] = script_obj(dialogue[DIA_ERROR_COLOSSEUM], DIA_START); - script[COND_ERROR_DISCONNECT] = script_obj(COND_ERROR_DISCONNECT, COND_CHECK_MYTHIC, DIA_ERROR_DISCONNECT); + script[COND_ERROR_DISCONNECT] = script_obj(COND_ERROR_DISCONNECT, CMD_LOAD_SIMP, DIA_ERROR_DISCONNECT); script[DIA_ERROR_DISCONNECT] = script_obj(dialogue[DIA_ERROR_DISCONNECT], DIA_START); // Pause the transfer and show the user their box data + script[CMD_LOAD_SIMP] = script_obj(CMD_LOAD_SIMP, COND_CHECK_MYTHIC); script[COND_CHECK_MYTHIC] = script_obj(COND_CHECK_MYTHIC, DIA_MYTHIC_CONVERT, DIA_IN_BOX); script[DIA_MYTHIC_CONVERT] = script_obj(dialogue[DIA_MYTHIC_CONVERT], CMD_MYTHIC_MENU); script[CMD_MYTHIC_MENU] = script_obj(CMD_MYTHIC_MENU, DIA_IN_BOX); script[DIA_IN_BOX] = script_obj(dialogue[DIA_IN_BOX], CMD_BOX_MENU); - script[CMD_BOX_MENU] = script_obj(CMD_BOX_MENU, CMD_CONTINUE_LINK); + script[CMD_BOX_MENU] = script_obj(CMD_BOX_MENU, CMD_CONTINUE_LINK, DIA_CANCEL); + script[DIA_CANCEL] = script_obj(dialogue[DIA_CANCEL], CMD_END_SCRIPT); script[CMD_CONTINUE_LINK] = script_obj(CMD_CONTINUE_LINK, CMD_IMPORT_POKEMON); // Complete the transfer and give messages based on the transfered Pokemon @@ -195,7 +198,7 @@ bool run_conditional(int index) return read_flag(curr_rom.mg_flag) || IGNORE_MG_E4_FLAGS; case COND_TUTORIAL_COMPLETE: - return get_tutorial_flag() || IGNORE_MG_E4_FLAGS; + return (get_tutorial_flag() || IGNORE_MG_E4_FLAGS) && !FORCE_TUTORIAL; case COND_NEW_POKEMON: return party_data.get_has_new_pkmn(); @@ -301,14 +304,16 @@ bool run_conditional(int index) return true; case CMD_BOX_MENU: - party_data.fill_simple_pkmn_array(); - box_viewer.box_main(party_data); - return true; + return (box_viewer.box_main(party_data) == CONFIRM_BUTTON); case CMD_MYTHIC_MENU: party_data.set_mythic_stabilization(yes_no_menu.button_main()); return true; + case CMD_LOAD_SIMP: + party_data.fill_simple_pkmn_array(); + return true; + default: tte_set_pos(0, 0); tte_write("ERROR! No conditional found."); diff --git a/source/sprite_data.cpp b/source/sprite_data.cpp index 5270032..84aa586 100644 --- a/source/sprite_data.cpp +++ b/source/sprite_data.cpp @@ -1,6 +1,7 @@ #include #include #include "sprite_data.h" +#include "debug_mode.h" #define SPRITE_CHAR_BLOCK 4 @@ -92,6 +93,9 @@ void load_textbox_background() int num_sprites = 0; OBJ_ATTR *testroid = &obj_buffer[num_sprites++]; OBJ_ATTR *prof = &obj_buffer[num_sprites++]; +OBJ_ATTR *ptgb_logo_l = &obj_buffer[num_sprites++]; +OBJ_ATTR *ptgb_logo_r = &obj_buffer[num_sprites++]; + OBJ_ATTR *btn_t_l = &obj_buffer[num_sprites++]; OBJ_ATTR *btn_t_r = &obj_buffer[num_sprites++]; OBJ_ATTR *btn_p_l = &obj_buffer[num_sprites++]; @@ -182,10 +186,13 @@ void load_eternal_sprites() memcpy(pal_obj_mem + (PROF_PAL * 16), profPal, profPalLen); memcpy(pal_obj_mem + (BTN_PAL * 16), btn_t_lPal, btn_t_lPalLen); memcpy(pal_obj_mem + (BTN_LIT_PAL * 16), btn_t_rPal, btn_t_rPalLen); + memcpy(pal_obj_mem + (LOGO_PAL * 16), ptgb_logo_lPal, ptgb_logo_lPalLen); u32 curr_tile_id = 0; load_sprite(testroid, metrTiles, metrTilesLen, curr_tile_id, METR_PAL, ATTR0_SQUARE, ATTR1_SIZE_64x64, 0); load_sprite(prof, profTiles, profTilesLen, curr_tile_id, PROF_PAL, ATTR0_SQUARE, ATTR1_SIZE_64x64, 2); + load_sprite(ptgb_logo_l, ptgb_logo_lTiles, ptgb_logo_lTilesLen, curr_tile_id, LOGO_PAL, ATTR0_SQUARE, ATTR1_SIZE_64x64, 1); + load_sprite(ptgb_logo_r, ptgb_logo_rTiles, ptgb_logo_rTilesLen, curr_tile_id, LOGO_PAL, ATTR0_SQUARE, ATTR1_SIZE_64x64, 1); load_sprite(btn_t_l, btn_t_lTiles, btn_t_lTilesLen, curr_tile_id, BTN_PAL, ATTR0_WIDE, ATTR1_SIZE_64x32, 1); load_sprite(btn_t_r, btn_t_rTiles, btn_t_rTilesLen, curr_tile_id, BTN_PAL, ATTR0_WIDE, ATTR1_SIZE_64x32, 1); load_sprite(btn_p_l, btn_p_lTiles, btn_p_lTilesLen, curr_tile_id, BTN_PAL, ATTR0_WIDE, ATTR1_SIZE_64x32, 1); @@ -246,7 +253,7 @@ void load_temp_box_sprites(Pokemon_Party party_data) u32 curr_tile_id = global_tile_id_end; for (int i = 0; i < 30; i++) { - if (party_data.get_simple_pkmn(i).is_valid) + if (party_data.get_simple_pkmn(i).is_valid || SHOW_INVALID_PKMN) { load_sprite(party_sprites[i], &duel_frame_menu_spritesTiles[(MENU_SPRITES[party_data.get_simple_pkmn(i).dex_number] - 1) * 32], 256, curr_tile_id, MENU_SPRITE_PAL, ATTR0_SQUARE, ATTR1_SIZE_16x16, 1); obj_set_pos(party_sprites[i], (16 * (i % 10)) + 40, (16 * (i / 10)) + 24); diff --git a/source/test_payload.txt b/source/test_payload.txt index 074b67f..d1d9d67 100644 --- a/source/test_payload.txt +++ b/source/test_payload.txt @@ -1,29 +1,29 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, # 0x10 -0xFD, 0xFD, 0xB4, 0xC7, 0xFF, 0x3E, 0x05, 0xD7, 0xCD, 0x0C, 0x4E, 0xC3, 0x50, 0x01, 0x00, 0x00, +0xFD, 0xFD, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, # 0x20 -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, # 0x30 -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, # 0x40 -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, # 0x50 -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, # 0x60 -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, # 0x70 -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, # 0x80 -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, # 0x90 -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, # 0xA0 -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, # 0xB0 -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, # 0xC0 -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x80, 0x80, 0x80, 0xD6, 0xC5, 0xFF, 0x3E, 0x05, 0xD7, 0xCD, 0xF6, 0x4D, 0xC3, 0xB0, 0x05, 0x00, # 0xD0 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, # 0xE0 @@ -57,21 +57,21 @@ # 0x1C0 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, # 0x1D0 -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFF, 0xFF, 0xCD, 0xDB, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFF, 0xFF, 0xCD, 0xE2, # 0x1E0 -0x0F, 0x21, 0x2E, 0xC4, 0x06, 0x03, 0x0E, 0x0E, 0x3E, 0x0A, 0xD7, 0xCD, 0xEF, 0x4E, 0x21, 0x43, +0x0E, 0x21, 0x2E, 0xC4, 0x06, 0x03, 0x0E, 0x0E, 0x3E, 0x0A, 0xD7, 0xCD, 0x88, 0x4D, 0x21, 0x43, # 0x1F0 -0xC4, 0x11, 0x7A, 0xC6, 0xCD, 0x78, 0x10, 0x21, 0xCB, 0xFF, 0x36, 0x02, 0x3E, 0x01, 0xCD, 0xE1, +0xC4, 0x11, 0x7A, 0xC6, 0xCD, 0x74, 0x0F, 0x21, 0xCD, 0xFF, 0x36, 0x02, 0x3E, 0x01, 0xCD, 0xE1, # 0x200 -0x30, 0x21, 0x0F, 0xAD, 0x36, 0xFD, 0x11, 0x0E, 0xAD, 0x01, 0x50, 0x04, 0xCD, 0x5F, 0x07, 0x21, +0x30, 0x21, 0x6B, 0xAD, 0x36, 0xFD, 0x11, 0x6A, 0xAD, 0x01, 0x50, 0x04, 0xCD, 0x10, 0x07, 0x21, # 0x210 -0xCB, 0xFF, 0x36, 0x02, 0x21, 0x70, 0x07, 0x11, 0x51, 0xC6, 0x01, 0x1E, 0x00, 0x00, 0x00, 0x00, +0xCD, 0xFF, 0x36, 0x02, 0x21, 0x54, 0x06, 0x11, 0x51, 0xC6, 0x01, 0x1E, 0x00, 0x00, 0x00, 0x00, # 0x220 -0x21, 0x0B, 0xD1, 0x36, 0x01, 0xFA, 0x50, 0xC6, 0x5F, 0x16, 0x00, 0x21, 0x51, 0xC6, 0x19, 0x3C, +0x21, 0x08, 0xD0, 0x36, 0x01, 0xFA, 0x50, 0xC6, 0x5F, 0x16, 0x00, 0x21, 0x51, 0xC6, 0x19, 0x3C, # 0x230 -0xEA, 0x50, 0xC6, 0xFA, 0x10, 0xAD, 0x47, 0x2A, 0xFE, 0xFF, 0x28, 0x0F, 0xB8, 0x30, 0xE6, 0x21, +0xEA, 0x50, 0xC6, 0xFA, 0x6C, 0xAD, 0x47, 0x2A, 0xFE, 0xFF, 0x28, 0x0F, 0xB8, 0x30, 0xE6, 0x21, # 0x240 -0x09, 0xD1, 0x77, 0x3E, 0x03, 0xD7, 0xCD, 0x39, 0x60, 0x18, 0xDA, 0xC3, 0xB4, 0xC7, 0x00, 0x00, +0x05, 0xD0, 0x77, 0x3E, 0x03, 0xD7, 0xCD, 0x3D, 0x60, 0x18, 0xDA, 0xC3, 0xB4, 0xC7, 0x00, 0x00, # 0x250 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1D, 0x1C, 0x1B, 0x1A, 0x19, 0x18, 0x17, # 0x260