This commit is contained in:
Seth Barberee 2021-01-07 16:10:24 -06:00
parent 469212f7ee
commit ec192a8fa8
33 changed files with 821 additions and 1278 deletions

View File

@ -429,226 +429,4 @@ _0800BA54: .4byte gUnknown_202D648
_0800BA58: .4byte 0x04000004
thumb_func_end VCountIntr
thumb_func_start sub_800BA5C
sub_800BA5C:
push {r4,lr}
ldr r4, _0800BAA4
ldrb r0, [r4]
cmp r0, 0
beq _0800BA72
ldr r1, _0800BAA8
ldr r0, [r1]
adds r0, 0x1
str r0, [r1]
bl xxx_update_bg_sound_input
_0800BA72:
movs r0, 0x1
strb r0, [r4]
ldr r1, _0800BAAC
movs r0, 0
strb r0, [r1]
ldr r1, _0800BAA8
movs r0, 0
str r0, [r1]
bl nullsub_25
ldr r1, _0800BAB0
_0800BA88:
ldrh r0, [r1]
cmp r0, 0x9F
bhi _0800BA88
ldr r1, _0800BAB4
movs r0, 0x1
strb r0, [r1]
bl VBlankIntrWait
bl nullsub_18
pop {r4}
pop {r0}
bx r0
.align 2, 0
_0800BAA4: .4byte gUnknown_203B09A
_0800BAA8: .4byte gUnknown_203B09C
_0800BAAC: .4byte gUnknown_203B09B
_0800BAB0: .4byte 0x04000006
_0800BAB4: .4byte gUnknown_203B099
thumb_func_end sub_800BA5C
thumb_func_start xxx_update_bg_sound_input
xxx_update_bg_sound_input:
push {r4,r5,lr}
ldr r1, _0800BACC
ldrb r4, [r1]
cmp r4, 0
beq _0800BAD4
ldr r1, _0800BAD0
ldr r0, [r1]
adds r0, 0x1
str r0, [r1]
b _0800BAFE
.align 2, 0
_0800BACC: .4byte gUnknown_203B09B
_0800BAD0: .4byte gUnknown_203B09C
_0800BAD4:
movs r0, 0x1
strb r0, [r1]
ldr r0, _0800BB04
strb r4, [r0]
ldr r0, _0800BB08
str r4, [r0]
bl UpdateBGControlRegisters
ldr r5, _0800BB0C
ldrb r0, [r5]
cmp r0, 0
beq _0800BAF0
bl UpdateSound
_0800BAF0:
bl UpdateInput
strb r4, [r5]
ldr r0, _0800BB10
ldr r1, _0800BB14
ldr r1, [r1]
str r1, [r0]
_0800BAFE:
pop {r4,r5}
pop {r0}
bx r0
.align 2, 0
_0800BB04: .4byte gUnknown_203B09A
_0800BB08: .4byte gUnknown_203B09C
_0800BB0C: .4byte gUnknown_203B099
_0800BB10: .4byte gUnknown_203B0A4
_0800BB14: .4byte gUnknown_203B0A0
thumb_func_end xxx_update_bg_sound_input
thumb_func_start Timer3Intr
Timer3Intr:
push {lr}
ldr r0, _0800BB30
ldr r0, [r0, 0x10]
cmp r0, 0
beq _0800BB26
bl _call_via_r0
_0800BB26:
movs r0, 0x40
bl SetInterruptFlag
pop {r0}
bx r0
.align 2, 0
_0800BB30: .4byte gUnknown_202D5F0
thumb_func_end Timer3Intr
thumb_func_start sub_800BB34
sub_800BB34:
ldr r0, _0800BB3C
ldr r0, [r0]
bx lr
.align 2, 0
_0800BB3C: .4byte gUnknown_203B0A0
thumb_func_end sub_800BB34
thumb_func_start nullsub_178
nullsub_178:
bx lr
thumb_func_end nullsub_178
thumb_func_start sub_800BB44
sub_800BB44:
push {r4-r7,lr}
mov r7, r10
mov r6, r9
mov r5, r8
push {r5-r7}
sub sp, 0x4
ldr r2, _0800BBF0
ldrh r0, [r2]
ldr r1, _0800BBF4
cmp r0, r1
beq _0800BB60
_0800BB5A:
ldrh r0, [r2]
cmp r0, r1
bne _0800BB5A
_0800BB60:
bl DisableInterrupts
lsls r0, 24
lsrs r0, 24
str r0, [sp]
ldr r1, _0800BBF8
_0800BB6C:
ldrh r0, [r1]
cmp r0, 0x9F
bls _0800BB6C
movs r0, 0x80
lsls r0, 19
mov r9, r0
ldrh r1, [r0]
mov r8, r1
movs r0, 0x80
mov r2, r9
strh r0, [r2]
movs r7, 0xA0
lsls r7, 19
ldr r1, _0800BBFC
adds r0, r1, 0
strh r0, [r7]
ldr r5, _0800BC00
ldrh r4, [r5]
movs r2, 0xC0
lsls r2, 6
adds r0, r2, 0
strh r0, [r5]
ldr r0, _0800BC04
mov r10, r0
ldr r1, _0800BC08
adds r0, r1, 0
mov r2, r10
strh r0, [r2]
ldr r6, _0800BC0C
movs r0, 0x1
strh r0, [r6]
bl SoundBiasReset
swi 0x3
bl SoundBiasSet
movs r0, 0
strh r0, [r6]
strh r4, [r5]
mov r1, r10
strh r0, [r1]
mov r1, r8
mov r2, r9
strh r1, [r2]
strh r0, [r7]
ldr r2, [sp]
cmp r2, 0
beq _0800BBD0
bl EnableInterrupts
_0800BBD0:
ldr r2, _0800BBF0
ldrh r0, [r2]
ldr r1, _0800BBF4
cmp r0, r1
beq _0800BBE0
_0800BBDA:
ldrh r0, [r2]
cmp r0, r1
bne _0800BBDA
_0800BBE0:
add sp, 0x4
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r0}
bx r0
.align 2, 0
_0800BBF0: .4byte 0x04000130
_0800BBF4: .4byte 0x000003ff
_0800BBF8: .4byte 0x04000006
_0800BBFC: .4byte 0x00007fff
_0800BC00: .4byte 0x04000200
_0800BC04: .4byte 0x04000132
_0800BC08: .4byte 0x00008304
_0800BC0C: .4byte 0x04000208
thumb_func_end sub_800BB44
.align 2, 0 @ Don't pad with nop.

View File

@ -5,178 +5,6 @@
.text
thumb_func_start GetKeyPress
GetKeyPress:
push {lr}
adds r1, r0, 0
cmp r1, 0
beq _08012ADE
adds r0, 0x29
ldrb r0, [r0]
cmp r0, 0
beq _08012AB4
movs r0, 0x1
b _08012AE2
_08012AB4:
adds r0, r1, 0
adds r0, 0x2A
ldrb r0, [r0]
cmp r0, 0
beq _08012AC2
movs r0, 0x2
b _08012AE2
_08012AC2:
adds r0, r1, 0
adds r0, 0x2C
ldrb r0, [r0]
cmp r0, 0
beq _08012AD0
movs r0, 0x9
b _08012AE2
_08012AD0:
adds r0, r1, 0
adds r0, 0x2B
ldrb r0, [r0]
cmp r0, 0
beq _08012ADE
movs r0, 0xA
b _08012AE2
_08012ADE:
bl sub_8012AE8
_08012AE2:
pop {r1}
bx r1
thumb_func_end GetKeyPress
thumb_func_start sub_8012AE8
sub_8012AE8:
push {lr}
ldr r2, _08012B08
ldrh r1, [r2]
movs r3, 0x80
lsls r3, 1
adds r0, r3, 0
ands r0, r1
cmp r0, 0
beq _08012B4A
ldrh r1, [r2, 0x2]
movs r0, 0x1
ands r0, r1
cmp r0, 0
beq _08012B0C
movs r0, 0xB
b _08012BBE
.align 2, 0
_08012B08: .4byte gRealInputs
_08012B0C:
ldrh r1, [r2, 0x4]
movs r0, 0x40
ands r0, r1
cmp r0, 0
beq _08012B1A
movs r0, 0xC
b _08012BBE
_08012B1A:
movs r0, 0x80
ands r0, r1
cmp r0, 0
beq _08012B26
movs r0, 0xD
b _08012BBE
_08012B26:
movs r0, 0x20
ands r0, r1
cmp r0, 0
beq _08012B32
movs r0, 0xE
b _08012BBE
_08012B32:
movs r0, 0x10
ands r0, r1
cmp r0, 0
beq _08012B3E
movs r0, 0xF
b _08012BBE
_08012B3E:
adds r0, r3, 0
ands r0, r1
cmp r0, 0
beq _08012BBC
movs r0, 0x6
b _08012BBE
_08012B4A:
ldrh r1, [r2, 0x2]
movs r0, 0x1
ands r0, r1
cmp r0, 0
beq _08012B58
movs r0, 0x1
b _08012BBE
_08012B58:
movs r0, 0x2
ands r0, r1
cmp r0, 0
beq _08012B64
movs r0, 0x2
b _08012BBE
_08012B64:
movs r0, 0x4
ands r0, r1
cmp r0, 0
beq _08012B70
movs r0, 0x3
b _08012BBE
_08012B70:
movs r0, 0x8
ands r0, r1
cmp r0, 0
beq _08012B7C
movs r0, 0x4
b _08012BBE
_08012B7C:
ldrh r1, [r2, 0x4]
movs r0, 0x40
ands r0, r1
cmp r0, 0
beq _08012B8A
movs r0, 0x7
b _08012BBE
_08012B8A:
movs r0, 0x80
ands r0, r1
cmp r0, 0
beq _08012B96
movs r0, 0x8
b _08012BBE
_08012B96:
movs r0, 0x20
ands r0, r1
cmp r0, 0
beq _08012BA2
movs r0, 0x9
b _08012BBE
_08012BA2:
movs r0, 0x10
ands r0, r1
cmp r0, 0
beq _08012BAE
movs r0, 0xA
b _08012BBE
_08012BAE:
movs r0, 0x80
lsls r0, 2
ands r0, r1
cmp r0, 0
beq _08012BBC
movs r0, 0x5
b _08012BBE
_08012BBC:
movs r0, 0
_08012BBE:
pop {r1}
bx r1
thumb_func_end sub_8012AE8
thumb_func_start sub_8012BC4
sub_8012BC4:
push {r4-r7,lr}

View File

@ -14300,7 +14300,7 @@ _080249F8:
str r0, [r1, 0x24]
movs r0, 0x8
movs r1, 0x3C
bl sub_8011900
bl xxx_call_fade_in_new_bgm
ldr r0, _08024A0C
ldr r3, _08024A10
b _08024CB0
@ -14620,7 +14620,7 @@ _08024C98: .4byte gUnknown_80DD0E0
_08024C9C:
movs r0, 0x8
movs r1, 0x3C
bl sub_8011900
bl xxx_call_fade_in_new_bgm
ldr r0, _08024CBC
ldr r1, [r0]
movs r0, 0x15

View File

@ -5,74 +5,6 @@
.text
thumb_func_start sub_80400D4
sub_80400D4:
push {r4,lr}
ldr r0, _08040114
ldr r4, [r0]
movs r0, 0xC1
lsls r0, 9
adds r3, r4, r0
ldr r0, [r3]
cmp r0, 0
beq _0804010C
cmp r0, 0x1E
ble _080400EC
movs r0, 0x1F
_080400EC:
ldr r1, _08040118
adds r2, r4, r1
ldr r1, _0804011C
lsls r0, 2
adds r0, r1
ldr r0, [r0]
str r0, [r2]
ldr r0, [r3]
subs r0, 0x1
str r0, [r3]
cmp r0, 0
bne _0804010C
ldr r1, _08040120
adds r0, r4, r1
ldr r0, [r0]
str r0, [r3]
_0804010C:
pop {r4}
pop {r0}
bx r0
.align 2, 0
_08040114: .4byte gUnknown_203B418
_08040118: .4byte 0x000181fc
_0804011C: .4byte gUnknown_80F6568
_08040120: .4byte 0x00018204
thumb_func_end sub_80400D4
thumb_func_start sub_8040124
sub_8040124:
ldr r1, _0804012C
movs r0, 0
strb r0, [r1]
bx lr
.align 2, 0
_0804012C: .4byte gUnknown_202EE01
thumb_func_end sub_8040124
thumb_func_start sub_8040130
sub_8040130:
push {lr}
ldr r0, _08040144
ldr r1, _08040148
bl OpenFileAndGetFileDataPtr
ldr r1, _0804014C
str r0, [r1]
pop {r0}
bx r0
.align 2, 0
_08040144: .4byte gUnknown_80F6604
_08040148: .4byte gUnknown_83B0000
_0804014C: .4byte gUnknown_202EE04
thumb_func_end sub_8040130
thumb_func_start sub_8040150
sub_8040150:
push {r4-r7,lr}

View File

@ -5,38 +5,6 @@
.text
thumb_func_start sub_80484E8
sub_80484E8:
push {r4,r5,lr}
adds r5, r0, 0
adds r4, r1, 0
ldr r0, [r4, 0x70]
adds r0, 0xAC
ldrb r0, [r0]
cmp r0, 0x1
bne _08048500
adds r0, r5, 0
bl sub_807A290
b _08048516
_08048500:
ldr r0, _0804851C
adds r1, r4, 0
movs r2, 0
bl sub_8045B94
ldr r0, _08048520
ldr r2, [r0]
adds r0, r5, 0
adds r1, r4, 0
bl sub_80522F4
_08048516:
pop {r4,r5}
pop {r0}
bx r0
.align 2, 0
_0804851C: .4byte gUnknown_202DF98
_08048520: .4byte gUnknown_80FB580
thumb_func_end sub_80484E8
thumb_func_start sub_8048524
sub_8048524:
push {r4-r6,lr}

View File

@ -100060,7 +100060,7 @@ sub_8083F14:
thumb_func_start sub_8083F24
sub_8083F24:
push {lr}
bl sub_800C068
bl GetCurrentBGSong
lsls r0, 16
lsrs r0, 16
pop {r1}
@ -100189,7 +100189,7 @@ _08084018:
beq _08084030
ldr r0, _0808402C
ands r0, r1
bl sub_800BDFC
bl StartNewBGM
b _0808403A
.align 2, 0
_0808402C: .4byte 0x00007fff
@ -115935,405 +115935,4 @@ sub_808C9B0:
bx r0
thumb_func_end sub_808C9B0
thumb_func_start sub_808C9C4
sub_808C9C4:
push {r4,r5,lr}
bl sub_8085480
adds r5, r0, 0
movs r0, 0x7
bl sub_8085680
adds r4, r0, 0
movs r0, 0x72
bl sub_8083E88
bl sub_80854D4
movs r0, 0x4
bl sub_8085930
ldr r0, _0808CA10
bl sub_80855E4
adds r0, r4, 0
movs r1, 0
bl sub_8085918
movs r1, 0x4
ldrsh r0, [r5, r1]
movs r2, 0x6
ldrsh r1, [r5, r2]
subs r1, 0x3
bl sub_8085860
ldr r0, _0808CA14
ldr r1, _0808CA18
bl sub_808D8BC
pop {r4,r5}
pop {r0}
bx r0
.align 2, 0
_0808CA10: .4byte sub_8086A3C
_0808CA14: .4byte gUnknown_202E038
_0808CA18: .4byte 0x0000014d
thumb_func_end sub_808C9C4
thumb_func_start sub_808CA1C
sub_808CA1C:
push {r4,r5,lr}
movs r0, 0x7
bl sub_8085680
adds r5, r0, 0
bl sub_808696C
movs r0, 0xA
movs r1, 0x46
bl sub_803E708
ldr r0, _0808CB44
bl sub_8052910
movs r0, 0xA
movs r1, 0x46
bl sub_803E708
adds r0, r5, 0
movs r1, 0x4
movs r2, 0x2
movs r3, 0x4
bl sub_80869E4
movs r0, 0xA
movs r1, 0x46
bl sub_803E708
ldr r0, _0808CB48
bl sub_8052910
movs r0, 0xA
movs r1, 0x46
bl sub_803E708
bl sub_8086448
bl sub_8086598
movs r0, 0x20
movs r1, 0x46
bl sub_803E708
adds r0, r5, 0
bl sub_80862BC
movs r0, 0x20
movs r1, 0x46
bl sub_803E708
adds r0, r5, 0
movs r1, 0x4
movs r2, 0x2
movs r3, 0
bl sub_80869E4
ldr r0, _0808CB4C
bl sub_8052910
movs r0, 0xA
movs r1, 0x46
bl sub_803E708
ldr r4, _0808CB50
adds r0, r4, 0
bl sub_8083E38
adds r0, r5, 0
movs r1, 0xA
movs r2, 0
bl sub_806CDD4
movs r0, 0x14
movs r1, 0x46
bl sub_803E708
adds r0, r5, 0
movs r1, 0
bl sub_806CE68
movs r0, 0x4
movs r1, 0x46
bl sub_803E708
adds r0, r4, 0
bl sub_8083E38
adds r0, r5, 0
movs r1, 0xA
movs r2, 0
bl sub_806CDD4
movs r0, 0x14
movs r1, 0x46
bl sub_803E708
ldr r0, _0808CB54
bl sub_8052910
movs r0, 0xA
movs r1, 0x46
bl sub_803E708
adds r0, r5, 0
movs r1, 0
movs r2, 0
bl sub_806CDD4
movs r4, 0x17
_0808CAF6:
adds r0, r5, 0
movs r1, 0
movs r2, 0x80
lsls r2, 1
bl sub_804539C
movs r0, 0x46
bl sub_803E46C
subs r4, 0x1
cmp r4, 0
bge _0808CAF6
adds r0, r5, 0
movs r1, 0
bl sub_806CE68
movs r0, 0x20
movs r1, 0x46
bl sub_803E708
adds r0, r5, 0
bl sub_8042B0C
movs r1, 0x87
lsls r1, 2
adds r0, r5, 0
movs r2, 0
bl sub_8068FE0
ldr r2, _0808CB58
ldr r1, [r2]
movs r0, 0x1
strb r0, [r1, 0x4]
ldr r1, [r2]
movs r0, 0x4
strb r0, [r1, 0x11]
pop {r4,r5}
pop {r0}
bx r0
.align 2, 0
_0808CB44: .4byte gUnknown_8106778
_0808CB48: .4byte gUnknown_81067BC
_0808CB4C: .4byte gUnknown_81067E0
_0808CB50: .4byte 0x000001c7
_0808CB54: .4byte gUnknown_8106834
_0808CB58: .4byte gUnknown_203B418
thumb_func_end sub_808CA1C
thumb_func_start sub_808CB5C
sub_808CB5C:
push {r4,r5,lr}
bl sub_8085480
adds r5, r0, 0
movs r0, 0x7
bl sub_8085680
adds r4, r0, 0
movs r0, 0x72
bl sub_8083E88
bl sub_80854D4
movs r0, 0x4
bl sub_8085930
movs r1, 0x87
lsls r1, 2
adds r0, r4, 0
movs r2, 0
bl sub_8068FE0
movs r1, 0x4
ldrsh r0, [r5, r1]
movs r2, 0x6
ldrsh r1, [r5, r2]
bl sub_8085860
ldr r0, _0808CBA4
ldr r1, _0808CBA8
bl sub_808D8BC
pop {r4,r5}
pop {r0}
bx r0
.align 2, 0
_0808CBA4: .4byte gUnknown_202E038
_0808CBA8: .4byte 0x0000014d
thumb_func_end sub_808CB5C
thumb_func_start nullsub_101
nullsub_101:
bx lr
thumb_func_end nullsub_101
thumb_func_start sub_808CBB0
sub_808CBB0:
push {r4,r5,lr}
bl sub_8085480
adds r5, r0, 0
movs r0, 0x1F
bl sub_8085680
adds r4, r0, 0
movs r0, 0x72
bl sub_8083E88
bl sub_80854D4
movs r0, 0x4
bl sub_8085930
ldr r0, _0808CBFC
bl sub_80855E4
adds r0, r4, 0
movs r1, 0
bl sub_8085918
movs r1, 0x4
ldrsh r0, [r5, r1]
movs r2, 0x6
ldrsh r1, [r5, r2]
subs r1, 0x3
bl sub_8085860
ldr r0, _0808CC00
movs r1, 0x82
lsls r1, 1
bl sub_808D8BC
pop {r4,r5}
pop {r0}
bx r0
.align 2, 0
_0808CBFC: .4byte sub_8086A3C
_0808CC00: .4byte gUnknown_202E038
thumb_func_end sub_808CBB0
thumb_func_start sub_808CC04
sub_808CC04:
push {r4,r5,lr}
movs r0, 0x1F
bl sub_8085680
adds r5, r0, 0
bl sub_808696C
movs r0, 0xA
movs r1, 0x46
bl sub_803E708
ldr r0, _0808CD2C
bl sub_8052910
movs r0, 0xA
movs r1, 0x46
bl sub_803E708
adds r0, r5, 0
movs r1, 0x4
movs r2, 0x2
movs r3, 0x4
bl sub_80869E4
movs r0, 0xA
movs r1, 0x46
bl sub_803E708
ldr r0, _0808CD30
bl sub_8052910
movs r0, 0xA
movs r1, 0x46
bl sub_803E708
bl sub_8086448
bl sub_8086598
movs r0, 0x20
movs r1, 0x46
bl sub_803E708
adds r0, r5, 0
bl sub_80862BC
movs r0, 0x20
movs r1, 0x46
bl sub_803E708
adds r0, r5, 0
movs r1, 0x4
movs r2, 0x2
movs r3, 0
bl sub_80869E4
ldr r0, _0808CD34
bl sub_8052910
movs r0, 0xA
movs r1, 0x46
bl sub_803E708
ldr r4, _0808CD38
adds r0, r4, 0
bl sub_8083E38
adds r0, r5, 0
movs r1, 0xA
movs r2, 0
bl sub_806CDD4
movs r0, 0x14
movs r1, 0x46
bl sub_803E708
adds r0, r5, 0
movs r1, 0
bl sub_806CE68
movs r0, 0x4
movs r1, 0x46
bl sub_803E708
adds r0, r4, 0
bl sub_8083E38
adds r0, r5, 0
movs r1, 0xA
movs r2, 0
bl sub_806CDD4
movs r0, 0x14
movs r1, 0x46
bl sub_803E708
ldr r0, _0808CD3C
bl sub_8052910
movs r0, 0xA
movs r1, 0x46
bl sub_803E708
adds r0, r5, 0
movs r1, 0
movs r2, 0
bl sub_806CDD4
movs r4, 0x17
_0808CCDE:
adds r0, r5, 0
movs r1, 0
movs r2, 0x80
lsls r2, 1
bl sub_804539C
movs r0, 0x46
bl sub_803E46C
subs r4, 0x1
cmp r4, 0
bge _0808CCDE
adds r0, r5, 0
movs r1, 0
bl sub_806CE68
movs r0, 0x20
movs r1, 0x46
bl sub_803E708
adds r0, r5, 0
bl sub_8042B0C
movs r1, 0x87
lsls r1, 2
adds r0, r5, 0
movs r2, 0
bl sub_8068FE0
ldr r2, _0808CD40
ldr r1, [r2]
movs r0, 0x1
strb r0, [r1, 0x4]
ldr r1, [r2]
movs r0, 0x4
strb r0, [r1, 0x11]
pop {r4,r5}
pop {r0}
bx r0
.align 2, 0
_0808CD2C: .4byte gUnknown_810688C
_0808CD30: .4byte gUnknown_81068D0
_0808CD34: .4byte gUnknown_8106918
_0808CD38: .4byte 0x000001c7
_0808CD3C: .4byte gUnknown_8106934
_0808CD40: .4byte gUnknown_203B418
thumb_func_end sub_808CC04
thumb_func_start sub_808CD44
sub_808CD44:
push {r4,r5,lr}
bl sub_8085480
adds r5, r0, 0
movs r0, 0x1F
bl sub_8085680
adds r4, r0, 0
movs r0, 0x72
bl sub_8083E88
bl sub_80854D4
movs r0, 0x4
bl sub_8085930
ldr r0, _0808CD94
bl sub_80855E4
movs r1, 0x87
lsls r1, 2
adds r0, r4, 0
movs r2, 0
bl sub_8068FE0
movs r1, 0x4
ldrsh r0, [r5, r1]
movs r2, 0x6
ldrsh r1, [r5, r2]
subs r1, 0x3
bl sub_8085860
ldr r0, _0808CD98
movs r1, 0x82
lsls r1, 1
bl sub_808D8BC
pop {r4,r5}
pop {r0}
bx r0
.align 2, 0
_0808CD94: .4byte sub_8086A3C
_0808CD98: .4byte gUnknown_202E038
thumb_func_end sub_808CD44
.align 2,0 @ Don't pad with nop

View File

@ -4953,7 +4953,7 @@ _0809FD20:
cmp r1, r0
beq _0809FDA0
adds r0, r1, 0
bl sub_80118F0
bl xxx_call_start_new_bgm
bl _0809EAE0
.align 2, 0
_0809FD34: .4byte 0x000003e7
@ -4978,7 +4978,7 @@ _0809FD4E:
add r0, sp, 0x8
ldrh r1, [r0, 0x2]
adds r0, r2, 0
bl sub_8011900
bl xxx_call_fade_in_new_bgm
bl _0809EAE0
.align 2, 0
_0809FD68: .4byte 0x000003e7
@ -9479,7 +9479,7 @@ _080A229E:
bl sub_80118C4
b _080A236A
_080A22AE:
bl sub_800C068
bl GetCurrentBGSong
ldr r1, _080A22C4
strh r0, [r1]
lsls r0, 16
@ -9498,7 +9498,7 @@ _080A22CC:
ldr r5, _080A22E0
cmp r0, r5
beq _080A236A
bl sub_80118F0
bl xxx_call_start_new_bgm
b _080A2312
.align 2, 0
_080A22DC: .4byte gUnknown_2039DA8
@ -9511,7 +9511,7 @@ _080A22E4:
beq _080A236A
lsls r1, r5, 16
lsrs r1, 16
bl sub_8011900
bl xxx_call_fade_in_new_bgm
strh r6, [r4]
b _080A1EBE
.align 2, 0

View File

@ -2489,80 +2489,4 @@ _080026C6:
bx r1
thumb_func_end sub_8002694
thumb_func_start sub_80026CC
sub_80026CC:
push {lr}
lsls r0, 16
asrs r0, 16
bl sub_8002658
lsls r0, 24
lsrs r0, 24
bl GetFriendAreaStatus
lsls r0, 24
lsrs r0, 24
pop {r1}
bx r1
thumb_func_end sub_80026CC
thumb_func_start sub_80026E8
sub_80026E8:
push {lr}
lsls r0, 16
asrs r0, 16
bl sub_8002658
lsls r0, 24
lsrs r0, 24
bl UnlockFriendArea
pop {r0}
bx r0
thumb_func_end sub_80026E8
thumb_func_start sub_8002700
sub_8002700:
push {lr}
ldr r1, _08002714
movs r2, 0x80
lsls r2, 3
bl MemoryCopy8
movs r0, 0x1
pop {r1}
bx r1
.align 2, 0
_08002714: .4byte gUnknown_2000A88
thumb_func_end sub_8002700
thumb_func_start sub_8002718
sub_8002718:
push {r4,lr}
sub sp, 0x8
adds r4, r0, 0
mov r0, sp
movs r1, 0
movs r2, 0
bl sub_800160C
ldr r0, _08002748
movs r2, 0x80
lsls r2, 3
adds r1, r4, 0
bl MemoryCopy8
ldr r0, [sp]
movs r2, 0xA
ldrsh r1, [r0, r2]
ldr r0, [sp, 0x4]
ldr r0, [r0]
cmp r1, r0
bne _0800274C
movs r0, 0x1
b _0800274E
.align 2, 0
_08002748: .4byte gUnknown_2000A88
_0800274C:
movs r0, 0
_0800274E:
add sp, 0x8
pop {r4}
pop {r1}
bx r1
thumb_func_end sub_8002718
.align 2, 0 @ Don't pad with nop.

View File

@ -1,38 +0,0 @@
.include "constants/gba_constants.inc"
.include "asm/macros.inc"
.syntax unified
.text
thumb_func_start FatalErrorFormatMessage
FatalErrorFormatMessage:
push {r0-r3}
push {lr}
sub sp, 0x100
ldr r1, [sp, 0x104]
add r2, sp, 0x108
mov r0, sp
bl vsprintf
add sp, 0x100
pop {r3}
add sp, 0x10
bx r3
thumb_func_end FatalErrorFormatMessage
thumb_func_start sub_8011B88
sub_8011B88:
push {r0-r3}
push {lr}
sub sp, 0x100
ldr r1, [sp, 0x104]
add r2, sp, 0x108
mov r0, sp
bl vsprintf
add sp, 0x100
pop {r3}
add sp, 0x10
bx r3
thumb_func_end sub_8011B88
.align 2,0

View File

@ -78,9 +78,9 @@ _0800C0B4:
_0800C0FC: .4byte 0x000003e5
_0800C100: .4byte gUnknown_202D68E
_0800C104: .4byte gUnknown_202D690
_0800C108: .4byte gUnknown_202D68A
_0800C108: .4byte gCurrentBGSong
_0800C10C: .4byte 0x000003e7
_0800C110: .4byte gUnknown_202D688
_0800C110: .4byte gBGMusicPlayerState
_0800C114: .4byte gUnknown_202D692
_0800C118: .4byte gUnknown_202D694
_0800C11C: .4byte gUnknown_20008F0
@ -132,7 +132,7 @@ _0800C15E:
b _0800C19A
.align 2, 0
_0800C17C: .4byte gUnknown_20008F0
_0800C180: .4byte gUnknown_202D68A
_0800C180: .4byte gCurrentBGSong
_0800C184:
cmp r0, 0x7A
beq _0800C19A
@ -817,7 +817,7 @@ _0800C6E4:
strh r0, [r4]
b _0800C8A2
.align 2, 0
_0800C6F0: .4byte gUnknown_202D68A
_0800C6F0: .4byte gCurrentBGSong
_0800C6F4: .4byte 0x000003e7
_0800C6F8: .4byte gUnknown_202D68E
_0800C6FC: .4byte 0x000003e5
@ -893,9 +893,9 @@ _0800C774:
bl m4aSongNumStart
b _0800C7BE
.align 2, 0
_0800C794: .4byte gUnknown_202D68A
_0800C794: .4byte gCurrentBGSong
_0800C798: .4byte 0x000003e7
_0800C79C: .4byte gUnknown_202D688
_0800C79C: .4byte gBGMusicPlayerState
_0800C7A0: .4byte gUnknown_202D694
_0800C7A4:
ldr r0, _0800C7B0
@ -917,7 +917,7 @@ _0800C7BE:
ldr r2, _0800C7DC
b _0800C84C
.align 2, 0
_0800C7CC: .4byte gUnknown_202D688
_0800C7CC: .4byte gBGMusicPlayerState
_0800C7D0: .4byte gUnknown_20008F0
_0800C7D4: .4byte gUnknown_202D690
_0800C7D8: .4byte gUnknown_202D68E
@ -948,8 +948,8 @@ _0800C80A:
strh r0, [r5]
b _0800C8A2
.align 2, 0
_0800C810: .4byte gUnknown_202D688
_0800C814: .4byte gUnknown_202D68A
_0800C810: .4byte gBGMusicPlayerState
_0800C814: .4byte gCurrentBGSong
_0800C818: .4byte 0x000003e7
_0800C81C:
ldr r0, _0800C834
@ -964,7 +964,7 @@ _0800C81C:
bne _0800C8A2
b _0800C842
.align 2, 0
_0800C834: .4byte gUnknown_202D68A
_0800C834: .4byte gCurrentBGSong
_0800C838: .4byte 0x000003e7
_0800C83C:
ldr r0, _0800C854
@ -981,8 +981,8 @@ _0800C84C:
b _0800C8A2
.align 2, 0
_0800C854: .4byte gUnknown_20008F0
_0800C858: .4byte gUnknown_202D688
_0800C85C: .4byte gUnknown_202D68A
_0800C858: .4byte gBGMusicPlayerState
_0800C85C: .4byte gCurrentBGSong
_0800C860: .4byte 0x000003e7
_0800C864:
movs r0, 0
@ -1008,7 +1008,7 @@ _0800C864:
.align 2, 0
_0800C890: .4byte gUnknown_202D68C
_0800C894: .4byte 0x000003e7
_0800C898: .4byte gUnknown_202D68A
_0800C898: .4byte gCurrentBGSong
_0800C89C:
strh r0, [r5]
ldr r0, _0800C8C4
@ -1033,7 +1033,7 @@ _0800C8AE:
beq _0800C8F0
b _0800C926
.align 2, 0
_0800C8C4: .4byte gUnknown_202D68A
_0800C8C4: .4byte gCurrentBGSong
_0800C8C8: .4byte gUnknown_3000FE8
_0800C8CC: .4byte 0x000003e5
_0800C8D0:

View File

@ -5,50 +5,6 @@
.text
thumb_func_start sub_803C190
sub_803C190:
lsls r0, 24
ldr r1, _0803C19C
lsrs r0, 21
adds r0, r1
ldr r0, [r0]
bx lr
.align 2, 0
_0803C19C: .4byte gUnknown_80EBA18
thumb_func_end sub_803C190
thumb_func_start sub_803C1A0
sub_803C1A0:
lsls r0, 24
ldr r1, _0803C1B0
lsrs r0, 21
adds r1, 0x4
adds r0, r1
ldr r0, [r0]
bx lr
.align 2, 0
_0803C1B0: .4byte gUnknown_80EBA18
thumb_func_end sub_803C1A0
thumb_func_start sub_803C1B4
sub_803C1B4:
push {r4,lr}
lsls r4, r1, 24
lsrs r4, 24
bl sub_80908D8
cmp r4, 0x2
bne _0803C1C4
adds r0, 0x2
_0803C1C4:
cmp r0, 0xF
ble _0803C1CA
movs r0, 0xF
_0803C1CA:
pop {r4}
pop {r1}
bx r1
thumb_func_end sub_803C1B4
thumb_func_start sub_803C1D0
sub_803C1D0:
push {lr}

View File

@ -1,6 +1,15 @@
#ifndef GUARD_BG_MUSIC_H
#define GUARD_BG_MUSIC_H
#define MUS_TINY_WOODS 1
#define MUS_POKEMON_SQUARE 7
#define MUS_LOADING_SCREEN 8
#define MUS_THERES_TROUBLE 10
#define MUS_KECLEON_SHOP 17
#define MUS_STOP_THIEF 18
#define MUS_WORLD_CALAMITY 19
#define MUS_INTRO 40
#define MUS_TITLE_SCREEN 43
#endif //GUARD_BG_MUSIC_H
#define NUM_BG_SONGS 128
#endif //GUARD_BG_MUSIC_H

11
include/crt0.h Normal file
View File

@ -0,0 +1,11 @@
#ifndef GUARD_CRT0_H
#define GUARD_CRT0_H
// Exported type declarations
// Exported RAM declarations
// Exported ROM declarations
extern u32 IntrMain[];
#endif //GUARD_CRT0_H

13
include/event_flag.h Normal file
View File

@ -0,0 +1,13 @@
struct UnkEventStruct
{
/* 0x0 */ s16 *unk0;
/* 0x4 */ u32 *unk4;
};
bool8 sub_80026CC(s16 r0);
void sub_80026E8(s16 r0);
bool8 sub_8002700(void *r0);
bool8 sub_8002718(u8 *r0);
void sub_8002758(u32 *r0);
u8 sub_800276C(void);

20
include/music.h Normal file
View File

@ -0,0 +1,20 @@
#ifndef GUARD_MUSIC_H
#define GUARD_MUSIC_H
void sub_800C93C(void);
void sub_800C9CC(void);
u8 sub_800CA38(u32 songIndex);
void StartNewBGM(u16 songIndex);
bool8 IsBGSong(u32 songIndex);
bool8 sub_800CAAC(u32 songIndex);
bool8 sub_800CACC(u32 songIndex);
u16 sub_800CAE0(u16 songIndex);
bool8 sub_800CAF0(u16 songIndex);
void StartNewBGM(u16 songIndex);
void FadeInNewBGM(u16 SongIndex, u16 speed);
u16 GetCurrentBGSong(void);
void nullsub_19(void);
void nullsub_20(u16 songIndex);
#endif //GUARD_MUSIC_H

View File

@ -80,7 +80,6 @@ SECTIONS {
src/code_80118A4.o(.text);
asm/code_80118A4.o(.text);
src/code_80118A4_1.o(.text);
asm/fatal_system.o(.text);
src/fatal_system.o(.text);
asm/fatal_system_1.o(.text);
src/save.o(.text);
@ -88,6 +87,7 @@ SECTIONS {
src/save_mid.o(.text);
asm/save1.o(.text);
src/save1.o(.text);
src/more_input.o(.text);
asm/code_8012A18.o(.text);
src/code_801D760.o(.text);
asm/code_801D760.o(.text);
@ -95,6 +95,7 @@ SECTIONS {
asm/code_8027C84.o(.text);
src/wonder_mail.o(.text);
asm/wonder_mail.o(.text);
src/code_803C190.o(.text);
asm/personality_test.o(.text);
src/personality_test.o(.text);
asm/code_803D110.o(.text);
@ -108,6 +109,7 @@ SECTIONS {
asm/code_8048480.o(.text);
src/code_80521D0.o(.text);
asm/code_80521D0.o(.text);
src/code_80521D0_1.o(.text);
src/pokemon.o(.text);
asm/pokemon.o(.text);
src/pokemon_mid.o(.text);

View File

@ -1,7 +1,7 @@
.align 2
gMPlayTable:: @ 9E8665C
music_player 0x20008F0, 0x2000000, 12, 0
music_player 0x2000970, 0x20003C0, 6, 0
music_player 0x20008F0, 0x2000000, 12, 0 @ BGM
music_player 0x2000970, 0x20003C0, 6, 0 @ SE?
music_player 0x20009B0, 0x20005A0, 1, 0
music_player 0x2000A40, 0x20005F0, 1, 0
music_player 0x20009F0, 0x2000640, 2, 0

View File

@ -3,6 +3,8 @@
#include "friend_area.h"
#include "input.h"
#include "bg.h"
#include "music.h"
#include "constants/bg_music.h"
extern void InitHeap(void);
extern void NDS_DebugInit(void);
@ -39,7 +41,6 @@ extern void sub_800CDA8(u32);
extern void sub_800641C(u32, u32, u32);
extern void LoadTitleScreen(void);
extern void SetBGPaletteBufferColorRGB(s32, u8 *, s32, u8 *);
extern void sub_800BDFC(u32);
extern void sub_80095CC(u32, u32);
extern void InitMainMenu(void);
extern void sub_8012468(void);
@ -149,7 +150,7 @@ void GameLoop(void)
sub_8012558();
}
tmp3 = 1;
sub_800BDFC(8);
StartNewBGM(MUS_LOADING_SCREEN);
flag = TRUE;
sub_80095CC(0, 20);
InitMainMenu();

View File

@ -1,22 +1,19 @@
#include "global.h"
#include "music.h"
#include "constants/bg_music.h"
void sub_8011924(void);
void nullsub_26(void);
extern u8 sub_80023E4(u8);
extern void sub_800BDFC(u16 r0);
extern void FadeInNewBGM(u16 r0, u16 r1);
extern void sub_800BF48(u16 r0);
extern void sub_800BF80(void);
extern void sub_800BFD0(u16 r0);
extern void sub_800C3F8(u16 r0, u16 r1);
extern void sub_801199C(u16 r0);
extern u16 sub_800C068();
extern void sub_800C074(u16 r0, u16 r1);
extern void sub_800C298(u16 r0);
extern void sub_800C93C();
extern u8 sub_800C5D0(u16 r0);
extern void sub_800C9CC();
extern void nullsub_27(void);
extern void nullsub_29(void);
@ -49,12 +46,12 @@ void sub_8011760(void)
{
if(sub_80023E4(0xD) != 0)
{
sub_800BDFC(0x13);
StartNewBGM(MUS_WORLD_CALAMITY);
return;
}
if(sub_80023E4(0xC) != 0)
{
sub_800BDFC(0x7); // Pokemon Square Theme
StartNewBGM(MUS_POKEMON_SQUARE);
}
}
@ -62,10 +59,10 @@ void sub_801178C(void)
{
if(sub_80023E4(0xD) != 0)
{
sub_800BDFC(0x13);
StartNewBGM(MUS_WORLD_CALAMITY);
return;
}
sub_800BDFC(0x7); // Pokemon Square Theme
StartNewBGM(MUS_POKEMON_SQUARE);
}
void sub_80117AC(void)
@ -147,12 +144,12 @@ void sub_80118C4(u16 r0)
sub_800C3F8(0x3e5, r0);
}
void sub_80118F0(u16 r0)
void xxx_call_start_new_bgm(u16 songIndex)
{
sub_800BDFC(r0);
StartNewBGM(songIndex);
}
void sub_8011900(u16 songIndex, u16 speed)
void xxx_call_fade_in_new_bgm(u16 songIndex, u16 speed)
{
FadeInNewBGM(songIndex, speed);
}
@ -175,7 +172,7 @@ void sub_8011930(u16 r0)
u32 sub_8011940(u16 r0)
{
u32 temp;
temp = sub_800C068();
temp = GetCurrentBGSong();
if(r0 == 999)
return temp != 999;

34
src/code_803C190.c Normal file
View File

@ -0,0 +1,34 @@
#include "global.h"
struct unkStruct_80EBA18
{
u32 unk0;
u32 unk4;
};
extern struct unkStruct_80EBA18 gUnknown_80EBA18[];
extern s32 sub_80908D8(u32);
u32 sub_803C190(u8 r0)
{
return gUnknown_80EBA18[r0].unk0;
}
u32 sub_803C1A0(u8 r0)
{
return gUnknown_80EBA18[r0].unk4;
}
s32 sub_803C1B4(s32 r0, u8 r1)
{
s32 temp;
temp = sub_80908D8(r0);
if(r1 == 2)
{
temp += 2;
}
if(temp > 0xF)
temp = 0xF;
return temp;
}

View File

@ -1,8 +1,27 @@
#include "global.h"
#include "time.h"
#include "file_system.h"
struct unkStruct_203B418
{
u8 padding[0x181FB];
u32 unk181FC;
u32 unk18200;
u32 unk18204;
u32 unk18208;
u32 unk1820C;
u32 unk18210;
u8 padding2[3];
u8 unk18217;
};
extern u8 *gUnknown_203B418;
extern struct PlayTimeStruct *gUnknown_203B47C;
extern struct unkStruct_203B418 *gUnknown_203B418;
extern s32 gUnknown_80F6568[];
extern u8 gUnknown_202EE01;
extern const char gUnknown_80F6604; // "zmappat"
extern struct FileArchive gUnknown_83B0000;
extern struct OpenedFile *gUnknown_202EE04;
extern void sub_803F7BC(void);
extern void sub_80060EC(void);
@ -14,7 +33,7 @@ extern void sub_8011860(void);
void sub_8040094(u8 r0)
{
gUnknown_203B418[0x18217] = r0;
gUnknown_203B418->unk18217 = r0;
sub_803F7BC();
sub_80060EC();
IncrementPlayTime(gUnknown_203B47C);
@ -24,3 +43,27 @@ void sub_8040094(u8 r0)
sub_8083F58();
sub_8011860();
}
void sub_80400D4(void)
{
s32 temp;
temp = gUnknown_203B418->unk18200;
if(temp == 0)
return;
if(temp > 0x1E)
temp = 0x1F;
gUnknown_203B418->unk181FC = gUnknown_80F6568[temp];
gUnknown_203B418->unk18200--;
if(gUnknown_203B418->unk18200 == 0)
gUnknown_203B418->unk18200 = gUnknown_203B418->unk18204;
}
void sub_8040124(void)
{
gUnknown_202EE01 = 0;
}
void sub_8040130(void)
{
gUnknown_202EE04 = OpenFileAndGetFileDataPtr(&gUnknown_80F6604, &gUnknown_83B0000);
}

View File

@ -1,13 +1,25 @@
#include "global.h"
struct unkDungeon_8041D5C
{
u8 padding[0x70];
u8 *unk70[100];
};
extern u32 gUnknown_80F89F4;
extern u32 gUnknown_202DF98;
extern u32 gUnknown_80FB580;
extern void sub_807D148(u32 r0, u32 r1, u32 r2, u32 r3);
extern void sub_8075FCC(void);
extern void sub_8077AE4(u32 r0, u32 r1, u32 r2);
extern void sub_8072008(u32 r0, u32 r1, u32 r2, u8 r3);
extern void sub_8076D10(void);
extern void sub_80522F4(u32 r0, u32 r1, u32 r2);
extern void sub_807232C(u32 r0, u32 r1, u32 r2);
extern u32 gUnknown_80F89F4;
extern void sub_8045B94(u32 *r0, struct unkDungeon_8041D5C *r1, u32);
extern void sub_807A290(u32);
extern void sub_80522F4(u32 r0, struct unkDungeon_8041D5C *r1, u32);
void sub_8048480(u32 r0, u32 r1)
{
@ -36,7 +48,7 @@ void sub_80484BC(void)
sub_8076D10();
}
void sub_80484C8(u32 r0, u32 r1)
void sub_80484C8(u32 r0, struct unkDungeon_8041D5C *r1)
{
sub_80522F4(r0, r1, gUnknown_80F89F4);
}
@ -45,3 +57,16 @@ void sub_80484DC(u32 r0, u32 r1)
{
sub_807232C(r0, r1, 1);
}
void sub_80484E8(u32 r0, struct unkDungeon_8041D5C *r1)
{
u8 *temp;
temp = r1->unk70[0];
if(temp[0xAC] == 1)
{
sub_807A290(r0);
return;
}
sub_8045B94(&gUnknown_202DF98, r1, 0);
sub_80522F4(r0, r1, gUnknown_80FB580);
}

200
src/code_80521D0_1.c Normal file
View File

@ -0,0 +1,200 @@
#include "global.h"
extern s16 *sub_8085480(void);
extern u32 sub_8085680(u32);
extern u32 gUnknown_202E038;
extern u8* gUnknown_203B418;
extern u32 gUnknown_8106778;
extern u32 gUnknown_81067BC;
extern u32 gUnknown_81067E0;
extern u32 gUnknown_8106834;
extern u32 gUnknown_810688C;
extern u32 gUnknown_81068D0;
extern u32 gUnknown_8106918;
extern u32 gUnknown_8106934;
extern void sub_8086A3C(void);
extern void sub_808D8BC(u32 *r0, u32 r1);
extern void sub_8083E88(u32);
extern void sub_80854D4(void);
extern void sub_80855E4(void *);
extern void sub_8085930(u32);
extern void sub_8068FE0(u32, u32, u32);
extern void sub_8085860(s16 r0, u32 r1);
extern void sub_803E708(u32, u32);
extern void sub_8052910(u32 *r0);
extern void sub_8086448(void);
extern void sub_8086598(void);
extern void sub_808696C();
extern void sub_80862BC(u32);
extern void sub_8083E38(u32);
extern void sub_806CDD4(u32, u32, u32);
extern void sub_80869E4(u32, u32, u32, u32);
extern void sub_806CE68(u32, u32);
extern void sub_804539C(u32, u32, u32);
extern void sub_803E46C(u32);
extern void sub_8042B0C(u32);
extern void sub_8085918(u32, u32);
void sub_808C9C4(void)
{
s16 *array;
u32 temp_2;
array = sub_8085480();
temp_2 = sub_8085680(7);
sub_8083E88(0x72);
sub_80854D4();
sub_8085930(0x4);
sub_80855E4(sub_8086A3C);
sub_8085918(temp_2, 0);
sub_8085860(array[2], array[3] - 3);
sub_808D8BC(&gUnknown_202E038, 0x14d);
}
void sub_808CA1C(void)
{
u32 temp;
s32 counter;
temp = sub_8085680(7);
sub_808696C();
sub_803E708(0xA, 0x46);
sub_8052910(&gUnknown_8106778);
sub_803E708(0xA, 0x46);
sub_80869E4(temp, 4, 2, 4);
sub_803E708(0xA, 0x46);
sub_8052910(&gUnknown_81067BC);
sub_803E708(0xA, 0x46);
sub_8086448();
sub_8086598();
sub_803E708(0x20, 0x46);
sub_80862BC(temp);
sub_803E708(0x20, 0x46);
sub_80869E4(temp, 4, 2, 0);
sub_8052910(&gUnknown_81067E0);
sub_803E708(0xA, 0x46);
sub_8083E38(0x1c7);
sub_806CDD4(temp, 0xA, 0);
sub_803E708(0x14, 0x46);
sub_806CE68(temp, 0);
sub_803E708(0x4, 0x46);
sub_8083E38(0x1c7);
sub_806CDD4(temp, 0xA, 0);
sub_803E708(0x14, 0x46);
sub_8052910(&gUnknown_8106834);
sub_803E708(0xA, 0x46);
sub_806CDD4(temp, 0, 0);
for(counter = 0x17; counter >= 0; counter--)
{
sub_804539C(temp, 0, 0x80 << 1);
sub_803E46C(0x46);
}
sub_806CE68(temp, 0);
sub_803E708(0x20, 0x46);
sub_8042B0C(temp);
sub_8068FE0(temp, 0x87 << 2, 0);
gUnknown_203B418[4] = 1;
gUnknown_203B418[0x11] = 4;
}
void sub_808CB5C(void)
{
s16 *array;
u32 temp_2;
array = sub_8085480();
temp_2 = sub_8085680(7);
sub_8083E88(0x72);
sub_80854D4();
sub_8085930(0x4);
sub_8068FE0(temp_2, 0x87 << 2, 0);
sub_8085860(array[2], array[3]);
sub_808D8BC(&gUnknown_202E038, 0x14d);
}
void nullsub_101(void)
{
}
void sub_808CBB0(void)
{
s16 *array;
u32 temp_2;
array = sub_8085480();
temp_2 = sub_8085680(0x1F);
sub_8083E88(0x72);
sub_80854D4();
sub_8085930(4);
sub_80855E4(sub_8086A3C);
sub_8085918(temp_2, 0);
sub_8085860(array[2], array[3] - 3);
sub_808D8BC(&gUnknown_202E038, 0x82 << 1);
}
void sub_808CC04(void)
{
u32 temp;
s32 counter;
temp = sub_8085680(0x1F);
sub_808696C();
sub_803E708(0xA, 0x46);
sub_8052910(&gUnknown_810688C);
sub_803E708(0xA, 0x46);
sub_80869E4(temp, 4, 2, 4);
sub_803E708(0xA, 0x46);
sub_8052910(&gUnknown_81068D0);
sub_803E708(0xA, 0x46);
sub_8086448();
sub_8086598();
sub_803E708(0x20, 0x46);
sub_80862BC(temp);
sub_803E708(0x20, 0x46);
sub_80869E4(temp, 4, 2, 0);
sub_8052910(&gUnknown_8106918);
sub_803E708(0xA, 0x46);
sub_8083E38(0x1c7);
sub_806CDD4(temp, 0xA, 0);
sub_803E708(0x14, 0x46);
sub_806CE68(temp, 0);
sub_803E708(0x4, 0x46);
sub_8083E38(0x1c7);
sub_806CDD4(temp, 0xA, 0);
sub_803E708(0x14, 0x46);
sub_8052910(&gUnknown_8106934);
sub_803E708(0xA, 0x46);
sub_806CDD4(temp, 0, 0);
for(counter = 0x17; counter >= 0; counter--)
{
sub_804539C(temp, 0, 0x80 << 1);
sub_803E46C(0x46);
}
sub_806CE68(temp, 0);
sub_803E708(0x20, 0x46);
sub_8042B0C(temp);
sub_8068FE0(temp, 0x87 << 2, 0);
gUnknown_203B418[4] = 1;
gUnknown_203B418[0x11] = 4;
}
void sub_808CD44(void)
{
s16 *array;
u32 temp_2;
array = sub_8085480();
temp_2 = sub_8085680(0x1F);
sub_8083E88(0x72);
sub_80854D4();
sub_8085930(0x4);
sub_80855E4(sub_8086A3C);
sub_8068FE0(temp_2, 0x87 << 2, 0);
sub_8085860(array[2], array[3] - 3);
sub_808D8BC(&gUnknown_202E038, 0x82 << 1);
}

View File

@ -14,8 +14,8 @@ extern u32 *gUnknown_203B488;
extern u32 *gUnknown_203B48C;
extern void sub_809488C(u32, u32, u32);
extern void sub_8094924(u32, u32, u32);
extern void sub_809488C(u32 *r0, u32 *r1, u32);
extern void sub_8094924(u32 *r0, u32 *r1, u32);
// Forward Declaration
@ -91,20 +91,20 @@ void DeconstructPlayTime(struct PlayTimeStruct *r0, u32 *outHours, u32 *outMinut
}
}
void sub_8095044(u32 r0)
void sub_8095044(u32 *r0)
{
sub_809488C(r0, (u32)(gUnknown_203B47C) + 4, 0x6);
sub_809488C(r0, (u32)(gUnknown_203B47C) + 3, 0x6);
sub_809488C(r0, (u32)(gUnknown_203B47C) + 2, 0x6);
sub_809488C(r0, (u32)(gUnknown_203B47C), 0xE);
sub_809488C(r0, (u32 *)(&(gUnknown_203B47C->frames)), 6);
sub_809488C(r0, (u32 *)(&(gUnknown_203B47C->seconds)), 6);
sub_809488C(r0, (u32 *)(&(gUnknown_203B47C->minutes)), 6);
sub_809488C(r0, (u32 *)(&(gUnknown_203B47C->hours)), 14);
}
void sub_8095080(u32 r0)
void sub_8095080(u32 *r0)
{
sub_8094924(r0, (u32)(gUnknown_203B47C) + 4, 0x6);
sub_8094924(r0, (u32)(gUnknown_203B47C) + 3, 0x6);
sub_8094924(r0, (u32)(gUnknown_203B47C) + 2, 0x6);
sub_8094924(r0, (u32)(gUnknown_203B47C), 0xE);
sub_8094924(r0, (u32 *)(&(gUnknown_203B47C->frames)), 6);
sub_8094924(r0, (u32 *)(&(gUnknown_203B47C->seconds)), 6);
sub_8094924(r0, (u32 *)(&(gUnknown_203B47C->minutes)), 6);
sub_8094924(r0, (u32 *)(&(gUnknown_203B47C->hours)), 14);
}
void sub_80950BC(void)

View File

@ -1,41 +1,39 @@
#include "global.h"
#include "event_flag.h"
#include "memory.h"
struct UnkEventStruct
{
/* 0x0 */ u32 unk0;
/* 0x4 */ s16 unk4;
/* 0x6 */ u16 unk6;
/* 0x8 */ u16 unk8;
/* 0xA */ s16 unkA;
};
struct UnkEventStruct2
{
/* 0x0 */ u32 unk0;
/* 0x4 */ u32 *unk4;
/* 0x8 */ u16 unk8;
/* 0xA */ s16 unkA;
};
#include "friend_area.h"
extern void sub_800226C(u8 r0, u8 r1, u32* r2, u8 u3);
extern void sub_800160C(struct UnkEventStruct2 *r0, u32 r1, u32 r2);
extern void sub_800160C(struct UnkEventStruct *r0, u32 r1, u32 r2);
extern u8 sub_8002658(s32);
extern u8 gUnknown_2000A88;
bool8 sub_80026CC(s16 r0)
{
return GetFriendAreaStatus(sub_8002658(r0));
}
// TODO fix stack allocation from 0xC to 0x8 to make this match
//u8 sub_8002718(struct UnkEventStruct *r0)
//{
// struct UnkEventStruct2 temp;
// sub_800160C(&temp, 0, 0);
// MemoryCopy8(&gUnknown_2000A88, (u8 *)r0, (0x80 << 3));
//
// // TODO fix this comparison to make it match
// if(temp.unkA != *(temp.unk4))
// return 0;
// return 1;
//}
void sub_80026E8(s16 r0)
{
UnlockFriendArea(sub_8002658(r0));
}
bool8 sub_8002700(void *r0)
{
MemoryCopy8(r0, &gUnknown_2000A88, 0x80 << 3);
return 1;
}
bool8 sub_8002718(u8 *r0)
{
struct UnkEventStruct temp;
sub_800160C(&temp, 0, 0);
MemoryCopy8(&gUnknown_2000A88, r0, 0x80 << 3);
if (temp.unk0[5] != temp.unk4[0])
return 0;
return 1;
}
void sub_8002758(u32 *r0)
{

View File

@ -1,8 +1,30 @@
#include "global.h"
#include <stdarg.h>
#include <stdio.h>
#include "gba/gba.h"
#include "config.h"
extern const char gNotMountText;
extern void Hang();
void FatalErrorFormatMessage(const char *text, ...)
{
char bufPrint[0x100];
va_list vArgv;
va_start(vArgv, text);
vsprintf(bufPrint, text, vArgv);
va_end(vArgv);
}
void sub_8011B88(const char *text, ...)
{
char bufPrint[0x100];
va_list vArgv;
va_start(vArgv, text);
vsprintf(bufPrint, text, vArgv);
va_end(vArgv);
}
void nullsub_28(void)
{
}
@ -25,7 +47,7 @@ const char *sub_8011BAC(void)
}
// Unused
void sub_8011BB4(void)
void UnusedHang(void)
{
Hang();
}

View File

@ -1,19 +1,21 @@
#include "global.h"
#include "crt0.h"
#include "random.h"
#include "flash.h"
#include "text.h"
extern char ewram_start[];
extern u8 gUnknown_202D4B8;
extern void *gUnknown_202D5F0[6];
typedef void (*IntrCallback)(void);
extern u8 IntrMain_Buffer[0x120];
extern IntrCallback gUnknown_202D5F0[6];
extern u16 gUnknown_202D7FC;
extern u8 gUnknown_202D7FE;
extern u8 gInterruptsEnabled;
extern u16 gUnknown_203B0AC;
extern s16 gUnknown_203B0AE;
extern u32 gIntrTable[];
extern u32 IntrMain;
extern char alt_203B038[];
@ -226,8 +228,8 @@ void SetInterruptFlag(u16 flag)
void InitIntrTable(const u32 *interrupt_table)
{
CpuCopy32(interrupt_table, &gIntrTable, 0x18); // 0x18 = 0x6 * 4 (0x4f00 is 32 bits)
CpuCopy32(&IntrMain, &gUnknown_202D4B8, 0x120); // 0x120 = 0x48 * 4 (0x4f00 is 32 bits)
INTR_VECTOR = &gUnknown_202D4B8;
CpuCopy32(&IntrMain, &IntrMain_Buffer, 0x120); // 0x120 = 0x48 * 4 (0x4f00 is 32 bits)
INTR_VECTOR = &IntrMain_Buffer;
}
u32 *sub_800B6E8(u32 r0)

132
src/more_input.c Normal file
View File

@ -0,0 +1,132 @@
#include "global.h"
#include "input.h"
struct UnkInputStruct
{
/* 0x0 */ u8 unk0;
/* 0x1 */ u8 unk1;
/* 0x2 */ u8 unk2;
/* 0x3 */ u8 unk3;
/* 0x4 */ u8 unk4;
/* 0x5 */ u32 unk5;
/* 0x9 */ u32 unk9;
/* 0xD */ u32 unkD;
/* 0x12 */ u32 unk11;
/* 0x16 */ u32 unk15;
/* 0x1A */ u32 unk19;
/* 0x1E */ u32 unk1D;
/* 0x24 */ u32 unk24;
/* 0x28 */ u8 unk28;
/* 0x29 */ u8 a_button;
/* 0x2A */ u8 b_button;
/* 0x2B */ u8 dpad_right;
/* 0x2C */ u8 dpad_left;
};
extern void nullsub_34(struct UnkInputStruct *r0);
extern struct Inputs gRealInputs;
u32 sub_8012AE8(void);
u32 sub_8012A64(struct UnkInputStruct *r0, u32 r1)
{
if(r0 == NULL)
{
return sub_8012AE8();
}
if(r1 != -1)
{
nullsub_34(r0);
}
if(r0->unk1 != 0)
{
r0->unk1 = 0;
return 1;
}
if(r0->unk2 == 0)
{
return sub_8012AE8();
}
r0->unk2 = r0->unk1;
return 2;
}
u32 GetKeyPress(struct UnkInputStruct *r0)
{
if(r0 != NULL)
{
if(r0->a_button != 0)
{
return 1;
}
if(r0->b_button != 0)
{
return 2;
}
if(r0->dpad_left != 0)
{
return 9;
}
if(r0->dpad_right != 0)
{
return 10;
}
}
return sub_8012AE8();
}
u32 sub_8012AE8(void)
{
if ((gRealInputs.held & R_BUTTON) != 0) {
if ((gRealInputs.pressed & A_BUTTON) != 0) {
return 11;
}
if ((gRealInputs.repeated & DPAD_UP) != 0) {
return 12;
}
if ((gRealInputs.repeated & DPAD_DOWN) != 0) {
return 13;
}
if ((gRealInputs.repeated & DPAD_LEFT) != 0) {
return 14;
}
if ((gRealInputs.repeated & DPAD_RIGHT) != 0) {
return 15;
}
if ((gRealInputs.repeated & R_BUTTON) != 0) {
return 6;
}
}
else
{
if ((gRealInputs.pressed & A_BUTTON) != 0) {
return 1;
}
if ((gRealInputs.pressed & B_BUTTON) != 0) {
return 2;
}
if ((gRealInputs.pressed & SELECT_BUTTON) != 0) {
return 3;
}
if ((gRealInputs.pressed & START_BUTTON) != 0) {
return 4;
}
if ((gRealInputs.repeated & DPAD_UP) != 0) {
return 7;
}
if ((gRealInputs.repeated & DPAD_DOWN) != 0) {
return 8;
}
if ((gRealInputs.repeated & DPAD_LEFT) != 0) {
return 9;
}
if ((gRealInputs.repeated & DPAD_RIGHT) != 0) {
return 10;
}
if ((gRealInputs.repeated & L_BUTTON) != 0) {
return 5;
}
}
return 0;
}

View File

@ -1,7 +1,6 @@
#include "global.h"
#include "m4a.h"
#define NUM_BG_SONGS 128
#include "constants/bg_music.h"
extern u8 sub_80023E4(u32);
extern void sub_80118C4(u16);
@ -15,8 +14,14 @@ extern void Random();
extern void sub_800BA5C();
extern void xxx_update_bg_sound_input();
extern u16 gUnknown_202D688;
extern u16 gUnknown_202D68A;
// 0 - Only seen it initialized
// 1 - Playing
// 2 -
// 3 - Fade Out?
// 4 - Stopped
extern u16 gBGMusicPlayerState;
extern u16 gCurrentBGSong;
extern u16 gUnknown_202D690;
extern u8 gUnknown_202D694;
extern u32 gUnknown_203B0B8;
@ -38,23 +43,20 @@ void sub_800C93C(void)
interrupt_flag = DisableInterrupts();
if(gUnknown_202D690 == 0)
{
if(gUnknown_202D68A != 0x3e7)
if(gCurrentBGSong != 999)
{
temp = gUnknown_202D688 - 1;
temp = gBGMusicPlayerState - 1;
if(temp <= 1)
{
if(gUnknown_202D688 == 2)
if(gBGMusicPlayerState == 2)
{
gUnknown_202D694 = gUnknown_202D690;
}
else
else if(gBGMusicPlayerState == 1)
{
if(gUnknown_202D688 == 1)
{
gUnknown_202D694 = 1;
}
gUnknown_202D694 = 1;
}
gUnknown_202D688 = 4;
gBGMusicPlayerState = 4;
}
}
}
@ -72,14 +74,14 @@ void sub_800C9CC(void)
m4aSoundVSyncOn();
if(gUnknown_202D690 == 0)
{
if(gUnknown_202D68A != 0x3e7)
if(gCurrentBGSong != 999)
{
if(gUnknown_202D688 == 4)
if(gBGMusicPlayerState == 4)
{
gUnknown_202D688 = 1;
gBGMusicPlayerState = 1;
if(gUnknown_202D694 != 0)
{
m4aSongNumStart(gUnknown_202D68A);
m4aSongNumStart(gCurrentBGSong);
}
else
{
@ -99,6 +101,7 @@ void nullsub_179(void)
{
}
// Unused
u8 sub_800CA38(u32 songIndex)
{
if(IsBGSong(songIndex))
@ -190,6 +193,7 @@ void sub_800CB20(void)
Random();
}
// Unused
u32 sub_800CB50(void)
{
return gUnknown_203B0B8;

View File

@ -2,24 +2,33 @@
#include "gba/io_reg.h"
#include "m4a.h"
#include "bg.h"
#include "music.h"
extern void nullsub_19(void);
extern void nullsub_20(u16 songIndex);
extern bool8 EnableInterrupts(void);
extern bool8 DisableInterrupts(void);
extern bool8 IsBGSong(u32);
extern void SoundBiasReset();
extern void SoundBiasSet();
extern void SetInterruptFlag(u16);
extern void nullsub_25();
extern void nullsub_18();
extern void sub_800C298(u16 r0);
extern u16 sub_800CAE0(u16);
extern u32 gUnknown_202D5F0[];
extern u16 gUnknown_202D688;
extern u16 gUnknown_202D68A;
typedef void (*IntrCallback)(void);
extern IntrCallback gUnknown_202D5F0[];
extern u32 gUnknown_203B0A0;
extern u16 gBGMusicPlayerState;
extern u16 gCurrentBGSong;
extern u16 gUnknown_202D68C;
extern u16 gUnknown_202D68E;
extern u16 gUnknown_202D690;
extern u16 gUnknown_202D692;
extern u8 gUnknown_202D694;
extern u8 gUnknown_203B099;
extern u8 gUnknown_203B09B;
extern u32 gUnknown_203B09C;
extern u8 gUnknown_203B09A;
struct unkStruct_3000FD8
{
@ -40,6 +49,152 @@ extern struct BGControlStruct gUnknown_202D6A8;
extern struct BGControlStruct gUnknown_202D6B0;
void sub_800BF80(void);
void xxx_update_bg_sound_input(void);
void sub_800BA5C(void)
{
if(gUnknown_203B09A != 0)
{
gUnknown_203B09C++;
xxx_update_bg_sound_input();
}
gUnknown_203B09A = 1;
gUnknown_203B09B = 0;
gUnknown_203B09C = 0;
nullsub_25();
while(REG_VCOUNT > 159){}
gUnknown_203B099 = 1;
VBlankIntrWait();
nullsub_18();
}
#ifdef NONMATCHING
void xxx_update_bg_sound_input(void)
{
u8 store;
store = gUnknown_203B09B;
if(gUnknown_203B09B != 0){
gUnknown_203B09C++;
}
else {
gUnknown_203B09B = 1;
gUnknown_203B09A = store;
gUnknown_203B09C = store;
UpdateBGControlRegisters();
if(gUnknown_203B099 != 0)
UpdateSound();
UpdateInput();
gUnknown_203B099 = store;
gUnknown_203B0A4 = gUnknown_203B0A0;
}
}
#else
NAKED
void xxx_update_bg_sound_input(void)
{
asm_unified("\tpush {r4,r5,lr}\n"
"\tldr r1, _0800BACC\n"
"\tldrb r4, [r1]\n"
"\tcmp r4, 0\n"
"\tbeq _0800BAD4\n"
"\tldr r1, _0800BAD0\n"
"\tldr r0, [r1]\n"
"\tadds r0, 0x1\n"
"\tstr r0, [r1]\n"
"\tb _0800BAFE\n"
"\t.align 2, 0\n"
"_0800BACC: .4byte gUnknown_203B09B\n"
"_0800BAD0: .4byte gUnknown_203B09C\n"
"_0800BAD4:\n"
"\tmovs r0, 0x1\n"
"\tstrb r0, [r1]\n"
"\tldr r0, _0800BB04\n"
"\tstrb r4, [r0]\n"
"\tldr r0, _0800BB08\n"
"\tstr r4, [r0]\n"
"\tbl UpdateBGControlRegisters\n"
"\tldr r5, _0800BB0C\n"
"\tldrb r0, [r5]\n"
"\tcmp r0, 0\n"
"\tbeq _0800BAF0\n"
"\tbl UpdateSound\n"
"_0800BAF0:\n"
"\tbl UpdateInput\n"
"\tstrb r4, [r5]\n"
"\tldr r0, _0800BB10\n"
"\tldr r1, _0800BB14\n"
"\tldr r1, [r1]\n"
"\tstr r1, [r0]\n"
"_0800BAFE:\n"
"\tpop {r4,r5}\n"
"\tpop {r0}\n"
"\tbx r0\n"
"\t.align 2, 0\n"
"_0800BB04: .4byte gUnknown_203B09A\n"
"_0800BB08: .4byte gUnknown_203B09C\n"
"_0800BB0C: .4byte gUnknown_203B099\n"
"_0800BB10: .4byte gUnknown_203B0A4\n"
"_0800BB14: .4byte gUnknown_203B0A0");
}
#endif
void Timer3Intr(void)
{
if(gUnknown_202D5F0[4])
gUnknown_202D5F0[4]();
SetInterruptFlag(INTR_FLAG_TIMER3);
}
// Unused
u32 sub_800BB34(void)
{
return gUnknown_203B0A0;
}
void nullsub_178(void)
{
}
// Unused
void sub_800BB44(void)
{
u16 ie_store;
u16 dispcnt_store;
bool8 interrupt_flag;
while(REG_KEYINPUT != 0x3ff){}
interrupt_flag = DisableInterrupts();
while(REG_VCOUNT <= 159){}
dispcnt_store = REG_DISPCNT;
REG_DISPCNT = 0x80;
*(vu16 *)BG_PLTT = 0x7fff;
ie_store = REG_IE;
REG_IE = INTR_FLAG_KEYPAD | INTR_FLAG_GAMEPAK;
REG_KEYCNT = 0x8304;
REG_IME = 1;
SoundBiasReset();
asm("swi 0x3");
SoundBiasSet();
REG_IME = 0;
REG_IE = ie_store;
REG_KEYCNT = 0;
REG_DISPCNT = dispcnt_store;
*(vu16 *)BG_PLTT = 0;
if(interrupt_flag)
EnableInterrupts();
while(REG_KEYINPUT != 0x3ff){}
}
void nullsub_17(void)
{
@ -104,9 +259,9 @@ void sub_800BD08(void)
m4aSoundInit();
gUnknown_202D688 = 0;
gUnknown_202D68A = 0x3e7;
gUnknown_202D68C = 0x3e7;
gBGMusicPlayerState = 0;
gCurrentBGSong = 999;
gUnknown_202D68C = 999;
gUnknown_202D68E = 0x3e5;
gUnknown_202D690 = 0;
gUnknown_202D692 = 0;
@ -138,18 +293,18 @@ void sub_800BDDC(void)
}
void sub_800BDFC(u16 songIndex)
void StartNewBGM(u16 songIndex)
{
bool8 interrupt_flag;
u16 temp_store;
if(!IsBGSong(songIndex))
return;
if(songIndex == 0x3e7)
if(songIndex == 999)
return;
if(songIndex == gUnknown_202D68A)
if(songIndex == gCurrentBGSong)
{
temp_store = gUnknown_202D688 - 1;
temp_store = gBGMusicPlayerState - 1;
if(temp_store <= 1)
return;
}
@ -159,12 +314,12 @@ void sub_800BDFC(u16 songIndex)
return;
}
interrupt_flag = DisableInterrupts();
gUnknown_202D68A = songIndex;
gCurrentBGSong = songIndex;
gUnknown_202D694 = 1;
if(gUnknown_202D690 == 0)
{
gUnknown_202D688 = 1;
gBGMusicPlayerState = 1;
m4aSongNumStart(songIndex);
}
if(interrupt_flag)
@ -178,11 +333,11 @@ void FadeInNewBGM(u16 SongIndex, u16 speed)
if(!IsBGSong(SongIndex))
return;
if(SongIndex == 0x3e7)
if(SongIndex == 999)
return;
if(SongIndex == gUnknown_202D68A)
if(SongIndex == gCurrentBGSong)
{
temp_store = gUnknown_202D688 - 1;
temp_store = gBGMusicPlayerState - 1;
if((temp_store) <= 1)
return;
}
@ -201,12 +356,12 @@ void FadeInNewBGM(u16 SongIndex, u16 speed)
}
interrupt_flag = DisableInterrupts();
gUnknown_202D68A = SongIndex;
gCurrentBGSong = SongIndex;
gUnknown_202D694 = 1;
if(gUnknown_202D690 == 0)
{
gUnknown_202D688 = 1;
gBGMusicPlayerState = 1;
m4aSongNumStart(SongIndex);
m4aMPlayImmInit(&gUnknown_20008F0);
m4aMPlayVolumeControl(&gUnknown_20008F0, 0xFF, 0);
@ -219,10 +374,10 @@ void FadeInNewBGM(u16 SongIndex, u16 speed)
void sub_800BF48(u16 SongIndex)
{
u16 preload = gUnknown_202D68A;
if(preload == 0x3e7)
u16 preload = gCurrentBGSong;
if(preload == 999)
{
sub_800BDFC(SongIndex);
StartNewBGM(SongIndex);
gUnknown_202D68C = preload;
return;
}
@ -234,13 +389,13 @@ void sub_800BF80(void)
bool8 interrupt_flag = DisableInterrupts();
if(gUnknown_202D690 == 0)
{
if(gUnknown_202D68A != 0x3e7)
if(gCurrentBGSong != 999)
{
m4aMPlayStop(&gUnknown_20008F0);
}
}
gUnknown_202D68A = 0x3e7;
gUnknown_202D68C = 0x3e7;
gCurrentBGSong = 999;
gUnknown_202D68C = 999;
if(interrupt_flag)
EnableInterrupts();
}
@ -267,30 +422,30 @@ void sub_800BFD0(u16 speed)
interrupt_flag = DisableInterrupts();
if(gUnknown_202D690 == 0)
{
if(gUnknown_202D68A != 0x3e7)
if(gCurrentBGSong != 999)
{
if(gUnknown_202D688 == 2)
if(gBGMusicPlayerState == 2)
{
gUnknown_202D688 = 3;
gBGMusicPlayerState = 3;
m4aMPlayFadeOut(&gUnknown_20008F0, speed);
}
else
{
gUnknown_202D68A = 0x3e7;
gCurrentBGSong = 999;
m4aMPlayStop(&gUnknown_20008F0);
}
}
}
else
{
gUnknown_202D68A = 0x3e7;
gCurrentBGSong = 999;
}
gUnknown_202D68C = 0x3e7;
gUnknown_202D68C = 999;
if(interrupt_flag)
EnableInterrupts();
}
u16 sub_800C068(void)
u16 GetCurrentBGSong(void)
{
return gUnknown_202D68A;
return gCurrentBGSong;
}

View File

@ -2,6 +2,7 @@
#include "flash.h"
#include "memory.h"
#include "save.h"
#include "event_flag.h"
struct UnkStruct_sub_8011DAC {
u8 fill000[0x4];
@ -44,7 +45,6 @@ extern volatile struct UnkStruct_203B184 *gUnknown_203B184;
extern void* MemoryAlloc(u32 a, u32 b);
extern void MemoryFree(void* a);
extern void SetRngState(s32 state);
extern bool8 sub_8002718(u8 *a);
extern bool8 sub_800DAB0(u16, u8*, s32);
extern bool8 sub_800DAB4(u16, u8*, s32);
extern bool8 sub_800DAB8(void);

View File

@ -11,27 +11,6 @@ struct UnkSaveStruct1
/* 0xA */ u8 unkA;
};
struct UnkStruct
{
/* 0x0 */ u8 unk0;
/* 0x1 */ u8 unk1;
/* 0x2 */ u8 unk2;
/* 0x3 */ u8 unk3;
/* 0x4 */ u8 unk4;
/* 0x5 */ u32 unk5;
/* 0x9 */ u32 unk9;
/* 0xD */ u32 unkD;
/* 0x12 */ u32 unk11;
/* 0x16 */ u32 unk15;
/* 0x1A */ u32 unk19;
/* 0x1E */ u32 unk1D;
/* 0x24 */ u32 unk24;
/* 0x28 */ u8 unk28;
/* 0x29 */ u8 unk29;
/* 0x2A */ u8 unk2A;
/* 0x2B */ u8 unk2B;
/* 0x2C */ u8 unk2C;
};
extern void MemoryFree(void *);
extern void sub_8011860();
@ -46,8 +25,6 @@ extern void xxx_call_update_bg_vram();
extern void sub_8009908();
extern void xxx_call_update_bg_sound_input();
extern void ResetSprites(u8 r0);
extern u32 sub_8012AE8(void);
extern void nullsub_34(struct UnkStruct *r0);
extern struct UnkSaveStruct1 *gUnknown_203B46C;
@ -79,52 +56,3 @@ void sub_8012A18()
ResetSprites(0);
}
u32 sub_8012A64(struct UnkStruct *r0, u32 r1)
{
if(r0 == NULL)
{
return sub_8012AE8();
}
if(r1 != -1)
{
nullsub_34(r0);
}
if(r0->unk1 != 0)
{
r0->unk1 = 0;
return 1;
}
if(r0->unk2 == 0)
{
return sub_8012AE8();
}
r0->unk2 = r0->unk1;
return 2;
}
// TODO match that one line
//u32 GetKeyPress(struct UnkStruct *r0)
//{
// if(r0 == NULL)
// {
// return sub_8012AE8();
// }
// // TODO it's not a struct access..
// if(r0->unk29 != 0)
// {
// return 1;
// }
// if(r0->unk2A != 0)
// {
// return 2;
// }
// if(r0->unk2C != 0)
// {
// return 9;
// }
// if(r0->unk2B == 0)
// {
// return sub_8012AE8();
// }
// return 0xA;
//}

View File

@ -256,7 +256,7 @@ gDecompressBufferCurrent = .; /* 202D4B0 */
gDecompressBufferByteInInt = .; /* 202D4B4 */
. += 0x4;
gUnknown_202D4B8 = .; /* 202D4B8 */
IntrMain_Buffer = .; /* 202D4B8 */
. += 0x120;
gIntrTable = .; /* 202D5D8 */
@ -271,10 +271,10 @@ gUnknown_202D608 = .; /* 202D608 */
gUnknown_202D648 = .; /* 202D648 */
. += 0x40;
gUnknown_202D688 = .; /* 202D688 */
gBGMusicPlayerState = .; /* 202D688 */
. += 0x2;
gUnknown_202D68A = .; /* 202D68A */
gCurrentBGSong = .; /* 202D68A */
. += 0x2;
gUnknown_202D68C = .; /* 202D68C */