Use 'Args' for application arguments

This commit is contained in:
Abaresk 2022-09-06 15:45:39 +00:00
parent 6e9aef28ed
commit 65f95751cf
8 changed files with 29 additions and 38 deletions

View File

@ -2828,8 +2828,8 @@ sub_0203F7F4: ; 0x0203F7F4
_0203F804: .word _020FA284
thumb_func_end sub_0203F7F4
thumb_func_start FieldSys_LaunchChooseStarterApplication
FieldSys_LaunchChooseStarterApplication: ; 0x0203F808
thumb_func_start LaunchChooseStarterApp
LaunchChooseStarterApp: ; 0x0203F808
ldr r3, _0203F810 ; =Fsys_LaunchApplication
add r2, r1, #0
ldr r1, _0203F814 ; =sAppTemplate_ChooseStarter
@ -2837,7 +2837,7 @@ FieldSys_LaunchChooseStarterApplication: ; 0x0203F808
.balign 4, 0
_0203F810: .word Fsys_LaunchApplication
_0203F814: .word sAppTemplate_ChooseStarter
thumb_func_end FieldSys_LaunchChooseStarterApplication
thumb_func_end LaunchChooseStarterApp
thumb_func_start sub_0203F818
sub_0203F818: ; 0x0203F818
@ -3000,8 +3000,8 @@ _0203F96C: .word Fsys_LaunchApplication
_0203F970: .word _020FA224
thumb_func_end sub_0203F964
thumb_func_start LaunchHOFCongratulationsApp
LaunchHOFCongratulationsApp: ; 0x0203F974
thumb_func_start LaunchHOFCongratsApp
LaunchHOFCongratsApp: ; 0x0203F974
ldr r3, _0203F97C ; =Fsys_LaunchApplication
add r2, r1, #0
ldr r1, _0203F980 ; =_020FA214
@ -3009,7 +3009,7 @@ LaunchHOFCongratulationsApp: ; 0x0203F974
.balign 4, 0
_0203F97C: .word Fsys_LaunchApplication
_0203F980: .word _020FA214
thumb_func_end LaunchHOFCongratulationsApp
thumb_func_end LaunchHOFCongratsApp
thumb_func_start sub_0203F984
sub_0203F984: ; 0x0203F984

View File

@ -612,7 +612,7 @@
.public FieldSys_CreateTask
.public FieldSys_GetPlayerAvatar
.public FieldSys_IncrementBugContestTimer
.public FieldSys_LaunchChooseStarterApplication
.public LaunchChooseStarterApp
.public FieldSys_SetEngagedTrainer
.public FieldSys_StartBugContestTimer
.public FieldSys_TakePhoto
@ -28870,7 +28870,7 @@
.public sub_0203F844
.public sub_0203F8EC
.public sub_0203F964
.public LaunchHOFCongratulationsApp
.public LaunchHOFCongratsApp
.public sub_0203F984
.public LaunchCreditsApp
.public sub_0203F9C4

View File

@ -9,6 +9,6 @@ typedef struct {
PLAYERPROFILE *profile;
PARTY *party;
IGT *igt;
} HOFCongratsAppWork;
} HOFCongratsAppArgs;
#endif //POKEHEARTGOLD_OVERLAY_63_H

View File

@ -1,9 +0,0 @@
#ifndef POKEHEARTGOLD_OVERLAY_76_H
#define POKEHEARTGOLD_OVERLAY_76_H
typedef struct {
int gender;
BOOL gameCleared;
} CreditsAppWork;
#endif //POKEHEARTGOLD_OVERLAY_76_H

View File

@ -4,7 +4,7 @@
#include "script.h"
#include "overlay_02.h"
#include "overlay_63.h"
#include "overlay_76.h"
#include "overlay_credits.h"
#include "bag.h"
#include "mail.h"
#include "fashion_case.h"
@ -34,7 +34,7 @@ struct PartyMenuAppData {
u8 filler_33[0x11];
};
struct ChooseStarterAppData {
struct ChooseStarterAppArgs {
int cursorPos;
OPTIONS *options;
POKEMON starters[3];
@ -80,7 +80,7 @@ int sub_0203E5F8(struct PartyMenuAppData *partyWork);
void sub_0203F570(FieldSystem *fsys, SAVEDATA *saveData);
UnkStruct_Ov02_0224E4EC* sub_0203EB64(FieldSystem *fsys);
void sub_0203F964(FieldSystem *fsys);
void FieldSys_LaunchChooseStarterApplication(FieldSystem *fsys, struct ChooseStarterAppData *data);
void LaunchChooseStarterApp(FieldSystem *fsys, struct ChooseStarterAppArgs *args);
void Save_CurrentLocation_BackUp(SAVEDATA *saveData);
u16 sub_0203E864(void *a0);
u16 sub_0203E600(void *a0);
@ -137,8 +137,8 @@ void *sub_0203EF40(FieldSystem *fsys);
void *sub_0203EFA0(FieldSystem *fsys);
void *sub_0203EEA0(FieldSystem *fsys);
void *Fsys_CreateApplication_AlphPuzzle(FieldSystem *fsys, u8 puzzle);
void LaunchHOFCongratulationsApp(FieldSystem *fsys, HOFCongratsAppWork *work);
void LaunchCreditsApp(FieldSystem *fsys, CreditsAppWork *work);
void LaunchHOFCongratsApp(FieldSystem *fsys, HOFCongratsAppArgs *args);
void LaunchCreditsApp(FieldSystem *fsys, CreditsAppArgs *args);
void LocationData_BackUp(Location *data);
void LocationData_Restore(Location *data);

View File

@ -12,7 +12,7 @@
struct ChooseStarterTaskData {
int state;
struct ChooseStarterAppData *appData;
struct ChooseStarterAppArgs *args;
};
static BOOL CreateStarter(TaskManager *taskManager);
@ -47,11 +47,11 @@ static BOOL CreateStarter(TaskManager *taskManager) {
};
mapsec = MapHeader_GetMapSec(fsys->location->mapId); //sp14
env->appData = AllocFromHeapAtEnd(11, sizeof(struct ChooseStarterAppData));
env->appData->cursorPos = 0;
env->appData->options = Sav2_PlayerData_GetOptionsAddr(fsys->savedata);
env->args = AllocFromHeapAtEnd(11, sizeof(struct ChooseStarterAppArgs));
env->args->cursorPos = 0;
env->args->options = Sav2_PlayerData_GetOptionsAddr(fsys->savedata);
for (i = 0; i < (int)NELEMS(species); i++) {
POKEMON *pokemon = &env->appData->starters[i];
POKEMON *pokemon = &env->args->starters[i];
PLAYERPROFILE *profile = Sav2_PlayerData_GetProfileAddr(fsys->savedata);
ZeroMonData(pokemon);
CreateMon(pokemon, species[i], 5, 32, FALSE, 0, OT_ID_PLAYER_ID, 0);
@ -62,7 +62,7 @@ static BOOL CreateStarter(TaskManager *taskManager) {
}
}
}
FieldSys_LaunchChooseStarterApplication(fsys, env->appData);
LaunchChooseStarterApp(fsys, env->args);
sub_0203E30C();
env->state = 2;
break;
@ -75,7 +75,7 @@ static BOOL CreateStarter(TaskManager *taskManager) {
case 3: {
POKEDEX *pokedex = Sav2_Pokedex_get(fsys->savedata);
party = SavArray_PlayerParty_get(fsys->savedata);
POKEMON *myChoice = &env->appData->starters[env->appData->cursorPos];
POKEMON *myChoice = &env->args->starters[env->args->cursorPos];
if (AddMonToParty(party, myChoice)) {
UpdatePokedexWithReceivedSpecies(fsys->savedata, myChoice);
}
@ -95,7 +95,7 @@ static BOOL CreateStarter(TaskManager *taskManager) {
if (!IsPaletteFadeFinished()) {
break;
}
FreeToHeap(env->appData);
FreeToHeap(env->args);
FreeToHeap(env);
return TRUE;
}

View File

@ -247,7 +247,7 @@ static u16 calcBallTranslationArcStep(const fx32 *from, const fx32 *to, int step
BOOL ChooseStarterApplication_OvyInit(OVY_MANAGER *ovy, int *state_p) {
struct ChooseStarterAppWork *work;
struct ChooseStarterAppData *args;
struct ChooseStarterAppArgs *args;
int i;
CreateHeap(3, HEAPID_STARTERCHOOSE, 0x40000);
@ -535,12 +535,12 @@ BOOL ChooseStarterApplication_OvyExec(OVY_MANAGER *ovy, int *state) {
BOOL ChooseStarterApplication_OvyExit(OVY_MANAGER *ovy, int *state) {
struct ChooseStarterAppWork *work = OverlayManager_GetData(ovy);
struct ChooseStarterAppData *data = OverlayManager_GetArgs(ovy);
struct ChooseStarterAppArgs *args = OverlayManager_GetArgs(ovy);
TextFlags_SetCanABSpeedUpPrint(FALSE);
sub_02002B50(FALSE);
sub_02002B8C(FALSE);
data->cursorPos = work->curSelection;
args->cursorPos = work->curSelection;
Main_SetVBlankIntrCB(NULL, NULL);
DeleteCameraTranslationWrapper(work->cameraTranslation);
sub_02023120(work->camera);

View File

@ -4,7 +4,7 @@
#include "game_clear.h"
#include "hall_of_fame.h"
#include "overlay_63.h"
#include "overlay_76.h"
#include "overlay_credits.h"
#include "player_data.h"
#include "save_arrays.h"
#include "save_flypoints.h"
@ -31,8 +31,8 @@
typedef struct {
BOOL gameCleared;
HOFCongratsAppWork hofCongrats;
CreditsAppWork credits;
HOFCongratsAppArgs hofCongrats;
CreditsAppArgs credits;
BGCONFIG *bgConfig;
WINDOW window;
STRING *windowText;
@ -155,7 +155,7 @@ static BOOL Task_GameClearSave(TaskManager *taskman) {
switch (*state) {
case 0:
if (!env->vsTrainerRed) {
LaunchHOFCongratulationsApp(fsys, &env->hofCongrats);
LaunchHOFCongratsApp(fsys, &env->hofCongrats);
*state += 1;
break;
}