Skip to content

Commit

Permalink
Merge pull request #365 from TheSylphIsIn/main
Browse files Browse the repository at this point in the history
Document ScrCmds 065, 0B4, 0B5, 0A1, 0DE, 096, 097
  • Loading branch information
lhearachel authored Feb 8, 2025
2 parents 3bf7b14 + e970e50 commit e27c17f
Show file tree
Hide file tree
Showing 184 changed files with 759 additions and 750 deletions.
39 changes: 20 additions & 19 deletions asm/macros/scrcmd.inc
Original file line number Diff line number Diff line change
Expand Up @@ -557,9 +557,9 @@
.short \arg0
.endm

.macro ScrCmd_065 arg0
.macro RemoveObject localID
.short 101
.short \arg0
.short \localID
.endm

.macro ScrCmd_066 arg0, arg1
Expand Down Expand Up @@ -852,18 +852,19 @@
.short \arg1
.endm

.macro ScrCmd_096 arg0, arg1, arg2, arg3
.macro GivePokemon species, level, heldItem, successVar
.short 150
.short \arg0
.short \arg1
.short \arg2
.short \arg3
.short \species
.short \level
.short \heldItem
.short \successVar
.endm

.macro ScrCmd_097 arg0, arg1
@ eggGiverTextId corresponds to an entry in special_met_location_names.gmm.
.macro GiveEgg species, eggGiverTextId
.short 151
.short \arg0
.short \arg1
.short \species
.short \eggGiverTextId
.endm

.macro ScrCmd_098 arg0, arg1, arg2
Expand Down Expand Up @@ -912,7 +913,7 @@
.short 160
.endm

.macro ScrCmd_0A1
.macro ReturnToField
.short 161
.endm

Expand Down Expand Up @@ -1000,11 +1001,11 @@
.short \arg0
.endm

.macro ScrCmd_0B4
.macro StartChooseStarterScene
.short 180
.endm

.macro ScrCmd_0B5
.macro SaveChosenStarter
.short 181
.endm

Expand Down Expand Up @@ -1206,9 +1207,9 @@
.byte \arg0
.endm

.macro BufferSpeciesNameFromVar bufferId, var, unused1, unused2
.macro BufferSpeciesNameFromVar templateArg, var, unused1, unused2
.short 218
.byte \bufferId
.byte \templateArg
.short \var
.short \unused1
.byte \unused2
Expand All @@ -1219,19 +1220,19 @@
.byte \arg0
.endm

.macro ScrCmd_0DC arg0
.macro BufferRivalStarterSpeciesName templateArg
.short 220
.byte \arg0
.byte \templateArg
.endm

.macro ScrCmd_0DD arg0
.short 221
.byte \arg0
.endm

.macro ScrCmd_0DE arg0
.macro GetPlayerStarterSpecies destVar
.short 222
.short \arg0
.short \destVar
.endm

.macro BufferUndergroundGoodsName templateArg, goods
Expand Down
2 changes: 1 addition & 1 deletion include/map_object.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ MapObject *sub_02061A74(const MapObjectManager *mapObjMan, int param1, int objEv
void sub_02061AB4(MapObject *mapObj, int graphicsID);
void sub_02061AD4(MapObject *mapObj, int param1);
void MapObject_Delete(MapObject *mapObj);
void sub_02061B28(MapObject *mapObj);
void MapObject_SetFlagAndDeleteObject(MapObject *mapObj);
void sub_02061B48(MapObject *mapObj);
void MapObjectMan_DeleteAll(MapObjectManager *mapObjMan);
void sub_02061BF0(MapObjectManager *mapObjMan);
Expand Down
2 changes: 1 addition & 1 deletion include/overlay005/ov5_021E622C.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ int ov5_021E6630(UnkStruct_02026310 *param0, u8 param1, StringTemplate *param2);
u8 ov5_021E6640(UnkStruct_02026310 *param0, int param1, StringTemplate *param2);
void ov5_021E6720(UnkStruct_02026310 *param0);
void ov5_021E6B40(UnkStruct_02026310 *param0);
void ov5_021E6CF0(Pokemon *param0, u16 param1, u8 param2, TrainerInfo *param3, int param4, int param5);
void Egg_CreateEgg(Pokemon *mon, u16 species, u8 param2, TrainerInfo *trainerInfo, int param4, int metLocation);
void ov5_021E6DE8(Pokemon *param0, u16 param1, UnkStruct_02026310 *param2, u32 param3, u8 param4);
void ov5_021E6EA8(UnkStruct_02026310 *param0, Party *param1, TrainerInfo *param2);
BOOL ov5_021E7154(UnkStruct_02026310 *param0, Party *param1, FieldSystem *fieldSystem);
Expand Down
4 changes: 3 additions & 1 deletion include/pokemon.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
#define FACE_BACK 0
#define FACE_FRONT 2

#define INIT_IVS_RANDOM 32

enum EvolutionClass {
EVO_CLASS_BY_LEVEL = 0,
EVO_CLASS_BY_TRADE,
Expand Down Expand Up @@ -805,7 +807,7 @@ void Pokemon_PlayCry(ChatotCry *chatotCry, enum PokemonCryMod crymod, u16 specie
*/
void Pokemon_PlayDelayedCry(ChatotCry *chatotCry, enum PokemonCryMod crymod, u16 species, int form, int pan, int volume, int forceDefaultChatot, int heapID, u8 delay);
BOOL Pokemon_IsEligibleForAction(Pokemon *mon);
void Pokemon_SetCatchData(Pokemon *mon, TrainerInfo *param1, int monPokeball, int param3, int param4, int param5);
void Pokemon_SetCatchData(Pokemon *mon, TrainerInfo *trainerInfo, int monPokeball, int metLocation, int metTerrain, enum HeapId heapId);
void Pokemon_UpdateAfterCatch(Pokemon *mon, TrainerInfo *param1, int monPokeball, int param3, int param4, int param5);
void Pokemon_GiveHeldItem(Pokemon *mon, u32 battleType, int itemRates);
BOOL Pokemon_CanLearnTM(Pokemon *mon, u8 tmID);
Expand Down
2 changes: 1 addition & 1 deletion include/scrcmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
#include "field_script_context.h"

BOOL sub_02041CC8(ScriptContext *ctx);
BOOL sub_02041D60(ScriptContext *ctx);
BOOL ScriptContext_WaitForApplicationExit(ScriptContext *ctx);

#endif // POKEPLATINUM_SCRCMD_H
2 changes: 1 addition & 1 deletion include/unk_02017038.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

int sub_02017038(u32 param0);
int sub_02017058(u32 param0);
int sub_02017070(int param0, int param1);
int SpecialMetLoc_GetId(int baseValue, int modifier);
BOOL sub_0201708C(u16 param0);

#endif // POKEPLATINUM_UNK_02017038_H
2 changes: 1 addition & 1 deletion include/unk_0203D1B8.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ void sub_0203DE88(FieldSystem *fieldSystem, SaveData *param1);
void sub_0203DFE8(FieldTask *param0, int param1, int param2, int param3, int param4, const u16 *param5, u16 *param6);
void sub_0203E09C(FieldSystem *fieldSystem, TrainerCard *param1);
BOOL sub_0203E0AC(FieldSystem *fieldSystem, void *param1);
void sub_0203E0C0(FieldSystem *fieldSystem, ChooseStarterData *param1);
void FieldSystem_LaunchChooseStarterApp(FieldSystem *fieldSystem, ChooseStarterData *param1);
void sub_0203E0D0(FieldSystem *fieldSystem);
void sub_0203E0FC(FieldSystem *fieldSystem, int param1);
void *sub_0203E1AC(FieldSystem *fieldSystem, int param1, int param2);
Expand Down
2 changes: 1 addition & 1 deletion include/unk_020474B8.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ BOOL ScrCmd_0D8(ScriptContext *param0);
BOOL ScrCmd_0D9(ScriptContext *param0);
BOOL ScrCmd_BufferSpeciesNameFromVar(ScriptContext *ctx);
BOOL ScrCmd_0DB(ScriptContext *param0);
BOOL ScrCmd_0DC(ScriptContext *param0);
BOOL ScrCmd_BufferRivalStarterSpeciesName(ScriptContext *ctx);
BOOL ScrCmd_0DD(ScriptContext *param0);
BOOL ScrCmd_BufferUndergroundGoodsName(ScriptContext *ctx);
BOOL ScrCmd_BufferUndergroundTrapName(ScriptContext *ctx);
Expand Down
4 changes: 2 additions & 2 deletions include/unk_0204CFFC.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

#include "field_script_context.h"

BOOL ScrCmd_096(ScriptContext *param0);
BOOL ScrCmd_GivePokemon(ScriptContext *param0);
BOOL ScrCmd_198(ScriptContext *param0);
BOOL ScrCmd_199(ScriptContext *param0);
BOOL ScrCmd_097(ScriptContext *param0);
BOOL ScrCmd_GiveEgg(ScriptContext *ctx);
BOOL ScrCmd_098(ScriptContext *param0);
BOOL ScrCmd_099(ScriptContext *param0);
BOOL ScrCmd_09A(ScriptContext *param0);
Expand Down
2 changes: 1 addition & 1 deletion include/unk_02054884.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#define PARTY_SLOT_NONE 0xFF

BOOL Pokemon_CanBattle(Pokemon *mon);
BOOL sub_020548B0(int heapID, SaveData *saveData, u16 param2, u8 param3, u16 param4, int param5, int param6);
BOOL Pokemon_GiveMonFromScript(enum HeapId heapID, SaveData *saveData, u16 species, u8 level, u16 heldItem, int metLocation, int metTerrain);
BOOL sub_02054930(int unused, SaveData *saveData, u16 param2, u8 param3, int param4, int param5);
void sub_02054988(Party *party, int param1, int param2, u16 param3);
int Party_HasMonWithMove(Party *party, u16 moveID);
Expand Down
6 changes: 3 additions & 3 deletions include/unk_0206AFE0.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ enum HiddenLocations {

BOOL sub_0206B024(VarsFlags *varsFlags, u16 param1);
u16 sub_0206B034(VarsFlags *varsFlags);
BOOL sub_0206B044(VarsFlags *varsFlags, u16 param1);
u16 sub_0206B054(VarsFlags *varsFlags);
u16 sub_0206B064(VarsFlags *varsFlags);
BOOL VarsFlags_SetPlayerStarterSpecies(VarsFlags *varsFlags, u16 param1);
u16 VarsFlags_GetPlayerStarterSpecies(VarsFlags *varsFlags);
u16 VarsFlags_GetRivalStarterSpecies(VarsFlags *varsFlags);
u16 VarsFlags_GetPlayerCounterpartStarterSpecies(VarsFlags *varsFlags);
u16 sub_0206B0B4(VarsFlags *varsFlags);
BOOL sub_0206B0C4(VarsFlags *varsFlags, u16 param1);
Expand Down
2 changes: 1 addition & 1 deletion res/field/scripts/scripts_acuity_cavern.s
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ _0014:

_0021:
SetFlag 0x1E1
ScrCmd_065 0
RemoveObject 0
ClearFlag 142
End

Expand Down
2 changes: 1 addition & 1 deletion res/field/scripts/scripts_acuity_lakefront.s
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ _009A:
CloseMessage
ApplyMovement 2, _00F8
WaitMovement
ScrCmd_065 2
RemoveObject 2
ApplyMovement 241, _00F0
WaitMovement
ScrCmd_067
Expand Down
2 changes: 1 addition & 1 deletion res/field/scripts/scripts_amity_square.s
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ _0365:
End

_037D:
ScrCmd_065 5
RemoveObject 5
GoTo _0389
End

Expand Down
4 changes: 2 additions & 2 deletions res/field/scripts/scripts_battle_arcade.s
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ _020B:
WaitFadeScreen
ScrCmd_2D9 4, 0x40BE, 0x800C
ScrCmd_2DB 0x4002, 0x4005, 0x4006
ScrCmd_0A1
ReturnToField
FadeScreen 6, 1, 1, 0
WaitFadeScreen
GoToIfEq 0x4002, 0xFF, _0145
Expand Down Expand Up @@ -292,7 +292,7 @@ _04DC:
ScrCmd_1F8
ScrCmd_2C4 15
CallIfEq 0x40BE, 2, _0545
ScrCmd_0A1
ReturnToField
FadeScreen 6, 1, 1, 0
WaitFadeScreen
ScrCmd_313 1
Expand Down
4 changes: 2 additions & 2 deletions res/field/scripts/scripts_battle_castle.s
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ _01FF:
WaitFadeScreen
ScrCmd_2D2 4, 0x40BD, 0x800C
ScrCmd_2D4 0x4002, 0x4005, 0x4006
ScrCmd_0A1
ReturnToField
FadeScreen 6, 1, 1, 0
WaitFadeScreen
GoToIfEq 0x4002, 0xFF, _0139
Expand Down Expand Up @@ -289,7 +289,7 @@ _04D0:
ScrCmd_1F8
ScrCmd_2C4 11
CallIfEq 0x40BD, 2, _0539
ScrCmd_0A1
ReturnToField
FadeScreen 6, 1, 1, 0
WaitFadeScreen
ScrCmd_313 1
Expand Down
2 changes: 1 addition & 1 deletion res/field/scripts/scripts_battle_factory.s
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ _03C1:
ScrCmd_1F8
ScrCmd_2C4 3
CallIfEq 0x40B8, 2, _042A
ScrCmd_0A1
ReturnToField
FadeScreen 6, 1, 1, 0
WaitFadeScreen
ScrCmd_313 1
Expand Down
2 changes: 1 addition & 1 deletion res/field/scripts/scripts_battle_frontier.s
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ _027E:
FadeScreen 6, 1, 0, 0
WaitFadeScreen
ScrCmd_2E2
ScrCmd_0A1
ReturnToField
FadeScreen 6, 1, 1, 0
WaitFadeScreen
ReleaseAll
Expand Down
8 changes: 4 additions & 4 deletions res/field/scripts/scripts_battle_hall.s
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ _00B5:
End

_00DB:
ScrCmd_065 13
RemoveObject 13
SetFlag 0x2CB
Return

Expand Down Expand Up @@ -107,7 +107,7 @@ _0196:
Return

_019C:
ScrCmd_065 10
RemoveObject 10
SetFlag 0x2C1
Return

Expand Down Expand Up @@ -257,7 +257,7 @@ _03F5:
WaitFadeScreen
ScrCmd_2CC 4, 0x40BB, 0x800C
ScrCmd_2D0 0x4002, 0x4005
ScrCmd_0A1
ReturnToField
FadeScreen 6, 1, 1, 0
WaitFadeScreen
GoToIfEq 0x4002, 0xFF, _034D
Expand Down Expand Up @@ -408,7 +408,7 @@ _06C3:
ScrCmd_1F8
ScrCmd_2C4 9
CallIfEq 0x40BB, 2, _072C
ScrCmd_0A1
ReturnToField
FadeScreen 6, 1, 1, 0
WaitFadeScreen
ScrCmd_313 1
Expand Down
4 changes: 2 additions & 2 deletions res/field/scripts/scripts_battle_park.s
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ _0032:
CallIfEq 0x8004, 24, _0204
CallIfEq 0x8004, 25, _0218
CallIfEq 0x8004, 26, _022C
ScrCmd_065 11
RemoveObject 11
ClearFlag 0x277
ScrCmd_064 12
ScrCmd_062 12
Expand All @@ -72,7 +72,7 @@ _0032:
CallIfEq 0x8004, 24, _0254
CallIfEq 0x8004, 25, _0268
CallIfEq 0x8004, 26, _027C
ScrCmd_065 12
RemoveObject 12
SetVar 0x410E, 1
ReleaseAll
End
Expand Down
8 changes: 4 additions & 4 deletions res/field/scripts/scripts_battle_tower.s
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ _04BE:
WaitFadeScreen
CloseMessage
ScrCmd_1DD 30, 0, 0
ScrCmd_0A1
ReturnToField
ScrCmd_1DD 31, 0, 0x800C
FadeScreen 6, 1, 1, 0
WaitFadeScreen
Expand Down Expand Up @@ -588,7 +588,7 @@ _097F:
ScrCmd_0B3 0x4000
ScrCmd_1DD 16, 0x4001, 0x4000
SetVar 0x4001, 0x4000
ScrCmd_0A1
ReturnToField
FadeScreen 6, 1, 1, 0
WaitFadeScreen
SetVar 0x800C, 0x4001
Expand Down Expand Up @@ -1169,7 +1169,7 @@ _1304:
FadeScreen 6, 1, 0, 0
WaitFadeScreen
ScrCmd_1D9 0x8000, 0x8001
ScrCmd_0A1
ReturnToField
FadeScreen 6, 1, 1, 0
WaitFadeScreen
ReleaseAll
Expand Down Expand Up @@ -1283,7 +1283,7 @@ _140A:
CloseMessage
ScrCmd_191
ScrCmd_193 0x800C
ScrCmd_0A1
ReturnToField
SetVar 0x8000, 0x800C
FadeScreen 6, 1, 1, 0
WaitFadeScreen
Expand Down
2 changes: 1 addition & 1 deletion res/field/scripts/scripts_battle_tower_battle_room.s
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ _0492:
ApplyMovement 1, _0550
WaitMovement
SetFlag 0x1CB
ScrCmd_065 1
RemoveObject 1
Return

_04A6:
Expand Down
Loading

0 comments on commit e27c17f

Please sign in to comment.