diff --git a/graphics/btn_d_l.grit b/graphics/btn_d_l.grit new file mode 100644 index 0000000..aa1971c --- /dev/null +++ b/graphics/btn_d_l.grit @@ -0,0 +1,3 @@ +# +# Button : 4bpp, not compressed. Pallet 2, copy from 32 to 48. +-gB4 -ps32 -pe48 \ No newline at end of file diff --git a/graphics/btn_d_l.png b/graphics/btn_d_l.png new file mode 100644 index 0000000..f7ff1de Binary files /dev/null and b/graphics/btn_d_l.png differ diff --git a/graphics/btn_d_r.grit b/graphics/btn_d_r.grit new file mode 100644 index 0000000..aa1971c --- /dev/null +++ b/graphics/btn_d_r.grit @@ -0,0 +1,3 @@ +# +# Button : 4bpp, not compressed. Pallet 2, copy from 32 to 48. +-gB4 -ps32 -pe48 \ No newline at end of file diff --git a/graphics/btn_d_r.png b/graphics/btn_d_r.png new file mode 100644 index 0000000..7ec8e49 Binary files /dev/null and b/graphics/btn_d_r.png differ diff --git a/include/debug_mode.h b/include/debug_mode.h index efbef62..7341585 100644 --- a/include/debug_mode.h +++ b/include/debug_mode.h @@ -2,8 +2,8 @@ #define DEBUG_MODE_H #define DEBUG_MODE true -#define DEBUG_GAME LEAFGREEN_ID -#define DEBUG_VERS VERS_1_1 +#define DEBUG_GAME EMERALD_ID +#define DEBUG_VERS VERS_1_0 // This is literally it. Yay. #endif \ No newline at end of file diff --git a/include/main_menu.h b/include/main_menu.h index a1f24fa..6972aa1 100644 --- a/include/main_menu.h +++ b/include/main_menu.h @@ -8,14 +8,17 @@ #define MAIN_MENU 0 #define TRANSFER 1 #define POKEDEX 2 -#define CREDITS 3 +#define LANGUAGE 3 +#define CREDITS 4 + +#define BUTTON_ARRAY_SIZE 5 #define NO_ANI 0 #define ENTERING -1 #define EXITING -2 #define DISABLE -3 -void main_menu_init(Button transfer, Button pokedex, Button credits); +void main_menu_init(Button transfer, Button pokedex, Button credits, Button language); int main_menu_loop(); void main_menu_enter(); void main_menu_exit(); diff --git a/include/pokemon.h b/include/pokemon.h index cbc4c4b..1afc889 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -6,9 +6,20 @@ #define POKEMON_SIZE 80 +// How much trade data is sent for each langauge and generation, +// sarts at OT name and ends after the 3 buffer bytes +#define GEN1_JPN_SIZE 353 +#define GEN1_INT_SIZE 418 +#define GEN2_JPN_SIZE 0 +#define GEN2_INT_SIZE 444 + class Pokemon { public: + int pkmn_size = 0; + int ot_and_party = 0; + int ot_size = 0; + int nickname_size = 0; Pokemon(); void load_data(int index, byte *party_data); void convert_to_gen_three(); @@ -16,16 +27,18 @@ public: void alocate_data_chunks(byte *G, byte *A, byte *E, byte *M); void insert_data(byte *first, byte *second, byte *third, byte *fourth); byte get_gen_3_data(int index); - byte* get_full_gen_3_array(); + byte *get_full_gen_3_array(); byte get_unencrypted_data(int index); - byte* convert_text(byte *text_array, int size, int gen); + byte *convert_text(byte *text_array, int size, int gen); u32 generate_pid(byte pid_species_index, byte nature, byte *pid_ivs); byte rand_reverse_mod(byte modulo_divisor, byte target_mod); byte get_rand_gender_byte(byte index_num, byte attack_DVs); + private: byte gen = 2; - byte species_index; + byte species_index_party; // The species ID stored in the party. Really only used for egg detection + byte species_index_struct; // The species ID stored in the pkmn strucutre. The main one to use. byte moves[4]; byte trainer_id[2]; byte secret_id[2]; @@ -36,8 +49,8 @@ private: byte caught_data[2]; byte level; byte gen_3_pkmn[80]; - byte unencrypted_data[49]; // Contains the 48 GAEM bytes, along with the modulo int - byte pid[4] = {0b00000001, 0b10101010, 0b11111111, 0b10011001}; //Little Endian, reverse of Bulbapedia + byte unencrypted_data[49]; // Contains the 48 GAEM bytes, along with the modulo int + byte pid[4] = {0b00000001, 0b10101010, 0b11111111, 0b10011001}; // Little Endian, reverse of Bulbapedia byte blank_word[4] = {0}; byte data_section_G[12]; byte data_section_A[12]; @@ -48,7 +61,7 @@ private: hword origin_info = 0; bool is_shiny = false; byte pp_values[4]; - byte pp_bonus; + byte pp_bonus[4]; byte pure_pp_values[4]; byte dvs[2]; byte ivs[6]; diff --git a/include/pokemon_data.h b/include/pokemon_data.h index 5ada250..6f54117 100644 --- a/include/pokemon_data.h +++ b/include/pokemon_data.h @@ -12,15 +12,16 @@ #define flux_max 1640000 - -extern const u8 EXP_MAX[251]; +extern const u8 EXP_MAX[252]; extern const u32 EXP_TYPES[6]; extern const int GENDER_THRESHOLDS[2][8]; -extern const u8 GENDER_RATIO[251]; -extern const bool NUM_ABILITIES[251]; -extern const byte MOVESETS[251][32]; -extern const byte FIRST_MOVES[251]; -extern const std::string_view NAMES[251]; +extern const u8 GENDER_RATIO[252]; +extern const bool NUM_ABILITIES[252]; +extern const byte MOVESETS[252][32]; +extern const byte FIRST_MOVES[252]; +extern const std::string_view NAMES[252]; +extern const u8 EVOLUTIONS[252]; +extern const u8 POWER_POINTS[252]; extern const byte gen_1_index_array[191]; extern const byte gen_1_char_array[0x80]; extern const byte gen_2_char_array[0x80]; diff --git a/include/pokemon_party.h b/include/pokemon_party.h index 5c7663f..102470e 100644 --- a/include/pokemon_party.h +++ b/include/pokemon_party.h @@ -16,7 +16,7 @@ public: private: Pokemon party[6]; - byte party_data_array[444]; + byte party_data_array[GEN2_INT_SIZE + 4]; int last_error; int party_size; int gen; diff --git a/include/sprite_data.h b/include/sprite_data.h index 07bbe3f..38a7473 100644 --- a/include/sprite_data.h +++ b/include/sprite_data.h @@ -14,6 +14,8 @@ extern OBJ_ATTR *btn_c_r; extern OBJ_ATTR *dex_l[]; extern OBJ_ATTR *dex_m[]; extern OBJ_ATTR *dex_r[]; +extern OBJ_ATTR *btn_d_l; +extern OBJ_ATTR *btn_d_r; void load_background(); void load_textbox_background(); @@ -28,4 +30,6 @@ void load_btn_c_l(); void load_btn_c_r(); void load_dex_l(); void load_dex_m(); -void load_dex_r(); \ No newline at end of file +void load_dex_r(); +void load_btn_d_l(); +void load_btn_d_r(); \ No newline at end of file diff --git a/source/main.cpp b/source/main.cpp index 2ff8643..f3a815e 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -34,25 +34,17 @@ -------- ACCURACY: - See if shiny Pokemon from gen 2 can be square shinies or if they're all normal -- See what happens with hybrid Pokemon LINK CABLE: -- Figure out JP Green +- Figure out JP Gen 2 CONVERSION: -- Fix fateful encounter so Mew and Celebi work -- Fix unown sometimes not being right (J becomes N) -- Add in check for glitch Pokemon -- Add in check for egg -- Restrict illegal moves -- Set full default PP points for ALL moves (and PP ups) -- Check for duplicate moves? -- What happens with Smeargle? -- Check Pokerus -- Fix egg moves only being on the baby Pokemon. TLDR anything Horsea can learn Seadra can too +- Combine gen 1/2 intern char arrays. No reason why they should be different tbh. Make them based on char input - Find automatic detection for languages. Japanese is longer, while other languages only use certian characters +- Korean is not possible, I don't think. Unless it just ignores the names, which we could do? How is the trade data different? INJECTION: +- Switch the gen 3 text conversion to the new array - Redo injection to be picked up like a Mystery Gift - Double check that returns false when PC is full BEFORE injecting - Fix coruption and Pokemon injection @@ -61,6 +53,8 @@ INJECTION: - Enable ribbon viewing - Set flags for the number of Pokemon injected - Set Pokedex flags +- Check what happens when the PC is full, but the last Pokemon doesn't exist (is zero) +- Set text color for FRLG (what happens if you set it in RSE?) SAVE DATA: - Add warning @@ -69,8 +63,6 @@ SAVE DATA: TESTING: - Test all the aspects of a Pokemon (Shiny, Pokerus, etc.) -- Test invalid moves -- Test move bubbling -------- */ @@ -147,15 +139,18 @@ int main(void) load_dex_l(); load_dex_m(); load_dex_r(); + load_btn_d_l(); + load_btn_d_r(); Button transfer_btn = Button(btn_t_l, btn_t_r, 128, 160); Button pokedex_btn = Button(btn_p_l, btn_p_r, 192, 224); Button credits_btn = Button(btn_c_l, btn_c_r, 256, 288); + Button language_btn = Button(btn_d_l, btn_d_r, 416, 448); pokedex_init(); // Why does this cause the music to stop playing? Also the loop doesn't work load_save_data(); - main_menu_init(transfer_btn, pokedex_btn, credits_btn); + main_menu_init(transfer_btn, pokedex_btn, credits_btn, language_btn); text_disable(); @@ -245,6 +240,9 @@ int main(void) main_menu_exit(); } break; + case (LANGUAGE): + main_menu_exit(); + break; case (CREDITS): tte_set_pos(0, 0); tte_write("wow cool credits man"); @@ -260,7 +258,7 @@ int main(void) rand_next_frame(); background_frame(); text_next_frame(); - oam_copy(oam_mem, obj_buffer, 26); + oam_copy(oam_mem, obj_buffer, 28); VBlankIntrWait(); //mmFrame(); //Music diff --git a/source/main_menu.cpp b/source/main_menu.cpp index 1c96b91..cc0abe4 100644 --- a/source/main_menu.cpp +++ b/source/main_menu.cpp @@ -8,18 +8,21 @@ int menu_mode = MAIN_MENU; int ani_mode = 0; int menu_x_cord = 128; -Button button_array[4]; +Button button_array[BUTTON_ARRAY_SIZE]; -void main_menu_init(Button nTransfer, Button nPokedex, Button nCredits) +void main_menu_init(Button nTransfer, Button nPokedex, Button nCredits, Button nLanguage) { button_array[TRANSFER] = nTransfer; button_array[POKEDEX] = nPokedex; + button_array[LANGUAGE] = nLanguage; button_array[CREDITS] = nCredits; - button_array[TRANSFER].set_location(128, 16); - button_array[POKEDEX].set_location(128, 64); - button_array[CREDITS].set_location(128, 112); + button_array[TRANSFER].set_location(128, 7 + (38 * (TRANSFER - 1))); + button_array[POKEDEX].set_location(128, 7 + (38 * (POKEDEX - 1))); + button_array[LANGUAGE].set_location(128, 7 + (38 * (LANGUAGE - 1))); + button_array[CREDITS].set_location(128, 7 + (38 * (CREDITS - 1))); button_array[TRANSFER].show(); button_array[POKEDEX].show(); + button_array[LANGUAGE].show(); button_array[CREDITS].show(); } @@ -30,9 +33,9 @@ int main_menu_loop() case ENTERING: { menu_x_cord = menu_x_cord + 4; - for (int i = 1; i < 4; i++) + for (int i = 1; i < (BUTTON_ARRAY_SIZE + 1); i++) { - button_array[i].set_location(menu_x_cord, 16 + (48 * (i - 1))); + button_array[i].set_location(menu_x_cord, 7 + (38 * (i - 1))); } if (menu_x_cord > 240) { @@ -43,9 +46,9 @@ int main_menu_loop() case EXITING: { menu_x_cord = menu_x_cord - 4; - for (int i = 1; i < 4; i++) + for (int i = 1; i < (BUTTON_ARRAY_SIZE + 1); i++) { - button_array[i].set_location(menu_x_cord, 16 + (48 * (i - 1))); + button_array[i].set_location(menu_x_cord, 7 + (38 * (i - 1))); } if (menu_x_cord <= 128) { @@ -57,7 +60,7 @@ int main_menu_loop() { if (key_hit(KEY_DOWN)) { - if (menu_slot != CREDITS) + if (menu_slot != (BUTTON_ARRAY_SIZE - 1)) { menu_slot++; } diff --git a/source/pokemon.cpp b/source/pokemon.cpp index 977030c..a10d0c8 100644 --- a/source/pokemon.cpp +++ b/source/pokemon.cpp @@ -3,35 +3,78 @@ #include "pokemon_data.h" #include "random.h" -#define name_size 11 - Pokemon::Pokemon(){}; void Pokemon::load_data(int index, byte *party_data) { - int pkmn_size; - int ot_and_party; - if (party_data[418] == 0xFD && party_data[419] == 0xFD && party_data[420] == 0xFD && party_data[421] == 0xFD){ + if (party_data[GEN1_JPN_SIZE + 0] == 0xFD && + party_data[GEN1_JPN_SIZE + 1] == 0xFD && + party_data[GEN1_JPN_SIZE + 2] == 0xFD && + party_data[GEN1_JPN_SIZE + 3] == 0xFD) + { + gen = 1; + pkmn_size = 44; + ot_and_party = 14; + ot_size = 6; + nickname_size = 6; + } + else if (party_data[GEN1_INT_SIZE + 0] == 0xFD && + party_data[GEN1_INT_SIZE + 1] == 0xFD && + party_data[GEN1_INT_SIZE + 2] == 0xFD && + party_data[GEN1_INT_SIZE + 3] == 0xFD) + { gen = 1; pkmn_size = 44; ot_and_party = 19; - } else { + ot_size = 11; + nickname_size = 11; + } + /* + else if (party_data[GEN2_JPN_SIZE + 0] == 0xFD && + party_data[GEN2_JPN_SIZE + 1] == 0xFD && + party_data[GEN2_JPN_SIZE + 2] == 0xFD && + party_data[GEN2_JPN_SIZE + 3] == 0xFD) + { + // DOUBLE CHECK THIS + gen = 2; + pkmn_size = 48; + ot_and_party = 17; + ot_size = 6; + nickname_size = 6; + }*/ + else if (party_data[GEN2_INT_SIZE + 0] == 0xFD && + party_data[GEN2_INT_SIZE + 1] == 0xFD && + party_data[GEN2_INT_SIZE + 2] == 0xFD && + party_data[GEN2_INT_SIZE + 3] == 0xFD) + { gen = 2; pkmn_size = 48; ot_and_party = 21; + ot_size = 11; + nickname_size = 11; } + else + { + tte_erase_screen(); + tte_write("An unexpected error has occured. Please contact the developer"); + while (true) + { + }; + } + int party_offset = ot_and_party + (index * pkmn_size); - int ot_offset = ot_and_party + (6 * pkmn_size) + (index * name_size); - int name_offset = ot_and_party + (6 * pkmn_size) + (6 * name_size) + (index * name_size); + int ot_offset = ot_and_party + (6 * pkmn_size) + (index * ot_size); + int nickname_offset = ot_and_party + (6 * pkmn_size) + (6 * ot_size) + (index * nickname_size); switch (gen) { case 1: - species_index = gen_1_index_array[party_data[party_offset + 0x00]]; + species_index_party = gen_1_index_array[party_data[ot_size + 1 + index]]; + species_index_struct = gen_1_index_array[party_data[party_offset + 0x00]]; copy_from_to(&party_data[party_offset + 0x08], &moves[0], 4, false); copy_from_to(&party_data[party_offset + 0x0C], &trainer_id[0], 2, false); copy_from_to(&party_data[party_offset + 0x0E], &exp[0], 3, true); - copy_from_to(&party_data[name_offset], &nickname[0], 10, false); + copy_from_to(&party_data[nickname_offset], &nickname[0], 10, false); copy_from_to(&party_data[ot_offset + 0x00], &trainer_name[0], 7, false); copy_from_to(&party_data[party_offset + 0x1B], &dvs[0], 2, false); copy_from_to(&party_data[party_offset + 0x1D], &pp_values[0], 4, false); @@ -41,11 +84,12 @@ void Pokemon::load_data(int index, byte *party_data) level = party_data[party_offset + 0x21]; break; case 2: - species_index = party_data[party_offset + 0x00]; + species_index_party = party_data[ot_size + 1 + index]; + species_index_struct = party_data[party_offset + 0x00]; copy_from_to(&party_data[party_offset + 0x02], &moves[0], 4, false); copy_from_to(&party_data[party_offset + 0x06], &trainer_id[0], 2, false); copy_from_to(&party_data[party_offset + 0x08], &exp[0], 3, true); - copy_from_to(&party_data[name_offset], &nickname[0], 10, false); + copy_from_to(&party_data[nickname_offset], &nickname[0], 10, false); copy_from_to(&party_data[ot_offset + 0x00], &trainer_name[0], 7, false); copy_from_to(&party_data[party_offset + 0x15], &dvs[0], 2, false); copy_from_to(&party_data[party_offset + 0x17], &pp_values[0], 4, false); @@ -58,57 +102,81 @@ void Pokemon::load_data(int index, byte *party_data) void Pokemon::convert_to_gen_three() { + 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 + { + return; + } // Generate PID - u32 n_pid = generate_pid(species_index, *(vu32 *)exp % 25, &dvs[0]); + u32 n_pid = generate_pid(species_index_struct, *(vu32 *)exp % 25, &dvs[0]); for (int i = 0; i < 4; i++) { pid[i] = (n_pid >> (i * 8)) & 0xFF; } // Make sure Level is not over 100 based on EXP - if (*(vu32 *)exp > get_max_exp(species_index)) + if (*(vu32 *)exp > get_max_exp(species_index_struct)) { - *(vu32 *)exp = get_max_exp(species_index); + *(vu32 *)exp = get_max_exp(species_index_struct); } // Separate the PP Up values from the Move PP values for (int i = 0; i < 4; i++) { - pure_pp_values[i] = (pp_values[i] & 0b00111111); - pp_bonus |= (pp_values[i] & 0b11000000) >> (6 - i * 2); + pure_pp_values[i] = (pp_values[i] & 0b00111111); // Take only the bottom six bits + pp_bonus[i] = (pp_values[i] >> 6); // Take only the top two bits } // Check that the moves are valid - for (int i = 0; i < 4; i++){ - if((!can_learn_move(species_index, moves[i])) && (moves[i] != 0)){ - moves[i] = 12; + if (species_index_struct != 0xEB) // Ignore Smeargle due to Sketch + { + for (int i = 0; i < 4; i++) + { + if ((!can_learn_move(species_index_struct, moves[i])) && (moves[i] != 0)) + { + moves[i] = 0; // Remove the move + pp_bonus[i] = 0; // Remove the PP bonus + } } } // Make sure it has at least one move - if (moves[0] + moves[1] + moves[2] + moves[3] == 0){ - moves[0] = get_earliest_move(species_index); + if (moves[0] + moves[1] + moves[2] + moves[3] == 0) + { + moves[0] = get_earliest_move(species_index_struct); } -/* // Bubble valid moves to the top int i, j; bool swapped; - for (i = 0; i < 3; i++) { + for (i = 0; i < 3; i++) + { swapped = false; - for (j = 0; j < 3 - i; j++) { - if ((moves[j] < moves[j + 1]) && moves[j] == 0) { + for (j = 0; j < 3 - i; j++) + { + if ((moves[j] < moves[j + 1]) && moves[j] == 0) + { + // Move the move *and* PP bonus up if there is a blank space moves[j] = moves[j + 1]; + pp_bonus[j] = pp_bonus[j + 1]; moves[j + 1] = 0; + pp_bonus[j + 1] = 0; swapped = true; } } - + // If no two elements were swapped // by inner loop, then break if (swapped == false) break; - }*/ + } + + // Restore the PP values + for (int i = 0; i < 4; i++) + { + pure_pp_values[i] = POWER_POINTS[moves[i]] + ((POWER_POINTS[moves[i]] / 5) * pp_bonus[i]); + } // Convert and set IVs int hp_iv = 0; @@ -127,7 +195,7 @@ void Pokemon::convert_to_gen_three() } // Determine and set Ability - iv_egg_ability |= ((pid[0] & 0x1) ? get_num_abilities(species_index) : 0) << 31; + iv_egg_ability |= ((pid[0] & 0x1) ? get_num_abilities(species_index_struct) : 0) << 31; // Origin info origin_info |= ((caught_data[0] & 0b10000000) << 8); // OT gender - We would shift left 15 bits, but the bit is already shifted over 7 @@ -136,19 +204,17 @@ void Pokemon::convert_to_gen_three() origin_info |= level; // Level met // Ribbons and Obedience - ribbons[2] |= 0b00000100; // Artist Ribbon - if (species_index == 151 || species_index == 251) // Checks for Mew or Celebi - ribbons[3] |= 0x10000000; // Fateful Encounter flag - + // ribbons[2] |= 0b00000100; // Artist Ribbon + ribbons[3] |= 0b10000000; // Fateful Encounter flag // Personality Value copy_from_to(&pid[0], &gen_3_pkmn[0], 4, false); // Trainer ID copy_from_to(&trainer_id[0], &gen_3_pkmn[4], 2, true); // 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 + 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] & 0b11000000) >> 6) | (((dvs[0] & 0b00110000) >> 2) > 7))) // Reorganizes the Attack DV bits so that they will be >7 if the Pokemon is shiny { secret_id[0] = trainer_id[0] ^ pid[0] ^ pid[2] ^ 0xFF; @@ -174,10 +240,10 @@ void Pokemon::convert_to_gen_three() // ??? // Data: - data_section_G[0] = species_index; + data_section_G[0] = species_index_struct; data_section_G[1] = 0x00; // Species Index, check for glitch Pokemon copy_from_to(&exp[0], &data_section_G[4], 3, false); - data_section_G[8] = pp_bonus; + 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 @@ -424,7 +490,9 @@ u32 Pokemon::generate_pid(byte pid_species_index, byte nature, byte *pid_dvs) // Set Nature while ((new_pid % 25) != nature) { - new_pid = (new_pid & 0xFFFFFF00) | ((new_pid & 0xFF) + 4); + // Keep adding 0b100 to the PID until the nature matches + // 0b100 ensures that the 2 LSBs are maintained, as they determine the letter + new_pid = (new_pid & 0xFFFFFF00) | ((new_pid + 0b100) & 0xFF); } return new_pid; } @@ -465,4 +533,4 @@ byte Pokemon::get_rand_gender_byte(byte index_num, byte attack_DVs) { return get_rand_range(gen3_threshold, 256); } -} +} \ No newline at end of file diff --git a/source/pokemon_data.cpp b/source/pokemon_data.cpp index c12315b..ef17ef9 100644 --- a/source/pokemon_data.cpp +++ b/source/pokemon_data.cpp @@ -13,31 +13,34 @@ const int GENDER_THRESHOLDS[2][8]{ u32 get_max_exp(int index_num) { - return EXP_TYPES[EXP_MAX[index_num - 1]]; + return EXP_TYPES[EXP_MAX[index_num]]; }; u8 get_gender_threshold(int index_num, bool is_gen_3) { - return GENDER_THRESHOLDS[is_gen_3][GENDER_RATIO[index_num - 1]]; + return GENDER_THRESHOLDS[is_gen_3][GENDER_RATIO[index_num]]; }; // If the Pokemon has two abilities it returns a 1, since ability 1 is valid. Otherwise it returns 0 bool get_num_abilities(int index_num) { - return NUM_ABILITIES[index_num - 1]; + return NUM_ABILITIES[index_num]; }; bool can_learn_move(int pkmn_index, int move_index) { - byte data_byte = MOVESETS[pkmn_index - 1][move_index / 8]; + byte data_byte = MOVESETS[pkmn_index][move_index / 8]; + data_byte |= MOVESETS[EVOLUTIONS[pkmn_index]][move_index / 8]; // add in the previous evolution's moves (if they exist) + data_byte |= MOVESETS[EVOLUTIONS[EVOLUTIONS[pkmn_index]]][move_index / 8]; // add in the first evolution's moves (if they exist) return (data_byte >> (7 - (move_index % 8))) & 0x1; } byte get_earliest_move(int index_num) { - return FIRST_MOVES[index_num - 1]; + return FIRST_MOVES[index_num]; } +// All data was obtained using PokeAPI const byte gen_1_index_array[191] = { 0x00, // Offset the list to remove "off by one" errors 0x70, // Rhydon @@ -231,6 +234,1043 @@ const byte gen_1_index_array[191] = { 0x46, // Weepinbell 0x47, // Victreebel }; + +const u16 gen_1_Jpn_char_array[256]{ + 0x20, + 0x30A4, + 0x30F4, + 0x30A8, + 0x30AA, + 0x30AC, + 0x30AE, + 0x30B0, + 0x30B2, + 0x30B4, + 0x30B6, + 0x30B8, + 0x30BA, + 0x30BC, + 0x30BE, + 0x30C0, + 0x20, + 0x30C5, + 0x30C7, + 0x30C9, + 0x30CA, + 0x30CB, + 0x30CC, + 0x30CD, + 0x30CE, + 0x30D0, + 0x30D3, + 0x30D6, + 0x30DC, + 0x30DE, + 0x30DF, + 0x30E0, + 0x30A3, + 0x3042, + 0x3044, + 0x3094, + 0x3048, + 0x304A, + 0x304C, + 0x304E, + 0x3050, + 0x3052, + 0x3054, + 0x3056, + 0x3058, + 0x305A, + 0x305C, + 0x305E, + 0x3060, + 0x3062, + 0x3065, + 0x3067, + 0x3069, + 0x306A, + 0x306B, + 0x306C, + 0x306D, + 0x306E, + 0x3070, + 0x3073, + 0x3076, + 0x3079, + 0x307C, + 0x307E, + 0x30D1, + 0x30D4, + 0x30D7, + 0x30DD, + 0x3071, + 0x3074, + 0x3077, + 0x307A, + 0x307D, + 0x307E, + 0x20, + 0x20, + 0x20, + 0x3082, + 0x20, + 0x20, + 0x19E, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x41, + 0x42, + 0x43, + 0x44, + 0x45, + 0x46, + 0x47, + 0x48, + 0x49, + 0x56, + 0x53, + 0x4C, + 0x4D, + 0xFF1A, + 0x3043, + 0x3045, + 0x300C, + 0x300D, + 0x300E, + 0x300F, + 0x30FB, + 0x2026, + 0x3041, + 0x3047, + 0x3049, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x30A2, + 0x30A4, + 0x30A6, + 0x30A8, + 0x30AA, + 0x30AB, + 0x30AD, + 0x30AF, + 0x30B1, + 0x30B3, + 0x30B5, + 0x30B7, + 0x30B9, + 0x30BB, + 0x30BD, + 0x30BF, + 0x30C1, + 0x30C4, + 0x30C6, + 0x30C8, + 0x30CA, + 0x30CB, + 0x30CC, + 0x30CD, + 0x30CE, + 0x30CF, + 0x30D2, + 0x30D5, + 0x30DB, + 0x30DE, + 0x30DF, + 0x30E0, + 0x30E1, + 0x30E2, + 0x30E4, + 0x30E6, + 0x30E8, + 0x30E9, + 0x30EB, + 0x30EC, + 0x30ED, + 0x30EF, + 0x30F2, + 0x30F3, + 0x30C3, + 0x30E3, + 0x30E5, + 0x30E7, + 0x30A3, + 0x3042, + 0x3044, + 0x3046, + 0x3048, + 0x304A, + 0x304B, + 0x304D, + 0x304F, + 0x3051, + 0x3053, + 0x3055, + 0x3057, + 0x3059, + 0x305B, + 0x305D, + 0x20, + 0x3061, + 0x3064, + 0x3066, + 0x3068, + 0x306A, + 0x306B, + 0x306C, + 0x306D, + 0x306E, + 0x306F, + 0x3072, + 0x3075, + 0x3078, + 0x307B, + 0x307E, + 0x307F, + 0x3080, + 0x3081, + 0x3082, + 0x3084, + 0x3086, + 0x3088, + 0x3089, + 0x30EA, + 0x308B, + 0x308C, + 0x308D, + 0x308F, + 0x3092, + 0x3093, + 0x3063, + 0x3083, + 0x50, + 0x4D, + 0x30FC, + 0x309C, + 0x309B, + 0x3F, + 0x21, + 0x3002, + 0x30A1, + 0x30A5, + 0x30A7, + 0x25B7, + 0x25B6, + 0x25BC, + 0x2642, + 0x5186, + 0xD7, + 0x2E, + 0x2F, + 0x30A9, + 0x2640, + 0x30, + 0x31, + 0x32, + 0x33, + 0x34, + 0x35, + 0x36, + 0x37, + 0x38, + 0x39, +}; +const u16 gen_1_Eng_char_array[256]{ + 0x2400, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x19E, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x41, + 0x42, + 0x43, + 0x44, + 0x45, + 0x46, + 0x47, + 0x48, + 0x49, + 0x56, + 0x53, + 0x4C, + 0x4D, + 0x3A, + 0x3043, + 0x3045, + 0x2018, + 0x2019, + 0x201C, + 0x201D, + 0x30FB, + 0x2026, + 0x3041, + 0x3047, + 0x3049, + 0x2554, + 0x2550, + 0x2557, + 0x2551, + 0x255A, + 0x255D, + 0x2420, + 0x41, + 0x42, + 0x43, + 0x44, + 0x45, + 0x46, + 0x47, + 0x48, + 0x49, + 0x4A, + 0x4B, + 0x4C, + 0x4D, + 0x4E, + 0x4F, + 0x50, + 0x51, + 0x52, + 0x53, + 0x54, + 0x55, + 0x56, + 0x57, + 0x58, + 0x59, + 0x5A, + 0x28, + 0x29, + 0x3A, + 0x3B, + 0x5B, + 0x5D, + 0x61, + 0x62, + 0x63, + 0x64, + 0x65, + 0x66, + 0x67, + 0x68, + 0x69, + 0x6A, + 0x6B, + 0x6C, + 0x6D, + 0x6E, + 0x6F, + 0x70, + 0x71, + 0x72, + 0x73, + 0x74, + 0x75, + 0x76, + 0x77, + 0x78, + 0x79, + 0x7A, + 0xE9, + 0x64, + 0x6C, + 0x73, + 0x74, + 0x76, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x50, + 0x4D, + 0x2D, + 0x72, + 0x6D, + 0x3F, + 0x21, + 0x2E, + 0x30A1, + 0x30A5, + 0x30A7, + 0x25B7, + 0x25B6, + 0x25BC, + 0x2642, + 0x20, + 0xD7, + 0x2E, + 0x2F, + 0x2C, + 0x2640, + 0x30, + 0x31, + 0x32, + 0x33, + 0x34, + 0x35, + 0x36, + 0x37, + 0x38, + 0x39, +}; +const u16 gen_1_FreGer_char_array[256]{ + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x19E, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x41, + 0x42, + 0x43, + 0x44, + 0x45, + 0x46, + 0x47, + 0x48, + 0x49, + 0x56, + 0x53, + 0x4C, + 0x4D, + 0x3A, + 0x3043, + 0x3045, + 0x2018, + 0x2019, + 0x201C, + 0x201D, + 0x30FB, + 0x22EF, + 0x3041, + 0x3047, + 0x3049, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x2420, + 0x41, + 0x42, + 0x43, + 0x44, + 0x45, + 0x46, + 0x47, + 0x48, + 0x49, + 0x4A, + 0x4B, + 0x4C, + 0x4D, + 0x4E, + 0x4F, + 0x50, + 0x51, + 0x52, + 0x53, + 0x54, + 0x55, + 0x56, + 0x57, + 0x58, + 0x59, + 0x5A, + 0x28, + 0x29, + 0x3A, + 0x3B, + 0x5B, + 0x5D, + 0x61, + 0x62, + 0x63, + 0x64, + 0x65, + 0x66, + 0x67, + 0x68, + 0x69, + 0x6A, + 0x6B, + 0x6C, + 0x6D, + 0x6E, + 0x6F, + 0x70, + 0x71, + 0x72, + 0x73, + 0x74, + 0x75, + 0x76, + 0x77, + 0x78, + 0x79, + 0x7A, + 0xE0, + 0xE8, + 0xE9, + 0xF9, + 0xDF, + 0xE7, + 0x20, + 0xD6, + 0xDC, + 0xE4, + 0xF6, + 0xFC, + 0xEB, + 0xEF, + 0xE2, + 0xF4, + 0xFB, + 0xEA, + 0xEE, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x63, + 0x64, + 0x6A, + 0x6C, + 0x6D, + 0x6E, + 0x70, + 0x73, + 0x73, + 0x74, + 0x75, + 0x79, + 0x20, + 0x50, + 0x4D, + 0x2D, + 0x2B, + 0x20, + 0x3F, + 0x21, + 0x2E, + 0x30A1, + 0x30A5, + 0x30A7, + 0x25B7, + 0x25B6, + 0x25BC, + 0x2642, + 0x20, + 0xD7, + 0x2E, + 0x2F, + 0x2C, + 0x2640, + 0x30, + 0x31, + 0x32, + 0x33, + 0x34, + 0x35, + 0x36, + 0x37, + 0x38, + 0x39, +}; +const u16 gen_1_ItaSpa_char_array[256]{ + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x19E, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x41, + 0x42, + 0x43, + 0x44, + 0x45, + 0x46, + 0x47, + 0x48, + 0x49, + 0x56, + 0x53, + 0x4C, + 0x4D, + 0x3A, + 0x3043, + 0x3045, + 0x2018, + 0x2019, + 0x201C, + 0x201D, + 0x30FB, + 0x22EF, + 0x3041, + 0x3047, + 0x3049, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x20, + 0x2420, + 0x41, + 0x42, + 0x43, + 0x44, + 0x45, + 0x46, + 0x47, + 0x48, + 0x49, + 0x4A, + 0x4B, + 0x4C, + 0x4D, + 0x4E, + 0x4F, + 0x50, + 0x51, + 0x52, + 0x53, + 0x54, + 0x55, + 0x56, + 0x57, + 0x58, + 0x59, + 0x5A, + 0x28, + 0x29, + 0x3A, + 0x3B, + 0x5B, + 0x5D, + 0x61, + 0x62, + 0x63, + 0x64, + 0x65, + 0x66, + 0x67, + 0x68, + 0x69, + 0x6A, + 0x6B, + 0x6C, + 0x6D, + 0x6E, + 0x6F, + 0x70, + 0x71, + 0x72, + 0x73, + 0x74, + 0x75, + 0x76, + 0x77, + 0x78, + 0x79, + 0x7A, + 0xE0, + 0xE8, + 0xE9, + 0xF9, + 0xC0, + 0xC1, + 0x20, + 0xD6, + 0xDC, + 0xE4, + 0xF6, + 0xFC, + 0xC8, + 0xC9, + 0xCC, + 0xCD, + 0xD1, + 0xD2, + 0xD3, + 0xD9, + 0xDA, + 0xE1, + 0xEC, + 0xED, + 0xF1, + 0xF2, + 0xF3, + 0xFA, + 0xBA, + 0x26, + 0x64, + 0x6C, + 0x6D, + 0x72, + 0x73, + 0x74, + 0x76, + 0x20, + 0x20, + 0x50, + 0x4D, + 0x2D, + 0xBF, + 0xA1, + 0x3F, + 0x21, + 0x2E, + 0x30A1, + 0x30A5, + 0x30A7, + 0x25B7, + 0x25B6, + 0x25BC, + 0x2642, + 0x20, + 0xD7, + 0x2E, + 0x2F, + 0x2C, + 0x2640, + 0x30, + 0x31, + 0x32, + 0x33, + 0x34, + 0x35, + 0x36, + 0x37, + 0x38, + 0x39, +}; +const u16 gen_2_Jpn_char_array[256]{}; +const u16 gen_2_Eng_char_array[256]{}; +const u16 gen_2_FreGer_char_array[256]{}; +const u16 gen_2_ItaSpa_char_array[256]{}; const byte gen_1_char_array[0x80] = { // Stores the gen 3 character ID in the gen 1 spot 0xBB, @@ -493,7 +1533,9 @@ const byte gen_2_char_array[0x80] = { 0xA9, 0xAA, }; -const u8 EXP_MAX[251] = { + +const u8 EXP_MAX[252] = { + 0, // Offset the list to remove "off by one" errors 2, // Bulbasaur 2, // Ivysaur 2, // Venusaur @@ -746,7 +1788,8 @@ const u8 EXP_MAX[251] = { 3, // Ho-Oh 2, // Celebi }; -const u8 GENDER_RATIO[251] = { +const u8 GENDER_RATIO[252] = { + 0, // Offset the list to remove "off by one" errors 1, // Bulbasaur [1♀:7♂] 1, // Ivysaur [1♀:7♂] 1, // Venusaur [1♀:7♂] @@ -999,7 +2042,8 @@ const u8 GENDER_RATIO[251] = { 7, // Ho-Oh [Gender Unknown] 7, // Celebi [Gender Unknown] }; -const bool NUM_ABILITIES[251] = { +const bool NUM_ABILITIES[252] = { + 0, // Offset the list to remove "off by one" errors 0, // Bulbasaur Overgrow 0, // Ivysaur Overgrow 0, // Venusaur Overgrow @@ -1252,9 +2296,10 @@ const bool NUM_ABILITIES[251] = { 0, // Ho-Oh Pressure 0, // Celebi Natural Cure }; -const byte MOVESETS[251][32] = { +const byte MOVESETS[252][32] = { // This data is stored as 32 bytes of binary data per Pokemon, depending on if they can learn the move. Data obtained through PokeAPI - // 0(unused) 8 16 24 32 40 48 56 64 72 80 88 96 104 112 120 128 136 144 152 160 168 176 184 192 200 208 216 224 232 240 248 + // 0(unused) 8 16 24 32 40 48 56 64 72 80 88 96 104 112 120 128 136 144 152 160 168 176 184 192 200 208 216 224 232 240 248 + {0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000}, // Offset the list to remove "off by one" errors {0b00000000, 0b00000011, 0b00000010, 0b00000000, 0b01100010, 0b00000100, 0b00000000, 0b00000000, 0b00000010, 0b01111101, 0b10000000, 0b00001000, 0b00000010, 0b10000001, 0b01000000, 0b00000000, 0b00100000, 0b00000000, 0b00001000, 0b00001000, 0b00001000, 0b00000110, 0b00000010, 0b00001100, 0b00000000, 0b00111001, 0b00100110, 0b10110000, 0b00000010, 0b00010100, 0b01000000, 0b01000000}, // Bulbasaur {0b00000000, 0b00000011, 0b00000010, 0b00000000, 0b01100010, 0b00000100, 0b00000000, 0b00000000, 0b00000010, 0b01111101, 0b00000000, 0b00001000, 0b00000010, 0b10000001, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00001000, 0b00001000, 0b00001000, 0b00000100, 0b00000010, 0b00001100, 0b00000000, 0b00110001, 0b00100110, 0b10100000, 0b00000010, 0b00010100, 0b01000000, 0b01000000}, // Ivysaur {0b00000000, 0b00000011, 0b00000010, 0b00000000, 0b01100010, 0b00000110, 0b00000000, 0b00000001, 0b00000010, 0b01111101, 0b00000000, 0b01001000, 0b00000010, 0b10000001, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00001000, 0b00001000, 0b00001000, 0b00000100, 0b00000010, 0b00001100, 0b00000000, 0b00110001, 0b00100110, 0b10100000, 0b00000010, 0b00010100, 0b01000000, 0b01000000}, // Venusaur @@ -1507,8 +2552,9 @@ const byte MOVESETS[251][32] = { {0b00000000, 0b00000000, 0b10110000, 0b00000000, 0b00000010, 0b00000010, 0b00000100, 0b00000001, 0b00000010, 0b00001000, 0b00000111, 0b01001010, 0b00000010, 0b11000000, 0b01010000, 0b00000010, 0b01000000, 0b00100000, 0b00001000, 0b00001000, 0b00001000, 0b00000100, 0b00000010, 0b00000100, 0b00000000, 0b01110001, 0b00010010, 0b10110100, 0b00000000, 0b00000100, 0b11001011, 0b11000000}, // Ho-oh {0b00000000, 0b00000011, 0b00000000, 0b00000000, 0b00000010, 0b00000000, 0b00000000, 0b00000001, 0b00000000, 0b01001000, 0b00000000, 0b00001110, 0b00000010, 0b11000001, 0b01010010, 0b00000000, 0b01000000, 0b00100000, 0b00001000, 0b00001000, 0b00001000, 0b00000100, 0b00000010, 0b00000100, 0b00010000, 0b01110001, 0b00000011, 0b10110000, 0b00100000, 0b00000100, 0b11001011, 0b10000000}, // Celebi }; -const byte FIRST_MOVES[251] = { +const byte FIRST_MOVES[252] = { // Data obtained through PokeAPI + 0, // Offset the list to remove "off by one" errors 0x21, // Bulbasaur (tackle) 0x21, // Ivysaur (tackle) 0x16, // Venusaur (vine-whip) @@ -1761,7 +2807,8 @@ const byte FIRST_MOVES[251] = { 0x12, // Ho-oh (whirlwind) 0x49, // Celebi (leech-seed) }; -const std::string_view NAMES[251]{ +const std::string_view NAMES[252]{ + "", // Offset the list to remove "off by one" errors "Bulbasaur", "Ivysaur", "Venusaur", @@ -2014,6 +3061,511 @@ const std::string_view NAMES[251]{ "Ho-Oh", "Celebi", }; -//const u8 EVOLUTIONS[251][2] -//const u8 POWER_POINTS[253] - +const u8 EVOLUTIONS[252]{ + 0, // Offset the list to remove "off by one" errors + 0x0, // Bulbasaur is a base evolution + 0x1, // Ivysaur evolves from Bulbasaur + 0x2, // Venusaur evolves from Ivysaur + 0x0, // Charmander is a base evolution + 0x4, // Charmeleon evolves from Charmander + 0x5, // Charizard evolves from Charmeleon + 0x0, // Squirtle is a base evolution + 0x7, // Wartortle evolves from Squirtle + 0x8, // Blastoise evolves from Wartortle + 0x0, // Caterpie is a base evolution + 0xa, // Metapod evolves from Caterpie + 0xb, // Butterfree evolves from Metapod + 0x0, // Weedle is a base evolution + 0xd, // Kakuna evolves from Weedle + 0xe, // Beedrill evolves from Kakuna + 0x0, // Pidgey is a base evolution + 0x10, // Pidgeotto evolves from Pidgey + 0x11, // Pidgeot evolves from Pidgeotto + 0x0, // Rattata is a base evolution + 0x13, // Raticate evolves from Rattata + 0x0, // Spearow is a base evolution + 0x15, // Fearow evolves from Spearow + 0x0, // Ekans is a base evolution + 0x17, // Arbok evolves from Ekans + 0xac, // Pikachu evolves from Pichu + 0x19, // Raichu evolves from Pikachu + 0x0, // Sandshrew is a base evolution + 0x1b, // Sandslash evolves from Sandshrew + 0x0, // Nidoran-f is a base evolution + 0x1d, // Nidorina evolves from Nidoran-f + 0x1e, // Nidoqueen evolves from Nidorina + 0x0, // Nidoran-m is a base evolution + 0x20, // Nidorino evolves from Nidoran-m + 0x21, // Nidoking evolves from Nidorino + 0xad, // Clefairy evolves from Cleffa + 0x23, // Clefable evolves from Clefairy + 0x0, // Vulpix is a base evolution + 0x25, // Ninetales evolves from Vulpix + 0xae, // Jigglypuff evolves from Igglybuff + 0x27, // Wigglytuff evolves from Jigglypuff + 0x0, // Zubat is a base evolution + 0x29, // Golbat evolves from Zubat + 0x0, // Oddish is a base evolution + 0x2b, // Gloom evolves from Oddish + 0x2c, // Vileplume evolves from Gloom + 0x0, // Paras is a base evolution + 0x2e, // Parasect evolves from Paras + 0x0, // Venonat is a base evolution + 0x30, // Venomoth evolves from Venonat + 0x0, // Diglett is a base evolution + 0x32, // Dugtrio evolves from Diglett + 0x0, // Meowth is a base evolution + 0x34, // Persian evolves from Meowth + 0x0, // Psyduck is a base evolution + 0x36, // Golduck evolves from Psyduck + 0x0, // Mankey is a base evolution + 0x38, // Primeape evolves from Mankey + 0x0, // Growlithe is a base evolution + 0x3a, // Arcanine evolves from Growlithe + 0x0, // Poliwag is a base evolution + 0x3c, // Poliwhirl evolves from Poliwag + 0x3d, // Poliwrath evolves from Poliwhirl + 0x0, // Abra is a base evolution + 0x3f, // Kadabra evolves from Abra + 0x40, // Alakazam evolves from Kadabra + 0x0, // Machop is a base evolution + 0x42, // Machoke evolves from Machop + 0x43, // Machamp evolves from Machoke + 0x0, // Bellsprout is a base evolution + 0x45, // Weepinbell evolves from Bellsprout + 0x46, // Victreebel evolves from Weepinbell + 0x0, // Tentacool is a base evolution + 0x48, // Tentacruel evolves from Tentacool + 0x0, // Geodude is a base evolution + 0x4a, // Graveler evolves from Geodude + 0x4b, // Golem evolves from Graveler + 0x0, // Ponyta is a base evolution + 0x4d, // Rapidash evolves from Ponyta + 0x0, // Slowpoke is a base evolution + 0x4f, // Slowbro evolves from Slowpoke + 0x0, // Magnemite is a base evolution + 0x51, // Magneton evolves from Magnemite + 0x0, // Farfetchd is a base evolution + 0x0, // Doduo is a base evolution + 0x54, // Dodrio evolves from Doduo + 0x0, // Seel is a base evolution + 0x56, // Dewgong evolves from Seel + 0x0, // Grimer is a base evolution + 0x58, // Muk evolves from Grimer + 0x0, // Shellder is a base evolution + 0x5a, // Cloyster evolves from Shellder + 0x0, // Gastly is a base evolution + 0x5c, // Haunter evolves from Gastly + 0x5d, // Gengar evolves from Haunter + 0x0, // Onix is a base evolution + 0x0, // Drowzee is a base evolution + 0x60, // Hypno evolves from Drowzee + 0x0, // Krabby is a base evolution + 0x62, // Kingler evolves from Krabby + 0x0, // Voltorb is a base evolution + 0x64, // Electrode evolves from Voltorb + 0x0, // Exeggcute is a base evolution + 0x66, // Exeggutor evolves from Exeggcute + 0x0, // Cubone is a base evolution + 0x68, // Marowak evolves from Cubone + 0xec, // Hitmonlee evolves from Tyrogue + 0xec, // Hitmonchan evolves from Tyrogue + 0x0, // Lickitung is a base evolution + 0x0, // Koffing is a base evolution + 0x6d, // Weezing evolves from Koffing + 0x0, // Rhyhorn is a base evolution + 0x6f, // Rhydon evolves from Rhyhorn + 0x0, // Chansey is a base evolution (in gen 2) + 0x0, // Tangela is a base evolution + 0x0, // Kangaskhan is a base evolution + 0x0, // Horsea is a base evolution + 0x74, // Seadra evolves from Horsea + 0x0, // Goldeen is a base evolution + 0x76, // Seaking evolves from Goldeen + 0x0, // Staryu is a base evolution + 0x78, // Starmie evolves from Staryu + 0x0, // Mr-mime is a base evolution (in gen 2) + 0x0, // Scyther is a base evolution + 0xee, // Jynx evolves from Smoochum + 0xef, // Electabuzz evolves from Elekid + 0xf0, // Magmar evolves from Magby + 0x0, // Pinsir is a base evolution + 0x0, // Tauros is a base evolution + 0x0, // Magikarp is a base evolution + 0x81, // Gyarados evolves from Magikarp + 0x0, // Lapras is a base evolution + 0x0, // Ditto is a base evolution + 0x0, // Eevee is a base evolution + 0x85, // Vaporeon evolves from Eevee + 0x85, // Jolteon evolves from Eevee + 0x85, // Flareon evolves from Eevee + 0x0, // Porygon is a base evolution + 0x0, // Omanyte is a base evolution + 0x8a, // Omastar evolves from Omanyte + 0x0, // Kabuto is a base evolution + 0x8c, // Kabutops evolves from Kabuto + 0x0, // Aerodactyl is a base evolution + 0x0, // Snorlax is a base evolution (in gen 2) + 0x0, // Articuno is a base evolution + 0x0, // Zapdos is a base evolution + 0x0, // Moltres is a base evolution + 0x0, // Dratini is a base evolution + 0x93, // Dragonair evolves from Dratini + 0x94, // Dragonite evolves from Dragonair + 0x0, // Mewtwo is a base evolution + 0x0, // Mew is a base evolution + 0x0, // Chikorita is a base evolution + 0x98, // Bayleef evolves from Chikorita + 0x99, // Meganium evolves from Bayleef + 0x0, // Cyndaquil is a base evolution + 0x9b, // Quilava evolves from Cyndaquil + 0x9c, // Typhlosion evolves from Quilava + 0x0, // Totodile is a base evolution + 0x9e, // Croconaw evolves from Totodile + 0x9f, // Feraligatr evolves from Croconaw + 0x0, // Sentret is a base evolution + 0xa1, // Furret evolves from Sentret + 0x0, // Hoothoot is a base evolution + 0xa3, // Noctowl evolves from Hoothoot + 0x0, // Ledyba is a base evolution + 0xa5, // Ledian evolves from Ledyba + 0x0, // Spinarak is a base evolution + 0xa7, // Ariados evolves from Spinarak + 0x2a, // Crobat evolves from Golbat + 0x0, // Chinchou is a base evolution + 0xaa, // Lanturn evolves from Chinchou + 0x0, // Pichu is a base evolution + 0x0, // Cleffa is a base evolution + 0x0, // Igglybuff is a base evolution + 0x0, // Togepi is a base evolution + 0xaf, // Togetic evolves from Togepi + 0x0, // Natu is a base evolution + 0xb1, // Xatu evolves from Natu + 0x0, // Mareep is a base evolution + 0xb3, // Flaaffy evolves from Mareep + 0xb4, // Ampharos evolves from Flaaffy + 0x2c, // Bellossom evolves from Gloom + 0x0, // Marill is a base evolution (in gen 2) + 0xb7, // Azumarill evolves from Marill + 0x0, // Sudowoodo is a base evolution (in gen 2) + 0x3d, // Politoed evolves from Poliwhirl + 0x0, // Hoppip is a base evolution + 0xbb, // Skiploom evolves from Hoppip + 0xbc, // Jumpluff evolves from Skiploom + 0x0, // Aipom is a base evolution + 0x0, // Sunkern is a base evolution + 0xbf, // Sunflora evolves from Sunkern + 0x0, // Yanma is a base evolution + 0x0, // Wooper is a base evolution + 0xc2, // Quagsire evolves from Wooper + 0x85, // Espeon evolves from Eevee + 0x85, // Umbreon evolves from Eevee + 0x0, // Murkrow is a base evolution + 0x4f, // Slowking evolves from Slowpoke + 0x0, // Misdreavus is a base evolution + 0x0, // Unown is a base evolution + 0x0, // Wobbuffet is a base evolution (in gen 2) + 0x0, // Girafarig is a base evolution + 0x0, // Pineco is a base evolution + 0xcc, // Forretress evolves from Pineco + 0x0, // Dunsparce is a base evolution + 0x0, // Gligar is a base evolution + 0x5f, // Steelix evolves from Onix + 0x0, // Snubbull is a base evolution + 0xd1, // Granbull evolves from Snubbull + 0x0, // Qwilfish is a base evolution + 0x7b, // Scizor evolves from Scyther + 0x0, // Shuckle is a base evolution + 0x0, // Heracross is a base evolution + 0x0, // Sneasel is a base evolution + 0x0, // Teddiursa is a base evolution + 0xd8, // Ursaring evolves from Teddiursa + 0x0, // Slugma is a base evolution + 0xda, // Magcargo evolves from Slugma + 0x0, // Swinub is a base evolution + 0xdc, // Piloswine evolves from Swinub + 0x0, // Corsola is a base evolution + 0x0, // Remoraid is a base evolution + 0xdf, // Octillery evolves from Remoraid + 0x0, // Delibird is a base evolution + 0x0, // Mantine is a base evolution (in gen 2) + 0x0, // Skarmory is a base evolution + 0x0, // Houndour is a base evolution + 0xe4, // Houndoom evolves from Houndour + 0x75, // Kingdra evolves from Seadra + 0x0, // Phanpy is a base evolution + 0xe7, // Donphan evolves from Phanpy + 0x89, // Porygon2 evolves from Porygon + 0x0, // Stantler is a base evolution + 0x0, // Smeargle is a base evolution + 0x0, // Tyrogue is a base evolution + 0xec, // Hitmontop evolves from Tyrogue + 0x0, // Smoochum is a base evolution + 0x0, // Elekid is a base evolution + 0x0, // Magby is a base evolution + 0x0, // Miltank is a base evolution + 0x71, // Blissey evolves from Chansey + 0x0, // Raikou is a base evolution + 0x0, // Entei is a base evolution + 0x0, // Suicune is a base evolution + 0x0, // Larvitar is a base evolution + 0xf6, // Pupitar evolves from Larvitar + 0xf7, // Tyranitar evolves from Pupitar + 0x0, // Lugia is a base evolution + 0x0, // Ho-oh is a base evolution + 0x0, // Celebi is a base evolution +}; +const u8 POWER_POINTS[252]{ + 0, // Offset the list to remove "off by one" errors + 35, // Pound + 25, // Karate-chop + 10, // Double-slap + 15, // Comet-punch + 20, // Mega-punch + 20, // Pay-day + 15, // Fire-punch + 15, // Ice-punch + 15, // Thunder-punch + 35, // Scratch + 30, // Vice-grip + 5, // Guillotine + 10, // Razor-wind + 20, // Swords-dance + 30, // Cut + 35, // Gust + 35, // Wing-attack + 20, // Whirlwind + 15, // Fly + 20, // Bind + 20, // Slam + 25, // Vine-whip + 20, // Stomp + 30, // Double-kick + 5, // Mega-kick + 10, // Jump-kick + 15, // Rolling-kick + 15, // Sand-attack + 15, // Headbutt + 25, // Horn-attack + 20, // Fury-attack + 5, // Horn-drill + 35, // Tackle + 15, // Body-slam + 20, // Wrap + 20, // Take-down + 10, // Thrash + 15, // Double-edge + 30, // Tail-whip + 35, // Poison-sting + 20, // Twineedle + 20, // Pin-missile + 30, // Leer + 25, // Bite + 40, // Growl + 20, // Roar + 15, // Sing + 20, // Supersonic + 20, // Sonic-boom + 20, // Disable + 30, // Acid + 25, // Ember + 15, // Flamethrower + 30, // Mist + 25, // Water-gun + 5, // Hydro-pump + 15, // Surf + 10, // Ice-beam + 5, // Blizzard + 20, // Psybeam + 20, // Bubble-beam + 20, // Aurora-beam + 5, // Hyper-beam + 35, // Peck + 20, // Drill-peck + 20, // Submission + 20, // Low-kick + 20, // Counter + 20, // Seismic-toss + 15, // Strength + 25, // Absorb + 15, // Mega-drain + 10, // Leech-seed + 20, // Growth + 25, // Razor-leaf + 10, // Solar-beam + 35, // Poison-powder + 30, // Stun-spore + 15, // Sleep-powder + 10, // Petal-dance + 40, // String-shot + 10, // Dragon-rage + 15, // Fire-spin + 30, // Thunder-shock + 15, // Thunderbolt + 20, // Thunder-wave + 10, // Thunder + 15, // Rock-throw + 10, // Earthquake + 5, // Fissure + 10, // Dig + 10, // Toxic + 25, // Confusion + 10, // Psychic + 20, // Hypnosis + 40, // Meditate + 30, // Agility + 30, // Quick-attack + 20, // Rage + 20, // Teleport + 15, // Night-shade + 10, // Mimic + 40, // Screech + 15, // Double-team + 10, // Recover + 30, // Harden + 10, // Minimize + 20, // Smokescreen + 10, // Confuse-ray + 40, // Withdraw + 40, // Defense-curl + 20, // Barrier + 30, // Light-screen + 30, // Haze + 20, // Reflect + 30, // Focus-energy + 10, // Bide + 10, // Metronome + 20, // Mirror-move + 5, // Self-destruct + 10, // Egg-bomb + 30, // Lick + 20, // Smog + 20, // Sludge + 20, // Bone-club + 5, // Fire-blast + 15, // Waterfall + 15, // Clamp + 20, // Swift + 10, // Skull-bash + 15, // Spike-cannon + 35, // Constrict + 20, // Amnesia + 15, // Kinesis + 10, // Soft-boiled + 10, // High-jump-kick + 30, // Glare + 15, // Dream-eater + 40, // Poison-gas + 20, // Barrage + 10, // Leech-life + 10, // Lovely-kiss + 5, // Sky-attack + 10, // Transform + 30, // Bubble + 10, // Dizzy-punch + 15, // Spore + 20, // Flash + 15, // Psywave + 40, // Splash + 20, // Acid-armor + 10, // Crabhammer + 5, // Explosion + 15, // Fury-swipes + 10, // Bonemerang + 10, // Rest + 10, // Rock-slide + 15, // Hyper-fang + 30, // Sharpen + 30, // Conversion + 10, // Tri-attack + 10, // Super-fang + 20, // Slash + 10, // Substitute + 1, // Struggle + 1, // Sketch + 10, // Triple-kick + 25, // Thief + 10, // Spider-web + 5, // Mind-reader + 15, // Nightmare + 25, // Flame-wheel + 15, // Snore + 10, // Curse + 15, // Flail + 30, // Conversion-2 + 5, // Aeroblast + 40, // Cotton-spore + 15, // Reversal + 10, // Spite + 25, // Powder-snow + 10, // Protect + 30, // Mach-punch + 10, // Scary-face + 20, // Feint-attack + 10, // Sweet-kiss + 10, // Belly-drum + 10, // Sludge-bomb + 10, // Mud-slap + 10, // Octazooka + 20, // Spikes + 5, // Zap-cannon + 40, // Foresight + 5, // Destiny-bond + 5, // Perish-song + 15, // Icy-wind + 5, // Detect + 10, // Bone-rush + 5, // Lock-on + 10, // Outrage + 10, // Sandstorm + 10, // Giga-drain + 10, // Endure + 20, // Charm + 20, // Rollout + 40, // False-swipe + 15, // Swagger + 10, // Milk-drink + 20, // Spark + 20, // Fury-cutter + 25, // Steel-wing + 5, // Mean-look + 15, // Attract + 10, // Sleep-talk + 5, // Heal-bell + 20, // Return + 15, // Present + 20, // Frustration + 25, // Safeguard + 20, // Pain-split + 5, // Sacred-fire + 30, // Magnitude + 5, // Dynamic-punch + 10, // Megahorn + 20, // Dragon-breath + 40, // Baton-pass + 5, // Encore + 20, // Pursuit + 40, // Rapid-spin + 20, // Sweet-scent + 15, // Iron-tail + 35, // Metal-claw + 10, // Vital-throw + 5, // Morning-sun + 5, // Synthesis + 5, // Moonlight + 15, // Hidden-power + 5, // Cross-chop + 20, // Twister + 5, // Rain-dance + 5, // Sunny-day + 15, // Crunch + 20, // Mirror-coat + 10, // Psych-up + 5, // Extreme-speed + 5, // Ancient-power + 15, // Shadow-ball + 10, // Future-sight + 15, // Rock-smash + 15, // Whirlpool + 10, // Beat-up +}; diff --git a/source/pokemon_party.cpp b/source/pokemon_party.cpp index 43fcc55..a21ce3c 100644 --- a/source/pokemon_party.cpp +++ b/source/pokemon_party.cpp @@ -5,15 +5,50 @@ #include "debug_mode.h" #include "script.h" -byte debug_party_data[444] = { - 0x8A, 0x91, 0x88, 0x92, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x06, 0x9B, 0x13, 0xA1, 0xA1, 0xA1, 0xA1, 0xFF, 0x25, 0xDA, - 0x8B, 0x00, 0x37, 0x35, 0x21, 0x2B, 0x25, 0xDA, 0x00, 0x00, 0xA7, 0x00, 0x46, 0x00, 0x5C, 0x00, 0x44, 0x00, 0x28, 0x00, 0x46, 0xFA, 0xAA, 0x1F, 0x1E, 0x00, 0x00, 0x45, 0x00, 0x85, 0x81, 0x05, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x13, 0x00, 0x0A, 0x00, 0x09, 0x00, 0x0B, 0x00, 0x0B, 0x00, 0x0A, +byte debug_party_data[GEN2_INT_SIZE + 4] = { // Japanese Gen 1 + 0x07, 0xD8, 0xE3, 0xAB, 0x50, 0x8B, + 0x06, + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, + 0xFF, + 0x01, 0x00, 0x14, 0x00, 0x00, 0x15, 0x15, 0x2D, 0x21, 0x27, 0x00, 0x00, 0x2E, 0x75, 0x00, 0x00, 0xCA, 0x00, 0x2D, 0x00, 0x31, 0x00, 0x31, 0x00, 0x2D, 0x00, 0x41, 0x59, 0x19, 0x23, 0x1D, 0x00, 0x00, 0x06, 0x00, 0x17, 0x00, 0x0B, 0x00, 0x0D, 0x00, 0x0A, 0x00, 0x0C, + 0x02, 0x00, 0x17, 0x06, 0x00, 0x15, 0x15, 0x2D, 0x21, 0x27, 0x00, 0x00, 0x2E, 0x75, 0x00, 0x00, 0xCA, 0x00, 0x2D, 0x00, 0x31, 0x00, 0x31, 0x00, 0x2D, 0x00, 0x41, 0x59, 0x19, 0x23, 0x1D, 0x00, 0x00, 0x06, 0x00, 0x17, 0x00, 0x0B, 0x00, 0x0D, 0x00, 0x0A, 0x00, 0x0C, + 0x03, 0x00, 0x17, 0x06, 0x00, 0x15, 0x15, 0x2D, 0x21, 0x27, 0x00, 0x00, 0x2E, 0x75, 0x00, 0x00, 0xCA, 0x00, 0x2D, 0x00, 0x31, 0x00, 0x31, 0x00, 0x2D, 0x00, 0x41, 0x59, 0x19, 0x23, 0x1D, 0x00, 0x00, 0x06, 0x00, 0x17, 0x00, 0x0B, 0x00, 0x0D, 0x00, 0x0A, 0x00, 0x0C, + 0x04, 0x00, 0x17, 0x06, 0x00, 0x15, 0x15, 0x2D, 0x21, 0x27, 0x00, 0x00, 0x2E, 0x75, 0x00, 0x00, 0xCA, 0x00, 0x2D, 0x00, 0x31, 0x00, 0x31, 0x00, 0x2D, 0x00, 0x41, 0x59, 0x19, 0x23, 0x1D, 0x00, 0x00, 0x06, 0x00, 0x17, 0x00, 0x0B, 0x00, 0x0D, 0x00, 0x0A, 0x00, 0x0C, + 0x05, 0x00, 0x17, 0x06, 0x00, 0x15, 0x15, 0x2D, 0x21, 0x27, 0x00, 0x00, 0x2E, 0x75, 0x00, 0x00, 0xCA, 0x00, 0x2D, 0x00, 0x31, 0x00, 0x31, 0x00, 0x2D, 0x00, 0x41, 0x59, 0x19, 0x23, 0x1D, 0x00, 0x00, 0x06, 0x00, 0x17, 0x00, 0x0B, 0x00, 0x0D, 0x00, 0x0A, 0x00, 0x0C, + 0x06, 0x00, 0x17, 0x06, 0x00, 0x15, 0x15, 0x2D, 0x21, 0x27, 0x00, 0x00, 0x2E, 0x75, 0x00, 0x00, 0xCA, 0x00, 0x2D, 0x00, 0x31, 0x00, 0x31, 0x00, 0x2D, 0x00, 0x41, 0x59, 0x19, 0x23, 0x1D, 0x00, 0x00, 0x06, 0x00, 0x17, 0x00, 0x0B, 0x00, 0x0D, 0x00, 0x0A, 0x00, 0x0C, + + 0x07, 0xD8, 0xE3, 0xAB, 0x50, 0x8B, + 0x07, 0xD8, 0xE3, 0xAB, 0x50, 0x8B, + 0x07, 0xD8, 0xE3, 0xAB, 0x50, 0x8B, + 0x07, 0xD8, 0xE3, 0xAB, 0x50, 0x8B, + 0x07, 0xD8, 0xE3, 0xAB, 0x50, 0x8B, + 0x07, 0xD8, 0xE3, 0xAB, 0x50, 0x8B, + + 0x80, 0x50, 0x00, 0x00, 0x00, 0x00, + 0x80, 0x50, 0x00, 0x00, 0x00, 0x00, + 0x80, 0x50, 0x00, 0x00, 0x00, 0x00, + 0x80, 0x50, 0x00, 0x00, 0x00, 0x00, + 0x80, 0x50, 0x00, 0x00, 0x00, 0x00, + 0x80, 0x50, 0x00, 0x00, 0x00, 0x00, + + 0x40, 0x00, 0x00, + 0xFD, 0xFD, 0xFD, 0xFD}; + +/* +byte debug_party_data[GEN2_INT_SIZE + 4] = { // International Gen 2 + 0x8A, 0x91, 0x88, 0x92, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, + 0x06, + 0x8B, 0xC9, 0xA1, 0x97, 0xFB, 0x24, + 0xFF, + 0x25, 0xDA, + + 0x8B, 0x00, 0x37, 0x21, 0x2C, 0x2B, 0x25, 0xDA, 0x00, 0x00, 0xA7, 0x00, 0x46, 0x00, 0x5C, 0x00, 0x44, 0x00, 0x28, 0x00, 0x46, 0xFA, 0xAA, 0x1F, 0x1E, 0xC0, 0x00, 0x45, 0xF2, 0x85, 0x81, 0x05, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x13, 0x00, 0x0A, 0x00, 0x09, 0x00, 0x0B, 0x00, 0x0B, 0x00, 0x0A, 0xC9, 0x00, 0x21, 0x27, 0xED, 0x00, 0x25, 0xDA, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2D, 0x11, 0x23, 0x1E, 0x00, 0x00, 0x46, 0x00, 0x82, 0x82, 0x02, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x0D, 0x00, 0x07, 0x00, 0x06, 0x00, 0x07, 0x00, 0x06, 0x00, 0x06, 0xA1, 0x00, 0x21, 0x00, 0x00, 0x00, 0x25, 0xDA, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8B, 0x8B, 0x23, 0x00, 0x00, 0x00, 0x46, 0x00, 0x83, 0x82, 0x03, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x0F, 0x00, 0x08, 0x00, 0x07, 0x00, 0x06, 0x00, 0x07, 0x00, 0x08, 0x97, 0x00, 0x21, 0x00, 0x00, 0x00, 0x25, 0xDA, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDB, 0x87, 0x21, 0x00, 0x00, 0x00, 0x46, 0x00, 0x82, 0x82, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x0D, 0x00, 0x07, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x07, 0xFB, 0x00, 0x21, 0x00, 0x00, 0x00, 0x25, 0xDA, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0x34, 0x21, 0x00, 0x00, 0x00, 0x46, 0x00, 0x83, 0x82, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0F, 0x00, 0x07, 0x00, 0x07, 0x00, 0x06, 0x00, 0x07, 0x00, 0x07, - 0xA1, 0x00, 0x21, 0x00, 0x00, 0x00, 0x25, 0xDA, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x23, 0x00, 0x00, 0x00, 0x46, 0x00, 0x82, 0x82, 0x02, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x0D, 0x00, 0x07, 0x00, 0x06, 0x00, 0x05, 0x00, 0x06, 0x00, 0x06, + 0x24, 0x00, 0x01, 0x2F, 0x21, 0x00, 0x25, 0xDA, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x23, 0x00, 0x00, 0x00, 0x46, 0x00, 0x82, 0x82, 0x02, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x0D, 0x00, 0x07, 0x00, 0x06, 0x00, 0x05, 0x00, 0x06, 0x00, 0x06, 0x8A, 0x91, 0x88, 0x92, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x8A, 0x91, 0x88, 0x92, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, @@ -29,14 +64,15 @@ byte debug_party_data[444] = { 0x92, 0x84, 0x8D, 0x93, 0x91, 0x84, 0x93, 0x50, 0x50, 0x50, 0x50, 0xE3, 0xE6, 0xE7, 0xF3, 0xF2, 0xF4, 0x7F, 0x50, 0x50, 0x50, 0x50, - 0x00, 0x00, 0x00}; - + 0x00, 0x00, 0x00, + 0xFD, 0xFD, 0xFD, 0xFD}; +*/ Pokemon_Party::Pokemon_Party(){}; void Pokemon_Party::start_link() { if (DEBUG_MODE) { - for (int i = 0; i < 444; i++) + for (int i = 0; i < GEN2_INT_SIZE + 4; i++) { party_data_array[i] = debug_party_data[i]; } @@ -55,8 +91,7 @@ int Pokemon_Party::get_last_error() void Pokemon_Party::load_pokemon() { - party_size = party_data_array[11]; - for (int i = 0; i < party_size; i++) + for (int i = 0; i < 6; i++) { party[i].load_data(i, &party_data_array[0]); rand_next_frame(); @@ -66,11 +101,12 @@ void Pokemon_Party::load_pokemon() void Pokemon_Party::inject_pokemon() { - //tte_write(std::to_string(party_size).c_str()); - //insert_pokemon(party, party_size); - //inject_mystery(); + // tte_write(std::to_string(party_size).c_str()); + // insert_pokemon(party, party_size); + // inject_mystery(); } -Pokemon* Pokemon_Party::get_full_pokemon_array(){ +Pokemon *Pokemon_Party::get_full_pokemon_array() +{ return party; } \ No newline at end of file diff --git a/source/script_array.cpp b/source/script_array.cpp index 25dd3ab..1e98939 100644 --- a/source/script_array.cpp +++ b/source/script_array.cpp @@ -75,7 +75,7 @@ bool run_conditional(int index) return true; case BEAT_E4: - return false; + return true; case SHOW_PROF: obj_unhide(prof, 0); diff --git a/source/sprite_data.cpp b/source/sprite_data.cpp index 0ecd8a8..f9299cd 100644 --- a/source/sprite_data.cpp +++ b/source/sprite_data.cpp @@ -295,4 +295,43 @@ void load_dex_r() } } +#include "btn_d_l.h" +OBJ_ATTR *btn_d_l = &obj_buffer[26]; +void load_btn_d_l() +{ + memcpy(&tile_mem[4][416], btn_d_lTiles, btn_d_lTilesLen); + memcpy(pal_obj_mem + 32, btn_d_lPal, btn_d_lPalLen); + + int x = 0, y = 0; + u32 tid = 416, pb = 2; // tile id, pal-bank + + obj_set_attr(btn_d_l, + ATTR0_WIDE, + ATTR1_SIZE_64x32, + ATTR2_PALBANK(pb) | tid | ATTR2_PRIO(1)); + obj_set_pos(btn_d_l, x, y); + obj_hide(btn_d_l); + // obj_unhide(btn_d_l, 0); +} + +#include "btn_d_r.h" +OBJ_ATTR *btn_d_r = &obj_buffer[27]; +void load_btn_d_r() +{ + memcpy(&tile_mem[4][448], btn_d_rTiles, btn_d_rTilesLen); + memcpy(pal_obj_mem + 48, btn_d_rPal, btn_d_rPalLen); + + int x = 0, y = 0; + u32 tid = 448, pb = 2; // tile id, pal-bank + + obj_set_attr(btn_d_r, + ATTR0_WIDE, + ATTR1_SIZE_64x32, + ATTR2_PALBANK(pb) | tid | ATTR2_PRIO(1)); + + obj_set_pos(btn_d_r, x, y); + obj_hide(btn_d_r); + // obj_unhide(btn_d_r, 0); +} + // Don't forget to increase the number of sprites loaded in main!! \ No newline at end of file