mirror of https://github.com/zeldaret/tmc.git
mineralWaterSource.c OK
Also modified entity.h to include BoundingBox
This commit is contained in:
parent
94d3564e5f
commit
933417209a
|
@ -1,72 +0,0 @@
|
||||||
.include "asm/macros.inc"
|
|
||||||
|
|
||||||
.include "constants/constants.inc"
|
|
||||||
|
|
||||||
.syntax unified
|
|
||||||
|
|
||||||
.text
|
|
||||||
|
|
||||||
|
|
||||||
thumb_func_start MineralWaterSource
|
|
||||||
MineralWaterSource: @ 0x08097370
|
|
||||||
push {lr}
|
|
||||||
ldr r2, _08097384 @ =gUnk_08123298
|
|
||||||
ldrb r1, [r0, #0xc]
|
|
||||||
lsls r1, r1, #2
|
|
||||||
adds r1, r1, r2
|
|
||||||
ldr r1, [r1]
|
|
||||||
bl _call_via_r1
|
|
||||||
pop {pc}
|
|
||||||
.align 2, 0
|
|
||||||
_08097384: .4byte gUnk_08123298
|
|
||||||
|
|
||||||
thumb_func_start sub_08097388
|
|
||||||
sub_08097388: @ 0x08097388
|
|
||||||
push {r4, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
bl sub_0806FBD8
|
|
||||||
cmp r0, #0
|
|
||||||
beq _080973D4
|
|
||||||
ldrb r0, [r4, #0xa]
|
|
||||||
lsls r0, r0, #2
|
|
||||||
ldr r1, _080973D8 @ =gUnk_081232A0
|
|
||||||
adds r0, r0, r1
|
|
||||||
ldrb r1, [r0]
|
|
||||||
strb r1, [r4, #0xb]
|
|
||||||
ldrb r2, [r0, #3]
|
|
||||||
adds r1, r4, #0
|
|
||||||
adds r1, #0x40
|
|
||||||
strb r2, [r1]
|
|
||||||
ldr r2, [r4, #0x48]
|
|
||||||
ldrb r1, [r0, #1]
|
|
||||||
strb r1, [r2, #6]
|
|
||||||
ldr r1, [r4, #0x48]
|
|
||||||
ldrb r0, [r0, #2]
|
|
||||||
strb r0, [r1, #7]
|
|
||||||
ldrb r1, [r4, #0x10]
|
|
||||||
movs r0, #0x80
|
|
||||||
orrs r0, r1
|
|
||||||
strb r0, [r4, #0x10]
|
|
||||||
adds r1, r4, #0
|
|
||||||
adds r1, #0x3c
|
|
||||||
movs r0, #7
|
|
||||||
strb r0, [r1]
|
|
||||||
adds r1, #3
|
|
||||||
movs r0, #0x91
|
|
||||||
strb r0, [r1]
|
|
||||||
subs r1, #4
|
|
||||||
movs r0, #2
|
|
||||||
strb r0, [r1]
|
|
||||||
movs r0, #1
|
|
||||||
strb r0, [r4, #0xc]
|
|
||||||
_080973D4:
|
|
||||||
pop {r4, pc}
|
|
||||||
.align 2, 0
|
|
||||||
_080973D8: .4byte gUnk_081232A0
|
|
||||||
|
|
||||||
thumb_func_start sub_080973DC
|
|
||||||
sub_080973DC: @ 0x080973DC
|
|
||||||
adds r0, #0x41
|
|
||||||
movs r1, #0
|
|
||||||
strb r1, [r0]
|
|
||||||
bx lr
|
|
|
@ -1828,10 +1828,10 @@ gUnk_08123274:: @ 08123274
|
||||||
gUnk_0812327C:: @ 0812327C
|
gUnk_0812327C:: @ 0812327C
|
||||||
.incbin "baserom.gba", 0x12327C, 0x000001C
|
.incbin "baserom.gba", 0x12327C, 0x000001C
|
||||||
|
|
||||||
gUnk_08123298:: @ 08123298
|
MineralWaterSourceActionFuncs:: @ 08123298
|
||||||
.incbin "baserom.gba", 0x123298, 0x0000008
|
.incbin "baserom.gba", 0x123298, 0x0000008
|
||||||
|
|
||||||
gUnk_081232A0:: @ 081232A0
|
MineralWaterSourceParameters:: @ 081232A0
|
||||||
.incbin "baserom.gba", 0x1232A0, 0x0000004
|
.incbin "baserom.gba", 0x1232A0, 0x0000004
|
||||||
|
|
||||||
gUnk_081232A4:: @ 081232A4
|
gUnk_081232A4:: @ 081232A4
|
||||||
|
|
|
@ -17,6 +17,13 @@ typedef struct {
|
||||||
u8 parameter;
|
u8 parameter;
|
||||||
} EntityType;
|
} EntityType;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
u8 unknown[6];
|
||||||
|
u8 field_0x6;
|
||||||
|
u8 field_0x7;
|
||||||
|
u8 unknown2[4];
|
||||||
|
} BoundingBox;
|
||||||
|
|
||||||
union SplitWord {
|
union SplitWord {
|
||||||
s32 WORD;
|
s32 WORD;
|
||||||
struct {
|
struct {
|
||||||
|
@ -103,7 +110,7 @@ typedef struct Entity {
|
||||||
u8 field_0x44;
|
u8 field_0x44;
|
||||||
u8 currentHealth;
|
u8 currentHealth;
|
||||||
s16 field_0x46;
|
s16 field_0x46;
|
||||||
u32* boundingBox;
|
BoundingBox* boundingBox;
|
||||||
u8 field_0x4c;
|
u8 field_0x4c;
|
||||||
u8 field_0x4d;
|
u8 field_0x4d;
|
||||||
u8 field_0x4e;
|
u8 field_0x4e;
|
||||||
|
|
|
@ -704,7 +704,7 @@ SECTIONS {
|
||||||
asm/crenalBeanSprout.o(.text);
|
asm/crenalBeanSprout.o(.text);
|
||||||
asm/minecartDoor.o(.text);
|
asm/minecartDoor.o(.text);
|
||||||
asm/objectOnPillar.o(.text);
|
asm/objectOnPillar.o(.text);
|
||||||
asm/mineralWaterSource.o(.text);
|
src/mineralWaterSource.o(.text);
|
||||||
asm/minishSizedArchway.o(.text);
|
asm/minishSizedArchway.o(.text);
|
||||||
asm/object70.o(.text);
|
asm/object70.o(.text);
|
||||||
asm/pushableGrave.o(.text);
|
asm/pushableGrave.o(.text);
|
||||||
|
|
|
@ -7,7 +7,7 @@ extern void sub_0808E714(Entity*);
|
||||||
|
|
||||||
extern void (*const gUnk_08121C48[])(Entity*);
|
extern void (*const gUnk_08121C48[])(Entity*);
|
||||||
|
|
||||||
extern u32 gUnk_08121C58;
|
extern BoundingBox gUnk_08121C58;
|
||||||
|
|
||||||
void HeartContainer(Entity* this) {
|
void HeartContainer(Entity* this) {
|
||||||
gUnk_08121C48[this->action](this);
|
gUnk_08121C48[this->action](this);
|
||||||
|
|
|
@ -0,0 +1,47 @@
|
||||||
|
#include "global.h"
|
||||||
|
#include "entity.h"
|
||||||
|
|
||||||
|
extern void (*MineralWaterSourceActionFuncs[])(Entity *);
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
u8 field_0x00;
|
||||||
|
u8 field_0x01;
|
||||||
|
u8 field_0x02;
|
||||||
|
u8 field_0x03;
|
||||||
|
} UnkStruct_MineralWater;
|
||||||
|
|
||||||
|
extern UnkStruct_MineralWater MineralWaterSourceParameters[];
|
||||||
|
|
||||||
|
extern bool32 sub_0806FBD8(Entity *);
|
||||||
|
|
||||||
|
void MineralWaterSource(Entity *this) {
|
||||||
|
MineralWaterSourceActionFuncs[this->action](this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MineralWaterSource_Init(Entity *this) {
|
||||||
|
UnkStruct_MineralWater *unknownParameters;
|
||||||
|
|
||||||
|
if (!sub_0806FBD8(this)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
unknownParameters = &MineralWaterSourceParameters[this->entityType.form];
|
||||||
|
|
||||||
|
this->entityType.parameter = unknownParameters->field_0x00;
|
||||||
|
this->field_0x40 = unknownParameters->field_0x03;
|
||||||
|
|
||||||
|
this->boundingBox->field_0x6 = unknownParameters->field_0x01;
|
||||||
|
this->boundingBox->field_0x7 = unknownParameters->field_0x02;
|
||||||
|
|
||||||
|
this->flags |= 0x80;
|
||||||
|
|
||||||
|
this->field_0x3c = 7;
|
||||||
|
this->damageType = 145;
|
||||||
|
this->flags2 = 2;
|
||||||
|
|
||||||
|
this->action = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_080973DC(Entity *this) {
|
||||||
|
this->bitfield = 0;
|
||||||
|
}
|
|
@ -11,7 +11,7 @@ extern u32 Random(void);
|
||||||
|
|
||||||
extern void (*gUnk_081206C4[99])(Entity*);
|
extern void (*gUnk_081206C4[99])(Entity*);
|
||||||
|
|
||||||
extern u32 gUnk_080FD1A8;
|
extern BoundingBox gUnk_080FD1A8;
|
||||||
|
|
||||||
// Main
|
// Main
|
||||||
void Object1A(Entity* ent) {
|
void Object1A(Entity* ent) {
|
||||||
|
|
Loading…
Reference in New Issue