Skip to content

Commit

Permalink
Merge pull request #328 from iriv24/pal-park
Browse files Browse the repository at this point in the history
Document catching_show (unk_020562F8)
  • Loading branch information
lhearachel authored Jan 5, 2025
2 parents 7fc646f + 5859d1c commit b8626d1
Show file tree
Hide file tree
Showing 28 changed files with 465 additions and 440 deletions.
11 changes: 6 additions & 5 deletions asm/macros/scrcmd.inc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.include "macros/movement.inc"
.include "consts/badges.inc"
.include "consts/catching_show.inc"
.include "consts/game_records.inc"
.include "consts/items.inc"
.include "consts/journal.inc"
Expand Down Expand Up @@ -3250,10 +3251,10 @@
.short 597
.endm

.macro ScrCmd_256 arg0, arg1
.macro CalcCatchingShowPoints pointsCategory, destVarID
.short 598
.short \arg0
.short \arg1
.short \pointsCategory
.short \destVarID
.endm

.macro ScrCmd_257
Expand Down Expand Up @@ -3370,9 +3371,9 @@
.short \arg0
.endm

.macro ScrCmd_26E arg0
.macro GetGBACartridgeVersion destVarID
.short 622
.short \arg0
.short \destVarID
.endm

.macro ScrCmd_26F
Expand Down
13 changes: 13 additions & 0 deletions consts/catching_show.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"definitions": {
"@CatchingShowPointsCategory": {
"type": "enum",
"values": [
"CATCHING_SHOW_CATCHING_POINTS",
"CATCHING_SHOW_TIME_POINTS",
"CATCHING_SHOW_TYPE_POINTS",
"CATCHING_SHOW_TOTAL_POINTS"
]
}
}
}
2 changes: 1 addition & 1 deletion consts/game_records.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
"TRAINER_SCORE_EVENT_UNK_14",
"TRAINER_SCORE_EVENT_UNK_15",
"TRAINER_SCORE_EVENT_UNK_16",
"TRAINER_SCORE_EVENT_UNK_17",
"TRAINER_SCORE_EVENT_FINISHED_CATCHING_SHOW",
"TRAINER_SCORE_EVENT_UNK_18",
"TRAINER_SCORE_EVENT_UNK_19",
"TRAINER_SCORE_EVENT_UNK_20",
Expand Down
1 change: 1 addition & 0 deletions consts/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ consts_manifest_basenames = [
'battle',
'battle_subscripts',
'btlcmd',
'catching_show',
'game_records',
'gender',
'items',
Expand Down
38 changes: 38 additions & 0 deletions include/catching_show.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#ifndef POKEPLATINUM_CATCHING_SHOW_H
#define POKEPLATINUM_CATCHING_SHOW_H

#include "field/field_system_decl.h"

#include "field_battle_data_transfer.h"

#define CATCHING_SHOW_MONS 6

typedef struct CatchingShowPokemon {
u16 species;
u8 area;
u8 rarity;
u16 catchingPoints;
u8 type1;
u8 type2;
} CatchingShowPokemon;

typedef struct CatchingShow {
CatchingShowPokemon pokemon[CATCHING_SHOW_MONS];
u8 caughtMonsOrder[CATCHING_SHOW_MONS];
int steps;
int currentEncounterIndex;
s64 startTime;
int timePoints;
} CatchingShow;

void CatchingShow_Start(FieldSystem *fieldSystem);
void CatchingShow_End(FieldSystem *fieldSystem);
BOOL CatchingShow_CheckWildEncounter(FieldSystem *fieldSystem, int playerX, int playerY);
FieldBattleDTO *CatchingShow_GetBattleDTO(FieldSystem *fieldSystem);
void CatchingShow_UpdateBattleResult(FieldSystem *fieldSystem, FieldBattleDTO *dto);
int CatchingShow_GetParkBallCount(FieldSystem *fieldSystem);
int CatchingShow_CalcCatchingPoints(FieldSystem *fieldSystem);
int CatchingShow_GetTimePoints(FieldSystem *fieldSystem);
int CatchingShow_GetTypePoints(FieldSystem *fieldSystem);

#endif // POKEPLATINUM_CATCHING_SHOW_H
2 changes: 1 addition & 1 deletion include/core_sys.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ typedef struct CoreSys {
u16 touchHeld;
u8 unk_64;
u8 unk_65;
u8 unk_66;
u8 gbaCartridgeVersion;
u8 inhibitSleep;
u8 inhibitReset;
u8 padding_69[3];
Expand Down
6 changes: 0 additions & 6 deletions include/struct_decls/struct_020564B4_decl.h

This file was deleted.

2 changes: 1 addition & 1 deletion include/unk_02017728.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ void *ReadFileToHeap(int heapID, const char *filename);
void ReadFileToBuffer(const char *filename, void **buf);
void sub_02017ACC(void);
void InitKeypadAndTouchpad(void);
void sub_02017B70(int param0);
void SetGBACartridgeVersion(int version);
void SleepLock(u8 param0);
void SleepUnlock(u8 param0);
void ReadKeypadAndTouchpad(void);
Expand Down
2 changes: 1 addition & 1 deletion include/unk_0204C500.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
BOOL ScrCmd_253(ScriptContext *param0);
BOOL ScrCmd_254(ScriptContext *param0);
BOOL ScrCmd_255(ScriptContext *param0);
BOOL ScrCmd_256(ScriptContext *param0);
BOOL ScrCmd_CalcCatchingShowPoints(ScriptContext *ctx);

#endif // POKEPLATINUM_UNK_0204C500_H
18 changes: 0 additions & 18 deletions include/unk_020562F8.h

This file was deleted.

2 changes: 1 addition & 1 deletion platinum.us/main.lsf
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ Static main
Object main.nef.p/src_field_transition.c.o
Object main.nef.p/src_unk_020559DC.c.o
Object main.nef.p/src_unk_02055C50.c.o
Object main.nef.p/src_unk_020562F8.c.o
Object main.nef.p/src_catching_show.c.o
Object main.nef.p/src_poketch_data.c.o
Object main.nef.p/src_unk_02056B30.c.o
Object main.nef.p/src_unk_020573FC.c.o
Expand Down
16 changes: 8 additions & 8 deletions res/field/scripts/scripts_pal_park_lobby.s
Original file line number Diff line number Diff line change
Expand Up @@ -213,16 +213,16 @@ _02F8:
SetVar 0x40F3, 0
ApplyMovement 0xFF, _03EC
WaitMovement
ScrCmd_256 0, 0x800C
CalcCatchingShowPoints CATCHING_SHOW_CATCHING_POINTS, 0x800C
BufferNumber 0, 0x800C
ScrCmd_256 1, 0x800C
CalcCatchingShowPoints CATCHING_SHOW_TIME_POINTS, 0x800C
BufferNumber 1, 0x800C
ScrCmd_256 2, 0x800C
CalcCatchingShowPoints CATCHING_SHOW_TYPE_POINTS, 0x800C
BufferNumber 2, 0x800C
ScrCmd_256 3, 0x800C
CalcCatchingShowPoints CATCHING_SHOW_TOTAL_POINTS, 0x800C
BufferNumber 3, 0x800C
Message 38
ScrCmd_256 3, 0x800C
CalcCatchingShowPoints CATCHING_SHOW_TOTAL_POINTS, 0x800C
GoToIfGt 0x800C, 0x40E0, _035B
Message 40
Call _07BE
Expand All @@ -231,7 +231,7 @@ _02F8:
_035B:
Message 39
Call _07BE
ScrCmd_256 3, 0x40E0
CalcCatchingShowPoints CATCHING_SHOW_TOTAL_POINTS, 0x40E0
GoTo _0370

_0370:
Expand Down Expand Up @@ -507,7 +507,7 @@ _0662:
LockAll
FacePlayer
GoToIfEq 0x4009, 1, _06CF
ScrCmd_26E 0x800C
GetGBACartridgeVersion 0x800C
GoToIfEq 0x800C, 4, _06DA
GoToIfEq 0x800C, 5, _0706
GoToIfEq 0x800C, 1, _0732
Expand Down Expand Up @@ -587,7 +587,7 @@ _07AE:
End

_07BE:
ScrCmd_256 3, 0x800C
CalcCatchingShowPoints CATCHING_SHOW_TOTAL_POINTS, 0x800C
CallIfLt 0x800C, 0xBB8, _07FA
CallIfLt 0x800C, 0xCE4, _0870
CallIfLt 0x800C, 0xDAC, _08BF
Expand Down
Loading

0 comments on commit b8626d1

Please sign in to comment.