Hi,
I’ve been trying some games that I heard of either directly or
indirectly from this list, specifically:
defendguin (http://www.newbreedsoftware.com/defendguin/)
njam (http://njam.sourceforge.net/)
I’ve e-mailed both the authors privately and they weren’t sure what to
make of this issue either, so I thought I’d try my question here.
Basically, it sounds like the endianness is not being corrected for mod
music. The wav sounds in both games play fine, and audio isn’t garbled
if I disable the music in both games.
Looking at the source I see:
defendguin.c: if (Mix_OpenAudio(22050, AUDIO_S16, 2, 512) < 0)
njam.cpp: if(Mix_OpenAudio(44100, MIX_DEFAULT_FORMAT, 1, 1024)==-1)
And in music.c from SDL_mixer I see the following for MOD_MUSIC:
case AUDIO_S16LSB:
case AUDIO_S16MSB: {
/* See if we need to correct MikMod mixing */
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
if ( mixer->format == AUDIO_S16MSB ) {
#else
if ( mixer->format == AUDIO_S16LSB ) {
#endif
music_swap16 = 1;
}
md_mode = DMODE_16BITS;
}
defendguin uses AUDIO_S16. AUDIO_S16 defined as AUDIO_S16LSB. since the
machine is actually AUDIO_S16MSB, the mod will be bitswapped?
njam uses MIX_DEFAULT_FORMAT. MIX_DEFAULT_FORMAT is AUDIO_S16MSB on
bigendian machines. since the mixer format will be AUDIO_S16MSB and the
audio format is AUDIO_S16MSB, the mod won’t be bitswapped?
How can different mixer formats yield the same results?
My environment is:
OpenBSD turing.no.tld 3.3 GENERIC#19 sparc64
gcc version 2.95.3 20010125 (prerelease, propolice)
SDL 1.2.5 w/sun audio driver
SDL_mixer 1.2.5 w/mikmod 3.1.10
rocks`n’diamonds (http://www.artsoft.org/rocksndiamonds/) mixes wavs and
mods just fine on my sparc64, and I can’t seem to figure out why.
And of course, music sounds okay when defendguin & njam are played on
my i386 machine which has the same environment as my sparc64.
I’m pretty sure I’m misunderstanding something. Anyone care to
straighten me out?