This commit is contained in:
patataofcourse 2023-03-21 11:20:55 +01:00
parent 0bfe4f9456
commit b6c9242b48
6 changed files with 308 additions and 9 deletions

View File

@ -28,6 +28,7 @@ SECTIONS {
build/asm/code_02003384.o(.text);
build/asm/CList.o(.text);
build/asm/code_020036e8.o(.text);
build/asm/memory.o(.text);
. = ALIGN(4);
# non-disassembled

273
arm9/asm/memory.s Normal file
View File

@ -0,0 +1,273 @@
@ memory.cpp but asm
.include "global.s"
.section .text
arm_func_start _ZnwPv
_ZnwPv: @ 0x020039a4
ldr r2, _020039bc @ =D_02263ce0
ldr ip, _020039c0 @ =func_020178b4
mov r1, r0
ldr r0, [r2, #8]
mov r2, #4
bx ip
.align 2, 0
_020039bc: .4byte D_02263ce0
_020039c0: .4byte func_020178b4
arm_func_end _ZnwPv
arm_func_start _ZnaPv
_ZnaPv: @ 0x020039c4
ldr r2, _020039dc @ =D_02263ce0
ldr ip, _020039e0 @ =func_020178b4
mov r1, r0
ldr r0, [r2, #8]
mov r2, #4
bx ip
.align 2, 0
_020039dc: .4byte D_02263ce0
_020039e0: .4byte func_020178b4
arm_func_end _ZnaPv
arm_func_start _ZdlPv
_ZdlPv: @ 0x020039e4
push {r3, lr}
movs r1, r0
popeq {r3, pc}
ldr r0, _02003a00 @ =D_02263ce0
ldr r0, [r0, #8]
bl func_020178e4
pop {r3, pc}
.align 2, 0
_02003a00: .4byte D_02263ce0
arm_func_end _ZdlPv
arm_func_start _ZdaPv
_ZdaPv: @ 0x02003a04
push {r3, lr}
movs r1, r0
popeq {r3, pc}
ldr r0, _02003a20 @ =D_02263ce0
ldr r0, [r0, #8]
bl func_020178e4
pop {r3, pc}
.align 2, 0
_02003a20: .4byte D_02263ce0
arm_func_end _ZdaPv
arm_func_start func_02003a24
func_02003a24: @ 0x02003a24
push {r4, lr}
mov r0, #0
bl func_0203122c
mov r4, r0
mov r0, #0
bl func_02031218
add r1, r4, #0xf
bic r2, r0, #0xf
bic r0, r1, #0xf
sub r4, r2, r0
mov r1, r4
mov r0, #0
mov r2, #0x10
bl func_020313f4
mov r1, r4
mov r2, #0
bl func_0201787c
ldr r1, _02003a80 @ =D_02263ce0
str r0, [r1, #8]
mov r0, #0
strb r0, [r1]
bl func_02003b30
pop {r4, pc}
.align 2, 0
_02003a80: .4byte D_02263ce0
arm_func_end func_02003a24
arm_func_start func_02003a84
func_02003a84: @ 0x02003a84
push {r4, lr}
movs r4, r0
bne _02003a94
bl func_02031f14
_02003a94:
ldr r0, _02003aac @ =D_02263ce0
mov r1, r4
ldr r0, [r0, #8]
mov r2, #4
bl func_020178b4
pop {r4, pc}
.align 2, 0
_02003aac: .4byte D_02263ce0
arm_func_end func_02003a84
arm_func_start func_02003ab0
func_02003ab0: @ 0x02003ab0
push {r3, r4, r5, lr}
movs r5, r0
mov r4, r1
bne _02003ac4
bl func_02031f14
_02003ac4:
ldr r0, _02003adc @ =D_02263ce0
mov r1, r5
ldr r0, [r0, #8]
mov r2, r4
bl func_020178b4
pop {r3, r4, r5, pc}
.align 2, 0
_02003adc: .4byte D_02263ce0
arm_func_end func_02003ab0
arm_func_start func_02003ae0
func_02003ae0: @ 0x02003ae0
push {r4, lr}
mov r4, r0
bl func_0201736c
ldr r1, _02003b14 @ =D_02263ce0
ldr r1, [r1, #8]
cmp r0, r1
beq _02003b00
bl func_02031f14
_02003b00:
ldr r0, _02003b14 @ =D_02263ce0
mov r1, r4
ldr r0, [r0, #8]
bl func_020178e4
pop {r4, pc}
.align 2, 0
_02003b14: .4byte D_02263ce0
arm_func_end func_02003ae0
arm_func_start func_02003b18
func_02003b18: @ 0x02003b18
ldr r0, _02003b28 @ =D_02263ce0
ldr ip, _02003b2c @ =func_02017930
ldr r0, [r0, #8]
bx ip
.align 2, 0
_02003b28: .4byte D_02263ce0
_02003b2c: .4byte func_02017930
arm_func_end func_02003b18
arm_func_start func_02003b30
func_02003b30: @ 0x02003b30
ldr r2, _02003b44 @ =D_02263ce0
ldr ip, _02003b48 @ =func_02017920
mov r1, r0
ldr r0, [r2, #8]
bx ip
.align 2, 0
_02003b44: .4byte D_02263ce0
_02003b48: .4byte func_02017920
arm_func_end func_02003b30
arm_func_start func_02003b4c
func_02003b4c: @ 0x02003b4c
push {r3, lr}
bl func_02003b18
ldr r1, _02003b70 @ =D_02263ce0
ldr r2, _02003b74 @ =D_02263e80
ldrb ip, [r1]
add r3, ip, #1
strb r3, [r1]
strb r0, [r2, ip]
pop {r3, pc}
.align 2, 0
_02003b70: .4byte D_02263ce0
_02003b74: .4byte D_02263e80
arm_func_end func_02003b4c
arm_func_start func_02003b78
func_02003b78: @ 0x02003b78
push {r4, lr}
mov r4, r0
bl func_02003b4c
mov r0, r4
bl func_02003b30
pop {r4, pc}
arm_func_end func_02003b78
arm_func_start func_02003b90
func_02003b90: @ 0x02003b90
ldr r1, _02003bb4 @ =D_02263ce0
ldr r0, _02003bb8 @ =D_02263e80
ldrb r2, [r1]
ldr ip, _02003bbc @ =func_02003b30
sub r3, r2, #1
and r2, r3, #0xff
ldrb r0, [r0, r2]
strb r3, [r1]
bx ip
.align 2, 0
_02003bb4: .4byte D_02263ce0
_02003bb8: .4byte D_02263e80
_02003bbc: .4byte func_02003b30
arm_func_end func_02003b90
arm_func_start func_02003bc0
func_02003bc0: @ 0x02003bc0
push {r3, r4, r5, lr}
ldr r1, _02003c14 @ =D_02263ce0
mov r4, r0
ldr r1, [r1, #4]
mov r5, r2
cmp r1, #0
popne {r3, r4, r5, pc}
bl func_02017978
cmp r0, r5
popne {r3, r4, r5, pc}
ldr r0, _02003c14 @ =D_02263ce0
ldr r3, [r0, #0xc]
cmp r3, #0x64
movge r1, #1
strge r1, [r0, #4]
popge {r3, r4, r5, pc}
ldr r2, _02003c18 @ =D_02263cf0
add r1, r3, #1
str r4, [r2, r3, lsl #2]
str r1, [r0, #0xc]
pop {r3, r4, r5, pc}
.align 2, 0
_02003c14: .4byte D_02263ce0
_02003c18: .4byte D_02263cf0
arm_func_end func_02003bc0
arm_func_start func_02003c1c
func_02003c1c: @ 0x02003c1c
push {r4, r5, r6, r7, r8, sb, sl, lr}
mov r7, #0
ldr r4, _02003c88 @ =D_02263cf0
ldr r6, _02003c8c @ =func_02003bc0
ldr sl, _02003c90 @ =D_02263ce0
mov sb, r0
mov r5, r7
_02003c38:
str r7, [sl, #0xc]
str r7, [sl, #4]
ldr r0, [sl, #8]
mov r1, r6
mov r2, sb
bl func_02017938
ldr r0, [sl, #0xc]
mov r8, r5
cmp r0, #0
ble _02003c78
_02003c60:
ldr r0, [r4, r8, lsl #2]
bl func_02003ae0
ldr r0, [sl, #0xc]
add r8, r8, #1
cmp r8, r0
blt _02003c60
_02003c78:
ldr r0, [sl, #4]
cmp r0, #0
bne _02003c38
pop {r4, r5, r6, r7, r8, sb, sl, pc}
.align 2, 0
_02003c88: .4byte D_02263cf0
_02003c8c: .4byte func_02003bc0
_02003c90: .4byte D_02263ce0
arm_func_end func_02003c1c

View File

@ -1,6 +1,6 @@
.section .data
.set progress, 0x39a4 @ amount of dism'd bytes!
.set progress, 0x3c94 @ amount of dism'd bytes!
.set total, 0x53560 @ this excludes dtcm + itcm + autoload list
.incbin "../extract/arm9.bin", progress, total-progress

View File

@ -1,11 +1,6 @@
### Undefined symbols ###
# Functions
func_020035f0 = 0x020035f0;
func_020036a4 = 0x020036a4;
func_02003924 = 0x02003924;
_ZnwPv = 0x020039a4;
_ZdlPv = 0x020039e4;
func_02003a24 = 0x02003a24;
func_02003a84 = 0x02003a84;
func_02003ab0 = 0x02003ab0;
@ -54,6 +49,14 @@ func_0200fb10 = 0x0200fb10;
func_020115e8 = 0x020115e8;
func_02015e70 = 0x02015e70;
func_02015ee8 = 0x02015ee8;
func_0201736c = 0x0201736c;
func_0201787c = 0x0201787c;
func_020178b4 = 0x020178b4;
func_020178e4 = 0x020178e4;
func_02017920 = 0x02017920;
func_02017930 = 0x02017930;
func_02017938 = 0x02017938;
func_02017978 = 0x02017978;
func_02017ee0 = 0x02017ee0;
func_02017f20 = 0x02017f20;
func_020180f0 = 0x020180f0;
@ -107,6 +110,9 @@ func_020304c8 = 0x020304c8;
func_02030f7c = 0x02030f7c;
func_02030fe8 = 0x02030fe8;
func_02031060 = 0x02031060;
func_02031218 = 0x02031218;
func_0203122c = 0x0203122c;
func_020313f4 = 0x020313f4;
func_020316e8 = 0x020316e8;
func_02031904 = 0x02031904;
func_02031cc4 = 0x02031cc4;
@ -187,6 +193,9 @@ D_02053bac = 0x02053bac;
D_02053cd4 = 0x02053cd4;
D_02153cd4 = 0x02153cd4;
D_02263cd4 = 0x02263cd4;
D_02263ce0 = 0x02263ce0;
D_02263cf0 = 0x02263cf0;
D_02263e80 = 0x02263e80;
# More BSS...?
D_02270240 = 0x02270240;

View File

@ -94,7 +94,6 @@ CDepth2D.cpp (single field: vtable)
end CDepth2D.cpp
code_02001fbc.c(pp)
- func_020020d4 ~ func_0200337c - massive struct, reaches up to unk504
func_02002290 runs 020020d4 and returns the arg0
func_02002474 has a couple of switchcases (with jumptables)
@ -113,12 +112,24 @@ code_020036e8.cpp - bunch of functions with some overloading?
- func_020036e8 ~ func_02003924
end code_000036e8.cpp?
func_020039a4 - operator new(void*)
func_020039e4 - operator delete(void*)
memory.cpp - probably a bunch of news and deletes, plus other memory stuff. accesses D_MemInfo?
- func_020039a4 - operator new(void*)
- func_020039c4 - operator new[](void*)
- func_020039e4 - operator delete(void*)
- func_02003a04 - operator delete[](void*)
- func_02003axx ~ func_02003c1c
end memory.cpp
code_02003c94 next
func_02003fe0 ~ func_0200400c - virtual functions for OMObjText
func_020139b8 - CProc constructor,
called from overlay_0::func_0227fb30 (entry function for overlay 0, CMultisceneProc constructor)
func_020178b4 - malloc?
func_020178e4 - free?
020301dc - snprintf(char* dest, int dest_size, char* format, ...) -> char*
02030204 - thunk to vsnprintf
@ -129,6 +140,8 @@ func_020139b8 - CProc constructor,
0203b2f0 - SDK_strcmp
0203b404 - probably another string operation but [E doesn't] have it labeled
D_02263ce0 - D_MemInfo?
Types with RTTI info: (RTTI positions may be off)
(Each dash is where I estimate a new .cpp file starts)
- CDepth2D (02045da0) - VTable 02045dbc

View File

@ -92,6 +92,9 @@ arm_func 0x02003588
arm_func 0x020035a8
arm_func 0x02003608
arm_func 0x020039a4 _ZnwPv
arm_func 0x020039c4 _ZnaPv
arm_func 0x020039e4 _ZdlPv
arm_func 0x02003a04 _ZdaPv
arm_func 0x02003bc0
data 0x02045dec D_02045dec
data 0xFFFF0000 ExceptionVectors