Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/pret/pokeplatinum into pal-…
Browse files Browse the repository at this point in the history
…park
  • Loading branch information
iriv24 committed Jan 5, 2025
2 parents 888f527 + 03a4d5e commit 4af2eb2
Show file tree
Hide file tree
Showing 124 changed files with 2,813 additions and 2,833 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
/subprojects/constgen/
/subprojects/SDATTool/
/subprojects/knarc/
/subprojects/narc/

# CLion folders
.idea/
Expand Down
30 changes: 30 additions & 0 deletions include/applications/journal_display/journal_controller.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
#ifndef POKEPLATINUM_JOURNAL_CONTROLLER_H
#define POKEPLATINUM_JOURNAL_CONTROLLER_H

#include "bg_window.h"
#include "journal.h"
#include "message.h"
#include "overlay_manager.h"
#include "savedata.h"
#include "strbuf.h"
#include "string_template.h"
#include "trainer_info.h"

enum JournalState {
JOURNAL_STATE_OPEN = 0,
Expand All @@ -11,6 +18,29 @@ enum JournalState {
JOURNAL_STATE_CLOSE,
};

typedef struct JournalManager {
BgConfig *bgConfig;
Window window[4];
JournalEntry *journalEntry;
TrainerInfo *trainerInfo;
SaveData *saveData;
MessageLoader *loader;
StringTemplate *template;
Strbuf *strbuf;
u16 tilemapBuffer_5C[1024];
u16 tilemapBuffer_85C[1024];
s8 page;
u8 padding_105D;
s8 state;
s8 unk_105F;
s8 unk_1060;
u8 bgLayer1;
u8 bgLayer2;
u8 bgLayer3;
u8 bgLayer4;
u8 unused[3];
} JournalManager;

int JournalController_Init(OverlayManager *ovyManager, int *state);
int JournalController_Main(OverlayManager *ovyManager, int *state);
int JournalController_Exit(OverlayManager *ovyManager, int *state);
Expand Down
8 changes: 4 additions & 4 deletions include/applications/journal_display/journal_printer.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#ifndef POKEPLATINUM_JOURNAL_PRINTER_H
#define POKEPLATINUM_JOURNAL_PRINTER_H

#include "applications/journal_display/struct_ov81_021D1610.h"
#include "applications/journal_display/journal_controller.h"

void ov81_021D1610(UnkStruct_ov81_021D1610 *param0);
void ov81_021D1634(UnkStruct_ov81_021D1610 *param0);
void ov81_021D164C(UnkStruct_ov81_021D1610 *param0, u32 param1);
void JournalPrinter_AddWindows(JournalManager *param0);
void JournalPrinter_RemoveWindows(JournalManager *param0);
void JournalPrinter_PrintEntry(JournalManager *param0, u32 param1);

#endif // POKEPLATINUM_JOURNAL_PRINTER_H
35 changes: 0 additions & 35 deletions include/applications/journal_display/struct_ov81_021D1610.h

This file was deleted.

18 changes: 18 additions & 0 deletions include/field_message.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#ifndef POKEPLATINUM_FIELD_MESSAGE_H
#define POKEPLATINUM_FIELD_MESSAGE_H

#include "bg_window.h"
#include "game_options.h"
#include "strbuf.h"

void FieldMessage_LoadTextPalettes(u32 palLocation, u32 resetPrinters);
void FieldMessage_AddWindow(BgConfig *bgConfig, Window *window, u32 bgLayer);
void FieldMessage_DrawWindow(Window *window, const Options *options);
void FieldMessage_ClearWindow(Window *window);
u8 FieldMessage_Print(Window *window, Strbuf *strBuf, const Options *options, u8 canSkipDelay);
u8 FieldMessage_PrintWithParams(Window *window, Strbuf *strBuf, int fontID, int renderDelay, u8 canSkipDelay, BOOL autoScroll);
u8 FieldMessage_FinishedPrinting(u8 printerID);
void FieldMessage_AddSignpostWindow(BgConfig *bgConfig, Window *window, u16 signpostType, u16 bgLayer);
void FieldMessage_LoadAndDrawSignpost(Window *window, u16 signpostType, u16 signpostNARCMemberIdx);

#endif // POKEPLATINUM_FIELD_MESSAGE_H
2 changes: 2 additions & 0 deletions include/journal.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include "savedata.h"
#include "trainer_info.h"

#define MAX_JOURNAL_ENTRIES 10

#define POKEMON_CAUGHT 1
#define POKEMON_DEFEATED 2

Expand Down
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
53 changes: 53 additions & 0 deletions include/pokedex_data.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#ifndef POKEPLATINUM_POKEDEX_DATA_H
#define POKEPLATINUM_POKEDEX_DATA_H

#include "struct_decls/pokedexdata_decl.h"

#include "pokemon.h"
#include "savedata.h"

int PokedexData_SaveSize(void);
PokedexData *PokedexData_Alloc(u32 heapID);
void PokedexData_Copy(const PokedexData *src, PokedexData *dest);
void PokedexData_Init(PokedexData *pokedexData);
u16 PokedexData_CountCaught_National(const PokedexData *pokedexData);
u16 PokedexData_CountSeen_National(const PokedexData *pokedexData);
u16 PokedexData_CountSeen(const PokedexData *pokedexData);
u16 PokedexData_CountCaught_Local(const PokedexData *pokedexData);
u16 PokedexData_CountSeen_Local(const PokedexData *pokedexData);
BOOL PokedexData_NationalDexCompleted(const PokedexData *pokedexData);
BOOL PokedexData_LocalDexCompleted(const PokedexData *pokedexData);
u16 PokedexData_NumCaught_National(const PokedexData *pokedexData);
u16 PokedexData_NumCaught_Local(const PokedexData *pokedexData);
BOOL PokedexData_HasCaughtSpecies(const PokedexData *pokedexData, u16 species);
BOOL PokedexData_HasSeenSpecies(const PokedexData *pokedexData, u16 species);
u32 PokedexData_GetForm_Spinda(const PokedexData *pokedexData, u8 formIndex);
u32 PokedexData_DisplayedGender(const PokedexData *pokedexData, u16 species, int displaySecondary);
u32 PokedexData_GetForm_Unown(const PokedexData *pokedexData, int formIndex);
u32 PokedexData_NumFormsSeen_Unown(const PokedexData *pokedexData);
u32 PokedexData_GetForm_Shellos(const PokedexData *pokedexData, int formIndex);
u32 PokedexData_NumFormsSeen_Shellos(const PokedexData *pokedexData);
u32 PokedexData_GetForm_Gastrodon(const PokedexData *pokedexData, int formIndex);
u32 PokedexData_NumFormsSeen_Gastrodon(const PokedexData *pokedexData);
u32 PokedexData_GetForm_Burmy(const PokedexData *pokedexData, int formIndex);
u32 PokedexData_NumFormsSeen_Burmy(const PokedexData *pokedexData);
u32 PokedexData_GetForm_Wormadam(const PokedexData *pokedexData, int formIndex);
u32 PokedexData_NumFormsSeen_Wormadam(const PokedexData *pokedexData);
u32 PokedexData_GetForm_Deoxys(const PokedexData *pokedexData, int formIndex);
u32 PokedexData_NumFormsSeen_Deoxys(const PokedexData *pokedexData);
void PokedexData_Encounter(PokedexData *pokedexData, Pokemon *pokemon);
void PokedexData_Capture(PokedexData *pokedexData, Pokemon *pokemon);
void PokedexData_ObtainNationalDex(PokedexData *pokedexData);
BOOL PokedexData_IsNationalDexObtained(const PokedexData *pokedexData);
BOOL PokedexData_CanDetectForms(const PokedexData *pokedexData);
void PokedexData_TurnOnFormDetection(PokedexData *pokedexData);
BOOL PokedexData_IsLanguageObtained(const PokedexData *pokedexData, u16 species, u32 languageIndex);
void PokedexData_TurnOnLanguageDetection(PokedexData *pokedexData);
BOOL PokedexData_CanDetectLanguages(const PokedexData *pokedexData);
BOOL PokedexData_IsObtained(const PokedexData *pokedexData);
void PokedexData_ObtainPokedex(PokedexData *pokedexData);
PokedexData *SaveData_PokedexData(SaveData *saveData);
u32 PokedexData_GetDisplayForm(const PokedexData *pokedexData, int species, int formIndex);
u32 PokedexData_NumFormsSeen(const PokedexData *pokedexData, int species);

#endif // POKEPLATINUM_POKEDEX_DATA_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
53 changes: 0 additions & 53 deletions include/unk_0202631C.h

This file was deleted.

18 changes: 0 additions & 18 deletions include/unk_0205D8CC.h

This file was deleted.

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

This file was deleted.

8 changes: 4 additions & 4 deletions platinum.us/main.lsf
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ Static main
Object main.nef.p/src_unk_0202602C.c.o
Object main.nef.p/src_unk_02026150.c.o
Object main.nef.p/src_unk_020261E4.c.o
Object main.nef.p/src_unk_0202631C.c.o
Object main.nef.p/src_pokedex_data.c.o
Object main.nef.p/src_savedata_misc.c.o
Object main.nef.p/src_game_options.c.o
Object main.nef.p/src_berry_patches.c.o
Expand Down Expand Up @@ -244,7 +244,7 @@ Static main
Object main.nef.p/src_unk_0205C22C.c.o
Object main.nef.p/src_unk_0205C980.c.o
Object main.nef.p/src_unk_0205CA94.c.o
Object main.nef.p/src_unk_0205D8CC.c.o
Object main.nef.p/src_field_message.c.o
Object main.nef.p/src_map_tile_behavior.c.o
Object main.nef.p/src_unk_0205DFC4.c.o
Object main.nef.p/src_player_avatar.c.o
Expand Down 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 res/battle/moves/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -484,11 +484,11 @@ pl_waza_tbl_narc = custom_target('pl_waza_tbl.narc',
depends: [ py_consts_generators ],
command: [
movedata_py,
'--knarc', knarc_exe,
'--narc', narc_exe,
'--source-dir', '@CURRENT_SOURCE_DIR@',
'--private-dir', '@PRIVATE_DIR@',
'--output-dir', '@OUTDIR@',
]
)

nitrofs_files += pl_waza_tbl_narc
nitrofs_files += pl_waza_tbl_narc
22 changes: 11 additions & 11 deletions res/battle/scripts/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ be_seq_narc = custom_target(be_seq_target_name,
extra_args: ['--out-dir', be_seq_private_dir]
),
command: [
knarc_exe,
'-d', '@PRIVATE_DIR@',
'-p', '@OUTPUT@'
narc_exe, 'create',
'--output', '@OUTPUT@',
'@PRIVATE_DIR@',
]
)

Expand All @@ -38,11 +38,11 @@ sub_seq_narc = custom_target(sub_seq_narc_name,
extra_args: ['--out-dir', sub_seq_private_dir]
),
command: [
knarc_exe,
'-d', '@PRIVATE_DIR@',
'-p', '@OUTPUT0@',
'-o', sub_seq_narc_order,
'-n'
narc_exe, 'create',
'--naix',
'--order', sub_seq_narc_order,
'--output', '@OUTPUT0@',
'@PRIVATE_DIR@',
]
)

Expand All @@ -53,9 +53,9 @@ waza_seq_narc = custom_target(waza_seq_target_name,
extra_args: ['--out-dir', waza_seq_private_dir]
),
command: [
knarc_exe,
'-d', '@PRIVATE_DIR@',
'-p', '@OUTPUT@'
narc_exe, 'create',
'--output', '@OUTPUT@',
'@PRIVATE_DIR@',
]
)

Expand Down
Loading

0 comments on commit 4af2eb2

Please sign in to comment.