mirror of
https://github.com/n64decomp/sm64
synced 2026-08-08 18:23:23 -04:00
Refresh 2
This commit is contained in:
+40
-42
@@ -112,17 +112,17 @@ u8 sDialogSpeaker[170] = {
|
||||
#undef _
|
||||
|
||||
s32 sDialogSpeakerVoice[15] = {
|
||||
SOUND_UKIKI_CHATTER_LONG,
|
||||
SOUND_BIG_PENGUIN_YELL,
|
||||
SOUND_OBJECT_BOWSERINTROLAUGH,
|
||||
SOUND_OBJECT_KOOPA,
|
||||
SOUND_OBJECT_KINGBOBOMB,
|
||||
SOUND_BOO_LAUGH_LONG,
|
||||
SOUND_OBJECT_BOBOMBBUDDY,
|
||||
SOUND_OBJECT_BOWSERLAUGH,
|
||||
SOUND_BOSS_DIALOG_GRUNT,
|
||||
SOUND_WIGGLER_DIALOG,
|
||||
SOUND_GENERAL_YOSHI,
|
||||
SOUND_OBJ_UKIKI_CHATTER_LONG,
|
||||
SOUND_OBJ_BIG_PENGUIN_YELL,
|
||||
SOUND_OBJ_BOWSER_INTRO_LAUGH,
|
||||
SOUND_OBJ_KOOPA_TALK,
|
||||
SOUND_OBJ_KING_BOBOMB_TALK,
|
||||
SOUND_OBJ_BOO_LAUGH_LONG,
|
||||
SOUND_OBJ_BOBOMB_BUDDY_TALK,
|
||||
SOUND_OBJ_BOWSER_LAUGH,
|
||||
SOUND_OBJ2_BOSS_DIALOG_GRUNT,
|
||||
SOUND_OBJ_WIGGLER_TALK,
|
||||
SOUND_GENERAL_YOSHI_TALK,
|
||||
NO_SOUND,
|
||||
NO_SOUND,
|
||||
NO_SOUND,
|
||||
@@ -545,7 +545,7 @@ void unused_8031E568(void) {
|
||||
/**
|
||||
* Fade out a sequence player
|
||||
*/
|
||||
static void sequence_player_fade_out(s32 player, FadeT fadeOutTime) {
|
||||
static void sequence_player_fade_out_internal(s32 player, FadeT fadeOutTime) {
|
||||
struct SequencePlayer *seqPlayer = &gSequencePlayers[player];
|
||||
#ifndef VERSION_JP
|
||||
if (fadeOutTime == 0) {
|
||||
@@ -694,9 +694,9 @@ struct SPTask *create_next_audio_frame_task(void) {
|
||||
task->type = M_AUDTASK;
|
||||
task->flags = flags;
|
||||
task->ucode_boot = rspF3DBootStart;
|
||||
task->ucode_boot_size = (u32) rspF3DBootEnd - (u32) rspF3DBootStart;
|
||||
task->ucode_boot_size = (u8 *) rspF3DBootEnd - (u8 *) rspF3DBootStart;
|
||||
task->ucode = rspAspMainStart;
|
||||
task->ucode_size = 0x800;
|
||||
task->ucode_size = 0x800; // (this size is ignored)
|
||||
task->ucode_data = rspAspMainDataStart;
|
||||
task->ucode_data_size = (rspAspMainDataEnd - rspAspMainDataStart) * sizeof(u64);
|
||||
task->dram_stack = NULL;
|
||||
@@ -1169,7 +1169,7 @@ void update_game_sound(void) {
|
||||
*gSoundBanks[bankIndex][index].x, *gSoundBanks[bankIndex][index].z);
|
||||
|
||||
if ((gSoundBanks[bankIndex][index].soundBits & SOUNDARGS_MASK_SOUNDID)
|
||||
== (SOUND_UNKNOWN_UNK1417 & SOUNDARGS_MASK_SOUNDID)) {
|
||||
== (SOUND_MOVING_FLYING & SOUNDARGS_MASK_SOUNDID)) {
|
||||
ret = get_sound_freq_scale(bankIndex, index);
|
||||
gSequencePlayers[2].channels[channelIndex]->freqScale =
|
||||
((f32) D_80363808[bankIndex] / US_FLOAT(80.0)) + ret;
|
||||
@@ -1261,7 +1261,7 @@ void update_game_sound(void) {
|
||||
*gSoundBanks[bankIndex][index].x, *gSoundBanks[bankIndex][index].z);
|
||||
|
||||
if ((gSoundBanks[bankIndex][index].soundBits & SOUNDARGS_MASK_SOUNDID)
|
||||
== (SOUND_UNKNOWN_UNK1417 & SOUNDARGS_MASK_SOUNDID)) {
|
||||
== (SOUND_MOVING_FLYING & SOUNDARGS_MASK_SOUNDID)) {
|
||||
ret = get_sound_freq_scale(bankIndex, index);
|
||||
gSequencePlayers[2].channels[channelIndex]->freqScale =
|
||||
((f32) D_80363808[bankIndex] / US_FLOAT(80.0)) + ret;
|
||||
@@ -1349,11 +1349,11 @@ void play_sequence(u8 player, u8 seqId, u16 fadeTimer) {
|
||||
}
|
||||
}
|
||||
|
||||
void func_8031F7CC(u8 player, u16 fadeTimer) {
|
||||
void sequence_player_fade_out(u8 player, u16 fadeTimer) {
|
||||
if (player == 0) {
|
||||
gPlayer0CurSeqId = SEQUENCE_NONE;
|
||||
}
|
||||
sequence_player_fade_out(player, fadeTimer);
|
||||
sequence_player_fade_out_internal(player, fadeTimer);
|
||||
}
|
||||
|
||||
void fade_volume_scale(u8 player, u8 targetScale, u16 fadeTimer) {
|
||||
@@ -1404,7 +1404,6 @@ void process_level_music_dynamics(void) {
|
||||
s16 dur2; // sp38
|
||||
u32 conditionBits; // s0
|
||||
u32 tempBits; // v1
|
||||
s32 numConditions; // v1
|
||||
u16 bit; // a1
|
||||
u8 condIndex; // a0 (same as numConditions?)
|
||||
u8 i; // s1
|
||||
@@ -1439,63 +1438,62 @@ void process_level_music_dynamics(void) {
|
||||
}
|
||||
}
|
||||
|
||||
numConditions = condIndex;
|
||||
for (j = 0; j < numConditions; j++) {
|
||||
for (j = 0; j < condIndex; j++) {
|
||||
// (having all 'temp' share a single variable affects regalloc)
|
||||
UNUSED s16 temp;
|
||||
switch (conditionTypes[j]) {
|
||||
case MARIO_X_GE: {
|
||||
s16 temp = gMarioStates[0].pos[0];
|
||||
if (temp < conditionValues[j])
|
||||
j = numConditions + 1;
|
||||
j = condIndex + 1;
|
||||
break;
|
||||
}
|
||||
case MARIO_Y_GE: {
|
||||
s16 temp = gMarioStates[0].pos[1];
|
||||
if (temp < conditionValues[j])
|
||||
j = numConditions + 1;
|
||||
j = condIndex + 1;
|
||||
break;
|
||||
}
|
||||
case MARIO_Z_GE: {
|
||||
s16 temp = gMarioStates[0].pos[2];
|
||||
if (temp < conditionValues[j])
|
||||
j = numConditions + 1;
|
||||
j = condIndex + 1;
|
||||
break;
|
||||
}
|
||||
case MARIO_X_LT: {
|
||||
s16 temp = gMarioStates[0].pos[0];
|
||||
if (temp >= conditionValues[j])
|
||||
j = numConditions + 1;
|
||||
j = condIndex + 1;
|
||||
break;
|
||||
}
|
||||
case MARIO_Y_LT: {
|
||||
s16 temp = gMarioStates[0].pos[1];
|
||||
if (temp >= conditionValues[j])
|
||||
j = numConditions + 1;
|
||||
j = condIndex + 1;
|
||||
break;
|
||||
}
|
||||
case MARIO_Z_LT: {
|
||||
s16 temp = gMarioStates[0].pos[2];
|
||||
if (temp >= conditionValues[j])
|
||||
j = numConditions + 1;
|
||||
j = condIndex + 1;
|
||||
break;
|
||||
}
|
||||
case MARIO_IS_IN_AREA: {
|
||||
s16 temp = gCurrAreaIndex;
|
||||
if (temp != conditionValues[j])
|
||||
j = numConditions + 1;
|
||||
j = condIndex + 1;
|
||||
break;
|
||||
}
|
||||
case MARIO_IS_IN_ROOM: {
|
||||
s16 temp = gMarioCurrentRoom;
|
||||
if (temp != conditionValues[j])
|
||||
j = numConditions + 1;
|
||||
j = condIndex + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (j == numConditions) {
|
||||
if (j == condIndex) {
|
||||
// The area matches. Break out of the loop.
|
||||
tempBits = 0;
|
||||
} else {
|
||||
@@ -1565,7 +1563,7 @@ void func_8031FFB4(u8 player, u16 fadeTimer, u8 arg2) {
|
||||
}
|
||||
}
|
||||
|
||||
void func_80320040(u8 player, u16 fadeTimer) {
|
||||
void sequence_player_unlower(u8 player, u16 fadeTimer) {
|
||||
sCapVolumeTo40 = FALSE;
|
||||
if (player == 0) {
|
||||
if (gSequencePlayers[player].state != SEQUENCE_PLAYER_STATE_FADE_OUT) {
|
||||
@@ -1799,17 +1797,17 @@ void func_80320A4C(u8 bankIndex, u8 arg1) {
|
||||
D_80363808[bankIndex] = arg1;
|
||||
}
|
||||
|
||||
void play_dialog_sound(u8 dialogId) {
|
||||
void play_dialog_sound(u8 dialogID) {
|
||||
u8 speaker;
|
||||
|
||||
if (dialogId >= 170) {
|
||||
dialogId = 0;
|
||||
if (dialogID >= 170) {
|
||||
dialogID = 0;
|
||||
}
|
||||
|
||||
speaker = sDialogSpeaker[dialogId];
|
||||
speaker = sDialogSpeaker[dialogID];
|
||||
if (speaker != 0xff) {
|
||||
play_sound(sDialogSpeakerVoice[speaker], gDefaultSoundArgs);
|
||||
if (speaker == 2) // SOUND_OBJECT_BOWSERINTROLAUGH
|
||||
if (speaker == 2) // SOUND_OBJ_BOWSER_INTRO_LAUGH
|
||||
{
|
||||
play_sequence(1, SEQ_EVENT_KOOPA_MESSAGE, 0);
|
||||
}
|
||||
@@ -1817,7 +1815,7 @@ void play_dialog_sound(u8 dialogId) {
|
||||
|
||||
#ifndef VERSION_JP
|
||||
// "You've stepped on the (Wing|Metal|Vanish) Cap Switch"
|
||||
if (dialogId == 10 || dialogId == 11 || dialogId == 12) {
|
||||
if (dialogID == 10 || dialogID == 11 || dialogID == 12) {
|
||||
play_puzzle_jingle();
|
||||
}
|
||||
#endif
|
||||
@@ -1904,7 +1902,7 @@ void stop_background_music(u16 seqId) {
|
||||
if (sBackgroundMusicQueueSize != 0) {
|
||||
play_sequence(0, sBackgroundMusicQueue[1].seqId, 0);
|
||||
} else {
|
||||
func_8031F7CC(0, 20);
|
||||
sequence_player_fade_out(0, 20);
|
||||
}
|
||||
}
|
||||
foundIndex = i;
|
||||
@@ -1925,7 +1923,7 @@ void stop_background_music(u16 seqId) {
|
||||
|
||||
void fadeout_background_music(u16 seqId, u16 fadeOut) {
|
||||
if (sBackgroundMusicQueueSize != 0 && sBackgroundMusicQueue[0].seqId == (u8)(seqId & 0xff)) {
|
||||
func_8031F7CC(0, fadeOut);
|
||||
sequence_player_fade_out(0, fadeOut);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1990,7 +1988,7 @@ void func_80321080(u16 fadeTimer) {
|
||||
D_80332120 = 0;
|
||||
D_80332124 = 0;
|
||||
func_803200E4(fadeTimer);
|
||||
func_8031F7CC(1, fadeTimer);
|
||||
sequence_player_fade_out(1, fadeTimer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2002,10 +2000,10 @@ void func_803210D4(u16 fadeOutTime) {
|
||||
}
|
||||
|
||||
if (gSequencePlayers[0].enabled == TRUE) {
|
||||
sequence_player_fade_out(0, fadeOutTime);
|
||||
sequence_player_fade_out_internal(0, fadeOutTime);
|
||||
}
|
||||
if (gSequencePlayers[1].enabled == TRUE) {
|
||||
sequence_player_fade_out(1, fadeOutTime);
|
||||
sequence_player_fade_out_internal(1, fadeOutTime);
|
||||
}
|
||||
|
||||
for (i = 0; i < SOUND_BANK_COUNT; i++) {
|
||||
|
||||
@@ -20,10 +20,10 @@ extern u8 gAudioSPTaskYieldBuffer[]; // ucode yield data ptr; only used in JP
|
||||
struct SPTask *create_next_audio_frame_task(void);
|
||||
void play_sound(s32 soundBits, f32 *pos);
|
||||
void audio_signal_game_loop_tick(void);
|
||||
void func_8031F7CC(u8 player, u16 fadeTimer);
|
||||
void sequence_player_fade_out(u8 player, u16 fadeTimer);
|
||||
void fade_volume_scale(u8 player, u8 targetScale, u16 fadeTimer);
|
||||
void func_8031FFB4(u8 player, u16 fadeTimer, u8 arg2);
|
||||
void func_80320040(u8 player, u16 fadeTimer);
|
||||
void sequence_player_unlower(u8 player, u16 fadeTimer);
|
||||
void set_sound_disabled(u8 disabled);
|
||||
void sound_init(void);
|
||||
void func_803205E8(u32 soundBits, f32 *vec);
|
||||
@@ -32,7 +32,7 @@ void func_80320890(void);
|
||||
void sound_banks_disable(u8 player, u16 bankMask);
|
||||
void sound_banks_enable(u8 player, u16 bankMask);
|
||||
void func_80320A4C(u8 bankIndex, u8 arg1);
|
||||
void play_dialog_sound(u8 dialogId);
|
||||
void play_dialog_sound(u8 dialogID);
|
||||
void play_music(u8 player, u16 seqArgs, s16 fadeTimer);
|
||||
void stop_background_music(u16 seqId);
|
||||
void fadeout_background_music(u16 arg0, u16 fadeOut);
|
||||
|
||||
@@ -220,8 +220,8 @@ struct SequencePlayer
|
||||
/*0x11C*/ OSIoMesg bankDmaIoMesg;
|
||||
/*0x130*/ u8 *bankDmaCurrMemAddr;
|
||||
/*0x134*/ struct AudioBank *loadingBank;
|
||||
/*0x138*/ u32 bankDmaCurrDevAddr;
|
||||
/*0x13C*/ s32 bankDmaRemaining;
|
||||
/*0x138*/ uintptr_t bankDmaCurrDevAddr;
|
||||
/*0x13C*/ ssize_t bankDmaRemaining;
|
||||
}; // size = 0x140
|
||||
|
||||
struct AdsrSettings
|
||||
|
||||
+48
-48
@@ -9,9 +9,9 @@
|
||||
#define ALIGN16(val) (((val) + 0xF) & ~0xF)
|
||||
|
||||
struct SharedDma {
|
||||
/*0x0*/ u8 *buffer; // target, points to pre-allocated buffer
|
||||
/*0x4*/ u32 source; // device address
|
||||
/*0x8*/ u16 sizeUnused; // set to bufSize, never read
|
||||
/*0x0*/ u8 *buffer; // target, points to pre-allocated buffer
|
||||
/*0x4*/ uintptr_t source; // device address
|
||||
/*0x8*/ u16 sizeUnused; // set to bufSize, never read
|
||||
/*0xA*/ u16 bufSize;
|
||||
/*0xC*/ u8 unused2; // set to 0, never read
|
||||
/*0xD*/ u8 reuseIndex; // position in sSampleDmaReuseQueue1/2, if ttl == 0
|
||||
@@ -69,8 +69,8 @@ extern u8 gBankSetsData[]; // bank_sets.s
|
||||
/**
|
||||
* Performs an immediate DMA copy
|
||||
*/
|
||||
void audio_dma_copy_immediate(u32 devAddr, void *vAddr, u32 nbytes) {
|
||||
osInvalDCache(vAddr, (s32) nbytes);
|
||||
void audio_dma_copy_immediate(uintptr_t devAddr, void *vAddr, size_t nbytes) {
|
||||
osInvalDCache(vAddr, nbytes);
|
||||
osPiStartDma(&gAudioDmaIoMesg, OS_MESG_PRI_HIGH, OS_READ, devAddr, vAddr, nbytes,
|
||||
&gAudioDmaMesgQueue);
|
||||
osRecvMesg(&gAudioDmaMesgQueue, NULL, OS_MESG_BLOCK);
|
||||
@@ -79,8 +79,8 @@ void audio_dma_copy_immediate(u32 devAddr, void *vAddr, u32 nbytes) {
|
||||
/**
|
||||
* Performs an asynchronus (normal priority) DMA copy
|
||||
*/
|
||||
void audio_dma_copy_async(u32 devAddr, void *vAddr, u32 nbytes, OSMesgQueue *queue, OSIoMesg *mesg) {
|
||||
osInvalDCache(vAddr, (s32) nbytes);
|
||||
void audio_dma_copy_async(uintptr_t devAddr, void *vAddr, size_t nbytes, OSMesgQueue *queue, OSIoMesg *mesg) {
|
||||
osInvalDCache(vAddr, nbytes);
|
||||
osPiStartDma(mesg, OS_MESG_PRI_NORMAL, OS_READ, devAddr, vAddr, nbytes, queue);
|
||||
}
|
||||
|
||||
@@ -88,9 +88,9 @@ void audio_dma_copy_async(u32 devAddr, void *vAddr, u32 nbytes, OSMesgQueue *que
|
||||
* Performs a partial asynchronous (normal priority) DMA copy. This is limited
|
||||
* to 0x1000 bytes transfer at once.
|
||||
*/
|
||||
void audio_dma_partial_copy_async(u32 *devAddr, u8 **vAddr, s32 *remaining, OSMesgQueue *queue,
|
||||
void audio_dma_partial_copy_async(uintptr_t *devAddr, u8 **vAddr, ssize_t *remaining, OSMesgQueue *queue,
|
||||
OSIoMesg *mesg) {
|
||||
s32 transfer = (*remaining < 0x1000 ? *remaining : 0x1000);
|
||||
ssize_t transfer = (*remaining < 0x1000 ? *remaining : 0x1000);
|
||||
*remaining -= transfer;
|
||||
osInvalDCache(*vAddr, transfer);
|
||||
osPiStartDma(mesg, OS_MESG_PRI_NORMAL, OS_READ, *devAddr, *vAddr, transfer, queue);
|
||||
@@ -129,7 +129,7 @@ void decrease_sample_dma_ttls() {
|
||||
#ifdef NON_MATCHING
|
||||
|
||||
void *dma_sample_data(u8 *devAddr, u32 size, s32 arg2, u8 *arg3) {
|
||||
s32 bufferPos; // v0
|
||||
ssize_t bufferPos; // v0
|
||||
struct SharedDma *dma; // sp58, v1, t0
|
||||
u32 transfer; // v0
|
||||
u32 dmaDevAddr; // s0
|
||||
@@ -141,8 +141,8 @@ void *dma_sample_data(u8 *devAddr, u32 size, s32 arg2, u8 *arg3) {
|
||||
if (arg2 != 0 || *arg3 >= sSampleDmaListSize1) {
|
||||
for (i = sSampleDmaListSize1; i < gSampleDmaNumListItems; i++) {
|
||||
dma = sSampleDmas + i;
|
||||
bufferPos = (u32) devAddr - dma->source;
|
||||
if (0 <= bufferPos && (u32) bufferPos <= dma->bufSize - size) {
|
||||
bufferPos = (uintptr_t) devAddr - dma->source;
|
||||
if (0 <= bufferPos && (size_t) bufferPos <= dma->bufSize - size) {
|
||||
// We already have a DMA request for this memory range.
|
||||
if (dma->ttl == 0 && sSampleDmaReuseQueueHead2 != sSampleDmaReuseQueueTail2) {
|
||||
// Move the DMA out of the reuse queue, by swapping it with the
|
||||
@@ -157,7 +157,7 @@ void *dma_sample_data(u8 *devAddr, u32 size, s32 arg2, u8 *arg3) {
|
||||
}
|
||||
dma->ttl = 60;
|
||||
*arg3 = (u8) i;
|
||||
bufferPos = (u32) devAddr - dma->source;
|
||||
bufferPos = (uintptr_t) devAddr - dma->source;
|
||||
return dma->buffer + bufferPos;
|
||||
}
|
||||
}
|
||||
@@ -171,8 +171,8 @@ void *dma_sample_data(u8 *devAddr, u32 size, s32 arg2, u8 *arg3) {
|
||||
}
|
||||
} else {
|
||||
dma = &sSampleDmas[*arg3];
|
||||
bufferPos = (u32) devAddr - dma->source;
|
||||
if (0 <= bufferPos && (u32) bufferPos <= dma->bufSize - size) {
|
||||
bufferPos = (uintptr_t) devAddr - dma->source;
|
||||
if (0 <= bufferPos && (size_t) bufferPos <= dma->bufSize - size) {
|
||||
// We already have DMA for this memory range.
|
||||
if (dma->ttl == 0) {
|
||||
// Move the DMA out of the reuse queue, by swapping it with the
|
||||
@@ -184,7 +184,7 @@ void *dma_sample_data(u8 *devAddr, u32 size, s32 arg2, u8 *arg3) {
|
||||
dma->reuseIndex;
|
||||
}
|
||||
sSampleDmaReuseQueueTail1++;
|
||||
bufferPos = (u32) devAddr - dma->source;
|
||||
bufferPos = (uintptr_t) devAddr - dma->source;
|
||||
}
|
||||
dma->ttl = 2;
|
||||
return dma->buffer + bufferPos;
|
||||
@@ -200,7 +200,7 @@ void *dma_sample_data(u8 *devAddr, u32 size, s32 arg2, u8 *arg3) {
|
||||
}
|
||||
|
||||
transfer = dma->bufSize;
|
||||
dmaDevAddr = (u32) devAddr & ~0xF;
|
||||
dmaDevAddr = (uintptr_t) devAddr & ~0xF;
|
||||
dma->ttl = 2;
|
||||
dma->source = dmaDevAddr;
|
||||
dma->sizeUnused = transfer;
|
||||
@@ -211,7 +211,7 @@ void *dma_sample_data(u8 *devAddr, u32 size, s32 arg2, u8 *arg3) {
|
||||
osPiStartDma(&gCurrAudioFrameDmaIoMesgBufs[gCurrAudioFrameDmaCount - 1], OS_MESG_PRI_NORMAL,
|
||||
OS_READ, dmaDevAddr, dma->buffer, transfer, &gCurrAudioFrameDmaQueue);
|
||||
*arg3 = dmaIndex;
|
||||
return dma->buffer + (u32) devAddr - dmaDevAddr;
|
||||
return dma->buffer + (uintptr_t) devAddr - dmaDevAddr;
|
||||
}
|
||||
|
||||
#elif defined(VERSION_JP)
|
||||
@@ -301,8 +301,8 @@ void func_8031784C(struct AudioBank *mem, u8 *offset, u32 numInstruments, u32 nu
|
||||
struct Instrument *instrument;
|
||||
struct Instrument **itInstrs;
|
||||
u32 i;
|
||||
u32 memBase = (u32) mem;
|
||||
u32 offsetBase = (u32) offset;
|
||||
uintptr_t memBase = (uintptr_t) mem;
|
||||
uintptr_t offsetBase = (uintptr_t) offset;
|
||||
|
||||
#define INIT_SOUND(sound) \
|
||||
{ \
|
||||
@@ -315,16 +315,16 @@ void func_8031784C(struct AudioBank *mem, u8 *offset, u32 numInstruments, u32 nu
|
||||
* Presumably sample and sample2 ought to have different types, \
|
||||
* but that doesn't matter for codegen. */ \
|
||||
volatile struct AudioBankSample *sample, *sample2; \
|
||||
*itSample = (void *) (memBase + (u32)(*itSample)); \
|
||||
*itSample = (void *) (memBase + (uintptr_t)(*itSample)); \
|
||||
sample = *itSample; \
|
||||
sample2 = *itSample; \
|
||||
if (sample2->loaded == FALSE) { \
|
||||
void *a = sample2->sampleAddr; \
|
||||
void *b = sample->loop; \
|
||||
void *c = sample->book; \
|
||||
sample->sampleAddr = (void *) (offsetBase + (u32) a); \
|
||||
sample->loop = (void *) (memBase + (u32) b); \
|
||||
sample->book = (void *) (memBase + (u32) c); \
|
||||
sample->sampleAddr = (void *) (offsetBase + (uintptr_t) a); \
|
||||
sample->loop = (void *) (memBase + (uintptr_t) b); \
|
||||
sample->book = (void *) (memBase + (uintptr_t) c); \
|
||||
sample->loaded = TRUE; \
|
||||
} \
|
||||
} \
|
||||
@@ -332,7 +332,7 @@ void func_8031784C(struct AudioBank *mem, u8 *offset, u32 numInstruments, u32 nu
|
||||
|
||||
if (mem->drums != NULL) {
|
||||
if (numDrums != 0) {
|
||||
mem->drums = (struct Drum **) (memBase + (u32) mem->drums);
|
||||
mem->drums = (struct Drum **) (memBase + (uintptr_t) mem->drums);
|
||||
if (numDrums != 0) {
|
||||
for (i = 0; i < numDrums; i++) {
|
||||
#if 0
|
||||
@@ -342,7 +342,7 @@ void func_8031784C(struct AudioBank *mem, u8 *offset, u32 numInstruments, u32 nu
|
||||
struct Drum **h = &mem->drums[i];
|
||||
if (*h == 0) continue;
|
||||
{
|
||||
*h = (void *)(memBase + (u32)*h);
|
||||
*h = (void *)(memBase + (uintptr_t)*h);
|
||||
drum = *h;
|
||||
drum2 = *h;
|
||||
if (drum2->loaded == FALSE)
|
||||
@@ -351,7 +351,7 @@ void func_8031784C(struct AudioBank *mem, u8 *offset, u32 numInstruments, u32 nu
|
||||
INIT_SOUND(((struct Drum *)drum2)->sound);
|
||||
d = drum2->envelope;
|
||||
drum->loaded = TRUE;
|
||||
drum->envelope = (void *) (memBase + (u32)d);
|
||||
drum->envelope = (void *) (memBase + (uintptr_t)d);
|
||||
}
|
||||
}
|
||||
#else
|
||||
@@ -359,7 +359,7 @@ void func_8031784C(struct AudioBank *mem, u8 *offset, u32 numInstruments, u32 nu
|
||||
// deduplicates it -- drum and drum2 end up in the same
|
||||
// register.
|
||||
struct Drum **drums = mem->drums;
|
||||
u32 h = (u32) drums[i];
|
||||
uintptr_t h = (uintptr_t) drums[i];
|
||||
if (h != 0) {
|
||||
volatile struct Drum *drum, *drum2;
|
||||
drums[i] = (struct Drum *) (memBase + h);
|
||||
@@ -370,7 +370,7 @@ void func_8031784C(struct AudioBank *mem, u8 *offset, u32 numInstruments, u32 nu
|
||||
INIT_SOUND(((struct Drum *) drum)->sound);
|
||||
d = drum->envelope;
|
||||
drum2->loaded = TRUE;
|
||||
drum2->envelope = (void *) (memBase + (u32) d);
|
||||
drum2->envelope = (void *) (memBase + (uintptr_t) d);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -383,7 +383,7 @@ void func_8031784C(struct AudioBank *mem, u8 *offset, u32 numInstruments, u32 nu
|
||||
itInstrs = mem->instruments;
|
||||
do {
|
||||
if (*itInstrs) {
|
||||
*itInstrs = (void *) (memBase + (u32) *itInstrs);
|
||||
*itInstrs = (void *) (memBase + (uintptr_t) *itInstrs);
|
||||
instrument = *itInstrs;
|
||||
|
||||
if (instrument->loaded == FALSE) {
|
||||
@@ -392,7 +392,7 @@ void func_8031784C(struct AudioBank *mem, u8 *offset, u32 numInstruments, u32 nu
|
||||
INIT_SOUND(instrument->highNotesSound);
|
||||
|
||||
instrument->loaded = TRUE;
|
||||
instrument->envelope = (void *) (memBase + (u32) instrument->envelope);
|
||||
instrument->envelope = (void *) (memBase + (uintptr_t) instrument->envelope);
|
||||
}
|
||||
}
|
||||
itInstrs++;
|
||||
@@ -424,10 +424,10 @@ struct AudioBank *bank_load_immediate(s32 bankId, s32 arg1) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
audio_dma_copy_immediate((u32) ctlData, buf, 0x10);
|
||||
audio_dma_copy_immediate((uintptr_t) ctlData, buf, 0x10);
|
||||
numInstruments = buf[0];
|
||||
numDrums = buf[1];
|
||||
audio_dma_copy_immediate((u32)(ctlData + 0x10), ret, alloc);
|
||||
audio_dma_copy_immediate((uintptr_t)(ctlData + 0x10), ret, alloc);
|
||||
func_8031784C(ret, gAlTbl->seqArray[bankId].offset, numInstruments, numDrums);
|
||||
gCtlEntries[bankId].numInstruments = (u8) numInstruments;
|
||||
gCtlEntries[bankId].numDrums = (u8) numDrums;
|
||||
@@ -442,7 +442,7 @@ struct AudioBank *bank_load_async(s32 bankId, s32 arg1, struct SequencePlayer *s
|
||||
UNUSED u32 pad1[2];
|
||||
u32 buf[4];
|
||||
UNUSED u32 pad2;
|
||||
s32 alloc;
|
||||
size_t alloc;
|
||||
struct AudioBank *ret;
|
||||
u8 *ctlData;
|
||||
OSMesgQueue *mesgQueue;
|
||||
@@ -456,7 +456,7 @@ struct AudioBank *bank_load_async(s32 bankId, s32 arg1, struct SequencePlayer *s
|
||||
return NULL;
|
||||
}
|
||||
|
||||
audio_dma_copy_immediate((u32) ctlData, buf, 0x10);
|
||||
audio_dma_copy_immediate((uintptr_t) ctlData, buf, 0x10);
|
||||
numInstruments = buf[0];
|
||||
numDrums = buf[1];
|
||||
seqPlayer->loadingBankId = (u8) bankId;
|
||||
@@ -464,7 +464,7 @@ struct AudioBank *bank_load_async(s32 bankId, s32 arg1, struct SequencePlayer *s
|
||||
seqPlayer->loadingBankNumDrums = numDrums;
|
||||
seqPlayer->bankDmaCurrMemAddr = (u8 *) ret;
|
||||
seqPlayer->loadingBank = ret;
|
||||
seqPlayer->bankDmaCurrDevAddr = (u32)(ctlData + 0x10);
|
||||
seqPlayer->bankDmaCurrDevAddr = (uintptr_t)(ctlData + 0x10);
|
||||
seqPlayer->bankDmaRemaining = alloc;
|
||||
mesgQueue = &seqPlayer->bankDmaMesgQueue;
|
||||
osCreateMesgQueue(mesgQueue, &seqPlayer->bankDmaMesg, 1);
|
||||
@@ -489,7 +489,7 @@ void *sequence_dma_immediate(s32 seqId, s32 arg1) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
audio_dma_copy_immediate((u32) seqData, ptr, seqLength);
|
||||
audio_dma_copy_immediate((uintptr_t) seqData, ptr, seqLength);
|
||||
gSeqLoadStatus[seqId] = SOUND_LOAD_STATUS_COMPLETE;
|
||||
return ptr;
|
||||
}
|
||||
@@ -510,15 +510,15 @@ void *sequence_dma_async(s32 seqId, s32 arg1, struct SequencePlayer *seqPlayer)
|
||||
|
||||
if (seqLength <= 0x40) {
|
||||
// Immediately load short sequenece
|
||||
audio_dma_copy_immediate((u32) seqData, ptr, seqLength);
|
||||
audio_dma_copy_immediate((uintptr_t) seqData, ptr, seqLength);
|
||||
gSeqLoadStatus[seqId] = SOUND_LOAD_STATUS_COMPLETE;
|
||||
} else {
|
||||
audio_dma_copy_immediate((u32) seqData, ptr, 0x40);
|
||||
audio_dma_copy_immediate((uintptr_t) seqData, ptr, 0x40);
|
||||
mesgQueue = &seqPlayer->seqDmaMesgQueue;
|
||||
osCreateMesgQueue(mesgQueue, &seqPlayer->seqDmaMesg, 1);
|
||||
seqPlayer->seqDmaMesg = NULL;
|
||||
seqPlayer->seqDmaInProgress = TRUE;
|
||||
audio_dma_copy_async((u32)(seqData + 0x40), (u8 *) ptr + 0x40, seqLength - 0x40, mesgQueue,
|
||||
audio_dma_copy_async((uintptr_t)(seqData + 0x40), (u8 *) ptr + 0x40, seqLength - 0x40, mesgQueue,
|
||||
&seqPlayer->seqDmaIoMesg);
|
||||
gSeqLoadStatus[seqId] = SOUND_LOAD_STATUS_IN_PROGRESS;
|
||||
}
|
||||
@@ -702,7 +702,7 @@ void audio_init() {
|
||||
}
|
||||
|
||||
i = 0;
|
||||
lim3 = ((u32) &gAudioGlobalsEndMarker - (u32) &gAudioGlobalsStartMarker) / 8;
|
||||
lim3 = ((uintptr_t) &gAudioGlobalsEndMarker - (uintptr_t) &gAudioGlobalsStartMarker) / 8;
|
||||
ptr64 = &gAudioGlobalsStartMarker - 1;
|
||||
for (k = lim3; k >= 0; k--) {
|
||||
i++;
|
||||
@@ -741,36 +741,36 @@ void audio_init() {
|
||||
// Load header for sequence data (assets/music_data.sbk.s)
|
||||
gSeqFileHeader = (ALSeqFile *) buf;
|
||||
data = gMusicData;
|
||||
audio_dma_copy_immediate((u32) data, gSeqFileHeader, 0x10);
|
||||
audio_dma_copy_immediate((uintptr_t) data, gSeqFileHeader, 0x10);
|
||||
gSequenceCount = gSeqFileHeader->seqCount;
|
||||
size = ALIGN16(gSequenceCount * sizeof(ALSeqData) + 4);
|
||||
gSeqFileHeader = soundAlloc(&gSoundPool, size);
|
||||
audio_dma_copy_immediate((u32) data, gSeqFileHeader, size);
|
||||
audio_dma_copy_immediate((uintptr_t) data, gSeqFileHeader, size);
|
||||
alSeqFileNew(gSeqFileHeader, data);
|
||||
|
||||
// Load header for CTL (assets/sound_data.ctl.s, i.e. ADSR)
|
||||
gAlCtlHeader = (ALSeqFile *) buf;
|
||||
data = gSoundDataADSR;
|
||||
audio_dma_copy_immediate((u32) data, gAlCtlHeader, 0x10);
|
||||
audio_dma_copy_immediate((uintptr_t) data, gAlCtlHeader, 0x10);
|
||||
size = gAlCtlHeader->seqCount * sizeof(ALSeqData) + 4;
|
||||
size = ALIGN16(size);
|
||||
gCtlEntries = soundAlloc(&gSoundPool, gAlCtlHeader->seqCount * sizeof(struct CtlEntry));
|
||||
gAlCtlHeader = soundAlloc(&gSoundPool, size);
|
||||
audio_dma_copy_immediate((u32) data, gAlCtlHeader, size);
|
||||
audio_dma_copy_immediate((uintptr_t) data, gAlCtlHeader, size);
|
||||
alSeqFileNew(gAlCtlHeader, data);
|
||||
|
||||
// Load header for TBL (assets/sound_data.tbl.s, i.e. raw data)
|
||||
gAlTbl = (ALSeqFile *) buf;
|
||||
audio_dma_copy_immediate((u32) data, gAlTbl, 0x10);
|
||||
audio_dma_copy_immediate((uintptr_t) data, gAlTbl, 0x10);
|
||||
size = gAlTbl->seqCount * sizeof(ALSeqData) + 4;
|
||||
size = ALIGN16(size);
|
||||
gAlTbl = soundAlloc(&gSoundPool, size);
|
||||
audio_dma_copy_immediate((u32) gSoundDataRaw, gAlTbl, size);
|
||||
audio_dma_copy_immediate((uintptr_t) gSoundDataRaw, gAlTbl, size);
|
||||
alSeqFileNew(gAlTbl, gSoundDataRaw);
|
||||
|
||||
// Load bank sets for each sequence (assets/bank_sets.s)
|
||||
gAlBankSets = soundAlloc(&gSoundPool, 0x100);
|
||||
audio_dma_copy_immediate((u32) gBankSetsData, gAlBankSets, 0x100);
|
||||
audio_dma_copy_immediate((uintptr_t) gBankSetsData, gAlBankSets, 0x100);
|
||||
|
||||
func_8031D4B8();
|
||||
gAudioLoadLock = AUDIO_LOCK_NOT_LOADING;
|
||||
|
||||
+4
-4
@@ -8,7 +8,7 @@
|
||||
#define PRELOAD_BANKS 2
|
||||
#define PRELOAD_SEQUENCE 1
|
||||
|
||||
#define IS_SEQUENCE_CHANNEL_VALID(ptr) ((u32)(ptr) != (u32)&gSequenceChannelNone)
|
||||
#define IS_SEQUENCE_CHANNEL_VALID(ptr) ((uintptr_t)(ptr) != (uintptr_t)&gSequenceChannelNone)
|
||||
|
||||
extern struct Note *gNotes;
|
||||
|
||||
@@ -36,11 +36,11 @@ extern u32 gSampleDmaNumListItems;
|
||||
extern ALSeqFile *gAlTbl;
|
||||
extern u8 *gAlBankSets;
|
||||
|
||||
void audio_dma_partial_copy_async(u32 *devAddr, u8 **vAddr, s32 *remaining, OSMesgQueue *queue, OSIoMesg *mesg);
|
||||
void audio_dma_partial_copy_async(uintptr_t *devAddr, u8 **vAddr, ssize_t *remaining, OSMesgQueue *queue, OSIoMesg *mesg);
|
||||
void decrease_sample_dma_ttls(void);
|
||||
void *dma_sample_data(u8 *arg0, u32 arg1, s32 arg2, u8 *arg3);
|
||||
void *dma_sample_data(u8 *devAddr, u32 size, s32 arg2, u8 *arg3);
|
||||
void func_8031758C(s32 arg0);
|
||||
void func_8031784C(struct AudioBank *arg0, u8 *offset, u32 arg2, u32 arg3);
|
||||
void func_8031784C(struct AudioBank *mem, u8 *offset, u32 numInstruments, u32 numDrums);
|
||||
void preload_sequence(u32 seqId, u8 preloadMask);
|
||||
void load_sequence(u32 player, u32 seqId, s32 loadAsync);
|
||||
|
||||
|
||||
+20
-29
@@ -109,7 +109,7 @@ void *soundAlloc(struct SoundAllocPool *pool, u32 size) {
|
||||
}
|
||||
|
||||
void func_80316094(struct SoundAllocPool *pool, void *arg1, u32 arg2) {
|
||||
pool->cur = pool->start = (u8 *) (((u32) arg1 + 0xf) & -0x10);
|
||||
pool->cur = pool->start = (u8 *) (((uintptr_t) arg1 + 0xf) & -0x10);
|
||||
pool->size = arg2;
|
||||
pool->unused = 0;
|
||||
}
|
||||
@@ -376,27 +376,24 @@ void func_803168CC(void) {
|
||||
void wait_for_audio_frames(s32 frames) {
|
||||
gActiveAudioFrames = 0;
|
||||
// Sound thread will update gActiveAudioFrames
|
||||
while (gActiveAudioFrames < frames) { /* spin */
|
||||
while (gActiveAudioFrames < frames) {
|
||||
// spin
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
#define frames s1
|
||||
void func_80316928(struct Struct80332190 *arg0) {
|
||||
// Wrong regalloc, and a lui which is too far up.
|
||||
s32 sp2C;
|
||||
s8 updatesPerFrame;
|
||||
s16 *mem;
|
||||
s32 i; // s0
|
||||
s32 sp2C;
|
||||
s32 i;
|
||||
s32 j;
|
||||
s32 k;
|
||||
s32 persistentMem;
|
||||
s32 temporaryMem;
|
||||
s32 totalMem;
|
||||
s32 wantMisc;
|
||||
s32 s1;
|
||||
s8 temp8;
|
||||
s32 size;
|
||||
UNUSED s32 temp;
|
||||
s32 frames;
|
||||
s32 remainingDmas;
|
||||
|
||||
if (gAudioLoadLock != AUDIO_LOCK_UNINITIALIZED) {
|
||||
func_803168CC();
|
||||
@@ -412,7 +409,7 @@ void func_80316928(struct Struct80332190 *arg0) {
|
||||
for (;;) {
|
||||
wait_for_audio_frames(1);
|
||||
frames++;
|
||||
if (frames > 8 * 30) {
|
||||
if (frames > 4 * 60) {
|
||||
// Break after 4 seconds
|
||||
break;
|
||||
}
|
||||
@@ -433,11 +430,11 @@ void func_80316928(struct Struct80332190 *arg0) {
|
||||
gAudioLoadLock = AUDIO_LOCK_LOADING;
|
||||
wait_for_audio_frames(3);
|
||||
|
||||
s1 = gCurrAudioFrameDmaCount;
|
||||
while (s1 > 0) {
|
||||
remainingDmas = gCurrAudioFrameDmaCount;
|
||||
while (remainingDmas > 0) {
|
||||
for (i = 0; i < gCurrAudioFrameDmaCount; i++) {
|
||||
if (osRecvMesg(&gCurrAudioFrameDmaQueue, NULL, OS_MESG_NOBLOCK) == 0)
|
||||
s1--;
|
||||
remainingDmas--;
|
||||
}
|
||||
}
|
||||
gCurrAudioFrameDmaCount = 0;
|
||||
@@ -453,8 +450,7 @@ void func_80316928(struct Struct80332190 *arg0) {
|
||||
sp2C = arg0->unk6;
|
||||
gAiFrequency = osAiSetFrequency(arg0->frequency);
|
||||
gMaxSimultaneousNotes = arg0->maxSimultaneousNotes;
|
||||
size = gAiFrequency / 60;
|
||||
D_80226D74 = ALIGN16(size);
|
||||
D_80226D74 = ALIGN16(gAiFrequency / 60);
|
||||
D_802212A2 = arg0->unk5;
|
||||
|
||||
switch (D_802212A2) {
|
||||
@@ -480,21 +476,22 @@ void func_80316928(struct Struct80332190 *arg0) {
|
||||
D_802212A2 = arg0->unk5;
|
||||
D_802212A0 = arg0->volume;
|
||||
gMinAiBufferLength = D_80226D74 - 0x10;
|
||||
temp8 = D_80226D74 / 160 + 1;
|
||||
gAudioUpdatesPerFrame = temp8;
|
||||
updatesPerFrame = D_80226D74 / 160 + 1;
|
||||
gAudioUpdatesPerFrame = D_80226D74 / 160 + 1;
|
||||
|
||||
// Compute conversion ratio from the internal unit tatums/tick to the
|
||||
// external beats/minute (JP) or tatums/minute (US). In practice this is
|
||||
// 300 on JP and 14360 on US.
|
||||
#ifdef VERSION_JP
|
||||
gTempoInternalToExternal = temp8 * 3600 / gTatumsPerBeat;
|
||||
gTempoInternalToExternal = updatesPerFrame * 3600 / gTatumsPerBeat;
|
||||
#else
|
||||
gTempoInternalToExternal = (u32)(temp8 * 2880000.0f / gTatumsPerBeat / 16.713f);
|
||||
gTempoInternalToExternal = (u32)(updatesPerFrame * 2880000.0f / gTatumsPerBeat / 16.713f);
|
||||
#endif
|
||||
D_80226D6C = gMaxSimultaneousNotes * 20 * temp8 + 320;
|
||||
|
||||
D_80226D6C = gMaxSimultaneousNotes * 20 * updatesPerFrame + 320;
|
||||
persistentMem = arg0->persistentBankMem + arg0->persistentSeqMem;
|
||||
temporaryMem = arg0->temporaryBankMem + arg0->temporarySeqMem;
|
||||
totalMem = persistentMem + temporaryMem;
|
||||
// (the address of D_802212A8.size is lui'd too far up)
|
||||
wantMisc = D_802212A8.size - totalMem - 0x100;
|
||||
D_80221898.wantSeq = wantMisc;
|
||||
D_80221898.wantCustom = totalMem;
|
||||
@@ -556,9 +553,3 @@ void func_80316928(struct Struct80332190 *arg0) {
|
||||
gAudioLoadLock = AUDIO_LOCK_NOT_LOADING;
|
||||
}
|
||||
}
|
||||
|
||||
#elif defined(VERSION_JP)
|
||||
GLOBAL_ASM("asm/non_matchings/func_80316928_jp.s")
|
||||
#else
|
||||
GLOBAL_ASM("asm/non_matchings/func_80316928_us.s")
|
||||
#endif
|
||||
|
||||
@@ -491,11 +491,11 @@ void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) {
|
||||
}
|
||||
|
||||
temp_v0_11 = &layer->adsr;
|
||||
if (((u32) gBankLoadedPool.persistent.pool.start <= (u32) inst
|
||||
&& (u32) inst <= (u32)(gBankLoadedPool.persistent.pool.start
|
||||
if (((uintptr_t) gBankLoadedPool.persistent.pool.start <= (uintptr_t) inst
|
||||
&& (uintptr_t) inst <= (uintptr_t)(gBankLoadedPool.persistent.pool.start
|
||||
+ gBankLoadedPool.persistent.pool.size))
|
||||
|| ((u32) gBankLoadedPool.temporary.pool.start <= (u32) inst
|
||||
&& (u32) inst <= (u32)(gBankLoadedPool.temporary.pool.start
|
||||
|| ((uintptr_t) gBankLoadedPool.temporary.pool.start <= (uintptr_t) inst
|
||||
&& (uintptr_t) inst <= (uintptr_t)(gBankLoadedPool.temporary.pool.start
|
||||
+ gBankLoadedPool.temporary.pool.size))) {
|
||||
temp_v0_11->envelope = inst->envelope;
|
||||
temp_v0_11->releaseRate = inst->releaseRate;
|
||||
@@ -802,11 +802,11 @@ u8 get_instrument(struct SequenceChannel *seqChannel, u8 instId, struct Instrume
|
||||
}
|
||||
}
|
||||
|
||||
if (((u32) gBankLoadedPool.persistent.pool.start <= (u32) inst
|
||||
&& (u32) inst
|
||||
<= (u32)(gBankLoadedPool.persistent.pool.start + gBankLoadedPool.persistent.pool.size))
|
||||
|| ((u32) gBankLoadedPool.temporary.pool.start <= (u32) inst
|
||||
&& (u32) inst <= (u32)(gBankLoadedPool.temporary.pool.start
|
||||
if (((uintptr_t) gBankLoadedPool.persistent.pool.start <= (uintptr_t) inst
|
||||
&& (uintptr_t) inst <= (uintptr_t)(gBankLoadedPool.persistent.pool.start
|
||||
+ gBankLoadedPool.persistent.pool.size))
|
||||
|| ((uintptr_t) gBankLoadedPool.temporary.pool.start <= (uintptr_t) inst
|
||||
&& (uintptr_t) inst <= (uintptr_t)(gBankLoadedPool.temporary.pool.start
|
||||
+ gBankLoadedPool.temporary.pool.size))) {
|
||||
adsr->envelope = inst->envelope;
|
||||
adsr->releaseRate = inst->releaseRate;
|
||||
|
||||
+25
-26
@@ -10,18 +10,17 @@
|
||||
|
||||
#define aSetLoadBufferPair(pkt, c, off) \
|
||||
aSetBuffer(pkt, 0, c + 0x740, 0, 0x140 - c); \
|
||||
aLoadBuffer(pkt, FIX(&D_802211B0.unk14.unk00[off])); \
|
||||
aLoadBuffer(pkt, VIRTUAL_TO_PHYSICAL2(&D_802211B0.unk14.unk00[off])); \
|
||||
aSetBuffer(pkt, 0, c + 0x880, 0, 0x140 - c); \
|
||||
aLoadBuffer(pkt, FIX(&D_802211B0.unk14.unk04[off]));
|
||||
aLoadBuffer(pkt, VIRTUAL_TO_PHYSICAL2(&D_802211B0.unk14.unk04[off]));
|
||||
|
||||
#define aSetSaveBufferPair(pkt, c, d, off) \
|
||||
aSetBuffer(pkt, 0, 0, c + 0x740, d); \
|
||||
aSaveBuffer(pkt, FIX(&D_802211B0.unk14.unk00[off])); \
|
||||
aSaveBuffer(pkt, VIRTUAL_TO_PHYSICAL2(&D_802211B0.unk14.unk00[off])); \
|
||||
aSetBuffer(pkt, 0, 0, c + 0x880, d); \
|
||||
aSaveBuffer(pkt, FIX(&D_802211B0.unk14.unk04[off]));
|
||||
aSaveBuffer(pkt, VIRTUAL_TO_PHYSICAL2(&D_802211B0.unk14.unk04[off]));
|
||||
|
||||
#define ALIGN(val, amnt) (((val) + (1 << amnt) - 1) & ~((1 << amnt) - 1))
|
||||
#define FIX(a) (u16 *) ((u8 *) (a) + 0x80000000U)
|
||||
|
||||
struct Struct802211B0 D_802211B0;
|
||||
u8 sAudioSynthesisPad[0x20];
|
||||
@@ -174,9 +173,9 @@ u64 *func_80313E54(u16 *aiBuf, s32 bufLen, u64 *cmd, u32 updateIndex) {
|
||||
aSetLoadBufferPair(cmd++, ra, 0);
|
||||
}
|
||||
aSetBuffer(cmd++, 0, t4 + 0x740, 0x4c0, bufLen << 1);
|
||||
aResample(cmd++, D_802211B0.unk0, (u16) D_802211B0.unk6, FIX(D_802211B0.unk1C));
|
||||
aResample(cmd++, D_802211B0.unk0, (u16) D_802211B0.unk6, VIRTUAL_TO_PHYSICAL2(D_802211B0.unk1C));
|
||||
aSetBuffer(cmd++, 0, t4 + 0x880, 0x600, bufLen << 1);
|
||||
aResample(cmd++, D_802211B0.unk0, (u16) D_802211B0.unk6, FIX(D_802211B0.unk20));
|
||||
aResample(cmd++, D_802211B0.unk0, (u16) D_802211B0.unk6, VIRTUAL_TO_PHYSICAL2(D_802211B0.unk20));
|
||||
aSetBuffer(cmd++, 0, 0, 0, 0x280);
|
||||
aMix(cmd++, 0, /*gain*/ D_802211B0.unk4 + 32768, /*in*/ 0x4c0, /*out*/ 0x4c0);
|
||||
aDMEMMove(cmd++, 0x4c0, 0x740, 0x280);
|
||||
@@ -189,7 +188,7 @@ u64 *func_80313E54(u16 *aiBuf, s32 bufLen, u64 *cmd, u32 updateIndex) {
|
||||
}
|
||||
} else {
|
||||
aSetBuffer(cmd++, 0, 0, 0x740, 0x280);
|
||||
aSaveBuffer(cmd++, FIX(D_802211B0.unk2C[D_802211B0.unk3][updateIndex].unk4));
|
||||
aSaveBuffer(cmd++, VIRTUAL_TO_PHYSICAL2(D_802211B0.unk2C[D_802211B0.unk3][updateIndex].unk4));
|
||||
D_802211B0.unk0 = 0;
|
||||
}
|
||||
}
|
||||
@@ -324,7 +323,7 @@ u64 *func_80314480(u16 *aiBuf, s32 bufLen, u64 *cmd) {
|
||||
u32 v1;
|
||||
sp15C = sp164->book->book;
|
||||
v1 = sp164->book->order * sp164->book->npredictors;
|
||||
aLoadADPCM(cmd++, v1 * 16, FIX(sp15C));
|
||||
aLoadADPCM(cmd++, v1 * 16, VIRTUAL_TO_PHYSICAL2(sp15C));
|
||||
}
|
||||
|
||||
while (fp != t5) {
|
||||
@@ -369,27 +368,27 @@ u64 *func_80314480(u16 *aiBuf, s32 bufLen, u64 *cmd) {
|
||||
// maybe keep a var for t0 * 9?
|
||||
v0_2 = dma_sample_data(sp120 + (s7->unk14 - s2 + 0x10) / 16 * 9, t0 * 9,
|
||||
sp148, &s7->sampleDmaIndex);
|
||||
a3 = (u32) v0_2 & 0xf;
|
||||
a3 = (u32)((uintptr_t) v0_2 & 0xf);
|
||||
aSetBuffer(cmd++, 0, 0x3f0, 0, t0 * 9 + a3);
|
||||
aLoadBuffer(cmd++, FIX(v0_2 - a3));
|
||||
aLoadBuffer(cmd++, VIRTUAL_TO_PHYSICAL2(v0_2 - a3));
|
||||
} else {
|
||||
s0 = 0;
|
||||
a3 = 0;
|
||||
}
|
||||
|
||||
if (s7->unk0b20 != 0) {
|
||||
aSetLoop(cmd++, FIX(sp164->loop->state));
|
||||
aSetLoop(cmd++, VIRTUAL_TO_PHYSICAL2(sp164->loop->state));
|
||||
sp148 = A_LOOP; // = 2
|
||||
s7->unk0b20 = 0;
|
||||
}
|
||||
|
||||
if (fp == 0) {
|
||||
aSetBuffer(cmd++, 0, a3 + 0x3f0, 0x180, s0 * 2);
|
||||
aADPCMdec(cmd++, sp148, FIX(s7->unk34->unk00));
|
||||
aADPCMdec(cmd++, sp148, VIRTUAL_TO_PHYSICAL2(s7->unk34->unk00));
|
||||
sp130 = s2 * 2;
|
||||
} else {
|
||||
aSetBuffer(cmd++, 0, a3 + 0x3f0, ALIGN(s5, 5) + 0x180, s0 * 2);
|
||||
aADPCMdec(cmd++, sp148, FIX(s7->unk34->unk00));
|
||||
aADPCMdec(cmd++, sp148, VIRTUAL_TO_PHYSICAL2(s7->unk34->unk00));
|
||||
aDMEMMove(cmd++, ALIGN(s5, 5) + (s2 * 2) + 0x180, s5 + 0x180,
|
||||
(s0 + s6_2 - s3) * 2);
|
||||
}
|
||||
@@ -440,7 +439,7 @@ u64 *func_80314480(u16 *aiBuf, s32 bufLen, u64 *cmd) {
|
||||
switch (spE4) {
|
||||
case 0:
|
||||
aSetBuffer(cmd++, 0, sp130 + 0x180, 0x20, t5 + 4);
|
||||
aResample(cmd++, 0x1, 0xff60, FIX(s7->unk34->unkF0));
|
||||
aResample(cmd++, 0x1, 0xff60, VIRTUAL_TO_PHYSICAL2(s7->unk34->unkF0));
|
||||
spD8 = t5 + 4;
|
||||
spD6 = 36;
|
||||
if (s7->unk0b10 != 0) {
|
||||
@@ -450,7 +449,7 @@ u64 *func_80314480(u16 *aiBuf, s32 bufLen, u64 *cmd) {
|
||||
|
||||
case 1:
|
||||
aSetBuffer(cmd++, 0, sp130 + 0x180, 0x160, t5 + 8);
|
||||
aResample(cmd++, 0x1, 0xff60, FIX(s7->unk34->unkF0));
|
||||
aResample(cmd++, 0x1, 0xff60, VIRTUAL_TO_PHYSICAL2(s7->unk34->unkF0));
|
||||
aDMEMMove(cmd++, 0x164, spD8 + 0x20, t5 + 4);
|
||||
break;
|
||||
}
|
||||
@@ -494,7 +493,7 @@ u64 *func_80314480(u16 *aiBuf, s32 bufLen, u64 *cmd) {
|
||||
aInterleave(cmd++, 0x4c0, 0x600);
|
||||
t9 *= 2;
|
||||
aSetBuffer(cmd++, 0, 0, 0, t9);
|
||||
aSaveBuffer(cmd++, FIX(aiBuf));
|
||||
aSaveBuffer(cmd++, VIRTUAL_TO_PHYSICAL2(aiBuf));
|
||||
return cmd;
|
||||
}
|
||||
|
||||
@@ -509,7 +508,7 @@ u64 *func_80314F08(u64 *cmd, struct Note *note, s32 arg2) {
|
||||
s32 i;
|
||||
aSetBuffer(cmd++, /*flags*/ 0, /*dmemin*/ 0x180, /*dmemout*/ 0,
|
||||
/*count*/ sizeof(note->unk34->samples)); // interesting that it's 128...
|
||||
aLoadBuffer(cmd++, FIX(note->unk34->samples));
|
||||
aLoadBuffer(cmd++, VIRTUAL_TO_PHYSICAL2(note->unk34->samples));
|
||||
note->unk14 = (note->sampleCount - 1) & note->unk14;
|
||||
a3 = 64 - note->unk14;
|
||||
if (a3 < arg2) {
|
||||
@@ -525,7 +524,7 @@ u64 *func_80314F08(u64 *cmd, struct Note *note, s32 arg2) {
|
||||
|
||||
u64 *func_80314FD4(u64 *cmd, struct Note *note, s32 arg2, u16 arg3, u16 arg4, u32 arg5) {
|
||||
aSetBuffer(cmd++, 0, arg4, 0, arg2);
|
||||
aResample(cmd++, arg5, arg3, FIX(note->unk34->unk20));
|
||||
aResample(cmd++, arg5, arg3, VIRTUAL_TO_PHYSICAL2(note->unk34->unk20));
|
||||
return cmd;
|
||||
}
|
||||
|
||||
@@ -593,7 +592,7 @@ u64 *func_80315094(u64 *cmd, struct Note *note, s32 arg2, u16 arg3, s32 arg4,
|
||||
aSetVolume(cmd++, A_AUX, D_802212A0, 0, note->reverbVol);
|
||||
}
|
||||
if (D_802211B0.unk1 && note->reverb) {
|
||||
aEnvMixer(cmd++, mixerFlags | A_AUX, FIX(note->unk34->unk40));
|
||||
aEnvMixer(cmd++, mixerFlags | A_AUX, VIRTUAL_TO_PHYSICAL2(note->unk34->unk40));
|
||||
if (note->stereoStrongRight) {
|
||||
aSetBuffer(cmd++, 0, 0, 0, arg2 * 2);
|
||||
aMix(cmd++, 0, /*gain*/ 0x8000, /*in*/ 0x200, /*out*/ 0x4c0);
|
||||
@@ -604,7 +603,7 @@ u64 *func_80315094(u64 *cmd, struct Note *note, s32 arg2, u16 arg3, s32 arg4,
|
||||
aMix(cmd++, 0, /*gain*/ 0x8000, /*in*/ 0x340, /*out*/ 0x880);
|
||||
}
|
||||
} else {
|
||||
aEnvMixer(cmd++, mixerFlags, FIX(note->unk34->unk40));
|
||||
aEnvMixer(cmd++, mixerFlags, VIRTUAL_TO_PHYSICAL2(note->unk34->unk40));
|
||||
if (note->stereoStrongRight) {
|
||||
aSetBuffer(cmd++, 0, 0, 0, arg2 * 2);
|
||||
aMix(cmd++, 0, /*gain*/ 0x8000, /*in*/ 0x200, /*out*/ 0x4c0);
|
||||
@@ -649,20 +648,20 @@ u64 *func_803155F4(u64 *cmd, struct Note *note, s32 arg2, s32 arg3, s32 leftRigh
|
||||
aClearBuffer(cmd++, 8, 8);
|
||||
aDMEMMove(cmd++, 0x200, 0x10, 0x10);
|
||||
aSetBuffer(cmd++, 0, 0, 0, 32);
|
||||
aSaveBuffer(cmd++, FIX(note->unk34->unk90));
|
||||
aSaveBuffer(cmd++, VIRTUAL_TO_PHYSICAL2(note->unk34->unk90));
|
||||
pitch = (arg2 << 0xf) / (panVolume + arg2 - prevPanVolume + 8);
|
||||
aSetBuffer(cmd++, 0, 0x208, 0, panVolume + arg2 - prevPanVolume);
|
||||
aResample(cmd++, 0, pitch, FIX(note->unk34->unk90));
|
||||
aResample(cmd++, 0, pitch, VIRTUAL_TO_PHYSICAL2(note->unk34->unk90));
|
||||
} else {
|
||||
pitch = (panVolume == 0) ? (arg2 << 0xf) / (arg2 - prevPanVolume - 4)
|
||||
: (arg2 << 0xf) / (arg2 + panVolume - prevPanVolume);
|
||||
aSetBuffer(cmd++, 0, 0x200, 0, panVolume + arg2 - prevPanVolume);
|
||||
aResample(cmd++, 0, pitch, FIX(note->unk34->unk90));
|
||||
aResample(cmd++, 0, pitch, VIRTUAL_TO_PHYSICAL2(note->unk34->unk90));
|
||||
}
|
||||
|
||||
if (prevPanVolume != 0) {
|
||||
aSetBuffer(cmd++, 0, 0x200, 0, prevPanVolume);
|
||||
aLoadBuffer(cmd++, FIX(note->unk34->unkB0));
|
||||
aLoadBuffer(cmd++, VIRTUAL_TO_PHYSICAL2(note->unk34->unkB0));
|
||||
aDMEMMove(cmd++, 0, prevPanVolume + 0x200, panVolume + arg2 - prevPanVolume);
|
||||
} else {
|
||||
aDMEMMove(cmd++, 0, 0x200, panVolume + arg2 - prevPanVolume);
|
||||
@@ -675,7 +674,7 @@ u64 *func_803155F4(u64 *cmd, struct Note *note, s32 arg2, s32 arg3, s32 leftRigh
|
||||
|
||||
if (panVolume) {
|
||||
aSetBuffer(cmd++, 0, 0, arg2 + 0x200, panVolume);
|
||||
aSaveBuffer(cmd++, FIX(note->unk34->unkB0));
|
||||
aSaveBuffer(cmd++, VIRTUAL_TO_PHYSICAL2(note->unk34->unkB0));
|
||||
}
|
||||
|
||||
aSetBuffer(cmd++, 0, 0, 0, arg2);
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
#define BUFFERS_H
|
||||
|
||||
#include "types.h"
|
||||
#include "save_file.h"
|
||||
#include "display.h"
|
||||
#include "game/save_file.h"
|
||||
#include "game/display.h"
|
||||
|
||||
extern u8 gDecompressionHeap[];
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
static u16 gRandomSeed16;
|
||||
|
||||
// unused
|
||||
static void func_80383B70(u32 segptr) {
|
||||
gBehCommand = segmented_to_virtual((void *) segptr);
|
||||
static void func_80383B70(void *segptr) {
|
||||
gBehCommand = segmented_to_virtual(segptr);
|
||||
gCurrentObject->stackIndex = 0;
|
||||
}
|
||||
|
||||
@@ -72,13 +72,13 @@ void func_80383D68(struct Object *object) {
|
||||
object->header.gfx.angle[2] = object->oFaceAngleRoll & 0xFFFF;
|
||||
}
|
||||
|
||||
static void cur_object_stack_push(u32 value) {
|
||||
static void cur_object_stack_push(uintptr_t value) {
|
||||
gCurrentObject->stack[gCurrentObject->stackIndex] = value;
|
||||
gCurrentObject->stackIndex++;
|
||||
}
|
||||
|
||||
static u32 cur_object_stack_pop(void) {
|
||||
u32 value;
|
||||
static uintptr_t cur_object_stack_pop(void) {
|
||||
uintptr_t value;
|
||||
gCurrentObject->stackIndex--;
|
||||
value = gCurrentObject->stack[gCurrentObject->stackIndex];
|
||||
return value;
|
||||
@@ -117,7 +117,7 @@ static s32 beh_cmd_graph_node(void) {
|
||||
}
|
||||
|
||||
static s32 beh_cmd_obj_load_chill(void) {
|
||||
u32 model = gBehCommand[1];
|
||||
u32 model = (u32) gBehCommand[1];
|
||||
void *arg1 = (void *) gBehCommand[2];
|
||||
|
||||
struct Object *object = spawn_object_at_origin(gCurrentObject, 0, model, arg1);
|
||||
@@ -129,7 +129,7 @@ static s32 beh_cmd_obj_load_chill(void) {
|
||||
}
|
||||
|
||||
static s32 beh_cmd_obj_spawn(void) {
|
||||
u32 model = gBehCommand[1];
|
||||
u32 model = (u32) gBehCommand[1];
|
||||
void *arg1 = (void *) gBehCommand[2];
|
||||
|
||||
struct Object *object = spawn_object_at_origin(gCurrentObject, 0, model, arg1);
|
||||
@@ -144,7 +144,7 @@ static s32 beh_cmd_obj_spawn(void) {
|
||||
|
||||
static s32 beh_cmd_obj_load_chill_param(void) {
|
||||
u32 behParam = (s16)(gBehCommand[0] & 0xFFFF);
|
||||
u32 model = gBehCommand[1];
|
||||
u32 model = (u32) gBehCommand[1];
|
||||
void *arg2 = (void *) gBehCommand[2];
|
||||
|
||||
struct Object *object = spawn_object_at_origin(gCurrentObject, 0, model, arg2);
|
||||
@@ -172,23 +172,23 @@ static s32 beh_cmd_break2(void) {
|
||||
}
|
||||
|
||||
static s32 beh_cmd_call(void) {
|
||||
u32 *jumpAddress;
|
||||
uintptr_t *jumpAddress;
|
||||
|
||||
gBehCommand++;
|
||||
cur_object_stack_push((u32)(gBehCommand + 1));
|
||||
jumpAddress = (u32 *) segmented_to_virtual((void *) gBehCommand[0]);
|
||||
cur_object_stack_push((uintptr_t)(gBehCommand + 1));
|
||||
jumpAddress = segmented_to_virtual((void *) gBehCommand[0]);
|
||||
gBehCommand = jumpAddress;
|
||||
|
||||
return BEH_CONTINUE;
|
||||
}
|
||||
|
||||
static s32 beh_cmd_return(void) {
|
||||
gBehCommand = (u32 *) cur_object_stack_pop();
|
||||
gBehCommand = (uintptr_t *) cur_object_stack_pop();
|
||||
return BEH_CONTINUE;
|
||||
}
|
||||
|
||||
static s32 beh_cmd_delay(void) {
|
||||
s16 arg0 = gBehCommand[0] & 0xFFFF;
|
||||
s16 arg0 = (s16)(gBehCommand[0] & 0xFFFF);
|
||||
|
||||
if (gCurrentObject->unk1F4 < arg0 - 1) {
|
||||
gCurrentObject->unk1F4++;
|
||||
@@ -201,7 +201,7 @@ static s32 beh_cmd_delay(void) {
|
||||
}
|
||||
|
||||
static s32 beh_cmd_delay_var(void) {
|
||||
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF;
|
||||
u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
|
||||
s32 arg0 = cur_object_get_int(objectOffset);
|
||||
|
||||
if (gCurrentObject->unk1F4 < (arg0 - 1)) {
|
||||
@@ -216,7 +216,7 @@ static s32 beh_cmd_delay_var(void) {
|
||||
|
||||
static s32 beh_cmd_goto(void) {
|
||||
gBehCommand++;
|
||||
gBehCommand = (u32 *) segmented_to_virtual((void *) gBehCommand[0]);
|
||||
gBehCommand = segmented_to_virtual((void *) gBehCommand[0]);
|
||||
return BEH_CONTINUE;
|
||||
}
|
||||
|
||||
@@ -224,7 +224,7 @@ static s32 beh_cmd_goto(void) {
|
||||
static s32 Behavior26(void) {
|
||||
s32 value = (u8)(gBehCommand[0] >> 16) & 0xFF;
|
||||
|
||||
cur_object_stack_push((u32)(gBehCommand + 1));
|
||||
cur_object_stack_push((uintptr_t)(gBehCommand + 1));
|
||||
cur_object_stack_push(value);
|
||||
|
||||
gBehCommand++;
|
||||
@@ -235,7 +235,7 @@ static s32 Behavior26(void) {
|
||||
static s32 beh_cmd_begin_repeat(void) {
|
||||
s32 count = (s16)(gBehCommand[0] & 0xFFFF);
|
||||
|
||||
cur_object_stack_push((u32)(gBehCommand + 1));
|
||||
cur_object_stack_push((uintptr_t)(gBehCommand + 1));
|
||||
cur_object_stack_push(count);
|
||||
|
||||
gBehCommand++;
|
||||
@@ -244,12 +244,12 @@ static s32 beh_cmd_begin_repeat(void) {
|
||||
}
|
||||
|
||||
static s32 beh_cmd_end_repeat(void) {
|
||||
u32 count = cur_object_stack_pop();
|
||||
u32 count = (u32) cur_object_stack_pop();
|
||||
|
||||
count--;
|
||||
if (count != 0) {
|
||||
gBehCommand = (u32 *) cur_object_stack_pop();
|
||||
cur_object_stack_push((u32) gBehCommand);
|
||||
gBehCommand = (uintptr_t *) cur_object_stack_pop();
|
||||
cur_object_stack_push((uintptr_t) gBehCommand);
|
||||
cur_object_stack_push(count);
|
||||
} else {
|
||||
cur_object_stack_pop();
|
||||
@@ -260,12 +260,12 @@ static s32 beh_cmd_end_repeat(void) {
|
||||
}
|
||||
|
||||
static s32 beh_cmd_end_repeat_nobreak(void) {
|
||||
u32 count = cur_object_stack_pop();
|
||||
u32 count = (u32) cur_object_stack_pop();
|
||||
|
||||
count--;
|
||||
if (count != 0) {
|
||||
gBehCommand = (u32 *) cur_object_stack_pop();
|
||||
cur_object_stack_push((u32) gBehCommand);
|
||||
gBehCommand = (uintptr_t *) cur_object_stack_pop();
|
||||
cur_object_stack_push((uintptr_t) gBehCommand);
|
||||
cur_object_stack_push(count);
|
||||
} else {
|
||||
cur_object_stack_pop();
|
||||
@@ -276,15 +276,15 @@ static s32 beh_cmd_end_repeat_nobreak(void) {
|
||||
}
|
||||
|
||||
static s32 beh_cmd_begin_loop(void) {
|
||||
cur_object_stack_push((u32)(gBehCommand + 1));
|
||||
cur_object_stack_push((uintptr_t)(gBehCommand + 1));
|
||||
|
||||
gBehCommand++;
|
||||
return BEH_CONTINUE;
|
||||
}
|
||||
|
||||
static s32 beh_cmd_end_loop(void) {
|
||||
gBehCommand = (u32 *) cur_object_stack_pop();
|
||||
cur_object_stack_push((u32) gBehCommand);
|
||||
gBehCommand = (uintptr_t *) cur_object_stack_pop();
|
||||
cur_object_stack_push((uintptr_t) gBehCommand);
|
||||
|
||||
return BEH_BREAK;
|
||||
}
|
||||
@@ -301,7 +301,7 @@ static s32 beh_cmd_callnative(void) {
|
||||
}
|
||||
|
||||
static s32 beh_cmd_obj_set_float(void) {
|
||||
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF;
|
||||
u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
|
||||
f32 value = (s16)(gBehCommand[0] & 0xFFFF);
|
||||
|
||||
cur_object_set_float(objectOffset, value);
|
||||
@@ -311,8 +311,8 @@ static s32 beh_cmd_obj_set_float(void) {
|
||||
}
|
||||
|
||||
static s32 beh_cmd_obj_set_int(void) {
|
||||
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF;
|
||||
s16 value = gBehCommand[0] & 0xFFFF;
|
||||
u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
|
||||
s16 value = (s16)(gBehCommand[0] & 0xFFFF);
|
||||
|
||||
cur_object_set_int(objectOffset, value);
|
||||
|
||||
@@ -322,7 +322,7 @@ static s32 beh_cmd_obj_set_int(void) {
|
||||
|
||||
// unused
|
||||
static s32 Behavior36(void) {
|
||||
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF;
|
||||
u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
|
||||
u32 value = (s16)(gBehCommand[1] & 0xFFFF);
|
||||
|
||||
cur_object_set_int(objectOffset, value);
|
||||
@@ -332,7 +332,7 @@ static s32 Behavior36(void) {
|
||||
}
|
||||
|
||||
static s32 beh_cmd_obj_set_float_rand(void) {
|
||||
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF;
|
||||
u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
|
||||
f32 min = (s16)(gBehCommand[0] & 0xFFFF);
|
||||
f32 max = (s16)(gBehCommand[1] >> 16);
|
||||
|
||||
@@ -343,7 +343,7 @@ static s32 beh_cmd_obj_set_float_rand(void) {
|
||||
}
|
||||
|
||||
static s32 beh_cmd_obj_set_int_rand(void) {
|
||||
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF;
|
||||
u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
|
||||
s32 min = (s16)(gBehCommand[0] & 0xFFFF);
|
||||
s32 max = (s16)(gBehCommand[1] >> 16);
|
||||
|
||||
@@ -354,7 +354,7 @@ static s32 beh_cmd_obj_set_int_rand(void) {
|
||||
}
|
||||
|
||||
static s32 beh_cmd_obj_set_int_rand_rshift(void) {
|
||||
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF;
|
||||
u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
|
||||
s32 min = (s16)(gBehCommand[0] & 0xFFFF);
|
||||
s32 rshift = (s16)(gBehCommand[1] >> 16);
|
||||
|
||||
@@ -365,7 +365,7 @@ static s32 beh_cmd_obj_set_int_rand_rshift(void) {
|
||||
}
|
||||
|
||||
static s32 beh_cmd_obj_add_float_rand(void) {
|
||||
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF;
|
||||
u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
|
||||
f32 min = (s16)(gBehCommand[0] & 0xFFFF);
|
||||
f32 max = (s16)(gBehCommand[1] >> 16);
|
||||
|
||||
@@ -378,7 +378,7 @@ static s32 beh_cmd_obj_add_float_rand(void) {
|
||||
|
||||
// unused
|
||||
static s32 beh_cmd_obj_add_int_rand_rshift(void) {
|
||||
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF;
|
||||
u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
|
||||
s32 min = (s16)(gBehCommand[0] & 0xFFFF);
|
||||
s32 rshift = (s16)(gBehCommand[1] >> 16);
|
||||
s32 rnd = RandomU16();
|
||||
@@ -390,7 +390,7 @@ static s32 beh_cmd_obj_add_int_rand_rshift(void) {
|
||||
}
|
||||
|
||||
static s32 beh_cmd_obj_add_float(void) {
|
||||
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF;
|
||||
u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
|
||||
f32 value = (s16)(gBehCommand[0] & 0xFFFF);
|
||||
|
||||
cur_object_add_float(objectOffset, value);
|
||||
@@ -400,7 +400,7 @@ static s32 beh_cmd_obj_add_float(void) {
|
||||
}
|
||||
|
||||
static s32 beh_cmd_obj_add_int(void) {
|
||||
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF;
|
||||
u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
|
||||
s16 value = gBehCommand[0] & 0xFFFF;
|
||||
|
||||
cur_object_add_int(objectOffset, value);
|
||||
@@ -410,7 +410,7 @@ static s32 beh_cmd_obj_add_int(void) {
|
||||
}
|
||||
|
||||
static s32 beh_cmd_obj_or_int(void) {
|
||||
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF;
|
||||
u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
|
||||
s32 value = (s16)(gBehCommand[0] & 0xFFFF);
|
||||
|
||||
value &= 0xFFFF;
|
||||
@@ -422,7 +422,7 @@ static s32 beh_cmd_obj_or_int(void) {
|
||||
|
||||
// unused
|
||||
static s32 beh_cmd_obj_bit_clear_int(void) {
|
||||
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF;
|
||||
u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
|
||||
s32 value = (s16)(gBehCommand[0] & 0xFFFF);
|
||||
|
||||
value = (value & 0xFFFF) ^ 0xFFFF;
|
||||
@@ -433,7 +433,7 @@ static s32 beh_cmd_obj_bit_clear_int(void) {
|
||||
}
|
||||
|
||||
static s32 beh_cmd_obj_set_int32(void) {
|
||||
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF;
|
||||
u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
|
||||
|
||||
cur_object_set_int(objectOffset, gBehCommand[1]);
|
||||
|
||||
@@ -443,7 +443,7 @@ static s32 beh_cmd_obj_set_int32(void) {
|
||||
|
||||
static s32 beh_cmd_obj_animate(void) {
|
||||
s32 animIndex = (u8)((gBehCommand[0] >> 16) & 0xFF);
|
||||
u32 *animations = gCurrentObject->oAnimations;
|
||||
struct Animation **animations = gCurrentObject->oAnimations;
|
||||
|
||||
geo_obj_init_animation((struct GraphNodeObject *) gCurrentObject, &animations[animIndex]);
|
||||
|
||||
@@ -517,8 +517,8 @@ static s32 beh_cmd_obj_sum_int(void) {
|
||||
}
|
||||
|
||||
static s32 beh_cmd_set_hitbox(void) {
|
||||
s16 colSphereX = gBehCommand[1] >> 16;
|
||||
s16 colSphereY = gBehCommand[1] & 0xFFFF;
|
||||
s16 colSphereX = (s16)(gBehCommand[1] >> 16);
|
||||
s16 colSphereY = (s16)(gBehCommand[1] & 0xFFFF);
|
||||
|
||||
gCurrentObject->hitboxRadius = colSphereX;
|
||||
gCurrentObject->hitboxHeight = colSphereY;
|
||||
@@ -528,8 +528,8 @@ static s32 beh_cmd_set_hitbox(void) {
|
||||
}
|
||||
|
||||
static s32 beh_cmd_obj_set_float2(void) {
|
||||
s16 arg0 = gBehCommand[1] >> 16;
|
||||
s16 arg1 = gBehCommand[1] & 0xFFFF;
|
||||
s16 arg0 = (s16)(gBehCommand[1] >> 16);
|
||||
s16 arg1 = (s16)(gBehCommand[1] & 0xFFFF);
|
||||
|
||||
gCurrentObject->hurtboxRadius = arg0;
|
||||
gCurrentObject->hurtboxHeight = arg1;
|
||||
@@ -539,9 +539,9 @@ static s32 beh_cmd_obj_set_float2(void) {
|
||||
}
|
||||
|
||||
static s32 beh_cmd_collision_sphere(void) {
|
||||
s16 colSphereX = gBehCommand[1] >> 16;
|
||||
s16 colSphereY = gBehCommand[1] & 0xFFFF;
|
||||
s16 unknown = gBehCommand[2] >> 16;
|
||||
s16 colSphereX = (s16)(gBehCommand[1] >> 16);
|
||||
s16 colSphereY = (s16)(gBehCommand[1] & 0xFFFF);
|
||||
s16 unknown = (s16)(gBehCommand[2] >> 16);
|
||||
|
||||
gCurrentObject->hitboxRadius = colSphereX;
|
||||
gCurrentObject->hitboxHeight = colSphereY;
|
||||
@@ -576,7 +576,7 @@ static s32 beh_cmd_begin(void) {
|
||||
}
|
||||
|
||||
static void Unknown8038556C(s32 lastIndex) {
|
||||
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF;
|
||||
u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
|
||||
u32 table[16];
|
||||
s32 i;
|
||||
|
||||
@@ -604,7 +604,7 @@ static s32 beh_cmd_obj_set_pos(void) {
|
||||
}
|
||||
|
||||
static s32 beh_cmd_interact_type(void) {
|
||||
gCurrentObject->oInteractType = gBehCommand[1];
|
||||
gCurrentObject->oInteractType = (u32) gBehCommand[1];
|
||||
|
||||
gBehCommand += 2;
|
||||
return BEH_CONTINUE;
|
||||
@@ -612,14 +612,14 @@ static s32 beh_cmd_interact_type(void) {
|
||||
|
||||
// unused
|
||||
static s32 Behavior31(void) {
|
||||
gCurrentObject->oInteractionSubtype = gBehCommand[1];
|
||||
gCurrentObject->oInteractionSubtype = (u32) gBehCommand[1];
|
||||
|
||||
gBehCommand += 2;
|
||||
return BEH_CONTINUE;
|
||||
}
|
||||
|
||||
static s32 beh_cmd_scale(void) {
|
||||
UNUSED u8 sp1f = (gBehCommand[0] >> 16) & 0xFF;
|
||||
UNUSED u8 sp1f = (u8)((gBehCommand[0] >> 16) & 0xFF);
|
||||
s16 sp1c = gBehCommand[0] & 0xFFFF;
|
||||
|
||||
obj_scale((f32) sp1c / 100.0f);
|
||||
@@ -647,7 +647,7 @@ static s32 beh_cmd_obj_set_gravity(void) {
|
||||
}
|
||||
|
||||
static s32 beh_cmd_obj_bit_clear_int32(void) {
|
||||
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF;
|
||||
u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
|
||||
s32 flags = gBehCommand[1];
|
||||
|
||||
flags = flags ^ 0xFFFFFFFF;
|
||||
@@ -666,7 +666,7 @@ static s32 beh_cmd_spawn_addr(void) {
|
||||
}
|
||||
|
||||
static s32 beh_cmd_text_anim_rate(void) {
|
||||
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF;
|
||||
u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
|
||||
s16 arg1 = (gBehCommand[0] & 0xFFFF);
|
||||
|
||||
if ((gGlobalTimer % arg1) == 0) {
|
||||
|
||||
+29
-30
@@ -91,7 +91,7 @@ UNUSED s32 D_8038BCA8;
|
||||
struct GraphNode **gGeoViews;
|
||||
u16 gGeoNumViews; // length of gGeoViews array
|
||||
|
||||
u32 gGeoLayoutStack[16];
|
||||
uintptr_t gGeoLayoutStack[16];
|
||||
struct GraphNode *gCurGraphNodeList[32];
|
||||
s16 gCurGraphNodeIndex;
|
||||
s16 gGeoLayoutStackIndex; // similar to SP register in MIPS
|
||||
@@ -107,10 +107,10 @@ u32 unused_8038B894[3] = { 0 };
|
||||
cmd+0x04: void *branchTarget
|
||||
*/
|
||||
void geo_layout_cmd_branch_and_link(void) {
|
||||
gGeoLayoutStack[gGeoLayoutStackIndex++] = (u32) &gGeoLayoutCommand[8];
|
||||
gGeoLayoutStack[gGeoLayoutStackIndex++] = (uintptr_t) (gGeoLayoutCommand + 4 + sizeof(void *));
|
||||
gGeoLayoutStack[gGeoLayoutStackIndex++] = (gCurGraphNodeIndex << 16) + gGeoLayoutReturnIndex;
|
||||
gGeoLayoutReturnIndex = gGeoLayoutStackIndex;
|
||||
gGeoLayoutCommand = (u8 *) segmented_to_virtual((void *) cur_geo_cmd_s32(0x04));
|
||||
gGeoLayoutCommand = segmented_to_virtual(cur_geo_cmd_ptr(0x04));
|
||||
}
|
||||
|
||||
// 0x01: Terminate geo layout
|
||||
@@ -127,10 +127,10 @@ void geo_layout_cmd_end(void) {
|
||||
*/
|
||||
void geo_layout_cmd_branch(void) {
|
||||
if (cur_geo_cmd_u8(0x01) == 1) {
|
||||
gGeoLayoutStack[gGeoLayoutStackIndex++] = (u32) &gGeoLayoutCommand[8];
|
||||
gGeoLayoutStack[gGeoLayoutStackIndex++] = (uintptr_t) (gGeoLayoutCommand + 4 + sizeof(void *));
|
||||
}
|
||||
|
||||
gGeoLayoutCommand = (u8 *) segmented_to_virtual((void *) cur_geo_cmd_s32(0x04));
|
||||
gGeoLayoutCommand = segmented_to_virtual(cur_geo_cmd_ptr(0x04));
|
||||
}
|
||||
|
||||
// 0x03: Return from branch
|
||||
@@ -216,8 +216,7 @@ void geo_layout_cmd_node_root(void) {
|
||||
graphNode = init_graph_node_root(gGraphNodePool, NULL, 0, x, y, width, height);
|
||||
|
||||
// TODO: check type
|
||||
gGeoViews =
|
||||
(struct GraphNode **) alloc_only_pool_alloc(gGraphNodePool, gGeoNumViews * sizeof(void *));
|
||||
gGeoViews = alloc_only_pool_alloc(gGraphNodePool, gGeoNumViews * sizeof(struct GraphNode *));
|
||||
|
||||
graphNode->views = gGeoViews;
|
||||
graphNode->numViews = gGeoNumViews;
|
||||
@@ -263,8 +262,8 @@ void geo_layout_cmd_node_perspective(void) {
|
||||
|
||||
if (cur_geo_cmd_u8(0x01) != 0) {
|
||||
// optional asm function
|
||||
frustumFunc = (GraphNodeFunc) cur_geo_cmd_s32(0x08);
|
||||
gGeoLayoutCommand += 0x04;
|
||||
frustumFunc = (GraphNodeFunc) cur_geo_cmd_ptr(0x08);
|
||||
gGeoLayoutCommand += sizeof(void *);
|
||||
}
|
||||
|
||||
graphNode = init_graph_node_perspective(gGraphNodePool, NULL, (f32) fov, near, far, frustumFunc, 0);
|
||||
@@ -340,12 +339,12 @@ void geo_layout_cmd_node_switch_case(void) {
|
||||
init_graph_node_switch_case(gGraphNodePool, NULL,
|
||||
cur_geo_cmd_s16(0x02), // case which is initially selected
|
||||
0,
|
||||
(GraphNodeFunc) cur_geo_cmd_s32(0x04), // case update function
|
||||
(GraphNodeFunc) cur_geo_cmd_ptr(0x04), // case update function
|
||||
0);
|
||||
|
||||
register_scene_graph_node(&graphNode->fnNode.node);
|
||||
|
||||
gGeoLayoutCommand += 0x08;
|
||||
gGeoLayoutCommand += 0x04 + sizeof(void *);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -369,13 +368,13 @@ void geo_layout_cmd_node_camera(void) {
|
||||
cmdPos = read_vec3s_to_vec3f(toPos, cmdPos);
|
||||
|
||||
graphNode = init_graph_node_camera(gGraphNodePool, NULL, fromPos, toPos,
|
||||
(GraphNodeFunc) cur_geo_cmd_s32(0x10), cur_geo_cmd_s16(0x02));
|
||||
(GraphNodeFunc) cur_geo_cmd_ptr(0x10), cur_geo_cmd_s16(0x02));
|
||||
|
||||
register_scene_graph_node(&graphNode->fnNode.node);
|
||||
|
||||
gGeoViews[0] = &graphNode->fnNode.node;
|
||||
|
||||
gGeoLayoutCommand += 0x14;
|
||||
gGeoLayoutCommand += 0x10 + sizeof(void *);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -446,7 +445,7 @@ void geo_layout_cmd_node_translation_rotation(void) {
|
||||
if (params & 0x80) {
|
||||
displayList = *(void **) &cmdPos[0];
|
||||
drawingLayer = params & 0x0F;
|
||||
cmdPos += 2;
|
||||
cmdPos += sizeof(void*) / 2;
|
||||
}
|
||||
|
||||
graphNode = init_graph_node_translation_rotation(gGraphNodePool, NULL, drawingLayer, displayList,
|
||||
@@ -481,7 +480,7 @@ void geo_layout_cmd_node_translation(void) {
|
||||
if (params & 0x80) {
|
||||
displayList = *(void **) &cmdPos[0];
|
||||
drawingLayer = params & 0x0F;
|
||||
cmdPos += 2;
|
||||
cmdPos += sizeof(void*) / 2;
|
||||
}
|
||||
|
||||
graphNode =
|
||||
@@ -517,7 +516,7 @@ void geo_layout_cmd_node_rotation(void) {
|
||||
if (params & 0x80) {
|
||||
displayList = *(void **) &cmdPos[0];
|
||||
drawingLayer = params & 0x0F;
|
||||
cmdPos += 2;
|
||||
cmdPos += sizeof(void*) / 2;
|
||||
}
|
||||
|
||||
graphNode = init_graph_node_rotation(gGraphNodePool, NULL, drawingLayer, displayList, sp2c);
|
||||
@@ -544,9 +543,9 @@ void geo_layout_cmd_node_scale(void) {
|
||||
void *displayList = NULL;
|
||||
|
||||
if (params & 0x80) {
|
||||
displayList = (void *) cur_geo_cmd_s32(0x08);
|
||||
displayList = cur_geo_cmd_ptr(0x08);
|
||||
drawingLayer = params & 0x0F;
|
||||
gGeoLayoutCommand += 0x04;
|
||||
gGeoLayoutCommand += sizeof(void *);
|
||||
}
|
||||
|
||||
graphNode = init_graph_node_scale(gGraphNodePool, NULL, drawingLayer, displayList, scale);
|
||||
@@ -573,7 +572,7 @@ void geo_layout_cmd_node_animated_part(void) {
|
||||
struct GraphNodeAnimatedPart *graphNode;
|
||||
Vec3s translation;
|
||||
s32 drawingLayer = cur_geo_cmd_u8(0x01);
|
||||
void *displayList = (void *) cur_geo_cmd_s32(0x08);
|
||||
void *displayList = cur_geo_cmd_ptr(0x08);
|
||||
s16 *cmdPos = (s16 *) gGeoLayoutCommand;
|
||||
|
||||
read_vec3s(translation, &cmdPos[1]);
|
||||
@@ -583,7 +582,7 @@ void geo_layout_cmd_node_animated_part(void) {
|
||||
|
||||
register_scene_graph_node(&graphNode->node);
|
||||
|
||||
gGeoLayoutCommand += 0x0C;
|
||||
gGeoLayoutCommand += 0x08 + sizeof(void *);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -609,7 +608,7 @@ void geo_layout_cmd_node_billboard(void) {
|
||||
if (params & 0x80) {
|
||||
displayList = *(void **) &cmdPos[0];
|
||||
drawingLayer = params & 0x0F;
|
||||
cmdPos += 2;
|
||||
cmdPos += sizeof(void*) / 2;
|
||||
}
|
||||
|
||||
graphNode = init_graph_node_billboard(gGraphNodePool, NULL, drawingLayer, displayList, translation);
|
||||
@@ -627,13 +626,13 @@ void geo_layout_cmd_node_billboard(void) {
|
||||
void geo_layout_cmd_node_display_list(void) {
|
||||
struct GraphNodeDisplayList *graphNode;
|
||||
s32 drawingLayer = cur_geo_cmd_u8(0x01);
|
||||
void *displayList = (void *) cur_geo_cmd_s32(0x04);
|
||||
void *displayList = cur_geo_cmd_ptr(0x04);
|
||||
|
||||
graphNode = init_graph_node_display_list(gGraphNodePool, NULL, drawingLayer, displayList);
|
||||
|
||||
register_scene_graph_node(&graphNode->node);
|
||||
|
||||
gGeoLayoutCommand += 0x08;
|
||||
gGeoLayoutCommand += 0x04 + sizeof(void *);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -675,12 +674,12 @@ void geo_layout_cmd_node_generated(void) {
|
||||
struct GraphNodeGenerated *graphNode;
|
||||
|
||||
graphNode = init_graph_node_generated(gGraphNodePool, NULL,
|
||||
(GraphNodeFunc) cur_geo_cmd_s32(0x04), // asm function
|
||||
(GraphNodeFunc) cur_geo_cmd_ptr(0x04), // asm function
|
||||
cur_geo_cmd_s16(0x02)); // parameter
|
||||
|
||||
register_scene_graph_node(&graphNode->fnNode.node);
|
||||
|
||||
gGeoLayoutCommand += 0x08;
|
||||
gGeoLayoutCommand += 0x04 + sizeof(void *);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -694,12 +693,12 @@ void geo_layout_cmd_node_background(void) {
|
||||
graphNode = init_graph_node_background(
|
||||
gGraphNodePool, NULL,
|
||||
cur_geo_cmd_s16(0x02), // background ID, or RGBA5551 color if asm function is null
|
||||
(GraphNodeFunc) cur_geo_cmd_s32(0x04), // asm function
|
||||
(GraphNodeFunc) cur_geo_cmd_ptr(0x04), // asm function
|
||||
0);
|
||||
|
||||
register_scene_graph_node(&graphNode->fnNode.node);
|
||||
|
||||
gGeoLayoutCommand += 0x08;
|
||||
gGeoLayoutCommand += 0x04 + sizeof(void *);
|
||||
}
|
||||
|
||||
// 0x1A: No operation
|
||||
@@ -749,11 +748,11 @@ void geo_layout_cmd_node_held_obj(void) {
|
||||
read_vec3s(offset, (s16 *) &gGeoLayoutCommand[0x02]);
|
||||
|
||||
graphNode = init_graph_node_held_object(
|
||||
gGraphNodePool, NULL, 0, offset, (GraphNodeFunc) cur_geo_cmd_s32(0x08), cur_geo_cmd_u8(0x01));
|
||||
gGraphNodePool, NULL, NULL, offset, (GraphNodeFunc) cur_geo_cmd_ptr(0x08), cur_geo_cmd_u8(0x01));
|
||||
|
||||
register_scene_graph_node(&graphNode->fnNode.node);
|
||||
|
||||
gGeoLayoutCommand += 0x0C;
|
||||
gGeoLayoutCommand += 0x08 + sizeof(void *);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -781,7 +780,7 @@ struct GraphNode *process_geo_layout(struct AllocOnlyPool *pool, void *segptr) {
|
||||
gGeoLayoutStackIndex = 2;
|
||||
gGeoLayoutReturnIndex = 2; // stack index is often copied here?
|
||||
|
||||
gGeoLayoutCommand = (u8 *) segmented_to_virtual(segptr);
|
||||
gGeoLayoutCommand = segmented_to_virtual(segptr);
|
||||
|
||||
gGraphNodePool = pool;
|
||||
|
||||
|
||||
@@ -19,12 +19,15 @@
|
||||
#define cur_geo_cmd_u32(offset) \
|
||||
(*(u32 *) &gGeoLayoutCommand[offset])
|
||||
|
||||
#define cur_geo_cmd_ptr(offset) \
|
||||
(*(void **) &gGeoLayoutCommand[offset])
|
||||
|
||||
extern struct AllocOnlyPool *gGraphNodePool;
|
||||
extern struct GraphNode *gCurRootGraphNode;
|
||||
extern UNUSED s32 D_8038BCA8;
|
||||
extern struct GraphNode **gGeoViews;
|
||||
extern u16 gGeoNumViews;
|
||||
extern u32 gGeoLayoutStack[];
|
||||
extern uintptr_t gGeoLayoutStack[];
|
||||
extern struct GraphNode *gCurGraphNodeList[];
|
||||
extern s16 gCurGraphNodeIndex;
|
||||
extern s16 gGeoLayoutStackIndex;
|
||||
|
||||
+10
-9
@@ -497,7 +497,8 @@ struct GraphNodeBackground *init_graph_node_background(struct AllocOnlyPool *poo
|
||||
*/
|
||||
struct GraphNodeHeldObject *init_graph_node_held_object(struct AllocOnlyPool *pool,
|
||||
struct GraphNodeHeldObject *graphNode,
|
||||
s32 objNode, Vec3s translation,
|
||||
struct GraphNodeObject *objNode,
|
||||
Vec3s translation,
|
||||
GraphNodeFunc nodeFunc, s32 unused) {
|
||||
if (pool != NULL) {
|
||||
graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodeHeldObject));
|
||||
@@ -506,7 +507,7 @@ struct GraphNodeHeldObject *init_graph_node_held_object(struct AllocOnlyPool *po
|
||||
if (graphNode != NULL) {
|
||||
init_scene_graph_node_links(&graphNode->fnNode.node, GRAPH_NODE_TYPE_HELD_OBJ);
|
||||
vec3s_copy(graphNode->translation, translation);
|
||||
graphNode->objNode = (struct GraphNodeObject *) objNode; // assumed type
|
||||
graphNode->objNode = objNode;
|
||||
graphNode->fnNode.func = nodeFunc;
|
||||
graphNode->unused = unused;
|
||||
|
||||
@@ -732,13 +733,13 @@ void geo_obj_init_spawninfo(struct GraphNodeObject *graphNode, struct SpawnInfo
|
||||
/**
|
||||
* Initialize the animation of an object node
|
||||
*/
|
||||
void geo_obj_init_animation(struct GraphNodeObject *graphNode, void *sp34) {
|
||||
void **animSegmented = segmented_to_virtual(sp34);
|
||||
struct Animation *anim = segmented_to_virtual(animSegmented[0]);
|
||||
void geo_obj_init_animation(struct GraphNodeObject *graphNode, struct Animation **animPtrAddr) {
|
||||
struct Animation **animSegmented = segmented_to_virtual(animPtrAddr);
|
||||
struct Animation *anim = segmented_to_virtual(*animSegmented);
|
||||
|
||||
if (graphNode->unk38.curAnim != anim) {
|
||||
graphNode->unk38.curAnim = anim;
|
||||
graphNode->unk38.animFrame = (anim->unk04) + ((anim->flags & ANIM_FLAG_FORWARD) ? 1 : -1);
|
||||
graphNode->unk38.animFrame = anim->unk04 + ((anim->flags & ANIM_FLAG_FORWARD) ? 1 : -1);
|
||||
graphNode->unk38.animAccel = 0;
|
||||
graphNode->unk38.animYTrans = 0;
|
||||
}
|
||||
@@ -747,9 +748,9 @@ void geo_obj_init_animation(struct GraphNodeObject *graphNode, void *sp34) {
|
||||
/**
|
||||
* Initialize the animation of an object node
|
||||
*/
|
||||
void geo_obj_init_animation_accel(struct GraphNodeObject *graphNode, void *sp34, u32 animAccel) {
|
||||
void **animSegmented = segmented_to_virtual(sp34);
|
||||
struct Animation *anim = segmented_to_virtual(animSegmented[0]);
|
||||
void geo_obj_init_animation_accel(struct GraphNodeObject *graphNode, struct Animation **animPtrAddr, u32 animAccel) {
|
||||
struct Animation **animSegmented = segmented_to_virtual(animPtrAddr);
|
||||
struct Animation *anim = segmented_to_virtual(*animSegmented);
|
||||
|
||||
if (graphNode->unk38.curAnim != anim) {
|
||||
graphNode->unk38.curAnim = anim;
|
||||
|
||||
@@ -181,8 +181,9 @@ struct GraphNodeSwitchCase
|
||||
/*0x1E*/ s16 selectedCase;
|
||||
};
|
||||
|
||||
/** GraphNode that specifies the location and aim of the camera.
|
||||
* When the roll is 0, the up vector is (0, 1, 0).
|
||||
/**
|
||||
* GraphNode that specifies the location and aim of the camera.
|
||||
* When the roll is 0, the up vector is (0, 1, 0).
|
||||
*/
|
||||
struct GraphNodeCamera
|
||||
{
|
||||
@@ -386,7 +387,7 @@ struct GraphNodeObject *init_graph_node_object(struct AllocOnlyPool *pool, struc
|
||||
struct GraphNode *sp20, Vec3f pos, Vec3s angle, Vec3f scale);
|
||||
struct GraphNodeCullingRadius *init_graph_node_culling_radius(struct AllocOnlyPool *pool, struct GraphNodeCullingRadius *sp1c,
|
||||
s16 sp22);
|
||||
struct GraphNodeAnimatedPart *init_graph_node_animated_part(struct AllocOnlyPool *pool, struct GraphNodeAnimatedPart * graphNode,
|
||||
struct GraphNodeAnimatedPart *init_graph_node_animated_part(struct AllocOnlyPool *pool, struct GraphNodeAnimatedPart *graphNode,
|
||||
s32 drawingLayer, void *displayList, Vec3s relativePos);
|
||||
struct GraphNodeBillboard *init_graph_node_billboard(struct AllocOnlyPool *pool,
|
||||
struct GraphNodeBillboard *graphNode, s32 drawingLayer, void *displayList, Vec3s sp28);
|
||||
@@ -401,7 +402,7 @@ struct GraphNodeGenerated *init_graph_node_generated(struct AllocOnlyPool *pool,
|
||||
struct GraphNodeBackground *init_graph_node_background(struct AllocOnlyPool *pool, struct GraphNodeBackground *sp1c,
|
||||
u16 sp22, GraphNodeFunc sp24, s32 sp28);
|
||||
struct GraphNodeHeldObject *init_graph_node_held_object(struct AllocOnlyPool *pool, struct GraphNodeHeldObject *sp1c,
|
||||
s32 sp20, Vec3s sp24, GraphNodeFunc sp28, s32 sp2c);
|
||||
struct GraphNodeObject *objNode, Vec3s translation, GraphNodeFunc nodeFunc, s32 unused);
|
||||
|
||||
struct GraphNode *geo_add_child(struct GraphNode *, struct GraphNode *);
|
||||
struct GraphNode *geo_remove_child(struct GraphNode *);
|
||||
@@ -413,8 +414,8 @@ void geo_call_global_function_nodes(struct GraphNode *graphNode, s32 sp1c);
|
||||
void geo_reset_object_node(struct GraphNodeObject *sp20);
|
||||
void geo_obj_init(struct GraphNodeObject *sp18, void *sp1c, Vec3f sp20, Vec3s sp24);
|
||||
void geo_obj_init_spawninfo(struct GraphNodeObject *sp18, struct SpawnInfo *sp1c);
|
||||
void geo_obj_init_animation(struct GraphNodeObject *, void *);
|
||||
void geo_obj_init_animation_accel(struct GraphNodeObject *sp30, void *sp34, u32 sp38);
|
||||
void geo_obj_init_animation(struct GraphNodeObject *graphNode, struct Animation **animPtrAddr);
|
||||
void geo_obj_init_animation_accel(struct GraphNodeObject *graphNode, struct Animation **animPtrAddr, u32 animAccel);
|
||||
|
||||
s32 retrieve_animation_index(s32 a0, u16 **a1);
|
||||
|
||||
|
||||
+47
-44
@@ -20,7 +20,7 @@
|
||||
#include "goddard/renderer.h"
|
||||
#include "game/profiler.h"
|
||||
|
||||
#define CMD_GET(type, offset) (*(type *) (offset + (u8 *) sCurrentCmd))
|
||||
#define CMD_GET(type, offset) (*(type *) ((offset) + (u8 *) sCurrentCmd))
|
||||
|
||||
// These are equal
|
||||
#define CMD_NEXT ((struct LevelCommand *) ((u8 *) sCurrentCmd + sCurrentCmd->size))
|
||||
@@ -34,7 +34,7 @@ struct LevelCommand {
|
||||
|
||||
enum ScriptStatus { SCRIPT_RUNNING = 1, SCRIPT_PAUSED = 0, SCRIPT_PAUSED2 = -1 };
|
||||
|
||||
static u32 sStack[32];
|
||||
static uintptr_t sStack[32];
|
||||
|
||||
static struct AllocOnlyPool *sLevelPool = NULL;
|
||||
|
||||
@@ -43,8 +43,8 @@ static u16 sDelayFrames2 = 0;
|
||||
|
||||
static s16 sCurrAreaIndex = -1;
|
||||
|
||||
static u32 *sStackTop = sStack;
|
||||
static u32 *sStackBase = NULL;
|
||||
static uintptr_t *sStackTop = sStack;
|
||||
static uintptr_t *sStackBase = NULL;
|
||||
|
||||
static s16 sScriptStatus;
|
||||
static s32 sRegister;
|
||||
@@ -85,32 +85,33 @@ static s32 eval_script_op(s8 op, s32 arg) {
|
||||
|
||||
static void level_cmd_load_and_execute(void) {
|
||||
main_pool_push_state();
|
||||
load_segment(CMD_GET(s16, 2), CMD_GET(void *, 4), CMD_GET(void *, 8), MEMORY_POOL_LEFT);
|
||||
load_segment(CMD_GET(s16, 2), CMD_GET(void *, 4), CMD_GET(void *, 4 + sizeof(void *)), MEMORY_POOL_LEFT);
|
||||
|
||||
*sStackTop++ = (u32) NEXT_CMD;
|
||||
*sStackTop++ = (u32) sStackBase;
|
||||
*sStackTop++ = (uintptr_t) NEXT_CMD;
|
||||
*sStackTop++ = (uintptr_t) sStackBase;
|
||||
sStackBase = sStackTop;
|
||||
|
||||
sCurrentCmd = segmented_to_virtual(CMD_GET(void *, 12));
|
||||
sCurrentCmd = segmented_to_virtual(CMD_GET(void *, 4 + 2 * sizeof(void *)));
|
||||
}
|
||||
|
||||
static void level_cmd_exit_and_execute(void) {
|
||||
void *targetAddr = CMD_GET(void *, 12);
|
||||
void *targetAddr = CMD_GET(void *, 4 + 2 * sizeof(void *));
|
||||
|
||||
main_pool_pop_state();
|
||||
main_pool_push_state();
|
||||
|
||||
load_segment(CMD_GET(s16, 2), CMD_GET(void *, 4), CMD_GET(void *, 8), MEMORY_POOL_LEFT);
|
||||
load_segment(CMD_GET(s16, 2), CMD_GET(void *, 4), CMD_GET(void *, 4 + sizeof(void *)),
|
||||
MEMORY_POOL_LEFT);
|
||||
|
||||
sStackTop = sStackBase;
|
||||
sCurrentCmd = (struct LevelCommand *) segmented_to_virtual(targetAddr);
|
||||
sCurrentCmd = segmented_to_virtual(targetAddr);
|
||||
}
|
||||
|
||||
static void level_cmd_exit(void) {
|
||||
main_pool_pop_state();
|
||||
|
||||
sStackTop = sStackBase;
|
||||
sStackBase = (u32 *) *(--sStackTop);
|
||||
sStackBase = (uintptr_t *) *(--sStackTop);
|
||||
sCurrentCmd = (struct LevelCommand *) *(--sStackTop);
|
||||
}
|
||||
|
||||
@@ -137,12 +138,12 @@ static void level_cmd_sleep2(void) {
|
||||
}
|
||||
|
||||
static void level_cmd_jump(void) {
|
||||
sCurrentCmd = (struct LevelCommand *) segmented_to_virtual(CMD_GET(void *, 4));
|
||||
sCurrentCmd = segmented_to_virtual(CMD_GET(void *, 4));
|
||||
}
|
||||
|
||||
static void level_cmd_jump_and_link(void) {
|
||||
*sStackTop++ = (u32) NEXT_CMD;
|
||||
sCurrentCmd = (struct LevelCommand *) segmented_to_virtual(CMD_GET(void *, 4));
|
||||
*sStackTop++ = (uintptr_t) NEXT_CMD;
|
||||
sCurrentCmd = segmented_to_virtual(CMD_GET(void *, 4));
|
||||
}
|
||||
|
||||
static void level_cmd_return(void) {
|
||||
@@ -150,7 +151,7 @@ static void level_cmd_return(void) {
|
||||
}
|
||||
|
||||
static void level_cmd_jump_and_link_push_arg(void) {
|
||||
*sStackTop++ = (u32) NEXT_CMD;
|
||||
*sStackTop++ = (uintptr_t) NEXT_CMD;
|
||||
*sStackTop++ = CMD_GET(s16, 2);
|
||||
sCurrentCmd = CMD_NEXT;
|
||||
}
|
||||
@@ -170,7 +171,7 @@ static void level_cmd_jump_repeat(void) {
|
||||
}
|
||||
|
||||
static void level_cmd_loop_begin(void) {
|
||||
*sStackTop++ = (u32) NEXT_CMD;
|
||||
*sStackTop++ = (uintptr_t) NEXT_CMD;
|
||||
*sStackTop++ = 0;
|
||||
sCurrentCmd = CMD_NEXT;
|
||||
}
|
||||
@@ -186,7 +187,7 @@ static void level_cmd_loop_until(void) {
|
||||
|
||||
static void level_cmd_jump_if(void) {
|
||||
if (eval_script_op(CMD_GET(u8, 2), CMD_GET(s32, 4)) != 0) {
|
||||
sCurrentCmd = (struct LevelCommand *) segmented_to_virtual(CMD_GET(void *, 8));
|
||||
sCurrentCmd = segmented_to_virtual(CMD_GET(void *, 8));
|
||||
} else {
|
||||
sCurrentCmd = CMD_NEXT;
|
||||
}
|
||||
@@ -194,8 +195,8 @@ static void level_cmd_jump_if(void) {
|
||||
|
||||
static void level_cmd_jump_and_link_if(void) {
|
||||
if (eval_script_op(CMD_GET(u8, 2), CMD_GET(s32, 4)) != 0) {
|
||||
*sStackTop++ = (u32) NEXT_CMD;
|
||||
sCurrentCmd = (struct LevelCommand *) segmented_to_virtual(CMD_GET(void *, 8));
|
||||
*sStackTop++ = (uintptr_t) NEXT_CMD;
|
||||
sCurrentCmd = segmented_to_virtual(CMD_GET(void *, 8));
|
||||
} else {
|
||||
sCurrentCmd = CMD_NEXT;
|
||||
}
|
||||
@@ -263,27 +264,29 @@ static void level_cmd_pop_pool_state(void) {
|
||||
}
|
||||
|
||||
static void level_cmd_load_to_fixed_address(void) {
|
||||
load_to_fixed_pool_addr(CMD_GET(void *, 4), CMD_GET(void *, 8), CMD_GET(void *, 12));
|
||||
load_to_fixed_pool_addr(CMD_GET(void *, 4), CMD_GET(void *, 4 + sizeof(void *)),
|
||||
CMD_GET(void *, 4 + 2 * sizeof(void *)));
|
||||
sCurrentCmd = CMD_NEXT;
|
||||
}
|
||||
|
||||
static void level_cmd_load_segment(void) {
|
||||
load_segment(CMD_GET(s16, 2), CMD_GET(void *, 4), CMD_GET(void *, 8), MEMORY_POOL_LEFT);
|
||||
static void level_cmd_load_raw(void) {
|
||||
load_segment(CMD_GET(s16, 2), CMD_GET(void *, 4), CMD_GET(void *, 4 + sizeof(void *)),
|
||||
MEMORY_POOL_LEFT);
|
||||
sCurrentCmd = CMD_NEXT;
|
||||
}
|
||||
|
||||
static void level_cmd_load_compressed_segment(void) {
|
||||
load_segment_decompress(CMD_GET(s16, 2), CMD_GET(void *, 4), CMD_GET(void *, 8));
|
||||
static void level_cmd_load_mio0(void) {
|
||||
load_segment_decompress(CMD_GET(s16, 2), CMD_GET(void *, 4), CMD_GET(void *, 4 + sizeof(void *)));
|
||||
sCurrentCmd = CMD_NEXT;
|
||||
}
|
||||
|
||||
static void level_cmd_19(void) {
|
||||
static void level_cmd_load_mario_head(void) {
|
||||
// TODO: Fix these hardcoded sizes
|
||||
void *addr = main_pool_alloc(0xE1000, MEMORY_POOL_LEFT);
|
||||
if (addr != NULL) {
|
||||
gdm_init(addr, 0xE1000);
|
||||
gd_add_to_heap(gZBuffer, 0x25800);
|
||||
gd_add_to_heap(gFrameBuffer0, 0x70800);
|
||||
gd_add_to_heap(gZBuffer, SCREEN_WIDTH * SCREEN_HEIGHT * 2); // 0x25800
|
||||
gd_add_to_heap(gFrameBuffer0, SCREEN_WIDTH * SCREEN_HEIGHT * 2 * 3); // 0x70800
|
||||
gdm_setup();
|
||||
gdm_maketestdl(CMD_GET(s16, 2));
|
||||
} else {
|
||||
@@ -292,8 +295,8 @@ static void level_cmd_19(void) {
|
||||
sCurrentCmd = CMD_NEXT;
|
||||
}
|
||||
|
||||
static void level_cmd_1A(void) {
|
||||
func_80278304(CMD_GET(s16, 2), CMD_GET(void *, 4), CMD_GET(void *, 8));
|
||||
static void level_cmd_load_mio0_texture(void) {
|
||||
func_80278304(CMD_GET(s16, 2), CMD_GET(void *, 4), CMD_GET(void *, 4 + sizeof(void *)));
|
||||
sCurrentCmd = CMD_NEXT;
|
||||
}
|
||||
|
||||
@@ -368,7 +371,7 @@ static void level_cmd_end_area(void) {
|
||||
sCurrentCmd = CMD_NEXT;
|
||||
}
|
||||
|
||||
static void level_cmd_21(void) {
|
||||
static void level_cmd_load_model_from_dl(void) {
|
||||
s16 val1 = CMD_GET(s16, 2) & 0x0FFF;
|
||||
s16 val2 = CMD_GET(u16, 2) >> 12;
|
||||
void *val3 = CMD_GET(void *, 4);
|
||||
@@ -381,7 +384,7 @@ static void level_cmd_21(void) {
|
||||
sCurrentCmd = CMD_NEXT;
|
||||
}
|
||||
|
||||
static void level_cmd_22(void) {
|
||||
static void level_cmd_load_model_from_geo(void) {
|
||||
s16 arg0 = CMD_GET(s16, 2);
|
||||
void *arg1 = CMD_GET(void *, 4);
|
||||
|
||||
@@ -401,8 +404,8 @@ static void level_cmd_23(void) {
|
||||
s16 model = CMD_GET(s16, 2) & 0x0FFF;
|
||||
s16 arg0H = CMD_GET(u16, 2) >> 12;
|
||||
void *arg1 = CMD_GET(void *, 4);
|
||||
arg2.i = CMD_GET(s32, 8); // store the raw word as a union s32. this allows is to reinterpret the
|
||||
// contents as a f32 without the value being converted implicitly.
|
||||
// load an f32, but using an integer load instruction for some reason (hence the union)
|
||||
arg2.i = CMD_GET(s32, 4 + sizeof(void *));
|
||||
|
||||
if (model < 256) {
|
||||
// GraphNodeScale has a GraphNode at the top. This
|
||||
@@ -603,7 +606,7 @@ static void level_cmd_set_rooms(void) {
|
||||
sCurrentCmd = CMD_NEXT;
|
||||
}
|
||||
|
||||
static void level_cmd_39(void) {
|
||||
static void level_cmd_set_macro_objects(void) {
|
||||
if (sCurrAreaIndex != -1) {
|
||||
gAreas[sCurrAreaIndex].macroObjects = segmented_to_virtual(CMD_GET(void *, 4));
|
||||
}
|
||||
@@ -655,7 +658,7 @@ static void level_cmd_nop(void) {
|
||||
sCurrentCmd = CMD_NEXT;
|
||||
}
|
||||
|
||||
static void level_cmd_30(void) {
|
||||
static void level_cmd_show_dialog(void) {
|
||||
if (sCurrAreaIndex != -1) {
|
||||
if (CMD_GET(u8, 2) < 2) {
|
||||
gAreas[sCurrAreaIndex].dialog[CMD_GET(u8, 2)] = CMD_GET(u8, 3);
|
||||
@@ -748,18 +751,18 @@ static void (*LevelScriptJumpTable[])(void) = {
|
||||
/*14*/ level_cmd_push_pool_state,
|
||||
/*15*/ level_cmd_pop_pool_state,
|
||||
/*16*/ level_cmd_load_to_fixed_address,
|
||||
/*17*/ level_cmd_load_segment,
|
||||
/*18*/ level_cmd_load_compressed_segment,
|
||||
/*19*/ level_cmd_19,
|
||||
/*1A*/ level_cmd_1A,
|
||||
/*17*/ level_cmd_load_raw,
|
||||
/*18*/ level_cmd_load_mio0,
|
||||
/*19*/ level_cmd_load_mario_head,
|
||||
/*1A*/ level_cmd_load_mio0_texture,
|
||||
/*1B*/ level_cmd_init_level,
|
||||
/*1C*/ level_cmd_clear_level,
|
||||
/*1D*/ level_cmd_alloc_level_pool,
|
||||
/*1E*/ level_cmd_free_level_pool,
|
||||
/*1F*/ level_cmd_begin_area,
|
||||
/*20*/ level_cmd_end_area,
|
||||
/*21*/ level_cmd_21,
|
||||
/*22*/ level_cmd_22,
|
||||
/*21*/ level_cmd_load_model_from_dl,
|
||||
/*22*/ level_cmd_load_model_from_geo,
|
||||
/*23*/ level_cmd_23,
|
||||
/*24*/ level_cmd_place_object,
|
||||
/*25*/ level_cmd_init_mario,
|
||||
@@ -773,7 +776,7 @@ static void (*LevelScriptJumpTable[])(void) = {
|
||||
/*2D*/ level_cmd_2D,
|
||||
/*2E*/ level_cmd_set_terrain_data,
|
||||
/*2F*/ level_cmd_set_rooms,
|
||||
/*30*/ level_cmd_30,
|
||||
/*30*/ level_cmd_show_dialog,
|
||||
/*31*/ level_cmd_set_terrain_type,
|
||||
/*32*/ level_cmd_nop,
|
||||
/*33*/ level_cmd_set_transition,
|
||||
@@ -782,7 +785,7 @@ static void (*LevelScriptJumpTable[])(void) = {
|
||||
/*36*/ level_cmd_set_music,
|
||||
/*37*/ level_cmd_set_menu_music,
|
||||
/*38*/ level_cmd_38,
|
||||
/*39*/ level_cmd_39,
|
||||
/*39*/ level_cmd_set_macro_objects,
|
||||
/*3A*/ level_cmd_3A,
|
||||
/*3B*/ level_cmd_create_whirlpool,
|
||||
/*3C*/ level_cmd_get_or_set_var,
|
||||
|
||||
@@ -522,7 +522,7 @@ void alloc_surface_pools(void) {
|
||||
sSurfacePool = main_pool_alloc(sSurfacePoolSize * sizeof(struct Surface), MEMORY_POOL_LEFT);
|
||||
|
||||
gCCMEnteredSlide = 0;
|
||||
func_802DA4DC();
|
||||
reset_red_coins_collected();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+13
-13
@@ -30,8 +30,8 @@ s16 gCurrCourseNum;
|
||||
s16 gCurrActNum;
|
||||
s16 gCurrAreaIndex;
|
||||
s16 gSavedCourseNum;
|
||||
s16 D_8033A75E;
|
||||
s16 D_8033A760;
|
||||
s16 gPauseScreenMode;
|
||||
s16 gSaveOptSelectIndex;
|
||||
|
||||
struct SpawnInfo *gMarioSpawnInfo = &gPlayerSpawnInfos[0];
|
||||
struct GraphNode **gLoadedGraphNodes = D_8033A160;
|
||||
@@ -354,27 +354,27 @@ void render_game(void) {
|
||||
|
||||
gSPViewport(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&D_8032CF00));
|
||||
|
||||
gDPSetScissor(gDisplayListHead++, G_SC_NON_INTERLACE, 0, BORDER_HEIGHT, 320,
|
||||
240 - BORDER_HEIGHT);
|
||||
gDPSetScissor(gDisplayListHead++, G_SC_NON_INTERLACE, 0, BORDER_HEIGHT, SCREEN_WIDTH,
|
||||
SCREEN_HEIGHT - BORDER_HEIGHT);
|
||||
render_hud();
|
||||
|
||||
gDPSetScissor(gDisplayListHead++, G_SC_NON_INTERLACE, 0, 0, 320, 240);
|
||||
gDPSetScissor(gDisplayListHead++, G_SC_NON_INTERLACE, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
render_text_labels();
|
||||
do_cutscene_handler();
|
||||
print_displaying_credits_entry();
|
||||
gDPSetScissor(gDisplayListHead++, G_SC_NON_INTERLACE, 0, BORDER_HEIGHT, 320,
|
||||
240 - BORDER_HEIGHT);
|
||||
D_8033A75E = func_802DCD98();
|
||||
gDPSetScissor(gDisplayListHead++, G_SC_NON_INTERLACE, 0, BORDER_HEIGHT, SCREEN_WIDTH,
|
||||
SCREEN_HEIGHT - BORDER_HEIGHT);
|
||||
gPauseScreenMode = render_menus_and_dialogs();
|
||||
|
||||
if (D_8033A75E != 0) {
|
||||
D_8033A760 = D_8033A75E;
|
||||
if (gPauseScreenMode != 0) {
|
||||
gSaveOptSelectIndex = gPauseScreenMode;
|
||||
}
|
||||
|
||||
|
||||
if (D_8032CE78 != NULL) {
|
||||
make_viewport_clip_rect(D_8032CE78);
|
||||
} else
|
||||
gDPSetScissor(gDisplayListHead++, G_SC_NON_INTERLACE, 0, BORDER_HEIGHT, 320,
|
||||
240 - BORDER_HEIGHT);
|
||||
gDPSetScissor(gDisplayListHead++, G_SC_NON_INTERLACE, 0, BORDER_HEIGHT, SCREEN_WIDTH,
|
||||
SCREEN_HEIGHT - BORDER_HEIGHT);
|
||||
|
||||
if (gWarpTransition.isActive) {
|
||||
if (gWarpTransDelay == 0) {
|
||||
|
||||
+2
-2
@@ -248,8 +248,8 @@ extern s16 gCurrCourseNum;
|
||||
extern s16 gCurrActNum;
|
||||
extern s16 gCurrAreaIndex;
|
||||
extern s16 gSavedCourseNum;
|
||||
extern s16 D_8033A75E;
|
||||
extern s16 D_8033A760;
|
||||
extern s16 gPauseScreenMode;
|
||||
extern s16 gSaveOptSelectIndex;
|
||||
|
||||
extern struct SpawnInfo *gMarioSpawnInfo;
|
||||
|
||||
|
||||
@@ -101,15 +101,15 @@ extern s32 gDialogResponse;
|
||||
extern s32 gCutsceneActive;
|
||||
extern u8 gCutsceneNumber;
|
||||
extern s8 *D_8032F96C[];
|
||||
extern u32 bowser_seg6_unkmoveshorts_060576FC[];
|
||||
extern u32 blue_fish_seg3_anims_0301C2B0[];
|
||||
extern u32 cyan_fish_seg6_anims_0600E264[];
|
||||
extern u32 blue_fish_seg3_anims_0301C2B0[];
|
||||
extern s16 bowser_seg6_unkmoveshorts_060576FC[];
|
||||
extern struct Animation *blue_fish_seg3_anims_0301C2B0[];
|
||||
extern struct Animation *cyan_fish_seg6_anims_0600E264[];
|
||||
extern struct Animation *blue_fish_seg3_anims_0301C2B0[];
|
||||
|
||||
void func_802A8D18(f32, f32, s32);
|
||||
|
||||
s32 mario_moving_fast_enough_to_make_piranha_plant_bite(void);
|
||||
void func_802C49E0(void);
|
||||
void obj_set_secondary_camera_focus(void);
|
||||
|
||||
s32 D_8032F0C0[] = { SAVE_FLAG_HAVE_WING_CAP, SAVE_FLAG_HAVE_METAL_CAP, SAVE_FLAG_HAVE_VANISH_CAP };
|
||||
|
||||
|
||||
@@ -213,7 +213,7 @@ void bhv_homing_amp_loop(void) {
|
||||
|
||||
case HOMING_AMP_ACT_CHASE:
|
||||
homing_amp_chase_loop();
|
||||
PlaySound(SOUND_CH6_AMPBUZZ);
|
||||
PlaySound(SOUND_AIR_AMP_BUZZ);
|
||||
break;
|
||||
|
||||
case HOMING_AMP_ACT_GIVE_UP:
|
||||
@@ -318,7 +318,7 @@ static void circling_amp_idle_loop(void) {
|
||||
// Oscillate
|
||||
o->oAmpYPhase++;
|
||||
|
||||
PlaySound(SOUND_CH6_AMPBUZZ);
|
||||
PlaySound(SOUND_AIR_AMP_BUZZ);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -53,9 +53,9 @@ void bhv_animates_on_floor_switch_press_loop(void) {
|
||||
|
||||
if (o->oFloorSwitchPressAnimationUnkF4 != 0) {
|
||||
if (o->oFloorSwitchPressAnimationUnkF4 < 60) {
|
||||
PlaySound(SOUND_CH8_SWITCH6);
|
||||
PlaySound(SOUND_GENERAL2_SWITCH_TICK_SLOW);
|
||||
} else {
|
||||
PlaySound(SOUND_CH8_SWITCH5);
|
||||
PlaySound(SOUND_GENERAL2_SWITCH_TICK_FAST);
|
||||
}
|
||||
|
||||
if (--o->oFloorSwitchPressAnimationUnkF4 == 0) {
|
||||
|
||||
@@ -32,7 +32,7 @@ void bhv_haunted_bookshelf_loop(void) {
|
||||
case HAUNTED_BOOKSHELF_ACT_RECEDE:
|
||||
// Move the bookshelf and play the sound
|
||||
o->oPosX += 5.0f;
|
||||
PlaySound(SOUND_ENVIRONMENT_ELEVATOR4_2);
|
||||
PlaySound(SOUND_ENV_ELEVATOR4_2);
|
||||
|
||||
// Delete the object after 102 frames
|
||||
if (o->oTimer > 101) {
|
||||
|
||||
@@ -57,7 +57,7 @@ static void handle_merry_go_round_music(void) {
|
||||
func_80321080(300); // Switch to BBH music? FIXME: Audio needs labelling
|
||||
o->oMerryGoRoundMusicShouldPlay = FALSE;
|
||||
} else {
|
||||
PlaySound(SOUND_ENVIRONMENT_MERRYGOROUNDCREAKING);
|
||||
PlaySound(SOUND_ENV_MERRY_GO_ROUND_CREAKING);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -68,13 +68,13 @@ static void handle_merry_go_round_music(void) {
|
||||
void bhv_merry_go_round_loop(void) {
|
||||
// Surprisingly, the merry-go-round is what's responsible
|
||||
// for playing the howling wind sound in BBH.
|
||||
if (o->oMerryGoRoundMarioIsOutside == FALSE) {
|
||||
if (!o->oMerryGoRoundMarioIsOutside) {
|
||||
if (gMarioCurrentRoom == BBH_OUTSIDE_ROOM) {
|
||||
// Set to TRUE
|
||||
o->oMerryGoRoundMarioIsOutside++;
|
||||
}
|
||||
} else {
|
||||
play_sound(SOUND_CH6_HOWLINGWIND, gDefaultSoundArgs);
|
||||
play_sound(SOUND_AIR_HOWLING_WIND, gDefaultSoundArgs);
|
||||
|
||||
if (
|
||||
// There are objects outside BBH, such as corkboxes.
|
||||
|
||||
@@ -53,7 +53,7 @@ void bhv_beta_chest_lid_loop(void) {
|
||||
if (o->oTimer == 0) {
|
||||
// Spawn the bubble 80 units in the -Y direction and 120 units in the +Z direction.
|
||||
spawn_object_relative(0, 0, -80, 120, o, MODEL_BUBBLE, bhvWaterAirBubble);
|
||||
play_sound(SOUND_GENERAL_CLAMSHELL1, o->header.gfx.cameraToObject);
|
||||
play_sound(SOUND_GENERAL_CLAM_SHELL1, o->header.gfx.cameraToObject);
|
||||
}
|
||||
|
||||
// Rotate the lid 0x400 (1024) angle units per frame backwards.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* Behavior for bhvBetaTrampolineTop and bhvBetaTrampolineSpring.
|
||||
* This was a trampoline that was never finished. The model and collision
|
||||
* are nearly complete finished, but the code was abandoned very early on
|
||||
* are nearly finished, but the code was abandoned very early on
|
||||
* in its development. The trampoline consists of 3 objects: the top,
|
||||
* the spring, and the base. The base is a static object with no behavior.
|
||||
*/
|
||||
|
||||
@@ -21,7 +21,7 @@ static void bird_act_inactive(void) {
|
||||
if (o->oBehParams2ndByte != BIRD_BP_SPAWNED) {
|
||||
s32 i;
|
||||
|
||||
PlaySound2(SOUND_GENERAL_BIRDSFLYAWAY);
|
||||
PlaySound2(SOUND_GENERAL_BIRDS_FLY_AWAY);
|
||||
|
||||
for (i = 0; i < 6; i++) {
|
||||
spawn_object(o, MODEL_BIRDS, bhvBird);
|
||||
|
||||
@@ -77,7 +77,7 @@ void bhv_blue_coin_switch_loop(void) {
|
||||
// Set gravity to 0 so it doesn't accelerate when receding.
|
||||
o->oGravity = 0.0f;
|
||||
|
||||
PlaySound2(SOUND_GENERAL_SWITCHDOOROPEN);
|
||||
PlaySound2(SOUND_GENERAL_SWITCH_DOOR_OPEN);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,7 +97,8 @@ void bhv_blue_coin_switch_loop(void) {
|
||||
// ???
|
||||
o->oPosY = gMarioObject->oPosY - 40.0f;
|
||||
|
||||
// Spawn particles
|
||||
// Spawn particles. There's a function that calls this same function
|
||||
// with the same arguments, func_802A3004, why didn't they just call that?
|
||||
func_802AA618(0, 0, 46.0f);
|
||||
} else {
|
||||
// Have collision while receding
|
||||
@@ -110,9 +111,9 @@ void bhv_blue_coin_switch_loop(void) {
|
||||
case BLUE_COIN_SWITCH_ACT_TICKING:
|
||||
// Tick faster when the blue coins start blinking
|
||||
if (o->oTimer < 200) {
|
||||
play_sound(SOUND_CH8_SWITCH5, gDefaultSoundArgs);
|
||||
play_sound(SOUND_GENERAL2_SWITCH_TICK_FAST, gDefaultSoundArgs);
|
||||
} else {
|
||||
play_sound(SOUND_CH8_SWITCH6, gDefaultSoundArgs);
|
||||
play_sound(SOUND_GENERAL2_SWITCH_TICK_SLOW, gDefaultSoundArgs);
|
||||
}
|
||||
|
||||
// Delete the switch (which stops the sound) after the last coin is collected,
|
||||
|
||||
@@ -90,7 +90,7 @@ void BobombChaseMarioLoop(void) {
|
||||
collisionFlags = ObjectStep();
|
||||
|
||||
if (sp1a == 5 || sp1a == 16)
|
||||
PlaySound2(SOUND_OBJECT_BOBOMBWALK);
|
||||
PlaySound2(SOUND_OBJ_BOBOMB_WALK);
|
||||
|
||||
obj_turn_toward_object(o, gMarioObject, 16, 0x800);
|
||||
ObjCheckFloorDeath(collisionFlags, D_803600E0);
|
||||
@@ -263,7 +263,7 @@ void bhv_bobomb_loop(void) {
|
||||
== 0) /* oBobombFuseTimer % 2 or oBobombFuseTimer % 8 */
|
||||
spawn_object(o, MODEL_SMOKE, bhvBobombFuseSmoke);
|
||||
|
||||
PlaySound(SOUND_CH6_BOBOMBLITFUSE);
|
||||
PlaySound(SOUND_AIR_BOBOMB_LIT_FUSE);
|
||||
|
||||
o->oBobombFuseTimer++;
|
||||
}
|
||||
@@ -296,7 +296,7 @@ void BobombBuddyIdleLoop(void) {
|
||||
collisionFlags = ObjectStep();
|
||||
|
||||
if ((sp1a == 5) || (sp1a == 16))
|
||||
PlaySound2(SOUND_OBJECT_BOBOMBWALK);
|
||||
PlaySound2(SOUND_OBJ_BOBOMB_WALK);
|
||||
|
||||
if (o->oDistanceToMario < 1000.0f)
|
||||
o->oMoveAngleYaw = approach_s16_symmetric(o->oMoveAngleYaw, o->oAngleToMario, 0x140);
|
||||
@@ -305,20 +305,25 @@ void BobombBuddyIdleLoop(void) {
|
||||
o->oAction = BOBOMB_BUDDY_ACT_TURN_TO_TALK;
|
||||
}
|
||||
|
||||
// sp30 = arg0
|
||||
// sp34 = arg1
|
||||
|
||||
void BobombBuddyCannonLoop(s16 arg0, s16 arg1) {
|
||||
struct Object *sp2c;
|
||||
s16 sp2a, sp28;
|
||||
/**
|
||||
* Function for the Bob-omb Buddy cannon guy.
|
||||
* dialogFirstText is the first dialogID called when Bob-omb Buddy
|
||||
* starts to talk to Mario to prepare the cannon(s) for him.
|
||||
* Then the camera goes to the nearest cannon, to play the "prepare cannon" cutscene
|
||||
* dialogSecondText is called after Bob-omb Buddy has the cannon(s) ready and
|
||||
* then tells Mario that is "Ready for blastoff".
|
||||
*/
|
||||
void BobombBuddyCannonLoop(s16 dialogFirstText, s16 dialogSecondText) {
|
||||
struct Object *cannonClosed;
|
||||
s16 buddyText, cutscene;
|
||||
|
||||
switch (o->oBobombBuddyCannonStatus) {
|
||||
case BOBOMB_BUDDY_CANNON_UNOPENED:
|
||||
sp2a = func_8028F8E0(162, o, arg0);
|
||||
if (sp2a != 0) {
|
||||
buddyText = cutscene_object_with_dialog(CUTSCENE_DIALOG_1, o, dialogFirstText);
|
||||
if (buddyText != 0) {
|
||||
save_file_set_cannon_unlocked();
|
||||
sp2c = obj_nearest_object_with_behavior(bhvCannonClosed);
|
||||
if (sp2c != 0)
|
||||
cannonClosed = obj_nearest_object_with_behavior(bhvCannonClosed);
|
||||
if (cannonClosed != 0)
|
||||
o->oBobombBuddyCannonStatus = BOBOMB_BUDDY_CANNON_OPENING;
|
||||
else
|
||||
o->oBobombBuddyCannonStatus = BOBOMB_BUDDY_CANNON_STOP_TALKING;
|
||||
@@ -326,15 +331,15 @@ void BobombBuddyCannonLoop(s16 arg0, s16 arg1) {
|
||||
break;
|
||||
|
||||
case BOBOMB_BUDDY_CANNON_OPENING:
|
||||
sp2c = obj_nearest_object_with_behavior(bhvCannonClosed);
|
||||
sp28 = func_8028F9E8(150, sp2c);
|
||||
if (sp28 == -1)
|
||||
cannonClosed = obj_nearest_object_with_behavior(bhvCannonClosed);
|
||||
cutscene = cutscene_object(CUTSCENE_PREPARE_CANNON, cannonClosed);
|
||||
if (cutscene == -1)
|
||||
o->oBobombBuddyCannonStatus = BOBOMB_BUDDY_CANNON_OPENED;
|
||||
break;
|
||||
|
||||
case BOBOMB_BUDDY_CANNON_OPENED:
|
||||
sp2a = func_8028F8E0(162, o, arg1);
|
||||
if (sp2a != 0)
|
||||
buddyText = cutscene_object_with_dialog(CUTSCENE_DIALOG_1, o, dialogSecondText);
|
||||
if (buddyText != 0)
|
||||
o->oBobombBuddyCannonStatus = BOBOMB_BUDDY_CANNON_STOP_TALKING;
|
||||
break;
|
||||
|
||||
@@ -356,7 +361,7 @@ void BobombBuddyTalkLoop(void) {
|
||||
|
||||
switch (o->oBobombBuddyRole) {
|
||||
case BOBOMB_BUDDY_ROLE_ADVICE:
|
||||
if (func_8028F8E0(162, o, o->oBehParams2ndByte) != BOBOMB_BUDDY_BP_STYPE_GENERIC) {
|
||||
if (cutscene_object_with_dialog(CUTSCENE_DIALOG_1, o, o->oBehParams2ndByte) != BOBOMB_BUDDY_BP_STYPE_GENERIC) {
|
||||
set_mario_npc_dialog(0);
|
||||
|
||||
o->activeFlags &= ~0x20; /* bit 5 */
|
||||
@@ -379,7 +384,7 @@ void BobombBuddyTalkLoop(void) {
|
||||
void BobombBuddyTurnToTalkLoop(void) {
|
||||
s16 sp1e = o->header.gfx.unk38.animFrame;
|
||||
if ((sp1e == 5) || (sp1e == 16))
|
||||
PlaySound2(SOUND_OBJECT_BOBOMBWALK);
|
||||
PlaySound2(SOUND_OBJ_BOBOMB_WALK);
|
||||
|
||||
o->oMoveAngleYaw = approach_s16_symmetric(o->oMoveAngleYaw, o->oAngleToMario, 0x1000);
|
||||
if ((s16) o->oMoveAngleYaw == (s16) o->oAngleToMario)
|
||||
|
||||
@@ -24,7 +24,7 @@ void bhv_small_bomp_loop(void) {
|
||||
if (o->oTimer == 15.0) {
|
||||
o->oAction = BOMP_ACT_EXTEND;
|
||||
o->oForwardVel = 40.0f;
|
||||
PlaySound2(SOUND_OBJECT_UNKNOWN2);
|
||||
PlaySound2(SOUND_OBJ_UNKNOWN2);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -38,7 +38,7 @@ void bhv_small_bomp_loop(void) {
|
||||
o->oAction = BOMP_ACT_RETRACT;
|
||||
o->oForwardVel = 10.0f;
|
||||
o->oMoveAngleYaw -= 0x8000;
|
||||
PlaySound2(SOUND_OBJECT_UNKNOWN2);
|
||||
PlaySound2(SOUND_OBJ_UNKNOWN2);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -80,7 +80,7 @@ void bhv_large_bomp_loop(void) {
|
||||
if (o->oTimer == 15.0) {
|
||||
o->oAction = BOMP_ACT_EXTEND;
|
||||
o->oForwardVel = 10.0f;
|
||||
PlaySound2(SOUND_OBJECT_UNKNOWN2);
|
||||
PlaySound2(SOUND_OBJ_UNKNOWN2);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -94,7 +94,7 @@ void bhv_large_bomp_loop(void) {
|
||||
o->oAction = BOMP_ACT_RETRACT;
|
||||
o->oForwardVel = 10.0f;
|
||||
o->oMoveAngleYaw -= 0x8000;
|
||||
PlaySound2(SOUND_OBJECT_UNKNOWN2);
|
||||
PlaySound2(SOUND_OBJ_UNKNOWN2);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
+388
-225
File diff suppressed because it is too large
Load Diff
@@ -65,7 +65,7 @@ void bhv_boo_cage_loop(void) {
|
||||
|
||||
// When the cage lands/bounces, play a landing/bouncing sound.
|
||||
if (o->oMoveFlags & OBJ_MOVE_LANDED) {
|
||||
PlaySound2(SOUND_GENERAL_SOFTLANDING);
|
||||
PlaySound2(SOUND_GENERAL_SOFT_LANDING);
|
||||
}
|
||||
|
||||
// Once the cage stops bouncing and settles on the ground,
|
||||
|
||||
@@ -15,7 +15,7 @@ void func_802F05DC(void) {
|
||||
|
||||
sp1E = func_802E4204();
|
||||
if ((sp1E & 0x09) == 0x01 && o->oVelY > 10.0f) {
|
||||
PlaySound2(SOUND_GENERAL_GRINDELROLL);
|
||||
PlaySound2(SOUND_GENERAL_GRINDEL_ROLL);
|
||||
func_802A3004();
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ void bhv_big_boulder_loop(void) {
|
||||
case 1:
|
||||
func_802F05DC();
|
||||
func_802EFB84(1.5f);
|
||||
PlaySound(SOUND_ENVIRONMENT_UNKNOWN2);
|
||||
PlaySound(SOUND_ENV_UNKNOWN2);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -42,23 +42,23 @@ void func_802EDA14(void) {
|
||||
void func_802EDA6C(void) {
|
||||
switch (o->oBehParams2ndByte) {
|
||||
case BBALL_BP_STYPE_BOB_UPPER:
|
||||
o->oBowlingBallUnkFC = segmented_to_virtual(bob_seg7_metal_ball_path0);
|
||||
o->oPathedWaypointsS16 = segmented_to_virtual(bob_seg7_metal_ball_path0);
|
||||
break;
|
||||
|
||||
case BBALL_BP_STYPE_TTM:
|
||||
o->oBowlingBallUnkFC = segmented_to_virtual(ttm_seg7_trajectory_070170A0);
|
||||
o->oPathedWaypointsS16 = segmented_to_virtual(ttm_seg7_trajectory_070170A0);
|
||||
break;
|
||||
|
||||
case BBALL_BP_STYPE_BOB_LOWER:
|
||||
o->oBowlingBallUnkFC = segmented_to_virtual(bob_seg7_metal_ball_path1);
|
||||
o->oPathedWaypointsS16 = segmented_to_virtual(bob_seg7_metal_ball_path1);
|
||||
break;
|
||||
|
||||
case BBALL_BP_STYPE_THI_LARGE:
|
||||
o->oBowlingBallUnkFC = D_803315B4;
|
||||
o->oPathedWaypointsS16 = D_803315B4;
|
||||
break;
|
||||
|
||||
case BBALL_BP_STYPE_THI_SMALL:
|
||||
o->oBowlingBallUnkFC = D_80331608;
|
||||
o->oPathedWaypointsS16 = D_80331608;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -73,8 +73,7 @@ void bhv_bowling_ball_roll_loop(void) {
|
||||
//! Uninitialzed parameter, but the parameter is unused in the called function
|
||||
sp18 = obj_follow_path(sp18);
|
||||
|
||||
//! oBowlingBallInitYaw is never explicitly initialized, so it is 0.
|
||||
o->oBowlingBallTargetYaw = o->oBowlingBallInitYaw;
|
||||
o->oBowlingBallTargetYaw = o->oPathedTargetYaw;
|
||||
o->oMoveAngleYaw = approach_s16_symmetric(o->oMoveAngleYaw, o->oBowlingBallTargetYaw, 0x400);
|
||||
if (o->oForwardVel > 70.0) {
|
||||
o->oForwardVel = 70.0;
|
||||
@@ -92,7 +91,7 @@ void bhv_bowling_ball_roll_loop(void) {
|
||||
}
|
||||
|
||||
if ((collisionFlags & OBJ_COL_FLAG_GROUNDED) && (o->oVelY > 5.0f))
|
||||
PlaySound2(SOUND_GENERAL_QUIETPOUND1_LOWPRIO);
|
||||
PlaySound2(SOUND_GENERAL_QUIET_POUND1_LOWPRIO);
|
||||
}
|
||||
|
||||
void bhv_bowling_ball_initializeLoop(void) {
|
||||
@@ -103,8 +102,7 @@ void bhv_bowling_ball_initializeLoop(void) {
|
||||
//! Uninitialzed parameter, but the parameter is unused in the called function
|
||||
sp1c = obj_follow_path(sp1c);
|
||||
|
||||
//! oBowlingBallInitYaw is never explicitly initialized, so it is 0.
|
||||
o->oMoveAngleYaw = o->oBowlingBallInitYaw;
|
||||
o->oMoveAngleYaw = o->oPathedTargetYaw;
|
||||
|
||||
switch (o->oBehParams2ndByte) {
|
||||
case BBALL_BP_STYPE_BOB_UPPER:
|
||||
@@ -152,18 +150,18 @@ void bhv_bowling_ball_loop(void) {
|
||||
void bhv_generic_bowling_ball_spawner_init(void) {
|
||||
switch (o->oBehParams2ndByte) {
|
||||
case BBALL_BP_STYPE_BOB_UPPER:
|
||||
o->oBBallSpwnrMaxSpawnDist = 7000.0f;
|
||||
o->oBBallSpwnrSpawnOdds = 2.0f;
|
||||
o->oBBallSpawnerMaxSpawnDist = 7000.0f;
|
||||
o->oBBallSpawnerSpawnOdds = 2.0f;
|
||||
break;
|
||||
|
||||
case BBALL_BP_STYPE_TTM:
|
||||
o->oBBallSpwnrMaxSpawnDist = 8000.0f;
|
||||
o->oBBallSpwnrSpawnOdds = 1.0f;
|
||||
o->oBBallSpawnerMaxSpawnDist = 8000.0f;
|
||||
o->oBBallSpawnerSpawnOdds = 1.0f;
|
||||
break;
|
||||
|
||||
case BBALL_BP_STYPE_BOB_LOWER:
|
||||
o->oBBallSpwnrMaxSpawnDist = 6000.0f;
|
||||
o->oBBallSpwnrSpawnOdds = 2.0f;
|
||||
o->oBBallSpawnerMaxSpawnDist = 6000.0f;
|
||||
o->oBBallSpawnerSpawnOdds = 2.0f;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -178,10 +176,10 @@ void bhv_generic_bowling_ball_spawner_loop(void) {
|
||||
|| (o->oPosY < gMarioObject->header.gfx.pos[1]))
|
||||
return;
|
||||
|
||||
if ((o->oTimer & o->oBBallSpwnrPeriodMinus1) == 0) /* Modulus */
|
||||
if ((o->oTimer & o->oBBallSpawnerPeriodMinus1) == 0) /* Modulus */
|
||||
{
|
||||
if (is_point_within_radius_of_mario(o->oPosX, o->oPosY, o->oPosZ, o->oBBallSpwnrMaxSpawnDist)) {
|
||||
if ((s32)(RandomFloat() * o->oBBallSpwnrSpawnOdds) == 0) {
|
||||
if (is_point_within_radius_of_mario(o->oPosX, o->oPosY, o->oPosZ, o->oBBallSpawnerMaxSpawnDist)) {
|
||||
if ((s32)(RandomFloat() * o->oBBallSpawnerSpawnOdds) == 0) {
|
||||
bowlingBall = spawn_object(o, MODEL_BOWLING_BALL, bhvBowlingBall);
|
||||
bowlingBall->oBehParams2ndByte = o->oBehParams2ndByte;
|
||||
}
|
||||
@@ -225,7 +223,7 @@ void bhv_bob_pit_bowling_ball_loop(void) {
|
||||
|
||||
func_802EDA14();
|
||||
func_8027F440(4, o->oPosX, o->oPosY, o->oPosZ);
|
||||
PlaySound(SOUND_ENVIRONMENT_UNKNOWN2);
|
||||
PlaySound(SOUND_ENV_UNKNOWN2);
|
||||
SetObjectVisibility(o, 3000);
|
||||
}
|
||||
|
||||
@@ -246,11 +244,11 @@ void bhv_free_bowling_ball_roll_loop(void) {
|
||||
|
||||
if (o->oForwardVel > 10.0f) {
|
||||
func_8027F440(4, o->oPosX, o->oPosY, o->oPosZ);
|
||||
PlaySound(SOUND_ENVIRONMENT_UNKNOWN2);
|
||||
PlaySound(SOUND_ENV_UNKNOWN2);
|
||||
}
|
||||
|
||||
if ((collisionFlags & OBJ_COL_FLAG_GROUNDED) && !(collisionFlags & OBJ_COL_FLAGS_LANDED))
|
||||
PlaySound2(SOUND_GENERAL_QUIETPOUND1_LOWPRIO);
|
||||
PlaySound2(SOUND_GENERAL_QUIET_POUND1_LOWPRIO);
|
||||
|
||||
if (!is_point_within_radius_of_mario(o->oPosX, o->oPosY, o->oPosZ, 6000)) {
|
||||
o->header.gfx.node.flags |= 0x10; /* bit 4 */
|
||||
|
||||
@@ -32,10 +32,10 @@ s8 D_8032F4FC[] = { 7, 8, 9, 12, 13, 14, 15, 4, 3, 16, 17, 19, 3, 3, 3, 3 };
|
||||
s16 D_8032F50C[] = { 60, 0 };
|
||||
s16 D_8032F510[] = { 50, 0 };
|
||||
s8 D_8032F514[] = { 24, 42, 60, -1 };
|
||||
s16 D_8032F518[3] = { 119, 120, 121 };
|
||||
s16 sBowserDefeatedDialogText[3] = { 119, 120, 121 };
|
||||
s16 D_8032F520[][3] = { { 1, 10, 40 }, { 0, 0, 74 }, { -1, -10, 114 }, { 1, -20, 134 },
|
||||
{ -1, 20, 154 }, { 1, 40, 164 }, { -1, -40, 174 }, { 1, -80, 179 },
|
||||
{ -1, 80, 184 }, { 1, 160, 186 }, { -1, -160, 186 }, { 1, 0, 0 } };
|
||||
{ -1, 80, 184 }, { 1, 160, 186 }, { -1, -160, 186 }, { 1, 0, 0 }, };
|
||||
|
||||
void bhv_bowser_tail_anchor_loop(void) {
|
||||
obj_call_action_function(sBowserTailAnchorActions);
|
||||
@@ -58,7 +58,7 @@ void bhv_bowser_flame_spawn_loop(void) {
|
||||
if (bowser->header.gfx.unk38.curAnim->unk08 == sp30)
|
||||
sp30 = 0;
|
||||
if (sp30 > 45 && sp30 < 85) {
|
||||
PlaySound(SOUND_CH6_BOWSERSPITFIRE);
|
||||
PlaySound(SOUND_AIR_BOWSER_SPIT_FIRE);
|
||||
sp2C = sp1C[5 * sp30];
|
||||
sp28 = sp1C[5 * sp30 + 2];
|
||||
o->oPosX = bowser->oPosX + (sp28 * sp20 + sp2C * sp24);
|
||||
@@ -111,7 +111,7 @@ void func_802B392C(s32 *a) {
|
||||
if (a[0] < 4) {
|
||||
func_802A11B4(o, 8);
|
||||
func_802AA618(0, 0, 60.0f);
|
||||
PlaySound2(SOUND_OBJECT_BOWSERWALK);
|
||||
PlaySound2(SOUND_OBJ_BOWSER_WALK);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -150,9 +150,9 @@ s32 func_802B3A98(void) {
|
||||
}
|
||||
|
||||
void func_802B3B0C(void) {
|
||||
if (o->oUnknownUnk88 == 0)
|
||||
if (o->oBowserUnk88 == 0)
|
||||
o->oAction = 5;
|
||||
else if (o->oUnknownUnk88 == 1)
|
||||
else if (o->oBowserUnk88 == 1)
|
||||
o->oAction = 6;
|
||||
else if (o->oBehParams2ndByte == 1)
|
||||
o->oAction = 13;
|
||||
@@ -175,8 +175,8 @@ void ActionBowser6(void) {
|
||||
if (func_802B3A30())
|
||||
o->oSubAction++;
|
||||
} else if (func_802B3A98()) {
|
||||
if (o->oUnknownUnk88 == 1)
|
||||
o->oUnknownUnk88 = 0;
|
||||
if (o->oBowserUnk88 == 1)
|
||||
o->oBowserUnk88 = 0;
|
||||
func_802B3B0C();
|
||||
}
|
||||
}
|
||||
@@ -321,7 +321,7 @@ void ActionBowser0() // only lasts one frame
|
||||
void ActionBowser15(void) {
|
||||
o->oForwardVel = 0.0f;
|
||||
if (o->oTimer == 0)
|
||||
PlaySound2(SOUND_OBJECT_BOWSERINHALING);
|
||||
PlaySound2(SOUND_OBJ_BOWSER_INHALING);
|
||||
if (func_802A4AB0(6))
|
||||
o->oAction = 0;
|
||||
}
|
||||
@@ -361,10 +361,10 @@ void ActionBowser16(void) {
|
||||
switch (o->oSubAction) {
|
||||
case 0:
|
||||
obj_become_intangible();
|
||||
o->oUnk1AC_S16 = 0;
|
||||
o->oBowserUnk1AC = 0;
|
||||
o->oBowserUnkF8 = 30;
|
||||
if (o->oTimer == 0)
|
||||
PlaySound2(SOUND_CH9_UNK66);
|
||||
PlaySound2(SOUND_OBJ2_BOWSER_TELEPORT);
|
||||
if (o->oOpacity == 0) {
|
||||
o->oSubAction++;
|
||||
o->oMoveAngleYaw = o->oAngleToMario;
|
||||
@@ -381,12 +381,12 @@ void ActionBowser16(void) {
|
||||
if (o->oDistanceToMario > 500.0f) {
|
||||
o->oSubAction = 2;
|
||||
o->oMoveAngleYaw = o->oAngleToMario; // large change in angle?
|
||||
PlaySound2(SOUND_CH9_UNK66);
|
||||
PlaySound2(SOUND_OBJ2_BOWSER_TELEPORT);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
o->oForwardVel = 0.0f;
|
||||
o->oUnk1AC_S16 = 0xFF;
|
||||
o->oBowserUnk1AC = 0xFF;
|
||||
if (o->oOpacity == 0xFF)
|
||||
o->oAction = 0;
|
||||
obj_become_tangible();
|
||||
@@ -400,7 +400,7 @@ void ActionBowser8(void) // only in sky
|
||||
set_obj_animation_and_sound_state(11);
|
||||
frame = o->header.gfx.unk38.animFrame;
|
||||
if (frame > 24 && frame < 36) {
|
||||
PlaySound(SOUND_CH6_BOWSERSPITFIRE);
|
||||
PlaySound(SOUND_AIR_BOWSER_SPIT_FIRE);
|
||||
if (frame == 35)
|
||||
spawn_object_relative(1, 0, 0x190, 0x64, o, MODEL_RED_FLAME, bhvBlueBowserFlame);
|
||||
else
|
||||
@@ -491,7 +491,7 @@ void ActionBowser13(void) {
|
||||
}
|
||||
} else if (o->oSubAction == 1) {
|
||||
#ifndef VERSION_JP
|
||||
if (o->oBehParams2ndByte == 2 && o->oUnknownUnkF4_S32 & 0x10000)
|
||||
if (o->oBehParams2ndByte == 2 && o->oBowserUnkF4 & 0x10000)
|
||||
func_u_802B4AF4();
|
||||
if (func_802B4A94()) {
|
||||
o->oBowserUnkF4 &= 0xfffeffff;
|
||||
@@ -676,7 +676,7 @@ void ActionBowser1(void) // unused?
|
||||
}
|
||||
|
||||
void func_802B5738(void) {
|
||||
o->oUnk1AC_S16 = 0;
|
||||
o->oBowserUnk1AC = 0;
|
||||
if (o->oOpacity == 0) {
|
||||
o->oForwardVel = 0.0f;
|
||||
o->oVelY = 0.0f;
|
||||
@@ -710,7 +710,7 @@ void ActionBowser2(void) {
|
||||
if (obj_check_anim_frame(11)) {
|
||||
o->oMoveAngleYaw = o->oBowserAngleToCentre;
|
||||
o->oVelY = 150.0f;
|
||||
o->oUnk1AC_S16 = 0xFF;
|
||||
o->oBowserUnk1AC = 0xFF;
|
||||
o->oBowserUnkF8 = 0;
|
||||
o->oSubAction++;
|
||||
} else
|
||||
@@ -723,9 +723,9 @@ void ActionBowser2(void) {
|
||||
if (absf(o->oFloorHeight - o->oHomeY) < 100.0f)
|
||||
approach_f32_signed(&o->oForwardVel, 0, -5.0f);
|
||||
else
|
||||
obj_obj_forward_vel_approach_upward(150.0f, 2.0f);
|
||||
obj_forward_vel_approach_upward(150.0f, 2.0f);
|
||||
} else
|
||||
obj_obj_forward_vel_approach_upward(150.0f, 2.0f);
|
||||
obj_forward_vel_approach_upward(150.0f, 2.0f);
|
||||
}
|
||||
if (func_802B4A94()) {
|
||||
o->oDragStrength = 10.0f;
|
||||
@@ -760,7 +760,7 @@ void ActionBowser2(void) {
|
||||
|
||||
void ActionBowser3(void) {
|
||||
if (item_in_array(o->oTimer, D_8032F514))
|
||||
PlaySound2(SOUND_OBJECT_BOWSERWALK);
|
||||
PlaySound2(SOUND_OBJ_BOWSER_WALK);
|
||||
if (func_802A4AB0(10))
|
||||
o->oAction = 0;
|
||||
}
|
||||
@@ -770,7 +770,7 @@ void func_802B5C78(void) {
|
||||
gSecondCameraFocus = spawn_object(o, MODEL_STAR, &bhvGrandStar);
|
||||
else {
|
||||
gSecondCameraFocus = spawn_object(o, MODEL_BOWSER_KEY, &bhvBowserKey);
|
||||
PlaySound2(SOUND_CH8_UNK61);
|
||||
PlaySound2(SOUND_GENERAL2_BOWSER_KEY);
|
||||
}
|
||||
gSecondCameraFocus->oAngleVelYaw = o->oAngleVelYaw;
|
||||
}
|
||||
@@ -791,7 +791,7 @@ void func_802B5DD8(void) {
|
||||
o->oBowserEyesShut = 1;
|
||||
func_802B392C(&o->oBowserUnkF8);
|
||||
if (o->oMoveFlags & 1)
|
||||
PlaySound2(SOUND_OBJECT_BOWSERWALK);
|
||||
PlaySound2(SOUND_OBJ_BOWSER_WALK);
|
||||
if (o->oMoveFlags & 2) {
|
||||
o->oForwardVel = 0.0f;
|
||||
o->oSubAction++;
|
||||
@@ -843,11 +843,11 @@ s32 func_802B6120(void) {
|
||||
func_8031FFB4(0, 60, 40);
|
||||
o->oBowserUnkF8++;
|
||||
}
|
||||
if (obj_update_dialog_unk1(2, 18, D_8032F518[o->oBehParams2ndByte], 0)) {
|
||||
if (obj_update_dialog(2, 18, sBowserDefeatedDialogText[o->oBehParams2ndByte], 0)) {
|
||||
o->oBowserUnkF8++;
|
||||
PlaySound2(SOUND_CH8_UNK60);
|
||||
func_80320040(0, 60);
|
||||
func_8031F7CC(0, 1);
|
||||
PlaySound2(SOUND_GENERAL2_BOWSER_EXPLODE);
|
||||
sequence_player_unlower(0, 60);
|
||||
sequence_player_fade_out(0, 1);
|
||||
}
|
||||
} else if (func_802B5F20()) {
|
||||
func_802B60B8();
|
||||
@@ -862,20 +862,20 @@ s32 func_802B6120(void) {
|
||||
s32 func_802B6254(void) {
|
||||
UNUSED s32 unused;
|
||||
s32 ret = 0;
|
||||
s32 sp1C;
|
||||
s32 dialogID;
|
||||
if (o->oBowserUnkF8 < 2) {
|
||||
if (gHudDisplay.stars < 120)
|
||||
sp1C = 121;
|
||||
dialogID = 121;
|
||||
else
|
||||
sp1C = 163;
|
||||
dialogID = 163;
|
||||
if (o->oBowserUnkF8 == 0) {
|
||||
func_8031FFB4(0, 60, 40);
|
||||
o->oBowserUnkF8++;
|
||||
}
|
||||
if (obj_update_dialog_unk1(2, 18, sp1C, 0)) {
|
||||
if (obj_update_dialog(2, 18, dialogID, 0)) {
|
||||
obj_set_model(MODEL_BOWSER2);
|
||||
func_80320040(0, 60);
|
||||
func_8031F7CC(0, 1);
|
||||
sequence_player_unlower(0, 60);
|
||||
sequence_player_fade_out(0, 1);
|
||||
func_802B5C78();
|
||||
o->oBowserUnkF8++;
|
||||
}
|
||||
@@ -950,7 +950,7 @@ void ActionBowser19(void) {
|
||||
sp28 = (o->oTimer - D_8032F520[i - 1][2]) * sp28;
|
||||
func_802B64E8(platform, sp28);
|
||||
if (sp28 != 0)
|
||||
play_sound(SOUND_ENVIRONMENT_UNKNOWN4, platform->header.gfx.cameraToObject);
|
||||
play_sound(SOUND_ENV_UNKNOWN4, platform->header.gfx.cameraToObject);
|
||||
sp1C = 0;
|
||||
break;
|
||||
}
|
||||
@@ -995,25 +995,25 @@ struct SoundState D_8032F5B8[] = { { 0, 0, 0, NO_SOUND },
|
||||
{ 0, 0, 0, NO_SOUND },
|
||||
{ 0, 0, 0, NO_SOUND },
|
||||
{ 0, 0, 0, NO_SOUND },
|
||||
{ 1, 0, -1, SOUND_OBJECT_BOWSERWALK },
|
||||
{ 1, 0, -1, SOUND_CH9_UNK04 },
|
||||
{ 1, 0, -1, SOUND_CH9_UNK04 },
|
||||
{ 1, 0, -1, SOUND_OBJ_BOWSER_WALK },
|
||||
{ 1, 0, -1, SOUND_OBJ2_BOWSER_ROAR },
|
||||
{ 1, 0, -1, SOUND_OBJ2_BOWSER_ROAR },
|
||||
{ 0, 0, 0, NO_SOUND },
|
||||
{ 0, 0, 0, NO_SOUND },
|
||||
{ 1, 20, 40, SOUND_OBJECT_BOWSERWALK },
|
||||
{ 1, 20, -1, SOUND_OBJECT_BOWSERWALK },
|
||||
{ 1, 20, 40, SOUND_OBJECT_BOWSERWALK },
|
||||
{ 1, 0, -1, SOUND_OBJECT_BOWSERTAILPICKUP },
|
||||
{ 1, 0, -1, SOUND_OBJECT_BOWSERDEFEATED },
|
||||
{ 1, 8, -1, SOUND_OBJECT_BOWSERWALK },
|
||||
{ 1, 8, 17, SOUND_OBJECT_BOWSERWALK },
|
||||
{ 1, 8, -10, SOUND_OBJECT_BOWSERWALK },
|
||||
{ 1, 20, 40, SOUND_OBJ_BOWSER_WALK },
|
||||
{ 1, 20, -1, SOUND_OBJ_BOWSER_WALK },
|
||||
{ 1, 20, 40, SOUND_OBJ_BOWSER_WALK },
|
||||
{ 1, 0, -1, SOUND_OBJ_BOWSER_TAIL_PICKUP },
|
||||
{ 1, 0, -1, SOUND_OBJ_BOWSER_DEFEATED },
|
||||
{ 1, 8, -1, SOUND_OBJ_BOWSER_WALK },
|
||||
{ 1, 8, 17, SOUND_OBJ_BOWSER_WALK },
|
||||
{ 1, 8, -10, SOUND_OBJ_BOWSER_WALK },
|
||||
{ 0, 0, 0, NO_SOUND },
|
||||
{ 1, 5, -1, SOUND_OBJECT_FLAMEBLOWN },
|
||||
{ 1, 5, -1, SOUND_OBJ_FLAME_BLOWN },
|
||||
{ 0, 0, 0, NO_SOUND },
|
||||
{ 0, 0, 0, NO_SOUND },
|
||||
{ 1, 0, -1, SOUND_OBJECT_BOWSERTAILPICKUP },
|
||||
{ 1, 0, -1, SOUND_CH9_UNK04 } };
|
||||
{ 1, 0, -1, SOUND_OBJ_BOWSER_TAIL_PICKUP },
|
||||
{ 1, 0, -1, SOUND_OBJ2_BOWSER_ROAR } };
|
||||
s8 D_8032F690[4] = { 0, 0, 1, 0 };
|
||||
s8 D_8032F694[4] = { 1, 1, 3, 0 };
|
||||
extern u8 bowser_3_seg7_collision_07004B94[];
|
||||
@@ -1063,7 +1063,7 @@ void func_802B697C(void) {
|
||||
obj_become_intangible();
|
||||
switch (o->oBowserUnk10E) {
|
||||
case 0:
|
||||
PlaySound2(SOUND_OBJECT_BOWSERTAILPICKUP);
|
||||
PlaySound2(SOUND_OBJ_BOWSER_TAIL_PICKUP);
|
||||
func_8029FA5C(3, 1);
|
||||
o->oBowserUnk10E++;
|
||||
break;
|
||||
@@ -1134,8 +1134,8 @@ void bhv_bowser_loop(void) {
|
||||
}
|
||||
obj_align_gfx_with_floor();
|
||||
if (o->oAction != 4)
|
||||
if (o->oUnk1AC_S16 != o->oOpacity) {
|
||||
if (o->oUnk1AC_S16 > o->oOpacity) {
|
||||
if (o->oBowserUnk1AC != o->oOpacity) {
|
||||
if (o->oBowserUnk1AC > o->oOpacity) {
|
||||
o->oOpacity += 20;
|
||||
if (o->oOpacity >= 0x100)
|
||||
o->oOpacity = 0xFF;
|
||||
@@ -1151,7 +1151,7 @@ void bhv_bowser_init(void) {
|
||||
s32 level; // 0 is dw, 1 is fs, 2 is sky
|
||||
o->oBowserUnk110 = 1;
|
||||
o->oOpacity = 0xFF;
|
||||
o->oUnk1AC_S16 = 0xFF;
|
||||
o->oBowserUnk1AC = 0xFF;
|
||||
if (gCurrLevelNum == LEVEL_BOWSER_2)
|
||||
level = 1;
|
||||
else if (gCurrLevelNum == LEVEL_BOWSER_3)
|
||||
@@ -1283,7 +1283,7 @@ Gfx *Geo18_802B7D44(s32 a0, struct GraphNode *node, UNUSED s32 a2) {
|
||||
sp20->fnNode.node.flags = (sp20->fnNode.node.flags & 0xFF) | 0x100;
|
||||
else
|
||||
sp20->fnNode.node.flags = (sp20->fnNode.node.flags & 0xFF) | (0x100 | 0x400);
|
||||
sp28 = sp2C = alloc_display_list(16);
|
||||
sp28 = sp2C = alloc_display_list(2 * sizeof(Gfx));
|
||||
|
||||
if (sp24->oBowserUnk1B2 != 0) {
|
||||
gSPClearGeometryMode(sp28++, G_LIGHTING);
|
||||
@@ -1304,7 +1304,7 @@ void ActionFallingBowserPlatform1(void) {
|
||||
UNUSED s32 unused;
|
||||
struct Object *sp0 = o->oPlatformUnkF8;
|
||||
if (sp0->platform == o)
|
||||
if (sp0->oAction == 13 && sp0->oUnknownUnkF4_S32 & 0x10000)
|
||||
if (sp0->oAction == 13 && sp0->oBowserUnkF4 & 0x10000)
|
||||
o->oAction = 2;
|
||||
if (sp0->oHealth == 1 && (sp0->oAction == 3 || sp0->oHeldState != HELD_FREE))
|
||||
o->oSubAction = 1;
|
||||
@@ -1323,7 +1323,7 @@ void ActionFallingBowserPlatform2(void) {
|
||||
f32 sp1C;
|
||||
UNUSED struct Object *sp18 = o->oPlatformUnkF8;
|
||||
if (o->oTimer == 0 || o->oTimer == 22)
|
||||
PlaySound2(SOUND_GENERAL_BOWSERPLATFORM_2);
|
||||
PlaySound2(SOUND_GENERAL_BOWSER_PLATFORM_2);
|
||||
if (o->oTimer < 22) {
|
||||
set_camera_shake_2(SHAKE_2_FALLING_BITS_PLAT);
|
||||
o->oVelY = 8.0f;
|
||||
|
||||
@@ -10,7 +10,7 @@ void bhv_bowser_bomb_loop(void) {
|
||||
if (o->oInteractStatus & INTERACT_MR_BLIZZARD) /* bit 21 */
|
||||
{
|
||||
spawn_object(o, MODEL_BOWSER_FLAMES, bhvBowserBombExplosion);
|
||||
create_sound_spawner(SOUND_GENERAL_EXPLOSION5);
|
||||
create_sound_spawner(SOUND_GENERAL_BOWSER_BOMB_EXPLOSION);
|
||||
func_8027F440(3, o->oPosX, o->oPosY, o->oPosZ);
|
||||
o->activeFlags = 0;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ Gfx *Geo18_802BA2B0(s32 run, struct GraphNode *node, UNUSED f32 mtx[4][4]) {
|
||||
struct Object *sp4;
|
||||
if (run == TRUE) {
|
||||
sp4 = (struct Object *) gCurGraphNodeObject;
|
||||
((struct GraphNodeScale *) node->next)->scale = sp4->oUnknownUnkF4_F32;
|
||||
((struct GraphNodeScale *) node->next)->scale = sp4->oBowserKeyScale;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -14,17 +14,17 @@ void bhv_bowser_key_unlock_door_loop(void) {
|
||||
animTimer = o->header.gfx.unk38.animFrame;
|
||||
set_obj_animation_and_sound_state(0);
|
||||
if (animTimer < 38)
|
||||
o->oBowserKeyUnlockDoorScale = 0.0f;
|
||||
o->oBowserKeyScale = 0.0f;
|
||||
else if (animTimer < 49)
|
||||
o->oBowserKeyUnlockDoorScale = 0.2f;
|
||||
o->oBowserKeyScale = 0.2f;
|
||||
else if (animTimer < 58)
|
||||
o->oBowserKeyUnlockDoorScale = (animTimer - 53) * 0.11875f + 0.2; // 0.11875?
|
||||
o->oBowserKeyScale = (animTimer - 53) * 0.11875f + 0.2; // 0.11875?
|
||||
else if (animTimer < 59)
|
||||
o->oBowserKeyUnlockDoorScale = 1.1f;
|
||||
o->oBowserKeyScale = 1.1f;
|
||||
else if (animTimer < 60)
|
||||
o->oBowserKeyUnlockDoorScale = 1.05f;
|
||||
o->oBowserKeyScale = 1.05f;
|
||||
else
|
||||
o->oBowserKeyUnlockDoorScale = 1.0f;
|
||||
o->oBowserKeyScale = 1.0f;
|
||||
if (o->oTimer > 150)
|
||||
mark_object_for_deletion(o);
|
||||
}
|
||||
@@ -33,15 +33,15 @@ void bhv_bowser_key_course_exit_loop(void) {
|
||||
s32 animTimer = o->header.gfx.unk38.animFrame;
|
||||
set_obj_animation_and_sound_state(1);
|
||||
if (animTimer < 38)
|
||||
o->oBowserKeyCourseExitScale = 0.2f;
|
||||
o->oBowserKeyScale = 0.2f;
|
||||
else if (animTimer < 52)
|
||||
o->oBowserKeyCourseExitScale = (animTimer - 42) * 0.042857f + 0.2; // TODO 3/70?
|
||||
o->oBowserKeyScale = (animTimer - 42) * 0.042857f + 0.2; // TODO 3/70?
|
||||
else if (animTimer < 94)
|
||||
o->oBowserKeyCourseExitScale = 0.8f;
|
||||
o->oBowserKeyScale = 0.8f;
|
||||
else if (animTimer < 101)
|
||||
o->oBowserKeyCourseExitScale = (101 - animTimer) * 0.085714f + 0.2; // TODO 6/70?
|
||||
o->oBowserKeyScale = (101 - animTimer) * 0.085714f + 0.2; // TODO 6/70?
|
||||
else
|
||||
o->oBowserKeyCourseExitScale = 0.2f;
|
||||
o->oBowserKeyScale = 0.2f;
|
||||
if (o->oTimer > 138)
|
||||
mark_object_for_deletion(o);
|
||||
}
|
||||
|
||||
@@ -199,7 +199,7 @@ void bhv_lll_bowser_puzzle_piece_move(f32 xOffset, f32 zOffset, s32 duration, UN
|
||||
} else {
|
||||
// On frame 20, play the shifting sound.
|
||||
if (o->oTimer == 20)
|
||||
PlaySound2(SOUND_BOWSER_PUZZLE_PIECE_MOVE);
|
||||
PlaySound2(SOUND_OBJ2_BOWSER_PUZZLE_PIECE_MOVE);
|
||||
|
||||
// For the number of frames specified by duration, move the piece.
|
||||
if (o->oTimer < duration + 20) {
|
||||
|
||||
@@ -7,6 +7,6 @@ void bhv_breakable_box_loop(void) {
|
||||
func_802B0E74();
|
||||
if (obj_was_attacked_or_ground_pounded() != 0) {
|
||||
func_802A3C98(46.0f, 1);
|
||||
create_sound_spawner(SOUND_GENERAL_BREAKBOX);
|
||||
create_sound_spawner(SOUND_GENERAL_BREAK_BOX);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,10 +33,10 @@ void func_802F4DB4(void) {
|
||||
|
||||
attack_collided_non_mario_object(o);
|
||||
if (sp1E == 1)
|
||||
PlaySound2(SOUND_GENERAL_BOXLANDING_2);
|
||||
PlaySound2(SOUND_GENERAL_BOX_LANDING_2);
|
||||
if (sp1E & 1) {
|
||||
if (o->oForwardVel > 20.0f) {
|
||||
PlaySound2(SOUND_ENVIRONMENT_SLIDING);
|
||||
PlaySound2(SOUND_ENV_SLIDING);
|
||||
func_802F4CE8();
|
||||
}
|
||||
}
|
||||
@@ -45,7 +45,7 @@ void func_802F4DB4(void) {
|
||||
func_802A3004();
|
||||
spawn_triangle_break_particles(20, 138, 0.7f, 3);
|
||||
ObjSpawnYellowCoins(o, 3);
|
||||
create_sound_spawner(SOUND_GENERAL_BREAKBOX);
|
||||
create_sound_spawner(SOUND_GENERAL_BREAK_BOX);
|
||||
o->activeFlags = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ void bhv_wf_breakable_wall_loop(void) {
|
||||
if (are_objects_collided(o, gMarioObject)) {
|
||||
if (obj_has_behavior(bhvWfBreakableWallRight))
|
||||
play_puzzle_jingle();
|
||||
create_sound_spawner(SOUND_GENERAL_EXPLOSION3);
|
||||
create_sound_spawner(SOUND_GENERAL_WALL_EXPLOSION);
|
||||
o->oInteractType = 8;
|
||||
o->oDamageOrCoinValue = 1;
|
||||
func_802A3C98(80.0f, 0);
|
||||
|
||||
@@ -87,7 +87,7 @@ void ActionCheepCheep2(void) {
|
||||
} else
|
||||
o->oInteractStatus = 0;
|
||||
if (o->oTimer == 0)
|
||||
PlaySound2(SOUND_GENERAL_MOVINGWATER);
|
||||
PlaySound2(SOUND_GENERAL_MOVING_WATER);
|
||||
if (o->oForwardVel == 0.0f)
|
||||
o->oForwardVel = 6.0f;
|
||||
dy = o->oPosY - gMarioObject->oPosY;
|
||||
|
||||
@@ -55,7 +55,7 @@ void bubba_act_1(void) {
|
||||
o->oAction = 0;
|
||||
} else if (o->oBubbaUnk100 != 0) {
|
||||
if (--o->oBubbaUnk100 == 0) {
|
||||
PlaySound2(SOUND_OBJECT_CHOMPINGSOUND);
|
||||
PlaySound2(SOUND_OBJ_BUBBA_CHOMP);
|
||||
o->oAction = 0;
|
||||
} else if (o->oBubbaUnk100 < 15) {
|
||||
o->oAnimState = 1;
|
||||
|
||||
@@ -42,7 +42,7 @@ void ActionBulletBill2(void) {
|
||||
if (o->oDistanceToMario > 300.0f)
|
||||
obj_rotate_yaw_toward(o->oAngleToMario, 0x100);
|
||||
if (o->oTimer == 50) {
|
||||
PlaySound2(SOUND_OBJECT_POUNDINGCANNON);
|
||||
PlaySound2(SOUND_OBJ_POUNDING_CANNON);
|
||||
ShakeScreen(1);
|
||||
}
|
||||
if (o->oTimer > 150 || o->oMoveFlags & 0x200) {
|
||||
|
||||
@@ -52,14 +52,13 @@ void bhv_big_bully_init(void) {
|
||||
}
|
||||
|
||||
void BullyCheckMarioCollision(void) {
|
||||
if (o->oInteractStatus & INT_STATUS_INTERACTED) /* bit 15 */
|
||||
{
|
||||
if (o->oInteractStatus & INT_STATUS_INTERACTED) {
|
||||
if (o->oBehParams2ndByte == BULLY_BP_SIZE_SMALL)
|
||||
PlaySound2(SOUND_CH9_UNK1C);
|
||||
PlaySound2(SOUND_OBJ2_BULLY_ATTACKED);
|
||||
else
|
||||
PlaySound2(SOUND_CH9_UNK57);
|
||||
PlaySound2(SOUND_OBJ2_LARGE_BULLY_ATTACKED);
|
||||
|
||||
o->oInteractStatus &= ~INT_STATUS_INTERACTED; /* bit 15 */
|
||||
o->oInteractStatus &= ~INT_STATUS_INTERACTED;
|
||||
o->oAction = BULLY_ACT_KNOCKBACK;
|
||||
o->oFlags &= ~0x8; /* bit 3 */
|
||||
SetObjAnimation(3);
|
||||
@@ -145,9 +144,9 @@ void PlayBullyStompingSound(void) {
|
||||
case BULLY_ACT_PATROL:
|
||||
if (sp26 == 0 || sp26 == 12) {
|
||||
if (o->oBehParams2ndByte == BULLY_BP_SIZE_SMALL)
|
||||
PlaySound2(SOUND_OBJECT_BULLYWALK);
|
||||
PlaySound2(SOUND_OBJ_BULLY_WALK);
|
||||
else
|
||||
PlaySound2(SOUND_OBJECT_BULLYWALKING);
|
||||
PlaySound2(SOUND_OBJ_BULLY_WALKING);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -155,9 +154,9 @@ void PlayBullyStompingSound(void) {
|
||||
case BULLY_ACT_BACK_UP:
|
||||
if (sp26 == 0 || sp26 == 5) {
|
||||
if (o->oBehParams2ndByte == BULLY_BP_SIZE_SMALL)
|
||||
PlaySound2(SOUND_OBJECT_BULLYWALK);
|
||||
PlaySound2(SOUND_OBJ_BULLY_WALK);
|
||||
else
|
||||
PlaySound2(SOUND_OBJECT_BULLYWALKING);
|
||||
PlaySound2(SOUND_OBJ_BULLY_WALKING);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -179,9 +178,9 @@ void BullyStep(void) {
|
||||
void BullySpawnCoin(void) {
|
||||
struct Object *coin = spawn_object(o, MODEL_YELLOW_COIN, bhvMovingYellowCoin);
|
||||
#ifdef VERSION_JP
|
||||
PlaySound2(SOUND_GENERAL_COINSPURT);
|
||||
PlaySound2(SOUND_GENERAL_COIN_SPURT);
|
||||
#else
|
||||
PlaySound2(SOUND_GENERAL_COINSPURT_2);
|
||||
PlaySound2(SOUND_GENERAL_COIN_SPURT_2);
|
||||
#endif
|
||||
coin->oForwardVel = 10.0f;
|
||||
coin->oVelY = 100.0f;
|
||||
@@ -349,7 +348,7 @@ void bhv_big_bully_with_minions_loop(void) {
|
||||
o->oAction = BULLY_ACT_PATROL;
|
||||
|
||||
if (collisionFlags == 1) {
|
||||
PlaySound2(SOUND_OBJECT_THWOMP);
|
||||
PlaySound2(SOUND_OBJ_THWOMP);
|
||||
func_8027F440(1, o->oPosX, o->oPosY, o->oPosZ);
|
||||
func_802A3004();
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ static void camera_lakitu_intro_act_show_dialog(void) {
|
||||
s16 targetMovePitch;
|
||||
s16 targetMoveYaw;
|
||||
|
||||
PlaySound(SOUND_CH6_LAKITUFLY);
|
||||
PlaySound(SOUND_AIR_LAKITU_FLY);
|
||||
|
||||
// Face toward mario
|
||||
o->oFaceAnglePitch = obj_turn_pitch_toward_mario(120.0f, 0);
|
||||
@@ -115,7 +115,7 @@ static void camera_lakitu_intro_act_show_dialog(void) {
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (obj_update_dialog_unk2(2, DIALOG_UNK2_FLAG_0, 0xA2, 0x22) != 0) {
|
||||
} else if (obj_update_dialog_with_cutscene(2, DIALOG_UNK2_FLAG_0, CUTSCENE_DIALOG_1, 34) != 0) {
|
||||
o->oCameraLakituFinishedDialog = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,8 +12,8 @@ void ActionOpenedCannon0(void) {
|
||||
o->oPosZ = o->oHomeZ;
|
||||
o->oMoveAnglePitch = 0;
|
||||
o->oMoveAngleYaw = (s16)(o->oBehParams2ndByte << 8);
|
||||
o->OBJECT_FIELD_S32(0x1B) = 0;
|
||||
o->OBJECT_FIELD_S32(0x21) = 0;
|
||||
o->oCannonUnkF4 = 0;
|
||||
o->oCannonUnk10C = 0;
|
||||
obj_enable_rendering();
|
||||
obj_become_tangible();
|
||||
}
|
||||
@@ -25,20 +25,20 @@ void ActionOpenedCannon0(void) {
|
||||
& INT_STATUS_TOUCHED_BOB_OMB))) // bob-omb explodes when it gets into a cannon
|
||||
{
|
||||
o->oAction = 4;
|
||||
o->OBJECT_FIELD_S32(0x21) = 1;
|
||||
o->OBJECT_FIELD_S32(0x1C) = 1;
|
||||
o->oCannonUnk10C = 1;
|
||||
o->oCannonUnkF8 = 1;
|
||||
} else
|
||||
o->oInteractStatus = 0;
|
||||
} else {
|
||||
obj_become_intangible();
|
||||
obj_disable_rendering();
|
||||
o->OBJECT_FIELD_S32(0x21) = 0;
|
||||
o->oCannonUnk10C = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void ActionOpenedCannon4(void) {
|
||||
if (o->oTimer == 0)
|
||||
PlaySound2(SOUND_OBJECT_CANNON1);
|
||||
PlaySound2(SOUND_OBJ_CANNON1);
|
||||
o->oPosY += 5.0f;
|
||||
o->oPosX += (f32)((o->oTimer / 2 & 1) - 0.5) * 2;
|
||||
o->oPosZ += (f32)((o->oTimer / 2 & 1) - 0.5) * 2;
|
||||
@@ -51,7 +51,7 @@ void ActionOpenedCannon4(void) {
|
||||
|
||||
void ActionOpenedCannon6(void) {
|
||||
if (o->oTimer == 0)
|
||||
PlaySound2(SOUND_OBJECT_CANNON2);
|
||||
PlaySound2(SOUND_OBJ_CANNON2);
|
||||
if (o->oTimer < 4) {
|
||||
o->oPosX += (f32)((o->oTimer / 2 & 1) - 0.5) * 4.0f;
|
||||
o->oPosZ += (f32)((o->oTimer / 2 & 1) - 0.5) * 4.0f;
|
||||
@@ -60,11 +60,11 @@ void ActionOpenedCannon6(void) {
|
||||
} else {
|
||||
if (o->oTimer < 22) {
|
||||
o->oMoveAngleYaw =
|
||||
sins(o->OBJECT_FIELD_S32(0x1B)) * 0x4000 + ((s16)(o->oBehParams2ndByte << 8));
|
||||
o->OBJECT_FIELD_S32(0x1B) += 0x400;
|
||||
sins(o->oCannonUnkF4) * 0x4000 + ((s16)(o->oBehParams2ndByte << 8));
|
||||
o->oCannonUnkF4 += 0x400;
|
||||
} else if (o->oTimer < 26) {
|
||||
} else {
|
||||
o->OBJECT_FIELD_S32(0x1B) = 0;
|
||||
o->oCannonUnkF4 = 0;
|
||||
o->oAction = 5;
|
||||
}
|
||||
}
|
||||
@@ -73,12 +73,12 @@ void ActionOpenedCannon6(void) {
|
||||
|
||||
void ActionOpenedCannon5(void) {
|
||||
if (o->oTimer == 0)
|
||||
PlaySound2(SOUND_OBJECT_CANNON3);
|
||||
PlaySound2(SOUND_OBJ_CANNON3);
|
||||
if (o->oTimer < 4) {
|
||||
} else {
|
||||
if (o->oTimer < 20) {
|
||||
o->OBJECT_FIELD_S32(0x1B) += 0x400;
|
||||
o->oMoveAnglePitch = sins(o->OBJECT_FIELD_S32(0x1B)) * 0x2000;
|
||||
o->oCannonUnkF4 += 0x400;
|
||||
o->oMoveAnglePitch = sins(o->oCannonUnkF4) * 0x2000;
|
||||
} else if (o->oTimer < 25) {
|
||||
} else
|
||||
o->oAction = 1;
|
||||
@@ -89,7 +89,7 @@ void ActionOpenedCannon1(void) {
|
||||
UNUSED s32 unused;
|
||||
obj_become_intangible();
|
||||
obj_disable_rendering();
|
||||
o->OBJECT_FIELD_S32(0x21) = 0;
|
||||
o->oCannonUnk10C = 0;
|
||||
gMarioShotFromCannon = 1;
|
||||
}
|
||||
|
||||
@@ -113,8 +113,8 @@ u8 unused0EA1FC[] = { 2, 0, 0, 0, 0, 0, 0, 0, 63, 128, 0, 0, 2, 0, 0, 0
|
||||
|
||||
void bhv_cannon_base_loop(void) {
|
||||
obj_call_action_function(sOpenedCannonActions);
|
||||
if (o->OBJECT_FIELD_S32(0x1C))
|
||||
o->OBJECT_FIELD_S32(0x1C)++;
|
||||
if (o->oCannonUnkF8)
|
||||
o->oCannonUnkF8++;
|
||||
o->oInteractStatus = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ void bhv_cannon_closed_init(void) {
|
||||
|
||||
void CannonTrapDoorOpeningLoop(void) {
|
||||
if (o->oTimer == 0)
|
||||
PlaySound2(SOUND_GENERAL_CANNONUP);
|
||||
PlaySound2(SOUND_GENERAL_CANNON_UP);
|
||||
|
||||
if (o->oTimer < 30) {
|
||||
o->oVelY = -0.5f;
|
||||
|
||||
@@ -109,11 +109,11 @@ void bhv_wing_cap_init(void) {
|
||||
}
|
||||
|
||||
void func_802F0D70(void) {
|
||||
o->oUnknownUnkF8_S32 += 0x2000;
|
||||
o->header.gfx.scale[1] = coss(o->oUnknownUnkF8_S32) * 0.3 + 0.7;
|
||||
if (o->oUnknownUnkF8_S32 == 0x10000) {
|
||||
o->oUnknownUnkF8_S32 = 0;
|
||||
o->oUnknownUnkF4_S32 = 2;
|
||||
o->oCapUnkF8 += 0x2000;
|
||||
o->header.gfx.scale[1] = coss(o->oCapUnkF8) * 0.3 + 0.7;
|
||||
if (o->oCapUnkF8 == 0x10000) {
|
||||
o->oCapUnkF8 = 0;
|
||||
o->oCapUnkF4 = 2;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,12 +125,12 @@ void func_802F0E0C(void) {
|
||||
if (sp1E & 0x01) {
|
||||
func_802F09C0();
|
||||
if (o->oVelY != 0.0f) {
|
||||
o->oUnknownUnkF4_S32 = 1;
|
||||
o->oCapUnkF4 = 1;
|
||||
o->oVelY = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
if (o->oUnknownUnkF4_S32 == 1)
|
||||
if (o->oCapUnkF4 == 1)
|
||||
func_802F0D70();
|
||||
}
|
||||
|
||||
@@ -229,13 +229,13 @@ void func_802F1234(void) {
|
||||
func_802F09C0();
|
||||
|
||||
if (o->oVelY != 0.0f) {
|
||||
o->oUnknownUnkF4_S32 = 1;
|
||||
o->oCapUnkF4 = 1;
|
||||
o->oVelY = 0.0f;
|
||||
o->oFaceAnglePitch = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (o->oUnknownUnkF4_S32 == 1)
|
||||
if (o->oCapUnkF4 == 1)
|
||||
func_802F0D70();
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ void ActionActivateCapSwitch1(void) {
|
||||
if (obj_is_mario_on_platform()) {
|
||||
save_file_set_flags(D_8032F0C0[o->oBehParams2ndByte]);
|
||||
o->oAction = 2;
|
||||
PlaySound2(SOUND_GENERAL_EXPLOSION);
|
||||
PlaySound2(SOUND_GENERAL_ACTIVATE_CAP_SWITCH);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ void ActionActivateCapSwitch2(void) {
|
||||
spawn_triangle_break_particles(60, 139, 0.3f, o->oBehParams2ndByte);
|
||||
}
|
||||
} else {
|
||||
sp1C = obj_update_dialog_unk2(1, 12, 161, 0);
|
||||
sp1C = obj_update_dialog_with_cutscene(1, 0x0C, CUTSCENE_CAP_SWITCH_PRESS, 0);
|
||||
if (sp1C)
|
||||
o->oAction = 3;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ void bhv_castle_floor_trap_open_detect(void) {
|
||||
|
||||
void bhv_castle_floor_trap_open(void) {
|
||||
if (o->oTimer == 0)
|
||||
PlaySound2(SOUND_GENERAL_UNUSED);
|
||||
PlaySound2(SOUND_GENERAL_CASTLE_TRAP_OPEN);
|
||||
o->oAngleVelRoll -= 0x100;
|
||||
o->oFaceAngleRoll += o->oAngleVelRoll;
|
||||
if (o->oFaceAngleRoll < -0x4000) {
|
||||
|
||||
@@ -12,13 +12,13 @@ void bhv_celebration_star_init(void) {
|
||||
o->oFaceAnglePitch = 0;
|
||||
o->oFaceAngleRoll = 49152;
|
||||
obj_scale(0.1f);
|
||||
o->oUnknownUnkF4_S32 = 1;
|
||||
o->oCelebStarUnkF4 = 1;
|
||||
} else {
|
||||
o->header.gfx.sharedChild = gLoadedGraphNodes[MODEL_STAR];
|
||||
o->oFaceAnglePitch = 0;
|
||||
o->oFaceAngleRoll = 0;
|
||||
obj_scale(0.4f);
|
||||
o->oUnknownUnkF4_S32 = 0;
|
||||
o->oCelebStarUnkF4 = 0;
|
||||
}
|
||||
#else
|
||||
o->header.gfx.sharedChild = gLoadedGraphNodes[MODEL_STAR];
|
||||
@@ -48,7 +48,7 @@ void CelebrationStarFaceCameraLoop(void) {
|
||||
|
||||
if (o->oTimer < 10) {
|
||||
#if BUGFIX_STAR_BOWSER_KEY
|
||||
if (o->oUnknownUnkF4_S32 == 0) {
|
||||
if (o->oCelebStarUnkF4 == 0) {
|
||||
obj_scale((f32) o->oTimer / 10.0);
|
||||
} else {
|
||||
obj_scale((f32) o->oTimer / 30.0);
|
||||
|
||||
@@ -182,7 +182,7 @@ static void chain_chomp_sub_act_turn(void) {
|
||||
if (o->oTimer > 40) {
|
||||
// Increase the maximum distance from the pivot and enter
|
||||
// the lunging sub-action.
|
||||
PlaySound2(SOUND_GENERAL_CHAINCHOMP2);
|
||||
PlaySound2(SOUND_GENERAL_CHAIN_CHOMP2);
|
||||
|
||||
o->oSubAction = CHAIN_CHOMP_SUB_ACT_LUNGE;
|
||||
o->oChainChompMaxDistFromPivotPerChainPart = 900.0f / 5;
|
||||
@@ -199,7 +199,7 @@ static void chain_chomp_sub_act_turn(void) {
|
||||
o->oForwardVel = 0.0f;
|
||||
}
|
||||
} else {
|
||||
PlaySound2(SOUND_GENERAL_CHAINCHOMP1);
|
||||
PlaySound2(SOUND_GENERAL_CHAIN_CHOMP1);
|
||||
o->oForwardVel = 10.0f;
|
||||
o->oVelY = 20.0f;
|
||||
}
|
||||
@@ -261,7 +261,7 @@ static void chain_chomp_released_trigger_cutscene(void) {
|
||||
//! Can delay this if we get into a cutscene-unfriendly action after the
|
||||
// last post ground pound and before this
|
||||
if (set_mario_npc_dialog(2) == 2 && (o->oMoveFlags & OBJ_MOVE_MASK_ON_GROUND)
|
||||
&& func_8028F9E8(0xAD, o) == 1) {
|
||||
&& cutscene_object(CUTSCENE_STAR_SPAWN, o) == 1) {
|
||||
o->oChainChompReleaseStatus = CHAIN_CHOMP_RELEASED_LUNGE_AROUND;
|
||||
o->oTimer = 0;
|
||||
}
|
||||
@@ -289,7 +289,7 @@ static void chain_chomp_released_lunge_around(void) {
|
||||
}
|
||||
} else {
|
||||
if (++o->oChainChompNumLunges <= 5) {
|
||||
PlaySound2(SOUND_GENERAL_CHAINCHOMP1);
|
||||
PlaySound2(SOUND_GENERAL_CHAIN_CHOMP1);
|
||||
o->oMoveAngleYaw = o->oAngleToMario + RandomSign() * 0x2000;
|
||||
o->oForwardVel = 30.0f;
|
||||
o->oVelY = 50.0f;
|
||||
@@ -345,7 +345,7 @@ static void chain_chomp_released_jump_away(void) {
|
||||
* Release mario and transition to the unload chain action.
|
||||
*/
|
||||
static void chain_chomp_released_end_cutscene(void) {
|
||||
if (func_8028F9E8(0xAD, o) == -1) {
|
||||
if (cutscene_object(CUTSCENE_STAR_SPAWN, o) == -1) {
|
||||
set_mario_npc_dialog(0);
|
||||
o->oAction = CHAIN_CHOMP_ACT_UNLOAD_CHAIN;
|
||||
}
|
||||
@@ -488,7 +488,7 @@ void bhv_wooden_post_update(void) {
|
||||
// When ground pounded by mario, drop by -45 + -20
|
||||
if (!o->oWoodenPostMarioPounding) {
|
||||
if ((o->oWoodenPostMarioPounding = obj_is_mario_ground_pounding_platform())) {
|
||||
PlaySound2(SOUND_GENERAL_POUNDWOODPOST);
|
||||
PlaySound2(SOUND_GENERAL_POUND_WOOD_POST);
|
||||
o->oWoodenPostSpeedY = -70.0f;
|
||||
}
|
||||
} else if (approach_f32_ptr(&o->oWoodenPostSpeedY, 0.0f, 25.0f)) {
|
||||
@@ -537,7 +537,7 @@ void bhv_chain_chomp_gate_init(void) {
|
||||
*/
|
||||
void bhv_chain_chomp_gate_update(void) {
|
||||
if (o->parentObj->oChainChompHitGate) {
|
||||
func_802A3034(SOUND_GENERAL_EXPLOSION3);
|
||||
func_802A3034(SOUND_GENERAL_WALL_EXPLOSION);
|
||||
func_8027F440(1, o->oPosX, o->oPosY, o->oPosZ);
|
||||
func_802AA618(0, 0x7F, 200.0f);
|
||||
spawn_triangle_break_particles(30, 0x8A, 3.0f, 4);
|
||||
|
||||
@@ -24,9 +24,10 @@ void bhv_checkerboard_elevator_group_init(void) {
|
||||
sp38 = -D_8032F754[sp34].unk0;
|
||||
else
|
||||
sp38 = D_8032F754[sp34].unk0;
|
||||
|
||||
sp2C = spawn_object_relative(i, 0, i * sp3C, sp38, o, MODEL_CHECKERBOARD_PLATFORM,
|
||||
bhvCheckerboardPlatformSub);
|
||||
sp2C->oUnk1AC_F32 = D_8032F754[sp34].unk2;
|
||||
sp2C->oCheckerBoardPlatformUnk1AC = D_8032F754[sp34].unk2;
|
||||
func_802B8F7C(sp2C->header.gfx.scale, D_8032F754[sp34].unk1);
|
||||
}
|
||||
}
|
||||
@@ -53,10 +54,10 @@ void bhv_checkerboard_platform_init(void) {
|
||||
}
|
||||
|
||||
void bhv_checkerboard_platform_loop(void) {
|
||||
f32 sp24 = o->oUnk1AC_F32;
|
||||
f32 sp24 = o->oCheckerBoardPlatformUnk1AC;
|
||||
o->oCheckerBoardPlatformUnkF8 = 0;
|
||||
if (o->oDistanceToMario < 1000.0f)
|
||||
PlaySound(SOUND_ENVIRONMENT_ELEVATOR4);
|
||||
PlaySound(SOUND_ENV_ELEVATOR4);
|
||||
switch (o->oAction) {
|
||||
case 0:
|
||||
if (o->oBehParams2ndByte == 0)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// chuckya.c.inc
|
||||
|
||||
void func_802A8D18(f32 sp28, f32 sp2C, s32 sp30) {
|
||||
switch (o->parentObj->oUnknownUnk88) {
|
||||
switch (o->parentObj->oChuckyaUnk88) {
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
@@ -11,14 +11,14 @@ void func_802A8D18(f32 sp28, f32 sp2C, s32 sp30) {
|
||||
gMarioObject->oInteractStatus |= (sp30 + INT_STATUS_MARIO_UNK2);
|
||||
gMarioStates->forwardVel = sp28;
|
||||
gMarioStates->vel[1] = sp2C;
|
||||
o->parentObj->oUnknownUnk88 = 0;
|
||||
o->parentObj->oChuckyaUnk88 = 0;
|
||||
break;
|
||||
case 3:
|
||||
gMarioObject->oInteractStatus |=
|
||||
(INT_STATUS_MARIO_UNK2 + INT_STATUS_MARIO_UNK6); // loads 2 interactions at once?
|
||||
gMarioStates->forwardVel = 10.0f;
|
||||
gMarioStates->vel[1] = 10.0f;
|
||||
o->parentObj->oUnknownUnk88 = 0;
|
||||
o->parentObj->oChuckyaUnk88 = 0;
|
||||
break;
|
||||
}
|
||||
o->oMoveAngleYaw = o->parentObj->oMoveAngleYaw;
|
||||
@@ -32,7 +32,7 @@ void bhv_chuckya_anchor_mario_loop(void) {
|
||||
|
||||
s32 Unknown802A8EC8(s32 sp20, f32 sp24, f32 sp28, s32 sp2C) {
|
||||
s32 sp1C = 0;
|
||||
if (o->OBJECT_FIELD_S32(0x1C) != 4) {
|
||||
if (o->oChuckyaUnkF8 != 4) {
|
||||
if (sp24 < obj_lateral_dist_from_mario_to_home()) {
|
||||
if (obj_lateral_dist_to_home() < 200.0f)
|
||||
sp1C = 0;
|
||||
@@ -48,7 +48,7 @@ s32 Unknown802A8EC8(s32 sp20, f32 sp24, f32 sp28, s32 sp2C) {
|
||||
sp1C = 3;
|
||||
if (sp20 && func_802C5A64(&o->oAngleToMario)) {
|
||||
sp1C = 4;
|
||||
o->OBJECT_FIELD_S32(0x1C) = 4;
|
||||
o->oChuckyaUnkF8 = 4;
|
||||
}
|
||||
} else
|
||||
sp1C = 4;
|
||||
@@ -75,14 +75,14 @@ void ActionChuckya0(void) {
|
||||
UNUSED u8 pad[16];
|
||||
s32 sp28;
|
||||
if (o->oTimer == 0)
|
||||
o->OBJECT_FIELD_S32(0x1D) = 0;
|
||||
o->oChuckyaUnkFC = 0;
|
||||
o->oAngleToMario = angle_to_object(o, gMarioObject);
|
||||
switch (sp28 = o->oSubAction) {
|
||||
case 0:
|
||||
o->oForwardVel = 0;
|
||||
if (obj_lateral_dist_from_mario_to_home() < 2000.0f) {
|
||||
obj_rotate_yaw_toward(o->oAngleToMario, 0x400);
|
||||
if (o->OBJECT_FIELD_S32(0x1D) > 40
|
||||
if (o->oChuckyaUnkFC > 40
|
||||
|| abs_angle_diff(o->oMoveAngleYaw, o->oAngleToMario) < 0x1000)
|
||||
o->oSubAction = 1;
|
||||
} else
|
||||
@@ -97,7 +97,7 @@ void ActionChuckya0(void) {
|
||||
break;
|
||||
case 2:
|
||||
func_802A9050(&o->oForwardVel, 0, 4.0f);
|
||||
if (o->OBJECT_FIELD_S32(0x1D) > 48)
|
||||
if (o->oChuckyaUnkFC > 48)
|
||||
o->oSubAction = 0;
|
||||
break;
|
||||
case 3:
|
||||
@@ -113,12 +113,12 @@ void ActionChuckya0(void) {
|
||||
break;
|
||||
}
|
||||
if (o->oSubAction != sp28)
|
||||
o->OBJECT_FIELD_S32(0x1D) = 0;
|
||||
o->oChuckyaUnkFC = 0;
|
||||
else
|
||||
o->OBJECT_FIELD_S32(0x1D)++;
|
||||
o->oChuckyaUnkFC++;
|
||||
set_obj_animation_and_sound_state(4);
|
||||
if (o->oForwardVel > 1.0f)
|
||||
PlaySound(SOUND_CH6_CHUCKYAMOVE);
|
||||
PlaySound(SOUND_AIR_CHUCKYA_MOVE);
|
||||
print_debug_bottom_up("fg %d", sp3C);
|
||||
print_debug_bottom_up("sp %d", o->oForwardVel);
|
||||
}
|
||||
@@ -127,22 +127,22 @@ void ActionChuckya1(void) {
|
||||
if (o->oSubAction == 0) {
|
||||
if (func_802A4AB0(0))
|
||||
o->oSubAction++;
|
||||
o->OBJECT_FIELD_S32(0x1D) = RandomFloat() * 30.0f + 10.0f;
|
||||
o->OBJECT_FIELD_S32(0x1E) = 0;
|
||||
o->oChuckyaUnkFC = RandomFloat() * 30.0f + 10.0f;
|
||||
o->oChuckyaUnk100 = 0;
|
||||
o->oForwardVel = 0.0f;
|
||||
} else {
|
||||
if (o->oSubAction == 1) {
|
||||
o->OBJECT_FIELD_S32(0x1E) += player_performed_grab_escape_action();
|
||||
print_debug_bottom_up("%d", o->OBJECT_FIELD_S32(0x1E));
|
||||
if (o->OBJECT_FIELD_S32(0x1E) > 10) {
|
||||
o->oUnknownUnk88 = 3;
|
||||
o->oChuckyaUnk100 += player_performed_grab_escape_action();
|
||||
print_debug_bottom_up("%d", o->oChuckyaUnk100);
|
||||
if (o->oChuckyaUnk100 > 10) {
|
||||
o->oChuckyaUnk88 = 3;
|
||||
o->oAction = 3;
|
||||
o->oInteractStatus &= ~(INT_STATUS_GRABBED_MARIO);
|
||||
} else {
|
||||
set_obj_animation_and_sound_state(1);
|
||||
o->oMoveAngleYaw += INT_STATUS_GRABBED_MARIO;
|
||||
if (o->OBJECT_FIELD_S32(0x1D)-- < 0)
|
||||
if (func_802B0C54(50.0f, 150.0f) || o->OBJECT_FIELD_S32(0x1D) < -16) {
|
||||
if (o->oChuckyaUnkFC-- < 0)
|
||||
if (func_802B0C54(50.0f, 150.0f) || o->oChuckyaUnkFC < -16) {
|
||||
o->oSubAction++;
|
||||
;
|
||||
}
|
||||
@@ -150,8 +150,8 @@ void ActionChuckya1(void) {
|
||||
} else {
|
||||
set_obj_animation_and_sound_state(3);
|
||||
if (obj_check_anim_frame(18)) {
|
||||
PlaySound2(SOUND_OBJECT_UNKNOWN4);
|
||||
o->oUnknownUnk88 = 2;
|
||||
PlaySound2(SOUND_OBJ_UNKNOWN4);
|
||||
o->oChuckyaUnk88 = 2;
|
||||
o->oAction = 3;
|
||||
o->oInteractStatus &= ~(INT_STATUS_GRABBED_MARIO);
|
||||
}
|
||||
@@ -171,7 +171,7 @@ void ActionChuckya2(void) {
|
||||
if (o->oMoveFlags & (0x200 | 0x40 | 0x20 | 0x10 | 0x8 | 0x1)) {
|
||||
mark_object_for_deletion(o);
|
||||
spawn_object_loot_yellow_coins(o, 5, 20.0f);
|
||||
func_802A3034(SOUND_OBJECT_CHUCKYADEATH);
|
||||
func_802A3034(SOUND_OBJ_CHUCKYA_DEATH);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -183,8 +183,8 @@ void func_802A97B8(void) {
|
||||
obj_move_standard(-30);
|
||||
if (o->oInteractStatus & INT_STATUS_GRABBED_MARIO) {
|
||||
o->oAction = 1;
|
||||
o->oUnknownUnk88 = 1;
|
||||
PlaySound2(SOUND_OBJECT_UNKNOWN3);
|
||||
o->oChuckyaUnk88 = 1;
|
||||
PlaySound2(SOUND_OBJ_UNKNOWN3);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,14 +14,14 @@ struct ObjectHitbox sClamShellHitbox = {
|
||||
|
||||
void clam_act_0(void) {
|
||||
if (func_802F92EC(0, 25)) {
|
||||
PlaySound2(SOUND_GENERAL_CLAMSHELL4);
|
||||
PlaySound2(SOUND_GENERAL_CLAM_SHELL3);
|
||||
func_802ADA94();
|
||||
obj_become_tangible();
|
||||
|
||||
o->oClamUnkF4 = 10;
|
||||
o->oTimer = 0;
|
||||
} else if (o->oTimer > 150 && o->oDistanceToMario < 500.0f) {
|
||||
PlaySound2(SOUND_GENERAL_CLAMSHELL3);
|
||||
PlaySound2(SOUND_GENERAL_CLAM_SHELL2);
|
||||
o->oAction = 1;
|
||||
} else if (o->oClamUnkF4 != 0) {
|
||||
o->oClamUnkF4 -= 1;
|
||||
|
||||
@@ -69,10 +69,10 @@ static void cloud_fwoosh_update(void) {
|
||||
o->oCloudBlowing = o->oTimer = 0;
|
||||
} else if (o->oCloudGrowSpeed < -0.1f) {
|
||||
// Start blowing once we start shrinking faster than -0.1
|
||||
PlaySound(SOUND_CH6_BLOWWINDORFIRE_LOWPRIO);
|
||||
PlaySound(SOUND_AIR_BLOW_WIND);
|
||||
func_802C76E0(12, 3.0f, 0.0f, -50.0f, 120.0f);
|
||||
} else {
|
||||
PlaySound(SOUND_ENVIRONMENT_WIND1);
|
||||
PlaySound(SOUND_ENV_WIND1);
|
||||
}
|
||||
} else {
|
||||
// Return to normal size
|
||||
|
||||
@@ -49,7 +49,7 @@ void coffin_act_0(void) {
|
||||
o->oAngleVelPitch = approach_s16_symmetric(o->oAngleVelPitch, -2000, 200);
|
||||
|
||||
if (obj_face_pitch_approach(0, -o->oAngleVelPitch)) {
|
||||
PlaySound2(SOUND_GENERAL_ELEVATORMOVE_2);
|
||||
PlaySound2(SOUND_GENERAL_ELEVATOR_MOVE_2);
|
||||
obj_perform_position_op(0);
|
||||
o->oMoveAngleYaw = o->oFaceAngleYaw - 0x4000;
|
||||
|
||||
@@ -73,7 +73,7 @@ void coffin_act_0(void) {
|
||||
&& (o->oDistanceToMario > 100.0f || gMarioState->action == ACT_SQUISHED)) {
|
||||
if (gMarioObject->oPosY - o->oPosY < 200.0f && absf(val04) < 140.0f) {
|
||||
if (val00 < 150.0f && val00 > -450.0f) {
|
||||
PlaySound2(SOUND_GENERAL_BUTTONPRESS_2_LOWPRIO);
|
||||
PlaySound2(SOUND_GENERAL_BUTTON_PRESS_2_LOWPRIO);
|
||||
o->oAction = 1;
|
||||
}
|
||||
}
|
||||
@@ -94,7 +94,7 @@ void coffin_act_1(void) {
|
||||
o->oFaceAngleRoll = 0;
|
||||
} else if (o->oTimer > 30) {
|
||||
if (gGlobalTimer % 4 == 0) {
|
||||
PlaySound2(SOUND_GENERAL_ELEVATORMOVE_2);
|
||||
PlaySound2(SOUND_GENERAL_ELEVATOR_MOVE_2);
|
||||
}
|
||||
o->oFaceAngleRoll = 400 * (gGlobalTimer % 2) - 200;
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ void bhv_temp_coin_loop(void) {
|
||||
}
|
||||
|
||||
void bhv_coin_init(void) {
|
||||
o->oVelY = RandomFloat() * 10.0f + 30 + o->OBJECT_FIELD_F32(0x22);
|
||||
o->oVelY = RandomFloat() * 10.0f + 30 + o->oCoinUnk110;
|
||||
o->oForwardVel = RandomFloat() * 10.0f;
|
||||
o->oMoveAngleYaw = RandomU16();
|
||||
obj_set_behavior(bhvYellowCoin);
|
||||
@@ -76,9 +76,9 @@ void bhv_coin_loop(void) {
|
||||
}
|
||||
if (o->oTimer == 0)
|
||||
#ifndef VERSION_JP
|
||||
PlaySound2(SOUND_GENERAL_COINSPURT_2);
|
||||
PlaySound2(SOUND_GENERAL_COIN_SPURT_2);
|
||||
#else
|
||||
PlaySound2(SOUND_GENERAL_COINSPURT);
|
||||
PlaySound2(SOUND_GENERAL_COIN_SPURT);
|
||||
#endif
|
||||
if (o->oVelY < 0)
|
||||
obj_become_tangible();
|
||||
@@ -92,13 +92,13 @@ void bhv_coin_loop(void) {
|
||||
}
|
||||
#ifndef VERSION_JP
|
||||
if (o->oMoveFlags & OBJ_MOVE_13) {
|
||||
if (o->oUnk1B0 < 5)
|
||||
if (o->oCoinUnk1B0 < 5)
|
||||
PlaySound2(0x30364081);
|
||||
o->oUnk1B0++;
|
||||
o->oCoinUnk1B0++;
|
||||
}
|
||||
#else
|
||||
if (o->oMoveFlags & OBJ_MOVE_13)
|
||||
PlaySound2(SOUND_GENERAL_COINDROP);
|
||||
PlaySound2(SOUND_GENERAL_COIN_DROP);
|
||||
#endif
|
||||
if (obj_wait_then_blink(400, 20))
|
||||
mark_object_for_deletion(o);
|
||||
@@ -110,7 +110,7 @@ void bhv_coin_formation_spawn_loop(void) {
|
||||
obj_set_behavior(bhvYellowCoin);
|
||||
set_object_hitbox(o, &sYellowCoinHitbox);
|
||||
bhv_init_room();
|
||||
if (o->OBJECT_FIELD_S32(0x1C)) {
|
||||
if (o->oCoinUnkF8) {
|
||||
o->oPosY += 300.0f;
|
||||
obj_update_floor_height();
|
||||
if (o->oPosY < o->oFloorHeight || o->oFloorHeight < -10000.0f)
|
||||
@@ -124,7 +124,7 @@ void bhv_coin_formation_spawn_loop(void) {
|
||||
}
|
||||
} else {
|
||||
if (bhv_coin_sparkles_init())
|
||||
o->parentObj->OBJECT_FIELD_S32(0x1B) |= func_802A377C(o->oBehParams2ndByte);
|
||||
o->parentObj->oCoinUnkF4 |= func_802A377C(o->oBehParams2ndByte);
|
||||
o->oAnimState++;
|
||||
}
|
||||
if (o->parentObj->oAction == 2)
|
||||
@@ -170,12 +170,12 @@ void func_802AB364(s32 sp50, s32 sp54) {
|
||||
if (sp3C) {
|
||||
sp4C = spawn_object_relative(sp50, sp40[0], sp40[1], sp40[2], o, MODEL_YELLOW_COIN,
|
||||
bhvCoinFormationSpawn);
|
||||
sp4C->OBJECT_FIELD_S32(0x1C) = sp38;
|
||||
sp4C->oCoinUnkF8 = sp38;
|
||||
}
|
||||
}
|
||||
|
||||
void bhv_coin_formation_init(void) {
|
||||
o->OBJECT_FIELD_S32(0x1B) = (o->oBehParams >> 8) & 0xFF;
|
||||
o->oCoinUnkF4 = (o->oBehParams >> 8) & 0xFF;
|
||||
}
|
||||
|
||||
void bhv_coin_formation_loop(void) {
|
||||
@@ -184,7 +184,7 @@ void bhv_coin_formation_loop(void) {
|
||||
case 0:
|
||||
if (o->oDistanceToMario < 2000.0f) {
|
||||
for (bitIndex = 0; bitIndex < 8; bitIndex++) {
|
||||
if (!(o->OBJECT_FIELD_S32(0x1B) & (1 << bitIndex)))
|
||||
if (!(o->oCoinUnkF4 & (1 << bitIndex)))
|
||||
func_802AB364(bitIndex, o->oBehParams2ndByte);
|
||||
}
|
||||
o->oAction++;
|
||||
@@ -198,15 +198,16 @@ void bhv_coin_formation_loop(void) {
|
||||
o->oAction = 0;
|
||||
break;
|
||||
}
|
||||
set_object_respawn_info_bits(o, o->OBJECT_FIELD_S32(0x1B)
|
||||
& 0xFF); // Casting to u8 doesn't seem to match
|
||||
|
||||
// Casting to u8 doesn't seem to match
|
||||
set_object_respawn_info_bits(o, o->oCoinUnkF4 & 0xFF);
|
||||
}
|
||||
|
||||
void ActionCoinInsideBoo1(void) {
|
||||
obj_update_floor_and_walls();
|
||||
obj_if_hit_wall_bounce_away();
|
||||
if (o->oMoveFlags & OBJ_MOVE_13)
|
||||
PlaySound2(SOUND_GENERAL_COINDROP);
|
||||
PlaySound2(SOUND_GENERAL_COIN_DROP);
|
||||
if (o->oTimer > 90 || (o->oMoveFlags & OBJ_MOVE_LANDED)) {
|
||||
set_object_hitbox(o, &sYellowCoinHitbox);
|
||||
obj_become_tangible();
|
||||
|
||||
@@ -10,14 +10,14 @@ void bhv_punch_tiny_triangle_loop(void) {
|
||||
s16 sp1E;
|
||||
if (o->oTimer == 0) {
|
||||
sp1E = o->oMoveAngleYaw;
|
||||
o->OBJECT_FIELD_F32(0x1B) = 1.28f;
|
||||
o->oCollisionParticleUnkF4 = 1.28f;
|
||||
obj_set_pos_relative(gMarioObject, 0.0f, 60.0f, 100.0f);
|
||||
o->oMoveAngleYaw = sp1E; // does obj_set_pos_relative modify currentObject?
|
||||
}
|
||||
obj_move_using_fvel_and_gravity();
|
||||
o->oAnimState = 5;
|
||||
obj_scale(o->OBJECT_FIELD_F32(0x1B));
|
||||
o->OBJECT_FIELD_F32(0x1B) -= 0.2f;
|
||||
obj_scale(o->oCollisionParticleUnkF4);
|
||||
o->oCollisionParticleUnkF4 -= 0.2f;
|
||||
if (gDebugInfo[4][0] + 6 < o->oTimer)
|
||||
mark_object_for_deletion(o);
|
||||
}
|
||||
@@ -38,14 +38,14 @@ void bhv_wall_tiny_star_particle_loop(void) {
|
||||
s16 sp1E;
|
||||
if (o->oTimer == 0) {
|
||||
sp1E = o->oMoveAngleYaw;
|
||||
o->OBJECT_FIELD_F32(0x1B) = 0.28f;
|
||||
o->oCollisionParticleUnkF4 = 0.28f;
|
||||
obj_set_pos_relative(gMarioObject, 0.0f, 30.0f, 110.0f);
|
||||
o->oMoveAngleYaw = sp1E;
|
||||
}
|
||||
obj_move_using_fvel_and_gravity();
|
||||
o->oAnimState = 4;
|
||||
obj_scale(o->OBJECT_FIELD_F32(0x1B));
|
||||
o->OBJECT_FIELD_F32(0x1B) -= 0.015f;
|
||||
obj_scale(o->oCollisionParticleUnkF4);
|
||||
o->oCollisionParticleUnkF4 -= 0.015f;
|
||||
}
|
||||
|
||||
void bhv_tiny_star_particles_init(void) {
|
||||
@@ -62,15 +62,15 @@ void bhv_tiny_star_particles_init(void) {
|
||||
|
||||
void bhv_pound_tiny_star_particle_loop(void) {
|
||||
if (o->oTimer == 0) {
|
||||
o->OBJECT_FIELD_F32(0x1B) = 0.28f;
|
||||
o->oCollisionParticleUnkF4 = 0.28f;
|
||||
o->oForwardVel = 25.0f;
|
||||
o->oPosY -= 20.0f;
|
||||
o->oVelY = 14.0f;
|
||||
}
|
||||
obj_move_using_fvel_and_gravity();
|
||||
o->oAnimState = 4;
|
||||
obj_scale(o->OBJECT_FIELD_F32(0x1B));
|
||||
o->OBJECT_FIELD_F32(0x1B) -= 0.015f;
|
||||
obj_scale(o->oCollisionParticleUnkF4);
|
||||
o->oCollisionParticleUnkF4 -= 0.015f;
|
||||
}
|
||||
|
||||
void bhv_pound_tiny_star_particle_init(void) {
|
||||
|
||||
@@ -71,11 +71,11 @@ void bhv_controllable_platform_init(void) {
|
||||
}
|
||||
|
||||
void func_802F3F80(s8 sp1B) {
|
||||
o->oUnknownUnkF8_S32 = sp1B;
|
||||
o->oControllablePlatformUnkF8 = sp1B;
|
||||
o->oTimer = 0;
|
||||
D_80331694 = 5;
|
||||
|
||||
PlaySound2(SOUND_GENERAL_QUIETPOUND1);
|
||||
PlaySound2(SOUND_GENERAL_QUIET_POUND1);
|
||||
}
|
||||
|
||||
void func_802F3FD8(s8 sp1B, s8 sp1C[3], Vec3f sp20, UNUSED Vec3f sp24, Vec3f sp28) {
|
||||
@@ -105,25 +105,25 @@ void func_802F3FD8(s8 sp1B, s8 sp1C[3], Vec3f sp20, UNUSED Vec3f sp24, Vec3f sp2
|
||||
|
||||
if (!is_point_within_radius_of_mario(o->oPosX, o->oPosY, o->oPosZ, 400)) {
|
||||
D_80331694 = 6;
|
||||
o->oUnknownUnk100_S32 = 1;
|
||||
o->oControllablePlatformUnk100 = 1;
|
||||
o->oTimer = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void func_802F4230(void) {
|
||||
if (o->oUnknownUnkF8_S32 == 1 || o->oUnknownUnkF8_S32 == 2) {
|
||||
if (o->oControllablePlatformUnkF8 == 1 || o->oControllablePlatformUnkF8 == 2) {
|
||||
o->oFaceAnglePitch = sins(o->oTimer * 0x1000) * 182.04444 * 10.0;
|
||||
o->oPosY = o->oUnknownUnkFC_F32 + sins(o->oTimer * 0x2000) * 20.0f;
|
||||
o->oPosY = o->oControllablePlatformUnkFC + sins(o->oTimer * 0x2000) * 20.0f;
|
||||
} else {
|
||||
o->oFaceAngleRoll = sins(o->oTimer * 0x1000) * 182.04444 * 10.0;
|
||||
o->oPosY = o->oUnknownUnkFC_F32 + sins(o->oTimer * 0x2000) * 20.0f;
|
||||
o->oPosY = o->oControllablePlatformUnkFC + sins(o->oTimer * 0x2000) * 20.0f;
|
||||
}
|
||||
|
||||
if (o->oTimer == 32) {
|
||||
D_80331694 = o->oUnknownUnkF8_S32;
|
||||
D_80331694 = o->oControllablePlatformUnkF8;
|
||||
o->oFaceAnglePitch = 0;
|
||||
o->oFaceAngleRoll = 0;
|
||||
o->oPosY = o->oUnknownUnkFC_F32;
|
||||
o->oPosY = o->oControllablePlatformUnkFC;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,5 +213,5 @@ void bhv_controllable_platform_loop(void) {
|
||||
o->oPosX += o->oVelX;
|
||||
o->oPosZ += o->oVelZ;
|
||||
if (D_80331694 != 0 && D_80331694 != 6)
|
||||
PlaySound(SOUND_ENVIRONMENT_ELEVATOR2);
|
||||
PlaySound(SOUND_ENV_ELEVATOR2);
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ void bhv_rr_cruiser_wing_loop(void) {
|
||||
}
|
||||
#ifndef VERSION_JP
|
||||
if (o->oTimer == 64) {
|
||||
PlaySound2(SOUND_GENERAL_BOATROCK);
|
||||
PlaySound2(SOUND_GENERAL_BOAT_ROCK);
|
||||
o->oTimer = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -27,5 +27,5 @@ void bhv_decorative_pendulum_loop(void) {
|
||||
* actually one sound played twice in rapid succession.
|
||||
*/
|
||||
if (o->oAngleVelRoll == 0x10 || o->oAngleVelRoll == -0x10)
|
||||
PlaySound2(SOUND_GENERAL_BIGCLOCK);
|
||||
PlaySound2(SOUND_GENERAL_BIG_CLOCK);
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ void bhv_donut_platform_update(void) {
|
||||
mark_object_for_deletion(o);
|
||||
} else {
|
||||
func_802A3C98(150.0f, 1);
|
||||
create_sound_spawner(SOUND_GENERAL_EXPLOSION4);
|
||||
create_sound_spawner(SOUND_GENERAL_DONUT_PLATFORM_EXPLOSION);
|
||||
}
|
||||
} else {
|
||||
if (o->oGravity == 0.0f) {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// door.c.inc
|
||||
|
||||
s32 D_8032F300[][2] = { { 0x40000, 3 }, { 0x80000, 4 }, { 0x10000, 1 }, { 0x20000, 2 }, { -1, 0 } };
|
||||
s32 D_8032F300[][2] = { { 0x40000, 3 }, { 0x80000, 4 }, { 0x10000, 1 }, { 0x20000, 2 }, { -1, 0 }, };
|
||||
|
||||
s32 D_8032F328[] = { SOUND_GENERAL_OPENWOODDOOR, SOUND_GENERAL_OPENIRONDOOR };
|
||||
s32 D_8032F328[] = { SOUND_GENERAL_OPEN_WOOD_DOOR, SOUND_GENERAL_OPEN_IRON_DOOR };
|
||||
|
||||
s32 D_8032F330[] = { SOUND_GENERAL_CLOSEWOODDOOR, SOUND_GENERAL_CLOSEIRONDOOR };
|
||||
s32 D_8032F330[] = { SOUND_GENERAL_CLOSE_WOOD_DOOR, SOUND_GENERAL_CLOSE_IRON_DOOR };
|
||||
|
||||
void func_802AC070(s32 sp18) {
|
||||
set_obj_animation_and_sound_state(sp18);
|
||||
@@ -78,45 +78,45 @@ void bhv_door_init(void) {
|
||||
struct Surface *floor;
|
||||
find_floor(x, o->oPosY, z, &floor);
|
||||
if (floor != NULL) {
|
||||
o->OBJECT_FIELD_S32(0x1C) = floor->room;
|
||||
o->oDoorUnkF8 = floor->room;
|
||||
}
|
||||
|
||||
x = o->oPosX + sins(o->oMoveAngleYaw) * 200.0f;
|
||||
z = o->oPosZ + coss(o->oMoveAngleYaw) * 200.0f;
|
||||
find_floor(x, o->oPosY, z, &floor);
|
||||
if (floor != NULL) {
|
||||
o->OBJECT_FIELD_S32(0x1D) = floor->room;
|
||||
o->oDoorUnkFC = floor->room;
|
||||
}
|
||||
|
||||
x = o->oPosX + sins(o->oMoveAngleYaw) * -200.0f;
|
||||
z = o->oPosZ + coss(o->oMoveAngleYaw) * -200.0f;
|
||||
find_floor(x, o->oPosY, z, &floor);
|
||||
if (floor != NULL) {
|
||||
o->OBJECT_FIELD_S32(0x1E) = floor->room;
|
||||
o->oDoorUnk100 = floor->room;
|
||||
}
|
||||
|
||||
if (o->OBJECT_FIELD_S32(0x1C) > 0 && o->OBJECT_FIELD_S32(0x1C) < 60) {
|
||||
gDoorAdjacentRooms[o->OBJECT_FIELD_S32(0x1C)][0] = o->OBJECT_FIELD_S32(0x1D);
|
||||
gDoorAdjacentRooms[o->OBJECT_FIELD_S32(0x1C)][1] = o->OBJECT_FIELD_S32(0x1E);
|
||||
if (o->oDoorUnkF8 > 0 && o->oDoorUnkF8 < 60) {
|
||||
gDoorAdjacentRooms[o->oDoorUnkF8][0] = o->oDoorUnkFC;
|
||||
gDoorAdjacentRooms[o->oDoorUnkF8][1] = o->oDoorUnk100;
|
||||
}
|
||||
}
|
||||
|
||||
void bhv_star_door_loop_2(void) {
|
||||
s32 sp4 = 0;
|
||||
if (gMarioCurrentRoom != 0) {
|
||||
if (o->OBJECT_FIELD_S32(0x1C) == gMarioCurrentRoom)
|
||||
if (o->oDoorUnkF8 == gMarioCurrentRoom)
|
||||
sp4 = 1;
|
||||
else if (gMarioCurrentRoom == o->OBJECT_FIELD_S32(0x1D))
|
||||
else if (gMarioCurrentRoom == o->oDoorUnkFC)
|
||||
sp4 = 1;
|
||||
else if (gMarioCurrentRoom == o->OBJECT_FIELD_S32(0x1E))
|
||||
else if (gMarioCurrentRoom == o->oDoorUnk100)
|
||||
sp4 = 1;
|
||||
else if (gDoorAdjacentRooms[gMarioCurrentRoom][0] == o->OBJECT_FIELD_S32(0x1D))
|
||||
else if (gDoorAdjacentRooms[gMarioCurrentRoom][0] == o->oDoorUnkFC)
|
||||
sp4 = 1;
|
||||
else if (gDoorAdjacentRooms[gMarioCurrentRoom][0] == o->OBJECT_FIELD_S32(0x1E))
|
||||
else if (gDoorAdjacentRooms[gMarioCurrentRoom][0] == o->oDoorUnk100)
|
||||
sp4 = 1;
|
||||
else if (gDoorAdjacentRooms[gMarioCurrentRoom][1] == o->OBJECT_FIELD_S32(0x1D))
|
||||
else if (gDoorAdjacentRooms[gMarioCurrentRoom][1] == o->oDoorUnkFC)
|
||||
sp4 = 1;
|
||||
else if (gDoorAdjacentRooms[gMarioCurrentRoom][1] == o->OBJECT_FIELD_S32(0x1E))
|
||||
else if (gDoorAdjacentRooms[gMarioCurrentRoom][1] == o->oDoorUnk100)
|
||||
sp4 = 1;
|
||||
} else
|
||||
sp4 = 1;
|
||||
@@ -127,5 +127,5 @@ void bhv_star_door_loop_2(void) {
|
||||
if (sp4 == 0) {
|
||||
o->header.gfx.node.flags &= ~1;
|
||||
}
|
||||
o->oUnknownUnk88 = sp4;
|
||||
o->oDoorUnk88 = sp4;
|
||||
}
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
// door_key.c.inc
|
||||
|
||||
Gfx *Geo18_802BA2B0(s32 run, struct GraphNode *node, UNUSED f32 mtx[4][4]) {
|
||||
struct Object *sp4;
|
||||
if (run == TRUE) {
|
||||
sp4 = (struct Object *) D_8032CFA0;
|
||||
((struct GraphNodeScaleOptionalDisplayList *) node->next)->scale = sp4->oUnknownUnkF4_F32;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void bhv_door_key_1_loop(void) {
|
||||
s32 sp1C;
|
||||
sp1C = o->header.gfx.unk38.animFrame;
|
||||
set_obj_animation_and_sound_state(0);
|
||||
if (sp1C < 38)
|
||||
o->oDoorKey1UnkF4 = 0.0f;
|
||||
else if (sp1C < 49)
|
||||
o->oDoorKey1UnkF4 = 0.2f;
|
||||
else if (sp1C < 58)
|
||||
o->oDoorKey1UnkF4 = (sp1C - 53) * 0.11875f + 0.2; // 0.11875?
|
||||
else if (sp1C < 59)
|
||||
o->oDoorKey1UnkF4 = 1.1f;
|
||||
else if (sp1C < 60)
|
||||
o->oDoorKey1UnkF4 = 1.05f;
|
||||
else
|
||||
o->oDoorKey1UnkF4 = 1.0f;
|
||||
if (o->oTimer > 150)
|
||||
mark_object_for_deletion(o);
|
||||
}
|
||||
|
||||
void bhv_door_key_2_loop(void) {
|
||||
s32 sp1C = o->header.gfx.unk38.animFrame;
|
||||
set_obj_animation_and_sound_state(1);
|
||||
if (sp1C < 38)
|
||||
o->oDoorKey2UnkF4 = 0.2f;
|
||||
else if (sp1C < 52)
|
||||
o->oDoorKey2UnkF4 = (sp1C - 42) * 0.042857f + 0.2; // TODO 3/70?
|
||||
else if (sp1C < 94)
|
||||
o->oDoorKey2UnkF4 = 0.8f;
|
||||
else if (sp1C < 0x65)
|
||||
o->oDoorKey2UnkF4 = (101 - sp1C) * 0.085714f + 0.2; // TODO 6/70?
|
||||
else
|
||||
o->oDoorKey2UnkF4 = 0.2f;
|
||||
if (o->oTimer > 138)
|
||||
mark_object_for_deletion(o);
|
||||
}
|
||||
@@ -26,7 +26,7 @@ static void dorrie_act_move(void) {
|
||||
set_obj_animation_and_sound_state(1);
|
||||
|
||||
if (o->oDorrieForwardDistToMario < 320.0f && o->oDorrieGroundPounded) {
|
||||
PlaySound2(SOUND_OBJECT_DORRIE);
|
||||
PlaySound2(SOUND_OBJ_DORRIE);
|
||||
o->collisionData = segmented_to_virtual(dorrie_seg6_collision_0600FBB8);
|
||||
o->oAction = DORRIE_ACT_LOWER_HEAD;
|
||||
o->oForwardVel = 0.0f;
|
||||
|
||||
@@ -36,7 +36,7 @@ void bhv_lll_drawbridge_loop(void) {
|
||||
// the game at regular intervals can leave the drawbridge raised indefinitely.
|
||||
if (o->oTimer >= 51 && (globalTimer % 8) == 0) {
|
||||
o->oAction = LLL_DRAWBRIDGE_ACT_LOWER;
|
||||
PlaySound2(SOUND_GENERAL_BOATTILT1);
|
||||
PlaySound2(SOUND_GENERAL_BOAT_TILT1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ void bhv_lll_drawbridge_loop(void) {
|
||||
// the game at regular intervals can leave the drawbridge lowered indefinitely.
|
||||
if (o->oTimer >= 51 && (globalTimer % 8) == 0) {
|
||||
o->oAction = LLL_DRAWBRIDGE_ACT_RAISE;
|
||||
PlaySound2(SOUND_GENERAL_BOATTILT2);
|
||||
PlaySound2(SOUND_GENERAL_BOAT_TILT2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,41 +1,41 @@
|
||||
// elevator.c.inc
|
||||
|
||||
void func_802AD01C(void) {
|
||||
PlaySound2(SOUND_GENERAL_QUIETPOUND1);
|
||||
PlaySound2(SOUND_GENERAL_QUIET_POUND1);
|
||||
ShakeScreen(1);
|
||||
}
|
||||
|
||||
void ActionElevator0(void) {
|
||||
o->oVelY = 0;
|
||||
if (o->OBJECT_FIELD_S32(0x1E) == 2) {
|
||||
if (o->oElevatorUnk100 == 2) {
|
||||
if (gMarioObject->platform == o) {
|
||||
if (o->oPosY > o->OBJECT_FIELD_F32(0x1D))
|
||||
if (o->oPosY > o->oElevatorUnkFC)
|
||||
o->oAction = 2;
|
||||
else
|
||||
o->oAction = 1;
|
||||
}
|
||||
} else if (gMarioObject->oPosY > o->OBJECT_FIELD_F32(0x1D) || o->OBJECT_FIELD_S32(0x1E) == 1) {
|
||||
o->oPosY = o->OBJECT_FIELD_F32(0x1C);
|
||||
} else if (gMarioObject->oPosY > o->oElevatorUnkFC || o->oElevatorUnk100 == 1) {
|
||||
o->oPosY = o->oElevatorUnkF8;
|
||||
if (gMarioObject->platform == o)
|
||||
o->oAction = 2;
|
||||
} else {
|
||||
o->oPosY = o->OBJECT_FIELD_F32(0x1B);
|
||||
o->oPosY = o->oElevatorUnkF4;
|
||||
if (gMarioObject->platform == o)
|
||||
o->oAction = 1;
|
||||
}
|
||||
}
|
||||
|
||||
void ActionElevator1(void) {
|
||||
PlaySound(SOUND_ENVIRONMENT_ELEVATOR1);
|
||||
PlaySound(SOUND_ENV_ELEVATOR1);
|
||||
if (o->oTimer == 0 && obj_is_mario_on_platform())
|
||||
func_802AD01C();
|
||||
approach_f32_signed(&o->oVelY, 10.0f, 2.0f);
|
||||
o->oPosY += o->oVelY;
|
||||
if (o->oPosY > o->OBJECT_FIELD_F32(0x1C)) {
|
||||
o->oPosY = o->OBJECT_FIELD_F32(0x1C);
|
||||
if (o->OBJECT_FIELD_S32(0x1E) == 2 || o->OBJECT_FIELD_S32(0x1E) == 1)
|
||||
if (o->oPosY > o->oElevatorUnkF8) {
|
||||
o->oPosY = o->oElevatorUnkF8;
|
||||
if (o->oElevatorUnk100 == 2 || o->oElevatorUnk100 == 1)
|
||||
o->oAction = 3;
|
||||
else if (gMarioObject->oPosY < o->OBJECT_FIELD_F32(0x1D))
|
||||
else if (gMarioObject->oPosY < o->oElevatorUnkFC)
|
||||
o->oAction = 2;
|
||||
else
|
||||
o->oAction = 3;
|
||||
@@ -44,18 +44,18 @@ void ActionElevator1(void) {
|
||||
|
||||
void ActionElevator2() // Pretty similar code to action 1
|
||||
{
|
||||
PlaySound(SOUND_ENVIRONMENT_ELEVATOR1);
|
||||
PlaySound(SOUND_ENV_ELEVATOR1);
|
||||
if (o->oTimer == 0 && obj_is_mario_on_platform())
|
||||
func_802AD01C();
|
||||
approach_f32_signed(&o->oVelY, -10.0f, -2.0f);
|
||||
o->oPosY += o->oVelY;
|
||||
if (o->oPosY < o->OBJECT_FIELD_F32(0x1B)) {
|
||||
o->oPosY = o->OBJECT_FIELD_F32(0x1B);
|
||||
if (o->OBJECT_FIELD_S32(0x1E) == 1)
|
||||
if (o->oPosY < o->oElevatorUnkF4) {
|
||||
o->oPosY = o->oElevatorUnkF4;
|
||||
if (o->oElevatorUnk100 == 1)
|
||||
o->oAction = 4;
|
||||
else if (o->OBJECT_FIELD_S32(0x1E) == 2)
|
||||
else if (o->oElevatorUnk100 == 2)
|
||||
o->oAction = 3;
|
||||
else if (gMarioObject->oPosY > o->OBJECT_FIELD_F32(0x1D))
|
||||
else if (gMarioObject->oPosY > o->oElevatorUnkFC)
|
||||
o->oAction = 1;
|
||||
else
|
||||
o->oAction = 3;
|
||||
@@ -66,7 +66,7 @@ void ActionElevator4() {
|
||||
o->oVelY = 0;
|
||||
if (o->oTimer == 0) {
|
||||
ShakeScreen(1);
|
||||
PlaySound2(SOUND_GENERAL_METALPOUND);
|
||||
PlaySound2(SOUND_GENERAL_METAL_POUND);
|
||||
}
|
||||
if (!mario_is_in_air_action() && !obj_is_mario_on_platform())
|
||||
o->oAction = 1;
|
||||
@@ -77,7 +77,7 @@ void ActionElevator3() // nearly identical to action 2
|
||||
o->oVelY = 0;
|
||||
if (o->oTimer == 0) {
|
||||
ShakeScreen(1);
|
||||
PlaySound2(SOUND_GENERAL_METALPOUND);
|
||||
PlaySound2(SOUND_GENERAL_METAL_POUND);
|
||||
}
|
||||
if (!mario_is_in_air_action() && !obj_is_mario_on_platform())
|
||||
o->oAction = 0;
|
||||
@@ -86,15 +86,15 @@ void ActionElevator3() // nearly identical to action 2
|
||||
void bhv_elevator_init(void) {
|
||||
s32 sp1C = D_8032F38C[o->oBehParams2ndByte * 3 + 2];
|
||||
if (sp1C == 0) {
|
||||
o->OBJECT_FIELD_F32(0x1B) = D_8032F38C[o->oBehParams2ndByte * 3];
|
||||
o->OBJECT_FIELD_F32(0x1C) = o->oHomeY;
|
||||
o->OBJECT_FIELD_F32(0x1D) = (o->OBJECT_FIELD_F32(0x1B) + o->OBJECT_FIELD_F32(0x1C)) / 2.0f;
|
||||
o->OBJECT_FIELD_S32(0x1E) = obj_has_behavior(bhvRrElevatorPlatform);
|
||||
o->oElevatorUnkF4 = D_8032F38C[o->oBehParams2ndByte * 3];
|
||||
o->oElevatorUnkF8 = o->oHomeY;
|
||||
o->oElevatorUnkFC = (o->oElevatorUnkF4 + o->oElevatorUnkF8) / 2.0f;
|
||||
o->oElevatorUnk100 = obj_has_behavior(bhvRrElevatorPlatform);
|
||||
} else {
|
||||
o->OBJECT_FIELD_F32(0x1B) = D_8032F38C[o->oBehParams2ndByte * 3];
|
||||
o->OBJECT_FIELD_F32(0x1C) = D_8032F38C[o->oBehParams2ndByte * 3 + 1];
|
||||
o->OBJECT_FIELD_F32(0x1D) = (o->OBJECT_FIELD_F32(0x1B) + o->OBJECT_FIELD_F32(0x1C)) / 2.0f;
|
||||
o->OBJECT_FIELD_S32(0x1E) = 2;
|
||||
o->oElevatorUnkF4 = D_8032F38C[o->oBehParams2ndByte * 3];
|
||||
o->oElevatorUnkF8 = D_8032F38C[o->oBehParams2ndByte * 3 + 1];
|
||||
o->oElevatorUnkFC = (o->oElevatorUnkF4 + o->oElevatorUnkF8) / 2.0f;
|
||||
o->oElevatorUnk100 = 2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ void bhv_end_birds_1_loop(void) {
|
||||
if (gCurrentObject->oTimer < 100)
|
||||
func_8029A7DC(gCurrentObject, sp34, 0, 0, 0x20, 0x20);
|
||||
if ((gCurrentObject->oEndBirdUnk104 == 0.f) && (gCurrentObject->oTimer == 0))
|
||||
PlaySound2(SOUND_GENERAL_BIRDSFLYAWAY);
|
||||
PlaySound2(SOUND_GENERAL_BIRDS_FLY_AWAY);
|
||||
if (gCutsceneTimer == 0)
|
||||
mark_object_for_deletion(gCurrentObject);
|
||||
break;
|
||||
|
||||
@@ -23,7 +23,7 @@ void bhv_end_birds_2_loop(void) {
|
||||
func_8029A7DC(gCurrentObject, sp3C, 0, 0, 8, 8);
|
||||
|
||||
if ((gCurrentObject->oEndBirdUnk104 == 0.f) && (gCurrentObject->oTimer == 0))
|
||||
PlaySound2(SOUND_GENERAL_BIRDSFLYAWAY);
|
||||
PlaySound2(SOUND_GENERAL_BIRDS_FLY_AWAY);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -137,7 +137,7 @@ static void enemy_lakitu_sub_act_hold_spiny(void) {
|
||||
*/
|
||||
static void enemy_lakitu_sub_act_throw_spiny(void) {
|
||||
if (func_802F92EC(2, 2)) {
|
||||
PlaySound2(SOUND_OBJECT_EVILLAKITUTHROW);
|
||||
PlaySound2(SOUND_OBJ_EVIL_LAKITU_THROW);
|
||||
o->prevObj = NULL;
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ static void enemy_lakitu_sub_act_throw_spiny(void) {
|
||||
* Main update function.
|
||||
*/
|
||||
static void enemy_lakitu_act_main(void) {
|
||||
PlaySound(SOUND_CH6_LAKITUFLY);
|
||||
PlaySound(SOUND_AIR_LAKITU_FLY);
|
||||
|
||||
obj_update_floor_and_walls();
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ void ActionExclamationBox4(void) {
|
||||
func_802C0DF0(sExclamationBoxContents, o->oBehParams2ndByte);
|
||||
func_802AA618(0, 0, 46.0f);
|
||||
spawn_triangle_break_particles(20, 139, 0.3f, o->oAnimState);
|
||||
create_sound_spawner(SOUND_GENERAL_BREAKBOX);
|
||||
create_sound_spawner(SOUND_GENERAL_BREAK_BOX);
|
||||
if (o->oBehParams2ndByte < 3) {
|
||||
o->oAction = 5;
|
||||
obj_hide();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// explosion.c.inc
|
||||
|
||||
void bhv_explosion_init(void) {
|
||||
create_sound_spawner(SOUND_CH8_UNK2E);
|
||||
create_sound_spawner(SOUND_GENERAL2_BOBOMB_EXPLOSION);
|
||||
set_camera_shake_2(SHAKE_2_UNKNOWN_1);
|
||||
|
||||
o->oOpacity = 255;
|
||||
|
||||
@@ -8,7 +8,7 @@ void bhv_wdw_express_elevator_loop(void) {
|
||||
} else if (o->oAction == 1) {
|
||||
o->oVelY = -20.0f;
|
||||
o->oPosY += o->oVelY;
|
||||
PlaySound(SOUND_ENVIRONMENT_ELEVATOR4);
|
||||
PlaySound(SOUND_ENV_ELEVATOR4);
|
||||
if (o->oTimer > 132)
|
||||
o->oAction++;
|
||||
} else if (o->oAction == 2) {
|
||||
@@ -17,7 +17,7 @@ void bhv_wdw_express_elevator_loop(void) {
|
||||
} else if (o->oAction == 3) {
|
||||
o->oVelY = 10.0f;
|
||||
o->oPosY += o->oVelY;
|
||||
PlaySound(SOUND_ENVIRONMENT_ELEVATOR4);
|
||||
PlaySound(SOUND_ENV_ELEVATOR4);
|
||||
if (o->oPosY >= o->oHomeY) {
|
||||
o->oPosY = o->oHomeY;
|
||||
o->oAction++;
|
||||
|
||||
@@ -34,7 +34,7 @@ static void eyerok_boss_act_sleep(void) {
|
||||
eyerok_spawn_hand(-1, MODEL_EYEROK_LEFT_HAND, bhvEyerokHand);
|
||||
eyerok_spawn_hand(1, MODEL_EYEROK_RIGHT_HAND, bhvEyerokHand);
|
||||
} else if (o->oDistanceToMario < 500.0f) {
|
||||
PlaySound2(SOUND_OBJECT_EYEROKEXPLODE);
|
||||
PlaySound2(SOUND_OBJ_EYEROK_EXPLODE);
|
||||
o->oAction = EYEROK_BOSS_ACT_WAKE_UP;
|
||||
}
|
||||
}
|
||||
@@ -63,7 +63,7 @@ static void eyerok_boss_act_wake_up(void) {
|
||||
}
|
||||
|
||||
static void eyerok_boss_act_show_intro_text(void) {
|
||||
if (obj_update_dialog_unk2(2, 0, 0xA2, 0x75)) {
|
||||
if (obj_update_dialog_with_cutscene(2, 0, CUTSCENE_DIALOG_1, 117)) {
|
||||
o->oAction = EYEROK_BOSS_ACT_FIGHT;
|
||||
}
|
||||
}
|
||||
@@ -117,7 +117,7 @@ static void eyerok_boss_act_fight(void) {
|
||||
|
||||
static void eyerok_boss_act_die(void) {
|
||||
if (o->oTimer == 60) {
|
||||
if (obj_update_dialog_unk2(2, 0, 0xA2, 0x76)) {
|
||||
if (obj_update_dialog_with_cutscene(2, 0, CUTSCENE_DIALOG_1, 118)) {
|
||||
create_star(0.0f, -900.0f, -3700.0f);
|
||||
} else {
|
||||
o->oTimer -= 1;
|
||||
@@ -150,7 +150,7 @@ void bhv_eyerok_boss_loop(void) {
|
||||
|
||||
static s32 eyerok_hand_check_attacked(void) {
|
||||
if (o->oEyerokReceivedAttack != 0 && abs_angle_diff(o->oAngleToMario, o->oFaceAngleYaw) < 0x3000) {
|
||||
PlaySound2(SOUND_CH9_UNK5A_LOWPRIO);
|
||||
PlaySound2(SOUND_OBJ2_EYEROK_SOUND_SHORT);
|
||||
|
||||
if (--o->oHealth >= 2) {
|
||||
o->oAction = EYEROK_HAND_ACT_ATTACKED;
|
||||
@@ -174,7 +174,7 @@ static s32 eyerok_hand_check_attacked(void) {
|
||||
}
|
||||
|
||||
static void func_8030DBA8(void) {
|
||||
PlaySound2(SOUND_OBJECT_POUNDINGLOUD);
|
||||
PlaySound2(SOUND_OBJ_POUNDING_LOUD);
|
||||
func_8027F440(1, o->oPosX, o->oPosY, o->oPosZ);
|
||||
func_802ADA94();
|
||||
}
|
||||
@@ -268,7 +268,7 @@ static void eyerok_hand_act_show_eye(void) {
|
||||
UNUSED s16 val06;
|
||||
|
||||
set_obj_animation_and_sound_state(5);
|
||||
func_802F9378(0, 0, SOUND_OBJECT_BRIDGEEXPLODE);
|
||||
func_802F9378(0, 0, SOUND_OBJ_EYEROK_SHOW_EYE);
|
||||
|
||||
if (!eyerok_hand_check_attacked()) {
|
||||
if (o->parentObj->oEyerokBossActiveHand == 0) {
|
||||
@@ -343,11 +343,11 @@ static void eyerok_hand_act_die(void) {
|
||||
if (func_802F92B0(1)) {
|
||||
o->parentObj->oEyerokBossUnk1AC = 0;
|
||||
func_802A3C98(150.0f, 1);
|
||||
create_sound_spawner(SOUND_CH9_UNK5B);
|
||||
create_sound_spawner(SOUND_OBJ2_EYEROK_SOUND_LONG);
|
||||
}
|
||||
|
||||
if (o->oMoveFlags & 0x00000003) {
|
||||
PlaySound2(SOUND_OBJECT_POUNDINGLOUD);
|
||||
PlaySound2(SOUND_OBJ_POUNDING_LOUD);
|
||||
o->oForwardVel = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ void bhv_falling_pillar_loop(void) {
|
||||
o->oAction = FALLING_PILLAR_ACT_TURNING;
|
||||
|
||||
// Play the detaching sound.
|
||||
PlaySound2(SOUND_GENERAL_POUNDROCK);
|
||||
PlaySound2(SOUND_GENERAL_POUND_ROCK);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -112,7 +112,7 @@ void bhv_falling_pillar_loop(void) {
|
||||
o->activeFlags = 0;
|
||||
|
||||
// Play the hitting the ground sound.
|
||||
create_sound_spawner(SOUND_GENERAL_BIGPOUND);
|
||||
create_sound_spawner(SOUND_GENERAL_BIG_POUND);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ static void fire_piranha_plant_act_hide(void) {
|
||||
|
||||
if (func_8029F788()) {
|
||||
if (--o->oFirePiranhaPlantDeathSpinTimer == 0) {
|
||||
PlaySound2(SOUND_EMEMY_DEFEAT_SHRINK);
|
||||
PlaySound2(SOUND_OBJ_ENEMY_DEFEAT_SHRINK);
|
||||
}
|
||||
}
|
||||
} else if (approach_f32_ptr(&o->oFirePiranhaPlantScale, 0.0f,
|
||||
@@ -76,7 +76,7 @@ static void fire_piranha_plant_act_hide(void) {
|
||||
}
|
||||
} else if (sNumActiveFirePiranhaPlants < 2 && o->oTimer > 100 && o->oDistanceToMario > 100.0f
|
||||
&& o->oDistanceToMario < 800.0f) {
|
||||
PlaySound2(SOUND_OBJECT_PIRANHAPLANTAPPEAR);
|
||||
PlaySound2(SOUND_OBJ_PIRANHA_PLANT_APPEAR);
|
||||
|
||||
o->oFirePiranhaPlantActive = TRUE;
|
||||
sNumActiveFirePiranhaPlants += 1;
|
||||
@@ -98,7 +98,7 @@ static void fire_piranha_plant_act_grow(void) {
|
||||
if (approach_f32_ptr(&o->oFirePiranhaPlantScale, o->oFirePiranhaPlantNeutralScale,
|
||||
0.04f * o->oFirePiranhaPlantNeutralScale)) {
|
||||
if (o->oTimer > 80) {
|
||||
PlaySound2(SOUND_OBJECT_PIRANHAPLANTSHRINK);
|
||||
PlaySound2(SOUND_OBJ_PIRANHA_PLANT_SHRINK);
|
||||
o->oAction = FIRE_PIRANHA_PLANT_ACT_HIDE;
|
||||
set_obj_animation_and_sound_state(0);
|
||||
} else if (o->oTimer < 50) {
|
||||
@@ -106,7 +106,7 @@ static void fire_piranha_plant_act_grow(void) {
|
||||
} else { // TODO: Check if we can put these conditionals on same line
|
||||
if (obj_is_rendering_enabled()) {
|
||||
if (obj_check_anim_frame(56)) {
|
||||
PlaySound2(SOUND_OBJECT_FLAMEBLOWN);
|
||||
PlaySound2(SOUND_OBJ_FLAME_BLOWN);
|
||||
obj_spit_fire(0, (s32)(30.0f * o->oFirePiranhaPlantNeutralScale),
|
||||
(s32)(140.0f * o->oFirePiranhaPlantNeutralScale),
|
||||
2.5f * o->oFirePiranhaPlantNeutralScale, MODEL_RED_FLAME_SHADOW,
|
||||
|
||||
@@ -20,7 +20,7 @@ static void fire_spitter_act_spit_fire(void) {
|
||||
if (scaleStatus < 0) {
|
||||
o->oAction = FIRE_SPITTER_ACT_IDLE;
|
||||
} else {
|
||||
PlaySound2(SOUND_OBJECT_FLAMEBLOWN);
|
||||
PlaySound2(SOUND_OBJ_FLAME_BLOWN);
|
||||
obj_spit_fire(0, 0, 0, 5.0f, MODEL_RED_FLAME_SHADOW, 20.0f, 15.0f, 0x1000);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ void ActionFish0(void) {
|
||||
s32 sp38;
|
||||
s16 model;
|
||||
f32 sp30;
|
||||
u32 *sp2C;
|
||||
struct Animation **sp2C;
|
||||
struct Object *sp28;
|
||||
switch (o->oBehParams2ndByte) {
|
||||
case 0:
|
||||
@@ -116,7 +116,7 @@ void ActionFishGroup2(void) {
|
||||
else
|
||||
sp18 = (s32)(1.0 / (o->oDistanceToMario / 600.0));
|
||||
sp18 *= 127;
|
||||
PlaySound2(SOUND_GENERAL_MOVINGWATER);
|
||||
PlaySound2(SOUND_GENERAL_MOVING_WATER);
|
||||
}
|
||||
if (o->oTimer < LEVEL_SA)
|
||||
func_8029ED98(0, 4.0f);
|
||||
|
||||
@@ -60,7 +60,7 @@ void bhv_flamethrower_loop(void) {
|
||||
o->oFlameThowerUnk110 = sp34;
|
||||
flame = spawn_object_relative(o->oBehParams2ndByte, 0, 0, 0, o, model, bhvFlamethrowerFlame);
|
||||
flame->oForwardVel = flameVel;
|
||||
PlaySound(SOUND_CH6_BLOWWINDORFIRE);
|
||||
PlaySound(SOUND_AIR_BLOW_FIRE);
|
||||
} else if (o->oTimer > 60)
|
||||
o->oAction = 0;
|
||||
}
|
||||
|
||||
@@ -7,12 +7,12 @@ f32 func_802F54F8(void) {
|
||||
|
||||
sp20 = find_water_level(o->oPosX, o->oPosZ);
|
||||
sp1C = find_floor(o->oPosX, o->oPosY, o->oPosZ, &sp24);
|
||||
if (sp20 > sp1C + o->oUnknownUnkFC_F32) {
|
||||
o->oUnknownUnkF4_S32 = 0;
|
||||
return sp20 + o->oUnknownUnkFC_F32;
|
||||
if (sp20 > sp1C + o->oFloatingPlatformUnkFC) {
|
||||
o->oFloatingPlatformUnkF4 = 0;
|
||||
return sp20 + o->oFloatingPlatformUnkFC;
|
||||
} else {
|
||||
o->oUnknownUnkF4_S32 = 1;
|
||||
return sp1C + o->oUnknownUnkFC_F32;
|
||||
o->oFloatingPlatformUnkF4 = 1;
|
||||
return sp1C + o->oFloatingPlatformUnkFC;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,27 +29,27 @@ void func_802F55CC(void) {
|
||||
if (o->oVelY < 0.0f)
|
||||
o->oVelY = 0.0f;
|
||||
|
||||
o->oUnknownUnkF8_F32 += o->oVelY;
|
||||
if (o->oUnknownUnkF8_F32 > 90.0f)
|
||||
o->oUnknownUnkF8_F32 = 90.0f;
|
||||
o->oFloatingPlatformUnkF8 += o->oVelY;
|
||||
if (o->oFloatingPlatformUnkF8 > 90.0f)
|
||||
o->oFloatingPlatformUnkF8 = 90.0f;
|
||||
} else {
|
||||
o->oFaceAnglePitch /= 2;
|
||||
o->oFaceAngleRoll /= 2;
|
||||
o->oUnknownUnkF8_F32 -= 5.0;
|
||||
o->oFloatingPlatformUnkF8 -= 5.0;
|
||||
o->oVelY = 10.0f;
|
||||
if (o->oUnknownUnkF8_F32 < 0.0f)
|
||||
o->oUnknownUnkF8_F32 = 0.0f;
|
||||
if (o->oFloatingPlatformUnkF8 < 0.0f)
|
||||
o->oFloatingPlatformUnkF8 = 0.0f;
|
||||
}
|
||||
|
||||
o->oPosY = o->oHomeY - 64.0f - o->oUnknownUnkF8_F32 + sins(o->oUnknownUnk100_S32 * 0x800) * 10.0f;
|
||||
o->oUnknownUnk100_S32++;
|
||||
if (o->oUnknownUnk100_S32 == 32)
|
||||
o->oUnknownUnk100_S32 = 0;
|
||||
o->oPosY = o->oHomeY - 64.0f - o->oFloatingPlatformUnkF8 + sins(o->oFloatingPlatformUnk100 * 0x800) * 10.0f;
|
||||
o->oFloatingPlatformUnk100++;
|
||||
if (o->oFloatingPlatformUnk100 == 32)
|
||||
o->oFloatingPlatformUnk100 = 0;
|
||||
}
|
||||
|
||||
void bhv_floating_platform_loop(void) {
|
||||
o->oHomeY = func_802F54F8();
|
||||
if (o->oFloatingPlatformUnkFC == 0)
|
||||
if (o->oFloatingPlatformUnkF4 == 0)
|
||||
o->oAction = 0;
|
||||
else
|
||||
o->oAction = 1;
|
||||
|
||||
@@ -149,7 +149,7 @@ static void fly_guy_act_shoot_fire(void) {
|
||||
} else {
|
||||
// We have reached below scale 1.2 in the shrinking portion
|
||||
s16 fireMovePitch = obj_turn_pitch_toward_mario(0.0f, 0);
|
||||
PlaySound2(SOUND_OBJECT_FLAMEBLOWN);
|
||||
PlaySound2(SOUND_OBJ_FLAME_BLOWN);
|
||||
clamp_s16(&fireMovePitch, 0x800, 0x3000);
|
||||
|
||||
obj_spit_fire(
|
||||
@@ -177,7 +177,7 @@ void bhv_fly_guy_update(void) {
|
||||
// PARTIAL_UPDATE (appears in non-roomed levels)
|
||||
|
||||
if (!(o->activeFlags & ACTIVE_FLAG_IN_DIFFERENT_ROOM)) {
|
||||
o->oDeathSound = SOUND_OBJECT_FLYGUYDEATH;
|
||||
o->oDeathSound = SOUND_OBJ_KOOPA_FLYGUY_DEATH;
|
||||
|
||||
obj_scale(o->header.gfx.scale[0]);
|
||||
treat_far_home_as_mario(2000.0f);
|
||||
|
||||
@@ -37,7 +37,7 @@ struct ObjectHitbox sBookSwitchHitbox = {
|
||||
|
||||
void flying_bookend_act_0(void) {
|
||||
if (obj_is_near_to_and_facing_mario(400.0f, 0x3000)) {
|
||||
PlaySound2(SOUND_OBJECT_DEFAULTDEATH);
|
||||
PlaySound2(SOUND_OBJ_DEFAULT_DEATH);
|
||||
o->oAction = 1;
|
||||
o->oBookendUnkF4 = o->oFaceAnglePitch + 0x7FFF;
|
||||
o->oBookendUnkF8 = o->oFaceAngleRoll - 0x7FFF;
|
||||
@@ -99,7 +99,7 @@ void flying_bookend_act_3(void) {
|
||||
|
||||
void bhv_flying_bookend_loop(void) {
|
||||
if (!(o->activeFlags & 0x0008)) {
|
||||
o->oDeathSound = SOUND_OBJECT_POUNDING1;
|
||||
o->oDeathSound = SOUND_OBJ_POUNDING1;
|
||||
obj_scale(o->header.gfx.scale[0]);
|
||||
|
||||
switch (o->oAction) {
|
||||
@@ -135,7 +135,7 @@ void bhv_bookend_spawn_loop(void) {
|
||||
sp1C = spawn_object(o, MODEL_BOOKEND, bhvFlyingBookend);
|
||||
if (sp1C != NULL) {
|
||||
sp1C->oAction = 3;
|
||||
PlaySound2(SOUND_OBJECT_DEFAULTDEATH);
|
||||
PlaySound2(SOUND_OBJ_DEFAULT_DEATH);
|
||||
}
|
||||
o->oTimer = 0;
|
||||
}
|
||||
@@ -252,7 +252,7 @@ void bhv_book_switch_loop(void) {
|
||||
|
||||
o->oAction = 1;
|
||||
if (o->oBookSwitchUnkF4 == 0.0f) {
|
||||
PlaySound2(SOUND_OBJECT_DEFAULTDEATH);
|
||||
PlaySound2(SOUND_OBJ_DEFAULT_DEATH);
|
||||
}
|
||||
|
||||
if (approach_f32_ptr(&o->oBookSwitchUnkF4, 50.0f, 20.0f)) {
|
||||
@@ -269,13 +269,13 @@ void bhv_book_switch_loop(void) {
|
||||
if (approach_f32_ptr(&o->oBookSwitchUnkF4, 0.0f, 20.0f)) {
|
||||
if (o->oAction != 0) {
|
||||
if (o->parentObj->oBookSwitchManagerUnkF4 == o->oBehParams2ndByte) {
|
||||
play_sound(SOUND_CH8_RIGHTANSWER, gDefaultSoundArgs);
|
||||
play_sound(SOUND_GENERAL2_RIGHT_ANSWER, gDefaultSoundArgs);
|
||||
o->parentObj->oBookSwitchManagerUnkF4 += 1;
|
||||
} else {
|
||||
sp36 = RandomU16() & 0x1;
|
||||
sp34 = gMarioObject->oPosZ + 1.5f * gMarioStates[0].vel[2];
|
||||
|
||||
play_sound(SOUND_MENU_CAMERABUZZ, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_CAMERA_BUZZ, gDefaultSoundArgs);
|
||||
if (sp34 > 0) {
|
||||
sp34 = 0;
|
||||
}
|
||||
|
||||
@@ -34,9 +34,9 @@ struct GoombaProperties {
|
||||
* Properties for regular, huge, and tiny goombas.
|
||||
*/
|
||||
static struct GoombaProperties sGoombaProperties[] = {
|
||||
{ 1.5f, SOUND_OBJECT_ENEMYDEATHHIGH, 4000, 1 },
|
||||
{ 3.5f, SOUND_OBJECT_ENEMYDEATHLOW, 4000, 2 },
|
||||
{ 0.5f, SOUND_OBJECT_ENEMYDEATHHIGH, 1500, 0 },
|
||||
{ 1.5f, SOUND_OBJ_ENEMY_DEATH_HIGH, 4000, 1 },
|
||||
{ 3.5f, SOUND_OBJ_ENEMY_DEATH_LOW, 4000, 2 },
|
||||
{ 0.5f, SOUND_OBJ_ENEMY_DEATH_HIGH, 1500, 0 },
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -128,7 +128,7 @@ void bhv_goomba_init(void) {
|
||||
* Enter the jump action and set initial y velocity.
|
||||
*/
|
||||
static void goomba_begin_jump(void) {
|
||||
PlaySound2(SOUND_OBJECT_GOOMBAALERT);
|
||||
PlaySound2(SOUND_OBJ_GOOMBA_ALERT);
|
||||
o->oAction = GOOMBA_ACT_JUMP;
|
||||
o->oForwardVel = 0.0f;
|
||||
o->oVelY = 50.0f / 3.0f * o->oGoombaScale;
|
||||
@@ -160,7 +160,7 @@ static void goomba_act_walk(void) {
|
||||
|
||||
// If walking fast enough, play footstep sounds
|
||||
if (o->oGoombaRelativeSpeed > 4.0f / 3.0f) {
|
||||
func_802F9378(2, 17, SOUND_OBJECT_GOOMBAWALK);
|
||||
func_802F9378(2, 17, SOUND_OBJ_GOOMBA_WALK);
|
||||
}
|
||||
|
||||
//! By strategically hitting a wall, steep slope, or another goomba, we can
|
||||
|
||||
@@ -27,15 +27,15 @@ void bhv_grand_star_loop(void) {
|
||||
if (o->oTimer == 0) {
|
||||
set_object_angle(o, 0, 0, 0);
|
||||
o->oAngleVelYaw = 0x400;
|
||||
PlaySound2(SOUND_CH8_UNK57);
|
||||
PlaySound2(SOUND_GENERAL2_STAR_APPEARS);
|
||||
}
|
||||
if (o->oTimer > 70)
|
||||
o->oAction++;
|
||||
func_802B2328(3, 200, 80, -60);
|
||||
} else if (o->oAction == 1) {
|
||||
if (o->oTimer == 0) {
|
||||
PlaySound2(SOUND_GENERAL_GRANDSTAR);
|
||||
func_8028F9E8(173, o);
|
||||
PlaySound2(SOUND_GENERAL_GRAND_STAR);
|
||||
cutscene_object(CUTSCENE_STAR_SPAWN, o);
|
||||
o->oGrandStarUnk108 = func_802B2894(sp28, &o->oPosX, 80.0f, -2.0f);
|
||||
}
|
||||
obj_move_using_fvel_and_gravity();
|
||||
@@ -45,7 +45,7 @@ void bhv_grand_star_loop(void) {
|
||||
o->oVelY = 60.0f;
|
||||
o->oForwardVel = 0.0f;
|
||||
o->oSubAction++;
|
||||
PlaySound2(SOUND_GENERAL_GRANDSTARJUMP);
|
||||
PlaySound2(SOUND_GENERAL_GRAND_STAR_JUMP);
|
||||
}
|
||||
} else if (o->oVelY < 0.0f && o->oPosY < o->oHomeY + 200.0f) {
|
||||
o->oPosY = o->oHomeY + 200.0f;
|
||||
@@ -54,7 +54,7 @@ void bhv_grand_star_loop(void) {
|
||||
set_mario_npc_dialog(0);
|
||||
o->oAction++;
|
||||
o->oInteractStatus = 0;
|
||||
PlaySound2(SOUND_GENERAL_GRANDSTARJUMP);
|
||||
PlaySound2(SOUND_GENERAL_GRAND_STAR_JUMP);
|
||||
}
|
||||
func_802B2328(3, 200, 80, -60);
|
||||
} else {
|
||||
|
||||
@@ -7,7 +7,7 @@ struct Struct8032FCE8 D_8032FCE8[] = { { 320, MODEL_BOB_BARS_GRILLS, bob_seg7_co
|
||||
|
||||
void bhv_openable_cage_door_loop(void) {
|
||||
if (gCurrentObject->oAction == 0) {
|
||||
if (gCurrentObject->parentObj->oUnknownUnk88 != 0)
|
||||
if (gCurrentObject->parentObj->oOpenableGrillUnk88 != 0)
|
||||
gCurrentObject->oAction++;
|
||||
} else if (gCurrentObject->oAction == 1) {
|
||||
if (gCurrentObject->oTimer < 64)
|
||||
@@ -40,8 +40,8 @@ void bhv_openable_grill_loop(void) {
|
||||
case 2:
|
||||
sp3C = o->oOpenableGrillUnkF4;
|
||||
if (sp3C->oAction == 2) {
|
||||
o->oUnknownUnk88 = 2;
|
||||
PlaySound2(SOUND_GENERAL_CAGEOPEN);
|
||||
o->oOpenableGrillUnk88 = 2;
|
||||
PlaySound2(SOUND_GENERAL_CAGE_OPEN);
|
||||
o->oAction++;
|
||||
if (o->oBehParams2ndByte != 0)
|
||||
play_puzzle_jingle();
|
||||
|
||||
@@ -66,7 +66,7 @@ void haunted_chair_act_0(void) {
|
||||
} else {
|
||||
if ((o->oTimer & 0x8) != 0) {
|
||||
if (o->oFaceAnglePitch < 0) {
|
||||
PlaySound2(SOUND_GENERAL_MOVINGBOOMAYBE);
|
||||
PlaySound2(SOUND_GENERAL_HAUNTED_CHAIR_MOVE);
|
||||
val08 = 4.0f;
|
||||
} else {
|
||||
val08 = -4.0f;
|
||||
@@ -108,13 +108,13 @@ void haunted_chair_act_1(void) {
|
||||
} else {
|
||||
if (o->oHauntedChairUnkF4 != 0) {
|
||||
if (--o->oHauntedChairUnkF4 == 0) {
|
||||
PlaySound2(SOUND_GENERAL_HAUNTEDCHAIR);
|
||||
PlaySound2(SOUND_GENERAL_HAUNTED_CHAIR);
|
||||
o->oMoveAnglePitch = obj_turn_pitch_toward_mario(120.0f, 0);
|
||||
o->oMoveAngleYaw = o->oAngleToMario;
|
||||
obj_compute_vel_from_move_pitch(50.0f);
|
||||
} else if (o->oHauntedChairUnkF4 > 20) {
|
||||
if (gGlobalTimer % 4 == 0) {
|
||||
PlaySound2(SOUND_GENERAL_SWISHAIR_2);
|
||||
PlaySound2(SOUND_GENERAL_SWISH_AIR_2);
|
||||
}
|
||||
o->oFaceAngleYaw += 0x2710;
|
||||
}
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
// heave_ho.c.inc
|
||||
|
||||
s16 D_8032F460[][2] = { { 30, 0 }, { 42, 1 }, { 52, 0 }, { 64, 1 }, { 74, 0 },
|
||||
{ 86, 1 }, { 96, 0 }, { 108, 1 }, { 118, 0 }, { -1, 0 } };
|
||||
{ 86, 1 }, { 96, 0 }, { 108, 1 }, { 118, 0 }, { -1, 0 }, };
|
||||
|
||||
void bhv_heave_ho_throw_mario_loop(void) {
|
||||
o->oParentRelativePosX = 200.0f;
|
||||
o->oParentRelativePosY = -50.0f;
|
||||
o->oParentRelativePosZ = 0.0f;
|
||||
o->oMoveAngleYaw = o->parentObj->oMoveAngleYaw;
|
||||
switch (o->parentObj->oUnknownUnk88) {
|
||||
switch (o->parentObj->oHeaveHoUnk88) {
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
break;
|
||||
case 2:
|
||||
PlaySound2(SOUND_OBJECT_HEAVEHOTOSSED);
|
||||
PlaySound2(SOUND_OBJ_HEAVEHO_TOSSED);
|
||||
gMarioObject->oInteractStatus |= INT_STATUS_MARIO_UNK2;
|
||||
gMarioStates->forwardVel = -45.0f;
|
||||
gMarioStates->vel[1] = 95.0f;
|
||||
o->parentObj->oUnknownUnk88 = 0;
|
||||
o->parentObj->oHeaveHoUnk88 = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -62,7 +62,7 @@ void ActionHeaveHo2(void) {
|
||||
void ActionHeaveHo3(void) {
|
||||
o->oForwardVel = 0.0f;
|
||||
if (o->oTimer == 0)
|
||||
o->oUnknownUnk88 = 2;
|
||||
o->oHeaveHoUnk88 = 2;
|
||||
if (o->oTimer == 1) {
|
||||
func_8029ED98(1, 1.0f);
|
||||
o->numCollidedObjs = 20;
|
||||
@@ -94,12 +94,12 @@ void func_802B18B4(void) {
|
||||
else
|
||||
o->oGraphYOffset = 0.0f;
|
||||
if (o->oForwardVel > 3.0f)
|
||||
PlaySound(SOUND_CH6_HEAVEHOMOVE);
|
||||
PlaySound(SOUND_AIR_HEAVEHO_MOVE);
|
||||
if (o->oAction != 0 && o->oMoveFlags & (0x40 | 0x20 | 0x10 | 0x8))
|
||||
o->oAction = 0;
|
||||
if (o->oInteractStatus & INT_STATUS_GRABBED_MARIO) {
|
||||
o->oInteractStatus = 0;
|
||||
o->oUnknownUnk88 = 1;
|
||||
o->oHeaveHoUnk88 = 1;
|
||||
o->oAction = 3;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,13 +12,13 @@ void bhv_hidden_star_init(void) {
|
||||
o->activeFlags = 0;
|
||||
}
|
||||
|
||||
o->oHiddenStarSecretsCollected = 5 - sp36;
|
||||
o->oHiddenStarTriggerCounter = 5 - sp36;
|
||||
}
|
||||
|
||||
void bhv_hidden_star_loop(void) {
|
||||
switch (o->oAction) {
|
||||
case 0:
|
||||
if (o->oHiddenStarSecretsCollected == 5)
|
||||
if (o->oHiddenStarTriggerCounter == 5)
|
||||
o->oAction = 1;
|
||||
break;
|
||||
|
||||
@@ -38,16 +38,16 @@ void bhv_hidden_star_trigger_loop(void) {
|
||||
if (are_objects_collided(o, gMarioObject) == 1) {
|
||||
hiddenStar = obj_nearest_object_with_behavior(bhvHiddenStar);
|
||||
if (hiddenStar != NULL) {
|
||||
hiddenStar->oHiddenStarSecretsCollected++;
|
||||
if (hiddenStar->oHiddenStarSecretsCollected != 5) {
|
||||
SpawnOrangeNumber(hiddenStar->oHiddenStarSecretsCollected, 0, 0, 0);
|
||||
hiddenStar->oHiddenStarTriggerCounter++;
|
||||
if (hiddenStar->oHiddenStarTriggerCounter != 5) {
|
||||
SpawnOrangeNumber(hiddenStar->oHiddenStarTriggerCounter, 0, 0, 0);
|
||||
}
|
||||
|
||||
#ifdef VERSION_JP
|
||||
play_sound(SOUND_MENU_STARSOUND, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_STAR_SOUND, gDefaultSoundArgs);
|
||||
#else
|
||||
play_sound(SOUND_MENU_COLLECTSECRET
|
||||
+ (((u8) hiddenStar->oHiddenStarSecretsCollected - 1) << 16),
|
||||
play_sound(SOUND_MENU_COLLECT_SECRET
|
||||
+ (((u8) hiddenStar->oHiddenStarTriggerCounter - 1) << 16),
|
||||
gDefaultSoundArgs);
|
||||
#endif
|
||||
}
|
||||
@@ -57,10 +57,10 @@ void bhv_hidden_star_trigger_loop(void) {
|
||||
}
|
||||
|
||||
void bhv_bowser_course_red_coin_star_loop(void) {
|
||||
D_8036008E = o->oBowserCourseRedCoinStarCoinsCollected;
|
||||
gRedCoinsCollected = o->oHiddenStarTriggerCounter;
|
||||
switch (o->oAction) {
|
||||
case 0:
|
||||
if (o->oBowserCourseRedCoinStarCoinsCollected == 8)
|
||||
if (o->oHiddenStarTriggerCounter == 8)
|
||||
o->oAction = 1;
|
||||
break;
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ void HootFreeStep(s16 fastOscY, s32 speed) {
|
||||
}
|
||||
|
||||
if (sp26 == 0)
|
||||
PlaySound2(SOUND_GENERAL_SWISHWATER);
|
||||
PlaySound2(SOUND_GENERAL_SWISH_WATER);
|
||||
}
|
||||
|
||||
void PlayerSetHootYaw(void) {
|
||||
@@ -108,7 +108,7 @@ void HootCarryStep(s32 speed, UNUSED f32 xPrev, UNUSED f32 zPrev) {
|
||||
o->oPosZ += o->oVelZ;
|
||||
|
||||
if (sp22 == 0)
|
||||
PlaySound2(SOUND_GENERAL_SWISHWATER);
|
||||
PlaySound2(SOUND_GENERAL_SWISH_WATER);
|
||||
}
|
||||
|
||||
// sp48 = xPrev
|
||||
@@ -160,7 +160,7 @@ void HootAscentLoop(f32 xPrev, f32 zPrev) {
|
||||
o->oMoveAnglePitch = 0xCE38;
|
||||
|
||||
if (o->oTimer >= 29) {
|
||||
PlaySound(SOUND_ENVIRONMENT_WIND2);
|
||||
PlaySound(SOUND_ENV_WIND2);
|
||||
o->header.gfx.unk38.animFrame = 1;
|
||||
}
|
||||
|
||||
@@ -188,7 +188,7 @@ void HootActionLoop(void) {
|
||||
if (o->oPosY < 2700.0f) {
|
||||
set_time_stop_flags(TIME_STOP_ENABLED | TIME_STOP_MARIO_AND_DOORS);
|
||||
|
||||
if (func_8028F8E0(162, o, 45)) {
|
||||
if (cutscene_object_with_dialog(CUTSCENE_DIALOG_1, o, 45)) {
|
||||
clear_time_stop_flags(TIME_STOP_ENABLED | TIME_STOP_MARIO_AND_DOORS);
|
||||
|
||||
o->oAction = HOOT_ACT_TIRED;
|
||||
@@ -255,7 +255,7 @@ void bhv_hoot_loop(void) {
|
||||
case HOOT_AVAIL_WANTS_TO_TALK:
|
||||
HootAwakeLoop();
|
||||
|
||||
if (set_mario_npc_dialog(2) == 2 && func_8028F8E0(162, o, 44)) {
|
||||
if (set_mario_npc_dialog(2) == 2 && cutscene_object_with_dialog(CUTSCENE_DIALOG_1, o, 44)) {
|
||||
set_mario_npc_dialog(0);
|
||||
|
||||
obj_become_tangible();
|
||||
|
||||
@@ -6,7 +6,7 @@ void bhv_horizontal_grindel_init(void) {
|
||||
void bhv_horizontal_grindel_update(void) {
|
||||
if (o->oMoveFlags & 0x00000003) {
|
||||
if (!o->oHorizontalGrindelOnGround) {
|
||||
PlaySound2(SOUND_OBJECT_THWOMP);
|
||||
PlaySound2(SOUND_OBJ_THWOMP);
|
||||
o->oHorizontalGrindelOnGround = TRUE;
|
||||
func_8027F440(1, o->oPosX, o->oPosY, o->oPosZ);
|
||||
|
||||
@@ -21,7 +21,7 @@ void bhv_horizontal_grindel_update(void) {
|
||||
o->oHorizontalGrindelTargetYaw += 0x8000;
|
||||
o->oHorizontalGrindelDistToHome = 0.0f;
|
||||
} else {
|
||||
PlaySound2(SOUND_OBJECT_KINGBOBOMBJUMP);
|
||||
PlaySound2(SOUND_OBJ_KING_BOBOMB_JUMP);
|
||||
o->oForwardVel = 11.0f;
|
||||
o->oVelY = 70.0f;
|
||||
o->oGravity = -4.0f;
|
||||
|
||||
@@ -49,7 +49,7 @@ void bhv_intro_lakitu_loop(void) {
|
||||
obj_disable_rendering();
|
||||
gCurrentObject->oIntroLakituUnkFC = 0.f;
|
||||
gCurrentObject->oIntroLakituUnkF8 = 0.f;
|
||||
gCurrentObject->oUnk1AC_VPTR =
|
||||
gCurrentObject->oIntroLakituUnk1AC =
|
||||
spawn_object_relative_with_scale(1, 0, 0, 0, 2.f, gCurrentObject, MODEL_MIST, bhvCloud);
|
||||
if (gCurrLevelCamera->cutscene == CUTSCENE_END_WAVING)
|
||||
gCurrentObject->oAction = 100;
|
||||
@@ -65,7 +65,7 @@ void bhv_intro_lakitu_loop(void) {
|
||||
gCurrentObject->oPosZ = gCurrLevelCamera->pos[2];
|
||||
}
|
||||
if (gCutsceneTimer > 52)
|
||||
PlaySound(SOUND_CH6_LAKITUFLY_HIGHPRIO);
|
||||
PlaySound(SOUND_AIR_LAKITU_FLY_HIGHPRIO);
|
||||
if (func_8029ACAC(gCurrentObject, D_8032E3CC, D_8032E2B4) == 1)
|
||||
gCurrentObject->oAction += 1;
|
||||
|
||||
@@ -109,11 +109,11 @@ void bhv_intro_lakitu_loop(void) {
|
||||
gCurrentObject->oFaceAngleYaw = gCurrentObject->oMoveAngleYaw + 0x4000;
|
||||
gCurrentObject->oMoveAnglePitch = 0x800;
|
||||
}
|
||||
PlaySound(SOUND_CH6_LAKITUFLY_HIGHPRIO);
|
||||
PlaySound(SOUND_AIR_LAKITU_FLY_HIGHPRIO);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
PlaySound(SOUND_CH6_LAKITUFLY_HIGHPRIO);
|
||||
PlaySound(SOUND_AIR_LAKITU_FLY_HIGHPRIO);
|
||||
vec3f_set(sp58, -1128.f, 560.f, 4664.f);
|
||||
gCurrentObject->oMoveAngleYaw += 0x200;
|
||||
gCurrentObject->oIntroLakituUnk100 =
|
||||
@@ -145,7 +145,7 @@ void bhv_intro_lakitu_loop(void) {
|
||||
|
||||
if (gCurrentObject->oTimer == TIMER) {
|
||||
mark_object_for_deletion(gCurrentObject);
|
||||
mark_object_for_deletion(gCurrentObject->oUnk1AC_VPTR);
|
||||
mark_object_for_deletion(gCurrentObject->oIntroLakituUnk1AC);
|
||||
}
|
||||
#ifndef VERSION_JP
|
||||
if (gCurrentObject->oTimer == 14)
|
||||
|
||||
@@ -30,7 +30,7 @@ void bhv_ship_part_3_loop(void) {
|
||||
o->oAngleVelPitch = o->oFaceAnglePitch - sp1E;
|
||||
o->oAngleVelRoll = o->oFaceAngleRoll - sp1C;
|
||||
if (gMarioObject->oPosY > 1000.0f)
|
||||
PlaySound(SOUND_ENVIRONMENT_BOATROCKING1);
|
||||
PlaySound(SOUND_ENV_BOAT_ROCKING1);
|
||||
}
|
||||
|
||||
void bhv_jrb_sliding_box_loop(void) {
|
||||
@@ -80,7 +80,7 @@ void bhv_jrb_sliding_box_loop(void) {
|
||||
o->oParentRelativePosZ += o->oJrbSlidingBoxUnkFC;
|
||||
if (gMarioObject->oPosY > 1000.0f)
|
||||
if (absf(o->oJrbSlidingBoxUnkFC) > 3.0f)
|
||||
PlaySound(SOUND_CH6_ROUGHSLIDE);
|
||||
PlaySound(SOUND_AIR_ROUGH_SLIDE);
|
||||
set_object_hitbox(o, &sSkullSlidingBoxHitbox);
|
||||
if (!(o->oJrbSlidingBoxUnkF8 & 0x7FFF))
|
||||
obj_become_tangible();
|
||||
|
||||
@@ -63,7 +63,7 @@ void bhv_jumping_box_loop(void) {
|
||||
break;
|
||||
}
|
||||
if (o->oInteractStatus & INTERACT_HIT_FROM_BELOW) {
|
||||
create_sound_spawner(SOUND_GENERAL_BREAKBOX);
|
||||
create_sound_spawner(SOUND_GENERAL_BREAK_BOX);
|
||||
func_802A3C98(46.0f, 1);
|
||||
}
|
||||
o->oInteractStatus = 0;
|
||||
|
||||
@@ -21,8 +21,8 @@ s32 func_802A9A0C(UNUSED s32 sp18) {
|
||||
}
|
||||
|
||||
void func_802A9B54(void) {
|
||||
o->OBJECT_FIELD_S32(0x1C) = 1600;
|
||||
o->OBJECT_FIELD_S32(0x1B) = 0;
|
||||
o->oKickableBoardF8 = 1600;
|
||||
o->oKickableBoardF4 = 0;
|
||||
}
|
||||
|
||||
void bhv_kickable_board_loop(void) {
|
||||
@@ -39,23 +39,23 @@ void bhv_kickable_board_loop(void) {
|
||||
case 1:
|
||||
o->oFaceAnglePitch = 0;
|
||||
load_object_collision_model();
|
||||
o->oFaceAnglePitch = -sins(o->OBJECT_FIELD_S32(0x1B)) * o->OBJECT_FIELD_S32(0x1C);
|
||||
o->oFaceAnglePitch = -sins(o->oKickableBoardF4) * o->oKickableBoardF8;
|
||||
if (o->oTimer > 30 && (sp24 = func_802A9A0C(0))) {
|
||||
if (gMarioObject->oPosY > o->oPosY + 160.0f && sp24 == 2) {
|
||||
o->oAction++;
|
||||
PlaySound2(SOUND_GENERAL_BUTTONPRESS_2);
|
||||
PlaySound2(SOUND_GENERAL_BUTTON_PRESS_2);
|
||||
} else
|
||||
o->oTimer = 0;
|
||||
}
|
||||
if (o->oTimer != 0) {
|
||||
o->OBJECT_FIELD_S32(0x1C) -= 8;
|
||||
if (o->OBJECT_FIELD_S32(0x1C) < 0)
|
||||
o->oKickableBoardF8 -= 8;
|
||||
if (o->oKickableBoardF8 < 0)
|
||||
o->oAction = 0;
|
||||
} else
|
||||
func_802A9B54();
|
||||
if (!(o->OBJECT_FIELD_S32(0x1B) & 0x7FFF))
|
||||
PlaySound2(SOUND_GENERAL_BUTTONPRESS_2);
|
||||
o->OBJECT_FIELD_S32(0x1B) += 0x400;
|
||||
if (!(o->oKickableBoardF4 & 0x7FFF))
|
||||
PlaySound2(SOUND_GENERAL_BUTTON_PRESS_2);
|
||||
o->oKickableBoardF4 += 0x400;
|
||||
break;
|
||||
case 2:
|
||||
obj_become_intangible();
|
||||
|
||||
@@ -19,7 +19,7 @@ void ActionKingBobomb0(void) {
|
||||
o->oSubAction++;
|
||||
func_8031FFB4(0, 60, 40);
|
||||
}
|
||||
} else if (obj_update_dialog_unk2(2, 1, 162, 17)) {
|
||||
} else if (obj_update_dialog_with_cutscene(2, 1, CUTSCENE_DIALOG_1, 17)) {
|
||||
o->oAction = 2;
|
||||
o->oFlags |= OBJ_FLAG_HOLDABLE;
|
||||
}
|
||||
@@ -34,28 +34,27 @@ int func_802A6AF8(f32 arg0) {
|
||||
|
||||
void ActionKingBobomb2(void) {
|
||||
obj_become_tangible();
|
||||
if (o->oPosY - o->oHomeY < -100.0f) // Thrown off hill
|
||||
{
|
||||
if (o->oPosY - o->oHomeY < -100.0f) { // Thrown off hill
|
||||
o->oAction = 5;
|
||||
obj_become_intangible();
|
||||
}
|
||||
if (o->OBJECT_FIELD_S32(0x1E) == 0) {
|
||||
if (o->oKingBobombUnk100 == 0) {
|
||||
if (obj_check_anim_frame(15))
|
||||
ShakeScreen(1);
|
||||
if (func_802A4AB0(4))
|
||||
o->OBJECT_FIELD_S32(0x1E)++;
|
||||
o->oKingBobombUnk100++;
|
||||
} else {
|
||||
if (o->OBJECT_FIELD_S32(0x1E) == 1) {
|
||||
if (o->oKingBobombUnk100 == 1) {
|
||||
func_802A4A70(11, 7);
|
||||
o->OBJECT_FIELD_S32(0x1E) = 2;
|
||||
o->oKingBobombUnk100 = 2;
|
||||
} else
|
||||
set_obj_animation_and_sound_state(11);
|
||||
if (o->OBJECT_FIELD_S32(0x20) == 0) {
|
||||
if (o->oKingBobombUnk108 == 0) {
|
||||
o->oForwardVel = 3.0f;
|
||||
obj_rotate_yaw_toward(o->oAngleToMario, 0x100);
|
||||
} else {
|
||||
o->oForwardVel = 0.0f;
|
||||
o->OBJECT_FIELD_S32(0x20)--;
|
||||
o->oKingBobombUnk108--;
|
||||
}
|
||||
}
|
||||
if (obj_check_grabbed_mario())
|
||||
@@ -69,10 +68,10 @@ void ActionKingBobomb2(void) {
|
||||
void ActionKingBobomb3(void) {
|
||||
if (o->oSubAction == 0) {
|
||||
o->oForwardVel = 0;
|
||||
o->OBJECT_FIELD_S32(0x1F) = 0;
|
||||
o->OBJECT_FIELD_S32(0x1D) = 0;
|
||||
o->oKingBobombUnk104 = 0;
|
||||
o->oKingBobombUnkFC = 0;
|
||||
if (o->oTimer == 0)
|
||||
PlaySound2(SOUND_OBJECT_UNKNOWN3);
|
||||
PlaySound2(SOUND_OBJ_UNKNOWN3);
|
||||
if (func_802A4AB0(0)) {
|
||||
o->oSubAction++;
|
||||
func_802A4A70(1, 0);
|
||||
@@ -80,26 +79,26 @@ void ActionKingBobomb3(void) {
|
||||
} else {
|
||||
if (o->oSubAction == 1) {
|
||||
set_obj_animation_and_sound_state(1);
|
||||
o->OBJECT_FIELD_S32(0x1D) += player_performed_grab_escape_action();
|
||||
print_debug_bottom_up("%d", o->OBJECT_FIELD_S32(0x1D));
|
||||
if (o->OBJECT_FIELD_S32(0x1D) > 10) {
|
||||
o->oUnknownUnk88 = 3;
|
||||
o->oKingBobombUnkFC += player_performed_grab_escape_action();
|
||||
print_debug_bottom_up("%d", o->oKingBobombUnkFC);
|
||||
if (o->oKingBobombUnkFC > 10) {
|
||||
o->oKingBobombUnk88 = 3;
|
||||
o->oAction = 2;
|
||||
o->OBJECT_FIELD_S32(0x20) = 35;
|
||||
o->oKingBobombUnk108 = 35;
|
||||
o->oInteractStatus &= ~(INT_STATUS_GRABBED_MARIO);
|
||||
} else {
|
||||
o->oForwardVel = 3.0f;
|
||||
if (o->OBJECT_FIELD_S32(0x1F) > 20 && obj_rotate_yaw_toward(0, 0x400)) {
|
||||
if (o->oKingBobombUnk104 > 20 && obj_rotate_yaw_toward(0, 0x400)) {
|
||||
o->oSubAction++;
|
||||
func_802A4A70(9, 22);
|
||||
}
|
||||
}
|
||||
o->OBJECT_FIELD_S32(0x1F)++;
|
||||
o->oKingBobombUnk104++;
|
||||
} else {
|
||||
set_obj_animation_and_sound_state(9);
|
||||
if (obj_check_anim_frame(31)) {
|
||||
o->oUnknownUnk88 = 2;
|
||||
PlaySound2(SOUND_OBJECT_UNKNOWN4);
|
||||
o->oKingBobombUnk88 = 2;
|
||||
PlaySound2(SOUND_OBJ_UNKNOWN4);
|
||||
} else if (func_8029F788()) {
|
||||
o->oAction = 1;
|
||||
o->oInteractStatus &= ~(INT_STATUS_GRABBED_MARIO);
|
||||
@@ -124,17 +123,17 @@ void ActionKingBobomb1(void) {
|
||||
void ActionKingBobomb6(void) {
|
||||
if (o->oSubAction == 0) {
|
||||
if (o->oTimer == 0) {
|
||||
o->OBJECT_FIELD_S32(0x1F) = 0;
|
||||
PlaySound2(SOUND_OBJECT_BULLYTHWOMP);
|
||||
PlaySound2(SOUND_CH9_UNK42);
|
||||
o->oKingBobombUnk104 = 0;
|
||||
PlaySound2(SOUND_OBJ_KING_BOBOMB);
|
||||
PlaySound2(SOUND_OBJ2_KING_BOBOMB_DAMAGE);
|
||||
ShakeScreen(1);
|
||||
func_802AA618(0, 0, 100.0f);
|
||||
o->oInteractType = 8;
|
||||
obj_become_tangible();
|
||||
}
|
||||
if (func_802A4AB0(2))
|
||||
o->OBJECT_FIELD_S32(0x1F)++;
|
||||
if (o->OBJECT_FIELD_S32(0x1F) > 3) {
|
||||
o->oKingBobombUnk104++;
|
||||
if (o->oKingBobombUnk104 > 3) {
|
||||
o->oSubAction++;
|
||||
; // Needed to match
|
||||
}
|
||||
@@ -155,8 +154,8 @@ void ActionKingBobomb6(void) {
|
||||
|
||||
void ActionKingBobomb7(void) {
|
||||
set_obj_animation_and_sound_state(2);
|
||||
if (obj_update_dialog_unk2(2, 2, 162, 116)) {
|
||||
create_sound_spawner(SOUND_OBJECT_KINGWHOMPDEATH);
|
||||
if (obj_update_dialog_with_cutscene(2, 2, CUTSCENE_DIALOG_1, 116)) {
|
||||
create_sound_spawner(SOUND_OBJ_KING_WHOMP_DEATH);
|
||||
obj_hide();
|
||||
obj_become_intangible();
|
||||
func_802AA618(0, 0, 200.0f);
|
||||
@@ -177,15 +176,13 @@ void ActionKingBobomb8(void) {
|
||||
stop_background_music(SEQUENCE_ARGS(4, SEQ_EVENT_BOSS));
|
||||
}
|
||||
|
||||
void ActionKingBobomb4() // bobomb been thrown
|
||||
{
|
||||
if (o->oPosY - o->oHomeY > -100.0f) // not thrown off hill
|
||||
{
|
||||
void ActionKingBobomb4() { // bobomb been thrown
|
||||
if (o->oPosY - o->oHomeY > -100.0f) { // not thrown off hill
|
||||
if (o->oMoveFlags & 1) {
|
||||
o->oHealth--;
|
||||
o->oForwardVel = 0;
|
||||
o->oVelY = 0;
|
||||
PlaySound2(SOUND_OBJECT_BULLYTHWOMP);
|
||||
PlaySound2(SOUND_OBJ_KING_BOBOMB);
|
||||
if (o->oHealth)
|
||||
o->oAction = 6;
|
||||
else
|
||||
@@ -198,7 +195,7 @@ void ActionKingBobomb4() // bobomb been thrown
|
||||
o->oVelY = 0;
|
||||
o->oSubAction++;
|
||||
} else if (o->oMoveFlags & 1)
|
||||
PlaySound2(SOUND_OBJECT_BULLYTHWOMP);
|
||||
PlaySound2(SOUND_OBJ_KING_BOBOMB);
|
||||
} else {
|
||||
if (func_802A4AB0(10))
|
||||
o->oAction = 5; // Go back to top of hill
|
||||
@@ -207,20 +204,18 @@ void ActionKingBobomb4() // bobomb been thrown
|
||||
}
|
||||
}
|
||||
|
||||
void ActionKingBobomb5() // bobomb returns home
|
||||
{
|
||||
void ActionKingBobomb5() { // bobomb returns home
|
||||
switch (o->oSubAction) {
|
||||
case 0:
|
||||
if (o->oTimer == 0)
|
||||
PlaySound2(SOUND_OBJECT_KINGBOBOMBJUMP);
|
||||
o->OBJECT_FIELD_S32(0x1C) = 1;
|
||||
PlaySound2(SOUND_OBJ_KING_BOBOMB_JUMP);
|
||||
o->oKingBobombUnkF8 = 1;
|
||||
func_802A4AEC(8);
|
||||
o->oMoveAngleYaw = obj_angle_to_home();
|
||||
if (o->oPosY < o->oHomeY)
|
||||
o->oVelY = 100.0f;
|
||||
else {
|
||||
func_802B2894(&o->oHomeX, &o->oPosX, 100.0f,
|
||||
-4.0f); // the Vec3fs oHome and oPos are being passed by reference
|
||||
func_802B2894(&o->oHomeX, &o->oPosX, 100.0f, -4.0f);
|
||||
o->oSubAction++;
|
||||
}
|
||||
break;
|
||||
@@ -231,9 +226,9 @@ void ActionKingBobomb5() // bobomb returns home
|
||||
o->oVelY = 0;
|
||||
o->oForwardVel = 0;
|
||||
o->oGravity = -4.0f;
|
||||
o->OBJECT_FIELD_S32(0x1C) = 0;
|
||||
o->oKingBobombUnkF8 = 0;
|
||||
set_obj_animation_and_sound_state(7);
|
||||
PlaySound2(SOUND_OBJECT_BULLYTHWOMP);
|
||||
PlaySound2(SOUND_OBJ_KING_BOBOMB);
|
||||
ShakeScreen(1);
|
||||
o->oSubAction++;
|
||||
}
|
||||
@@ -251,31 +246,34 @@ void ActionKingBobomb5() // bobomb returns home
|
||||
o->oSubAction++;
|
||||
break;
|
||||
case 4:
|
||||
if (obj_update_dialog_unk2(2, 1, 162, 128))
|
||||
if (obj_update_dialog_with_cutscene(2, 1, CUTSCENE_DIALOG_1, 128))
|
||||
o->oAction = 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void (*sKingBobombActions[])(void) = { ActionKingBobomb0, ActionKingBobomb1, ActionKingBobomb2,
|
||||
ActionKingBobomb3, ActionKingBobomb4, ActionKingBobomb5,
|
||||
ActionKingBobomb6, ActionKingBobomb7, ActionKingBobomb8 };
|
||||
struct SoundState sKingBobombSoundStates[] = { { 0, 0, 0, NO_SOUND },
|
||||
{ 1, 1, 20, SOUND_OBJECT_POUNDING1_HIGHPRIO },
|
||||
{ 0, 0, 0, NO_SOUND },
|
||||
{ 0, 0, 0, NO_SOUND },
|
||||
{ 1, 15, -1, SOUND_OBJECT_POUNDING1_HIGHPRIO },
|
||||
{ 0, 0, 0, NO_SOUND },
|
||||
{ 0, 0, 0, NO_SOUND },
|
||||
{ 0, 0, 0, NO_SOUND },
|
||||
{ 0, 0, 0, NO_SOUND },
|
||||
{ 1, 33, -1, SOUND_OBJECT_POUNDING1_HIGHPRIO },
|
||||
{ 0, 0, 0, NO_SOUND },
|
||||
{ 1, 1, 15, SOUND_OBJECT_POUNDING1_HIGHPRIO } };
|
||||
void (*sKingBobombActions[])(void) = {
|
||||
ActionKingBobomb0, ActionKingBobomb1, ActionKingBobomb2, ActionKingBobomb3, ActionKingBobomb4,
|
||||
ActionKingBobomb5, ActionKingBobomb6, ActionKingBobomb7, ActionKingBobomb8,
|
||||
};
|
||||
struct SoundState sKingBobombSoundStates[] = {
|
||||
{ 0, 0, 0, NO_SOUND },
|
||||
{ 1, 1, 20, SOUND_OBJ_POUNDING1_HIGHPRIO },
|
||||
{ 0, 0, 0, NO_SOUND },
|
||||
{ 0, 0, 0, NO_SOUND },
|
||||
{ 1, 15, -1, SOUND_OBJ_POUNDING1_HIGHPRIO },
|
||||
{ 0, 0, 0, NO_SOUND },
|
||||
{ 0, 0, 0, NO_SOUND },
|
||||
{ 0, 0, 0, NO_SOUND },
|
||||
{ 0, 0, 0, NO_SOUND },
|
||||
{ 1, 33, -1, SOUND_OBJ_POUNDING1_HIGHPRIO },
|
||||
{ 0, 0, 0, NO_SOUND },
|
||||
{ 1, 1, 15, SOUND_OBJ_POUNDING1_HIGHPRIO },
|
||||
};
|
||||
|
||||
void func_802A7748(void) {
|
||||
obj_update_floor_and_walls();
|
||||
if (o->OBJECT_FIELD_S32(0x1C) == 0)
|
||||
if (o->oKingBobombUnkF8 == 0)
|
||||
obj_move_standard(-78);
|
||||
else
|
||||
obj_move_using_fvel_and_gravity();
|
||||
|
||||
@@ -30,12 +30,12 @@ static s32 func_8030F158(void) {
|
||||
func_802F932C(5);
|
||||
} else if (o->oSoundStateID == 5) {
|
||||
if (func_802F932C(0)) {
|
||||
PlaySound2(SOUND_GENERAL_SWISHWATER);
|
||||
PlaySound2(SOUND_GENERAL_SWISH_WATER);
|
||||
o->header.gfx.unk38.animFrame = 9;
|
||||
}
|
||||
} else {
|
||||
if (obj_check_anim_frame(9)) {
|
||||
PlaySound2(SOUND_GENERAL_SWISHWATER);
|
||||
PlaySound2(SOUND_GENERAL_SWISH_WATER);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
@@ -50,7 +50,7 @@ static void func_8030F218(void) {
|
||||
} else {
|
||||
if (o->oSoundStateID == 0) {
|
||||
if (obj_check_anim_frame(9)) {
|
||||
PlaySound2(SOUND_GENERAL_SWISHWATER);
|
||||
PlaySound2(SOUND_GENERAL_SWISH_WATER);
|
||||
set_obj_animation_and_sound_state(6);
|
||||
}
|
||||
} else if (--o->oKleptoUnk1AE == 0) {
|
||||
@@ -190,7 +190,7 @@ static void klepto_act_turn_toward_mario(void) {
|
||||
|
||||
if (func_8030F158() && func_8029F828() && o->oKleptoDistanceToTarget > 800.0f
|
||||
&& abs_angle_diff(o->oAngleToMario, o->oFaceAngleYaw) < 0x800 && o->oKleptoUnk1B0 < 0x400) {
|
||||
PlaySound2(SOUND_OBJECT_KLEPTO1);
|
||||
PlaySound2(SOUND_OBJ_KLEPTO1);
|
||||
o->oAction = KLEPTO_ACT_DIVE_AT_MARIO;
|
||||
o->oMoveAngleYaw = o->oFaceAngleYaw;
|
||||
o->oFlags |= 0x00000008;
|
||||
@@ -206,7 +206,7 @@ static void klepto_act_dive_at_mario(void) {
|
||||
approach_f32_ptr(&o->oKleptoSpeed, 60.0f, 10.0f);
|
||||
if (o->oSoundStateID == 2) {
|
||||
if (obj_check_anim_frame(11)) {
|
||||
PlaySound2(SOUND_GENERAL_SWISHWATER);
|
||||
PlaySound2(SOUND_GENERAL_SWISH_WATER);
|
||||
}
|
||||
|
||||
if (func_802F932C(0)) {
|
||||
@@ -355,7 +355,7 @@ void bhv_klepto_update(void) {
|
||||
}
|
||||
|
||||
if (obj_handle_attacks(&sKleptoHitbox, o->oAction, sKleptoAttackHandlers)) {
|
||||
PlaySound2(SOUND_OBJECT_KLEPTO2);
|
||||
PlaySound2(SOUND_OBJ_KLEPTO2);
|
||||
|
||||
if (o->oAnimState == KLEPTO_ANIM_STATE_HOLDING_CAP) {
|
||||
save_file_clear_flags(SAVE_FLAG_CAP_ON_KLEPTO);
|
||||
|
||||
@@ -92,9 +92,9 @@ void bhv_koopa_init(void) {
|
||||
static void koopa_play_footstep_sound(s8 animFrame1, s8 animFrame2) {
|
||||
s32 sound;
|
||||
if (o->header.gfx.scale[0] > 1.5f) {
|
||||
sound = SOUND_OBJECT_UNK50342081;
|
||||
sound = SOUND_OBJ_KOOPA_THE_QUICK_WALK;
|
||||
} else {
|
||||
sound = SOUND_OBJECT_UNK50350081;
|
||||
sound = SOUND_OBJ_KOOPA_WALK;
|
||||
}
|
||||
|
||||
func_802F9378(animFrame1, animFrame2, sound);
|
||||
@@ -257,7 +257,7 @@ static void koopa_shelled_act_lying(void) {
|
||||
*/
|
||||
void shelled_koopa_attack_handler(s32 attackType) {
|
||||
if (o->header.gfx.scale[0] > 0.8f) {
|
||||
PlaySound2(SOUND_OBJECT_KOOPADAMAGE);
|
||||
PlaySound2(SOUND_OBJ_KOOPA_DAMAGE);
|
||||
|
||||
o->oKoopaMovementType = KOOPA_BP_UNSHELLED;
|
||||
o->oAction = KOOPA_UNSHELLED_ACT_LYING;
|
||||
@@ -470,7 +470,7 @@ static void koopa_unshelled_update(void) {
|
||||
*/
|
||||
s32 obj_begin_race(s32 noTimer) {
|
||||
if (o->oTimer == 50) {
|
||||
PlaySound2(SOUND_GENERAL_RACEGUNSHOT);
|
||||
PlaySound2(SOUND_GENERAL_RACE_GUN_SHOT);
|
||||
|
||||
if (!noTimer) {
|
||||
play_music(0, SEQUENCE_ARGS(4, SEQ_LEVEL_SLIDE), 0);
|
||||
@@ -503,7 +503,7 @@ static void koopa_the_quick_act_wait_before_race(void) {
|
||||
//! The next action doesn't execute until next frame, giving mario one
|
||||
// frame where he can jump, and thus no longer be ready to speak.
|
||||
// (On J, he has two frames and doing this enables time stop - see
|
||||
// obj_update_dialog_unk2 for that glitch)
|
||||
// obj_update_dialog_with_cutscene for that glitch)
|
||||
o->oAction = KOOPA_THE_QUICK_ACT_SHOW_INIT_TEXT;
|
||||
o->oForwardVel = 0.0f;
|
||||
set_obj_animation_and_sound_state(7);
|
||||
@@ -731,7 +731,7 @@ static void koopa_the_quick_act_after_race(void) {
|
||||
o->oFlags &= ~OBJ_FLAG_ACTIVE_FROM_AFAR;
|
||||
}
|
||||
} else if (o->parentObj->oKoopaRaceEndpointUnk100 > 0) {
|
||||
s32 dialogResponse = obj_update_dialog_unk2(2, 1, 0xA2, o->parentObj->oKoopaRaceEndpointUnk100);
|
||||
s32 dialogResponse = obj_update_dialog_with_cutscene(2, 1, CUTSCENE_DIALOG_1, o->parentObj->oKoopaRaceEndpointUnk100);
|
||||
if (dialogResponse != 0) {
|
||||
o->parentObj->oKoopaRaceEndpointUnk100 = -1;
|
||||
o->oTimer = 0;
|
||||
@@ -789,7 +789,7 @@ static void koopa_the_quick_update(void) {
|
||||
*/
|
||||
void bhv_koopa_update(void) {
|
||||
// PARTIAL_UPDATE
|
||||
o->oDeathSound = SOUND_OBJECT_KOOPADEATH;
|
||||
o->oDeathSound = SOUND_OBJ_KOOPA_FLYGUY_DEATH;
|
||||
|
||||
if (o->oKoopaMovementType >= KOOPA_BP_KOOPA_THE_QUICK_BASE) {
|
||||
koopa_the_quick_update();
|
||||
|
||||
@@ -21,5 +21,5 @@ void func_802BBFDC(void) {
|
||||
size = RandomFloat() * 6.0 + 3.0;
|
||||
scale_object_xyz(sp1C, size, size, size);
|
||||
if (RandomFloat() < 0.1)
|
||||
PlaySound2(SOUND_GENERAL_EXPLOSION2);
|
||||
PlaySound2(SOUND_GENERAL_VOLCANO_EXPLOSION);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user