Fixed vanilla sounds on 32-bit

This commit is contained in:
MysterD 2023-06-24 13:48:44 -07:00
parent 243bddf634
commit 09a50f7b58
4 changed files with 22 additions and 6 deletions

View File

@ -175,6 +175,9 @@ else
EXTRA_CPP_INCLUDES ?= EXTRA_CPP_INCLUDES ?=
endif endif
ifeq ($(TARGET_BITS), 32)
DEFINES += BITS_32=1
endif
# VERSION - selects the version of the game to build # VERSION - selects the version of the game to build
# jp - builds the 1996 Japanese version # jp - builds the 1996 Japanese version

View File

@ -91,7 +91,11 @@
.macro seq_initchannels_extended a .macro seq_initchannels_extended a
.byte 0xc1 .byte 0xc1
.byte (\a >> 56) & 0xff, (\a >> 48) & 0xff, (\a >> 40) & 0xff, (\a >> 32) & 0xff, (\a >> 24) & 0xff, (\a >> 16) & 0xff, (\a >> 8) & 0xff, \a & 0xff .ifdef BITS_32
.byte 0, 0, 0, 0, (\a >> 24) & 0xff, (\a >> 16) & 0xff, (\a >> 8) & 0xff, \a & 0xff
.else
.byte (\a >> 56) & 0xff, (\a >> 48) & 0xff, (\a >> 40) & 0xff, (\a >> 32) & 0xff, (\a >> 24) & 0xff, (\a >> 16) & 0xff, (\a >> 8) & 0xff, \a & 0xff
.endif
.endm .endm
.macro seq_changevol a .macro seq_changevol a

View File

@ -18,7 +18,12 @@ seq_setmutescale 0
seq_setvol 127 seq_setvol 127
.endif .endif
seq_settempo 120 seq_settempo 120
seq_initchannels_extended 0xffffffffffffffff
.ifdef BITS_32
seq_initchannels_extended 0xb33f
.else
seq_initchannels_extended 0xffffffffffffffff
.endif
# SOUND_BANK_ACTION # SOUND_BANK_ACTION
seq_startchannel_extended 0, .channel0 seq_startchannel_extended 0, .channel0

View File

@ -532,10 +532,11 @@ s32 m64_read_s32(struct M64ScriptState* state) {
assert(state != NULL); assert(state != NULL);
assert(state->pc != NULL); assert(state->pc != NULL);
#endif #endif
s32 ret = *(state->pc++) << 24; s32 ret = 0;
ret = (*(state->pc++) << 16) | ret; ret = (((u32)*(state->pc++) << 24)) | ret;
ret = (*(state->pc++) << 8) | ret; ret = (((u32)*(state->pc++) << 16)) | ret;
ret = *(state->pc++) | ret; ret = (((u32)*(state->pc++) << 8)) | ret;
ret = (((u32)*(state->pc++) << 0)) | ret;
return ret; return ret;
} }
@ -2750,6 +2751,9 @@ void sequence_player_process_sequence(struct SequencePlayer *seqPlayer) {
case 0xc1: // seq_initchannels_extended case 0xc1: // seq_initchannels_extended
u64v = m64_read_s64(state); u64v = m64_read_s64(state);
#ifdef BITS_32
if (u64v == 0xb33f) { u64v = 0xffffffffffffffff; }
#endif
sequence_player_init_channels_extended(seqPlayer, u64v); sequence_player_init_channels_extended(seqPlayer, u64v);
break; break;