mirror of https://github.com/zeldaret/tmc.git
decompile macroBook
This commit is contained in:
parent
07d709e3a7
commit
675b5e314c
|
|
@ -1,471 +0,0 @@
|
|||
.include "asm/macros.inc"
|
||||
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
|
||||
thumb_func_start MacroBook
|
||||
MacroBook: @ 0x0809A774
|
||||
push {lr}
|
||||
ldr r2, _0809A788 @ =gUnk_08123C80
|
||||
ldrb r1, [r0, #0xc]
|
||||
lsls r1, r1, #2
|
||||
adds r1, r1, r2
|
||||
ldr r1, [r1]
|
||||
bl _call_via_r1
|
||||
pop {pc}
|
||||
.align 2, 0
|
||||
_0809A788: .4byte gUnk_08123C80
|
||||
|
||||
thumb_func_start sub_0809A78C
|
||||
sub_0809A78C: @ 0x0809A78C
|
||||
push {r4, r5, lr}
|
||||
adds r4, r0, #0
|
||||
movs r3, #0
|
||||
movs r0, #1
|
||||
strb r0, [r4, #0xc]
|
||||
movs r2, #0x80
|
||||
strb r2, [r4, #0xe]
|
||||
strb r3, [r4, #0xf]
|
||||
ldrb r0, [r4, #0x19]
|
||||
movs r1, #3
|
||||
orrs r0, r1
|
||||
strb r0, [r4, #0x19]
|
||||
adds r5, r4, #0
|
||||
adds r5, #0x80
|
||||
strh r2, [r5]
|
||||
adds r0, r4, #0
|
||||
adds r0, #0x78
|
||||
strh r3, [r0]
|
||||
ldrh r0, [r4, #0x2e]
|
||||
subs r0, #4
|
||||
strh r0, [r4, #0x2e]
|
||||
adds r1, r4, #0
|
||||
adds r1, #0x63
|
||||
movs r0, #0xfc
|
||||
strb r0, [r1]
|
||||
adds r2, r4, #0
|
||||
adds r2, #0x29
|
||||
ldrb r0, [r2]
|
||||
movs r1, #7
|
||||
orrs r0, r1
|
||||
strb r0, [r2]
|
||||
ldrb r0, [r4, #0x19]
|
||||
movs r1, #0xc0
|
||||
orrs r0, r1
|
||||
strb r0, [r4, #0x19]
|
||||
ldrh r2, [r5]
|
||||
adds r0, r4, #0
|
||||
adds r1, r2, #0
|
||||
bl sub_0805EC9C
|
||||
adds r0, r4, #0
|
||||
bl UpdateSpriteForCollisionLayer
|
||||
ldrb r1, [r4, #0xf]
|
||||
adds r0, r4, #0
|
||||
bl InitAnimationForceUpdate
|
||||
adds r0, r4, #0
|
||||
bl sub_0809A958
|
||||
pop {r4, r5, pc}
|
||||
.align 2, 0
|
||||
|
||||
thumb_func_start sub_0809A7F4
|
||||
sub_0809A7F4: @ 0x0809A7F4
|
||||
push {r4, lr}
|
||||
adds r4, r0, #0
|
||||
bl UpdateAnimationSingleFrame
|
||||
adds r0, r4, #0
|
||||
bl sub_0809AA00
|
||||
ldrb r0, [r4, #0xe]
|
||||
adds r2, r0, #0
|
||||
cmp r2, #0
|
||||
beq _0809A810
|
||||
subs r0, #1
|
||||
strb r0, [r4, #0xe]
|
||||
b _0809A840
|
||||
_0809A810:
|
||||
adds r0, r4, #0
|
||||
adds r0, #0x5a
|
||||
ldrb r1, [r0]
|
||||
movs r0, #0x80
|
||||
ands r0, r1
|
||||
cmp r0, #0
|
||||
beq _0809A840
|
||||
ldrb r0, [r4, #0xf]
|
||||
cmp r0, #3
|
||||
bne _0809A838
|
||||
movs r0, #2
|
||||
strb r0, [r4, #0xc]
|
||||
movs r0, #0x5a
|
||||
strb r0, [r4, #0xe]
|
||||
strb r2, [r4, #0xf]
|
||||
adds r0, r4, #0
|
||||
movs r1, #2
|
||||
bl InitAnimationForceUpdate
|
||||
b _0809A840
|
||||
_0809A838:
|
||||
ldrb r1, [r4, #0xf]
|
||||
adds r0, r4, #0
|
||||
bl InitAnimationForceUpdate
|
||||
_0809A840:
|
||||
pop {r4, pc}
|
||||
.align 2, 0
|
||||
|
||||
thumb_func_start sub_0809A844
|
||||
sub_0809A844: @ 0x0809A844
|
||||
push {r4, lr}
|
||||
adds r4, r0, #0
|
||||
bl UpdateAnimationSingleFrame
|
||||
adds r0, r4, #0
|
||||
bl sub_0809AA00
|
||||
ldrb r0, [r4, #0xf]
|
||||
cmp r0, #1
|
||||
bhi _0809A85C
|
||||
movs r1, #0
|
||||
b _0809A870
|
||||
_0809A85C:
|
||||
ldrb r0, [r4, #0xe]
|
||||
adds r2, r0, #0
|
||||
cmp r2, #0
|
||||
beq _0809A87C
|
||||
subs r0, #1
|
||||
strb r0, [r4, #0xe]
|
||||
ldr r0, _0809A878 @ =gPlayerClones
|
||||
ldr r1, [r0]
|
||||
cmp r1, #0
|
||||
bne _0809A8A0
|
||||
_0809A870:
|
||||
movs r0, #1
|
||||
strb r0, [r4, #0xc]
|
||||
strb r1, [r4, #0xe]
|
||||
b _0809A8A0
|
||||
.align 2, 0
|
||||
_0809A878: .4byte gPlayerClones
|
||||
_0809A87C:
|
||||
adds r0, r4, #0
|
||||
adds r0, #0x5a
|
||||
ldrb r1, [r0]
|
||||
movs r0, #0x80
|
||||
ands r0, r1
|
||||
cmp r0, #0
|
||||
beq _0809A8A0
|
||||
movs r0, #3
|
||||
strb r0, [r4, #0xc]
|
||||
strb r2, [r4, #0xe]
|
||||
adds r0, r4, #0
|
||||
movs r1, #3
|
||||
bl InitAnimationForceUpdate
|
||||
adds r0, r4, #0
|
||||
movs r1, #0x78
|
||||
bl RequestPriorityDuration
|
||||
_0809A8A0:
|
||||
pop {r4, pc}
|
||||
.align 2, 0
|
||||
|
||||
thumb_func_start sub_0809A8A4
|
||||
sub_0809A8A4: @ 0x0809A8A4
|
||||
push {r4, lr}
|
||||
adds r4, r0, #0
|
||||
adds r2, r4, #0
|
||||
adds r2, #0x5a
|
||||
ldrb r1, [r2]
|
||||
movs r0, #0xe0
|
||||
ands r0, r1
|
||||
cmp r0, #0x40
|
||||
beq _0809A8D4
|
||||
cmp r0, #0x40
|
||||
bgt _0809A8C0
|
||||
cmp r0, #0x20
|
||||
beq _0809A8E2
|
||||
b _0809A8FC
|
||||
_0809A8C0:
|
||||
cmp r0, #0x80
|
||||
bne _0809A8FC
|
||||
adds r0, r4, #0
|
||||
adds r0, #0x59
|
||||
ldrb r0, [r0]
|
||||
cmp r0, #0
|
||||
bne _0809A902
|
||||
bl DeleteThisEntity
|
||||
b _0809A902
|
||||
_0809A8D4:
|
||||
movs r0, #0xbf
|
||||
ands r0, r1
|
||||
strb r0, [r2]
|
||||
adds r0, r4, #0
|
||||
bl sub_0809A9D4
|
||||
b _0809A902
|
||||
_0809A8E2:
|
||||
ldrb r0, [r4, #0xe]
|
||||
adds r0, #1
|
||||
strb r0, [r4, #0xe]
|
||||
ldrb r1, [r2]
|
||||
movs r0, #0xdf
|
||||
ands r0, r1
|
||||
strb r0, [r2]
|
||||
movs r0, #0xff
|
||||
bl SetPlayerControl
|
||||
movs r0, #0x2a
|
||||
bl SetGlobalFlag
|
||||
_0809A8FC:
|
||||
adds r0, r4, #0
|
||||
bl UpdateAnimationSingleFrame
|
||||
_0809A902:
|
||||
ldrb r0, [r4, #0xe]
|
||||
cmp r0, #0
|
||||
beq _0809A92A
|
||||
adds r1, r4, #0
|
||||
adds r1, #0x80
|
||||
ldrh r0, [r1]
|
||||
adds r0, #8
|
||||
strh r0, [r1]
|
||||
ldr r0, [r4, #0x2c]
|
||||
movs r2, #0x80
|
||||
lsls r2, r2, #3
|
||||
adds r0, r0, r2
|
||||
str r0, [r4, #0x2c]
|
||||
ldrh r2, [r1]
|
||||
adds r0, r4, #0
|
||||
adds r1, r2, #0
|
||||
movs r3, #0
|
||||
bl sub_0805EC9C
|
||||
b _0809A94E
|
||||
_0809A92A:
|
||||
ldr r1, [r4, #0x54]
|
||||
adds r0, r4, #0
|
||||
movs r2, #0
|
||||
bl sub_0809AA9C
|
||||
ldr r1, _0809A950 @ =gPlayerEntity
|
||||
adds r0, r4, #0
|
||||
movs r2, #1
|
||||
bl sub_0809AA9C
|
||||
ldr r0, _0809A954 @ =gPlayerClones
|
||||
ldr r1, [r0]
|
||||
cmp r1, #0
|
||||
beq _0809A94E
|
||||
adds r0, r4, #0
|
||||
movs r2, #1
|
||||
bl sub_0809AA9C
|
||||
_0809A94E:
|
||||
pop {r4, pc}
|
||||
.align 2, 0
|
||||
_0809A950: .4byte gPlayerEntity
|
||||
_0809A954: .4byte gPlayerClones
|
||||
|
||||
thumb_func_start sub_0809A958
|
||||
sub_0809A958: @ 0x0809A958
|
||||
push {r4, r5, r6, r7, lr}
|
||||
mov r7, sb
|
||||
mov r6, r8
|
||||
push {r6, r7}
|
||||
movs r1, #0x2e
|
||||
ldrsh r3, [r0, r1]
|
||||
ldr r2, _0809A9CC @ =gRoomControls
|
||||
ldrh r1, [r2, #6]
|
||||
subs r1, #4
|
||||
subs r3, r3, r1
|
||||
asrs r3, r3, #4
|
||||
movs r4, #0x3f
|
||||
ands r3, r4
|
||||
movs r5, #0x32
|
||||
ldrsh r1, [r0, r5]
|
||||
ldrh r2, [r2, #8]
|
||||
subs r1, r1, r2
|
||||
asrs r1, r1, #4
|
||||
ands r1, r4
|
||||
lsls r1, r1, #6
|
||||
orrs r3, r1
|
||||
adds r0, #0x82
|
||||
strh r3, [r0]
|
||||
ldrh r0, [r0]
|
||||
adds r5, r0, #0
|
||||
subs r5, #0x82
|
||||
ldr r6, _0809A9D0 @ =gUnk_08123C90
|
||||
movs r0, #0
|
||||
movs r1, #0x80
|
||||
lsls r1, r1, #7
|
||||
mov sb, r1
|
||||
_0809A996:
|
||||
movs r4, #0
|
||||
adds r0, #1
|
||||
mov r8, r0
|
||||
adds r7, r5, #0
|
||||
adds r7, #0x40
|
||||
_0809A9A0:
|
||||
ldrh r0, [r6]
|
||||
mov r1, sb
|
||||
ands r0, r1
|
||||
cmp r0, #0
|
||||
beq _0809A9B4
|
||||
ldrh r0, [r6]
|
||||
adds r1, r5, r4
|
||||
movs r2, #1
|
||||
bl SetTile
|
||||
_0809A9B4:
|
||||
adds r4, #1
|
||||
adds r6, #2
|
||||
cmp r4, #3
|
||||
ble _0809A9A0
|
||||
mov r0, r8
|
||||
adds r5, r7, #0
|
||||
cmp r0, #4
|
||||
ble _0809A996
|
||||
pop {r3, r4}
|
||||
mov r8, r3
|
||||
mov sb, r4
|
||||
pop {r4, r5, r6, r7, pc}
|
||||
.align 2, 0
|
||||
_0809A9CC: .4byte gRoomControls
|
||||
_0809A9D0: .4byte gUnk_08123C90
|
||||
|
||||
thumb_func_start sub_0809A9D4
|
||||
sub_0809A9D4: @ 0x0809A9D4
|
||||
push {r4, r5, r6, r7, lr}
|
||||
adds r0, #0x82
|
||||
ldrh r0, [r0]
|
||||
adds r5, r0, #0
|
||||
subs r5, #0x82
|
||||
movs r0, #0
|
||||
_0809A9E0:
|
||||
movs r4, #0
|
||||
adds r7, r0, #1
|
||||
adds r6, r5, #0
|
||||
adds r6, #0x40
|
||||
_0809A9E8:
|
||||
adds r0, r5, r4
|
||||
movs r1, #1
|
||||
bl sub_0807BA8C
|
||||
adds r4, #1
|
||||
cmp r4, #3
|
||||
ble _0809A9E8
|
||||
adds r0, r7, #0
|
||||
adds r5, r6, #0
|
||||
cmp r0, #4
|
||||
ble _0809A9E0
|
||||
pop {r4, r5, r6, r7, pc}
|
||||
|
||||
thumb_func_start sub_0809AA00
|
||||
sub_0809AA00: @ 0x0809AA00
|
||||
push {r4, r5, r6, r7, lr}
|
||||
mov r7, r8
|
||||
push {r7}
|
||||
adds r5, r0, #0
|
||||
movs r0, #0
|
||||
strb r0, [r5, #0xf]
|
||||
ldr r1, [r5, #0x54]
|
||||
cmp r1, #0
|
||||
bne _0809AA50
|
||||
movs r0, #7
|
||||
movs r1, #0x38
|
||||
movs r2, #7
|
||||
bl FindEntityByID
|
||||
adds r4, r0, #0
|
||||
adds r7, r5, #0
|
||||
adds r7, #0x78
|
||||
cmp r4, #0
|
||||
beq _0809AA5C
|
||||
movs r0, #0x80
|
||||
lsls r0, r0, #4
|
||||
mov r8, r0
|
||||
ldr r0, _0809AA4C @ =0x0000FFFF
|
||||
adds r6, r0, #0
|
||||
_0809AA30:
|
||||
ldrh r0, [r4, #0xa]
|
||||
ands r0, r6
|
||||
cmp r0, r8
|
||||
bne _0809AA3A
|
||||
str r4, [r5, #0x54]
|
||||
_0809AA3A:
|
||||
adds r0, r4, #0
|
||||
movs r1, #7
|
||||
bl FindNextDuplicateID
|
||||
adds r4, r0, #0
|
||||
cmp r4, #0
|
||||
bne _0809AA30
|
||||
b _0809AA5C
|
||||
.align 2, 0
|
||||
_0809AA4C: .4byte 0x0000FFFF
|
||||
_0809AA50:
|
||||
adds r0, r5, #0
|
||||
movs r2, #0
|
||||
bl sub_0809AA9C
|
||||
adds r7, r5, #0
|
||||
adds r7, #0x78
|
||||
_0809AA5C:
|
||||
ldr r4, _0809AA94 @ =gPlayerEntity
|
||||
adds r0, r5, #0
|
||||
adds r1, r4, #0
|
||||
movs r2, #0x20
|
||||
movs r3, #0x22
|
||||
bl EntityInRectRadius
|
||||
strh r0, [r7]
|
||||
lsls r0, r0, #0x10
|
||||
cmp r0, #0
|
||||
beq _0809AA8E
|
||||
adds r0, r5, #0
|
||||
adds r1, r4, #0
|
||||
movs r2, #1
|
||||
bl sub_0809AA9C
|
||||
ldr r0, _0809AA98 @ =gPlayerClones
|
||||
ldr r4, [r0]
|
||||
cmp r4, #0
|
||||
beq _0809AA8E
|
||||
adds r0, r5, #0
|
||||
adds r1, r4, #0
|
||||
movs r2, #1
|
||||
bl sub_0809AA9C
|
||||
_0809AA8E:
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4, r5, r6, r7, pc}
|
||||
.align 2, 0
|
||||
_0809AA94: .4byte gPlayerEntity
|
||||
_0809AA98: .4byte gPlayerClones
|
||||
|
||||
thumb_func_start sub_0809AA9C
|
||||
sub_0809AA9C: @ 0x0809AA9C
|
||||
push {r4, lr}
|
||||
adds r4, r0, #0
|
||||
adds r3, r1, #0
|
||||
adds r0, #0x5a
|
||||
ldrb r0, [r0]
|
||||
movs r1, #3
|
||||
ands r1, r0
|
||||
cmp r1, #1
|
||||
beq _0809AAB2
|
||||
cmp r1, #2
|
||||
bne _0809AABC
|
||||
_0809AAB2:
|
||||
adds r0, r3, #0
|
||||
adds r0, #0x63
|
||||
strb r1, [r0]
|
||||
adds r2, r0, #0
|
||||
b _0809AAC6
|
||||
_0809AABC:
|
||||
adds r1, r3, #0
|
||||
adds r1, #0x63
|
||||
movs r0, #0
|
||||
strb r0, [r1]
|
||||
adds r2, r1, #0
|
||||
_0809AAC6:
|
||||
movs r0, #0x2e
|
||||
ldrsh r1, [r3, r0]
|
||||
ldr r0, _0809AAE8 @ =gRoomControls
|
||||
ldrh r0, [r0, #6]
|
||||
movs r3, #0xad
|
||||
lsls r3, r3, #1
|
||||
adds r0, r0, r3
|
||||
cmp r1, r0
|
||||
bgt _0809AAE4
|
||||
ldrb r0, [r4, #0xf]
|
||||
adds r0, #1
|
||||
strb r0, [r4, #0xf]
|
||||
ldrb r0, [r2]
|
||||
adds r0, #1
|
||||
strb r0, [r2]
|
||||
_0809AAE4:
|
||||
pop {r4, pc}
|
||||
.align 2, 0
|
||||
_0809AAE8: .4byte gRoomControls
|
||||
|
|
@ -45066,11 +45066,6 @@
|
|||
"size": 41,
|
||||
"type": "animation"
|
||||
},
|
||||
{
|
||||
"path": "macroBook/gUnk_08123C90.bin",
|
||||
"start": 1195152,
|
||||
"size": 40
|
||||
},
|
||||
{
|
||||
"path": "object91/gUnk_08123DDC.bin",
|
||||
"start": 1195484,
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.section .rodata
|
||||
.align 2
|
||||
|
||||
gUnk_08123C80:: @ 08123C80
|
||||
.4byte sub_0809A78C
|
||||
.4byte sub_0809A7F4
|
||||
.4byte sub_0809A844
|
||||
.4byte sub_0809A8A4
|
||||
|
||||
gUnk_08123C90:: @ 08123C90
|
||||
.incbin "macroBook/gUnk_08123C90.bin"
|
||||
|
|
@ -780,7 +780,7 @@ SECTIONS {
|
|||
src/object/bigIceBlock.o(.text);
|
||||
src/object/object86.o(.text);
|
||||
src/object/octorokBossObject.o(.text);
|
||||
asm/object/macroBook.o(.text);
|
||||
src/object/macroBook.o(.text);
|
||||
asm/object/mazaalBossObject.o(.text);
|
||||
asm/object/cabinFurniture.o(.text);
|
||||
src/object/doubleBookshelf.o(.text);
|
||||
|
|
@ -1533,7 +1533,7 @@ SECTIONS {
|
|||
data/const/object/object86.o(.rodata);
|
||||
data/animations/object/object86.o(.rodata);
|
||||
src/object/octorokBossObject.o(.rodata);
|
||||
data/const/object/macroBook.o(.rodata);
|
||||
src/object/macroBook.o(.rodata);
|
||||
data/animations/object/macroBook.o(.rodata);
|
||||
data/const/object/mazaalBossObject.o(.rodata);
|
||||
data/const/object/cabinFurniture.o(.rodata);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,208 @@
|
|||
#define NENT_DEPRECATED
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
#include "flags.h"
|
||||
#include "asm.h"
|
||||
#include "npc.h"
|
||||
|
||||
typedef struct {
|
||||
Entity base;
|
||||
u8 filler[0x10];
|
||||
u16 playerWithinRect;
|
||||
u8 filler2[0x6];
|
||||
u16 unk80;
|
||||
u16 tilePos;
|
||||
} MacroBookEntity;
|
||||
|
||||
void MacroBook_Init(MacroBookEntity*);
|
||||
void MacroBook_Action1(MacroBookEntity*);
|
||||
void MacroBook_Action2(MacroBookEntity*);
|
||||
void MacroBook_Action3(MacroBookEntity*);
|
||||
void sub_0809A958(MacroBookEntity*);
|
||||
void sub_0809AA00(MacroBookEntity*);
|
||||
void sub_0809A9D4(MacroBookEntity*);
|
||||
void sub_0809AA9C(MacroBookEntity*, Entity*, u32);
|
||||
|
||||
void MacroBook(Entity* this) {
|
||||
static void (*const actionFuncs[])(MacroBookEntity*) = {
|
||||
MacroBook_Init,
|
||||
MacroBook_Action1,
|
||||
MacroBook_Action2,
|
||||
MacroBook_Action3,
|
||||
};
|
||||
actionFuncs[this->action]((MacroBookEntity*)this);
|
||||
}
|
||||
|
||||
void MacroBook_Init(MacroBookEntity* this) {
|
||||
super->action = 1;
|
||||
super->actionDelay = 0x80;
|
||||
super->field_0xf = 0;
|
||||
super->spriteRendering.b0 = 3;
|
||||
this->unk80 = 0x80;
|
||||
this->playerWithinRect = 0;
|
||||
super->x.HALF.HI -= 4;
|
||||
super->spriteOffsetY = -4;
|
||||
super->spritePriority.b0 = 7;
|
||||
super->spriteRendering.b3 = 3;
|
||||
sub_0805EC9C(super, this->unk80, this->unk80, 0);
|
||||
UpdateSpriteForCollisionLayer(super);
|
||||
InitAnimationForceUpdate(super, super->field_0xf);
|
||||
sub_0809A958(this);
|
||||
}
|
||||
|
||||
void MacroBook_Action1(MacroBookEntity* this) {
|
||||
UpdateAnimationSingleFrame(super);
|
||||
sub_0809AA00(this);
|
||||
if (super->actionDelay) {
|
||||
super->actionDelay--;
|
||||
} else {
|
||||
if ((super->frame & 0x80) != 0) {
|
||||
if (super->field_0xf == 3) {
|
||||
super->action = 2;
|
||||
super->actionDelay = 90;
|
||||
super->field_0xf = 0;
|
||||
InitAnimationForceUpdate(super, 2);
|
||||
} else {
|
||||
InitAnimationForceUpdate(super, super->field_0xf);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MacroBook_Action2(MacroBookEntity* this) {
|
||||
UpdateAnimationSingleFrame(super);
|
||||
sub_0809AA00(this);
|
||||
if (super->field_0xf < 2) {
|
||||
super->action = 1;
|
||||
super->actionDelay = 0;
|
||||
} else if (super->actionDelay) {
|
||||
super->actionDelay--;
|
||||
if (gPlayerClones[0] != 0) {
|
||||
return;
|
||||
}
|
||||
super->action = 1;
|
||||
super->actionDelay = 0;
|
||||
} else {
|
||||
if ((super->frame & 0x80) == 0) {
|
||||
return;
|
||||
}
|
||||
super->action = 3;
|
||||
super->actionDelay = 0;
|
||||
InitAnimationForceUpdate(super, 3);
|
||||
RequestPriorityDuration(super, 0x78);
|
||||
}
|
||||
}
|
||||
|
||||
void MacroBook_Action3(MacroBookEntity* this) {
|
||||
switch (super->frame & 0xe0) {
|
||||
case 0x80:
|
||||
if (super->frameDuration == 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
break;
|
||||
case 0x40:
|
||||
super->frame &= 0xbf;
|
||||
sub_0809A9D4(this);
|
||||
break;
|
||||
case 0x20:
|
||||
super->actionDelay++;
|
||||
super->frame &= 0xdf;
|
||||
SetPlayerControl(0xff);
|
||||
SetGlobalFlag(0x2a);
|
||||
default:
|
||||
UpdateAnimationSingleFrame(super);
|
||||
break;
|
||||
}
|
||||
|
||||
if (super->actionDelay) {
|
||||
this->unk80 += 8;
|
||||
super->x.WORD += 0x400;
|
||||
sub_0805EC9C(super, this->unk80, this->unk80, 0);
|
||||
} else {
|
||||
sub_0809AA9C(this, super->child, 0);
|
||||
sub_0809AA9C(this, &gPlayerEntity, 1);
|
||||
if (gPlayerClones[0] != NULL) {
|
||||
sub_0809AA9C(this, gPlayerClones[0], 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0809A958(MacroBookEntity* this) {
|
||||
|
||||
static const u16 tileIndices[] = {
|
||||
0x4074, 0x4074, 0x4074, 0x4074, 0x4074, 0x4074, 0x4074, 0x4074, 0x4074, 0x4074,
|
||||
0x4074, 0x4074, 0x4074, 0x4074, 0x4074, 0x4074, 0, 0, 0x4022, 0x4022,
|
||||
};
|
||||
int index;
|
||||
int index2;
|
||||
int tilePos;
|
||||
const u16* tileIndexPtr;
|
||||
|
||||
this->tilePos = COORD_TO_TILE_OFFSET(super, -4, 0);
|
||||
tilePos = this->tilePos - 0x82;
|
||||
tileIndexPtr = tileIndices;
|
||||
|
||||
for (index = 0; index < 5; index++, tilePos += 0x40) {
|
||||
for (index2 = 0; index2 < 4; index2++, tileIndexPtr++) {
|
||||
if ((*tileIndexPtr & 0x4000) != 0) {
|
||||
SetTile(*tileIndexPtr, tilePos + index2, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0809A9D4(MacroBookEntity* this) {
|
||||
int index;
|
||||
int index2;
|
||||
int tilePos;
|
||||
|
||||
tilePos = this->tilePos - 0x82;
|
||||
for (index = 0; index < 5; index++, tilePos += 0x40) {
|
||||
for (index2 = 0; index2 < 4; index2++) {
|
||||
sub_0807BA8C(tilePos + index2, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0809AA00(MacroBookEntity* this) {
|
||||
Entity* ent;
|
||||
|
||||
super->field_0xf = 0;
|
||||
if (super->child == NULL) {
|
||||
for (ent = FindEntityByID(NPC, TOWN_MINISH, 7); ent != NULL; ent = FindNextDuplicateID(ent, NPC)) {
|
||||
if (ent->type == 0 && ent->type2 == 8) {
|
||||
super->child = ent;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
sub_0809AA9C(this, super->child, 0);
|
||||
}
|
||||
ent = &gPlayerEntity;
|
||||
this->playerWithinRect = EntityInRectRadius(super, ent, 0x20, 0x22);
|
||||
if (this->playerWithinRect != 0) {
|
||||
sub_0809AA9C(this, ent, 1);
|
||||
|
||||
ent = gPlayerClones[0];
|
||||
if (ent != NULL) {
|
||||
sub_0809AA9C(this, ent, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0809AA9C(MacroBookEntity* this, Entity* ent, u32 arg3) {
|
||||
u32 bVar1;
|
||||
|
||||
bVar1 = super->frame & 3;
|
||||
if (bVar1 == 1) {
|
||||
ent->spriteOffsetY = bVar1;
|
||||
} else if (bVar1 == 2) {
|
||||
ent->spriteOffsetY = bVar1;
|
||||
} else {
|
||||
ent->spriteOffsetY = 0;
|
||||
}
|
||||
|
||||
if (ent->x.HALF.HI <= gRoomControls.origin_x + 0x15a) {
|
||||
super->field_0xf++;
|
||||
ent->spriteOffsetY++;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue