summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--asm/code_800D090.s104
-rw-r--r--asm/code_809D148.s14
-rw-r--r--data/data_80F4278.s196
-rwxr-xr-xld_script.txt1
-rw-r--r--src/code_800D090.c65
-rw-r--r--src/code_801D760.c28
-rw-r--r--src/code_809D148.c42
7 files changed, 257 insertions, 193 deletions
diff --git a/asm/code_800D090.s b/asm/code_800D090.s
index 394944e..691f0f6 100644
--- a/asm/code_800D090.s
+++ b/asm/code_800D090.s
@@ -5,110 +5,6 @@
.text
- thumb_func_start Hang
-Hang:
- push {lr}
-_0800D092:
- swi 0x2
- b _0800D092
- thumb_func_end Hang
-
- thumb_func_start sub_800D098
-sub_800D098:
- push {r4-r7,lr}
- mov r7, r10
- mov r6, r9
- mov r5, r8
- push {r5-r7}
- ldr r1, _0800D138
-_0800D0A4:
- ldrh r0, [r1]
- cmp r0, 0x9F
- bls _0800D0A4
- movs r1, 0x80
- lsls r1, 19
- ldrh r0, [r1]
- adds r7, r0, 0
- movs r0, 0
- strh r0, [r1]
- movs r1, 0xA0
- lsls r1, 19
- ldr r2, _0800D13C
- adds r0, r2, 0
- strh r0, [r1]
- ldr r2, _0800D140
- ldrh r0, [r2]
- ldr r1, _0800D144
- cmp r0, r1
- beq _0800D0D0
-_0800D0CA:
- ldrh r0, [r2]
- cmp r0, r1
- bne _0800D0CA
-_0800D0D0:
- ldr r6, _0800D148
- movs r0, 0
- mov r8, r0
- strh r0, [r6]
- ldr r5, _0800D14C
- ldrh r4, [r5]
- movs r1, 0xC0
- lsls r1, 6
- adds r0, r1, 0
- strh r0, [r5]
- ldr r2, _0800D150
- mov r10, r2
- ldr r1, _0800D154
- adds r0, r1, 0
- strh r0, [r2]
- movs r2, 0x1
- mov r9, r2
- strh r2, [r6]
- bl SoundBiasReset
- swi 0x3
- bl SoundBiasSet
- mov r0, r8
- strh r0, [r6]
- strh r4, [r5]
- mov r1, r10
- strh r0, [r1]
- mov r2, r9
- strh r2, [r6]
- ldr r1, _0800D138
-_0800D10E:
- ldrh r0, [r1]
- cmp r0, 0x9F
- bls _0800D10E
- movs r0, 0x80
- lsls r0, 19
- strh r7, [r0]
- ldr r2, _0800D140
- ldrh r0, [r2]
- ldr r1, _0800D144
- cmp r0, r1
- beq _0800D12A
-_0800D124:
- ldrh r0, [r2]
- cmp r0, r1
- bne _0800D124
-_0800D12A:
- pop {r3-r5}
- mov r8, r3
- mov r9, r4
- mov r10, r5
- pop {r4-r7}
- pop {r0}
- bx r0
- .align 2, 0
-_0800D138: .4byte 0x04000006
-_0800D13C: .4byte 0x0000efff
-_0800D140: .4byte 0x04000130
-_0800D144: .4byte 0x000003ff
-_0800D148: .4byte 0x04000208
-_0800D14C: .4byte 0x04000200
-_0800D150: .4byte 0x04000132
-_0800D154: .4byte 0x0000c304
- thumb_func_end sub_800D098
thumb_func_start sub_800D158
sub_800D158:
diff --git a/asm/code_809D148.s b/asm/code_809D148.s
index 75bec2b..5571ce2 100644
--- a/asm/code_809D148.s
+++ b/asm/code_809D148.s
@@ -5,20 +5,6 @@
.text
- thumb_func_start sub_809D248
-sub_809D248:
- ldr r3, _0809D258
- ldr r1, [r3, 0x3C]
- ldr r2, [r3, 0x40]
- str r1, [r0]
- str r2, [r0, 0x4]
- adds r3, 0x44
- ldrb r0, [r3]
- bx lr
- .align 2, 0
-_0809D258: .4byte gUnknown_20399E8
- thumb_func_end sub_809D248
-
thumb_func_start sub_809D25C
sub_809D25C:
push {r4-r6,lr}
diff --git a/data/data_80F4278.s b/data/data_80F4278.s
index 9508167..e2333d9 100644
--- a/data/data_80F4278.s
+++ b/data/data_80F4278.s
@@ -1280,137 +1280,206 @@ gUnknown_80F60DC: @ 80F60DC
.global gUnknown_80F60F8
gUnknown_80F60F8: @ 80F60F8
- .incbin "baserom.gba", 0xF60F8, 0x8
+@ replacing .incbin "baserom.gba", 0x000f60f8, 0x8
+ .asciz "banrpal"
.global gUnknown_80F6100
gUnknown_80F6100: @ 80F6100
- .incbin "baserom.gba", 0xF6100, 0x8
+@ replacing .incbin "baserom.gba", 0x000f6100, 0x8
+ .asciz "banfont"
.global gUnknown_80F6108
gUnknown_80F6108: @ 80F6108
- .incbin "baserom.gba", 0xF6108, 0x4
+@ replacing .incbin "baserom.gba", 0x000f6108, 0x4
+.byte 0x23, 0x00, 0x00, 0x00
.global gUnknown_80F610C
gUnknown_80F610C: @ 80F610C
- .incbin "baserom.gba", 0xF610C, 0x4
+@ replacing .incbin "baserom.gba", 0x000f610c, 0x4
+.byte 0x42, 0x00, 0x00, 0x00
.global gUnknown_80F6110
gUnknown_80F6110: @ 80F6110
- .incbin "baserom.gba", 0xF6110, 0x8
+@ replacing .incbin "baserom.gba", 0x000f6110, 0x8
+.byte 0x25, 0x73, 0x25, 0x63, 0x25, 0x63, 0x46, 0x00
.global gUnknown_80F6118
gUnknown_80F6118: @ 80F6118
- .incbin "baserom.gba", 0xF6118, 0x8
+@ replacing .incbin "baserom.gba", 0x000f6118, 0x8
+.byte 0x25, 0x73, 0x25, 0x63, 0x46, 0x00, 0x00, 0x00
.global gUnknown_80F6120
gUnknown_80F6120: @ 80F6120
- .incbin "baserom.gba", 0xF6120, 0x88
+@ replacing .incbin "baserom.gba", 0x000f6120, 0x88
+.byte 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0xf0, 0x04, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00
+.byte 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x0c, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00
+.byte 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x14, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00
+.byte 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x18, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x1c, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00
+.asciz "pksdir0"
.global gUnknown_80F61A8
gUnknown_80F61A8: @ 80F61A8
- .incbin "baserom.gba", 0xF61A8, 0x8
+@ replacing .incbin "baserom.gba", 0x000f61a8, 0x8
+ .asciz "itempat"
.global gUnknown_80F61B0
gUnknown_80F61B0: @ 80F61B0
- .incbin "baserom.gba", 0xF61B0, 0x8
+@ replacing .incbin "baserom.gba", 0x000f61b0, 0x8
+ .asciz "etcfont"
.global gUnknown_80F61B8
gUnknown_80F61B8: @ 80F61B8
- .incbin "baserom.gba", 0xF61B8, 0xC
+@ replacing .incbin "baserom.gba", 0x000f61b8, 0xc
+ .asciz "etcfonta"
+ .align 2,0
.global gUnknown_80F61C4
gUnknown_80F61C4: @ 80F61C4
- .incbin "baserom.gba", 0xF61C4, 0x8
+@ replacing .incbin "baserom.gba", 0x000f61c4, 0x8
+ .asciz "levfont"
.global gUnknown_80F61CC
gUnknown_80F61CC: @ 80F61CC
- .incbin "baserom.gba", 0xF61CC, 0x8
+@ replacing .incbin "baserom.gba", 0x000f61cc, 0x8
+ .asciz "hp5font"
.global gUnknown_80F61D4
gUnknown_80F61D4: @ 80F61D4
- .incbin "baserom.gba", 0xF61D4, 0x8
+@ replacing .incbin "baserom.gba", 0x000f61d4, 0x8
+.byte 0x63, 0x6f, 0x6c, 0x76, 0x65, 0x63, 0x00, 0x00
.global gUnknown_80F61DC
gUnknown_80F61DC: @ 80F61DC
- .incbin "baserom.gba", 0xF61DC, 0x10
+@ replacing .incbin "baserom.gba", 0x000f61dc, 0x10
+.byte 0x74, 0x72, 0x61, 0x70, 0x70, 0x61, 0x74, 0x00
+.asciz "pksdir0"
.global gUnknown_80F61EC
gUnknown_80F61EC: @ 80F61EC
- .incbin "baserom.gba", 0xF61EC, 0x30
+@ replacing .incbin "baserom.gba", 0x000f61ec, 0x30
+ .byte 0xfc, 0xff, 0xfc, 0xff, 0xf8, 0xff, 0xfc, 0xff, 0xf0, 0xff, 0xfc, 0xff, 0xf0, 0xff, 0xfc, 0xff, 0xf0, 0xff, 0xfc, 0xff, 0xf0, 0xff, 0xfc, 0xff, 0xfc, 0xff, 0xfc, 0xff, 0xf8, 0xff, 0xfc, 0xff
+ .byte 0xf0, 0xff, 0xf8, 0xff, 0xf0, 0xff, 0xf8, 0xff, 0xf0, 0xff, 0xf8, 0xff, 0xf0, 0xff, 0xf8, 0xff
.global gUnknown_80F621C
gUnknown_80F621C: @ 80F621C
- .incbin "baserom.gba", 0xF621C, 0x8
+@ replacing .incbin "baserom.gba", 0x000f621c, 0x8
+ .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.global gUnknown_80F6224
gUnknown_80F6224: @ 80F6224
- .incbin "baserom.gba", 0xF6224, 0x88
+@ replacing .incbin "baserom.gba", 0x000f6224, 0x88
+ .byte 0x00, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00
+ .byte 0x01, 0x00, 0x00, 0x00, 0x23, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x23, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x23, 0x02, 0x00, 0x00
+ .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00
+ .byte 0x0a, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2a, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2a, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00
+ .byte 0x02, 0x00, 0x00, 0x00, 0x2a, 0x02, 0x00, 0x00
.global gUnknown_80F62AC
gUnknown_80F62AC: @ 80F62AC
- .incbin "baserom.gba", 0xF62AC, 0x4
+@ replacing .incbin "baserom.gba", 0x000f62ac, 0x4
+.byte 0x00, 0x00, 0x00, 0x00
.global gUnknown_80F62B0
gUnknown_80F62B0: @ 80F62B0
- .incbin "baserom.gba", 0xF62B0, 0x60
+@ replacing .incbin "baserom.gba", 0x000f62b0, 0x60
+.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0f, 0x00, 0x1a, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00
+.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.global gUnknown_80F6310
gUnknown_80F6310: @ 80F6310
- .incbin "baserom.gba", 0xF6310, 0x60
+@ replacing .incbin "baserom.gba", 0x000f6310, 0x60
+.byte 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x03, 0x00, 0x06, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00
+.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.global gUnknown_80F6370
gUnknown_80F6370: @ 80F6370
- .incbin "baserom.gba", 0xF6370, 0x60
+@ replacing .incbin "baserom.gba", 0x000f6370, 0x60
+.byte 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x03, 0x00, 0x06, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00
+.byte 0x0a, 0x00, 0x04, 0x00, 0x11, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0d, 0x00, 0x1a, 0x00, 0x06, 0x00
+.byte 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.global gUnknown_80F63D0
gUnknown_80F63D0: @ 80F63D0
- .incbin "baserom.gba", 0xF63D0, 0x60
+@ replacing .incbin "baserom.gba", 0x000f63d0, 0x60
+.byte 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x03, 0x00, 0x1a, 0x00, 0x0e, 0x00, 0x12, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00
+.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.global gUnknown_80F6430
gUnknown_80F6430: @ 80F6430
- .incbin "baserom.gba", 0xF6430, 0x48
+@ replacing .incbin "baserom.gba", 0x000f6430, 0x48
+.byte 0x84, 0x03, 0x00, 0x00, 0x20, 0x03, 0x00, 0x00, 0xbc, 0x02, 0x00, 0x00, 0x58, 0x02, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x90, 0x01, 0x00, 0x00, 0x2c, 0x01, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00
+.byte 0x64, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00
+.byte 0x14, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00
.global gUnknown_80F6478
gUnknown_80F6478: @ 80F6478
- .incbin "baserom.gba", 0xF6478, 0x18
+@ replacing .incbin "baserom.gba", 0x000f6478, 0x18
+.byte 0x0d, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00
+.asciz "pksdir0"
.global gUnknown_80F6490
gUnknown_80F6490: @ 80F6490
- .incbin "baserom.gba", 0xF6490, 0x24
+@ replacing .incbin "baserom.gba", 0x000f6490, 0x24
+ .byte 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x0f, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x0f
+ .byte 0xff, 0xff, 0xff, 0xff
.global gUnknown_80F64B4
gUnknown_80F64B4: @ 80F64B4
- .incbin "baserom.gba", 0xF64B4, 0x24
+@ replacing .incbin "baserom.gba", 0x000f64b4, 0x24
+ .byte 0x5a, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00
+ .byte 0x0a, 0x00, 0x00, 0x00
.global gUnknown_80F64D8
gUnknown_80F64D8: @ 80F64D8
- .incbin "baserom.gba", 0xF64D8, 0x24
+@ replacing .incbin "baserom.gba", 0x000f64d8, 0x24
+ .byte 0x91, 0xf2, 0x90, 0xf2, 0x8f, 0xf2, 0x8e, 0xf2, 0x8d, 0xf2, 0x8c, 0xf2, 0x8b, 0xf2, 0x8a, 0xf2, 0x89, 0xf2, 0xc8, 0xf2, 0xc7, 0xf2, 0xc6, 0xf2, 0xc5, 0xf2, 0xc4, 0xf2, 0xc3, 0xf2, 0xc2, 0xf2
+ .byte 0xc1, 0xf2, 0xc0, 0xf2
.global gUnknown_80F64FC
gUnknown_80F64FC: @ 80F64FC
- .incbin "baserom.gba", 0xF64FC, 0x24
+@ replacing .incbin "baserom.gba", 0x000f64fc, 0x24
+ .byte 0x84, 0x03, 0x00, 0x00, 0x20, 0x03, 0x00, 0x00, 0xbc, 0x02, 0x00, 0x00, 0x58, 0x02, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x90, 0x01, 0x00, 0x00, 0x2c, 0x01, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00
+ .byte 0x64, 0x00, 0x00, 0x00
.global gUnknown_80F6520
gUnknown_80F6520: @ 80F6520
- .incbin "baserom.gba", 0xF6520, 0x24
+@ replacing .incbin "baserom.gba", 0x000f6520, 0x24
+.byte 0x5a, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00
+.byte 0x0a, 0x00, 0x00, 0x00
.global gUnknown_80F6544
gUnknown_80F6544: @ 80F6544
- .incbin "baserom.gba", 0xF6544, 0x24
+@ replacing .incbin "baserom.gba", 0x000f6544, 0x24
+ .byte 0x91, 0xf2, 0x90, 0xf2, 0x8f, 0xf2, 0x8e, 0xf2, 0x8d, 0xf2, 0x8c, 0xf2, 0x8b, 0xf2, 0x8a, 0xf2, 0x89, 0xf2, 0xc8, 0xf2, 0xc7, 0xf2, 0xc6, 0xf2, 0xc5, 0xf2, 0xc4, 0xf2, 0xc3, 0xf2, 0xc2, 0xf2
+ .byte 0xc1, 0xf2, 0xc0, 0xf2
.global gUnknown_80F6568
gUnknown_80F6568: @ 80F6568
- .incbin "baserom.gba", 0xF6568, 0x88
+@ replacing .incbin "baserom.gba", 0x000f6568, 0x88
+ .byte 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff
+ .byte 0x01, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x02, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x02, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x02, 0x00, 0x00, 0x00, 0xfd, 0xff, 0xff, 0xff
+ .byte 0x03, 0x00, 0x00, 0x00, 0xfd, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0xfd, 0xff, 0xff, 0xff, 0x04, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x04, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff
+ .byte 0x04, 0x00, 0x00, 0x00, 0xfb, 0xff, 0xff, 0xff, 0x04, 0x00, 0x00, 0x00, 0xfb, 0xff, 0xff, 0xff, 0x04, 0x00, 0x00, 0x00, 0xfb, 0xff, 0xff, 0xff, 0x04, 0x00, 0x00, 0x00, 0xfb, 0xff, 0xff, 0xff
+ .byte 0x70, 0x6b, 0x73, 0x64, 0x69, 0x72, 0x30, 0x00
.global gUnknown_80F65F0
gUnknown_80F65F0: @ 80F65F0
- .incbin "baserom.gba", 0xF65F0, 0x14
+@ replacing .incbin "baserom.gba", 0x000f65f0, 0x14
+ .byte 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x07, 0x04, 0x04
.global gUnknown_80F6604
gUnknown_80F6604: @ 80F6604
- .incbin "baserom.gba", 0xF6604, 0x20
+@ replacing .incbin "baserom.gba", 0x000f6604, 0x20
+ .asciz "zmappat"
+ .asciz "pksdir0"
+ .asciz "pksdir0"
+ .asciz "pksdir0"
- .global gUnknown_80F6624
+
+ .global gUnknown_80F6624
gUnknown_80F6624: @ 80F6624
.incbin "baserom.gba", 0xF6624, 0x78
@@ -1620,7 +1689,9 @@ gTrapDescriptions: @ 80F8130
.global gUnknown_80F8968
gUnknown_80F8968: @ 80F8968
- .incbin "baserom.gba", 0xF8968, 0xC
+ .byte 0x5C, 0x89, 0x0F, 0x08
+ .asciz "Decoy"
+ .align 2,0
.global gUnknown_80F8974
gUnknown_80F8974: @ 80F8974
@@ -1680,27 +1751,39 @@ gUnknown_80F8ADC: @ 80F8ADC
.global gUnknown_80F8B0C
gUnknown_80F8B0C: @ 80F8B0C
- .incbin "baserom.gba", 0xF8B0C, 0x18
+ .byte 0xE0, 0x8A, 0x0F, 0x08
+ .asciz "There are no items."
.global gUnknown_80F8B24
gUnknown_80F8B24: @ 80F8B24
- .incbin "baserom.gba", 0xF8B24, 0x1C
+ .byte 0x10, 0x8B, 0x0F, 0x08
+ .asciz "The move $i0 was set."
+ .align 2,0
.global gUnknown_80F8B40
gUnknown_80F8B40: @ 80F8B40
- .incbin "baserom.gba", 0xF8B40, 0x24
+ .byte 0x28, 0x8B, 0x0F, 0x08
+ .asciz "The move $i0 was deselected."
+ .align 2,0
.global gUnknown_80F8B64
gUnknown_80F8B64: @ 80F8B64
- .incbin "baserom.gba", 0xF8B64, 0x24
+ .byte 0x44, 0x8B, 0x0F, 0x08
+ .byte 0x20, 0x7F, 0x0F, 0x08
+ .asciz "The move $i0 was delinked."
+ .align 2,0
.global gUnknown_80F8B88
gUnknown_80F8B88: @ 80F8B88
- .incbin "baserom.gba", 0xF8B88, 0x2C
+ .byte 0x6C, 0x8B, 0x0F, 0x08
+ .asciz "The linked moves were left unchanged."
+ .align 2,0
.global gUnknown_80F8BB4
gUnknown_80F8BB4: @ 80F8BB4
- .incbin "baserom.gba", 0xF8BB4, 0x2C
+ .byte 0x8C, 0x8B, 0x0F, 0x08
+ .asciz "It~27s all sticky and doesn~27t work!"
+ .align 2,0
.global gUnknown_80F8BE0
gUnknown_80F8BE0: @ 80F8BE0
@@ -1708,19 +1791,24 @@ gUnknown_80F8BE0: @ 80F8BE0
.global gUnknown_80F8C40
gUnknown_80F8C40: @ 80F8C40
- .incbin "baserom.gba", 0xF8C40, 0x4
+ .byte 0x14, 0x8C, 0x0F, 0x08
.global gUnknown_80F8C44
gUnknown_80F8C44: @ 80F8C44
- .incbin "baserom.gba", 0xF8C44, 0x4
+ .byte 0x14, 0x8C, 0x0F, 0x08
.global gUnknown_80F8C48
gUnknown_80F8C48: @ 80F8C48
- .incbin "baserom.gba", 0xF8C48, 0x34
+ .byte 0x14, 0x8C, 0x0F, 0x08
+ .asciz "The $i0 is all sticky!\nIt can~27t be equipped."
+ .align 2,0
.global gUnknown_80F8C7C
gUnknown_80F8C7C: @ 80F8C7C
- .incbin "baserom.gba", 0xF8C7C, 0x2C
+ .byte 0x4C, 0x8C, 0x0F, 0x08
+ .string "$m1 took the $i0\n"
+ .asciz "and returned the $i1."
+ .align 2,0
.global gUnknown_80F8CA8
gUnknown_80F8CA8: @ 80F8CA8
@@ -1728,23 +1816,31 @@ gUnknown_80F8CA8: @ 80F8CA8
.global gUnknown_80F8CE4
gUnknown_80F8CE4: @ 80F8CE4
- .incbin "baserom.gba", 0xF8CE4, 0x4
+ .byte 0xAC, 0x8C, 0x0F, 0x08
.global gUnknown_80F8CE8
gUnknown_80F8CE8: @ 80F8CE8
- .incbin "baserom.gba", 0xF8CE8, 0x1C
+ .byte 0xAC, 0x8C, 0x0F, 0x08
+ .asciz "Equipped the item $i0."
+ .align 2,0
.global gUnknown_80F8D04
gUnknown_80F8D04: @ 80F8D04
- .incbin "baserom.gba", 0xF8D04, 0x1C
+ .byte 0xEC, 0x8C, 0x0F, 0x08
+ .asciz "The $i0 was deselected."
.global gUnknown_80F8D20
gUnknown_80F8D20: @ 80F8D20
- .incbin "baserom.gba", 0xF8D20, 0x24
+ .byte 0x08, 0x8D, 0x0F, 0x08
+ .string "The item $i0 was given\n"
+ .asciz "to $m1."
+ .align 2,0
.global gUnknown_80F8D44
gUnknown_80F8D44: @ 80F8D44
- .incbin "baserom.gba", 0xF8D44, 0x1C
+ .byte 0x24, 0x8D, 0x0F, 0x08
+ .asciz "The Toolbox is full."
+ .align 2,0
.global gUnknown_80F8D60
gUnknown_80F8D60: @ 80F8D60
diff --git a/ld_script.txt b/ld_script.txt
index 19f31e4..c51eb2d 100755
--- a/ld_script.txt
+++ b/ld_script.txt
@@ -77,6 +77,7 @@ SECTIONS {
src/code_800C9CC.o(.text);
asm/code_800C9CC.o(.text);
src/flash.o(.text);
+ src/code_800D090.o(.text);
asm/code_800D090.o(.text);
src/code_80118A4.o(.text);
asm/code_80118A4.o(.text);
diff --git a/src/code_800D090.c b/src/code_800D090.c
new file mode 100644
index 0000000..1031a2d
--- /dev/null
+++ b/src/code_800D090.c
@@ -0,0 +1,65 @@
+#include "global.h"
+
+extern void SoundBiasReset(void);
+extern void SoundBiasSet(void);
+
+void Hang(void)
+{
+ while(1)
+ {
+ asm("swi 0x2");
+ }
+}
+
+
+// Unused
+void sub_800D098(void)
+{
+ u32 dispcnt_save;
+ u32 ie_store;
+
+ while(REG_VCOUNT <= 159)
+ ;
+
+ // Save DISPCNT and set to 0
+ dispcnt_save = REG_DISPCNT;
+ REG_DISPCNT = 0;
+
+ *(u16 *)BG_PLTT = 0xefff;
+
+ while(REG_KEYINPUT != 0x3ff) // 0011 1111 1111 (all buttons)
+ ;
+
+
+ REG_IME = 0;
+
+ // Save IE Register
+ ie_store = REG_IE;
+ REG_IE = INTR_FLAG_KEYPAD | INTR_FLAG_GAMEPAK;
+
+ REG_KEYCNT = 0xC304; // TODO 1100 0011 0000 0100
+ // Select:
+ // * Select button
+ // * L/R Button
+ // Enable IRQ
+ // Logical AND
+ // So do something when all buttons above are pressed
+
+ REG_IME = 1;
+
+ SoundBiasReset();
+ asm("swi 0x3");
+ SoundBiasSet();
+
+ REG_IME = 0;
+
+ REG_IE = ie_store; // restore IE
+ REG_KEYCNT = 0; // reset KEYCNT
+
+ REG_IME = 1;
+
+ // Good after here
+ while(REG_VCOUNT <= 159){}
+ REG_DISPCNT = dispcnt_save; // restore DISPCNT
+ while(REG_KEYINPUT != 0x3ff){} // All buttons
+}
diff --git a/src/code_801D760.c b/src/code_801D760.c
index e2e6617..c2266ec 100644
--- a/src/code_801D760.c
+++ b/src/code_801D760.c
@@ -1,26 +1,26 @@
#include "global.h"
+extern u32 sub_801BF48(void);
+extern void sub_801BF98(void);
+extern void sub_801D208(u8);
+extern u32 sub_801DCE8(void);
+extern void sub_801DD50(void);
+extern u32 sub_80217EC(void);
+extern void sub_8021830(void);
extern u32 sub_8022860();
extern void sub_8022908();
-extern void sub_801D208(u8);
-extern void sub_8027168();
-extern u32 sub_80270A4();
-extern u32 sub_8025F68();
-extern u8 sub_802604C();
-extern void sub_8026058();
+extern u32 sub_80244E4(void);
+extern void sub_802453C(void);
extern u32 sub_8025354(void);
extern u8 sub_802540C(void);
extern void sub_8025418(void);
-extern u32 sub_80244E4(void);
-extern void sub_802453C(void);
-extern u32 sub_801BF48(void);
-extern void sub_801BF98(void);
-extern u32 sub_80217EC(void);
-extern void sub_8021830(void);
+extern u32 sub_8025F68();
+extern u8 sub_802604C();
+extern void sub_8026058();
+extern void sub_8027168();
+extern u32 sub_80270A4();
extern u32 sub_802C898(void);
extern void sub_802C8F4(void);
-extern u32 sub_801DCE8(void);
-extern void sub_801DD50(void);
struct unk_203B250
{
diff --git a/src/code_809D148.c b/src/code_809D148.c
index 965ca12..5d3c908 100644
--- a/src/code_809D148.c
+++ b/src/code_809D148.c
@@ -18,6 +18,9 @@ struct unkStruct_20399E8
u32 unk30;
u32 unk34;
u32 unk38;
+ u32 unk3C;
+ u32 unk40;
+ u8 unk44;
};
struct unkStruct_809D158
@@ -264,14 +267,31 @@ u32 sub_809D234(void)
}
// TODO regswap but matches otherwise
-//u8 sub_809D248(struct unkStruct_809D158 *r0)
-//{
-// u32 temp;
-// u32 temp1;
-//
-// temp = gUnknown_20399E8.unk3C;
-// temp1 = gUnknown_20399E8.unk40;
-// r0->unk0 = temp;
-// r0->unk4 = temp1;
-// return gUnknown_20399E8.unk44;
-//}
+// Loads struct into R1... should be R3
+#ifndef NONMATCHING
+NAKED
+#endif
+u8 sub_809D248(struct unkStruct_809D158 *r0)
+{
+#ifdef NONMATCHING
+ u32 temp;
+ u32 temp1;
+
+ temp = gUnknown_20399E8.unk3C;
+ temp1 = gUnknown_20399E8.unk40;
+ r0->unk0 = temp;
+ r0->unk4 = temp1;
+ return gUnknown_20399E8.unk44;
+#else
+ asm_unified("\tldr r3, _0809D258\n"
+ "\tldr r1, [r3, 0x3C]\n"
+ "\tldr r2, [r3, 0x40]\n"
+ "\tstr r1, [r0]\n"
+ "\tstr r2, [r0, 0x4]\n"
+ "\tadds r3, 0x44\n"
+ "\tldrb r0, [r3]\n"
+ "\tbx lr\n"
+ "\t.align 2, 0\n"
+"_0809D258: .4byte gUnknown_20399E8");
+#endif
+}