Match sub_8013DD0

This commit is contained in:
Kermalis
2023-09-13 04:10:45 -04:00
parent 7e2926f75c
commit 2b74ea0c1a
4 changed files with 49 additions and 74 deletions

View File

@@ -5,77 +5,6 @@
.text
thumb_func_start sub_8013DD0
sub_8013DD0:
push {r4,r5,lr}
adds r4, r0, 0
bl sub_8012AE8
cmp r0, 0x7
beq _08013DE4
cmp r0, 0x8
beq _08013E10
movs r0, 0
b _08013E4C
_08013DE4:
ldr r2, [r4]
ldr r0, [r4, 0xC]
cmp r2, r0
beq _08013E18
ldr r1, _08013E0C
adds r0, r4, 0
adds r0, 0x24
ldrb r0, [r0]
lsls r0, 2
adds r0, r1
ldr r0, [r0]
adds r5, r2, r0
movs r0, 0x3
bl PlayMenuSoundEffect
ldr r0, [r4, 0xC]
cmp r5, r0
bgt _08013E3E
b _08013E48
.align 2, 0
_08013E0C: .4byte gUnknown_80D4830
_08013E10:
ldr r2, [r4]
ldr r0, [r4, 0x8]
cmp r2, r0
bne _08013E22
_08013E18:
movs r0, 0x2
bl PlayMenuSoundEffect
movs r0, 0
b _08013E4C
_08013E22:
ldr r1, _08013E44
adds r0, r4, 0
adds r0, 0x24
ldrb r0, [r0]
lsls r0, 2
adds r0, r1
ldr r0, [r0]
subs r5, r2, r0
movs r0, 0x3
bl PlayMenuSoundEffect
ldr r0, [r4, 0x8]
cmp r5, r0
bge _08013E48
_08013E3E:
str r0, [r4]
b _08013E4A
.align 2, 0
_08013E44: .4byte gUnknown_80D4830
_08013E48:
str r5, [r4]
_08013E4A:
movs r0, 0x1
_08013E4C:
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end sub_8013DD0
thumb_func_start sub_8013E54
sub_8013E54:
push {r4-r6,lr}

View File

@@ -44,8 +44,15 @@ gUnknown_80D4828: @ 80D4828
.global gUnknown_80D4830
gUnknown_80D4830: @ 80D4830
.byte 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xe8, 0x03, 0x00, 0x00, 0x10, 0x27, 0x00, 0x00, 0xa0, 0x86, 0x01, 0x00, 0x40, 0x42, 0x0f, 0x00, 0x80, 0x96, 0x98, 0x00
.byte 0x00, 0xe1, 0xf5, 0x05
.4byte 1
.4byte 10
.4byte 100
.4byte 1000
.4byte 10000
.4byte 100000
.4byte 1000000
.4byte 10000000
.4byte 100000000
@ END code_80130A8 #1

View File

@@ -6,7 +6,6 @@
#include "text.h"
// code_80130A8.s
extern bool8 sub_8013DD0(unkStructFor8013AA0 *);
extern void sub_8013F84(void);
extern void sub_80140B4(UnkTextStruct2 *);
extern void sub_80140DC(void);

View File

@@ -14,6 +14,7 @@
// data_80D47B8.s
extern const u8 gUnknown_80D4828[];
extern const s32 gUnknown_80D4830[9];
// text.s
extern s32 sub_8008ED0(const u8 *);
@@ -22,6 +23,7 @@ extern s16 sub_8009614(u32, u32);
static void sub_8013134(MenuInputStruct *, u32, u32);
static void sub_801332C(s16 *);
static void sub_8013470(MenuInputStruct *);
static bool8 sub_8013DD0(unkStructFor8013AA0 *);
ALIGNED(4) static const char fill_save7[] = _("pksdir0");
const u32 gDefaultMenuTextColors[3] = { COLOR_WHITE_2, COLOR_RED, COLOR_RED };
@@ -1349,4 +1351,42 @@ void sub_8013D10(unkStructFor8013AA0 *a0)
a0->unk28.unk6 &= ~SPRITEOAM_MASK_UNK6_4;
a0->unk28.unk6 |= temp;
} while (0);
}
static bool8 sub_8013DD0(unkStructFor8013AA0 *a0)
{
s32 iVar2;
switch (sub_8012AE8()) {
case 7:
if (a0->unk0 == a0->unkC) {
PlayMenuSoundEffect(2);
return FALSE;
}
iVar2 = a0->unk0 + gUnknown_80D4830[a0->unk24];
PlayMenuSoundEffect(3);
if (iVar2 > a0->unkC)
a0->unk0 = a0->unkC;
else
a0->unk0 = iVar2;
return TRUE;
case 8:
if (a0->unk0 == a0->unk8) {
PlayMenuSoundEffect(2);
return FALSE;
}
iVar2 = a0->unk0 - gUnknown_80D4830[a0->unk24];
PlayMenuSoundEffect(3);
if (iVar2 < a0->unk8)
a0->unk0 = a0->unk8;
else
a0->unk0 = iVar2;
return TRUE;
default:
return FALSE;
}
}