Skip to content

Commit

Permalink
ekrdragon in process
Browse files Browse the repository at this point in the history
  • Loading branch information
MokhaLeee committed Mar 7, 2024
1 parent dd4046b commit a0e44ee
Show file tree
Hide file tree
Showing 7 changed files with 114 additions and 285 deletions.
48 changes: 0 additions & 48 deletions asm/banim-ekrdragon.s
Original file line number Diff line number Diff line change
Expand Up @@ -191,51 +191,3 @@ _08070866:
_08070870: .4byte gPaletteBuffer+0xC0

THUMB_FUNC_END sub_80707FC

THUMB_FUNC_START sub_8070874
sub_8070874: @ 0x08070874
push {lr}
bl GetBanimDragonStatusType
cmp r0, #0
beq _08070898
bl GetBanimDragonStatusType
cmp r0, #3
beq _08070898
ldr r0, _0807089C @ ProcScr_EkrDragon_08758720
bl Proc_EndEach
movs r0, #0
bl SetEkrDragonPaletteFront
movs r0, #0
bl SetEkrDragonPaletteBack
_08070898:
pop {r0}
bx r0
.align 2, 0
_0807089C: .4byte ProcScr_EkrDragon_08758720

THUMB_FUNC_END sub_8070874

THUMB_FUNC_START sub_80708A0
sub_80708A0: @ 0x080708A0
push {lr}
bl GetBanimDragonStatusType
cmp r0, #0
beq _080708BE
bl GetBanimDragonStatusType
cmp r0, #3
beq _080708BE
ldr r0, _080708C4 @ ProcScr_EkrDragon_08758720
movs r1, #3
bl Proc_Start
ldr r1, _080708C8 @ gUnknown_08758740
str r1, [r0, #0x38]
_080708BE:
pop {r0}
bx r0
.align 2, 0
_080708C4: .4byte ProcScr_EkrDragon_08758720
_080708C8: .4byte gUnknown_08758740

THUMB_FUNC_END sub_80708A0

.align 2, 0
4 changes: 2 additions & 2 deletions include/efxbattle.h
Original file line number Diff line number Diff line change
Expand Up @@ -2402,8 +2402,8 @@ extern u32 AnimScr_EfxLokmsunaObjRight[];
extern struct ProcCmd ProcScr_EkrDracoZombie[];
extern struct ProcCmd ProcScr_ekrDragonQuake[];
extern struct ProcCmd ProcScr_ekrWhiteINOUT[];
// extern ??? ProcScr_EkrDragon_08758720
// extern ??? gUnknown_08758740
extern struct ProcCmd ProcScr_EkrDragon_08758720[];
extern u16 gUnknown_08758740[];
// extern ??? ProcScr_EkrMyrrh
extern struct ProcCmd ProcScr_EkrMyrrh[];
extern s16 gUnknown_0875879C[];
Expand Down
6 changes: 3 additions & 3 deletions include/ekrdragon.h
Original file line number Diff line number Diff line change
Expand Up @@ -606,9 +606,9 @@ bool CheckEkrDragonDead(struct Anim *anim);
bool CheckEkrDragonRefrain(struct Anim *anim);
void InitEkrDragonStatus(void);
void sub_807027C(struct Anim *anim);
u16 *GetEkrDragonPalette(void);
// ??? SetEkrDragonPaletteBack(???);
// ??? SetEkrDragonPaletteFront(???);
u16 * GetEkrDragonPalette(void);
void SetEkrDragonPaletteBack(int pos);
void SetEkrDragonPaletteFront(int pos);
void BanimSetFrontPaletteForDragon(struct Anim *anim);
void NewEkrDragonQuakeTree3(struct EkrDragonQuakePriv *priv, int, int);
void NewEkrDragonQuake(struct EkrDragonQuakePriv *priv, int, int, ProcPtr);
Expand Down
1 change: 1 addition & 0 deletions ldscript.txt
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,7 @@ SECTIONS
src/banim-ekrdragon-dracozombie.o(.text);
src/banim-ekrdragon-utils.o(.text);
asm/banim-ekrdragon.o(.text);
src/banim-ekrdragon-8070710.o(.text);
src/banim-ekrdragon-myrrh.o(.text);
src/banim-efxutils.o(.text);
src/banim-efxsound.o(.text);
Expand Down
66 changes: 66 additions & 0 deletions src/banim-ekrdragon-8070710.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#include "global.h"
#include "proc.h"
#include "hardware.h"
#include "ekrbattle.h"
#include "efxbattle.h"
#include "ekrdragon.h"

struct ProcEkrDragon_08758720 {
PROC_HEADER;

STRUCT_PAD(0x29, 0x2C);

/* 2C */ int unk2C;
/* 30 */ int unk30;
/* 34 */ u16 * unk34;
/* 38 */ const u16 * unk38;
/* 3C */ u8 unk3C;
/* 3D */ u8 unk3D;
};

void sub_8070710(u16 * a, u16 * paldst, u16 c, u16 d, u16 e);

#if 0
void sub_80707FC(struct ProcEkrDragon_08758720 * proc)
{
sub_8070710(proc->unk34,
(void *)gPaletteBuffer + 0xC0 + proc->unk3D,
proc->unk38[proc->unk30],
proc->unk3C,
proc->unk3D);

sub_8070710(proc->unk34,
(void *)gPaletteBuffer + 0x2E0 + proc->unk3D,
proc->unk38[proc->unk30],
proc->unk3C,
proc->unk3D);

EnablePaletteSync();

proc->unk2C++;
proc->unk30++;

if (proc->unk38[proc->unk30] == 0x8000)
proc->unk30 = 0;
}
#endif

void sub_8070874(void)
{
if (GetBanimDragonStatusType() != EKRDRGON_TYPE_NORMAL && GetBanimDragonStatusType() != EKRDRGON_TYPE_MYRRH)
{
Proc_EndEach(ProcScr_EkrDragon_08758720);
SetEkrDragonPaletteFront(POS_L);
SetEkrDragonPaletteBack(POS_L);
}
}

void sub_80708A0(void)
{
if (GetBanimDragonStatusType() != EKRDRGON_TYPE_NORMAL && GetBanimDragonStatusType() != EKRDRGON_TYPE_MYRRH)
{
struct ProcEkrDragon_08758720 * proc;
proc = Proc_Start(ProcScr_EkrDragon_08758720, PROC_TREE_3);
proc->unk38 = gUnknown_08758740;
}
}
Loading

0 comments on commit a0e44ee

Please sign in to comment.