lightableSwitch OK

This commit is contained in:
theo3 2020-07-06 13:56:19 -07:00
parent a4a932deb6
commit c5897e647c
38 changed files with 197 additions and 373 deletions

View File

@ -163,7 +163,7 @@ _080302BA:
ldrb r0, [r4, #0xb]
cmp r0, #0
beq _080302C6
bl sub_0804B128
bl GetCurrentRoomProperty
str r0, [r4, #0x7c]
_080302C6:
adds r0, r4, #0

View File

@ -41,7 +41,7 @@ sub_080333D4: @ 0x080333D4
ldrb r0, [r4, #0xa]
cmp r0, #0
beq _0803340E
bl sub_0804B128
bl GetCurrentRoomProperty
str r0, [r4, #0x54]
adds r1, r4, #0
adds r1, #0x54

View File

@ -291,7 +291,7 @@ sub_08084074: @ 0x08084074
push {r4, lr}
adds r4, r0, #0
movs r0, #3
bl sub_0804B128
bl GetCurrentRoomProperty
adds r1, r0, #0
cmp r1, #0
beq _080840A4

View File

@ -3472,7 +3472,7 @@ _0801AE70:
bl sub_0805BB74
_0801AE8C:
movs r0, #5
bl sub_0804B128
bl GetCurrentRoomProperty
cmp r0, #0
beq _0801AE9A
bl _call_via_r0

View File

@ -169,7 +169,7 @@ sub_0804AFDC: @ 0x0804AFDC
push {r4, lr}
movs r4, #1
movs r0, #6
bl sub_0804B128
bl GetCurrentRoomProperty
cmp r0, #0
beq _0804AFF0
bl _call_via_r0

View File

@ -120,8 +120,8 @@ _0804B120:
.align 2, 0
_0804B124: .4byte gUnk_080D50FC
thumb_func_start sub_0804B128
sub_0804B128: @ 0x0804B128
thumb_func_start GetCurrentRoomProperty
GetCurrentRoomProperty: @ 0x0804B128
push {lr}
adds r2, r0, #0
ldr r0, _0804B138 @ =gUnk_02017654

View File

@ -5029,7 +5029,7 @@ sub_080A7CFC: @ 0x080A7CFC
lsls r4, r4, #3
movs r6, #0
movs r0, #3
bl sub_0804B128
bl GetCurrentRoomProperty
adds r1, r0, #0
cmp r1, #0
beq _080A7D38

View File

@ -440,7 +440,7 @@ sub_08040E3C: @ 0x08040E3C
bne _08040E86
strb r5, [r4, #0xc]
ldrb r0, [r4, #0xe]
bl sub_0804B128
bl GetCurrentRoomProperty
str r0, [r4, #0x54]
b _08040E8C
_08040E86:

View File

@ -44,7 +44,7 @@ sub_080860D8: @ 0x080860D8
orrs r0, r1
strb r0, [r2]
ldrb r0, [r4, #0xb]
bl sub_0804B128
bl GetCurrentRoomProperty
str r0, [r4, #0x54]
adds r1, r4, #0
adds r1, #0x54

View File

@ -43,7 +43,7 @@ _080866FE:
adds r0, r6, #0
adds r0, #0x6c
ldrb r0, [r0]
bl sub_0804B128
bl GetCurrentRoomProperty
adds r5, r0, #0
movs r0, #0
mov r8, r0

View File

@ -460,7 +460,7 @@ sub_080925A4: @ 0x080925A4
push {r4, r5, r6, r7, lr}
adds r6, r0, #0
ldrb r0, [r6, #0xb]
bl sub_0804B128
bl GetCurrentRoomProperty
adds r5, r0, #0
ldrb r0, [r5, #9]
cmp r0, #0xff

View File

@ -1,321 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.syntax unified
.text
thumb_func_start LightableSwitch
LightableSwitch: @ 0x0809E9FC
push {r4, lr}
adds r4, r0, #0
ldr r1, _0809EA18 @ =gUnk_081243B4
ldrb r0, [r4, #0xa]
lsls r0, r0, #2
adds r0, r0, r1
ldr r1, [r0]
adds r0, r4, #0
bl _call_via_r1
adds r0, r4, #0
bl sub_0809EB30
pop {r4, pc}
.align 2, 0
_0809EA18: .4byte gUnk_081243B4
thumb_func_start sub_0809EA1C
sub_0809EA1C: @ 0x0809EA1C
push {lr}
ldr r2, _0809EA30 @ =gUnk_081243BC
ldrb r1, [r0, #0xc]
lsls r1, r1, #2
adds r1, r1, r2
ldr r1, [r1]
bl _call_via_r1
pop {pc}
.align 2, 0
_0809EA30: .4byte gUnk_081243BC
thumb_func_start sub_0809EA34
sub_0809EA34: @ 0x0809EA34
push {r4, lr}
adds r4, r0, #0
movs r2, #0
movs r0, #1
strb r0, [r4, #0xc]
ldrb r1, [r4, #0x10]
movs r0, #0x80
orrs r0, r1
strb r0, [r4, #0x10]
strb r2, [r4, #0x1e]
adds r1, r4, #0
adds r1, #0x3c
movs r0, #7
strb r0, [r1]
adds r1, #4
movs r0, #0x48
strb r0, [r1]
subs r1, #1
movs r0, #0x28
strb r0, [r1]
subs r1, #4
movs r0, #0xa
strb r0, [r1]
ldr r0, _0809EA7C @ =gUnk_080FD150
str r0, [r4, #0x48]
adds r0, r4, #0
bl sub_0809EAD8
adds r0, r4, #0
bl UpdateSpriteOrderAndFlip
adds r0, r4, #0
bl sub_0809EABC
pop {r4, pc}
.align 2, 0
_0809EA7C: .4byte gUnk_080FD150
thumb_func_start sub_0809EA80
sub_0809EA80: @ 0x0809EA80
push {r4, r5, lr}
adds r5, r0, #0
adds r0, #0x41
ldrb r1, [r0]
movs r0, #0x80
ands r0, r1
cmp r0, #0
beq _0809EAB4
adds r4, r5, #0
adds r4, #0x86
ldrh r0, [r4]
bl CheckFlags
cmp r0, #0
beq _0809EAA6
ldrh r0, [r4]
bl ClearFlag
b _0809EAAC
_0809EAA6:
ldrh r0, [r4]
bl SetFlag
_0809EAAC:
movs r0, #0x88
lsls r0, r0, #1
bl sub_08004488
_0809EAB4:
adds r0, r5, #0
bl sub_0809EABC
pop {r4, r5, pc}
thumb_func_start sub_0809EABC
sub_0809EABC: @ 0x0809EABC
push {r4, lr}
adds r4, r0, #0
adds r0, #0x86
ldrh r0, [r0]
bl CheckFlags
rsbs r1, r0, #0
orrs r1, r0
lsrs r1, r1, #0x1f
ldrb r0, [r4, #0x1e]
cmp r0, r1
beq _0809EAD6
strb r1, [r4, #0x1e]
_0809EAD6:
pop {r4, pc}
thumb_func_start sub_0809EAD8
sub_0809EAD8: @ 0x0809EAD8
push {r4, r5, r6, lr}
adds r5, r0, #0
ldrb r0, [r5, #0xb]
cmp r0, #0
beq _0809EAF8
bl sub_0804B128
str r0, [r5, #0x54]
adds r1, r5, #0
adds r1, #0x54
adds r2, r5, #0
adds r2, #0x74
adds r0, r5, #0
bl sub_080A2CC0
b _0809EB24
_0809EAF8:
ldr r0, _0809EB28 @ =0x00004050
movs r2, #0x2e
ldrsh r1, [r5, r2]
ldr r3, _0809EB2C @ =gRoomControls
ldrh r2, [r3, #6]
subs r1, r1, r2
asrs r1, r1, #4
movs r4, #0x3f
ands r1, r4
movs r6, #0x32
ldrsh r2, [r5, r6]
ldrh r3, [r3, #8]
subs r2, r2, r3
asrs r2, r2, #4
ands r2, r4
lsls r2, r2, #6
orrs r1, r2
adds r2, r5, #0
adds r2, #0x38
ldrb r2, [r2]
bl SetTile
_0809EB24:
pop {r4, r5, r6, pc}
.align 2, 0
_0809EB28: .4byte 0x00004050
_0809EB2C: .4byte gRoomControls
thumb_func_start sub_0809EB30
sub_0809EB30: @ 0x0809EB30
push {r4, lr}
adds r4, r0, #0
ldrb r0, [r4, #0xb]
cmp r0, #0
beq _0809EB64
ldrb r1, [r4, #0x15]
movs r0, #0x80
ands r0, r1
cmp r0, #0
bne _0809EB4A
adds r0, r4, #0
bl sub_0806F69C
_0809EB4A:
adds r2, r4, #0
adds r2, #0x74
ldrh r0, [r2]
subs r0, #1
strh r0, [r2]
lsls r0, r0, #0x10
cmp r0, #0
bne _0809EB64
adds r1, r4, #0
adds r1, #0x54
adds r0, r4, #0
bl sub_080A2CC0
_0809EB64:
pop {r4, pc}
.align 2, 0
thumb_func_start sub_0809EB68
sub_0809EB68: @ 0x0809EB68
push {lr}
ldr r2, _0809EB7C @ =gUnk_081243C4
ldrb r1, [r0, #0xc]
lsls r1, r1, #2
adds r1, r1, r2
ldr r1, [r1]
bl _call_via_r1
pop {pc}
.align 2, 0
_0809EB7C: .4byte gUnk_081243C4
thumb_func_start sub_0809EB80
sub_0809EB80: @ 0x0809EB80
push {r4, r5, lr}
adds r4, r0, #0
movs r0, #1
strb r0, [r4, #0xc]
ldrb r1, [r4, #0x10]
movs r0, #0x80
orrs r0, r1
strb r0, [r4, #0x10]
movs r5, #3
strb r5, [r4, #0x1e]
adds r1, r4, #0
adds r1, #0x3c
movs r0, #7
strb r0, [r1]
adds r1, #4
movs r0, #0x48
strb r0, [r1]
subs r1, #1
movs r0, #0x28
strb r0, [r1]
subs r1, #4
movs r0, #0xa
strb r0, [r1]
ldr r0, _0809EBD4 @ =gUnk_080FD150
str r0, [r4, #0x48]
adds r0, r4, #0
bl sub_0809EAD8
adds r0, r4, #0
bl UpdateSpriteOrderAndFlip
adds r0, r4, #0
adds r0, #0x84
ldrh r0, [r0]
bl CheckFlags
cmp r0, #0
beq _0809EBD2
strb r5, [r4, #0xc]
movs r0, #2
strb r0, [r4, #0x1e]
_0809EBD2:
pop {r4, r5, pc}
.align 2, 0
_0809EBD4: .4byte gUnk_080FD150
thumb_func_start sub_0809EBD8
sub_0809EBD8: @ 0x0809EBD8
push {lr}
adds r2, r0, #0
adds r0, #0x41
ldrb r1, [r0]
movs r0, #0x80
ands r0, r1
cmp r0, #0
beq _0809EC04
movs r1, #2
strb r1, [r2, #0xc]
movs r0, #0x10
strb r0, [r2, #0xe]
strb r1, [r2, #0x1e]
adds r0, r2, #0
adds r0, #0x86
ldrh r0, [r0]
bl SetFlag
movs r0, #0x88
lsls r0, r0, #1
bl sub_08004488
_0809EC04:
pop {pc}
.align 2, 0
thumb_func_start sub_0809EC08
sub_0809EC08: @ 0x0809EC08
push {r4, lr}
adds r4, r0, #0
adds r0, #0x84
ldrh r0, [r0]
bl CheckFlags
cmp r0, #0
beq _0809EC1E
movs r0, #3
strb r0, [r4, #0xc]
b _0809EC44
_0809EC1E:
ldrb r0, [r4, #0xe]
subs r0, #1
strb r0, [r4, #0xe]
lsls r0, r0, #0x18
cmp r0, #0
bne _0809EC44
movs r0, #1
strb r0, [r4, #0xc]
movs r0, #3
strb r0, [r4, #0x1e]
adds r0, r4, #0
adds r0, #0x86
ldrh r0, [r0]
bl ClearFlag
movs r0, #0x88
lsls r0, r0, #1
bl sub_08004488
_0809EC44:
pop {r4, pc}
.align 2, 0
thumb_func_start nullsub_126
nullsub_126: @ 0x0809EC48
bx lr
.align 2, 0

View File

@ -38,7 +38,7 @@ LilypadSmall: @ 0x08097A5C
orrs r0, r1
strb r0, [r2]
ldrb r0, [r5, #0xb]
bl sub_0804B128
bl GetCurrentRoomProperty
str r0, [r5, #0x54]
adds r1, r5, #0
adds r1, #0x54

View File

@ -145,7 +145,7 @@ sub_08057174: @ 0x08057174
push {r4, r5, r6, r7, lr}
adds r4, r0, #0
ldrb r0, [r4, #0xa]
bl sub_0804B128
bl GetCurrentRoomProperty
adds r3, r0, #0
ldrb r0, [r3]
cmp r0, #0xff

View File

@ -15,7 +15,7 @@ sub_0805AB4C: @ 0x0805AB4C
push {r5, r6, r7}
adds r6, r0, #0
ldrb r0, [r6, #0xa]
bl sub_0804B128
bl GetCurrentRoomProperty
adds r4, r0, #0
cmp r4, #0
bne _0805AB68
@ -245,7 +245,7 @@ _0805AD06:
cmp r0, r5
ble _0805AD2C
ldrb r0, [r4, #0xa]
bl sub_0804B128
bl GetCurrentRoomProperty
adds r3, r0, #0
cmp r3, #0
bne _0805ACD0

View File

@ -20,7 +20,7 @@ sub_0805B820: @ 0x0805B820
str r1, [r5, #0x20]
_0805B834:
ldrb r0, [r5, #0xa]
bl sub_0804B128
bl GetCurrentRoomProperty
adds r4, r0, #0
movs r7, #0
ldrh r0, [r4]

View File

@ -25,7 +25,7 @@ sub_0805C6D0: @ 0x0805C6D0
sub sp, #4
adds r5, r0, #0
ldrb r0, [r5, #0xa]
bl sub_0804B128
bl GetCurrentRoomProperty
adds r4, r0, #0
cmp r4, #0
bne _0805C6EA

View File

@ -180,7 +180,7 @@ sub_0805CA6C: @ 0x0805CA6C
adds r6, r0, #0
movs r5, #0
ldrb r0, [r6, #0xb]
bl sub_0804B128
bl GetCurrentRoomProperty
adds r4, r0, #0
cmp r4, #0
bne _0805CACE

View File

@ -17,7 +17,7 @@ sub_0805CFC0: @ 0x0805CFC0
strb r0, [r1, #0xc]
_0805CFCE:
movs r0, #3
bl sub_0804B128
bl GetCurrentRoomProperty
adds r4, r0, #0
cmp r4, #0
beq _0805CFEE

View File

@ -38,7 +38,7 @@ _0805D046:
cmp r0, #0x43
bhi _0805D0B0
ldrb r0, [r6, #0xa]
bl sub_0804B128
bl GetCurrentRoomProperty
adds r5, r0, #0
movs r7, #0
movs r0, #0x36

View File

@ -28,7 +28,7 @@ sub_0805E0C0: @ 0x0805E0C0
strb r1, [r5, #0xc]
strb r0, [r5, #0xe]
ldrb r0, [r5, #0xa]
bl sub_0804B128
bl GetCurrentRoomProperty
adds r4, r0, #0
cmp r4, #0
bne _0805E0EC

View File

@ -16,7 +16,7 @@ sub_08057CB4: @ 0x08057CB4
movs r0, #1
strb r0, [r4, #0xc]
ldrb r0, [r4, #0xa]
bl sub_0804B128
bl GetCurrentRoomProperty
str r0, [r4, #0x20]
cmp r0, #0
bne _08057CD6
@ -72,7 +72,7 @@ _08057D18:
cmp r0, #0
bne _08057D3A
ldrb r0, [r4, #6]
bl sub_0804B128
bl GetCurrentRoomProperty
bl DoExitTransition
_08057D3A:
adds r4, #8

View File

@ -152,7 +152,7 @@ sub_080586EC: @ 0x080586EC
bl DeleteThisEntity
_0805870A:
ldrb r0, [r7, #0xb]
bl sub_0804B128
bl GetCurrentRoomProperty
adds r4, r0, #0
cmp r4, #0
beq _0805875C

View File

@ -78,7 +78,7 @@ sub_08058E34: @ 0x08058E34
ldrb r0, [r4, #0xa]
cmp r0, #0
beq _08058E58
bl sub_0804B128
bl GetCurrentRoomProperty
bl LoadRoomEntityList
_08058E58:
adds r0, r4, #0

View File

@ -48,7 +48,7 @@ _08058E9E:
bl PlaySFX
_08058EB4:
ldrb r0, [r4, #0xa]
bl sub_0804B128
bl GetCurrentRoomProperty
bl LoadRoomEntityList
bl DeleteThisEntity
b _08058EC8

View File

@ -52,7 +52,7 @@ _08090F1C:
cmp r0, #0
beq _08090F62
ldrb r0, [r4, #0xe]
bl sub_0804B128
bl GetCurrentRoomProperty
bl DoExitTransition
_08090F62:
pop {r4, r5, r6, pc}

View File

@ -349,14 +349,14 @@ sub_0809AD68: @ 0x0809AD68
push {r4, lr}
adds r4, r0, #0
ldrb r0, [r4, #0xa]
bl sub_0804B128
bl GetCurrentRoomProperty
bl LoadRoomEntityList
movs r0, #0x17
bl GetInventoryValue
cmp r0, #0
beq _0809AD8A
ldrb r0, [r4, #0xb]
bl sub_0804B128
bl GetCurrentRoomProperty
bl LoadRoomEntityList
_0809AD8A:
pop {r4, pc}

View File

@ -73,7 +73,7 @@ _0809E3A6:
ldrb r0, [r4, #0xa]
cmp r0, #0
beq _0809E3D8
bl sub_0804B128
bl GetCurrentRoomProperty
str r0, [r4, #0x54]
adds r1, r4, #0
adds r1, #0x54

View File

@ -44,7 +44,7 @@ sub_08060428: @ 0x08060428
ldrb r0, [r4, #0xb]
cmp r0, #0
beq _08060444
bl sub_0804B128
bl GetCurrentRoomProperty
adds r1, r0, #0
b _08060446
_08060444:

View File

@ -617,7 +617,7 @@ sub_0809963C: @ 0x0809963C
ldrb r0, [r5, #0xb]
cmp r0, #0
beq _08099684
bl sub_0804B128
bl GetCurrentRoomProperty
adds r4, r0, #0
ldrh r0, [r4]
bl CheckFlags

View File

@ -123,7 +123,7 @@ sub_0802F55C: @ 0x0802F55C
adds r0, #0x80
strb r2, [r0]
ldrb r0, [r4, #0xe]
bl sub_0804B128
bl GetCurrentRoomProperty
str r0, [r4, #0x54]
adds r0, r4, #0
bl sub_0802FA48

View File

@ -6,7 +6,7 @@
#include "entity.h"
#include "position.h"
// Identified
// Identified - to be sorted into header files
extern u32 Random(void);
extern void PlaySFX(u32);
extern void UpdateSpriteOrderAndFlip(Entity*);
@ -29,6 +29,8 @@ extern u32* StartCutscene(Entity*, u8*);
extern void GetNextFrame(Entity*);
extern u32 LoadExtraSpriteData(Entity*, u32*);
extern void ResolveEntityOnTop(Entity*, Entity*);
extern void SetExtraSpriteFrame(Entity*, u32, u32);
extern void SetSpriteSubEntryOffsetData1(Entity*, u32, u32);
// Unidentified
extern void sub_0806ED78(Entity*);
@ -60,8 +62,6 @@ extern void sub_0807DD94(Entity*, u32);
extern Entity* sub_0805EB00(u32, u32, u32);
extern Entity* sub_0805EB2C(u32, u32, u32, u32, u32);
extern s32 sub_0806ED9C(Entity*, u32, u32);
extern void SetExtraSpriteFrame(Entity*, u32, u32);
extern void SetSpriteSubEntryOffsetData1(Entity*, u32, u32);
extern void sub_0807000C(Entity*);
extern void sub_0805E47C(Entity*);
extern void sub_0805E584(Entity*);

View File

@ -810,7 +810,7 @@ SECTIONS {
asm/macroAcorn.o(.text);
asm/object9B.o(.text);
asm/treeHidingPortal.o(.text);
asm/lightableSwitch.o(.text);
src/lightableSwitch.o(.text);
asm/object9E.o(.text);
asm/fan.o(.text);
asm/objectA0.o(.text);

View File

@ -4,7 +4,7 @@
extern void sub_080A2CC0();
extern void sub_0806F69C();
extern void sub_08004488();
extern Entity* sub_0804B128();
extern Entity* GetCurrentRoomProperty();
void BladeTrap(Entity* ent) {
u16 uVar1;
@ -12,7 +12,7 @@ void BladeTrap(Entity* ent) {
u16* puVar3;
if (ent->action == 0) {
ent->action = 1;
pEVar2 = sub_0804B128((u8)(ent->entityType).form);
pEVar2 = GetCurrentRoomProperty((u8)(ent->entityType).form);
ent->attachedEntity = pEVar2;
sub_080A2CC0((EntityData*)ent, &ent->attachedEntity, &ent->field_0x74);
}

View File

@ -19,7 +19,7 @@ extern bool32 sub_0806F520(Entity *);
extern void sub_0800449C(Entity *, u32);
extern void sub_0803CE14(Entity *);
extern void sub_0803CE3C(Entity *);
extern Entity *sub_0804B128(u8);
extern Entity *GetCurrentRoomProperty(u8);
extern void sub_0806F4E8(Entity *);
extern void sub_0806F69C(Entity *);
extern void sub_08079D84(void);
@ -78,7 +78,7 @@ void sub_0803CD6C(Entity *this) {
this->height.HALF.HI = -2;
// Set parent to lakitu
lakitu = sub_0804B128(this->entityType.form);
lakitu = GetCurrentRoomProperty(this->entityType.form);
this->attachedEntity = lakitu;
this->parent = lakitu;

145
src/lightableSwitch.c Normal file
View File

@ -0,0 +1,145 @@
#include "global.h"
#include "entity.h"
#include "room.h"
#include "flags.h"
#include "functions.h"
extern void sub_0809EB30(Entity*);
extern void sub_0809EAD8(Entity*);
extern void sub_0809EABC(Entity*);
extern void sub_08004488(u32);
extern void sub_080A2CC0(Entity*, Entity**, u16*);
extern Entity* GetCurrentRoomProperty(u32);
extern void SetTile(u32, u32, u32);
extern void sub_0806F69C(Entity*);
extern void (*const gUnk_081243B4[])(Entity*);
extern void (*const gUnk_081243BC[])(Entity*);
extern void (*const gUnk_081243C4[])(Entity*);
extern BoundingBox gUnk_080FD150;
void LightableSwitch(Entity* this) {
gUnk_081243B4[this->entityType.form](this);
sub_0809EB30(this);
}
void sub_0809EA1C(Entity* this) {
gUnk_081243BC[this->action](this);
}
void sub_0809EA34(Entity* this) {
this->action = 1;
this->flags = this->flags | 0x80;
this->frameIndex = 0;
this->field_0x3c = 7;
this->field_0x40 = 0x48;
this->damageType = 0x28;
this->flags2 = 10;
this->boundingBox = &gUnk_080FD150;
sub_0809EAD8(this);
UpdateSpriteOrderAndFlip(this);
sub_0809EABC(this);
}
void sub_0809EA80(Entity* this) {
if ((this->bitfield & 0x80) != 0) {
if (CheckFlags(this->field_0x86) != 0) {
ClearFlag(this->field_0x86);
} else {
SetFlag(this->field_0x86);
}
sub_08004488(0x110);
}
sub_0809EABC(this);
}
void sub_0809EABC(Entity* this) {
bool32 anySet;
u32 f;
f = CheckFlags(this->field_0x86);
anySet = (-f | f) >> 0x1F;
if (this->frameIndex != anySet) {
this->frameIndex = anySet;
}
}
void sub_0809EAD8(Entity* this) {
u8 bVar1;
Entity* pEVar2;
if (this->entityType.parameter != 0) {
this->attachedEntity = GetCurrentRoomProperty(this->entityType.parameter);
sub_080A2CC0(this, &this->attachedEntity, &this->field_0x74);
} else {
SetTile(0x4050, COORD_TO_TILE(this), this->collisionLayer);
}
}
void sub_0809EB30(Entity* this) {
u16 uVar1;
u16* puVar2;
if (this->entityType.parameter != 0) {
if ((this->direction & 0x80) == 0) {
sub_0806F69C(this);
}
puVar2 = &this->field_0x74;
if (!--*puVar2) {
sub_080A2CC0(this, &this->attachedEntity, puVar2);
}
}
}
void sub_0809EB68(Entity* this) {
gUnk_081243C4[this->action](this);
}
void sub_0809EB80(Entity* this) {
this->action = 1;
this->flags = this->flags | 0x80;
this->frameIndex = 3;
this->field_0x3c = 7;
this->field_0x40 = 0x48;
this->damageType = 0x28;
this->flags2 = 10;
this->boundingBox = &gUnk_080FD150;
sub_0809EAD8(this);
UpdateSpriteOrderAndFlip(this);
if (CheckFlags(this->cutsceneBeh.HWORD) != 0) {
this->action = 3;
this->frameIndex = 2;
}
}
void sub_0809EBD8(Entity* this) {
if ((this->bitfield & 0x80) != 0) {
this->action = 2;
this->actionDelay = 0x10;
this->frameIndex = 2;
SetFlag(this->field_0x86);
sub_08004488(0x110);
}
}
void sub_0809EC08(Entity* this) {
if (CheckFlags(this->cutsceneBeh.HWORD) != 0) {
this->action = 3;
} else {
if (--this->actionDelay == 0) {
this->action = 1;
this->frameIndex = 3;
ClearFlag(this->field_0x86);
sub_08004488(0x110);
}
}
}
void nullsub_126(Entity* this) { }

View File

@ -3,7 +3,7 @@
void LoadRoomEntityList();
s32 CheckGlobalFlag(u32 flag);
extern s32* sub_0804B128(u8 unk);
extern s32* GetCurrentRoomProperty(u8 unk);
extern void sub_0804B058(s32* unk);
extern void sub_0804B1AC();
extern void sub_0801AC98();
@ -15,13 +15,13 @@ void LoadRoom(void)
s32 iVar1;
s32* dat;
sub_0804B128(1);
GetCurrentRoomProperty(1);
LoadRoomEntityList();
sub_0804B128(0);
GetCurrentRoomProperty(0);
LoadRoomEntityList();
if (CheckGlobalFlag(21)) sub_0804B058(sub_0804B128(2));
sub_0804B128(3);
if (CheckGlobalFlag(21)) sub_0804B058(GetCurrentRoomProperty(2));
GetCurrentRoomProperty(3);
sub_0804B1AC();
sub_0801AC98();
}

View File

@ -1,7 +1,7 @@
#include "global.h"
extern void sub_080186EC();
extern u32* sub_0804B128(u8);
extern u32* GetCurrentRoomProperty(u8);
extern u32 _call_via_r0(u32*);
extern void sub_0804B16C();
@ -9,11 +9,11 @@ void sub_0804AFF4(void) {
u32* func;
sub_080186EC();
func = sub_0804B128(5);
func = GetCurrentRoomProperty(5);
if (func != NULL) {
_call_via_r0(func);
}
func = sub_0804B128(7);
func = GetCurrentRoomProperty(7);
if (func != NULL) {
_call_via_r0(func);
}
@ -27,13 +27,13 @@ sub_0804AFF4: @ 0x0804AFF4
push {lr}
bl sub_080186EC
movs r0, #5
bl sub_0804B128
bl GetCurrentRoomProperty
cmp r0, #0
beq _0804B008
bl _call_via_r0
_0804B008:
movs r0, #7
bl sub_0804B128
bl GetCurrentRoomProperty
cmp r0, #0
beq _0804B016
bl _call_via_r0