diff options
| author | theo3 <arisstephenson2@gmail.com> | 2020-07-13 15:27:20 -0700 |
|---|---|---|
| committer | theo3 <arisstephenson2@gmail.com> | 2020-07-13 15:27:20 -0700 |
| commit | 62ddaaa5f6fe2dc2aaa2dd002d4ce0b1d61a3cc9 (patch) | |
| tree | d625ad1b183fc6aa5b56c00ce6573ef850679731 /src/manager | |
| parent | c47f16e5e7b0abb010133b3ee1a58099d8b8915d (diff) | |
add subdirs
Diffstat (limited to 'src/manager')
| -rw-r--r-- | src/manager/manager1.c | 64 | ||||
| -rw-r--r-- | src/manager/manager2.c | 18 | ||||
| -rw-r--r-- | src/manager/manager27.c | 90 | ||||
| -rw-r--r-- | src/manager/manager2E.c | 15 |
4 files changed, 187 insertions, 0 deletions
diff --git a/src/manager/manager1.c b/src/manager/manager1.c new file mode 100644 index 00000000..ba556db0 --- /dev/null +++ b/src/manager/manager1.c @@ -0,0 +1,64 @@ +#include "global.h" +#include "entity.h" +#include "screen.h" + +extern void sub_0801D7EC(u32); +extern void sub_08056250(void); +extern void sub_080570B8(Entity*); +void sub_080570F8(void); +extern void sub_08052D74(void*, void*, void*); + +extern void (*const gUnk_08107C5C[])(Entity*); +extern void (*const gUnk_08107C48[])(Entity*); + +extern u8 gUnk_08107C40[]; + +void Manager1(Entity *this) +{ + u8 bVar1; + u8 *pbVar2; + + gUnk_08107C5C[this->action](this); + gUnk_08107C48[((u8*)&this->field_0x20)[1]](this); + bVar1 = gUnk_08107C40[((u8*)&this->field_0x20)[1]]; + if ((bVar1 != 0) && (*(u8 *)&this->field_0x20 != bVar1)) { + ((u8*)&this->field_0x20)[0] = bVar1; + sub_0801D7EC(bVar1); + } +} + +void sub_080570B8(Entity *this) +{ + u8 *pbVar1; + + sub_0801D7EC(((u8 *)&this->field_0x20)[0]); + this->height.WORD = 0; + pbVar1 = ((u8 *)&this->field_0x20 + 1); + if (*pbVar1 == 3) { + gScreen.affine.bg3xOffset = 1; + } + else { + gUnk_08107C48[*pbVar1](this); + } +} + +void sub_080570F8(void) +{ + gScreen.lcd.lcdControl2 &= 0xf7ff; + gScreen.controls.windowOutsideControl = 0; + sub_08056250(); +} + +void sub_08057118(Entity *this) +{ + this->actionDelay = 0; + *(u8 *)&this->field_0x20 = 0; + ((u8 *)&this->field_0x20)[1] = 0; + ((u8 *)&this->field_0x20)[2] = 0; + this->action = 1; + gScreen.affine.unk2 = 0x1e04; + *(u16 *)&gScreen.lcd.lcdControl2 |= 0x800; + gScreen.controls.windowOutsideControl = 0x3648; + gScreen.controls.mosaicSize = 0x1000; + sub_08052D74(this, sub_080570B8, sub_080570F8); +}
\ No newline at end of file diff --git a/src/manager/manager2.c b/src/manager/manager2.c new file mode 100644 index 00000000..707c13d1 --- /dev/null +++ b/src/manager/manager2.c @@ -0,0 +1,18 @@ +#include "global.h" +#include "entity.h" +#include "screen.h" + +extern void sub_080576A0(); +extern void sub_08052D74(); +extern void sub_0805754C(Entity*); + +void Manager2(Entity *this) +{ + if (this->action == 0) { + this->action = 1; + gScreen.affine.bg3xOffset = 0; + gScreen.bg2.bg0xOffset = 0; + sub_08052D74(this, sub_080576A0, 0); + } + sub_0805754C(this); +}
\ No newline at end of file diff --git a/src/manager/manager27.c b/src/manager/manager27.c new file mode 100644 index 00000000..db5bd8b6 --- /dev/null +++ b/src/manager/manager27.c @@ -0,0 +1,90 @@ +#include "global.h" +#include "entity.h" +#include "flags.h" +#include "functions.h" + +typedef struct { + u8 filler[0xAC]; + u16 unk; +} struct_030010A0; + +extern u32 sub_0805C920(Entity*); +extern void LoadPalettesByPaletteGroupIndex(u32); +extern void (*const gUnk_08108D10[])(Entity*); + +extern struct_030010A0 gUnk_030010A0; +extern u8 gUnk_08108D20[]; + +void Manager27(Entity *this) +{ + + gUnk_08108D10[this->action](this); + if (CheckLocalFlagByOffset(0x300, this->entityType.form + 0x67)) { + gUnk_030010A0.unk |= (1 << (this->entityType).form); + } + else { + gUnk_030010A0.unk &= ~(1 << (this->entityType).form); + } +} + +void sub_0805C874(Entity *this) +{ + u8 bVar1; + + if (sub_0805C920(this)) { + this->action = 2; + } + else { + this->action = 1; + } + + this->actionDelay = 1; + this->field_0xf = 0; +} + +void sub_0805C894(Entity *this) +{ + + if (sub_0805C920(this)) { + this->action = 2; + this->actionDelay = 1; + PlaySFX(0x11a); + } +} + +void sub_0805C8B4(Entity *this) +{ + u8 bVar1; + int iVar2; + + + if (--this->actionDelay == 0) { + this->actionDelay = 0x14; + + if (5 < ++this->field_0xf) { + this->field_0xf = 0; + } + LoadPalettesByPaletteGroupIndex(gUnk_08108D20[this->field_0xf]); + if (this->field_0xf == 0) { + PlaySFX(0x11a); + } + } + if (sub_0805C920(this) == 0) { + this->action = 3; + } +} + +void sub_0805C908(Entity *this) +{ + if (this->field_0xf == 0) { + this->action = 1; + } + else { + sub_0805C8B4(this); + } +} + +u32 sub_0805C920(Entity *this) +{ + return CheckLocalFlagByOffset(0x300, (this->entityType).form + 0x67); +}
\ No newline at end of file diff --git a/src/manager/manager2E.c b/src/manager/manager2E.c new file mode 100644 index 00000000..3e528098 --- /dev/null +++ b/src/manager/manager2E.c @@ -0,0 +1,15 @@ +#include "global.h" +#include "entity.h" + +extern void (*const gUnk_08108D3C[])(Entity*); +extern void (*const gUnk_08108D44[])(Entity*); + +void sub_0805D250(Entity *this) +{ + gUnk_08108D3C[this->entityType.form](this); +} + +void sub_0805D268(Entity *this) +{ + gUnk_08108D44[this->action](this); +}
\ No newline at end of file |
