Finish port of agb_flash

This commit is contained in:
Diegoisawesome 2016-11-01 17:34:01 -05:00
parent dd3e5da227
commit 67ac6db95e
6 changed files with 25 additions and 51 deletions

View File

@ -9,7 +9,7 @@
calls_flash_erase_block: @ 8152650 calls_flash_erase_block: @ 8152650
push {r4,r5,lr} push {r4,r5,lr}
movs r4, 0 movs r4, 0
ldr r5, =gUnknown_03007860 ldr r5, =EraseFlashSector
_08152656: _08152656:
ldr r1, [r5] ldr r1, [r5]
adds r0, r4, 0 adds r0, r4, 0
@ -572,7 +572,7 @@ _08152B22:
ldr r2, =0x00000ff6 ldr r2, =0x00000ff6
adds r1, r2 adds r1, r2
strh r0, [r1] strh r0, [r1]
ldr r0, =gUnknown_03007860 ldr r0, =EraseFlashSector
ldr r1, [r0] ldr r1, [r0]
adds r0, r5, 0 adds r0, r5, 0
bl _call_via_r1 bl _call_via_r1
@ -580,7 +580,7 @@ _08152B22:
movs r4, 0 movs r4, 0
ldr r7, =0x00000ff7 ldr r7, =0x00000ff7
mov r9, r7 mov r9, r7
ldr r7, =gUnknown_03007854 ldr r7, =ProgramFlashByte
b _08152B82 b _08152B82
.pool .pool
_08152B7C: _08152B7C:
@ -612,7 +612,7 @@ _08152BA0:
_08152BB0: _08152BB0:
movs r6, 0x1 movs r6, 0x1
movs r4, 0 movs r4, 0
ldr r1, =gUnknown_03007854 ldr r1, =ProgramFlashByte
mov r9, r1 mov r9, r1
ldr r7, =0x00000ff9 ldr r7, =0x00000ff9
b _08152BCA b _08152BCA
@ -690,7 +690,7 @@ sav12_xor_get: @ 8152C20
adds r0, r4, r0 adds r0, r4, r0
lsls r0, 16 lsls r0, 16
lsrs r4, r0, 16 lsrs r4, r0, 16
ldr r0, =gUnknown_03007854 ldr r0, =ProgramFlashByte
ldr r1, =0x00000ff8 ldr r1, =0x00000ff8
ldr r3, [r0] ldr r3, [r0]
adds r0, r4, 0 adds r0, r4, 0
@ -751,7 +751,7 @@ sub_8152CAC: @ 8152CAC
adds r0, r4, r0 adds r0, r4, r0
lsls r0, 16 lsls r0, 16
lsrs r4, r0, 16 lsrs r4, r0, 16
ldr r3, =gUnknown_03007854 ldr r3, =ProgramFlashByte
ldr r1, =0x00000ff8 ldr r1, =0x00000ff8
ldr r0, =gUnknown_03006204 ldr r0, =gUnknown_03006204
ldr r0, [r0] ldr r0, [r0]
@ -815,7 +815,7 @@ sub_8152D44: @ 8152D44
adds r0, r4, r0 adds r0, r4, r0
lsls r0, 16 lsls r0, 16
lsrs r4, r0, 16 lsrs r4, r0, 16
ldr r0, =gUnknown_03007854 ldr r0, =ProgramFlashByte
ldr r1, =0x00000ff8 ldr r1, =0x00000ff8
ldr r3, [r0] ldr r3, [r0]
adds r0, r4, 0 adds r0, r4, 0
@ -1390,7 +1390,7 @@ _0815322C:
.4byte _08153244 .4byte _08153244
_08153244: _08153244:
movs r4, 0x1C movs r4, 0x1C
ldr r5, =gUnknown_03007860 ldr r5, =EraseFlashSector
_08153248: _08153248:
ldr r1, [r5] ldr r1, [r5]
adds r0, r4, 0 adds r0, r4, 0
@ -1460,7 +1460,7 @@ _081532DE:
.pool .pool
_081532F8: _081532F8:
movs r4, 0x1C movs r4, 0x1C
ldr r5, =gUnknown_03007860 ldr r5, =EraseFlashSector
_081532FC: _081532FC:
ldr r1, [r5] ldr r1, [r5]
adds r0, r4, 0 adds r0, r4, 0

View File

@ -633,7 +633,7 @@ sub_8179554: @ 8179554
movs r0, 0 movs r0, 0
ldr r1, =0x00000fff ldr r1, =0x00000fff
mov r8, r1 mov r8, r1
ldr r7, =gUnknown_03007854 ldr r7, =ProgramFlashByte
_08179566: _08179566:
movs r4, 0 movs r4, 0
adds r5, r0, 0x1 adds r5, r0, 0x1

10
common_syms/agb_flash.txt Normal file
View File

@ -0,0 +1,10 @@
gFlashTimeoutFlag
PollFlashStatus
WaitForFlashWrite
ProgramFlashSector
gFlash
ProgramFlashByte
gFlashNumRemainingBytes
EraseFlashChip
EraseFlashSector
gFlashMaxTime

View File

@ -31,4 +31,4 @@ gUnknown_086B49C0:: @ 86B49C0
.incbin "baserom.gba", 0x6b49c0, 0x30 .incbin "baserom.gba", 0x6b49c0, 0x30
gUnknown_086B49F0:: @ 86B49F0 gUnknown_086B49F0:: @ 86B49F0
.incbin "baserom.gba", 0x6b49f0, 0x2ee6e0 .incbin "baserom.gba", 0x6b49f0, 0x2ee660

View File

@ -511,20 +511,12 @@ gUnknown_030012FC: @ 30012FC
gUnknown_03001300: @ 3001300 gUnknown_03001300: @ 3001300
.space 0x770 .space 0x770
gUnknown_03001A70: @ 3001A70 .include "src/agb_flash.o"
.space 0x2 .space 0x2
gUnknown_03001A72: @ 3001A72
.space 0x2
gUnknown_03001A74: @ 3001A74
.space 0x4
gUnknown_03001A78: @ 3001A78
.space 0x6
gUnknown_03001A7E: @ 3001A7E gUnknown_03001A7E: @ 3001A7E
.space 0x02 .space 0x2
.include "tools/agbcc/lib/libgcc.a:dp-bit.o" .include "tools/agbcc/lib/libgcc.a:dp-bit.o"
.include "tools/agbcc/lib/libgcc.a:fp-bit.o" .include "tools/agbcc/lib/libgcc.a:fp-bit.o"

View File

@ -548,35 +548,7 @@ gUnknown_030077F0: @ 30077F0
gUnknown_03007800: @ 3007800 gUnknown_03007800: @ 3007800
.space 0x40 .space 0x40
gUnknown_03007840: @ 3007840 .include "agb_flash.o"
.space 0x4
gUnknown_03007844: @ 3007844
.space 0x4
gUnknown_03007848: @ 3007848
.space 0x4
gUnknown_0300784C: @ 300784C
.space 0x4
gUnknown_03007850: @ 3007850
.space 0x4
gUnknown_03007854: @ 3007854
.space 0x4
gUnknown_03007858: @ 3007858
.space 0x4
gUnknown_0300785C: @ 300785C
.space 0x4
gUnknown_03007860: @ 3007860
.space 0x4
gUnknown_03007864: @ 3007864
.space 0x4
gUnknown_03007868: @ 3007868 gUnknown_03007868: @ 3007868
.space 0x8 .space 0x8