ChooseStarterApplication_OvyExit

This commit is contained in:
PikalaxALT 2022-03-29 07:53:28 -04:00
parent 292d4842ad
commit b725bca5e5
9 changed files with 77 additions and 98 deletions

View File

@ -8,101 +8,6 @@
.text
thumb_func_start ChooseStarterApplication_OvyExit
ChooseStarterApplication_OvyExit: ; 0x021E5F74
push {r4, r5, r6, lr}
add r5, r0, #0
bl OverlayManager_GetData
add r4, r0, #0
add r0, r5, #0
bl OverlayManager_GetParentWork
add r6, r0, #0
mov r0, #0
bl TextFlags_SetCanABSpeedUpPrint
mov r0, #0
bl sub_02002B50
mov r0, #0
bl sub_02002B8C
mov r0, #0xe5
lsl r0, r0, #2
ldr r0, [r4, r0]
str r0, [r6]
mov r0, #0
add r1, r0, #0
bl Main_SetVBlankIntrCB
ldr r0, _021E6060 ; =0x00000574
ldr r0, [r4, r0]
bl sub_02019030
ldr r0, [r4, #0x10]
bl sub_02023120
add r0, r4, #0
bl ov61_021E6730
add r0, r4, #0
bl ov61_021E6750
mov r0, #0xed
lsl r0, r0, #2
add r0, r4, r0
bl ov61_021E6068
ldr r0, _021E6064 ; =0x0000043C
ldr r0, [r4, r0]
bl sub_02024504
mov r0, #0xed
lsl r0, r0, #2
ldr r0, [r4, r0]
bl sub_0200A0D0
mov r0, #0xee
lsl r0, r0, #2
ldr r0, [r4, r0]
bl sub_0200A0D0
mov r0, #0xef
lsl r0, r0, #2
ldr r0, [r4, r0]
bl sub_0200A0D0
mov r0, #0xf
lsl r0, r0, #6
ldr r0, [r4, r0]
bl sub_0200A0D0
bl sub_0200B244
bl sub_0202168C
bl sub_02022608
mov r0, #0xe7
lsl r0, r0, #2
ldr r0, [r4, r0]
bl ov61_021E6E30
mov r0, #0x3a
lsl r0, r0, #4
ldr r0, [r4, r0]
bl ov61_021E6E30
ldr r0, [r4, #8]
mov r1, #1
bl FreeBgTilemapBuffer
ldr r0, [r4, #8]
mov r1, #2
bl FreeBgTilemapBuffer
ldr r0, [r4, #8]
mov r1, #4
bl FreeBgTilemapBuffer
ldr r0, [r4, #8]
mov r1, #5
bl FreeBgTilemapBuffer
ldr r0, [r4, #8]
mov r1, #6
bl FreeBgTilemapBuffer
ldr r0, [r4, #8]
bl FreeToHeap
ldr r0, [r4, #0xc]
bl GF_3DVramMan_Delete
add r0, r5, #0
bl OverlayManager_FreeData
mov r0, #0x2e
bl DestroyHeap
mov r0, #1
pop {r4, r5, r6, pc}
.balign 4, 0
_021E6060: .word 0x00000574
_021E6064: .word 0x0000043C
thumb_func_end ChooseStarterApplication_OvyExit
thumb_func_start ov61_021E6068
ov61_021E6068: ; 0x021E6068
push {r3, r4, r5, r6, r7, lr}

6
include/unk_0200A090.h Normal file
View File

@ -0,0 +1,6 @@
#ifndef POKEHEARTGOLD_UNK_0200A090_H
#define POKEHEARTGOLD_UNK_0200A090_H
void sub_0200A0D0(void *);
#endif //POKEHEARTGOLD_UNK_0200A090_H

View File

@ -4,5 +4,6 @@
void sub_0200B528(void);
void sub_0200B594(void);
void SetBlendBrightness(int brightness, int plane, int screenBit);
void sub_0200B244(void);
#endif //POKEHEARTGOLD_UNK_0200B150_H

View File

@ -15,5 +15,6 @@ struct UnkStruct_02019040 {
UnkStruct_02019014 *sub_02019014(HeapID heapId, UnkStruct_02022D74 *a1);
BOOL sub_020190E8(UnkStruct_02019014 *a0);
void sub_02019040(UnkStruct_02019014 *a0, struct UnkStruct_02019040 *a1, int a2);
void sub_02019030(UnkStruct_02019014 *unk);
#endif //POKEHEARTGOLD_UNK_02019014_H

6
include/unk_020215A0.h Normal file
View File

@ -0,0 +1,6 @@
#ifndef POKEHEARTGOLD_UNK_020215A0_H
#define POKEHEARTGOLD_UNK_020215A0_H
void sub_0202168C(void);
#endif //POKEHEARTGOLD_UNK_020215A0_H

6
include/unk_02022588.h Normal file
View File

@ -0,0 +1,6 @@
#ifndef POKEHEARTGOLD_UNK_02022588_H
#define POKEHEARTGOLD_UNK_02022588_H
void sub_02022608(void);
#endif //POKEHEARTGOLD_UNK_02022588_H

View File

@ -8,5 +8,6 @@ typedef struct UnkStruct_02022D74 UnkStruct_02022D74;
UnkStruct_02022D74 *sub_02023114(HeapID heapId);
void sub_02023240(fx32, fx32, UnkStruct_02022D74 *);
void sub_02023120(UnkStruct_02022D74 *unk);
#endif //POKEHEARTGOLD_UNK_02022D74_H

View File

@ -2,5 +2,6 @@
#define POKEHEARTGOLD_UNK_02023694_H
void sub_02024AA8(void *, s32);
void sub_02024504(void *);
#endif //POKEHEARTGOLD_UNK_02023694_H

View File

@ -7,7 +7,13 @@
#include "render_text.h"
#include "msgdata/msg/msg_0190.h"
#include "sound.h"
#include "gf_3d_vramman.h"
#include "unk_02005D10.h"
#include "unk_02023694.h"
#include "unk_0200A090.h"
#include "unk_0200B150.h"
#include "unk_020215A0.h"
#include "unk_02022588.h"
#define HEAPID_STARTERCHOOSE 46
@ -24,7 +30,13 @@ struct ChooseStarterAnm {
};
struct UnkStarterChooseSub_3B4 {
u8 filler_000[0x1B4];
void *unk_000;
void *unk_004;
void *unk_008;
void *unk_00C;
u8 filler_010[0x78];
void *unk_088;
u8 filler_08C[0x128];
int unk_1B4[3];
};
@ -43,7 +55,7 @@ struct ChooseStarterAppWork {
u8 filler_000[0x4];
HeapID heapId;
BGCONFIG *bgConfig;
u8 filler_00C[0x4];
struct GF3DVramMan *_3dMan;
UnkStruct_02022D74 *unk_010;
u8 filler_014[0xC];
NNSFndAllocator allocator; // 020
@ -58,7 +70,7 @@ struct ChooseStarterAppWork {
u8 filler_398[0x2];
s16 unk_39A;
WINDOW *unk_39C;
u8 filler_3A0[0x4];
WINDOW *unk_3A0;
u8 frame; // 3A4
u8 unk_3A5;
u8 unk_3A6;
@ -99,6 +111,10 @@ void ov61_021E7248(struct UnkStarterChooseSub_3B4 *a0);
BOOL ov61_021E6AE0(struct ChooseStarterAppWork *work, s16 a1);
BOOL ov61_021E7268(struct ChooseStarterAppWork *work, int a1, int a2);
void ov61_021E682C(struct ChooseStarterAnm *anm);
void ov61_021E6730(struct ChooseStarterAppWork *work);
void ov61_021E6750(struct ChooseStarterAppWork *work);
void ov61_021E6068(struct UnkStarterChooseSub_3B4 *a0);
void ov61_021E6E30(WINDOW *window);
BOOL ChooseStarterApplication_OvyInit(OVY_MANAGER *ovy, int *state_p) {
struct ChooseStarterAppWork *work;
@ -379,3 +395,39 @@ BOOL ChooseStarterApplication_OvyExec(OVY_MANAGER *ovy, int *state) {
ov61_021E61FC(work);
return FALSE;
}
BOOL ChooseStarterApplication_OvyExit(OVY_MANAGER *ovy, int *state) {
struct ChooseStarterAppWork *work = OverlayManager_GetData(ovy);
struct ChooseStarterAppData *data = OverlayManager_GetParentWork(ovy);
TextFlags_SetCanABSpeedUpPrint(FALSE);
sub_02002B50(FALSE);
sub_02002B8C(FALSE);
data->cursorPos = work->unk_394;
Main_SetVBlankIntrCB(NULL, NULL);
sub_02019030(work->unk_574);
sub_02023120(work->unk_010);
ov61_021E6730(work);
ov61_021E6750(work);
ov61_021E6068(&work->unk_3B4);
sub_02024504(work->unk_3B4.unk_088);
sub_0200A0D0(work->unk_3B4.unk_000);
sub_0200A0D0(work->unk_3B4.unk_004);
sub_0200A0D0(work->unk_3B4.unk_008);
sub_0200A0D0(work->unk_3B4.unk_00C);
sub_0200B244();
sub_0202168C();
sub_02022608();
ov61_021E6E30(work->unk_39C);
ov61_021E6E30(work->unk_3A0);
FreeBgTilemapBuffer(work->bgConfig, 1);
FreeBgTilemapBuffer(work->bgConfig, 2);
FreeBgTilemapBuffer(work->bgConfig, 4);
FreeBgTilemapBuffer(work->bgConfig, 5);
FreeBgTilemapBuffer(work->bgConfig, 6);
FreeToHeap(work->bgConfig);
GF_3DVramMan_Delete(work->_3dMan);
OverlayManager_FreeData(ovy);
DestroyHeap(HEAPID_STARTERCHOOSE);
return TRUE;
}