Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Poketch Memo Pad (ov24) Decompilation #551

Merged
merged 31 commits into from
Sep 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
a5fbbcf
initial memo pad work
Lincoln-LM Sep 2, 2024
d68dd9a
small clean
Lincoln-LM Sep 2, 2024
6df7f6c
borrow names from pokeplatinum
Lincoln-LM Sep 3, 2024
9b0cc39
split out other substructure
Lincoln-LM Sep 3, 2024
aed8e1b
finish functions
Lincoln-LM Sep 3, 2024
c5bb6bf
adjust return types
Lincoln-LM Sep 3, 2024
f7286c9
split out header file
Lincoln-LM Sep 3, 2024
bba1919
cleaner dispcnt
Lincoln-LM Sep 3, 2024
1f8c98a
no inline asm finally
Lincoln-LM Sep 3, 2024
68f2c0d
split C file to correct rodata order
Lincoln-LM Sep 3, 2024
f720494
small rodata clean
Lincoln-LM Sep 4, 2024
4fbff01
utility enums
Lincoln-LM Sep 4, 2024
ee13d30
split functions into proper files
Lincoln-LM Sep 4, 2024
85d9eb2
move data into functions again
Lincoln-LM Sep 4, 2024
6257a32
move ov24_02254CA0
Lincoln-LM Sep 4, 2024
9b2e6e9
remove unneccessary fnptr dereferencing
Lincoln-LM Sep 4, 2024
f03ca3b
UnkSubStructOverlay24_1 -> MemoPadDrawState
Lincoln-LM Sep 7, 2024
90c5528
UnkStructOverlay24 -> MemoPadAppHandler
Lincoln-LM Sep 7, 2024
2319dfc
UnkSubStructOverlay24 -> MemoPadDisplayHandler
Lincoln-LM Sep 7, 2024
11c3b98
further naming tweaks
Lincoln-LM Sep 7, 2024
dd451ff
name files based on starting address
Lincoln-LM Sep 7, 2024
2c6f44a
merge typedef structs + ptr != NULL comparisons + switch/case indent …
Lincoln-LM Sep 9, 2024
2ddaaea
extra TRUEs for isCompressed
Lincoln-LM Sep 9, 2024
663b991
other missed constants/nullptr comparisons
Lincoln-LM Sep 9, 2024
febfaaa
merge width & height assignments
Lincoln-LM Sep 9, 2024
565a3ca
PM_LCD_BOTTOM constant
Lincoln-LM Sep 9, 2024
b8f8a0e
int -> s32
Lincoln-LM Sep 9, 2024
e8af3a0
function prototype arg names + align pointer style to the right
Lincoln-LM Sep 9, 2024
ae4e855
sound and naix constants
Lincoln-LM Sep 9, 2024
89efc7b
unk3 -> stylusHeld
Lincoln-LM Sep 9, 2024
da32081
stylus -> touch
Lincoln-LM Sep 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading