mirror of
https://github.com/FireEmblemUniverse/fireemblem8u.git
synced 2024-11-23 13:19:53 +00:00
(emitstarfx) decompile completed
This commit is contained in:
parent
2f01fca176
commit
b67ca593bb
428
asm/emitstarfx.s
428
asm/emitstarfx.s
@ -2,433 +2,5 @@
|
||||
|
||||
.SYNTAX UNIFIED
|
||||
|
||||
@ Some effect proc emitting little white stars. Seems unused
|
||||
|
||||
THUMB_FUNC_START sub_8021FB8
|
||||
sub_8021FB8: @ 0x08021FB8
|
||||
push {r4, lr}
|
||||
adds r4, r0, #0
|
||||
movs r0, #0
|
||||
str r0, [r4, #0x34]
|
||||
str r0, [r4, #0x38]
|
||||
str r0, [r4, #0x3c]
|
||||
bl AdvanceGetLCGRNValue
|
||||
ldr r1, _08021FE8 @ 0x000003FF
|
||||
ands r1, r0
|
||||
ldr r0, [r4, #0x14]
|
||||
adds r0, #0x64
|
||||
movs r2, #0
|
||||
ldrsh r0, [r0, r2]
|
||||
lsls r0, r0, #4
|
||||
movs r2, #0xc0
|
||||
lsls r2, r2, #4
|
||||
adds r0, r0, r2
|
||||
adds r1, r1, r0
|
||||
negs r1, r1
|
||||
str r1, [r4, #0x40]
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_08021FE8: .4byte 0x000003FF
|
||||
|
||||
THUMB_FUNC_END sub_8021FB8
|
||||
|
||||
THUMB_FUNC_START sub_8021FEC
|
||||
sub_8021FEC: @ 0x08021FEC
|
||||
push {r4, lr}
|
||||
sub sp, #4
|
||||
adds r4, r0, #0
|
||||
ldr r0, [r4, #0x14]
|
||||
adds r0, #0x66
|
||||
movs r1, #0
|
||||
ldrsh r0, [r0, r1]
|
||||
cmp r0, #0
|
||||
beq _0802200A
|
||||
bl GetGameClock
|
||||
movs r1, #3
|
||||
ands r1, r0
|
||||
cmp r1, #0
|
||||
bne _08022026
|
||||
_0802200A:
|
||||
ldr r2, [r4, #0x34]
|
||||
ldr r0, [r4, #0x3c]
|
||||
adds r2, r2, r0
|
||||
str r2, [r4, #0x34]
|
||||
ldr r1, [r4, #0x38]
|
||||
ldr r0, [r4, #0x40]
|
||||
adds r1, r1, r0
|
||||
str r1, [r4, #0x38]
|
||||
ldr r0, [r4, #0x2c]
|
||||
adds r0, r0, r2
|
||||
str r0, [r4, #0x2c]
|
||||
ldr r0, [r4, #0x30]
|
||||
adds r0, r0, r1
|
||||
str r0, [r4, #0x30]
|
||||
_08022026:
|
||||
ldr r2, [r4, #0x30]
|
||||
cmp r2, #0
|
||||
bge _0802203E
|
||||
adds r0, r4, #0
|
||||
bl Proc_Break
|
||||
ldr r1, [r4, #0x14]
|
||||
adds r1, #0x4c
|
||||
ldrh r0, [r1]
|
||||
subs r0, #1
|
||||
strh r0, [r1]
|
||||
b _08022052
|
||||
_0802203E:
|
||||
movs r0, #0x2e
|
||||
ldrsh r1, [r4, r0]
|
||||
asrs r2, r2, #0x10
|
||||
ldr r3, _0802205C @ gObject_8x8
|
||||
movs r0, #0xa0
|
||||
lsls r0, r0, #4
|
||||
str r0, [sp]
|
||||
movs r0, #0xa
|
||||
bl PutSprite
|
||||
_08022052:
|
||||
add sp, #4
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_0802205C: .4byte gObject_8x8
|
||||
|
||||
THUMB_FUNC_END sub_8021FEC
|
||||
|
||||
THUMB_FUNC_START sub_8022060
|
||||
sub_8022060: @ 0x08022060
|
||||
push {r4, r5, r6, lr}
|
||||
mov r6, r9
|
||||
mov r5, r8
|
||||
push {r5, r6}
|
||||
sub sp, #4
|
||||
adds r5, r0, #0
|
||||
mov r8, r1
|
||||
mov r9, r3
|
||||
ldr r6, [sp, #0x1c]
|
||||
ldr r1, [r5]
|
||||
movs r4, #0x80
|
||||
lsls r4, r4, #1
|
||||
str r4, [sp]
|
||||
movs r0, #0
|
||||
adds r3, r6, #0
|
||||
bl Interpolate
|
||||
str r0, [r5]
|
||||
mov r0, r8
|
||||
ldr r1, [r0]
|
||||
str r4, [sp]
|
||||
movs r0, #0
|
||||
mov r2, r9
|
||||
adds r3, r6, #0
|
||||
bl Interpolate
|
||||
mov r1, r8
|
||||
str r0, [r1]
|
||||
add sp, #4
|
||||
pop {r3, r4}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
pop {r4, r5, r6}
|
||||
pop {r0}
|
||||
bx r0
|
||||
|
||||
THUMB_FUNC_END sub_8022060
|
||||
|
||||
THUMB_FUNC_START sub_80220A8
|
||||
sub_80220A8: @ 0x080220A8
|
||||
push {r4, r5, r6, r7, lr}
|
||||
mov r7, sl
|
||||
mov r6, r9
|
||||
mov r5, r8
|
||||
push {r5, r6, r7}
|
||||
sub sp, #4
|
||||
adds r6, r0, #0
|
||||
bl GetGameClock
|
||||
movs r1, #3
|
||||
ands r1, r0
|
||||
cmp r1, #0
|
||||
bne _080220C4
|
||||
b _080221EE
|
||||
_080220C4:
|
||||
movs r0, #0
|
||||
mov r9, r0
|
||||
adds r0, r6, #0
|
||||
adds r0, #0x4c
|
||||
movs r2, #0
|
||||
ldrsh r1, [r0, r2]
|
||||
mov r8, r0
|
||||
cmp r1, #0x28
|
||||
ble _080220D8
|
||||
b _080221EE
|
||||
_080220D8:
|
||||
movs r3, #0x64
|
||||
adds r3, r3, r6
|
||||
mov sl, r3
|
||||
mov r7, sl
|
||||
_080220E0:
|
||||
ldr r0, _080221A4 @ gUnknown_0859B510
|
||||
adds r1, r6, #0
|
||||
bl Proc_Start
|
||||
adds r5, r0, #0
|
||||
bl AdvanceGetLCGRNValue
|
||||
ldr r1, [r6, #0x34]
|
||||
lsls r1, r1, #0x10
|
||||
ldr r4, _080221A8 @ 0x0000FFFF
|
||||
ands r0, r4
|
||||
lsls r0, r0, #4
|
||||
adds r1, r1, r0
|
||||
str r1, [r5, #0x2c]
|
||||
bl AdvanceGetLCGRNValue
|
||||
ldr r1, [r6, #0x38]
|
||||
adds r1, #8
|
||||
lsls r1, r1, #0x10
|
||||
ands r0, r4
|
||||
lsls r0, r0, #3
|
||||
adds r1, r1, r0
|
||||
str r1, [r5, #0x30]
|
||||
adds r4, r5, #0
|
||||
adds r4, #0x2c
|
||||
adds r1, r5, #0
|
||||
adds r1, #0x30
|
||||
ldr r2, [r6, #0x3c]
|
||||
ldr r3, [r6, #0x40]
|
||||
movs r5, #0
|
||||
ldrsh r0, [r7, r5]
|
||||
movs r5, #0x80
|
||||
lsls r5, r5, #1
|
||||
cmp r0, r5
|
||||
ble _0802212A
|
||||
movs r0, #0x80
|
||||
lsls r0, r0, #1
|
||||
_0802212A:
|
||||
str r0, [sp]
|
||||
adds r0, r4, #0
|
||||
bl sub_8022060
|
||||
mov r1, r8
|
||||
ldrh r0, [r1]
|
||||
adds r1, r0, #1
|
||||
mov r2, r8
|
||||
strh r1, [r2]
|
||||
movs r3, #1
|
||||
add r9, r3
|
||||
mov r4, r9
|
||||
cmp r4, #0
|
||||
bgt _0802214E
|
||||
lsls r0, r1, #0x10
|
||||
asrs r0, r0, #0x10
|
||||
cmp r0, #0x28
|
||||
ble _080220E0
|
||||
_0802214E:
|
||||
lsls r0, r1, #0x10
|
||||
asrs r0, r0, #0x10
|
||||
cmp r0, #0x28
|
||||
bgt _080221EE
|
||||
ldr r0, _080221A4 @ gUnknown_0859B510
|
||||
adds r1, r6, #0
|
||||
bl Proc_Start
|
||||
adds r5, r0, #0
|
||||
bl AdvanceGetLCGRNValue
|
||||
ldr r1, [r6, #0x34]
|
||||
subs r1, #8
|
||||
lsls r1, r1, #0x10
|
||||
ldr r4, _080221A8 @ 0x0000FFFF
|
||||
ands r0, r4
|
||||
lsls r0, r0, #5
|
||||
adds r1, r1, r0
|
||||
str r1, [r5, #0x2c]
|
||||
bl AdvanceGetLCGRNValue
|
||||
ldr r1, [r6, #0x38]
|
||||
adds r1, #8
|
||||
lsls r1, r1, #0x10
|
||||
ands r0, r4
|
||||
lsls r0, r0, #3
|
||||
adds r1, r1, r0
|
||||
str r1, [r5, #0x30]
|
||||
adds r7, r5, #0
|
||||
adds r7, #0x2c
|
||||
adds r1, r5, #0
|
||||
adds r1, #0x30
|
||||
ldr r2, [r6, #0x3c]
|
||||
ldr r3, [r6, #0x40]
|
||||
mov r5, sl
|
||||
movs r4, #0
|
||||
ldrsh r0, [r5, r4]
|
||||
movs r4, #0x80
|
||||
lsls r4, r4, #1
|
||||
cmp r0, r4
|
||||
bgt _080221AC
|
||||
str r0, [sp]
|
||||
b _080221AE
|
||||
.align 2, 0
|
||||
_080221A4: .4byte gUnknown_0859B510
|
||||
_080221A8: .4byte 0x0000FFFF
|
||||
_080221AC:
|
||||
str r4, [sp]
|
||||
_080221AE:
|
||||
adds r0, r7, #0
|
||||
bl sub_8022060
|
||||
mov r5, r8
|
||||
ldrh r0, [r5]
|
||||
adds r0, #1
|
||||
strh r0, [r5]
|
||||
mov r1, sl
|
||||
ldrh r2, [r1]
|
||||
movs r3, #0
|
||||
ldrsh r0, [r1, r3]
|
||||
cmp r0, #0
|
||||
blt _080221CE
|
||||
adds r0, r2, #0
|
||||
adds r0, #8
|
||||
strh r0, [r1]
|
||||
_080221CE:
|
||||
mov r4, sl
|
||||
movs r5, #0
|
||||
ldrsh r1, [r4, r5]
|
||||
movs r0, #0xa0
|
||||
lsls r0, r0, #1
|
||||
cmp r1, r0
|
||||
ble _080221EE
|
||||
adds r0, r6, #0
|
||||
bl Proc_Break
|
||||
movs r0, #0
|
||||
strh r0, [r4]
|
||||
adds r1, r6, #0
|
||||
adds r1, #0x66
|
||||
movs r0, #1
|
||||
strh r0, [r1]
|
||||
_080221EE:
|
||||
add sp, #4
|
||||
pop {r3, r4, r5}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
mov sl, r5
|
||||
pop {r4, r5, r6, r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
|
||||
THUMB_FUNC_END sub_80220A8
|
||||
|
||||
THUMB_FUNC_START sub_8022200
|
||||
sub_8022200: @ 0x08022200
|
||||
push {r4, r5, lr}
|
||||
sub sp, #4
|
||||
adds r5, r0, #0
|
||||
adds r5, #0x64
|
||||
movs r0, #0
|
||||
ldrsh r1, [r5, r0]
|
||||
movs r0, #0x10
|
||||
subs r0, r0, r1
|
||||
cmp r0, #0
|
||||
bge _08022216
|
||||
movs r0, #0
|
||||
_08022216:
|
||||
lsls r3, r0, #0x18
|
||||
lsrs r3, r3, #0x18
|
||||
movs r0, #2
|
||||
movs r1, #0
|
||||
movs r2, #0
|
||||
bl SetSpecialColorEffectsParameters
|
||||
movs r4, #1
|
||||
str r4, [sp]
|
||||
movs r0, #1
|
||||
movs r1, #1
|
||||
movs r2, #1
|
||||
movs r3, #1
|
||||
bl SetBlendTargetA
|
||||
str r4, [sp]
|
||||
movs r0, #1
|
||||
movs r1, #1
|
||||
movs r2, #1
|
||||
movs r3, #1
|
||||
bl SetBlendTargetB
|
||||
ldrh r0, [r5]
|
||||
adds r0, #1
|
||||
strh r0, [r5]
|
||||
add sp, #4
|
||||
pop {r4, r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
|
||||
THUMB_FUNC_END sub_8022200
|
||||
|
||||
THUMB_FUNC_START sub_8022250
|
||||
sub_8022250: @ 0x08022250
|
||||
push {r4, r5, r6, lr}
|
||||
mov r6, r9
|
||||
mov r5, r8
|
||||
push {r5, r6}
|
||||
adds r6, r0, #0
|
||||
mov r8, r1
|
||||
mov r9, r2
|
||||
adds r4, r3, #0
|
||||
ldr r5, [sp, #0x18]
|
||||
ldr r0, _080222A8 @ gUnknown_0859B540
|
||||
ldr r1, _080222AC @ 0x06014000
|
||||
movs r2, #0x20
|
||||
bl RegisterTileGraphics
|
||||
ldr r0, _080222B0 @ gUnknown_0859B528
|
||||
adds r1, r6, #0
|
||||
bl Proc_Start
|
||||
adds r3, r0, #0
|
||||
mov r0, r8
|
||||
str r0, [r3, #0x34]
|
||||
mov r0, r9
|
||||
str r0, [r3, #0x38]
|
||||
lsls r4, r4, #0x10
|
||||
str r4, [r3, #0x3c]
|
||||
lsls r5, r5, #0x10
|
||||
str r5, [r3, #0x40]
|
||||
adds r0, r3, #0
|
||||
adds r0, #0x4c
|
||||
movs r2, #0
|
||||
strh r2, [r0]
|
||||
adds r1, r3, #0
|
||||
adds r1, #0x64
|
||||
ldr r0, _080222B4 @ 0x0000FFFF
|
||||
strh r0, [r1]
|
||||
adds r0, r3, #0
|
||||
adds r0, #0x66
|
||||
strh r2, [r0]
|
||||
pop {r3, r4}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
pop {r4, r5, r6}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_080222A8: .4byte gUnknown_0859B540
|
||||
_080222AC: .4byte 0x06014000
|
||||
_080222B0: .4byte gUnknown_0859B528
|
||||
_080222B4: .4byte 0x0000FFFF
|
||||
|
||||
THUMB_FUNC_END sub_8022250
|
||||
|
||||
THUMB_FUNC_START sub_80222B8
|
||||
sub_80222B8: @ 0x080222B8
|
||||
push {lr}
|
||||
ldr r0, _080222CC @ gUnknown_0859B528
|
||||
bl Proc_Find
|
||||
adds r0, #0x64
|
||||
movs r1, #0
|
||||
strh r1, [r0]
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_080222CC: .4byte gUnknown_0859B528
|
||||
|
||||
THUMB_FUNC_END sub_80222B8
|
||||
|
||||
THUMB_FUNC_START sub_80222D0
|
||||
sub_80222D0: @ 0x080222D0
|
||||
push {lr}
|
||||
ldr r0, _080222DC @ gUnknown_0859B528
|
||||
bl Proc_EndEach
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_080222DC: .4byte gUnknown_0859B528
|
||||
|
||||
THUMB_FUNC_END sub_80222D0
|
||||
|
||||
.align 2, 0
|
||||
|
@ -1,35 +1,5 @@
|
||||
.section .data
|
||||
|
||||
.global gUnknown_0859B510
|
||||
gUnknown_0859B510: @ 0x0859B510
|
||||
@ PROC_CALL
|
||||
.short 0x2, 0x0
|
||||
.word sub_8021FB8
|
||||
@ PROC_REPEAT
|
||||
.short 0x3, 0x0
|
||||
.word sub_8021FEC
|
||||
@ PROC_END
|
||||
.short 0x0, 0x0
|
||||
.word 0x0
|
||||
|
||||
|
||||
.global gUnknown_0859B528
|
||||
gUnknown_0859B528: @ 0x0859B528
|
||||
@ PROC_REPEAT
|
||||
.short 0x3, 0x0
|
||||
.word sub_80220A8
|
||||
@ PROC_REPEAT
|
||||
.short 0x3, 0x0
|
||||
.word sub_8022200
|
||||
@ PROC_END
|
||||
.short 0x0, 0x0
|
||||
.word 0x0
|
||||
|
||||
|
||||
.global gUnknown_0859B540
|
||||
gUnknown_0859B540: @ 0x0859B540
|
||||
.incbin "baserom.gba", 0x59B540, 0x20
|
||||
|
||||
.global gUnknown_0859B560
|
||||
gUnknown_0859B560: @ 0x0859B560
|
||||
@ PROC_SLEEP
|
||||
|
@ -37,5 +37,7 @@ void StartDanceringAnim(ProcPtr parent);
|
||||
void StartEventWarpAnim(ProcPtr parent, int xCamera, int yCamera, s8 xWarp, s8 yWarp);
|
||||
void StartEventWarpAnim_unused(ProcPtr parent, int xCamera, int yCamera, s8 xWarp);
|
||||
int EventWarpAnimExists();
|
||||
|
||||
void StartEmitStarsAnim(ProcPtr parent, int r1, int r2, int r3, int r4);
|
||||
void ClearEmitedStars();
|
||||
void EndEmitStars();
|
||||
#endif /* GUARD_BMFX_H */
|
||||
|
@ -106,6 +106,8 @@ enum
|
||||
|
||||
OBJCHR_TRAPFX = 0x240,
|
||||
|
||||
OBJCHR_EMITSTARTS = 0x200,
|
||||
|
||||
OBJCHR_TRADEMENU_240 = 0x240,
|
||||
|
||||
OBJCHR_SUBTITLEHELP_TEXT = 0x240,
|
||||
|
@ -932,14 +932,14 @@ void StartDanceringAnim(ProcPtr parent);
|
||||
// ??? ProcWhiteCircleFx_Loop(???);
|
||||
// ??? ProcWhiteCircleFx_End(???);
|
||||
// ??? StartCircularFadeAnim(???);
|
||||
// ??? sub_8021FB8(???);
|
||||
// ??? sub_8021FEC(???);
|
||||
// ??? sub_8022060(???);
|
||||
// ??? sub_80220A8(???);
|
||||
// ??? sub_8022200(???);
|
||||
// ??? sub_8022250(???);
|
||||
// ??? sub_80222B8(???);
|
||||
// ??? sub_80222D0(???);
|
||||
// ??? ProcEmitSingleStar_Init(???);
|
||||
// ??? ProcEmitSingleStar_Loop(???);
|
||||
// ??? Calcs_Interpolate(???);
|
||||
// ??? LetsEmitStars(???);
|
||||
// ??? StarsBlinking(???);
|
||||
// ??? StartEmitStarsAnim(???);
|
||||
// ??? ClearEmitedStars(???);
|
||||
// ??? EndEmitStars(???);
|
||||
// ??? sub_80222E0(???);
|
||||
// ??? sub_8022300(???);
|
||||
// ??? sub_802237C(???);
|
||||
|
@ -44,28 +44,53 @@ struct ProcCmd
|
||||
// allows local Proc structs to invoke the general Proc
|
||||
// fields when creating local Proc definitions.
|
||||
#define PROC_HEADER \
|
||||
const struct ProcCmd* proc_script; /* pointer to proc script */ \
|
||||
const struct ProcCmd* proc_scrCur; /* pointer to currently executing script command */ \
|
||||
ProcFunc proc_endCb; /* callback to run upon delegint the process */ \
|
||||
ProcFunc proc_idleCb; /* callback to run once each frame. */ \
|
||||
/* disables script execution when not null */ \
|
||||
const char* proc_name; \
|
||||
ProcPtr proc_parent; /* pointer to parent proc. If this proc is a root proc, */ \
|
||||
/* this member is an integer which is the root index. */ \
|
||||
ProcPtr proc_child; /* pointer to most recently added child */ \
|
||||
ProcPtr proc_next; /* next sibling */ \
|
||||
ProcPtr proc_prev; /* previous sibling */ \
|
||||
s16 proc_sleepTime; \
|
||||
u8 proc_mark; \
|
||||
u8 proc_flags; \
|
||||
u8 proc_lockCnt; /* wait semaphore. Process execution */ \
|
||||
/* is blocked when this is nonzero. */ \
|
||||
/* 00 */ const struct ProcCmd* proc_script; /* pointer to proc script */ \
|
||||
/* 04 */ const struct ProcCmd* proc_scrCur; /* pointer to currently executing script command */ \
|
||||
/* 08 */ ProcFunc proc_endCb; /* callback to run upon delegint the process */ \
|
||||
/* 0C */ ProcFunc proc_idleCb; /* callback to run once each frame. */ \
|
||||
/* disables script execution when not null */ \
|
||||
/* 10 */ const char* proc_name; \
|
||||
/* 14 */ ProcPtr proc_parent; /* pointer to parent proc. If this proc is a root proc, */ \
|
||||
/* this member is an integer which is the root index. */ \
|
||||
/* 18 */ ProcPtr proc_child; /* pointer to most recently added child */ \
|
||||
/* 1C */ ProcPtr proc_next; /* next sibling */ \
|
||||
/* 20 */ ProcPtr proc_prev; /* previous sibling */ \
|
||||
/* 24 */ s16 proc_sleepTime; \
|
||||
/* 26 */ u8 proc_mark; \
|
||||
/* 27 */ u8 proc_flags; \
|
||||
/* 28 */ u8 proc_lockCnt; /* wait semaphore. Process execution */ \
|
||||
/* is blocked when this is nonzero. */ \
|
||||
|
||||
// general Proc struct for use in proc.c when initializing and using the proc.
|
||||
struct Proc
|
||||
{
|
||||
/* 00 */ PROC_HEADER;
|
||||
/* 2C */ u32 data[0x10];
|
||||
|
||||
/* 2C */ int x, y;
|
||||
/* 34 */ int unk34;
|
||||
/* 38 */ int unk38;
|
||||
/* 3C */ int unk3C;
|
||||
/* 40 */ int unk40;
|
||||
|
||||
/* 44 */ u8 pad38[0x4A - 0x44];
|
||||
|
||||
/* 4A */ short unk4A;
|
||||
|
||||
// Is this part of that?
|
||||
/* 4C */ short unk4C;
|
||||
/* 4E */ short unk4E;
|
||||
/* 50 */ short unk50;
|
||||
|
||||
/* 52 */ u16 unk52;
|
||||
|
||||
/* 54 */ void * ptr;
|
||||
/* 58 */ int unk58;
|
||||
/* 5C */ int unk5C;
|
||||
/* 60 */ int unk60;
|
||||
/* 64 */ short unk64;
|
||||
/* 66 */ short unk66;
|
||||
/* 68 */ short unk68;
|
||||
/* 6A */ short unk6A;
|
||||
};
|
||||
|
||||
struct ProcFindIterator
|
||||
|
@ -1446,9 +1446,9 @@ extern u16 CONST_DATA obj_0859AEC8[];
|
||||
// extern ??? Vectors_EventWarp2
|
||||
// extern ??? ProcScr_EventWrapAnim
|
||||
// extern ??? ProcScr_WhiteCircleFx
|
||||
// extern ??? gUnknown_0859B510
|
||||
// extern ??? gUnknown_0859B528
|
||||
// extern ??? gUnknown_0859B540
|
||||
// extern ??? ProcScr_EmitSingleStar
|
||||
// extern ??? ProcScr_EmitStars
|
||||
// extern ??? Img_EmitedStar
|
||||
// extern ??? gUnknown_0859B560
|
||||
// extern ??? gUnknown_0859B668
|
||||
// extern ??? gUnknown_0859B66C
|
||||
|
@ -80,7 +80,7 @@ SECTIONS
|
||||
src/danceringfx.o(.text);
|
||||
src/eventwarpfx.o(.text);
|
||||
src/whitecircularfadefx.o(.text);
|
||||
asm/emitstarfx.o(.text);
|
||||
src/emitstarfx.o(.text);
|
||||
asm/minefx.o(.text);
|
||||
asm/chapterintrofx_title.o(.text);
|
||||
src/bmmenu.o(.text);
|
||||
@ -305,6 +305,7 @@ SECTIONS
|
||||
. = ALIGN(4); src/danceringfx.o(.data);
|
||||
. = ALIGN(4); src/eventwarpfx.o(.data);
|
||||
. = ALIGN(4); src/whitecircularfadefx.o(.data);
|
||||
. = ALIGN(4); src/emitstarfx.o(.data);
|
||||
. = ALIGN(4); data/data_59B358.o(.data);
|
||||
. = ALIGN(4); src/bmmenu.o(.data);
|
||||
. = ALIGN(4); data/data_59B668.o(.data);
|
||||
|
239
src/emitstarfx.c
Normal file
239
src/emitstarfx.c
Normal file
@ -0,0 +1,239 @@
|
||||
#include "global.h"
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
#include "constants/video-global.h"
|
||||
#include "proc.h"
|
||||
#include "hardware.h"
|
||||
#include "rng.h"
|
||||
#include "ctc.h"
|
||||
#include "bmfx.h"
|
||||
|
||||
/**
|
||||
* Some effect proc emitting little white stars. Seems unused
|
||||
*/
|
||||
|
||||
struct ProcEmitSingleStarFx {
|
||||
PROC_HEADER;
|
||||
|
||||
/* 2C */ int star_loc;
|
||||
/* 30 */ int unk30;
|
||||
/* 34 */ int unk34;
|
||||
/* 38 */ int unk38;
|
||||
/* 3C */ int unk3C;
|
||||
/* 40 */ int unk40;
|
||||
};
|
||||
|
||||
struct ProcEmitStars {
|
||||
PROC_HEADER;
|
||||
|
||||
/* 2C */ int star_loc;
|
||||
/* 30 */ int unk30;
|
||||
/* 34 */ int unk34;
|
||||
/* 38 */ int unk38;
|
||||
/* 3C */ int unk3C;
|
||||
/* 40 */ int unk40;
|
||||
/* 44 */ int unk44;
|
||||
/* 48 */ int unk48;
|
||||
|
||||
/* 4C */ s16 counter;
|
||||
|
||||
/* 4E */ u8 _pad_4E[0x64 - 0x4E];
|
||||
|
||||
/* 64 */ s16 stars;
|
||||
/* 66 */ s16 move_star_ctr;
|
||||
};
|
||||
|
||||
|
||||
|
||||
/* function declarations */
|
||||
|
||||
void ProcEmitSingleStar_Init(struct ProcEmitSingleStarFx *proc);
|
||||
void ProcEmitSingleStar_Loop(struct ProcEmitSingleStarFx *proc);
|
||||
|
||||
void LetsEmitStars(struct ProcEmitStars *proc);
|
||||
void StarsBlinking(struct ProcEmitStars *proc);
|
||||
|
||||
|
||||
/* section.data */
|
||||
|
||||
struct ProcCmd CONST_DATA ProcScr_EmitSingleStar[] = {
|
||||
PROC_CALL(ProcEmitSingleStar_Init),
|
||||
PROC_REPEAT(ProcEmitSingleStar_Loop),
|
||||
PROC_END
|
||||
};
|
||||
|
||||
struct ProcCmd CONST_DATA ProcScr_EmitStars[] = {
|
||||
PROC_REPEAT(LetsEmitStars),
|
||||
PROC_REPEAT(StarsBlinking),
|
||||
PROC_END
|
||||
};
|
||||
|
||||
u8 CONST_DATA Img_EmitedStar[0x20] = {
|
||||
0xE0, 0x00, 0x00, 0x00, 0xEE, 0x0E, 0x00, 0x00,
|
||||
0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
|
||||
|
||||
|
||||
/* section.text */
|
||||
|
||||
void ProcEmitSingleStar_Init(struct ProcEmitSingleStarFx *proc)
|
||||
{
|
||||
int val, tmp1, tmp2;
|
||||
|
||||
proc->unk34 = 0;
|
||||
proc->unk38 = 0;
|
||||
proc->unk3C = 0;
|
||||
|
||||
tmp1 = AdvanceGetLCGRNValue() % 0x400;
|
||||
tmp2 = ((struct ProcEmitStars*)proc->proc_parent)->stars * 0x10;
|
||||
tmp2 += 0xC00;
|
||||
val = tmp1 + tmp2;
|
||||
|
||||
proc->unk40 = -val;
|
||||
}
|
||||
|
||||
void ProcEmitSingleStar_Loop(struct ProcEmitSingleStarFx *proc)
|
||||
{
|
||||
int val0, val1;
|
||||
|
||||
struct ProcEmitStars *parent = proc->proc_parent;
|
||||
if (0 == parent->move_star_ctr || 0 == GetGameClock() % 4) {
|
||||
val0 = proc->unk34 + proc->unk3C;
|
||||
proc->unk34 = val0;
|
||||
|
||||
val1 = proc->unk38 + proc->unk40;
|
||||
proc->unk38 = val1;
|
||||
proc->star_loc += val0;
|
||||
proc->unk30 += val1;
|
||||
}
|
||||
|
||||
if (proc->unk30 < 0) {
|
||||
Proc_Break(proc);
|
||||
((struct ProcEmitStars*)proc->proc_parent)->counter--;
|
||||
} else {
|
||||
struct Vec2 *vec = (struct Vec2*)(&proc->star_loc);
|
||||
PutSprite(0xA,
|
||||
vec->y, /* wtf?? */
|
||||
proc->unk30 >> 0x10,
|
||||
gObject_8x8, 0xA00);
|
||||
}
|
||||
}
|
||||
|
||||
void Calcs_Interpolate(int *buf1, int *buf2, int r2, int r3, int r4)
|
||||
{
|
||||
*buf1 = Interpolate(0, *buf1, r2, r4, 0x100);
|
||||
*buf2 = Interpolate(0, *buf2, r3, r4, 0x100);
|
||||
}
|
||||
|
||||
void LetsEmitStars(struct ProcEmitStars *proc)
|
||||
{
|
||||
int val, val1;
|
||||
struct ProcEmitSingleStarFx * child;
|
||||
|
||||
if (0 == GetGameClock() % 4)
|
||||
return;
|
||||
|
||||
val = 0;
|
||||
|
||||
if (proc->counter > 0x28)
|
||||
return;
|
||||
|
||||
while (1) {
|
||||
child = Proc_Start(ProcScr_EmitSingleStar, proc);
|
||||
child->star_loc = (proc->unk34 * 0x10000)
|
||||
+ (AdvanceGetLCGRNValue() % 0x10000) * 0x10;
|
||||
child->unk30 = (proc->unk38 + 8) * 0x10000
|
||||
+ (AdvanceGetLCGRNValue() % 0x10000) * 0x8;
|
||||
|
||||
Calcs_Interpolate(
|
||||
&child->star_loc,
|
||||
&child->unk30,
|
||||
proc->unk3C,
|
||||
proc->unk40,
|
||||
proc->stars <= 0x100 ? proc->stars : 0x100
|
||||
);
|
||||
|
||||
proc->counter++;
|
||||
val++;
|
||||
|
||||
if (val > 0)
|
||||
break;
|
||||
|
||||
if (proc->counter > 0x28)
|
||||
break;
|
||||
}
|
||||
|
||||
if (proc->counter > 0x28)
|
||||
return;
|
||||
|
||||
child = Proc_Start(ProcScr_EmitSingleStar, proc);
|
||||
child->star_loc = (proc->unk34 - 0x8) * 0x10000
|
||||
+ (AdvanceGetLCGRNValue() % 0x10000) * 0x20;
|
||||
child->unk30 = (proc->unk38 + 8) * 0x10000
|
||||
+ (AdvanceGetLCGRNValue() % 0x10000) * 0x8;
|
||||
|
||||
Calcs_Interpolate(
|
||||
&child->star_loc,
|
||||
&child->unk30,
|
||||
proc->unk3C,
|
||||
proc->unk40,
|
||||
proc->stars <= 0x100 ? proc->stars : 0x100
|
||||
);
|
||||
|
||||
proc->counter++;
|
||||
|
||||
if (proc->stars >= 0)
|
||||
proc->stars = proc->stars + 8;
|
||||
|
||||
if (proc->stars > 0x140) {
|
||||
Proc_Break(proc);
|
||||
proc->stars = 0;
|
||||
proc->move_star_ctr = 1;
|
||||
}
|
||||
}
|
||||
|
||||
void StarsBlinking(struct ProcEmitStars *proc)
|
||||
{
|
||||
int blend = 0x10 - proc->stars < 0 ? 0 : 0x10 - proc->stars;
|
||||
|
||||
SetSpecialColorEffectsParameters(2, 0, 0, blend);
|
||||
SetBlendTargetA(1, 1, 1, 1, 1);
|
||||
SetBlendTargetB(1, 1, 1, 1, 1);
|
||||
|
||||
proc->stars++;
|
||||
}
|
||||
|
||||
void StartEmitStarsAnim(ProcPtr parent, int r1, int r2, int r3, int r4)
|
||||
{
|
||||
struct ProcEmitStars *proc;
|
||||
|
||||
RegisterTileGraphics(
|
||||
Img_EmitedStar,
|
||||
OBJ_CHR_ADDR(OBJCHR_EMITSTARTS),
|
||||
0x20
|
||||
);
|
||||
|
||||
proc = Proc_Start(ProcScr_EmitStars, parent);
|
||||
|
||||
proc->unk34 = r1;
|
||||
proc->unk38 = r2;
|
||||
proc->unk3C = r3 << 0x10;
|
||||
proc->unk40 = r4 << 0x10;
|
||||
proc->counter = 0;
|
||||
proc->stars = -1;
|
||||
proc->move_star_ctr = 0;
|
||||
}
|
||||
|
||||
void ClearEmitedStars()
|
||||
{
|
||||
struct ProcEmitStars *proc = Proc_Find(ProcScr_EmitStars);
|
||||
proc->stars = 0;
|
||||
}
|
||||
|
||||
void EndEmitStars()
|
||||
{
|
||||
Proc_EndEach(ProcScr_EmitStars);
|
||||
}
|
Loading…
Reference in New Issue
Block a user