Add other languages' data

This commit is contained in:
Lorenzooone 2023-02-25 05:11:36 +01:00
parent 65e25e6661
commit 520d2e6c4f
19 changed files with 105 additions and 73 deletions

BIN
data/egg_names.bin Normal file

Binary file not shown.

View File

@ -1,5 +0,0 @@
æææææ›‹—›‹Ž‚›‹”š“…
ã
ã« • P… ã¦P… ¬‡Œ†­<E280A0>Aã“¥«<C2A5>¦<19>Øãã¦P‰‡ã«PŒA€ãPC¬CPPA ¯«PA ¯¬“‰¥¬<C2A5>P¥¬<C2A5>PP„•Œ  „•ئ€ãPP€ã¬‡A…<41>®¥<E2809A><C2A5>®Š«PPŠ«@«•¥«õ•Øã”•<>«•¥«ï•Øã˜•†«A¬APPA‡ãP¨‰«PP†®‰«BØ«PPB‡Ø«P ¬“P ¦¬“”˜‡Š‡Š<E280A1>™”¥§€@¥ŒPP@¥<>‡“‰«@«P¡¦ô«°P“Ø„•­ãŒPG¦€«‰¬‡P ¦¬‡<C2AC>«†ãP„‰Ø
¦ã°P<50>«°•¯¨¡P•¯¨P•¯¨«ˆã°P£«¥ã›ã°«©«Ø†ã ãØ†ã…<C3A3>؆ã<E280A0>ž‚‘«P¬“ ˜‡¥‡‡¥<08> ¨ã«P ¨ã•­C•ã<E280A2>P­¨¬B¢«PP¢¥«P‰<50>¦PP§€‰<E282AC>¦…¡—PããPãØ„@©P ® «P=“=<3D>ã=“=“«‹ë¦ã@¦‹ë« ãŒPP ㌓P«ãP<C3A3>©ã‡PŒØãBPŒØã@㇥PP†«¥ãØØ<0F><>¦<EFBFBD><C2A6>«<EFBFBD><C2AB><EFBFBD><EFBFBD>P”¬ãP…¥…¥P¥¥PŠ©Ÿ¥ãƒ©¥ã=¨Ø«ãŒP<C592><50>ŒŠ<C592>œã«Š<C2AB>«P¥¬†ãP¡« ­¥¦ã¥P<C2A5>¬ãPã¥P“І«“€ <0C>š“<12>«Œ<C2AB>ãžãآ㌓¥<E2809C>‡¦ã ®¥ƒ§ãPããP…<50>¨ŒPˆ«<CB86>¨Œ‰<C592>†«­¥Œ¥B¥ŒP <50>¡«P<C2AB>ã<1B>P­©ã Š«ãŒãŒ<C3A3>ãCØ «P„Ÿ”<C5B8>“„ŸŒ<C5B8>ã…“PP…“BŒB¥PP… «PØã
㊫ãPé<E280BA>¢ãž•Ø®™‡Ø®ã…<C3A3>خ㞮㞮PP<50>‰Øã<C398>=<3D>Øã Ÿš˜€¥<C2A5><07>¥ã«©•˜‰P€Ø<08>„ã<0F>¦„<C2A6><E2809E>PP„„<E2809E><E2809E>PœãœãP¤¦˜ ‡§°°€«<E282AC><EFBFBD>¦P€Ø€Œ‡¨¬“<C2AC>¯«<C2AF>㥫<C2A5>ã«A<C2AB>®ãPA°PPPBBØ«P“AãP“<08>¬‡—<E280A1>°P—<50>°„ ØãBP¡‰‰PP«Ø®†§<E280A0>™”<E284A2>ئPP<50>ئØPެ†ã•¯¨“˜™—¬‰PCC¬‰P©<50>¬‰Pƒ<50>@ŸPš<50>”¬<E28098>©ØP¢«¢«<C2A2>@ãPP„ãPPƒã°P¥¬†ã¢ž…¥Œ¢†«Ÿ<C5B8>PP€«˜ã«Žã”«Œ†Ø«Ø†‡<0F>ô§“Œ˜‰¬<E280B0>P¥<>㙗㦦ãPP¥«¦™Øã<C398>«™¬ŠŸPPÍ¥‡¨Œ•®ã¥Pš <07>PØ«<07>P<EFBFBD><07>¬<07>…¦ ØŸãP<C3A3>˜ŸãPŠ•ã P¬C„„‡<E2809E>«PØã<13>«<EFBFBD><C2AB>«ƒ€ãŸ¦¦PͦãP†«¥ <09>P«é«CØ «ø„Pã¦P¦†ãP…Cƒ¥ãŸ<C3A3>®ã¦ƒ§†¬°PPž¦<C5BE>«‡™A”ŒP¥<50>Pƒ«<C2AB><50>‡«P¤ã¥ŒŠ”¥Œ«¥Œ¦€PPœP<E2809A>§°Pæææææ<C3A6><C3A6> PPææææææææææ

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -145,9 +145,21 @@
#define ROAMER_ENCOUNTER 2
#define UNOWN_ENCOUNTER 3
#define NUM_LANGUAGES 8
#define NUM_POKEMON_NAME_LANGUAGES 4
#define JAPANESE_LANGUAGE 1
#define ENGLISH_LANGUAGE 2
#define GET_LANGUAGE_IS_JAPANESE(x) ((x) == JAPANESE_LANGUAGE)
#define GET_LANGUAGE_NICKNAME_LIMIT(x) (GET_LANGUAGE_IS_JAPANESE(x) ? NICKNAME_JP_GEN3_SIZE : NICKNAME_GEN3_SIZE)
#define GET_LANGUAGE_OT_NAME_LIMIT(x) (GET_LANGUAGE_IS_JAPANESE(x) ? OT_NAME_JP_GEN3_SIZE : OT_NAME_GEN3_SIZE)
#define GET_LANGUAGE_OT_NAME_LIMIT_DIRECT(x) ((x) ? OT_NAME_JP_GEN3_SIZE : OT_NAME_GEN3_SIZE)
#define SYS_LANGUAGE ENGLISH_LANGUAGE
#define IS_SYS_LANGUAGE_JAPANESE GET_LANGUAGE_IS_JAPANESE(SYS_LANGUAGE)
#define SYS_LANGUAGE_LIMIT GET_LANGUAGE_NICKNAME_LIMIT(SYS_LANGUAGE)
#define DEFAULT_NAME_BAD_LANGUAGE ENGLISH_LANGUAGE
typedef u32 gen3_party_total_t;
enum LEARNABLE_MOVES_RETVAL {LEARNT, SKIPPED, LEARNABLE, COMPLETED};
@ -345,7 +357,7 @@ u8 get_index_key(u32);
u8 get_nature(u32);
u16 get_mon_index(int, u32, u8, u8);
u8 get_unown_letter_gen3(u32);
const u8* get_pokemon_name(int, u32, u8, u8);
const u8* get_pokemon_name(int, u32, u8, u8, u8);
u8 has_mail(struct gen3_mon*, struct gen3_mon_growth*, u8);
s32 get_proper_exp(struct gen3_mon*, struct gen3_mon_growth*, u8);
u8 to_valid_level(u8);
@ -354,6 +366,8 @@ u8 get_pokemon_gender_gen3(int, u32, u8, u8);
u16 calc_stats_gen3(u16, u32, u8, u8, u8, u8, u8);
void place_and_encrypt_gen3_data(struct gen3_mon_data_unenc*, struct gen3_mon*);
u8 get_valid_language(u8);
const u8* get_pokemon_name_language(u16, u8);
const u16* get_learnset_for_species(const u16*, u16);
const u8* get_pokemon_name_raw(struct gen3_mon_data_unenc*);
u16 get_mon_index_raw(struct gen3_mon_data_unenc*);

View File

@ -2,14 +2,11 @@
#include "gen12_methods.h"
#include "party_handler.h"
#include "text_handler.h"
#include "bin_table_handler.h"
#include "fast_pokemon_methods.h"
#include "gen3_to_1_conv_table_bin.h"
#include "gen1_to_3_conv_table_bin.h"
#include "pokemon_gender_bin.h"
#include "pokemon_names_bin.h"
#include "gen2_names_jap_bin.h"
#include "pokemon_stats_gen1_bin.h"
#include "pokemon_stats_bin.h"
@ -173,17 +170,21 @@ u8 get_pokemon_gender_kind_gen2(u8 index, u8 is_egg, u8 curr_gen) {
return pokemon_gender_bin[get_mon_index_gen2(index, is_egg)];
}
const u8* get_pokemon_name_gen2(int index, u8 is_egg, u8 is_jp, u8* buffer) {
if(is_jp)
return &(gen2_names_jap_bin[get_mon_index_gen2(index, is_egg)*STRING_GEN2_JP_CAP]);
u8 buffer_two[STRING_GEN2_INT_SIZE];
const u8* get_pokemon_name_gen2(int index, u8 is_egg, u8 language, u8* buffer) {
u8 string_cap = STRING_GEN2_INT_CAP;
u8 is_jp = 0;
if(language == JAPANESE_LANGUAGE) {
string_cap = STRING_GEN2_JP_CAP;
is_jp = 1;
}
u16 mon_index = get_mon_index_gen2(index, is_egg);
if (mon_index == MR_MIME_SPECIES)
mon_index = MR_MIME_OLD_NAME_POS;
if (mon_index == UNOWN_SPECIES)
mon_index = UNOWN_REAL_NAME_POS;
text_generic_to_gen3(get_table_pointer(pokemon_names_bin, mon_index), buffer_two, NAME_SIZE, STRING_GEN2_INT_CAP, 0, 0);
text_gen3_to_gen12(buffer_two, buffer, STRING_GEN2_INT_CAP, STRING_GEN2_INT_CAP, 0, 0);
text_gen3_to_gen12(get_pokemon_name_language(mon_index, language), buffer, string_cap, string_cap, is_jp, is_jp);
return buffer;
}

View File

@ -67,11 +67,13 @@ void set_ivs(struct gen3_mon_misc*, u32);
void preset_alter_data(struct gen3_mon_data_unenc*, struct alternative_data_gen3*);
void set_origin_pid_iv(struct gen3_mon*, struct gen3_mon_data_unenc*, u16, u16, u8, u8, u8, u8);
u8 are_trainers_same(struct gen3_mon*, u8);
void fix_name_change_from_gen3(struct gen3_mon*, u16, u8*, u8, u8);
void fix_name_change_from_gen3(struct gen3_mon*, u16, u8*, u8, u8, u8);
void fix_name_change_to_gen3(struct gen3_mon*, u8);
void convert_strings_of_gen3(struct gen3_mon*, u16, u8*, u8*, u8*, u8*, u8, u8);
void convert_strings_of_gen12(struct gen3_mon*, u8, u8*, u8*, u8);
u8 target_int_language = ENGLISH_LANGUAGE;
u16 swap_endian_short(u16 shrt) {
return ((shrt & 0xFF00) >> 8) | ((shrt & 0xFF) << 8);
}
@ -799,31 +801,37 @@ u8 are_trainers_same(struct gen3_mon* dst, u8 is_jp) {
}
void fix_name_change_from_gen3(struct gen3_mon* src, u16 species, u8* nickname, u8 is_egg, u8 is_gen2) {
u8 tmp_text_buffer[NAME_SIZE];
// Get the string to compare to
text_generic_to_gen3(get_pokemon_name(species, src->pid, is_egg, 0), tmp_text_buffer, NAME_SIZE, NICKNAME_GEN3_SIZE, 0, 0);
void fix_name_change_from_gen3(struct gen3_mon* src, u16 species, u8* nickname, u8 is_egg, u8 is_gen2, u8 language) {
u8 tmp_text_buffer[STRING_GEN2_INT_SIZE];
u8 is_jp = language == JAPANESE_LANGUAGE;
u8 name_cap = STRING_GEN2_INT_CAP;
if(is_jp)
name_cap = STRING_GEN2_JP_CAP;
// If it's the same, update the nickname with the new one
if(text_gen3_is_same(src->nickname, tmp_text_buffer, NICKNAME_GEN3_SIZE, NICKNAME_GEN3_SIZE)) {
text_gen2_copy(get_pokemon_name_gen2(species, is_egg, 0, tmp_text_buffer), nickname, STRING_GEN2_INT_CAP, STRING_GEN2_INT_CAP);
if(text_gen3_is_same(src->nickname, get_pokemon_name(species, src->pid, is_egg, 0, language), NICKNAME_GEN3_SIZE, NICKNAME_GEN3_SIZE)) {
text_gen2_copy(get_pokemon_name_gen2(species, is_egg, language, tmp_text_buffer), nickname, name_cap, name_cap);
// Gen 1 used the wrong dot symbol
if(!is_gen2)
text_gen2_replace(nickname, STRING_GEN2_INT_CAP, GEN2_DOT, GEN1_DOT);
text_gen2_replace(nickname, name_cap, GEN2_DOT, GEN1_DOT);
}
}
void fix_name_change_to_gen3(struct gen3_mon* dst, u8 species) {
u8 tmp_text_buffer[STRING_GEN2_INT_CAP];
u8 tmp_text_buffer[STRING_GEN2_INT_SIZE];
u8 tmp_text_buffer2[NICKNAME_GEN3_SIZE];
u8 language = dst->language;
u8 is_jp = language == JAPANESE_LANGUAGE;
u8 name_cap = STRING_GEN2_INT_CAP;
if(is_jp)
name_cap = STRING_GEN2_JP_CAP;
// Get the string to compare to
text_gen12_to_gen3(get_pokemon_name_gen2(species, 0, 0, tmp_text_buffer), tmp_text_buffer2, STRING_GEN2_INT_CAP, NICKNAME_GEN3_SIZE, 0, 0);
text_gen12_to_gen3(get_pokemon_name_gen2(species, 0, language, tmp_text_buffer), tmp_text_buffer2, name_cap, NICKNAME_GEN3_SIZE, 0, 0);
// If it's the same, update the nickname with the new one
if(text_gen3_is_same(dst->nickname, tmp_text_buffer2, NICKNAME_GEN3_SIZE, NICKNAME_GEN3_SIZE))
text_generic_to_gen3(get_pokemon_name(species, 0, 0, 0), dst->nickname, NAME_SIZE, NICKNAME_GEN3_SIZE, 0, 0);
text_gen3_copy(get_pokemon_name(species, 0, 0, 0, language), dst->nickname, NICKNAME_GEN3_SIZE, NICKNAME_GEN3_SIZE);
}
void convert_strings_of_gen3(struct gen3_mon* src, u16 species, u8* ot_name, u8* ot_name_jp, u8* nickname, u8* nickname_jp, u8 is_egg, u8 is_gen2) {
@ -843,25 +851,24 @@ void convert_strings_of_gen3(struct gen3_mon* src, u16 species, u8* ot_name, u8*
// Fix text up
// "MR.MIME" gen 2 == "MR. MIME" gen 3
// Idk if something similar happens in Jap...
// Maybe there are some French things with accents...
// In French, "M.MIME" == "M. MIME"
if((species == MR_MIME_SPECIES) && !is_egg)
fix_name_change_from_gen3(src, species, nickname, is_egg, is_gen2);
fix_name_change_from_gen3(src, species, nickname, is_egg, is_gen2, target_int_language);
// Put the "EGG" name
if(is_gen2 && is_egg) {
text_gen2_copy(get_pokemon_name_gen2(species, is_egg, 0, gen2_buffer), nickname, STRING_GEN2_INT_CAP, STRING_GEN2_INT_CAP);
text_gen2_copy(get_pokemon_name_gen2(species, is_egg, 1, gen2_buffer), nickname_jp, STRING_GEN2_JP_CAP, STRING_GEN2_JP_CAP);
text_gen2_copy(get_pokemon_name_gen2(species, is_egg, target_int_language, gen2_buffer), nickname, STRING_GEN2_INT_CAP, STRING_GEN2_INT_CAP);
text_gen2_copy(get_pokemon_name_gen2(species, is_egg, JAPANESE_LANGUAGE, gen2_buffer), nickname_jp, STRING_GEN2_JP_CAP, STRING_GEN2_JP_CAP);
}
// Handle bad naming conversions (? >= half the name) and empty names
size_t question_marks_count = text_gen2_count_question(nickname, STRING_GEN2_INT_CAP) - text_gen3_count_question(src->nickname, NICKNAME_GEN3_SIZE);
if((question_marks_count >= (text_gen2_size(nickname, STRING_GEN2_INT_CAP) >> 1)) || (text_gen2_size(nickname, STRING_GEN2_INT_CAP) == 0))
text_gen2_copy(get_pokemon_name_gen2(species, is_egg, 0, gen2_buffer), nickname, STRING_GEN2_INT_CAP, STRING_GEN2_INT_CAP);
text_gen2_copy(get_pokemon_name_gen2(species, is_egg, target_int_language, gen2_buffer), nickname, STRING_GEN2_INT_CAP, STRING_GEN2_INT_CAP);
// For the japanese nickname too
question_marks_count = text_gen2_count_question(nickname_jp, STRING_GEN2_JP_CAP) - text_gen3_count_question(src->nickname, NICKNAME_GEN3_SIZE);
if((question_marks_count >= (text_gen2_size(nickname_jp, STRING_GEN2_JP_CAP) >> 1)) || (text_gen2_size(nickname_jp, STRING_GEN2_JP_CAP) == 0))
text_gen2_copy(get_pokemon_name_gen2(species, is_egg, 1, gen2_buffer), nickname_jp, STRING_GEN2_JP_CAP, STRING_GEN2_JP_CAP);
text_gen2_copy(get_pokemon_name_gen2(species, is_egg, JAPANESE_LANGUAGE, gen2_buffer), nickname_jp, STRING_GEN2_JP_CAP, STRING_GEN2_JP_CAP);
}
@ -899,13 +906,13 @@ void convert_strings_of_gen12(struct gen3_mon* dst, u8 species, u8* ot_name, u8*
// Put the "EGG" name
if(is_egg) {
dst->language = JAPANESE_LANGUAGE;
text_gen12_to_gen3(get_pokemon_name_gen2(species, 1, 1, gen2_buffer), dst->nickname, STRING_GEN2_JP_CAP, NICKNAME_GEN3_SIZE, 1, 1);
text_gen12_to_gen3(get_pokemon_name_gen2(species, 1, JAPANESE_LANGUAGE, gen2_buffer), dst->nickname, STRING_GEN2_JP_CAP, NICKNAME_GEN3_SIZE, 1, 1);
}
else {
// Handle bad naming conversions (? >= half the name) and empty names
size_t question_marks_count = text_gen3_count_question(dst->nickname, NICKNAME_GEN3_SIZE) - text_gen2_count_question(nickname, name_cap);
if((question_marks_count >= (text_gen3_size(dst->nickname, NICKNAME_GEN3_SIZE) >> 1)) || (text_gen3_size(dst->nickname, NICKNAME_GEN3_SIZE) == 0))
text_gen12_to_gen3(get_pokemon_name_gen2(species, 0, is_jp, gen2_buffer), dst->nickname, name_cap, NICKNAME_GEN3_SIZE, is_jp, is_jp);
text_gen12_to_gen3(get_pokemon_name_gen2(species, 0, dst->language, gen2_buffer), dst->nickname, name_cap, NICKNAME_GEN3_SIZE, is_jp, is_jp);
}
}
@ -1113,7 +1120,7 @@ u8 gen2_to_gen3(struct gen2_mon_data* src, struct gen3_mon_data_unenc* data_dst,
if(is_jp)
dst->language = JAPANESE_LANGUAGE;
else
dst->language = ENGLISH_LANGUAGE;
dst->language = target_int_language;
// Handle Nickname + OT conversion
convert_strings_of_gen12(dst, src->species, ot_name, nickname, is_egg);
@ -1209,7 +1216,7 @@ u8 gen1_to_gen3(struct gen1_mon_data* src, struct gen3_mon_data_unenc* data_dst,
if(is_jp)
dst->language = JAPANESE_LANGUAGE;
else
dst->language = ENGLISH_LANGUAGE;
dst->language = target_int_language;
// Handle Nickname + OT conversion
convert_strings_of_gen12(dst, get_mon_index_gen1_to_3(src->species), ot_name, nickname, 0);

View File

@ -40,6 +40,7 @@ const char* slash_string = {"/"};
const char* target_strings[] = {"Gen 1", "Gen 2", "Gen 3"};
const char* stat_strings[] = {"Hp", "Atk", "Def", "SpA", "SpD", "Spe"};
const char* contest_strings[] = {"Coolness", "Beauty", "Cuteness", "Smartness", "Toughness", "Feel"};
const char* language_strings[NUM_LANGUAGES] = {"???", "Japanese", "English", "French", "Italian", "German", "Korean", "Spanish"};
const char* trade_start_state_strings[] = {"Unknown", "Entering Room", "Starting Trade", "Ending Trade", "Waiting Trade", "Trading Party Data", "Synchronizing", "Completed"};
const char* offer_strings[] = {" Sending ", "Receiving"};
const char* invalid_strings[][PRINTABLE_INVALID_STRINGS] = {{" TRADE REJECTED!", "The Pokémon offered by the", "other player has issues!"}, {" TRADE REJECTED!", "The trade would leave you", "with no usable Pokémon!"}};
@ -116,11 +117,11 @@ void print_trade_menu(struct game_data_t* game_data, u8 update, u8 curr_gen, u8
num_parties = 1;
if(is_own)
PRINT_FUNCTION("\x05 - Gen \x03\n", game_data[0].trainer_name, OT_NAME_GEN3_SIZE, game_data[0].game_identifier.game_is_jp, curr_gen);
PRINT_FUNCTION("\x05 - Gen \x03\n", game_data[0].trainer_name, GET_LANGUAGE_OT_NAME_LIMIT_DIRECT(game_data[0].game_identifier.game_is_jp), game_data[0].game_identifier.game_is_jp, curr_gen);
else {
for(int i = 0; i < num_parties; i++) {
set_text_x(SCREEN_HALF_X * i);
PRINT_FUNCTION("\x05 - \x01", game_data[i].trainer_name, OT_NAME_GEN3_SIZE, game_data[i].game_identifier.game_is_jp, person_strings[i]);
PRINT_FUNCTION("\x05 - \x01", game_data[i].trainer_name, GET_LANGUAGE_OT_NAME_LIMIT_DIRECT(game_data[i].game_identifier.game_is_jp), game_data[i].game_identifier.game_is_jp, person_strings[i]);
}
}
@ -140,7 +141,7 @@ void print_trade_menu(struct game_data_t* game_data, u8 update, u8 curr_gen, u8
if(options[party_index][party_option_index] != 0xFF) {
struct gen3_mon_data_unenc* mon = &game_data[party_index].party_3_undec[options[party_index][party_option_index]];
// I tried just using printf here with left padding, but it's EXTREMELY slow
PRINT_FUNCTION("\x01", get_pokemon_name_raw(mon));
PRINT_FUNCTION("\x05", get_pokemon_name_raw(mon), SYS_LANGUAGE_LIMIT, IS_SYS_LANGUAGE_JAPANESE);
if(load_sprites)
load_pokemon_sprite_raw(mon, 1, BASE_Y_SPRITE_TRADE_MENU + (i*BASE_Y_SPRITE_INCREMENT_TRADE_MENU), (BASE_X_SPRITE_INCREMENT_TRADE_MENU*j) + BASE_X_SPRITE_TRADE_MENU);
}
@ -185,23 +186,23 @@ void print_learnable_move(struct gen3_mon_data_unenc* mon, u16 index, enum MOVES
switch(moves_printing_type) {
case LEARNT_P:
PRINT_FUNCTION("\x01 learnt\n\n", get_pokemon_name_raw(mon));
PRINT_FUNCTION("\x05 learnt\n\n", get_pokemon_name_raw(mon), SYS_LANGUAGE_LIMIT, IS_SYS_LANGUAGE_JAPANESE);
set_text_x(LEARN_MOVE_MESSAGE_WINDOW_X);
PRINT_FUNCTION("\x01!", get_move_name_raw(move));
break;
case DID_NOT_LEARN_P:
PRINT_FUNCTION("\x01 did not\n\n", get_pokemon_name_raw(mon));
PRINT_FUNCTION("\x05 did not\n\n", get_pokemon_name_raw(mon), SYS_LANGUAGE_LIMIT, IS_SYS_LANGUAGE_JAPANESE);
set_text_x(LEARN_MOVE_MESSAGE_WINDOW_X);
PRINT_FUNCTION("learn \x01!", get_move_name_raw(move));
break;
case LEARNABLE_P:
PRINT_FUNCTION("\x01 wants to\n", get_pokemon_name_raw(mon));
PRINT_FUNCTION("\x05 wants to\n", get_pokemon_name_raw(mon), SYS_LANGUAGE_LIMIT, IS_SYS_LANGUAGE_JAPANESE);
set_text_x(LEARN_MOVE_MESSAGE_WINDOW_X);
PRINT_FUNCTION("learn \x01!\n", get_move_name_raw(move));
set_text_x(LEARN_MOVE_MESSAGE_WINDOW_X);
PRINT_FUNCTION("Would you like to replace\n", get_pokemon_name_raw(mon));
PRINT_FUNCTION("Would you like to replace\n");
set_text_x(LEARN_MOVE_MESSAGE_WINDOW_X);
PRINT_FUNCTION("an existing move with it?", get_move_name_raw(move));
PRINT_FUNCTION("an existing move with it?");
set_text_y(BASE_Y_CURSOR_LEARN_MOVE_MESSAGE>>3);
set_text_x((BASE_X_CURSOR_LEARN_MOVE_MESSAGE_YES>>3)+2+LEARN_MOVE_MESSAGE_WINDOW_X);
PRINT_FUNCTION("Yes");
@ -235,7 +236,7 @@ void print_offer_screen(struct game_data_t* game_data, u8 own_mon, u8 other_mon)
if(!is_egg) {
set_text_y(curr_text_y++);
set_text_x(POKEMON_SPRITE_X_TILES+(OFFER_WINDOW_X*i));
PRINT_FUNCTION("\x01", get_pokemon_name_raw(mon));
PRINT_FUNCTION("\x05", get_pokemon_name_raw(mon), SYS_LANGUAGE_LIMIT, IS_SYS_LANGUAGE_JAPANESE);
set_text_y(curr_text_y++);
set_text_x(POKEMON_SPRITE_X_TILES+(OFFER_WINDOW_X*i));
@ -278,7 +279,7 @@ void print_offer_screen(struct game_data_t* game_data, u8 own_mon, u8 other_mon)
curr_text_y++;
set_text_y(curr_text_y++);
set_text_x(POKEMON_SPRITE_X_TILES+(OFFER_WINDOW_X*i));
PRINT_FUNCTION("\x01", get_pokemon_name_raw(mon));
PRINT_FUNCTION("\x05", get_pokemon_name_raw(mon), SYS_LANGUAGE_LIMIT, IS_SYS_LANGUAGE_JAPANESE);
}
}
}
@ -300,9 +301,9 @@ void print_offer_options_screen(struct game_data_t* game_data, u8 own_mon, u8 ot
clear_offer_options_window();
set_text_y(OFFER_OPTIONS_WINDOW_Y);
set_text_x(OFFER_OPTIONS_WINDOW_X);
PRINT_FUNCTION("Trade \x01\n", get_pokemon_name_raw(&game_data[0].party_3_undec[own_mon]));
PRINT_FUNCTION("Trade \x05\n", get_pokemon_name_raw(&game_data[0].party_3_undec[own_mon]), SYS_LANGUAGE_LIMIT, IS_SYS_LANGUAGE_JAPANESE);
set_text_x(OFFER_OPTIONS_WINDOW_X);
PRINT_FUNCTION("for \x01?\n\n", get_pokemon_name_raw(&game_data[1].party_3_undec[other_mon]));
PRINT_FUNCTION("for \x05?\n\n", get_pokemon_name_raw(&game_data[1].party_3_undec[other_mon]), SYS_LANGUAGE_LIMIT, IS_SYS_LANGUAGE_JAPANESE);
set_text_x(OFFER_OPTIONS_WINDOW_X+2);
PRINT_FUNCTION("Yes");
set_text_x(OFFER_OPTIONS_WINDOW_X + (OFFER_OPTIONS_WINDOW_X_SIZE - SUMMARY_LINE_MAX_SIZE));
@ -371,7 +372,7 @@ void print_evolution_animation_internal(struct gen3_mon_data_unenc* mon, u8 is_s
else {
PRINT_FUNCTION("\x01 evolved\n\n", mon->pre_evo_string);
set_text_x(EVOLUTION_ANIMATION_WINDOW_X);
PRINT_FUNCTION("into \x01!", get_pokemon_name_raw(mon));
PRINT_FUNCTION("into \x05!", get_pokemon_name_raw(mon), SYS_LANGUAGE_LIMIT, IS_SYS_LANGUAGE_JAPANESE);
}
swap_buffer_screen(get_screen_num(), 1);
}
@ -382,7 +383,7 @@ void print_evolution_animation(struct gen3_mon_data_unenc* mon){
}
void print_trade_animation_send(struct gen3_mon_data_unenc* mon){
u8 is_jp = mon->src->language == JAPANESE_LANGUAGE;
u8 language = get_valid_language(mon->src->language);
u8 is_egg = mon->is_egg;
reset_screen(BLANK_FILL);
@ -391,9 +392,9 @@ void print_trade_animation_send(struct gen3_mon_data_unenc* mon){
set_text_y(TRADE_ANIMATION_SEND_WINDOW_Y);
set_text_x(TRADE_ANIMATION_SEND_WINDOW_X);
if(!is_egg) {
PRINT_FUNCTION("Sending \x01 away...\n\n", get_pokemon_name_raw(mon));
PRINT_FUNCTION("Sending \x05 away...\n\n", get_pokemon_name_raw(mon), SYS_LANGUAGE_LIMIT, IS_SYS_LANGUAGE_JAPANESE);
set_text_x(TRADE_ANIMATION_SEND_WINDOW_X);
PRINT_FUNCTION("Goodbye, \x05!", mon->src->nickname, NICKNAME_GEN3_SIZE, is_jp);
PRINT_FUNCTION("Goodbye, \x05!", mon->src->nickname, GET_LANGUAGE_NICKNAME_LIMIT(language), GET_LANGUAGE_IS_JAPANESE(language));
}
else {
PRINT_FUNCTION("Sending an Egg away...\n\n");
@ -403,7 +404,7 @@ void print_trade_animation_send(struct gen3_mon_data_unenc* mon){
}
void print_trade_animation_recv(struct gen3_mon_data_unenc* mon){
u8 is_jp = mon->src->language == JAPANESE_LANGUAGE;
u8 language = get_valid_language(mon->src->language);
u8 is_egg = mon->is_egg;
reset_screen(BLANK_FILL);
@ -412,9 +413,9 @@ void print_trade_animation_recv(struct gen3_mon_data_unenc* mon){
set_text_y(TRADE_ANIMATION_RECV_WINDOW_Y);
set_text_x(TRADE_ANIMATION_RECV_WINDOW_X);
if(!is_egg) {
PRINT_FUNCTION("Received \x01.\n\n", get_pokemon_name_raw(mon));
PRINT_FUNCTION("Received \x05.\n\n", get_pokemon_name_raw(mon), SYS_LANGUAGE_LIMIT, IS_SYS_LANGUAGE_JAPANESE);
set_text_x(TRADE_ANIMATION_RECV_WINDOW_X);
PRINT_FUNCTION("Welcome, \x05!", mon->src->nickname, NICKNAME_GEN3_SIZE, is_jp);
PRINT_FUNCTION("Welcome, \x05!", mon->src->nickname, GET_LANGUAGE_NICKNAME_LIMIT(language), GET_LANGUAGE_IS_JAPANESE(language));
}
else {
PRINT_FUNCTION("Received an Egg.\n\n");
@ -578,7 +579,7 @@ void print_learnable_moves_menu(struct gen3_mon_data_unenc* mon, u16 index) {
void print_pokemon_base_data(u8 load_sprites, struct gen3_mon_data_unenc* mon, u8 y, u8 x) {
u8 is_shiny = is_shiny_gen3_raw(mon, 0);
u8 has_pokerus = has_pokerus_gen3_raw(mon);
u8 is_jp = mon->src->language == JAPANESE_LANGUAGE;
u8 language = get_valid_language(mon->src->language);
u8 is_egg = mon->is_egg;
if(load_sprites) {
@ -590,7 +591,7 @@ void print_pokemon_base_data(u8 load_sprites, struct gen3_mon_data_unenc* mon, u
set_text_x((x>>3) + POKEMON_SPRITE_X_TILES);
if(!is_egg) {
PRINT_FUNCTION("\x05 - \x01 \x02\n", mon->src->nickname, NICKNAME_GEN3_SIZE, is_jp, get_pokemon_name_raw(mon), get_pokemon_gender_char_raw(mon));
PRINT_FUNCTION("\x05 - \x05 \x02\n", mon->src->nickname, GET_LANGUAGE_NICKNAME_LIMIT(language), GET_LANGUAGE_IS_JAPANESE(language), get_pokemon_name_raw(mon), SYS_LANGUAGE_LIMIT, IS_SYS_LANGUAGE_JAPANESE, get_pokemon_gender_char_raw(mon));
set_text_x((x>>3) + POKEMON_SPRITE_X_TILES);
@ -606,7 +607,7 @@ void print_pokemon_base_data(u8 load_sprites, struct gen3_mon_data_unenc* mon, u
PRINT_FUNCTION("Had Pokerus");
}
else
PRINT_FUNCTION("\x01\n", get_pokemon_name_raw(mon));
PRINT_FUNCTION("\x05\n", get_pokemon_name_raw(mon), SYS_LANGUAGE_LIMIT, IS_SYS_LANGUAGE_JAPANESE);
}
void print_pokemon_base_info(u8 load_sprites, struct gen3_mon_data_unenc* mon, u8 page) {
@ -638,18 +639,15 @@ void print_bottom_info(){
}
void print_pokemon_page1(struct gen3_mon_data_unenc* mon) {
u8 is_jp = (mon->src->language == JAPANESE_LANGUAGE);
u8 language = get_valid_language(mon->src->language);
u8 is_egg = mon->is_egg;
if(!is_egg) {
PRINT_FUNCTION("\nLevel: \x13Nature: \x01\n", to_valid_level_gen3(mon->src), 6, get_nature_name(mon->src->pid));
if(is_jp)
PRINT_FUNCTION("\nLanguage: Japanese\n");
else
PRINT_FUNCTION("\nLanguage: International\n");
PRINT_FUNCTION("\nLanguage: \x01\n", language_strings[language]);
PRINT_FUNCTION("\nOT: \x05 - \x02 - \x0B\n", mon->src->ot_name, OT_NAME_GEN3_SIZE, is_jp, get_trainer_gender_char_raw(mon), (mon->src->ot_id)&0xFFFF, 5);
PRINT_FUNCTION("\nOT: \x05 - \x02 - \x0B\n", mon->src->ot_name, GET_LANGUAGE_OT_NAME_LIMIT(language), GET_LANGUAGE_IS_JAPANESE(language), get_trainer_gender_char_raw(mon), (mon->src->ot_id)&0xFFFF, 5);
PRINT_FUNCTION("\nItem: \x01\n", get_item_name_raw(mon));
PRINT_FUNCTION("\nMet in: \x01\n", get_met_location_name_gen3_raw(mon));

View File

@ -15,6 +15,8 @@
#include "pokemon_gender_bin.h"
#include "pokemon_names_bin.h"
#include "egg_names_bin.h"
#include "language_names_index_bin.h"
#include "item_names_bin.h"
#include "location_names_bin.h"
#include "pokeball_names_bin.h"
@ -48,7 +50,7 @@
#define PID_POSITIONS 24
const u8* get_pokemon_name_pure(int, u32, u8);
const u8* get_pokemon_name_pure(int, u32, u8, u8);
const u8* get_item_name(int, u8);
u8 get_ability_pokemon(int, u32, u8, u8, u8);
u8 is_ability_valid(u16, u32, u8, u8, u8, u8);
@ -91,6 +93,12 @@ void init_enc_positions() {
enc_positions[pos++] = (0<<(i*2)) | (1<<(j*2)) | (2<<(k*2)) | (3<<(l*2));
}
u8 get_valid_language(u8 language) {
if(language >= NUM_LANGUAGES)
language = DEFAULT_NAME_BAD_LANGUAGE;
return language;
}
u8 get_index_key(u32 pid){
// Make use of modulo properties to get this to positives
while(pid >= 0x80000000)
@ -132,24 +140,24 @@ u16 get_mon_index_raw(struct gen3_mon_data_unenc* data_src){
return get_mon_index(data_src->growth.species, data_src->src->pid, data_src->is_egg, data_src->deoxys_form);
}
const u8* get_pokemon_name(int index, u32 pid, u8 is_egg, u8 deoxys_form){
return get_table_pointer(pokemon_names_bin, get_mon_index(index, pid, is_egg, deoxys_form));
const u8* get_pokemon_name(int index, u32 pid, u8 is_egg, u8 deoxys_form, u8 language){
return get_pokemon_name_language(get_mon_index(index, pid, is_egg, deoxys_form), language);
}
const u8* get_pokemon_name_pure(int index, u32 pid, u8 is_egg){
const u8* get_pokemon_name_pure(int index, u32 pid, u8 is_egg, u8 language){
u16 mon_index = get_mon_index(index, pid, is_egg, 0);
if ((index == UNOWN_SPECIES) && !is_egg)
mon_index = UNOWN_REAL_NAME_POS;
if ((index == DEOXYS_SPECIES) && !is_egg)
mon_index = DEOXYS_SPECIES;
return get_table_pointer(pokemon_names_bin, mon_index);
return get_pokemon_name_language(mon_index, language);
}
const u8* get_pokemon_name_raw(struct gen3_mon_data_unenc* data_src){
if(!data_src->is_valid_gen3)
return get_pokemon_name(0,0,0,0);
return get_pokemon_name(0,0,0,0, SYS_LANGUAGE);
return get_pokemon_name(data_src->growth.species, data_src->src->pid, data_src->is_egg, data_src->deoxys_form);
return get_pokemon_name(data_src->growth.species, data_src->src->pid, data_src->is_egg, data_src->deoxys_form, SYS_LANGUAGE);
}
const u16* get_learnset_for_species(const u16* learnsets, u16 species){
@ -162,6 +170,13 @@ const u16* get_learnset_for_species(const u16* learnsets, u16 species){
return NULL;
}
const u8* get_pokemon_name_language(u16 index, u8 language) {
language = get_valid_language(language);
if(index == EGG_SPECIES)
return get_table_pointer(egg_names_bin, language);
return get_table_pointer(pokemon_names_bin, (index * NUM_POKEMON_NAME_LANGUAGES) + language_names_index_bin[language]);
}
const u8* get_item_name(int index, u8 is_egg){
if(is_egg)
index = 0;
@ -923,6 +938,8 @@ void process_gen3_data(struct gen3_mon* src, struct gen3_mon_data_unenc* dst, u8
growth->exp = get_proper_exp_raw(dst);
// TODO: Fix Nincada evolving to Shedinja in a Japanese game
// Set the new "cleaned" data
place_and_encrypt_gen3_data(dst, src);