Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document Pokedex Text and Languages #323

Merged
merged 4 commits into from
Jan 5, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions include/overlay021/ov21_021D5600.h

This file was deleted.

12 changes: 12 additions & 0 deletions include/overlay021/pokedex_text.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#ifndef POKEPLATINUM_POKEDEX_TEXT_H
#define POKEPLATINUM_POKEDEX_TEXT_H

#include "strbuf.h"

void PokedexText_Free(Strbuf *strbuf);
int PokedexText_ForeignLanguage(int languageIndex);
Strbuf *PokedexText_NameNumber(int species, int language, int heapID);
Strbuf *PokedexText_Category(int species, int language, int heapID);
Strbuf *PokedexText_DexEntry(int species, int language, int entryOffset, int heapID);

#endif // POKEPLATINUM_POKEDEX_TEXT_H
9 changes: 9 additions & 0 deletions include/pokedex_language.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#ifndef POKEPLATINUM_POKEDEX_LANGUAGE_H
#define POKEPLATINUM_POKEDEX_LANGUAGE_H

#define NUM_LANGUAGES 6

int PokedexLanguage_LanguageToIndex(int language);
int PokedexLanguage_IndexToLanguage(int languageIndex);

#endif // POKEPLATINUM_POKEDEX_LANGUAGE_H
7 changes: 0 additions & 7 deletions include/unk_020986CC.h

This file was deleted.

4 changes: 2 additions & 2 deletions platinum.us/main.lsf
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ Static main
Object main.nef.p/src_unk_02097B18.c.o
Object main.nef.p/src_unk_02098218.c.o
Object main.nef.p/src_unk_020985E4.c.o
Object main.nef.p/src_unk_020986CC.c.o
Object main.nef.p/src_pokedex_language.c.o
Object main.nef.p/src_pokedex_heightweight.c.o
Object main.nef.p/src_pokedex_data_index.c.o
Object main.nef.p/src_unk_020F6824.c.o
Expand Down Expand Up @@ -792,7 +792,7 @@ Overlay overlay21
Object main.nef.p/src_overlay021_ov21_021D4C0C.c.o
Object main.nef.p/src_overlay021_ov21_021D4EE4.c.o
Object main.nef.p/src_overlay021_pokedex_field_map.c.o
Object main.nef.p/src_overlay021_ov21_021D5600.c.o
Object main.nef.p/src_overlay021_pokedex_text.c.o
Object main.nef.p/src_overlay021_pokedex_enc_data.c.o
Object main.nef.p/src_overlay021_ov21_021D5AEC.c.o
Object main.nef.p/src_overlay021_ov21_021D76B0.c.o
Expand Down
4 changes: 2 additions & 2 deletions src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ pokeplatinum_c = files(
'unk_02097B18.c',
'unk_02098218.c',
'unk_020985E4.c',
'unk_020986CC.c',
'pokedex_language.c',
'pokedex_heightweight.c',
'pokedex_data_index.c',
'unk_020989DC.c',
Expand Down Expand Up @@ -603,7 +603,7 @@ pokeplatinum_c = files(
'overlay021/ov21_021D4C0C.c',
'overlay021/ov21_021D4EE4.c',
'overlay021/pokedex_field_map.c',
'overlay021/ov21_021D5600.c',
'overlay021/pokedex_text.c',
'overlay021/pokedex_enc_data.c',
'overlay021/ov21_021D5AEC.c',
'overlay021/ov21_021D76B0.c',
Expand Down
6 changes: 3 additions & 3 deletions src/overlay021/ov21_021D0D80.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include "overlay021/ov21_021D423C.h"
#include "overlay021/ov21_021D4340.h"
#include "overlay021/ov21_021D4C0C.h"
#include "overlay021/ov21_021D5600.h"
#include "overlay021/ov21_021D5AEC.h"
#include "overlay021/ov21_021D76B0.h"
#include "overlay021/ov21_021D85B0.h"
Expand All @@ -33,6 +32,7 @@
#include "overlay021/ov21_021E737C.h"
#include "overlay021/ov21_021E8484.h"
#include "overlay021/pokedex_sort.h"
#include "overlay021/pokedex_text.h"
#include "overlay021/species_caught_status.h"
#include "overlay021/struct_ov21_021D0D80.h"
#include "overlay021/struct_ov21_021D13FC.h"
Expand Down Expand Up @@ -664,13 +664,13 @@ void ov21_021D1650(Window *param0, int param1, int param2, int param3)
v0 = ov21_021D1CE0(100, param3);
}

v1 = ov21_021D561C(param2, GAME_LANGUAGE, param3);
v1 = PokedexText_NameNumber(param2, GAME_LANGUAGE, param3);

Text_AddPrinterWithParamsAndColor(param0, FONT_SUBSCREEN, v0, 22, 0, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(3, 2, 1), NULL);
Text_AddPrinterWithParamsAndColor(param0, FONT_SUBSCREEN, v1, 49, 0, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(3, 2, 1), NULL);
Strbuf_Free(v0);

ov21_021D5600(v1);
PokedexText_Free(v1);
}

Window *ov21_021D16D8(UnkStruct_ov21_021D13FC *param0, const UnkStruct_ov21_021D3320 *param1, int param2, int param3)
Expand Down
168 changes: 0 additions & 168 deletions src/overlay021/ov21_021D5600.c

This file was deleted.

10 changes: 5 additions & 5 deletions src/overlay021/ov21_021DE668.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
#include "overlay021/ov21_021D1F90.h"
#include "overlay021/ov21_021D1FA4.h"
#include "overlay021/ov21_021D4C0C.h"
#include "overlay021/ov21_021D5600.h"
#include "overlay021/ov21_021E29DC.h"
#include "overlay021/pokedex_sort.h"
#include "overlay021/pokedex_text.h"
#include "overlay021/struct_ov21_021D0F60_decl.h"
#include "overlay021/struct_ov21_021D13FC.h"
#include "overlay021/struct_ov21_021D2648.h"
Expand Down Expand Up @@ -469,12 +469,12 @@ static void ov21_021DEC80(Window *param0, int param1, int param2, u32 param3)

static void ov21_021DECD4(Window *param0, int param1, int param2, int param3, u32 param4)
{
Strbuf *v0 = ov21_021D56BC(param2, GAME_LANGUAGE, param3, param1);
Strbuf *v0 = PokedexText_DexEntry(param2, GAME_LANGUAGE, param3, param1);
u32 v1 = Font_CalcMaxLineWidth(FONT_SYSTEM, v0, 0);
u32 v2 = (v1 < 240) ? 128 - v1 / 2 : 8;

Text_AddPrinterWithParamsAndColor(param0, FONT_SYSTEM, v0, v2, 136, TEXT_SPEED_INSTANT, param4, NULL);
ov21_021D5600(v0);
PokedexText_Free(v0);
}

static void ov21_021DED24(UnkStruct_ov21_021DF374 *param0, UnkStruct_ov21_021DE760 *param1, const UnkStruct_ov21_021DE6D4 *param2, int param3)
Expand Down Expand Up @@ -785,7 +785,7 @@ Window *ov21_021DF30C(UnkStruct_ov21_021D4C0C *param0, int param1, int param2)
Strbuf *v1;

v0 = ov21_021D4D6C(param0, 18, 2);
v1 = ov21_021D566C(param1, GAME_LANGUAGE, param2);
v1 = PokedexText_Category(param1, GAME_LANGUAGE, param2);

{
u32 v2 = Font_CalcStrbufWidth(FONT_SUBSCREEN, v1, 0);
Expand All @@ -794,7 +794,7 @@ Window *ov21_021DF30C(UnkStruct_ov21_021D4C0C *param0, int param1, int param2)
ov21_021D4E80(param0, v0, v1, v3, 0);
}

ov21_021D5600(v1);
PokedexText_Free(v1);

return v0;
}
Expand Down
18 changes: 9 additions & 9 deletions src/overlay021/ov21_021E0C68.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#include "overlay021/ov21_021D0D80.h"
#include "overlay021/ov21_021D1FA4.h"
#include "overlay021/ov21_021D4C0C.h"
#include "overlay021/ov21_021D5600.h"
#include "overlay021/ov21_021E29DC.h"
#include "overlay021/pokedex_sort.h"
#include "overlay021/pokedex_text.h"
#include "overlay021/struct_ov21_021D0F60_decl.h"
#include "overlay021/struct_ov21_021D13FC.h"
#include "overlay021/struct_ov21_021D2648.h"
Expand Down Expand Up @@ -445,12 +445,12 @@ static void ov21_021E10D0(UnkStruct_ov21_021E0D7C *param0, const UnkStruct_ov21_

static void ov21_021E1188(UnkStruct_ov21_021E0D7C *param0, int param1, int param2, int param3, int param4)
{
Strbuf *v0 = ov21_021D56BC(param2, param3, param4, param1);
Strbuf *v0 = PokedexText_DexEntry(param2, param3, param4, param1);
u32 v1 = Font_CalcMaxLineWidth(FONT_SYSTEM, v0, 0);
u32 v2 = (v1 < 240) ? 128 - v1 / 2 : 8;

Text_AddPrinterWithParamsAndColor(&param0->unk_00->unk_04, FONT_SYSTEM, v0, v2, 136, TEXT_SPEED_INSTANT, TEXT_COLOR(2, 1, 0), NULL);
ov21_021D5600(v0);
PokedexText_Free(v0);
}

static void ov21_021E11DC(UnkStruct_ov21_021E0D7C *param0, const UnkStruct_ov21_021E0D68 *param1, int param2)
Expand Down Expand Up @@ -567,15 +567,15 @@ static Window *ov21_021E1460(UnkStruct_ov21_021E0D7C *param0, int param1, int pa
Strbuf *v1;

v0 = ov21_021D4D6C(param0->unk_00->unk_14C, 18, 2);
v1 = ov21_021D566C(param1, GAME_LANGUAGE, param2);
v1 = PokedexText_Category(param1, GAME_LANGUAGE, param2);

{
u32 v2 = Font_CalcStrbufWidth(FONT_SUBSCREEN, v1, 0);
u32 v3 = (v2 < 136) ? (136 - v2) / 2 : 0;
ov21_021D4E80(param0->unk_00->unk_14C, v0, v1, v3, 0);
}

ov21_021D5600(v1);
PokedexText_Free(v1);

return v0;
}
Expand Down Expand Up @@ -818,19 +818,19 @@ static int ov21_021E185C(int param0)

static void ov21_021E18A0(UnkStruct_ov21_021E0D7C *param0, int param1, int param2, int param3)
{
Strbuf *v0 = ov21_021D561C(param2, param3, param1);
Strbuf *v0 = PokedexText_NameNumber(param2, param3, param1);

Text_AddPrinterWithParamsAndColor(&param0->unk_00->unk_04, FONT_SYSTEM, v0, 120, 96, TEXT_SPEED_INSTANT, TEXT_COLOR(2, 1, 0), NULL);
ov21_021D5600(v0);
PokedexText_Free(v0);
}

static void ov21_021E18DC(UnkStruct_ov21_021E0D7C *param0, int param1, int param2, int param3)
{
Strbuf *v0 = ov21_021D566C(param2, param3, param1);
Strbuf *v0 = PokedexText_Category(param2, param3, param1);
u32 v1;

v1 = 240 - Font_CalcStrbufWidth(FONT_SYSTEM, v0, 0);

Text_AddPrinterWithParamsAndColor(&param0->unk_00->unk_04, FONT_SYSTEM, v0, v1, 112, TEXT_SPEED_INSTANT, TEXT_COLOR(2, 1, 0), NULL);
ov21_021D5600(v0);
PokedexText_Free(v0);
}
Loading
Loading