diff --git a/Poke_Transporter_GB_mb.sym b/Poke_Transporter_GB_mb.sym index 5bf4c2e..bf6ae72 100644 --- a/Poke_Transporter_GB_mb.sym +++ b/Poke_Transporter_GB_mb.sym @@ -95,7 +95,6 @@ 00000004 d _ZN12_GLOBAL__N_120io_category_instanceE 00000004 b _ZN12_GLOBAL__N_1L11static_condE 00000004 b _ZN12_GLOBAL__N_1L12static_mutexE -00000004 T _ZN13Pokemon_Party12get_num_pkmnEv 00000004 T _ZN7Pokemon20get_full_gen_3_arrayEv 00000004 T _ZNKSt11logic_error4whatEv 00000004 T _ZNKSt13runtime_error4whatEv @@ -356,6 +355,7 @@ 0000000c T _ZN11Button_Menu12clear_vectorEv 0000000c T _ZN11Button_Menu14set_xy_min_maxEiiii 0000000c b _ZN12_GLOBAL__N_110eh_globalsE +0000000c T _ZN13Pokemon_Party12get_num_pkmnEv 0000000c T _ZN13Pokemon_Party16get_has_new_pkmnEv 0000000c T _ZN13Pokemon_Party20get_contains_invalidEv 0000000c T _ZN13Pokemon_Party21get_contains_mythicalEv @@ -638,7 +638,6 @@ 00000023 R _ZTSN9__gnu_cxx20recursive_init_errorE 00000024 T __aeabi_ui2d 00000024 T __floatunsidf -00000024 t _GLOBAL__sub_I_curr_line 00000024 T _Z12hide_textboxv 00000024 T _ZN10script_objC1ESt17basic_string_viewIcSt11char_traitsIcEEi 00000024 T _ZN10script_objC2ESt17basic_string_viewIcSt11char_traitsIcEEi @@ -664,6 +663,7 @@ 00000028 t __gnu_unwind_get_pr_addr 00000028 B __malloc_current_mallinfo 00000028 t _GLOBAL__sub_D__ZN17__eh_globals_init7_S_initE +00000028 t _GLOBAL__sub_I_curr_line 00000028 T _Z18delay_cycles_untilmPVhhh 00000028 T _ZN19mystery_gift_script10fadeScreenEh 00000028 T _ZN19mystery_gift_script11add_commandEi @@ -1036,7 +1036,6 @@ 000000ea W _ZNSo3putEc 000000ec T tte_write 000000f0 B _Z9out_arrayB5cxx11 -000000f0 T _ZN13Pokemon_Party22fill_simple_pkmn_arrayEv 000000f4 T _ZN7Pokemon12convert_textEPhiii 000000fa T __cxa_call_unexpected 000000fc T __udivsi3 @@ -1047,6 +1046,7 @@ 000000fc R MENU_SPRITES 000000fc R NUM_ABILITIES 000000fc R POWER_POINTS +00000100 T _ZN13Pokemon_Party22fill_simple_pkmn_arrayEv 00000101 R _ctype_ 00000104 t _ZL28read_encoded_value_with_basehjPKhPj 00000108 T _Z12pokedex_initv @@ -1071,6 +1071,7 @@ 00000130 T _Z15is_save_correctPhjj 0000013c T _Z5printNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE 0000013c T _ZN11Button_Menu10add_buttonE6Buttoni +00000148 T _Z13load_graphicsv 00000148 T sbmp16_blit 0000014c W _ZNSt6vectorIS_IhSaIhEESaIS1_EE17_M_realloc_appendIJRKS1_EEEvDpOT_ 00000150 T _Z21populate_lang_buttonsv @@ -1078,7 +1079,6 @@ 00000164 T tte_init_se 00000168 B __sf 00000168 T _Z17print_mem_sectionv -0000017c T _Z13load_graphicsv 0000017c W _ZNSo9_M_insertIlEERSoT_ 0000017c W _ZNSo9_M_insertImEERSoT_ 0000018e T _ZNK10__cxxabiv121__vmi_class_type_info11__do_upcastEPKNS_17__class_type_infoEPKvRNS1_15__upcast_resultE @@ -1111,6 +1111,7 @@ 0000028c T _ZN11Button_Menu11button_mainEv 00000290 T __aeabi_dmul 00000290 T __muldf3 +00000294 T _Z14inject_mysteryR13Pokemon_Party 00000294 T _Z20load_eternal_spritesv 000002a0 B payload_storage 000002a4 T _ZN8rom_data14print_rom_infoEv @@ -1118,14 +1119,13 @@ 000002d4 W _ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_i 000002e0 T _ZN7Pokemon12set_to_eventEv 000002e4 T _Unwind_VRS_Pop -000002ec T _Z15run_conditionali +000002f0 T _Z15run_conditionali 0000030c T __gnu_unwind_execute 00000310 T __adddf3 00000310 T __aeabi_dadd 00000314 T __aeabi_dsub 00000314 T __subdf3 0000037c T _Z21populate_game_buttonsv -000003ac T _Z14inject_mysteryR13Pokemon_Party 00000400 B internal_io 00000400 B obj_buffer 00000408 D __malloc_av_ @@ -1134,24 +1134,24 @@ 0000044e D gen2_debug_box_data 00000454 T tte_cmd_default 00000462 D gen1_debug_box_data -00000480 T _Z9text_loopi 00000494 T _ZNK10__cxxabiv121__vmi_class_type_info12__do_dyncastEiNS_17__class_type_info10__sub_kindEPKS1_PKvS4_S6_RNS1_16__dyncast_resultE +000004bc T _Z9text_loopi 000004ee T __gxx_personality_v0 00000588 T _malloc_r -000005bc T _ZN8Box_Menu8box_mainE13Pokemon_Party +000005d8 T _ZN8Box_Menu8box_mainE13Pokemon_Party 00000600 T _ZN7Pokemon20convert_to_gen_threeEbb 000006c0 B event_script 000006c0 B party_data 000006c0 B transfer_script -000006c8 T _Z15populate_scriptv 000007e0 B NAMES 000007f4 T _Z12pokedex_loopv 00000850 T _Z7creditsv +00000940 T _Z15populate_scriptv 00000bd0 R JPN_NAMES -00000d3c T _Z16generate_payload6GB_ROMb +00000d74 T _Z16generate_payload6GB_ROMb 00001000 B global_memory_buffer 00001000 d handles 000011f8 t _GLOBAL__sub_I_EXP_TYPES -0000158c T _ZN19mystery_gift_script16build_script_oldER13Pokemon_Party +00001570 T _ZN19mystery_gift_script16build_script_oldER13Pokemon_Party 00001f80 R MOVESETS 0000449e T _ZN19mystery_gift_script12build_scriptER13Pokemon_Party diff --git a/include/debug_mode.h b/include/debug_mode.h index 02c3272..a6e7e62 100644 --- a/include/debug_mode.h +++ b/include/debug_mode.h @@ -2,13 +2,14 @@ #define DEBUG_MODE_H #define DEBUG_MODE false -#define IGNORE_GAME_PAK false -#define IGNORE_LINK_CABLE false +#define IGNORE_GAME_PAK true +#define IGNORE_LINK_CABLE true #define IGNORE_MG_E4_FLAGS false -#define IGNORE_UNRECEIVED_PKMN false +#define IGNORE_UNRECEIVED_PKMN true #define FORCE_TUTORIAL false #define DONT_REMOVE_PKMN false #define SHOW_INVALID_PKMN false +#define IGNORE_DEX_COMPLETION true #define DEBUG_GAME SAPPHIRE_ID #define DEBUG_VERS VERS_1_0 diff --git a/include/pokemon.h b/include/pokemon.h index 0000cf8..84a201c 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -30,6 +30,7 @@ public: int ot_and_party = 0; int ot_size = 0; int nickname_size = 0; + int nature_mod = 0; Pokemon(); void load_data(int index, byte *party_data, int game, int lang); void convert_to_gen_three(bool simplified, bool stabilize_mythical); @@ -51,7 +52,7 @@ public: u8 get_letter_from_pid(u32 pid); u8 get_nature_from_pid(u32 pid); u8 get_gender_from_pid(u32 pid); - void set_to_event(); + void set_to_event(byte nature); int num_in_box; int index_in_box; @@ -69,6 +70,7 @@ private: byte pokerus; byte caught_data[2]; byte met_level; + byte item; byte gen_3_pkmn[80]; byte unencrypted_data[49]; // Contains the 48 GAEM bytes, along with the modulo int byte pid[4] = {0, 0, 0, 0}; // Little Endian, reverse of Bulbapedia diff --git a/source/main.cpp b/source/main.cpp index 5041968..0c92b08 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -104,7 +104,7 @@ 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, 48), BTN_EVENTS); + main_menu.add_button(Button(btn_d_l, btn_d_r, 48), BTN_EVENTS); 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); diff --git a/source/pokemon.cpp b/source/pokemon.cpp index 3a55b44..e11f6f8 100644 --- a/source/pokemon.cpp +++ b/source/pokemon.cpp @@ -63,68 +63,69 @@ void Pokemon::load_data(int index, byte *party_data, int game, int lang) box_size = 20; break; } + } + int party_species_offset = + 1 + // the num pkmn byte + (1 * index); // the pkmn index we're looking for - int party_species_offset = - 1 + // the num pkmn byte - (1 * index); // the pkmn index we're looking for + int box_struct_offset = + 1 + // the num of pkmn byte + (1 * box_size) + 1 + // list of pkmn in box and terminator + (pkmn_size * index); // the pokemon we're looking for - int box_struct_offset = - 1 + // the num of pkmn byte - (1 * box_size) + 1 + // list of pkmn in box and terminator - (pkmn_size * index); // the pokemon we're looking for + int ot_offset = + 1 + // the num of pkmn byte + (1 * box_size) + 1 + // list of pkmn in box and terminator + (pkmn_size * box_size) + // the pokemon structs + (ot_size * index); // the ot we're looking for - int ot_offset = - 1 + // the num of pkmn byte - (1 * box_size) + 1 + // list of pkmn in box and terminator - (pkmn_size * box_size) + // the pokemon structs - (ot_size * index); // the ot we're looking for + int nickname_offset = + 1 + // the num of pkmn byte + (1 * box_size) + 1 + // list of pkmn in box and terminator + (pkmn_size * box_size) + // the pokemon structs + (ot_size * box_size) + // the ots + (nickname_size * index); // the nickname we're looking for - int nickname_offset = - 1 + // the num of pkmn byte - (1 * box_size) + 1 + // list of pkmn in box and terminator - (pkmn_size * box_size) + // the pokemon structs - (ot_size * box_size) + // the ots - (nickname_size * index); // the nickname we're looking for + num_in_box = party_data[0]; + index_in_box = index; - num_in_box = party_data[0]; - index_in_box = index; + switch (gen) + { + case 1: + // tte_write(std::to_string(party_data[1121]).c_str()); + // while (true){}; + species_index_party = party_data[party_species_offset]; + species_index_struct = party_data[box_struct_offset + 0x00]; + met_level = party_data[box_struct_offset + 0x03]; + copy_from_to(&party_data[box_struct_offset + 0x08], &moves[0], 4, false); + copy_from_to(&party_data[box_struct_offset + 0x0C], &trainer_id[0], 2, false); + copy_from_to(&party_data[box_struct_offset + 0x0E], &exp[0], 3, true); + copy_from_to(&party_data[box_struct_offset + 0x1B], &dvs[0], 2, false); + copy_from_to(&party_data[box_struct_offset + 0x1D], &pp_values[0], 4, false); + copy_from_to(&party_data[nickname_offset], &nickname[0], 10, false); + copy_from_to(&party_data[ot_offset], &trainer_name[0], 7, false); + // Data not in gen 1 + pokerus = 0x00; + caught_data[0] = 0x00; + caught_data[1] = 0x00; + item = 0; - switch (gen) - { - case 1: - // tte_write(std::to_string(party_data[1121]).c_str()); - // while (true){}; - species_index_party = party_data[party_species_offset]; - species_index_struct = party_data[box_struct_offset + 0x00]; - met_level = party_data[box_struct_offset + 0x03]; - copy_from_to(&party_data[box_struct_offset + 0x08], &moves[0], 4, false); - copy_from_to(&party_data[box_struct_offset + 0x0C], &trainer_id[0], 2, false); - copy_from_to(&party_data[box_struct_offset + 0x0E], &exp[0], 3, true); - copy_from_to(&party_data[box_struct_offset + 0x1B], &dvs[0], 2, false); - copy_from_to(&party_data[box_struct_offset + 0x1D], &pp_values[0], 4, false); - copy_from_to(&party_data[nickname_offset], &nickname[0], 10, false); - copy_from_to(&party_data[ot_offset], &trainer_name[0], 7, false); - // Data not in gen 1 - pokerus = 0x00; - caught_data[0] = 0x00; - caught_data[1] = 0x00; - - break; - case 2: - species_index_party = party_data[party_species_offset]; - species_index_struct = party_data[box_struct_offset + 0x00]; - copy_from_to(&party_data[box_struct_offset + 0x02], &moves[0], 4, false); - copy_from_to(&party_data[box_struct_offset + 0x06], &trainer_id[0], 2, false); - copy_from_to(&party_data[box_struct_offset + 0x08], &exp[0], 3, true); - copy_from_to(&party_data[box_struct_offset + 0x15], &dvs[0], 2, false); - copy_from_to(&party_data[box_struct_offset + 0x17], &pp_values[0], 4, false); - pokerus = party_data[box_struct_offset + 0x1C]; - copy_from_to(&party_data[box_struct_offset + 0x1D], &caught_data[0], 2, false); - met_level = party_data[box_struct_offset + 0x1F]; - copy_from_to(&party_data[nickname_offset], &nickname[0], 10, false); - copy_from_to(&party_data[ot_offset + 0x00], &trainer_name[0], 7, false); - break; - } + break; + case 2: + species_index_party = party_data[party_species_offset]; + species_index_struct = party_data[box_struct_offset + 0x00]; + item = party_data[box_struct_offset + 0x01]; + copy_from_to(&party_data[box_struct_offset + 0x02], &moves[0], 4, false); + copy_from_to(&party_data[box_struct_offset + 0x06], &trainer_id[0], 2, false); + copy_from_to(&party_data[box_struct_offset + 0x08], &exp[0], 3, true); + copy_from_to(&party_data[box_struct_offset + 0x15], &dvs[0], 2, false); + copy_from_to(&party_data[box_struct_offset + 0x17], &pp_values[0], 4, false); + pokerus = party_data[box_struct_offset + 0x1C]; + copy_from_to(&party_data[box_struct_offset + 0x1D], &caught_data[0], 2, false); + met_level = party_data[box_struct_offset + 0x1F]; + copy_from_to(&party_data[nickname_offset], &nickname[0], 10, false); + copy_from_to(&party_data[ot_offset + 0x00], &trainer_name[0], 7, false); + break; } } void Pokemon::convert_to_gen_three(bool simplified, bool stabilize_mythical) @@ -139,13 +140,16 @@ void Pokemon::convert_to_gen_three(bool simplified, bool stabilize_mythical) if (species_index_struct > 251 || // Checks if the Pokemon is beyond Celebi species_index_struct == 0 || // Checks that the Pokemon isn't a blank party space species_index_struct != species_index_party || // Checks that the Pokemon isn't a hybrid or an egg - index_in_box >= num_in_box) // Checks that we're not reading beyond the Pokemon in the box + index_in_box >= num_in_box || // Checks that we're not reading beyond the Pokemon in the box + item != 0) // Checks that the Pokemon doesn't have an item { is_valid = false; return; } is_valid = true; + nature_mod = *(vu32 *)exp % 25; // save the nature mod in case the level is changed + // Update dex if not simple if (!simplified && !is_caught(species_index_struct)) { @@ -202,69 +206,21 @@ void Pokemon::convert_to_gen_three(bool simplified, bool stabilize_mythical) copy_from_to(convert_text(&trainer_name[0], 7, gen, language), &gen_3_pkmn[20], 7, false); // OT Name } - if (simplified) - { - return; - } - else if (stabilize_mythical && (species_index_struct == 151 || species_index_struct == 251)) - { - set_to_event(); - return; - } - - // Generate PID - disable_auto_random(); - u32 n_pid; - if (ENABLE_MATCH_PID) - { - n_pid = generate_pid_iv_match(species_index_struct, *(vu32 *)exp % 25, &dvs[0]); - - u16 curr_rand = get_rand_u16(); - ivs[0] = (curr_rand >> 0) & 0b11111; - ivs[1] = (curr_rand >> 5) & 0b11111; - ivs[2] = (curr_rand >> 10) & 0b11111; - curr_rand = get_rand_u16(); - ivs[3] = (curr_rand >> 0) & 0b11111; - ivs[4] = (curr_rand >> 5) & 0b11111; - ivs[5] = (curr_rand >> 10) & 0b11111; - iv_egg_ability = 0; - for (int i = 0; i < 6; i++) - { - iv_egg_ability |= ((ivs[i] & 0b11111) << (i * 5)); - } - } - else - { - n_pid = generate_pid_save_iv(species_index_struct, *(vu32 *)exp % 25, &dvs[0]); - - // Convert and set IVs - int hp_iv = 0; - for (int i = 0; i < 4; i++) - { - ivs[i + 1] = (dvs[i / 2] >> (((i + 1) % 2) * 4)) & 0b1111; - hp_iv |= ((ivs[i + 1] & 0x1) << i); - }; - ivs[0] = hp_iv; - ivs[5] = ivs[4]; - - for (int i = 0; i < 6; i++) - { - ivs[i] = (ivs[i] * 2) + 1; - iv_egg_ability |= ((ivs[i] & 0b11111) << (i * 5)); - } - } - for (int i = 0; i < 4; i++) - { - pid[i] = (n_pid >> (i * 8)) & 0xFF; - } - enable_auto_random(); - // Make sure Level is not over 100 based on EXP if (*(vu32 *)exp > get_max_exp(species_index_struct)) { *(vu32 *)exp = get_max_exp(species_index_struct); } + if (simplified) + { + if ((species_index_struct == 151 || species_index_struct == 251) && *(vu32 *)exp < 560) // Minimum EXP for level 10 + { + met_level = 10; + } + return; + } + // Separate the PP Up values from the Move PP values for (int i = 0; i < 4; i++) { @@ -322,6 +278,60 @@ void Pokemon::convert_to_gen_three(bool simplified, bool stabilize_mythical) pure_pp_values[i] = POWER_POINTS[moves[i]] + ((POWER_POINTS[moves[i]] / 5) * pp_bonus[i]); } + // This is everything the mythical needs, don't change anything else + if (stabilize_mythical && (species_index_struct == 151 || species_index_struct == 251)) + { + set_to_event(nature_mod); + return; + } + + // Generate PID + disable_auto_random(); + u32 n_pid; + if (ENABLE_MATCH_PID) + { + n_pid = generate_pid_iv_match(species_index_struct, nature_mod, &dvs[0]); + + u16 curr_rand = get_rand_u16(); + ivs[0] = (curr_rand >> 0) & 0b11111; + ivs[1] = (curr_rand >> 5) & 0b11111; + ivs[2] = (curr_rand >> 10) & 0b11111; + curr_rand = get_rand_u16(); + ivs[3] = (curr_rand >> 0) & 0b11111; + ivs[4] = (curr_rand >> 5) & 0b11111; + ivs[5] = (curr_rand >> 10) & 0b11111; + iv_egg_ability = 0; + for (int i = 0; i < 6; i++) + { + iv_egg_ability |= ((ivs[i] & 0b11111) << (i * 5)); + } + } + else + { + n_pid = generate_pid_save_iv(species_index_struct, nature_mod, &dvs[0]); + + // Convert and set IVs + int hp_iv = 0; + for (int i = 0; i < 4; i++) + { + ivs[i + 1] = (dvs[i / 2] >> (((i + 1) % 2) * 4)) & 0b1111; + hp_iv |= ((ivs[i + 1] & 0x1) << i); + }; + ivs[0] = hp_iv; + ivs[5] = ivs[4]; + + for (int i = 0; i < 6; i++) + { + ivs[i] = (ivs[i] * 2) + 1; + iv_egg_ability |= ((ivs[i] & 0b11111) << (i * 5)); + } + } + for (int i = 0; i < 4; i++) + { + pid[i] = (n_pid >> (i * 8)) & 0xFF; + } + enable_auto_random(); + // Determine and set Ability iv_egg_ability |= ((pid[0] & 0x1) ? get_num_abilities(species_index_struct) : 0) << 31; @@ -344,9 +354,9 @@ void Pokemon::convert_to_gen_three(bool simplified, bool stabilize_mythical) // Check if the Pokemon is shiny if ( // Is shiny - ((dvs[1] == 0b10101010) && // Checks if the Speed and Special DVs equal 10 - ((dvs[0] & 0xF) == 0b1010) && // Checks if the Defense DVs equal 10 - ((dvs[0] & 0b00100000) >> 5))) // Checks if the second bit of the Attack DV is true + ((dvs[1] == 0b10101010) && // Checks if the Speed and Special DVs equal 10 + ((dvs[0] & 0xF) == 0b1010) && // Checks if the Defense DVs equal 10 + ((dvs[0] & 0b00100000) >> 5))) // Checks if the second bit of the Attack DV is true { secret_id[0] = trainer_id[1] ^ pid[0] ^ pid[2] ^ 0x0; // This value at the end should be random between 0 - 15, if that is to be implemented secret_id[1] = trainer_id[0] ^ pid[1] ^ pid[3] ^ 0x0; @@ -761,10 +771,8 @@ Simplified_Pokemon Pokemon::get_simple_pkmn() return curr_pkmn; } -void Pokemon::set_to_event() +void Pokemon::set_to_event(byte nature) { - // Things that need to be modified: PID, IV_egg_ability, checksum, OT gender, and the encryption - int event_id = 0; if (species_index_struct == 151) { @@ -812,6 +820,10 @@ void Pokemon::set_to_event() // Load the event into the Pokemon array and unencrypted data array for (int i = 0; i < 0x20; i++) { + if (i == 0x08) + { + i += 10; // Skip over the nickname + } gen_3_pkmn[i] = EVENT_PKMN[event_id][i]; } @@ -823,11 +835,15 @@ void Pokemon::set_to_event() data_section_M[i] = EVENT_PKMN[event_id][i + 0x20 + 36]; } - // Set garbage data at end of nickname to PTGB for true event preservation efforts - gen_3_pkmn[0x10] = 0xCA; - gen_3_pkmn[0x11] = 0xCE; + // insert moves and PP bonuses + data_section_G[8] = (pp_bonus[0] << 0 | pp_bonus[1] << 2 | pp_bonus[2] << 4 | pp_bonus[3] << 6); + data_section_A[0] = moves[0]; // Move 1 + data_section_A[2] = moves[1]; // Move 2 + data_section_A[4] = moves[2]; // Move 3 + data_section_A[6] = moves[3]; // Move 4 // get a new PID in the BACD_R format, and make sure it isn't shiny + disable_auto_random(); u32 n_pid; do { @@ -840,7 +856,8 @@ void Pokemon::set_to_event() pid[i] = (n_pid >> (i * 8)) & 0xFF; }; } while (((pid[0] ^ pid[2] ^ gen_3_pkmn[4] ^ gen_3_pkmn[6]) < 8) && - ((pid[1] ^ pid[3] ^ gen_3_pkmn[5] ^ gen_3_pkmn[7]) == 0)); + ((pid[1] ^ pid[3] ^ gen_3_pkmn[5] ^ gen_3_pkmn[7]) == 0) && + (n_pid % 25 != nature)); // maintain the nature // Set and fill the IVs u16 curr_rand = get_rand_u16(); @@ -857,6 +874,7 @@ void Pokemon::set_to_event() { iv_egg_ability |= ((ivs[i] & 0b11111) << (i * 5)); } + enable_auto_random(); // Determine and set Ability iv_egg_ability |= ((pid[0] & 0x1) ? get_num_abilities(species_index_struct) : 0) << 31; @@ -870,6 +888,14 @@ void Pokemon::set_to_event() // Determine and set OT gender data_section_M[3] |= (caught_data[1] & 0b10000000); + // Check the level + if (*(vu32 *)exp < 560) // Minimum EXP for level 10 + { + *(vu32 *)exp = 560; + } + + data_section_G[2] = (is_new ? 0x44 : 0x00); // Rare Candy if new + // Update and set the checksum checksum = 0x0000; for (int i = 0; i < 12; i = i + 2) diff --git a/source/pokemon_data.cpp b/source/pokemon_data.cpp index e95effe..ed0d58b 100644 --- a/source/pokemon_data.cpp +++ b/source/pokemon_data.cpp @@ -3630,8 +3630,8 @@ const byte MOVESETS[252][32] = { {0b00000000, 0b00000000, 0b00010000, 0b00000001, 0b00000010, 0b00010100, 0b00000000, 0b00000001, 0b11000000, 0b00000000, 0b00000000, 0b00001000, 0b01000010, 0b10000000, 0b00000001, 0b00000000, 0b01000000, 0b00000000, 0b00000000, 0b00001000, 0b00001000, 0b10000100, 0b00000010, 0b00000100, 0b00000000, 0b00010001, 0b00010110, 0b10100000, 0b00001000, 0b00000100, 0b11000000, 0b00000000}, // Fearow {0b00000000, 0b00000000, 0b00000100, 0b00000000, 0b00110010, 0b10011000, 0b00010000, 0b00000000, 0b00000010, 0b00000000, 0b00000000, 0b01011000, 0b00000011, 0b10000000, 0b00100000, 0b00000000, 0b00000000, 0b01000000, 0b00000000, 0b00001100, 0b00001000, 0b10000100, 0b00001010, 0b00001000, 0b00000000, 0b00110001, 0b00000110, 0b10100000, 0b00001001, 0b00000100, 0b11000000, 0b00010000}, // Ekans {0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00110010, 0b10011000, 0b00010000, 0b00000001, 0b00000010, 0b00000000, 0b00000000, 0b01011000, 0b00000011, 0b10000000, 0b00100000, 0b00000000, 0b00000000, 0b01000000, 0b00000000, 0b00001100, 0b00001000, 0b10000100, 0b00000010, 0b00001000, 0b00000000, 0b00110001, 0b00000110, 0b10100000, 0b00000001, 0b00000100, 0b11000000, 0b00000000}, // Arbok - {0b00000100, 0b01000000, 0b00000100, 0b01000000, 0b00100011, 0b00000100, 0b00000000, 0b00000000, 0b00001110, 0b00000000, 0b00001111, 0b00011000, 0b01100010, 0b10000001, 0b01000000, 0b00000000, 0b01000000, 0b00000000, 0b00001000, 0b00001000, 0b00001000, 0b00000100, 0b00000010, 0b00000100, 0b00000000, 0b00010101, 0b00000110, 0b10100001, 0b00000001, 0b00000100, 0b10000000, 0b01000000}, // Pikachu - {0b00000100, 0b01000000, 0b00000000, 0b01000000, 0b00100011, 0b00000000, 0b00000000, 0b00000001, 0b00001110, 0b00000000, 0b00001111, 0b00011000, 0b00100010, 0b10000001, 0b01000000, 0b00000000, 0b01000000, 0b00000000, 0b00001000, 0b00001000, 0b00001000, 0b10000100, 0b00000010, 0b00000100, 0b00000000, 0b00010101, 0b00000110, 0b10100001, 0b00000001, 0b00000100, 0b10000000, 0b01000000}, // Raichu + {0b00000100, 0b01000000, 0b00000100, 0b01000000, 0b00100011, 0b00000100, 0b00000000, 0b01000000, 0b00001110, 0b00000000, 0b00001111, 0b00011000, 0b01100010, 0b10000001, 0b01000000, 0b00000000, 0b01000000, 0b00000000, 0b00001000, 0b00001000, 0b00001000, 0b00000100, 0b00000010, 0b00000100, 0b00000000, 0b00010101, 0b00000110, 0b10100001, 0b00000001, 0b00000100, 0b10000000, 0b01000000}, // Pikachu + {0b00000100, 0b01000000, 0b00000000, 0b01000000, 0b00100011, 0b00000000, 0b00000000, 0b01000001, 0b00001110, 0b00000000, 0b00001111, 0b00011000, 0b00100010, 0b10000001, 0b01000000, 0b00000000, 0b01000000, 0b00000000, 0b00001000, 0b00001000, 0b00001000, 0b10000100, 0b00000010, 0b00000100, 0b00000000, 0b00010101, 0b00000110, 0b10100001, 0b00000001, 0b00000100, 0b10000000, 0b01000000}, // Raichu {0b00000000, 0b00100011, 0b00000000, 0b00001000, 0b00100010, 0b10000000, 0b00000000, 0b00000000, 0b00001110, 0b00000000, 0b00000000, 0b01011000, 0b00000010, 0b10000001, 0b00000000, 0b00000000, 0b01000000, 0b00000000, 0b00000000, 0b00101100, 0b00011000, 0b10000101, 0b00000010, 0b00000100, 0b00000000, 0b01010101, 0b00100110, 0b10110001, 0b00000101, 0b10000100, 0b01000000, 0b01000000}, // Sandshrew {0b00000000, 0b00100011, 0b00000000, 0b00001000, 0b00100010, 0b10000000, 0b00000000, 0b00000001, 0b00001110, 0b00000000, 0b00000000, 0b01011000, 0b00000010, 0b10000001, 0b00000000, 0b00000000, 0b01000000, 0b00000000, 0b00000000, 0b00101100, 0b00011000, 0b10000100, 0b00000010, 0b00000100, 0b00000000, 0b01010101, 0b00100110, 0b10100001, 0b00000001, 0b00000100, 0b01000000, 0b01000000}, // Sandslash {0b00000000, 0b00100001, 0b00000000, 0b10000000, 0b00101011, 0b10001100, 0b10100000, 0b00110000, 0b00001010, 0b00000000, 0b00000101, 0b00011000, 0b00000010, 0b10000001, 0b00001000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00101000, 0b00001000, 0b10000100, 0b00000010, 0b00001100, 0b00000000, 0b00011001, 0b00000110, 0b10100000, 0b00000001, 0b00000100, 0b11100000, 0b01010000}, // Nidoran-f diff --git a/source/pokemon_party.cpp b/source/pokemon_party.cpp index 5d72fb7..cb62d1c 100644 --- a/source/pokemon_party.cpp +++ b/source/pokemon_party.cpp @@ -42,7 +42,7 @@ byte gen1_debug_box_data[0x462] = { 0x24, 0x00, 0x12, 0x04, 0x00, 0x00, 0x02, 0xFF, 0x10, 0x00, 0x00, 0x00, 0x6F, 0xC6, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x35, 0xC2, 0x23, 0x00, 0x00, 0x00, 0x24, 0x00, 0x11, 0x04, 0x00, 0x00, 0x02, 0xFF, 0x10, 0x00, 0x00, 0x00, 0x6F, 0xC6, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4D, 0x2A, 0x23, 0x00, 0x00, 0x00, 0xA5, 0x00, 0x0E, 0x03, 0x00, 0x00, 0x00, 0xFF, 0x21, 0x27, 0x00, 0x00, 0x6F, 0xC6, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2C, 0xBE, 0x23, 0x1E, 0x00, 0x00, - 0x15, 0x00, 0x0F, 0x03, 0x00, 0x00, 0x02, 0xFF, 0x10, 0x00, 0x00, 0x00, 0x6F, 0xC6, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x67, 0xE6, 0x23, 0x00, 0x00, 0x00, + 0x15, 0x00, 0x0F, 0x03, 0x00, 0x00, 0x02, 0xFF, 0x10, 0x00, 0x39, 0x3B, 0x6F, 0xC6, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x67, 0xE6, 0x23, 0x00, 0x00, 0x00, // Trainer names 0x80, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, diff --git a/source/script_array.cpp b/source/script_array.cpp index 9451b71..1f45748 100644 --- a/source/script_array.cpp +++ b/source/script_array.cpp @@ -47,9 +47,9 @@ void populate_dialogue() dialogue[DIA_WHAT_LANG_TRANS] = "What language is the Game\nBoy Pok@mon game that you're\ntransferring from?"; dialogue[DIA_NO_GB_ROM] = "I'm sorry, but that version\nin that language is not\ncurrently supported."; dialogue[DIA_IN_BOX] = "Alright! Let's take a look\nat the 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\nrare Mythical Pok@mon!|Due to their rarity, it\nseems they've overloaded 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_MYTHIC_CONVERT] = "It looks like you have a\nrare Mythical Pok@mon!|Due to their rarity, it\nseems they've overloaded the\nmachine.|I can stablize them if you'd\nlike, but it'll change some\nthings like met location,\nOT, TID, 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? This will apply to\nall of the Mythical Pok@mon\ncurrently in your box."; dialogue[DIA_CANCEL] = "No worries! Feel free to\ncome back if you change your\nmind!|See you around!"; - dialogue[DIA_SOME_INVALID_PKMN] = "I see there is at least one\ninvalid Pok@mon in your\ncurrent box.|Invalid Pok@mon won't be\nable to be transfered, but\nthe rest will transfer with no problems!"; + dialogue[DIA_SOME_INVALID_PKMN] = "I see there is at least one\nPok@mon that cannot be\ntransferred from your\ncurrent box.|Pok@mon holding items or\nmodified incorrectly through\nunintended means cannot\nbe transferred.|The other Pok@mon will\ntransfer just fine though!"; 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!"; @@ -262,11 +262,11 @@ bool run_conditional(int index) case COND_CHECK_DEX: if (party_data.get_game_gen() == 1) { - return get_dex_completion(1, false) == 150; + return (get_dex_completion(1, false) == 150) || IGNORE_DEX_COMPLETION; } else { - return get_dex_completion(1, false) == 99; + return (get_dex_completion(1, false) == 99) || IGNORE_DEX_COMPLETION; } case COND_CHECK_KANTO: