This commit is contained in:
theo3 2021-11-02 23:05:38 -07:00
parent 479920b5ba
commit 9ef31544e2
10 changed files with 26 additions and 37 deletions

View File

@ -575,7 +575,7 @@ sub_0801CC80: @ 0x0801CC80
adds r0, r0, r1
ldrb r4, [r0]
adds r0, r4, #0
bl sub_080544C8
bl ItemIsBottle
cmp r0, #0
beq _0801CCA8
adds r0, r5, r4

View File

@ -3279,7 +3279,7 @@ _08054014:
mov r8, r2
_08054018:
adds r0, r6, #0
bl sub_080544C8
bl ItemIsBottle
cmp r0, #0
bne _08054034
adds r0, r6, #0

View File

@ -2323,7 +2323,7 @@ sub_0807441C: @ 0x0807441C
adds r4, r6, #0
adds r4, #0xb4
ldrb r0, [r4]
bl sub_0805449C
bl ItemIsSword
cmp r0, #0
beq _08074448
ldrb r0, [r4]

View File

@ -29,13 +29,13 @@ sub_08078008: @ 0x08078008
adds r5, r6, #0
adds r5, #0xb4
ldrb r0, [r5]
bl sub_0805449C
bl ItemIsSword
cmp r0, #0
bne _0807802C
adds r5, r6, #0
adds r5, #0xb5
ldrb r0, [r5]
bl sub_0805449C
bl ItemIsSword
movs r2, #0
cmp r0, #0
beq _0807802E

View File

@ -3327,13 +3327,13 @@ sub_0807A158: @ 0x0807A158
adds r0, r4, #0
adds r0, #0xb4
ldrb r0, [r0]
bl sub_0805449C
bl ItemIsSword
cmp r0, #0
bne _0807A17C
adds r0, r4, #0
adds r0, #0xb5
ldrb r0, [r0]
bl sub_0805449C
bl ItemIsSword
b _0807A17E
.align 2, 0
_0807A178: .4byte gSave

View File

@ -92,7 +92,7 @@ _080769CC:
adds r4, r6, #0
adds r4, #0xb4
ldrb r0, [r4]
bl sub_0805449C
bl ItemIsSword
cmp r0, #0
beq _08076A38
ldrb r1, [r4]

View File

@ -15,12 +15,10 @@ void CreateMinishEntrance(u32 tilePos) {
}
void sub_08018C58(u32 tilePos) {
u32 i = 0;
u32 i;
for (; i < 6;) {
for (i = 0; i < 6; i += 2, tilePos += 0x40) {
SetTileType(0x260 + i, tilePos, 1);
SetTileType(0x261 + i, tilePos + 1, 1);
i += 2;
tilePos += 0x40;
}
}

View File

@ -4,22 +4,14 @@
#include "menu.h"
#include "area.h"
#include "utils.h"
typedef struct {
u8 filler[0xa8];
Stats stats;
} SaveFile;
#include "structures.h"
#include "save.h"
typedef struct {
u8 unk;
u8 filler[7];
} struct_080FD5B4;
typedef struct {
u8 filler[0x2e];
u8 unk;
} ScreenTransition;
extern SaveFile gSave;
extern struct_080FD5B4 gUnk_080FD5B4[];
extern ScreenTransition gScreenTransition;
@ -105,7 +97,7 @@ u32 SetBottleContents(u32 itemID, u32 bottleIndex) {
return bottleIndex;
}
u32 sub_0805449C(u32 arg0) {
u32 ItemIsSword(u32 arg0) {
switch (arg0) {
case 1:
case 2:
@ -118,8 +110,8 @@ u32 sub_0805449C(u32 arg0) {
}
}
u32 sub_080544B4(u32 arg0) {
switch (arg0) {
u32 ItemIsShield(u32 id) {
switch (id) {
case 13:
case 14:
return 1;
@ -128,8 +120,8 @@ u32 sub_080544B4(u32 arg0) {
}
}
u32 sub_080544C8(u32 arg0) {
switch (arg0) {
u32 ItemIsBottle(u32 id) {
switch (id) {
case 28:
case 29:
case 30:
@ -140,14 +132,14 @@ u32 sub_080544C8(u32 arg0) {
}
}
u32 GetBottleContaining(u32 arg0) {
if (arg0 == gSave.stats.bottles[0]) {
u32 GetBottleContaining(u32 id) {
if (id == gSave.stats.bottles[0]) {
return 1;
} else if (arg0 == gSave.stats.bottles[1]) {
} else if (id == gSave.stats.bottles[1]) {
return 2;
} else if (arg0 == gSave.stats.bottles[2]) {
} else if (id == gSave.stats.bottles[2]) {
return 3;
} else if (arg0 == gSave.stats.bottles[3]) {
} else if (id == gSave.stats.bottles[3]) {
return 4;
} else {
return 0;
@ -160,7 +152,7 @@ NONMATCH("asm/non_matching/sub_08054524.inc", void sub_08054524(void)) {
bVar1 = gArea.locationIndex;
if (gArea.locationIndex == 0) {
bVar1 = gScreenTransition.unk;
bVar1 = gScreenTransition.field_0x24[0xa];
}
if (bVar1 > 0x16) {
bVar1 = 0;

View File

@ -6,7 +6,7 @@
#include "createObject.h"
#include "functions.h"
extern bool32 sub_080544B4(u32);
extern bool32 ItemIsShield(u32);
void sub_0802810C(Entity*);
void sub_080281A0(Entity*);
@ -241,11 +241,11 @@ void sub_080281A0(Entity* this) {
bool32 sub_080281E0(u32 param_1) {
bool32 ret = FALSE;
if (GetInventoryValue(param_1) == 1) {
if (sub_080544B4(gSave.stats.itemOnA)) {
if (ItemIsShield(gSave.stats.itemOnA)) {
gSave.stats.itemOnA = 0;
}
if (sub_080544B4(gSave.stats.itemOnB)) {
if (ItemIsShield(gSave.stats.itemOnB)) {
gSave.stats.itemOnB = 0;
}

View File

@ -17,7 +17,6 @@ void ItemPegasusBoots(ItemBehavior* this, u32 arg1) {
gPlayerState.field_0x1d[1] = 0;
gPlayerState.field_0xe = 0;
sub_08077E78(this, arg1);
} else {
bVar1 = this->field_0x5[2] - 1;
this->field_0x5[2] = bVar1;