Merge branch 'master' into overlay_60

This commit is contained in:
Adrienn Tindall 2024-02-20 15:01:58 -06:00 committed by GitHub
commit 1f644005dc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 275 additions and 584 deletions

View File

@ -1,44 +0,0 @@
#include <nitro/fs/overlay.h>
#pragma once
.public sub_02002C60
.public CreateHeap
.public DestroyHeap
.public AllocFromHeap
.public AllocFromHeapAtEnd
.public FreeToHeap
.public GF_AssertFail
.public sub_020270C4
.public Save_PlayerData_GetOptionsAddr
.public Save_Mailbox_Get
.public Save_SealCase_Get
.public SealCase_GetCapsuleI
.public CapsuleGetSealI
.public SealOnCapsuleGetID
.public sub_02037AC0
.public sub_02037B38
.public MapHeader_GetMapSec
.public SetupNativeScript
.public ScriptReadHalfword
.public FieldSysGetAttrAddr
.public GetVarPointer
.public FieldSystem_VarGet
.public TaskManager_Call
.public CallApplicationAsTask
.public TaskManager_GetFieldSystem
.public TaskManager_GetEnvironment
.public sub_0205525C
.public CallTask_RestoreOverworld
.public sub_0206B910
.public SetMonData
.public Party_GetCount
.public Party_GetMonByIndex
.public SaveArray_Party_Get
.public Save_Bag_Get
.public sub_0209106C
.public MI_CpuFill8
.public memset
.public _0210159C
.public NNS_G3dGlb
.public ov57_022378DC
.public ov57_02237AF8
.public ov57_02237B20

View File

@ -1,532 +0,0 @@
#include "constants/species.h"
#include "constants/maps.h"
#include "constants/sprites.h"
#include "constants/items.h"
#include "constants/moves.h"
.include "asm/macros.inc"
.include "unk_0206B910.inc"
.include "global.inc"
.public NNS_G3dGlb
.text
thumb_func_start sub_0206B910
sub_0206B910: ; 0x0206B910
push {r3, r4, r5, r6, r7, lr}
add r7, r0, #0
add r5, r1, #0
bl TaskManager_GetFieldSystem
add r6, r0, #0
mov r0, #0xb
mov r1, #0x14
bl AllocFromHeapAtEnd
add r4, r0, #0
add r2, r4, #0
mov r1, #0x14
mov r0, #0
_0206B92C:
strb r0, [r2]
add r2, r2, #1
sub r1, r1, #1
bne _0206B92C
mov r0, #0xb
mov r1, #0x34
str r5, [r4, #0xc]
bl AllocFromHeap
mov r1, #0
mov r2, #0x34
str r0, [r4, #4]
bl memset
add r0, r5, #0
bl Save_PlayerData_GetOptionsAddr
ldr r1, [r4, #4]
str r0, [r1, #0x24]
ldr r0, [r4, #4]
str r5, [r0, #0x28]
mov r0, #0x43
lsl r0, r0, #2
add r1, r6, r0
ldr r0, [r4, #4]
str r1, [r0, #0x2c]
mov r0, #0xb
mov r1, #0x44
bl AllocFromHeap
mov r1, #0
mov r2, #0x44
str r0, [r4, #8]
bl memset
ldr r1, _0206B980 ; =sub_0206B984
add r0, r7, #0
add r2, r4, #0
bl TaskManager_Call
pop {r3, r4, r5, r6, r7, pc}
nop
_0206B980: .word sub_0206B984
thumb_func_end sub_0206B910
thumb_func_start sub_0206B984
sub_0206B984: ; 0x0206B984
push {r4, r5, r6, r7, lr}
sub sp, #0xc
str r0, [sp]
bl TaskManager_GetEnvironment
add r7, r0, #0
ldr r0, [sp]
ldr r6, [r7, #4]
bl TaskManager_GetFieldSystem
add r5, r0, #0
ldr r0, [r7, #0x10]
cmp r0, #6
bls _0206B9A2
b _0206BB1C
_0206B9A2:
add r0, r0, r0
add r0, pc
ldrh r0, [r0, #6]
lsl r0, r0, #0x10
asr r0, r0, #0x10
add pc, r0
_0206B9AE: ; jump table
.short _0206B9BC - _0206B9AE - 2 ; case 0
.short _0206BA20 - _0206B9AE - 2 ; case 1
.short _0206BA30 - _0206B9AE - 2 ; case 2
.short _0206BA4E - _0206B9AE - 2 ; case 3
.short _0206BA96 - _0206B9AE - 2 ; case 4
.short _0206BAF8 - _0206B9AE - 2 ; case 5
.short _0206BB04 - _0206B9AE - 2 ; case 6
_0206B9BC:
ldr r0, [sp]
bl sub_0205525C
ldr r0, [r7, #0xc]
bl Save_SealCase_Get
str r0, [r6, #0x20]
add r0, r6, #0
mov r1, #0
add r0, #0x31
strb r1, [r0]
mov r0, #0x43
lsl r0, r0, #2
add r0, r5, r0
str r0, [r6, #0x2c]
ldr r0, [r7, #0xc]
bl SaveArray_Party_Get
str r0, [r6, #0x1c]
bl Party_GetCount
mov r4, #0
str r0, [sp, #4]
str r0, [r6]
cmp r0, #0
ble _0206BA06
add r5, r6, #0
_0206B9F2:
ldr r0, [r6, #0x1c]
add r1, r4, #0
bl Party_GetMonByIndex
str r0, [r5, #4]
ldr r0, [sp, #4]
add r4, r4, #1
add r5, r5, #4
cmp r4, r0
blt _0206B9F2
_0206BA06:
cmp r4, #6
bge _0206BA1A
lsl r0, r4, #2
add r1, r6, r0
mov r0, #0
_0206BA10:
add r4, r4, #1
str r0, [r1, #4]
add r1, r1, #4
cmp r4, #6
blt _0206BA10
_0206BA1A:
mov r0, #1
str r0, [r7, #0x10]
b _0206BB1C
_0206BA20:
ldr r0, [sp]
ldr r1, _0206BB24 ; =_020FF480
add r2, r6, #0
bl CallApplicationAsTask
mov r0, #2
str r0, [r7, #0x10]
b _0206BB1C
_0206BA30:
ldr r0, [r7, #4]
add r0, #0x31
ldrb r0, [r0]
cmp r0, #0
beq _0206BA42
cmp r0, #1
beq _0206BA48
bl GF_AssertFail
_0206BA42:
mov r0, #5
str r0, [r7, #0x10]
b _0206BB1C
_0206BA48:
mov r0, #3
str r0, [r7, #0x10]
b _0206BB1C
_0206BA4E:
ldr r4, [r7, #8]
ldr r0, [r6, #0x1c]
str r0, [r4]
ldr r0, [r7, #0xc]
bl Save_Bag_Get
str r0, [r4, #4]
ldr r0, [r7, #0xc]
bl Save_Mailbox_Get
str r0, [r4, #8]
add r0, r4, #0
mov r1, #0
add r0, #0x26
strb r1, [r0]
add r0, r4, #0
add r0, #0x25
strb r1, [r0]
add r0, r4, #0
mov r1, #0xf
add r0, #0x24
strb r1, [r0]
ldr r0, [r6, #0x24]
add r1, #0xfd
str r0, [r4, #0xc]
add r0, r5, r1
str r5, [r4, #0x1c]
str r0, [r4, #0x20]
ldr r0, [sp]
ldr r1, _0206BB28 ; =_0210159C
add r2, r4, #0
bl CallApplicationAsTask
mov r0, #4
str r0, [r7, #0x10]
b _0206BB1C
_0206BA96:
ldr r0, [r7, #4]
ldr r1, [r7, #8]
add r0, #0x30
ldrb r0, [r0]
add r1, #0x26
add r0, r0, #1
str r0, [sp, #8]
ldrb r0, [r1]
cmp r0, #7
beq _0206BAF2
ldr r1, [r7, #4]
lsl r0, r0, #2
add r0, r1, r0
ldr r4, [r0, #4]
mov r1, #0xa2
add r0, r4, #0
add r2, sp, #8
bl SetMonData
ldr r1, [sp, #8]
ldr r0, [r6, #0x20]
sub r1, r1, #1
bl SealCase_GetCapsuleI
add r2, r0, #0
add r0, r4, #0
mov r1, #0xab
bl SetMonData
ldr r1, [sp, #8]
ldr r0, [r6, #0x20]
sub r1, r1, #1
bl SealCase_GetCapsuleI
mov r1, #0
bl CapsuleGetSealI
bl SealOnCapsuleGetID
lsl r0, r0, #0x18
lsr r0, r0, #0x18
bl sub_0209106C
ldr r0, [r5, #0xc]
bl sub_020270C4
_0206BAF2:
mov r0, #1
str r0, [r7, #0x10]
b _0206BB1C
_0206BAF8:
ldr r0, [sp]
bl CallTask_RestoreOverworld
mov r0, #6
str r0, [r7, #0x10]
b _0206BB1C
_0206BB04:
ldr r0, [r7, #8]
bl FreeToHeap
ldr r0, [r7, #4]
bl FreeToHeap
add r0, r7, #0
bl FreeToHeap
add sp, #0xc
mov r0, #1
pop {r4, r5, r6, r7, pc}
_0206BB1C:
mov r0, #0
add sp, #0xc
pop {r4, r5, r6, r7, pc}
nop
_0206BB24: .word _020FF480
_0206BB28: .word _0210159C
thumb_func_end sub_0206B984
thumb_func_start ScrCmd_232
ScrCmd_232: ; 0x0206BB2C
push {r3, r4, r5, lr}
add r5, r0, #0
add r0, #0x80
ldr r0, [r0]
mov r1, #0x15
bl FieldSysGetAttrAddr
add r4, r0, #0
add r0, r5, #0
bl ScriptReadHalfword
add r5, #0x80
add r1, r0, #0
ldr r0, [r5]
bl FieldSystem_VarGet
add r1, r0, #0
lsl r1, r1, #0x18
ldr r0, [r4]
lsr r1, r1, #0x18
bl sub_0206BCA4
mov r0, #0
pop {r3, r4, r5, pc}
thumb_func_end ScrCmd_232
thumb_func_start ScrCmd_233
ScrCmd_233: ; 0x0206BB5C
push {r4, lr}
add r4, r0, #0
add r0, #0x80
ldr r0, [r0]
mov r1, #0x15
bl FieldSysGetAttrAddr
add r0, r4, #0
bl ScriptReadHalfword
add r1, r0, #0
add r0, r4, #0
add r0, #0x80
ldr r0, [r0]
bl FieldSystem_VarGet
str r0, [r4, #0x64]
ldr r1, _0206BB8C ; =sub_0206BB90
add r0, r4, #0
bl SetupNativeScript
mov r0, #1
pop {r4, pc}
nop
_0206BB8C: .word sub_0206BB90
thumb_func_end ScrCmd_233
thumb_func_start sub_0206BB90
sub_0206BB90: ; 0x0206BB90
push {r4, lr}
add r4, r0, #0
add r0, #0x80
ldr r0, [r0]
mov r1, #0x15
bl FieldSysGetAttrAddr
ldr r1, [r4, #0x64]
ldr r0, [r0]
lsl r1, r1, #0x18
lsr r1, r1, #0x18
bl sub_0206BCB4
pop {r4, pc}
thumb_func_end sub_0206BB90
thumb_func_start ScrCmd_234
ScrCmd_234: ; 0x0206BBAC
push {r3, r4, r5, r6, r7, lr}
sub sp, #0x20
add r5, r0, #0
add r0, #0x80
ldr r0, [r0]
mov r1, #0x15
bl FieldSysGetAttrAddr
add r4, r0, #0
add r0, r5, #0
bl ScriptReadHalfword
add r1, r0, #0
add r0, r5, #0
add r0, #0x80
ldr r0, [r0]
bl FieldSystem_VarGet
add r6, r0, #0
add r0, r5, #0
bl ScriptReadHalfword
add r1, r0, #0
add r0, r5, #0
add r0, #0x80
ldr r0, [r0]
bl FieldSystem_VarGet
add r7, r0, #0
add r0, r5, #0
bl ScriptReadHalfword
add r1, r0, #0
add r0, r5, #0
add r0, #0x80
ldr r0, [r0]
bl FieldSystem_VarGet
str r0, [sp]
add r0, r5, #0
bl ScriptReadHalfword
add r1, r0, #0
add r0, r5, #0
add r0, #0x80
ldr r0, [r0]
bl FieldSystem_VarGet
add r1, sp, #4
strb r7, [r1]
ldr r0, [sp]
strb r6, [r1, #1]
add r5, #0x80
strb r0, [r1, #2]
ldr r0, [r5]
ldr r0, [r0, #0xc]
str r0, [sp, #0x1c]
add r0, sp, #4
bl sub_0206BCEC
str r0, [r4]
mov r0, #0
add sp, #0x20
pop {r3, r4, r5, r6, r7, pc}
thumb_func_end ScrCmd_234
thumb_func_start ScrCmd_235
ScrCmd_235: ; 0x0206BC2C
push {r3, r4, r5, lr}
add r5, r0, #0
add r0, #0x80
ldr r0, [r0]
mov r1, #0x15
bl FieldSysGetAttrAddr
add r4, r0, #0
add r0, r5, #0
bl ScriptReadHalfword
add r1, r0, #0
add r0, r5, #0
add r0, #0x80
ldr r0, [r0]
bl FieldSystem_VarGet
add r5, #0x80
ldr r0, [r5]
ldr r0, [r0, #0x20]
ldr r0, [r0]
bl MapHeader_GetMapSec
ldr r0, [r4]
bl sub_0206BD00
mov r0, #0
pop {r3, r4, r5, pc}
thumb_func_end ScrCmd_235
thumb_func_start ScrCmd_236
ScrCmd_236: ; 0x0206BC64
push {r4, lr}
add r4, r0, #0
add r0, #0x80
ldr r0, [r0]
mov r1, #0x15
bl FieldSysGetAttrAddr
add r0, r4, #0
bl ScriptReadHalfword
add r4, #0x80
add r1, r0, #0
ldr r0, [r4]
bl GetVarPointer
mov r1, #0
strh r1, [r0]
add r0, r1, #0
pop {r4, pc}
.balign 4, 0
thumb_func_end ScrCmd_236
thumb_func_start ScrCmd_237
ScrCmd_237: ; 0x0206BC8C
push {r3, lr}
add r0, #0x80
ldr r0, [r0]
mov r1, #0x15
bl FieldSysGetAttrAddr
mov r0, #1
bl sub_02002C60
mov r0, #0
pop {r3, pc}
.balign 4, 0
thumb_func_end ScrCmd_237
thumb_func_start sub_0206BCA4
sub_0206BCA4: ; 0x0206BCA4
push {r3, lr}
ldrb r0, [r0, #4]
cmp r0, #0
beq _0206BCB2
add r0, r1, #0
bl sub_02037AC0
_0206BCB2:
pop {r3, pc}
thumb_func_end sub_0206BCA4
thumb_func_start sub_0206BCB4
sub_0206BCB4: ; 0x0206BCB4
push {r3, lr}
ldrb r0, [r0, #4]
cmp r0, #0
bne _0206BCC0
mov r0, #1
pop {r3, pc}
_0206BCC0:
add r0, r1, #0
bl sub_02037B38
cmp r0, #1
bne _0206BCCE
mov r0, #1
pop {r3, pc}
_0206BCCE:
mov r0, #0
pop {r3, pc}
.balign 4, 0
thumb_func_end sub_0206BCB4
thumb_func_start sub_0206BCD4
sub_0206BCD4: ; 0x0206BCD4
push {r4, lr}
mov r0, #0x14
add r1, r0, #0
bl AllocFromHeap
mov r1, #0
mov r2, #0x14
add r4, r0, #0
bl MI_CpuFill8
add r0, r4, #0
pop {r4, pc}
thumb_func_end sub_0206BCD4
thumb_func_start sub_0206BCEC
sub_0206BCEC: ; 0x0206BCEC
push {r3, lr}
mov r2, #1
mov r0, #0xb
mov r1, #0x14
lsl r2, r2, #0xe
bl CreateHeap
bl sub_0206BCD4
pop {r3, pc}
thumb_func_end sub_0206BCEC
thumb_func_start sub_0206BD00
sub_0206BD00: ; 0x0206BD00
push {r3, lr}
bl FreeToHeap
mov r0, #0x14
bl DestroyHeap
pop {r3, pc}
.balign 4, 0
thumb_func_end sub_0206BD00
.rodata
_020FF480:
.word ov57_022378DC, ov57_02237AF8, ov57_02237B20, FS_OVERLAY_ID(OVY_57)

View File

@ -17,6 +17,7 @@ typedef enum HeapID {
HEAP_ID_10,
HEAP_ID_FIELD,
HEAP_ID_PARTY_MENU,
HEAP_ID_20 = 20,
HEAP_ID_30 = 30,
HEAP_ID_32 = 32,
HEAP_ID_OPTIONS_APP = 38,

11
include/overlay_57.h Normal file
View File

@ -0,0 +1,11 @@
#ifndef POKEHEARTGOLD_OVERLAY_57_H
#define POKEHEARTGOLD_OVERLAY_57_H
#include "global.h"
#include "overlay_manager.h"
int ov57_022378DC(OVY_MANAGER *manager, int *state);
int ov57_02237AF8(OVY_MANAGER *manager, int *state);
int ov57_02237B20(OVY_MANAGER *manager, int *state);
#endif //POKEHEARTGOLD_OVERLAY_57_H

View File

@ -15,8 +15,9 @@ struct TextPrinterSubStruct {
RenderResult RenderText(TextPrinter *printer);
void TextFlags_SetCanABSpeedUpPrint(BOOL enable);
void sub_02002B50(BOOL enable);
void sub_02002B8C(BOOL enable);
void sub_020027F0(int a0);
void sub_02002B50(u32 a0);
void sub_02002B8C(BOOL enable);
void sub_02002C60(BOOL a0);
#endif //POKEHEARTGOLD_RENDER_TEXT_H

View File

@ -112,7 +112,7 @@ void SealCase_SetCapsuleI(SealCase *sealCase, const CAPSULE *src, int i);
SEAL *CapsuleGetSealI(CAPSULE *capsule, int i);
/*
* u8 SealOnCapsuleGetID(const SEAL *seal)
* u32 SealOnCapsuleGetID(const SEAL *seal)
* u8 SealOnCapsuleGetX(const SEAL *seal)
* u8 SealOnCapsuleGetY(const SEAL *seal)
*
@ -122,7 +122,7 @@ SEAL *CapsuleGetSealI(CAPSULE *capsule, int i);
*
* @returns: The requested attribute
*/
u8 SealOnCapsuleGetID(const SEAL *seal);
u32 SealOnCapsuleGetID(const SEAL *seal);
u8 SealOnCapsuleGetX(const SEAL *seal);
u8 SealOnCapsuleGetY(const SEAL *seal);

View File

@ -2,7 +2,7 @@
#define POKEHEARTGOLD_UNK_02091054_H
u8 sub_02091054(u32 idx);
u8 sub_0209106C(u32 idx);
u8 sub_0209106C(u8 idx);
u8 sub_02091084(u32 idx);
BOOL sub_0209109C(u32 idx);
u32 sub_020910B8(u32 idx);

View File

@ -245,7 +245,7 @@ Static main
Object src/field_follow_poke.o
Object asm/unk_0206A360.o
Object asm/field_take_photo.o
Object asm/unk_0206B910.o
Object src/unk_0206B910.o
Object src/alph_checks.o
Object src/get_egg.o
Object src/unk_0206D494.o

View File

@ -32,7 +32,7 @@ SEAL *CapsuleGetSealI(CAPSULE *capsule, int i) {
return &capsule->seals[i];
}
u8 SealOnCapsuleGetID(const SEAL *seal) {
u32 SealOnCapsuleGetID(const SEAL *seal) {
return seal->kind;
}

254
src/unk_0206B910.c Normal file
View File

@ -0,0 +1,254 @@
#include "global.h"
#include "assert.h"
#include "bag.h"
#include "field_player_avatar.h"
#include "fieldmap.h"
#include "heap.h"
#include "mail.h"
#include "map_header.h"
#include "overlay_57.h"
#include "party.h"
#include "player_data.h"
#include "pokemon.h"
#include "render_text.h"
#include "save_arrays.h"
#include "scrcmd.h"
#include "script.h"
#include "seal_case.h"
#include "task.h"
#include "unk_020379A0.h"
#include "unk_0203E348.h"
#include "unk_02055244.h"
#include "unk_020552A4.h"
#include "unk_0206B910.h"
#include "unk_02078E30.h"
#include "unk_02091054.h"
FS_EXTERN_OVERLAY(OVY_57);
typedef struct UnkStruct_0206B984 {
u32 partyCount;
Pokemon *mons[PARTY_SIZE];
Party *party;
SealCase *sealCase;
Options *options;
SaveData *saveData;
void *unk2c;
u8 unk30;
u8 unk31;
} UnkStruct_0206B984;
typedef struct UnkStruct_0206B910 {
u8 filler00[4];
UnkStruct_0206B984 *unk04;
PartyMenuAppData *partyMenu;
SaveData *saveData;
u32 state;
} UnkStruct_0206B910;
typedef struct UnkStruct_0206BCEC {
u8 unk00;
u8 unk01;
u8 unk02;
u8 filler03[21];
SaveData *unk18;
} UnkStruct_0206BCEC;
typedef struct UnkStruct_0206BCD4 {
u8 filler00[4];
u8 unk04;
u8 filler05[15];
} UnkStruct_0206BCD4;
static const OVY_MGR_TEMPLATE _020FF480 = {
.init = ov57_022378DC,
.exec = ov57_02237AF8,
.exit = ov57_02237B20,
.ovy_id = FS_OVERLAY_ID(OVY_57),
};
static BOOL sub_0206B984(TaskManager *taskManager);
static BOOL sub_0206BB90(ScriptContext *ctx);
static void sub_0206BCA4(UnkStruct_0206BCD4 *a0, u8 a1);
static BOOL sub_0206BCB4(UnkStruct_0206BCD4 *a0, u8 a1);
static UnkStruct_0206BCD4 *sub_0206BCD4(void);
static UnkStruct_0206BCD4 *sub_0206BCEC(UnkStruct_0206BCEC *unused);
static void sub_0206BD00(UnkStruct_0206BCD4 *a0);
void sub_0206B910(TaskManager *taskManager, SaveData *saveData) {
FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager);
UnkStruct_0206B910 *r4 = AllocFromHeapAtEnd(HEAP_ID_FIELD, sizeof(UnkStruct_0206B910));
memset(r4, 0, sizeof(UnkStruct_0206B910));
r4->saveData = saveData;
r4->unk04 = AllocFromHeap(HEAP_ID_FIELD, sizeof(UnkStruct_0206B984));
memset(r4->unk04, 0, sizeof(UnkStruct_0206B984));
r4->unk04->options = Save_PlayerData_GetOptionsAddr(saveData);
r4->unk04->saveData = saveData;
r4->unk04->unk2c = &fieldSystem->unk_10C;
r4->partyMenu = AllocFromHeap(HEAP_ID_FIELD, sizeof(PartyMenuAppData));
memset(r4->partyMenu, 0, sizeof(PartyMenuAppData));
TaskManager_Call(taskManager, sub_0206B984, r4);
}
static BOOL sub_0206B984(TaskManager *taskManager) {
UnkStruct_0206B910 *r7 = TaskManager_GetEnvironment(taskManager);
UnkStruct_0206B984 *r6 = r7->unk04;
FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager);
switch (r7->state) {
case 0:
sub_0205525C(taskManager);
SealCase *sealCase = Save_SealCase_Get(r7->saveData);
r6->sealCase = sealCase;
r6->unk31 = 0;
r6->unk2c = &fieldSystem->unk_10C;
Party *party = SaveArray_Party_Get(r7->saveData);
r6->party = party;
s32 partyCount = Party_GetCount(party);
r6->partyCount = partyCount;
s32 i;
for (i = 0; i < partyCount; i++) {
r6->mons[i] = Party_GetMonByIndex(r6->party, i);
}
for (; i < PARTY_SIZE; i++) {
r6->mons[i] = NULL;
}
r7->state = 1;
break;
case 1:
CallApplicationAsTask(taskManager, &_020FF480, r6);
r7->state = 2;
break;
case 2:
switch (r7->unk04->unk31) {
default:
GF_ASSERT(FALSE);
case 0:
r7->state = 5;
break;
case 1:
r7->state = 3;
break;
}
break;
case 3:
PartyMenuAppData *partyMenu = r7->partyMenu;
partyMenu->party = r6->party;
partyMenu->bag = Save_Bag_Get(r7->saveData);
partyMenu->mailbox = Save_Mailbox_Get(r7->saveData);
partyMenu->unk_26 = 0;
partyMenu->unk_25 = 0;
partyMenu->unk_24 = 15;
partyMenu->options = r6->options;
partyMenu->fieldSystem = fieldSystem;
partyMenu->fieldSystem_unk_10C = &(fieldSystem->unk_10C);
CallApplicationAsTask(taskManager, &_0210159C, partyMenu);
r7->state = 4;
break;
case 4: {
PartyMenuAppData *partyMenu = r7->partyMenu;
u32 index = r7->unk04->unk30 + 1;
if (partyMenu->unk_26 != 7) {
Pokemon *mon = r7->unk04->mons[partyMenu->unk_26];
SetMonData(mon, MON_DATA_CAPSULE, &index);
SetMonData(mon, MON_DATA_SEAL_COORDS, SealCase_GetCapsuleI(r6->sealCase, index - 1));
sub_0209106C(SealOnCapsuleGetID(CapsuleGetSealI(SealCase_GetCapsuleI(r6->sealCase, index - 1), 0)));
sub_020270C4(fieldSystem->saveData);
}
r7->state = 1;
break;
}
case 5:
CallTask_RestoreOverworld(taskManager);
r7->state = 6;
break;
case 6:
FreeToHeap(r7->partyMenu);
FreeToHeap(r7->unk04);
FreeToHeap(r7);
return TRUE;
}
return FALSE;
}
BOOL ScrCmd_232(ScriptContext *ctx) {
UnkStruct_0206BCD4 **unkStruct = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MISC_DATA_PTR);
sub_0206BCA4(*unkStruct, ScriptGetVar(ctx));
return FALSE;
}
BOOL ScrCmd_233(ScriptContext *ctx) {
void *unused = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MISC_DATA_PTR);
ctx->data[0] = ScriptGetVar(ctx);
SetupNativeScript(ctx, sub_0206BB90);
return TRUE;
}
static BOOL sub_0206BB90(ScriptContext *ctx) {
UnkStruct_0206BCD4 **unkStruct = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MISC_DATA_PTR);
return sub_0206BCB4(*unkStruct, ctx->data[0]);
}
BOOL ScrCmd_234(ScriptContext *ctx) {
UnkStruct_0206BCD4 **unkStruct = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MISC_DATA_PTR);
u16 arg1 = ScriptGetVar(ctx);
u16 arg2 = ScriptGetVar(ctx);
u16 arg3 = ScriptGetVar(ctx);
u16 unused = ScriptGetVar(ctx);
UnkStruct_0206BCEC unusedStruct;
unusedStruct.unk00 = arg2;
unusedStruct.unk01 = arg1;
unusedStruct.unk02 = arg3;
unusedStruct.unk18 = ctx->fieldSystem->saveData;
*unkStruct = sub_0206BCEC(&unusedStruct);
return FALSE;
}
BOOL ScrCmd_235(ScriptContext *ctx) {
UnkStruct_0206BCD4 **unkStruct = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MISC_DATA_PTR);
u16 unused = ScriptGetVar(ctx);
u16 unused2 = MapHeader_GetMapSec(ctx->fieldSystem->location->mapId);
sub_0206BD00(*unkStruct);
return FALSE;
}
BOOL ScrCmd_236(ScriptContext *ctx) {
void **unused = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MISC_DATA_PTR);
u16 *result = ScriptGetVarPointer(ctx);
*result = 0;
return FALSE;
}
BOOL ScrCmd_237(ScriptContext *ctx) {
void **unused = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MISC_DATA_PTR);
sub_02002C60(TRUE);
return FALSE;
}
static void sub_0206BCA4(UnkStruct_0206BCD4 *a0, u8 a1) {
if (a0->unk04 != 0) {
sub_02037AC0(a1);
}
}
static BOOL sub_0206BCB4(UnkStruct_0206BCD4 *a0, u8 a1) {
if (a0->unk04 == 0) {
return TRUE;
}
return sub_02037B38(a1) == TRUE;
}
static UnkStruct_0206BCD4 *sub_0206BCD4(void) {
UnkStruct_0206BCD4 *unkStruct = AllocFromHeap(HEAP_ID_20, sizeof(UnkStruct_0206BCD4));
MI_CpuFill8(unkStruct, 0, sizeof(UnkStruct_0206BCD4));
return unkStruct;
}
static UnkStruct_0206BCD4 *sub_0206BCEC(UnkStruct_0206BCEC *unused) {
CreateHeap(HEAP_ID_FIELD, HEAP_ID_20, 0x4000);
return sub_0206BCD4();
}
static void sub_0206BD00(UnkStruct_0206BCD4 *a0) {
FreeToHeap(a0);
DestroyHeap(HEAP_ID_20);
}

View File

@ -99,7 +99,7 @@ u8 sub_02091054(u32 idx) {
return _02105F04[idx].unk0;
}
u8 sub_0209106C(u32 idx) {
u8 sub_0209106C(u8 idx) {
GF_ASSERT(idx < NELEMS(_02105F04));
return _02105F04[idx].unk1;
}