*little fix to ignore case sensitivity on searching files on the WiiDisc (Thanks to LoudBob11 for pointing it out)

*Added new options for BannerSounds (You can loop them, make it be quite after once played or play the BGM again)

NOTE: Changed the way how to disable BannerSounds. If you make Volume to 0 than the loading of the BannerSounds is disabled now.
This commit is contained in:
dimok321 2009-11-10 18:43:56 +00:00
parent 781d204691
commit ef956c430a
5 changed files with 26 additions and 15 deletions

File diff suppressed because one or more lines are too long

View File

@ -70,12 +70,12 @@ static char *u8Filename(const U8Entry *fst, int i)
inline u32 le32(u32 i) inline u32 le32(u32 i)
{ {
return ((i & 0xFF) << 24) | ((i & 0xFF00) << 8) | ((i & 0xFF0000) >> 8) | ((i & 0xFF000000) >> 24); return ((i & 0xFF) << 24) | ((i & 0xFF00) << 8) | ((i & 0xFF0000) >> 8) | ((i & 0xFF000000) >> 24);
} }
inline u16 le16(u16 i) inline u16 le16(u16 i)
{ {
return ((i & 0xFF) << 8) | ((i & 0xFF00) >> 8); return ((i & 0xFF) << 8) | ((i & 0xFF00) >> 8);
} }
static u8 *uncompressLZ77(const u8 *inBuf, u32 inLength, u32 &size) static u8 *uncompressLZ77(const u8 *inBuf, u32 inLength, u32 &size)
@ -90,10 +90,10 @@ static u8 *uncompressLZ77(const u8 *inBuf, u32 inLength, u32 &size)
buffer = new(std::nothrow) u8[uncSize]; buffer = new(std::nothrow) u8[uncSize];
if (!buffer) if (!buffer)
return buffer; return buffer;
u8 *bufCur = buffer; u8 *bufCur = buffer;
u8 *bufEnd = buffer + uncSize; u8 *bufEnd = buffer + uncSize;
while (bufCur < bufEnd && inBuf < inBufEnd) while (bufCur < bufEnd && inBuf < inBufEnd)
{ {
u8 flags = *inBuf; u8 flags = *inBuf;
@ -170,7 +170,8 @@ const u8 *LoadBannerSound(const u8 *discid, u32 *size)
break; break;
if (i >= fst[0].numEntries) if (i >= fst[0].numEntries)
{ {
WindowPrompt(tr("sound.bin not found."), 0, tr("OK")); /* Not all games have a sound.bin and this message is annoying **/
//WindowPrompt(tr("sound.bin not found."), 0, tr("OK"));
free(opening_bnr); free(opening_bnr);
return NULL; return NULL;
} }

View File

@ -122,7 +122,7 @@ static u32 do_fst(wiidisc_t *d,u8 *fst, const char *names, u32 i)
return size; return size;
} else { } else {
offset = _be32(fst + 12*i + 4); offset = _be32(fst + 12*i + 4);
if(d->extract_pathname && strcmp(name, d->extract_pathname)==0) if(d->extract_pathname && stricmp(name, d->extract_pathname)==0)
{ {
d->extracted_buffer = wbfs_ioalloc(size); d->extracted_buffer = wbfs_ioalloc(size);
partition_read(d,offset, d->extracted_buffer, size,0); partition_read(d,offset, d->extracted_buffer, size,0);

View File

@ -1234,7 +1234,7 @@ int GameWindowPrompt() {
//load disc image based or what game is seleted //load disc image based or what game is seleted
struct discHdr * header = (mountMethod==1||mountMethod==2?dvdheader:&gameList[gameSelected]); struct discHdr * header = (mountMethod==1||mountMethod==2?dvdheader:&gameList[gameSelected]);
if(Settings.gamesound) if(Settings.gamesoundvolume > 0)
{ {
if(gameSound) if(gameSound)
{ {
@ -1248,6 +1248,8 @@ int GameWindowPrompt() {
{ {
gameSound = new GuiSound(gameSoundData, gameSoundDataLen, Settings.gamesoundvolume, false, true); gameSound = new GuiSound(gameSoundData, gameSoundDataLen, Settings.gamesoundvolume, false, true);
bgMusic->SetVolume(0); bgMusic->SetVolume(0);
if(Settings.gamesound == 2)
gameSound->SetLoop(1);
gameSound->Play(); gameSound->Play();
} }
} }
@ -1383,7 +1385,10 @@ int GameWindowPrompt() {
if(gameSound) if(gameSound)
{ {
if(!gameSound->IsPlaying()) if(!gameSound->IsPlaying())
bgMusic->SetVolume(Settings.volume); {
if(Settings.gamesound == 1)
bgMusic->SetVolume(Settings.volume);
}
} }
if (btn1.GetState() == STATE_CLICKED) { if (btn1.GetState() == STATE_CLICKED) {

View File

@ -1304,18 +1304,20 @@ int MenuSettings()
if(ret == ++Idx || firstRun) if(ret == ++Idx || firstRun)
{ {
if(firstRun) options2.SetName(Idx, "%s",tr("Game (Banner) Sounds")); if(firstRun) options2.SetName(Idx, "%s",tr("Game Sound Mode"));
if(ret == Idx) if(ret == Idx)
{ {
Settings.gamesound++; Settings.gamesound++;
if (Settings.gamesound > 1) if (Settings.gamesound > 2)
Settings.gamesound = 0; Settings.gamesound = 0;
} }
if(Settings.gamesound == 1) if(Settings.gamesound == 1)
options2.SetValue(Idx,"%s", tr("ON")); options2.SetValue(Idx,"%s", tr("Sound+BGM"));
else if(Settings.gamesound == 2)
options2.SetValue(Idx,"%s", tr("Loop Sound"));
else else
options2.SetValue(Idx,"%s", tr("OFF")); options2.SetValue(Idx,"%s", tr("Sound+Quiet"));
} }
if(ret == ++Idx || firstRun) if(ret == ++Idx || firstRun)
@ -1328,7 +1330,10 @@ int MenuSettings()
Settings.gamesoundvolume = 0; Settings.gamesoundvolume = 0;
} }
options2.SetValue(Idx,"%i", Settings.gamesoundvolume); if (Settings.gamesoundvolume > 0)
options2.SetValue(Idx,"%i", Settings.gamesoundvolume);
else
options2.SetValue(Idx,"%s", tr("OFF"));
} }
firstRun = false; firstRun = false;