Sese's vacation work

This commit is contained in:
Seth Barberee 2021-07-07 11:39:34 -05:00
parent f308c79eba
commit 6aa475c631
65 changed files with 17405 additions and 17860 deletions

View File

@ -4500,211 +4500,4 @@ _08094820: .4byte gUnknown_81139B8
_08094824: .4byte gUnknown_81139CC
thumb_func_end sub_8094558
thumb_func_start sub_8094828
sub_8094828:
push {lr}
lsls r0, 16
lsrs r2, r0, 16
lsls r1, 24
lsrs r0, r1, 24
cmp r0, 0
beq _08094852
bl GetItemType
lsls r0, 24
lsrs r0, 24
cmp r0, 0x9
bne _0809484C
ldr r0, _08094848
b _08094856
.align 2, 0
_08094848: .4byte 0x00000223
_0809484C:
movs r0, 0x89
lsls r0, 2
b _08094856
_08094852:
lsls r0, r2, 16
asrs r0, 16
_08094856:
pop {r1}
bx r1
thumb_func_end sub_8094828
thumb_func_start sub_809485C
sub_809485C:
str r1, [r0]
movs r3, 0
str r3, [r0, 0x8]
str r3, [r0, 0xC]
adds r1, r2
str r1, [r0, 0x4]
bx lr
thumb_func_end sub_809485C
thumb_func_start sub_809486C
sub_809486C:
push {lr}
str r1, [r0]
movs r3, 0
str r3, [r0, 0x8]
str r3, [r0, 0xC]
adds r3, r1, r2
str r3, [r0, 0x4]
adds r0, r1, 0
adds r1, r2, 0
bl MemoryClear8
pop {r0}
bx r0
thumb_func_end sub_809486C
thumb_func_start nullsub_102
nullsub_102:
bx lr
thumb_func_end nullsub_102
thumb_func_start sub_809488C
sub_809488C:
push {r4-r7,lr}
adds r3, r0, 0
adds r4, r2, 0
movs r5, 0
adds r6, r1, 0
cmp r4, 0
beq _080948DE
movs r7, 0x1
_0809489C:
ldrb r0, [r6]
asrs r0, r5
ands r0, r7
cmp r0, 0
beq _080948B4
ldr r2, [r3]
ldr r1, [r3, 0x8]
adds r0, r7, 0
lsls r0, r1
ldrb r1, [r2]
orrs r0, r1
strb r0, [r2]
_080948B4:
adds r5, 0x1
cmp r5, 0x8
bne _080948BE
adds r6, 0x1
movs r5, 0
_080948BE:
ldr r0, [r3, 0x8]
adds r0, 0x1
str r0, [r3, 0x8]
cmp r0, 0x8
bne _080948D2
ldr r0, [r3]
adds r0, 0x1
str r0, [r3]
movs r0, 0
str r0, [r3, 0x8]
_080948D2:
ldr r0, [r3, 0xC]
adds r0, 0x1
str r0, [r3, 0xC]
subs r4, 0x1
cmp r4, 0
bne _0809489C
_080948DE:
pop {r4-r7}
pop {r0}
bx r0
thumb_func_end sub_809488C
thumb_func_start sub_80948E4
sub_80948E4:
push {r4-r6,lr}
adds r4, r0, 0
adds r5, r2, 0
adds r6, r1, 0
cmp r5, 0
beq _0809491C
_080948F0:
ldrb r1, [r6]
ldr r0, [r4, 0x8]
lsls r1, r0
ldr r3, [r4]
ldrb r2, [r3]
adds r0, r1, 0
orrs r0, r2
strb r0, [r3]
ldr r2, [r4]
adds r0, r2, 0x1
str r0, [r4]
asrs r1, 8
ldrb r0, [r2, 0x1]
orrs r1, r0
strb r1, [r2, 0x1]
adds r6, 0x1
ldr r0, [r4, 0xC]
adds r0, 0x8
str r0, [r4, 0xC]
subs r5, 0x1
cmp r5, 0
bne _080948F0
_0809491C:
pop {r4-r6}
pop {r0}
bx r0
thumb_func_end sub_80948E4
thumb_func_start sub_8094924
sub_8094924:
push {r4-r7,lr}
adds r3, r0, 0
adds r5, r2, 0
movs r6, 0
adds r2, r1, 0
cmp r5, 0
beq _08094978
_08094932:
cmp r6, 0
bne _08094938
strb r6, [r2]
_08094938:
ldr r7, [r3]
ldrb r0, [r7]
ldr r4, [r3, 0x8]
asrs r0, r4
movs r1, 0x1
ands r0, r1
cmp r0, 0
beq _08094952
adds r0, r1, 0
lsls r0, r6
ldrb r1, [r2]
orrs r0, r1
strb r0, [r2]
_08094952:
adds r6, 0x1
cmp r6, 0x8
bne _0809495C
adds r2, 0x1
movs r6, 0
_0809495C:
adds r0, r4, 0x1
str r0, [r3, 0x8]
cmp r0, 0x8
bne _0809496C
adds r0, r7, 0x1
str r0, [r3]
movs r0, 0
str r0, [r3, 0x8]
_0809496C:
ldr r0, [r3, 0xC]
adds r0, 0x1
str r0, [r3, 0xC]
subs r5, 0x1
cmp r5, 0
bne _08094932
_08094978:
pop {r4-r7}
pop {r0}
bx r0
thumb_func_end sub_8094924
.align 2,0 @ Don't pad with nop

View File

@ -338,269 +338,4 @@ _080981D4:
_080981D8: .4byte gUnknown_203B498
thumb_func_end sub_80981A0
thumb_func_start IsExclusivePokemonUnlocked
IsExclusivePokemonUnlocked:
push {r4,r5,lr}
lsls r0, 16
asrs r3, r0, 16
movs r1, 0
ldr r4, _080981FC
ldr r2, _08098200
_080981E8:
movs r5, 0
ldrsh r0, [r2, r5]
cmp r0, r3
bne _08098204
ldr r0, [r4]
adds r0, 0x58
adds r0, r1
ldrb r0, [r0]
b _0809820E
.align 2, 0
_080981FC: .4byte gUnknown_203B498
_08098200: .4byte gExclusivePokemon
_08098204:
adds r2, 0x4
adds r1, 0x1
cmp r1, 0xB
ble _080981E8
movs r0, 0x1
_0809820E:
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end IsExclusivePokemonUnlocked
thumb_func_start UnlockExclusivePokemon
UnlockExclusivePokemon:
push {r4-r6,lr}
lsls r0, 16
asrs r3, r0, 16
movs r1, 0
ldr r5, _08098240
movs r4, 0x1
ldr r2, _08098244
_08098222:
movs r6, 0
ldrsh r0, [r2, r6]
cmp r0, r3
bne _08098232
ldr r0, [r5]
adds r0, 0x58
adds r0, r1
strb r4, [r0]
_08098232:
adds r2, 0x4
adds r1, 0x1
cmp r1, 0xB
ble _08098222
pop {r4-r6}
pop {r0}
bx r0
.align 2, 0
_08098240: .4byte gUnknown_203B498
_08098244: .4byte gExclusivePokemon
thumb_func_end UnlockExclusivePokemon
thumb_func_start WriteExclusivePokemon
WriteExclusivePokemon:
push {r4-r7,lr}
mov r7, r9
mov r6, r8
push {r6,r7}
sub sp, 0x8
adds r7, r0, 0
mov r5, sp
adds r5, 0x3
movs r0, 0xFF
strb r0, [r5]
add r4, sp, 0x4
movs r0, 0
strb r0, [r4]
ldr r0, _08098300
ldr r1, [r0]
adds r0, r7, 0
movs r2, 0x1
bl sub_809488C
movs r6, 0
mov r9, r5
mov r8, r4
mov r4, sp
adds r4, 0x1
mov r5, sp
adds r5, 0x2
_0809827C:
lsls r0, r6, 16
asrs r0, 16
bl sub_8098134
mov r1, sp
strb r0, [r1]
adds r0, r7, 0
movs r2, 0x1
bl sub_809488C
adds r6, 0x1
ldr r0, _08098304
cmp r6, r0
ble _0809827C
movs r6, 0
_0809829A:
lsls r0, r6, 24
lsrs r0, 24
bl sub_8098100
strb r0, [r4]
adds r0, r7, 0
adds r1, r4, 0
movs r2, 0x1
bl sub_809488C
adds r6, 0x1
cmp r6, 0x3F
ble _0809829A
movs r6, 0
adds r4, r5, 0
_080982B8:
adds r0, r6, 0
bl sub_80981A0
strb r0, [r4]
adds r0, r7, 0
adds r1, r4, 0
movs r2, 0x1
bl sub_809488C
adds r6, 0x1
cmp r6, 0x1E
ble _080982B8
movs r6, 0
_080982D2:
ldr r0, _08098300
ldr r0, [r0]
adds r0, 0x58
adds r0, r6
ldrb r0, [r0]
mov r1, r8
cmp r0, 0
beq _080982E4
mov r1, r9
_080982E4:
adds r0, r7, 0
movs r2, 0x1
bl sub_809488C
adds r6, 0x1
cmp r6, 0xB
ble _080982D2
add sp, 0x8
pop {r3,r4}
mov r8, r3
mov r9, r4
pop {r4-r7}
pop {r0}
bx r0
.align 2, 0
_08098300: .4byte gUnknown_203B498
_08098304: .4byte 0x000001a7
thumb_func_end WriteExclusivePokemon
thumb_func_start ReadExclusivePokemon
ReadExclusivePokemon:
push {r4-r7,lr}
mov r7, r8
push {r7}
sub sp, 0x4
adds r6, r0, 0
ldr r4, _080983D0
ldr r0, [r4]
movs r1, 0
movs r2, 0x64
bl memset
ldr r1, [r4]
adds r0, r6, 0
movs r2, 0x1
bl sub_8094924
movs r4, 0
mov r5, sp
adds r5, 0x1
mov r7, sp
adds r7, 0x2
movs r0, 0x3
add r0, sp
mov r8, r0
_08098338:
adds r0, r6, 0
mov r1, sp
movs r2, 0x1
bl sub_8094924
mov r0, sp
ldrb r0, [r0]
cmp r0, 0
beq _08098352
lsls r0, r4, 16
asrs r0, 16
bl sub_80980B4
_08098352:
adds r4, 0x1
ldr r0, _080983D4
cmp r4, r0
ble _08098338
movs r4, 0
_0809835C:
adds r0, r6, 0
adds r1, r5, 0
movs r2, 0x1
bl sub_8094924
ldrb r0, [r5]
cmp r0, 0
beq _08098374
lsls r0, r4, 24
lsrs r0, 24
bl sub_8097FA8
_08098374:
adds r4, 0x1
cmp r4, 0x3F
ble _0809835C
movs r4, 0
adds r5, r7, 0
_0809837E:
adds r0, r6, 0
adds r1, r5, 0
movs r2, 0x1
bl sub_8094924
ldrb r0, [r5]
cmp r0, 0
beq _08098394
adds r0, r4, 0
bl sub_8098170
_08098394:
adds r4, 0x1
cmp r4, 0x1E
ble _0809837E
movs r4, 0
_0809839C:
adds r0, r6, 0
mov r1, r8
movs r2, 0x1
bl sub_8094924
ldr r0, _080983D0
ldr r1, [r0]
adds r1, 0x58
adds r1, r4
mov r0, sp
adds r0, 0x3
ldrb r2, [r0]
movs r0, 0x1
ands r0, r2
strb r0, [r1]
adds r4, 0x1
cmp r4, 0xB
ble _0809839C
bl sub_8097FF8
add sp, 0x4
pop {r3}
mov r8, r3
pop {r4-r7}
pop {r0}
bx r0
.align 2, 0
_080983D0: .4byte gUnknown_203B498
_080983D4: .4byte 0x000001a7
thumb_func_end ReadExclusivePokemon
.align 2,0

16376
asm/friend_list_menu.s Normal file

File diff suppressed because it is too large Load Diff

View File

@ -4525,682 +4525,4 @@ _08034D48:
_08034D50: .4byte gUnknown_203B33C
thumb_func_end sub_8034C98
thumb_func_start sub_8034D54
sub_8034D54:
push {lr}
sub sp, 0x4
mov r0, sp
bl sub_80144A4
cmp r0, 0
bne _08034D6E
movs r0, 0x65
bl sub_80338C4
movs r0, 0
bl PrepareSavePakWrite
_08034D6E:
add sp, 0x4
pop {r0}
bx r0
thumb_func_end sub_8034D54
thumb_func_start sub_8034D74
sub_8034D74:
push {r4,r5,lr}
sub sp, 0x44
bl sub_80154F0
adds r4, r0, 0
add r0, sp, 0x14
movs r1, 0
movs r2, 0x30
bl MemoryFill8
cmp r4, 0x2
bne _08034D8E
b _08034E9C
_08034D8E:
cmp r4, 0x3
beq _08034D94
b _08034EBC
_08034D94:
ldr r0, _08034DB4
ldr r1, [r0]
adds r1, 0x8
movs r0, 0x20
add r2, sp, 0x14
bl sub_8039068
subs r0, 0x7
cmp r0, 0x11
bhi _08034E90
lsls r0, 2
ldr r1, _08034DB8
adds r0, r1
ldr r0, [r0]
mov pc, r0
.align 2, 0
_08034DB4: .4byte gUnknown_203B33C
_08034DB8: .4byte _08034DBC
.align 2, 0
_08034DBC:
.4byte _08034E90
.4byte _08034E90
.4byte _08034E90
.4byte _08034E90
.4byte _08034E38
.4byte _08034E90
.4byte _08034E90
.4byte _08034E90
.4byte _08034E90
.4byte _08034E90
.4byte _08034E04
.4byte _08034E90
.4byte _08034E90
.4byte _08034E30
.4byte _08034E90
.4byte _08034E90
.4byte _08034E90
.4byte _08034E54
_08034E04:
ldr r0, _08034E28
ldr r3, _08034E2C
movs r2, 0
str r2, [sp]
movs r1, 0x4
str r1, [sp, 0x4]
str r2, [sp, 0x8]
str r2, [sp, 0xC]
adds r1, 0xFD
str r1, [sp, 0x10]
movs r1, 0
movs r2, 0x6
bl sub_8014248
movs r0, 0x74
bl sub_80338C4
b _08034E90
.align 2, 0
_08034E28: .4byte gUnknown_80E48A8
_08034E2C: .4byte gUnknown_80E2440
_08034E30:
ldr r0, _08034E34
b _08034E3A
.align 2, 0
_08034E34: .4byte gUnknown_80E49C4
_08034E38:
ldr r0, _08034E4C
_08034E3A:
ldr r3, _08034E50
movs r1, 0
movs r2, 0
bl sub_80141B4
movs r0, 0x6B
bl sub_80338C4
b _08034E90
.align 2, 0
_08034E4C: .4byte gUnknown_80E4704
_08034E50: .4byte 0x00000101
_08034E54:
ldr r1, [sp, 0x24]
movs r0, 0x4
bl sub_809539C
lsls r0, 24
lsrs r0, 24
bl sub_8095228
adds r2, r0, 0
add r1, sp, 0x14
ldm r1!, {r3-r5}
stm r2!, {r3-r5}
ldm r1!, {r3-r5}
stm r2!, {r3-r5}
ldm r1!, {r3-r5}
stm r2!, {r3-r5}
ldm r1!, {r3-r5}
stm r2!, {r3-r5}
movs r1, 0x6
strb r1, [r0]
ldr r0, _08034E98
ldr r0, [r0]
movs r1, 0x84
lsls r1, 3
adds r0, r1
ldr r1, [sp, 0x24]
str r1, [r0]
movs r0, 0x6D
bl sub_80338C4
_08034E90:
bl sub_80155F0
b _08034EBC
.align 2, 0
_08034E98: .4byte gUnknown_203B33C
_08034E9C:
bl sub_80155F0
bl ResetUnusedInputStruct
ldr r0, _08034EC4
ldr r0, [r0]
movs r3, 0xEF
lsls r3, 2
adds r0, r3
movs r1, 0x1
movs r2, 0x1
bl sub_800641C
movs r0, 0x1
bl sub_80338C4
_08034EBC:
add sp, 0x44
pop {r4,r5}
pop {r0}
bx r0
.align 2, 0
_08034EC4: .4byte gUnknown_203B33C
thumb_func_end sub_8034D74
thumb_func_start sub_8034EC8
sub_8034EC8:
push {lr}
sub sp, 0x4
mov r0, sp
bl sub_80144A4
cmp r0, 0
bne _08034EEA
bl WriteSavePak
lsls r0, 24
cmp r0, 0
bne _08034EEA
bl FinishWriteSavePak
movs r0, 0x2
bl sub_80338C4
_08034EEA:
add sp, 0x4
pop {r0}
bx r0
thumb_func_end sub_8034EC8
thumb_func_start sub_8034EF0
sub_8034EF0:
push {lr}
sub sp, 0x4
mov r0, sp
bl sub_80144A4
cmp r0, 0
bne _08034F12
bl WriteSavePak
lsls r0, 24
cmp r0, 0
bne _08034F12
bl FinishWriteSavePak
movs r0, 0x2
bl sub_80338C4
_08034F12:
add sp, 0x4
pop {r0}
bx r0
thumb_func_end sub_8034EF0
thumb_func_start sub_8034F18
sub_8034F18:
push {lr}
sub sp, 0x4
mov r0, sp
bl sub_80144A4
cmp r0, 0
bne _08034F32
movs r0, 0x65
bl sub_80338C4
movs r0, 0
bl PrepareSavePakWrite
_08034F32:
add sp, 0x4
pop {r0}
bx r0
thumb_func_end sub_8034F18
thumb_func_start sub_8034F38
sub_8034F38:
push {lr}
sub sp, 0x4
mov r0, sp
bl sub_80144A4
cmp r0, 0
bne _08034F52
movs r0, 0x71
bl sub_80338C4
movs r0, 0
bl PrepareSavePakWrite
_08034F52:
add sp, 0x4
pop {r0}
bx r0
thumb_func_end sub_8034F38
thumb_func_start sub_8034F58
sub_8034F58:
push {lr}
sub sp, 0x4
mov r0, sp
bl sub_80144A4
cmp r0, 0
bne _08034F80
ldr r0, [sp]
cmp r0, 0x6
beq _08034F72
cmp r0, 0x8
beq _08034F7A
b _08034F80
_08034F72:
movs r0, 0x62
bl sub_80338C4
b _08034F80
_08034F7A:
movs r0, 0x1
bl sub_80338C4
_08034F80:
add sp, 0x4
pop {r0}
bx r0
thumb_func_end sub_8034F58
thumb_func_start sub_8034F88
sub_8034F88:
push {r4,r5,lr}
sub sp, 0x4
mov r0, sp
bl sub_80144A4
cmp r0, 0
bne _0803500E
ldr r0, [sp]
cmp r0, 0x7
beq _08035000
cmp r0, 0x7
bgt _08034FA6
cmp r0, 0x6
beq _08034FAC
b _0803500E
_08034FA6:
cmp r0, 0x8
beq _08035008
b _0803500E
_08034FAC:
ldr r4, _08034FF0
ldr r0, [r4]
movs r1, 0x86
lsls r1, 2
adds r0, r1
ldrb r0, [r0]
bl sub_8095228
adds r2, r0, 0
ldr r1, [r4]
ldr r3, _08034FF4
adds r0, r1, r3
ldrb r0, [r0]
cmp r0, 0
beq _08034FD2
ldr r5, _08034FF8
adds r0, r1, r5
ldr r0, [r0]
str r0, [r2, 0x20]
_08034FD2:
ldr r0, _08034FFC
ldr r1, [r0]
ldr r0, [r4]
adds r0, r3
ldrb r0, [r0]
lsls r0, 1
adds r1, 0x50
adds r1, r0
ldrh r0, [r1]
subs r0, 0x1
strh r0, [r1]
movs r0, 0x75
bl sub_80338C4
b _0803500E
.align 2, 0
_08034FF0: .4byte gUnknown_203B33C
_08034FF4: .4byte 0x0000041e
_08034FF8: .4byte 0x0000041c
_08034FFC: .4byte gUnknown_203B460
_08035000:
movs r0, 0x57
bl sub_80338C4
b _0803500E
_08035008:
movs r0, 0x1
bl sub_80338C4
_0803500E:
add sp, 0x4
pop {r4,r5}
pop {r0}
bx r0
thumb_func_end sub_8034F88
thumb_func_start sub_8035018
sub_8035018:
push {lr}
sub sp, 0x4
mov r0, sp
bl sub_80144A4
cmp r0, 0
bne _08035032
movs r0, 0x76
bl sub_80338C4
movs r0, 0
bl PrepareSavePakWrite
_08035032:
add sp, 0x4
pop {r0}
bx r0
thumb_func_end sub_8035018
thumb_func_start sub_8035038
sub_8035038:
push {lr}
sub sp, 0x4
mov r0, sp
bl sub_80144A4
cmp r0, 0
bne _0803508E
bl WriteSavePak
lsls r0, 24
cmp r0, 0
bne _0803508E
bl FinishWriteSavePak
ldr r0, _0803506C
ldr r0, [r0]
ldr r1, _08035070
adds r0, r1
ldr r0, [r0]
cmp r0, 0xD
beq _08035080
cmp r0, 0xD
bls _08035074
cmp r0, 0xE
beq _08035088
b _0803508E
.align 2, 0
_0803506C: .4byte gUnknown_203B33C
_08035070: .4byte 0x00000524
_08035074:
cmp r0, 0xB
bcc _0803508E
movs r0, 0x69
bl sub_80338C4
b _0803508E
_08035080:
movs r0, 0x66
bl sub_80338C4
b _0803508E
_08035088:
movs r0, 0x4B
bl sub_80338C4
_0803508E:
add sp, 0x4
pop {r0}
bx r0
thumb_func_end sub_8035038
thumb_func_start sub_8035094
sub_8035094:
push {lr}
sub sp, 0x4
mov r0, sp
bl sub_80144A4
cmp r0, 0
bne _080350EE
ldr r0, [sp]
cmp r0, 0x8
beq _080350E8
cmp r0, 0x16
bne _080350EE
ldr r0, _080350C4
ldr r0, [r0]
ldr r1, _080350C8
adds r0, r1
ldr r0, [r0]
cmp r0, 0xD
beq _080350D8
cmp r0, 0xD
bls _080350CC
cmp r0, 0xE
beq _080350E0
b _080350EE
.align 2, 0
_080350C4: .4byte gUnknown_203B33C
_080350C8: .4byte 0x00000524
_080350CC:
cmp r0, 0xB
bcc _080350EE
movs r0, 0x69
bl sub_80338C4
b _080350EE
_080350D8:
movs r0, 0x66
bl sub_80338C4
b _080350EE
_080350E0:
movs r0, 0x4B
bl sub_80338C4
b _080350EE
_080350E8:
movs r0, 0x1
bl sub_80338C4
_080350EE:
add sp, 0x4
pop {r0}
bx r0
thumb_func_end sub_8035094
thumb_func_start sub_80350F4
sub_80350F4:
push {lr}
sub sp, 0x4
mov r0, sp
bl sub_80144A4
cmp r0, 0
bne _08035176
ldr r0, [sp]
cmp r0, 0x15
beq _08035118
cmp r0, 0x15
bgt _08035112
cmp r0, 0x8
beq _08035170
b _08035176
_08035112:
cmp r0, 0x16
beq _08035134
b _08035176
_08035118:
movs r0, 0
bl sub_801CF14
lsls r0, 24
cmp r0, 0
beq _0803512C
movs r0, 0x56
bl sub_80338C4
b _08035176
_0803512C:
movs r0, 0x57
bl sub_80338C4
b _08035176
_08035134:
ldr r0, _0803514C
ldr r0, [r0]
ldr r1, _08035150
adds r0, r1
ldr r0, [r0]
cmp r0, 0xD
beq _08035160
cmp r0, 0xD
bls _08035154
cmp r0, 0xE
beq _08035168
b _08035176
.align 2, 0
_0803514C: .4byte gUnknown_203B33C
_08035150: .4byte 0x00000524
_08035154:
cmp r0, 0xB
bcc _08035176
movs r0, 0x69
bl sub_80338C4
b _08035176
_08035160:
movs r0, 0x66
bl sub_80338C4
b _08035176
_08035168:
movs r0, 0x4B
bl sub_80338C4
b _08035176
_08035170:
movs r0, 0x1
bl sub_80338C4
_08035176:
add sp, 0x4
pop {r0}
bx r0
thumb_func_end sub_80350F4
thumb_func_start sub_803517C
sub_803517C:
push {lr}
sub sp, 0x4
mov r0, sp
bl sub_80144A4
cmp r0, 0
bne _080351DA
ldr r0, [sp]
cmp r0, 0x6
beq _08035196
cmp r0, 0x8
beq _080351D4
b _080351DA
_08035196:
ldr r0, _080351B0
ldr r0, [r0]
ldr r1, _080351B4
adds r0, r1
ldr r0, [r0]
cmp r0, 0xD
beq _080351C4
cmp r0, 0xD
bls _080351B8
cmp r0, 0xE
beq _080351CC
b _080351DA
.align 2, 0
_080351B0: .4byte gUnknown_203B33C
_080351B4: .4byte 0x00000524
_080351B8:
cmp r0, 0xB
bcc _080351DA
movs r0, 0x69
bl sub_80338C4
b _080351DA
_080351C4:
movs r0, 0x66
bl sub_80338C4
b _080351DA
_080351CC:
movs r0, 0x4B
bl sub_80338C4
b _080351DA
_080351D4:
movs r0, 0x1
bl sub_80338C4
_080351DA:
add sp, 0x4
pop {r0}
bx r0
thumb_func_end sub_803517C
thumb_func_start sub_80351E0
sub_80351E0:
push {lr}
sub sp, 0x4
mov r0, sp
bl sub_80144A4
cmp r0, 0
bne _08035208
ldr r0, [sp]
cmp r0, 0x6
beq _080351FA
cmp r0, 0x8
beq _08035202
b _08035208
_080351FA:
movs r0, 0x72
bl sub_80338C4
b _08035208
_08035202:
movs r0, 0x1
bl sub_80338C4
_08035208:
add sp, 0x4
pop {r0}
bx r0
thumb_func_end sub_80351E0
thumb_func_start sub_8035210
sub_8035210:
push {lr}
sub sp, 0x4
mov r0, sp
bl sub_80144A4
cmp r0, 0
bne _0803528C
ldr r0, _08035238
ldr r2, [r0]
ldr r1, _0803523C
adds r0, r2, r1
ldr r1, [sp]
str r1, [r0]
cmp r1, 0xD
bgt _0803528C
cmp r1, 0xB
bge _08035240
cmp r1, 0x8
beq _08035286
b _0803528C
.align 2, 0
_08035238: .4byte gUnknown_203B33C
_0803523C: .4byte 0x00000524
_08035240:
movs r3, 0xA5
lsls r3, 3
adds r0, r2, r3
ldr r0, [r0]
cmp r0, 0x13
bne _08035272
movs r0, 0x5
bl sub_80953D4
lsls r0, 24
lsrs r0, 24
bl sub_8095228
adds r0, 0x22
ldrb r0, [r0]
cmp r0, 0
beq _0803526A
movs r0, 0x53
bl sub_80338C4
b _0803528C
_0803526A:
movs r0, 0x55
bl sub_80338C4
b _0803528C
_08035272:
cmp r1, 0xD
beq _0803527E
movs r0, 0x69
bl sub_80338C4
b _0803528C
_0803527E:
movs r0, 0x72
bl sub_80338C4
b _0803528C
_08035286:
movs r0, 0x1
bl sub_80338C4
_0803528C:
add sp, 0x4
pop {r0}
bx r0
thumb_func_end sub_8035210
.align 2,0

File diff suppressed because it is too large Load Diff

View File

@ -56,36 +56,36 @@ gUnknown_80D4830: @ 80D4830
.global gUnknown_80D485C
gUnknown_80D485C: @ 80D485C
.4byte Data_80D4878
.4byte Yes_80D4878
.byte 0x01, 0x00, 0x00, 0x00
.4byte Data_80D4874
.4byte No_80D4874
.byte 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00
.byte 0xFF, 0xFF, 0xFF, 0xFF
.4byte -1
.global Data_80D4874
Data_80D4874:
.global No_80D4874
No_80D4874:
.string "No\0"
.align 2,0
.global Data_80D4878
Data_80D4878:
.global Yes_80D4878
Yes_80D4878:
.string "*Yes\0"
.align 2,0
.global gUnknown_80D4880
gUnknown_80D4880: @ 80D4880
.4byte Data_80D489C
.4byte Yes_80D489C
.byte 0x01, 0x00, 0x00, 0x00
.4byte Data_80D4898
.4byte No_80D4898
.byte 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00 @ End of table
.byte 0xFF, 0xFF, 0xFF, 0xFF
.4byte -1
.global Data_80D4898
Data_80D4898:
.global No_80D4898
No_80D4898:
.string "*No\0"
.global Data_80D489C
Data_80D489C:
.global Yes_80D489C
Yes_80D489C:
.string "Yes\0"
.align 2,0

View File

@ -306,27 +306,89 @@ gUnknown_80E236C: @ 80E236C
.global gUnknown_80E23A8
gUnknown_80E23A8: @ 80E23A8
.incbin "baserom.gba", 0xE23A8, 0x48
@ replacing .incbin "baserom.gba", 0x000e23a8, 0x48
.4byte SendPokemon_80E23E0
.byte 0x0f, 0x00, 0x00, 0x00
.4byte DontSendPokemon_80E23C8
.byte 0x10, 0x00, 0x00, 0x00
.4byte Cancel_80E22A8
.byte 0x08, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00
.byte 0x08, 0x00, 0x00, 0x00
.global DontSendPokemon_80E23C8
DontSendPokemon_80E23C8:
.string "Don~27t Send Pokémon\0"
.align 2,0
.global SendPokemon_80E23E0
SendPokemon_80E23E0:
.string "Send Pokémon\0"
.align 2,0
.global gUnknown_80E23F0
gUnknown_80E23F0: @ 80E23F0
.incbin "baserom.gba", 0xE23F0, 0x18
@ replacing .incbin "baserom.gba", 0x000e23f0, 0x18
.byte 0x00, 0x00, 0x00, 0x00
.byte 0x03, 0x00, 0x00, 0x00
.byte 0x15, 0x00, 0x04, 0x00
.byte 0x06, 0x00, 0x05, 0x00
.byte 0x05, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00
.global gUnknown_80E2408
gUnknown_80E2408: @ 80E2408
.incbin "baserom.gba", 0xE2408, 0x38
@ replacing .incbin "baserom.gba", 0x000e2408, 0x38
.4byte Confirm_80E2364
.byte 0x09, 0x00, 0x00, 0x00
.4byte Info_80E2098
.byte 0x0a, 0x00, 0x00, 0x00
.4byte Cancel_80E22A8
.byte 0x05, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00
.byte 0x08, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00
.byte 0x03, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00
.global gUnknown_80E2440
gUnknown_80E2440: @ 80E2440
.incbin "baserom.gba", 0xE2440, 0x18
@ replacing .incbin "baserom.gba", 0x000e2440, 0x18
.4byte Yes_80E22B0
.byte 0x06, 0x00, 0x00, 0x00
.4byte Cancel_80E22A8
.byte 0x08, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00
.byte 0x08, 0x00, 0x00, 0x00
.global gUnknown_80E2458
gUnknown_80E2458: @ 80E2458
.incbin "baserom.gba", 0xE2458, 0x18
@ replacing .incbin "baserom.gba", 0x000e2458, 0x18
.4byte Yes_80E22B0
.byte 0x06, 0x00, 0x00, 0x00
.4byte No_80E22CC
.byte 0x07, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00
.byte 0x08, 0x00, 0x00, 0x00
.global gUnknown_80E2470
gUnknown_80E2470: @ 80E2470
.incbin "baserom.gba", 0xE2470, 0x40
@ replacing .incbin "baserom.gba", 0x000e2470, 0x40
.byte 0xa4, 0x24, 0x0e, 0x08
.byte 0x15, 0x00, 0x00, 0x00
.byte 0x90, 0x24, 0x0e, 0x08
.byte 0x16, 0x00, 0x00, 0x00
.byte 0xa8, 0x22, 0x0e, 0x08
.byte 0x08, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00
.byte 0x08, 0x00, 0x00, 0x00
.byte 0x44, 0x6f, 0x6e, 0x7e, 0x32, 0x37, 0x74, 0x20, 0x53, 0x65, 0x6e, 0x64, 0x20, 0x49, 0x74, 0x65, 0x6d, 0x00, 0x00, 0x00
.byte 0x53, 0x65, 0x6e, 0x64, 0x20, 0x49, 0x74, 0x65, 0x6d, 0x00, 0x00, 0x00
.global gUnknown_80E24B0
gUnknown_80E24B0: @ 80E24B0
@ -1041,7 +1103,7 @@ gUnknown_80E60A0: @ 80E60A0
.global gUnknown_80E60D4
gUnknown_80E60D4: @ 80E60D4
.4byte SendItem_80E60C8
.byte 0xFF, 0xFF, 0xFF, 0xFF
.4byte -1
.4byte ReceiveItem_80E60B8
.4byte 2
.4byte 0
@ -1938,7 +2000,7 @@ gUnknown_80E7894: @ 80E7894
.4byte GameLinkCable_80E78C8
.4byte 3
.4byte Password_80E78BC
.byte 0xFF, 0xFF, 0xFF, 0xFF
.4byte -1
.4byte Cancel_80E78B4
.4byte 8
.4byte 0

View File

@ -1,5 +1,5 @@
#ifndef ADVENTURE_LOG_H
#define ADVENTURE_LOG_H
#ifndef GUARD_ADVENTURE_LOG_H
#define GUARD_ADVENTURE_LOG_H
void CreateAdventureLogMenu(void);
void CleanAdventureLogMenu(void);

View File

@ -1,3 +1,6 @@
#ifndef GUARD_BG_H
#define GUARD_BG_H
struct BGControlStruct
{
u16 padding;
@ -16,3 +19,4 @@ void SetBGRegYOffset(s32 reg, s32 offset);
void UpdateBGControlRegisters(void);
void SetBGOBJEnableFlags(u32 mask);
#endif

View File

@ -1,7 +1,7 @@
#ifndef GUARD_code_800558C_H
#define GUARD_code_800558C_H
#ifndef GUARD_CODE_800558C_H
#define GUARD_CODE_800558C_H
extern void *gUnknown_203B078;
void sub_80060EC(void);
#endif //GUARD_code_800558C_H
#endif //GUARD_CODE_800558C_H

View File

@ -1,6 +1,6 @@
#ifndef GUARD_code_800B540_H
#define GUARD_code_800B540_H
#ifndef GUARD_CODE_800B540_H
#define GUARD_CODE_800B540_H
void sub_800CDA8(int a0);
#endif //GUARD_code_800B540_H
#endif //GUARD_CODE_800B540_H

View File

@ -1,5 +1,5 @@
#ifndef CODE_8041D5C_H
#define CODE_8041D5C_H
#ifndef GUARD_CODE_8041D5C_H
#define GUARD_CODE_8041D5C_H
struct subStruct_8048524
{

View File

@ -1,5 +1,5 @@
#ifndef GUARD_BG_MUSIC_H
#define GUARD_BG_MUSIC_H
#ifndef GUARD_CONSTANTS_BG_MUSIC_H
#define GUARD_CONSTANTS_BG_MUSIC_H
#define MUS_TEAM_BASE 1
#define MUS_FRIEND_AREA_SWAMP 2
@ -84,4 +84,4 @@
#define NUM_BG_SONGS 128
#endif //GUARD_BG_MUSIC_H
#endif //GUARD_CONSTANTS_BG_MUSIC_H

View File

@ -10,9 +10,6 @@ struct DebugLocation
char *func;
};
void FatalErrorHang();
void FatalErrorPrintFuncFileLine(const char *r0, struct DebugLocation *debug);
void FatalErrorFormatMessage(const char *text, ...);
void Log(u8 *buffer, const char *text, ...);
void NDS_DebugInit(void);
void nullsub_25(void);

View File

@ -1,3 +1,6 @@
#ifndef GUARD_EVENT_FLAG_H
#define GUARD_EVENT_FLAG_H
struct UnkEventStruct
{
/* 0x0 */ s16 *unk0;
@ -11,3 +14,5 @@ bool8 sub_8002700(void *r0);
bool8 sub_8002718(u8 *r0);
void sub_8002758(u32 *r0);
u8 sub_800276C(void);
#endif // GUARD_EVENT_FLAG_H

View File

@ -1,5 +1,5 @@
#ifndef EXCLUSIVE_POKEMON_H
#define EXCLUSIVE_POKEMON_H
#ifndef GUARD_EXCLUSIVE_POKEMON_H
#define GUARD_EXCLUSIVE_POKEMON_H
#define NUM_EXCLUSIVE_POKEMON 12
@ -12,7 +12,8 @@ struct ExclusivePokemon
struct ExclusivePokemonData
{
u8 fill0[0x58];
u8 fill0[0x48];
u32 unk48[4];
bool8 Exclusives[NUM_EXCLUSIVE_POKEMON];
};
@ -35,4 +36,4 @@ void LoadExclusivePokemon(void);
struct ExclusivePokemonData *GetExclusivePokemon(void);
void InitializeExclusivePokemon(void);
#endif // EXCLUSIVE_POKEMON_H
#endif // GUARD_EXCLUSIVE_POKEMON_H

View File

@ -1,5 +1,5 @@
#ifndef FELICITY_BANK_H
#define FELICITY_BANK_H
#ifndef GUARD_FELICITY_BANK_H
#define GUARD_FELICITY_BANK_H
#include "file_system.h"
#include "text.h"

View File

@ -1,5 +1,5 @@
#ifndef FRIEND_AREA_ACTION_MENU_H
#define FRIEND_AREA_ACTION_MENU_H
#ifndef GUARD_FRIEND_AREA_ACTION_MENU_H
#define GUARD_FRIEND_AREA_ACTION_MENU_H
struct unkSubStruct_203B2BC
{
@ -16,10 +16,7 @@ struct unkStruct_203B2BC
s16 unk8;
u16 unkA;
u32 unkC;
u8 unk10;
u8 unk11;
u8 unk12;
u8 unk13;
struct ItemStruct_203B460_ALT unk10;
u8 unk14;
u8 fill15[3];
struct unkSubStruct_203B2BC *unk18;

View File

@ -1,3 +1,6 @@
#ifndef GUARD_FRIEND_RESCUE_H
#define GUARD_FRIEND_RESCUE_H
struct WonderMailStruct_203B33C
{
// size: 0x568
@ -17,10 +20,12 @@ struct WonderMailStruct_203B33C
u8 padding8[0x4C];
u32 unk35C;
u8 padding5[0x5C];
u32 unk3BC;
u8 padding4[0x60];
struct UnkTextStruct2 unk3BC[4];
struct ItemStruct_203B460 unk41C;
u32 unk420; // Is this supposed to be a File like 203B2C4?
u8 fill424[0x52C - 0x424];
u8 fill424[0x524 - 0x424];
s32 unk524;
u32 unk528;
u8 unk52C;
u8 unk52D;
u8 fill52E;
@ -33,3 +38,5 @@ struct WonderMailStruct_203B33C
u8 filler546[0x564 - 0x546];
s32 unk564;
};
#endif

View File

@ -1,3 +1,6 @@
#ifndef GUARD_GUNKNOWN_203B418_H
#define GUARD_GUNKNOWN_203B418_H
#include "code_8041D5C.h"
struct unkStruct_203B418
@ -34,3 +37,5 @@ struct unkStruct_203B418
u8 padding2[3];
u8 unk18217;
};
#endif

View File

@ -1,12 +1,5 @@
#ifndef GUNKNOWN_203B460_H
#define GUNKNOWN_203B460_H
struct ItemStruct_203B460
{
u8 unk0;
u8 numItems;
u8 itemIndex;
};
#ifndef GUARD_GUNKNOWN_203B460_H
#define GUARD_GUNKNOWN_203B460_H
struct subStruct_203B460
{

View File

@ -1,5 +1,5 @@
#ifndef ITEMS_H
#define ITEMS_H
#ifndef GUARD_ITEMS_H
#define GUARD_ITEMS_H
struct Item
{
@ -21,6 +21,20 @@ struct Item
/* 0x1F */ u8 fill3;
};
struct ItemStruct_203B460
{
u8 unk0;
u8 numItems;
u8 itemIndex;
};
struct ItemStruct_203B460_ALT
{
u8 itemIndex;
u8 numItems;
u8 unk2;
};
enum ItemType
{
ITEM_TYPE_THROWABLE,
@ -69,5 +83,8 @@ u8 *GetItemDescription(u8 itemIndex);
u32 GetItemUnkFood(u8 itemIndex, u32 r1);
s32 sub_8090A34(void);
bool8 sub_8090A60(u8 itemIndex);
void sub_8090A8C(struct ItemStruct_203B460 *param_1,u8 itemIndex,u8 param_3);
void sub_8090B08(struct ItemStruct_203B460_ALT *param_1,u8 itemIndex);
void sub_8090B64(struct ItemStruct_203B460 *param_1, struct ItemStruct_203B460_ALT *param_2);
#endif

View File

@ -1,9 +1,9 @@
#ifndef KANGASKHAN_STORAGE_H
#define KANGASKHAN_STORAGE_H
#ifndef GUARD_KANGASKHAN_STORAGE_H
#define GUARD_KANGASKHAN_STORAGE_H
#include "text.h"
#include "menu.h"
#include "gUnknown_203B460.h"
#include "item.h"
struct unkStruct_203B208
{
@ -13,7 +13,7 @@ struct unkStruct_203B208
u32 unk8;
struct ItemStruct_203B460 unkC;
u32 unk10;
u8 unk14; // another itemIndex?
u8 itemIndex; // another itemIndex?
u8 fill15[0x3];
u32 unk18;
u32 unk1C;
@ -25,7 +25,8 @@ struct unkStruct_203B208
u32 unkA8;
u8 unkAC[0xBC - 0xAC];
u32 unkBC;
u8 unkC0[0xD8 - 0xC0];
u8 unkC0[0xD4 - 0xC0];
u32 unkD4;
struct OpenedFile *faceFile;
u8 *faceData;
u16 unkE0;

View File

@ -1,5 +1,5 @@
#ifndef KECLEON_ITEMS_H
#define KECLEON_ITEMS_H
#ifndef GUARD_KECLEON_ITEMS_H
#define GUARD_KECLEON_ITEMS_H
#include "gUnknown_203B460.h"
#include "text.h"
@ -42,4 +42,4 @@ struct unkStruct_203B210
struct UnkTextStruct2 unkE8[4];
};
#endif
#endif // GUARD_KECLEON_ITEMS_H

View File

@ -1,5 +1,5 @@
#ifndef MENU_H
#define MENU_H
#ifndef GUARD_MENU_H
#define GUARD_MENU_H
struct MenuItem
{
@ -7,4 +7,4 @@ struct MenuItem
u32 menuAction; // action??
};
#endif
#endif // GUARD_MENU_H

View File

@ -1,5 +1,5 @@
#ifndef PLAY_TIME_H
#define PLAY_TIME_H
#ifndef GUARD_PLAY_TIME_H
#define GUARD_PLAY_TIME_H
struct PlayTimeStruct
{
@ -16,5 +16,5 @@ void DeconstructPlayTime(struct PlayTimeStruct *r0, u32 *outHours, u32 *outMinut
void InitializePlayTime(void);
#endif // PLAY_TIME_H
#endif // GUARD_PLAY_TIME_H

View File

@ -1,5 +1,5 @@
#ifndef POKEMON_H
#define POKEMON_H
#ifndef GUARD_POKEMON_H
#define GUARD_POKEMON_H
#include "file_system.h"
@ -158,4 +158,4 @@ struct OpenedFile *OpenPokemonDialogueSpriteFile(s16 index);
struct OpenedFile *GetDialogueSpriteDataPtr(s16 index);
s32 GetUnownIndex(s16 index);
#endif // POKEMON_H
#endif // GUARD_POKEMON_H

View File

@ -1,5 +1,5 @@
#ifndef RESCUE_TEAM_INFO_H
#define RESCUE_TEAM_INFO_H
#ifndef GUARD_RESCUE_TEAM_INFO_H
#define GUARD_RESCUE_TEAM_INFO_H
#define TEAM_NAME_LENGTH 10
@ -38,4 +38,4 @@ u8 sub_80921B8(void);
u32 SaveRescueTeamInfo(u8 *param_1,u32 param_2);
u32 ReadRescueTeamInfo(u8 *param_1, u32 param_2);
#endif // RESCUE_TEAM_INFO_H
#endif // GUARD_RESCUE_TEAM_INFO_H

View File

@ -1,5 +1,5 @@
#ifndef SAVE_H
#define SAVE_H
#ifndef GUARD_SAVE_H
#define GUARD_SAVE_H
#include "play_time.h"
#include "exclusive_pokemon.h"
@ -107,4 +107,4 @@ u32 WriteSaveSector(s32 *a, u8 *src, s32 size);
void CalculateChecksum(u8 *out, u32 size);
bool8 ValidateChecksum(u8 *in, u32 size);
#endif
#endif // GUARD_SAVE_H

21
include/sub_8095228.h Normal file
View File

@ -0,0 +1,21 @@
struct unkStruct_8095228
{
u8 unk0;
u8 unk1;
u8 unk2;
u8 unk3;
u8 unk4;
u8 padding[0x10 - 0x5];
u32 unk10;
u8 padding2[0x20 - 0x14];
struct ItemStruct_203B460 unk20;
u8 padding3[0x28 - 0x24];
u32 unk28;
s8 unk2C;
u8 padding4[0x30 - 0x2D];
};
extern struct unkStruct_8095228 *sub_8095228(u8);

View File

@ -3,6 +3,7 @@
#include "file_system.h"
#include "text.h"
#include "item.h"
#define PASSWORD_BUFFER_SIZE 54
@ -60,14 +61,6 @@ struct WonderMailStruct_203B2C0
};
struct unkStruct_41C
{
u8 unk41C;
u8 unk41D;
u8 unk41E;
u8 unk41F;
};
struct WonderMailStruct_203B2C4
{
// size: 0x564
@ -85,7 +78,7 @@ struct WonderMailStruct_203B2C4
u8 filler310[0x35C - 0x310];
struct UnkTextStruct2 unk35C[4];
struct UnkTextStruct2 unk3BC[4];
struct unkStruct_41C unk41C;
struct ItemStruct_203B460 unk41C;
/* 0x420 */ struct OpenedFile *faceFile;
/* 0x424 */ u8 *faceData;
u16 unk428;

View File

@ -113,6 +113,7 @@ SECTIONS {
asm/code_801DCC4.o(.text);
src/gulpin_shop.o(.text);
asm/gulpin_shop.o(.text);
asm/friend_list_menu.o(.text);
src/friend_area_action_menu.o(.text);
asm/friend_area_action_menu.o(.text);
src/friend_area_action_menu_1.o(.text);
@ -205,6 +206,7 @@ SECTIONS {
asm/friend_area_1.o(.text);
src/friend_area_1.o(.text);
asm/code_8092334.o(.text);
src/code_8092334.o(.text);
src/game_options.o(.text);
asm/code_8094D28.o(.text);
src/play_time.o(.text);
@ -220,6 +222,7 @@ SECTIONS {
src/code_8097F40.o(.text);
src/exclusive_pokemon.o(.text);
asm/exclusive_pokemon.o(.text);
src/exclusive_pokemon_1.o(.text);
asm/code_80983D8.o(.text);
src/code_80983D8.o(.text);
asm/code_8098468.o(.text);

View File

@ -50,7 +50,7 @@ const u8 fill_adven[] = "pksdir0";
void sub_8032084();
void DisplayAdventureLog();
extern void sub_8013818(void *, u32, u32, u32);
extern u8 sub_8013938(void *);
extern bool8 sub_8013938(void *);
extern void sub_8013660(void *);
extern void PlayMenuSoundEffect(u32);
extern u32 GetKeyPress(void *);
@ -98,7 +98,7 @@ u32 HandleAdventureLogInput(u8 param_1)
PlayMenuSoundEffect(0);
return 3;
default:
if (sub_8013938(gAdventureLog) != '\0') {
if (sub_8013938(gAdventureLog)) {
sub_8032084();
DisplayAdventureLog();
return 1;

View File

@ -1,6 +1,7 @@
#include "global.h"
#include "bg.h"
#include "constants/bg_music.h"
#include "debug.h"
#include "file_system.h"
#include "friend_area.h"
#include "input.h"
@ -14,7 +15,6 @@
#include "pokemon.h"
#include "rescue_team_info.h"
extern void NDS_DebugInit(void);
extern void sub_801180C(void);
extern void NDS_LoadOverlay_GroundMain(void);
extern void sub_8014144(void);

View File

@ -1,6 +1,7 @@
#include "global.h"
#include "memory.h"
#include "text.h"
#include "item.h"
#include "gUnknown_203B460.h"
extern struct unkStruct_203B460 *gUnknown_203B460;

View File

@ -2,27 +2,21 @@
#include "text.h"
#include "input.h"
#include "memory.h"
#include "item.h"
#include "gUnknown_203B460.h"
struct subStruct_203B240
{
char * unk0;
char * pokeName;
char * unk4;
};
struct unkStruct_41C
{
u8 unk41C;
u8 unk41D;
u8 unk41E;
u8 unk41F;
};
// based off of 203B240..
struct unkStruct_203B230
{
// size: 0x94
s32 state;
struct unkStruct_41C unk4;
struct ItemStruct_203B460 unk4;
s32 unk8;
s32 unkC;
struct subStruct_203B240 *unk10[2];
@ -46,7 +40,7 @@ extern void sub_8014FF0(u32, u32, u8 *, u32, u32);
extern void PlayMenuSoundEffect(u32);
extern void sub_8013F84(void);
extern u32 sub_8012A64(u32 *, u32);
extern s32 sub_80913E0(struct unkStruct_41C *, u32, struct subStruct_203B240 **);
extern s32 sub_80913E0(struct ItemStruct_203B460 *, u32, struct subStruct_203B240 **);
extern void sub_801317C(u32 *);
extern void sub_80140B4(struct UnkTextStruct2 *);
@ -58,7 +52,7 @@ void sub_801B590();
void sub_801B480();
u32 sub_801B3C0(struct unkStruct_41C *param_1)
u32 sub_801B3C0(struct ItemStruct_203B460 *param_1)
{
ResetSprites(1);
gUnknown_203B230 = MemoryAlloc(sizeof(struct unkStruct_203B230),8);
@ -120,7 +114,7 @@ void sub_801B480(void)
sub_8008C54(gUnknown_203B230->unk24);
sub_80073B8(gUnknown_203B230->unk24);
preload = gUnknown_203B230->unk10[gUnknown_203B230->unk8];
strcpy(gAvailablePokemonNames, preload->unk0);
strcpy(gAvailablePokemonNames, preload->pokeName);
sub_8014FF0(16, 0, gUnknown_80DBA4C, gUnknown_203B230->unk24, 0); // $m0
sub_8014FF0(4, 16, gUnknown_203B230->unk10[gUnknown_203B230->unk8]->unk4, gUnknown_203B230->unk24, 0);
sub_80073E0(gUnknown_203B230->unk24);

View File

@ -2,6 +2,7 @@
#include "friend_area.h"
#include "constants/friend_area.h"
#include "file_system.h"
#include "item.h"
#include "gUnknown_203B460.h"
#include "memory.h"
#include "input.h"

160
src/code_8092334.c Normal file
View File

@ -0,0 +1,160 @@
#include "global.h"
#include "memory.h"
#include "item.h"
struct unkStruct_8094924
{
// size: 0x10?
u8 *unk0; // head?
u8 *unk4; // tail?
u32 unk8;
u32 unkC;
};
s16 sub_8094828(u16 r0, u8 itemIndex)
{
if(itemIndex != 0)
{
if(GetItemType(itemIndex) == ITEM_TYPE_ORB)
return 0x223;
else
return 0x224;
}
else
{
return r0;
}
}
void sub_809485C(struct unkStruct_8094924 *r0, u8 *r1, s32 size)
{
r0->unk0 = r1;
r0->unk8 = 0;
r0->unkC = 0;
r0->unk4 = &r1[size];
}
void sub_809486C(struct unkStruct_8094924 *r0, u8 *r1, s32 size)
{
r0->unk0 = r1;
r0->unk8 = 0;
r0->unkC = 0;
r0->unk4 = &r1[size];
MemoryClear8(r1, size);
}
void nullsub_102(struct unkStruct_8094924 *r0)
{
}
void sub_809488C(struct unkStruct_8094924 *r0, u8 *r1, s32 size)
{
s32 r5;
u8 *r6;
r5 = 0;
r6 = r1;
if(size != 0)
{
while(size != 0)
{
if(( *(r6) >> r5) & 1)
{
*r0->unk0 |= (1 << r0->unk8);
}
r5++;
if(r5 == 8)
{
r6++;
r5 = 0;
}
r0->unk8++;
if(r0->unk8 == 8)
{
r0->unk0++;
r0->unk8 = 0;
}
r0->unkC++;
size--;
}
}
}
// Unused
NAKED
void sub_80948E4(struct unkStruct_8094924 *r0, u8 *r1, s32 size)
{
asm_unified("\tpush {r4-r6,lr}\n"
"\tadds r4, r0, 0\n"
"\tadds r5, r2, 0\n"
"\tadds r6, r1, 0\n"
"\tcmp r5, 0\n"
"\tbeq _0809491C\n"
"_080948F0:\n"
"\tldrb r1, [r6]\n"
"\tldr r0, [r4, 0x8]\n"
"\tlsls r1, r0\n"
"\tldr r3, [r4]\n"
"\tldrb r2, [r3]\n"
"\tadds r0, r1, 0\n"
"\torrs r0, r2\n"
"\tstrb r0, [r3]\n"
"\tldr r2, [r4]\n"
"\tadds r0, r2, 0x1\n"
"\tstr r0, [r4]\n"
"\tasrs r1, 8\n"
"\tldrb r0, [r2, 0x1]\n"
"\torrs r1, r0\n"
"\tstrb r1, [r2, 0x1]\n"
"\tadds r6, 0x1\n"
"\tldr r0, [r4, 0xC]\n"
"\tadds r0, 0x8\n"
"\tstr r0, [r4, 0xC]\n"
"\tsubs r5, 0x1\n"
"\tcmp r5, 0\n"
"\tbne _080948F0\n"
"_0809491C:\n"
"\tpop {r4-r6}\n"
"\tpop {r0}\n"
"\tbx r0");
}
void sub_8094924(struct unkStruct_8094924 *r0, u8 *r1, s32 size)
{
s32 r6;
u8 *r2;
r6 = 0;
r2 = r1;
if(size != 0)
{
while(size != 0)
{
if(r6 == 0)
*r2 = 0;
if(( *(r0->unk0) >> r0->unk8) & 1)
{
*r2 |= (1 << r6);
}
r6++;
if(r6 == 8)
{
r2++;
r6 = 0;
}
r0->unk8++;
if(r0->unk8 == 8)
{
r0->unk0++;
r0->unk8 = 0;
}
r0->unkC++;
size--;
}
}
}

View File

@ -1,5 +1,6 @@
#include "global.h"
#include "memory.h"
#include "item.h"
#include "friend_area.h"
#include "constants/friend_area.h"
#include "wonder_mail.h"
@ -10,7 +11,6 @@ struct subStruct_203B490
// size: 0xC
u8 unk0;
u8 unk1;
u8 fill2[2];
u32 unk4;
u32 unk8;
};
@ -29,14 +29,13 @@ struct unkStruct_203B490
};
extern u8 sub_809095C(u8);
extern bool8 sub_809095C(u8);
extern s32 sub_8090298(u8);
extern u8 sub_809017C(u8 *);
extern bool8 sub_809017C(u8 *);
extern s16 sub_808E770(s16);
extern u8 sub_8092040(u8);
extern bool8 sub_8092040(u8);
extern u8 sub_803C1D0(u8 *, u8);
extern u8 sub_8090A60(u8);
extern u8 sub_8091524(u8);
extern bool8 sub_8091524(u8);
extern u8 sub_8091E60(u8 ,u8 );
extern u32 GetMaxItemCount(u8);
extern u8 sub_803C0DC(s16);
@ -82,7 +81,7 @@ void sub_8095900(void)
MemoryClear8(gUnknown_203B490->unk1B8, sizeof(gUnknown_203B490->unk1B8));
for(iVar2 = 0; iVar2 < 16; iVar2++)
{
gUnknown_203B490->unk230[iVar2].unk0 = 0x63;
gUnknown_203B490->unk230[iVar2].unk0 = 99;
gUnknown_203B490->unk230[iVar2].unk1 = 1;
gUnknown_203B490->unk230[iVar2].unk4 = 0;
gUnknown_203B490->unk230[iVar2].unk8 = 0;
@ -117,11 +116,11 @@ bool8 ValidateWonderMail(struct WonderMail *data)
if(data->unk2 > 9)
return FALSE;
if(sub_809095C(data->dungeon) != 0)
if(sub_809095C(data->dungeon))
return FALSE;
if(data->floor >= sub_8090298(data->dungeon))
return FALSE;
if(sub_809017C(&(data->dungeon)) != 0)
if(sub_809017C(&(data->dungeon)))
return FALSE;
if(data->clientPoke == SPECIES_NONE)
@ -145,11 +144,11 @@ bool8 ValidateWonderMail(struct WonderMail *data)
if(data->targetPoke != data->clientPoke)
return FALSE;
if(sub_8092040(data->targetItem) != 0)
if(sub_8092040(data->targetItem))
return FALSE;
if(sub_8090A60(data->targetItem) != 0)
if(sub_8090A60(data->targetItem))
return FALSE;
if(sub_8091524(data->targetItem) == 0)
if(!sub_8091524(data->targetItem))
return FALSE;
// Item finding
@ -159,7 +158,7 @@ bool8 ValidateWonderMail(struct WonderMail *data)
if(data->rewardType == BLANK_4 || data->rewardType == END_REWARDS || data->rewardType > END_REWARDS)
return FALSE;
if(sub_8092040(data->itemReward) != 0)
if(sub_8092040(data->itemReward))
return FALSE;
// Friend Area Reward

View File

@ -9,7 +9,7 @@ struct unkDungeonStruct
struct unkStruct_203B494
{
// size: 0xC8?
u32 unk0;
u32 unk0; // 32 bit bitfield, I think
s32 numAdventures;
s32 unk8;
s32 unkC;
@ -20,10 +20,7 @@ struct unkStruct_203B494
u32 unk1C[0xE];
u8 fill54[0x8C - 0x54];
u32 unk8C[0xD];
union UNKC0{
s32 unkC0;
s16 unkC0_16;
} UNKC0;
s32 unkC0;
};
extern struct unkStruct_203B494 *gUnknown_203B494;
@ -59,7 +56,7 @@ void sub_80976A8(void)
gUnknown_203B494->unk14 = 0;
gUnknown_203B494->unk16 = 0;
gUnknown_203B494->unk18 = 0;
gUnknown_203B494->UNKC0.unkC0 = 0;
gUnknown_203B494->unkC0 = 0;
gUnknown_203B494->unk8 = 0;
gUnknown_203B494->unkC = 0;
@ -81,7 +78,7 @@ void sub_80976F8(u8 r0)
u8 sub_8097710(u8 r0)
{
if((gUnknown_203B494->unk0 & (1 << r0)) != 0)
if(gUnknown_203B494->unk0 & (1 << r0))
return 1;
else
return 0;
@ -181,12 +178,12 @@ s16 sub_8097880(void)
void sub_8097890(void)
{
if(gUnknown_203B494->UNKC0.unkC0 < 99999)
gUnknown_203B494->UNKC0.unkC0++;
if(gUnknown_203B494->unkC0 < 99999)
gUnknown_203B494->unkC0++;
sub_80976F8(12);
}
s16 sub_80978B8(void)
{
return gUnknown_203B494->UNKC0.unkC0_16;
return gUnknown_203B494->unkC0;
}

View File

@ -1,6 +1,7 @@
#include "global.h"
#include "play_time.h"
#include "input.h"
#include "debug.h"
extern struct PlayTimeStruct *gPlayTimeRef;
extern u32 gUnknown_20398A8;
@ -21,8 +22,6 @@ extern const char gUnknown_8115FA4;
extern const char gUnknown_8115FC8;
extern const char gUnknown_8115FE8;
extern void Log(u8 *, const char*, ...);
extern void sub_809B57C();
extern void GroundScript_Unlock();
extern void sub_809D25C();

View File

@ -5,7 +5,7 @@
#include "debug.h"
extern void Hang();
void FatalErrorHang(void) __attribute__((noreturn));
static void FatalErrorHang(void) __attribute__((noreturn));
extern bool32 gNDS_DebugEnabled;
extern u8 gUnknown_203B150;
@ -143,7 +143,7 @@ void nullsub_137(void)
}
void FatalErrorPrintFuncFileLine(const char *r0, struct DebugLocation *debug)
static void FatalErrorPrintFuncFileLine(const char *r0, struct DebugLocation *debug)
{
char buf[0x100];
if(r0 != NULL){
@ -155,7 +155,7 @@ void FatalErrorPrintFuncFileLine(const char *r0, struct DebugLocation *debug)
}
}
void FatalErrorFormatMessage(const char *text, ...)
static void FatalErrorFormatMessage(const char *text, ...)
{
char bufPrint[0x100];
va_list vArgv;
@ -190,7 +190,7 @@ u32 sub_8011BA8(void)
}
// Unused
const char *sub_8011BAC(void)
const char *GetNotMountText(void)
{
return gNotMountText;
}
@ -232,7 +232,7 @@ void nullsub_32()
{
}
void FatalErrorHang()
static void FatalErrorHang()
{
Hang();
}

View File

@ -1,5 +1,6 @@
#include "global.h"
#include "input.h"
#include "item.h"
#include "gUnknown_203B460.h"
#include "memory.h"
#include "menu.h"
@ -49,8 +50,7 @@ extern struct unkStruct_203B3F4 *gUnknown_203B3F4;
extern struct unkStruct_203B460 *gUnknown_203B460;
extern void sub_801B3C0(u8 *);
extern void sub_8090A8C(u8 *, u8, u32);
extern void sub_801B3C0(struct ItemStruct_203B460 *);
extern void sub_8013AA0(u32 *);
extern struct UnkTextStruct2 gUnknown_80E7E34;
@ -181,7 +181,7 @@ void sub_803A51C(void)
void sub_803A5A0(void)
{
u8 auStack8 [4];
struct ItemStruct_203B460 auStack8;
switch(gUnknown_203B3F0->state) {
case 0:
@ -208,8 +208,8 @@ void sub_803A5A0(void)
sub_803A690();
break;
case 4:
sub_8090A8C(auStack8,gUnknown_203B3F0->itemIndex,0);
sub_801B3C0(auStack8);
sub_8090A8C(&auStack8,gUnknown_203B3F0->itemIndex,0);
sub_801B3C0(&auStack8);
break;
case 5:
break;

125
src/exclusive_pokemon_1.c Normal file
View File

@ -0,0 +1,125 @@
#include "global.h"
#include "exclusive_pokemon.h"
extern struct ExclusivePokemonData *gUnknown_203B498;
extern struct ExclusivePokemon gExclusivePokemon[NUM_EXCLUSIVE_POKEMON];
void sub_8094924(u32 *, u8 *, u32);
void sub_80980B4(s16);
void sub_8097FA8(u8);
void sub_8098170(s32);
void sub_8097FF8(void);
u8 sub_8098100(u8);
u8 sub_8098134(s16);
u8 sub_80981A0(s32);
void sub_809488C(u32 *, u8 *, s32);
bool8 IsExclusivePokemonUnlocked(s16 pokeID)
{
s32 iVar2;
s32 pokeID_s32;
pokeID_s32 = pokeID;
for(iVar2 = 0; iVar2 < NUM_EXCLUSIVE_POKEMON; iVar2++)
{
if(gExclusivePokemon[iVar2].poke_id == pokeID_s32)
return gUnknown_203B498->Exclusives[iVar2];
}
return TRUE;
}
void UnlockExclusivePokemon(s16 pokeID)
{
s32 iVar2;
s32 pokeID_s32;
pokeID_s32 = pokeID;
for(iVar2 = 0; iVar2 < NUM_EXCLUSIVE_POKEMON; iVar2++)
{
if(gExclusivePokemon[iVar2].poke_id == pokeID_s32)
gUnknown_203B498->Exclusives[iVar2] = 1;
}
}
void WriteExclusivePokemon(u32 *r0)
{
s32 iVar2;
u8 *puVar2;
u8 stack_0;
u8 stack_1;
u8 stack_2;
u8 neg_1;
u8 zero;
neg_1 = -1;
zero = 0;
sub_809488C(r0, (u8 *)gUnknown_203B498, 1);
for(iVar2 = 0; iVar2 < 424; iVar2++)
{
stack_0 = sub_8098134(iVar2);
sub_809488C(r0, &stack_0, 1);
}
for(iVar2 = 0; iVar2 < 64; iVar2++)
{
stack_1 = sub_8098100(iVar2);
sub_809488C(r0, &stack_1, 1);
}
for(iVar2 = 0; iVar2 < 31; iVar2++)
{
stack_2 = sub_80981A0(iVar2);
sub_809488C(r0, &stack_2, 1);
}
for(iVar2 = 0; iVar2 < NUM_EXCLUSIVE_POKEMON; iVar2++)
{
if(gUnknown_203B498->Exclusives[iVar2])
puVar2 = &neg_1;
else
puVar2 = &zero;
sub_809488C(r0, puVar2, 1);
}
}
void ReadExclusivePokemon(u32 *r0)
{
s32 iVar2;
u8 stack_0;
u8 stack_1;
u8 stack_2;
u8 stack_3;
memset(gUnknown_203B498, 0, sizeof(struct ExclusivePokemonData));
sub_8094924(r0, (u8 *)gUnknown_203B498, 1);
for(iVar2 = 0; iVar2 < 424; iVar2++)
{
sub_8094924(r0, &stack_0, 1);
if(stack_0)
sub_80980B4(iVar2);
}
for(iVar2 = 0; iVar2 < 64; iVar2++)
{
sub_8094924(r0, &stack_1, 1);
if(stack_1)
sub_8097FA8(iVar2);
}
for(iVar2 = 0; iVar2 < 31; iVar2++)
{
sub_8094924(r0, &stack_2, 1);
if(stack_2)
sub_8098170(iVar2);
}
for(iVar2 = 0; iVar2 < NUM_EXCLUSIVE_POKEMON; iVar2++)
{
sub_8094924(r0, &stack_3, 1);
do; while(0); // do/while needed for matching - jiang
gUnknown_203B498->Exclusives[iVar2] = 1 & stack_3;
}
sub_8097FF8();
}

View File

@ -1,4 +1,5 @@
#include "global.h"
#include "item.h"
#include "gUnknown_203B460.h"
#include "felicity_bank.h"

View File

@ -5,13 +5,13 @@
extern u8 gFlashEnabled;
extern FlashIntrFunc *sub_800B6E8(s32);
extern FlashIntrFunc *GetInterruptCallback(s32);
static u8 TryProgramSector(s32, u8 *);
void InitFlash(void)
{
if (!IdentifyFlash() && !SetFlashTimerIntr(2, sub_800B6E8(3)))
if (!IdentifyFlash() && !SetFlashTimerIntr(2, GetInterruptCallback(3)))
gFlashEnabled = TRUE;
}

View File

@ -2,18 +2,18 @@
#include "constants/friend_area.h"
extern bool8 *gFriendAreas;
extern void sub_809485C(u32 *r0, u8 *r1, u32 r2);
extern void sub_809485C(u32 *r0, u8 *r1, u32 size);
extern void sub_8094924(u32 *r0, u32 *r1, u32);
extern void nullsub_102(u32 *r0);
extern void sub_809488C(u32 *r0, u32 *r1, u32 r2);
extern void sub_809486C(u32 *r0, u8 *r1, u32 r2);
extern void sub_809486C(u32 *r0, u8 *r1, u32 size);
u32 SaveFriendAreas(u8 *r0, u32 r1)
u32 SaveFriendAreas(u8 *r0, u32 size)
{
u32 temp[5];
s32 counter;
sub_809486C(temp, r0, r1);
sub_809486C(temp, r0, size);
for(counter = 0; counter < NUM_FRIEND_AREAS; counter++)
{
if(gFriendAreas[counter] != 0)
@ -26,12 +26,12 @@ u32 SaveFriendAreas(u8 *r0, u32 r1)
return temp[2];
}
u32 ReadSavedFriendAreas(u8 *r0, s32 r1)
u32 ReadSavedFriendAreas(u8 *r0, s32 size)
{
u32 temp[5];
s32 counter;
sub_809485C(temp, r0, r1);
sub_809485C(temp, r0, size);
for(counter = 0; counter < NUM_FRIEND_AREAS; counter++)
{
sub_8094924(temp, &(temp[4]), 1);

View File

@ -3,6 +3,8 @@
#include "text.h"
#include "input.h"
#include "menu.h"
#include "item.h"
#include "gUnknown_203B460.h"
#include "friend_area_action_menu.h"
extern struct unkStruct_203B2BC *gUnknown_203B2BC;
@ -31,8 +33,7 @@ extern void sub_801A5D8(u32, u32, u32, u32);
extern void sub_801A8D0(u32);
extern void sub_801A9E0();
extern void sub_801F1B0(u32, u32);
extern void sub_8090B64(u8 *, u8 *);
extern void sub_801B3C0(u8 *);
extern void sub_801B3C0(struct ItemStruct_203B460 *);
extern void sub_809401C(u32 *, u32 *);
extern void sub_801EE10(u32, s16, u32 *, u32, u32, u32);
@ -166,7 +167,7 @@ void sub_802719C(void)
void sub_8027274(void)
{
u8 auStack12 [4];
struct ItemStruct_203B460 auStack12;
switch(gUnknown_203B2BC->state) {
case 0:
@ -200,8 +201,8 @@ void sub_8027274(void)
sub_8012D60(&gUnknown_203B2BC->unk7C,gUnknown_203B2BC->menuItems,0,&gUnknown_203B2BC->unk16C,gUnknown_203B2BC->unk74,2);
break;
case 0xd:
sub_8090B64(auStack12,&gUnknown_203B2BC->unk10);
sub_801B3C0(auStack12);
sub_8090B64(&auStack12,&gUnknown_203B2BC->unk10);
sub_801B3C0(&auStack12);
break;
case 0xe:
sub_809401C(&gUnknown_203B2BC->unk28,&gUnknown_203B2BC->unk18->unk2C);

View File

@ -2,6 +2,7 @@
#include "text.h"
#include "input.h"
#include "menu.h"
#include "item.h"
#include "gUnknown_203B460.h"
#include "friend_area_action_menu.h"
@ -23,7 +24,7 @@ extern void nullsub_104();
extern void sub_8091274(u8 *);
extern void sub_801A928();
extern void sub_8099690(u32);
extern void sub_808D800(s16, u8 *);
extern void sub_808D800(s16, struct ItemStruct_203B460_ALT *);
extern u32 sub_801A8AC();
extern u32 sub_801A6E8(u32);
@ -56,14 +57,14 @@ void sub_8027B28(void)
{
case 3:
gUnknown_203B2BC->unkC = sub_801A8AC();
gUnknown_203B2BC->unk10 = gUnknown_203B460->fill0[gUnknown_203B2BC->unkC].itemIndex;
gUnknown_203B2BC->unk11 = gUnknown_203B460->fill0[gUnknown_203B2BC->unkC].numItems;
gUnknown_203B2BC->unk10.itemIndex = gUnknown_203B460->fill0[gUnknown_203B2BC->unkC].itemIndex;
gUnknown_203B2BC->unk10.numItems = gUnknown_203B460->fill0[gUnknown_203B2BC->unkC].numItems;
sub_8027184(0xc);
break;
case 4:
gUnknown_203B2BC->unkC = sub_801A8AC();
gUnknown_203B2BC->unk10 = gUnknown_203B460->fill0[gUnknown_203B2BC->unkC].itemIndex;
gUnknown_203B2BC->unk11 = gUnknown_203B460->fill0[gUnknown_203B2BC->unkC].numItems;
gUnknown_203B2BC->unk10.itemIndex = gUnknown_203B460->fill0[gUnknown_203B2BC->unkC].itemIndex;
gUnknown_203B2BC->unk10.numItems = gUnknown_203B460->fill0[gUnknown_203B2BC->unkC].numItems;
sub_8099690(0);
sub_8027184(0xd);
break;

View File

@ -1,8 +1,10 @@
#include "global.h"
#include "text.h"
#include "item.h"
#include "gUnknown_203B460.h"
#include "friend_rescue.h"
#include "pokemon.h"
#include "memory.h"
#include "text.h"
extern void sub_80338C4(u32);
extern s32 sub_80144A4(s32 *);

View File

@ -1,6 +1,14 @@
#include "global.h"
#include "friend_rescue.h"
#include "text.h"
#include "pokemon.h"
#include "save.h"
#include "memory.h"
#include "input.h"
#include "gUnknown_203B460.h"
#include "friend_rescue.h"
#include "sub_8095228.h"
extern struct unkStruct_203B460 *gUnknown_203B460;
extern void sub_80338C4(u32);
extern s32 sub_80144A4(s32 *);
@ -14,6 +22,380 @@ extern char gAvailablePokemonNames[0x50];
extern struct WonderMailStruct_203B33C *gUnknown_203B33C;
u8 sub_80953D4(u32);
u8 sub_801CF14(u32);
extern u8 gUnknown_80E48A8[];
extern u32 gUnknown_80E2440;
extern u8 gUnknown_80E49C4[];
extern u8 gUnknown_80E4704[];
u8 sub_809539C(u32, u32);
u32 sub_8039068(u32, u8 *, u8 *);
extern u32 sub_80154F0();
extern void sub_80155F0();
struct unkStruct_8095228 *sub_8095228(u8);
extern void sub_80141B4(u8 *r0, u32, u32 *r1, u32);
extern void sub_8014248(const char *r0, u32, u32, u32 *r4, u32, u32, u32, u32 *r5, u32);
void sub_8034D54(void)
{
s32 temp;
if(sub_80144A4(&temp) == 0)
{
sub_80338C4(0x65);
PrepareSavePakWrite(SPECIES_NONE);
}
}
void sub_8034D74(void)
{
u32 return_var;
struct unkStruct_8095228 temp;
struct unkStruct_8095228 *temp2;
return_var = sub_80154F0();
MemoryFill8((u8 *)&temp, 0, sizeof(struct unkStruct_8095228));
switch(return_var)
{
case 3:
switch(sub_8039068(0x20, (gUnknown_203B33C->unk8), &temp.unk0))
{
case 17:
sub_8014248(gUnknown_80E48A8, 0, 6, &gUnknown_80E2440, 0, 4, 0, 0, 0x101);
sub_80338C4(0x74);
break;
case 20:
sub_80141B4(gUnknown_80E49C4, 0, 0, 0x101);
sub_80338C4(0x6B);
break;
case 11:
sub_80141B4(gUnknown_80E4704, 0, 0, 0x101);
sub_80338C4(0x6B);
break;
case 24:
temp2 = sub_8095228(sub_809539C(4, temp.unk10));
*temp2 = temp;
temp2->unk0 = 6; // Some sort of Ack?
gUnknown_203B33C->unk420 = temp.unk10;
sub_80338C4(0x6D);
break;
case 7:
default:
break;
}
sub_80155F0();
break;
case 2:
sub_80155F0();
ResetUnusedInputStruct();
sub_800641C(gUnknown_203B33C->unk3BC, 1, 1);
sub_80338C4(1);
break;
default:
break;
}
}
void sub_8034EC8(void)
{
s32 temp;
if(sub_80144A4(&temp) == 0)
{
if(!WriteSavePak())
{
FinishWriteSavePak();
sub_80338C4(2);
}
}
}
void sub_8034EF0(void)
{
s32 temp;
if(sub_80144A4(&temp) == 0)
{
if(!WriteSavePak())
{
FinishWriteSavePak();
sub_80338C4(2);
}
}
}
void sub_8034F18(void)
{
s32 temp;
if(sub_80144A4(&temp) == 0)
{
sub_80338C4(0x65);
PrepareSavePakWrite(SPECIES_NONE);
}
}
void sub_8034F38(void)
{
s32 temp;
if(sub_80144A4(&temp) == 0)
{
sub_80338C4(0x71);
PrepareSavePakWrite(SPECIES_NONE);
}
}
void sub_8034F58(void)
{
s32 temp;
if(sub_80144A4(&temp) == 0)
{
switch(temp)
{
case 6:
sub_80338C4(0x62);
break;
case 8:
sub_80338C4(0x1);
break;
}
}
}
void sub_8034F88(void)
{
s32 temp;
struct unkStruct_8095228 *temp2;
if(sub_80144A4(&temp) == 0)
{
switch(temp)
{
case 6:
temp2 = sub_8095228(gUnknown_203B33C->unk218);
if(gUnknown_203B33C->unk41C.itemIndex != 0)
temp2->unk20 = gUnknown_203B33C->unk41C;
gUnknown_203B460->unk50[gUnknown_203B33C->unk41C.itemIndex]--;
sub_80338C4(0x75);
break;
case 7:
sub_80338C4(0x57);
break;
case 8:
sub_80338C4(0x1);
break;
}
}
}
void sub_8035018(void)
{
s32 temp;
if(sub_80144A4(&temp) == 0)
{
sub_80338C4(0x76);
PrepareSavePakWrite(SPECIES_NONE);
}
}
void sub_8035038(void)
{
s32 temp;
if(sub_80144A4(&temp) == 0)
{
if(!WriteSavePak()){
FinishWriteSavePak();
// Dumb cast to get unsigned switch
switch((u32)gUnknown_203B33C->unk524)
{
default:
break;
case 0xB:
case 0xC:
sub_80338C4(0x69);
break;
case 0xD:
sub_80338C4(0x66);
break;
case 0xE:
sub_80338C4(0x4B);
break;
}
}
}
}
void sub_8035094(void)
{
s32 temp;
if(sub_80144A4(&temp) == 0)
{
switch(temp)
{
case 0x16:
// Dumb cast to get unsigned switch
switch((u32)gUnknown_203B33C->unk524)
{
default:
break;
case 0xB:
case 0xC:
sub_80338C4(0x69);
break;
case 0xD:
sub_80338C4(0x66);
break;
case 0xE:
sub_80338C4(0x4B);
break;
}
break;
case 8:
sub_80338C4(0x1);
break;
default:
break;
}
}
}
void sub_80350F4(void)
{
s32 temp;
if(sub_80144A4(&temp) == 0)
{
switch(temp)
{
case 0x15:
if(sub_801CF14(0) != 0)
sub_80338C4(0x56);
else
sub_80338C4(0x57);
break;
case 0x16:
// Dumb cast to get unsigned switch
switch((u32)gUnknown_203B33C->unk524)
{
default:
break;
case 0xB:
case 0xC:
sub_80338C4(0x69);
break;
case 0xD:
sub_80338C4(0x66);
break;
case 0xE:
sub_80338C4(0x4B);
break;
}
break;
case 8:
sub_80338C4(0x1);
break;
default:
break;
}
}
}
void sub_803517C(void)
{
s32 temp;
if(sub_80144A4(&temp) == 0)
{
switch(temp)
{
case 6:
// Dumb cast to get unsigned switch
switch((u32)gUnknown_203B33C->unk524)
{
default:
break;
case 0xB:
case 0xC:
sub_80338C4(0x69);
break;
case 0xD:
sub_80338C4(0x66);
break;
case 0xE:
sub_80338C4(0x4B);
break;
}
break;
case 8:
sub_80338C4(0x1);
break;
default:
break;
}
}
}
void sub_80351E0(void)
{
s32 temp;
if(sub_80144A4(&temp) == 0)
{
switch(temp)
{
case 6:
sub_80338C4(0x72);
break;
case 8:
sub_80338C4(0x1);
break;
default:
break;
}
}
}
void sub_8035210(void)
{
s32 temp;
struct unkStruct_8095228 *temp2;
if(sub_80144A4(&temp) == 0)
{
// NOTE: this is why unk524 can't be changed to u32..
gUnknown_203B33C->unk524 = temp;
switch(gUnknown_203B33C->unk524)
{
case 0xB:
case 0xC:
case 0xD:
if(gUnknown_203B33C->unk528 == 0x13)
{
temp2 = sub_8095228(sub_80953D4(5));
if(temp2->unk20.itemIndex != 0)
sub_80338C4(0x53);
else
sub_80338C4(0x55);
}
else if(gUnknown_203B33C->unk524 != 0xD)
sub_80338C4(0x69);
else
sub_80338C4(0x72);
break;
case 8:
sub_80338C4(1);
break;
case 0xE:
default:
break;
}
}
}
void nullsub_46(void)
{
}

View File

@ -1,8 +1,8 @@
#include "global.h"
#include "file_system.h"
#include "item.h"
#include "gUnknown_203B460.h"
#include "random.h"
#include "item.h"
extern struct unkStruct_203B460 *gUnknown_203B460;
extern struct unkStruct_203B460 gUnknown_20389A8;
@ -110,14 +110,13 @@ void sub_8090A8C(struct ItemStruct_203B460 *param_1,u8 itemIndex,u8 param_3)
}
}
// TODO is this a struct one too?
void sub_8090B08(struct ItemStruct_203B460 *param_1,u8 itemIndex)
void sub_8090B08(struct ItemStruct_203B460_ALT *param_1,u8 itemIndex)
{
u32 uVar2;
u32 uVar3;
if (itemIndex != 0) {
param_1->unk0 = itemIndex;
param_1->itemIndex = itemIndex;
if (sub_8090A60(itemIndex)) {
uVar2 = GetItemUnkThrow(itemIndex,0);
uVar3 = GetItemUnkThrow(itemIndex,1);
@ -132,19 +131,19 @@ void sub_8090B08(struct ItemStruct_203B460 *param_1,u8 itemIndex)
}
}
else {
param_1->unk0 = 0;
param_1->itemIndex = 0;
param_1->numItems = 0;
}
}
void sub_8090B64(struct ItemStruct_203B460 *param_1,struct ItemStruct_203B460 *param_2)
void sub_8090B64(struct ItemStruct_203B460 *param_1, struct ItemStruct_203B460_ALT *param_2)
{
u8 r6;
if(param_2->unk0 != 0)
if(param_2->itemIndex != 0)
{
param_1->unk0 = 1;
param_1->itemIndex = param_2->unk0;
param_1->itemIndex = param_2->itemIndex;
r6 = sub_8090A60(param_1->itemIndex);
if(r6 != 0 || GetItemType(param_1->itemIndex) == ITEM_TYPE_MONEY)
{
@ -170,14 +169,14 @@ void sub_8090B64(struct ItemStruct_203B460 *param_1,struct ItemStruct_203B460 *p
}
}
void sub_8090BB0(struct ItemStruct_203B460 *param_1,struct ItemStruct_203B460 *param_2)
void sub_8090BB0(struct ItemStruct_203B460_ALT *param_1,struct ItemStruct_203B460 *param_2)
{
if ((param_2->unk0 & 1) != 0) {
param_1->unk0 = param_2->itemIndex;
param_1->itemIndex = param_2->itemIndex;
param_1->numItems = param_2->numItems;
}
else {
param_1->unk0 = 0;
param_1->itemIndex = 0;
}
}
@ -188,7 +187,7 @@ u8 GetItemType(u8 index)
s32 sub_8090BE4(struct ItemStruct_203B460 *param_1)
{
if (param_1->itemIndex == 0x69) {
if (param_1->itemIndex == 105) {
return sub_80915D4(param_1);
}
else {
@ -203,7 +202,7 @@ s32 sub_8090BE4(struct ItemStruct_203B460 *param_1)
s32 sub_8090C30(struct ItemStruct_203B460 *param_1)
{
if (param_1->itemIndex == 0x69) {
if (param_1->itemIndex == 105) {
return sub_80915D4(param_1);
}
else {

View File

@ -2,6 +2,7 @@
#include "file_system.h"
#include "pokemon.h"
#include "input.h"
#include "item.h"
#include "kangaskhan_storage.h"
#include "memory.h"

View File

@ -2,6 +2,7 @@
#include "file_system.h"
#include "pokemon.h"
#include "input.h"
#include "item.h"
#include "kangaskhan_storage.h"
extern struct unkStruct_203B208 *gUnknown_203B208;

View File

@ -3,9 +3,9 @@
#include "memory.h"
#include "text.h"
#include "item.h"
#include "gUnknown_203B460.h"
#include "input.h"
#include "kangaskhan_storage.h"
#include "gUnknown_203B460.h"
extern struct unkStruct_203B208 *gUnknown_203B208;
extern struct unkStruct_203B460 *gUnknown_203B460;
@ -14,10 +14,7 @@ struct unkStruct_203B20C
{
u32 state;
u8 unk4[4];
u8 unk8;
u8 unk9;
u8 unkA;
u8 unkB;
struct ItemStruct_203B460 unk8;
u8 fillC[0x14 - 0xC];
u32 unk14;
u32 unk18;
@ -64,8 +61,8 @@ extern u8 sub_8012FD8(u32 *r0);
extern void sub_8013114(u32 *, s32 *);
extern void sub_801CBB8();
extern u8 sub_8091524(u8);
extern u8 sub_801ADA0(u32);
extern bool8 sub_8091524(u8);
extern bool8 sub_801ADA0(u32);
extern void sub_8099690(u32);
extern u32 sub_8013BBC(u32 *);
extern void sub_8017598(void);
@ -73,7 +70,6 @@ extern void sub_8017598(void);
extern u32 sub_801CA08(u32);
extern u32 sub_801CFB8(void);
extern u8 sub_801CB24();
extern void sub_8090A8C(struct ItemStruct_203B460 *, u8, u32);
extern void sub_801AD34(u32);
extern u32 sub_801A6E8(u32);
extern u32 sub_801AEA8(void);
@ -88,7 +84,7 @@ extern void sub_801CCD8();
extern void sub_80184D4();
extern void sub_8018280();
extern void sub_8013AA0(u32 *);
extern void sub_801B3C0(u8 *);
extern void sub_801B3C0(struct ItemStruct_203B460 *);
extern void sub_801A5D8(u32, u32, u32, u32);
extern void sub_801C8C4(u32, u32, u32, u32);
extern void sub_8012D60(u32 *, u32 *, u32, u32 *, u32, u32);
@ -140,15 +136,15 @@ void sub_8017B88(void)
}
else
{
gUnknown_203B208->unk14 = sub_801CB24();
sub_8090A8C(&gUnknown_203B208->unkC, gUnknown_203B208->unk14, 0);
gUnknown_203B208->itemIndex = sub_801CB24();
sub_8090A8C(&gUnknown_203B208->unkC, gUnknown_203B208->itemIndex, 0);
gUnknown_203B208->unkC.numItems = 1;
UpdateKangaskhanStorageState(0x19);
}
break;
case 4:
gUnknown_203B208->unk14 = sub_801CB24();
sub_8090A8C(&gUnknown_203B208->unkC, gUnknown_203B208->unk14, 0);
gUnknown_203B208->itemIndex = sub_801CB24();
sub_8090A8C(&gUnknown_203B208->unkC, gUnknown_203B208->itemIndex, 0);
gUnknown_203B208->unkC.numItems = 1;
UpdateKangaskhanStorageState(0x1A);
break;
@ -198,21 +194,13 @@ void sub_8017C7C(void)
{
case 2:
sub_8099690(0);
if(sub_8091524(gUnknown_203B208->unkC.itemIndex) == 0)
{
if(!sub_8091524(gUnknown_203B208->unkC.itemIndex))
UpdateKangaskhanStorageState(9);
}
else
{
if(sub_801ADA0(gUnknown_203B208->unk10) == 0)
{
if(!sub_801ADA0(gUnknown_203B208->unk10))
UpdateKangaskhanStorageState(0xA);
}
else
{
UpdateKangaskhanStorageState(0x11);
}
}
break;
case 6:
sub_8099690(0);
@ -304,7 +292,7 @@ u32 sub_8017E1C(void)
{
ResetUnusedInputStruct();
sub_800641C(NULL, 1, 1);
gUnknown_203B20C = MemoryAlloc(0x150, 8);
gUnknown_203B20C = MemoryAlloc(sizeof(struct unkStruct_203B20C), 8);
gUnknown_203B20C->unk14 = 0;
gUnknown_203B20C->unk18 = 0;
gUnknown_203B20C->unk1C = 0;
@ -449,10 +437,10 @@ void sub_8018100(void)
case 12:
gUnknown_203B20C->unkD0 = 2;
gUnknown_203B20C->unkC8 = 1;
if(gUnknown_203B460->unk50[gUnknown_203B20C->unkA] > 0x63)
gUnknown_203B20C->unkCC = 0x63;
if(gUnknown_203B460->unk50[gUnknown_203B20C->unk8.itemIndex] > 99)
gUnknown_203B20C->unkCC = 99;
else
gUnknown_203B20C->unkCC = gUnknown_203B460->unk50[gUnknown_203B20C->unkA];
gUnknown_203B20C->unkCC = gUnknown_203B460->unk50[gUnknown_203B20C->unk8.itemIndex];
gUnknown_203B20C->unkC4 = gUnknown_203B20C->unkCC;
gUnknown_203B20C->unkD4 = 1;
gUnknown_203B20C->unkD8 = &gUnknown_203B20C->unkF0[1];

View File

@ -2,6 +2,7 @@
#include "file_system.h"
#include "pokemon.h"
#include "input.h"
#include "item.h"
#include "kecleon_items.h"
#include "memory.h"

View File

@ -2,6 +2,7 @@
#include "file_system.h"
#include "pokemon.h"
#include "input.h"
#include "item.h"
#include "kecleon_items.h"
#include "gUnknown_203B460.h"

View File

@ -232,9 +232,9 @@ void InitIntrTable(const u32 *interrupt_table)
INTR_VECTOR = IntrMain_Buffer;
}
u32 *sub_800B6E8(u32 r0)
u32 *GetInterruptCallback(u32 index)
{
return &gIntrTable[r0];
return &gIntrTable[index];
}
void *SetInterruptCallback(u32 index, void * new_callback)

View File

@ -96,10 +96,8 @@ void VBlankIntr(void)
if (gIntrCallbacks[1] != NULL) {
gIntrCallbacks[1]();
}
index = 0;
while (index < gUnknown_203B0AA) {
for(index = 0; index < gUnknown_203B0AA; index++) {
gUnknown_202D648[index] = gUnknown_202D608[index];
index++;
}
gUnknown_203B0AC = gUnknown_203B0AA;
gUnknown_203B0AE = -1;

View File

@ -1,6 +1,7 @@
#include "global.h"
#include "input.h"
#include "main_menu.h"
#include "item.h"
#include "gUnknown_203B460.h"
#include "menu.h"
#include "memory.h"

View File

@ -131,7 +131,7 @@ u8 sub_80921B8(void)
return gRescueTeamInfoRef->unk10;
}
u32 SaveRescueTeamInfo(u8 *param_1, u32 param_2)
u32 SaveRescueTeamInfo(u8 *param_1, u32 size)
{
u32 auStack36[4];
@ -142,7 +142,7 @@ u32 SaveRescueTeamInfo(u8 *param_1, u32 param_2)
neg1 = -1;
zero = 0;
sub_809486C(auStack36, param_1, param_2);
sub_809486C(auStack36, param_1, size);
sub_809488C(auStack36, gRescueTeamInfoRef->teamName, 0x58);
sub_809488C(auStack36, (u8 *)&gRescueTeamInfoRef->teamRankPts, 0x20);
gRescueTeamInfoRef->unk10 = sub_80023E4(0);
@ -160,12 +160,12 @@ u32 SaveRescueTeamInfo(u8 *param_1, u32 param_2)
return auStack36[2];
}
u32 ReadRescueTeamInfo(u8 *param_1, u32 param_2)
u32 ReadRescueTeamInfo(u8 *param_1, u32 size)
{
u32 auStack32 [4];
u8 byteArray[4];
sub_809485C(auStack32, param_1, param_2);
sub_809485C(auStack32, param_1, size);
sub_8094924(auStack32, gRescueTeamInfoRef->teamName, 0x58);
sub_8094924(auStack32, (u8 *)&gRescueTeamInfoRef->teamRankPts, 0x20);
sub_8094924(auStack32, byteArray, 1);

View File

@ -89,56 +89,56 @@ ALIGNED(4) const char fill_save1[] = _("pksdir0");
ALIGNED(4) const char fill_save2[] = _("pksdir0");
ALIGNED(4) const char fill_save3[] = _("pksdir0");
ALIGNED(4) const char gSaveCorrupted[] = _("#+The game data is corrupted.\n"
"#+Your data will be erased.");
ALIGNED(4) const char gSaveCorrupted[] = _("{CENTER_ALIGN}The game data is corrupted.\n"
"{CENTER_ALIGN}Your data will be erased.");
ALIGNED(4) const char fill_save4[] = _("pksdir0");
ALIGNED(4) const char gSavingAdventure[] = _("#+Saving your adventure...\n"
"#+Please don~27t turn off the power.");
ALIGNED(4) const char gSavingAdventure[] = _("{CENTER_ALIGN}Saving your adventure...\n"
"{CENTER_ALIGN}Please don~27t turn off the power.");
ALIGNED(4) const char gWriteGamePak[] = _("#+Writing to GBA Game Pak.\n"
"#+Do not remove the GBA Game Pak.\n"
"#+Please wait with the power on.");
ALIGNED(4) const char gWriteGamePak[] = _("{CENTER_ALIGN}Writing to GBA Game Pak.\n"
"{CENTER_ALIGN}Do not remove the GBA Game Pak.\n"
"{CENTER_ALIGN}Please wait with the power on.");
ALIGNED(4) const char gSaveCompleted[] = _("#+Save completed!");
ALIGNED(4) const char gSaveCompleted[] = _("{CENTER_ALIGN}Save completed!");
ALIGNED(4) const char gSaveNotWritten[] = _("#+The data could not be written.\n"
"#+Please turn off the power and remove\n"
"#+and reinsert the DS Card.");
ALIGNED(4) const char gSaveNotWritten[] = _("{CENTER_ALIGN}The data could not be written.\n"
"{CENTER_ALIGN}Please turn off the power and remove\n"
"{CENTER_ALIGN}and reinsert the DS Card.");
ALIGNED(4) const char gSaveFailed[] = _("#+Save failed.");
ALIGNED(4) const char gSaveFailed[] = _("{CENTER_ALIGN}Save failed.");
ALIGNED(4) const char fill_save5[] = _("pksdir0");
ALIGNED(4) const char gUnknown_80D44C8[] = _("#+Your data was not properly saved~2c\n"
"#+so your game cannot be resumed\n"
"#+from your last spot.#P"
"#+Your last outing is considered a defeat.\n"
"#+Before shutting down~2c save in your\n"
"#+team base~2c or quicksave in a dungeon.");
ALIGNED(4) const char gUnknown_80D44C8[] = _("{CENTER_ALIGN}Your data was not properly saved~2c\n"
"{CENTER_ALIGN}so your game cannot be resumed\n"
"{CENTER_ALIGN}from your last spot.{EXTRA_MSG}"
"{CENTER_ALIGN}Your last outing is considered a defeat.\n"
"{CENTER_ALIGN}Before shutting down~2c save in your\n"
"{CENTER_ALIGN}team base~2c or quicksave in a dungeon.");
ALIGNED(4) const char fill_save6[] = _("pksdir0");
ALIGNED(4) const char gUnknown_80D45AC[] = _("#+Quicksaving your adventure...\n"
"#+Please don~27t turn off the power.");
ALIGNED(4) const char gUnknown_80D45AC[] = _("{CENTER_ALIGN}Quicksaving your adventure...\n"
"{CENTER_ALIGN}Please don~27t turn off the power.");
ALIGNED(4) const char gUnknown_80D45F4[] = _("#+Your adventure has been saved.\n"
"#+When you are in a dungeon~2c quicksave\n"
"#+your progress before ending the game.");
ALIGNED(4) const char gUnknown_80D45F4[] = _("{CENTER_ALIGN}Your adventure has been saved.\n"
"{CENTER_ALIGN}When you are in a dungeon~2c quicksave\n"
"{CENTER_ALIGN}your progress before ending the game.");
ALIGNED(4) const char gUnknown_80D4668[] = _("#+Your adventure has been saved.\n"
"#+When you resume play~2c the quicksave\n"
"#+data will be deleted.#P"
"#+When you are shutting down the game~2c\n"
"#+save your progress in your team base~2c\n"
"#+or quicksave in a dungeon.");
ALIGNED(4) const char gUnknown_80D4668[] = _("{CENTER_ALIGN}Your adventure has been saved.\n"
"{CENTER_ALIGN}When you resume play~2c the quicksave\n"
"{CENTER_ALIGN}data will be deleted.{EXTRA_MSG}"
"{CENTER_ALIGN}When you are shutting down the game~2c\n"
"{CENTER_ALIGN}save your progress in your team base~2c\n"
"{CENTER_ALIGN}or quicksave in a dungeon.");
ALIGNED(4) const char gSaveNotWritten2[] = _("#+The data could not be written.\n"
"#+Please turn off the power and remove\n"
"#+and reinsert the DS Card.");
ALIGNED(4) const char gSaveNotWritten2[] = _("{CENTER_ALIGN}The data could not be written.\n"
"{CENTER_ALIGN}Please turn off the power and remove\n"
"{CENTER_ALIGN}and reinsert the DS Card.");
ALIGNED(4) const char gSaveFailed2[] = _("#+Save failed.");
ALIGNED(4) const char gSaveFailed2[] = _("{CENTER_ALIGN}Save failed.");
ALIGNED(4) const char fill_save7[] = _("pksdir0");
extern volatile struct UnkStruct_203B184 *gUnknown_203B184;

View File

@ -1,6 +1,7 @@
#include "global.h"
#include "input.h"
#include "trade_items_menu.h"
#include "item.h"
#include "gUnknown_203B460.h"
#include "memory.h"
#include "save.h"
@ -1047,14 +1048,6 @@ void PrintTradeItemsLinkError(u32 errorNum)
sub_80141B4(&gUnknown_80E64AC, 0, 0, 0x101);
break;
default:
case 0x6:
case 0x7:
case 0x8:
case 0x9:
case 0xA:
case 0xB:
case 0xC:
case 0xD:
sub_80141B4(&gTradeItemsCommunicationError, 0, 0, 0x101);
break;
}

View File

@ -2,32 +2,17 @@
#include "save.h"
#include "pokemon.h"
#include "file_system.h"
#include "item.h"
#include "wonder_mail.h"
#include "memory.h"
#include "text.h"
#include "sub_8095228.h"
#include "gUnknown_203B460.h"
extern struct WonderMailStruct_203B2C0 *gUnknown_203B2C0;
extern struct WonderMailStruct_203B2C4 *gUnknown_203B2C4;
extern struct unkStruct_203B460 *gUnknown_203B460;
struct unkStruct_8095228
{
u8 unk0;
u8 unk1;
u8 unk2;
u8 unk3;
u8 unk4;
u8 padding[0x10 - 0x5];
u32 unk10;
u8 padding2[0x20 - 0x14];
struct unkStruct_41C unk20;
u8 padding3[0x28 - 0x24];
u32 unk28;
s8 unk2C;
u8 padding4[0x30 - 0x2D];
};
extern u32 sub_80144A4(s32 *r0);
extern void sub_8011C28(u32);
extern void sub_8095240(u8);
@ -40,14 +25,13 @@ extern u32 sub_8095350();
extern u8 sub_801CF14(u32);
extern u32 sub_802F298();
extern struct unkStruct_8095228 *sub_8095228(u8);
extern u8 sub_80A2824(u32);
#include "data/wonder_mail_1.h"
const struct unkStruct_41C gUnknown_80DED44 =
const struct ItemStruct_203B460 gUnknown_80DED44 =
{
1, 0, 0, 0
1, 0, 0
};
@ -186,7 +170,7 @@ extern void sub_803092C();
extern void sub_8035CF4(u32 *, u32, u32);
extern u32 sub_801CA08(u32);
extern void sub_801CBB8();
extern void sub_801B3C0(struct unkStruct_41C *);
extern void sub_801B3C0(struct ItemStruct_203B460 *);
extern u8 sub_801CB24();
extern void sub_801B450();
extern u32 sub_801B410();
@ -302,13 +286,6 @@ void sub_8028BF0(void)
case 3:
sub_8028B04(11);
break;
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
break;
case 10:
sub_8028B04(2);
break;
@ -890,16 +867,6 @@ void sub_80293F4(void)
case 3:
switch(sub_8039068(0x1C, (gUnknown_203B2C0->passwordBuffer), &temp.unk0))
{
case 8:
case 9:
case 10:
case 11:
case 12:
case 13:
case 14:
case 15:
case 16:
break;
case 17:
sub_8014248(gWonderMailPasswordIncorrectText, 0, 8, &gUnknown_80DDA48, 0, 4, 0, (u32 *)&gUnknown_203B2C0->faceFile, 0xC);
sub_8028B04(40);
@ -912,10 +879,6 @@ void sub_80293F4(void)
sub_80141B4(gWonderMailDuplicateText, 0, (u32 *)&gUnknown_203B2C0->faceFile, 0x10d);
sub_8028B04(7);
break;
case 19:
case 20:
case 21:
break;
case 22:
sub_8095274(temp.unk10);
temp.unk0 = 2; // Some sort of Ack?
@ -1573,11 +1536,8 @@ void PrintWonderMailLinkError(u32 param_1)
sub_80141B4(gUnknown_80DF138,0,(u32 *)&gUnknown_203B2C4->faceFile, 0x10d);
break;
case 0:
case 8:
case 10:
case 12:
default:
return;
break;
}
}
@ -1588,10 +1548,10 @@ void sub_8029F98(void)
if (sub_80144A4(&auStack20) != 0) {
return;
}
MemoryFill8((u8 *)&gUnknown_203B2C4->unk41C, 0, sizeof(struct unkStruct_41C));
gUnknown_203B2C4->unk41C.unk41E = 0;
gUnknown_203B2C4->unk41C.unk41D = 1;
gUnknown_203B2C4->unk41C.unk41C = 0;
MemoryFill8((u8 *)&gUnknown_203B2C4->unk41C, 0, sizeof(struct ItemStruct_203B460));
gUnknown_203B2C4->unk41C.itemIndex = 0;
gUnknown_203B2C4->unk41C.numItems = 1;
gUnknown_203B2C4->unk41C.unk0 = 0;
if (gUnknown_203B2C4->linkError == 0) {
switch(gUnknown_203B2C4->unk40)
{
@ -1757,9 +1717,9 @@ void sub_802A230(void)
void sub_802A28C(void)
{
gUnknown_203B2C4->unk41C.unk41E = 0;
gUnknown_203B2C4->unk41C.unk41D = 1;
gUnknown_203B2C4->unk41C.unk41C = 0;
gUnknown_203B2C4->unk41C.itemIndex = 0;
gUnknown_203B2C4->unk41C.numItems = 1;
gUnknown_203B2C4->unk41C.unk0 = 0;
switch(sub_801CA08(1))
{
@ -1768,12 +1728,12 @@ void sub_802A28C(void)
sub_802B2BC(1);
break;
case 3:
gUnknown_203B2C4->unk41C.unk41E = sub_801CB24();
gUnknown_203B2C4->unk41C.itemIndex = sub_801CB24();
sub_802B2BC(0x14);
break;
case 4:
gUnknown_203B2C4->unk4 = 0x13;
gUnknown_203B2C4->unk41C.unk41E = sub_801CB24();
gUnknown_203B2C4->unk41C.itemIndex = sub_801CB24();
sub_8006518(gUnknown_203B2C4->unk3BC);
ResetUnusedInputStruct();
sub_800641C(0,1,1);
@ -1911,15 +1871,6 @@ void sub_802A50C(void)
case 3:
switch(sub_8039068(0x20,gUnknown_203B2C4->passwordBuffer,&temp.unk0))
{
case 7:
case 8:
case 9:
case 0xA:
case 0xD:
case 0xE:
case 0xF:
case 0x10:
break;
case 0x11:
// Wrong password
sub_8014248(gUnknown_80DF1C0,0,7,&gUnknown_80DEE44,0,4,0,(u32 *)&gUnknown_203B2C4->faceFile,0xc);
@ -1945,6 +1896,7 @@ void sub_802A50C(void)
sub_802B2BC(0x21);
break;
default:
case 7:
break;
}
sub_80155F0();
@ -2051,11 +2003,11 @@ void sub_802A798(void)
{
case 7:
return_var = sub_8095228(gUnknown_203B2C4->unk218);
if(gUnknown_203B2C4->unk41C.unk41E != 0)
if(gUnknown_203B2C4->unk41C.itemIndex != 0)
{
return_var->unk20 = gUnknown_203B2C4->unk41C;
}
gUnknown_203B460->unk50[gUnknown_203B2C4->unk41C.unk41E]--;
gUnknown_203B460->unk50[gUnknown_203B2C4->unk41C.itemIndex]--;
sub_802B2BC(0x29);
break;
case 8:
@ -2240,7 +2192,7 @@ void sub_802AA28(void)
{
case 1:
return_var = sub_8095228(sub_80953D4(5));
if(return_var->unk20.unk41E != 0)
if(return_var->unk20.itemIndex != 0)
{
sub_802B2BC(7);
}

View File

@ -6,6 +6,7 @@
#include "text.h"
#include "save.h"
#include "wonder_mail.h"
#include "sub_8095228.h"
extern struct WonderMailStruct_203B2C4 *gUnknown_203B2C4;
@ -43,26 +44,8 @@ struct unkStruct_203B2C8
extern struct unkStruct_203B2C8 *gUnknown_203B2C8;
struct unkStruct_8095228
{
u8 unk0;
u8 unk1;
u8 unk2;
u8 unk3;
u8 unk4;
u8 padding[0x10 - 0x5];
u32 unk10;
u8 padding2[0x20 - 0x14];
u32 unk20;
u8 padding3[0x28 - 0x24];
u32 unk28;
s8 unk2C;
u8 padding4[0x30 - 0x2D];
};
extern void sub_80920D8(u8 *buffer);
extern void sub_8097790();
extern struct unkStruct_8095228 *sub_8095228(u8);
extern char gUnknown_202E5D8[0x50];
extern char gAvailablePokemonNames[0x50];
extern u32 sub_802F298();