Skip to content

Commit

Permalink
Merge pull request #551 from Lincoln-LM/memo-pad
Browse files Browse the repository at this point in the history
Poketch Memo Pad (ov24) Decompilation
  • Loading branch information
red031000 authored Sep 28, 2024
2 parents 4ce1970 + da32081 commit 9a81717
Show file tree
Hide file tree
Showing 33 changed files with 677 additions and 1,304 deletions.
4 changes: 2 additions & 2 deletions arm9/arm9.lsf
Original file line number Diff line number Diff line change
Expand Up @@ -904,8 +904,8 @@ Overlay OVERLAY_24
{
##Memo Pad##
After OVERLAY_20
Object overlay_24_sinit.o
Object overlay_24.o
Object ov24_02254840.o
Object ov24_02254CA0.o
}

Overlay OVERLAY_25
Expand Down
18 changes: 16 additions & 2 deletions arm9/global.inc
Original file line number Diff line number Diff line change
Expand Up @@ -7960,9 +7960,9 @@
.extern ov20_022529A0
.extern ov20_022529B4
.extern ov20_02252B1C
.extern ov20_02252B28
.extern Poketch_PlaySoundEffect
.extern ov20_02252B48
.extern ov20_02252B68
.extern TouchScreen_GetTapState
.extern ov20_02252BB8
.extern ov20_02252C08
.extern ov20_02252C14
Expand Down Expand Up @@ -8030,6 +8030,20 @@
.extern ov21_02254B10
.extern ov21_02254B34
.extern ov21_02254B40
.extern ov24_02254854
.extern ov24_022548F4
.extern ov24_02254998
.extern ov24_022549AC
.extern ov24_022549F8
.extern ov24_02254C64
.extern ov24_02254D00
.extern ov24_02254DC8
.extern ov24_02254DDC
.extern ov24_02254EE0
.extern ov24_02254F28
.extern ov24_02254F40
.extern ov24_02255038
.extern ov24_02255050
.extern ov26_02254BD4
.extern ov26_02254C04
.extern ov26_02254C10
Expand Down
8 changes: 4 additions & 4 deletions arm9/overlays/19/src/overlay_19.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ void ov19_02252440(struct BgConfig * bgConfig)
GX_SetBankForSubOBJ(0x100);
GXS_SetOBJVRamModeChar(GX_OBJVRAMMODE_CHAR_1D_32K);
InitBgFromTemplate(bgConfig, GF_BG_LYR_SUB_0, &ov19_02252508, GF_BG_TYPE_TEXT);
GfGfxLoader_LoadCharData(NARC_GRAPHIC_POKETCH, NARC_poketch_narc_0010_NCGR_lz, bgConfig, GF_BG_LYR_SUB_0, 0, 0, TRUE, HEAP_ID_8);
GfGfxLoader_LoadScrnData(NARC_GRAPHIC_POKETCH, NARC_poketch_narc_0011_NSCR_lz, bgConfig, GF_BG_LYR_SUB_0, 0, 0, TRUE, HEAP_ID_8);
GfGfxLoader_GXLoadPal(NARC_GRAPHIC_POKETCH, NARC_poketch_narc_0012_NCLR, GF_PAL_LOCATION_SUB_BG, GF_PAL_SLOT_0_OFFSET, 0x20, HEAP_ID_8);
GfGfxLoader_LoadCharData(NARC_GRAPHIC_POKETCH, NARC_poketch_narc_0010_NCGR_lz, bgConfig, GF_BG_LYR_SUB_0, 0, 0, TRUE, HEAP_ID_POKETCH_APP);
GfGfxLoader_LoadScrnData(NARC_GRAPHIC_POKETCH, NARC_poketch_narc_0011_NSCR_lz, bgConfig, GF_BG_LYR_SUB_0, 0, 0, TRUE, HEAP_ID_POKETCH_APP);
GfGfxLoader_GXLoadPal(NARC_GRAPHIC_POKETCH, NARC_poketch_narc_0012_NCLR, GF_PAL_LOCATION_SUB_BG, GF_PAL_SLOT_0_OFFSET, 0x20, HEAP_ID_POKETCH_APP);
GXS_SetVisibleWnd(GX_WNDMASK_NONE);
GXS_SetVisiblePlane(GX_PLANEMASK_BG0);
}

void ov19_022524F4(struct BgConfig * bgConfig)
{
FreeBgTilemapBuffer(bgConfig, GF_BG_LYR_SUB_0);
DestroyHeap(HEAP_ID_8);
DestroyHeap(HEAP_ID_POKETCH_APP);
}

BOOL ov19_02252504(struct BgConfig * bgConfig)
Expand Down
12 changes: 6 additions & 6 deletions arm9/overlays/20/asm/ov20_02252440.s
Original file line number Diff line number Diff line change
Expand Up @@ -1004,8 +1004,8 @@ ov20_02252B1C: ; 0x02252B1C
.align 2, 0
thumb_func_end ov20_02252B1C

thumb_func_start ov20_02252B28
ov20_02252B28: ; 0x02252B28
thumb_func_start Poketch_PlaySoundEffect
Poketch_PlaySoundEffect: ; 0x02252B28
push {r4, lr}
add r4, r0, #0
bl ov20_02252440
Expand All @@ -1020,7 +1020,7 @@ ov20_02252B28: ; 0x02252B28
bl PlaySE
_02252B46:
pop {r4, pc}
thumb_func_end ov20_02252B28
thumb_func_end Poketch_PlaySoundEffect

thumb_func_start ov20_02252B48
ov20_02252B48: ; 0x02252B48
Expand All @@ -1040,8 +1040,8 @@ _02252B66:
pop {r4, pc}
thumb_func_end ov20_02252B48

thumb_func_start ov20_02252B68
ov20_02252B68: ; 0x02252B68
thumb_func_start TouchScreen_GetTapState
TouchScreen_GetTapState: ; 0x02252B68
push {r3, r4, r5, lr}
add r5, r0, #0
add r4, r1, #0
Expand Down Expand Up @@ -1085,7 +1085,7 @@ _02252BB0:
_02252BB4:
mov r0, #0
pop {r3, r4, r5, pc}
thumb_func_end ov20_02252B68
thumb_func_end TouchScreen_GetTapState

thumb_func_start ov20_02252BB8
ov20_02252BB8: ; 0x02252BB8
Expand Down
2 changes: 1 addition & 1 deletion arm9/overlays/21/src/ov21_02254854.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ static void ov21_02254840(void)

BOOL ov21_02254854(UnkStruct02254854 **param0, u32 param1, u32 param2, u32 param3)
{
UnkStruct02254854 *alloced = (UnkStruct02254854 *)AllocFromHeap(HEAP_ID_8, sizeof(UnkStruct02254854));
UnkStruct02254854 *alloced = (UnkStruct02254854 *)AllocFromHeap(HEAP_ID_POKETCH_APP, sizeof(UnkStruct02254854));
if (alloced != NULL)
{
if (ov21_0225489C(alloced, param1, param2, param3) && SysTask_CreateOnMainQueue((SysTaskFunc)ov21_02254930, (void *)alloced, 1))
Expand Down
2 changes: 1 addition & 1 deletion arm9/overlays/21/src/ov21_02254A6C.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ extern void ov11_02252DB4(u32 param0, u32 param1);

BOOL ov21_02254A6C(UnkStruct02254A6C *param0, void *param1)
{
UnkStruct02254A6C *strct = (UnkStruct02254A6C *)AllocFromHeap(HEAP_ID_8, 3 << 8);
UnkStruct02254A6C *strct = (UnkStruct02254A6C *)AllocFromHeap(HEAP_ID_POKETCH_APP, 3 << 8);
u32 sp4;
if (strct != NULL)
{
Expand Down
8 changes: 4 additions & 4 deletions arm9/overlays/22/asm/overlay_22.s
Original file line number Diff line number Diff line change
Expand Up @@ -1386,7 +1386,7 @@ ov22_02255268: ; 0x02255268
mov r1, #6
bl BgCommitTilemapBufferToVram
ldr r0, _022552A8 ; =0x00000669
bl ov20_02252B28
bl Poketch_PlaySoundEffect
add r0, r5, #0
bl ov22_02255084
pop {r3, r4, r5, pc}
Expand Down Expand Up @@ -1482,7 +1482,7 @@ _02255358:
cmp r0, #0
beq _0225537A
ldr r0, _0225537C ; =0x00000669
bl ov20_02252B28
bl Poketch_PlaySoundEffect
ldrb r1, [r5, #3]
ldr r0, [r4, #4]
bl ov22_02255544
Expand Down Expand Up @@ -1543,7 +1543,7 @@ _022553D8:
cmp r0, #0
beq _022553FA
ldr r0, _022553FC ; =0x00000669
bl ov20_02252B28
bl Poketch_PlaySoundEffect
ldrb r1, [r5, #3]
ldr r0, [r4, #4]
bl ov22_02255544
Expand Down Expand Up @@ -1599,7 +1599,7 @@ _0225543A:
mov r1, #6
bl BgCommitTilemapBufferToVram
ldr r0, _02255498 ; =0x00000666
bl ov20_02252B28
bl Poketch_PlaySoundEffect
add r0, r6, #0
bl ov20_022538B0
_02255468:
Expand Down
2 changes: 1 addition & 1 deletion arm9/overlays/23/asm/overlay_23.s
Original file line number Diff line number Diff line change
Expand Up @@ -1293,7 +1293,7 @@ ov23_022551A4: ; 0x022551A4
add r4, r0, #0
ldrh r5, [r5]
ldr r0, _022551F8 ; =0x00000663
bl ov20_02252B28
bl Poketch_PlaySoundEffect
lsl r3, r5, #2
ldr r0, _022551FC ; =ov23_02255FB9
ldr r2, _02255200 ; =ov23_02255FFC
Expand Down
Loading

0 comments on commit 9a81717

Please sign in to comment.