NSF player: limit track number to legal range and print current track number to console

This commit is contained in:
zeromus 2015-12-31 12:52:09 -06:00
parent 2765961984
commit 3844bf3c12
1 changed files with 12 additions and 5 deletions

View File

@ -125,12 +125,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
Buffer.BlockCopy(nsf.NSFData, 0x80, FakePRG, load_start, load_size);
}
ReplayInit();
CurrentSong = nsf.StartingSong;
ReplayInit();
}
void ReplayInit()
{
Console.WriteLine("NSF: Playing track {0}/{1}", CurrentSong, nsf.TotalSongs-1);
InitPending = true;
Patch_Vectors = true;
}
@ -330,13 +331,19 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
bool reset = false;
if (right)
{
CurrentSong++;
reset = true;
if (CurrentSong < nsf.TotalSongs - 1)
{
CurrentSong++;
reset = true;
}
}
if (left)
{
CurrentSong--;
reset = true;
if (CurrentSong > 0)
{
CurrentSong--;
reset = true;
}
}
if (a)