effect organization (#745)

* isk + warning patrol

* minor reorg

* effect data union

* structs sorted and dummy structs added

* effect data cleanup + some end funcs

* two more PAL_PTR*

Co-authored-by: HailSanta <Hail2Santa@gmail.com>
This commit is contained in:
HailSanta 2022-08-07 08:42:54 -04:00 committed by GitHub
parent b04187c149
commit ba183f35b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
151 changed files with 2029 additions and 2124 deletions

View File

@ -19,6 +19,10 @@ typedef void NoArgCallback(void*);
#define IMG_PTR u8*
#define PAL_PTR u16*
#define MSG_BIN u8
#define IMG_BIN u8
#define PAL_BIN u16
typedef struct {
u8 r, g, b, a;
} Color_RGBA8;
@ -197,7 +201,7 @@ typedef struct Npc {
/* 0x0AC */ u8 alpha;
/* 0x0AD */ u8 alpha2; ///< Multiplied with Npc::alpha
/* 0x0AE */ char unk_AE[2];
/* 0x0B0 */ s32** extraAnimList;
/* 0x0B0 */ u32** extraAnimList;
/* 0x0B4 */ s8 palSwapType; // 0..4 inclusive
/* 0x0B5 */ s8 palSwapPrevType;
/* 0x0B6 */ s8 dirtyPalettes;
@ -208,7 +212,7 @@ typedef struct Npc {
/* 0x0C0 */ s8 unk_C0;
/* 0x0C1 */ s8 paletteCount;
/* 0x0C2 */ char unk_C2[2];
/* 0x0C4 */ s32* spritePaletteList;
/* 0x0C4 */ PAL_PTR* spritePaletteList;
/* 0x0C8 */ Palette16 localPaletteData[16];
/* 0x2C8 */ Palette16* localPalettes[16];
/* 0x308 */ s16 unk_308;
@ -461,29 +465,7 @@ typedef struct EntityBlueprint {
/* 0x21 */ u8 aabbSize[3];
} EntityBlueprint; // size = 0x24
typedef struct Entity {
/* 0x00 */ s32 flags;
/* 0x04 */ u8 listIndex;
/* 0x05 */ s8 unk_05;
/* 0x06 */ u8 collisionFlags;
/* 0x07 */ s8 collisionTimer;
/* 0x08 */ u8 unk_08;
/* 0x09 */ u8 scriptDelay;
/* 0x0A */ u8 type;
/* 0x0B */ u8 alpha;
/* 0x0C */ Vec3s aabb;
/* 0x12 */ s16 vertexSegment;
/* 0x14 */ s16 virtualModelIndex;
/* 0x16 */ s16 shadowIndex;
/* 0x18 */ s32* scriptReadPos;
/* 0x1C */ EntityCallback updateScriptCallback;
/* 0x20 */ EntityCallback updateMatrixOverride;
/* 0x24 */ Evt* boundScript;
/* 0x28 */ EvtScript* boundScriptBytecode;
/* 0x2C */ s32* savedReadPos[3];
/* 0x38 */ EntityBlueprint* blueprint;
/* 0x3C */ void (*renderSetupFunc)(s32);
/* 0x40 */ union {
typedef union {
s32* any;
struct SaveBlockData* saveBlock;
struct SwitchData* swtch;
@ -508,7 +490,31 @@ typedef struct Entity {
struct TrumpetPlantData* trumpetPlant;
struct MunchlesiaData* munchlesia;
struct ArrowSignData* arrowSign;
} dataBuf;
} EntityData;
typedef struct Entity {
/* 0x00 */ s32 flags;
/* 0x04 */ u8 listIndex;
/* 0x05 */ s8 unk_05;
/* 0x06 */ u8 collisionFlags;
/* 0x07 */ s8 collisionTimer;
/* 0x08 */ u8 unk_08;
/* 0x09 */ u8 scriptDelay;
/* 0x0A */ u8 type;
/* 0x0B */ u8 alpha;
/* 0x0C */ Vec3s aabb;
/* 0x12 */ s16 vertexSegment;
/* 0x14 */ s16 virtualModelIndex;
/* 0x16 */ s16 shadowIndex;
/* 0x18 */ s32* scriptReadPos;
/* 0x1C */ EntityCallback updateScriptCallback;
/* 0x20 */ EntityCallback updateMatrixOverride;
/* 0x24 */ Evt* boundScript;
/* 0x28 */ EvtScript* boundScriptBytecode;
/* 0x2C */ s32* savedReadPos[3];
/* 0x38 */ EntityBlueprint* blueprint;
/* 0x3C */ void (*renderSetupFunc)(s32);
/* 0x40 */ EntityData dataBuf;
/* 0x44 */ void* gfxBaseAddr;
/* 0x48 */ Vec3f position;
/* 0x54 */ Vec3f scale;
@ -1104,8 +1110,8 @@ typedef struct ItemEntity {
/* 0x40 */ s32* sparkleReadPos;
/* 0x44 */ s32 sparkleUnk44;
/* 0x48 */ s32* sparkleSavedPos;
/* 0x4C */ s8* sparkleRaster;
/* 0x50 */ s8* sparklePalette;
/* 0x4C */ IMG_PTR sparkleRaster;
/* 0x50 */ PAL_PTR sparklePalette;
/* 0x54 */ s32 sparkleWidth;
/* 0x58 */ s32 sparkleHeight;
} ItemEntity; // size = 0x5C
@ -1196,10 +1202,10 @@ typedef struct MessagePrintState {
/* 0x53C */ u8 maxLinesPerPage;
/* 0x53D */ char unk_53D[0x3];
/* 0x540 */ f32 sizeScale;
/* 0x544 */ s32* letterBackgroundImg;
/* 0x548 */ s32* letterBackgroundPal;
/* 0x54C */ s32* letterContentImg;
/* 0x550 */ s32* letterContentPal;
/* 0x544 */ IMG_PTR letterBackgroundImg;
/* 0x548 */ PAL_PTR letterBackgroundPal;
/* 0x54C */ IMG_PTR letterContentImg;
/* 0x550 */ PAL_PTR letterContentPal;
/* 0x554 */ char unk_554[0x4];
} MessagePrintState; // size = 0x558
@ -1235,7 +1241,7 @@ typedef struct MessageDrawState {
} MessageDrawState; // size = 0x54
typedef struct MessageCharData {
/* 0x0 */ s8* raster;
/* 0x0 */ IMG_PTR raster;
/* 0x4 */ u8* charWidthTable;
/* 0x8 */ u8 monospaceWidth;
/* 0x9 */ u8 baseHeightOffset;
@ -1260,8 +1266,8 @@ typedef struct MesasgeFontGlyphData {
} MesasgeFontGlyphData; // size = 0xC
typedef struct MessageImageData {
/* 0x00 */ s32* raster;
/* 0x04 */ s32* palette;
/* 0x00 */ IMG_PTR raster;
/* 0x04 */ PAL_PTR palette;
/* 0x08 */ u16 width;
/* 0x0A */ u16 height;
/* 0x0C */ s32 format;
@ -1269,7 +1275,7 @@ typedef struct MessageImageData {
} MessageImageData; // size = 0x14
typedef struct MessageNumber {
/* 0x00 */ s32* rasters;
/* 0x00 */ IMG_PTR rasters;
/* 0x04 */ s8 texSize;
/* 0x05 */ u8 texWidth;
/* 0x06 */ u8 texHeight;
@ -1603,8 +1609,8 @@ typedef struct DecorationTable {
/* 0x6CC */ s8 unk_6CC;
/* 0x6CD */ s8 numPalettes;
/* 0x6CE */ char unk_6CE[2];
/* 0x6D0 */ u16** palettes;
/* 0x6D4 */ s16* unk_6D4[27];
/* 0x6D0 */ PAL_PTR* palettes;
/* 0x6D4 */ PAL_PTR unk_6D4[27];
/* 0x740 */ s16 unk_740;
/* 0x742 */ s16 unk_742;
/* 0x744 */ s16 unk_744;
@ -1623,7 +1629,7 @@ typedef struct DecorationTable {
/* 0x767 */ s8 unk_767;
/* 0x768 */ u8 unk_768;
/* 0x769 */ char unk_769[3];
/* 0x76C */ s16* unk_76C[16];
/* 0x76C */ PAL_PTR unk_76C[16];
/* 0x78C */ char unk_7AC[0x2C];
/* 0x7D8 */ s8 unk_7D8;
/* 0x7D9 */ s8 unk_7D9;
@ -1643,7 +1649,7 @@ typedef struct DecorationTable {
/* 0x8B0 */ struct EffectInstance* unk_8B0[2];
/* 0x8B8 */ s8 decorationType[2];
/* 0x8BA */ u8 unk_8BA[2];
/* 0x8BC */ u8 unk_8BC[2];
/* 0x8BC */ s8 unk_8BC[2];
/* 0x8C0 */ s16 unk_8C0[4];
/* 0x8C6 */ DecorationUnk unk_8C6[2];
} DecorationTable; // size = 0x8E8
@ -1845,8 +1851,8 @@ typedef struct Actor {
} Actor; // size = 0x444
typedef struct BackgroundHeader {
/* 0x00 */ void* raster;
/* 0x04 */ void* palette;
/* 0x00 */ IMG_PTR raster;
/* 0x04 */ PAL_PTR palette;
/* 0x08 */ u16 startX;
/* 0x0A */ u16 startY;
/* 0x0C */ u16 width;
@ -2149,8 +2155,8 @@ typedef struct PartnerActionStatus {
} PartnerActionStatus; // size = 0x360
typedef struct SpriteRasterInfo {
/* 0x00 */ void* raster;
/* 0x04 */ void* defaultPal;
/* 0x00 */ IMG_PTR raster;
/* 0x04 */ PAL_PTR defaultPal;
/* 0x08 */ s32 width;
/* 0x0C */ s32 height;
} SpriteRasterInfo; // size = 0x10
@ -2292,28 +2298,6 @@ typedef struct SpriteShadingProfile {
/* 0xAF */ s8 ambientPower; // ?
} SpriteShadingProfile; // size = 0xB0
typedef struct WattEffectData {
/* 0x00 */ s32 flags;
/* 0x04 */ s32 unk_04;
/* 0x08 */ s32 angle;
/* 0x0C */ s32 unk_0C;
/* 0x10 */ s32 unk_10;
/* 0x14 */ struct EffectInstance* effect1;
/* 0x18 */ struct EffectInstance* effect2;
/* 0x1C */ s32 debuff;
} WattEffectData;
typedef struct UnkStruct1 {
/* 0x00 */ char unk_00[8];
/* 0x08 */ f32 unk_08;
} UnkStruct1;
typedef struct UnkStruct0 {
/* 0x00 */ s32 flags;
/* 0x04 */ char unk_04[8];
/* 0x0C */ UnkStruct1* unk_0C;
} UnkStruct0;
typedef struct FoldImageRecPart {
/* 0x00 */ IMG_PTR raster;
/* 0x04 */ PAL_PTR palette;
@ -2322,12 +2306,13 @@ typedef struct FoldImageRecPart {
/* 0x0C */ s16 xOffset;
/* 0x0E */ s16 yOffset;
/* 0x10 */ u8 opacity; // alpha?
/* 0x11 */ char unk_11[0x7];
/* 0x11 */ char unk_11[3];
/* 0x14 */ Gfx* dlist;
} FoldImageRecPart; // size = 0x18
typedef struct FoldImageRec {
/* 0x00 */ s8* raster;
/* 0x04 */ s8* palette;
/* 0x00 */ IMG_PTR raster;
/* 0x04 */ PAL_PTR palette;
/* 0x08 */ u16 width;
/* 0x0A */ u16 height;
/* 0x0C */ s16 xOffset;

File diff suppressed because it is too large Load Diff

View File

@ -1416,6 +1416,7 @@ enum EncounterOutcomes {
};
enum DecorationIDs {
DECORATION_0 = 0x00000000,
DECORATION_GOLDEN_FLAMES = 0x00000001,
DECORATION_SWEAT = 0x00000002,
DECORATION_SEEING_STARS = 0x00000003,
@ -1424,6 +1425,8 @@ enum DecorationIDs {
DECORATION_FIRE_SMOKE_TRAIL = 0x00000006,
DECORATION_WHIRLWIND = 0x00000007,
DECORATION_STEAM_EMITTER = 0x00000008,
DECORATION_9 = 0x00000009,
DECORATION_A = 0x0000000A,
DECORATION_RADIAL_STAR_EMITTER = 0x0000000B,
};
@ -1569,7 +1572,7 @@ enum Events {
EVENT_RECOVER_STATUS = 0x00000031,
EVENT_32 = 0x00000032,
EVENT_33 = 0x00000033,
EVENT_34 = 0x00000034,
EVENT_RECOVER_PARTNER = 0x00000034,
EVENT_END_FIRST_STRIKE = 0x00000035,
EVENT_LUCKY = 0x00000037,
EVENT_BEGIN_FIRST_STRIKE = 0x00000038,
@ -3780,6 +3783,13 @@ typedef enum FoldType {
FOLD_TYPE_8 = 0x8,
FOLD_TYPE_9 = 0x9,
FOLD_TYPE_A = 0xA,
FOLD_TYPE_B = 0xB,
FOLD_TYPE_C = 0xC,
FOLD_TYPE_D = 0xD,
FOLD_TYPE_E = 0xE,
FOLD_TYPE_F = 0xF,
FOLD_TYPE_10 = 0x10,
FOLD_TYPE_11 = 0x11,
} FoldType;
enum MoveType {

View File

@ -89,7 +89,7 @@ void load_mesh_animator_tree(s32 index, StaticAnimatorNode** tree);
void setup_pause_menu_tab(MenuWindowBP* bpArray, s32 arraySize);
s32 draw_ci_image_with_clipping(s32* raster, s32 width, s32 height, s32 fmt, s32 bitDepth, s32* palette, s16 posX,
s32 draw_ci_image_with_clipping(IMG_PTR raster, s32 width, s32 height, s32 fmt, s32 bitDepth, PAL_PTR palette, s16 posX,
s16 posY, u16 clipULx, u16 clipULy, u16 clipLRx, u16 clipRLy, u8 opacity);
void render_frame(s32 flag);

View File

@ -75,7 +75,8 @@
#define TAU 6.28318f
#define PI_S 3.14159f // Shorter PI
#define SPRITE_WORLD_SCALE 0.71428573f
#define SPRITE_WORLD_SCALE (5.0f/7.0f)
#define SPRITE_WORLD_SCALE_D (5.0/7.0)
#define BATTLE_ENTITY_ID_MASK 0x800

View File

@ -81,10 +81,10 @@ typedef struct ModelTreeInfo {
typedef struct TextureHandle {
/* 0x00 */ Gfx* gfx;
/* 0x04 */ TextureHeader header;
/* 0x34 */ s32* raster;
/* 0x38 */ s32* palette;
/* 0x3C */ s32* auxRaster;
/* 0x40 */ s32* auxPalette;
/* 0x34 */ IMG_PTR raster;
/* 0x38 */ PAL_PTR palette;
/* 0x3C */ IMG_PTR auxRaster;
/* 0x40 */ PAL_PTR auxPalette;
} TextureHandle; // size = 0x44
typedef struct ModelBlueprint {

View File

@ -359,11 +359,11 @@ void init_npc_list(void);
/// Presumably did something once upon a time but got commented out.
void npc_iter_no_op(void);
s32 _create_npc(NpcBlueprint* blueprint, s32** animList, s32 skipLoadingAnims);
s32 _create_npc(NpcBlueprint* blueprint, u32** animList, s32 skipLoadingAnims);
s32 _create_npc_basic(NpcBlueprint* blueprint);
s32 _create_npc_standard(NpcBlueprint* blueprint, s32** animList);
s32 _create_npc_standard(NpcBlueprint* blueprint, u32** animList);
void _create_npc_partner(NpcBlueprint* blueprint);

View File

@ -424,11 +424,11 @@ void btl_state_update_begin_player_turn(void) {
player->koDuration = debuffDuration;
if ((s8) debuffDuration > 0) {
player->koStatus = 0xD;
((DisableXFXData*)player->debuffEffect->data)->unk_3C = player->koDuration;
player->debuffEffect->data.disableX->unk_3C = player->koDuration;
} else if (koDuration != (s8) debuffDuration) {
player->koStatus = 0;
player->koDuration = 0;
((DisableXFXData*)player->debuffEffect->data)->unk_3C = 0;
player->debuffEffect->data.disableX->unk_3C = 0;
}
}
@ -606,15 +606,11 @@ void btl_state_update_begin_partner_turn(void) {
D_8029F254 = 1;
D_8029F258 = 20;
if (partner->koDuration > 0) {
// TODO: We believe these are DebuffFXData*,
// but unk_3C is a u8 for these and we need it to be an s32...
((s32*)(partner->debuffEffect->data))[15] = partner->koDuration;
partner->debuffEffect->data.disableX->unk_3C = partner->koDuration;
} else {
partner->koStatus = 0;
dispatch_event_partner(EVENT_34);
// TODO: We believe these are DebuffFXData*,
// but unk_3C is a u8 for these and we need it to be an s32...
((s32*)(partner->debuffEffect->data))[15] = 0;
dispatch_event_partner(EVENT_RECOVER_PARTNER);
partner->debuffEffect->data.disableX->unk_3C = 0;
gBattleStatus.flags2 |= BS_FLAGS2_8;
}
}
@ -814,7 +810,7 @@ void btl_state_update_victory(void) {
gBattleStatus.flags1 &= ~BS_FLAGS1_8;
if (player->koStatus == STATUS_DAZE) {
dispatch_event_player(EVENT_34);
dispatch_event_player(EVENT_RECOVER_PARTNER);
gBattleState2 = BATTLE_STATE2_PLAYER_DEFEATED;
}
player->debuff = 0;
@ -823,11 +819,11 @@ void btl_state_update_victory(void) {
player->transStatus = 0;
player->koStatus = 0;
player->koDuration = 0;
((DisableXFXData*)player->debuffEffect->data)->unk_3C = 0;
player->debuffEffect->data.disableX->unk_3C = 0;
if (partner != NULL) {
if (partner->koStatus == STATUS_DAZE) {
dispatch_event_partner(EVENT_34);
dispatch_event_partner(EVENT_RECOVER_PARTNER);
gBattleState2 = BATTLE_STATE2_PLAYER_DEFEATED;
}
partner->debuff = 0;
@ -836,7 +832,7 @@ void btl_state_update_victory(void) {
partner->transStatus = 0;
partner->koStatus = 0;
partner->koDuration = 0;
((DisableXFXData*)partner->debuffEffect->data)->unk_3C = 0;
partner->debuffEffect->data.disableX->unk_3C = 0;
}
break;
case BATTLE_STATE2_PLAYER_DEFEATED:
@ -984,7 +980,7 @@ void btl_state_update_end_training_battle(void) {
gBattleStatus.flags2 &= ~BS_FLAGS2_10;
if (player->koStatus == STATUS_DAZE) {
dispatch_event_player(EVENT_34);
dispatch_event_player(EVENT_RECOVER_PARTNER);
gBattleState2 = BATTLE_STATE2_PLAYER_DEFEATED;
}
player->debuff = 0;
@ -993,10 +989,10 @@ void btl_state_update_end_training_battle(void) {
player->transStatus = 0;
player->koStatus = 0;
player->koDuration = 0;
((DisableXFXData*)player->debuffEffect->data)->unk_3C = 0;
player->debuffEffect->data.disableX->unk_3C = 0;
if (partner != NULL) {
if (partner->koStatus == STATUS_DAZE) {
dispatch_event_partner(EVENT_34);
dispatch_event_partner(EVENT_RECOVER_PARTNER);
gBattleState2 = BATTLE_STATE2_PLAYER_DEFEATED;
}
partner->debuff = 0;
@ -1005,7 +1001,7 @@ void btl_state_update_end_training_battle(void) {
partner->transStatus = 0;
partner->koStatus = 0;
partner->koDuration = 0;
((DisableXFXData*)partner->debuffEffect->data)->unk_3C = 0;
partner->debuffEffect->data.disableX->unk_3C = 0;
}
break;
case BATTLE_STATE2_PLAYER_DEFEATED:
@ -1274,7 +1270,7 @@ void btl_state_update_run_away(void) {
player->state.varTable[0] = 100;
}
battleStatus->battlePhase = 3;
script = start_script(PlayerScriptDispatcher, EVT_PRIORITY_A, 0);
script = start_script(&PlayerScriptDispatcher, EVT_PRIORITY_A, 0);
player->takeTurnScript = script;
player->takeTurnID = script->id;
script->owner1.actorID = ACTOR_PLAYER;
@ -1353,7 +1349,7 @@ void btl_state_update_run_away(void) {
switch (gBattleState2) {
case BATTLE_STATE2_UNK_3:
battleStatus->battlePhase = 7;
script = start_script(PlayerScriptDispatcher, EVT_PRIORITY_A, 0);
script = start_script(&PlayerScriptDispatcher, EVT_PRIORITY_A, 0);
player->takeTurnScript = script;
player->takeTurnID = script->id;
script->owner1.actorID = ACTOR_PLAYER;
@ -1410,7 +1406,7 @@ void btl_state_update_defeat(void) {
remove_status_debuff(player->hudElementDataIndex);
player->koStatus = 0;
player->koDuration = 0;
((DisableXFXData*)player->debuffEffect->data)->unk_3C = 0;
player->debuffEffect->data.disableX->unk_3C = 0;
}
btl_cam_use_preset(BTL_CAM_PRESET_25);

View File

@ -1026,7 +1026,7 @@ void btl_delete_actor(Actor* actor) {
remove_effect(actor->debuffEffect);
if (actor->unk_200 != NULL) {
((AttackResultTextFXData*)actor->unk_200->data)->unk_24 = 0;
actor->unk_200->data.attackResultText->unk_24 = 0;
}
battleStatus = &gBattleStatus;
@ -1069,7 +1069,7 @@ void btl_delete_player_actor(Actor* player) {
remove_effect(player->debuffEffect);
if (player->unk_200 != NULL) {
((AttackResultTextFXData*)player->unk_200->data)->unk_24 = 0;
player->unk_200->data.attackResultText->unk_24 = 0;
}
heap_free(movement);

View File

@ -1946,40 +1946,40 @@ void func_8025CEC8(ActorPart* actorPart) {
decorationTable = actorPart->decorationTable;
for (i = 0; i < ARRAY_COUNT(decorationTable->decorationType); i++) {
switch (decorationTable->decorationType[i]) {
case 0:
case DECORATION_0:
func_8025D150(actorPart, i);
break;
case 1:
case DECORATION_GOLDEN_FLAMES:
func_8025D160(actorPart, i);
break;
case 2:
case DECORATION_SWEAT:
func_8025D2B0(actorPart, i);
break;
case 3:
case DECORATION_SEEING_STARS:
func_8025D3CC(actorPart, i);
break;
case 4:
case DECORATION_RED_FLAMES:
func_8025D4C8(actorPart, i);
break;
case 5:
case DECORATION_GREY_SMOKE_TRAIL:
func_8025D640(actorPart, i);
break;
case 6:
case DECORATION_FIRE_SMOKE_TRAIL:
func_8025D71C(actorPart, i);
break;
case 7:
case DECORATION_WHIRLWIND:
func_8025D830(actorPart, i);
break;
case 8:
case DECORATION_STEAM_EMITTER:
func_8025D90C(actorPart, i);
break;
case 9:
case DECORATION_9:
func_8025DA68(actorPart, i);
break;
case 10:
case DECORATION_A:
func_8025DBD0(actorPart, i);
break;
case 11:
case DECORATION_RADIAL_STAR_EMITTER:
func_8025DD60(actorPart, i);
break;
}
@ -1987,45 +1987,44 @@ void func_8025CEC8(ActorPart* actorPart) {
}
}
void _remove_part_decoration(ActorPart* part, s32 decorationIndex) {
DecorationTable* decorationTable = part->decorationTable;
switch (decorationTable->decorationType[decorationIndex]) {
case 0:
case DECORATION_0:
func_8025D158(part, decorationIndex);
break;
case 1:
case DECORATION_GOLDEN_FLAMES:
func_8025D290(part, decorationIndex);
break;
case 2:
case DECORATION_SWEAT:
func_8025D3C4(part, decorationIndex);
break;
case 3:
case DECORATION_SEEING_STARS:
func_8025D4A0(part, decorationIndex);
break;
case 4:
case DECORATION_RED_FLAMES:
func_8025D620(part, decorationIndex);
break;
case 5:
case DECORATION_GREY_SMOKE_TRAIL:
func_8025D6FC(part, decorationIndex);
break;
case 6:
case DECORATION_FIRE_SMOKE_TRAIL:
func_8025D810(part, decorationIndex);
break;
case 7:
case DECORATION_WHIRLWIND:
func_8025D8EC(part, decorationIndex);
break;
case 8:
case DECORATION_STEAM_EMITTER:
func_8025DA60(part, decorationIndex);
break;
case 9:
case DECORATION_9:
func_8025DBC8(part, decorationIndex);
break;
case 10:
case DECORATION_A:
func_8025DD40(part, decorationIndex);
break;
case 11:
case DECORATION_RADIAL_STAR_EMITTER:
func_8025DE88(part, decorationIndex);
break;
}
@ -2039,11 +2038,38 @@ void func_8025D150(ActorPart* actorPart, s32 i) {
void func_8025D158(ActorPart* part, s32 decorationIndex) {
}
// float reg swapping
#ifdef NON_MATCHING
void func_8025D160(ActorPart* arg0, s32 arg1) {
DecorationTable* table = arg0->decorationTable;
EffectInstance* effect;
AuraFXData* data;
switch (table->unk_8BC[arg1]) {
case 0:
fx_aura(3, arg0->currentPos.x, arg0->currentPos.y, arg0->currentPos.z, 0.4f, &table->unk_8B0[arg1]);
table->unk_8BC[arg1] = 1;
table->unk_8C6[arg1].unk00 = 0x28;
table->unk_8C6[arg1].unk02 = 0x28;
table->unk_8C6[arg1].unk04 = 0;
break;
case 1:
effect = table->unk_8B0[arg1];
data = effect->data.aura;
data->posA.x = arg0->currentPos.x + table->unk_8C6[arg1].unk04;
data->posA.y = arg0->currentPos.y;
data->posA.z = arg0->currentPos.z;
effect->data.aura->scale.x = table->unk_8C6[arg1].unk00 / 100.0f;
effect->data.aura->scale.y = table->unk_8C6[arg1].unk02 / 100.0f;
break;
}
}
#else
INCLUDE_ASM(s32, "182B30", func_8025D160);
#endif
void func_8025D290(ActorPart* part, s32 decorationIndex) {
// TODO cast to appropriate struct data type once we know what it is
((s32*) part->decorationTable->unk_8B0[decorationIndex]->data)[11] = 5;
part->decorationTable->unk_8B0[decorationIndex]->data.aura->fadeTime = 5;
}
INCLUDE_ASM(s32, "182B30", func_8025D2B0);
@ -2057,11 +2083,43 @@ void func_8025D4A0(ActorPart* part, s32 decorationIndex) {
remove_effect(part->decorationTable->unk_8B0[decorationIndex]);
}
// float reg swapping
#ifdef NON_MATCHING
void func_8025D4C8(ActorPart* arg0, s32 arg1) {
DecorationTable* decor = arg0->decorationTable;
EffectInstance* effect;
AuraFXData* data;
switch (decor->unk_8BC[arg1]) {
case 0:
fx_aura(1, arg0->currentPos.x, arg0->currentPos.y, arg0->currentPos.z, 0.4f, &decor->unk_8B0[arg1]);
decor->unk_8BC[arg1] = 1;
decor->unk_8C6[arg1].unk00 = 0x28;
decor->unk_8C6[arg1].unk02 = 0x28;
decor->unk_8C6[arg1].unk04 = 0xFF;
decor->unk_8C6[arg1].unk06 = 0;
decor->unk_8C6[arg1].unk08 = 0xFF;
decor->unk_8C6[arg1].unk0A = 0;
decor->unk_8C6[arg1].unk0C = 0;
// fall through
case 1:
effect = decor->unk_8B0[arg1];
data = effect->data.aura;
data->posA.x = arg0->currentPos.x;
data->posA.y = arg0->currentPos.y;
data->posA.z = arg0->currentPos.z + decor->unk_8C6[arg1].unk06;
effect->data.aura->scale.x = decor->unk_8C6[arg1].unk00 / 100.0f;
effect->data.aura->scale.y = decor->unk_8C6[arg1].unk02 / 100.0f;
effect->data.aura->primA = decor->unk_8C6[arg1].unk04;
break;
}
}
#else
INCLUDE_ASM(s32, "182B30", func_8025D4C8);
#endif
void func_8025D620(ActorPart* part, s32 decorationIndex) {
// TODO cast to appropriate struct data type once we know what it is
((s32*) part->decorationTable->unk_8B0[decorationIndex]->data)[11] = 5;
part->decorationTable->unk_8B0[decorationIndex]->data.aura->fadeTime = 5;
}
INCLUDE_ASM(s32, "182B30", func_8025D640);
@ -2095,8 +2153,7 @@ void func_8025DBC8(ActorPart* part, s32 decorationIndex) {
INCLUDE_ASM(s32, "182B30", func_8025DBD0);
void func_8025DD40(ActorPart* part, s32 decorationIndex) {
// TODO cast to appropriate struct data type once we know what it is
((s32*) part->decorationTable->unk_8B0[decorationIndex]->data)[11] = 5;
part->decorationTable->unk_8B0[decorationIndex]->data.aura->fadeTime = 5;
}
INCLUDE_ASM(s32, "182B30", func_8025DD60);

View File

@ -7,8 +7,8 @@ extern HudScript HES_HPDrain;
extern s32 D_8029FB90;
extern f32 D_8029FB94;
extern EffectInstance* D_8029FB98;
extern EffectInstance* D_8029FB9C;
extern EffectInstance* BattleMerleeOrbEffect;
extern EffectInstance* BattleMerleeWaveEffect;
extern s32 D_8029FBA0;
extern s16 D_8029FBA4;
extern s32 D_8029FBA8;
@ -242,7 +242,7 @@ ApiStatus func_802613A8(Evt* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
ApiStatus func_802613BC(Evt* script, s32 isInitialCall) {
ApiStatus PlayBattleMerleeGatherFX(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 var1 = evt_get_variable(script, *args++);
s32 var2 = evt_get_variable(script, *args++);
@ -252,7 +252,7 @@ ApiStatus func_802613BC(Evt* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
ApiStatus func_80261478(Evt* script, s32 isInitialCall) {
ApiStatus PlayBattleMerleeOrbFX(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 var1 = evt_get_variable(script, *args++);
s32 var2 = evt_get_variable(script, *args++);
@ -262,7 +262,7 @@ ApiStatus func_80261478(Evt* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
ApiStatus func_80261530(Evt* script, s32 isInitialCall) {
ApiStatus BattleMerleeFadeStageToBlack(Evt* script, s32 isInitialCall) {
if (isInitialCall) {
mdl_set_all_fog_mode(1);
*D_801512F0 = 1;
@ -271,13 +271,16 @@ ApiStatus func_80261530(Evt* script, s32 isInitialCall) {
}
set_background_color_blend(0, 0, 0, ((25 - script->functionTemp[0]) * 10) & 0xFE);
script->functionTemp[0]--;
do {} while(0); // TODO required to match
return (script->functionTemp[0] == 0) * ApiStatus_DONE2;
if (script->functionTemp[0] == 0) {
return ApiStatus_DONE2;
} else {
return ApiStatus_BLOCK;
}
}
ApiStatus func_802615C8(Evt* script, s32 isInitialCall) {
ApiStatus BattleMerleeFadeStageFromBlack(Evt* script, s32 isInitialCall) {
if (isInitialCall) {
script->functionTemp[0] = 25;
}
@ -293,7 +296,7 @@ ApiStatus func_802615C8(Evt* script, s32 isInitialCall) {
return ApiStatus_BLOCK;
}
ApiStatus func_80261648(Evt* script, s32 isInitialCall) {
ApiStatus BattleFadeInMerlee(Evt* script, s32 isInitialCall) {
Npc* merlee = get_npc_unsafe(NPC_BTL_MERLEE);
if (isInitialCall) {
@ -310,7 +313,7 @@ ApiStatus func_80261648(Evt* script, s32 isInitialCall) {
return ApiStatus_BLOCK;
}
ApiStatus func_802616B4(Evt* script, s32 isInitialCall) {
ApiStatus BattleFadeOutMerlee(Evt* script, s32 isInitialCall) {
Npc* merlee = get_npc_unsafe(NPC_BTL_MERLEE);
merlee->alpha -= 17;
@ -322,15 +325,15 @@ ApiStatus func_802616B4(Evt* script, s32 isInitialCall) {
return ApiStatus_BLOCK;
}
ApiStatus func_802616F4(Evt* script, s32 isInitialCall) {
ApiStatus BattleMerleeUpdateFX(Evt* script, s32 isInitialCall) {
Npc* merlee = get_npc_unsafe(NPC_BTL_MERLEE);
EffectInstanceData* effectInstanceData;
EnergyOrbWaveFXData* data;
if (isInitialCall) {
script->functionTemp[1] = 0;
D_8029FB94 = merlee->pos.y;
D_8029FB98 = fx_energy_orb_wave(0, merlee->pos.x, merlee->pos.y, merlee->pos.z, 0.4f, 0);
D_8029FB9C = fx_energy_orb_wave(3, merlee->pos.x, merlee->pos.y, merlee->pos.z, 0.00001f, 0);
BattleMerleeOrbEffect = fx_energy_orb_wave(0, merlee->pos.x, merlee->pos.y, merlee->pos.z, 0.4f, 0);
BattleMerleeWaveEffect = fx_energy_orb_wave(3, merlee->pos.x, merlee->pos.y, merlee->pos.z, 0.00001f, 0);
D_8029FBA4 = 0;
D_8029FB90 = 12;
sfx_play_sound(SOUND_2074);
@ -340,37 +343,37 @@ ApiStatus func_802616F4(Evt* script, s32 isInitialCall) {
script->functionTemp[1] += 10;
script->functionTemp[1] = clamp_angle(script->functionTemp[1]);
effectInstanceData = D_8029FB98->data;
effectInstanceData->pos.x = merlee->pos.x;
effectInstanceData->pos.y = merlee->pos.y + 16.0f;
effectInstanceData->pos.z = merlee->pos.z;
data = BattleMerleeOrbEffect->data.energyOrbWave;
data->pos.x = merlee->pos.x;
data->pos.y = merlee->pos.y + 16.0f;
data->pos.z = merlee->pos.z;
effectInstanceData = D_8029FB9C->data;
effectInstanceData->pos.x = merlee->pos.x;
effectInstanceData->pos.y = merlee->pos.y + 16.0f;
effectInstanceData->pos.z = merlee->pos.z + 5.0f;
data = BattleMerleeWaveEffect->data.energyOrbWave;
data->pos.x = merlee->pos.x;
data->pos.y = merlee->pos.y + 16.0f;
data->pos.z = merlee->pos.z + 5.0f;
if (D_8029FBA4 == 2) {
((EffectInstanceData*)D_8029FB98->data)->unk_30 = 0.00001f;
((EffectInstanceData*)D_8029FB9C->data)->unk_30 = 0.00001f;
D_8029FB98->flags |= 0x10;
D_8029FB9C->flags |= 0x10;
BattleMerleeOrbEffect->data.energyOrbWave->scale = 0.00001f;
BattleMerleeWaveEffect->data.energyOrbWave->scale = 0.00001f;
BattleMerleeOrbEffect->flags |= 0x10;
BattleMerleeWaveEffect->flags |= 0x10;
return ApiStatus_DONE1;
}
if (D_8029FBA4 == 1) {
effectInstanceData = D_8029FB98->data;
effectInstanceData->unk_30 += 0.35;
if (effectInstanceData->unk_30 > 3.5) {
effectInstanceData->unk_30 = 3.5f;
data = BattleMerleeOrbEffect->data.energyOrbWave;
data->scale += 0.35;
if (data->scale > 3.5) {
data->scale = 3.5f;
}
if (D_8029FB90 != 0) {
D_8029FB90--;
} else {
effectInstanceData = D_8029FB9C->data;
effectInstanceData->unk_30 += 0.5;
if (effectInstanceData->unk_30 > 5.0) {
data = BattleMerleeWaveEffect->data.energyOrbWave;
data->scale += 0.5;
if (data->scale > 5.0) {
D_8029FBA4 = 2;
}
}

View File

@ -1676,7 +1676,7 @@ s32 inflict_status(Actor* target, s32 statusTypeKey, s32 duration) {
if (target->debuff != statusTypeKey) {
target->status = statusTypeKey;
}
((DisableXFXData*)target->debuffEffect->data)->unk_3C = 0;
target->debuffEffect->data.disableX->unk_3C = 0;
target->debuff = statusTypeKey;
target->debuffDuration = duration;
if ((s8)duration > 9) {
@ -1796,68 +1796,67 @@ s32 get_defense(Actor* actor, s32* defenseTable, s32 elementFlags) {
s32 minDefense = 255;
if (defenseTable != NULL) {
if (elementFlags & 2) {
if (elementFlags & DAMAGE_TYPE_FIRE) {
defense = lookup_defense(defenseTable, ELEMENT_FIRE);
if (defense < minDefense) {
minDefense = defense;
}
}
if (elementFlags & 4) {
if (elementFlags & DAMAGE_TYPE_WATER) {
defense = lookup_defense(defenseTable, ELEMENT_WATER);
if (defense < minDefense) {
minDefense = defense;
}
}
if (elementFlags & 8) {
if (elementFlags & DAMAGE_TYPE_ICE) {
defense = lookup_defense(defenseTable, ELEMENT_ICE);
if (defense < minDefense) {
minDefense = defense;
}
}
// ELEMENT_MYSTERY missing?
if (elementFlags & 0x10) {
if (elementFlags & DAMAGE_TYPE_MAGIC) {
defense = lookup_defense(defenseTable, ELEMENT_MAGIC);
if (defense < minDefense) {
minDefense = defense;
}
}
if (elementFlags & 0x40) {
if (elementFlags & DAMAGE_TYPE_SMASH) {
defense = lookup_defense(defenseTable, ELEMENT_HAMMER);
if (defense < minDefense) {
minDefense = defense;
}
}
if (elementFlags & 0x80) {
if (elementFlags & DAMAGE_TYPE_JUMP) {
defense = lookup_defense(defenseTable, ELEMENT_JUMP);
if (defense < minDefense) {
minDefense = defense;
}
}
if (elementFlags & 0x100) {
if (elementFlags & DAMAGE_TYPE_COSMIC) {
defense = lookup_defense(defenseTable, ELEMENT_COSMIC);
if (defense < minDefense) {
minDefense = defense;
}
}
if (elementFlags & 0x200) {
if (elementFlags & DAMAGE_TYPE_BLAST) {
defense = lookup_defense(defenseTable, ELEMENT_BLAST);
if (defense < minDefense) {
minDefense = defense;
}
}
if (elementFlags & 0x20) {
if (elementFlags & DAMAGE_TYPE_ELECTRIC) {
defense = lookup_defense(defenseTable, ELEMENT_SHOCK);
if (defense < minDefense) {
minDefense = defense;
}
}
if (elementFlags & 0x800) {
if (elementFlags & DAMAGE_TYPE_QUAKE) {
defense = lookup_defense(defenseTable, ELEMENT_QUAKE);
if (defense < minDefense) {
minDefense = defense;
}
}
if (elementFlags & 0x40000) {
if (elementFlags & DAMAGE_TYPE_THROW) {
defense = lookup_defense(defenseTable, ELEMENT_THROW);
if (defense < minDefense) {
minDefense = defense;
@ -1873,7 +1872,7 @@ s32 get_defense(Actor* actor, s32* defenseTable, s32 elementFlags) {
}
}
if (elementFlags & 0x8000000) { // "ignore defense" flag
if (elementFlags & DAMAGE_TYPE_IGNORE_DEFENSE) {
if (minDefense == 99) {
// Immune
minDefense = 999;
@ -1896,8 +1895,7 @@ void func_802664DC(f32 x, f32 y, f32 z, s32 attack, s32 a) {
if (i > 0) {
i = 0;
// TODO use actual effect instance struct when we know what it is
((s32*)gDamageCountEffects[i]->data)[12] = 5;
gDamageCountEffects[i]->data.damageIndicator->effectDurationTimer = 5;
gDamageCountEffects[i] = NULL;
}
@ -1922,8 +1920,7 @@ void show_damage_popup(f32 x, f32 y, f32 z, s32 attack, s32 a) {
if (i > ARRAY_COUNT(gDamageCountEffects) - 1) {
i = 0;
// TODO use actual effect instance struct when we know what it is
((s32*)gDamageCountEffects[i]->data)[12] = 5;
gDamageCountEffects[i]->data.damageIndicator->effectDurationTimer = 5;
gDamageCountEffects[i] = NULL;
}
@ -1944,8 +1941,7 @@ void func_80266684(void) {
if (gDamageCountEffects[i] != NULL) {
gDamageCountTimers[i]--;
if (gDamageCountTimers[i] == 0) {
// TODO use actual effect instance struct when we know what it is
((s32**)gDamageCountEffects[i])[3][12] = 5;
gDamageCountEffects[i]->data.damageIndicator->effectDurationTimer = 5;
gDamageCountEffects[i] = NULL;
}
}
@ -2070,12 +2066,12 @@ void func_80266978(void) {
if (actor != NULL) {
if (actor->unk_205 == 0x3C) {
if (actor->unk_200 != 0) {
((AttackResultTextFXData*)actor->unk_200->data)->unk_24 = 0;
actor->unk_200->data.attackResultText->unk_24 = 0;
}
}
if (actor->unk_205 == 5) {
if (actor->unk_200 != 0) {
((AttackResultTextFXData*)actor->unk_200->data)->unk_18 = 0;
actor->unk_200->data.attackResultText->unk_18 = 0;
actor->unk_200 = NULL;
}
}
@ -2089,12 +2085,12 @@ void func_80266978(void) {
if (actor != NULL) {
if (actor->unk_205 == 60) {
if (actor->unk_200 != NULL) {
((AttackResultTextFXData*)actor->unk_200->data)->unk_24 = 0;
actor->unk_200->data.attackResultText->unk_24 = 0;
}
}
if (actor->unk_205 == 5) {
if (actor->unk_200 != NULL) {
((AttackResultTextFXData*)actor->unk_200->data)->unk_18 = 0;
actor->unk_200->data.attackResultText->unk_18 = 0;
actor->unk_200 = NULL;
}
}
@ -2107,12 +2103,12 @@ void func_80266978(void) {
if (actor != NULL) {
if (actor->unk_205 == 60) {
if (actor->unk_200 != NULL) {
((AttackResultTextFXData*)actor->unk_200->data)->unk_24 = 0;
actor->unk_200->data.attackResultText->unk_24 = 0;
}
}
if (actor->unk_205 == 5) {
if (actor->unk_200 != NULL) {
((AttackResultTextFXData*)actor->unk_200->data)->unk_18 = 0;
actor->unk_200->data.attackResultText->unk_18 = 0;
actor->unk_200 = NULL;
}
}
@ -2524,7 +2520,7 @@ void btl_update_ko_status(void) {
player->koDuration = player->debuffDuration;
if (player->koDuration > 0) {
player->koStatus = STATUS_DAZE;
((DisableXFXData*)player->debuffEffect->data)->unk_3C = player->koDuration;
player->debuffEffect->data.disableX->unk_3C = player->koDuration;
if (koDuration == 0) {
sfx_play_sound(SOUND_2107);
@ -2539,7 +2535,7 @@ void btl_update_ko_status(void) {
if (partner->koDuration > 0) {
partner->koStatus = STATUS_DAZE;
((DisableXFXData*)partner->debuffEffect->data)->unk_3C = partner->koDuration;
partner->debuffEffect->data.disableX->unk_3C = partner->koDuration;
}
}
@ -2550,7 +2546,7 @@ void btl_update_ko_status(void) {
enemy->koDuration = enemy->debuffDuration;
if (enemy->koDuration > 0) {
enemy->koStatus = STATUS_DAZE;
((DisableXFXData*)enemy->debuffEffect->data)->unk_3C = enemy->koDuration;
enemy->debuffEffect->data.disableX->unk_3C = enemy->koDuration;
}
}
}

View File

@ -18,36 +18,36 @@ ApiStatus func_80271258(Evt* script, s32 isInitialCall) {
ApiStatus func_802712A0(Evt* script, s32 isInitialCall) {
EffectInstance* debuffEffect = fx_debuff(2, script->varTable[0], script->varTable[1], script->varTable[2]);
((DebuffFXData*)debuffEffect->data)->unk_38 = 200;
((DebuffFXData*)debuffEffect->data)->unk_39 = 120;
((DebuffFXData*)debuffEffect->data)->unk_3A = 0;
((DebuffFXData*)debuffEffect->data)->unk_3B = 234;
((DebuffFXData*)debuffEffect->data)->unk_3C = 193;
((DebuffFXData*)debuffEffect->data)->unk_3D = 0;
debuffEffect->data.debuff->unk_38 = 200;
debuffEffect->data.debuff->unk_39 = 120;
debuffEffect->data.debuff->unk_3A = 0;
debuffEffect->data.debuff->unk_3B = 234;
debuffEffect->data.debuff->unk_3C = 193;
debuffEffect->data.debuff->unk_3D = 0;
return ApiStatus_DONE2;
}
ApiStatus func_80271328(Evt* script, s32 isInitialCall) {
EffectInstance* debuffEffect = fx_debuff(2, script->varTable[0], script->varTable[1], script->varTable[2]);
((DebuffFXData*)debuffEffect->data)->unk_38 = 60;
((DebuffFXData*)debuffEffect->data)->unk_39 = 160;
((DebuffFXData*)debuffEffect->data)->unk_3A = 0;
((DebuffFXData*)debuffEffect->data)->unk_3B = 90;
((DebuffFXData*)debuffEffect->data)->unk_3C = 240;
((DebuffFXData*)debuffEffect->data)->unk_3D = 0;
debuffEffect->data.debuff->unk_38 = 60;
debuffEffect->data.debuff->unk_39 = 160;
debuffEffect->data.debuff->unk_3A = 0;
debuffEffect->data.debuff->unk_3B = 90;
debuffEffect->data.debuff->unk_3C = 240;
debuffEffect->data.debuff->unk_3D = 0;
return ApiStatus_DONE2;
}
ApiStatus func_802713B0(Evt* script, s32 isInitialCall) {
EffectInstance* debuffEffect = fx_debuff(2, script->varTable[0], script->varTable[1], script->varTable[2]);
((DebuffFXData*)debuffEffect->data)->unk_38 = 205;
((DebuffFXData*)debuffEffect->data)->unk_39 = 0;
((DebuffFXData*)debuffEffect->data)->unk_3A = 40;
((DebuffFXData*)debuffEffect->data)->unk_3B = 205;
((DebuffFXData*)debuffEffect->data)->unk_3C = 32;
((DebuffFXData*)debuffEffect->data)->unk_3D = 242;
debuffEffect->data.debuff->unk_38 = 205;
debuffEffect->data.debuff->unk_39 = 0;
debuffEffect->data.debuff->unk_3A = 40;
debuffEffect->data.debuff->unk_3B = 205;
debuffEffect->data.debuff->unk_3C = 32;
debuffEffect->data.debuff->unk_3D = 242;
return ApiStatus_DONE2;
}

View File

@ -2593,7 +2593,7 @@ ApiStatus ClearStatusEffects(Evt* script, s32 isInitialCall) {
actor->koStatus = 0;
actor->koDuration = 0;
((DisableXFXData*)actor->debuffEffect->data)->unk_3C = 0;
actor->debuffEffect->data.disableX->unk_3C = 0;
actor->attackBoost = 0;
actor->defenseBoost = 0;
actor->isGlowing = 0;

View File

@ -23,9 +23,9 @@ ApiStatus AddEffectOffset(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
EffectInstance* effect = (EffectInstance*) evt_get_variable(script, *args++);
((EffectInstanceData*)effect->data)->pos.x += evt_get_variable(script, *args++);
((EffectInstanceData*)effect->data)->pos.y += evt_get_variable(script, *args++);
((EffectInstanceData*)effect->data)->pos.z += evt_get_variable(script, *args++);
effect->data.flashingBoxShockwave->pos.x += evt_get_variable(script, *args++);
effect->data.flashingBoxShockwave->pos.y += evt_get_variable(script, *args++);
effect->data.flashingBoxShockwave->pos.z += evt_get_variable(script, *args++);
return ApiStatus_DONE2;
}

View File

@ -11,8 +11,8 @@ extern s8 D_8009A654;
extern s16 D_8009A668;
extern s32 D_800A0BA0;
extern f32 D_800A0BA4;
extern EffectInstance* D_800A0BA8;
extern EffectInstance* D_800A0BAC;
extern EffectInstance* WorldMerleeOrbEffect;
extern EffectInstance* WorldMerleeWaveEffect;
s32 get_defeated(s32 mapID, s32 encounterID) {
EncounterStatus* currentEncounter = &gCurrentEncounter;
@ -45,14 +45,24 @@ ApiStatus ShowMerleeCoinMessage(Evt* script, s32 isInitialCall) {
if (isInitialCall) {
show_merlee_message(0, 60);
}
return (is_merlee_message_done() == 0) * ApiStatus_DONE2;
if (is_merlee_message_done()) {
return ApiStatus_BLOCK;
} else {
return ApiStatus_DONE2;
}
}
ApiStatus ShowMerleeRanOutMessage(Evt* script, s32 isInitialCall) {
if (isInitialCall) {
show_merlee_message(1, 60);
}
return (is_merlee_message_done() == 0) * ApiStatus_DONE2;
if (is_merlee_message_done()) {
return ApiStatus_BLOCK;
} else {
return ApiStatus_DONE2;
}
}
ApiStatus FadeBackgroundToBlack(Evt* script, s32 isInitialCall) {
@ -65,12 +75,12 @@ ApiStatus FadeBackgroundToBlack(Evt* script, s32 isInitialCall) {
set_background_color_blend(0, 0, 0, ((25 - script->functionTemp[0]) * 10) & 254);
script->functionTemp[0]--;
do {} while (0);
if (script->functionTemp[0] == 0) {
return ApiStatus_DONE2;
}
} else {
return ApiStatus_BLOCK;
}
}
ApiStatus UnfadeBackgroundFromBlack(Evt* script, s32 isInitialCall) {
@ -102,8 +112,9 @@ ApiStatus FadeInMerlee(Evt* script, s32 isInitialCall) {
if ((u32)(npc->alpha & 0xFF) >= 0xFF) {
npc->alpha = 0xFF;
return ApiStatus_DONE1;
}
} else {
return ApiStatus_BLOCK;
}
}
ApiStatus FadeOutMerlee(Evt* script, s32 isInitialCall) {
@ -113,21 +124,21 @@ ApiStatus FadeOutMerlee(Evt* script, s32 isInitialCall) {
if (npc->alpha == 0) {
npc->alpha = 0;
return ApiStatus_DONE1;
}
} else {
return ApiStatus_BLOCK;
}
}
// same as func_802616F4 aside from syms
// same as BattleMerleeUpdateFX aside from syms
ApiStatus MerleeUpdateFX(Evt* script, s32 isInitialCall) {
Npc* merlee = get_npc_unsafe(NPC_BTL_MERLEE);
EffectInstanceData* effectInstanceData;
EnergyOrbWaveFXData* effectData;
if (isInitialCall) {
script->functionTemp[1] = 0;
D_800A0BA4 = merlee->pos.y;
D_800A0BA8 = fx_energy_orb_wave(0, merlee->pos.x, merlee->pos.y, merlee->pos.z, 0.4f, 0);
D_800A0BAC = fx_energy_orb_wave(3, merlee->pos.x, merlee->pos.y, merlee->pos.z, 0.00001f, 0);
WorldMerleeOrbEffect = fx_energy_orb_wave(0, merlee->pos.x, merlee->pos.y, merlee->pos.z, 0.4f, 0);
WorldMerleeWaveEffect = fx_energy_orb_wave(3, merlee->pos.x, merlee->pos.y, merlee->pos.z, 0.00001f, 0);
D_800A0BB8 = 0;
D_800A0BA0 = 12;
sfx_play_sound(SOUND_2074);
@ -138,37 +149,37 @@ ApiStatus MerleeUpdateFX(Evt* script, s32 isInitialCall) {
script->functionTemp[1] += 10;
script->functionTemp[1] = clamp_angle(script->functionTemp[1]);
effectInstanceData = D_800A0BA8->data;
effectInstanceData->pos.x = merlee->pos.x;
effectInstanceData->pos.y = merlee->pos.y + 16.0f;
effectInstanceData->pos.z = merlee->pos.z;
effectData = WorldMerleeOrbEffect->data.energyOrbWave;
effectData->pos.x = merlee->pos.x;
effectData->pos.y = merlee->pos.y + 16.0f;
effectData->pos.z = merlee->pos.z;
effectInstanceData = D_800A0BAC->data;
effectInstanceData->pos.x = merlee->pos.x;
effectInstanceData->pos.y = merlee->pos.y + 16.0f;
effectInstanceData->pos.z = merlee->pos.z + 5.0f;
effectData = WorldMerleeWaveEffect->data.energyOrbWave;
effectData->pos.x = merlee->pos.x;
effectData->pos.y = merlee->pos.y + 16.0f;
effectData->pos.z = merlee->pos.z + 5.0f;
if (D_800A0BB8 == 2) {
((EffectInstanceData*)D_800A0BA8->data)->unk_30 = 0.00001f;
((EffectInstanceData*)D_800A0BAC->data)->unk_30 = 0.00001f;
D_800A0BA8->flags |= EFFECT_INSTANCE_FLAGS_10;
D_800A0BAC->flags |= EFFECT_INSTANCE_FLAGS_10;
WorldMerleeOrbEffect->data.energyOrbWave->scale = 0.00001f;
WorldMerleeWaveEffect->data.energyOrbWave->scale = 0.00001f;
WorldMerleeOrbEffect->flags |= EFFECT_INSTANCE_FLAGS_10;
WorldMerleeWaveEffect->flags |= EFFECT_INSTANCE_FLAGS_10;
return ApiStatus_DONE1;
}
if (D_800A0BB8 == 1) {
effectInstanceData = D_800A0BA8->data;
effectInstanceData->unk_30 += 0.35;
if (effectInstanceData->unk_30 > 3.5) {
effectInstanceData->unk_30 = 3.5f;
effectData = WorldMerleeOrbEffect->data.energyOrbWave;
effectData->scale += 0.35;
if (effectData->scale > 3.5) {
effectData->scale = 3.5f;
}
if (D_800A0BA0 != 0) {
D_800A0BA0--;
} else {
effectInstanceData = D_800A0BAC->data;
effectInstanceData->unk_30 += 0.5;
if (effectInstanceData->unk_30 > 5.0) {
effectData = WorldMerleeWaveEffect->data.energyOrbWave;
effectData->scale += 0.5;
if (effectData->scale > 5.0) {
D_800A0BB8 = 2;
}
}

View File

@ -392,7 +392,7 @@ void set_action_state(s32 actionState) {
}
if (playerStatus->unk_D8 != NULL) {
((Effect46FXData*)playerStatus->unk_D8->data)->unk_24 = 10;
playerStatus->unk_D8->data.unk_46->unk_24 = 10;
playerStatus->unk_D8 = NULL;
}
}

View File

@ -46,7 +46,7 @@ void func_801356C4(ItemEntity*);
void func_801356CC(ItemEntity*);
void func_801356D4(ItemEntity*);
void update_item_entity_temp(ItemEntity*);
s32 draw_image_with_clipping(s32* raster, s32 width, s32 height, s32 fmt, s32 bitDepth, s16 posX, s16 posY, u16 clipULx,
s32 draw_image_with_clipping(IMG_PTR raster, s32 width, s32 height, s32 fmt, s32 bitDepth, s16 posX, s16 posY, u16 clipULx,
u16 clipULy, u16 clipLRx, u16 clipRLy);
void func_8013673C(ItemEntity* itemEntity, s32 posX, s32 posY);
void func_801369D0(ItemEntity* itemEntity, s32 posX, s32 posY);
@ -101,7 +101,7 @@ Lights1 D_8014C6C8 = gdSPDefLights1(255, 255, 255, 0, 0, 0, 0, 0, 0);
s16 D_8014C6E0[] = { 32, 40 };
s16 D_8014C6E4[] = { 8, 4 };
s32 draw_ci_image_with_clipping(s32* raster, s32 width, s32 height, s32 fmt, s32 bitDepth, s32* palette, s16 posX,
s32 draw_ci_image_with_clipping(IMG_PTR raster, s32 width, s32 height, s32 fmt, s32 bitDepth, PAL_PTR palette, s16 posX,
s16 posY, u16 clipULx, u16 clipULy, u16 clipLRx, u16 clipRLy, u8 opacity) {
s32 ret;
@ -180,8 +180,8 @@ s32 sparkle_script_step(ItemEntity* itemEntity) {
return TRUE;
case SPARKLE_OP_SetCI:
itemEntity->sparkleNextUpdate = *readPos++;
itemEntity->sparkleRaster = (s8*)*readPos++;
itemEntity->sparklePalette = (s8*)*readPos++;
itemEntity->sparkleRaster = (IMG_PTR)*readPos++;
itemEntity->sparklePalette = (PAL_PTR)*readPos++;
itemEntity->sparkleWidth = *readPos++;
itemEntity->sparkleHeight = *readPos++;
itemEntity->sparkleReadPos = readPos;

View File

@ -12,11 +12,11 @@
ApiStatus func_80240344_EC74F4(Evt* script, s32 isInitialCall) {
EffectInstance* effect = fx_misc_particles(3, -272.0f, 80.0f, 20.0f, 200.0f, 120.0f, 4.0f, 8, 0);
((MiscParticlesFXData*)effect->data)->unk_38 = 240;
((MiscParticlesFXData*)effect->data)->unk_3C = 240;
((MiscParticlesFXData*)effect->data)->unk_40 = 240;
((MiscParticlesFXData*)effect->data)->unk_48 = 230;
((MiscParticlesFXData*)effect->data)->unk_4C = 230;
((MiscParticlesFXData*)effect->data)->unk_50 = 240;
effect->data.miscParticles->unk_38 = 240;
effect->data.miscParticles->unk_3C = 240;
effect->data.miscParticles->unk_40 = 240;
effect->data.miscParticles->unk_48 = 230;
effect->data.miscParticles->unk_4C = 230;
effect->data.miscParticles->unk_50 = 240;
return ApiStatus_DONE2;
}

View File

@ -392,7 +392,7 @@ Gfx D_8014B400[21][5] = {
},
};
u32 mdl_textureBaseAddress = 0x8028E000;
void* mdl_textureBaseAddress = 0x8028E000;
u8 mdl_bgMultiplyColorA = 0;
u8 mdl_bgMultiplyColorR = 0;
@ -1063,7 +1063,7 @@ extern s32 texPannerMainU[MAX_TEX_PANNERS];
extern s32 texPannerMainV[MAX_TEX_PANNERS];
extern s32 texPannerAuxU[MAX_TEX_PANNERS];
extern s32 texPannerAuxV[MAX_TEX_PANNERS];
extern u8* mdl_nextTextureAddress;
extern void* mdl_nextTextureAddress;
extern u16 mdl_currentTransformGroupChildIndex;
extern u16 D_80153226;
extern ModelNode* D_80153370;
@ -2971,9 +2971,9 @@ void appendGfx_model(Model* model);
INCLUDE_ASM(void, "a5dd0_len_114e0", appendGfx_model, Model*);
void func_80114B58(u32 romOffset, TextureHandle* handle, TextureHeader* header, s32 mainSize, s32 mainPalSize, s32 auxSize, s32 auxPalSize) {
handle->raster = (u32*) mdl_nextTextureAddress;
handle->raster = (IMG_PTR) mdl_nextTextureAddress;
if (mainPalSize != 0) {
handle->palette = (u32*) (mdl_nextTextureAddress + mainSize);
handle->palette = (PAL_PTR) (mdl_nextTextureAddress + mainSize);
} else {
handle->palette = NULL;
}
@ -2981,9 +2981,9 @@ void func_80114B58(u32 romOffset, TextureHandle* handle, TextureHeader* header,
romOffset += mainSize + mainPalSize;
mdl_nextTextureAddress += mainSize + mainPalSize;
if (auxSize != 0) {
handle->auxRaster = (u32*) mdl_nextTextureAddress;
handle->auxRaster = (IMG_PTR) mdl_nextTextureAddress;
if (auxPalSize != 0) {
handle->auxPalette = (u32*) (mdl_nextTextureAddress + auxSize);
handle->auxPalette = (PAL_PTR) (mdl_nextTextureAddress + auxSize);
} else {
handle->auxPalette = NULL;
}

View File

@ -151,10 +151,10 @@ ApiStatus func_80218680_4FF0D0(Evt* script, s32 isInitialCall) {
s32 z = evt_get_variable(script, *args++);
f32 scale = evt_get_float_variable(script, *args++);
((Effect6BFXData*)effect->data)->pos.x = x;
((Effect6BFXData*)effect->data)->pos.y = y;
((Effect6BFXData*)effect->data)->pos.z = z;
((Effect6BFXData*)effect->data)->scale = scale;
effect->data.energyInOut->pos.x = x;
effect->data.energyInOut->pos.y = y;
effect->data.energyInOut->pos.z = z;
effect->data.energyInOut->scale = scale;
return ApiStatus_DONE2;
}

View File

@ -229,9 +229,9 @@ ApiStatus func_8021875C_4EFBFC(Evt* script, s32 isInitialCall) {
s32 var3 = evt_get_variable(script, *args++);
EffectInstance* effect = fx_floating_rock(2, var1, 150.0f, var3, var2, -0.5f, -0.9f, 0.5f, 60);
((EffectInstanceData*)effect->data)->unk_30 = 0;
((EffectInstanceData*)effect->data)->unk_38 = 0;
((EffectInstanceData*)effect->data)->unk_34 = 0;
effect->data.floatingRock->unk_30.x = 0;
effect->data.floatingRock->unk_30.z = 0;
effect->data.floatingRock->unk_30.y = 0;
return ApiStatus_DONE2;
}

View File

@ -12,17 +12,17 @@
ApiStatus func_80218BC4_6BC754(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
UnkStruct0* unkStruct0 = (UnkStruct0*)evt_get_variable(script, *args++);
EffectInstance* tattleEffect = (EffectInstance*) evt_get_variable(script, *args++);
unkStruct0->unk_0C->unk_08 = -1000.0f;
tattleEffect->data.tattleWindow->pos.y = -1000.0f;
return ApiStatus_DONE2;
}
ApiStatus func_80218BFC_6BC78C(Evt* script, s32 isInitialCall) {
UnkStruct0* unkStruct0 = (UnkStruct0*)evt_get_variable(script, *script->ptrReadPos);
EffectInstance* tattleEffect = (EffectInstance*) evt_get_variable(script, *script->ptrReadPos);
unkStruct0->unk_0C->unk_08 = 144.0f;
unkStruct0->flags |= 0x10;
tattleEffect->data.tattleWindow->pos.y = 144.0f;
tattleEffect->flags |= EFFECT_INSTANCE_FLAGS_10;
return ApiStatus_DONE2;
}

View File

@ -922,17 +922,17 @@ EvtScript N(8021F6E0) = {
ApiStatus func_80218DF4_465284(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
UnkStruct0* unkStruct0 = (UnkStruct0*)evt_get_variable(script, *args++);
EffectInstance* tattleEffect = (EffectInstance*) evt_get_variable(script, *args++);
unkStruct0->unk_0C->unk_08 = -1000.0f;
tattleEffect->data.tattleWindow->pos.y = -1000.0f;
return ApiStatus_DONE2;
}
ApiStatus func_80218E2C_4652BC(Evt* script, s32 isInitialCall) {
UnkStruct0* unkStruct0 = (UnkStruct0*) evt_get_variable(script, *script->ptrReadPos);
EffectInstance* tattleEffect = (EffectInstance*) evt_get_variable(script, *script->ptrReadPos);
unkStruct0->unk_0C->unk_08 = 144.0f;
unkStruct0->flags |= 0x10;
tattleEffect->data.tattleWindow->pos.y = 144.0f;
tattleEffect->flags |= EFFECT_INSTANCE_FLAGS_10;
return ApiStatus_DONE2;
}
@ -2848,25 +2848,25 @@ EvtScript N(idle_80225B68) = {
ApiStatus func_80219658_465AE8(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
WattEffectData* unkDuplighost = (WattEffectData*)get_actor(script->owner1.enemyID)->state.varTable[3];
WattEffectData* wattEffects = (WattEffectData*)get_actor(script->owner1.enemyID)->state.varTable[3];
unkDuplighost->unk_04 = evt_get_variable(script, *args++);
wattEffects->unk_04 = evt_get_variable(script, *args++);
return ApiStatus_DONE2;
}
ApiStatus func_802196A4_465B34(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
WattEffectData* unkDuplighost = (WattEffectData*)get_actor(script->owner1.enemyID)->state.varTable[3];
WattEffectData* wattEffects = (WattEffectData*)get_actor(script->owner1.enemyID)->state.varTable[3];
unkDuplighost->unk_0C = evt_get_variable(script, *args++);
wattEffects->unk_0C = evt_get_variable(script, *args++);
return ApiStatus_DONE2;
}
ApiStatus func_802196F0_465B80(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
WattEffectData* unkDuplighost = (WattEffectData*)get_actor(script->owner1.enemyID)->state.varTable[3];
WattEffectData* wattEffects = (WattEffectData*)get_actor(script->owner1.enemyID)->state.varTable[3];
unkDuplighost->unk_10 = evt_get_variable(script, *args++);
wattEffects->unk_10 = evt_get_variable(script, *args++);
return ApiStatus_DONE2;
}

View File

@ -370,10 +370,10 @@ ApiStatus func_80218250_52B8F0(Evt* script, s32 isInitialCall) {
for (i = 0; i < ARRAY_COUNT(bpArray); i++) {
EffectInstance* effect = fx_ice_shard(bpArray[i].unk_00, bpArray[i].unk_04, bpArray[i].unk_08,
bpArray[i].unk_0C, bpArray[i].unk_10, bpArray[i].unk_14);
((IceShardFXData*)effect->data)->unk_4C = bpArray[i].unk_18;
((IceShardFXData*)effect->data)->unk_50 = bpArray[i].unk_1C;
((IceShardFXData*)effect->data)->unk_54 = bpArray[i].unk_20;
((IceShardFXData*)effect->data)->unk_58 = bpArray[i].unk_24;
effect->data.iceShard->unk_4C = bpArray[i].unk_18;
effect->data.iceShard->unk_50 = bpArray[i].unk_1C;
effect->data.iceShard->unk_54 = bpArray[i].unk_20;
effect->data.iceShard->unk_58 = bpArray[i].unk_24;
}
return ApiStatus_DONE2;

View File

@ -46,7 +46,7 @@ ApiStatus N(UpdateBulbGlow)(Evt* script, s32 isInitialCall) {
s32 y = evt_get_variable(script, *args++);
s32 z = evt_get_variable(script, *args++);
s32 rotation = evt_get_variable(script, *args++);
BulbGlowFXData* effectData = ((EffectInstance*) evt_get_variable(script, *args++))->data;
BulbGlowFXData* effectData = ((EffectInstance*) evt_get_variable(script, *args++))->data.bulbGlow;
effectData->pos.x = x;
effectData->pos.y = y;

View File

@ -230,16 +230,16 @@ ApiStatus UpdateCrystalBitEffect(Evt* script, s32 isInitialCall) {
ActorPart* actorPart = get_actor_part(actor, 1);
EffectInstance* effect = (EffectInstance*) evt_get_variable(script, *args);
((MiscParticlesFXData*)effect->data)->scaleX = actorPart->scale.x * 24.0f;
((MiscParticlesFXData*)effect->data)->scaleY = actorPart->scale.y * 24.0f;
effect->data.miscParticles->scaleX = actorPart->scale.x * 24.0f;
effect->data.miscParticles->scaleY = actorPart->scale.y * 24.0f;
if (actorPart->flags & ACTOR_PART_FLAG_INVISIBLE) {
((MiscParticlesFXData*)effect->data)->pos.x = actor->currentPos.x;
((MiscParticlesFXData*)effect->data)->pos.y = -1000.0f;
((MiscParticlesFXData*)effect->data)->pos.z = actor->currentPos.z;
effect->data.miscParticles->pos.x = actor->currentPos.x;
effect->data.miscParticles->pos.y = -1000.0f;
effect->data.miscParticles->pos.z = actor->currentPos.z;
} else {
((MiscParticlesFXData*)effect->data)->pos.x = actor->currentPos.x;
((MiscParticlesFXData*)effect->data)->pos.y = actor->currentPos.y;
((MiscParticlesFXData*)effect->data)->pos.z = actor->currentPos.z;
effect->data.miscParticles->pos.x = actor->currentPos.x;
effect->data.miscParticles->pos.y = actor->currentPos.y;
effect->data.miscParticles->pos.z = actor->currentPos.z;
}
return ApiStatus_BLOCK;

View File

@ -171,12 +171,12 @@ ApiStatus func_80218280_6609D0(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
EffectInstance* effect = (EffectInstance*) evt_get_variable(script, *args);
((HuffPuffBreathFXData*)effect->data)->unk_18 = 0xF8;
((HuffPuffBreathFXData*)effect->data)->unk_1C = 0xF8;
((HuffPuffBreathFXData*)effect->data)->unk_20 = 0xFF;
((HuffPuffBreathFXData*)effect->data)->unk_28 = 0x80;
((HuffPuffBreathFXData*)effect->data)->unk_2C = 0xE0;
((HuffPuffBreathFXData*)effect->data)->unk_30 = 0xFF;
effect->data.huffPuffBreath->unk_18 = 0xF8;
effect->data.huffPuffBreath->unk_1C = 0xF8;
effect->data.huffPuffBreath->unk_20 = 0xFF;
effect->data.huffPuffBreath->unk_28 = 0x80;
effect->data.huffPuffBreath->unk_2C = 0xE0;
((HuffPuffBreathFXData*)effect->data.huffPuffBreath)->unk_30 = 0xFF;
return ApiStatus_DONE2;
}
@ -184,12 +184,12 @@ ApiStatus func_802182E4_660A34(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
EffectInstance* effect = (EffectInstance*) evt_get_variable(script, *args);
((LightningBoltFXData*)effect->data)->unk_30 = 0xFF;
((LightningBoltFXData*)effect->data)->unk_34 = 0xFF;
((LightningBoltFXData*)effect->data)->unk_38 = 0xFF;
((LightningBoltFXData*)effect->data)->unk_40 = 0xC8;
((LightningBoltFXData*)effect->data)->unk_44 = 0xF0;
((LightningBoltFXData*)effect->data)->unk_48 = 0xFF;
effect->data.lightningBolt->unk_30 = 0xFF;
effect->data.lightningBolt->unk_34 = 0xFF;
effect->data.lightningBolt->unk_38 = 0xFF;
effect->data.lightningBolt->unk_40 = 0xC8;
effect->data.lightningBolt->unk_44 = 0xF0;
effect->data.lightningBolt->unk_48 = 0xFF;
return ApiStatus_DONE2;
}
@ -197,12 +197,12 @@ ApiStatus func_80218344_660A94(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
EffectInstance* effect = (EffectInstance*) evt_get_variable(script, *args++);
((ColdBreathFXData*)effect->data)->unk_18 = 0xFF;
((ColdBreathFXData*)effect->data)->unk_1C = 0xFF;
((ColdBreathFXData*)effect->data)->unk_20 = 0xFF;
((ColdBreathFXData*)effect->data)->unk_28 = 0xC8;
((ColdBreathFXData*)effect->data)->unk_2C = 0xF0;
((ColdBreathFXData*)effect->data)->unk_30 = 0xFF;
effect->data.coldBreath->unk_18 = 0xFF;
effect->data.coldBreath->unk_1C = 0xFF;
effect->data.coldBreath->unk_20 = 0xFF;
effect->data.coldBreath->unk_28 = 0xC8;
effect->data.coldBreath->unk_2C = 0xF0;
effect->data.coldBreath->unk_30 = 0xFF;
return ApiStatus_DONE2;
}

View File

@ -8,17 +8,6 @@
#define NAMESPACE b_area_sam2_monstar
// probably the same as FoldImageRecPart
typedef struct UnknownMonstarStruct {
/* 0x00 */ u8* raster;
/* 0x04 */ u8* palette;
/* 0x08 */ u16 width;
/* 0x0A */ u16 height;
/* 0x0C */ s32 unk_0C;
/* 0x10 */ s32 unk_10;
/* 0x14 */ Gfx* dlist;
} UnknownMonstarStruct; // size = 0x18;
extern Gfx N(dlist)[];
extern EvtScript N(init);
@ -148,13 +137,14 @@ EvtScript N(init) = {
#include "battle/area_sam2/actor/img.png.inc.c"
#include "battle/area_sam2/actor/img.pal.inc.c"
UnknownMonstarStruct D_8021A2B8_63F498 = {
FoldImageRecPart D_8021A2B8_63F498 = {
.raster = battle_area_sam2_actor_img_png,
.palette = battle_area_sam2_actor_img_pal,
.width = battle_area_sam2_actor_img_png_width,
.height = battle_area_sam2_actor_img_png_height,
.unk_0C = -4,
.unk_10 = 0,
.xOffset = -1,
.yOffset = -4,
.opacity = 0,
.dlist = N(dlist),
};

View File

@ -14,7 +14,7 @@ ApiStatus N(UnkTattleEffectFunc1)(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
EffectInstance* effect = (EffectInstance*)evt_get_variable(script, *args++);
((EffectInstanceData*)effect->data)->pos.y = -1000.0f;
effect->data.tattleWindow->pos.y = -1000.0f;
return ApiStatus_DONE2;
}
@ -22,7 +22,7 @@ ApiStatus N(UnkTattleEffectFunc2)(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
EffectInstance* effect = (EffectInstance*)evt_get_variable(script, *args++);
((EffectInstanceData*)effect->data)->pos.y = 144.0f;
effect->data.tattleWindow->pos.y = 144.0f;
effect->flags |= EFFECT_INSTANCE_FLAGS_10;
return ApiStatus_DONE2;
}

View File

@ -45,9 +45,9 @@ ApiStatus N(UnkWattEffectFunc1)(Evt* script, s32 isInitialCall) {
wattEffectData->effect2->flags |= EFFECT_INSTANCE_FLAGS_10;
wattEffectData->effect2 = NULL;
}
((StaticStatusFXData*)wattEffectData->effect1->data)->unk_04 = x;
((StaticStatusFXData*)wattEffectData->effect1->data)->unk_08 = y;
((StaticStatusFXData*)wattEffectData->effect1->data)->unk_0C = z;
wattEffectData->effect1->data.staticStatus->unk_04 = x;
wattEffectData->effect1->data.staticStatus->unk_08 = y;
wattEffectData->effect1->data.staticStatus->unk_0C = z;
break;
case 1:
if (wattEffectData->effect1 != NULL) {
@ -58,9 +58,9 @@ ApiStatus N(UnkWattEffectFunc1)(Evt* script, s32 isInitialCall) {
wattEffectData->effect2 = fx_static_status(1, x, y, z, (actor->debuff != STATUS_SHRINK) ? 1.0f : 0.4f, 5, 0);
}
((StaticStatusFXData*)wattEffectData->effect2->data)->unk_04 = x;
((StaticStatusFXData*)wattEffectData->effect2->data)->unk_08 = y;
((StaticStatusFXData*)wattEffectData->effect2->data)->unk_0C = z;
wattEffectData->effect2->data.staticStatus->unk_04 = x;
wattEffectData->effect2->data.staticStatus->unk_08 = y;
wattEffectData->effect2->data.staticStatus->unk_0C = z;
break;
}
} else {

View File

@ -31,11 +31,11 @@ ApiStatus N(func_802A12EC_7333BC)(Evt* script, s32 isInitialCall) {
partner->koDuration = 0;
}
if (partner->koDuration > 0) {
((DisableXFXData*)partner->debuffEffect->data)->unk_3C = partner->koDuration;
partner->debuffEffect->data.disableX->unk_3C = partner->koDuration;
} else {
partner->koStatus = 0;
dispatch_event_partner(EVENT_34);
((DisableXFXData*)partner->debuffEffect->data)->unk_3C = 0;
dispatch_event_partner(EVENT_RECOVER_PARTNER);
partner->debuffEffect->data.disableX->unk_3C = 0;
}
return ApiStatus_DONE2;

View File

@ -38,12 +38,12 @@ ApiStatus N(func_802A12E0_72AA30)(Evt* script, s32 isInitialCall) {
effect = fx_cold_breath(0, a, b, c, 1.0f, 30);
((ColdBreathFXData*)effect->data)->unk_18 = 244;
((ColdBreathFXData*)effect->data)->unk_1C = 244;
((ColdBreathFXData*)effect->data)->unk_20 = 220;
((ColdBreathFXData*)effect->data)->unk_28 = 210;
((ColdBreathFXData*)effect->data)->unk_2C = 210;
((ColdBreathFXData*)effect->data)->unk_30 = 190;
effect->data.coldBreath->unk_18 = 244;
effect->data.coldBreath->unk_1C = 244;
effect->data.coldBreath->unk_20 = 220;
effect->data.coldBreath->unk_28 = 210;
effect->data.coldBreath->unk_2C = 210;
effect->data.coldBreath->unk_30 = 190;
return ApiStatus_DONE2;
}

View File

@ -31,11 +31,11 @@ ApiStatus N(func_802A12EC_72E81C)(Evt* script, s32 isInitialCall) {
partner->koDuration = 0;
}
if (partner->koDuration > 0) {
((DisableXFXData*)partner->debuffEffect->data)->unk_3C = partner->koDuration;
partner->debuffEffect->data.disableX->unk_3C = partner->koDuration;
} else {
partner->koStatus = 0;
dispatch_event_partner(EVENT_34);
((DisableXFXData*)partner->debuffEffect->data)->unk_3C = 0;
dispatch_event_partner(EVENT_RECOVER_PARTNER);
partner->debuffEffect->data.disableX->unk_3C = 0;
}
return ApiStatus_DONE2;

View File

@ -31,11 +31,11 @@ ApiStatus N(func_802A12EC_715B3C)(Evt* script, s32 isInitialCall) {
partner->koDuration = 0;
}
if (partner->koDuration > 0) {
((DisableXFXData*)partner->debuffEffect->data)->unk_3C = partner->koDuration;
partner->debuffEffect->data.disableX->unk_3C = partner->koDuration;
} else {
partner->koStatus = 0;
dispatch_event_partner(EVENT_34);
((DisableXFXData*)partner->debuffEffect->data)->unk_3C = 0;
dispatch_event_partner(EVENT_RECOVER_PARTNER);
partner->debuffEffect->data.disableX->unk_3C = 0;
}
return ApiStatus_DONE2;

View File

@ -31,11 +31,11 @@ ApiStatus N(func_802A12EC_724FCC)(Evt* script, s32 isInitialCall) {
partner->koDuration = 0;
}
if (partner->koDuration > 0) {
((DisableXFXData*)partner->debuffEffect->data)->unk_3C = partner->koDuration;
partner->debuffEffect->data.disableX->unk_3C = partner->koDuration;
} else {
partner->koStatus = 0;
dispatch_event_partner(EVENT_34);
((DisableXFXData*)partner->debuffEffect->data)->unk_3C = 0;
dispatch_event_partner(EVENT_RECOVER_PARTNER);
partner->debuffEffect->data.disableX->unk_3C = 0;
}
return ApiStatus_DONE2;
@ -64,7 +64,7 @@ ApiStatus N(func_802A1378_725058)(Evt* script, s32 isInitialCall) {
break;
}
((DisableXFXData*)actor->debuffEffect->data)->unk_3C = 0;
actor->debuffEffect->data.disableX->unk_3C = 0;
}
btl_update_ko_status();

View File

@ -24,7 +24,7 @@ ApiStatus N(func_802A123C_72223C)(Evt* script, s32 isInitialCall) {
case ACTOR_CLASS_PARTNER:
dispatch_event_partner(EVENT_RECOVER_STATUS);
}
((DisableXFXData*)actor->debuffEffect->data)->unk_3C = 0;
actor->debuffEffect->data.disableX->unk_3C = 0;
}
return ApiStatus_DONE2;

View File

@ -560,7 +560,7 @@ EvtScript N(handleEvent_802387F0) = {
EVT_CASE_EQ(EVENT_33)
EVT_SET_CONST(LW(1), NPC_ANIM_battle_bombette_Palette_00_Anim_12)
EVT_EXEC_WAIT(D_80296014)
EVT_CASE_EQ(EVENT_34)
EVT_CASE_EQ(EVENT_RECOVER_PARTNER)
EVT_SET_CONST(LW(0), 1)
EVT_SET_CONST(LW(1), NPC_ANIM_battle_bombette_Palette_00_Anim_4)
EVT_SET_CONST(LW(2), NPC_ANIM_battle_bombette_Palette_00_Anim_8)

View File

@ -177,7 +177,7 @@ ApiStatus func_80238E04_6F1EE4(Evt* script, s32 isInitialCall) {
ApiStatus func_80238E48_6F1F28(Evt* script, s32 isInitialCall) {
EffectInstance* effect = D_8023CDA0;
((EffectInstanceData*)effect->data)->pos.y = 144.0f;
effect->data.tattleWindow->pos.y = 144.0f;
effect->flags |= EFFECT_INSTANCE_FLAGS_10;
return ApiStatus_DONE2;

View File

@ -123,7 +123,7 @@ EvtScript N(handleEvent_8023819C) = {
EVT_SET_CONST(LW(1), NPC_ANIM_goompa_Palette_00_Anim_7)
EVT_EXEC_WAIT(DoNormalHit)
EVT_CASE_EQ(EVENT_33)
EVT_CASE_EQ(EVENT_34)
EVT_CASE_EQ(EVENT_RECOVER_PARTNER)
EVT_SET_CONST(LW(0), 1)
EVT_SET_CONST(LW(1), NPC_ANIM_goompa_Palette_00_Anim_1)
EVT_SET_CONST(LW(2), NPC_ANIM_goompa_Palette_00_Anim_3)

View File

@ -317,7 +317,7 @@ EvtScript N(handleEvent_802385E0) = {
EVT_CASE_EQ(EVENT_33)
EVT_SET_CONST(LW(1), NPC_ANIM_battle_kooper_Palette_00_Anim_11)
EVT_EXEC_WAIT(D_80296014)
EVT_CASE_EQ(EVENT_34)
EVT_CASE_EQ(EVENT_RECOVER_PARTNER)
EVT_SET_CONST(LW(0), 1)
EVT_SET_CONST(LW(1), NPC_ANIM_battle_kooper_Palette_00_Anim_4)
EVT_SET_CONST(LW(2), NPC_ANIM_battle_kooper_Palette_00_Anim_6)

View File

@ -53,7 +53,6 @@ ApiStatus func_80238C14_70C924(Evt* script, s32 isInitialCall) {
ApiStatus func_80238C58_70C968(Evt* script, s32 isInitialCall) {
BattleStatus* battleStatus = &gBattleStatus;
Actor* actor = battleStatus->playerActor;
EffectInstanceData* effectData; // TODO remove this struct and replace it with the effect-specific one
if (isInitialCall) {
script->functionTemp[0] = 0;
@ -69,8 +68,7 @@ ApiStatus func_80238C58_70C968(Evt* script, s32 isInitialCall) {
if (D_8023D1E0 >= 1.0) {
return ApiStatus_DONE2;
}
effectData = battleStatus->cloudNineEffect->data;
effectData->rotation.x += 0.2;
battleStatus->cloudNineEffect->data.endingDecals->unk_10 += 0.2;
D_8023D1E0 += 0.2;
break;
}

View File

@ -86,7 +86,7 @@ ApiStatus func_8023859C_70408C(Evt* script, s32 isInitialCall) {
ThunderboltRingFXData* data;
D_8023C1B4 = fx_thunderbolt_ring(0, var1, var2, var3, 1.0f, 10);
data = D_8023C1B4->data;
data = D_8023C1B4->data.thunderboltRing;
data->unk_30 = 3;
return ApiStatus_DONE2;
@ -106,7 +106,7 @@ ApiStatus func_80238668_704158(Evt* script, s32 isInitialCall) {
script->functionTemp[0]--;
if (script->functionTemp[0] == 0) {
((BulbGlowFXData*)D_8023C1B0->data)->unk_14 = 5;
D_8023C1B0->data.bulbGlow->unk_14 = 5;
return ApiStatus_DONE2;
}
@ -142,7 +142,7 @@ ApiStatus func_80238B3C_70462C(Evt* script, s32 isInitialCall) {
ThunderboltRingFXData* data;
D_8023C1B4 = fx_thunderbolt_ring(0, var1, var2, var3, 1.0f, 60);
data = D_8023C1B4->data;
data = D_8023C1B4->data.thunderboltRing;
data->unk_30 = 2;
return ApiStatus_DONE2;

View File

@ -22,7 +22,7 @@ ApiStatus func_802A17D4_78BDD4(Evt* script, s32 isInitialCall) {
if (actor->koStatus != 0) {
actor->koDuration = 0;
actor->koStatus = 0;
((DisableXFXData*)actor->debuffEffect->data)->unk_3C = 0;
actor->debuffEffect->data.disableX->unk_3C = 0;
}
btl_update_ko_status();

View File

@ -151,8 +151,8 @@ BSS s8 D_800A0B94;
BSS char D_800A0B98[0x8];
BSS s32 D_800A0BA0;
BSS float D_800A0BA4;
BSS s32 D_800A0BA8;
BSS s32 D_800A0BAC;
BSS s32 WorldMerleeOrbEffect;
BSS s32 WorldMerleeWaveEffect;
BSS s32 D_800A0BB0;
BSS s32 D_800A0BB4;
BSS s16 D_800A0BB8;

View File

@ -95,7 +95,7 @@ BSS s8 texPannerMainU[0x40];
BSS s8 texPannerMainV[0x40];
BSS s8 texPannerAuxU[0x40];
BSS s8 texPannerAuxV[0x40];
BSS s32 mdl_nextTextureAddress;
BSS void* mdl_nextTextureAddress;
BSS s16 mdl_currentTransformGroupChildIndex;
BSS s16 D_8015336E;
BSS s32 D_80153370;

View File

@ -14,7 +14,7 @@ ApiStatus N(ShrinkActor)(Evt* script, s32 isInitialCall) {
EffectInstance* effect = fx_shape_spell(0, var1, (f32) var2 + 5.0, var3, var4, var5, var6, var7);
if (actor->debuff == STATUS_SHRINK) {
((FootprintFXData*)effect->data)->unk_28 = 0.4f;
effect->data.footprint->unk_28 = 0.4f;
}
return ApiStatus_DONE2;

View File

@ -15,12 +15,12 @@ ApiStatus N(UnkEffect6FFunc)(Evt* script, s32 isInitialCall) {
s32 temp_s0_9 = evt_get_variable(script, *args++);
effect = fx_cold_breath(1, temp_s6, temp_s5, temp_s4, temp_f20, temp_s2);
((Effect6FFXData*)effect->data)->rotation.z = temp_s3;
((Effect6FFXData*)effect->data)->scale.x = temp_s1;
((Effect6FFXData*)effect->data)->scale.y = temp_s0_9;
((Effect6FFXData*)effect->data)->color.x = 255;
((Effect6FFXData*)effect->data)->color.y = 255;
((Effect6FFXData*)effect->data)->color.z = 255;
effect->data.coldBreath->unk_18 = temp_s3;
effect->data.coldBreath->unk_1C = temp_s1;
effect->data.coldBreath->unk_20 = temp_s0_9;
effect->data.coldBreath->unk_28 = 255;
effect->data.coldBreath->unk_2C = 255;
effect->data.coldBreath->unk_30 = 255;
return ApiStatus_DONE2;
}

View File

@ -1,14 +1,15 @@
#include "common.h"
#include "effects.h"
ApiStatus N(UnkFireBreathFXFunc)(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
EffectInstance* effect = (EffectInstance*)evt_get_variable(script, *args++);
FireBreathFXData* data = (FireBreathFXData*)effect->data;
EffectInstance* effect = (EffectInstance*) evt_get_variable(script, *args++);
FireBreathFXData* data = effect->data.fireBreath;
data->scale = 0.04f;
data->unk_30 = 0.04f;
((FireBreathFXData*)effect->data)->unk_34 = 1.875f;
((FireBreathFXData*)effect->data)->scaleChangeFactor = 0.05f;
effect->data.fireBreath->unk_34 = 1.875f;
effect->data.fireBreath->scaleChangeFactor = 0.05f;
return ApiStatus_DONE2;
}

View File

@ -1,14 +1,15 @@
#include "common.h"
#include "effects.h"
ApiStatus N(UnkLightningFXFunc)(Evt* script, s32 isInitialCall) {
EffectInstance* effect = (EffectInstance*)script->varTable[15];
((LightningFXData*)effect->data)->unk_30 = 85;
((LightningFXData*)effect->data)->unk_34 = 42;
((LightningFXData*)effect->data)->unk_38 = 255;
((LightningFXData*)effect->data)->unk_40 = 255;
((LightningFXData*)effect->data)->unk_44 = 175;
((LightningFXData*)effect->data)->unk_48 = 239;
effect->data.lightning->unk_30 = 85;
effect->data.lightning->unk_34 = 42;
effect->data.lightning->unk_38 = 255;
effect->data.lightning->unk_40 = 255;
effect->data.lightning->unk_44 = 175;
effect->data.lightning->unk_48 = 239;
return ApiStatus_DONE2;
}

View File

@ -20,12 +20,12 @@ ApiStatus N(UnkWaterFountainFunc)(Evt* script, s32 isInitialCall) {
temp_f20_2 = atan2(temp_f28, temp_f26, temp_f20, temp_f22 + 40.0f);
effect = fx_water_fountain(0, temp_f20 - 10.0f, temp_f22 + 60.0f, temp_f24 + 20.0f, 2.5f, 40);
((WaterFountainFXData*)effect->data)->unk_38 = temp_f20_2;
((WaterFountainFXData*)effect->data)->unk_18 = 2;
((WaterFountainFXData*)effect->data)->unk_1C = 2;
((WaterFountainFXData*)effect->data)->unk_20 = 2;
((WaterFountainFXData*)effect->data)->unk_28 = 80;
((WaterFountainFXData*)effect->data)->unk_2C = 80;
((WaterFountainFXData*)effect->data)->unk_30 = 80;
effect->data.waterFountain->unk_38 = temp_f20_2;
effect->data.waterFountain->unk_18 = 2;
effect->data.waterFountain->unk_1C = 2;
effect->data.waterFountain->unk_20 = 2;
effect->data.waterFountain->unk_28 = 80;
effect->data.waterFountain->unk_2C = 80;
effect->data.waterFountain->unk_30 = 80;
return ApiStatus_DONE2;
}

View File

@ -397,7 +397,7 @@ void fold_init_state(FoldState* state) {
}
}
void fold_update(u32 idx, FoldType arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6) {
void fold_update(u32 idx, FoldType type, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6) {
FoldState* state = &(*D_80156954)[idx];
s32 oldFlags;
s32 t1;
@ -406,9 +406,9 @@ void fold_update(u32 idx, FoldType arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5,
return;
}
switch (arg1) {
case 0:
case 3:
switch (type) {
case FOLD_TYPE_NONE:
case FOLD_TYPE_3:
oldFlags = state->flags;
fold_clear_state_gfx(state);
fold_init_state(state);
@ -427,38 +427,38 @@ void fold_update(u32 idx, FoldType arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5,
state->flags = state->flags; // required to match
}
return;
case 1:
case FOLD_TYPE_1:
state->unk_05 = 0;
state->renderType = 0;
state->unk_1C[0][0] = -1;
return;
case 2:
case FOLD_TYPE_2:
state->unk_06 = 0;
state->meshType = 0;
state->unk_1C[1][0] = -1;
return;
case 17:
case FOLD_TYPE_11:
if (state->buf != NULL) {
heap_free(state->buf);
}
state->bufSize = arg2 * 4;
state->buf = heap_malloc(state->bufSize);
return;
case 15:
case 16:
if (arg1 == state->unk_06 && arg2 == state->unk_1C[1][0] && arg3 == state->unk_1C[1][1]) {
case FOLD_TYPE_F:
case FOLD_TYPE_10:
if (type == state->unk_06 && arg2 == state->unk_1C[1][0] && arg3 == state->unk_1C[1][1]) {
return;
}
break;
case 5:
if (state->unk_05 == arg1 && state->unk_1C[0][0] == arg2 && state->unk_1C[0][1] == arg3 &&
case FOLD_TYPE_5:
if (state->unk_05 == type && state->unk_1C[0][0] == arg2 && state->unk_1C[0][1] == arg3 &&
state->unk_1C[0][2] == arg4)
{
return;
}
break;
default:
if (arg1 != 0xD && state->unk_06 == 0xD) {
if (type != FOLD_TYPE_D && state->unk_06 == 0xD) {
state->meshType = 0;
state->subdivX = 1;
state->subdivY = 1;
@ -466,18 +466,18 @@ void fold_update(u32 idx, FoldType arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5,
break;
}
if (arg1 != 5 && state->unk_05 == 5) {
if (type != FOLD_TYPE_5 && state->unk_05 == 5) {
state->unk_05 = 0;
}
if (arg1 == 4 || arg1 == 5) {
state->unk_05 = arg1;
if (type == FOLD_TYPE_4 || type == FOLD_TYPE_5) {
state->unk_05 = type;
state->unk_1C[0][0] = arg2;
state->unk_1C[0][1] = arg3;
state->unk_1C[0][2] = arg4;
state->unk_1C[0][3] = arg5;
} else if (arg1 >= 6 && arg1 <= 16) {
state->unk_06 = arg1;
} else if (type >= FOLD_TYPE_6 && type <= FOLD_TYPE_10) {
state->unk_06 = type;
state->unk_1C[1][0] = arg2;
state->unk_1C[1][1] = arg3;
state->unk_1C[1][2] = arg4;
@ -490,27 +490,27 @@ void fold_update(u32 idx, FoldType arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5,
}
state->meshType = 0;
switch (arg1) {
case 3:
switch (type) {
case FOLD_TYPE_3:
state->meshType = 0;
state->renderType = 0;
break;
case 4:
case FOLD_TYPE_4:
state->subdivX = 4;
state->subdivY = 4;
state->meshType = 1;
func_8013EE48(state);
break;
case 5:
case FOLD_TYPE_5:
state->meshType = 2;
state->renderType = 0xB;
state->unk_3C[0][0] = 0.0f;
state->unk_3C[0][1] = 0.0f;
state->flags |= FOLD_STATE_FLAG_200;
break;
case 6:
case 7:
case 8:
case FOLD_TYPE_6:
case FOLD_TYPE_7:
case FOLD_TYPE_8:
if (arg2 >= 0xFF && arg3 >= 0xFF && arg4 >= 0xFF && arg5 >= 0xFF) {
state->renderType = 0;
} else if (arg5 >= 0xFF) {
@ -521,15 +521,15 @@ void fold_update(u32 idx, FoldType arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5,
state->renderType = 3;
}
break;
case 9:
case 10:
case FOLD_TYPE_9:
case FOLD_TYPE_A:
if (arg5 == 255.0) {
state->renderType = 4;
} else {
state->renderType = 5;
}
break;
case 11:
case FOLD_TYPE_B:
if (arg2 < state->bufSize) {
t1 = (u32) arg3 >> 0x18; // required to match
state->buf[arg2 * 4 + 0] = (u32) arg3 >> 0x18;
@ -548,7 +548,7 @@ void fold_update(u32 idx, FoldType arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5,
}
}
break;
case 12:
case FOLD_TYPE_C:
if (arg2 < state->bufSize) {
t1 = (u32) arg3 >> 0x18; // required to match
state->buf[arg2 * 4 + 0] = t1;
@ -567,14 +567,14 @@ void fold_update(u32 idx, FoldType arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5,
}
}
break;
case 13:
case FOLD_TYPE_D:
state->renderType = 0xC;
break;
case 14:
case FOLD_TYPE_E:
state->renderType = 0xD;
break;
case 15:
case 16:
case FOLD_TYPE_F:
case FOLD_TYPE_10:
state->meshType = 4;
if (arg3 >= 0xFF) {
state->renderType = 0xE;

View File

@ -173,15 +173,16 @@ s32 D_8007FEB8[] = {
};
/// Used for unbound function points in effect structs.
void stub_effect_delegate(EffectInstance* effectInst) {
void stub_effect_delegate(EffectInstance* effect) {
}
void set_effect_pos_offset(EffectGraphics* effect, f32 x, f32 y, f32 z) {
EffectInstanceData* instanceData = effect->freeDelay;
instanceData->pos.x = x;
instanceData->pos.y = y;
instanceData->pos.z = z;
void set_effect_pos_offset(EffectInstance* effect, f32 x, f32 y, f32 z) {
s32* data = effect->data.any;
((f32*)data)[1] = x;
((f32*)data)[2] = y;
((f32*)data)[3] = z;
}
void clear_effect_data(void) {
@ -391,23 +392,23 @@ EffectInstance* create_effect_instance(EffectBlueprint* effectBp) {
return newEffectInst;
}
void remove_effect(EffectInstance* effectInstsance) {
void remove_effect(EffectInstance* effectInstance) {
s32 i;
for (i = 0; i < ARRAY_COUNT(gEffectInstances); i++) {
if (gEffectInstances[i] == effectInstsance) {
if (gEffectInstances[i] == effectInstance) {
break;
}
}
ASSERT(i < ARRAY_COUNT(gEffectInstances));
if (effectInstsance->data == NULL) {
general_heap_free(effectInstsance);
if (effectInstance->data.any == NULL) {
general_heap_free(effectInstance);
gEffectInstances[i] = NULL;
} else {
general_heap_free(effectInstsance->data);
general_heap_free(effectInstsance);
general_heap_free(effectInstance->data.any);
general_heap_free(effectInstance);
gEffectInstances[i] = NULL;
}
}
@ -419,8 +420,8 @@ void remove_all_effects(void) {
EffectInstance* effect = gEffectInstances[i];
if (effect != NULL && effect->flags & 4) {
if (effect->data != NULL) {
general_heap_free(effect->data);
if (effect->data.any != NULL) {
general_heap_free(effect->data.any);
}
general_heap_free(effect);
gEffectInstances[i] = NULL;

View File

@ -50,7 +50,7 @@ EffectInstance* attack_result_text_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3,
effect = shim_create_effect_instance(&bp);
effect->numParts = numParts;
data = effect->data = shim_general_heap_malloc(effect->numParts * sizeof(*data));
data = effect->data.attackResultText = shim_general_heap_malloc(effect->numParts * sizeof(*data));
ASSERT(data != NULL);
@ -89,7 +89,7 @@ void attack_result_text_init(EffectInstance* effect) {
}
void attack_result_text_update(EffectInstance* effect) {
AttackResultTextFXData* data = effect->data;
AttackResultTextFXData* data = effect->data.attackResultText;
s32 unk_00 = data->unk_00;
s32 old_unk_1C;
s32 unk_1C;

View File

@ -19,7 +19,7 @@ Gfx* D_E0076EB0[] = { D_090023B0, D_090023B0, D_09002410, D_09002410 };
Gfx* D_E0076EC0[] = { D_090023C8, D_090023C8, D_09002428, D_09002428 };
Gfx* D_E0076ED0[] = { D_09002000, D_09002000, D_090020E8, D_090021D0 };
void aura_appendGfx(void* effect);
void aura_appendGfx(void* argEffect);
void aura_init(EffectInstance* effect);
void aura_update(EffectInstance* effect);
void aura_render(EffectInstance* effect);
@ -42,25 +42,25 @@ void aura_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, EffectInstance*
effect = shim_create_effect_instance(bpPtr);
effect->numParts = numParts;
part = effect->data = shim_general_heap_malloc(numParts * sizeof(*part));
part = effect->data.aura = shim_general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data != NULL);
ASSERT(effect->data.aura != NULL);
part->unk_64.s = 0;
part->renderYaw = 0.0f;
zero = part->unk_64.f;
zero = 0.0f;
part->unk_40 = zero;
part->unk_34 = zero;
part->unk_58 = zero;
part->unk_4C = zero;
part->unk_2C = 100;
part->fadeTime = 100;
part->type = arg0;
part->unk_30 = 0;
part->lifeTime = 0;
part->primA = 0;
part->pos.x = arg1;
part->pos.y = arg2;
part->pos.z = arg3;
part->posA.x = arg1;
part->posA.y = arg2;
part->posA.z = arg3;
switch (arg0) {
case 0:
@ -71,9 +71,9 @@ void aura_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, EffectInstance*
part->envG = 247;
part->engB = 155;
part->engA = 0;
part->scale.x = arg4 * 2.0;
part->scale.y = arg4 * 0.6;
part->unk_24 = arg4;
part->unk_20 = arg4 * 0.6;
part->unk_1C = arg4 * 2.0;
part->unk_38 = -0.9f;
part->unk_44 = 0.04f;
part->unk_3C = 0.04f;
@ -91,8 +91,8 @@ void aura_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, EffectInstance*
part->envG = 0;
part->engB = 0;
part->engA = 0;
part->unk_1C = arg4;
part->unk_20 = arg4;
part->scale.x = arg4;
part->scale.y = arg4;
part->unk_24 = arg4;
part->unk_38 = zero;
part->unk_50 = zero;
@ -111,8 +111,8 @@ void aura_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, EffectInstance*
part->engB = 255;
part->envG = 0;
part->engA = 81;
part->unk_1C = arg4;
part->unk_20 = arg4;
part->scale.x = arg4;
part->scale.y = arg4;
part->unk_24 = arg4;
part->unk_38 = zero;
part->unk_50 = zero;
@ -131,8 +131,8 @@ void aura_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, EffectInstance*
part->engB = 255;
part->envG = 0;
part->engA = 63;
part->unk_1C = arg4;
part->unk_20 = arg4;
part->scale.x = arg4;
part->scale.y = arg4;
part->unk_24 = arg4;
part->unk_38 = 0.0f;
part->unk_50 = 0.0f;
@ -145,9 +145,9 @@ void aura_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, EffectInstance*
break;
}
part->unk_10 = part->pos.x;
part->unk_14 = part->pos.y;
part->unk_18 = part->pos.z;
part->posB.x = part->posA.x;
part->posB.y = part->posA.y;
part->posB.z = part->posA.z;
*outEffect = effect;
}
@ -158,52 +158,52 @@ void aura_init(EffectInstance* effect) {
void aura_update(EffectInstance* effect) {
AuraFXData* data;
s32 type;
s32 unk_2C;
s32 unk_30;
s32 fadeTime;
s32 lifeTime;
data = effect->data;
data = effect->data.aura;
if (effect->flags & 0x10) {
effect->flags &= ~0x10;
data->unk_2C = 5;
data->fadeTime = 5;
}
data->unk_30++;
if (data->unk_30 > 324000) {
data->unk_30 = 256;
data->lifeTime++;
if (data->lifeTime > 90*60*60) {
data->lifeTime = 256;
}
if (data->unk_2C <= 10) {
data->unk_2C--;
if (data->fadeTime <= 10) {
data->fadeTime--;
}
if (data->unk_2C < 0) {
if (data->fadeTime < 0) {
shim_remove_effect(effect);
return;
}
type = data->type;
unk_2C = data->unk_2C;
unk_30 = data->unk_30;
fadeTime = data->fadeTime;
lifeTime = data->lifeTime;
if (type < 2) {
if (unk_30 <= 10) {
if (lifeTime <= 10) {
data->primA += (128 - data->primA) * 0.5;
}
} else {
if (unk_30 <= 10) {
data->primA = (unk_30 * 0xFF) / 10;
if (lifeTime <= 10) {
data->primA = (lifeTime * 0xFF) / 10;
}
}
if (unk_2C < 10) {
if (fadeTime < 10) {
data->primA *= 0.5;
}
if (type == 0) {
data->unk_38 += (data->unk_3C - data->unk_38) * 0.02;
data->unk_44 += (data->unk_48 - data->unk_44) * 0.02;
data->unk_1C += (data->unk_24 - data->unk_1C) * 0.04;
data->unk_20 += (data->unk_24 - data->unk_20) * 0.04;
data->scale.x += (data->unk_24 - data->scale.x) * 0.04;
data->scale.y += (data->unk_24 - data->scale.y) * 0.04;
} else {
data->unk_38 += (data->unk_3C - data->unk_38) * 0.02;
data->unk_44 += (data->unk_48 - data->unk_44) * 0.02;
@ -239,9 +239,9 @@ void aura_update(EffectInstance* effect) {
data->unk_58 -= 128.0f;
}
data->unk_10 += (data->pos.x - data->unk_10) * 0.1;
data->unk_14 += (data->pos.y - data->unk_14) * 0.1;
data->unk_18 += (data->pos.z - data->unk_18) * 0.1;
data->posB.x += (data->posA.x - data->posB.x) * 0.1;
data->posB.y += (data->posA.y - data->posB.y) * 0.1;
data->posB.z += (data->posA.z - data->posB.z) * 0.1;
}
void aura_render(EffectInstance* effect) {
@ -263,50 +263,50 @@ void func_E007684C(void) {
void func_E0076854(void) {
}
void aura_appendGfx(void* effect) {
Matrix4f sp18, sp58, sp98;
EffectInstance* eff = (EffectInstance*)effect;
AuraFXData* data = ((EffectInstance*)effect)->data;
void aura_appendGfx(void* argEffect) {
Matrix4f translateMtx, tempMtx, transformMtx;
EffectInstance* effect = argEffect;
AuraFXData* data = effect->data.aura;
s32 type = data->type;
s32 primA = data->primA;
s32 v1, v2;
gSPSegment(gMasterGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
gSPSegment(gMasterGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(effect->graphics->data));
gSPDisplayList(gMasterGfxPos++, D_E0076ED0[type]);
shim_guTranslateF(sp18, data->unk_10, data->unk_14, data->unk_18);
shim_guTranslateF(translateMtx, data->posB.x, data->posB.y, data->posB.z);
if (type == 2) {
shim_guRotateF(sp58, data->unk_64.f, 0.0f, 1.0f, 0.0f);
shim_guRotateF(tempMtx, data->renderYaw, 0.0f, 1.0f, 0.0f);
} else {
shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guRotateF(tempMtx, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
}
shim_guMtxCatF(sp58, sp18, sp98);
shim_guScaleF(sp58, data->unk_1C, data->unk_20, 1.0f);
shim_guMtxCatF(sp58, sp98, sp98);
shim_guMtxCatF(tempMtx, translateMtx, transformMtx);
shim_guScaleF(tempMtx, data->scale.x, data->scale.y, 1.0f);
shim_guMtxCatF(tempMtx, transformMtx, transformMtx);
if (type == 0) {
shim_guTranslateF(sp58, (-(data->unk_1C - data->unk_24) / data->unk_24) * 10.0f, 0.0f, 0.0f);
shim_guMtxCatF(sp58, sp98, sp98);
shim_guTranslateF(tempMtx, (-(data->scale.x - data->unk_24) / data->unk_24) * 10.0f, 0.0f, 0.0f);
shim_guMtxCatF(tempMtx, transformMtx, transformMtx);
}
shim_guMtxF2L(sp98, &gDisplayContext->matrixStack[gMatrixListPos]);
shim_guMtxF2L(transformMtx, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMasterGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gMasterGfxPos++, D_E0076EC0[type]);
gSPPopMatrix(gMasterGfxPos++, G_MTX_MODELVIEW);
shim_guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z);
shim_guTranslateF(translateMtx, data->posA.x, data->posA.y, data->posA.z);
if (type == 2) {
shim_guRotateF(sp58, data->unk_64.f, 0.0f, 1.0f, 0.0f);
shim_guRotateF(tempMtx, data->renderYaw, 0.0f, 1.0f, 0.0f);
} else {
shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guRotateF(tempMtx, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
}
shim_guMtxCatF(sp58, sp18, sp98);
shim_guScaleF(sp58, data->unk_1C, data->unk_20, 1.0f);
shim_guMtxCatF(sp58, sp98, sp98);
shim_guMtxCatF(tempMtx, translateMtx, transformMtx);
shim_guScaleF(tempMtx, data->scale.x, data->scale.y, 1.0f);
shim_guMtxCatF(tempMtx, transformMtx, transformMtx);
if (type == 0) {
shim_guTranslateF(sp58, (-(data->unk_1C - data->unk_24) / data->unk_24) * 10.0f, 0.0f, 0.0f);
shim_guMtxCatF(sp58, sp98, sp98);
shim_guTranslateF(tempMtx, (-(data->scale.x - data->unk_24) / data->unk_24) * 10.0f, 0.0f, 0.0f);
shim_guMtxCatF(tempMtx, transformMtx, transformMtx);
}
shim_guMtxF2L(sp98, &gDisplayContext->matrixStack[gMatrixListPos]);
shim_guMtxF2L(transformMtx, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMasterGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gMasterGfxPos++, D_E0076EB0[type]);

View File

@ -31,7 +31,7 @@ EffectInstance* balloon_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, s
effect->numParts = numParts;
data = shim_general_heap_malloc(numParts * sizeof(*data));
effect->data = data;
effect->data.balloon = data;
part = data;
ASSERT(data != NULL);
@ -53,7 +53,7 @@ void balloon_init(EffectInstance* effect) {
}
void balloon_update(EffectInstance* effect) {
BalloonFXData* part = (BalloonFXData*)effect->data;
BalloonFXData* part = effect->data.balloon;
part->unk_1C--;
part->unk_20++;
@ -86,7 +86,7 @@ void balloon_render(EffectInstance* effect) {
void balloon_appendGfx(void* effect) {
Matrix4f sp18;
Matrix4f sp58;
BalloonFXData* data = ((EffectInstance*)effect)->data;
BalloonFXData* data = ((EffectInstance*)effect)->data.balloon;
s32 idx = data->unk_00;
gDPPipeSync(gMasterGfxPos++);

View File

@ -46,7 +46,7 @@ void big_smoke_puff_main(f32 x, f32 y, f32 z) {
effect->numParts = numParts;
data = shim_general_heap_malloc(effect->numParts * sizeof(*data));
effect->data = data;
effect->data.bigSmokePuff = data;
ASSERT(data != NULL);
@ -75,7 +75,7 @@ void big_smoke_puff_init(EffectInstance* effect) {
}
void big_smoke_puff_update(EffectInstance* effect) {
BigSmokePuffFXData* data = effect->data;
BigSmokePuffFXData* data = effect->data.bigSmokePuff;
s32 cond = FALSE;
s32 i;
@ -121,7 +121,7 @@ void big_smoke_puff_render(EffectInstance* effect) {
void big_smoke_puff_appendGfx(void* effect) {
EffectInstance* eff = (EffectInstance*)effect;
BigSmokePuffFXData* data = ((EffectInstance*)effect)->data;
BigSmokePuffFXData* data = ((EffectInstance*)effect)->data.bigSmokePuff;
Matrix4f mtx;
s32 i;

View File

@ -16,7 +16,7 @@ void big_snowflakes_appendGfx(void* effect);
void big_snowflakes_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) {
EffectBlueprint bp;
EffectInstance* effect;
BigSnowflakeFXData* data;
BigSnowflakesFXData* data;
s32 numParts = 9;
s32 i;
@ -31,7 +31,7 @@ void big_snowflakes_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) {
effect->numParts = numParts;
data = shim_general_heap_malloc(effect->numParts * sizeof(*data));
effect->data = data;
effect->data.bigSnowflakes = data;
ASSERT(data != NULL);
@ -61,7 +61,7 @@ void big_snowflakes_init(EffectInstance* effect) {
}
void big_snowflakes_update(EffectInstance* effect) {
BigSnowflakeFXData* data = effect->data;
BigSnowflakesFXData* data = effect->data.bigSnowflakes;
s32 unk_28;
s32 i;
@ -108,7 +108,7 @@ void big_snowflakes_render(EffectInstance* effect) {
}
void big_snowflakes_appendGfx(void* effect) {
BigSnowflakeFXData* data = ((EffectInstance*)effect)->data;
BigSnowflakesFXData* data = ((EffectInstance*)effect)->data.bigSnowflakes;
Matrix4f sp18;
Matrix4f sp58;
Matrix4f sp98;

View File

@ -1,10 +1,11 @@
#include "common.h"
#include "effects_internal.h"
void blast_appendGfx(void* effect);
void blast_init(EffectInstance* effect);
void blast_update(EffectInstance* effect);
void blast_render(EffectInstance* effect);
void blast_appendGfx(void* effect);
void blast_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, s32 arg5) {
EffectBlueprint bp;
@ -24,9 +25,9 @@ void blast_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, s32 arg5) {
effect = shim_create_effect_instance(bpPtr);
effect->numParts = numParts;
part = effect->data = shim_general_heap_malloc(numParts * sizeof(*part));
part = effect->data.blast = shim_general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data != NULL);
ASSERT(effect->data.blast != NULL);
shim_mem_clear(part, numParts * sizeof(*part));
@ -48,7 +49,7 @@ void blast_init(EffectInstance* effect) {
}
void blast_update(EffectInstance* effect) {
BlastFXData* part = effect->data;
BlastFXData* part = effect->data.blast;
part->unk_20 = part->unk_18++ * 9.0f / part->unk_1C;
part->timeLeft--;

View File

@ -11,14 +11,14 @@ void bulb_glow_init(void) {
INCLUDE_ASM(s32, "effects/bulb_glow", bulb_glow_update);
void bulb_glow_render(EffectInstance* effect) {
BulbGlowFXData* effect60 = effect->data;
BulbGlowFXData* data = effect->data.bulbGlow;
RenderTask renderTask;
RenderTask* renderTaskPtr = &renderTask;
RenderTask* retTask;
renderTask.appendGfxArg = effect;
renderTask.appendGfx = bulb_glow_appendGfx;
if (effect60->unk_00 == 5) {
if (data->unk_00 == 5) {
renderTask.distance = 0;
renderTaskPtr->renderMode = RENDER_MODE_SURFACE_OPA;
} else {

View File

@ -32,7 +32,7 @@ void butterflies_appendGfx(void* effect);
EffectInstance* butterflies_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) {
EffectBlueprint bp;
EffectInstance* effect;
ButterflyFXData* part;
ButterfliesFXData* part;
s32 numParts = 1;
s32 i;
@ -45,8 +45,8 @@ EffectInstance* butterflies_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) {
effect = shim_create_effect_instance(&bp);
effect->numParts = numParts;
part = effect->data = shim_general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data != NULL);
part = effect->data.butterflies = shim_general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data.butterflies != NULL);
part->unk_04 = 1000;
part->unk_00 = arg0;
@ -69,7 +69,7 @@ void butterflies_init(EffectInstance* effect) {
}
void butterflies_update(EffectInstance* effect) {
ButterflyFXData* temp_s0;
ButterfliesFXData* temp_s0;
f32 temp_f20;
f32 temp_f20_2;
f32 temp_f22;
@ -82,7 +82,7 @@ void butterflies_update(EffectInstance* effect) {
f32 var_f22;
f32 var_f24;
temp_s0 = effect->data;
temp_s0 = effect->data.butterflies;
if (effect->flags & 0x10) {
effect->flags &= ~0x10;
temp_s0->unk_04 = 900;
@ -163,7 +163,7 @@ void butterflies_render(EffectInstance* effect) {
void butterflies_appendGfx(void* effect) {
EffectInstance* effectTemp = effect;
ButterflyFXData* data = effectTemp->data;
ButterfliesFXData* data = effectTemp->data.butterflies;
Matrix4f sp18;
Matrix4f sp58;

View File

@ -27,8 +27,8 @@ void cloud_puff_main(f32 arg0, f32 arg1, f32 arg2, f32 arg3) {
effect = shim_create_effect_instance(&bp);
effect->numParts = numParts;
part = shim_general_heap_malloc(numParts * sizeof(*part));
effect->data = part;
ASSERT(effect->data != NULL);
effect->data.cloudPuff = part;
ASSERT(effect->data.cloudPuff != NULL);
shim_mem_clear(part, numParts * sizeof(*part));
@ -60,7 +60,7 @@ void cloud_puff_init(EffectInstance* effect) {
}
void cloud_puff_update(EffectInstance* effect) {
CloudPuffFXData* part = (CloudPuffFXData*)effect->data;
CloudPuffFXData* part = effect->data.cloudPuff;
s32 cond = FALSE;
s32 i;
@ -114,7 +114,7 @@ void cloud_puff_render(EffectInstance* effect) {
void cloud_puff_appendGfx(void* effect) {
EffectInstance* effectTemp = effect;
CloudPuffFXData* part = effectTemp->data;
CloudPuffFXData* part = effectTemp->data.cloudPuff;
Matrix4f sp20;
Matrix4f sp60;
s32 i;

View File

@ -26,9 +26,9 @@ void cloud_trail_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) {
effect = shim_create_effect_instance(&bp);
effect->numParts = 1;
part = shim_general_heap_malloc(numParts * sizeof(*part));
effect->data = part;
effect->data.cloudTrail = part;
ASSERT(effect->data != NULL);
ASSERT(effect->data.cloudTrail != NULL);
shim_mem_clear(part, numParts * sizeof(*part));
@ -60,7 +60,7 @@ void cloud_trail_init(EffectInstance* effect) {
}
void cloud_trail_update(EffectInstance* effect) {
CloudTrailFXData* part = (CloudTrailFXData*)effect->data;
CloudTrailFXData* part = effect->data.cloudTrail;
s32 cond = FALSE;
s32 i;
@ -115,7 +115,7 @@ void cloud_trail_render(EffectInstance* effect) {
void cloud_trail_appendGfx(void* effect) {
EffectInstance* effectTemp = effect;
CloudTrailFXData* part = effectTemp->data;
CloudTrailFXData* part = effectTemp->data.cloudTrail;
Matrix4f sp20;
Matrix4f sp60;
s32 i;

View File

@ -96,8 +96,8 @@ void damage_indicator_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32
effect = shim_create_effect_instance(bpPtr);
effect->numParts = numParts;
effect->data = part = shim_general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data != NULL);
effect->data.damageIndicator = part = shim_general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data.damageIndicator != NULL);
part->unk_00 = arg0;
part->unk_04.x = arg1;
@ -133,7 +133,7 @@ void damage_indicator_update(EffectInstance* effect) {
s32 temp_a2;
s32 temp_t0;
s32 duration;
DamageIndicatorFXData* part = effect->data;
DamageIndicatorFXData* part = effect->data.damageIndicator;
f32 phi_f12;
s32 i;

View File

@ -29,7 +29,7 @@ EffectInstance* debuff_main(s32 arg0, f32 x, f32 y, f32 z) {
effect = shim_create_effect_instance(&bp);
effect->numParts = numParts;
effect->data = data = shim_general_heap_malloc(numParts * sizeof(*data));
effect->data.debuff = data = shim_general_heap_malloc(numParts * sizeof(*data));
ASSERT(data != NULL);
@ -83,7 +83,7 @@ void debuff_init(EffectInstance* effect) {
}
void debuff_update(EffectInstance* effect) {
DebuffFXData* data = effect->data;
DebuffFXData* data = effect->data.debuff;
s32 temp;
s32 i;
@ -132,7 +132,7 @@ void debuff_render(EffectInstance* effect) {
void debuff_appendGfx(void* effect) {
EffectInstance* eff = (EffectInstance*)effect;
DebuffFXData* data = eff->data;
DebuffFXData* data = eff->data.debuff;
Gfx* dlist = D_E00628C0[0];
Gfx* dlist2 = D_E00628C4[0];
Matrix4f sp18;

View File

@ -50,8 +50,8 @@ EffectInstance* disable_x_main(s32 type, f32 x, f32 y, f32 z, s32 arg4) {
effect = shim_create_effect_instance(&bp);
effect->numParts = numParts;
data = shim_general_heap_malloc(numParts * sizeof(*data));
effect->data = data;
ASSERT(effect->data != NULL);
effect->data.disableX = data;
ASSERT(effect->data.disableX != NULL);
data->type = type;
data->scale = 1.0f;
@ -102,7 +102,7 @@ void disable_x_init(EffectInstance* effect) {
void disable_x_update(EffectInstance* effect) {
static const f32 D_E0082D30[12] = { 5.0f, 4.0f, 4.0f, 3.0f, 2.0f, 1.0f, 0.7f, 1.2f, 1.0f, 0.0f, 0.0f, 0.0f };
DisableXFXData* data = effect->data;
DisableXFXData* data = effect->data.disableX;
s32 unk_28;
s32 unk_2C;
f32 unk_34;
@ -202,7 +202,7 @@ void disable_x_render(EffectInstance* effect) {
}
void func_E0082528(EffectInstance* effect) {
DisableXFXData* data = effect->data;
DisableXFXData* data = effect->data.disableX;
if (data->unk_04 != 0) {
func_E00828B4(effect);
@ -254,7 +254,7 @@ void func_E00826C4(DisableXFXData* data) {
}
void func_E00828B4(EffectInstance* effect) {
DisableXFXData* data = effect->data;
DisableXFXData* data = effect->data.disableX;
s32 type;
s32 unk_38;
s32 i;
@ -283,7 +283,7 @@ void func_E00828B4(EffectInstance* effect) {
}
void func_E0082A84(EffectInstance* effect) {
DisableXFXData* data = effect->data;
DisableXFXData* data = effect->data.disableX;
s32 unk_38;
s32 i;

View File

@ -15,7 +15,7 @@ void fx_75_init(void) {
INCLUDE_ASM(s32, "effects/effect_75", fx_75_update);
void fx_75_render(EffectInstance* effect) {
Effect75FXData* data = effect->data;
Effect75FXData* data = effect->data.unk_75;
RenderTask renderTask;
RenderTask* renderTaskPtr = &renderTask;
RenderTask* retTask;

View File

@ -30,8 +30,8 @@ void fx_86_appendGfx(void* effect);
EffectInstance* fx_86_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, s32 arg5) {
EffectBlueprint bp;
EffectInstance* effect;
Effect134* data;
Effect134* part;
Effect86FXData* data;
Effect86FXData* part;
s32 numParts = 1;
bp.init = fx_86_init;
@ -45,7 +45,7 @@ EffectInstance* fx_86_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, s32
effect->numParts = numParts;
data = shim_general_heap_malloc(numParts * sizeof(*data));
effect->data = data;
effect->data.unk_86 = data;
part = data;
ASSERT(data != NULL);
@ -76,7 +76,7 @@ void fx_86_init(EffectInstance* effect) {
}
void fx_86_update(EffectInstance* effect) {
Effect134* data = effect->data;
Effect86FXData* data = effect->data.unk_86;
if (effect->flags & 0x10) {
effect->flags &= ~0x10;
@ -109,7 +109,7 @@ void fx_86_render(EffectInstance* effect) {
void fx_86_appendGfx(void* effect) {
Matrix4f sp10;
Matrix4f sp50;
Effect134* part = ((EffectInstance*)effect)->data;
Effect86FXData* part = ((EffectInstance*)effect)->data.unk_86;
Camera* camera = &gCameras[gCurrentCameraID];
s32 primAlpha = part->unk_24;
s32 dlistIdx = part->unk_00;

View File

@ -55,7 +55,7 @@ INCLUDE_ASM(s32, "effects/emote", func_E0020000);
void emote_main(s32 arg0, s32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, s32 arg7, EffectInstance** arg8) {
EffectBlueprint bp;
EffectBlueprint* bpPtr = &bp;
EmoteFXData* part;
EmoteFXData* data;
EffectInstance* effect;
s32 numParts;
@ -74,39 +74,39 @@ void emote_main(s32 arg0, s32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32
effect = shim_create_effect_instance(bpPtr);
effect->numParts = numParts;
part = effect->data = shim_general_heap_malloc(numParts * sizeof(*part));
data = effect->data.emote = shim_general_heap_malloc(numParts * sizeof(*data));
ASSERT(effect->data != NULL);
part->unk_3C = arg1;
part->unk_00 = arg0;
part->unk_30 = arg0;
ASSERT(effect->data.emote != NULL);
data->unk_3C = arg1;
data->unk_00 = arg0;
data->unk_30 = arg0;
if (arg7 <= 0) {
arg7 = 10000;
}
part->unk_2C = arg7;
part->unk_34 = 0;
data->unk_2C = arg7;
data->unk_34 = 0;
if (arg0 == 1) {
s32 i;
for (i = 0; i < numParts; i++, part++) {
part->unk_10 = arg2;
part->unk_14 = arg3;
part->unk_18 = arg4;
part->unk_1C = arg6;
part->unk_20 = arg5;
part->unk_3C = arg1;
func_E0020000(part, i);
for (i = 0; i < numParts; i++, data++) {
data->unk_10 = arg2;
data->unk_14 = arg3;
data->unk_18 = arg4;
data->unk_1C = arg6;
data->unk_20 = arg5;
data->unk_3C = arg1;
func_E0020000(data, i);
}
} else {
part->unk_10 = arg2;
part->unk_14 = arg3;
part->unk_18 = arg4;
part->unk_1C = arg6;
part->unk_20 = arg5;
part->unk_3C = arg1;
func_E0020000(part, 1);
data->unk_10 = arg2;
data->unk_14 = arg3;
data->unk_18 = arg4;
data->unk_1C = arg6;
data->unk_20 = arg5;
data->unk_3C = arg1;
func_E0020000(data, 1);
}
*arg8 = effect;
}
@ -115,7 +115,7 @@ void emote_init(EffectInstance* effect) {
}
void emote_update(EffectInstance* effect) {
EmoteFXData* part = effect->data;
EmoteFXData* part = effect->data.emote;
s32 temp_a0 = D_E0020D80[part->unk_30][part->unk_34];
s32 type = part->unk_00;

View File

@ -1,10 +1,6 @@
#include "common.h"
#include "effects_internal.h"
typedef struct EndingDecalsFXData {
/* 0x00 */ s32 unk_00;
} EndingDecalsFXData; // size = 0x??
void ending_decals_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/ending_decals", ending_decals_main);
@ -15,7 +11,7 @@ void ending_decals_init(void) {
INCLUDE_ASM(s32, "effects/ending_decals", ending_decals_update);
void ending_decals_render(EffectInstance* effect) {
EndingDecalsFXData* effect52 = effect->data;
EndingDecalsFXData* data = effect->data.endingDecals;
RenderTask renderTask;
RenderTask* renderTaskPtr = &renderTask;
RenderTask* retTask;
@ -23,7 +19,7 @@ void ending_decals_render(EffectInstance* effect) {
renderTask.appendGfxArg = effect;
renderTask.appendGfx = ending_decals_appendGfx;
renderTask.distance = 10;
if (effect52->unk_00 == 0) {
if (data->unk_00 == 0) {
renderTaskPtr->renderMode = RENDER_MODE_SURFACE_OPA;
} else {
renderTaskPtr->renderMode = RENDER_MODE_2D;

View File

@ -1,10 +1,6 @@
#include "common.h"
#include "effects_internal.h"
typedef struct EnergyOrbWaveFXData {
/* 0x00 */ s32 unk_00;
} EnergyOrbWaveFXData; // size = ??
void energy_orb_wave_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/energy_orb_wave", energy_orb_wave_main);
@ -15,7 +11,7 @@ void energy_orb_wave_init(void) {
INCLUDE_ASM(s32, "effects/energy_orb_wave", energy_orb_wave_update);
void energy_orb_wave_render(EffectInstance* effect) {
EnergyOrbWaveFXData* effect82 = effect->data;
EnergyOrbWaveFXData* effect82 = effect->data.energyOrbWave;
RenderTask renderTask;
RenderTask* retTask;
RenderTask* renderTaskPointer = &renderTask;

View File

@ -36,8 +36,8 @@ EffectInstance* fire_breath_main(
effect = shim_create_effect_instance(&bp);
effect->numParts = numParts;
data = effect->data = shim_general_heap_malloc(numParts * sizeof(*data));
ASSERT(effect->data != NULL);
data = effect->data.fireBreath = shim_general_heap_malloc(numParts * sizeof(*data));
ASSERT(effect->data.fireBreath != NULL);
data->type = type;
data->numChildren = numExtra;
@ -92,7 +92,7 @@ void fire_breath_init(EffectInstance* effect) {
}
void fire_breath_update(EffectInstance* effect) {
FireBreathFXData* data = effect->data;
FireBreathFXData* data = effect->data.fireBreath;
s32 maxLifetime;
s32 lifetime;
s32 spawnTimer;
@ -132,15 +132,15 @@ void fire_breath_update(EffectInstance* effect) {
data->endPos.z, data->numChildren - 1, data->spawnDelay, maxLifetime
);
((FireBreathFXData*)spawned->data)->primR = data->primR;
((FireBreathFXData*)spawned->data)->primG = data->primG;
((FireBreathFXData*)spawned->data)->primB = data->primB;
((FireBreathFXData*)spawned->data)->envR = data->envR;
((FireBreathFXData*)spawned->data)->envG = data->envG;
((FireBreathFXData*)spawned->data)->envB = data->envB;
((FireBreathFXData*)spawned->data)->unk_30 = ((FireBreathFXData*)spawned->data)->scale = data->unk_30;
((FireBreathFXData*)spawned->data)->unk_34 = data->unk_34;
((FireBreathFXData*)spawned->data)->scaleChangeFactor = data->scaleChangeFactor;
spawned->data.fireBreath->primR = data->primR;
spawned->data.fireBreath->primG = data->primG;
spawned->data.fireBreath->primB = data->primB;
spawned->data.fireBreath->envR = data->envR;
spawned->data.fireBreath->envG = data->envG;
spawned->data.fireBreath->envB = data->envB;
spawned->data.fireBreath->unk_30 = spawned->data.fireBreath->scale = data->unk_30;
spawned->data.fireBreath->unk_34 = data->unk_34;
spawned->data.fireBreath->scaleChangeFactor = data->scaleChangeFactor;
}
if (lifetime < 10 && data->type == FIRE_BREATH_LARGE) {
@ -159,7 +159,7 @@ void fire_breath_update(EffectInstance* effect) {
}
void fire_breath_render(EffectInstance* effect) {
FireBreathFXData* data = effect->data;
FireBreathFXData* data = effect->data.fireBreath;
RenderTask renderTask;
RenderTask* retTask;
RenderTask* renderTaskPointer = &renderTask;
@ -181,7 +181,7 @@ void fire_breath_render(EffectInstance* effect) {
void fire_breath_appendGfx(void* effect) {
Matrix4f sp18;
Matrix4f sp58;
FireBreathFXData* data = ((EffectInstance*)effect)->data;
FireBreathFXData* data = ((EffectInstance*)effect)->data.fireBreath;
s32 type = data->type;
s32 envAlpha = (data->unk_5C - (s32)data->unk_5C) * 256.0f;
Gfx* dlist = D_E006EC00[type];

View File

@ -27,9 +27,9 @@ EffectInstance* fire_flower_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg
effect = shim_create_effect_instance(&bp);
effect->numParts = numParts;
part = shim_general_heap_malloc(numParts * sizeof(*part));
effect->data = part;
effect->data.fireFlower = part;
ASSERT(effect->data != NULL);
ASSERT(effect->data.fireFlower != NULL);
part->unk_04 = 0;
part->unk_00 = arg0;

View File

@ -1,13 +1,6 @@
#include "common.h"
#include "effects_internal.h"
typedef struct FlameFXData {
/* 0x00 */ s32 unk_00;
/* 0x04 */ f32 unk_04;
/* 0x08 */ f32 unk_08;
/* 0x0C */ f32 unk_0C;
} FlameFXData; // size = 0x??
void flame_appendGfx(void* effect);
u32 D_E0040840[2] = { 0xFF6DFF5C, 0x66BFFF4B };
@ -24,7 +17,7 @@ void flame_init(void) {
INCLUDE_ASM(s32, "effects/flame", flame_update);
void flame_render(EffectInstance* effect) {
FlameFXData* effect32 = effect->data;
FlameFXData* data = effect->data.flame;
RenderTask renderTask;
RenderTask* renderTaskPtr = &renderTask;
RenderTask* retTask;
@ -34,7 +27,7 @@ void flame_render(EffectInstance* effect) {
f32 outZ;
f32 outS;
shim_transform_point(gCameras[gCurrentCameraID].perspectiveMatrix[0], effect32->unk_04, effect32->unk_08, effect32->unk_0C, 1.0f, &outX, &outY, &outZ, &outS);
shim_transform_point(gCameras[gCurrentCameraID].perspectiveMatrix[0], data->unk_04, data->unk_08, data->unk_0C, 1.0f, &outX, &outY, &outZ, &outS);
outDist = outZ + 5000;
if (outDist < 0) {

View File

@ -26,9 +26,9 @@ void floating_flower_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg4) {
effect = shim_create_effect_instance(&bp);
effect->numParts = 1;
part = effect->data = shim_general_heap_malloc(numParts * sizeof(*part));
part = effect->data.floatingFlower = shim_general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data != NULL);
ASSERT(effect->data.floatingFlower != NULL);
part->unk_00 = arg0;
part->unk_04 = arg1;
@ -76,7 +76,7 @@ void floating_flower_init(EffectInstance* effect) {
}
void floating_flower_update(EffectInstance* effect) {
FloatingFlowerFXData* data = effect->data;
FloatingFlowerFXData* data = effect->data.floatingFlower;
s32 unk_00 = data->unk_00;
if (data->unk_34 < 150) {
@ -143,7 +143,7 @@ void floating_flower_render(EffectInstance* effect) {
void floating_flower_appendGfx(void* effect) {
Matrix4f sp20, other;
EffectInstance* effectTemp = effect;
FloatingFlowerFXData* part = effectTemp->data;
FloatingFlowerFXData* part = effectTemp->data.floatingFlower;
u32 alpha;
u8 rgb, a;

View File

@ -1,11 +1,6 @@
#include "common.h"
#include "effects_internal.h"
typedef struct FloatingRockFXData {
/* 0x00 */ char unk_00[0xC];
/* 0x0C */ f32 unk_0C;
} FloatingRockFXData; // size = 0x??
void floating_rock_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/floating_rock", floating_rock_main);
@ -16,7 +11,7 @@ void floating_rock_init(void) {
INCLUDE_ASM(s32, "effects/floating_rock", floating_rock_update);
void floating_rock_render(EffectInstance *effect) {
FloatingRockFXData* effect76 = effect->data;
FloatingRockFXData* effect76 = effect->data.floatingRock;
RenderTask renderTask;
RenderTask* retTask;

View File

@ -62,8 +62,8 @@ void flower_splash_main(f32 arg0, f32 arg1, f32 arg2, f32 arg3) {
effect->numParts = numParts;
data = shim_general_heap_malloc(numParts * sizeof(*data));
effect->data = data;
ASSERT(effect->data != NULL);
effect->data.flowerSplash = data;
ASSERT(effect->data.flowerSplash != NULL);
shim_mem_clear(data, numParts * sizeof(*data));
@ -98,7 +98,7 @@ void flower_splash_init(EffectInstance* effect) {
}
void flower_splash_update(EffectInstance* effect) {
FlowerFXData* data = (FlowerFXData*)effect->data;
FlowerFXData* data = effect->data.flowerSplash;
s32 cond = FALSE;
s32 i;
@ -139,7 +139,7 @@ void func_E00104F4(EffectInstance* effect) {
void flower_splash_appendGfx(void* effect) {
EffectInstance* effectTemp = effect;
FlowerFXData* data = effectTemp->data;
FlowerFXData* data = effectTemp->data.flowerSplash;
s32 i;
gDPPipeSync(gMasterGfxPos++);

View File

@ -64,8 +64,8 @@ void flower_trail_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg
effect->numParts = numParts;
part = shim_general_heap_malloc(numParts * sizeof(*part));
effect->data = part;
ASSERT(effect->data != NULL);
effect->data.flowerTrail = part;
ASSERT(effect->data.flowerTrail != NULL);
shim_mem_clear(part, numParts * sizeof(*part));
@ -116,7 +116,7 @@ void flower_trail_init(EffectInstance* effect) {
}
void flower_trail_update(EffectInstance* effect) {
FlowerFXData* part = (FlowerFXData*)effect->data;
FlowerFXData* part = effect->data.flowerTrail;
s32 cond = FALSE;
s32 i;
@ -157,7 +157,7 @@ void func_E0012548(EffectInstance* effect) {
void flower_trail_appendGfx(void* effect) {
EffectInstance* effectTemp = effect;
FlowerFXData* part = effectTemp->data;
FlowerFXData* part = effectTemp->data.flowerTrail;
Gfx* dlist;
s32 i;

View File

@ -38,9 +38,9 @@ void footprint_main(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5,
effect = shim_create_effect_instance(&bp);
effect->numParts = 1;
part = shim_general_heap_malloc(numParts * sizeof(*part));
effect->data = part;
effect->data.footprint = part;
ASSERT(effect->data != NULL);
ASSERT(effect->data.footprint != NULL);
shim_mem_clear(part, numParts * sizeof(*part));
@ -75,7 +75,7 @@ void footprint_init(EffectInstance* effect) {
}
void footprint_update(EffectInstance* effect) {
FootprintFXData* part = (FootprintFXData*)effect->data;
FootprintFXData* part = effect->data.footprint;
s32 cond = FALSE;
s32 i;
@ -116,7 +116,7 @@ void func_E00183BC(EffectInstance* effect) {
void footprint_appendGfx(void* effect) {
EffectInstance* effectTemp = effect;
FootprintFXData* part = effectTemp->data;
FootprintFXData* part = effectTemp->data.footprint;
s32 i;
gDPPipeSync(gMasterGfxPos++);

View File

@ -23,8 +23,8 @@ EffectInstance* gather_magic_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 ar
effect = shim_create_effect_instance(&bp);
effect->numParts = numParts;
data = shim_general_heap_malloc(numParts * sizeof(*data));
effect->data = data;
ASSERT(effect->data != NULL);
effect->data.gatherMagic = data;
ASSERT(effect->data.gatherMagic != NULL);
data->unk_04 = arg0;
data->unk_1C = 0;

View File

@ -105,8 +105,8 @@ void landing_dust_main(s32 type, f32 x, f32 y, f32 z, f32 arg4) {
effect->numParts = numParts;
data = shim_general_heap_malloc(numParts * sizeof(*data));
effect->data = data;
ASSERT(effect->data != NULL);
effect->data.landingDust = data;
ASSERT(effect->data.landingDust != NULL);
shim_mem_clear(data, numParts * sizeof(*data));
@ -213,7 +213,7 @@ void landing_dust_init(EffectInstance* effect) {
}
void landing_dust_update(EffectInstance* effect) {
LandingDustFXData* data = effect->data;
LandingDustFXData* data = effect->data.landingDust;
data->unk_40 = D_E000CD24[data->unk_38][data->unk_3C++];
@ -258,7 +258,7 @@ void landing_dust_render(EffectInstance* effect) {
}
void landing_dust_appendGfx(void* effect) {
LandingDustFXData* part = ((EffectInstance*)effect)->data;
LandingDustFXData* part = ((EffectInstance*)effect)->data.landingDust;
s32 type = part->type;
s32 temp_t0 = part->unk_40;
Matrix4f mtx1;

View File

@ -21,7 +21,7 @@ f32 func_E00BC1D8(f32 arg0) {
INCLUDE_ASM(s32, "effects/lightning_bolt", lightning_bolt_update);
void lightning_bolt_render(EffectInstance *effect) {
LightningBoltFXData* effect94 = effect->data;
LightningBoltFXData* effect94 = effect->data.lightningBolt;
RenderTask renderTask;
RenderTask* retTask;
RenderTask* renderTaskPointer = &renderTask;

View File

@ -18,20 +18,6 @@ Gfx* D_E004C660[] = { D_09001038, D_090010C0, D_09001148, D_090011D0, D_09001258
s8 D_E004C67C[] = { 0xFE, 0xAC, 0xAC, 0xFE, 0xAC, 0xD5, 0xFE, 0xB4, 0x9A, 0xD5, 0xB4, 0xFE, 0xB4, 0xB4, 0xFE, 0xB4, 0xDD, 0xFE, 0xB4, 0xFE, 0xFE, 0xB4, 0xFE, 0xD5, 0xB4, 0xFE, 0xB4, 0xD5, 0xFE, 0xB4, 0xFE, 0xFE, 0xB4, 0xFE, 0xD5, 0xAC, };
typedef struct MusicNoteFXData {
/* 0x00 */ s32 unk_00;
/* 0x04 */ Vec3f pos;
/* 0x10 */ f32 unk_10;
/* 0x14 */ s32 unk_14;
/* 0x18 */ s32 timeLeft;
/* 0x1C */ s32 unk_1C;
/* 0x20 */ s32 unk_20;
/* 0x24 */ f32 unk_24;
/* 0x28 */ f32 unk_28;
/* 0x2C */ f32 unk_2C;
/* 0x30 */ f32 unk_30;
} MusicNoteFXData; // size = 0x34
void music_note_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) {
EffectBlueprint bp;
EffectBlueprint* bpPtr = &bp;
@ -50,9 +36,9 @@ void music_note_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) {
effect = shim_create_effect_instance(bpPtr);
effect->numParts = numParts;
part = effect->data = shim_general_heap_malloc(numParts * sizeof(*part));
part = effect->data.musicNote = shim_general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data != NULL);
ASSERT(effect->data.musicNote != NULL);
part->unk_00 = arg0;
part->pos.x = arg1;
@ -91,7 +77,7 @@ void music_note_init(EffectInstance* effect) {
}
void music_note_update(EffectInstance* effect) {
MusicNoteFXData* part = effect->data;
MusicNoteFXData* part = effect->data.musicNote;
s32 timeLeft;
part->timeLeft--;

View File

@ -1,21 +1,6 @@
#include "common.h"
#include "effects_internal.h"
typedef struct ShapeSpellFXData {
/* 0x00 */ s32 isChild;
/* 0x04 */ Vec3f pos;
/* 0x10 */ f32 unk_10;
/* 0x14 */ f32 unk_14;
/* 0x18 */ f32 unk_18;
/* 0x1C */ f32 unk_1C;
/* 0x20 */ f32 unk_20;
/* 0x24 */ f32 unk_24;
/* 0x28 */ f32 unk_28;
/* 0x2C */ s32 unk_2C;
/* 0x30 */ s32 timeLeft;
/* 0x34 */ s32 unk_34;
} ShapeSpellFXData; // size = 0x38
s32 D_E0024CC0[] = { 0x00FFD01A, 0x09001128, 0x090011A0, 0x784DD0FE, 0x09001150, 0x090011C8, 0xF0FE4C6E, 0x09001178, 0x090011F0, 0x00000000, 0x00000000, 0x00000000 };
void shape_spell_appendGfx(void* effect);
@ -39,9 +24,9 @@ EffectInstance* shape_spell_main(s32 isChild, f32 x, f32 y, f32 z, f32 arg4, f32
effect = shim_create_effect_instance(bpPtr);
effect->numParts = numParts;
part = effect->data = shim_general_heap_malloc(numParts * sizeof(*part));
part = effect->data.shapeSpell = shim_general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data != NULL);
ASSERT(effect->data.shapeSpell != NULL);
part->unk_2C = 0;
part->isChild = isChild;
@ -76,7 +61,7 @@ void shape_spell_init(EffectInstance* effect) {
void shape_spell_update(EffectInstance* effect) {
s32 flags = effect->flags;
ShapeSpellFXData* part = effect->data;
ShapeSpellFXData* part = effect->data.shapeSpell;
s32 isChild;
if (flags & 0x10) {
@ -101,7 +86,7 @@ void shape_spell_update(EffectInstance* effect) {
part->pos.y + part->unk_14,
part->pos.z + part->unk_18,
0.0f, 0.0f, 0.0f, 0x18
)->data;
)->data.shapeSpell;
newPart->unk_28 = part->unk_28;
}

View File

@ -24,9 +24,9 @@ void sleep_bubble_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg
effect = shim_create_effect_instance(bpPtr);
effect->numParts = numParts;
part = effect->data = shim_general_heap_malloc(numParts * sizeof(*part));
part = effect->data.sleepBubble = shim_general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data != NULL);
ASSERT(effect->data.sleepBubble != NULL);
part->unk_00 = arg0;
part->pos.x = arg1;
@ -46,7 +46,7 @@ void sleep_bubble_init(EffectInstance* effect) {
// seems extremely fake
void sleep_bubble_update(EffectInstance* effect) {
SleepBubbleFXData* part = effect->data;
SleepBubbleFXData* part = effect->data.sleepBubble;
f32* xPtr = &part->points->x;
f32* yPtr;
s32 xAngle, yAngle, i, timeLeft, unk_20;

View File

@ -42,7 +42,7 @@ EffectInstance* small_gold_sparkle_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3,
effect->numParts = numParts;
data = shim_general_heap_malloc(numParts * sizeof(*data));
effect->data = data;
effect->data.smallGoldSparkle = data;
part = data;
ASSERT(data != NULL);
@ -70,7 +70,7 @@ void small_gold_sparkle_init(EffectInstance* effect) {
}
void small_gold_sparkle_update(EffectInstance* effect) {
SmallGoldSparkleFXData* part = (SmallGoldSparkleFXData*) effect->data;
SmallGoldSparkleFXData* part = effect->data.smallGoldSparkle;
s32 i;
part->unk_14--;
@ -110,7 +110,7 @@ void small_gold_sparkle_render(EffectInstance* effect) {
}
void small_gold_sparkle_appendGfx(void* effect) {
SmallGoldSparkleFXData* part = ((EffectInstance*)effect)->data;
SmallGoldSparkleFXData* part = ((EffectInstance*)effect)->data.smallGoldSparkle;
Matrix4f sp18;
Matrix4f sp58;
Matrix4f sp98;

View File

@ -27,9 +27,9 @@ void snowflake_main(f32 arg0, f32 arg1, f32 arg2, s32 arg3, s32 arg4) {
effect = shim_create_effect_instance(&bp);
effect->numParts = 1;
part = effect->data = shim_general_heap_malloc(numParts * sizeof(*part));
part = effect->data.snowflake = shim_general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data != NULL);
ASSERT(effect->data.snowflake != NULL);
part->xPos = arg0;
part->yPos = arg1;
@ -58,7 +58,7 @@ void snowflake_init(EffectInstance* effect) {
}
void snowflake_update(EffectInstance* effect) {
SnowflakeFXData* data = effect->data;
SnowflakeFXData* data = effect->data.snowflake;
data->unk_28--;
if (data->unk_28 < 0) {
@ -83,7 +83,7 @@ void snowflake_update(EffectInstance* effect) {
void snowflake_render(EffectInstance* effect) {
PlayerStatus* playerStatus = &gPlayerStatus;
SnowflakeFXData* effect14 = effect->data;
SnowflakeFXData* effect14 = effect->data.snowflake;
RenderTask renderTask;
RenderTask* renderTaskPtr = &renderTask;
RenderTask* retTask;
@ -120,7 +120,7 @@ void snowflake_render(EffectInstance* effect) {
void snowflake_appendGfx(void* effect) {
Matrix4f sp18, sp58, sp98, spD8, sp118;
EffectInstance* effectTemp = effect;
SnowflakeFXData* part = effectTemp->data;
SnowflakeFXData* part = effectTemp->data.snowflake;
gDPPipeSync(gMasterGfxPos++);
gSPSegment(gMasterGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(effectTemp->graphics->data));

View File

@ -40,9 +40,9 @@ EffectInstance* star_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32
effect = shim_create_effect_instance(&bp);
effect->numParts = 1;
part = effect->data = shim_general_heap_malloc(numParts * sizeof(*part));
part = effect->data.star = shim_general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data != NULL);
ASSERT(effect->data.star != NULL);
part->unk_00 = 1;
part->unk_04 = arg1;
part->unk_08 = arg2;
@ -117,7 +117,7 @@ void star_init(EffectInstance* effect) {
void star_update(EffectInstance* effect) {
PlayerStatus* playerStatus = &gPlayerStatus;
StarFXData* data = effect->data;
StarFXData* data = effect->data.star;
f32 x, y, z, length;
f32 xTemp, yTemp, zTemp;
@ -179,7 +179,7 @@ void star_update(EffectInstance* effect) {
}
void star_render(EffectInstance* effect) {
StarFXData* effect15 = effect->data;
StarFXData* effect15 = effect->data.star;
RenderTask renderTask;
RenderTask* renderTaskPtr = &renderTask;
RenderTask* retTask;

View File

@ -7,24 +7,6 @@ enum ArrowType {
ARROW_TYPE_DEF_UP = 2,
};
typedef struct StatChangeFXData {
/* 0x00 */ s32 unk_00;
/* 0x04 */ Vec3f pos;
/* 0x10 */ f32 scale;
/* 0x14 */ s32 timeLeft;
/* 0x18 */ s32 unk_18;
/* 0x1C */ s32 arrowType;
/* 0x20 */ s32 arrowValue;
/* 0x24 */ s32 unk_24;
/* 0x28 */ f32 scaleX;
/* 0x2C */ f32 scaleY;
/* 0x30 */ f32 unk_30;
/* 0x34 */ f32 unk_34;
/* 0x38 */ f32 unk_38;
/* 0x3C */ s32 unk_3C;
/* 0x40 */ s32 unk_40;
} StatChangeFXData;
typedef struct ExtraArrowDataEntry {
u8 unk_00;
u8 unk_01;
@ -148,9 +130,9 @@ EffectInstance* stat_change_main(s32 arg0, f32 x, f32 y, f32 z, f32 scale, s32 t
effect = shim_create_effect_instance(bpPtr);
effect->numParts = numParts;
part = effect->data = shim_general_heap_malloc(numParts * sizeof(*part));
part = effect->data.statChange = shim_general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data != NULL);
ASSERT(effect->data.statChange != NULL);
part->unk_00 = arg0;
part->pos.x = x;
@ -177,7 +159,7 @@ void stat_change_init(EffectInstance* effect) {
}
void stat_change_update(EffectInstance* effect) {
StatChangeFXData* part = effect->data;
StatChangeFXData* part = effect->data.statChange;
s32 old_unk18;
part->timeLeft--;

View File

@ -7,22 +7,6 @@ void tattle_window_render(EffectInstance* effect);
void func_E00D8264(EffectInstance* effect);
void func_E00D8630(EffectInstance* effect);
typedef struct TattleWindowFXData {
/* 0x00 */ s32 unk_00;
/* 0x04 */ Vec3f pos;
/* 0x10 */ s32 unk_10;
/* 0x14 */ s32 unk_14;
/* 0x18 */ f32 unk_18;
/* 0x1C */ f32 unk_1C;
/* 0x20 */ s32 unk_20;
/* 0x24 */ s32 unk_24;
/* 0x28 */ f32 unk_28;
/* 0x2C */ f32 unk_2C;
/* 0x30 */ f32 unk_30;
/* 0x34 */ u8 unk_34;
/* 0x35 */ u8 unk_35;
} TattleWindowFXData; // size = 0x38
typedef struct D_E00D8818_Entry {
s16 unk_00;
u8 unk_02;
@ -72,9 +56,9 @@ EffectInstance* tattle_window_main(s32 arg0, f32 x, f32 y, f32 z, f32 arg4, s32
effect = shim_create_effect_instance(bpPtr);
effect->numParts = numParts;
part = effect->data = shim_general_heap_malloc(numParts * sizeof(*part));
part = effect->data.tattleWindow = shim_general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data != NULL);
ASSERT(effect->data.tattleWindow != NULL);
part->unk_00 = arg0;
part->unk_14 = 0;
@ -104,7 +88,7 @@ void tattle_window_init(EffectInstance* effect) {
void tattle_window_update(EffectInstance* effect) {
s32 unk_10, unk_10_2;
s32 old_unk_14;
TattleWindowFXData* part = effect->data;
TattleWindowFXData* part = effect->data.tattleWindow;
if (effect->flags & 0x10) {
effect->flags &= ~0x10;

View File

@ -17,34 +17,6 @@ Gfx* D_E00C8710[2] = { D_09000800_3D02F0, D_090008D8_3D03C8 };
u8 D_E00C8718[8] = { 110, 150, 130, 110, 100, 95, 100, 0 };
u8 D_E00C8720[8] = { 80, 60, 80, 100, 120, 110, 100, 0 };
typedef struct ThrowSpinyFXData {
/* 0x00 */ s32 unk_00;
/* 0x04 */ Vec3f pos;
/* 0x10 */ f32 unk_10;
/* 0x14 */ f32 unk_14;
/* 0x18 */ f32 unk_18;
/* 0x1C */ f32 unk_1C;
/* 0x20 */ f32 unk_20;
/* 0x24 */ f32 unk_24;
/* 0x28 */ s32 life;
/* 0x2C */ s32 lifeDuration;
/* 0x30 */ s32 unk_30;
/* 0x34 */ s32 unk_34;
/* 0x38 */ s32 unk_38;
/* 0x3C */ s32 rgba;
/* 0x40 */ f32 unk_40;
/* 0x44 */ f32 unk_44;
/* 0x48 */ f32 gravity;
/* 0x4C */ f32 unk_4C;
/* 0x50 */ f32 yaw;
/* 0x54 */ f32 rotationSpeed;
/* 0x58 */ f32 xScale;
/* 0x5C */ f32 yScale;
/* 0x60 */ u32 state;
/* 0x64 */ s32 unk_64;
/* 0x68 */ s32 timeUntilFall; //how long until spiny falls to ground?
} ThrowSpinyFXData; //sizeof 0x6C
//during spiny surge
EffectInstance* throw_spiny_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7, s32 time) {
EffectBlueprint bp;
@ -63,8 +35,8 @@ EffectInstance* throw_spiny_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg
effect = (EffectInstance*)shim_create_effect_instance(bpPtr);
effect->numParts = numParts;
spinyObject = effect->data = shim_general_heap_malloc(numParts * sizeof(*spinyObject));
ASSERT(effect->data != NULL);
spinyObject = effect->data.throwSpiny = shim_general_heap_malloc(numParts * sizeof(*spinyObject));
ASSERT(effect->data.throwSpiny != NULL);
spinyObject->unk_00 = arg0;
spinyObject->lifeDuration = 0;
@ -114,7 +86,7 @@ void throw_spiny_init(EffectInstance* effect) {
}
void throw_spiny_update(EffectInstance* effectInstance) {
ThrowSpinyFXData* spinyObject = effectInstance->data;
ThrowSpinyFXData* spinyObject = effectInstance->data.throwSpiny;
u32 state;
f32 gravity;
s32 lifeDuration;
@ -188,7 +160,7 @@ void throw_spiny_appendGfx(void* effect) {
Matrix4f sp18;
Matrix4f sp58;
Camera* camera = &gCameras[gCurrentCameraID];
ThrowSpinyFXData* data = ((EffectInstance*)effect)->data;
ThrowSpinyFXData* data = ((EffectInstance*)effect)->data.throwSpiny;
s32 temp_s5 = data->rgba;
s32 temp_s6 = data->unk_00;
f32 scale = data->unk_40 * SPRITE_PIXEL_SCALE;

View File

@ -36,8 +36,8 @@ void walking_dust_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg
effect->numParts = numParts;
data = shim_general_heap_malloc(numParts * sizeof(*data));
effect->data = data;
ASSERT(effect->data != NULL);
effect->data.walkingDust = data;
ASSERT(effect->data.walkingDust != NULL);
shim_mem_clear(data, numParts * sizeof(*data));
data->unk_6C = arg0 == 2;
@ -61,7 +61,7 @@ void walking_dust_init(EffectInstance* effect) {
}
void walking_dust_update(EffectInstance* effect) {
WalkingDustFXData* data = (WalkingDustFXData*)effect->data;
WalkingDustFXData* data = effect->data.walkingDust;
data->unk_74 = D_E000E684[data->unk_6C][data->unk_70++];
@ -94,7 +94,7 @@ void walking_dust_render(EffectInstance* effect) {
void walking_dust_appendGfx(void* effect) {
EffectInstance* effectTemp = effect;
WalkingDustFXData* data = effectTemp->data;
WalkingDustFXData* data = effectTemp->data.walkingDust;
s32 temp_t3 = data->unk_04;
s32 temp_t4 = data->unk_74;
s32 cond = FALSE;

View File

@ -255,7 +255,7 @@ void entity_GiantChest_hide_effect(Entity* entity) {
EffectInstance* effect = chest->gotItemEffect;
if (effect != NULL) {
((GotItemOutlineFXData*)effect->data)->unk_14 = 10;
effect->data.gotItemOutline->unk_14 = 10;
}
}

View File

@ -131,19 +131,20 @@ ApiStatus func_802D7B10(Evt* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
//TODO fix this!
ApiStatus func_802D7B44(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
EffectInstance* effect = (EffectInstance*)evt_get_variable(script, *args++);
((s32*)(effect->data))[5] = 10; // offset 0x14 in GotItemOutline effect data
effect->data.gotItemOutline->unk_14 = 10;
return ApiStatus_DONE2;
}
//TODO fix this!
ApiStatus func_802D7B74(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
EffectInstance* effect = (EffectInstance*)evt_get_variable(script, *args++);
((s32*)(effect->data))[12] = 5; // offset 0x30 in unknown effect data
// function is never called, so the effect type is assumed
effect->data.gotItemOutline->unk_30 = 5;
return ApiStatus_DONE2;
}
@ -302,7 +303,7 @@ ApiStatus SetSleepBubbleTimeLeft(Evt* script, s32 isInitialCall) {
EffectInstance* effect = (EffectInstance*)evt_get_variable(script, *args++);
s32 value = evt_get_variable(script, *args++);
((SleepBubbleFXData*)(effect->data))->timeLeft = value;
effect->data.sleepBubble->timeLeft = value;
return ApiStatus_DONE2;
}

View File

@ -12,7 +12,7 @@ typedef struct UnkMsgStruct8 {
typedef MessageImageData* MessageImageDataList[1];
extern s32 D_802EF0D0;
extern IMG_BIN D_802EF0D0;
s32 D_8014C280[] = { 0x028001E0, 0x01FF0000, 0x028001E0, 0x01FF0000, };
@ -133,8 +133,8 @@ u8 D_8014C588[] = { 105, 100, 77, 57, 40, 27, 16, 8, 3, 0, 0, 0, 0, 0, 0, 0, 0,
// unsorted
extern s32 D_8015131C;
extern MessageDrawState D_80155D20;
extern s32 D_80159B50;
extern s32 D_8015C7E0;
extern IMG_BIN D_80159B50[];
extern PAL_BIN D_8015C7E0[];
// BSS
extern s32 gMsgBGScrollAmtX;
@ -150,25 +150,25 @@ extern MessageDrawState* msg_drawState;
// another file?
extern s16 D_802EB644[22];
extern s32 D_802EB670;
extern s32 D_802EBA70;
extern s32 D_802EBB70;
extern s32 D_802EC3F0;
extern s32 D_802EC5F0;
extern s32 D_802EC670;
extern s32 D_802EC6F0;
extern s32 D_802EC770;
extern s32 D_802EC7F0;
extern s32 D_802EC870[];
extern s32 D_802EC970[];
extern s32 D_802ECAB0[];
extern s32 D_802ECBF0[];
extern s32 D_802ECCF0[];
extern s32 D_802ECD10;
extern s32 D_802ECD30;
extern IMG_BIN D_802EB670[];
extern IMG_BIN D_802EBA70[];
extern IMG_BIN D_802EBB70[];
extern PAL_BIN D_802EC3F0[]; // array of several in series
extern IMG_BIN D_802EC5F0[];
extern IMG_BIN D_802EC670[];
extern IMG_BIN D_802EC6F0[];
extern IMG_BIN D_802EC770[];
extern IMG_BIN D_802EC7F0[];
extern IMG_BIN D_802EC870[];
extern IMG_BIN D_802EC970[];
extern IMG_BIN D_802ECAB0[];
extern IMG_BIN D_802ECBF0[];
extern IMG_BIN D_802ECCF0[];
extern PAL_BIN D_802ECD10[];
extern PAL_BIN D_802ECD30[];
extern s32 D_802ED550;
extern s32 D_802ED670;
extern IMG_BIN D_802ED550[];
extern PAL_BIN D_802ED670[];
extern s32 D_802ED970;
extern s32 D_802EE8D0;
extern MessageCharset* gMsgCharsets[5];
@ -1012,7 +1012,7 @@ void draw_msg(s32 msgID, s32 posX, s32 posY, s32 opacity, s32 palette, u8 style)
mallocSpace = general_heap_malloc(0x400);
dma_load_msg(msgID, mallocSpace);
printer->srcBuffer = mallocSpace;
get_msg_properties((s32)printer->srcBuffer, 0, &width, 0, 0, 0, 0, charset);
get_msg_properties((s32) printer->srcBuffer, 0, &width, 0, 0, 0, 0, charset);
printer->msgWidth = width;
}
@ -1059,7 +1059,7 @@ void msg_draw_rewind_arrow(s32 printerIndex) {
MessagePrintState* printer = &gMessagePrinters[printerIndex];
if (printer->rewindArrowBlinkCounter < 6) {
draw_ci_image_with_clipping(&D_802ED550, 24, 24, G_IM_FMT_CI, G_IM_SIZ_4b, &D_802ED670, printer->rewindArrowPos.x,
draw_ci_image_with_clipping(D_802ED550, 24, 24, G_IM_FMT_CI, G_IM_SIZ_4b, D_802ED670, printer->rewindArrowPos.x,
printer->rewindArrowPos.y, 10, 10, SCREEN_WIDTH - 20, SCREEN_HEIGHT - 20, 255);
}
@ -1150,7 +1150,6 @@ void appendGfx_message(MessagePrintState* printer, s16 posX, s16 posY, u16 addit
u16 spB6;
u8 spB8;
f32 windowScaleX;
s32* spC0;
MessageCharset* msgCharset;
f32 temp_f10;
f32 temp_f20;
@ -1199,7 +1198,8 @@ void appendGfx_message(MessagePrintState* printer, s16 posX, s16 posY, u16 addit
s32 frameAlpha;
u16 fading;
s32 phi_s0_5;
s32* phi_s6;
IMG_PTR signRaster;
PAL_PTR signPalette;
s8 phi_s2_4;
s32 phi_s3_2;
s32 phi_v0_3;
@ -1577,14 +1577,14 @@ void appendGfx_message(MessagePrintState* printer, s16 posX, s16 posY, u16 addit
msg_drawState->framePalette = 15;
temp_s1_5 = 0xFF;
if (printer->style == MSG_STYLE_SIGN) {
spC0 = &D_802EC770;
signRaster = D_802EC770;
printer->windowSize.y = 72;
msg_drawState->textColor = MSG_PAL_18;
phi_s6 = &D_802ECD10;
signPalette = D_802ECD10;
} else {
spC0 = &D_802EC7F0;
signRaster = D_802EC7F0;
msg_drawState->textColor = MSG_PAL_1C;
phi_s6 = &D_802ECD30;
signPalette = D_802ECD30;
}
msg_drawState->clipX[0] = 34;
msg_drawState->clipY[0] = 40;
@ -1611,11 +1611,11 @@ void appendGfx_message(MessagePrintState* printer, s16 posX, s16 posY, u16 addit
}
}
spAE = (u8)temp_s1_5;
draw_ci_image_with_clipping(&D_802EC5F0, 16, 16, G_IM_FMT_CI, G_IM_SIZ_4b, phi_s6, 20, 28, 10, 10, 310, 230, temp_s1_5);
draw_ci_image_with_clipping(&D_802EC670, 16, 16, G_IM_FMT_CI, G_IM_SIZ_4b, phi_s6, 284, 28, 10, 10, 310, 230, temp_s1_5);
draw_ci_image_with_clipping(&D_802EC6F0, 16, 16, G_IM_FMT_CI, G_IM_SIZ_4b, phi_s6, 20, printer->windowSize.y + 12, 10, 10, 310, 230,
draw_ci_image_with_clipping(D_802EC5F0, 16, 16, G_IM_FMT_CI, G_IM_SIZ_4b, signPalette, 20, 28, 10, 10, 310, 230, temp_s1_5);
draw_ci_image_with_clipping(D_802EC670, 16, 16, G_IM_FMT_CI, G_IM_SIZ_4b, signPalette, 284, 28, 10, 10, 310, 230, temp_s1_5);
draw_ci_image_with_clipping(D_802EC6F0, 16, 16, G_IM_FMT_CI, G_IM_SIZ_4b, signPalette, 20, printer->windowSize.y + 12, 10, 10, 310, 230,
temp_s1_5);
draw_ci_image_with_clipping(spC0, 16, 16, G_IM_FMT_CI, G_IM_SIZ_4b, phi_s6, 284, printer->windowSize.y + 12, 10, 10, 310, 230, temp_s1_5);
draw_ci_image_with_clipping(signRaster, 16, 16, G_IM_FMT_CI, G_IM_SIZ_4b, signPalette, 284, printer->windowSize.y + 12, 10, 10, 310, 230, temp_s1_5);
gDPLoadTextureTile_4b(gMasterGfxPos++, D_802EC870, G_IM_FMT_CI, 32, 0, 0, 0, 31, 15, 0, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMIRROR | G_TX_WRAP, 5, 4, G_TX_NOLOD, G_TX_NOLOD);
gSPTextureRectangle(gMasterGfxPos++, 0x0090, 0x0070, 0x0470, 0x00B0, G_TX_RENDERTILE, 0, 0, 0x0400, 0x0400);
@ -1870,7 +1870,7 @@ void appendGfx_message(MessagePrintState* printer, s16 posX, s16 posY, u16 addit
imgDrawPosY = (s16)((msg_drawState->nextPos[1] + (msg_drawState->textStartPos[1] + (printer->windowBasePos.y + posY))) -
additionalOffsetY);
draw_ci_image_with_clipping(&D_80159B50, 32, 32, G_IM_FMT_CI, G_IM_SIZ_4b, &D_8015C7E0, imgDrawPosX, imgDrawPosY, msg_drawState->clipX[0],
draw_ci_image_with_clipping(D_80159B50, 32, 32, G_IM_FMT_CI, G_IM_SIZ_4b, D_8015C7E0, imgDrawPosX, imgDrawPosY, msg_drawState->clipX[0],
msg_drawState->clipY[0], msg_drawState->clipX[1] - msg_drawState->clipX[0],
msg_drawState->clipY[1] - msg_drawState->clipY[0], phi_t3);
msg_drawState->printModeFlags |= MSG_PRINT_FLAG_10;
@ -2585,22 +2585,22 @@ void msg_draw_speech_bubble(
gDPSetTextureLUT(gMasterGfxPos++, G_TT_RGBA16);
gDPSetTextureImage(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1,
(msg_drawState->framePalette << 5) + (s8*)&D_802EC3F0); // TODO fix (array?)
&D_802EC3F0[16 * msg_drawState->framePalette]);
gDPTileSync(gMasterGfxPos++);
gDPSetTile(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 0x0100, G_TX_LOADTILE, 0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
gDPLoadSync(gMasterGfxPos++);
gDPLoadTLUTCmd(gMasterGfxPos++, G_TX_LOADTILE, 15);
gDPPipeSync(gMasterGfxPos++);
gDPLoadTextureTile_4b(gMasterGfxPos++, &D_802EB670, G_IM_FMT_CI, 32, 0, 0, 0, 31, 63, 0,
gDPLoadTextureTile_4b(gMasterGfxPos++, D_802EB670, G_IM_FMT_CI, 32, 0, 0, 0, 31, 63, 0,
G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, 5, 6, G_TX_NOLOD, G_TX_NOLOD);
gSPVertex(gMasterGfxPos++, gMsgSpeechBoxLQuad, 4, 0);
gSP2Triangles(gMasterGfxPos++, 0, 2, 1, 0, 1, 2, 3, 0);
gDPLoadTextureTile_4b(gMasterGfxPos++, &D_802EBA70, G_IM_FMT_CI, 8, 0, 0, 0, 7, 63, 0,
gDPLoadTextureTile_4b(gMasterGfxPos++, D_802EBA70, G_IM_FMT_CI, 8, 0, 0, 0, 7, 63, 0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 3, 6, G_TX_NOLOD, G_TX_NOLOD);
gSPVertex(gMasterGfxPos++, gMsgSpeechBoxMQuad, 4, 0);
gSP2Triangles(gMasterGfxPos++, 0, 2, 1, 0, 1, 2, 3, 0);
gDPLoadTextureTile_4b(gMasterGfxPos++, &D_802EBB70, G_IM_FMT_CI, 32, 0, 0, 0, 31, 63, 0,
gDPLoadTextureTile_4b(gMasterGfxPos++, D_802EBB70, G_IM_FMT_CI, 32, 0, 0, 0, 31, 63, 0,
G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, 5, 6, G_TX_NOLOD, G_TX_NOLOD);
gSPVertex(gMasterGfxPos++, gMsgSpeechBoxRQuad, 4, 0);
gSP2Triangles(gMasterGfxPos++, 0, 2, 1, 0, 1, 2, 3, 0);

View File

@ -66,7 +66,7 @@ void npc_iter_no_op(void) {
}
}
s32 _create_npc(NpcBlueprint* blueprint, s32** animList, s32 skipLoadingAnims) {
s32 _create_npc(NpcBlueprint* blueprint, u32** animList, s32 skipLoadingAnims) {
Npc* npc;
s32 i;
s32 j;
@ -172,7 +172,7 @@ s32 _create_npc_basic(NpcBlueprint* blueprint) {
return _create_npc(blueprint, NULL, FALSE);
}
s32 _create_npc_standard(NpcBlueprint* blueprint, s32** animList) {
s32 _create_npc_standard(NpcBlueprint* blueprint, u32** animList) {
_create_npc(blueprint, animList, FALSE);
}
@ -935,7 +935,7 @@ void disable_npc_shadow(Npc* npc) {
}
}
void set_npc_sprite(Npc* npc, s32 anim, s32** extraAnimList) {
void set_npc_sprite(Npc* npc, s32 anim, u32** extraAnimList) {
ASSERT((npc->flags & NPC_FLAG_1000000) || spr_free_sprite(npc->spriteInstanceID) == 0);
npc->extraAnimList = extraAnimList;
@ -1247,7 +1247,7 @@ void npc_remove_decoration_none(Npc* npc, s32 idx) {
}
void npc_update_decoration_bowser_aura(Npc* npc, s32 idx) {
EffectInstanceData* instanceData;
AuraFXData* data;
switch (npc->decorationInitialised[idx]) {
case 0:
@ -1260,17 +1260,17 @@ void npc_update_decoration_bowser_aura(Npc* npc, s32 idx) {
return;
}
instanceData = npc->decorations[idx]->data;
instanceData->pos.x = npc->pos.x;
instanceData->pos.y = npc->pos.y;
instanceData->pos.z = npc->pos.z;
instanceData->scale.x = (npc->scale.x * npc->collisionRadius) * 0.01;
instanceData->scale.y = (npc->scale.y * npc->collisionHeight) * 0.01;
instanceData->unk_64 = npc->renderYaw;
data = npc->decorations[idx]->data.aura;
data->posA.x = npc->pos.x;
data->posA.y = npc->pos.y;
data->posA.z = npc->pos.z;
data->scale.x = (npc->scale.x * npc->collisionRadius) * 0.01;
data->scale.y = (npc->scale.y * npc->collisionHeight) * 0.01;
data->renderYaw = npc->renderYaw;
}
void npc_remove_decoration_bowser_aura(Npc* npc, s32 idx) {
((EffectInstanceData*)npc->decorations[idx]->data)->unk_2C = 5;
npc->decorations[idx]->data.aura->fadeTime = 5;
}
void npc_update_decoration_sweat(Npc* npc, s32 idx) {
@ -1298,7 +1298,7 @@ void npc_remove_decoration_sweat(Npc* npc, s32 idx) {
}
void npc_update_decoration_seeing_stars(Npc* npc, s32 idx) {
EffectInstanceData* instanceData;
StarsOrbitingFXData* data;
switch (npc->decorationInitialised[idx]) {
case 0:
@ -1312,10 +1312,10 @@ void npc_update_decoration_seeing_stars(Npc* npc, s32 idx) {
}
instanceData = npc->decorations[idx]->data;
instanceData->pos.x = npc->pos.x;
instanceData->pos.y = npc->pos.y + npc->collisionHeight;
instanceData->pos.z = npc->pos.z;
data = npc->decorations[idx]->data.starsOrbiting;
data->pos.x = npc->pos.x;
data->pos.y = npc->pos.y + npc->collisionHeight;
data->pos.z = npc->pos.z;
}
void npc_remove_decoration_seeing_stars(Npc* npc, s32 idx) {
@ -1323,20 +1323,19 @@ void npc_remove_decoration_seeing_stars(Npc* npc, s32 idx) {
}
void npc_update_decoration_glow_in_front(Npc* npc, s32 idx) {
EffectInstanceData* instanceData;
EnergyOrbWaveFXData* data;
switch (npc->decorationInitialised[idx]) {
case 0:
npc->decorations[idx] = fx_energy_orb_wave(2, npc->pos.x, npc->pos.y + npc->collisionHeight * 0.5, npc->pos.z,
npc->scale.x * 0.8 + 0.2f, -1);
npc->decorations[idx] = fx_energy_orb_wave(2, npc->pos.x, npc->pos.y + npc->collisionHeight * 0.5, npc->pos.z, npc->scale.x * 0.8 + 0.2f, -1);
npc->decorationInitialised[idx] = 1;
break;
case 1:
instanceData = npc->decorations[idx]->data;
instanceData->pos.x = npc->pos.x;
instanceData->pos.y = npc->pos.y + npc->collisionHeight * 0.5 * npc->scale.x;
instanceData->pos.z = npc->pos.z;
instanceData->unk_30 = npc->scale.x * 0.8 + 0.2f;
data = npc->decorations[idx]->data.energyOrbWave;
data->pos.x = npc->pos.x;
data->pos.y = npc->pos.y + npc->collisionHeight * 0.5 * npc->scale.x;
data->pos.z = npc->pos.z;
data->scale = npc->scale.x * 0.8 + 0.2f;
break;
}
}
@ -1346,20 +1345,19 @@ void npc_remove_decoration_glow_in_front(Npc* npc, s32 idx) {
}
void npc_update_decoration_glow_behind(Npc* npc, s32 idx) {
EffectInstanceData* instanceData;
EnergyOrbWaveFXData* data;
switch (npc->decorationInitialised[idx]) {
case 0:
npc->decorations[idx] = fx_energy_orb_wave(2, npc->pos.x, npc->pos.y + npc->collisionHeight * 0.5, npc->pos.z - 5.0f, 1.0f,
0);
npc->decorations[idx] = fx_energy_orb_wave(2, npc->pos.x, npc->pos.y + npc->collisionHeight * 0.5, npc->pos.z - 5.0f, 1.0f, 0);
npc->decorationInitialised[idx] = 1;
break;
case 1:
instanceData = npc->decorations[idx]->data;
instanceData->pos.x = npc->pos.x;
instanceData->pos.y = npc->pos.y + npc->collisionHeight * 0.5;
instanceData->pos.z = npc->pos.z - 5.0f;
instanceData->unk_30 = 1.0f;
data = npc->decorations[idx]->data.energyOrbWave;
data->pos.x = npc->pos.x;
data->pos.y = npc->pos.y + npc->collisionHeight * 0.5;
data->pos.z = npc->pos.z - 5.0f;
data->scale = 1.0f;
break;
}
}

View File

@ -94,7 +94,7 @@ PlayerSpriteSet spr_playerSpriteSets[] = {
void spr_appendGfx_component_flat(
Quad* vertices,
void* raster, void* palette,
IMG_PTR raster, PAL_PTR palette,
s32 width, s32 height,
f32 arg5,
Matrix4f mtx,
@ -702,7 +702,7 @@ s32 spr_get_npc_raster_info(SpriteRasterInfo* out, s32 npcSpriteID, s32 rasterIn
return FALSE;
}
u16** spr_get_npc_palettes(s32 npcSpriteID) {
PAL_PTR* spr_get_npc_palettes(s32 npcSpriteID) {
SpriteAnimData* sprite = spr_npcSprites[npcSpriteID];
if (sprite != NULL) {

View File

@ -70,7 +70,7 @@ typedef struct PlayerSpriteSet {
/// Sprite data header.
typedef struct SpriteAnimData {
/* 0x00 */ SpriteRasterCacheEntry** rastersOffset;
/* 0x04 */ u16** palettesOffset;
/* 0x04 */ PAL_PTR* palettesOffset;
/* 0x08 */ s32 maxComponents;
/* 0x0C */ s32 colorVariations;
} SpriteAnimData; // size = 0x10
@ -104,7 +104,7 @@ void spr_update_player_raster_cache(void);
s32 spr_update_player_sprite(s32 arg0, s32 arg1, f32 arg2);
s32 spr_draw_player_sprite(s32 spriteInstanceID, s32 yaw, s32 arg2, s16** paletteList, Matrix4f mtx);
s32 spr_draw_player_sprite(s32 spriteInstanceID, s32 yaw, s32 arg2, PAL_PTR* paletteList, Matrix4f mtx);
s32 func_802DDEC4(s32 arg0);
@ -119,11 +119,11 @@ void spr_get_player_raster_info(SpriteRasterInfo* out, s32 playerSpriteID, s32 r
u16** spr_get_player_palettes(s32 spriteIndex);
/// @param animID - Set MSB for tail allocation (i.e. `0x80XXYYZZ`)
s32 spr_load_npc_sprite(s32 animID, s32* extraAnimList);
s32 spr_load_npc_sprite(s32 animID, u32* extraAnimList);
s32 spr_update_sprite(s32 spriteInstanceID, s32 animID, f32 timeScale);
s32 spr_draw_npc_sprite(s32 spriteInstanceID, s32 yaw, s32 arg2, s16** paletteList, Matrix4f mtx);
s32 spr_draw_npc_sprite(s32 spriteInstanceID, s32 yaw, s32 arg2, PAL_PTR* paletteList, Matrix4f mtx);
s32 func_802DE5C8(s32 arg0);

View File

@ -15,6 +15,7 @@ extern u8 N(CreditsMessageBuffers)[23][256];
extern Mtx N(CreditsProjMatrices)[2];
s32 msg_get_print_char_width(s32 character, s32 charset, s32 variation, f32 msgScale, s32 overrideCharWidth, u8 flags);
void msg_get_glyph(s32 font, s32 variation, s32 charIndex, s32 palette, MesasgeFontGlyphData* out);
void dma_load_msg(u32 msgID, void* dest);
#include "world/common/atomic/Credits_1.inc.c"
@ -40,7 +41,7 @@ void N(credits_update_line)(CreditsLine* line) {
line->state = 0;
}
get_msg_properties(line->message, &msgHeight, &msgWidth, &msgMaxLineChars, NULL, NULL, NULL, 0);
get_msg_properties((s32) line->message, &msgHeight, &msgWidth, &msgMaxLineChars, NULL, NULL, NULL, 0);
curChar->font = 0;
curChar->variation = 0;
@ -235,7 +236,7 @@ void N(credits_update_line)(CreditsLine* line) {
if ((line->state == CREDITS_LINE_APPEARING) && doneCurrentState) {
s32 temp = 0;
get_msg_properties(line->message, NULL, NULL, &temp, NULL, NULL, NULL, 0);
get_msg_properties((s32) line->message, NULL, NULL, &temp, NULL, NULL, NULL, 0);
line->time = 0;
line->state++;
if (line->holdTime <= 0) {
@ -281,7 +282,7 @@ ApiStatus func_80242744_DF9144(Evt* script, s32 isInitialCall) {
s32 heapSize = evt_get_variable(script, *args++);
s32 outVar = *args++;
evt_set_variable(script, outVar, _heap_malloc(&gSpriteHeapPtr, heapSize));
evt_set_variable(script, outVar, (s32) _heap_malloc(&gSpriteHeapPtr, heapSize));
return ApiStatus_DONE2;
}
@ -289,7 +290,7 @@ ApiStatus func_802427A4_DF91A4(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 pointer = *args++;
_heap_free(&gSpriteHeapPtr, evt_get_variable(script, pointer));
_heap_free(&gSpriteHeapPtr, (void*) evt_get_variable(script, pointer));
return ApiStatus_DONE2;
}

View File

@ -1,14 +1,3 @@
#include "end_00.h"
#include "battle/battle.h"
#include "world/common/PlayFX3D.inc.c"
INCLUDE_ASM(s32, "world/area_end/end_00/DF9300", func_80242A30_DF9430);
ApiStatus func_80242AD4_DF94D4(Evt *script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
EffectInstance* effect = (EffectInstance*) evt_get_variable(script, *args++);
// TODO figure out the correct effect data struct
((s32*) effect->data)[1] = 1;
return ApiStatus_DONE2;
}

Some files were not shown because too many files have changed in this diff Show More