mirror of
https://github.com/pmret/papermario.git
synced 2025-02-09 00:51:42 +01:00
fold doc 1 (#1009)
* minor fold cleanup * fold doc I * enough * rename * last --------- Co-authored-by: HailSanta <Hail2Santa@gmail.com>
This commit is contained in:
parent
314c4ef423
commit
93ed912319
@ -256,7 +256,7 @@ typedef struct Npc {
|
||||
/* 0x09C */ s16 foldArg2;
|
||||
/* 0x09E */ s16 foldArg3;
|
||||
/* 0x0A0 */ s16 foldArg4;
|
||||
/* 0x0A2 */ u16 foldArg5;
|
||||
/* 0x0A2 */ u16 foldFlags;
|
||||
/* 0x0A4 */ s8 npcID;
|
||||
/* 0x0A5 */ char unk_A5;
|
||||
/* 0x0A6 */ s16 collisionRadius;
|
||||
|
@ -275,8 +275,8 @@
|
||||
#define GetSelfVar dead_GetSelfVar
|
||||
#define GetPlayerTargetYaw dead_GetPlayerTargetYaw
|
||||
#define HidePlayerShadow dead_HidePlayerShadow
|
||||
#define func_802D286C dead_func_802D286C
|
||||
#define func_802D2520 dead_func_802D2520
|
||||
#define SetPlayerFoldFlags dead_SetPlayerFoldFlags
|
||||
#define UpdatePlayerFold dead_UpdatePlayerFold
|
||||
#define SetPlayerFlagBits dead_SetPlayerFlagBits
|
||||
#define func_80044238 dead_func_80044238
|
||||
#define SetCamType dead_SetCamType
|
||||
@ -322,7 +322,7 @@
|
||||
#define GetSelfAnimationFromTable dead_GetSelfAnimationFromTable
|
||||
#define EVS_NpcHitRecoil dead_EVS_NpcHitRecoil
|
||||
#define SelfEnemyOverrideSyncPos dead_SelfEnemyOverrideSyncPos
|
||||
#define func_802CFD30 dead_func_802CFD30
|
||||
#define SetNpcFoldParams dead_SetNpcFoldParams
|
||||
#define SetGroupVisibility dead_SetGroupVisibility
|
||||
#define Entity_HeartBlock dead_Entity_HeartBlock
|
||||
#define GetCamDistance dead_GetCamDistance
|
||||
|
@ -5963,15 +5963,16 @@ enum FoldStateFlags {
|
||||
FOLD_STATE_FLAG_ENABLED = 0x00000001,
|
||||
FOLD_STATE_FLAG_G_CULL_BACK = 0x00000002,
|
||||
FOLD_STATE_FLAG_G_CULL_FRONT = 0x00000004,
|
||||
FOLD_STATE_FLAG_10 = 0x00000010,
|
||||
FOLD_STATE_FLAG_20 = 0x00000020,
|
||||
FOLD_STATE_FLAG_8 = 0x00000008,
|
||||
FOLD_STATE_FLAG_SKIP_GFX_SETUP = 0x00000010,
|
||||
FOLD_STATE_FLAG_SKIP_TEX_SETUP = 0x00000020,
|
||||
FOLD_STATE_FLAG_40 = 0x00000040,
|
||||
FOLD_STATE_FLAG_80 = 0x00000080,
|
||||
FOLD_STATE_FLAG_100 = 0x00000100,
|
||||
FOLD_STATE_FLAG_LOOP_ANIM = 0x00000080,
|
||||
FOLD_STATE_FLAG_REVERSE_ANIM = 0x00000100, // fold animation plays backwards (from end to start)
|
||||
FOLD_STATE_FLAG_200 = 0x00000200,
|
||||
FOLD_STATE_FLAG_400 = 0x00000400,
|
||||
FOLD_STATE_FLAG_800 = 0x00000800,
|
||||
FOLD_STATE_FLAG_1000 = 0x00001000,
|
||||
FOLD_STATE_FLAG_ANIM_DONE = 0x00001000,
|
||||
FOLD_STATE_FLAG_2000 = 0x00002000,
|
||||
FOLD_STATE_FLAG_4000 = 0x00004000,
|
||||
FOLD_STATE_FLAG_8000 = 0x00008000,
|
||||
@ -5983,50 +5984,73 @@ enum FoldStateFlags {
|
||||
};
|
||||
|
||||
typedef enum FoldType {
|
||||
FOLD_TYPE_NONE = 0x0,
|
||||
FOLD_TYPE_1 = 0x1,
|
||||
FOLD_TYPE_2 = 0x2,
|
||||
FOLD_TYPE_3 = 0x3,
|
||||
FOLD_TYPE_4 = 0x4,
|
||||
FOLD_TYPE_5 = 0x5,
|
||||
FOLD_TYPE_6 = 0x6,
|
||||
FOLD_TYPE_7 = 0x7,
|
||||
FOLD_TYPE_8 = 0x8, // color overlay?
|
||||
FOLD_UPD_CLEAR = 0x0, // or FOLD_UPD_INIT?
|
||||
FOLD_TYPE_1 = 0x1, // unused?
|
||||
FOLD_TYPE_2 = 0x2, // unused?
|
||||
FOLD_TYPE_3 = 0x3, // after goomba 'sticker' ambush in kmr_09 unfurls
|
||||
FOLD_UPD_WAVY = 0x4, // Kolorado when injured and Sushie when underwater (* note: Sushie fold rendering is bugged and only occurs *before* going underwater)
|
||||
FOLD_UPD_SET_ANIM = 0x5,
|
||||
FOLD_UPD_SET_COLOR = 0x6, // modulate color (args: R, G, B)
|
||||
FOLD_UPD_SET_ALPHA = 0x7, // modulate alpha (args: A)
|
||||
FOLD_UPD_SET_TINT = 0x8, // modulate color+alpha (args: R, G, B, A)
|
||||
FOLD_TYPE_9 = 0x9,
|
||||
FOLD_TYPE_A = 0xA,
|
||||
FOLD_TYPE_B = 0xB,
|
||||
FOLD_TYPE_C = 0xC,
|
||||
FOLD_TYPE_D = 0xD, // noisy hologram -- used for ghostly star spirits and merlar
|
||||
FOLD_UPD_COLOR_BUF_SET_B = 0xB,
|
||||
FOLD_UPD_COLOR_BUF_SET_C = 0xC,
|
||||
FOLD_UPD_HOLOGRAM = 0xD, // ghostly star spirits and merlar (args: ???, staticAmt, ???, alphaAmt)
|
||||
FOLD_TYPE_E = 0xE,
|
||||
FOLD_TYPE_F = 0xF,
|
||||
FOLD_TYPE_10 = 0x10,
|
||||
FOLD_TYPE_11 = 0x11,
|
||||
FOLD_TYPE_10 = 0x10, // unused?
|
||||
FOLD_UPD_ALLOC_COLOR_BUF = 0x11, // args: count
|
||||
} FoldType;
|
||||
|
||||
typedef enum FoldAnim {
|
||||
FOLD_ANIM_SHOCK = 0x00, // used for Goombaria and Goompapa when Kammy drops the hammer block
|
||||
FOLD_ANIM_SHIVER = 0x01, // used when Goombaria gives Mario a kiss
|
||||
FOLD_ANIM_VERTICAL_PIPE_CURL = 0x02, // vertical pipe curl
|
||||
FOLD_ANIM_HORIZONTAL_PIPE_CURL = 0x03, // horizontal pipe curl
|
||||
FOLD_ANIM_STARTLE = 0x04, // used when Koopa Bros are surprised by Mario
|
||||
FOLD_ANIM_FLUTTER_DOWN = 0x05, // player falling like paper
|
||||
FOLD_ANIM_UNFURL = 0x06, // used by Goomba 'stickers' that ambush Mario in area_kmr
|
||||
FOLD_ANIM_GET_IN_BED = 0x07, // Mario gets into bed
|
||||
FOLD_ANIM_SPIRIT_CAPTURE = 0x08, // Eldstar being captured
|
||||
FOLD_ANIM_UNUSED_1 = 0x09, // unused
|
||||
FOLD_ANIM_UNUSED_2 = 0x0A, // unused
|
||||
FOLD_ANIM_UNUSED_3 = 0x0B, // unused
|
||||
FOLD_ANIM_TUTANKOOPA_GATHER = 0x0C, // tutankoopa 3
|
||||
FOLD_ANIM_TUTANKOOPA_SWIRL_2 = 0x0D, // tutankoopa 2
|
||||
FOLD_ANIM_TUTANKOOPA_SWIRL_1 = 0x0E, // tutankoopa 1
|
||||
FOLD_ANIM_SHUFFLE_CARDS = 0x0F, // merlee spell-casting card shuffle
|
||||
FOLD_ANIM_FLIP_CARD_1 = 0x10, // merlee spell-casting card flip 1
|
||||
FOLD_ANIM_FLIP_CARD_2 = 0x11, // merlee spell-casting card flip 2
|
||||
FOLD_ANIM_FLIP_CARD_3 = 0x12, // merlee spell-casting card flip 3
|
||||
FOLD_ANIM_CYMBAL_CRUSH = 0x13, // used when Mario is crushed in a Cymbal Plant
|
||||
} FoldAnim;
|
||||
|
||||
typedef enum FoldRenderType {
|
||||
FOLD_RENDER_TYPE_0 = 0x0,
|
||||
FOLD_RENDER_TYPE_1 = 0x1,
|
||||
FOLD_RENDER_TYPE_2 = 0x2,
|
||||
FOLD_RENDER_TYPE_3 = 0x3,
|
||||
FOLD_RENDER_TYPE_4 = 0x4,
|
||||
FOLD_RENDER_TYPE_5 = 0x5,
|
||||
FOLD_RENDER_TYPE_6 = 0x6,
|
||||
FOLD_RENDER_TYPE_7 = 0x7,
|
||||
FOLD_RENDER_TYPE_8 = 0x8,
|
||||
FOLD_RENDER_TYPE_9 = 0x9,
|
||||
FOLD_RENDER_TYPE_A = 0xA,
|
||||
FOLD_RENDER_TYPE_B = 0xB,
|
||||
FOLD_RENDER_TYPE_C = 0xC,
|
||||
FOLD_RENDER_TYPE_D = 0xD,
|
||||
FOLD_RENDER_TYPE_E = 0xE,
|
||||
FOLD_RENDER_TYPE_F = 0xF,
|
||||
FOLD_RENDER_TYPE_10 = 0x10,
|
||||
FOLD_RENDER_TYPE_0 = 0x0,
|
||||
FOLD_RENDER_TYPE_1 = 0x1,
|
||||
FOLD_RENDER_TYPE_2 = 0x2,
|
||||
FOLD_RENDER_TYPE_3 = 0x3,
|
||||
FOLD_RENDER_TYPE_4 = 0x4,
|
||||
FOLD_RENDER_TYPE_5 = 0x5,
|
||||
FOLD_RENDER_TYPE_6 = 0x6,
|
||||
FOLD_RENDER_TYPE_7 = 0x7,
|
||||
FOLD_RENDER_TYPE_8 = 0x8,
|
||||
FOLD_RENDER_TYPE_9 = 0x9,
|
||||
FOLD_RENDER_TYPE_A = 0xA,
|
||||
FOLD_RENDER_TYPE_B = 0xB,
|
||||
FOLD_RENDER_HOLOGRAM = 0xC,
|
||||
FOLD_RENDER_TYPE_D = 0xD,
|
||||
FOLD_RENDER_TYPE_E = 0xE,
|
||||
FOLD_RENDER_TYPE_F = 0xF,
|
||||
FOLD_RENDER_TYPE_10 = 0x10,
|
||||
} FoldRenderType;
|
||||
|
||||
typedef enum FoldMeshType {
|
||||
FOLD_MESH_TYPE_0 = 0x0,
|
||||
FOLD_MESH_TYPE_1 = 0x1,
|
||||
FOLD_MESH_TYPE_2 = 0x2,
|
||||
FOLD_MESH_ANIMATED = 0x2,
|
||||
FOLD_MESH_TYPE_3 = 0x3,
|
||||
FOLD_MESH_TYPE_4 = 0x4,
|
||||
} FoldMeshType;
|
||||
|
@ -94,6 +94,7 @@
|
||||
#define MAX_WORKERS 16
|
||||
#define MAX_TEX_PANNERS 16
|
||||
#define MAX_ITEM_ENTITIES 256
|
||||
#define MAX_FOLD_STATES 90
|
||||
|
||||
#define MAX_STAR_PIECES 222
|
||||
|
||||
|
@ -594,7 +594,7 @@ s32 npc_get_collider_below(Npc* npc);
|
||||
|
||||
void func_8003D3BC(Npc* npc);
|
||||
|
||||
void func_8003D624(Npc* npc, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6);
|
||||
void npc_set_fold_params(Npc* npc, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6);
|
||||
|
||||
void spawn_surface_effects(Npc* npc, SurfaceInteractMode mode);
|
||||
|
||||
|
@ -292,8 +292,8 @@ ApiStatus func_802D2484(Evt* script, s32 isInitialCall);
|
||||
ApiStatus WaitForPlayerTouchingFloor(Evt* script, s32 isInitialCall);
|
||||
ApiStatus IsPlayerOnValidFloor(Evt* script, s32 isInitialCall);
|
||||
ApiStatus WaitForPlayerMoveToComplete(Evt* script, s32 isInitialCall);
|
||||
ApiStatus func_802CFE2C(Evt* script, s32 isInitialCall);
|
||||
ApiStatus func_802CFD30(Evt* script, s32 isInitialCall);
|
||||
ApiStatus SetNpcFoldFlags(Evt* script, s32 isInitialCall);
|
||||
ApiStatus SetNpcFoldParams(Evt* script, s32 isInitialCall);
|
||||
ApiStatus IsStartingConversation(Evt* script, s32 isInitialCall);
|
||||
ApiStatus SetTimeFreezeMode(Evt* script, s32 isInitialCall);
|
||||
ApiStatus CreateVirtualEntity(Evt* script, s32 isInitialCall);
|
||||
@ -327,8 +327,8 @@ ApiStatus func_802CF56C(Evt* script, s32 isInitialCall);
|
||||
ApiStatus func_802CA988(Evt* script, s32 isInitialCall);
|
||||
ApiStatus SetNpcRotationPivot(Evt* script, s32 isInitialCall);
|
||||
ApiStatus SetSleepBubbleTimeLeft(Evt* script, s32 isInitialCall);
|
||||
ApiStatus func_802D286C(Evt* script, s32 isInitialCall);
|
||||
ApiStatus func_802D2520(Evt* script, s32 isInitialCall);
|
||||
ApiStatus SetPlayerFoldFlags(Evt* script, s32 isInitialCall);
|
||||
ApiStatus UpdatePlayerFold(Evt* script, s32 isInitialCall);
|
||||
ApiStatus PushSong(Evt* script, s32 isInitialCall);
|
||||
ApiStatus PopSong(Evt* script, s32 isInitialCall);
|
||||
ApiStatus func_802D62E4(Evt* script, s32 isInitialCall);
|
||||
|
@ -1132,7 +1132,7 @@ void btl_delete_actor(Actor* actor) {
|
||||
}
|
||||
|
||||
if (part->idleAnimations != NULL) {
|
||||
func_802DE894(part->spriteInstanceID, FOLD_TYPE_NONE, 0, 0, 0, 0, 0);
|
||||
func_802DE894(part->spriteInstanceID, FOLD_UPD_CLEAR, 0, 0, 0, 0, 0);
|
||||
|
||||
ASSERT(spr_free_sprite(part->spriteInstanceID) == 0);
|
||||
|
||||
|
12
src/182B30.c
12
src/182B30.c
@ -3223,9 +3223,9 @@ void func_8025C8A0(s32 isNpcSprite, ActorPart* part, s32 yaw, s32 arg3) {
|
||||
if (part->decorationTable->unk_751 != 0) {
|
||||
part->decorationTable->unk_751 = 0;
|
||||
if (isNpcSprite == SPRITE_MODE_PLAYER) {
|
||||
func_802DDFF8(PLAYER_SPRITE_MAIN, FOLD_TYPE_NONE, 0, 0, 0, 0, 0);
|
||||
func_802DDFF8(PLAYER_SPRITE_MAIN, FOLD_UPD_CLEAR, 0, 0, 0, 0, 0);
|
||||
} else {
|
||||
func_802DE894(part->spriteInstanceID, FOLD_TYPE_NONE, 0, 0, 0, 0, 0);
|
||||
func_802DE894(part->spriteInstanceID, FOLD_UPD_CLEAR, 0, 0, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3246,9 +3246,9 @@ void func_8025C918(s32 isNpcSprite, ActorPart* part, s32 yaw, s32 arg3) {
|
||||
decor->unk_751 = 0;
|
||||
decor->unk758 = 0;
|
||||
if (isNpcSprite == SPRITE_MODE_PLAYER) {
|
||||
func_802DDFF8(0, FOLD_TYPE_11, 20, 0, 0, 255, 0);
|
||||
func_802DDFF8(PLAYER_SPRITE_MAIN, FOLD_UPD_ALLOC_COLOR_BUF, 20, 0, 0, 255, 0);
|
||||
} else {
|
||||
func_802DE894(part->spriteInstanceID, FOLD_TYPE_11, 20, 0, 0, 255, 0);
|
||||
func_802DE894(part->spriteInstanceID, FOLD_UPD_ALLOC_COLOR_BUF, 20, 0, 0, 255, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3276,9 +3276,9 @@ void func_8025C918(s32 isNpcSprite, ActorPart* part, s32 yaw, s32 arg3) {
|
||||
for (i = 0; i < ARRAY_COUNT(rbuf); i++) {
|
||||
color = (rbuf[i] << 0x18) | (gbuf[i] << 0x10) | (bbuf[i] << 8) | alpha;
|
||||
if (isNpcSprite == SPRITE_MODE_PLAYER) {
|
||||
func_802DDFF8(PLAYER_SPRITE_MAIN, FOLD_TYPE_C, i, color, 0, 0xFF, 0);
|
||||
func_802DDFF8(PLAYER_SPRITE_MAIN, FOLD_UPD_COLOR_BUF_SET_C, i, color, 0, 255, 0);
|
||||
} else {
|
||||
func_802DE894(part->spriteInstanceID, FOLD_TYPE_C, i, color, 0, 0xFF, 0);
|
||||
func_802DE894(part->spriteInstanceID, FOLD_UPD_COLOR_BUF_SET_C, i, color, 0, 255, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3336,7 +3336,7 @@ ApiStatus EnableActorGlow(Evt* script, s32 isInitialCall) {
|
||||
|
||||
while (it != NULL) {
|
||||
if (it->idleAnimations != NULL) {
|
||||
func_802DE894(it->spriteInstanceID, FOLD_TYPE_NONE, 0, 0, 0, 0, 0);
|
||||
func_802DE894(it->spriteInstanceID, FOLD_UPD_CLEAR, 0, 0, 0, 0, 0);
|
||||
}
|
||||
it = it->nextPart;
|
||||
}
|
||||
|
@ -70,12 +70,12 @@ EvtScript D_800939B4 = {
|
||||
EVT_LOOP(30)
|
||||
EVT_CALL(SetNpcRotation, NPC_SELF, 0, LVar0, 0)
|
||||
EVT_CALL(func_8005DD54)
|
||||
EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_6, LVar2, LVar2, LVar2, 0)
|
||||
EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_UPD_SET_COLOR, LVar2, LVar2, LVar2, 0)
|
||||
EVT_ADD(LVar0, 30)
|
||||
EVT_WAIT(1)
|
||||
EVT_END_LOOP
|
||||
EVT_CALL(SetNpcRotation, NPC_SELF, 0, 0, 0)
|
||||
EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_6, 255, 255, 255, 0)
|
||||
EVT_CALL(SetNpcFoldParams, NPC_SELF, FOLD_UPD_SET_COLOR, 255, 255, 255, 0)
|
||||
EVT_CALL(SetNpcFlagBits, NPC_SELF, NPC_FLAG_IGNORE_CAMERA_FOR_YAW, FALSE)
|
||||
EVT_CALL(SetSelfVar, 0, 0)
|
||||
EVT_CALL(func_8005DDF0)
|
||||
|
@ -1551,7 +1551,7 @@ void appendGfx_player(void* data) {
|
||||
playerStatus->animFlags = playerStatus->animFlags & ~PA_FLAG_SHIVERING;
|
||||
playerStatus->shiverTime = 22;
|
||||
func_802DDEE4(PLAYER_SPRITE_MAIN, -1, 0, 0, 0, 0, 0, 0);
|
||||
func_802DDFF8(playerStatus->anim, 5, 1, 1, 1, 0, 0);
|
||||
func_802DDFF8(playerStatus->anim, FOLD_UPD_SET_ANIM, FOLD_ANIM_SHIVER, 1, 1, 0, 0);
|
||||
}
|
||||
|
||||
if (playerStatus->shiverTime != 0) {
|
||||
@ -1614,7 +1614,7 @@ void appendGfx_player_spin(void* data) {
|
||||
tint = 100;
|
||||
}
|
||||
|
||||
func_802DDFF8(0, FOLD_TYPE_6, tint, tint, tint, 255, 0);
|
||||
func_802DDFF8(PLAYER_SPRITE_MAIN, FOLD_UPD_SET_COLOR, tint, tint, tint, 255, 0);
|
||||
|
||||
guRotateF(rotation, yaw, 0.0f, -1.0f, 0.0f);
|
||||
guRotateF(mtx, clamp_angle(playerStatus->pitch), 0.0f, 0.0f, 1.0f);
|
||||
|
@ -31,8 +31,8 @@ void func_800E6860(void) {
|
||||
if (gPartnerStatus.partnerActionState != PARTNER_ACTION_NONE && gPartnerStatus.actingPartner == PARTNER_BOW) {
|
||||
Npc* partner = get_npc_unsafe(NPC_PARTNER);
|
||||
|
||||
func_802DDEE4(PLAYER_SPRITE_MAIN, -1, FOLD_TYPE_7, 0, 0, 0, playerStatus->alpha1, 0);
|
||||
func_8003D624(partner, FOLD_TYPE_7, playerStatus->alpha1, 0, 0, 0, 0);
|
||||
func_802DDEE4(PLAYER_SPRITE_MAIN, -1, FOLD_UPD_SET_ALPHA, 0, 0, 0, playerStatus->alpha1, 0);
|
||||
npc_set_fold_params(partner, FOLD_UPD_SET_ALPHA, playerStatus->alpha1, 0, 0, 0, 0);
|
||||
playerStatus->alpha2 = 0;
|
||||
}
|
||||
}
|
||||
|
@ -599,8 +599,6 @@ AuResult func_80053E58(s32 songID, BGMHeader* bgmFile) {
|
||||
AuGlobals* soundData;
|
||||
InitSongEntry* songInfo;
|
||||
s32 i;
|
||||
u32 data;
|
||||
u32 offset;
|
||||
u16 bkFileIndex;
|
||||
|
||||
soundData = gSoundGlobals;
|
||||
@ -614,14 +612,11 @@ AuResult func_80053E58(s32 songID, BGMHeader* bgmFile) {
|
||||
if (bkFileIndex != 0) {
|
||||
bkFileEntry = &soundData->sbnFileList[bkFileIndex];
|
||||
|
||||
offset = (bkFileEntry->offset & 0xFFFFFF) + soundData->baseRomOffset;
|
||||
fileEntry.offset = offset;
|
||||
fileEntry.offset = (bkFileEntry->offset & 0xFFFFFF) + soundData->baseRomOffset;
|
||||
fileEntry.data = bkFileEntry->data;
|
||||
|
||||
data = bkFileEntry->data;
|
||||
fileEntry.data = data;
|
||||
|
||||
if ((data >> 0x18) == AU_FMT_BK) {
|
||||
snd_load_BK(offset, i);
|
||||
if ((fileEntry.data >> 0x18) == AU_FMT_BK) {
|
||||
snd_load_BK(fileEntry.offset, i);
|
||||
} else {
|
||||
status = AU_ERROR_SBN_FORMAT_MISMATCH;
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ Instrument* au_get_instrument(AuGlobals* globals, u32 bank, u32 patch, EnvelopeD
|
||||
void au_get_bgm_player_and_file(u32 playerIndex, BGMHeader** outCurrentTrackData, BGMPlayer** outPlayer);
|
||||
void au_get_bgm_player(u32 playerIndex, BGMPlayer** outPlayer);
|
||||
AuResult au_load_song_files(u32 arg0, BGMHeader* arg1, BGMPlayer* arg2);
|
||||
AuResult func_80053E58(s32 arg0, BGMHeader* arg1);
|
||||
AuResult func_80053E58(s32 songID, BGMHeader* arg1);
|
||||
BGMPlayer* func_80053F64(s32 arg0);
|
||||
AuResult au_ambient_load(u32 arg0);
|
||||
BGMPlayer* func_80054248(u8 arg0);
|
||||
|
@ -149,16 +149,16 @@ FoldImageRecPart D_8021A2B8_63F498 = {
|
||||
API_CALLABLE(func_80218000_63D1E0) {
|
||||
ActorPart* part = get_actor_part(get_actor(script->owner1.actorID), 1);
|
||||
s32 i;
|
||||
u8 sp20[20];
|
||||
u8 sp38[20];
|
||||
u8 sp50[20];
|
||||
u8 sp68[20];
|
||||
u8 colR[20];
|
||||
u8 colG[20];
|
||||
u8 colB[20];
|
||||
u8 colA[20];
|
||||
|
||||
if (isInitialCall) {
|
||||
script->functionTemp[1] = 0;
|
||||
script->functionTemp[2] = 0;
|
||||
script->functionTemp[0] = 0;
|
||||
func_802DE780(part->spriteInstanceID, 0, FOLD_TYPE_11, 20, 0, 0, 255, 0);
|
||||
func_802DE780(part->spriteInstanceID, 0, FOLD_UPD_ALLOC_COLOR_BUF, 20, 0, 0, 255, 0);
|
||||
}
|
||||
|
||||
func_802DE780(part->spriteInstanceID, 1, FOLD_TYPE_F, (s32)&D_8021A2B8_63F498, 255, 0, 255, 0);
|
||||
@ -168,13 +168,13 @@ API_CALLABLE(func_80218000_63D1E0) {
|
||||
}
|
||||
|
||||
for (i = 0; i < 20; i++) {
|
||||
sp20[i] = (cosine(script->functionTemp[1] + i * 25) + 1.0) * 56.0;
|
||||
sp38[i] = (cosine(script->functionTemp[1] + i * 25 + 45) + 1.0) * 56.0;
|
||||
sp50[i] = (cosine(script->functionTemp[1] + i * 25 + 90) + 1.0) * 56.0;
|
||||
colR[i] = (cosine(script->functionTemp[1] + i * 25) + 1.0) * 56.0;
|
||||
colG[i] = (cosine(script->functionTemp[1] + i * 25 + 45) + 1.0) * 56.0;
|
||||
colB[i] = (cosine(script->functionTemp[1] + i * 25 + 90) + 1.0) * 56.0;
|
||||
}
|
||||
|
||||
for (i = 0; i < 20; i++) {
|
||||
func_802DE780(part->spriteInstanceID, 0, FOLD_TYPE_C, i, sp20[i] << 0x18 | sp38[i] << 0x10 | sp50[i] << 8 | 0xFF, 0, 255, 0);
|
||||
func_802DE780(part->spriteInstanceID, 0, FOLD_UPD_COLOR_BUF_SET_C, i, colR[i] << 0x18 | colG[i] << 0x10 | colB[i] << 8 | 255, 0, 255, 0);
|
||||
}
|
||||
|
||||
return ApiStatus_BLOCK;
|
||||
|
@ -30,7 +30,7 @@ API_CALLABLE(N(UnkBowserFunc1)) {
|
||||
script->functionTemp[0] = 0;
|
||||
|
||||
for (i = 0; i < 10; i++) {
|
||||
func_802DE780(part->spriteInstanceID, i, FOLD_TYPE_11, 20, 0, 0, 255, 0);
|
||||
func_802DE780(part->spriteInstanceID, i, FOLD_UPD_ALLOC_COLOR_BUF, 20, 0, 0, 255, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -50,7 +50,7 @@ API_CALLABLE(N(UnkBowserFunc1)) {
|
||||
for (j = 0; j < 20; j++) {
|
||||
colorRGBA = sp20[j] << 0x18 | sp38[j] << 0x10 | sp50[j] << 8 | 0xFF;
|
||||
for (i = 0; i < 10; i++) {
|
||||
func_802DE780(part->spriteInstanceID, i, FOLD_TYPE_C, j, colorRGBA, 0, 255, 0);
|
||||
func_802DE780(part->spriteInstanceID, i, FOLD_UPD_COLOR_BUF_SET_C, j, colorRGBA, 0, 255, 0);
|
||||
}
|
||||
}
|
||||
return ApiStatus_BLOCK;
|
||||
@ -60,7 +60,7 @@ API_CALLABLE(N(UnkBowserFunc1)) {
|
||||
colorRGBA = 255;
|
||||
for (i = 0; i < 10; i++) {
|
||||
// TODO find better match for opacity
|
||||
func_802DE780(part->spriteInstanceID, i, FOLD_TYPE_C, j, colorRGBA, 0, opacity & 0xFFFF, 0);
|
||||
func_802DE780(part->spriteInstanceID, i, FOLD_UPD_COLOR_BUF_SET_C, j, colorRGBA, 0, opacity & 0xFFFF, 0);
|
||||
}
|
||||
}
|
||||
script->functionTemp[1] = 0;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -115,7 +115,7 @@ void entity_BlueWarpPipe_enter_pipe_init(Entity* bluePipe) {
|
||||
pipeData->timer = 25;
|
||||
playerStatus->renderMode = RENDER_MODE_ALPHATEST;
|
||||
|
||||
func_802DDFF8(ANIM_Mario1_Idle, FOLD_TYPE_5, 2, 1, 1, 0, 0);
|
||||
func_802DDFF8(ANIM_Mario1_Idle, FOLD_UPD_SET_ANIM, FOLD_ANIM_VERTICAL_PIPE_CURL, 1, 1, 0, 0);
|
||||
sfx_play_sound(SOUND_ENTER_PIPE);
|
||||
disable_player_shadow();
|
||||
}
|
||||
@ -130,7 +130,7 @@ void entity_BlueWarpPipe_enter_pipe_update(Entity* entity) {
|
||||
if (pipeData->timer == -1) {
|
||||
playerStatus->renderMode = RENDER_MODE_ALPHATEST;
|
||||
playerStatus->position.y -= 50.0f;
|
||||
func_802DDFF8(ANIM_Mario1_Idle, 0, 0, 0, 0, 0, 0);
|
||||
func_802DDFF8(ANIM_Mario1_Idle, FOLD_UPD_CLEAR, 0, 0, 0, 0, 0);
|
||||
exec_entity_commandlist(entity);
|
||||
}
|
||||
}
|
||||
|
@ -309,7 +309,7 @@ void entity_CymbalPlant_idle(Entity* entity) {
|
||||
if (--data->timer == 0) {
|
||||
data->state++;
|
||||
func_802DDEE4(PLAYER_SPRITE_MAIN, -1, 0, 0, 0, 0, 0, 0);
|
||||
func_802DDFF8(ANIM_Mario1_Idle, 5, 19, 1, 1, 0, 0);
|
||||
func_802DDFF8(ANIM_Mario1_Idle, FOLD_UPD_SET_ANIM, FOLD_ANIM_CYMBAL_CRUSH, 1, 1, 0, 0);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
|
@ -965,7 +965,7 @@ ApiStatus PartnerIsFlying(Evt* script, s32 isInitialCall) {
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
ApiStatus func_802CFD30(Evt* script, s32 isInitialCall) {
|
||||
ApiStatus SetNpcFoldParams(Evt* script, s32 isInitialCall) {
|
||||
Bytecode* args = script->ptrReadPos;
|
||||
s32 npcId = evt_get_variable(script, *args++);
|
||||
Bytecode foldType = evt_get_variable(script, *args++);
|
||||
@ -979,21 +979,21 @@ ApiStatus func_802CFD30(Evt* script, s32 isInitialCall) {
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
func_8003D624(npc, foldType, var2, var3, var4, var5, npc->foldArg5);
|
||||
npc_set_fold_params(npc, foldType, var2, var3, var4, var5, npc->foldFlags);
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
ApiStatus func_802CFE2C(Evt* script, s32 isInitialCall) {
|
||||
ApiStatus SetNpcFoldFlags(Evt* script, s32 isInitialCall) {
|
||||
Bytecode* args = script->ptrReadPos;
|
||||
s32 npcId = evt_get_variable(script, *args++);
|
||||
Bytecode arg1 = *args;
|
||||
Bytecode flags = *args;
|
||||
Npc* npc = resolve_npc(script, npcId);
|
||||
|
||||
if (npc == NULL) {
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
npc->foldArg5 = arg1;
|
||||
npc->foldFlags = flags;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "world/partners.h"
|
||||
|
||||
extern Npc playerNpcData;
|
||||
extern u16 D_802DB5B0;
|
||||
extern u16 PlayerFoldFlags;
|
||||
extern s32 D_802DB5B4[3]; // unused
|
||||
|
||||
Npc* playerNpc = &playerNpcData;
|
||||
@ -630,78 +630,78 @@ ApiStatus WaitForPlayerInputEnabled(Evt* script, s32 isInitialCall) {
|
||||
}
|
||||
}
|
||||
|
||||
ApiStatus func_802D2520(Evt* script, s32 isInitialCall) {
|
||||
ApiStatus UpdatePlayerFold(Evt* script, s32 isInitialCall) {
|
||||
Bytecode* args = script->ptrReadPos;
|
||||
PlayerStatus* playerStatus = &gPlayerStatus;
|
||||
s32 a0 = *args++;
|
||||
s32 foldType = evt_get_variable(script, *args++);
|
||||
s32 a2, a3, a4, a5;
|
||||
|
||||
func_802DDFF8(a0, FOLD_TYPE_NONE, 0, 0, 0, 0, 0);
|
||||
func_802DDFF8(a0, FOLD_UPD_CLEAR, 0, 0, 0, 0, 0);
|
||||
|
||||
switch (foldType) {
|
||||
case FOLD_TYPE_NONE:
|
||||
case FOLD_UPD_CLEAR:
|
||||
playerStatus->renderMode = RENDER_MODE_ALPHATEST;
|
||||
func_802DDFF8(a0, FOLD_TYPE_NONE, 0, 0, 0, 0, D_802DB5B0);
|
||||
func_802DDFF8(a0, FOLD_UPD_CLEAR, 0, 0, 0, 0, PlayerFoldFlags);
|
||||
break;
|
||||
case FOLD_TYPE_2:
|
||||
case FOLD_TYPE_3:
|
||||
playerStatus->renderMode = RENDER_MODE_ALPHATEST;
|
||||
case FOLD_TYPE_1:
|
||||
func_802DDFF8(a0, foldType, 0, 0, 0, 0, D_802DB5B0);
|
||||
func_802DDFF8(a0, foldType, 0, 0, 0, 0, PlayerFoldFlags);
|
||||
break;
|
||||
case FOLD_TYPE_4:
|
||||
case FOLD_UPD_WAVY:
|
||||
playerStatus->renderMode = RENDER_MODE_ALPHATEST;
|
||||
a2 = evt_get_variable(script, *args++);
|
||||
a3 = evt_get_variable(script, *args++);
|
||||
a4 = evt_get_variable(script, *args++);
|
||||
func_802DDFF8(a0, FOLD_TYPE_4, a2, a3, a4, 0, D_802DB5B0);
|
||||
func_802DDFF8(a0, FOLD_UPD_WAVY, a2, a3, a4, 0, PlayerFoldFlags);
|
||||
break;
|
||||
case FOLD_TYPE_6:
|
||||
case FOLD_UPD_SET_COLOR:
|
||||
playerStatus->renderMode = RENDER_MODE_ALPHATEST;
|
||||
a2 = evt_get_variable(script, *args++);
|
||||
a3 = evt_get_variable(script, *args++);
|
||||
a4 = evt_get_variable(script, *args++);
|
||||
func_802DDFF8(a0, FOLD_TYPE_6, a2, a3, a4, 255, D_802DB5B0);
|
||||
func_802DDFF8(a0, FOLD_UPD_SET_COLOR, a2, a3, a4, 255, PlayerFoldFlags);
|
||||
break;
|
||||
case FOLD_TYPE_7:
|
||||
case FOLD_UPD_SET_ALPHA:
|
||||
playerStatus->renderMode = RENDER_MODE_SURFACE_XLU_LAYER2;
|
||||
a5 = evt_get_variable(script, *args++);
|
||||
func_802DDFF8(a0, FOLD_TYPE_7, 255, 255, 255, a5, D_802DB5B0);
|
||||
func_802DDFF8(a0, FOLD_UPD_SET_ALPHA, 255, 255, 255, a5, PlayerFoldFlags);
|
||||
break;
|
||||
case FOLD_TYPE_8:
|
||||
case FOLD_UPD_SET_TINT:
|
||||
playerStatus->renderMode = RENDER_MODE_SURFACE_XLU_LAYER2;
|
||||
a2 = evt_get_variable(script, *args++);
|
||||
a3 = evt_get_variable(script, *args++);
|
||||
a4 = evt_get_variable(script, *args++);
|
||||
a5 = evt_get_variable(script, *args++);
|
||||
func_802DDFF8(a0, FOLD_TYPE_8, a2, a3, a4, a5, D_802DB5B0);
|
||||
func_802DDFF8(a0, FOLD_UPD_SET_TINT, a2, a3, a4, a5, PlayerFoldFlags);
|
||||
break;
|
||||
case FOLD_TYPE_5:
|
||||
case FOLD_UPD_SET_ANIM:
|
||||
playerStatus->renderMode = RENDER_MODE_ALPHATEST;
|
||||
a2 = evt_get_variable(script, *args++);
|
||||
a3 = evt_get_variable(script, *args++);
|
||||
a4 = evt_get_variable(script, *args++);
|
||||
func_802DDFF8(a0, FOLD_TYPE_5, a2, a3, a4, 0, D_802DB5B0);
|
||||
func_802DDFF8(a0, FOLD_UPD_SET_ANIM, a2, a3, a4, 0, PlayerFoldFlags);
|
||||
break;
|
||||
case FOLD_TYPE_D:
|
||||
case FOLD_UPD_HOLOGRAM:
|
||||
playerStatus->renderMode = RENDER_MODE_SURFACE_XLU_LAYER2;
|
||||
a2 = evt_get_variable(script, *args++);
|
||||
a3 = evt_get_variable(script, *args++);
|
||||
a4 = evt_get_variable(script, *args++);
|
||||
a5 = evt_get_variable(script, *args++);
|
||||
func_802DDFF8(a0, FOLD_TYPE_D, a2, a3, a4, a5, D_802DB5B0);
|
||||
func_802DDFF8(a0, FOLD_UPD_HOLOGRAM, a2, a3, a4, a5, PlayerFoldFlags);
|
||||
break;
|
||||
}
|
||||
|
||||
D_802DB5B0 = 0;
|
||||
PlayerFoldFlags = 0;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
ApiStatus func_802D286C(Evt* script, s32 isInitialCall) {
|
||||
s32 temp = *script->ptrReadPos;
|
||||
ApiStatus SetPlayerFoldFlags(Evt* script, s32 isInitialCall) {
|
||||
s32 foldFlags = *script->ptrReadPos;
|
||||
|
||||
D_802DB5B0 = temp;
|
||||
PlayerFoldFlags = foldFlags;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
|
@ -50,7 +50,7 @@ BSS s32 D_802DB26C; // unused?
|
||||
|
||||
// player_api
|
||||
BSS Npc playerNpcData;
|
||||
BSS u16 D_802DB5B0;
|
||||
BSS u16 PlayerFoldFlags;
|
||||
BSS s32 D_802DB5B4[3]; // unused
|
||||
BSS VirtualEntityList bBattleVirtualEntityList;
|
||||
BSS VirtualEntityList wWorldVirtualEntityList;
|
||||
|
@ -1511,15 +1511,15 @@ void render_hud_element(HudElement* hudElement) {
|
||||
case 1:
|
||||
if (hudElement->flags & HUD_ELEMENT_FLAG_NO_FOLD) {
|
||||
if (hudElement->flags & HUD_ELEMENT_FLAG_TRANSPARENT) {
|
||||
fold_update(0, FOLD_TYPE_7, 255, 255, 255, hudElement->opacity, 0);
|
||||
fold_update(0, FOLD_UPD_SET_ALPHA, 255, 255, 255, hudElement->opacity, 0);
|
||||
} else {
|
||||
fold_update(0, FOLD_TYPE_NONE, 0, 0, 0, 0, 0);
|
||||
fold_update(0, FOLD_UPD_CLEAR, 0, 0, 0, 0, 0);
|
||||
}
|
||||
} else {
|
||||
if (hudElement->flags & HUD_ELEMENT_FLAG_TRANSPARENT) {
|
||||
fold_update(transform->foldIdx, FOLD_TYPE_7, 255, 255, 255, hudElement->opacity, 0);
|
||||
fold_update(transform->foldIdx, FOLD_UPD_SET_ALPHA, 255, 255, 255, hudElement->opacity, 0);
|
||||
} else {
|
||||
fold_update(transform->foldIdx, FOLD_TYPE_NONE, 0, 0, 0, 0, 0);
|
||||
fold_update(transform->foldIdx, FOLD_UPD_CLEAR, 0, 0, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1534,12 +1534,12 @@ void render_hud_element(HudElement* hudElement) {
|
||||
|
||||
if (hudElement->flags & HUD_ELEMENT_FLAG_NO_FOLD) {
|
||||
if (hudElement->flags & HUD_ELEMENT_FLAG_ANTIALIASING) {
|
||||
fold_appendGfx_component(0, &sp2A0, 0x40, sp60);
|
||||
fold_appendGfx_component(0, &sp2A0, FOLD_STATE_FLAG_40, sp60);
|
||||
} else {
|
||||
fold_appendGfx_component(0, &sp2A0, 0x40, sp60);
|
||||
fold_appendGfx_component(0, &sp2A0, FOLD_STATE_FLAG_40, sp60);
|
||||
}
|
||||
} else {
|
||||
fold_appendGfx_component(transform->foldIdx, &sp2A0, 0x40, sp60);
|
||||
fold_appendGfx_component(transform->foldIdx, &sp2A0, FOLD_STATE_FLAG_40, sp60);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
|
@ -73,7 +73,7 @@ void appendGfx_ispy_icon(void) {
|
||||
foldImage.palette = ispy_icon_3_pal;
|
||||
break;
|
||||
}
|
||||
fold_update(0, FOLD_TYPE_7, 255, 255, 255, ISpyPtr->alpha, 0);
|
||||
fold_update(0, FOLD_UPD_SET_ALPHA, 255, 255, 255, ISpyPtr->alpha, 0);
|
||||
|
||||
foldImage.raster = ispy_icon_img;
|
||||
foldImage.width = ispy_icon_img_width;
|
||||
|
@ -80,9 +80,10 @@ void appendGfx_interact_prompt(void) {
|
||||
sp20.xOffset = -16;
|
||||
sp20.yOffset = 26;
|
||||
sp20.opacity = 255;
|
||||
fold_update(0, FOLD_TYPE_NONE, 0, 0, 0, 0, 0x440);
|
||||
fold_update(0, FOLD_TYPE_6,
|
||||
InspectIconPtr->brightness, InspectIconPtr->brightness, InspectIconPtr->brightness, 255, 0x448);
|
||||
fold_update(0, FOLD_UPD_CLEAR, 0, 0, 0, 0, FOLD_STATE_FLAG_400 | FOLD_STATE_FLAG_40);
|
||||
fold_update(0, FOLD_UPD_SET_COLOR,
|
||||
InspectIconPtr->brightness, InspectIconPtr->brightness, InspectIconPtr->brightness, 255,
|
||||
FOLD_STATE_FLAG_400 | FOLD_STATE_FLAG_40 | FOLD_STATE_FLAG_8);
|
||||
fold_appendGfx_component(0, &sp20, 0, sp78);
|
||||
|
||||
gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
|
||||
|
56
src/npc.c
56
src/npc.c
@ -141,7 +141,7 @@ s32 create_npc_impl(NpcBlueprint* blueprint, AnimID* animList, s32 isPeachNpc) {
|
||||
npc->animationSpeed = 1.0f;
|
||||
npc->renderYaw = 0.0f;
|
||||
npc->foldType = 0;
|
||||
npc->foldArg5 = 0;
|
||||
npc->foldFlags = 0;
|
||||
npc->collisionChannel = COLLISION_CHANNEL_20000;
|
||||
npc->isFacingAway = FALSE;
|
||||
npc->yawCamOffset = 0;
|
||||
@ -1148,7 +1148,7 @@ void appendGfx_npc_blur(void* data) {
|
||||
x = blur->x[index];
|
||||
y = blur->y[index];
|
||||
z = blur->z[index];
|
||||
func_802DE894(npc->spriteInstanceID, FOLD_TYPE_7, 255, 255, 255, 120 - (var_s5 * 20), 0);
|
||||
func_802DE894(npc->spriteInstanceID, FOLD_UPD_SET_ALPHA, 255, 255, 255, 120 - (var_s5 * 20), 0);
|
||||
yaw = npc->renderYaw;
|
||||
guTranslateF(sp20, x, y, z);
|
||||
|
||||
@ -1928,7 +1928,7 @@ void npc_update_decoration_charged(Npc* npc, s32 idx) {
|
||||
s32 temp3;
|
||||
|
||||
if (!npc->decorationInitialised[idx]) {
|
||||
func_802DE894(npc->spriteInstanceID, FOLD_TYPE_11, 20, 0, 0, 255, 0);
|
||||
func_802DE894(npc->spriteInstanceID, FOLD_UPD_ALLOC_COLOR_BUF, 20, 0, 0, 255, 0);
|
||||
npc->decorationInitialised[idx] = TRUE;
|
||||
}
|
||||
if (npc->decorationInitialised[idx] == TRUE) {
|
||||
@ -1944,7 +1944,7 @@ void npc_update_decoration_charged(Npc* npc, s32 idx) {
|
||||
}
|
||||
|
||||
for (temp3 = 255, i = 0; i < 20; i++) {
|
||||
func_802DE894(npc->spriteInstanceID, FOLD_TYPE_C, i, (sp50[i] << 24) | (sp38[i] << 16) | (sp20[i] << 8) | temp3, 0, 255, 0);
|
||||
func_802DE894(npc->spriteInstanceID, FOLD_UPD_COLOR_BUF_SET_C, i, (sp50[i] << 24) | (sp38[i] << 16) | (sp20[i] << 8) | temp3, 0, 255, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2086,76 +2086,76 @@ void func_8003D3BC(Npc* npc) {
|
||||
s32 foldArg2 = npc->foldArg2;
|
||||
s32 foldArg3 = npc->foldArg3;
|
||||
s32 foldArg4 = npc->foldArg4;
|
||||
s32 foldArg5 = npc->foldArg5;
|
||||
s32 foldFlags = npc->foldFlags;
|
||||
|
||||
func_802DE894(npc->spriteInstanceID, FOLD_TYPE_NONE, 0, 0, 0, 0, 0);
|
||||
func_802DE894(npc->spriteInstanceID, FOLD_UPD_CLEAR, 0, 0, 0, 0, 0);
|
||||
|
||||
switch (foldType) {
|
||||
case FOLD_TYPE_NONE:
|
||||
case FOLD_UPD_CLEAR:
|
||||
npc->renderMode = RENDER_MODE_ALPHATEST;
|
||||
func_802DE894(npc->spriteInstanceID, FOLD_TYPE_NONE, 0, 0, 0, 0, foldArg5);
|
||||
func_802DE894(npc->spriteInstanceID, FOLD_UPD_CLEAR, 0, 0, 0, 0, foldFlags);
|
||||
break;
|
||||
case FOLD_TYPE_2:
|
||||
case FOLD_TYPE_3:
|
||||
npc->renderMode = RENDER_MODE_ALPHATEST;
|
||||
// fallthrough
|
||||
case FOLD_TYPE_1:
|
||||
func_802DE894(npc->spriteInstanceID, foldType, 0, 0, 0, 0, foldArg5);
|
||||
func_802DE894(npc->spriteInstanceID, foldType, 0, 0, 0, 0, foldFlags);
|
||||
break;
|
||||
case FOLD_TYPE_4:
|
||||
case FOLD_UPD_WAVY:
|
||||
npc->renderMode = RENDER_MODE_ALPHATEST;
|
||||
func_802DE894(npc->spriteInstanceID, FOLD_TYPE_4, foldArg1, foldArg2, foldArg3, 0, foldArg5);
|
||||
func_802DE894(npc->spriteInstanceID, FOLD_UPD_WAVY, foldArg1, foldArg2, foldArg3, 0, foldFlags);
|
||||
break;
|
||||
case FOLD_TYPE_6:
|
||||
case FOLD_UPD_SET_COLOR:
|
||||
npc->renderMode = RENDER_MODE_ALPHATEST;
|
||||
func_802DE894(npc->spriteInstanceID, FOLD_TYPE_6, foldArg1, foldArg2, foldArg3, 255, foldArg5);
|
||||
func_802DE894(npc->spriteInstanceID, FOLD_UPD_SET_COLOR, foldArg1, foldArg2, foldArg3, 255, foldFlags);
|
||||
break;
|
||||
case FOLD_TYPE_7:
|
||||
case FOLD_UPD_SET_ALPHA:
|
||||
npc->renderMode = RENDER_MODE_SURFACE_XLU_LAYER2;
|
||||
func_802DE894(npc->spriteInstanceID, FOLD_TYPE_7, 255, 255, 255, foldArg1, foldArg5);
|
||||
func_802DE894(npc->spriteInstanceID, FOLD_UPD_SET_ALPHA, 255, 255, 255, foldArg1, foldFlags);
|
||||
break;
|
||||
case FOLD_TYPE_8:
|
||||
case FOLD_UPD_SET_TINT:
|
||||
npc->renderMode = RENDER_MODE_SURFACE_XLU_LAYER2;
|
||||
func_802DE894(npc->spriteInstanceID, FOLD_TYPE_8, foldArg1, foldArg2, foldArg3, foldArg4, foldArg5);
|
||||
func_802DE894(npc->spriteInstanceID, FOLD_UPD_SET_TINT, foldArg1, foldArg2, foldArg3, foldArg4, foldFlags);
|
||||
break;
|
||||
case FOLD_TYPE_9:
|
||||
npc->renderMode = RENDER_MODE_ALPHATEST;
|
||||
func_802DE894(npc->spriteInstanceID, FOLD_TYPE_9, foldArg1, foldArg2, foldArg3, 255, foldArg5);
|
||||
func_802DE894(npc->spriteInstanceID, FOLD_TYPE_9, foldArg1, foldArg2, foldArg3, 255, foldFlags);
|
||||
break;
|
||||
case FOLD_TYPE_A:
|
||||
npc->renderMode = RENDER_MODE_SURFACE_XLU_LAYER2;
|
||||
func_802DE894(npc->spriteInstanceID, FOLD_TYPE_A, foldArg1, foldArg2, foldArg3, foldArg4, foldArg5);
|
||||
func_802DE894(npc->spriteInstanceID, FOLD_TYPE_A, foldArg1, foldArg2, foldArg3, foldArg4, foldFlags);
|
||||
break;
|
||||
case FOLD_TYPE_5:
|
||||
case FOLD_UPD_SET_ANIM:
|
||||
npc->renderMode = RENDER_MODE_ALPHATEST;
|
||||
func_802DE894(npc->spriteInstanceID, FOLD_TYPE_5, foldArg1, foldArg2, foldArg3, 0, foldArg5);
|
||||
func_802DE894(npc->spriteInstanceID, FOLD_UPD_SET_ANIM, foldArg1, foldArg2, foldArg3, 0, foldFlags);
|
||||
break;
|
||||
case FOLD_TYPE_D:
|
||||
case FOLD_UPD_HOLOGRAM:
|
||||
npc->renderMode = RENDER_MODE_SURFACE_XLU_LAYER2;
|
||||
func_802DE894(npc->spriteInstanceID, FOLD_TYPE_D, foldArg1, foldArg2, foldArg3, foldArg4, foldArg5);
|
||||
func_802DE894(npc->spriteInstanceID, FOLD_UPD_HOLOGRAM, foldArg1, foldArg2, foldArg3, foldArg4, foldFlags);
|
||||
break;
|
||||
case FOLD_TYPE_E:
|
||||
npc->renderMode = RENDER_MODE_ALPHATEST;
|
||||
func_802DE894(npc->spriteInstanceID, FOLD_TYPE_E, foldArg1, foldArg2, foldArg3, 255, foldArg5);
|
||||
func_802DE894(npc->spriteInstanceID, FOLD_TYPE_E, foldArg1, foldArg2, foldArg3, 255, foldFlags);
|
||||
break;
|
||||
case FOLD_TYPE_F:
|
||||
npc->renderMode = RENDER_MODE_ALPHATEST;
|
||||
func_802DE894(npc->spriteInstanceID, FOLD_TYPE_F, foldArg1, 255, 0, 255, foldArg5);
|
||||
func_802DE894(npc->spriteInstanceID, FOLD_TYPE_F, foldArg1, 255, 0, 255, foldFlags);
|
||||
break;
|
||||
case FOLD_TYPE_10:
|
||||
npc->renderMode = RENDER_MODE_SURFACE_XLU_LAYER2;
|
||||
func_802DE894(npc->spriteInstanceID, FOLD_TYPE_F, foldArg1, foldArg2, 0, foldArg2, foldArg5);
|
||||
func_802DE894(npc->spriteInstanceID, FOLD_TYPE_F, foldArg1, foldArg2, 0, foldArg2, foldFlags);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void func_8003D624(Npc* npc, s32 foldType, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6) {
|
||||
void npc_set_fold_params(Npc* npc, s32 foldType, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6) {
|
||||
npc->foldType = foldType;
|
||||
npc->foldArg1 = arg2;
|
||||
npc->foldArg2 = arg3;
|
||||
npc->foldArg3 = arg4;
|
||||
npc->foldArg4 = arg5;
|
||||
npc->foldArg5 = arg6;
|
||||
npc->foldFlags = arg6;
|
||||
func_8003D3BC(npc);
|
||||
}
|
||||
|
||||
|
@ -578,7 +578,7 @@ void pause_tutorial_draw_contents(MenuPanel* menu, s32 baseX, s32 baseY, s32 wid
|
||||
guMtxCatF(matrix2ptr, matrix1, matrix1);
|
||||
guMtxF2L(matrix1, &gDisplayContext->matrixStack[gMatrixListPos]);
|
||||
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
func_802DE894(gPauseTutorialSprites[i], FOLD_TYPE_6, 255, 255, 255, 255, 64);
|
||||
func_802DE894(gPauseTutorialSprites[i], FOLD_UPD_SET_COLOR, 255, 255, 255, 255, 64);
|
||||
spr_draw_npc_sprite(gPauseTutorialSprites[i], 0, 0, 0, matrix1);
|
||||
gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
|
||||
}
|
||||
|
@ -341,7 +341,7 @@ void pause_partners_draw_contents(MenuPanel* menu, s32 baseX, s32 baseY, s32 wid
|
||||
} else {
|
||||
color = 255.0f - offsetZ * 95.0f * 0.125f;
|
||||
}
|
||||
func_802DE894(gPausePartnersSpriteIDs[gPausePartnersPartnerIdx[index]], FOLD_TYPE_6, color, color, color, 255, 0x40);
|
||||
func_802DE894(gPausePartnersSpriteIDs[gPausePartnersPartnerIdx[index]], FOLD_UPD_SET_COLOR, color, color, color, 255, 64);
|
||||
spr_draw_npc_sprite(gPausePartnersSpriteIDs[gPausePartnersPartnerIdx[index]], 0, 0, NULL, matrix);
|
||||
}
|
||||
|
||||
|
@ -196,7 +196,7 @@ void pause_spirits_draw_contents(MenuPanel* menu, s32 baseX, s32 baseY, s32 widt
|
||||
|
||||
}
|
||||
|
||||
func_802DE894(gPauseSpiritsSpriteIDs[gPauseSpiritsIndexes[index]], FOLD_TYPE_8, color, color, color, alpha, 0x40);
|
||||
func_802DE894(gPauseSpiritsSpriteIDs[gPauseSpiritsIndexes[index]], FOLD_UPD_SET_TINT, color, color, color, alpha, 64);
|
||||
guTranslateF(matrix1, baseX + 22 + x, baseY + 77 + y + offsetY, 0.0f);
|
||||
guRotateF(matrix2, 180.0f, 0.0f, 0.0f, 1.0f);
|
||||
guMtxCatF(matrix2, matrix1, matrix1);
|
||||
|
@ -594,8 +594,8 @@ void pause_stats_init(MenuPanel* panel) {
|
||||
|
||||
void pause_stats_handle_input(MenuPanel* panel) {
|
||||
s32 initialSelection = panel->selected;
|
||||
s16 adjustedBootsLevel;
|
||||
s16 adjustedHammerLevel;
|
||||
s16 bootsMsgIdx;
|
||||
s16 hammerMsgIdx;
|
||||
s32 msgOffset;
|
||||
|
||||
if (gPauseHeldButtons & BUTTON_STICK_LEFT) {
|
||||
@ -652,33 +652,33 @@ void pause_stats_handle_input(MenuPanel* panel) {
|
||||
}
|
||||
|
||||
msgOffset = 0;
|
||||
adjustedBootsLevel = gPlayerData.bootsLevel;
|
||||
adjustedHammerLevel = gPlayerData.hammerLevel;
|
||||
bootsMsgIdx = gPlayerData.bootsLevel;
|
||||
hammerMsgIdx = gPlayerData.hammerLevel;
|
||||
|
||||
adjustedBootsLevel++;
|
||||
if (adjustedBootsLevel < 0) {
|
||||
adjustedBootsLevel = 0;
|
||||
bootsMsgIdx++;
|
||||
if (bootsMsgIdx < 0) {
|
||||
bootsMsgIdx = 0;
|
||||
}
|
||||
if (adjustedBootsLevel > 3) {
|
||||
adjustedBootsLevel = 3;
|
||||
if (bootsMsgIdx > 3) {
|
||||
bootsMsgIdx = 3;
|
||||
}
|
||||
|
||||
adjustedHammerLevel++;
|
||||
if (adjustedHammerLevel < 0) {
|
||||
adjustedHammerLevel = 0;
|
||||
hammerMsgIdx++;
|
||||
if (hammerMsgIdx < 0) {
|
||||
hammerMsgIdx = 0;
|
||||
}
|
||||
if (adjustedHammerLevel > 3) {
|
||||
adjustedHammerLevel = 3;
|
||||
if (hammerMsgIdx > 3) {
|
||||
hammerMsgIdx = 3;
|
||||
}
|
||||
|
||||
switch (gStatsMenuEntries[panel->selected].baseMsgID) {
|
||||
case PAUSE_MSG_TIP_BOOTS_1:
|
||||
if (adjustedBootsLevel > 1) {
|
||||
msgOffset = adjustedBootsLevel - 1;
|
||||
if (bootsMsgIdx > 1) {
|
||||
msgOffset = bootsMsgIdx - 1;
|
||||
}
|
||||
break;
|
||||
case PAUSE_MSG_TIP_HAMMER_0:
|
||||
msgOffset = adjustedHammerLevel;
|
||||
msgOffset = hammerMsgIdx;
|
||||
break;
|
||||
case PAUSE_MSG_TIP_SECRETS:
|
||||
if (evt_get_variable(NULL, GF_Tutorial_GotStarPiece)) {
|
||||
|
@ -67,10 +67,10 @@ void appendGfx_speech_bubble(void) {
|
||||
foldImg.xOffset = -16;
|
||||
foldImg.yOffset = 26;
|
||||
foldImg.opacity = 255;
|
||||
fold_update(0, FOLD_TYPE_NONE, 0, 0, 0, 0, 0x440);
|
||||
fold_update(0, FOLD_TYPE_6,
|
||||
fold_update(0, FOLD_UPD_CLEAR, 0, 0, 0, 0, FOLD_STATE_FLAG_400 | FOLD_STATE_FLAG_40);
|
||||
fold_update(0, FOLD_UPD_SET_COLOR,
|
||||
SpeechBubblePtr->brightness, SpeechBubblePtr->brightness, SpeechBubblePtr->brightness, 255, 0x440);
|
||||
fold_appendGfx_component(0, &foldImg, 0x40, mtxTransform);
|
||||
fold_appendGfx_component(0, &foldImg, FOLD_STATE_FLAG_40, mtxTransform);
|
||||
|
||||
gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
|
||||
}
|
||||
|
12
src/sprite.c
12
src/sprite.c
@ -391,7 +391,7 @@ void spr_appendGfx_component(
|
||||
foldImg.xOffset = -(width / 2);
|
||||
foldImg.yOffset = height;
|
||||
foldImg.opacity = opacity;
|
||||
if (fold_appendGfx_component((u8) (u16) D_802DF540, &foldImg, 0x80000, mtxTransform) == 1) { // todo bitfield?
|
||||
if (fold_appendGfx_component((u8) (u16) D_802DF540, &foldImg, FOLD_STATE_FLAG_80000, mtxTransform) == 1) { // todo bitfield?
|
||||
D_802DF540 &= ~(0x80000000 | 0x40000000 | 0x20000000 | 0x10000000);
|
||||
}
|
||||
}
|
||||
@ -1228,7 +1228,7 @@ s32 func_802DE748(s32 spriteIdx, s32 compIdx) {
|
||||
}
|
||||
}
|
||||
|
||||
void func_802DE780(s32 spriteIdx, s32 compIdx, FoldType foldType, s32 foldArg0, s32 foldArg1, s32 foldArg2, s32 foldArg3, s32 foldArg4) {
|
||||
void func_802DE780(s32 spriteIdx, s32 compIdx, FoldType foldType, s32 foldArg1, s32 foldArg2, s32 foldArg3, s32 foldArg4, s32 foldArg5) {
|
||||
SpriteInstance* sprite = &SpriteInstances[spriteIdx];
|
||||
SpriteComponent** componentList;
|
||||
s32 i;
|
||||
@ -1241,8 +1241,8 @@ void func_802DE780(s32 spriteIdx, s32 compIdx, FoldType foldType, s32 foldArg0,
|
||||
SpriteComponent* comp = *componentList;
|
||||
|
||||
if (compIdx == -1 || i == compIdx) {
|
||||
fold_update((u8)comp->unk_4C, foldType, foldArg0, foldArg1, foldArg2, foldArg3, foldArg4);
|
||||
if (foldType != FOLD_TYPE_NONE) {
|
||||
fold_update((u8)comp->unk_4C, foldType, foldArg1, foldArg2, foldArg3, foldArg4, foldArg5);
|
||||
if (foldType != FOLD_UPD_CLEAR) {
|
||||
comp->unk_4C |= 0x10000000;
|
||||
} else {
|
||||
comp->unk_4C &= ~0xF0000000;
|
||||
@ -1254,8 +1254,8 @@ void func_802DE780(s32 spriteIdx, s32 compIdx, FoldType foldType, s32 foldArg0,
|
||||
}
|
||||
}
|
||||
|
||||
void func_802DE894(s32 spriteIdx, FoldType foldType, s32 foldArg0, s32 foldArg1, s32 foldArg2, s32 foldArg3, s32 foldArg4) {
|
||||
func_802DE780(spriteIdx, -1, foldType, foldArg0, foldArg1, foldArg2, foldArg3, foldArg4);
|
||||
void func_802DE894(s32 spriteIdx, FoldType foldType, s32 foldArg1, s32 foldArg2, s32 foldArg3, s32 foldArg4, s32 foldArg5) {
|
||||
func_802DE780(spriteIdx, -1, foldType, foldArg1, foldArg2, foldArg3, foldArg4, foldArg5);
|
||||
}
|
||||
|
||||
s32 func_802DE8DC(s32 spriteIdx, s32 compListIdx, s32* outX, s32* outY, s32* outZ) {
|
||||
|
@ -192,7 +192,7 @@ EvtScript N(802428CC) = {
|
||||
EVT_END_IF
|
||||
EVT_ADD(LVar1, 20)
|
||||
EVT_CALL(SetNpcPos, NPC_Boo_05, LVar0, LVar1, LVar2)
|
||||
EVT_CALL(func_802CFD30, NPC_Boo_05, FOLD_TYPE_7, 0, 0, 0, 0)
|
||||
EVT_CALL(SetNpcFoldParams, NPC_Boo_05, FOLD_UPD_SET_ALPHA, 0, 0, 0, 0)
|
||||
EVT_WAIT(1)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
@ -210,7 +210,7 @@ EvtScript N(802429D4) = {
|
||||
EVT_CALL(MakeLerp, 0, 255, 40, EASING_LINEAR)
|
||||
EVT_LABEL(10)
|
||||
EVT_CALL(UpdateLerp)
|
||||
EVT_CALL(func_802CFD30, NPC_Boo_05, FOLD_TYPE_7, LVar0, 0, 0, 0)
|
||||
EVT_CALL(SetNpcFoldParams, NPC_Boo_05, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0)
|
||||
EVT_WAIT(1)
|
||||
EVT_IF_EQ(LVar1, 1)
|
||||
EVT_GOTO(10)
|
||||
@ -233,7 +233,7 @@ EvtScript N(80242B0C) = {
|
||||
EVT_CALL(MakeLerp, 255, 0, 40, EASING_LINEAR)
|
||||
EVT_LABEL(10)
|
||||
EVT_CALL(UpdateLerp)
|
||||
EVT_CALL(func_802CFD30, NPC_Boo_05, FOLD_TYPE_7, LVar0, 0, 0, 0)
|
||||
EVT_CALL(SetNpcFoldParams, NPC_Boo_05, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0)
|
||||
EVT_WAIT(1)
|
||||
EVT_IF_EQ(LVar1, 1)
|
||||
EVT_GOTO(10)
|
||||
|
@ -370,9 +370,9 @@ EvtScript N(EVS_Scene_TubbaRaid) = {
|
||||
EVT_SETF(LVar0, EVT_FLOAT(240.0))
|
||||
EVT_LOOP(20 * DT)
|
||||
EVT_SUBF(LVar0, EVT_FLOAT(240.0 / (s32) (20 * DT)))
|
||||
EVT_CALL(func_802CFD30, NPC_Boo_01, FOLD_TYPE_7, LVar0, 0, 0, 0)
|
||||
EVT_CALL(func_802CFD30, NPC_Boo_02, FOLD_TYPE_7, LVar0, 0, 0, 0)
|
||||
EVT_CALL(func_802CFD30, NPC_Boo_05, FOLD_TYPE_7, LVar0, 0, 0, 0)
|
||||
EVT_CALL(SetNpcFoldParams, NPC_Boo_01, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0)
|
||||
EVT_CALL(SetNpcFoldParams, NPC_Boo_02, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0)
|
||||
EVT_CALL(SetNpcFoldParams, NPC_Boo_05, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0)
|
||||
EVT_WAIT(1)
|
||||
EVT_END_LOOP
|
||||
EVT_CALL(SetNpcPos, NPC_Boo_01, 420, 300, 220)
|
||||
@ -385,8 +385,8 @@ EvtScript N(EVS_Scene_TubbaRaid) = {
|
||||
EVT_SETF(LVar0, EVT_FLOAT(0.0))
|
||||
EVT_LOOP(20 * DT)
|
||||
EVT_ADDF(LVar0, EVT_FLOAT(240.0 / (s32) (20 * DT)))
|
||||
EVT_CALL(func_802CFD30, NPC_Boo_01, FOLD_TYPE_7, LVar0, 0, 0, 0)
|
||||
EVT_CALL(func_802CFD30, NPC_Boo_02, FOLD_TYPE_7, LVar0, 0, 0, 0)
|
||||
EVT_CALL(SetNpcFoldParams, NPC_Boo_01, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0)
|
||||
EVT_CALL(SetNpcFoldParams, NPC_Boo_02, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0)
|
||||
EVT_WAIT(1)
|
||||
EVT_END_LOOP
|
||||
EVT_CALL(SpeakToPlayer, NPC_Boo_03, ANIM_Boo_Tan_Flail, ANIM_Boo_Tan_Flail, 0, MSG_CH3_00A1)
|
||||
@ -445,8 +445,8 @@ EvtScript N(EVS_Scene_TubbaRaid) = {
|
||||
EVT_SETF(LVar0, EVT_FLOAT(240.0))
|
||||
EVT_LOOP(20 * DT)
|
||||
EVT_SUBF(LVar0, EVT_FLOAT(240.0 / (s32) (20 * DT)))
|
||||
EVT_CALL(func_802CFD30, NPC_Boo_01, FOLD_TYPE_7, LVar0, 0, 0, 0)
|
||||
EVT_CALL(func_802CFD30, NPC_Boo_02, FOLD_TYPE_7, LVar0, 0, 0, 0)
|
||||
EVT_CALL(SetNpcFoldParams, NPC_Boo_01, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0)
|
||||
EVT_CALL(SetNpcFoldParams, NPC_Boo_02, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0)
|
||||
EVT_WAIT(1)
|
||||
EVT_END_LOOP
|
||||
EVT_CALL(SetNpcPos, NPC_Boo_01, NPC_DISPOSE_LOCATION)
|
||||
@ -565,14 +565,14 @@ EvtScript N(EVS_Scene_TubbaRaid) = {
|
||||
EVT_SETF(LVar0, EVT_FLOAT(0.0))
|
||||
EVT_LOOP(20 * DT)
|
||||
EVT_ADDF(LVar0, EVT_FLOAT(250.0 / (s32) (20 * DT)))
|
||||
EVT_CALL(func_802CFD30, NPC_Boo_01, FOLD_TYPE_7, LVar0, 0, 0, 0)
|
||||
EVT_CALL(func_802CFD30, NPC_Boo_02, FOLD_TYPE_7, LVar0, 0, 0, 0)
|
||||
EVT_CALL(func_802CFD30, NPC_Boo_05, FOLD_TYPE_7, LVar0, 0, 0, 0)
|
||||
EVT_CALL(SetNpcFoldParams, NPC_Boo_01, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0)
|
||||
EVT_CALL(SetNpcFoldParams, NPC_Boo_02, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0)
|
||||
EVT_CALL(SetNpcFoldParams, NPC_Boo_05, FOLD_UPD_SET_ALPHA, LVar0, 0, 0, 0)
|
||||
EVT_WAIT(1)
|
||||
EVT_END_LOOP
|
||||
EVT_CALL(func_802CFD30, NPC_Boo_01, FOLD_TYPE_NONE, 0, 0, 0, 0)
|
||||
EVT_CALL(func_802CFD30, NPC_Boo_02, FOLD_TYPE_NONE, 0 |