summaryrefslogtreecommitdiff
path: root/arm9/asm
diff options
context:
space:
mode:
Diffstat (limited to 'arm9/asm')
-rw-r--r--arm9/asm/CTRDG_backup.s145
-rw-r--r--arm9/asm/CTRDG_flash_AT29LV512.s53
-rw-r--r--arm9/asm/CTRDG_flash_LE26FV10N1TS-10.s29
-rw-r--r--arm9/asm/CTRDG_flash_LE39FW512.s33
-rw-r--r--arm9/asm/CTRDG_flash_MX29L010.s33
-rw-r--r--arm9/asm/CTRDG_flash_MX29L512.s23
-rw-r--r--arm9/asm/scrcmd.s2
-rw-r--r--arm9/asm/scrcmd_7.s6
-rw-r--r--arm9/asm/unk_02001B80.s14
-rw-r--r--arm9/asm/unk_02038C78.s36
-rw-r--r--arm9/asm/unk_02048904.s4
-rw-r--r--arm9/asm/unk_02054590.s4
-rw-r--r--arm9/asm/unk_0205C598.s2
-rw-r--r--arm9/asm/unk_020625EC.s2
-rw-r--r--arm9/asm/unk_020653EC.s2
-rw-r--r--arm9/asm/unk_0206C700.s4
-rw-r--r--arm9/asm/unk_02072548.s2
-rw-r--r--arm9/asm/unk_02089498.s4
18 files changed, 215 insertions, 183 deletions
diff --git a/arm9/asm/CTRDG_backup.s b/arm9/asm/CTRDG_backup.s
index e04344b4..e4c4baa4 100644
--- a/arm9/asm/CTRDG_backup.s
+++ b/arm9/asm/CTRDG_backup.s
@@ -1,6 +1,7 @@
.include "asm/macros.inc"
.include "global.inc"
+ .extern AT29LV512_lib
.extern CTRDGi_EraseFlash4KBAT
.extern CTRDGi_EraseFlash4KBAsyncAT
.extern CTRDGi_EraseFlashChipAT
@@ -26,6 +27,12 @@
.extern CTRDGi_WriteFlashSectorMX
.extern CTRDGi_WriteFlashSectorAsyncMX5
.extern CTRDGi_WriteFlashSectorMX5
+ .extern defaultFlash1M
+ .extern defaultFlash512
+ .extern LE26FV10N1TS_10
+ .extern LE39FW512
+ .extern MN63F805MNP
+ .extern MX29L010
.extern UNK_021D6B14
.extern UNK_021D6B30
.extern UNK_021D6B28
@@ -46,140 +53,16 @@ UNK_02103FE4: ; 0x02103FE4
.global UNK_02103FE8
UNK_02103FE8: ; 0x02103FE8
- .word UNK_02104150
- .word UNK_0210408C
- .word UNK_0210418C
+ .word MX29L010
+ .word LE26FV10N1TS_10
+ .word defaultFlash1M
.global UNK_02103FF4
UNK_02103FF4: ; 0x02103FF4
- .word UNK_0210410C
- .word UNK_0210400C
- .word UNK_021041D0
- .word UNK_021040D0
-
- .global UNK_02104004
-UNK_02104004: ; 0x02104004
- .byte 0x0A, 0x00, 0x28, 0x00, 0x00, 0x00, 0x28, 0x00
-
- .global UNK_0210400C
-UNK_0210400C: ; 0x0210400C
- .word CTRDGi_WriteFlash4KBAT
- .word CTRDGi_EraseFlashChipAT
- .word CTRDGi_EraseFlash4KBAT
- .word CTRDGi_WriteFlash4KBAsyncAT
- .word CTRDGi_EraseFlashChipAsyncAT
- .word CTRDGi_EraseFlash4KBAsyncAT
- .word CTRDGi_PollingSR512kCOMMON
- .word UNK_02104004
- .byte 0x00, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0C, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00
- .byte 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x3D, 0x00
-
- .global UNK_02104048
-UNK_02104048: ; 0x02104048
- .word CTRDGi_WriteFlashSectorAT
- .word CTRDGi_EraseFlashChipAT
- .word CTRDGi_EraseFlashSectorAT
- .word CTRDGi_WriteFlashSectorAsyncAT
- .word CTRDGi_EraseFlashChipAsyncAT
- .word CTRDGi_EraseFlashSectorAsyncAT
- .word CTRDGi_PollingSR512kCOMMON
- .word UNK_02104004
- .byte 0x00, 0x00, 0x01, 0x00, 0x80, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00
- .byte 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x3D, 0x00
-
- .global UNK_02104084
-UNK_02104084: ; 0x02104084
- .byte 0x0A, 0x00, 0x0A, 0x00, 0xD0, 0x07, 0x88, 0x13
-
- .global UNK_0210408C
-UNK_0210408C: ; 0x0210408C
- .word CTRDGi_WriteFlashSectorMX
- .word CTRDGi_EraseFlashChipMX
- .word CTRDGi_EraseFlashSectorMX
- .word CTRDGi_WriteFlashSectorAsyncMX
- .word CTRDGi_EraseFlashChipAsyncMX
- .word CTRDGi_EraseFlashSectorAsyncMX
- .word CTRDGi_PollingSR1MCOMMON
- .word UNK_02104084
- .byte 0x00, 0x00, 0x02, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0C, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00
- .byte 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x62, 0x00, 0x13, 0x00
-
- .global UNK_021040C8
-UNK_021040C8: ; 0x021040C8
- .byte 0x0A, 0x00, 0x0A, 0x00, 0x28, 0x00, 0xC8, 0x00
-
- .global UNK_021040D0
-UNK_021040D0: ; 0x021040D0
- .word CTRDGi_WriteFlashSectorLE
- .word CTRDGi_EraseFlashChipLE
- .word CTRDGi_EraseFlashSectorLE
- .word CTRDGi_WriteFlashSectorAsyncLE
- .word CTRDGi_EraseFlashChipAsyncLE
- .word CTRDGi_EraseFlashSectorAsyncLE
- .word CTRDGi_PollingSR512kCOMMON
- .word UNK_021040C8
- .byte 0x00, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0C, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00
- .byte 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-
- .global UNK_0210410C
-UNK_0210410C: ; 0x0210410C
- .word CTRDGi_WriteFlashSectorLE
- .word CTRDGi_EraseFlashChipLE
- .word CTRDGi_EraseFlashSectorLE
- .word CTRDGi_WriteFlashSectorAsyncLE
- .word CTRDGi_EraseFlashChipAsyncLE
- .word CTRDGi_EraseFlashSectorAsyncLE
- .word CTRDGi_PollingSR512kCOMMON
- .word UNK_021040C8
- .byte 0x00, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0C, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00
- .byte 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xBF, 0x00, 0xD4, 0x00
-
- .global UNK_02104148
-UNK_02104148: ; 0x02104148
- .byte 0x0A, 0x00, 0x0A, 0x00, 0xD0, 0x07, 0xD0, 0x07
-
- .global UNK_02104150
-UNK_02104150: ; 0x02104150
- .word CTRDGi_WriteFlashSectorMX
- .word CTRDGi_EraseFlashChipMX
- .word CTRDGi_EraseFlashSectorMX
- .word CTRDGi_WriteFlashSectorAsyncMX
- .word CTRDGi_EraseFlashChipAsyncMX
- .word CTRDGi_EraseFlashSectorAsyncMX
- .word CTRDGi_PollingSR1MCOMMON
- .word UNK_02104148
- .byte 0x00, 0x00, 0x02, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0C, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00
- .byte 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xC2, 0x00, 0x09, 0x00
-
- .global UNK_0210418C
-UNK_0210418C: ; 0x0210418C
- .word CTRDGi_WriteFlashSectorMX
- .word CTRDGi_EraseFlashChipMX
- .word CTRDGi_EraseFlashSectorMX
- .word CTRDGi_WriteFlashSectorAsyncMX
- .word CTRDGi_EraseFlashChipAsyncMX
- .word CTRDGi_EraseFlashSectorAsyncMX
- .word CTRDGi_PollingSR1MCOMMON
- .word UNK_02104148
- .byte 0x00, 0x00, 0x02, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0C, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00
- .byte 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-
- .global UNK_021041C8
-UNK_021041C8: ; 0x021041C8
- .byte 0x0A, 0x00, 0x0A, 0x00, 0xF4, 0x01, 0xF4, 0x01
-
- .global UNK_021041D0
-UNK_021041D0: ; 0x021041D0
- .word CTRDGi_WriteFlashSectorMX5
- .word CTRDGi_EraseFlashChipLE
- .word CTRDGi_EraseFlashSectorLE
- .word CTRDGi_WriteFlashSectorAsyncMX5
- .word CTRDGi_EraseFlashChipAsyncLE
- .word CTRDGi_EraseFlashSectorAsyncLE
- .word CTRDGi_PollingSR512kCOMMON
- .word UNK_021041C8
- .byte 0x00, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0C, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00
- .byte 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x32, 0x00, 0x1B, 0x00
+ .word LE39FW512
+ .word AT29LV512_lib
+ .word MN63F805MNP
+ .word defaultFlash512
.section .bss
diff --git a/arm9/asm/CTRDG_flash_AT29LV512.s b/arm9/asm/CTRDG_flash_AT29LV512.s
index 33298e6c..ff80e947 100644
--- a/arm9/asm/CTRDG_flash_AT29LV512.s
+++ b/arm9/asm/CTRDG_flash_AT29LV512.s
@@ -1,14 +1,45 @@
.include "asm/macros.inc"
.include "global.inc"
- .extern UNK_0210400C
+ .extern CTRDGi_PollingSR512kCOMMON
.extern UNK_021D6B20
.extern UNK_021D6B24
.extern UNK_021D6B0C
.extern UNK_021D6B38
- .extern UNK_02104048
.extern UNK_021D6B08
+ .section .rodata
+
+ .global atMaxTime
+atMaxTime: ; 0x02104004
+ .short 10, 40, 0, 40
+
+ .global AT29LV512_lib
+AT29LV512_lib: ; 0x0210400C
+ .word CTRDGi_WriteFlash4KBAT
+ .word CTRDGi_EraseFlashChipAT
+ .word CTRDGi_EraseFlash4KBAT
+ .word CTRDGi_WriteFlash4KBAsyncAT
+ .word CTRDGi_EraseFlashChipAsyncAT
+ .word CTRDGi_EraseFlash4KBAsyncAT
+ .word CTRDGi_PollingSR512kCOMMON
+ .word atMaxTime
+ .byte 0x00, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0C, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00
+ .byte 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x3D, 0x00
+
+ .global AT29LV512_org
+AT29LV512_org: ; 0x02104048
+ .word CTRDGi_WriteFlashSectorAT
+ .word CTRDGi_EraseFlashChipAT
+ .word CTRDGi_EraseFlashSectorAT
+ .word CTRDGi_WriteFlashSectorAsyncAT
+ .word CTRDGi_EraseFlashChipAsyncAT
+ .word CTRDGi_EraseFlashSectorAsyncAT
+ .word CTRDGi_PollingSR512kCOMMON
+ .word atMaxTime
+ .byte 0x00, 0x00, 0x01, 0x00, 0x80, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00
+ .byte 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x3D, 0x00
+
.text
arm_func_start CTRDGi_WriteFlashSectorAsyncAT
@@ -170,7 +201,7 @@ CTRDGi_WriteFlash4KBCoreAT: ; 0x020DC780
ldrhs r0, _020DC85C ; =0x000080FF
ldmcsia sp!, {r4-r9,lr}
bxcs lr
- ldr r1, _020DC860 ; =UNK_0210400C
+ ldr r1, _020DC860 ; =AT29LV512_lib
mov r0, r0, lsl #0x15
ldr r1, [r1, #0x24]
ldr r4, _020DC864 ; =UNK_021D6B08
@@ -179,7 +210,7 @@ CTRDGi_WriteFlash4KBCoreAT: ; 0x020DC780
ldrh r0, [r4, #0x0]
cmp r0, #0x0
beq _020DC84C
- ldr r0, _020DC868 ; =UNK_02104048
+ ldr r0, _020DC868 ; =AT29LV512_org
ldr r6, [r0, #0x24]
mov r5, #0x2
_020DC7F4:
@@ -214,9 +245,9 @@ _020DC84C:
bx lr
.balign 4
_020DC85C: .word 0x000080FF
-_020DC860: .word UNK_0210400C
+_020DC860: .word AT29LV512_lib
_020DC864: .word UNK_021D6B08
-_020DC868: .word UNK_02104048
+_020DC868: .word AT29LV512_org
arm_func_start CTRDGi_WriteFlashSectorCoreAT
CTRDGi_WriteFlashSectorCoreAT: ; 0x020DC86C
@@ -240,7 +271,7 @@ CTRDGi_WriteFlashSectorCoreAT: ; 0x020DC86C
ldr r1, [r1, #0x0]
ldrh r2, [r5, #0x0]
ldr r3, [r1, #0x10]
- ldr r1, _020DC990 ; =UNK_02104048
+ ldr r1, _020DC990 ; =AT29LV512_org
bic r2, r2, #0x3
orr r2, r2, r3
strh r2, [r5, #0x0]
@@ -296,7 +327,7 @@ _020DC92C:
_020DC984: .word UNK_021D6B0C
_020DC988: .word 0x04000204
_020DC98C: .word UNK_021D6B20
-_020DC990: .word UNK_02104048
+_020DC990: .word AT29LV512_org
_020DC994: .word 0x04000208
_020DC998: .word 0x0A005555
_020DC99C: .word 0x0A002AAA
@@ -366,7 +397,7 @@ CTRDGi_EraseFlashSectorCoreAT: ; 0x020DCA58
ldmia r5!, {r0-r3}
stmia r4!, {r0-r3}
ldr r0, [r5, #0x0]
- ldr r1, _020DCB80 ; =UNK_02104048
+ ldr r1, _020DCB80 ; =AT29LV512_org
str r0, [r4, #0x0]
ldr r0, _020DCB84 ; =UNK_021D6B0C
ldrh r2, [sp, #0x20]
@@ -396,7 +427,7 @@ CTRDGi_EraseFlashSectorCoreAT: ; 0x020DCA58
strb r3, [r1, #0x0]
mov r3, #0xa0
strb r3, [r4, #0x0]
- ldr r1, _020DCB80 ; =UNK_02104048
+ ldr r1, _020DCB80 ; =AT29LV512_org
and r4, r0, #0x3
ldr r1, [r1, #0x24]
cmp r1, #0x0
@@ -434,7 +465,7 @@ _020DCB18:
ldmia sp!, {r4-r5,lr}
bx lr
.balign 4
-_020DCB80: .word UNK_02104048
+_020DCB80: .word AT29LV512_org
_020DCB84: .word UNK_021D6B0C
_020DCB88: .word 0x04000204
_020DCB8C: .word UNK_021D6B20
diff --git a/arm9/asm/CTRDG_flash_LE26FV10N1TS-10.s b/arm9/asm/CTRDG_flash_LE26FV10N1TS-10.s
new file mode 100644
index 00000000..518ac3d7
--- /dev/null
+++ b/arm9/asm/CTRDG_flash_LE26FV10N1TS-10.s
@@ -0,0 +1,29 @@
+ .include "asm/macros.inc"
+ .include "global.inc"
+
+ .extern CTRDGi_EraseFlashChipAsyncMX
+ .extern CTRDGi_EraseFlashChipMX
+ .extern CTRDGi_EraseFlashSectorAsyncMX
+ .extern CTRDGi_EraseFlashSectorMX
+ .extern CTRDGi_PollingSR1MCOMMON
+ .extern CTRDGi_WriteFlashSectorAsyncMX
+ .extern CTRDGi_WriteFlashSectorMX
+
+ .section .rodata
+
+ .global LeMaxTime
+LeMaxTime: ; 0x02104084
+ .short 10, 10, 2000, 5000
+
+ .global LE26FV10N1TS_10
+LE26FV10N1TS_10: ; 0x0210408C
+ .word CTRDGi_WriteFlashSectorMX
+ .word CTRDGi_EraseFlashChipMX
+ .word CTRDGi_EraseFlashSectorMX
+ .word CTRDGi_WriteFlashSectorAsyncMX
+ .word CTRDGi_EraseFlashChipAsyncMX
+ .word CTRDGi_EraseFlashSectorAsyncMX
+ .word CTRDGi_PollingSR1MCOMMON
+ .word LeMaxTime
+ .byte 0x00, 0x00, 0x02, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0C, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00
+ .byte 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x62, 0x00, 0x13, 0x00
diff --git a/arm9/asm/CTRDG_flash_LE39FW512.s b/arm9/asm/CTRDG_flash_LE39FW512.s
index 77071a6d..b3f4b8a3 100644
--- a/arm9/asm/CTRDG_flash_LE39FW512.s
+++ b/arm9/asm/CTRDG_flash_LE39FW512.s
@@ -1,12 +1,45 @@
.include "asm/macros.inc"
.include "global.inc"
+ .extern CTRDGi_PollingSR512kCOMMON
.extern UNK_021D6B20
.extern UNK_021D6B24
.extern UNK_021D6B0C
.extern UNK_021D6B38
.extern UNK_021D6B08
+ .section .rodata
+
+ .global leMaxTime
+leMaxTime: ; 0x021040C8
+ .byte 0x0A, 0x00, 0x0A, 0x00, 0x28, 0x00, 0xC8, 0x00
+
+ .global defaultFlash512
+defaultFlash512: ; 0x021040D0
+ .word CTRDGi_WriteFlashSectorLE
+ .word CTRDGi_EraseFlashChipLE
+ .word CTRDGi_EraseFlashSectorLE
+ .word CTRDGi_WriteFlashSectorAsyncLE
+ .word CTRDGi_EraseFlashChipAsyncLE
+ .word CTRDGi_EraseFlashSectorAsyncLE
+ .word CTRDGi_PollingSR512kCOMMON
+ .word leMaxTime
+ .byte 0x00, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0C, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00
+ .byte 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+
+ .global LE39FW512
+LE39FW512: ; 0x0210410C
+ .word CTRDGi_WriteFlashSectorLE
+ .word CTRDGi_EraseFlashChipLE
+ .word CTRDGi_EraseFlashSectorLE
+ .word CTRDGi_WriteFlashSectorAsyncLE
+ .word CTRDGi_EraseFlashChipAsyncLE
+ .word CTRDGi_EraseFlashSectorAsyncLE
+ .word CTRDGi_PollingSR512kCOMMON
+ .word leMaxTime
+ .byte 0x00, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0C, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00
+ .byte 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xBF, 0x00, 0xD4, 0x00
+
.text
arm_func_start CTRDGi_WriteFlashSectorAsyncLE
diff --git a/arm9/asm/CTRDG_flash_MX29L010.s b/arm9/asm/CTRDG_flash_MX29L010.s
index 646121f3..5ac28935 100644
--- a/arm9/asm/CTRDG_flash_MX29L010.s
+++ b/arm9/asm/CTRDG_flash_MX29L010.s
@@ -1,12 +1,45 @@
.include "asm/macros.inc"
.include "global.inc"
+ .extern CTRDGi_PollingSR1MCOMMON
.extern UNK_021D6B20
.extern UNK_021D6B24
.extern UNK_021D6B0C
.extern UNK_021D6B38
.extern UNK_021D6B08
+ .section .rodata
+
+ .global MxMaxTime
+MxMaxTime: ; 0x02104148
+ .short 10, 10, 2000, 2000
+
+ .global MX29L010
+MX29L010: ; 0x02104150
+ .word CTRDGi_WriteFlashSectorMX
+ .word CTRDGi_EraseFlashChipMX
+ .word CTRDGi_EraseFlashSectorMX
+ .word CTRDGi_WriteFlashSectorAsyncMX
+ .word CTRDGi_EraseFlashChipAsyncMX
+ .word CTRDGi_EraseFlashSectorAsyncMX
+ .word CTRDGi_PollingSR1MCOMMON
+ .word MxMaxTime
+ .byte 0x00, 0x00, 0x02, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0C, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00
+ .byte 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xC2, 0x00, 0x09, 0x00
+
+ .global defaultFlash1M
+defaultFlash1M: ; 0x0210418C
+ .word CTRDGi_WriteFlashSectorMX
+ .word CTRDGi_EraseFlashChipMX
+ .word CTRDGi_EraseFlashSectorMX
+ .word CTRDGi_WriteFlashSectorAsyncMX
+ .word CTRDGi_EraseFlashChipAsyncMX
+ .word CTRDGi_EraseFlashSectorAsyncMX
+ .word CTRDGi_PollingSR1MCOMMON
+ .word MxMaxTime
+ .byte 0x00, 0x00, 0x02, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0C, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00
+ .byte 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+
.text
arm_func_start CTRDGi_WriteFlashSectorAsyncMX
diff --git a/arm9/asm/CTRDG_flash_MX29L512.s b/arm9/asm/CTRDG_flash_MX29L512.s
index f075c9f0..17b50125 100644
--- a/arm9/asm/CTRDG_flash_MX29L512.s
+++ b/arm9/asm/CTRDG_flash_MX29L512.s
@@ -1,10 +1,33 @@
.include "asm/macros.inc"
.include "global.inc"
+ .extern CTRDGi_EraseFlashChipAsyncLE
+ .extern CTRDGi_EraseFlashChipLE
+ .extern CTRDGi_EraseFlashSectorAsyncLE
+ .extern CTRDGi_PollingSR512kCOMMON
.extern UNK_021D6B08
.extern UNK_021D6B20
.extern UNK_021D6B0C
+ .section .rodata
+
+ .global PaMaxTime
+PaMaxTime: ; 0x021041C8
+ .byte 0x0A, 0x00, 0x0A, 0x00, 0xF4, 0x01, 0xF4, 0x01
+
+ .global MN63F805MNP
+MN63F805MNP: ; 0x021041D0
+ .word CTRDGi_WriteFlashSectorMX5
+ .word CTRDGi_EraseFlashChipLE
+ .word CTRDGi_EraseFlashSectorLE
+ .word CTRDGi_WriteFlashSectorAsyncMX5
+ .word CTRDGi_EraseFlashChipAsyncLE
+ .word CTRDGi_EraseFlashSectorAsyncLE
+ .word CTRDGi_PollingSR512kCOMMON
+ .word PaMaxTime
+ .byte 0x00, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0C, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00
+ .byte 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x32, 0x00, 0x1B, 0x00
+
.text
arm_func_start CTRDGi_WriteFlashSectorAsyncMX5
diff --git a/arm9/asm/scrcmd.s b/arm9/asm/scrcmd.s
index 2f0cb3ef..c5ae760b 100644
--- a/arm9/asm/scrcmd.s
+++ b/arm9/asm/scrcmd.s
@@ -2248,7 +2248,7 @@ FUN_0203AAA0: ; 0x0203AAA0
ldr r1, _0203AAF8 ; =UNK_020F34E0
ldr r2, _0203AAF4 ; =0x000003D9
mov r3, #0xb
- bl FUN_02002198
+ bl Std_CreateYesNoMenu
str r0, [r6, #0x0]
ldr r1, _0203AAFC ; =FUN_0203AB00
add r0, r5, #0x0
diff --git a/arm9/asm/scrcmd_7.s b/arm9/asm/scrcmd_7.s
index 7ae38f49..01c0425f 100644
--- a/arm9/asm/scrcmd_7.s
+++ b/arm9/asm/scrcmd_7.s
@@ -366,7 +366,7 @@ FUN_02041970: ; 0x02041970
add r5, r0, #0x0
ldrh r0, [r4, #0x0]
bl FUN_020395F4
- bl FUN_0203962C
+ bl Field_TrainerIsDoubleBattle
lsl r0, r0, #0x10
lsr r0, r0, #0x10
bne _020419D2
@@ -430,7 +430,7 @@ FUN_020419F8: ; 0x020419F8
add r5, r0, #0x0
ldrh r0, [r4, #0x0]
bl FUN_020395F4
- bl FUN_0203962C
+ bl Field_TrainerIsDoubleBattle
lsl r0, r0, #0x10
lsr r0, r0, #0x10
bne _02041A5A
@@ -478,7 +478,7 @@ FUN_02041A80: ; 0x02041A80
add r5, r0, #0x0
ldrh r0, [r4, #0x0]
bl FUN_020395F4
- bl FUN_0203962C
+ bl Field_TrainerIsDoubleBattle
strh r0, [r5, #0x0]
mov r0, #0x0
pop {r3-r5, pc}
diff --git a/arm9/asm/unk_02001B80.s b/arm9/asm/unk_02001B80.s
index ff804a2f..3ad4b3b7 100644
--- a/arm9/asm/unk_02001B80.s
+++ b/arm9/asm/unk_02001B80.s
@@ -755,8 +755,8 @@ FUN_020020B0: ; 0x020020B0
pop {r3-r7, pc}
.balign 4
- thumb_func_start FUN_020020EC
-FUN_020020EC: ; 0x020020EC
+ thumb_func_start CreateYesNoMenu
+CreateYesNoMenu: ; 0x020020EC
push {r3-r7, lr}
sub sp, #0x20
ldr r5, [sp, #0x3c]
@@ -777,13 +777,13 @@ FUN_020020EC: ; 0x020020EC
mov r2, #0x29
mov r3, #0x0
add r6, r0, #0x0
- bl ListMenu_ItemFromMsgData
+ bl ListMenu_ItemFromMsgData ; YES
mov r3, #0x2a
add r2, r3, #0x0
add r0, r6, #0x0
add r1, r4, #0x0
sub r3, #0x2c
- bl ListMenu_ItemFromMsgData
+ bl ListMenu_ItemFromMsgData ; NO
add r0, r4, #0x0
bl DestroyMsgData
add r0, r5, #0x0
@@ -834,15 +834,15 @@ FUN_020020EC: ; 0x020020EC
nop
_02002194: .word 0x00000141
- thumb_func_start FUN_02002198
-FUN_02002198: ; 0x02002198
+ thumb_func_start Std_CreateYesNoMenu
+Std_CreateYesNoMenu: ; 0x02002198
push {r4, lr}
sub sp, #0x8
mov r4, #0x0
str r4, [sp, #0x0]
ldr r4, [sp, #0x10]
str r4, [sp, #0x4]
- bl FUN_020020EC
+ bl CreateYesNoMenu
add sp, #0x8
pop {r4, pc}
diff --git a/arm9/asm/unk_02038C78.s b/arm9/asm/unk_02038C78.s
index d16d93f2..f35fd58e 100644
--- a/arm9/asm/unk_02038C78.s
+++ b/arm9/asm/unk_02038C78.s
@@ -879,7 +879,7 @@ FUN_02038C78: ; 0x02038C78
add r5, r0, #0x0
add r6, r1, #0x0
add r7, r2, #0x0
- bl FUN_02038E20
+ bl CreateFieldContext
add r4, r0, #0x0
mov r0, #0x0
str r0, [sp, #0x0]
@@ -932,7 +932,7 @@ FUN_02038CD8: ; 0x02038CD8
add r5, r3, #0x0
bl FUN_02046528
str r0, [sp, #0x8]
- bl FUN_02038E20
+ bl CreateFieldContext
add r4, r0, #0x0
ldr r0, [sp, #0x8]
ldr r3, [sp, #0x4]
@@ -958,7 +958,7 @@ FUN_02038D10: ; 0x02038D10
add r7, r2, #0x0
bl FUN_02046528
str r0, [sp, #0x4]
- bl FUN_02038E20
+ bl CreateFieldContext
add r4, r0, #0x0
mov r0, #0x0
str r0, [sp, #0x0]
@@ -1031,7 +1031,7 @@ _02038DA8:
cmp r0, #0x0
bne _02038DD2
add r0, r6, #0x0
- bl FUN_02038E48
+ bl DeleteScriptContext
ldrb r0, [r4, #0x9]
cmp r0, #0x0
bne _02038DC8
@@ -1081,8 +1081,8 @@ _02038E1A:
add sp, #0x8
pop {r3-r7, pc}
- thumb_func_start FUN_02038E20
-FUN_02038E20: ; 0x02038E20
+ thumb_func_start CreateFieldContext
+CreateFieldContext: ; 0x02038E20
push {r4, lr}
mov r0, #0xb
mov r1, #0xdc
@@ -1102,8 +1102,8 @@ _02038E32:
.balign 4
_02038E44: .word 0x0003643F
- thumb_func_start FUN_02038E48
-FUN_02038E48: ; 0x02038E48
+ thumb_func_start DeleteScriptContext
+DeleteScriptContext: ; 0x02038E48
push {r4, lr}
add r4, r0, #0x0
ldr r0, [r4, #0x78]
@@ -2139,8 +2139,8 @@ _02039622:
nop
_02039628: .word 0x00001388
- thumb_func_start FUN_0203962C
-FUN_0203962C: ; 0x0203962C
+ thumb_func_start Field_TrainerIsDoubleBattle
+Field_TrainerIsDoubleBattle: ; 0x0203962C
push {r3, lr}
mov r1, #0x9
bl TrainerData_GetAttr
@@ -2443,17 +2443,17 @@ _02039856:
nop
_02039870: .word 0x0000FFFF
- thumb_func_start FUN_02039874
-FUN_02039874: ; 0x02039874
- ldr r3, _0203987C ; =FUN_02039880
+ thumb_func_start RunPokemonCenterScriptsInNewContext
+RunPokemonCenterScriptsInNewContext: ; 0x02039874
+ ldr r3, _0203987C ; =RunScriptInNewContext
mov r1, #0x96
lsl r1, r1, #0x6
bx r3
.balign 4
-_0203987C: .word FUN_02039880
+_0203987C: .word RunScriptInNewContext
- thumb_func_start FUN_02039880
-FUN_02039880: ; 0x02039880
+ thumb_func_start RunScriptInNewContext
+RunScriptInNewContext: ; 0x02039880
push {r4, lr}
bl CreateScriptContext
add r4, r0, #0x0
@@ -2463,7 +2463,7 @@ _02039888:
cmp r0, #0x1
beq _02039888
add r0, r4, #0x0
- bl FUN_02038E48
+ bl DeleteScriptContext
pop {r4, pc}
.balign 4
@@ -2503,7 +2503,7 @@ _020398CE:
b _020398E2
_020398DC:
add r0, r5, #0x0
- bl FUN_02039880
+ bl RunScriptInNewContext
_020398E2:
mov r0, #0x1
pop {r3-r5, pc}
diff --git a/arm9/asm/unk_02048904.s b/arm9/asm/unk_02048904.s
index 4ca21350..d9259556 100644
--- a/arm9/asm/unk_02048904.s
+++ b/arm9/asm/unk_02048904.s
@@ -599,7 +599,7 @@ FUN_02048D90: ; 0x02048D90
add r4, r0, #0x0
mov r1, #0x0
str r1, [r4, #0x6c]
- bl FUN_02039874
+ bl RunPokemonCenterScriptsInNewContext
ldr r1, _02048DA8 ; =FUN_02048D34
add r0, r4, #0x0
mov r2, #0x0
@@ -2040,7 +2040,7 @@ _020498DC:
ldr r0, [r5, #0x8]
ldr r1, _02049ABC ; =UNK_020F46D8
ldr r2, _02049AB8 ; =0x000003D9
- bl FUN_02002198
+ bl Std_CreateYesNoMenu
str r0, [r4, #0x3c]
mov r0, #0x2
str r0, [r4, #0x0]
diff --git a/arm9/asm/unk_02054590.s b/arm9/asm/unk_02054590.s
index c4969083..6f52c967 100644
--- a/arm9/asm/unk_02054590.s
+++ b/arm9/asm/unk_02054590.s
@@ -131,8 +131,8 @@ FUN_02054658: ; 0x02054658
add sp, #0xc
pop {r3-r6, pc}
- thumb_func_start FUN_02054690
-FUN_02054690: ; 0x02054690
+ thumb_func_start DrawFieldMessage
+DrawFieldMessage: ; 0x02054690
push {r4-r7, lr}
sub sp, #0xc
add r5, r0, #0x0
diff --git a/arm9/asm/unk_0205C598.s b/arm9/asm/unk_0205C598.s
index 8429979f..ac7a6808 100644
--- a/arm9/asm/unk_0205C598.s
+++ b/arm9/asm/unk_0205C598.s
@@ -241,7 +241,7 @@ FUN_0205C73C: ; 0x0205C73C
str r0, [r5, #0xc]
lsl r0, r0, #0x10
lsr r0, r0, #0x10
- bl FUN_0203962C
+ bl Field_TrainerIsDoubleBattle
str r0, [r5, #0x10]
str r4, [r5, #0x14]
pop {r3-r5, pc}
diff --git a/arm9/asm/unk_020625EC.s b/arm9/asm/unk_020625EC.s
index e60a5b4f..8383e9bb 100644
--- a/arm9/asm/unk_020625EC.s
+++ b/arm9/asm/unk_020625EC.s
@@ -430,7 +430,7 @@ FUN_020628BC: ; 0x020628BC
ldr r0, [r0, #0x0]
ldr r2, _020628E4 ; =0x000003D9
mov r3, #0xb
- bl FUN_02002198
+ bl Std_CreateYesNoMenu
add r4, #0xc8
str r0, [r4, #0x0]
add sp, #0x4
diff --git a/arm9/asm/unk_020653EC.s b/arm9/asm/unk_020653EC.s
index 74da05c0..45f5de1d 100644
--- a/arm9/asm/unk_020653EC.s
+++ b/arm9/asm/unk_020653EC.s
@@ -2192,7 +2192,7 @@ FUN_02066520: ; 0x02066520
ldr r0, [r4, r0]
ldr r2, _02066548 ; =0x000003D9
mov r3, #0xb
- bl FUN_02002198
+ bl Std_CreateYesNoMenu
mov r1, #0x5a
lsl r1, r1, #0x2
str r0, [r4, r1]
diff --git a/arm9/asm/unk_0206C700.s b/arm9/asm/unk_0206C700.s
index 7fa07ac0..8e89581c 100644
--- a/arm9/asm/unk_0206C700.s
+++ b/arm9/asm/unk_0206C700.s
@@ -1314,7 +1314,7 @@ _0206D1F0:
ldr r0, [r4, #0x0]
mov r2, #0x1
mov r3, #0x8
- bl FUN_02002198
+ bl Std_CreateYesNoMenu
str r0, [r4, #0x40]
add r0, r4, #0x0
add r0, #0x64
@@ -1537,7 +1537,7 @@ _0206D3CC:
ldr r0, [r4, #0x0]
mov r2, #0x1
mov r3, #0x8
- bl FUN_02002198
+ bl Std_CreateYesNoMenu
str r0, [r4, #0x40]
add r0, r4, #0x0
add r0, #0x64
diff --git a/arm9/asm/unk_02072548.s b/arm9/asm/unk_02072548.s
index f35f769c..5b3ed0a3 100644
--- a/arm9/asm/unk_02072548.s
+++ b/arm9/asm/unk_02072548.s
@@ -1741,7 +1741,7 @@ FUN_020732CC: ; 0x020732CC
ldr r1, _020732EC ; =UNK_020F96EC
mov r2, #0x1
mov r3, #0xe
- bl FUN_02002198
+ bl Std_CreateYesNoMenu
ldr r1, _020732F0 ; =0x000006FC
str r0, [r4, r1]
add sp, #0x4
diff --git a/arm9/asm/unk_02089498.s b/arm9/asm/unk_02089498.s
index 82d06472..e4ce48cf 100644
--- a/arm9/asm/unk_02089498.s
+++ b/arm9/asm/unk_02089498.s
@@ -415,7 +415,7 @@ _020897B8:
ldr r0, [r4, #0x14]
ldr r2, _02089894 ; =0x000001D9
mov r3, #0x3
- bl FUN_020020EC
+ bl CreateYesNoMenu
str r0, [r4, #0x2c]
mov r0, #0x1
str r0, [r4, #0x4]
@@ -453,7 +453,7 @@ _02089802:
ldr r0, [r4, #0x14]
ldr r2, _02089894 ; =0x000001D9
mov r3, #0x3
- bl FUN_020020EC
+ bl CreateYesNoMenu
str r0, [r4, #0x2c]
mov r0, #0x3
str r0, [r4, #0x4]