From 3844bf3c12db20a8aace9140e73d56c6e7abdc5c Mon Sep 17 00:00:00 2001 From: zeromus Date: Thu, 31 Dec 2015 12:52:09 -0600 Subject: [PATCH] NSF player: limit track number to legal range and print current track number to console --- .../Consoles/Nintendo/NES/Boards/NSFBoard.cs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/NSFBoard.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/NSFBoard.cs index 4816614864..a3bf9dc415 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/NSFBoard.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/NSFBoard.cs @@ -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)