Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions config/GALE01/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -533,18 +533,18 @@ fn_80021C1C = .text:0x80021C1C; // type:function size:0x2C
lbBgFlash_80021C48 = .text:0x80021C48; // type:function size:0x38 scope:global
fn_80021C80 = .text:0x80021C80; // type:function size:0x68
lbRefract_80021CE8 = .text:0x80021CE8; // type:function size:0x24C scope:global
fn_80021F34 = .text:0x80021F34; // type:function size:0x3C
lbRefract_WriteTexCoordIA4 = .text:0x80021F34; // type:function size:0x3C scope:local
fn_80021F70 = .text:0x80021F70; // type:function size:0x44
fn_80021FB4 = .text:0x80021FB4; // type:function size:0x44
fn_80021FF8 = .text:0x80021FF8; // type:function size:0x74
fn_8002206C = .text:0x8002206C; // type:function size:0xB4
fn_80022120 = .text:0x80022120; // type:function size:0x7C
lbRefract_ReadTexCoordRGBA8 = .text:0x80022120; // type:function size:0x7C
lbRefract_8002219C = .text:0x8002219C; // type:function size:0x108 scope:global
lbRefract_800222A4 = .text:0x800222A4; // type:function size:0x1D8 scope:global
lbRefract_8002247C = .text:0x8002247C; // type:function size:0xE4 scope:global
lbRefract_80022560 = .text:0x80022560; // type:function size:0x74 scope:global
lbRefract_800225D4 = .text:0x800225D4; // type:function size:0x34 scope:global
fn_80022608 = .text:0x80022608; // type:function size:0x48
lbRefract_DObjDispReset = .text:0x80022608; // type:function size:0x48 scope:local
fn_80022650 = .text:0x80022650; // type:function size:0x58
lbRefract_PObjLoad = .text:0x800226A8; // type:function size:0x298 scope:global
fn_80022940 = .text:0x80022940; // type:function size:0x58
Expand Down
2 changes: 1 addition & 1 deletion src/melee/gm/gm_17C0.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ void fn_8017C1A4(HSD_GObj* unused)
gm_SetGameSpeed(0.5f);
lbBgFlash_80020688(temp_r27);
} else if (tmp->x8 == temp_r28) {
lbBgFlash_800205F0();
lbBgFlash_800205F0(temp_r3);
} else if (tmp->x8 >= temp_r29_2) {
lbAudioAx_80028B90();
gm_SetGameSpeed(1.0f);
Expand Down
7 changes: 4 additions & 3 deletions src/melee/lb/lbaudio_ax.c
Original file line number Diff line number Diff line change
Expand Up @@ -808,10 +808,11 @@ int fn_800250A0(int arg0, int arg1, int arg2, int arg3)

/// #fn_800262A0

void fn_800263B4(void* ptr)
/// @brief Free an object from the audio allocator pool.
void lbAudioAx_ObjFree(void* obj)
{
if (ptr != NULL) {
void* p = ptr;
if (obj != NULL) {
void* p = obj;
HSD_ObjFree(&lbl_80433710, p);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/melee/lb/lbaudio_ax.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
/* 025E38 */ bool fn_80025E38(HSD_GObj* gobj);
/* 025FAC */ UNK_RET fn_80025FAC(UNK_PARAMS);
/* 0262A0 */ UNK_RET fn_800262A0(UNK_PARAMS);
/* 0263B4 */ void fn_800263B4(void* ptr);
/* 0263B4 */ void lbAudioAx_ObjFree(void* obj);
/* 0263E8 */ HSD_GObj* lbAudioAx_800263E8(float, HSD_GObj*, int, int, int, int, int, int, int, int, int);
/* 0264E4 */ bool lbAudioAx_800264E4(UNK_T);
/* 026510 */ void lbAudioAx_80026510(HSD_GObj*);
Expand Down
81 changes: 67 additions & 14 deletions src/melee/lb/lbbgflash.c
Original file line number Diff line number Diff line change
@@ -1,21 +1,43 @@
/**
* @file lbbgflash.c
* @brief Background flash effects for dramatic game events.
*
* Provides full-screen color overlay flashes triggered by various game events.
* Called from game mode code (gmallstar.c, gm_17C0.c, gm_1A4C.c, etc).
*/

#include "lbbgflash.h"

#include <placeholder.h>
#include "lb/forward.h"
#include "lb/lb_00F9.h"

typedef struct BgFlashState {
u8 active : 1;
u8 mode : 7;
} BgFlashState;

typedef struct BgFlashData {
BgFlashState state;
u8 pad[3];
int x4;
int x8;
int xC;
} BgFlashData;

extern BgFlashData lbl_80433658;

#include <baselib/gobj.h>
#include <melee/lb/lb_00F9.h>

/* 021A10 */ static void lbBgFlash_80021A10(f32 arg8);
/* 021C18 */ static void fn_80021C18(HSD_GObj* gobj, CommandInfo* cmd, int arg2);

typedef struct lbl_80433658_t {
u8 _0 : 1;
u8 field : 7;
u8 bytes[0x47];
} lbl_80433658_t;
/// @brief Initialize background flash state.
/* 02087C */ void lbBgFlash_InitState(int* duration);

extern s32 lbl_804D3840;
extern s32 lbl_804D3844;
extern lbl_80433658_t lbl_80433658;
extern s32 lbl_804D3848;

typedef struct BgFlashData2 {
u8 state;
Expand Down Expand Up @@ -45,23 +67,39 @@ typedef struct BgFlashData2 {
/// #fn_8001FEC4

/// #fn_800204C8
/// #lbBgFlash_800205F0

/// @brief Trigger background flash.
/// @param duration Flash duration in frames (minimum 1).
void lbBgFlash_800205F0(s32 duration)
{
if (duration < 1) {
duration = 1;
}
lbBgFlash_800206D4(&lbl_804D3848, &lbl_804D3840, duration);
lbl_80433658.state.mode = 0;
}

/// @brief Trigger background flash.
/// @param count Flash duration in frames (minimum 1).
void lbBgFlash_8002063C(int count)
{
if (count < 1) {
count = 1;
}
lbBgFlash_800206D4(&lbl_804D3844, &lbl_804D3840, count);
lbl_80433658.field = 0;
lbl_80433658.state.mode = 0;
}

/// #lbBgFlash_80020688

/// #lbBgFlash_800206D4

/// #fn_8002087C

void lbBgFlash_InitState(int* duration)
{
lbl_80433658.state.active = 0;
lbl_80433658.state.mode = 5;
lbl_80433658.xC = *duration;
}
/// #fn_800208B0

/// #lbBgFlash_800208EC
Expand All @@ -80,7 +118,15 @@ void lbBgFlash_8002063C(int count)

f32 lbl_804D63D8;

void lbBgFlash_80021A10(f32 arg8)
typedef struct {
char pad[0x2C];
void* x2C;
} BgFlashGlobal;

extern BgFlashGlobal* lbl_804D63E0;
extern struct Fighter_804D653C_t* lbl_804D63DC;

static void lbBgFlash_80021A10(f32 arg8)
{
lbl_804D63D8 = arg8;
}
Expand All @@ -89,11 +135,18 @@ void lbBgFlash_80021A10(f32 arg8)

/// #fn_80021B04

void fn_80021C18(HSD_GObj* gobj, CommandInfo* cmd, int arg2) {}
static void fn_80021C18(HSD_GObj* gobj, CommandInfo* cmd, int arg2) {}

/// #fn_80021C1C

/// #lbBgFlash_80021C48
void lbBgFlash_80021C48(u32 arg0, u32 arg1)
{
struct {
u8 unk0[4];
ColorOverlay x4;
}* data = lbl_804D63E0->x2C;
lb_800144C8(&data->x4, lbl_804D63DC, arg0, arg1);
}

void fn_80021C80(HSD_GObj* gobj)
{
Expand Down
14 changes: 9 additions & 5 deletions src/melee/lb/lbbgflash.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* @file lbbgflash.h
* @brief Background flash effects for dramatic game events.
*/

#ifndef GALE01_01FC08
#define GALE01_01FC08

Expand All @@ -9,11 +14,11 @@
/* 01FC08 */ UNK_RET fn_8001FC08(UNK_PARAMS);
/* 01FEC4 */ UNK_RET fn_8001FEC4(UNK_PARAMS);
/* 0204C8 */ void fn_800204C8(void);
/* 0205F0 */ void lbBgFlash_800205F0(void);
/* 02063C */ void lbBgFlash_8002063C(int);
/* 0205F0 */ void lbBgFlash_800205F0(s32 duration);
/* 02063C */ void lbBgFlash_8002063C(int count);
/* 020688 */ void lbBgFlash_80020688(int);
/* 0206D4 */ void lbBgFlash_800206D4(s32*, s32*, int);
/* 02087C */ UNK_RET fn_8002087C(UNK_PARAMS);
/* 0206D4 */ void lbBgFlash_800206D4(void*, s32*, int);
/* 02087C */ void lbBgFlash_InitState(int* duration);
/* 0208B0 */ UNK_RET fn_800208B0(UNK_PARAMS);
/* 0208EC */ UNK_RET lbBgFlash_800208EC(UNK_PARAMS);
/* 0209F4 */ void lbBgFlash_800209F4(void);
Expand All @@ -22,7 +27,6 @@
/* 02113C */ UNK_RET fn_8002113C(UNK_PARAMS);
/* 021410 */ UNK_RET lbBgFlash_80021410(UNK_PARAMS);
/* 0219E4 */ UNK_RET fn_800219E4(UNK_PARAMS);
/* 021A10 */ void lbBgFlash_80021A10(f32);
/* 021A18 */ void lbBgFlash_80021A18(int);
/* 021B04 */ UNK_RET fn_80021B04(UNK_PARAMS);
/* 021C1C */ UNK_RET fn_80021C1C(UNK_PARAMS);
Expand Down
Loading
Loading