mirror of
https://github.com/pret/pokeplatinum.git
synced 2026-03-21 09:45:26 -05:00
Identify FrontierScriptManager struct (#1013)
This commit is contained in:
parent
0246641192
commit
7226459d15
109
include/overlay104/defs.h
Normal file
109
include/overlay104/defs.h
Normal file
|
|
@ -0,0 +1,109 @@
|
|||
#ifndef POKEPLATINUM_FRONTIER_DEFS_H
|
||||
#define POKEPLATINUM_FRONTIER_DEFS_H
|
||||
|
||||
#include "constants/heap.h"
|
||||
|
||||
#include "struct_decls/struct_0209B75C_decl.h"
|
||||
|
||||
#include "overlay104/struct_ov104_0222E8C8.h"
|
||||
|
||||
#include "bg_window.h"
|
||||
#include "list_menu.h"
|
||||
#include "menu.h"
|
||||
#include "message.h"
|
||||
#include "string_gf.h"
|
||||
#include "string_template.h"
|
||||
|
||||
#define FRONTIER_MENU_ENTRIES_MAX 28
|
||||
|
||||
typedef struct FrontierScriptManager FrontierScriptManager;
|
||||
typedef struct FrontierScriptContext FrontierScriptContext;
|
||||
|
||||
typedef BOOL (*FrontierScrCmdFunc)(FrontierScriptContext *);
|
||||
typedef BOOL (*FrontierShouldResumeScriptFunc)(FrontierScriptContext *);
|
||||
|
||||
struct FrontierScriptContext {
|
||||
FrontierScriptManager *scriptMan;
|
||||
u32 unk_04;
|
||||
u16 unk_08[8];
|
||||
u8 stackPointer;
|
||||
u8 state;
|
||||
const u8 *scriptPtr;
|
||||
const u8 *stack[20];
|
||||
const FrontierScrCmdFunc *cmdTable;
|
||||
u32 cmdTableSize;
|
||||
u16 data[4];
|
||||
MessageLoader *msgLoader;
|
||||
u8 *scripts;
|
||||
FrontierShouldResumeScriptFunc shouldResume;
|
||||
u8 comparisonResult;
|
||||
};
|
||||
|
||||
typedef struct FrontierMenuManager {
|
||||
FrontierScriptManager *scriptMan;
|
||||
SysTask *sysTask;
|
||||
Window window;
|
||||
Window *parent;
|
||||
String *choiceStringBuffers[FRONTIER_MENU_ENTRIES_MAX];
|
||||
MessageLoader *msgLoader;
|
||||
StringTemplate *strTemplate;
|
||||
u8 sysTaskDelay;
|
||||
u8 unused;
|
||||
u8 initialCursorPos;
|
||||
u8 canExitWithB : 1;
|
||||
u8 freeMsgLoaderOnDelete : 1;
|
||||
u8 unused2 : 4;
|
||||
u8 anchorRight : 1;
|
||||
u8 anchorBottom : 1;
|
||||
u8 anchorX;
|
||||
u8 anchorY;
|
||||
u8 unused3;
|
||||
u8 optionCount;
|
||||
u16 *unused4;
|
||||
u16 *selectedOptionPtr;
|
||||
MenuTemplate menuTemplate;
|
||||
Menu *menu;
|
||||
StringList menuChoiceStrings[FRONTIER_MENU_ENTRIES_MAX];
|
||||
ListMenuTemplate listMenuTemplate;
|
||||
ListMenu *listMenu;
|
||||
u16 unused5;
|
||||
u16 listMenuAltTextIndex;
|
||||
StringList listMenuChoiceStrings[FRONTIER_MENU_ENTRIES_MAX];
|
||||
u16 choicesAltTextEntryIDs[FRONTIER_MENU_ENTRIES_MAX];
|
||||
u16 cursorPos;
|
||||
} FrontierMenuManager;
|
||||
|
||||
struct FrontierScriptManager {
|
||||
UnkStruct_0209B75C *unk_00;
|
||||
FrontierScriptContext *ctx[8];
|
||||
UnkStruct_ov104_0222E8C8 unk_24;
|
||||
enum HeapID heapID;
|
||||
u8 unk_38;
|
||||
MessageLoader *msgLoader;
|
||||
u8 *script;
|
||||
StringTemplate *strTemplate;
|
||||
String *string;
|
||||
String *fmtString;
|
||||
u8 printerID;
|
||||
s8 numSetContexts;
|
||||
u16 scene;
|
||||
u8 unused[5];
|
||||
u8 unk_59;
|
||||
u8 isMsgBoxOpen;
|
||||
int unused2;
|
||||
FrontierMenuManager *menuMan;
|
||||
Window msgWindow;
|
||||
Menu *menu;
|
||||
u16 *unused3;
|
||||
void *savingIcon;
|
||||
int unused4[10];
|
||||
Window *unk_A8;
|
||||
Window *unk_AC;
|
||||
u16 unk_B0;
|
||||
u16 unk_B2;
|
||||
u16 unk_B4;
|
||||
u16 unk_B6;
|
||||
u16 *unk_B8;
|
||||
};
|
||||
|
||||
#endif // POKEPLATINUM_FRONTIER_DEFS_H
|
||||
|
|
@ -1,31 +1,7 @@
|
|||
#ifndef POKEPLATINUM_FRONTIER_SCRIPT_CONTEXT_H
|
||||
#define POKEPLATINUM_FRONTIER_SCRIPT_CONTEXT_H
|
||||
|
||||
#include "overlay104/struct_ov104_022320B4_decl.h"
|
||||
|
||||
#include "message.h"
|
||||
|
||||
typedef struct FrontierScriptContext FrontierScriptContext;
|
||||
|
||||
typedef BOOL (*FrontierScrCmdFunc)(FrontierScriptContext *);
|
||||
typedef BOOL (*FrontierShouldResumeScriptFunc)(FrontierScriptContext *);
|
||||
|
||||
struct FrontierScriptContext {
|
||||
UnkStruct_ov104_022320B4 *unk_00;
|
||||
u32 unk_04;
|
||||
u16 unk_08[8];
|
||||
u8 stackPointer;
|
||||
u8 state;
|
||||
const u8 *scriptPtr;
|
||||
const u8 *stack[20];
|
||||
const FrontierScrCmdFunc *cmdTable;
|
||||
u32 cmdTableSize;
|
||||
u16 data[4];
|
||||
MessageLoader *msgLoader;
|
||||
u8 *scripts;
|
||||
FrontierShouldResumeScriptFunc shouldResume;
|
||||
u8 comparisonResult;
|
||||
};
|
||||
#include "overlay104/defs.h"
|
||||
|
||||
#define FrontierScriptContext_ReadByte(ctx) (*(ctx->scriptPtr++))
|
||||
|
||||
|
|
|
|||
22
include/overlay104/frontier_script_manager.h
Normal file
22
include/overlay104/frontier_script_manager.h
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#ifndef POKEPLATINUM_FRONTIER_SCRIPT_MANAGER_H
|
||||
#define POKEPLATINUM_FRONTIER_SCRIPT_MANAGER_H
|
||||
|
||||
#include "constants/heap.h"
|
||||
|
||||
#include "struct_decls/struct_0209B75C_decl.h"
|
||||
|
||||
#include "overlay104/defs.h"
|
||||
#include "overlay104/struct_ov104_0222E8C8.h"
|
||||
#include "overlay104/struct_ov104_0223C4CC_decl.h"
|
||||
|
||||
FrontierScriptManager *FrontierScriptManager_New(UnkStruct_0209B75C *param0, enum HeapID heapID, int scene);
|
||||
BOOL ov104_0222E6A8(FrontierScriptManager *scriptMan);
|
||||
void FrontierScriptManager_Free(FrontierScriptManager *scriptMan);
|
||||
void FrontierScriptManager_Load(FrontierScriptManager *scriptMan, int scene, int offsetID);
|
||||
void FrontierScriptManager_UpdateMessageLoader(FrontierScriptManager *scriptMan, int scene, enum HeapID heapID);
|
||||
UnkStruct_ov104_0222E8C8 *ov104_0222E8C8(FrontierScriptManager *param0, enum HeapID heapID);
|
||||
void ov104_0222E8E8(FrontierScriptManager *param0, UnkStruct_ov104_0222E8C8 *param1);
|
||||
u16 *ov104_0222E91C(FrontierScriptManager *param0, int param1);
|
||||
UnkStruct_ov104_0223C4CC *ov104_0222E924(FrontierScriptManager *param0);
|
||||
|
||||
#endif // POKEPLATINUM_FRONTIER_SCRIPT_MANAGER_H
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef POKEPLATINUM_FRSCRCMD_H
|
||||
#define POKEPLATINUM_FRSCRCMD_H
|
||||
|
||||
#include "overlay104/frontier_script_context.h"
|
||||
#include "overlay104/defs.h"
|
||||
|
||||
extern const FrontierScrCmdFunc gFrontierScrCmdFuncs[];
|
||||
extern const u32 gFrontierScrCmdFuncsCount;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef POKEPLATINUM_FRSCRCMD_SOUND_H
|
||||
#define POKEPLATINUM_FRSCRCMD_SOUND_H
|
||||
|
||||
#include "overlay104/frontier_script_context.h"
|
||||
#include "overlay104/defs.h"
|
||||
|
||||
BOOL FrontierScrCmd_PlaySoundEffect(FrontierScriptContext *ctx);
|
||||
BOOL FrontierScrCmd_StopSoundEffect(FrontierScriptContext *ctx);
|
||||
|
|
|
|||
|
|
@ -1,22 +0,0 @@
|
|||
#ifndef POKEPLATINUM_OV104_0222E63C_H
|
||||
#define POKEPLATINUM_OV104_0222E63C_H
|
||||
|
||||
#include "constants/heap.h"
|
||||
|
||||
#include "struct_decls/struct_0209B75C_decl.h"
|
||||
|
||||
#include "overlay104/struct_ov104_0222E8C8.h"
|
||||
#include "overlay104/struct_ov104_022320B4_decl.h"
|
||||
#include "overlay104/struct_ov104_0223C4CC_decl.h"
|
||||
|
||||
UnkStruct_ov104_022320B4 *ov104_0222E63C(UnkStruct_0209B75C *param0, enum HeapID heapID, int param2);
|
||||
BOOL ov104_0222E6A8(UnkStruct_ov104_022320B4 *param0);
|
||||
void ov104_0222E710(UnkStruct_ov104_022320B4 *param0);
|
||||
void ov104_0222E748(UnkStruct_ov104_022320B4 *param0, int param1, int param2);
|
||||
void ov104_0222E86C(UnkStruct_ov104_022320B4 *param0, int param1, enum HeapID heapID);
|
||||
UnkStruct_ov104_0222E8C8 *ov104_0222E8C8(UnkStruct_ov104_022320B4 *param0, enum HeapID heapID);
|
||||
void ov104_0222E8E8(UnkStruct_ov104_022320B4 *param0, UnkStruct_ov104_0222E8C8 *param1);
|
||||
u16 *ov104_0222E91C(UnkStruct_ov104_022320B4 *param0, int param1);
|
||||
UnkStruct_ov104_0223C4CC *ov104_0222E924(UnkStruct_ov104_022320B4 *param0);
|
||||
|
||||
#endif // POKEPLATINUM_OV104_0222E63C_H
|
||||
|
|
@ -5,62 +5,22 @@
|
|||
|
||||
#include "overlay063/struct_ov63_0222BEC0_decl.h"
|
||||
#include "overlay063/struct_ov63_0222CCB8.h"
|
||||
#include "overlay104/frontier_script_context.h"
|
||||
#include "overlay104/defs.h"
|
||||
#include "overlay104/struct_ov104_0222FEDC.h"
|
||||
#include "overlay104/struct_ov104_022320B4_decl.h"
|
||||
#include "overlay104/struct_ov104_0223C4CC_decl.h"
|
||||
|
||||
#include "bg_window.h"
|
||||
#include "list_menu.h"
|
||||
#include "menu.h"
|
||||
#include "message.h"
|
||||
#include "sprite.h"
|
||||
#include "string_template.h"
|
||||
#include "sys_task_manager.h"
|
||||
|
||||
#define FRONTIER_MENU_ENTRIES_MAX 28
|
||||
|
||||
typedef struct FrontierMenuManager {
|
||||
UnkStruct_ov104_022320B4 *unk_00;
|
||||
SysTask *sysTask;
|
||||
Window window;
|
||||
Window *parent;
|
||||
String *choiceStringBuffers[FRONTIER_MENU_ENTRIES_MAX];
|
||||
MessageLoader *msgLoader;
|
||||
StringTemplate *strTemplate;
|
||||
u8 sysTaskDelay;
|
||||
u8 unused;
|
||||
u8 initialCursorPos;
|
||||
u8 canExitWithB : 1;
|
||||
u8 freeMsgLoaderOnDelete : 1;
|
||||
u8 unused2 : 4;
|
||||
u8 anchorRight : 1;
|
||||
u8 anchorBottom : 1;
|
||||
u8 anchorX;
|
||||
u8 anchorY;
|
||||
u8 unused3;
|
||||
u8 optionCount;
|
||||
u16 *unused4;
|
||||
u16 *selectedOptionPtr;
|
||||
MenuTemplate menuTemplate;
|
||||
Menu *menu;
|
||||
StringList menuChoiceStrings[FRONTIER_MENU_ENTRIES_MAX];
|
||||
ListMenuTemplate listMenuTemplate;
|
||||
ListMenu *listMenu;
|
||||
u16 unused5;
|
||||
u16 listMenuAltTextIndex;
|
||||
StringList listMenuChoiceStrings[FRONTIER_MENU_ENTRIES_MAX];
|
||||
u16 choicesAltTextEntryIDs[FRONTIER_MENU_ENTRIES_MAX];
|
||||
u16 cursorPos;
|
||||
} FrontierMenuManager;
|
||||
|
||||
void FrontierShowMessage(UnkStruct_ov104_022320B4 *param0, const MessageLoader *msgLoader, u16 messageID, u8 canSpeedUp, FrontierMessageOptions *msgOptions);
|
||||
void Frontier_CloseMessage(UnkStruct_ov104_022320B4 *param0);
|
||||
FrontierMenuManager *FrontierMenuManager_New(UnkStruct_ov104_022320B4 *param0, u8 anchorX, u8 anchorY, u8 initialCursorPos, u8 CanExitWithB, u16 *selectedOptionPtr, StringTemplate *strTemplate, MessageLoader *msgLoader);
|
||||
void FrontierShowMessage(FrontierScriptManager *scriptMan, const MessageLoader *msgLoader, u16 messageID, u8 canSpeedUp, FrontierMessageOptions *msgOptions);
|
||||
void Frontier_CloseMessage(FrontierScriptManager *scriptMan);
|
||||
FrontierMenuManager *FrontierMenuManager_New(FrontierScriptManager *scriptMan, u8 anchorX, u8 anchorY, u8 initalCursorPos, u8 canExitWithB, u16 *selectedOptionPtr, StringTemplate *strTemplate, MessageLoader *msgLoader);
|
||||
void FrontierMenuManager_AddMenuEntry(FrontierMenuManager *menuManager, u32 entryID, u32 altTextEntryID, u32 index);
|
||||
void FrontierMenuManager_ShowMenu(FrontierMenuManager *menuManager);
|
||||
FrontierMenuManager *FrontierMenuManager_New2(UnkStruct_ov104_022320B4 *param0, u8 anchorX, u8 anchorY, u8 initialCursorPos, u8 CanExitWithB, u16 *selectedOptionPtr, StringTemplate *strTemplate, MessageLoader *msgLoader);
|
||||
void FrontierMenuManager_AddListMenuEntry(FrontierMenuManager *menuManager, u32 entryID, u32 altTextEntryID, u32 index);
|
||||
FrontierMenuManager *FrontierMenuManager_New2(FrontierScriptManager *scriptMan, u8 anchorX, u8 anchorY, u8 initialCursorPos, u8 canExitWithB, u16 *selectedOptionPtr, StringTemplate *strTemplate, MessageLoader *msgLoader);
|
||||
void FrontierMenuManager_AddListMenuEntry(FrontierMenuManager *menuManager, u32 entry, u32 altTextEntryID, u32 index);
|
||||
void FrontierMenuManager_ShowListMenu(FrontierMenuManager *menuManager);
|
||||
void FrontierMenuManager_FreeListMenu(FrontierMenuManager *menuManager);
|
||||
void ov104_02232B78(SysTask *param0, void *param1);
|
||||
|
|
@ -75,8 +35,8 @@ void ov104_02232FEC(UnkStruct_ov104_0223C4CC *param0);
|
|||
void ov104_0223307C(UnkStruct_ov104_0223C4CC *param0);
|
||||
ManagedSprite *ov104_022330AC(UnkStruct_ov104_0223C4CC *param0, int param1, int param2);
|
||||
void ov104_022330F0(UnkStruct_ov104_0223C4CC *param0, ManagedSprite *param1);
|
||||
void ov104_022330FC(FrontierScriptContext *param0, u16 *param1);
|
||||
void ov104_0223310C(FrontierScriptContext *param0, u16 *param1, u32 param2);
|
||||
void ov104_022330FC(FrontierScriptContext *ctx, u16 *args);
|
||||
void ov104_0223310C(FrontierScriptContext *ctx, u16 *args, u32 bankID);
|
||||
void ov104_0223319C(SysTask *param0, void *param1);
|
||||
void ov104_022331E8(SysTask *param0, void *param1);
|
||||
void FrontierMenuManager_SetHorizontalAnchor(FrontierMenuManager *menuManager, BOOL anchorRight);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef POKEPLATINUM_OV104_022332B4_H
|
||||
#define POKEPLATINUM_OV104_022332B4_H
|
||||
|
||||
#include "overlay104/frontier_script_context.h"
|
||||
#include "overlay104/defs.h"
|
||||
|
||||
BOOL FrontierScrCmd_5C(FrontierScriptContext *param0);
|
||||
BOOL FrontierScrCmd_5D(FrontierScriptContext *param0);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef POKEPLATINUM_OV104_02234838_H
|
||||
#define POKEPLATINUM_OV104_02234838_H
|
||||
|
||||
#include "overlay104/frontier_script_context.h"
|
||||
#include "overlay104/defs.h"
|
||||
|
||||
BOOL FrontierScrCmd_8B(FrontierScriptContext *param0);
|
||||
BOOL FrontierScrCmd_8C(FrontierScriptContext *param0);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef POKEPLATINUM_OV104_022358E8_H
|
||||
#define POKEPLATINUM_OV104_022358E8_H
|
||||
|
||||
#include "overlay104/frontier_script_context.h"
|
||||
#include "overlay104/defs.h"
|
||||
|
||||
BOOL FrontierScrCmd_97(FrontierScriptContext *param0);
|
||||
BOOL FrontierScrCmd_98(FrontierScriptContext *param0);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef POKEPLATINUM_OV104_022361B4_H
|
||||
#define POKEPLATINUM_OV104_022361B4_H
|
||||
|
||||
#include "overlay104/struct_ov104_022320B4_decl.h"
|
||||
#include "overlay104/defs.h"
|
||||
#include "overlay104/struct_ov104_0223BA10.h"
|
||||
|
||||
#include "savedata.h"
|
||||
|
|
@ -23,9 +23,9 @@ void ov104_02236C50(UnkStruct_ov104_0223BA10 *param0);
|
|||
int ov104_02236D10(UnkStruct_ov104_0223BA10 *param0);
|
||||
void ov104_02236ED8(SaveData *saveData, u8 param1, int param2);
|
||||
BOOL ov104_02236F70(UnkStruct_ov104_0223BA10 *param0, u16 param1, u16 param2);
|
||||
void ov104_02236FC0(UnkStruct_ov104_022320B4 *param0, UnkStruct_ov104_0223BA10 *param1);
|
||||
void ov104_022370E0(UnkStruct_ov104_022320B4 *param0, UnkStruct_ov104_0223BA10 *param1);
|
||||
void ov104_02237180(UnkStruct_ov104_022320B4 *param0, UnkStruct_ov104_0223BA10 *param1);
|
||||
void ov104_02236FC0(FrontierScriptManager *param0, UnkStruct_ov104_0223BA10 *param1);
|
||||
void ov104_022370E0(FrontierScriptManager *param0, UnkStruct_ov104_0223BA10 *param1);
|
||||
void ov104_02237180(FrontierScriptManager *param0, UnkStruct_ov104_0223BA10 *param1);
|
||||
u16 ov104_02237338(UnkStruct_ov104_0223BA10 *param0);
|
||||
|
||||
#endif // POKEPLATINUM_OV104_022361B4_H
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef POKEPLATINUM_OV104_02237378_H
|
||||
#define POKEPLATINUM_OV104_02237378_H
|
||||
|
||||
#include "overlay104/frontier_script_context.h"
|
||||
#include "overlay104/defs.h"
|
||||
|
||||
BOOL FrontierScrCmd_B8(FrontierScriptContext *param0);
|
||||
BOOL FrontierScrCmd_B9(FrontierScriptContext *param0);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef POKEPLATINUM_OV104_02239130_H
|
||||
#define POKEPLATINUM_OV104_02239130_H
|
||||
|
||||
#include "overlay104/frontier_script_context.h"
|
||||
#include "overlay104/defs.h"
|
||||
|
||||
BOOL FrontierScrCmd_CallBattleTowerFunction(FrontierScriptContext *ctx);
|
||||
BOOL FrontierScrCmd_85(FrontierScriptContext *param0);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef POKEPLATINUM_OV104_022395F0_H
|
||||
#define POKEPLATINUM_OV104_022395F0_H
|
||||
|
||||
#include "overlay104/frontier_script_context.h"
|
||||
#include "overlay104/defs.h"
|
||||
|
||||
BOOL FrontierScrCmd_AA(FrontierScriptContext *param0);
|
||||
BOOL FrontierScrCmd_AB(FrontierScriptContext *param0);
|
||||
|
|
|
|||
|
|
@ -1,6 +0,0 @@
|
|||
#ifndef POKEPLATINUM_STRUCT_OV104_022320B4_DECL_H
|
||||
#define POKEPLATINUM_STRUCT_OV104_022320B4_DECL_H
|
||||
|
||||
typedef struct UnkStruct_ov104_022320B4_t UnkStruct_ov104_022320B4;
|
||||
|
||||
#endif // POKEPLATINUM_STRUCT_OV104_022320B4_DECL_H
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
#ifndef POKEPLATINUM_STRUCT_OV104_022320B4_T_H
|
||||
#define POKEPLATINUM_STRUCT_OV104_022320B4_T_H
|
||||
|
||||
#include "struct_decls/struct_0209B75C_decl.h"
|
||||
|
||||
#include "overlay104/frontier_script_context.h"
|
||||
#include "overlay104/ov104_02231F74.h"
|
||||
#include "overlay104/struct_ov104_0222E8C8.h"
|
||||
|
||||
#include "bg_window.h"
|
||||
#include "menu.h"
|
||||
#include "message.h"
|
||||
#include "string_gf.h"
|
||||
#include "string_template.h"
|
||||
|
||||
struct UnkStruct_ov104_022320B4_t {
|
||||
UnkStruct_0209B75C *unk_00;
|
||||
FrontierScriptContext *unk_04[8];
|
||||
UnkStruct_ov104_0222E8C8 unk_24;
|
||||
enum HeapID heapID;
|
||||
u8 unk_38;
|
||||
MessageLoader *unk_3C;
|
||||
u8 *unk_40;
|
||||
StringTemplate *strTemplate;
|
||||
String *string;
|
||||
String *fmtString;
|
||||
u8 printerID;
|
||||
s8 unk_51;
|
||||
u16 unk_52;
|
||||
int unk_54;
|
||||
u8 unk_58;
|
||||
u8 unk_59;
|
||||
u8 isMsgBoxOpen;
|
||||
BOOL unk_5C;
|
||||
FrontierMenuManager *unk_60;
|
||||
Window msgWindow;
|
||||
Menu *menu;
|
||||
u16 *unk_78;
|
||||
void *savingIcon;
|
||||
void *unk_80;
|
||||
void *unk_84;
|
||||
Window unk_88;
|
||||
Window unk_98;
|
||||
Window *unk_A8;
|
||||
Window *unk_AC;
|
||||
u16 unk_B0;
|
||||
u16 unk_B2;
|
||||
u16 unk_B4;
|
||||
u16 unk_B6;
|
||||
u16 *unk_B8;
|
||||
};
|
||||
|
||||
#endif // POKEPLATINUM_STRUCT_OV104_022320B4_T_H
|
||||
|
|
@ -1535,7 +1535,7 @@ Overlay overlay104
|
|||
{
|
||||
After overlay63
|
||||
Object main.nef.p/src_overlay104_ov104_0222DCE0.c.o
|
||||
Object main.nef.p/src_overlay104_ov104_0222E63C.c.o
|
||||
Object main.nef.p/src_overlay104_frontier_script_manager.c.o
|
||||
Object main.nef.p/src_overlay104_frontier_script_context.c.o
|
||||
Object main.nef.p/src_overlay104_ov104_0222EA90.c.o
|
||||
Object main.nef.p/src_overlay104_ov104_0222ECE8.c.o
|
||||
|
|
|
|||
|
|
@ -919,7 +919,7 @@ pokeplatinum_c = files(
|
|||
'overlay101/ov101_021D94D8.c',
|
||||
'applications/diploma.c',
|
||||
'overlay104/ov104_0222DCE0.c',
|
||||
'overlay104/ov104_0222E63C.c',
|
||||
'overlay104/frontier_script_manager.c',
|
||||
'overlay104/frontier_script_context.c',
|
||||
'overlay104/ov104_0222EA90.c',
|
||||
'overlay104/ov104_0222ECE8.c',
|
||||
|
|
|
|||
200
src/overlay104/frontier_script_manager.c
Normal file
200
src/overlay104/frontier_script_manager.c
Normal file
|
|
@ -0,0 +1,200 @@
|
|||
#include "overlay104/frontier_script_manager.h"
|
||||
|
||||
#include <nitro.h>
|
||||
|
||||
#include "struct_decls/struct_0209B75C_decl.h"
|
||||
|
||||
#include "overlay104/defs.h"
|
||||
#include "overlay104/frontier_script_context.h"
|
||||
#include "overlay104/frscrcmd.h"
|
||||
#include "overlay104/ov104_0222EA90.h"
|
||||
#include "overlay104/ov104_0223D860.h"
|
||||
#include "overlay104/struct_ov104_0222E8C8.h"
|
||||
#include "overlay104/struct_ov104_0223C4CC.h"
|
||||
|
||||
#include "heap.h"
|
||||
#include "message.h"
|
||||
#include "narc.h"
|
||||
#include "string_gf.h"
|
||||
#include "string_template.h"
|
||||
#include "unk_0209B6F8.h"
|
||||
|
||||
static BOOL FrontierScriptManager_SetContext(FrontierScriptManager *scriptMan, FrontierScriptContext *ctx);
|
||||
static void FrontierScriptContext_Free(FrontierScriptManager *scriptMan, FrontierScriptContext *ctx);
|
||||
static void Dummy(FrontierScriptManager *scriptMan, u16 scene, u32 *null1, void *null2);
|
||||
static void FrontierScriptManager_LoadScriptData(u8 **script, MessageLoader **msgLoader, int scene, enum HeapID heapID);
|
||||
static void FrontierScriptContext_JumpToOffsetID(FrontierScriptContext *ctx, int offsetID);
|
||||
|
||||
FrontierScriptManager *FrontierScriptManager_New(UnkStruct_0209B75C *param0, enum HeapID heapID, int scene)
|
||||
{
|
||||
FrontierScriptManager *scriptMan = Heap_Alloc(heapID, sizeof(FrontierScriptManager));
|
||||
MI_CpuClear8(scriptMan, sizeof(FrontierScriptManager));
|
||||
|
||||
scriptMan->unk_00 = param0;
|
||||
scriptMan->heapID = heapID;
|
||||
scriptMan->scene = scene;
|
||||
|
||||
FrontierScriptManager_LoadScriptData(&scriptMan->script, &scriptMan->msgLoader, scene, heapID);
|
||||
|
||||
scriptMan->strTemplate = StringTemplate_New(8, 64, heapID);
|
||||
scriptMan->string = String_Init(1024, heapID);
|
||||
scriptMan->fmtString = String_Init(1024, heapID);
|
||||
|
||||
Dummy(scriptMan, scene, NULL, NULL);
|
||||
|
||||
return scriptMan;
|
||||
}
|
||||
|
||||
BOOL ov104_0222E6A8(FrontierScriptManager *scriptMan)
|
||||
{
|
||||
if (scriptMan->numSetContexts == 0) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (scriptMan->unk_38 == 0) {
|
||||
for (int i = 0; i < (int)NELEMS(scriptMan->ctx); i++) {
|
||||
FrontierScriptContext *ctx = scriptMan->ctx[i];
|
||||
|
||||
if (ctx != NULL) {
|
||||
if (FrontierScriptContext_Run(ctx) == 0) {
|
||||
FrontierScriptContext_Free(scriptMan, ctx);
|
||||
scriptMan->ctx[i] = NULL;
|
||||
scriptMan->numSetContexts--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ov104_0223D8C4(scriptMan->unk_00);
|
||||
}
|
||||
|
||||
return scriptMan->numSetContexts == 0;
|
||||
}
|
||||
|
||||
void FrontierScriptManager_Free(FrontierScriptManager *scriptMan)
|
||||
{
|
||||
GF_ASSERT(scriptMan->numSetContexts == 0);
|
||||
|
||||
StringTemplate_Free(scriptMan->strTemplate);
|
||||
String_Free(scriptMan->string);
|
||||
String_Free(scriptMan->fmtString);
|
||||
Heap_Free(scriptMan->script);
|
||||
MessageLoader_Free(scriptMan->msgLoader);
|
||||
|
||||
Heap_Free(scriptMan);
|
||||
}
|
||||
|
||||
void FrontierScriptManager_Load(FrontierScriptManager *scriptMan, int scene, int offsetID)
|
||||
{
|
||||
FrontierScriptContext *ctx = Heap_Alloc(scriptMan->heapID, sizeof(FrontierScriptContext));
|
||||
MI_CpuClear8(ctx, sizeof(FrontierScriptContext));
|
||||
|
||||
FrontierScriptContext_Init(ctx, gFrontierScrCmdFuncs, gFrontierScrCmdFuncsCount);
|
||||
|
||||
ctx->scriptMan = scriptMan;
|
||||
|
||||
if (scene == 0xffff || scriptMan->scene == scene) {
|
||||
ctx->scripts = scriptMan->script;
|
||||
ctx->msgLoader = scriptMan->msgLoader;
|
||||
} else {
|
||||
FrontierScriptManager_LoadScriptData(&ctx->scripts, &ctx->msgLoader, scene, scriptMan->heapID);
|
||||
}
|
||||
|
||||
FrontierScriptContext_Start(ctx, ctx->scripts);
|
||||
FrontierScriptContext_JumpToOffsetID(ctx, offsetID);
|
||||
FrontierScriptManager_SetContext(scriptMan, ctx);
|
||||
}
|
||||
|
||||
static BOOL FrontierScriptManager_SetContext(FrontierScriptManager *scriptMan, FrontierScriptContext *ctx)
|
||||
{
|
||||
for (int i = 0; i < (int)NELEMS(scriptMan->ctx); i++) {
|
||||
if (scriptMan->ctx[i] == NULL) {
|
||||
scriptMan->ctx[i] = ctx;
|
||||
scriptMan->numSetContexts++;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
GF_ASSERT(FALSE);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void FrontierScriptContext_Free(FrontierScriptManager *scriptMan, FrontierScriptContext *ctx)
|
||||
{
|
||||
if (ctx->msgLoader != scriptMan->msgLoader) {
|
||||
MessageLoader_Free(ctx->msgLoader);
|
||||
}
|
||||
|
||||
if (ctx->scripts != scriptMan->script) {
|
||||
Heap_Free(ctx->scripts);
|
||||
}
|
||||
|
||||
Heap_Free(ctx);
|
||||
}
|
||||
|
||||
static void Dummy(FrontierScriptManager *scriptMan, u16 scene, u32 *null1, void *null2)
|
||||
{
|
||||
}
|
||||
|
||||
static void FrontierScriptManager_LoadScriptData(u8 **script, MessageLoader **msgLoader, int scene, enum HeapID heapID)
|
||||
{
|
||||
int scriptID = GetFrontierSceneValue(scene, FR_SCENE_SCRIPT_ID);
|
||||
int bankID = GetFrontierSceneValue(scene, FR_SCENE_BANK_ID);
|
||||
|
||||
*script = NARC_AllocAndReadWholeMemberByIndexPair(NARC_INDEX_FRONTIER__SCRIPT__FR_SCRIPT, scriptID, heapID);
|
||||
*msgLoader = MessageLoader_Init(MSG_LOADER_LOAD_ON_DEMAND, NARC_INDEX_MSGDATA__PL_MSG, bankID, heapID);
|
||||
}
|
||||
|
||||
void FrontierScriptManager_UpdateMessageLoader(FrontierScriptManager *scriptMan, int scene, enum HeapID heapID)
|
||||
{
|
||||
int currentBankID = GetFrontierSceneValue(scriptMan->scene, FR_SCENE_BANK_ID);
|
||||
int newBankID = GetFrontierSceneValue(scene, FR_SCENE_BANK_ID);
|
||||
|
||||
if (currentBankID == newBankID) {
|
||||
return;
|
||||
}
|
||||
|
||||
MessageLoader *msgLoader = MessageLoader_Init(MSG_LOADER_LOAD_ON_DEMAND, NARC_INDEX_MSGDATA__PL_MSG, newBankID, heapID);
|
||||
|
||||
for (int i = 0; i < (int)NELEMS(scriptMan->ctx); i++) {
|
||||
FrontierScriptContext *ctx = scriptMan->ctx[i];
|
||||
|
||||
if (ctx != NULL) {
|
||||
if (ctx->msgLoader == scriptMan->msgLoader) {
|
||||
ctx->msgLoader = msgLoader;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MessageLoader_Free(scriptMan->msgLoader);
|
||||
scriptMan->msgLoader = msgLoader;
|
||||
}
|
||||
|
||||
UnkStruct_ov104_0222E8C8 *ov104_0222E8C8(FrontierScriptManager *param0, enum HeapID heapID)
|
||||
{
|
||||
UnkStruct_ov104_0222E8C8 *v0 = Heap_Alloc(heapID, sizeof(UnkStruct_ov104_0222E8C8));
|
||||
*v0 = param0->unk_24;
|
||||
|
||||
return v0;
|
||||
}
|
||||
|
||||
void ov104_0222E8E8(FrontierScriptManager *param0, UnkStruct_ov104_0222E8C8 *param1)
|
||||
{
|
||||
param0->unk_24 = *param1;
|
||||
Heap_Free(param1);
|
||||
}
|
||||
|
||||
static void FrontierScriptContext_JumpToOffsetID(FrontierScriptContext *ctx, int offsetID)
|
||||
{
|
||||
ctx->scriptPtr += offsetID * 4;
|
||||
ctx->scriptPtr += FrontierScriptContext_ReadWord(ctx);
|
||||
}
|
||||
|
||||
u16 *ov104_0222E91C(FrontierScriptManager *param0, int param1)
|
||||
{
|
||||
return ¶m0->unk_24.unk_00[param1];
|
||||
}
|
||||
|
||||
UnkStruct_ov104_0223C4CC *ov104_0222E924(FrontierScriptManager *param0)
|
||||
{
|
||||
return sub_0209B974(param0->unk_00);
|
||||
}
|
||||
|
|
@ -1,10 +1,8 @@
|
|||
#include "overlay104/frscrcmd.h"
|
||||
|
||||
#include <nitro.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "constants/field_base_tiles.h"
|
||||
#include "constants/scrcmd.h"
|
||||
#include "generated/game_records.h"
|
||||
#include "generated/genders.h"
|
||||
#include "generated/object_events_gfx.h"
|
||||
|
|
@ -21,10 +19,11 @@
|
|||
#include "overlay063/struct_ov63_0222BEC0_decl.h"
|
||||
#include "overlay063/struct_ov63_0222CE44.h"
|
||||
#include "overlay063/struct_ov63_0222D77C_decl.h"
|
||||
#include "overlay104/defs.h"
|
||||
#include "overlay104/frontier_script_context.h"
|
||||
#include "overlay104/frontier_script_manager.h"
|
||||
#include "overlay104/frscrcmd_sound.h"
|
||||
#include "overlay104/ov104_0222DCE0.h"
|
||||
#include "overlay104/ov104_0222E63C.h"
|
||||
#include "overlay104/ov104_02231F74.h"
|
||||
#include "overlay104/ov104_022332B4.h"
|
||||
#include "overlay104/ov104_02234838.h"
|
||||
|
|
@ -39,8 +38,6 @@
|
|||
#include "overlay104/ov104_0223E894.h"
|
||||
#include "overlay104/struct_ov104_0222FEDC.h"
|
||||
#include "overlay104/struct_ov104_02230BE4.h"
|
||||
#include "overlay104/struct_ov104_022320B4_decl.h"
|
||||
#include "overlay104/struct_ov104_022320B4_t.h"
|
||||
#include "overlay104/struct_ov104_02232B78.h"
|
||||
#include "overlay104/struct_ov104_02232B78_sub1.h"
|
||||
#include "overlay104/struct_ov104_0223319C.h"
|
||||
|
|
@ -533,7 +530,7 @@ u16 *FrontierScriptContext_GetVarPointer(FrontierScriptContext *ctx, u16 varID)
|
|||
} else if (varID < ((SCRIPT_LOCAL_VARS_START + 7) + 1)) {
|
||||
return &ctx->unk_08[varID - SCRIPT_LOCAL_VARS_START];
|
||||
} else if (varID < ((((SCRIPT_LOCAL_VARS_START + 7) + 1) + 7) + 1)) {
|
||||
return ov104_0222E91C(ctx->unk_00, varID - ((SCRIPT_LOCAL_VARS_START + 7) + 1));
|
||||
return ov104_0222E91C(ctx->scriptMan, varID - ((SCRIPT_LOCAL_VARS_START + 7) + 1));
|
||||
} else if (varID < ((((((SCRIPT_LOCAL_VARS_START + 7) + 1) + 7) + 1) + 3) + 1)) {
|
||||
return &ctx->data[varID - ((((SCRIPT_LOCAL_VARS_START + 7) + 1) + 7) + 1)];
|
||||
} else if (varID == 0xFD13) {
|
||||
|
|
@ -573,14 +570,14 @@ static BOOL FrontierScrCmd_End(FrontierScriptContext *ctx)
|
|||
static BOOL FrontierScrCmd_02(FrontierScriptContext *ctx)
|
||||
{
|
||||
FrontierScriptContext_Stop(ctx);
|
||||
sub_0209B9B4(ctx->unk_00->unk_00);
|
||||
sub_0209B9B4(ctx->scriptMan->unk_00);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static BOOL FrontierScrCmd_03(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_022320B4 *v0 = ctx->unk_00;
|
||||
FrontierScriptManager *v0 = ctx->scriptMan;
|
||||
u16 v1 = FrontierScriptContext_GetVar(ctx);
|
||||
|
||||
sub_0209B9BC(v0->unk_00, v1, 0xFFFF);
|
||||
|
|
@ -596,7 +593,7 @@ static BOOL Resume(FrontierScriptContext *ctx)
|
|||
|
||||
static BOOL FrontierScrCmd_04(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_022320B4 *v0 = ctx->unk_00;
|
||||
FrontierScriptManager *v0 = ctx->scriptMan;
|
||||
u16 v1 = FrontierScriptContext_GetVar(ctx);
|
||||
u16 v2 = FrontierScriptContext_GetVar(ctx);
|
||||
|
||||
|
|
@ -736,7 +733,7 @@ static BOOL FrontierScrCmd_MessageInstant(FrontierScriptContext *ctx)
|
|||
printParams.font = FONT_MESSAGE;
|
||||
printParams.unused = 0;
|
||||
|
||||
FrontierShowMessage(ctx->unk_00, ctx->msgLoader, messageID, FALSE, &printParams);
|
||||
FrontierShowMessage(ctx->scriptMan, ctx->msgLoader, messageID, FALSE, &printParams);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -745,7 +742,7 @@ static BOOL FrontierScrCmd_MessageNoSkip(FrontierScriptContext *ctx)
|
|||
{
|
||||
u16 messageID = FrontierScriptContext_ReadHalfWord(ctx);
|
||||
|
||||
FrontierShowMessage(ctx->unk_00, ctx->msgLoader, messageID, FALSE, NULL);
|
||||
FrontierShowMessage(ctx->scriptMan, ctx->msgLoader, messageID, FALSE, NULL);
|
||||
FrontierScriptContext_Pause(ctx, WaitForPrinter);
|
||||
return TRUE;
|
||||
}
|
||||
|
|
@ -754,19 +751,19 @@ static BOOL FrontierScrCmd_Message(FrontierScriptContext *ctx)
|
|||
{
|
||||
u16 messageID = FrontierScriptContext_ReadHalfWord(ctx);
|
||||
|
||||
FrontierShowMessage(ctx->unk_00, ctx->msgLoader, messageID, TRUE, NULL);
|
||||
FrontierShowMessage(ctx->scriptMan, ctx->msgLoader, messageID, TRUE, NULL);
|
||||
FrontierScriptContext_Pause(ctx, WaitForPrinter);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL WaitForPrinter(FrontierScriptContext *ctx)
|
||||
{
|
||||
return !Text_IsPrinterActive(ctx->unk_00->printerID);
|
||||
return !Text_IsPrinterActive(ctx->scriptMan->printerID);
|
||||
}
|
||||
|
||||
static BOOL FrontierScrCmd_CloseMessage(FrontierScriptContext *ctx)
|
||||
{
|
||||
Frontier_CloseMessage(ctx->unk_00);
|
||||
Frontier_CloseMessage(ctx->scriptMan);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -796,14 +793,14 @@ static BOOL ScreenWipeDone(FrontierScriptContext *ctx)
|
|||
|
||||
static BOOL FrontierScrCmd_InitGlobalTextMenu(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_022320B4 *v0 = ctx->unk_00;
|
||||
FrontierScriptManager *scriptMan = ctx->scriptMan;
|
||||
u8 anchorX = FrontierScriptContext_ReadByte(ctx);
|
||||
u8 anchorY = FrontierScriptContext_ReadByte(ctx);
|
||||
u8 initialCursorPos = FrontierScriptContext_ReadByte(ctx);
|
||||
u8 canExitWithB = FrontierScriptContext_ReadByte(ctx);
|
||||
u16 selectedOptionVar = FrontierScriptContext_ReadHalfWord(ctx);
|
||||
|
||||
v0->unk_60 = FrontierMenuManager_New(v0, anchorX, anchorY, initialCursorPos, canExitWithB, FrontierScriptContext_GetVarPointer(ctx, selectedOptionVar), v0->strTemplate, NULL);
|
||||
scriptMan->menuMan = FrontierMenuManager_New(scriptMan, anchorX, anchorY, initialCursorPos, canExitWithB, FrontierScriptContext_GetVarPointer(ctx, selectedOptionVar), scriptMan->strTemplate, NULL);
|
||||
ctx->data[0] = selectedOptionVar;
|
||||
|
||||
return TRUE;
|
||||
|
|
@ -811,14 +808,14 @@ static BOOL FrontierScrCmd_InitGlobalTextMenu(FrontierScriptContext *ctx)
|
|||
|
||||
static BOOL FrontierScrCmd_InitLocalTextMenu(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_022320B4 *v0 = ctx->unk_00;
|
||||
FrontierScriptManager *scriptMan = ctx->scriptMan;
|
||||
u8 anchorX = FrontierScriptContext_ReadByte(ctx);
|
||||
u8 anchorY = FrontierScriptContext_ReadByte(ctx);
|
||||
u8 initialCursorPos = FrontierScriptContext_ReadByte(ctx);
|
||||
u8 canExitWithB = FrontierScriptContext_ReadByte(ctx);
|
||||
u16 selectedOptionVar = FrontierScriptContext_ReadHalfWord(ctx);
|
||||
|
||||
v0->unk_60 = FrontierMenuManager_New(v0, anchorX, anchorY, initialCursorPos, canExitWithB, FrontierScriptContext_GetVarPointer(ctx, selectedOptionVar), v0->strTemplate, ctx->msgLoader);
|
||||
scriptMan->menuMan = FrontierMenuManager_New(scriptMan, anchorX, anchorY, initialCursorPos, canExitWithB, FrontierScriptContext_GetVarPointer(ctx, selectedOptionVar), scriptMan->strTemplate, ctx->msgLoader);
|
||||
ctx->data[0] = selectedOptionVar;
|
||||
|
||||
return TRUE;
|
||||
|
|
@ -826,33 +823,33 @@ static BOOL FrontierScrCmd_InitLocalTextMenu(FrontierScriptContext *ctx)
|
|||
|
||||
static BOOL FrontierScrCmd_AddMenuEntry(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_022320B4 *v3 = ctx->unk_00;
|
||||
FrontierScriptManager *scriptMan = ctx->scriptMan;
|
||||
|
||||
u16 entryID = FrontierScriptContext_ReadHalfWord(ctx);
|
||||
u16 descriptionID = 0xff;
|
||||
u16 index = FrontierScriptContext_ReadHalfWord(ctx);
|
||||
|
||||
FrontierMenuManager_AddMenuEntry(v3->unk_60, entryID, descriptionID, index);
|
||||
FrontierMenuManager_AddMenuEntry(scriptMan->menuMan, entryID, descriptionID, index);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static BOOL FrontierScrCmd_AddMenuEntryWithDesc(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_022320B4 *v3 = ctx->unk_00;
|
||||
FrontierScriptManager *scriptMan = ctx->scriptMan;
|
||||
|
||||
u16 entryID = FrontierScriptContext_ReadHalfWord(ctx);
|
||||
u16 descriptionID = FrontierScriptContext_ReadHalfWord(ctx);
|
||||
u16 index = FrontierScriptContext_ReadHalfWord(ctx);
|
||||
|
||||
FrontierMenuManager_AddMenuEntry(v3->unk_60, entryID, descriptionID, index);
|
||||
FrontierMenuManager_AddMenuEntry(scriptMan->menuMan, entryID, descriptionID, index);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static BOOL FrontierScrCmd_ShowMenu(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_022320B4 *v0 = ctx->unk_00;
|
||||
FrontierScriptManager *scriptMan = ctx->scriptMan;
|
||||
|
||||
FrontierMenuManager_ShowMenu(v0->unk_60);
|
||||
FrontierMenuManager_ShowMenu(scriptMan->menuMan);
|
||||
FrontierScriptContext_Pause(ctx, ResumeOnMenuSelection);
|
||||
|
||||
return TRUE;
|
||||
|
|
@ -860,27 +857,27 @@ static BOOL FrontierScrCmd_ShowMenu(FrontierScriptContext *ctx)
|
|||
|
||||
static BOOL ResumeOnMenuSelection(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_022320B4 *v0 = ctx->unk_00;
|
||||
FrontierScriptManager *scriptMan = ctx->scriptMan;
|
||||
u16 *selectedOptionPtr = FrontierScriptContext_GetVarPointer(ctx, ctx->data[0]);
|
||||
|
||||
if (*selectedOptionPtr == LIST_MENU_NO_SELECTION_YET) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
v0->unk_60 = NULL;
|
||||
scriptMan->menuMan = NULL;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL FrontierScrCmd_InitGlobalTextListMenu(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_022320B4 *v0 = ctx->unk_00;
|
||||
FrontierScriptManager *scriptMan = ctx->scriptMan;
|
||||
u8 anchorX = FrontierScriptContext_ReadByte(ctx);
|
||||
u8 anchorY = FrontierScriptContext_ReadByte(ctx);
|
||||
u8 initialCursorPos = FrontierScriptContext_ReadByte(ctx);
|
||||
u8 canExitWithB = FrontierScriptContext_ReadByte(ctx);
|
||||
u16 selectedOptionVar = FrontierScriptContext_ReadHalfWord(ctx);
|
||||
|
||||
v0->unk_60 = FrontierMenuManager_New2(v0, anchorX, anchorY, initialCursorPos, canExitWithB, FrontierScriptContext_GetVarPointer(ctx, selectedOptionVar), v0->strTemplate, NULL);
|
||||
scriptMan->menuMan = FrontierMenuManager_New2(scriptMan, anchorX, anchorY, initialCursorPos, canExitWithB, FrontierScriptContext_GetVarPointer(ctx, selectedOptionVar), scriptMan->strTemplate, NULL);
|
||||
ctx->data[0] = selectedOptionVar;
|
||||
|
||||
return TRUE;
|
||||
|
|
@ -888,14 +885,14 @@ static BOOL FrontierScrCmd_InitGlobalTextListMenu(FrontierScriptContext *ctx)
|
|||
|
||||
static BOOL FrontierScrCmd_InitLocalTextListMenu(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_022320B4 *v0 = ctx->unk_00;
|
||||
FrontierScriptManager *scriptMan = ctx->scriptMan;
|
||||
u8 anchorX = FrontierScriptContext_ReadByte(ctx);
|
||||
u8 anchorY = FrontierScriptContext_ReadByte(ctx);
|
||||
u8 initialCursorPos = FrontierScriptContext_ReadByte(ctx);
|
||||
u8 canExitWithB = FrontierScriptContext_ReadByte(ctx);
|
||||
u16 selectedOptionVar = FrontierScriptContext_ReadHalfWord(ctx);
|
||||
|
||||
v0->unk_60 = FrontierMenuManager_New2(v0, anchorX, anchorY, initialCursorPos, canExitWithB, FrontierScriptContext_GetVarPointer(ctx, selectedOptionVar), v0->strTemplate, ctx->msgLoader);
|
||||
scriptMan->menuMan = FrontierMenuManager_New2(scriptMan, anchorX, anchorY, initialCursorPos, canExitWithB, FrontierScriptContext_GetVarPointer(ctx, selectedOptionVar), scriptMan->strTemplate, ctx->msgLoader);
|
||||
ctx->data[0] = selectedOptionVar;
|
||||
|
||||
return TRUE;
|
||||
|
|
@ -903,21 +900,21 @@ static BOOL FrontierScrCmd_InitLocalTextListMenu(FrontierScriptContext *ctx)
|
|||
|
||||
static BOOL FrontierScrCmd_AddListMenuEntry(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_022320B4 *v3 = ctx->unk_00;
|
||||
FrontierScriptManager *scriptMan = ctx->scriptMan;
|
||||
|
||||
u16 entryID = FrontierScriptContext_ReadHalfWord(ctx);
|
||||
u16 descriptionID = FrontierScriptContext_ReadHalfWord(ctx);
|
||||
u16 index = FrontierScriptContext_ReadHalfWord(ctx);
|
||||
|
||||
FrontierMenuManager_AddListMenuEntry(v3->unk_60, entryID, descriptionID, index);
|
||||
FrontierMenuManager_AddListMenuEntry(scriptMan->menuMan, entryID, descriptionID, index);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static BOOL FrontierScrCmd_ShowListMenu(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_022320B4 *v0 = ctx->unk_00;
|
||||
FrontierScriptManager *scriptMan = ctx->scriptMan;
|
||||
|
||||
FrontierMenuManager_ShowListMenu(v0->unk_60);
|
||||
FrontierMenuManager_ShowListMenu(scriptMan->menuMan);
|
||||
FrontierScriptContext_Pause(ctx, ResumeOnMenuSelection);
|
||||
|
||||
return TRUE;
|
||||
|
|
@ -925,20 +922,20 @@ static BOOL FrontierScrCmd_ShowListMenu(FrontierScriptContext *ctx)
|
|||
|
||||
static BOOL FrontierScrCmd_FreeListMenu(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_022320B4 *v0 = ctx->unk_00;
|
||||
FrontierScriptManager *scriptMan = ctx->scriptMan;
|
||||
|
||||
FrontierMenuManager_FreeListMenu(v0->unk_60);
|
||||
FrontierMenuManager_FreeListMenu(scriptMan->menuMan);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL FrontierScrCmd_ShowYesNoMenu(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_022320B4 *v0 = ctx->unk_00;
|
||||
UnkStruct_ov104_0223C4CC *v1 = ov104_0222E924(v0);
|
||||
FrontierScriptManager *scriptMan = ctx->scriptMan;
|
||||
UnkStruct_ov104_0223C4CC *v1 = ov104_0222E924(scriptMan);
|
||||
u16 destVarID = FrontierScriptContext_ReadHalfWord(ctx);
|
||||
u8 cursorStart = FrontierScriptContext_ReadByte(ctx);
|
||||
|
||||
v0->menu = Menu_MakeYesNoChoiceWithCursorAt(v1->unk_00, &sYesNoWindowTemplate, BASE_TILE_STANDARD_WINDOW_FRAME, 12, cursorStart, v0->heapID);
|
||||
scriptMan->menu = Menu_MakeYesNoChoiceWithCursorAt(v1->unk_00, &sYesNoWindowTemplate, BASE_TILE_STANDARD_WINDOW_FRAME, 12, cursorStart, scriptMan->heapID);
|
||||
ctx->data[0] = destVarID;
|
||||
FrontierScriptContext_Pause(ctx, WaitForYesNoResult);
|
||||
return TRUE;
|
||||
|
|
@ -946,9 +943,9 @@ static BOOL FrontierScrCmd_ShowYesNoMenu(FrontierScriptContext *ctx)
|
|||
|
||||
static BOOL WaitForYesNoResult(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_022320B4 *v1 = ctx->unk_00;
|
||||
FrontierScriptManager *scriptMan = ctx->scriptMan;
|
||||
u16 *destVar = FrontierScriptContext_GetVarPointer(ctx, ctx->data[0]);
|
||||
u32 result = Menu_ProcessInputAndHandleExit(v1->menu, v1->heapID);
|
||||
u32 result = Menu_ProcessInputAndHandleExit(scriptMan->menu, scriptMan->heapID);
|
||||
if (result == MENU_NOTHING_CHOSEN) {
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -962,7 +959,7 @@ static BOOL WaitForYesNoResult(FrontierScriptContext *ctx)
|
|||
|
||||
static BOOL FrontierScrCmd_22(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_022320B4 *v0 = ctx->unk_00;
|
||||
FrontierScriptManager *v0 = ctx->scriptMan;
|
||||
UnkStruct_ov104_0223C4CC *v1 = sub_0209B974(v0->unk_00);
|
||||
const u8 *currScriptPtr;
|
||||
UnkStruct_ov104_0223C688 v3;
|
||||
|
|
@ -1010,7 +1007,7 @@ static BOOL FrontierScrCmd_22(FrontierScriptContext *ctx)
|
|||
|
||||
static BOOL FrontierScrCmd_23(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_022320B4 *v0 = ctx->unk_00;
|
||||
FrontierScriptManager *v0 = ctx->scriptMan;
|
||||
UnkStruct_ov104_0223C4CC *v1 = sub_0209B974(v0->unk_00);
|
||||
u16 v2 = FrontierScriptContext_GetVar(ctx);
|
||||
ov104_0223D148(v1, v2);
|
||||
|
|
@ -1020,7 +1017,7 @@ static BOOL FrontierScrCmd_23(FrontierScriptContext *ctx)
|
|||
|
||||
static BOOL FrontierScrCmd_24(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_022320B4 *v0 = ctx->unk_00;
|
||||
FrontierScriptManager *v0 = ctx->scriptMan;
|
||||
UnkStruct_ov104_0223C4CC *v1 = sub_0209B974(v0->unk_00);
|
||||
const u8 *currScriptPtr;
|
||||
s32 offset = FrontierScriptContext_ReadWord(ctx);
|
||||
|
|
@ -1072,7 +1069,7 @@ static BOOL FrontierScrCmd_24(FrontierScriptContext *ctx)
|
|||
|
||||
static BOOL FrontierScrCmd_25(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_022320B4 *v0 = ctx->unk_00;
|
||||
FrontierScriptManager *v0 = ctx->scriptMan;
|
||||
UnkStruct_ov104_0223C4CC *v1 = sub_0209B974(v0->unk_00);
|
||||
UnkStruct_ov63_0222BEC0 *v2;
|
||||
u16 v3 = FrontierScriptContext_GetVar(ctx);
|
||||
|
|
@ -1085,7 +1082,7 @@ static BOOL FrontierScrCmd_25(FrontierScriptContext *ctx)
|
|||
|
||||
static BOOL FrontierScrCmd_26(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_022320B4 *v0 = ctx->unk_00;
|
||||
FrontierScriptManager *v0 = ctx->scriptMan;
|
||||
UnkStruct_ov104_0223C4CC *v1 = sub_0209B974(v0->unk_00);
|
||||
u16 v2 = FrontierScriptContext_GetVar(ctx);
|
||||
u8 v3 = FrontierScriptContext_ReadByte(ctx);
|
||||
|
|
@ -1105,7 +1102,7 @@ static BOOL FrontierScrCmd_Dummy27(FrontierScriptContext *ctx)
|
|||
|
||||
static BOOL FrontierScrCmd_28(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_022320B4 *v0 = ctx->unk_00;
|
||||
FrontierScriptManager *v0 = ctx->scriptMan;
|
||||
UnkStruct_ov104_0223C4CC *v1 = sub_0209B974(v0->unk_00);
|
||||
u8 *v2;
|
||||
u16 v3 = FrontierScriptContext_GetVar(ctx);
|
||||
|
|
@ -1146,7 +1143,7 @@ static BOOL FrontierScrCmd_29(FrontierScriptContext *ctx)
|
|||
|
||||
static BOOL ov104_022305C8(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_022320B4 *v0 = ctx->unk_00;
|
||||
FrontierScriptManager *v0 = ctx->scriptMan;
|
||||
|
||||
if (v0->unk_59 == 0) {
|
||||
return TRUE;
|
||||
|
|
@ -1157,7 +1154,7 @@ static BOOL ov104_022305C8(FrontierScriptContext *ctx)
|
|||
|
||||
static BOOL FrontierScrCmd_2A(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_022320B4 *v0 = ctx->unk_00;
|
||||
FrontierScriptManager *v0 = ctx->scriptMan;
|
||||
UnkStruct_ov104_0223C4CC *v1 = sub_0209B974(v0->unk_00);
|
||||
const u8 *currScriptPtr;
|
||||
s32 offset = FrontierScriptContext_ReadWord(ctx);
|
||||
|
|
@ -1187,7 +1184,7 @@ static BOOL FrontierScrCmd_2A(FrontierScriptContext *ctx)
|
|||
|
||||
static BOOL FrontierScrCmd_2B(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_022320B4 *v0 = ctx->unk_00;
|
||||
FrontierScriptManager *v0 = ctx->scriptMan;
|
||||
UnkStruct_ov104_0223C4CC *v1 = sub_0209B974(v0->unk_00);
|
||||
u16 v2 = FrontierScriptContext_GetVar(ctx);
|
||||
|
||||
|
|
@ -1199,7 +1196,7 @@ static BOOL FrontierScrCmd_2B(FrontierScriptContext *ctx)
|
|||
|
||||
static BOOL FrontierScrCmd_2C(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_022320B4 *v0 = ctx->unk_00;
|
||||
FrontierScriptManager *v0 = ctx->scriptMan;
|
||||
UnkStruct_ov104_0223C4CC *v1 = sub_0209B974(v0->unk_00);
|
||||
const u8 *currScriptPtr;
|
||||
s32 offset = FrontierScriptContext_ReadWord(ctx);
|
||||
|
|
@ -1235,7 +1232,7 @@ static BOOL FrontierScrCmd_2C(FrontierScriptContext *ctx)
|
|||
|
||||
static BOOL FrontierScrCmd_2D(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_022320B4 *v0 = ctx->unk_00;
|
||||
FrontierScriptManager *v0 = ctx->scriptMan;
|
||||
u16 v1;
|
||||
UnkStruct_ov104_0223C4CC *v2 = sub_0209B974(v0->unk_00);
|
||||
|
||||
|
|
@ -1247,7 +1244,7 @@ static BOOL FrontierScrCmd_2D(FrontierScriptContext *ctx)
|
|||
|
||||
static BOOL FrontierScrCmd_2E(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_022320B4 *v0 = ctx->unk_00;
|
||||
FrontierScriptManager *v0 = ctx->scriptMan;
|
||||
UnkStruct_ov104_0223C4CC *v1 = sub_0209B974(v0->unk_00);
|
||||
u16 v2 = FrontierScriptContext_GetVar(ctx);
|
||||
u8 draw = FrontierScriptContext_ReadByte(ctx);
|
||||
|
|
@ -1261,7 +1258,7 @@ static BOOL FrontierScrCmd_2E(FrontierScriptContext *ctx)
|
|||
|
||||
static BOOL FrontierScrCmd_2F(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_022320B4 *v0 = ctx->unk_00;
|
||||
FrontierScriptManager *v0 = ctx->scriptMan;
|
||||
UnkStruct_ov104_0223C4CC *v1 = sub_0209B974(v0->unk_00);
|
||||
u16 v2 = FrontierScriptContext_GetVar(ctx);
|
||||
ManagedSprite *managedSprite = ov104_0223D370(v1, v2);
|
||||
|
|
@ -1275,7 +1272,7 @@ static BOOL FrontierScrCmd_2F(FrontierScriptContext *ctx)
|
|||
static BOOL FrontierScrCmd_30(FrontierScriptContext *ctx)
|
||||
{
|
||||
ManagedSprite *managedSprite;
|
||||
UnkStruct_ov104_022320B4 *v1 = ctx->unk_00;
|
||||
FrontierScriptManager *v1 = ctx->scriptMan;
|
||||
UnkStruct_ov104_0223C4CC *v2 = sub_0209B974(v1->unk_00);
|
||||
u16 v3 = FrontierScriptContext_GetVar(ctx);
|
||||
u16 v4 = FrontierScriptContext_GetVar(ctx);
|
||||
|
|
@ -1297,7 +1294,7 @@ static BOOL FrontierScrCmd_31(FrontierScriptContext *ctx)
|
|||
u16 v0 = FrontierScriptContext_GetVar(ctx);
|
||||
u16 animID = FrontierScriptContext_GetVar(ctx);
|
||||
ManagedSprite *managedSprite;
|
||||
UnkStruct_ov104_0223C4CC *v3 = sub_0209B974(ctx->unk_00->unk_00);
|
||||
UnkStruct_ov104_0223C4CC *v3 = sub_0209B974(ctx->scriptMan->unk_00);
|
||||
|
||||
managedSprite = ov104_0223D370(v3, v0);
|
||||
|
||||
|
|
@ -1310,7 +1307,7 @@ static BOOL FrontierScrCmd_31(FrontierScriptContext *ctx)
|
|||
static BOOL FrontierScrCmd_32(FrontierScriptContext *ctx)
|
||||
{
|
||||
u16 v0 = FrontierScriptContext_GetVar(ctx);
|
||||
UnkStruct_ov104_0223C4CC *v1 = sub_0209B974(ctx->unk_00->unk_00);
|
||||
UnkStruct_ov104_0223C4CC *v1 = sub_0209B974(ctx->scriptMan->unk_00);
|
||||
|
||||
ov104_0223D378(v1, v0, 0);
|
||||
return FALSE;
|
||||
|
|
@ -1329,7 +1326,7 @@ static BOOL FrontierScrCmd_33(FrontierScriptContext *ctx)
|
|||
static BOOL ov104_02230850(FrontierScriptContext *ctx)
|
||||
{
|
||||
ManagedSprite *managedSprite;
|
||||
UnkStruct_ov104_0223C4CC *v1 = sub_0209B974(ctx->unk_00->unk_00);
|
||||
UnkStruct_ov104_0223C4CC *v1 = sub_0209B974(ctx->scriptMan->unk_00);
|
||||
|
||||
managedSprite = ov104_0223D370(v1, ctx->data[0]);
|
||||
|
||||
|
|
@ -1342,7 +1339,7 @@ static BOOL ov104_02230850(FrontierScriptContext *ctx)
|
|||
|
||||
static void ov104_0223088C(FrontierScriptContext *ctx, int param1, int param2)
|
||||
{
|
||||
UnkStruct_ov104_022320B4 *v0 = ctx->unk_00;
|
||||
FrontierScriptManager *v0 = ctx->scriptMan;
|
||||
s16 *v1;
|
||||
u16 v2;
|
||||
int v3;
|
||||
|
|
@ -1363,7 +1360,7 @@ static void ov104_0223088C(FrontierScriptContext *ctx, int param1, int param2)
|
|||
static BOOL FrontierScrCmd_53(FrontierScriptContext *ctx)
|
||||
{
|
||||
u16 v0 = FrontierScriptContext_GetVar(ctx);
|
||||
ov104_0223D860(ctx->unk_00->unk_00, v0, 0, NULL, 0);
|
||||
ov104_0223D860(ctx->scriptMan->unk_00, v0, 0, NULL, 0);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -1376,10 +1373,10 @@ static BOOL FrontierScrCmd_54(FrontierScriptContext *ctx)
|
|||
|
||||
static BOOL FrontierScrCmd_34(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_02230BE4 *v1 = sub_0209B970(ctx->unk_00->unk_00);
|
||||
UnkStruct_ov104_02230BE4 *v1 = sub_0209B970(ctx->scriptMan->unk_00);
|
||||
void *namingScreenArgs = NamingScreenArgs_Init(HEAP_ID_FIELD2, NAMING_SCREEN_TYPE_PLAYER, 0, 8, (void *)v1->options);
|
||||
|
||||
sub_0209B988(ctx->unk_00->unk_00, &gNamingScreenAppTemplate, namingScreenArgs, 0, ov104_02230950);
|
||||
sub_0209B988(ctx->scriptMan->unk_00, &gNamingScreenAppTemplate, namingScreenArgs, 0, ov104_02230950);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
@ -1392,7 +1389,7 @@ static void ov104_02230950(void *namingScreenArgs)
|
|||
static BOOL FrontierScrCmd_6C(FrontierScriptContext *ctx)
|
||||
{
|
||||
int v0;
|
||||
UnkStruct_ov104_02230BE4 *v1 = sub_0209B970(ctx->unk_00->unk_00);
|
||||
UnkStruct_ov104_02230BE4 *v1 = sub_0209B970(ctx->scriptMan->unk_00);
|
||||
|
||||
sub_0202F1F8(v1->saveData, HEAP_ID_FIELD2, &v0);
|
||||
return FALSE;
|
||||
|
|
@ -1400,7 +1397,7 @@ static BOOL FrontierScrCmd_6C(FrontierScriptContext *ctx)
|
|||
|
||||
static BOOL FrontierScrCmd_6D(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_022320B4 *v0 = ctx->unk_00;
|
||||
FrontierScriptManager *v0 = ctx->scriptMan;
|
||||
u16 v1 = FrontierScriptContext_ReadHalfWord(ctx);
|
||||
u16 v2 = FrontierScriptContext_GetVar(ctx);
|
||||
u16 v3 = FrontierScriptContext_GetVar(ctx);
|
||||
|
|
@ -1422,8 +1419,8 @@ static BOOL FrontierScrCmd_6D(FrontierScriptContext *ctx)
|
|||
|
||||
static BOOL ov104_022309DC(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_022320B4 *v0 = ctx->unk_00;
|
||||
UnkStruct_ov104_02230BE4 *v1 = sub_0209B970(ctx->unk_00->unk_00);
|
||||
FrontierScriptManager *v0 = ctx->scriptMan;
|
||||
UnkStruct_ov104_02230BE4 *v1 = sub_0209B970(ctx->scriptMan->unk_00);
|
||||
int v2 = sub_0202F41C(v1->saveData, v0->unk_B4, v0->unk_B6, 0, &v0->unk_B0, &v0->unk_B2);
|
||||
|
||||
if ((v2 == 2) || (v2 == 3)) {
|
||||
|
|
@ -1560,14 +1557,14 @@ static BOOL FrontierScrCmd_6E(FrontierScriptContext *ctx)
|
|||
{
|
||||
int v0;
|
||||
FieldBattleDTO *dto;
|
||||
UnkStruct_ov104_02230BE4 *v2 = sub_0209B970(ctx->unk_00->unk_00);
|
||||
UnkStruct_ov104_02230BE4 *v2 = sub_0209B970(ctx->scriptMan->unk_00);
|
||||
|
||||
dto = Heap_Alloc(HEAP_ID_FIELD2, sizeof(FieldBattleDTO));
|
||||
MI_CpuClear8(dto, sizeof(FieldBattleDTO));
|
||||
|
||||
sub_0202F298(v2->saveData, 11, &v0, dto, 0);
|
||||
Sound_SetSceneAndPlayBGM(SOUND_SCENE_BATTLE, SEQ_BATTLE_TRAINER, 1);
|
||||
sub_0209B988(ctx->unk_00->unk_00, &gBattleApplicationTemplate, dto, 1, NULL);
|
||||
sub_0209B988(ctx->scriptMan->unk_00, &gBattleApplicationTemplate, dto, 1, NULL);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
@ -1581,7 +1578,7 @@ static BOOL FrontierScrCmd_6F(FrontierScriptContext *ctx)
|
|||
static BOOL FrontierScrCmd_70(FrontierScriptContext *ctx)
|
||||
{
|
||||
int v0;
|
||||
UnkStruct_ov104_02230BE4 *v1 = sub_0209B970(ctx->unk_00->unk_00);
|
||||
UnkStruct_ov104_02230BE4 *v1 = sub_0209B970(ctx->scriptMan->unk_00);
|
||||
u16 *v2 = FrontierScriptContext_TryGetVarPointer(ctx);
|
||||
|
||||
*v2 = sub_0202F330(v1->saveData, 11, &v0, 0);
|
||||
|
|
@ -1590,7 +1587,7 @@ static BOOL FrontierScrCmd_70(FrontierScriptContext *ctx)
|
|||
|
||||
static BOOL FrontierScrCmd_72(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_02230BE4 *v0 = sub_0209B970(ctx->unk_00->unk_00);
|
||||
UnkStruct_ov104_02230BE4 *v0 = sub_0209B970(ctx->scriptMan->unk_00);
|
||||
u16 *unused = FrontierScriptContext_TryGetVarPointer(ctx);
|
||||
SaveData_Save(v0->saveData);
|
||||
return FALSE;
|
||||
|
|
@ -1598,8 +1595,8 @@ static BOOL FrontierScrCmd_72(FrontierScriptContext *ctx)
|
|||
|
||||
static BOOL FrontierScrCmd_73(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_022320B4 *v0 = ctx->unk_00;
|
||||
UnkStruct_ov104_02230BE4 *v1 = sub_0209B970(ctx->unk_00->unk_00);
|
||||
FrontierScriptManager *v0 = ctx->scriptMan;
|
||||
UnkStruct_ov104_02230BE4 *v1 = sub_0209B970(ctx->scriptMan->unk_00);
|
||||
u16 *v2 = FrontierScriptContext_TryGetVarPointer(ctx);
|
||||
|
||||
ResetLock(RESET_LOCK_SOFT_RESET);
|
||||
|
|
@ -1612,7 +1609,7 @@ static BOOL FrontierScrCmd_73(FrontierScriptContext *ctx)
|
|||
|
||||
static BOOL WaitForSaveStateFinish(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_02230BE4 *v1 = sub_0209B970(ctx->unk_00->unk_00);
|
||||
UnkStruct_ov104_02230BE4 *v1 = sub_0209B970(ctx->scriptMan->unk_00);
|
||||
int saveResult = SaveData_SaveStateMain(v1->saveData);
|
||||
|
||||
if (saveResult == SAVE_RESULT_OK) {
|
||||
|
|
@ -1632,7 +1629,7 @@ static BOOL WaitForSaveStateFinish(FrontierScriptContext *ctx)
|
|||
|
||||
static BOOL FrontierScrCmd_SaveDataExtraInit(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_02230BE4 *v0 = sub_0209B970(ctx->unk_00->unk_00);
|
||||
UnkStruct_ov104_02230BE4 *v0 = sub_0209B970(ctx->scriptMan->unk_00);
|
||||
|
||||
SaveDataExtra_Init(v0->saveData);
|
||||
return FALSE;
|
||||
|
|
@ -1640,7 +1637,7 @@ static BOOL FrontierScrCmd_SaveDataExtraInit(FrontierScriptContext *ctx)
|
|||
|
||||
static BOOL FrontierScrCmd_GetMiscSaveBlockInitFlag(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_02230BE4 *v0 = sub_0209B970(ctx->unk_00->unk_00);
|
||||
UnkStruct_ov104_02230BE4 *v0 = sub_0209B970(ctx->scriptMan->unk_00);
|
||||
u16 *destVar = FrontierScriptContext_TryGetVarPointer(ctx);
|
||||
|
||||
*destVar = SaveData_MiscSaveBlock_InitFlag(v0->saveData);
|
||||
|
|
@ -1649,15 +1646,15 @@ static BOOL FrontierScrCmd_GetMiscSaveBlockInitFlag(FrontierScriptContext *ctx)
|
|||
|
||||
static BOOL FrontierScrCmd_ShowSavingIcon(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_022320B4 *v0 = ctx->unk_00;
|
||||
v0->savingIcon = Window_AddWaitDial(&v0->msgWindow, BASE_TILE_SCROLLING_MESSAGE_BOX);
|
||||
FrontierScriptManager *scriptMan = ctx->scriptMan;
|
||||
scriptMan->savingIcon = Window_AddWaitDial(&scriptMan->msgWindow, BASE_TILE_SCROLLING_MESSAGE_BOX);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static BOOL FrontierScrCmd_HideSavingIcon(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_022320B4 *v0 = ctx->unk_00;
|
||||
DestroyWaitDial(v0->savingIcon);
|
||||
FrontierScriptManager *scriptMan = ctx->scriptMan;
|
||||
DestroyWaitDial(scriptMan->savingIcon);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1666,7 +1663,7 @@ static BOOL FrontierScrCmd_BufferItemName(FrontierScriptContext *ctx)
|
|||
u8 templateArg = FrontierScriptContext_ReadByte(ctx);
|
||||
u16 item = FrontierScriptContext_GetVar(ctx);
|
||||
|
||||
StringTemplate_SetItemName(ctx->unk_00->strTemplate, templateArg, item);
|
||||
StringTemplate_SetItemName(ctx->scriptMan->strTemplate, templateArg, item);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1675,7 +1672,7 @@ static BOOL FrontierScrCmd_BufferNumber(FrontierScriptContext *ctx)
|
|||
u8 templateArg = FrontierScriptContext_ReadByte(ctx);
|
||||
u16 number = FrontierScriptContext_GetVar(ctx);
|
||||
|
||||
StringTemplate_SetNumber(ctx->unk_00->strTemplate, templateArg, number, GetNumberDigitCount(number), PADDING_MODE_SPACES, CHARSET_MODE_EN);
|
||||
StringTemplate_SetNumber(ctx->scriptMan->strTemplate, templateArg, number, GetNumberDigitCount(number), PADDING_MODE_SPACES, CHARSET_MODE_EN);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1704,19 +1701,19 @@ static u16 GetNumberDigitCount(u32 number)
|
|||
|
||||
static BOOL FrontierScrCmd_BufferPlayerName(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_02230BE4 *v0 = sub_0209B970(ctx->unk_00->unk_00);
|
||||
UnkStruct_ov104_02230BE4 *v0 = sub_0209B970(ctx->scriptMan->unk_00);
|
||||
u8 templateArg = FrontierScriptContext_ReadByte(ctx);
|
||||
|
||||
StringTemplate_SetPlayerName(ctx->unk_00->strTemplate, templateArg, SaveData_GetTrainerInfo(v0->saveData));
|
||||
StringTemplate_SetPlayerName(ctx->scriptMan->strTemplate, templateArg, SaveData_GetTrainerInfo(v0->saveData));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static BOOL FrontierScrCmd_BufferPartnerName(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_02230BE4 *v0 = sub_0209B970(ctx->unk_00->unk_00);
|
||||
UnkStruct_ov104_02230BE4 *v0 = sub_0209B970(ctx->scriptMan->unk_00);
|
||||
u8 templateArg = FrontierScriptContext_ReadByte(ctx);
|
||||
|
||||
StringTemplate_SetPlayerName(ctx->unk_00->strTemplate, templateArg, CommInfo_TrainerInfo(CommSys_CurNetId() ^ 1));
|
||||
StringTemplate_SetPlayerName(ctx->scriptMan->strTemplate, templateArg, CommInfo_TrainerInfo(CommSys_CurNetId() ^ 1));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1725,7 +1722,7 @@ BOOL FrontierScrCmd_BufferMoveName(FrontierScriptContext *ctx)
|
|||
u8 templateArg = FrontierScriptContext_ReadByte(ctx);
|
||||
u16 move = FrontierScriptContext_GetVar(ctx);
|
||||
|
||||
StringTemplate_SetMoveName(ctx->unk_00->strTemplate, templateArg, move);
|
||||
StringTemplate_SetMoveName(ctx->scriptMan->strTemplate, templateArg, move);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1737,7 +1734,7 @@ BOOL FrontierScrCmd_BufferSpeciesName(FrontierScriptContext *ctx)
|
|||
u8 unused2 = FrontierScriptContext_ReadByte(ctx);
|
||||
String *speciesName = GetSpeciesNameString(species, HEAP_ID_FIELD2);
|
||||
|
||||
StringTemplate_SetString(ctx->unk_00->strTemplate, templateArg, speciesName, unused1, unused2, GAME_LANGUAGE);
|
||||
StringTemplate_SetString(ctx->scriptMan->strTemplate, templateArg, speciesName, unused1, unused2, GAME_LANGUAGE);
|
||||
String_Free(speciesName);
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -1756,22 +1753,22 @@ static BOOL FrontierScrCmd_BufferTypeName(FrontierScriptContext *ctx)
|
|||
u8 templateArg = FrontierScriptContext_ReadByte(ctx);
|
||||
u16 type = FrontierScriptContext_GetVar(ctx);
|
||||
|
||||
StringTemplate_SetPokemonTypeName(ctx->unk_00->strTemplate, templateArg, type);
|
||||
StringTemplate_SetPokemonTypeName(ctx->scriptMan->strTemplate, templateArg, type);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static BOOL FrontierScrCmd_BufferRivalName(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_02230BE4 *v0 = sub_0209B970(ctx->unk_00->unk_00);
|
||||
UnkStruct_ov104_02230BE4 *v0 = sub_0209B970(ctx->scriptMan->unk_00);
|
||||
u8 templateArg = FrontierScriptContext_ReadByte(ctx);
|
||||
|
||||
StringTemplate_SetRivalName(ctx->unk_00->strTemplate, templateArg, v0->saveData);
|
||||
StringTemplate_SetRivalName(ctx->scriptMan->strTemplate, templateArg, v0->saveData);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static BOOL FrontierScrCmd_GetNumBattlePoints(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_02230BE4 *v0 = sub_0209B970(ctx->unk_00->unk_00);
|
||||
UnkStruct_ov104_02230BE4 *v0 = sub_0209B970(ctx->scriptMan->unk_00);
|
||||
u16 *destVar = FrontierScriptContext_TryGetVarPointer(ctx);
|
||||
|
||||
*destVar = BattlePoints_ApplyFuncAndGet(sub_0202D750(v0->saveData), 0, BATTLE_POINTS_FUNC_NONE);
|
||||
|
|
@ -1781,7 +1778,7 @@ static BOOL FrontierScrCmd_GetNumBattlePoints(FrontierScriptContext *ctx)
|
|||
static BOOL FrontierScrCmd_GiveBattlePoints(FrontierScriptContext *ctx)
|
||||
{
|
||||
TVBroadcast *broadcast;
|
||||
UnkStruct_ov104_02230BE4 *v1 = sub_0209B970(ctx->unk_00->unk_00);
|
||||
UnkStruct_ov104_02230BE4 *v1 = sub_0209B970(ctx->scriptMan->unk_00);
|
||||
u16 battlePoints = FrontierScriptContext_GetVar(ctx);
|
||||
|
||||
broadcast = SaveData_GetTVBroadcast(v1->saveData);
|
||||
|
|
@ -1795,7 +1792,7 @@ static BOOL FrontierScrCmd_GiveBattlePoints(FrontierScriptContext *ctx)
|
|||
|
||||
static BOOL FrontierScrCmd_RemoteBattlePoints(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_02230BE4 *v0 = sub_0209B970(ctx->unk_00->unk_00);
|
||||
UnkStruct_ov104_02230BE4 *v0 = sub_0209B970(ctx->scriptMan->unk_00);
|
||||
u16 battlePoints = FrontierScriptContext_GetVar(ctx);
|
||||
|
||||
GameRecords_AddToRecordValue(SaveData_GetGameRecords(v0->saveData), RECORD_BATTLE_POINTS_SPENT, battlePoints);
|
||||
|
|
@ -1859,7 +1856,7 @@ static BOOL FrontierScrCmd_GetRandom(FrontierScriptContext *ctx)
|
|||
|
||||
static BOOL FrontierScrCmd_HealParty(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_02230BE4 *v0 = sub_0209B970(ctx->unk_00->unk_00);
|
||||
UnkStruct_ov104_02230BE4 *v0 = sub_0209B970(ctx->scriptMan->unk_00);
|
||||
Party_HealAllMembers(SaveData_GetParty(v0->saveData));
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -1905,7 +1902,7 @@ BOOL FrontierScrCmd_3D(FrontierScriptContext *ctx)
|
|||
u16 *destVar;
|
||||
u16 destVarID = FrontierScriptContext_ReadHalfWord(ctx);
|
||||
u16 value = FrontierScriptContext_GetVar(ctx);
|
||||
UnkStruct_ov104_02230BE4 *v3 = sub_0209B970(ctx->unk_00->unk_00);
|
||||
UnkStruct_ov104_02230BE4 *v3 = sub_0209B970(ctx->scriptMan->unk_00);
|
||||
|
||||
destVar = VarsFlags_GetVarAddress(SaveData_GetVarsFlags(v3->saveData), destVarID);
|
||||
*destVar = value;
|
||||
|
|
@ -1918,7 +1915,7 @@ BOOL FrontierScrCmd_3E(FrontierScriptContext *ctx)
|
|||
u16 *srcVar;
|
||||
u16 srcVarID = FrontierScriptContext_ReadHalfWord(ctx);
|
||||
u16 *destVar = FrontierScriptContext_TryGetVarPointer(ctx);
|
||||
UnkStruct_ov104_02230BE4 *v3 = sub_0209B970(ctx->unk_00->unk_00);
|
||||
UnkStruct_ov104_02230BE4 *v3 = sub_0209B970(ctx->scriptMan->unk_00);
|
||||
|
||||
srcVar = VarsFlags_GetVarAddress(SaveData_GetVarsFlags(v3->saveData), srcVarID);
|
||||
*destVar = *srcVar;
|
||||
|
|
@ -2365,18 +2362,18 @@ static BOOL FrontierScrCmd_3F(FrontierScriptContext *ctx)
|
|||
UnkStruct_ov104_02230BE4 *v0;
|
||||
UnkStruct_ov104_02231148 *v1;
|
||||
|
||||
v0 = sub_0209B970(ctx->unk_00->unk_00);
|
||||
v0 = sub_0209B970(ctx->scriptMan->unk_00);
|
||||
ctx->data[0] = FrontierScriptContext_GetVar(ctx);
|
||||
|
||||
Sound_SetSceneAndPlayBGM(SOUND_SCENE_BATTLE, SEQ_BATTLE_TRAINER, 1);
|
||||
|
||||
v1 = Heap_Alloc(HEAP_ID_FIELD2, sizeof(UnkStruct_ov104_02231148));
|
||||
v1->unk_14 = sub_0209B978(ctx->unk_00->unk_00);
|
||||
v1->unk_14 = sub_0209B978(ctx->scriptMan->unk_00);
|
||||
v1->unk_04 = 0;
|
||||
v1->unk_08 = ctx->data[0];
|
||||
v1->unk_00 = ov104_0222E924(ctx->unk_00);
|
||||
v1->unk_00 = ov104_0222E924(ctx->scriptMan);
|
||||
|
||||
sub_0209B980(ctx->unk_00->unk_00, v1);
|
||||
sub_0209B980(ctx->scriptMan->unk_00, v1);
|
||||
FrontierScriptContext_Pause(ctx, ov104_02231AA8);
|
||||
PaletteData_FillBufferRange(v1->unk_00->unk_04, 0, 2, 0x0, 0, 1);
|
||||
|
||||
|
|
@ -2386,14 +2383,14 @@ static BOOL FrontierScrCmd_3F(FrontierScriptContext *ctx)
|
|||
static BOOL ov104_02231AA8(FrontierScriptContext *ctx)
|
||||
{
|
||||
BOOL v0;
|
||||
UnkStruct_ov104_02231148 *v1 = sub_0209B978(ctx->unk_00->unk_00);
|
||||
UnkStruct_ov104_02231148 *v1 = sub_0209B978(ctx->scriptMan->unk_00);
|
||||
|
||||
v0 = Unk_ov104_0223F65C[v1->unk_08](v1);
|
||||
|
||||
if (v0 == 0) {
|
||||
SetScreenColorBrightness(DS_SCREEN_MAIN, COLOR_BLACK);
|
||||
SetScreenColorBrightness(DS_SCREEN_SUB, COLOR_BLACK);
|
||||
sub_0209B980(ctx->unk_00->unk_00, v1->unk_14);
|
||||
sub_0209B980(ctx->scriptMan->unk_00, v1->unk_14);
|
||||
Heap_Free(v1);
|
||||
}
|
||||
|
||||
|
|
@ -2406,7 +2403,7 @@ static BOOL FrontierScrCmd_GetPlayerObjEventGfx(FrontierScriptContext *ctx)
|
|||
UnkStruct_ov104_02230BE4 *v1;
|
||||
u16 *destVar = FrontierScriptContext_TryGetVarPointer(ctx);
|
||||
|
||||
v1 = sub_0209B970(ctx->unk_00->unk_00);
|
||||
v1 = sub_0209B970(ctx->scriptMan->unk_00);
|
||||
|
||||
if (TrainerInfo_Gender(SaveData_GetTrainerInfo(v1->saveData)) == GENDER_MALE) {
|
||||
objEventGfx = OBJ_EVENT_GFX_PLAYER_M;
|
||||
|
|
@ -2420,7 +2417,7 @@ static BOOL FrontierScrCmd_GetPlayerObjEventGfx(FrontierScriptContext *ctx)
|
|||
|
||||
static BOOL FrontierScrCmd_41(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_022320B4 *v0 = ctx->unk_00;
|
||||
FrontierScriptManager *v0 = ctx->scriptMan;
|
||||
UnkStruct_ov104_0223C4CC *v1 = sub_0209B974(v0->unk_00);
|
||||
u16 v2 = FrontierScriptContext_GetVar(ctx);
|
||||
u16 v3 = FrontierScriptContext_GetVar(ctx);
|
||||
|
|
@ -2433,7 +2430,7 @@ static BOOL FrontierScrCmd_41(FrontierScriptContext *ctx)
|
|||
|
||||
static BOOL FrontierScrCmd_42(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_022320B4 *v0 = ctx->unk_00;
|
||||
FrontierScriptManager *v0 = ctx->scriptMan;
|
||||
UnkStruct_ov104_0223C4CC *v1 = sub_0209B974(v0->unk_00);
|
||||
u16 v2 = FrontierScriptContext_GetVar(ctx);
|
||||
ov104_0223D68C(v1->unk_10, v2);
|
||||
|
|
@ -2443,7 +2440,7 @@ static BOOL FrontierScrCmd_42(FrontierScriptContext *ctx)
|
|||
|
||||
static BOOL FrontierScrCmd_43(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_022320B4 *v0 = ctx->unk_00;
|
||||
FrontierScriptManager *v0 = ctx->scriptMan;
|
||||
UnkStruct_ov104_0223C4CC *v1 = sub_0209B974(v0->unk_00);
|
||||
u16 v2, resourceID;
|
||||
ParticleSystem *particleSystem;
|
||||
|
|
@ -2465,7 +2462,7 @@ static BOOL FrontierScrCmd_44(FrontierScriptContext *ctx)
|
|||
|
||||
static BOOL ov104_02231BB8(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_022320B4 *v0 = ctx->unk_00;
|
||||
FrontierScriptManager *v0 = ctx->scriptMan;
|
||||
UnkStruct_ov104_0223C4CC *v1 = sub_0209B974(v0->unk_00);
|
||||
|
||||
if (ov104_0223D6E4(v1->unk_10) == 1) {
|
||||
|
|
@ -2477,7 +2474,7 @@ static BOOL ov104_02231BB8(FrontierScriptContext *ctx)
|
|||
|
||||
static BOOL FrontierScrCmd_4C(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_022320B4 *v0 = ctx->unk_00;
|
||||
FrontierScriptManager *v0 = ctx->scriptMan;
|
||||
UnkStruct_ov104_0223C4CC *v1 = sub_0209B974(v0->unk_00);
|
||||
u16 v2, v3, v4, v5;
|
||||
UnkStruct_ov104_0223319C *v6 = &v1->unk_A4;
|
||||
|
|
@ -2511,7 +2508,7 @@ static BOOL FrontierScrCmd_4D(FrontierScriptContext *ctx)
|
|||
|
||||
static BOOL ov104_02231C54(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_022320B4 *v0 = ctx->unk_00;
|
||||
FrontierScriptManager *v0 = ctx->scriptMan;
|
||||
UnkStruct_ov104_0223C4CC *v1 = sub_0209B974(v0->unk_00);
|
||||
|
||||
if (v1->unk_A4.unk_00 == NULL) {
|
||||
|
|
@ -2523,7 +2520,7 @@ static BOOL ov104_02231C54(FrontierScriptContext *ctx)
|
|||
|
||||
static BOOL FrontierScrCmd_4E(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_022320B4 *v0 = ctx->unk_00;
|
||||
FrontierScriptManager *v0 = ctx->scriptMan;
|
||||
UnkStruct_ov104_0223C4CC *v1 = sub_0209B974(v0->unk_00);
|
||||
u16 v2, v3, v4, v5;
|
||||
UnkStruct_ov104_022331E8 *v6 = &v1->unk_B0;
|
||||
|
|
@ -2554,7 +2551,7 @@ static BOOL FrontierScrCmd_4F(FrontierScriptContext *ctx)
|
|||
|
||||
static BOOL ov104_02231CF4(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_022320B4 *v0 = ctx->unk_00;
|
||||
FrontierScriptManager *v0 = ctx->scriptMan;
|
||||
UnkStruct_ov104_0223C4CC *v1 = sub_0209B974(v0->unk_00);
|
||||
|
||||
if (v1->unk_B0.unk_00 == NULL) {
|
||||
|
|
@ -2576,7 +2573,7 @@ static BOOL FrontierScrCmd_45(FrontierScriptContext *ctx)
|
|||
Party *party;
|
||||
Pokemon *mon;
|
||||
UnkStruct_ov104_02230BE4 *v2;
|
||||
UnkStruct_ov104_0223C4CC *v3 = ov104_0222E924(ctx->unk_00);
|
||||
UnkStruct_ov104_0223C4CC *v3 = ov104_0222E924(ctx->scriptMan);
|
||||
u16 slot = FrontierScriptContext_GetVar(ctx);
|
||||
u16 x = FrontierScriptContext_GetVar(ctx);
|
||||
u16 y = FrontierScriptContext_GetVar(ctx);
|
||||
|
|
@ -2584,7 +2581,7 @@ static BOOL FrontierScrCmd_45(FrontierScriptContext *ctx)
|
|||
u16 blendFraction = FrontierScriptContext_ReadHalfWord(ctx);
|
||||
u16 blendTarget = FrontierScriptContext_ReadHalfWord(ctx);
|
||||
|
||||
v2 = sub_0209B970(ctx->unk_00->unk_00);
|
||||
v2 = sub_0209B970(ctx->scriptMan->unk_00);
|
||||
party = SaveData_GetParty(v2->saveData);
|
||||
mon = Party_GetPokemonBySlotIndex(party, slot);
|
||||
blendFraction = 8;
|
||||
|
|
@ -2596,7 +2593,7 @@ static BOOL FrontierScrCmd_45(FrontierScriptContext *ctx)
|
|||
|
||||
static BOOL FrontierScrCmd_46(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_0223C4CC *v0 = ov104_0222E924(ctx->unk_00);
|
||||
UnkStruct_ov104_0223C4CC *v0 = ov104_0222E924(ctx->scriptMan);
|
||||
u16 v1 = FrontierScriptContext_ReadHalfWord(ctx);
|
||||
|
||||
ov104_02232E80(v0, v1);
|
||||
|
|
@ -2605,7 +2602,7 @@ static BOOL FrontierScrCmd_46(FrontierScriptContext *ctx)
|
|||
|
||||
static BOOL FrontierScrCmd_47(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_0223C4CC *v0 = ov104_0222E924(ctx->unk_00);
|
||||
UnkStruct_ov104_0223C4CC *v0 = ov104_0222E924(ctx->scriptMan);
|
||||
u16 v1 = FrontierScriptContext_ReadHalfWord(ctx);
|
||||
s16 v2, v3;
|
||||
|
||||
|
|
@ -2619,7 +2616,7 @@ static BOOL FrontierScrCmd_47(FrontierScriptContext *ctx)
|
|||
|
||||
static BOOL ov104_02231E14(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_022320B4 *v0 = ctx->unk_00;
|
||||
FrontierScriptManager *v0 = ctx->scriptMan;
|
||||
UnkStruct_ov104_0223C4CC *v1 = sub_0209B974(v0->unk_00);
|
||||
|
||||
if (ctx->data[0] == 1) {
|
||||
|
|
@ -2634,7 +2631,7 @@ static BOOL FrontierScrCmd_IncrementRecordValue(FrontierScriptContext *ctx)
|
|||
UnkStruct_ov104_02230BE4 *v0;
|
||||
u16 recordID = FrontierScriptContext_ReadHalfWord(ctx);
|
||||
|
||||
v0 = sub_0209B970(ctx->unk_00->unk_00);
|
||||
v0 = sub_0209B970(ctx->scriptMan->unk_00);
|
||||
GameRecords_IncrementRecordValue(SaveData_GetGameRecords(v0->saveData), recordID);
|
||||
|
||||
return FALSE;
|
||||
|
|
@ -2646,7 +2643,7 @@ static BOOL FrontierScrCmd_AddToRecordValue(FrontierScriptContext *ctx)
|
|||
u16 recordID = FrontierScriptContext_ReadHalfWord(ctx);
|
||||
u16 value = FrontierScriptContext_GetVar(ctx);
|
||||
|
||||
v0 = sub_0209B970(ctx->unk_00->unk_00);
|
||||
v0 = sub_0209B970(ctx->scriptMan->unk_00);
|
||||
GameRecords_AddToRecordValue(SaveData_GetGameRecords(v0->saveData), recordID, value);
|
||||
|
||||
return FALSE;
|
||||
|
|
@ -2657,7 +2654,7 @@ static BOOL FrontierScrCmd_IncrementTrainerScore(FrontierScriptContext *ctx)
|
|||
UnkStruct_ov104_02230BE4 *v0;
|
||||
u16 scoreID = FrontierScriptContext_ReadHalfWord(ctx);
|
||||
|
||||
v0 = sub_0209B970(ctx->unk_00->unk_00);
|
||||
v0 = sub_0209B970(ctx->scriptMan->unk_00);
|
||||
GameRecords_IncrementTrainerScore(SaveData_GetGameRecords(v0->saveData), scoreID);
|
||||
|
||||
return FALSE;
|
||||
|
|
@ -2668,7 +2665,7 @@ static BOOL FrontierScrCmd_4B(FrontierScriptContext *ctx)
|
|||
UnkStruct_ov104_02230BE4 *v0;
|
||||
u16 *destVar = FrontierScriptContext_TryGetVarPointer(ctx);
|
||||
|
||||
v0 = sub_0209B970(ctx->unk_00->unk_00);
|
||||
v0 = sub_0209B970(ctx->scriptMan->unk_00);
|
||||
*destVar = sub_0205E6D8(v0->saveData);
|
||||
|
||||
return FALSE;
|
||||
|
|
@ -2684,7 +2681,7 @@ static BOOL FrontierScrCmd_71(FrontierScriptContext *ctx)
|
|||
|
||||
static BOOL FrontierScrCmd_SetWiFiListHostFriendCurrentDate(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_02230BE4 *v1 = sub_0209B970(ctx->unk_00->unk_00);
|
||||
UnkStruct_ov104_02230BE4 *v1 = sub_0209B970(ctx->scriptMan->unk_00);
|
||||
WiFiList *wiFiList = SaveData_GetWiFiList(v1->saveData);
|
||||
|
||||
WiFiList_SetHostFriendCurrentDate(wiFiList, NintendoWFC_GetHostFriendIdx());
|
||||
|
|
@ -2696,7 +2693,7 @@ static BOOL FrontierScrCmd_C8(FrontierScriptContext *ctx)
|
|||
u16 v0;
|
||||
TVBroadcast *broadcast;
|
||||
TrainerInfo *trainerInfo;
|
||||
UnkStruct_ov104_02230BE4 *v3 = sub_0209B970(ctx->unk_00->unk_00);
|
||||
UnkStruct_ov104_02230BE4 *v3 = sub_0209B970(ctx->scriptMan->unk_00);
|
||||
broadcast = SaveData_GetTVBroadcast(v3->saveData);
|
||||
v0 = FrontierScriptContext_GetVar(ctx);
|
||||
trainerInfo = CommInfo_TrainerInfo(1 - CommSys_CurNetId());
|
||||
|
|
@ -2715,16 +2712,16 @@ static BOOL FrontierScrCmd_C9(FrontierScriptContext *ctx)
|
|||
|
||||
static BOOL FrontierScrCmd_SetMenuXOriginSide(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_022320B4 *v0 = ctx->unk_00;
|
||||
FrontierScriptManager *scriptMan = ctx->scriptMan;
|
||||
u8 isRightSide = FrontierScriptContext_ReadByte(ctx);
|
||||
FrontierMenuManager_SetHorizontalAnchor(v0->unk_60, isRightSide);
|
||||
FrontierMenuManager_SetHorizontalAnchor(scriptMan->menuMan, isRightSide);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL FrontierScrCmd_SetMenuYOriginSide(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_022320B4 *v0 = ctx->unk_00;
|
||||
FrontierScriptManager *scriptMan = ctx->scriptMan;
|
||||
u8 isBottomSide = FrontierScriptContext_ReadByte(ctx);
|
||||
FrontierMenuManager_SetVerticalAnchor(v0->unk_60, isBottomSide);
|
||||
FrontierMenuManager_SetVerticalAnchor(scriptMan->menuMan, isBottomSide);
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,223 +0,0 @@
|
|||
#include "overlay104/ov104_0222E63C.h"
|
||||
|
||||
#include <nitro.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "struct_decls/struct_0209B75C_decl.h"
|
||||
|
||||
#include "overlay104/frontier_script_context.h"
|
||||
#include "overlay104/frscrcmd.h"
|
||||
#include "overlay104/ov104_0222EA90.h"
|
||||
#include "overlay104/ov104_0223D860.h"
|
||||
#include "overlay104/struct_ov104_0222E8C8.h"
|
||||
#include "overlay104/struct_ov104_022320B4_decl.h"
|
||||
#include "overlay104/struct_ov104_022320B4_t.h"
|
||||
#include "overlay104/struct_ov104_0223C4CC.h"
|
||||
|
||||
#include "heap.h"
|
||||
#include "message.h"
|
||||
#include "narc.h"
|
||||
#include "string_gf.h"
|
||||
#include "string_template.h"
|
||||
#include "unk_0209B6F8.h"
|
||||
|
||||
static BOOL ov104_0222E7CC(UnkStruct_ov104_022320B4 *param0, FrontierScriptContext *param1);
|
||||
static void ov104_0222E7FC(UnkStruct_ov104_022320B4 *param0, FrontierScriptContext *param1);
|
||||
static void ov104_0222E82C(UnkStruct_ov104_022320B4 *param0, u16 param1, u32 *param2, void *param3);
|
||||
static void ov104_0222E830(u8 **param0, MessageLoader **param1, int param2, enum HeapID heapID);
|
||||
static void ov104_0222E904(FrontierScriptContext *param0, int param1);
|
||||
|
||||
UnkStruct_ov104_022320B4 *ov104_0222E63C(UnkStruct_0209B75C *param0, enum HeapID heapID, int param2)
|
||||
{
|
||||
UnkStruct_ov104_022320B4 *v0 = Heap_Alloc(heapID, sizeof(UnkStruct_ov104_022320B4));
|
||||
MI_CpuClear8(v0, sizeof(UnkStruct_ov104_022320B4));
|
||||
|
||||
v0->unk_00 = param0;
|
||||
v0->heapID = heapID;
|
||||
v0->unk_52 = param2;
|
||||
|
||||
ov104_0222E830(&v0->unk_40, &v0->unk_3C, param2, heapID);
|
||||
|
||||
v0->strTemplate = StringTemplate_New(8, 64, heapID);
|
||||
v0->string = String_Init(1024, heapID);
|
||||
v0->fmtString = String_Init(1024, heapID);
|
||||
|
||||
ov104_0222E82C(v0, param2, NULL, NULL);
|
||||
|
||||
return v0;
|
||||
}
|
||||
|
||||
BOOL ov104_0222E6A8(UnkStruct_ov104_022320B4 *param0)
|
||||
{
|
||||
int v0;
|
||||
FrontierScriptContext *v1;
|
||||
|
||||
if (param0->unk_51 == 0) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
switch (param0->unk_38) {
|
||||
case 0:
|
||||
for (v0 = 0; v0 < 8; v0++) {
|
||||
v1 = param0->unk_04[v0];
|
||||
|
||||
if (v1 != NULL) {
|
||||
if (FrontierScriptContext_Run(v1) == 0) {
|
||||
ov104_0222E7FC(param0, v1);
|
||||
param0->unk_04[v0] = NULL;
|
||||
param0->unk_51--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ov104_0223D8C4(param0->unk_00);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (param0->unk_51 == 0) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ov104_0222E710(UnkStruct_ov104_022320B4 *param0)
|
||||
{
|
||||
GF_ASSERT(param0->unk_51 == 0);
|
||||
|
||||
StringTemplate_Free(param0->strTemplate);
|
||||
String_Free(param0->string);
|
||||
String_Free(param0->fmtString);
|
||||
Heap_Free(param0->unk_40);
|
||||
MessageLoader_Free(param0->unk_3C);
|
||||
|
||||
Heap_Free(param0);
|
||||
}
|
||||
|
||||
void ov104_0222E748(UnkStruct_ov104_022320B4 *param0, int param1, int param2)
|
||||
{
|
||||
FrontierScriptContext *ctx = Heap_Alloc(param0->heapID, sizeof(FrontierScriptContext));
|
||||
MI_CpuClear8(ctx, sizeof(FrontierScriptContext));
|
||||
|
||||
FrontierScriptContext_Init(ctx, gFrontierScrCmdFuncs, gFrontierScrCmdFuncsCount);
|
||||
|
||||
ctx->unk_00 = param0;
|
||||
|
||||
if ((param1 == 0xffff) || (param0->unk_52 == param1)) {
|
||||
ctx->scripts = param0->unk_40;
|
||||
ctx->msgLoader = param0->unk_3C;
|
||||
} else {
|
||||
ov104_0222E830(&ctx->scripts, &ctx->msgLoader, param1, param0->heapID);
|
||||
}
|
||||
|
||||
FrontierScriptContext_Start(ctx, ctx->scripts);
|
||||
ov104_0222E904(ctx, param2);
|
||||
ov104_0222E7CC(param0, ctx);
|
||||
}
|
||||
|
||||
static BOOL ov104_0222E7CC(UnkStruct_ov104_022320B4 *param0, FrontierScriptContext *param1)
|
||||
{
|
||||
int v0;
|
||||
|
||||
for (v0 = 0; v0 < 8; v0++) {
|
||||
if (param0->unk_04[v0] == NULL) {
|
||||
param0->unk_04[v0] = param1;
|
||||
param0->unk_51++;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
GF_ASSERT(FALSE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void ov104_0222E7FC(UnkStruct_ov104_022320B4 *param0, FrontierScriptContext *param1)
|
||||
{
|
||||
if (param1->msgLoader != param0->unk_3C) {
|
||||
MessageLoader_Free(param1->msgLoader);
|
||||
}
|
||||
|
||||
if (param1->scripts != param0->unk_40) {
|
||||
Heap_Free(param1->scripts);
|
||||
}
|
||||
|
||||
Heap_Free(param1);
|
||||
}
|
||||
|
||||
static void ov104_0222E82C(UnkStruct_ov104_022320B4 *param0, u16 param1, u32 *param2, void *param3)
|
||||
{
|
||||
if (param2 != NULL) {
|
||||
(void)0;
|
||||
}
|
||||
}
|
||||
|
||||
static void ov104_0222E830(u8 **param0, MessageLoader **param1, int param2, enum HeapID heapID)
|
||||
{
|
||||
int scriptID = GetFrontierSceneValue(param2, FR_SCENE_SCRIPT_ID);
|
||||
int bankID = GetFrontierSceneValue(param2, FR_SCENE_BANK_ID);
|
||||
|
||||
*param0 = NARC_AllocAndReadWholeMemberByIndexPair(NARC_INDEX_FRONTIER__SCRIPT__FR_SCRIPT, scriptID, heapID);
|
||||
*param1 = MessageLoader_Init(MSG_LOADER_LOAD_ON_DEMAND, NARC_INDEX_MSGDATA__PL_MSG, bankID, heapID);
|
||||
}
|
||||
|
||||
void ov104_0222E86C(UnkStruct_ov104_022320B4 *param0, int param1, enum HeapID heapID)
|
||||
{
|
||||
int v0;
|
||||
FrontierScriptContext *v1;
|
||||
int v2, v3;
|
||||
MessageLoader *v4;
|
||||
|
||||
v2 = GetFrontierSceneValue(param0->unk_52, FR_SCENE_BANK_ID);
|
||||
v3 = GetFrontierSceneValue(param1, FR_SCENE_BANK_ID);
|
||||
|
||||
if (v2 == v3) {
|
||||
return;
|
||||
}
|
||||
|
||||
v4 = MessageLoader_Init(MSG_LOADER_LOAD_ON_DEMAND, NARC_INDEX_MSGDATA__PL_MSG, v3, heapID);
|
||||
|
||||
for (v0 = 0; v0 < 8; v0++) {
|
||||
v1 = param0->unk_04[v0];
|
||||
|
||||
if (v1 != NULL) {
|
||||
if (v1->msgLoader == param0->unk_3C) {
|
||||
v1->msgLoader = v4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MessageLoader_Free(param0->unk_3C);
|
||||
param0->unk_3C = v4;
|
||||
}
|
||||
|
||||
UnkStruct_ov104_0222E8C8 *ov104_0222E8C8(UnkStruct_ov104_022320B4 *param0, enum HeapID heapID)
|
||||
{
|
||||
UnkStruct_ov104_0222E8C8 *v0 = Heap_Alloc(heapID, sizeof(UnkStruct_ov104_0222E8C8));
|
||||
*v0 = param0->unk_24;
|
||||
|
||||
return v0;
|
||||
}
|
||||
|
||||
void ov104_0222E8E8(UnkStruct_ov104_022320B4 *param0, UnkStruct_ov104_0222E8C8 *param1)
|
||||
{
|
||||
param0->unk_24 = *param1;
|
||||
Heap_Free(param1);
|
||||
}
|
||||
|
||||
static void ov104_0222E904(FrontierScriptContext *param0, int param1)
|
||||
{
|
||||
param0->scriptPtr += (param1 * 4);
|
||||
param0->scriptPtr += FrontierScriptContext_ReadWord(param0);
|
||||
}
|
||||
|
||||
u16 *ov104_0222E91C(UnkStruct_ov104_022320B4 *param0, int param1)
|
||||
{
|
||||
return ¶m0->unk_24.unk_00[param1];
|
||||
}
|
||||
|
||||
UnkStruct_ov104_0223C4CC *ov104_0222E924(UnkStruct_ov104_022320B4 *param0)
|
||||
{
|
||||
return sub_0209B974(param0->unk_00);
|
||||
}
|
||||
|
|
@ -14,12 +14,11 @@
|
|||
#include "overlay063/ov63_0222D77C.h"
|
||||
#include "overlay063/struct_ov63_0222BEC0_decl.h"
|
||||
#include "overlay063/struct_ov63_0222CCB8.h"
|
||||
#include "overlay104/defs.h"
|
||||
#include "overlay104/frontier_script_context.h"
|
||||
#include "overlay104/ov104_0222E63C.h"
|
||||
#include "overlay104/frontier_script_manager.h"
|
||||
#include "overlay104/struct_ov104_0222FEDC.h"
|
||||
#include "overlay104/struct_ov104_02230BE4.h"
|
||||
#include "overlay104/struct_ov104_022320B4_decl.h"
|
||||
#include "overlay104/struct_ov104_022320B4_t.h"
|
||||
#include "overlay104/struct_ov104_02232B78.h"
|
||||
#include "overlay104/struct_ov104_0223319C.h"
|
||||
#include "overlay104/struct_ov104_022331E8.h"
|
||||
|
|
@ -65,10 +64,10 @@ typedef struct {
|
|||
u16 unk_02;
|
||||
} UnkStruct_ov104_022419A0;
|
||||
|
||||
static void OpenMessageBox(UnkStruct_ov104_022320B4 *param0);
|
||||
static void GetMessage(UnkStruct_ov104_022320B4 *param0, const MessageLoader *msgLoader, u32 entryID);
|
||||
static void PrintMessage(UnkStruct_ov104_022320B4 *param0, enum Font font, int renderDelay, BOOL canSpeedUp, int autoScroll);
|
||||
static void FrontierMenuManager_Init(UnkStruct_ov104_022320B4 *param0, FrontierMenuManager *menuManager, u8 anchorX, u8 anchorY, u8 initialCursorPos, u8 canExitWithB, u16 *selectedOptionPtr, StringTemplate *strTemplate, MessageLoader *msgLoader);
|
||||
static void OpenMessageBox(FrontierScriptManager *scriptMan);
|
||||
static void GetMessage(FrontierScriptManager *scriptMan, const MessageLoader *msgLoader, u32 entryID);
|
||||
static void PrintMessage(FrontierScriptManager *scriptMan, enum Font font, int renderDelay, BOOL canSpeedUp, int autoScroll);
|
||||
static void FrontierMenuManager_Init(FrontierScriptManager *scriptMan, FrontierMenuManager *menuManager, u8 anchorX, u8 anchorY, u8 initialCursorPos, u8 canExitWithB, u16 *selectedOptionPtr, StringTemplate *strTemplate, MessageLoader *msgLoader);
|
||||
static void AddMenuEntry(FrontierMenuManager *menuManager, u32 entryID, u32 altTextEntryID, u32 index);
|
||||
static u32 CalcMenuWidth(FrontierMenuManager *menuManager);
|
||||
static void SetupSingleColumnMenu(FrontierMenuManager *menuManager);
|
||||
|
|
@ -76,11 +75,11 @@ static void MenuSysTaskCallback(SysTask *task, void *data);
|
|||
static void FreeManagerWithMenu(FrontierMenuManager *menuManager);
|
||||
static void UpdateMenuAltText(FrontierMenuManager *menuManager);
|
||||
static void PrintListMenuAltText(FrontierMenuManager *menuManager, u16 entryID, u32 printerDelay);
|
||||
static void ShowSentence(UnkStruct_ov104_022320B4 *param0, u8 renderDelay, u16 sentenceType, u16 sentenceID, u16 word1, s16 word2, u8 canSpeedUp);
|
||||
static void ShowSentence(FrontierScriptManager *scriptMan, u8 renderDelay, u16 sentenceType, u16 sentenceID, u16 word1, s16 word2, u8 canSpeedUp);
|
||||
static void GetStringFromSentence(String *msgBuf, u16 sentenceType, u16 sentenceID, u16 word1, u16 word2);
|
||||
static BOOL WaitForFinishedPrinting(FrontierScriptContext *ctx);
|
||||
static void AddListMenuEntry(FrontierMenuManager *menuManager, u32 entryID, u32 altTextEntryID, u32 index);
|
||||
static u32 CalcListMenuWidth(FrontierMenuManager *menuManager);
|
||||
static u32 CalcListMenuWidth(FrontierMenuManager *param0);
|
||||
static void InitListMenuTemplate(FrontierMenuManager *menuManager);
|
||||
static void SetListMenuItemAltColor(ListMenu *listMenu, u32 index, u8 yOffset);
|
||||
static void ListMenuDummyCursorCallback(ListMenu *listMenu, u32 index, u8 onInit);
|
||||
|
|
@ -88,17 +87,17 @@ static void ListMenuSysTaskCallback(SysTask *task, void *data);
|
|||
static void FreeManagerWithListMenu(FrontierMenuManager *menuManager, u8 playSound);
|
||||
static void UpdateListMenuAltText(FrontierMenuManager *menuManager);
|
||||
|
||||
void FrontierShowMessage(UnkStruct_ov104_022320B4 *param0, const MessageLoader *msgLoader, u16 messageID, u8 canSpeedUp, FrontierMessageOptions *msgOptions)
|
||||
void FrontierShowMessage(FrontierScriptManager *scriptMan, const MessageLoader *msgLoader, u16 messageID, u8 canSpeedUp, FrontierMessageOptions *msgOptions)
|
||||
{
|
||||
u8 renderDelay;
|
||||
u8 autoScroll;
|
||||
u8 font;
|
||||
|
||||
OpenMessageBox(param0);
|
||||
GetMessage(param0, msgLoader, messageID);
|
||||
OpenMessageBox(scriptMan);
|
||||
GetMessage(scriptMan, msgLoader, messageID);
|
||||
|
||||
if (msgOptions == NULL) {
|
||||
UnkStruct_ov104_0223C4CC *v3 = ov104_0222E924(param0);
|
||||
UnkStruct_ov104_0223C4CC *v3 = ov104_0222E924(scriptMan);
|
||||
UnkStruct_ov104_02230BE4 *v4 = sub_0209B970(v3->unk_08);
|
||||
|
||||
renderDelay = Options_TextFrameDelay(v4->options);
|
||||
|
|
@ -110,59 +109,59 @@ void FrontierShowMessage(UnkStruct_ov104_022320B4 *param0, const MessageLoader *
|
|||
font = msgOptions->font;
|
||||
}
|
||||
|
||||
PrintMessage(param0, font, renderDelay, canSpeedUp, autoScroll);
|
||||
PrintMessage(scriptMan, font, renderDelay, canSpeedUp, autoScroll);
|
||||
}
|
||||
|
||||
static void OpenMessageBox(UnkStruct_ov104_022320B4 *param0)
|
||||
static void OpenMessageBox(FrontierScriptManager *scriptMan)
|
||||
{
|
||||
UnkStruct_ov104_0223C4CC *v0 = ov104_0222E924(param0);
|
||||
UnkStruct_ov104_0223C4CC *v0 = ov104_0222E924(scriptMan);
|
||||
|
||||
if (param0->isMsgBoxOpen == FALSE) {
|
||||
if (scriptMan->isMsgBoxOpen == FALSE) {
|
||||
Window_Add(
|
||||
v0->unk_00, ¶m0->msgWindow, BG_LAYER_MAIN_1, 2, 19, 27, 4, 13, BASE_TILE_STANDARD_WINDOW_FRAME - MESSAGE_WINDOW_TILE_COUNT);
|
||||
Window_FillTilemap(¶m0->msgWindow, 15);
|
||||
Window_DrawMessageBoxWithScrollCursor(¶m0->msgWindow, 0, BASE_TILE_SCROLLING_MESSAGE_BOX, 11);
|
||||
v0->unk_00, &scriptMan->msgWindow, BG_LAYER_MAIN_1, 2, 19, 27, 4, 13, BASE_TILE_STANDARD_WINDOW_FRAME - MESSAGE_WINDOW_TILE_COUNT);
|
||||
Window_FillTilemap(&scriptMan->msgWindow, 15);
|
||||
Window_DrawMessageBoxWithScrollCursor(&scriptMan->msgWindow, 0, BASE_TILE_SCROLLING_MESSAGE_BOX, 11);
|
||||
|
||||
param0->isMsgBoxOpen = TRUE;
|
||||
scriptMan->isMsgBoxOpen = TRUE;
|
||||
} else {
|
||||
Window_FillTilemap(¶m0->msgWindow, 15);
|
||||
Window_FillTilemap(&scriptMan->msgWindow, 15);
|
||||
}
|
||||
}
|
||||
|
||||
static void GetMessage(UnkStruct_ov104_022320B4 *param0, const MessageLoader *msgLoader, u32 entryID)
|
||||
static void GetMessage(FrontierScriptManager *scriptMan, const MessageLoader *msgLoader, u32 entryID)
|
||||
{
|
||||
MessageLoader_GetString(msgLoader, entryID, param0->fmtString);
|
||||
StringTemplate_Format(param0->strTemplate, param0->string, param0->fmtString);
|
||||
MessageLoader_GetString(msgLoader, entryID, scriptMan->fmtString);
|
||||
StringTemplate_Format(scriptMan->strTemplate, scriptMan->string, scriptMan->fmtString);
|
||||
}
|
||||
|
||||
static void PrintMessage(UnkStruct_ov104_022320B4 *param0, enum Font font, int renderDelay, BOOL canSpeedUp, int autoScroll)
|
||||
static void PrintMessage(FrontierScriptManager *scriptMan, enum Font font, int renderDelay, BOOL canSpeedUp, int autoScroll)
|
||||
{
|
||||
RenderControlFlags_SetCanABSpeedUpPrint(canSpeedUp);
|
||||
RenderControlFlags_SetAutoScrollFlags(autoScroll);
|
||||
RenderControlFlags_SetSpeedUpOnTouch(FALSE);
|
||||
param0->printerID = Text_AddPrinterWithParams(¶m0->msgWindow, font, param0->string, 0, 0, renderDelay, NULL);
|
||||
scriptMan->printerID = Text_AddPrinterWithParams(&scriptMan->msgWindow, font, scriptMan->string, 0, 0, renderDelay, NULL);
|
||||
}
|
||||
|
||||
void Frontier_CloseMessage(UnkStruct_ov104_022320B4 *param0)
|
||||
void Frontier_CloseMessage(FrontierScriptManager *scriptMan)
|
||||
{
|
||||
GF_ASSERT(param0->isMsgBoxOpen == TRUE);
|
||||
GF_ASSERT(scriptMan->isMsgBoxOpen == TRUE);
|
||||
|
||||
Window_EraseMessageBox(¶m0->msgWindow, FALSE);
|
||||
Window_Remove(¶m0->msgWindow);
|
||||
Window_EraseMessageBox(&scriptMan->msgWindow, FALSE);
|
||||
Window_Remove(&scriptMan->msgWindow);
|
||||
|
||||
param0->isMsgBoxOpen = FALSE;
|
||||
scriptMan->isMsgBoxOpen = FALSE;
|
||||
}
|
||||
|
||||
static void ShowSentence(UnkStruct_ov104_022320B4 *param0, u8 renderDelay, u16 sentenceType, u16 sentenceID, u16 word1, s16 word2, u8 canSpeedUp)
|
||||
static void ShowSentence(FrontierScriptManager *scriptMan, u8 renderDelay, u16 sentenceType, u16 sentenceID, u16 word1, s16 word2, u8 canSpeedUp)
|
||||
{
|
||||
OpenMessageBox(param0);
|
||||
OpenMessageBox(scriptMan);
|
||||
|
||||
GetStringFromSentence(param0->string, sentenceType, sentenceID, word1, word2);
|
||||
GetStringFromSentence(scriptMan->string, sentenceType, sentenceID, word1, word2);
|
||||
|
||||
if (canSpeedUp != 0xFF) {
|
||||
PrintMessage(param0, FONT_MESSAGE, renderDelay, canSpeedUp, AUTO_SCROLL_DISABLED);
|
||||
PrintMessage(scriptMan, FONT_MESSAGE, renderDelay, canSpeedUp, AUTO_SCROLL_DISABLED);
|
||||
} else {
|
||||
PrintMessage(param0, FONT_MESSAGE, TEXT_SPEED_INSTANT, canSpeedUp, AUTO_SCROLL_DISABLED);
|
||||
PrintMessage(scriptMan, FONT_MESSAGE, TEXT_SPEED_INSTANT, canSpeedUp, AUTO_SCROLL_DISABLED);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -181,12 +180,12 @@ static void GetStringFromSentence(String *msgBuf, u16 sentenceType, u16 sentence
|
|||
String_Free(string);
|
||||
}
|
||||
|
||||
static void FrontierMenuManager_Init(UnkStruct_ov104_022320B4 *param0, FrontierMenuManager *menuManager, u8 anchorX, u8 anchorY, u8 initialCursorPos, u8 canExitWithB, u16 *selectedOptionPtr, StringTemplate *strTemplate, MessageLoader *msgLoader)
|
||||
static void FrontierMenuManager_Init(FrontierScriptManager *scriptMan, FrontierMenuManager *menuManager, u8 anchorX, u8 anchorY, u8 initialCursorPos, u8 canExitWithB, u16 *selectedOptionPtr, StringTemplate *strTemplate, MessageLoader *msgLoader)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (msgLoader == NULL) {
|
||||
menuManager->msgLoader = MessageLoader_Init(MSG_LOADER_LOAD_ON_DEMAND, NARC_INDEX_MSGDATA__PL_MSG, TEXT_BANK_MENU_ENTRIES, param0->heapID);
|
||||
menuManager->msgLoader = MessageLoader_Init(MSG_LOADER_LOAD_ON_DEMAND, NARC_INDEX_MSGDATA__PL_MSG, TEXT_BANK_MENU_ENTRIES, scriptMan->heapID);
|
||||
menuManager->freeMsgLoaderOnDelete = TRUE;
|
||||
} else {
|
||||
menuManager->msgLoader = msgLoader;
|
||||
|
|
@ -194,7 +193,7 @@ static void FrontierMenuManager_Init(UnkStruct_ov104_022320B4 *param0, FrontierM
|
|||
}
|
||||
|
||||
menuManager->strTemplate = strTemplate;
|
||||
menuManager->unk_00 = param0;
|
||||
menuManager->scriptMan = scriptMan;
|
||||
menuManager->selectedOptionPtr = selectedOptionPtr;
|
||||
|
||||
*menuManager->selectedOptionPtr = 0;
|
||||
|
|
@ -204,7 +203,7 @@ static void FrontierMenuManager_Init(UnkStruct_ov104_022320B4 *param0, FrontierM
|
|||
menuManager->anchorX = anchorX;
|
||||
menuManager->anchorY = anchorY;
|
||||
menuManager->optionCount = 0;
|
||||
menuManager->parent = ¶m0->msgWindow;
|
||||
menuManager->parent = &scriptMan->msgWindow;
|
||||
menuManager->sysTaskDelay = 3;
|
||||
menuManager->cursorPos = initialCursorPos;
|
||||
|
||||
|
|
@ -220,15 +219,15 @@ static void FrontierMenuManager_Init(UnkStruct_ov104_022320B4 *param0, FrontierM
|
|||
}
|
||||
|
||||
for (i = 0; i < FRONTIER_MENU_ENTRIES_MAX; i++) {
|
||||
menuManager->choiceStringBuffers[i] = String_Init(80, param0->heapID);
|
||||
menuManager->choiceStringBuffers[i] = String_Init(80, scriptMan->heapID);
|
||||
}
|
||||
|
||||
*menuManager->selectedOptionPtr = LIST_MENU_NO_SELECTION_YET;
|
||||
}
|
||||
|
||||
FrontierMenuManager *FrontierMenuManager_New(UnkStruct_ov104_022320B4 *param0, u8 anchorX, u8 anchorY, u8 initalCursorPos, u8 canExitWithB, u16 *selectedOptionPtr, StringTemplate *strTemplate, MessageLoader *msgLoader)
|
||||
FrontierMenuManager *FrontierMenuManager_New(FrontierScriptManager *scriptMan, u8 anchorX, u8 anchorY, u8 initalCursorPos, u8 canExitWithB, u16 *selectedOptionPtr, StringTemplate *strTemplate, MessageLoader *msgLoader)
|
||||
{
|
||||
FrontierMenuManager *menuManager = Heap_Alloc(param0->heapID, sizeof(FrontierMenuManager));
|
||||
FrontierMenuManager *menuManager = Heap_Alloc(scriptMan->heapID, sizeof(FrontierMenuManager));
|
||||
|
||||
if (menuManager == NULL) {
|
||||
return NULL;
|
||||
|
|
@ -236,7 +235,7 @@ FrontierMenuManager *FrontierMenuManager_New(UnkStruct_ov104_022320B4 *param0, u
|
|||
|
||||
memset(menuManager, 0, sizeof(FrontierMenuManager));
|
||||
|
||||
FrontierMenuManager_Init(param0, menuManager, anchorX, anchorY, initalCursorPos, canExitWithB, selectedOptionPtr, strTemplate, msgLoader);
|
||||
FrontierMenuManager_Init(scriptMan, menuManager, anchorX, anchorY, initalCursorPos, canExitWithB, selectedOptionPtr, strTemplate, msgLoader);
|
||||
|
||||
return menuManager;
|
||||
}
|
||||
|
|
@ -249,7 +248,7 @@ void FrontierMenuManager_AddMenuEntry(FrontierMenuManager *menuManager, u32 entr
|
|||
void FrontierMenuManager_ShowMenu(FrontierMenuManager *menuManager)
|
||||
{
|
||||
u32 menuWidth;
|
||||
UnkStruct_ov104_0223C4CC *v1 = ov104_0222E924(menuManager->unk_00);
|
||||
UnkStruct_ov104_0223C4CC *v1 = ov104_0222E924(menuManager->scriptMan);
|
||||
|
||||
menuWidth = CalcMenuWidth(menuManager);
|
||||
if (menuWidth % TILE_WIDTH_PIXELS == 0) {
|
||||
|
|
@ -268,14 +267,14 @@ void FrontierMenuManager_ShowMenu(FrontierMenuManager *menuManager)
|
|||
Window_Add(v1->unk_00, &menuManager->window, BG_LAYER_MAIN_1, menuManager->anchorX, menuManager->anchorY, menuWidth, menuManager->optionCount * 2, 14, 1);
|
||||
Window_DrawStandardFrame(&menuManager->window, TRUE, 985, PLTT_12);
|
||||
SetupSingleColumnMenu(menuManager);
|
||||
menuManager->menu = Menu_NewSimple(&menuManager->menuTemplate, menuManager->initialCursorPos, menuManager->unk_00->heapID);
|
||||
menuManager->menu = Menu_NewSimple(&menuManager->menuTemplate, menuManager->initialCursorPos, menuManager->scriptMan->heapID);
|
||||
UpdateMenuAltText(menuManager);
|
||||
menuManager->sysTask = SysTask_Start(MenuSysTaskCallback, menuManager, 0);
|
||||
}
|
||||
|
||||
static void AddMenuEntry(FrontierMenuManager *menuManager, u32 entryID, u32 altTextEntryID, u32 index)
|
||||
{
|
||||
String *entryBuf = String_Init(80, menuManager->unk_00->heapID);
|
||||
String *entryBuf = String_Init(80, menuManager->scriptMan->heapID);
|
||||
|
||||
MessageLoader_GetString(menuManager->msgLoader, entryID, entryBuf);
|
||||
StringTemplate_Format(menuManager->strTemplate, menuManager->choiceStringBuffers[menuManager->optionCount], entryBuf);
|
||||
|
|
@ -391,9 +390,9 @@ static void UpdateMenuAltText(FrontierMenuManager *menuManager)
|
|||
}
|
||||
}
|
||||
|
||||
FrontierMenuManager *FrontierMenuManager_New2(UnkStruct_ov104_022320B4 *param0, u8 anchorX, u8 anchorY, u8 initialCursorPos, u8 canExitWithB, u16 *selectedOptionPtr, StringTemplate *strTemplate, MessageLoader *msgLoader)
|
||||
FrontierMenuManager *FrontierMenuManager_New2(FrontierScriptManager *scriptMan, u8 anchorX, u8 anchorY, u8 initialCursorPos, u8 canExitWithB, u16 *selectedOptionPtr, StringTemplate *strTemplate, MessageLoader *msgLoader)
|
||||
{
|
||||
return FrontierMenuManager_New(param0, anchorX, anchorY, initialCursorPos, canExitWithB, selectedOptionPtr, strTemplate, msgLoader);
|
||||
return FrontierMenuManager_New(scriptMan, anchorX, anchorY, initialCursorPos, canExitWithB, selectedOptionPtr, strTemplate, msgLoader);
|
||||
}
|
||||
|
||||
void FrontierMenuManager_AddListMenuEntry(FrontierMenuManager *menuManager, u32 entry, u32 altTextEntryID, u32 index)
|
||||
|
|
@ -403,7 +402,7 @@ void FrontierMenuManager_AddListMenuEntry(FrontierMenuManager *menuManager, u32
|
|||
|
||||
void FrontierMenuManager_ShowListMenu(FrontierMenuManager *menuManager)
|
||||
{
|
||||
UnkStruct_ov104_0223C4CC *v1 = ov104_0222E924(menuManager->unk_00);
|
||||
UnkStruct_ov104_0223C4CC *v1 = ov104_0222E924(menuManager->scriptMan);
|
||||
|
||||
u32 menuWidth = CalcListMenuWidth(menuManager);
|
||||
if (menuWidth % TILE_WIDTH_PIXELS == 0) {
|
||||
|
|
@ -429,14 +428,14 @@ void FrontierMenuManager_ShowListMenu(FrontierMenuManager *menuManager)
|
|||
}
|
||||
Window_DrawStandardFrame(&menuManager->window, 1, 985, PLTT_12);
|
||||
InitListMenuTemplate(menuManager);
|
||||
menuManager->listMenu = ListMenu_New(&menuManager->listMenuTemplate, 0, menuManager->initialCursorPos, menuManager->unk_00->heapID);
|
||||
menuManager->listMenu = ListMenu_New(&menuManager->listMenuTemplate, 0, menuManager->initialCursorPos, menuManager->scriptMan->heapID);
|
||||
UpdateListMenuAltText(menuManager);
|
||||
menuManager->sysTask = SysTask_Start(ListMenuSysTaskCallback, menuManager, 0);
|
||||
}
|
||||
|
||||
static void AddListMenuEntry(FrontierMenuManager *menuManager, u32 entryID, u32 altTextEntryID, u32 index)
|
||||
{
|
||||
String *fmtStr = String_Init(80, menuManager->unk_00->heapID);
|
||||
String *fmtStr = String_Init(80, menuManager->scriptMan->heapID);
|
||||
|
||||
MessageLoader_GetString(menuManager->msgLoader, entryID, fmtStr);
|
||||
StringTemplate_Format(menuManager->strTemplate, menuManager->choiceStringBuffers[menuManager->optionCount], fmtStr);
|
||||
|
|
@ -585,8 +584,8 @@ static void FreeManagerWithListMenu(FrontierMenuManager *menuManager, u8 playSou
|
|||
|
||||
static void PrintListMenuAltText(FrontierMenuManager *menuManager, u16 entryID, u32 printerDelay)
|
||||
{
|
||||
String *fmtStr = String_Init(80, menuManager->unk_00->heapID);
|
||||
String *displayStr = String_Init(80, menuManager->unk_00->heapID);
|
||||
String *fmtStr = String_Init(80, menuManager->scriptMan->heapID);
|
||||
String *displayStr = String_Init(80, menuManager->scriptMan->heapID);
|
||||
|
||||
Window_FillTilemap(menuManager->parent, 15);
|
||||
|
||||
|
|
@ -954,16 +953,16 @@ void ov104_022330FC(FrontierScriptContext *ctx, u16 *args)
|
|||
void ov104_0223310C(FrontierScriptContext *ctx, u16 *args, u32 bankID)
|
||||
{
|
||||
MessageLoader *msgLoader;
|
||||
UnkStruct_ov104_02230BE4 *v2 = sub_0209B970(ctx->unk_00->unk_00);
|
||||
UnkStruct_ov104_02230BE4 *v2 = sub_0209B970(ctx->scriptMan->unk_00);
|
||||
|
||||
if (args[0] == 0xFFFF) {
|
||||
msgLoader = MessageLoader_Init(MSG_LOADER_LOAD_ON_DEMAND, NARC_INDEX_MSGDATA__PL_MSG, bankID, HEAP_ID_FIELD3);
|
||||
|
||||
FrontierShowMessage(ctx->unk_00, msgLoader, args[1], 1, NULL);
|
||||
FrontierShowMessage(ctx->scriptMan, msgLoader, args[1], 1, NULL);
|
||||
MessageLoader_Free(msgLoader);
|
||||
} else {
|
||||
u8 frameDelay = Options_TextFrameDelay(SaveData_GetOptions(v2->saveData));
|
||||
ShowSentence(ctx->unk_00, frameDelay, args[0], args[1], args[2], args[3], TRUE);
|
||||
ShowSentence(ctx->scriptMan, frameDelay, args[0], args[1], args[2], args[3], TRUE);
|
||||
}
|
||||
|
||||
FrontierScriptContext_Pause(ctx, WaitForFinishedPrinting);
|
||||
|
|
@ -971,7 +970,7 @@ void ov104_0223310C(FrontierScriptContext *ctx, u16 *args, u32 bankID)
|
|||
|
||||
static BOOL WaitForFinishedPrinting(FrontierScriptContext *ctx)
|
||||
{
|
||||
if (!Text_IsPrinterActive(ctx->unk_00->printerID)) {
|
||||
if (!Text_IsPrinterActive(ctx->scriptMan->printerID)) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,14 +5,13 @@
|
|||
|
||||
#include "applications/frontier/battle_factory/main.h"
|
||||
#include "overlay104/frontier_script_context.h"
|
||||
#include "overlay104/frontier_script_manager.h"
|
||||
#include "overlay104/frscrcmd.h"
|
||||
#include "overlay104/ov104_0222DCE0.h"
|
||||
#include "overlay104/ov104_0222E63C.h"
|
||||
#include "overlay104/ov104_02231F74.h"
|
||||
#include "overlay104/ov104_022339B4.h"
|
||||
#include "overlay104/ov104_0223A7F4.h"
|
||||
#include "overlay104/struct_ov104_02230BE4.h"
|
||||
#include "overlay104/struct_ov104_022320B4_t.h"
|
||||
#include "overlay104/struct_ov104_02234130.h"
|
||||
#include "overlay104/struct_ov104_0223ADA0.h"
|
||||
#include "overlay104/struct_ov104_0223C4CC.h"
|
||||
|
|
@ -48,10 +47,10 @@ BOOL FrontierScrCmd_5C(FrontierScriptContext *param0)
|
|||
u16 v3 = FrontierScriptContext_GetVar(param0);
|
||||
u16 v4 = FrontierScriptContext_GetVar(param0);
|
||||
|
||||
v1 = sub_0209B970(param0->unk_00->unk_00);
|
||||
v1 = sub_0209B970(param0->scriptMan->unk_00);
|
||||
v0 = ov104_022339B4(v1->saveData, v2, v3, v4);
|
||||
|
||||
sub_0209B980(param0->unk_00->unk_00, v0);
|
||||
sub_0209B980(param0->scriptMan->unk_00, v0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -61,7 +60,7 @@ BOOL FrontierScrCmd_5D(FrontierScriptContext *param0)
|
|||
UnkStruct_ov104_0223ADA0 *v0;
|
||||
u16 v1 = FrontierScriptContext_GetVar(param0);
|
||||
|
||||
v0 = sub_0209B978(param0->unk_00->unk_00);
|
||||
v0 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
ov104_02233B98(v0, v1);
|
||||
|
||||
return 0;
|
||||
|
|
@ -69,7 +68,7 @@ BOOL FrontierScrCmd_5D(FrontierScriptContext *param0)
|
|||
|
||||
BOOL FrontierScrCmd_5E(FrontierScriptContext *param0)
|
||||
{
|
||||
UnkStruct_ov104_0223ADA0 *v0 = sub_0209B978(param0->unk_00->unk_00);
|
||||
UnkStruct_ov104_0223ADA0 *v0 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
ov104_022340D0(v0);
|
||||
|
||||
return 0;
|
||||
|
|
@ -80,7 +79,7 @@ BOOL FrontierScrCmd_5F(FrontierScriptContext *param0)
|
|||
int v0;
|
||||
UnkStruct_ov104_0223ADA0 *v1;
|
||||
UnkStruct_ov104_02234130 *v2;
|
||||
UnkStruct_ov104_02230BE4 *v3 = sub_0209B970(param0->unk_00->unk_00);
|
||||
UnkStruct_ov104_02230BE4 *v3 = sub_0209B970(param0->scriptMan->unk_00);
|
||||
|
||||
FS_EXTERN_OVERLAY(battle_factory_app);
|
||||
|
||||
|
|
@ -91,7 +90,7 @@ BOOL FrontierScrCmd_5F(FrontierScriptContext *param0)
|
|||
FS_OVERLAY_ID(battle_factory_app)
|
||||
};
|
||||
|
||||
v1 = sub_0209B978(param0->unk_00->unk_00);
|
||||
v1 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
v2 = Heap_Alloc(HEAP_ID_FIELD2, sizeof(UnkStruct_ov104_02234130));
|
||||
|
||||
MI_CpuClear8(v2, sizeof(UnkStruct_ov104_02234130));
|
||||
|
|
@ -104,13 +103,13 @@ BOOL FrontierScrCmd_5F(FrontierScriptContext *param0)
|
|||
v2->unk_0C = v1->unk_4D8;
|
||||
v2->unk_1C = v1;
|
||||
|
||||
sub_0209B988(param0->unk_00->unk_00, &v4, v2, 0, ov104_02233478);
|
||||
sub_0209B988(param0->scriptMan->unk_00, &v4, v2, 0, ov104_02233478);
|
||||
return 1;
|
||||
}
|
||||
|
||||
BOOL FrontierScrCmd_60(FrontierScriptContext *param0)
|
||||
{
|
||||
UnkStruct_ov104_0223ADA0 *v0 = sub_0209B978(param0->unk_00->unk_00);
|
||||
UnkStruct_ov104_0223ADA0 *v0 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
FieldBattleDTO *v1 = v0->unk_4FC;
|
||||
|
||||
v0->unk_14 = CheckPlayerWonBattle(v1->resultMask);
|
||||
|
|
@ -123,13 +122,13 @@ BOOL FrontierScrCmd_61(FrontierScriptContext *param0)
|
|||
{
|
||||
FieldBattleDTO *v0;
|
||||
UnkStruct_ov104_0223ADA0 *v1;
|
||||
UnkStruct_ov104_02230BE4 *v2 = sub_0209B970(param0->unk_00->unk_00);
|
||||
UnkStruct_ov104_02230BE4 *v2 = sub_0209B970(param0->scriptMan->unk_00);
|
||||
|
||||
v1 = sub_0209B978(param0->unk_00->unk_00);
|
||||
v1 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
v0 = ov104_0223ABA0(v1, v2);
|
||||
|
||||
v1->unk_4FC = v0;
|
||||
sub_0209B988(param0->unk_00->unk_00, &gBattleApplicationTemplate, v0, 0, NULL);
|
||||
sub_0209B988(param0->scriptMan->unk_00, &gBattleApplicationTemplate, v0, 0, NULL);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -139,7 +138,7 @@ BOOL FrontierScrCmd_62(FrontierScriptContext *param0)
|
|||
int v0;
|
||||
UnkStruct_ov104_0223ADA0 *v1;
|
||||
UnkStruct_ov104_02234130 *v2;
|
||||
UnkStruct_ov104_02230BE4 *v3 = sub_0209B970(param0->unk_00->unk_00);
|
||||
UnkStruct_ov104_02230BE4 *v3 = sub_0209B970(param0->scriptMan->unk_00);
|
||||
|
||||
FS_EXTERN_OVERLAY(battle_factory_app);
|
||||
|
||||
|
|
@ -150,7 +149,7 @@ BOOL FrontierScrCmd_62(FrontierScriptContext *param0)
|
|||
FS_OVERLAY_ID(battle_factory_app)
|
||||
};
|
||||
|
||||
v1 = sub_0209B978(param0->unk_00->unk_00);
|
||||
v1 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
|
||||
for (v0 = 0; v0 < 6; v0++) {
|
||||
v1->unk_4DC[v0] = 0;
|
||||
|
|
@ -167,7 +166,7 @@ BOOL FrontierScrCmd_62(FrontierScriptContext *param0)
|
|||
v2->unk_0C = v1->unk_4D8;
|
||||
v2->unk_1C = v1;
|
||||
|
||||
sub_0209B988(param0->unk_00->unk_00, &v4, v2, 0, ov104_02233478);
|
||||
sub_0209B988(param0->scriptMan->unk_00, &v4, v2, 0, ov104_02233478);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
@ -184,7 +183,7 @@ static void ov104_02233478(void *param0)
|
|||
|
||||
BOOL FrontierScrCmd_63(FrontierScriptContext *param0)
|
||||
{
|
||||
UnkStruct_ov104_0223ADA0 *v0 = sub_0209B978(param0->unk_00->unk_00);
|
||||
UnkStruct_ov104_0223ADA0 *v0 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
ov104_0223449C(v0);
|
||||
|
||||
return 0;
|
||||
|
|
@ -192,7 +191,7 @@ BOOL FrontierScrCmd_63(FrontierScriptContext *param0)
|
|||
|
||||
BOOL FrontierScrCmd_64(FrontierScriptContext *param0)
|
||||
{
|
||||
UnkStruct_ov104_0223ADA0 *v0 = sub_0209B978(param0->unk_00->unk_00);
|
||||
UnkStruct_ov104_0223ADA0 *v0 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
ov104_02234570(v0);
|
||||
|
||||
return 0;
|
||||
|
|
@ -200,7 +199,7 @@ BOOL FrontierScrCmd_64(FrontierScriptContext *param0)
|
|||
|
||||
BOOL FrontierScrCmd_65(FrontierScriptContext *param0)
|
||||
{
|
||||
UnkStruct_ov104_0223ADA0 *v0 = sub_0209B978(param0->unk_00->unk_00);
|
||||
UnkStruct_ov104_0223ADA0 *v0 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
ov104_022346A4(v0);
|
||||
|
||||
return 0;
|
||||
|
|
@ -208,7 +207,7 @@ BOOL FrontierScrCmd_65(FrontierScriptContext *param0)
|
|||
|
||||
BOOL FrontierScrCmd_66(FrontierScriptContext *param0)
|
||||
{
|
||||
UnkStruct_ov104_0223ADA0 *v0 = sub_0209B978(param0->unk_00->unk_00);
|
||||
UnkStruct_ov104_0223ADA0 *v0 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
ov104_0223470C(v0);
|
||||
|
||||
return 0;
|
||||
|
|
@ -229,8 +228,8 @@ BOOL FrontierScrCmd_67(FrontierScriptContext *param0)
|
|||
u8 v14 = FrontierScriptContext_ReadByte(param0);
|
||||
u16 *v15 = FrontierScriptContext_TryGetVarPointer(param0);
|
||||
|
||||
v4 = sub_0209B978(param0->unk_00->unk_00);
|
||||
v1 = ov104_0222E924(param0->unk_00);
|
||||
v4 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
v1 = ov104_0222E924(param0->scriptMan);
|
||||
|
||||
switch (v12) {
|
||||
case 0:
|
||||
|
|
@ -354,7 +353,7 @@ BOOL FrontierScrCmd_67(FrontierScriptContext *param0)
|
|||
Bg_ScheduleTilemapTransfer(v1->unk_00, 3);
|
||||
break;
|
||||
case 31:
|
||||
v4->unk_500 = SysTask_Start(ov104_022338B4, ov104_0222E924(param0->unk_00), 5);
|
||||
v4->unk_500 = SysTask_Start(ov104_022338B4, ov104_0222E924(param0->scriptMan), 5);
|
||||
break;
|
||||
case 32:
|
||||
if (v4->unk_500 != NULL) {
|
||||
|
|
@ -371,7 +370,7 @@ BOOL FrontierScrCmd_67(FrontierScriptContext *param0)
|
|||
|
||||
for (v10 = 0; v10 < v6; v10++) {
|
||||
v3 = Party_GetPokemonBySlotIndex(v4->unk_4D4, v10);
|
||||
StringTemplate_SetSpeciesName(param0->unk_00->strTemplate, v10, Pokemon_GetBoxPokemon(v3));
|
||||
StringTemplate_SetSpeciesName(param0->scriptMan->strTemplate, v10, Pokemon_GetBoxPokemon(v3));
|
||||
}
|
||||
break;
|
||||
case 35:
|
||||
|
|
@ -430,7 +429,7 @@ BOOL FrontierScrCmd_68(FrontierScriptContext *param0)
|
|||
UnkStruct_ov104_0223ADA0 *v0;
|
||||
u16 *v1 = FrontierScriptContext_TryGetVarPointer(param0);
|
||||
|
||||
v0 = sub_0209B978(param0->unk_00->unk_00);
|
||||
v0 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
*v1 = v0->unk_14;
|
||||
|
||||
return 0;
|
||||
|
|
@ -443,7 +442,7 @@ BOOL FrontierScrCmd_69(FrontierScriptContext *param0)
|
|||
u16 v2 = FrontierScriptContext_GetVar(param0);
|
||||
u16 *v3 = FrontierScriptContext_TryGetVarPointer(param0);
|
||||
|
||||
v0 = sub_0209B978(param0->unk_00->unk_00);
|
||||
v0 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
*v3 = ov104_022347A4(v0, v1, v2);
|
||||
|
||||
return 1;
|
||||
|
|
@ -464,7 +463,7 @@ static BOOL ov104_0223394C(FrontierScriptContext *param0)
|
|||
UnkStruct_ov104_0223ADA0 *v0;
|
||||
u16 v1 = FrontierScriptContext_TryGetVar(param0, param0->data[0]);
|
||||
|
||||
v0 = sub_0209B978(param0->unk_00->unk_00);
|
||||
v0 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
|
||||
if (v0->unk_702 >= 2) {
|
||||
v0->unk_702 = 0;
|
||||
|
|
@ -478,10 +477,10 @@ BOOL FrontierScrCmd_6B(FrontierScriptContext *param0)
|
|||
{
|
||||
u16 *v0;
|
||||
UnkStruct_ov104_0223ADA0 *v1;
|
||||
UnkStruct_ov104_02230BE4 *v2 = sub_0209B970(param0->unk_00->unk_00);
|
||||
UnkStruct_ov104_02230BE4 *v2 = sub_0209B970(param0->scriptMan->unk_00);
|
||||
u16 v3 = FrontierScriptContext_ReadByte(param0);
|
||||
|
||||
v1 = sub_0209B978(param0->unk_00->unk_00);
|
||||
v1 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
|
||||
if (v1 == NULL) {
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
#include "struct_decls/struct_0202440C_decl.h"
|
||||
|
||||
#include "applications/frontier/battle_hall/main.h"
|
||||
#include "overlay104/defs.h"
|
||||
#include "overlay104/frontier_script_context.h"
|
||||
#include "overlay104/frscrcmd.h"
|
||||
#include "overlay104/ov104_0222DCE0.h"
|
||||
|
|
@ -11,7 +12,6 @@
|
|||
#include "overlay104/ov104_02234DB4.h"
|
||||
#include "overlay104/ov104_0223AF58.h"
|
||||
#include "overlay104/struct_ov104_02230BE4.h"
|
||||
#include "overlay104/struct_ov104_022320B4_t.h"
|
||||
#include "overlay104/struct_ov104_02235208.h"
|
||||
#include "overlay104/struct_ov104_0223B5C0.h"
|
||||
#include "savedata/save_table.h"
|
||||
|
|
@ -45,10 +45,10 @@ BOOL FrontierScrCmd_8B(FrontierScriptContext *param0)
|
|||
u16 v4 = FrontierScriptContext_GetVar(param0);
|
||||
u16 v5 = FrontierScriptContext_GetVar(param0);
|
||||
|
||||
v1 = sub_0209B970(param0->unk_00->unk_00);
|
||||
v1 = sub_0209B970(param0->scriptMan->unk_00);
|
||||
v0 = ov104_02234DB4(v1->saveData, v2, v3, v4, v5);
|
||||
|
||||
sub_0209B980(param0->unk_00->unk_00, v0);
|
||||
sub_0209B980(param0->scriptMan->unk_00, v0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -58,7 +58,7 @@ BOOL FrontierScrCmd_8C(FrontierScriptContext *param0)
|
|||
UnkStruct_ov104_0223B5C0 *v0;
|
||||
u16 v1 = FrontierScriptContext_GetVar(param0);
|
||||
|
||||
v0 = sub_0209B978(param0->unk_00->unk_00);
|
||||
v0 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
ov104_022350B0(v0, v1);
|
||||
|
||||
return 0;
|
||||
|
|
@ -66,7 +66,7 @@ BOOL FrontierScrCmd_8C(FrontierScriptContext *param0)
|
|||
|
||||
BOOL FrontierScrCmd_8D(FrontierScriptContext *param0)
|
||||
{
|
||||
UnkStruct_ov104_0223B5C0 *v0 = sub_0209B978(param0->unk_00->unk_00);
|
||||
UnkStruct_ov104_0223B5C0 *v0 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
ov104_02235190(v0);
|
||||
|
||||
return 0;
|
||||
|
|
@ -74,7 +74,7 @@ BOOL FrontierScrCmd_8D(FrontierScriptContext *param0)
|
|||
|
||||
BOOL FrontierScrCmd_OpenBattleHallApp(FrontierScriptContext *ctx)
|
||||
{
|
||||
UnkStruct_ov104_02230BE4 *v5 = sub_0209B970(ctx->unk_00->unk_00);
|
||||
UnkStruct_ov104_02230BE4 *v5 = sub_0209B970(ctx->scriptMan->unk_00);
|
||||
|
||||
FS_EXTERN_OVERLAY(battle_hall_app);
|
||||
|
||||
|
|
@ -85,7 +85,7 @@ BOOL FrontierScrCmd_OpenBattleHallApp(FrontierScriptContext *ctx)
|
|||
FS_OVERLAY_ID(battle_hall_app)
|
||||
};
|
||||
|
||||
UnkStruct_ov104_0223B5C0 *v3 = sub_0209B978(ctx->unk_00->unk_00);
|
||||
UnkStruct_ov104_0223B5C0 *v3 = sub_0209B978(ctx->scriptMan->unk_00);
|
||||
UnkStruct_ov104_02235208 *v4 = Heap_Alloc(HEAP_ID_FIELD2, sizeof(UnkStruct_ov104_02235208));
|
||||
|
||||
MI_CpuClear8(v4, sizeof(UnkStruct_ov104_02235208));
|
||||
|
|
@ -113,13 +113,13 @@ BOOL FrontierScrCmd_OpenBattleHallApp(FrontierScriptContext *ctx)
|
|||
Party_AddPokemon(v4->party, v3->unk_D8C);
|
||||
}
|
||||
|
||||
sub_0209B988(ctx->unk_00->unk_00, &sBattleHallAppTemplate, v4, 0, ov104_02234A08);
|
||||
sub_0209B988(ctx->scriptMan->unk_00, &sBattleHallAppTemplate, v4, 0, ov104_02234A08);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL FrontierScrCmd_8F(FrontierScriptContext *param0)
|
||||
{
|
||||
UnkStruct_ov104_0223B5C0 *v0 = sub_0209B978(param0->unk_00->unk_00);
|
||||
UnkStruct_ov104_0223B5C0 *v0 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
FieldBattleDTO *v1 = v0->unk_700;
|
||||
|
||||
v0->unk_14 = CheckPlayerWonBattle(v1->resultMask);
|
||||
|
|
@ -132,15 +132,15 @@ BOOL FrontierScrCmd_90(FrontierScriptContext *param0)
|
|||
{
|
||||
FieldBattleDTO *v0;
|
||||
UnkStruct_ov104_0223B5C0 *v1;
|
||||
UnkStruct_ov104_02230BE4 *v2 = sub_0209B970(param0->unk_00->unk_00);
|
||||
UnkStruct_ov104_02230BE4 *v2 = sub_0209B970(param0->scriptMan->unk_00);
|
||||
|
||||
v1 = sub_0209B978(param0->unk_00->unk_00);
|
||||
v1 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
v0 = ov104_0223B250(v1, v2);
|
||||
|
||||
v1->unk_700 = v0;
|
||||
|
||||
Sound_SetSceneAndPlayBGM(SOUND_SCENE_BATTLE, SEQ_BATTLE_TRAINER, 1);
|
||||
sub_0209B988(param0->unk_00->unk_00, &gBattleApplicationTemplate, v0, 0, NULL);
|
||||
sub_0209B988(param0->scriptMan->unk_00, &gBattleApplicationTemplate, v0, 0, NULL);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -171,8 +171,8 @@ BOOL FrontierScrCmd_91(FrontierScriptContext *param0)
|
|||
u8 v10 = FrontierScriptContext_ReadByte(param0);
|
||||
u16 *v11 = FrontierScriptContext_TryGetVarPointer(param0);
|
||||
|
||||
v0 = sub_0209B970(param0->unk_00->unk_00);
|
||||
v3 = sub_0209B978(param0->unk_00->unk_00);
|
||||
v0 = sub_0209B970(param0->scriptMan->unk_00);
|
||||
v3 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
|
||||
switch (v8) {
|
||||
case 2:
|
||||
|
|
@ -299,7 +299,7 @@ BOOL FrontierScrCmd_92(FrontierScriptContext *param0)
|
|||
UnkStruct_ov104_0223B5C0 *v0;
|
||||
u16 *v1 = FrontierScriptContext_TryGetVarPointer(param0);
|
||||
|
||||
v0 = sub_0209B978(param0->unk_00->unk_00);
|
||||
v0 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
*v1 = v0->unk_14;
|
||||
|
||||
return 0;
|
||||
|
|
@ -312,7 +312,7 @@ BOOL FrontierScrCmd_93(FrontierScriptContext *param0)
|
|||
u16 v2 = FrontierScriptContext_GetVar(param0);
|
||||
u16 *v3 = FrontierScriptContext_TryGetVarPointer(param0);
|
||||
|
||||
v0 = sub_0209B978(param0->unk_00->unk_00);
|
||||
v0 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
*v3 = ov104_02235534(v0, v1, v2);
|
||||
|
||||
return 1;
|
||||
|
|
@ -333,7 +333,7 @@ static BOOL ov104_02234CEC(FrontierScriptContext *param0)
|
|||
UnkStruct_ov104_0223B5C0 *v0;
|
||||
u16 v1 = FrontierScriptContext_TryGetVar(param0, param0->data[0]);
|
||||
|
||||
v0 = sub_0209B978(param0->unk_00->unk_00);
|
||||
v0 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
|
||||
if (v0->unk_D90 >= 2) {
|
||||
v0->unk_D90 = 0;
|
||||
|
|
@ -347,10 +347,10 @@ BOOL FrontierScrCmd_95(FrontierScriptContext *param0)
|
|||
{
|
||||
u16 *v0;
|
||||
UnkStruct_ov104_0223B5C0 *v1;
|
||||
UnkStruct_ov104_02230BE4 *v2 = sub_0209B970(param0->unk_00->unk_00);
|
||||
UnkStruct_ov104_02230BE4 *v2 = sub_0209B970(param0->scriptMan->unk_00);
|
||||
u16 v3 = FrontierScriptContext_ReadByte(param0);
|
||||
|
||||
v1 = sub_0209B978(param0->unk_00->unk_00);
|
||||
v1 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
|
||||
if (v1 == NULL) {
|
||||
return 0;
|
||||
|
|
@ -367,7 +367,7 @@ BOOL FrontierScrCmd_76(FrontierScriptContext *param0)
|
|||
UnkStruct_ov104_0223B5C0 *v0;
|
||||
u16 *v1 = FrontierScriptContext_TryGetVarPointer(param0);
|
||||
|
||||
v0 = sub_0209B978(param0->unk_00->unk_00);
|
||||
v0 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
ov104_0223520C(v0, v1);
|
||||
|
||||
return 1;
|
||||
|
|
@ -380,9 +380,9 @@ BOOL FrontierScrCmd_C7(FrontierScriptContext *param0)
|
|||
Party *v2;
|
||||
Pokemon *v3;
|
||||
UnkStruct_ov104_0223B5C0 *v4;
|
||||
UnkStruct_ov104_02230BE4 *v5 = sub_0209B970(param0->unk_00->unk_00);
|
||||
UnkStruct_ov104_02230BE4 *v5 = sub_0209B970(param0->scriptMan->unk_00);
|
||||
|
||||
v4 = sub_0209B978(param0->unk_00->unk_00);
|
||||
v4 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
v2 = SaveData_GetParty(v5->saveData);
|
||||
v3 = Party_GetPokemonBySlotIndex(v2, v4->unk_260[0]);
|
||||
v1 = Pokemon_GetValue(v3, MON_DATA_SPECIES, NULL);
|
||||
|
|
|
|||
|
|
@ -4,14 +4,13 @@
|
|||
#include "applications/frontier/battle_castle/opponent_app.h"
|
||||
#include "applications/frontier/battle_castle/self_app.h"
|
||||
#include "overlay104/frontier_script_context.h"
|
||||
#include "overlay104/frontier_script_manager.h"
|
||||
#include "overlay104/frscrcmd.h"
|
||||
#include "overlay104/ov104_0222DCE0.h"
|
||||
#include "overlay104/ov104_0222E63C.h"
|
||||
#include "overlay104/ov104_02231F74.h"
|
||||
#include "overlay104/ov104_022361B4.h"
|
||||
#include "overlay104/ov104_0223B6F4.h"
|
||||
#include "overlay104/struct_ov104_02230BE4.h"
|
||||
#include "overlay104/struct_ov104_022320B4_t.h"
|
||||
#include "overlay104/struct_ov104_0223597C.h"
|
||||
#include "overlay104/struct_ov104_0223BA10.h"
|
||||
#include "overlay104/struct_ov104_0223C4CC.h"
|
||||
|
|
@ -50,10 +49,10 @@ BOOL FrontierScrCmd_97(FrontierScriptContext *param0)
|
|||
u16 v6 = FrontierScriptContext_GetVar(param0);
|
||||
u16 *v7 = FrontierScriptContext_TryGetVarPointer(param0);
|
||||
|
||||
v1 = sub_0209B970(param0->unk_00->unk_00);
|
||||
v1 = sub_0209B970(param0->scriptMan->unk_00);
|
||||
v0 = ov104_022361B4(v1->saveData, v2, v3, v4, v5, v6, v7);
|
||||
|
||||
sub_0209B980(param0->unk_00->unk_00, v0);
|
||||
sub_0209B980(param0->scriptMan->unk_00, v0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -63,7 +62,7 @@ BOOL FrontierScrCmd_98(FrontierScriptContext *param0)
|
|||
UnkStruct_ov104_0223BA10 *v0;
|
||||
u16 v1 = FrontierScriptContext_GetVar(param0);
|
||||
|
||||
v0 = sub_0209B978(param0->unk_00->unk_00);
|
||||
v0 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
ov104_02236514(v0, v1);
|
||||
|
||||
return 0;
|
||||
|
|
@ -71,7 +70,7 @@ BOOL FrontierScrCmd_98(FrontierScriptContext *param0)
|
|||
|
||||
BOOL FrontierScrCmd_99(FrontierScriptContext *param0)
|
||||
{
|
||||
UnkStruct_ov104_0223BA10 *v0 = sub_0209B978(param0->unk_00->unk_00);
|
||||
UnkStruct_ov104_0223BA10 *v0 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
ov104_022367AC(v0);
|
||||
|
||||
return 0;
|
||||
|
|
@ -82,7 +81,7 @@ BOOL FrontierScrCmd_9A(FrontierScriptContext *param0)
|
|||
int v0;
|
||||
UnkStruct_ov104_0223BA10 *v1;
|
||||
UnkStruct_ov104_0223597C *v2;
|
||||
UnkStruct_ov104_02230BE4 *v3 = sub_0209B970(param0->unk_00->unk_00);
|
||||
UnkStruct_ov104_02230BE4 *v3 = sub_0209B970(param0->scriptMan->unk_00);
|
||||
|
||||
FS_EXTERN_OVERLAY(battle_castle_app);
|
||||
|
||||
|
|
@ -93,14 +92,14 @@ BOOL FrontierScrCmd_9A(FrontierScriptContext *param0)
|
|||
FS_OVERLAY_ID(battle_castle_app)
|
||||
};
|
||||
|
||||
v1 = sub_0209B978(param0->unk_00->unk_00);
|
||||
v1 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
v2 = Heap_Alloc(HEAP_ID_FIELD2, sizeof(UnkStruct_ov104_0223597C));
|
||||
|
||||
MI_CpuClear8(v2, sizeof(UnkStruct_ov104_0223597C));
|
||||
v2->saveData = v3->saveData;
|
||||
|
||||
ov104_02235B3C(v2, v1);
|
||||
sub_0209B988(param0->unk_00->unk_00, &v4, v2, 0, ov104_02235B84);
|
||||
sub_0209B988(param0->scriptMan->unk_00, &v4, v2, 0, ov104_02235B84);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -110,7 +109,7 @@ BOOL FrontierScrCmd_A4(FrontierScriptContext *param0)
|
|||
int v0;
|
||||
UnkStruct_ov104_0223BA10 *v1;
|
||||
UnkStruct_ov104_0223597C *v2;
|
||||
UnkStruct_ov104_02230BE4 *v3 = sub_0209B970(param0->unk_00->unk_00);
|
||||
UnkStruct_ov104_02230BE4 *v3 = sub_0209B970(param0->scriptMan->unk_00);
|
||||
|
||||
FS_EXTERN_OVERLAY(battle_castle_app);
|
||||
|
||||
|
|
@ -121,14 +120,14 @@ BOOL FrontierScrCmd_A4(FrontierScriptContext *param0)
|
|||
FS_OVERLAY_ID(battle_castle_app)
|
||||
};
|
||||
|
||||
v1 = sub_0209B978(param0->unk_00->unk_00);
|
||||
v1 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
v2 = Heap_Alloc(HEAP_ID_FIELD2, sizeof(UnkStruct_ov104_0223597C));
|
||||
|
||||
MI_CpuClear8(v2, sizeof(UnkStruct_ov104_0223597C));
|
||||
v2->saveData = v3->saveData;
|
||||
|
||||
ov104_02235B3C(v2, v1);
|
||||
sub_0209B988(param0->unk_00->unk_00, &v4, v2, 0, ov104_02235B84);
|
||||
sub_0209B988(param0->scriptMan->unk_00, &v4, v2, 0, ov104_02235B84);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -140,7 +139,7 @@ BOOL FrontierScrCmd_9B(FrontierScriptContext *param0)
|
|||
FieldBattleDTO *v2;
|
||||
Pokemon *v3;
|
||||
|
||||
v1 = sub_0209B978(param0->unk_00->unk_00);
|
||||
v1 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
v2 = v1->unk_0C;
|
||||
|
||||
v3 = Party_GetPokemonBySlotIndex(v2->parties[0], 0);
|
||||
|
|
@ -170,14 +169,14 @@ BOOL FrontierScrCmd_9C(FrontierScriptContext *param0)
|
|||
{
|
||||
FieldBattleDTO *v0;
|
||||
UnkStruct_ov104_0223BA10 *v1;
|
||||
UnkStruct_ov104_02230BE4 *v2 = sub_0209B970(param0->unk_00->unk_00);
|
||||
UnkStruct_ov104_02230BE4 *v2 = sub_0209B970(param0->scriptMan->unk_00);
|
||||
|
||||
v1 = sub_0209B978(param0->unk_00->unk_00);
|
||||
v1 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
v0 = ov104_0223B810(v1, v2);
|
||||
|
||||
v1->unk_0C = v0;
|
||||
|
||||
sub_0209B988(param0->unk_00->unk_00, &gBattleApplicationTemplate, v0, 0, NULL);
|
||||
sub_0209B988(param0->scriptMan->unk_00, &gBattleApplicationTemplate, v0, 0, NULL);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
@ -186,7 +185,7 @@ BOOL FrontierScrCmd_9D(FrontierScriptContext *param0)
|
|||
int v0;
|
||||
UnkStruct_ov104_0223BA10 *v1;
|
||||
UnkStruct_ov104_0223597C *v2;
|
||||
UnkStruct_ov104_02230BE4 *v3 = sub_0209B970(param0->unk_00->unk_00);
|
||||
UnkStruct_ov104_02230BE4 *v3 = sub_0209B970(param0->scriptMan->unk_00);
|
||||
|
||||
FS_EXTERN_OVERLAY(battle_castle_app);
|
||||
|
||||
|
|
@ -197,14 +196,14 @@ BOOL FrontierScrCmd_9D(FrontierScriptContext *param0)
|
|||
FS_OVERLAY_ID(battle_castle_app)
|
||||
};
|
||||
|
||||
v1 = sub_0209B978(param0->unk_00->unk_00);
|
||||
v1 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
v2 = Heap_Alloc(HEAP_ID_FIELD2, sizeof(UnkStruct_ov104_0223597C));
|
||||
|
||||
MI_CpuClear8(v2, sizeof(UnkStruct_ov104_0223597C));
|
||||
v2->saveData = v3->saveData;
|
||||
|
||||
ov104_02235B3C(v2, v1);
|
||||
sub_0209B988(param0->unk_00->unk_00, &v4, v2, 0, ov104_02235B84);
|
||||
sub_0209B988(param0->scriptMan->unk_00, &v4, v2, 0, ov104_02235B84);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -242,7 +241,7 @@ static void ov104_02235B84(void *param0)
|
|||
|
||||
BOOL FrontierScrCmd_9E(FrontierScriptContext *param0)
|
||||
{
|
||||
UnkStruct_ov104_0223BA10 *v0 = sub_0209B978(param0->unk_00->unk_00);
|
||||
UnkStruct_ov104_0223BA10 *v0 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
ov104_02236BF0(v0);
|
||||
|
||||
return 0;
|
||||
|
|
@ -250,7 +249,7 @@ BOOL FrontierScrCmd_9E(FrontierScriptContext *param0)
|
|||
|
||||
BOOL FrontierScrCmd_9F(FrontierScriptContext *param0)
|
||||
{
|
||||
UnkStruct_ov104_0223BA10 *v0 = sub_0209B978(param0->unk_00->unk_00);
|
||||
UnkStruct_ov104_0223BA10 *v0 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
ov104_02236BF8(v0);
|
||||
|
||||
return 0;
|
||||
|
|
@ -274,8 +273,8 @@ BOOL FrontierScrCmd_A0(FrontierScriptContext *param0)
|
|||
u8 v16 = FrontierScriptContext_ReadByte(param0);
|
||||
u16 *v17 = FrontierScriptContext_TryGetVarPointer(param0);
|
||||
|
||||
v3 = sub_0209B978(param0->unk_00->unk_00);
|
||||
v11 = sub_0209B970(param0->unk_00->unk_00);
|
||||
v3 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
v11 = sub_0209B970(param0->scriptMan->unk_00);
|
||||
|
||||
switch (v14) {
|
||||
case 2:
|
||||
|
|
@ -408,7 +407,7 @@ BOOL FrontierScrCmd_A0(FrontierScriptContext *param0)
|
|||
*v17 = v3->unk_12;
|
||||
break;
|
||||
case 36:
|
||||
v12 = ov104_0222E924(param0->unk_00);
|
||||
v12 = ov104_0222E924(param0->scriptMan);
|
||||
ov104_0223BB84(v12->unk_00, v3, 3);
|
||||
break;
|
||||
case 37:
|
||||
|
|
@ -464,7 +463,7 @@ BOOL FrontierScrCmd_A1(FrontierScriptContext *param0)
|
|||
UnkStruct_ov104_0223BA10 *v0;
|
||||
u16 *v1 = FrontierScriptContext_TryGetVarPointer(param0);
|
||||
|
||||
v0 = sub_0209B978(param0->unk_00->unk_00);
|
||||
v0 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
*v1 = v0->unk_1C;
|
||||
|
||||
return 0;
|
||||
|
|
@ -477,7 +476,7 @@ BOOL FrontierScrCmd_A2(FrontierScriptContext *param0)
|
|||
u16 v2 = FrontierScriptContext_GetVar(param0);
|
||||
u16 *v3 = FrontierScriptContext_TryGetVarPointer(param0);
|
||||
|
||||
v0 = sub_0209B978(param0->unk_00->unk_00);
|
||||
v0 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
*v3 = ov104_02236F70(v0, v1, v2);
|
||||
|
||||
return 1;
|
||||
|
|
@ -498,7 +497,7 @@ static BOOL ov104_02236008(FrontierScriptContext *param0)
|
|||
UnkStruct_ov104_0223BA10 *v0;
|
||||
u16 v1 = FrontierScriptContext_TryGetVar(param0, param0->data[0]);
|
||||
|
||||
v0 = sub_0209B978(param0->unk_00->unk_00);
|
||||
v0 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
|
||||
if (v0->unk_A1A >= 2) {
|
||||
v0->unk_A1A = 0;
|
||||
|
|
@ -523,7 +522,7 @@ static BOOL ov104_02236058(FrontierScriptContext *param0)
|
|||
UnkStruct_ov104_0223BA10 *v0;
|
||||
u16 *v1 = FrontierScriptContext_GetVarPointer(param0, param0->data[0]);
|
||||
|
||||
v0 = sub_0209B978(param0->unk_00->unk_00);
|
||||
v0 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
|
||||
if (v0->unk_A1B == 0) {
|
||||
return 0;
|
||||
|
|
@ -537,24 +536,24 @@ static BOOL ov104_02236058(FrontierScriptContext *param0)
|
|||
|
||||
BOOL FrontierScrCmd_50(FrontierScriptContext *param0)
|
||||
{
|
||||
UnkStruct_ov104_0223BA10 *v0 = sub_0209B978(param0->unk_00->unk_00);
|
||||
ov104_02236FC0(param0->unk_00, v0);
|
||||
UnkStruct_ov104_0223BA10 *v0 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
ov104_02236FC0(param0->scriptMan, v0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
BOOL FrontierScrCmd_51(FrontierScriptContext *param0)
|
||||
{
|
||||
UnkStruct_ov104_0223BA10 *v0 = sub_0209B978(param0->unk_00->unk_00);
|
||||
ov104_022370E0(param0->unk_00, v0);
|
||||
UnkStruct_ov104_0223BA10 *v0 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
ov104_022370E0(param0->scriptMan, v0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
BOOL FrontierScrCmd_52(FrontierScriptContext *param0)
|
||||
{
|
||||
UnkStruct_ov104_0223BA10 *v0 = sub_0209B978(param0->unk_00->unk_00);
|
||||
ov104_02237180(param0->unk_00, v0);
|
||||
UnkStruct_ov104_0223BA10 *v0 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
ov104_02237180(param0->scriptMan, v0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -565,7 +564,7 @@ BOOL FrontierScrCmd_A6(FrontierScriptContext *param0)
|
|||
u16 v1 = FrontierScriptContext_GetVar(param0);
|
||||
u16 *v2 = FrontierScriptContext_TryGetVarPointer(param0);
|
||||
|
||||
v0 = sub_0209B970(param0->unk_00->unk_00);
|
||||
v0 = sub_0209B970(param0->scriptMan->unk_00);
|
||||
*v2 = sub_02030698(SaveData_GetBattleFrontier(v0->saveData), sub_0205E630(v1), sub_0205E6A8(sub_0205E630(v1)));
|
||||
|
||||
return 0;
|
||||
|
|
@ -577,7 +576,7 @@ BOOL FrontierScrCmd_A7(FrontierScriptContext *param0)
|
|||
u16 v1 = FrontierScriptContext_GetVar(param0);
|
||||
u16 v2 = FrontierScriptContext_GetVar(param0);
|
||||
|
||||
v0 = sub_0209B970(param0->unk_00->unk_00);
|
||||
v0 = sub_0209B970(param0->scriptMan->unk_00);
|
||||
ov104_0223BC2C(SaveData_GetBattleFrontier(v0->saveData), v1, v2);
|
||||
|
||||
return 0;
|
||||
|
|
@ -590,7 +589,7 @@ BOOL FrontierScrCmd_A8(FrontierScriptContext *param0)
|
|||
u16 v2 = FrontierScriptContext_GetVar(param0);
|
||||
u16 v3 = FrontierScriptContext_GetVar(param0);
|
||||
|
||||
v1 = sub_0209B970(param0->unk_00->unk_00);
|
||||
v1 = sub_0209B970(param0->scriptMan->unk_00);
|
||||
ov104_02236ED8(v1->saveData, v2, v3);
|
||||
|
||||
return 0;
|
||||
|
|
@ -600,10 +599,10 @@ BOOL FrontierScrCmd_A9(FrontierScriptContext *param0)
|
|||
{
|
||||
u16 *v0;
|
||||
UnkStruct_ov104_0223BA10 *v1;
|
||||
UnkStruct_ov104_02230BE4 *v2 = sub_0209B970(param0->unk_00->unk_00);
|
||||
UnkStruct_ov104_02230BE4 *v2 = sub_0209B970(param0->scriptMan->unk_00);
|
||||
u16 v3 = FrontierScriptContext_ReadByte(param0);
|
||||
|
||||
v1 = sub_0209B978(param0->unk_00->unk_00);
|
||||
v1 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
|
||||
if (v1 == NULL) {
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -10,12 +10,11 @@
|
|||
#include "struct_decls/struct_0203041C_decl.h"
|
||||
#include "struct_defs/battle_frontier.h"
|
||||
|
||||
#include "overlay104/defs.h"
|
||||
#include "overlay104/frontier_script_manager.h"
|
||||
#include "overlay104/ov104_0222DCE0.h"
|
||||
#include "overlay104/ov104_0222E63C.h"
|
||||
#include "overlay104/ov104_0222ECE8.h"
|
||||
#include "overlay104/ov104_0223B6F4.h"
|
||||
#include "overlay104/struct_ov104_022320B4_decl.h"
|
||||
#include "overlay104/struct_ov104_022320B4_t.h"
|
||||
#include "overlay104/struct_ov104_0223597C.h"
|
||||
#include "overlay104/struct_ov104_0223BA10.h"
|
||||
#include "overlay104/struct_ov104_0223C4CC.h"
|
||||
|
|
@ -53,11 +52,11 @@ void ov104_02236BF8(UnkStruct_ov104_0223BA10 *param0);
|
|||
void ov104_02236C50(UnkStruct_ov104_0223BA10 *param0);
|
||||
int ov104_02236D10(UnkStruct_ov104_0223BA10 *param0);
|
||||
BOOL ov104_02236F70(UnkStruct_ov104_0223BA10 *param0, u16 param1, u16 param2);
|
||||
void ov104_02236FC0(UnkStruct_ov104_022320B4 *param0, UnkStruct_ov104_0223BA10 *param1);
|
||||
void ov104_022370E0(UnkStruct_ov104_022320B4 *param0, UnkStruct_ov104_0223BA10 *param1);
|
||||
void ov104_02237180(UnkStruct_ov104_022320B4 *param0, UnkStruct_ov104_0223BA10 *param1);
|
||||
void ov104_02236FC0(FrontierScriptManager *param0, UnkStruct_ov104_0223BA10 *param1);
|
||||
void ov104_022370E0(FrontierScriptManager *param0, UnkStruct_ov104_0223BA10 *param1);
|
||||
void ov104_02237180(FrontierScriptManager *param0, UnkStruct_ov104_0223BA10 *param1);
|
||||
static void ov104_022370C0(BgConfig *param0, Window *param1);
|
||||
static void ov104_02237284(UnkStruct_ov104_022320B4 *param0, Window *param1, TrainerInfo *param2, u16 param3);
|
||||
static void ov104_02237284(FrontierScriptManager *param0, Window *param1, TrainerInfo *param2, u16 param3);
|
||||
u16 ov104_02237338(UnkStruct_ov104_0223BA10 *param0);
|
||||
|
||||
UnkStruct_ov104_0223BA10 *ov104_022361B4(SaveData *saveData, u16 param1, u8 param2, u16 param3, u16 param4, u16 param5, u16 *param6)
|
||||
|
|
@ -182,7 +181,7 @@ static void ov104_02236528(UnkStruct_ov104_0223BA10 *param0)
|
|||
param0->unk_394[i][3] = Pokemon_GetValue(mon, MON_DATA_MOVE4_PP, NULL);
|
||||
}
|
||||
|
||||
ov104_0223B760(param0->unk_10, ov104_0223BB60(param0), param0->unk_30, (7 * 2));
|
||||
ov104_0223B760(param0->unk_10, ov104_0223BB60(param0), param0->unk_30, 7 * 2);
|
||||
|
||||
ov104_0222E4BC(ov104_0223B7DC(param0->unk_10, 1), param0->unk_30[param0->unk_11], param0->unk_30[param0->unk_11 + 7], param0->unk_26C, param0->unk_288, param0->unk_274, param0->unk_278, BattleCastle_IsMultiPlayerChallenge(param0->unk_10));
|
||||
|
||||
|
|
@ -675,7 +674,7 @@ BOOL ov104_02236F70(UnkStruct_ov104_0223BA10 *param0, u16 param1, u16 param2)
|
|||
return v0;
|
||||
}
|
||||
|
||||
void ov104_02236FC0(UnkStruct_ov104_022320B4 *param0, UnkStruct_ov104_0223BA10 *param1)
|
||||
void ov104_02236FC0(FrontierScriptManager *param0, UnkStruct_ov104_0223BA10 *param1)
|
||||
{
|
||||
UnkStruct_ov104_0223C4CC *v0 = ov104_0222E924(param0);
|
||||
|
||||
|
|
@ -684,14 +683,14 @@ void ov104_02236FC0(UnkStruct_ov104_022320B4 *param0, UnkStruct_ov104_0223BA10 *
|
|||
|
||||
if (BattleCastle_IsMultiPlayerChallenge(param1->unk_10) == 0) {
|
||||
param0->unk_A8 = Window_New(HEAP_ID_FIELD2, 1);
|
||||
Window_Add(v0->unk_00, param0->unk_A8, 1, 1, 1, 10, 4, 14, (((((1024 - (18 + 12)) - 9) - (27 * 4)) - (11 * 22)) - (10 * 4)));
|
||||
Window_Add(v0->unk_00, param0->unk_A8, 1, 1, 1, 10, 4, 14, ((((1024 - (18 + 12)) - 9) - (27 * 4)) - (11 * 22)) - (10 * 4));
|
||||
ov104_022370C0(v0->unk_00, param0->unk_A8);
|
||||
} else {
|
||||
param0->unk_A8 = Window_New(HEAP_ID_FIELD2, 1);
|
||||
param0->unk_AC = Window_New(HEAP_ID_FIELD2, 1);
|
||||
|
||||
Window_Add(v0->unk_00, param0->unk_A8, 1, 1, 1, 10, 4, 14, (((((1024 - (18 + 12)) - 9) - (27 * 4)) - (11 * 22)) - (10 * 4)));
|
||||
Window_Add(v0->unk_00, param0->unk_AC, 1, 21, 1, 10, 4, 14, ((((((1024 - (18 + 12)) - 9) - (27 * 4)) - (11 * 22)) - (10 * 4)) - (10 * 4)));
|
||||
Window_Add(v0->unk_00, param0->unk_A8, 1, 1, 1, 10, 4, 14, ((((1024 - (18 + 12)) - 9) - (27 * 4)) - (11 * 22)) - (10 * 4));
|
||||
Window_Add(v0->unk_00, param0->unk_AC, 1, 21, 1, 10, 4, 14, (((((1024 - (18 + 12)) - 9) - (27 * 4)) - (11 * 22)) - (10 * 4)) - (10 * 4));
|
||||
|
||||
ov104_022370C0(v0->unk_00, param0->unk_A8);
|
||||
ov104_022370C0(v0->unk_00, param0->unk_AC);
|
||||
|
|
@ -703,13 +702,13 @@ void ov104_02236FC0(UnkStruct_ov104_022320B4 *param0, UnkStruct_ov104_0223BA10 *
|
|||
|
||||
static void ov104_022370C0(BgConfig *param0, Window *param1)
|
||||
{
|
||||
Window_DrawStandardFrame(param1, 1, ((1024 - (18 + 12)) - 9), 12);
|
||||
Window_DrawStandardFrame(param1, 1, (1024 - (18 + 12)) - 9, 12);
|
||||
Window_FillTilemap(param1, 15);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void ov104_022370E0(UnkStruct_ov104_022320B4 *param0, UnkStruct_ov104_0223BA10 *param1)
|
||||
void ov104_022370E0(FrontierScriptManager *param0, UnkStruct_ov104_0223BA10 *param1)
|
||||
{
|
||||
Window *v0;
|
||||
Window *v1;
|
||||
|
|
@ -743,7 +742,7 @@ void ov104_022370E0(UnkStruct_ov104_022320B4 *param0, UnkStruct_ov104_0223BA10 *
|
|||
return;
|
||||
}
|
||||
|
||||
void ov104_02237180(UnkStruct_ov104_022320B4 *param0, UnkStruct_ov104_0223BA10 *param1)
|
||||
void ov104_02237180(FrontierScriptManager *param0, UnkStruct_ov104_0223BA10 *param1)
|
||||
{
|
||||
u16 v0, v1;
|
||||
|
||||
|
|
@ -770,11 +769,11 @@ void ov104_02237180(UnkStruct_ov104_022320B4 *param0, UnkStruct_ov104_0223BA10 *
|
|||
return;
|
||||
}
|
||||
|
||||
static void ov104_02237284(UnkStruct_ov104_022320B4 *param0, Window *param1, TrainerInfo *param2, u16 param3)
|
||||
static void ov104_02237284(FrontierScriptManager *param0, Window *param1, TrainerInfo *param2, u16 param3)
|
||||
{
|
||||
MessageLoader *v0;
|
||||
String *v1 = String_Init((10 * 2), param0->heapID);
|
||||
String *v2 = String_Init((10 * 2), param0->heapID);
|
||||
String *v1 = String_Init(10 * 2, param0->heapID);
|
||||
String *v2 = String_Init(10 * 2, param0->heapID);
|
||||
|
||||
v0 = MessageLoader_Init(MSG_LOADER_PRELOAD_ENTIRE_BANK, NARC_INDEX_MSGDATA__PL_MSG, TEXT_BANK_BATTLE_CASTLE_SELF_APP, HEAP_ID_FIELD2);
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,11 @@
|
|||
|
||||
#include "applications/frontier/battle_arcade/main.h"
|
||||
#include "overlay063/ov63_0222CCE4.h"
|
||||
#include "overlay104/defs.h"
|
||||
#include "overlay104/frontier_script_context.h"
|
||||
#include "overlay104/frontier_script_manager.h"
|
||||
#include "overlay104/frscrcmd.h"
|
||||
#include "overlay104/ov104_0222DCE0.h"
|
||||
#include "overlay104/ov104_0222E63C.h"
|
||||
#include "overlay104/ov104_02231F74.h"
|
||||
#include "overlay104/ov104_02237DD8.h"
|
||||
#include "overlay104/ov104_0223B6F4.h"
|
||||
|
|
@ -14,8 +15,6 @@
|
|||
#include "overlay104/ov104_0223C2D4.h"
|
||||
#include "overlay104/ov104_0223D5D0.h"
|
||||
#include "overlay104/struct_ov104_02230BE4.h"
|
||||
#include "overlay104/struct_ov104_022320B4_decl.h"
|
||||
#include "overlay104/struct_ov104_022320B4_t.h"
|
||||
#include "overlay104/struct_ov104_02238240.h"
|
||||
#include "overlay104/struct_ov104_0223BFFC.h"
|
||||
#include "overlay104/struct_ov104_0223C4CC.h"
|
||||
|
|
@ -63,10 +62,10 @@ BOOL FrontierScrCmd_B8(FrontierScriptContext *param0)
|
|||
u16 v6 = FrontierScriptContext_GetVar(param0);
|
||||
u16 *v7 = FrontierScriptContext_TryGetVarPointer(param0);
|
||||
|
||||
v1 = sub_0209B970(param0->unk_00->unk_00);
|
||||
v1 = sub_0209B970(param0->scriptMan->unk_00);
|
||||
v0 = ov104_02237DD8(v1->saveData, v2, v3, v4, v5, v6, v7);
|
||||
|
||||
sub_0209B980(param0->unk_00->unk_00, v0);
|
||||
sub_0209B980(param0->scriptMan->unk_00, v0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -75,7 +74,7 @@ BOOL FrontierScrCmd_B9(FrontierScriptContext *param0)
|
|||
UnkStruct_ov104_0223BFFC *v0;
|
||||
u16 v1 = FrontierScriptContext_GetVar(param0);
|
||||
|
||||
v0 = sub_0209B978(param0->unk_00->unk_00);
|
||||
v0 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
ov104_0223806C(v0, v1);
|
||||
|
||||
return 0;
|
||||
|
|
@ -83,7 +82,7 @@ BOOL FrontierScrCmd_B9(FrontierScriptContext *param0)
|
|||
|
||||
BOOL FrontierScrCmd_BA(FrontierScriptContext *param0)
|
||||
{
|
||||
UnkStruct_ov104_0223BFFC *v0 = sub_0209B978(param0->unk_00->unk_00);
|
||||
UnkStruct_ov104_0223BFFC *v0 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
ov104_02238210(v0);
|
||||
|
||||
return 0;
|
||||
|
|
@ -94,7 +93,7 @@ BOOL FrontierScrCmd_C3(FrontierScriptContext *param0)
|
|||
int v0;
|
||||
UnkStruct_ov104_0223BFFC *v1;
|
||||
UnkStruct_ov104_02238240 *v2;
|
||||
UnkStruct_ov104_02230BE4 *v3 = sub_0209B970(param0->unk_00->unk_00);
|
||||
UnkStruct_ov104_02230BE4 *v3 = sub_0209B970(param0->scriptMan->unk_00);
|
||||
|
||||
FS_EXTERN_OVERLAY(battle_arcade_app);
|
||||
|
||||
|
|
@ -105,14 +104,14 @@ BOOL FrontierScrCmd_C3(FrontierScriptContext *param0)
|
|||
FS_OVERLAY_ID(battle_arcade_app)
|
||||
};
|
||||
|
||||
v1 = sub_0209B978(param0->unk_00->unk_00);
|
||||
v1 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
v2 = Heap_Alloc(HEAP_ID_FIELD2, sizeof(UnkStruct_ov104_02238240));
|
||||
|
||||
MI_CpuClear8(v2, sizeof(UnkStruct_ov104_02238240));
|
||||
v2->saveData = v3->saveData;
|
||||
|
||||
ov104_02237634(v2, v1);
|
||||
sub_0209B988(param0->unk_00->unk_00, &v4, v2, 0, ov104_0223770C);
|
||||
sub_0209B988(param0->scriptMan->unk_00, &v4, v2, 0, ov104_0223770C);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -127,7 +126,7 @@ BOOL FrontierScrCmd_BB(FrontierScriptContext *param0)
|
|||
Pokemon *v11;
|
||||
Pokemon *v12;
|
||||
|
||||
v9 = sub_0209B978(param0->unk_00->unk_00);
|
||||
v9 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
v10 = v9->unk_0C;
|
||||
|
||||
v9->unk_1D = ov104_02238538(v9, v10->parties[0], v10->parties[2], v10->totalTurnsElapsed);
|
||||
|
|
@ -198,13 +197,13 @@ BOOL FrontierScrCmd_BC(FrontierScriptContext *param0)
|
|||
{
|
||||
FieldBattleDTO *v0;
|
||||
UnkStruct_ov104_0223BFFC *v1;
|
||||
UnkStruct_ov104_02230BE4 *v2 = sub_0209B970(param0->unk_00->unk_00);
|
||||
UnkStruct_ov104_02230BE4 *v2 = sub_0209B970(param0->scriptMan->unk_00);
|
||||
|
||||
v1 = sub_0209B978(param0->unk_00->unk_00);
|
||||
v1 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
v0 = ov104_0223BDD8(v1, v2);
|
||||
|
||||
v1->unk_0C = v0;
|
||||
sub_0209B988(param0->unk_00->unk_00, &gBattleApplicationTemplate, v0, 0, NULL);
|
||||
sub_0209B988(param0->scriptMan->unk_00, &gBattleApplicationTemplate, v0, 0, NULL);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -260,7 +259,7 @@ static void ov104_0223770C(void *param0)
|
|||
|
||||
BOOL FrontierScrCmd_BD(FrontierScriptContext *param0)
|
||||
{
|
||||
UnkStruct_ov104_0223BFFC *v0 = sub_0209B978(param0->unk_00->unk_00);
|
||||
UnkStruct_ov104_0223BFFC *v0 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
ov104_022384D4(v0);
|
||||
|
||||
return 0;
|
||||
|
|
@ -268,7 +267,7 @@ BOOL FrontierScrCmd_BD(FrontierScriptContext *param0)
|
|||
|
||||
BOOL FrontierScrCmd_BE(FrontierScriptContext *param0)
|
||||
{
|
||||
UnkStruct_ov104_0223BFFC *v0 = sub_0209B978(param0->unk_00->unk_00);
|
||||
UnkStruct_ov104_0223BFFC *v0 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
ov104_022384DC(v0);
|
||||
|
||||
return 0;
|
||||
|
|
@ -293,9 +292,9 @@ BOOL FrontierScrCmd_BF(FrontierScriptContext *param0)
|
|||
u8 v19 = FrontierScriptContext_GetVar(param0);
|
||||
u16 *v20 = FrontierScriptContext_TryGetVarPointer(param0);
|
||||
|
||||
v3 = sub_0209B978(param0->unk_00->unk_00);
|
||||
v14 = sub_0209B970(param0->unk_00->unk_00);
|
||||
v15 = ov104_0222E924(param0->unk_00);
|
||||
v3 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
v14 = sub_0209B970(param0->scriptMan->unk_00);
|
||||
v15 = ov104_0222E924(param0->scriptMan);
|
||||
|
||||
switch (v17) {
|
||||
case 2:
|
||||
|
|
@ -456,7 +455,7 @@ BOOL FrontierScrCmd_BF(FrontierScriptContext *param0)
|
|||
v6 = BattleArcade_GetCategoryFromEffect(v3->unk_13);
|
||||
|
||||
if (v6 == 0) {
|
||||
StringTemplate_SetFrontierTrainerName(param0->unk_00->strTemplate, v18, v3->unk_78[ov104_02238498(v3, v19)]);
|
||||
StringTemplate_SetFrontierTrainerName(param0->scriptMan->strTemplate, v18, v3->unk_78[ov104_02238498(v3, v19)]);
|
||||
} else {
|
||||
if (BattleArcade_IsMultiPlayerChallenge(v3->unk_10) == 0) {
|
||||
v16 = SaveData_GetTrainerInfo(v14->saveData);
|
||||
|
|
@ -464,7 +463,7 @@ BOOL FrontierScrCmd_BF(FrontierScriptContext *param0)
|
|||
v16 = CommInfo_TrainerInfo(v19);
|
||||
}
|
||||
|
||||
StringTemplate_SetPlayerName(param0->unk_00->strTemplate, v18, v16);
|
||||
StringTemplate_SetPlayerName(param0->scriptMan->strTemplate, v18, v16);
|
||||
}
|
||||
break;
|
||||
case 39:
|
||||
|
|
@ -493,7 +492,7 @@ BOOL FrontierScrCmd_BF(FrontierScriptContext *param0)
|
|||
UnkStruct_ov104_0223C634 *v26;
|
||||
Sprite *v27;
|
||||
|
||||
v26 = ov104_0223D5A8(param0->unk_00->unk_00, v19);
|
||||
v26 = ov104_0223D5A8(param0->scriptMan->unk_00, v19);
|
||||
v25 = ov63_0222D050(v26->unk_04);
|
||||
|
||||
PaletteData_Blend(v15->unk_04, 2, v25 * 16, 16, v18, 0x0);
|
||||
|
|
@ -540,8 +539,8 @@ BOOL FrontierScrCmd_BF(FrontierScriptContext *param0)
|
|||
|
||||
static void ov104_02237C0C(FrontierScriptContext *param0, UnkStruct_ov104_0223BFFC *param1, u16 param2)
|
||||
{
|
||||
UnkStruct_ov104_022320B4 *v0 = param0->unk_00;
|
||||
UnkStruct_ov104_0223C4CC *v1 = ov104_0222E924(param0->unk_00);
|
||||
FrontierScriptManager *v0 = param0->scriptMan;
|
||||
UnkStruct_ov104_0223C4CC *v1 = ov104_0222E924(param0->scriptMan);
|
||||
ParticleSystem *v2 = ov104_0223D6D0(v1->unk_10, 0);
|
||||
ParticleSystem_CreateEmitterWithCallback(v2, param2, ov104_02237C30, param1);
|
||||
|
||||
|
|
@ -571,7 +570,7 @@ BOOL FrontierScrCmd_C0(FrontierScriptContext *param0)
|
|||
UnkStruct_ov104_0223BFFC *v0;
|
||||
u16 *v1 = FrontierScriptContext_TryGetVarPointer(param0);
|
||||
|
||||
v0 = sub_0209B978(param0->unk_00->unk_00);
|
||||
v0 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
*v1 = v0->unk_28;
|
||||
|
||||
return 0;
|
||||
|
|
@ -584,7 +583,7 @@ BOOL FrontierScrCmd_C1(FrontierScriptContext *param0)
|
|||
u16 v2 = FrontierScriptContext_GetVar(param0);
|
||||
u16 *v3 = FrontierScriptContext_TryGetVarPointer(param0);
|
||||
|
||||
v0 = sub_0209B978(param0->unk_00->unk_00);
|
||||
v0 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
*v3 = ov104_02238B40(v0, v1, v2);
|
||||
|
||||
return 1;
|
||||
|
|
@ -605,7 +604,7 @@ static BOOL ov104_02237D18(FrontierScriptContext *param0)
|
|||
UnkStruct_ov104_0223BFFC *v0;
|
||||
u16 v1 = FrontierScriptContext_TryGetVar(param0, param0->data[0]);
|
||||
|
||||
v0 = sub_0209B978(param0->unk_00->unk_00);
|
||||
v0 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
|
||||
if (v0->unk_A7C >= 2) {
|
||||
v0->unk_A7C = 0;
|
||||
|
|
@ -619,10 +618,10 @@ BOOL FrontierScrCmd_C4(FrontierScriptContext *param0)
|
|||
{
|
||||
u16 *v0;
|
||||
UnkStruct_ov104_0223BFFC *v1;
|
||||
UnkStruct_ov104_02230BE4 *v2 = sub_0209B970(param0->unk_00->unk_00);
|
||||
UnkStruct_ov104_02230BE4 *v2 = sub_0209B970(param0->scriptMan->unk_00);
|
||||
u16 v3 = FrontierScriptContext_ReadByte(param0);
|
||||
|
||||
v1 = sub_0209B978(param0->unk_00->unk_00);
|
||||
v1 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
|
||||
if (v1 == NULL) {
|
||||
return 0;
|
||||
|
|
@ -636,7 +635,7 @@ BOOL FrontierScrCmd_C4(FrontierScriptContext *param0)
|
|||
|
||||
BOOL FrontierScrCmd_C5(FrontierScriptContext *param0)
|
||||
{
|
||||
UnkStruct_ov104_0223BFFC *v0 = sub_0209B978(param0->unk_00->unk_00);
|
||||
UnkStruct_ov104_0223BFFC *v0 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
ov104_02238B88(v0, v0->unk_13);
|
||||
|
||||
return 1;
|
||||
|
|
@ -645,12 +644,12 @@ BOOL FrontierScrCmd_C5(FrontierScriptContext *param0)
|
|||
BOOL FrontierScrCmd_C6(FrontierScriptContext *param0)
|
||||
{
|
||||
UnkStruct_ov104_0223BFFC *v0;
|
||||
UnkStruct_ov104_0223C4CC *v1 = ov104_0222E924(param0->unk_00);
|
||||
UnkStruct_ov104_0223C4CC *v1 = ov104_0222E924(param0->scriptMan);
|
||||
u16 v2 = FrontierScriptContext_GetVar(param0);
|
||||
u16 v3 = FrontierScriptContext_GetVar(param0);
|
||||
u16 v4 = FrontierScriptContext_GetVar(param0);
|
||||
|
||||
v0 = sub_0209B978(param0->unk_00->unk_00);
|
||||
v0 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
ov104_022389F4(v0, v1, v2, v3, v4);
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -11,13 +11,13 @@
|
|||
#include "struct_decls/struct_0202440C_decl.h"
|
||||
#include "struct_defs/battle_tower.h"
|
||||
|
||||
#include "overlay104/defs.h"
|
||||
#include "overlay104/frontier_script_context.h"
|
||||
#include "overlay104/frscrcmd.h"
|
||||
#include "overlay104/ov104_02231F74.h"
|
||||
#include "overlay104/ov104_022394A4.h"
|
||||
#include "overlay104/ov104_0223A0C4.h"
|
||||
#include "overlay104/struct_ov104_02230BE4.h"
|
||||
#include "overlay104/struct_ov104_022320B4_t.h"
|
||||
#include "savedata/save_table.h"
|
||||
|
||||
#include "communication_system.h"
|
||||
|
|
@ -43,12 +43,12 @@ BOOL FrontierScrCmd_CallBattleTowerFunction(FrontierScriptContext *ctx)
|
|||
BattleTower *battleTower;
|
||||
u16 functionIndex, functionArgument;
|
||||
u16 *destVar;
|
||||
UnkStruct_ov104_02230BE4 *v8 = sub_0209B970(ctx->unk_00->unk_00);
|
||||
UnkStruct_ov104_02230BE4 *v8 = sub_0209B970(ctx->scriptMan->unk_00);
|
||||
|
||||
functionIndex = FrontierScriptContext_ReadHalfWord(ctx);
|
||||
functionArgument = FrontierScriptContext_GetVar(ctx);
|
||||
destVar = FrontierScriptContext_TryGetVarPointer(ctx);
|
||||
battleTower = sub_0209B978(ctx->unk_00->unk_00);
|
||||
battleTower = sub_0209B978(ctx->scriptMan->unk_00);
|
||||
|
||||
switch (functionIndex) {
|
||||
case BT_FUNC_RESET_SYSTEM:
|
||||
|
|
@ -155,10 +155,10 @@ BOOL FrontierScrCmd_85(FrontierScriptContext *param0)
|
|||
u8 v0;
|
||||
u16 *v1;
|
||||
BattleTower *battleTower;
|
||||
UnkStruct_ov104_02230BE4 *v3 = sub_0209B970(param0->unk_00->unk_00);
|
||||
UnkStruct_ov104_02230BE4 *v3 = sub_0209B970(param0->scriptMan->unk_00);
|
||||
u16 v4 = FrontierScriptContext_ReadByte(param0);
|
||||
|
||||
battleTower = sub_0209B978(param0->unk_00->unk_00);
|
||||
battleTower = sub_0209B978(param0->scriptMan->unk_00);
|
||||
|
||||
if (battleTower == NULL) {
|
||||
return 0;
|
||||
|
|
@ -172,7 +172,7 @@ BOOL FrontierScrCmd_85(FrontierScriptContext *param0)
|
|||
|
||||
BOOL FrontierScrCmd_86(FrontierScriptContext *param0)
|
||||
{
|
||||
BattleTower *battleTower = sub_0209B978(param0->unk_00->unk_00);
|
||||
BattleTower *battleTower = sub_0209B978(param0->scriptMan->unk_00);
|
||||
BattleTower_Free(battleTower);
|
||||
|
||||
return 0;
|
||||
|
|
@ -182,15 +182,15 @@ BOOL FrontierScrCmd_87(FrontierScriptContext *param0)
|
|||
{
|
||||
FieldBattleDTO *v0;
|
||||
BattleTower *battleTower;
|
||||
UnkStruct_ov104_02230BE4 *v2 = sub_0209B970(param0->unk_00->unk_00);
|
||||
UnkStruct_ov104_02230BE4 *v2 = sub_0209B970(param0->scriptMan->unk_00);
|
||||
|
||||
battleTower = sub_0209B978(param0->unk_00->unk_00);
|
||||
battleTower = sub_0209B978(param0->scriptMan->unk_00);
|
||||
v0 = ov104_0223A580(battleTower, v2);
|
||||
|
||||
battleTower->unk_8D0 = v0;
|
||||
|
||||
Sound_SetSceneAndPlayBGM(SOUND_SCENE_BATTLE, SEQ_BATTLE_TRAINER, 1);
|
||||
sub_0209B988(param0->unk_00->unk_00, &gBattleApplicationTemplate, v0, 0, NULL);
|
||||
sub_0209B988(param0->scriptMan->unk_00, &gBattleApplicationTemplate, v0, 0, NULL);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -201,7 +201,7 @@ BOOL FrontierScrCmd_88(FrontierScriptContext *param0)
|
|||
FieldBattleDTO *v1;
|
||||
u16 *v2;
|
||||
|
||||
battleTower = sub_0209B978(param0->unk_00->unk_00);
|
||||
battleTower = sub_0209B978(param0->scriptMan->unk_00);
|
||||
v2 = FrontierScriptContext_TryGetVarPointer(param0);
|
||||
v1 = battleTower->unk_8D0;
|
||||
|
||||
|
|
@ -215,12 +215,12 @@ BOOL FrontierScrCmd_88(FrontierScriptContext *param0)
|
|||
BOOL FrontierScrCmd_89(FrontierScriptContext *param0)
|
||||
{
|
||||
BattleTower *battleTower;
|
||||
UnkStruct_ov104_02230BE4 *v1 = sub_0209B970(param0->unk_00->unk_00);
|
||||
UnkStruct_ov104_02230BE4 *v1 = sub_0209B970(param0->scriptMan->unk_00);
|
||||
u16 v2 = FrontierScriptContext_GetVar(param0);
|
||||
u16 v3 = FrontierScriptContext_GetVar(param0);
|
||||
u16 *v4 = FrontierScriptContext_TryGetVarPointer(param0);
|
||||
|
||||
battleTower = sub_0209B978(param0->unk_00->unk_00);
|
||||
battleTower = sub_0209B978(param0->scriptMan->unk_00);
|
||||
|
||||
switch (v2) {
|
||||
case 2:
|
||||
|
|
@ -256,9 +256,9 @@ BOOL FrontierScrCmd_8A(FrontierScriptContext *param0)
|
|||
static BOOL ov104_0223942C(FrontierScriptContext *param0)
|
||||
{
|
||||
BattleTower *battleTower;
|
||||
UnkStruct_ov104_02230BE4 *v1 = sub_0209B970(param0->unk_00->unk_00);
|
||||
UnkStruct_ov104_02230BE4 *v1 = sub_0209B970(param0->scriptMan->unk_00);
|
||||
|
||||
battleTower = sub_0209B978(param0->unk_00->unk_00);
|
||||
battleTower = sub_0209B978(param0->scriptMan->unk_00);
|
||||
|
||||
if (ov104_02239464(param0, battleTower, v1->saveData, param0->data[0], param0->data[1]) == 1) {
|
||||
return 1;
|
||||
|
|
|
|||
|
|
@ -9,13 +9,13 @@
|
|||
#include "struct_defs/battle_tower.h"
|
||||
#include "struct_defs/struct_0209BBA4.h"
|
||||
|
||||
#include "overlay104/defs.h"
|
||||
#include "overlay104/frontier_script_context.h"
|
||||
#include "overlay104/frscrcmd.h"
|
||||
#include "overlay104/ov104_0222DCE0.h"
|
||||
#include "overlay104/ov104_02239C58.h"
|
||||
#include "overlay104/ov104_0223C164.h"
|
||||
#include "overlay104/struct_ov104_02230BE4.h"
|
||||
#include "overlay104/struct_ov104_022320B4_t.h"
|
||||
|
||||
#include "communication_system.h"
|
||||
#include "heap.h"
|
||||
|
|
@ -35,16 +35,16 @@ static BOOL ov104_02239C20(FrontierScriptContext *param0);
|
|||
|
||||
BOOL FrontierScrCmd_AA(FrontierScriptContext *param0)
|
||||
{
|
||||
UnkStruct_ov104_02230BE4 *v1 = sub_0209B970(param0->unk_00->unk_00);
|
||||
UnkStruct_ov104_02230BE4 *v1 = sub_0209B970(param0->scriptMan->unk_00);
|
||||
UnkStruct_0209BBA4 *v0 = ov104_02239C58(v1->saveData);
|
||||
|
||||
sub_0209B980(param0->unk_00->unk_00, v0);
|
||||
sub_0209B980(param0->scriptMan->unk_00, v0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
BOOL FrontierScrCmd_AB(FrontierScriptContext *param0)
|
||||
{
|
||||
UnkStruct_0209BBA4 *v0 = sub_0209B978(param0->unk_00->unk_00);
|
||||
UnkStruct_0209BBA4 *v0 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
ov104_02239C7C(v0);
|
||||
|
||||
return 0;
|
||||
|
|
@ -58,7 +58,7 @@ BOOL FrontierScrCmd_AC(FrontierScriptContext *param0)
|
|||
u16 v3 = FrontierScriptContext_GetVar(param0);
|
||||
u16 *v4 = FrontierScriptContext_TryGetVarPointer(param0);
|
||||
|
||||
v0 = sub_0209B978(param0->unk_00->unk_00);
|
||||
v0 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
*v4 = ov104_02239C88(v0, v1, v2, v3);
|
||||
|
||||
return 1;
|
||||
|
|
@ -76,7 +76,7 @@ BOOL FrontierScrCmd_AD(FrontierScriptContext *param0)
|
|||
|
||||
static BOOL ov104_02239680(FrontierScriptContext *param0)
|
||||
{
|
||||
UnkStruct_0209BBA4 *v0 = sub_0209B978(param0->unk_00->unk_00);
|
||||
UnkStruct_0209BBA4 *v0 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
|
||||
if (v0->unk_6F >= 2) {
|
||||
v0->unk_6F = 0;
|
||||
|
|
@ -92,7 +92,7 @@ BOOL FrontierScrCmd_AE(FrontierScriptContext *param0)
|
|||
u16 v1 = FrontierScriptContext_GetVar(param0);
|
||||
u16 *v2 = FrontierScriptContext_TryGetVarPointer(param0);
|
||||
|
||||
v0 = sub_0209B978(param0->unk_00->unk_00);
|
||||
v0 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
|
||||
if (v1 == v0->unk_6E) {
|
||||
*v2 = 1;
|
||||
|
|
@ -111,13 +111,13 @@ BOOL FrontierScrCmd_AF(FrontierScriptContext *param0)
|
|||
u16 v3 = FrontierScriptContext_GetVar(param0);
|
||||
u16 *v4 = FrontierScriptContext_TryGetVarPointer(param0);
|
||||
|
||||
v0 = sub_0209B978(param0->unk_00->unk_00);
|
||||
v1 = sub_0209B970(param0->unk_00->unk_00);
|
||||
v0 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
v1 = sub_0209B970(param0->scriptMan->unk_00);
|
||||
|
||||
v0->fieldSystem = v1->fieldSystem;
|
||||
v0->unk_B0 = v4;
|
||||
|
||||
ov104_02239CD0(param0->unk_00->unk_00, v0, v3);
|
||||
ov104_02239CD0(param0->scriptMan->unk_00, v0, v3);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -130,7 +130,7 @@ BOOL FrontierScrCmd_B0(FrontierScriptContext *param0)
|
|||
u16 *v3 = FrontierScriptContext_TryGetVarPointer(param0);
|
||||
u16 *v4 = FrontierScriptContext_TryGetVarPointer(param0);
|
||||
|
||||
v1 = sub_0209B978(param0->unk_00->unk_00);
|
||||
v1 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
|
||||
if (v1->partyMenu->selectedMonSlot == 7) {
|
||||
*v3 = 0xff;
|
||||
|
|
@ -160,7 +160,7 @@ BOOL FrontierScrCmd_B1(FrontierScriptContext *param0)
|
|||
UnkStruct_0209BBA4 *v0;
|
||||
u16 *v1 = FrontierScriptContext_TryGetVarPointer(param0);
|
||||
|
||||
v0 = sub_0209B978(param0->unk_00->unk_00);
|
||||
v0 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
*v1 = v0->unk_59;
|
||||
|
||||
return 0;
|
||||
|
|
@ -178,8 +178,8 @@ BOOL FrontierScrCmd_B2(FrontierScriptContext *param0)
|
|||
u8 v8 = FrontierScriptContext_ReadByte(param0);
|
||||
u16 *v9 = FrontierScriptContext_TryGetVarPointer(param0);
|
||||
|
||||
v4 = sub_0209B978(param0->unk_00->unk_00);
|
||||
v5 = sub_0209B970(param0->unk_00->unk_00);
|
||||
v4 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
v5 = sub_0209B970(param0->scriptMan->unk_00);
|
||||
|
||||
switch (v6) {
|
||||
case 0:
|
||||
|
|
@ -306,14 +306,14 @@ BOOL FrontierScrCmd_B3(FrontierScriptContext *param0)
|
|||
UnkStruct_0209BBA4 *v3;
|
||||
UnkStruct_0209BBA4 v4;
|
||||
|
||||
v2 = sub_0209B970(param0->unk_00->unk_00);
|
||||
v3 = sub_0209B978(param0->unk_00->unk_00);
|
||||
v2 = sub_0209B970(param0->scriptMan->unk_00);
|
||||
v3 = sub_0209B978(param0->scriptMan->unk_00);
|
||||
|
||||
v4 = *v3;
|
||||
ov104_02239C7C(v3);
|
||||
|
||||
battleTower = BattleTower_Init(v2->saveData, 0, BATTLE_TOWER_MODE_6);
|
||||
sub_0209B980(param0->unk_00->unk_00, battleTower);
|
||||
sub_0209B980(param0->scriptMan->unk_00, battleTower);
|
||||
|
||||
if (battleTower->challengeMode == BATTLE_TOWER_MODE_6) {
|
||||
ov104_0222E630(v2->saveData);
|
||||
|
|
@ -347,7 +347,7 @@ BOOL FrontierScrCmd_B4(FrontierScriptContext *param0)
|
|||
BattleTower *battleTower;
|
||||
u16 *v1 = FrontierScriptContext_TryGetVarPointer(param0);
|
||||
|
||||
battleTower = sub_0209B978(param0->unk_00->unk_00);
|
||||
battleTower = sub_0209B978(param0->scriptMan->unk_00);
|
||||
*v1 = sub_0209BB08(battleTower);
|
||||
|
||||
return 1;
|
||||
|
|
@ -361,7 +361,7 @@ BOOL FrontierScrCmd_B5(FrontierScriptContext *param0)
|
|||
|
||||
static BOOL ov104_02239C20(FrontierScriptContext *param0)
|
||||
{
|
||||
BattleTower *battleTower = sub_0209B978(param0->unk_00->unk_00);
|
||||
BattleTower *battleTower = sub_0209B978(param0->scriptMan->unk_00);
|
||||
|
||||
if (battleTower->unk_8D4 < 2) {
|
||||
return 0;
|
||||
|
|
@ -373,7 +373,7 @@ static BOOL ov104_02239C20(FrontierScriptContext *param0)
|
|||
|
||||
BOOL FrontierScrCmd_B6(FrontierScriptContext *param0)
|
||||
{
|
||||
BattleTower *battleTower = sub_0209B978(param0->unk_00->unk_00);
|
||||
BattleTower *battleTower = sub_0209B978(param0->scriptMan->unk_00);
|
||||
BattleTower_Free(battleTower);
|
||||
battleTower = NULL;
|
||||
|
||||
|
|
|
|||
|
|
@ -6,12 +6,11 @@
|
|||
#include "constants/heap.h"
|
||||
|
||||
#include "functypes/funcptr_0209B988.h"
|
||||
#include "overlay104/ov104_0222E63C.h"
|
||||
#include "overlay104/defs.h"
|
||||
#include "overlay104/frontier_script_manager.h"
|
||||
#include "overlay104/ov104_0223C2D4.h"
|
||||
#include "overlay104/struct_ov104_0222E8C8.h"
|
||||
#include "overlay104/struct_ov104_02230BE4.h"
|
||||
#include "overlay104/struct_ov104_022320B4_decl.h"
|
||||
#include "overlay104/struct_ov104_022320B4_t.h"
|
||||
#include "overlay104/struct_ov104_0223C4CC.h"
|
||||
#include "overlay104/struct_ov104_0223C634.h"
|
||||
#include "overlay104/struct_ov104_0223C688.h"
|
||||
|
|
@ -36,7 +35,7 @@ typedef struct UnkStruct_0209B75C_t {
|
|||
void *unk_08;
|
||||
UnkFuncPtr_0209B988 unk_0C;
|
||||
u8 unk_10;
|
||||
UnkStruct_ov104_022320B4 *unk_14;
|
||||
FrontierScriptManager *unk_14;
|
||||
UnkStruct_ov104_0223C4CC *unk_18;
|
||||
u8 unk_1C;
|
||||
u8 unk_1D;
|
||||
|
|
@ -81,8 +80,8 @@ int sub_0209B6F8(ApplicationManager *appMan, int *param1)
|
|||
v0->unk_00 = ApplicationManager_Args(appMan);
|
||||
GF_ASSERT(v0->unk_00 != NULL);
|
||||
|
||||
v0->unk_14 = ov104_0222E63C(v0, HEAP_ID_FIELD2, v0->unk_00->unk_24);
|
||||
ov104_0222E748(v0->unk_14, v0->unk_00->unk_24, 0);
|
||||
v0->unk_14 = FrontierScriptManager_New(v0, HEAP_ID_FIELD2, v0->unk_00->unk_24);
|
||||
FrontierScriptManager_Load(v0->unk_14, v0->unk_00->unk_24, 0);
|
||||
|
||||
sub_0209B8C8(v0);
|
||||
|
||||
|
|
@ -162,15 +161,15 @@ int sub_0209B75C(ApplicationManager *appMan, int *param1)
|
|||
sub_0209B8C8(v0);
|
||||
|
||||
if (v0->unk_20 == 0xffff) {
|
||||
ov104_0222E86C(v0->unk_14, v0->unk_00->unk_24, HEAP_ID_FIELD2);
|
||||
FrontierScriptManager_UpdateMessageLoader(v0->unk_14, v0->unk_00->unk_24, HEAP_ID_FIELD2);
|
||||
} else {
|
||||
UnkStruct_ov104_0222E8C8 *v2;
|
||||
|
||||
v2 = ov104_0222E8C8(v0->unk_14, HEAP_ID_FIELD2);
|
||||
ov104_0222E710(v0->unk_14);
|
||||
FrontierScriptManager_Free(v0->unk_14);
|
||||
|
||||
v0->unk_14 = ov104_0222E63C(v0, HEAP_ID_FIELD2, v0->unk_00->unk_24);
|
||||
ov104_0222E748(v0->unk_14, v0->unk_00->unk_24, v0->unk_20);
|
||||
v0->unk_14 = FrontierScriptManager_New(v0, HEAP_ID_FIELD2, v0->unk_00->unk_24);
|
||||
FrontierScriptManager_Load(v0->unk_14, v0->unk_00->unk_24, v0->unk_20);
|
||||
ov104_0222E8E8(v0->unk_14, v2);
|
||||
}
|
||||
|
||||
|
|
@ -186,7 +185,7 @@ int sub_0209B8A4(ApplicationManager *appMan, int *param1)
|
|||
{
|
||||
UnkStruct_0209B75C *v0 = ApplicationManager_Data(appMan);
|
||||
|
||||
ov104_0222E710(v0->unk_14);
|
||||
FrontierScriptManager_Free(v0->unk_14);
|
||||
|
||||
sub_0209B8D8(v0);
|
||||
ApplicationManager_FreeData(appMan);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user