lots of menu cleanup and some menu decomp

This commit is contained in:
Seth Barberee 2023-05-18 07:45:14 -07:00
parent d9a411956b
commit 204dc302be
16 changed files with 1411 additions and 2068 deletions

View File

@ -1,274 +0,0 @@
#include "asm/constants/gba_constants.inc"
#include "asm/macros.inc"
.syntax unified
.text
thumb_func_start sub_80175FC
sub_80175FC:
push {r4-r7,lr}
ldr r4, _0801767C
ldr r0, [r4]
adds r0, 0x4C
movs r1, 0
movs r2, 0xA
bl MemoryFill16
ldr r3, [r4]
movs r2, 0
ldr r0, _08017680
ldr r0, [r0]
str r0, [r3, 0x24]
movs r0, 0x2
str r0, [r3, 0x28]
movs r1, 0x1
ldr r0, _08017684
ldr r0, [r0]
str r0, [r3, 0x2C]
movs r0, 0x3
str r0, [r3, 0x30]
ldr r0, _08017688
ldr r0, [r0]
str r0, [r3, 0x34]
movs r0, 0x6
str r0, [r3, 0x38]
ldr r0, _0801768C
ldr r0, [r0]
str r0, [r3, 0x3C]
str r1, [r3, 0x40]
movs r6, 0x4
str r2, [r3, 0x44]
str r1, [r3, 0x48]
movs r5, 0
mov r12, r3
adds r3, 0x28
mov r2, r12
adds r2, 0x4C
_08017648:
ldrh r0, [r2]
cmp r0, 0
bne _08017658
ldr r1, [r3]
mov r7, r12
ldr r0, [r7, 0x18]
cmp r1, r0
beq _080176B2
_08017658:
adds r3, 0x8
adds r2, 0x2
adds r5, 0x1
cmp r5, r6
blt _08017648
movs r5, 0
cmp r5, r6
bge _080176B2
ldr r1, [r4]
adds r0, r1, 0
adds r0, 0x4C
ldrh r0, [r0]
cmp r0, 0
bne _08017690
ldr r0, [r1, 0x28]
str r0, [r1, 0x18]
b _080176B2
.align 2, 0
_0801767C: .4byte gUnknown_203B208
_08017680: .4byte gUnknown_80D4958
_08017684: .4byte gUnknown_80D4964
_08017688: .4byte gUnknown_80D4970
_0801768C: .4byte gUnknown_80D4934
_08017690:
adds r5, 0x1
cmp r5, r6
bge _080176B2
ldr r2, [r4]
lsls r0, r5, 1
adds r1, r2, 0
adds r1, 0x4C
adds r1, r0
ldrh r0, [r1]
cmp r0, 0
bne _08017690
lsls r0, r5, 3
adds r1, r2, 0
adds r1, 0x28
adds r1, r0
ldr r0, [r1]
str r0, [r2, 0x18]
_080176B2:
pop {r4-r7}
pop {r0}
bx r0
thumb_func_end sub_80175FC
thumb_func_start sub_80176B8
sub_80176B8:
push {r4-r7,lr}
ldr r4, _08017724
ldr r0, [r4]
adds r0, 0x4C
movs r1, 0
movs r2, 0xA
bl MemoryFill16
ldr r3, [r4]
movs r2, 0
ldr r0, _08017728
ldr r0, [r0]
str r0, [r3, 0x24]
movs r0, 0x2
str r0, [r3, 0x28]
movs r1, 0x1
ldr r0, _0801772C
ldr r0, [r0]
str r0, [r3, 0x2C]
movs r0, 0x6
str r0, [r3, 0x30]
movs r6, 0x2
str r2, [r3, 0x34]
str r1, [r3, 0x38]
movs r5, 0
mov r12, r3
adds r3, 0x28
mov r2, r12
adds r2, 0x4C
_080176F2:
ldrh r0, [r2]
cmp r0, 0
bne _08017702
ldr r1, [r3]
mov r7, r12
ldr r0, [r7, 0x1C]
cmp r1, r0
beq _08017752
_08017702:
adds r3, 0x8
adds r2, 0x2
adds r5, 0x1
cmp r5, r6
blt _080176F2
movs r5, 0
cmp r5, r6
bge _08017752
ldr r1, [r4]
adds r0, r1, 0
adds r0, 0x4C
ldrh r0, [r0]
cmp r0, 0
bne _08017730
ldr r0, [r1, 0x28]
str r0, [r1, 0x1C]
b _08017752
.align 2, 0
_08017724: .4byte gUnknown_203B208
_08017728: .4byte gUnknown_80D4958
_0801772C: .4byte gUnknown_80D4970
_08017730:
adds r5, 0x1
cmp r5, r6
bge _08017752
ldr r2, [r4]
lsls r0, r5, 1
adds r1, r2, 0
adds r1, 0x4C
adds r1, r0
ldrh r0, [r1]
cmp r0, 0
bne _08017730
lsls r0, r5, 3
adds r1, r2, 0
adds r1, 0x28
adds r1, r0
ldr r0, [r1]
str r0, [r2, 0x1C]
_08017752:
pop {r4-r7}
pop {r0}
bx r0
thumb_func_end sub_80176B8
thumb_func_start sub_8017758
sub_8017758:
push {r4-r7,lr}
ldr r4, _080177C4
ldr r0, [r4]
adds r0, 0x4C
movs r1, 0
movs r2, 0xA
bl MemoryFill16
ldr r3, [r4]
movs r2, 0
ldr r0, _080177C8
ldr r0, [r0]
str r0, [r3, 0x24]
movs r0, 0x3
str r0, [r3, 0x28]
movs r1, 0x1
ldr r0, _080177CC
ldr r0, [r0]
str r0, [r3, 0x2C]
movs r0, 0x6
str r0, [r3, 0x30]
movs r6, 0x2
str r2, [r3, 0x34]
str r1, [r3, 0x38]
movs r5, 0
mov r12, r3
adds r3, 0x28
mov r2, r12
adds r2, 0x4C
_08017792:
ldrh r0, [r2]
cmp r0, 0
bne _080177A2
ldr r1, [r3]
mov r7, r12
ldr r0, [r7, 0x20]
cmp r1, r0
beq _080177F2
_080177A2:
adds r3, 0x8
adds r2, 0x2
adds r5, 0x1
cmp r5, r6
blt _08017792
movs r5, 0
cmp r5, r6
bge _080177F2
ldr r1, [r4]
adds r0, r1, 0
adds r0, 0x4C
ldrh r0, [r0]
cmp r0, 0
bne _080177D0
ldr r0, [r1, 0x28]
str r0, [r1, 0x20]
b _080177F2
.align 2, 0
_080177C4: .4byte gUnknown_203B208
_080177C8: .4byte gUnknown_80D4964
_080177CC: .4byte gUnknown_80D4970
_080177D0:
adds r5, 0x1
cmp r5, r6
bge _080177F2
ldr r2, [r4]
lsls r0, r5, 1
adds r1, r2, 0
adds r1, 0x4C
adds r1, r0
ldrh r0, [r1]
cmp r0, 0
bne _080177D0
lsls r0, r5, 3
adds r1, r2, 0
adds r1, 0x28
adds r1, r0
ldr r0, [r1]
str r0, [r2, 0x20]
_080177F2:
pop {r4-r7}
pop {r0}
bx r0
thumb_func_end sub_8017758
.align 2,0

View File

@ -1,359 +0,0 @@
#include "asm/constants/gba_constants.inc"
#include "asm/macros.inc"
.syntax unified
.text
thumb_func_start sub_80182E4
sub_80182E4:
push {r4-r7,lr}
mov r7, r8
push {r7}
movs r0, 0
mov r8, r0
ldr r4, _080183DC
ldr r0, [r4]
adds r0, 0x60
movs r1, 0
movs r2, 0x10
bl MemoryFill16
ldr r1, [r4]
ldr r0, _080183E0
ldr r0, [r0]
str r0, [r1, 0x20]
movs r0, 0x2
str r0, [r1, 0x24]
bl GetNumberOfFilledInventorySlots
cmp r0, 0
beq _0801831C
movs r0, 0
bl sub_801CF50
lsls r0, 24
cmp r0, 0
beq _08018324
_0801831C:
ldr r0, [r4]
adds r0, 0x60
movs r1, 0x1
strh r1, [r0]
_08018324:
movs r1, 0x1
add r8, r1
ldr r4, _080183DC
ldr r2, [r4]
mov r0, r8
lsls r3, r0, 3
adds r0, r2, 0
adds r0, 0x20
adds r0, r3
ldr r1, _080183E4
ldr r1, [r1]
str r1, [r0]
adds r2, 0x24
adds r2, r3
movs r0, 0x3
str r0, [r2]
movs r0, 0x1
bl sub_801CF14
lsls r0, 24
cmp r0, 0
bne _08018358
bl GetNumberOfFilledInventorySlots
cmp r0, 0x13
ble _08018366
_08018358:
ldr r0, [r4]
mov r2, r8
lsls r1, r2, 1
adds r0, 0x60
adds r0, r1
movs r1, 0x1
strh r1, [r0]
_08018366:
movs r0, 0x1
add r8, r0
ldr r4, _080183DC
ldr r7, [r4]
mov r2, r8
lsls r1, r2, 3
adds r2, r7, 0
adds r2, 0x20
adds r3, r2, r1
ldr r0, _080183E8
ldr r0, [r0]
str r0, [r3]
adds r6, r7, 0
adds r6, 0x24
adds r1, r6, r1
movs r3, 0x1
str r3, [r1]
add r8, r3
mov r1, r8
lsls r0, r1, 3
adds r2, r0
movs r1, 0
str r1, [r2]
adds r0, r6, r0
str r3, [r0]
movs r5, 0
mov r12, r4
cmp r5, r8
bge _080183C0
adds r4, r7, 0
adds r2, r4, 0
adds r2, 0x60
adds r3, r6, 0
_080183A8:
ldrh r0, [r2]
cmp r0, 0
bne _080183B6
ldr r1, [r3]
ldr r0, [r4, 0x14]
cmp r1, r0
beq _08018410
_080183B6:
adds r2, 0x2
adds r3, 0x8
adds r5, 0x1
cmp r5, r8
blt _080183A8
_080183C0:
movs r5, 0
cmp r5, r8
bge _08018410
mov r2, r12
ldr r1, [r2]
adds r0, r1, 0
adds r0, 0x60
ldrh r0, [r0]
cmp r0, 0
bne _080183EC
ldr r0, [r1, 0x24]
str r0, [r1, 0x14]
b _08018410
.align 2, 0
_080183DC: .4byte gUnknown_203B20C
_080183E0: .4byte gUnknown_80D4958
_080183E4: .4byte gUnknown_80D4964
_080183E8: .4byte gUnknown_80D4934
_080183EC:
adds r5, 0x1
cmp r5, r8
bge _08018410
mov r0, r12
ldr r2, [r0]
lsls r0, r5, 1
adds r1, r2, 0
adds r1, 0x60
adds r1, r0
ldrh r0, [r1]
cmp r0, 0
bne _080183EC
lsls r0, r5, 3
adds r1, r2, 0
adds r1, 0x24
adds r1, r0
ldr r0, [r1]
str r0, [r2, 0x14]
_08018410:
pop {r3}
mov r8, r3
pop {r4-r7}
pop {r0}
bx r0
thumb_func_end sub_80182E4
thumb_func_start sub_801841C
sub_801841C:
push {r4-r7,lr}
ldr r4, _080184A0
ldr r0, [r4]
adds r0, 0x60
movs r1, 0
movs r2, 0x10
bl MemoryFill16
ldr r1, [r4]
ldr r0, _080184A4
ldr r0, [r0]
str r0, [r1, 0x20]
movs r0, 0x2
str r0, [r1, 0x24]
ldr r0, [r1, 0xC]
bl sub_801ADA0
lsls r0, 24
cmp r0, 0
bne _0801844C
ldr r0, [r4]
adds r0, 0x60
movs r1, 0x1
strh r1, [r0]
_0801844C:
ldr r2, [r4]
movs r1, 0x1
ldr r0, _080184A8
ldr r0, [r0]
str r0, [r2, 0x28]
movs r0, 0x4
str r0, [r2, 0x2C]
movs r5, 0x2
movs r0, 0
str r0, [r2, 0x30]
str r1, [r2, 0x34]
movs r3, 0
adds r6, r4, 0
mov r12, r2
mov r4, r12
adds r4, 0x60
adds r2, 0x24
_0801846E:
ldrh r0, [r4]
cmp r0, 0
bne _0801847E
ldr r1, [r2]
mov r7, r12
ldr r0, [r7, 0x18]
cmp r1, r0
beq _080184CE
_0801847E:
adds r4, 0x2
adds r2, 0x8
adds r3, 0x1
cmp r3, r5
blt _0801846E
movs r3, 0
cmp r3, r5
bge _080184CE
ldr r1, [r6]
adds r0, r1, 0
adds r0, 0x60
ldrh r0, [r0]
cmp r0, 0
bne _080184AC
ldr r0, [r1, 0x24]
str r0, [r1, 0x18]
b _080184CE
.align 2, 0
_080184A0: .4byte gUnknown_203B20C
_080184A4: .4byte gUnknown_80D4958
_080184A8: .4byte gUnknown_80D4970
_080184AC:
adds r3, 0x1
cmp r3, r5
bge _080184CE
ldr r2, [r6]
lsls r0, r3, 1
adds r1, r2, 0
adds r1, 0x60
adds r1, r0
ldrh r0, [r1]
cmp r0, 0
bne _080184AC
lsls r0, r3, 3
adds r1, r2, 0
adds r1, 0x24
adds r1, r0
ldr r0, [r1]
str r0, [r2, 0x18]
_080184CE:
pop {r4-r7}
pop {r0}
bx r0
thumb_func_end sub_801841C
thumb_func_start sub_80184D4
sub_80184D4:
push {r4-r7,lr}
ldr r4, _08018554
ldr r0, [r4]
adds r0, 0x60
movs r1, 0
movs r2, 0x10
bl MemoryFill16
ldr r1, [r4]
ldr r0, _08018558
ldr r0, [r0]
str r0, [r1, 0x20]
movs r0, 0x3
str r0, [r1, 0x24]
bl GetNumberOfFilledInventorySlots
cmp r0, 0x13
ble _08018500
ldr r0, [r4]
adds r0, 0x60
movs r1, 0x1
strh r1, [r0]
_08018500:
ldr r2, [r4]
movs r1, 0x1
ldr r0, _0801855C
ldr r0, [r0]
str r0, [r2, 0x28]
movs r0, 0x4
str r0, [r2, 0x2C]
movs r5, 0x2
movs r0, 0
str r0, [r2, 0x30]
str r1, [r2, 0x34]
movs r3, 0
adds r6, r4, 0
mov r12, r2
mov r4, r12
adds r4, 0x60
adds r2, 0x24
_08018522:
ldrh r0, [r4]
cmp r0, 0
bne _08018532
ldr r1, [r2]
mov r7, r12
ldr r0, [r7, 0x1C]
cmp r1, r0
beq _08018582
_08018532:
adds r4, 0x2
adds r2, 0x8
adds r3, 0x1
cmp r3, r5
blt _08018522
movs r3, 0
cmp r3, r5
bge _08018582
ldr r1, [r6]
adds r0, r1, 0
adds r0, 0x60
ldrh r0, [r0]
cmp r0, 0
bne _08018560
ldr r0, [r1, 0x24]
str r0, [r1, 0x1C]
b _08018582
.align 2, 0
_08018554: .4byte gUnknown_203B20C
_08018558: .4byte gUnknown_80D4964
_0801855C: .4byte gUnknown_80D4970
_08018560:
adds r3, 0x1
cmp r3, r5
bge _08018582
ldr r2, [r6]
lsls r0, r3, 1
adds r1, r2, 0
adds r1, 0x60
adds r1, r0
ldrh r0, [r1]
cmp r0, 0
bne _08018560
lsls r0, r3, 3
adds r1, r2, 0
adds r1, 0x24
adds r1, r0
ldr r0, [r1]
str r0, [r2, 0x1C]
_08018582:
pop {r4-r7}
pop {r0}
bx r0
thumb_func_end sub_80184D4
.align 2,0

View File

@ -755,275 +755,4 @@ _080194F0: .4byte gKecleonShopDialogue
_080194F4: .4byte 0x0000010d
thumb_func_end UpdateKecleonStoreDialogue
thumb_func_start sub_80194F8
sub_80194F8:
push {r4-r7,lr}
ldr r4, _08019580
ldr r0, [r4]
adds r0, 0x74
movs r1, 0
movs r2, 0x10
bl MemoryFill16
ldr r3, [r4]
movs r2, 0
ldr r0, _08019584
ldr r0, [r0]
str r0, [r3, 0x34]
movs r0, 0x2
str r0, [r3, 0x38]
movs r1, 0x1
ldr r0, _08019588
ldr r0, [r0]
str r0, [r3, 0x3C]
movs r0, 0x3
str r0, [r3, 0x40]
ldr r0, _0801958C
str r0, [r3, 0x44]
movs r0, 0x4
str r0, [r3, 0x48]
ldr r0, _08019590
ldr r0, [r0]
str r0, [r3, 0x4C]
movs r0, 0x7
str r0, [r3, 0x50]
ldr r0, _08019594
ldr r0, [r0]
str r0, [r3, 0x54]
str r1, [r3, 0x58]
movs r6, 0x5
str r2, [r3, 0x5C]
str r1, [r3, 0x60]
movs r5, 0
mov r12, r3
adds r3, 0x38
mov r2, r12
adds r2, 0x74
_0801954C:
ldrh r0, [r2]
cmp r0, 0
bne _0801955C
ldr r1, [r3]
mov r7, r12
ldr r0, [r7, 0x28]
cmp r1, r0
beq _080195BA
_0801955C:
adds r3, 0x8
adds r2, 0x2
adds r5, 0x1
cmp r5, r6
blt _0801954C
movs r5, 0
cmp r5, r6
bge _080195BA
ldr r1, [r4]
adds r0, r1, 0
adds r0, 0x74
ldrh r0, [r0]
cmp r0, 0
bne _08019598
ldr r0, [r1, 0x38]
str r0, [r1, 0x28]
b _080195BA
.align 2, 0
_08019580: .4byte gUnknown_203B210
_08019584: .4byte gUnknown_80D4978
_08019588: .4byte gUnknown_80D4984
_0801958C: .4byte gUnknown_80DB8A0
_08019590: .4byte gUnknown_80D4970
_08019594: .4byte gUnknown_80D4934
_08019598:
adds r5, 0x1
cmp r5, r6
bge _080195BA
ldr r2, [r4]
lsls r0, r5, 1
adds r1, r2, 0
adds r1, 0x74
adds r1, r0
ldrh r0, [r1]
cmp r0, 0
bne _08019598
lsls r0, r5, 3
adds r1, r2, 0
adds r1, 0x38
adds r1, r0
ldr r0, [r1]
str r0, [r2, 0x28]
_080195BA:
pop {r4-r7}
pop {r0}
bx r0
thumb_func_end sub_80194F8
thumb_func_start sub_80195C0
sub_80195C0:
push {r4-r7,lr}
ldr r4, _0801962C
ldr r0, [r4]
adds r0, 0x74
movs r1, 0
movs r2, 0x10
bl MemoryFill16
ldr r3, [r4]
movs r2, 0
ldr r0, _08019630
ldr r0, [r0]
str r0, [r3, 0x34]
movs r0, 0x2
str r0, [r3, 0x38]
movs r1, 0x1
ldr r0, _08019634
ldr r0, [r0]
str r0, [r3, 0x3C]
movs r0, 0x7
str r0, [r3, 0x40]
movs r6, 0x2
str r2, [r3, 0x44]
str r1, [r3, 0x48]
movs r5, 0
mov r12, r3
adds r3, 0x38
mov r2, r12
adds r2, 0x74
_080195FA:
ldrh r0, [r2]
cmp r0, 0
bne _0801960A
ldr r1, [r3]
mov r7, r12
ldr r0, [r7, 0x30]
cmp r1, r0
beq _0801965A
_0801960A:
adds r3, 0x8
adds r2, 0x2
adds r5, 0x1
cmp r5, r6
blt _080195FA
movs r5, 0
cmp r5, r6
bge _0801965A
ldr r1, [r4]
adds r0, r1, 0
adds r0, 0x74
ldrh r0, [r0]
cmp r0, 0
bne _08019638
ldr r0, [r1, 0x38]
str r0, [r1, 0x30]
b _0801965A
.align 2, 0
_0801962C: .4byte gUnknown_203B210
_08019630: .4byte gUnknown_80D4978
_08019634: .4byte gUnknown_80D4970
_08019638:
adds r5, 0x1
cmp r5, r6
bge _0801965A
ldr r2, [r4]
lsls r0, r5, 1
adds r1, r2, 0
adds r1, 0x74
adds r1, r0
ldrh r0, [r1]
cmp r0, 0
bne _08019638
lsls r0, r5, 3
adds r1, r2, 0
adds r1, 0x38
adds r1, r0
ldr r0, [r1]
str r0, [r2, 0x30]
_0801965A:
pop {r4-r7}
pop {r0}
bx r0
thumb_func_end sub_80195C0
thumb_func_start sub_8019660
sub_8019660:
push {r4-r7,lr}
ldr r4, _080196CC
ldr r0, [r4]
adds r0, 0x74
movs r1, 0
movs r2, 0x10
bl MemoryFill16
ldr r3, [r4]
movs r2, 0
ldr r0, _080196D0
ldr r0, [r0]
str r0, [r3, 0x34]
movs r0, 0x3
str r0, [r3, 0x38]
movs r1, 0x1
ldr r0, _080196D4
ldr r0, [r0]
str r0, [r3, 0x3C]
movs r0, 0x7
str r0, [r3, 0x40]
movs r6, 0x2
str r2, [r3, 0x44]
str r1, [r3, 0x48]
movs r5, 0
mov r12, r3
adds r3, 0x38
mov r2, r12
adds r2, 0x74
_0801969A:
ldrh r0, [r2]
cmp r0, 0
bne _080196AA
ldr r1, [r3]
mov r7, r12
ldr r0, [r7, 0x2C]
cmp r1, r0
beq _080196FA
_080196AA:
adds r3, 0x8
adds r2, 0x2
adds r5, 0x1
cmp r5, r6
blt _0801969A
movs r5, 0
cmp r5, r6
bge _080196FA
ldr r1, [r4]
adds r0, r1, 0
adds r0, 0x74
ldrh r0, [r0]
cmp r0, 0
bne _080196D8
ldr r0, [r1, 0x38]
str r0, [r1, 0x2C]
b _080196FA
.align 2, 0
_080196CC: .4byte gUnknown_203B210
_080196D0: .4byte gUnknown_80D4984
_080196D4: .4byte gUnknown_80D4970
_080196D8:
adds r5, 0x1
cmp r5, r6
bge _080196FA
ldr r2, [r4]
lsls r0, r5, 1
adds r1, r2, 0
adds r1, 0x74
adds r1, r0
ldrh r0, [r1]
cmp r0, 0
bne _080196D8
lsls r0, r5, 3
adds r1, r2, 0
adds r1, 0x38
adds r1, r0
ldr r0, [r1]
str r0, [r2, 0x2C]
_080196FA:
pop {r4-r7}
pop {r0}
bx r0
thumb_func_end sub_8019660
.align 2,0

View File

@ -101,10 +101,6 @@ SECTIONS {
src/kangaskhan_storage.o(.text);
asm/kangaskhan_storage.o(.text);
src/kangaskhan_storage_1.o(.text);
asm/kangaskhan_storage_1.o(.text);
src/kangaskhan_storage_2.o(.text);
asm/kangaskhan_storage_2.o(.text);
src/kangaskhan_storage_3.o(.text);
src/kecleon_items.o(.text);
asm/kecleon_items.o(.text);
src/kecleon_items_1.o(.text);

View File

@ -501,15 +501,15 @@ void sub_801B874(void)
void sub_801BB20(void)
{
struct unkStruct_203B234 *preload;
u8 *nullText;
s32 loopMax;
preload = gUnknown_203B234;
nullText = NULL;
preload->unkCC[0].text = gKangaskhanTrashToolboxItem;
preload->unkCC[0].menuAction = 4;
preload->unkCC[1].text = gKangaskhanTrashReceivedItem;
preload->unkCC[1].menuAction = 5;
preload->unkCC[2].text = nullText;
preload->unkCC[2].menuAction = -1;
loopMax = 0;
gUnknown_203B234->unkCC[loopMax].text = gKangaskhanTrashToolboxItem;
gUnknown_203B234->unkCC[loopMax].menuAction = 4;
loopMax += 1;
gUnknown_203B234->unkCC[loopMax].text = gKangaskhanTrashReceivedItem;
gUnknown_203B234->unkCC[loopMax].menuAction = 5;
loopMax += 1;
gUnknown_203B234->unkCC[loopMax].text = NULL;
gUnknown_203B234->unkCC[loopMax].menuAction = -1;
}

View File

@ -173,25 +173,20 @@ void sub_803AE58(void)
void sub_803AEB0(void)
{
s32 index;
s32 loopMax;
u8 *nullText;
s32 menuAction;
struct unkStruct_203B3F8 *preload;
MemoryFill16(gUnknown_203B3F8->unkD0,0,sizeof(gUnknown_203B3F8->unkD0));
loopMax = 0;
preload = gUnknown_203B3F8;
nullText = NULL;
preload->unk90[0].text = gDebug_LevelText;
preload->unk90[0].menuAction = 4;
menuAction = 1;
preload->unk90[1].text = gUnknown_80E7F2C;
preload->unk90[1].menuAction = 5;
loopMax = 2;
preload->unk90[2].text = nullText;
preload->unk90[2].menuAction = menuAction;
gUnknown_203B3F8->unk90[loopMax].text = gDebug_LevelText;
gUnknown_203B3F8->unk90[loopMax].menuAction = 4;
loopMax += 1;
gUnknown_203B3F8->unk90[loopMax].text = gUnknown_80E7F2C;
gUnknown_203B3F8->unk90[loopMax].menuAction = 5;
loopMax += 1;
gUnknown_203B3F8->unk90[loopMax].text = NULL;
gUnknown_203B3F8->unk90[loopMax].menuAction = 1;
for(index = 0; index < loopMax; index++)
{

View File

@ -227,23 +227,21 @@ void sub_803A690(void)
void sub_803A6F0(void)
{
s32 menuAction;
struct unkStruct_203B3F0 *preload;
s32 loopMax = 0;
gUnknown_203B3F0->menuItems[0].text = &gDebug_NumberText;
gUnknown_203B3F0->menuItems[0].menuAction = 2;
gUnknown_203B3F0->menuItems[loopMax].text = &gDebug_NumberText;
gUnknown_203B3F0->menuItems[loopMax].menuAction = 2;
gUnknown_203B3F0->menuAction = 2;
if (!IsNotMoneyOrUsedTMItem(gUnknown_203B3F0->id)) {
gUnknown_203B3F0->menuItems[0].menuAction = -1;
gUnknown_203B3F0->menuItems[loopMax].menuAction = -1;
gUnknown_203B3F0->menuAction = 3;
}
preload = gUnknown_203B3F0;
// this var gets loaded in between the sets... very dumb
menuAction = 1;
preload->menuItems[1].text = *gUnknown_80D4970;
preload->menuItems[1].menuAction = 3;
preload->menuItems[2].text = NULL;
preload->menuItems[2].menuAction = menuAction;
loopMax += 1;
gUnknown_203B3F0->menuItems[loopMax].text = *gUnknown_80D4970;
gUnknown_203B3F0->menuItems[loopMax].menuAction = 3;
loopMax += 1;
gUnknown_203B3F0->menuItems[loopMax].text = NULL;
gUnknown_203B3F0->menuItems[loopMax].menuAction = 1;
}
void sub_803A740(void)

File diff suppressed because it is too large Load Diff

View File

@ -1,633 +0,0 @@
#include "constants/item.h"
#include "global.h"
#include "input.h"
#include "memory.h"
#include "text.h"
#include "item.h"
#include "team_inventory.h"
#include "input.h"
#include "kangaskhan_storage.h"
#include "menu_input.h"
extern struct unkStruct_203B208 *gUnknown_203B208;
extern struct unkStruct_203B20C *gUnknown_203B20C;
extern void sub_8017F10(u32);
extern void sub_8018588(void);
extern void sub_8018620(void);
extern void sub_8018904(void);
extern void sub_8018AC8(void);
extern void sub_80186F8(void);
extern void sub_8018854(void);
extern void sub_80189C8(void);
extern void sub_8018AE4(void);
extern void sub_8017F28();
extern void sub_8018100();
extern void UpdateKangaskhanStorageState(u32);
extern s32 sub_80144A4(s32 *);
extern void sub_801B450();
extern u32 sub_801B410(void);
extern void sub_801CBB8();
extern bool8 sub_801ADA0(u32);
extern void sub_8099690(u32);
extern u32 sub_8013BBC(u32 *);
extern void sub_8017598(void);
extern u32 sub_801CA08(u32);
extern u32 sub_801CFB8(void);
extern u8 sub_801CB24();
extern void sub_801AD34(u32);
extern u32 sub_801A6E8(u32);
extern u32 sub_801AEA8(void);
extern u32 sub_801A8AC(void);
extern void sub_801A928(void);
extern void sub_80182E4(void);
extern void sub_8008C54(u32);
extern void sub_80073B8(u32);
extern void sub_8013C68(u32 *);
extern void sub_80073E0(u32);
extern void xxx_call_draw_string(u32 x, u32 y, u8 *, u32, u32);
extern void sub_801A9E0();
extern void sub_801841C();
extern void sub_801CCD8();
extern void sub_80184D4();
extern void sub_8018280();
extern void sub_8013AA0(u32 *);
extern void sub_801B3C0(struct Item *);
extern void sub_801A5D8(u32, u32, u32, u32);
extern void sub_801C8C4(u32, u32, u32, u32);
extern void sub_801CB5C(u32);
extern void sub_801A8D0(u32);
extern u32 sub_801CFE0(u8);
extern void sub_801CF94(void);
extern void sub_801AE84(void);
extern s32 sub_801AED0(s32);
extern u8 sub_801CF14(u32);
extern u8 sub_801CF50(u32);
extern struct UnkTextStruct2 gUnknown_80DB7B8;
extern struct UnkTextStruct2 gUnknown_80DB7E8;
extern struct UnkTextStruct2 gUnknown_80DB7D0;
extern struct UnkTextStruct2 gUnknown_80DB800;
extern struct UnkTextStruct2 gUnknown_80DB818;
extern u8 gUnknown_80DB830[];
extern u8 *gUnknown_80D4920[];
extern u8 *gUnknown_80D4928[];
void sub_80177F8(void)
{
struct unkStruct_203B208 *preload;
u8 *nullText;
u32 defaultAction;
preload = gUnknown_203B208;
nullText = NULL;
preload->unk24[0].text = *gUnknown_80D4920;
preload->unk24[0].menuAction = 4;
defaultAction = 1;
preload->unk24[1].text = *gUnknown_80D4928;
preload->unk24[1].menuAction = 5;
preload->unk24[2].text = nullText;
preload->unk24[2].menuAction = defaultAction;
}
void sub_8017828(void)
{
s32 menuAction;
if (sub_80144A4(&menuAction) == 0) {
if (menuAction != 1) {
gUnknown_203B208->menuAction1 = menuAction;
}
switch(menuAction)
{
case 2:
if (GetNumberOfFilledInventorySlots() == 0) {
UpdateKangaskhanStorageState(KANGASKHAN_STORAGE_NO_INV_ITEMS);
}
else if (sub_801CF50(0) != 0) {
UpdateKangaskhanStorageState(8);
}
else {
UpdateKangaskhanStorageState(0xb);
}
break;
case 3:
if (sub_801CF14(1) != 0) {
UpdateKangaskhanStorageState(7);
}
else if (GetNumberOfFilledInventorySlots() >= INVENTORY_SIZE) {
UpdateKangaskhanStorageState(KANGASKHAN_STORAGE_TOO_MANY_ITEMS);
}
else {
UpdateKangaskhanStorageState(0x14);
}
break;
case 6:
UpdateKangaskhanStorageState(2);
break;
case 1:
UpdateKangaskhanStorageState(3);
break;
}
}
}
void sub_80178D0(void)
{
s32 menuAction;
if (sub_80144A4(&menuAction) == 0) {
switch(menuAction)
{
case 4:
MoveToStorage(&gUnknown_203B208->storedItem);
ShiftItemsDownFrom(gUnknown_203B208->itemIndex);
FillInventoryGaps();
UpdateKangaskhanStorageState(0x13);
break;
case 1:
case 5:
UpdateKangaskhanStorageState(0xe);
break;
}
}
}
void sub_8017928(void)
{
int menuAction;
struct BulkItem item;
if (sub_80144A4(&menuAction) == 0) {
switch(menuAction)
{
case 4:
gTeamInventory_203B460->teamStorage[gUnknown_203B208->storedItem.id] -= gUnknown_203B208->storedItem.quantity;
item.id = gUnknown_203B208->storedItem.id;
item.quantity = gUnknown_203B208->storedItem.quantity;
AddHeldItemToInventory(&item);
UpdateKangaskhanStorageState(0x1d);
break;
case 1:
case 5:
UpdateKangaskhanStorageState(0x17);
break;
}
}
}
void sub_80179A8(void)
{
s32 index;
s32 menuAction;
if (sub_80144A4(&menuAction) == 0) {
switch(menuAction)
{
case 4:
for(index = 0; index < INVENTORY_SIZE; index++)
{
if (sub_801AED0(index) != 0) {
MoveToStorage(&gTeamInventory_203B460->teamItems[index]);
gTeamInventory_203B460->teamItems[index].id = 0;
gTeamInventory_203B460->teamItems[index].flags = 0;
}
}
FillInventoryGaps();
sub_801AE84();
UpdateKangaskhanStorageState(0x13);
break;
case 1:
case 5:
UpdateKangaskhanStorageState(0xe);
break;
}
}
}
void sub_8017A1C(void)
{
s32 itemID;
int menuAction;
struct BulkItem item;
if (sub_80144A4(&menuAction) == 0) {
switch(menuAction)
{
case 4:
for(itemID = 0; itemID < NUMBER_OF_ITEM_IDS; itemID++)
{
if(sub_801CFE0(itemID) != 0)
{
item.id = itemID;
if(IsThrowableItem(item.id))
if(gTeamInventory_203B460->teamStorage[item.id] > 0x63)
{
item.quantity = 0x63;
}
else
{
item.quantity = gTeamInventory_203B460->teamStorage[item.id];
}
else
{
item.quantity = 1;
}
gTeamInventory_203B460->teamStorage[item.id] -= item.quantity;
AddHeldItemToInventory(&item);
}
}
FillInventoryGaps();
sub_801CF94();
UpdateKangaskhanStorageState(0x1d);
break;
case 1:
case 5:
UpdateKangaskhanStorageState(0x17);
break;
}
}
}
void sub_8017AF8(void)
{
switch(sub_801A6E8(1))
{
case 3:
if(sub_801AEA8() != 0)
{
sub_8099690(0);
UpdateKangaskhanStorageState(0x12);
}
else
{
gUnknown_203B208->itemIndex = sub_801A8AC();
gUnknown_203B208->storedItem = gTeamInventory_203B460->teamItems[gUnknown_203B208->itemIndex];
UpdateKangaskhanStorageState(0xF);
}
break;
case 4:
gUnknown_203B208->itemIndex = sub_801A8AC();
gUnknown_203B208->storedItem = gTeamInventory_203B460->teamItems[gUnknown_203B208->itemIndex];
UpdateKangaskhanStorageState(0x10);
break;
case 2:
sub_801A928();
UpdateKangaskhanStorageState(KANGASKHAN_STORAGE_MAIN_MENU);
break;
}
}
void sub_8017B88(void)
{
switch(sub_801CA08(1))
{
case 3:
if(sub_801CFB8() != 0){
UpdateKangaskhanStorageState(0x1C);
}
else
{
gUnknown_203B208->id = sub_801CB24();
xxx_init_itemslot_8090A8C(&gUnknown_203B208->storedItem, gUnknown_203B208->id, 0);
gUnknown_203B208->storedItem.quantity = 1;
UpdateKangaskhanStorageState(0x19);
}
break;
case 4:
gUnknown_203B208->id = sub_801CB24();
xxx_init_itemslot_8090A8C(&gUnknown_203B208->storedItem, gUnknown_203B208->id, 0);
gUnknown_203B208->storedItem.quantity = 1;
UpdateKangaskhanStorageState(0x1A);
break;
case 2:
sub_801CBB8();
UpdateKangaskhanStorageState(KANGASKHAN_STORAGE_MAIN_MENU);
break;
case 1:
sub_801AD34(0);
break;
}
}
void sub_8017C28(void)
{
sub_801CA08(0);
sub_8012FD8(&gUnknown_203B208->unk58);
switch(sub_8013BBC(&gUnknown_203B208->unkA8))
{
case 1:
sub_8017598();
break;
case 3:
gUnknown_203B208->storedItem.quantity = gUnknown_203B208->unkA8;
UpdateKangaskhanStorageState(0x1B);
break;
case 2:
UpdateKangaskhanStorageState(0x17);
break;
case 0:
default:
break;
}
}
void sub_8017C7C(void)
{
s32 menuAction;
menuAction = 0;
sub_801A6E8(0);
if (sub_8012FD8(&gUnknown_203B208->unk58) == 0) {
sub_8013114(&gUnknown_203B208->unk58, &menuAction);
if(menuAction != 1) gUnknown_203B208->menuAction2 = menuAction;
}
switch(menuAction)
{
case 2:
sub_8099690(0);
if(!IsNotMoneyOrUsedTMItem(gUnknown_203B208->storedItem.id))
UpdateKangaskhanStorageState(KANGASKHAN_STORAGE_IS_MONEY_USED_TM);
else if(!sub_801ADA0(gUnknown_203B208->itemIndex))
UpdateKangaskhanStorageState(0xA);
else
UpdateKangaskhanStorageState(0x11);
break;
case 6:
sub_8099690(0);
UpdateKangaskhanStorageState(0x10);
break;
case 1:
UpdateKangaskhanStorageState(0xE);
break;
}
}
void sub_8017D24(void)
{
s32 menuAction;
menuAction = 0;
sub_801CA08(0);
if (sub_8012FD8(&gUnknown_203B208->unk58) == 0) {
sub_8013114(&gUnknown_203B208->unk58, &menuAction);
if(menuAction != 1) gUnknown_203B208->menuAction3 = menuAction;
}
switch(menuAction)
{
case 3:
if (GetNumberOfFilledInventorySlots() >= INVENTORY_SIZE)
{
sub_801CBB8();
UpdateKangaskhanStorageState(KANGASKHAN_STORAGE_TOO_MANY_ITEMS);
}
else if(IsThrowableItem(gUnknown_203B208->storedItem.id))
UpdateKangaskhanStorageState(0x18);
else
UpdateKangaskhanStorageState(0x1B);
break;
case 6:
UpdateKangaskhanStorageState(0x1A);
break;
case 1:
UpdateKangaskhanStorageState(0x17);
break;
}
}
void sub_8017DC0(void)
{
switch(sub_801B410())
{
case 0:
case 1:
default:
break;
case 2:
case 3:
sub_801B450();
UpdateKangaskhanStorageState(0xE);
break;
}
}
void sub_8017DDC(void)
{
switch(sub_801B410())
{
case 0:
case 1:
default:
break;
case 2:
case 3:
sub_801B450();
UpdateKangaskhanStorageState(0x17);
break;
}
}
void AdvanceToKangaskhanStorageFallbackState(void)
{
s32 temp;
if(sub_80144A4(&temp) == 0)
{
UpdateKangaskhanStorageState(gUnknown_203B208->fallbackState);
}
}
u32 sub_8017E1C(void)
{
ResetUnusedInputStruct();
sub_800641C(NULL, 1, 1);
gUnknown_203B20C = MemoryAlloc(sizeof(struct unkStruct_203B20C), 8);
gUnknown_203B20C->menuAction1 = 0;
gUnknown_203B20C->menuAction2 = 0;
gUnknown_203B20C->menuAction3 = 0;
sub_8017F10(0);
return 1;
}
u32 sub_8017E54(void)
{
switch(gUnknown_203B20C->state)
{
case 0:
sub_8017F10(1);
break;
case 1:
sub_8018588();
break;
case 4:
case 5:
sub_8018620();
break;
case 6:
sub_8018904();
break;
case 7:
sub_8018AC8();
break;
case 10:
case 11:
sub_80186F8();
break;
case 12:
sub_8018854();
break;
case 13:
sub_80189C8();
break;
case 14:
sub_8018AE4();
break;
case 3:
return 3;
}
return 0;
}
void sub_8017EF4(void)
{
if(gUnknown_203B20C != NULL)
{
MemoryFree(gUnknown_203B20C);
gUnknown_203B20C = NULL;
}
}
void sub_8017F10(u32 newState)
{
gUnknown_203B20C->state = newState;
sub_8017F28();
sub_8018100();
}
void sub_8017F28(void)
{
s32 index;
sub_8006518(gUnknown_203B20C->unkF0);
switch(gUnknown_203B20C->state)
{
case 1:
gUnknown_203B20C->unkF0[0] = gUnknown_80DB7B8;
gUnknown_203B20C->unkF0[1] = gUnknown_80DB7B8;
gUnknown_203B20C->unkF0[0] = gUnknown_80DB7B8;
sub_80182E4();
gUnknown_203B20C->unkF0[2] = gUnknown_80DB7D0;
sub_8012CAC(&gUnknown_203B20C->unkF0[2], gUnknown_203B20C->unk20);
break;
case 4:
case 5:
gUnknown_203B20C->unkF0[0] = gUnknown_80DB7B8;
gUnknown_203B20C->unkF0[1] = gUnknown_80DB7B8;
gUnknown_203B20C->unkF0[2] = gUnknown_80DB7B8;
gUnknown_203B20C->unkF0[0] = gUnknown_80DB7B8;
break;
case 10:
case 11:
gUnknown_203B20C->unkF0[0] = gUnknown_80DB7B8;
gUnknown_203B20C->unkF0[1] = gUnknown_80DB7B8;
gUnknown_203B20C->unkF0[2] = gUnknown_80DB7B8;
gUnknown_203B20C->unkF0[0] = gUnknown_80DB800;
break;
case 12:
gUnknown_203B20C->unkF0[1] = gUnknown_80DB818;
break;
case 6:
case 13:
gUnknown_203B20C->unkF0[2] = gUnknown_80DB7E8;
break;
default:
case 0:
for(index = 0; index < 4; index++)
{
gUnknown_203B20C->unkF0[index] = gUnknown_80DB7B8;
}
break;
}
ResetUnusedInputStruct();
sub_800641C(gUnknown_203B20C->unkF0, 1, 1);
}
void sub_8018100(void)
{
switch(gUnknown_203B20C->state)
{
case 1:
sub_8012D60(&gUnknown_203B20C->unk70, gUnknown_203B20C->unk20, 0, gUnknown_203B20C->unk60, gUnknown_203B20C->menuAction1, 2);
break;
case 4:
sub_801A5D8(3, 3, 0, 0xA);
break;
case 5:
sub_801A8D0(1);
break;
case 6:
sub_801A9E0();
sub_801841C();
sub_8012D60(&gUnknown_203B20C->unk70, gUnknown_203B20C->unk20, 0, gUnknown_203B20C->unk60, gUnknown_203B20C->menuAction2, 2);
break;
case 7:
sub_801B3C0(&gUnknown_203B20C->item);
break;
case 10:
sub_801C8C4(1, 3, 0, 0xA);
sub_801AD34(0);
break;
case 11:
sub_801CB5C(1);
sub_801AD34(0);
break;
case 12:
gUnknown_203B20C->unkD0 = 2;
gUnknown_203B20C->unkC8 = 1;
if(gTeamInventory_203B460->teamStorage[gUnknown_203B20C->item.id] > 99)
gUnknown_203B20C->unkCC = 99;
else
gUnknown_203B20C->unkCC = gTeamInventory_203B460->teamStorage[gUnknown_203B20C->item.id];
gUnknown_203B20C->unkC4 = gUnknown_203B20C->unkCC;
gUnknown_203B20C->unkD4 = 1;
gUnknown_203B20C->unkD8 = &gUnknown_203B20C->unkF0[1];
gUnknown_203B20C->unkDC = 0x28;
gUnknown_203B20C->unkE0 = 0x12;
sub_8013AA0(&gUnknown_203B20C->unkC0);
sub_8018280();
break;
case 13:
sub_801CCD8();
sub_801AD34(0);
sub_80184D4();
sub_8012D60(&gUnknown_203B20C->unk70, gUnknown_203B20C->unk20, 0, gUnknown_203B20C->unk60, gUnknown_203B20C->menuAction3, 2);
break;
case 14:
sub_801B3C0(&gUnknown_203B20C->item);
break;
case 0:
default:
break;
}
}
void sub_8018280(void)
{
sub_8008C54(gUnknown_203B20C->unkD4);
sub_80073B8(gUnknown_203B20C->unkD4);
xxx_call_draw_string(4, 0, gUnknown_80DB830, gUnknown_203B20C->unkD4, 0); // Number?
sub_8013C68(&gUnknown_203B20C->unkC0);
sub_80073E0(gUnknown_203B20C->unkD4);
sub_801CCD8();
sub_801AD34(0);
sub_8012EA4(&gUnknown_203B20C->unk70,0);
}

View File

@ -1,348 +0,0 @@
#include "global.h"
#include "item.h"
#include "kangaskhan_storage.h"
#include "team_inventory.h"
#include "menu_input.h"
extern struct unkStruct_203B20C *gUnknown_203B20C;
extern u32 sub_801B410();
extern void sub_801B450();
extern void sub_8017F10(u32);
extern u8 sub_801CF14(u32);
extern void sub_801CBB8(void);
extern void sub_8017F10(u32);
extern u8 sub_801ADA0(s32);
extern void sub_801A928(void);
extern void sub_8099690(u32);
extern u32 sub_801A6E8(u32);
extern u32 sub_8013BBC(u32 *);
extern u32 sub_801CA08(u32);
extern void sub_8018280(void);
extern void sub_801CF94(void);
extern u8 sub_801CB24();
extern u32 sub_801CFB8(void);
extern void sub_801AD34(u32);
extern u32 sub_801CFE0(u8);
extern u32 sub_801A8AC(void);
extern u32 sub_801AEA8(void);
extern u32 sub_801AED0(u32);
extern void sub_801AE84(void);
extern u8 sub_801CF50(u32);
void sub_8018588(void)
{
s32 menuAction;
menuAction = 0;
if(sub_8012FD8(&gUnknown_203B20C->unk70) == 0)
{
sub_8013114(&gUnknown_203B20C->unk70, &menuAction);
if(menuAction != 1) gUnknown_203B20C->menuAction1 = menuAction;
}
switch(menuAction)
{
case 2:
if((GetNumberOfFilledInventorySlots() != 0) && sub_801CF50(0) == 0)
sub_8017F10(4);
else
sub_8012EA4(&gUnknown_203B20C->unk70, 1);;
break;
case 3:
if(sub_801CF14(1) != 0)
sub_8012EA4(&gUnknown_203B20C->unk70, 1);
else
sub_8017F10(0xA);
break;
case 1:
sub_8017F10(3);
break;
}
}
void sub_8018620(void)
{
s32 index;
switch(sub_801A6E8(1))
{
case 3:
if(sub_801AEA8() != 0)
{
for(index = 0; index < INVENTORY_SIZE; index++)
{
if(sub_801AED0(index) != 0)
{
MoveToStorage(&gTeamInventory_203B460->teamItems[index]);
gTeamInventory_203B460->teamItems[index].id = 0;
gTeamInventory_203B460->teamItems[index].flags = 0;
}
}
FillInventoryGaps();
sub_801AE84();
if(GetNumberOfFilledInventorySlots() == 0)
{
sub_801A928();
sub_8017F10(1);
}
else
{
sub_8017F10(5);
}
}
else
{
gUnknown_203B20C->itemIndex = sub_801A8AC();
gUnknown_203B20C->item = gTeamInventory_203B460->teamItems[gUnknown_203B20C->itemIndex];
sub_8017F10(6);
}
break;
case 4:
gUnknown_203B20C->itemIndex = sub_801A8AC();
gUnknown_203B20C->item = gTeamInventory_203B460->teamItems[gUnknown_203B20C->itemIndex];
sub_8017F10(7);
break;
case 2:
sub_801A928();
sub_8017F10(1);
break;
}
}
void sub_80186F8(void)
{
struct BulkItem item;
s32 itemID;
switch(sub_801CA08(1))
{
case 3:
if(sub_801CFB8() != 0)
{
for(itemID = 0; itemID < NUMBER_OF_ITEM_IDS; itemID++)
{
if(sub_801CFE0(itemID) != 0)
{
item.id = itemID;
if(IsThrowableItem(item.id))
if(gTeamInventory_203B460->teamStorage[item.id] > 0x63)
{
item.quantity = 0x63;
}
else
{
item.quantity = gTeamInventory_203B460->teamStorage[item.id];
}
else
{
item.quantity = 1;
}
gTeamInventory_203B460->teamStorage[item.id] -= item.quantity;
AddHeldItemToInventory(&item);
}
}
FillInventoryGaps();
sub_801CF94();
if((sub_801CF14(1) == 0) && (GetNumberOfFilledInventorySlots() < INVENTORY_SIZE))
sub_8017F10(0xB);
else
{
sub_801CBB8();
sub_8017F10(1);
}
}
else
{
gUnknown_203B20C->id = sub_801CB24();
xxx_init_itemslot_8090A8C(&gUnknown_203B20C->item, gUnknown_203B20C->id, 0);
gUnknown_203B20C->item.quantity = 1;
sub_8017F10(0xD);
}
break;
case 4:
gUnknown_203B20C->id = sub_801CB24();
xxx_init_itemslot_8090A8C(&gUnknown_203B20C->item, gUnknown_203B20C->id, 0);
gUnknown_203B20C->item.quantity = 1;
sub_8017F10(0xE);
break;
case 2:
sub_801CBB8();
sub_8017F10(1);
break;
case 1:
sub_801AD34(0);
break;
}
}
void sub_8018854(void)
{
struct BulkItem item;
sub_801CA08(0);
sub_8012FD8(&gUnknown_203B20C->unk70);
switch(sub_8013BBC(&gUnknown_203B20C->unkC0))
{
case 3:
gUnknown_203B20C->item.quantity = gUnknown_203B20C->unkC0;
gTeamInventory_203B460->teamStorage[gUnknown_203B20C->item.id] -= gUnknown_203B20C->item.quantity;
item.id = gUnknown_203B20C->item.id;
item.quantity = gUnknown_203B20C->item.quantity;
AddHeldItemToInventory(&item);
if(sub_801CF14(1) == 0)
if(GetNumberOfFilledInventorySlots() >= INVENTORY_SIZE)
{
error:
sub_801CBB8();
sub_8017F10(0x1);
}
else
sub_8017F10(0xB);
else
goto error;
break;
case 2:
sub_8017F10(0xB);
break;
case 1:
sub_8018280();
break;
case 0:
break;
}
}
void sub_8018904(void)
{
s32 menuAction;
menuAction = 0;
sub_801A6E8(0);
if(sub_8012FD8(&gUnknown_203B20C->unk70) == 0)
{
sub_8013114(&gUnknown_203B20C->unk70, &menuAction);
if(menuAction != 1) gUnknown_203B20C->menuAction2 = menuAction;
}
switch(menuAction)
{
case 2:
if(IsNotMoneyOrUsedTMItem(gUnknown_203B20C->item.id))
if(sub_801ADA0(gUnknown_203B20C->itemIndex) == 0)
error:
sub_8012EA4(&gUnknown_203B20C->unk70, 1);
else
{
MoveToStorage(&gUnknown_203B20C->item);
ShiftItemsDownFrom(gUnknown_203B20C->itemIndex);
FillInventoryGaps();
if(GetNumberOfFilledInventorySlots() == 0)
{
sub_801A928();
sub_8017F10(1);
}
else
sub_8017F10(5);
}
else
goto error;
break;
case 4:
sub_8099690(0);
sub_8017F10(7);
break;
case 1:
sub_8017F10(5);
break;
}
}
void sub_80189C8(void)
{
struct BulkItem item;
s32 menuAction;
menuAction = 0;
sub_801CA08(0);
if(sub_8012FD8(&gUnknown_203B20C->unk70) == 0)
{
sub_8013114(&gUnknown_203B20C->unk70, &menuAction);
if(menuAction != 1) gUnknown_203B20C->menuAction3 = menuAction;
}
switch(menuAction)
{
case 3:
if(GetNumberOfFilledInventorySlots() >= INVENTORY_SIZE)
sub_8012EA4(&gUnknown_203B20C->unk70, 1);
else if(IsThrowableItem(gUnknown_203B20C->item.id))
sub_8017F10(0xC);
else
{
gTeamInventory_203B460->teamStorage[gUnknown_203B20C->item.id] -= gUnknown_203B20C->item.quantity;
item.id = gUnknown_203B20C->item.id;
item.quantity = gUnknown_203B20C->item.quantity;
AddHeldItemToInventory(&item);
if(sub_801CF14(1) == 0)
if(GetNumberOfFilledInventorySlots() >= INVENTORY_SIZE)
{
error:
sub_801CBB8();
sub_8017F10(1);
}
else
{
sub_8017F10(0xB);
}
else
goto error;
}
break;
case 4:
sub_8017F10(0xE);
break;
case 1:
sub_8017F10(0xB);
break;
}
}
void sub_8018AC8(void)
{
switch(sub_801B410())
{
case 2:
case 3:
sub_801B450();
sub_8017F10(0x5);
break;
case 0:
case 1:
default:
break;
}
}
void sub_8018AE4(void)
{
switch(sub_801B410())
{
case 2:
case 3:
sub_801B450();
sub_8017F10(0xB);
break;
case 0:
case 1:
default:
break;
}
}

View File

@ -111,21 +111,135 @@ extern void PlaySound(u16 songIndex);
u32 CountKecleonItems(void);
extern u8 *gUnknown_80D4984[];
extern u8 *gUnknown_80D4970[];
extern u8 * gUnknown_80D4978[];
extern u8 gUnknown_80DB8A0[];
extern u8 *gUnknown_80D4934[];
void sub_80194F8(void)
{
int index;
s32 loopMax;
MemoryFill16(gUnknown_203B210->unk74,0,sizeof(gUnknown_203B210->unk74));
loopMax = 0;
gUnknown_203B210->menuItems[loopMax].text = *gUnknown_80D4978;
gUnknown_203B210->menuItems[loopMax].menuAction = 2;
loopMax += 1;
gUnknown_203B210->menuItems[loopMax].text = *gUnknown_80D4984;
gUnknown_203B210->menuItems[loopMax].menuAction = 3;
loopMax += 1;
gUnknown_203B210->menuItems[loopMax].text = gUnknown_80DB8A0;
gUnknown_203B210->menuItems[loopMax].menuAction = 4;
loopMax += 1;
gUnknown_203B210->menuItems[loopMax].text = *gUnknown_80D4970;
gUnknown_203B210->menuItems[loopMax].menuAction = 7;
loopMax += 1;
gUnknown_203B210->menuItems[loopMax].text = *gUnknown_80D4934;
gUnknown_203B210->menuItems[loopMax].menuAction = 1;
loopMax += 1;
gUnknown_203B210->menuItems[loopMax].text = NULL;
gUnknown_203B210->menuItems[loopMax].menuAction = 1;
for(index = 0; index < loopMax; index++)
{
if(gUnknown_203B210->unk74[index] == 0)
{
if(gUnknown_203B210->menuItems[index].menuAction == gUnknown_203B210->menuAction1)
return;
}
}
for(index = 0; index < loopMax; index++)
{
if (gUnknown_203B210->unk74[index] == 0)
{
gUnknown_203B210->menuAction1 = gUnknown_203B210->menuItems[index].menuAction;
break;
}
}
}
void sub_80195C0(void)
{
int index;
s32 loopMax;
MemoryFill16(gUnknown_203B210->unk74,0,sizeof(gUnknown_203B210->unk74));
loopMax = 0;
gUnknown_203B210->menuItems[loopMax].text = *gUnknown_80D4978;
gUnknown_203B210->menuItems[loopMax].menuAction = 2;
loopMax += 1;
gUnknown_203B210->menuItems[loopMax].text = *gUnknown_80D4970;
gUnknown_203B210->menuItems[loopMax].menuAction = 7;
loopMax += 1;
gUnknown_203B210->menuItems[loopMax].text = NULL;
gUnknown_203B210->menuItems[loopMax].menuAction = 1;
for(index = 0; index < loopMax; index++)
{
if(gUnknown_203B210->unk74[index] == 0)
{
if(gUnknown_203B210->menuItems[index].menuAction == gUnknown_203B210->menuAction3)
return;
}
}
for(index = 0; index < loopMax; index++)
{
if (gUnknown_203B210->unk74[index] == 0)
{
gUnknown_203B210->menuAction3 = gUnknown_203B210->menuItems[index].menuAction;
break;
}
}
}
void sub_8019660(void)
{
int index;
s32 loopMax;
MemoryFill16(gUnknown_203B210->unk74,0, sizeof(gUnknown_203B210->unk74));
loopMax = 0;
gUnknown_203B210->menuItems[loopMax].text = *gUnknown_80D4984;
gUnknown_203B210->menuItems[loopMax].menuAction = 3;
loopMax += 1;
gUnknown_203B210->menuItems[loopMax].text = *gUnknown_80D4970;
gUnknown_203B210->menuItems[loopMax].menuAction = 7;
loopMax += 1;
gUnknown_203B210->menuItems[loopMax].text = NULL;
gUnknown_203B210->menuItems[loopMax].menuAction = 1;
for(index = 0; index < loopMax; index++)
{
if(gUnknown_203B210->unk74[index] == 0)
{
if(gUnknown_203B210->menuItems[index].menuAction == gUnknown_203B210->menuAction2)
return;
}
}
for(index = 0; index < loopMax; index++)
{
if (gUnknown_203B210->unk74[index] == 0)
{
gUnknown_203B210->menuAction2 = gUnknown_203B210->menuItems[index].menuAction;
break;
}
}
}
void sub_8019700(void)
{
u32 menuAction;
struct unkStruct_203B210 *preload;
u8 *nullText;
preload = gUnknown_203B210;
nullText = NULL;
preload->menuItems[0].text = *gUnknown_80D4920;
preload->menuItems[0].menuAction = 5;
menuAction = 1;
preload->menuItems[1].text = *gUnknown_80D4928;
preload->menuItems[1].menuAction = 6;
preload->menuItems[2].text = nullText;
preload->menuItems[2].menuAction = menuAction;
s32 loopMax = 0;
gUnknown_203B210->menuItems[loopMax].text = *gUnknown_80D4920;
gUnknown_203B210->menuItems[loopMax].menuAction = 5;
loopMax += 1;
gUnknown_203B210->menuItems[loopMax].text = *gUnknown_80D4928;
gUnknown_203B210->menuItems[loopMax].menuAction = 6;
loopMax += 1;
gUnknown_203B210->menuItems[loopMax].text = NULL;
gUnknown_203B210->menuItems[loopMax].menuAction = 1;
}
void sub_8019730(void)

View File

@ -464,47 +464,40 @@ void UpdateLuminousCaveDialogue(void)
void sub_8024CFC(void)
{
u8 *nullString;
struct unkStruct_203B2B0 *preload;
u32 defaultAction;
s32 loopMax = 0;
MemoryFill16(gUnknown_203B2B0->unk74, 0, sizeof(gUnknown_203B2B0->unk74));
preload = gUnknown_203B2B0;
nullString = NULL;
preload->unk34[0].text = gUnknown_80DCA18;
preload->unk34[0].menuAction = 3;
defaultAction = 1;
preload->unk34[1].text = *gUnknown_80D4970;
preload->unk34[1].menuAction = 2;
preload->unk34[2].text = *gUnknown_80D4934;
preload->unk34[2].menuAction = defaultAction;
preload->unk34[3].text = nullString;
preload->unk34[3].menuAction = defaultAction;
gUnknown_203B2B0->unk34[loopMax].text = gUnknown_80DCA18;
gUnknown_203B2B0->unk34[loopMax].menuAction = 3;
loopMax += 1;
gUnknown_203B2B0->unk34[loopMax].text = *gUnknown_80D4970;
gUnknown_203B2B0->unk34[loopMax].menuAction = 2;
loopMax += 1;
gUnknown_203B2B0->unk34[loopMax].text = *gUnknown_80D4934;
gUnknown_203B2B0->unk34[loopMax].menuAction = 1;
loopMax += 1;
gUnknown_203B2B0->unk34[loopMax].text = NULL;
gUnknown_203B2B0->unk34[loopMax].menuAction = 1;
}
void sub_8024D48(void)
{
u8 *nullString;
struct unkStruct_203B2B0 *preload;
u32 defaultAction;
s32 index;
s32 loopMax;
loopMax = 0;
MemoryFill16(gUnknown_203B2B0->unk74, 0, sizeof(gUnknown_203B2B0->unk74));
preload = gUnknown_203B2B0;
nullString = NULL;
preload->unk34[0].text = gUnknown_80DCA24;
preload->unk34[0].menuAction = 4;
defaultAction = 1;
preload->unk34[1].text = gUnknown_80DCA2C;
preload->unk34[1].menuAction = 5;
preload->unk34[2].text = *gUnknown_80D4934;
preload->unk34[2].menuAction = defaultAction;
loopMax = 3;
preload->unk34[3].text = nullString;
preload->unk34[3].menuAction = defaultAction;
gUnknown_203B2B0->unk34[loopMax].text = gUnknown_80DCA24;
gUnknown_203B2B0->unk34[loopMax].menuAction = 4;
loopMax += 1;
gUnknown_203B2B0->unk34[loopMax].text = gUnknown_80DCA2C;
gUnknown_203B2B0->unk34[loopMax].menuAction = 5;
loopMax += 1;
gUnknown_203B2B0->unk34[loopMax].text = *gUnknown_80D4934;
gUnknown_203B2B0->unk34[loopMax].menuAction = 1;
loopMax += 1;
gUnknown_203B2B0->unk34[loopMax].text = NULL;
gUnknown_203B2B0->unk34[loopMax].menuAction = 1;
for(index = 0; index < loopMax; index++)
{
@ -520,27 +513,22 @@ void sub_8024D48(void)
void sub_8024DBC(void)
{
u8 *nullString;
struct unkStruct_203B2B0 *preload;
u32 defaultAction;
s32 index;
s32 loopMax;
loopMax = 0;
MemoryFill16(gUnknown_203B2B0->unk74, 0, sizeof(gUnknown_203B2B0->unk74));
preload = gUnknown_203B2B0;
nullString = NULL;
preload->unk34[0].text = gUnknown_80DCA24;
preload->unk34[0].menuAction = 4;
defaultAction = 1;
preload->unk34[1].text = gUnknown_80DCA2C;
preload->unk34[1].menuAction = 5;
preload->unk34[2].text = *gUnknown_80D4934;
preload->unk34[2].menuAction = defaultAction;
loopMax = 3;
preload->unk34[3].text = nullString;
preload->unk34[3].menuAction = defaultAction;
gUnknown_203B2B0->unk34[loopMax].text = gUnknown_80DCA24;
gUnknown_203B2B0->unk34[loopMax].menuAction = 4;
loopMax += 1;
gUnknown_203B2B0->unk34[loopMax].text = gUnknown_80DCA2C;
gUnknown_203B2B0->unk34[loopMax].menuAction = 5;
loopMax += 1;
gUnknown_203B2B0->unk34[loopMax].text = *gUnknown_80D4934;
gUnknown_203B2B0->unk34[loopMax].menuAction = 1;
loopMax += 1;
gUnknown_203B2B0->unk34[loopMax].text = NULL;
gUnknown_203B2B0->unk34[loopMax].menuAction = 1;
for(index = 0; index < loopMax; index++)
{
@ -556,25 +544,19 @@ void sub_8024DBC(void)
void sub_8024E30(void)
{
u8 *nullString;
struct unkStruct_203B2B0 *preload;
u32 defaultAction;
s32 index;
s32 loopMax;
loopMax = 0;
MemoryFill16(gUnknown_203B2B0->unk74, 0, sizeof(gUnknown_203B2B0->unk74));
preload = gUnknown_203B2B0;
nullString = NULL;
preload->unk34[0].text = gUnknown_80DCA2C;
preload->unk34[0].menuAction = 5;
defaultAction = 1;
preload->unk34[1].text = *gUnknown_80D4970;
preload->unk34[1].menuAction = 2;
loopMax = 2;
preload->unk34[2].text = nullString;
preload->unk34[2].menuAction = defaultAction;
gUnknown_203B2B0->unk34[loopMax].text = gUnknown_80DCA2C;
gUnknown_203B2B0->unk34[loopMax].menuAction = 5;
loopMax += 1;
gUnknown_203B2B0->unk34[loopMax].text = *gUnknown_80D4970;
gUnknown_203B2B0->unk34[loopMax].menuAction = 2;
loopMax += 1;
gUnknown_203B2B0->unk34[loopMax].text = NULL;
gUnknown_203B2B0->unk34[loopMax].menuAction = 1;
for(index = 0; index < loopMax; index++)
{

View File

@ -95,25 +95,26 @@ extern void sub_8030480(void);
void DrawMakuhitaMainMenu(void) {
s32 menuAction;
struct unkStruct_203B318 *preload;
s32 loopMax;
gUnknown_203B318->menuAction = 2;
gUnknown_203B318->unk18[0].text = gMakuhitaDojoGoTrain;
gUnknown_203B318->unk18[0].menuAction = 2;
loopMax = 0;
gUnknown_203B318->unk18[loopMax].text = gMakuhitaDojoGoTrain;
gUnknown_203B318->unk18[loopMax].menuAction = 2;
if(sub_80306A4())
{
gUnknown_203B318->unk18[0].menuAction = -1;
gUnknown_203B318->unk18[loopMax].menuAction = -1;
gUnknown_203B318->menuAction = 1;
}
preload = gUnknown_203B318;
menuAction = 1;
preload->unk18[1].text = *gUnknown_80D4970;
preload->unk18[1].menuAction = 3;
preload->unk18[2].text = *gUnknown_80D4934;
preload->unk18[2].menuAction = menuAction;
preload->unk18[3].text = NULL;
preload->unk18[3].menuAction = menuAction;
loopMax += 1;
gUnknown_203B318->unk18[loopMax].text = *gUnknown_80D4970;
gUnknown_203B318->unk18[loopMax].menuAction = 3;
loopMax += 1;
gUnknown_203B318->unk18[loopMax].text = *gUnknown_80D4934;
gUnknown_203B318->unk18[loopMax].menuAction = 1;
loopMax += 1;
gUnknown_203B318->unk18[loopMax].text = NULL;
gUnknown_203B318->unk18[loopMax].menuAction = 1;
}
void sub_8030208(void) {

View File

@ -420,42 +420,37 @@ void sub_801DED0(void)
void CreateOthersMenu(void)
{
const char *blankText;
s32 defaultAction;
struct unkStruct_203B25C *preload;
s32 loopMax;
MemoryFill16(gUnknown_203B25C->unkAC,0,sizeof(gUnknown_203B25C->unkAC));
// This is dumb that I have to squeeze this in like this
preload = gUnknown_203B25C;
blankText = NULL;
preload->menuItems[0].text = gOthers_GameOptions;
preload->menuItems[0].menuAction = MENU_OPTION_GAMEOPTIONS;
defaultAction = MENU_OPTION_DEFAULT;
preload->menuItems[1].text = gOthers_Hints;
preload->menuItems[1].menuAction = MENU_OPTION_HINTS;
preload->menuItems[2].text = blankText;
preload->menuItems[2].menuAction = defaultAction;
loopMax = 0;
gUnknown_203B25C->menuItems[loopMax].text = gOthers_GameOptions;
gUnknown_203B25C->menuItems[loopMax].menuAction = MENU_OPTION_GAMEOPTIONS;
loopMax += 1;
gUnknown_203B25C->menuItems[loopMax].text = gOthers_Hints;
gUnknown_203B25C->menuItems[loopMax].menuAction = MENU_OPTION_HINTS;
loopMax += 1;
gUnknown_203B25C->menuItems[loopMax].text = NULL;
gUnknown_203B25C->menuItems[loopMax].menuAction = MENU_OPTION_DEFAULT;
}
void CreateChangeSettingsConfirmMenu(void)
{
const char *blankText;
s32 defaultAction;
struct unkStruct_203B25C *preload;
s32 loopMax;
MemoryFill16(gUnknown_203B25C->unkAC,0,sizeof(gUnknown_203B25C->unkAC));
loopMax = 0;
// This is dumb that I have to squeeze this in like this
preload = gUnknown_203B25C;
blankText = NULL;
preload->menuItems[0].text = *gUnknown_80D4920; // Yes
preload->menuItems[0].menuAction = MENU_OPTION_YES;
defaultAction = MENU_OPTION_DEFAULT;
preload->menuItems[1].text = *gUnknown_80D4928; // No
preload->menuItems[1].menuAction = MENU_OPTION_NO;
preload->menuItems[2].text = blankText;
preload->menuItems[2].menuAction = defaultAction;
gUnknown_203B25C->menuItems[loopMax].text = *gUnknown_80D4920; // Yes
gUnknown_203B25C->menuItems[loopMax].menuAction = MENU_OPTION_YES;
loopMax += 1;
gUnknown_203B25C->menuItems[loopMax].text = *gUnknown_80D4928; // No
gUnknown_203B25C->menuItems[loopMax].menuAction = MENU_OPTION_NO;
loopMax += 1;
gUnknown_203B25C->menuItems[loopMax].text = NULL;
gUnknown_203B25C->menuItems[loopMax].menuAction = MENU_OPTION_DEFAULT;
}
void HandleOthersMenu(void)

View File

@ -186,19 +186,17 @@ extern u8 *gUnknown_80D4928[];
void sub_802CBAC(void)
{
u8 *text;
s32 menuAction;
struct unkStruct_203B2F0 *preload;
s32 loopMax;
loopMax = 0;
preload = gUnknown_203B2F0;
text = NULL;
preload->unk14C[0].text = *gUnknown_80D4920;
preload->unk14C[0].menuAction = 5;
menuAction = 1;
preload->unk14C[1].text = *gUnknown_80D4928;
preload->unk14C[1].menuAction = 6;
preload->unk14C[2].text = text;
preload->unk14C[2].menuAction = menuAction;
gUnknown_203B2F0->unk14C[loopMax].text = *gUnknown_80D4920;
gUnknown_203B2F0->unk14C[loopMax].menuAction = 5;
loopMax += 1;
gUnknown_203B2F0->unk14C[loopMax].text = *gUnknown_80D4928;
gUnknown_203B2F0->unk14C[loopMax].menuAction = 6;
loopMax += 1;
gUnknown_203B2F0->unk14C[loopMax].text = NULL;
gUnknown_203B2F0->unk14C[loopMax].menuAction = 1;
}
void sub_802CC00(void)

View File

@ -381,19 +381,16 @@ void sub_802F088(void)
void sub_802F108(void)
{
struct unkStruct_203B30C *preload;
const u8 *blankText;
s32 action_1;
s32 loopMax = 0;
preload = gUnknown_203B30C;
blankText = NULL;
preload->unkB0[0].text = gUnknown_80E040C;
preload->unkB0[0].menuAction = 2;
action_1 = 1;
preload->unkB0[1].text = *gUnknown_80D4970;
preload->unkB0[1].menuAction = 3;
preload->unkB0[2].text = blankText;
preload->unkB0[2].menuAction = action_1;
gUnknown_203B30C->unkB0[loopMax].text = gUnknown_80E040C;
gUnknown_203B30C->unkB0[loopMax].menuAction = 2;
loopMax += 1;
gUnknown_203B30C->unkB0[loopMax].text = *gUnknown_80D4970;
gUnknown_203B30C->unkB0[loopMax].menuAction = 3;
loopMax += 1;
gUnknown_203B30C->unkB0[loopMax].text = NULL;
gUnknown_203B30C->unkB0[loopMax].menuAction = 1;
}
void sub_802F148(void)