Debugger: Fixed scanline number being wrong in trace log in some cases

This commit is contained in:
Souryo 2017-07-01 15:38:18 -04:00
parent 23ccf25915
commit 97323f3eb0
6 changed files with 4 additions and 10 deletions

View file

@ -132,7 +132,7 @@ void BaseRenderer::ShowGameTimer(int lineNumber)
{
int yPos = 13 + 24 * lineNumber;
double frameCount = PPU::GetFrameCount();
double frameRate = Console::GetNesModel() == NesModel::NTSC ? 60.098811862348404716732985230828 : 50.006977968268290848936010226333;
double frameRate = Console::GetModel() == NesModel::NTSC ? 60.098811862348404716732985230828 : 50.006977968268290848936010226333;
//uint32_t milliseconds = (uint32_t)(frameCount / 60.1 * 1000) % 1000;
uint32_t seconds = (uint32_t)(frameCount / frameRate) % 60;
uint32_t minutes = (uint32_t)(frameCount / frameRate / 60) % 60;

View file

@ -610,11 +610,6 @@ void Console::RequestReset()
Instance->_resetRequested = true;
}
NesModel Console::GetNesModel()
{
return Instance->_model;
}
uint32_t Console::GetLagCounter()
{
return Instance->_lagCounter;

View file

@ -82,7 +82,6 @@ class Console
std::shared_ptr<Debugger> GetDebugger(bool autoStart = true);
void StopDebugger();
static NesModel GetNesModel();
static void SaveState(ostream &saveStream);
static void LoadState(istream &loadStream);
static void LoadState(uint8_t *buffer, uint32_t bufferSize);

View file

@ -284,7 +284,7 @@ void ControlManager::StreamState(bool saving)
bool hasFourScore = false;
bool useNes101Hvc101Behavior = false;
if(saving) {
nesModel = Console::GetNesModel();
nesModel = Console::GetModel();
expansionDevice = EmulationSettings::GetExpansionDevice();
consoleType = EmulationSettings::GetConsoleType();
hasFourScore = EmulationSettings::CheckFlag(EmulationFlags::HasFourScore);

View file

@ -175,7 +175,7 @@ bool MesenMovie::Save()
header.MovieFormatVersion = MesenMovie::MovieFormatVersion;
header.SaveStateFormatVersion = SaveStateManager::FileFormatVersion;
header.RomCrc32 = Console::GetCrc32();
header.Region = (uint32_t)Console::GetNesModel();
header.Region = (uint32_t)Console::GetModel();
header.ConsoleType = (uint32_t)EmulationSettings::GetConsoleType();
header.ExpansionDevice = (uint32_t)EmulationSettings::GetExpansionDevice();
header.OverclockRate = (uint32_t)EmulationSettings::GetOverclockRate();

View file

@ -99,7 +99,7 @@ void TraceLogger::GetTraceRow(string &output, State &cpuState, PPUDebugState &pp
ppuCycle = 341 + ppuCycle;
scanline--;
if(scanline < -1) {
scanline = EmulationSettings::GetNesModel() == NesModel::NTSC ? 260 : 310;
scanline = Console::GetModel() == NesModel::NTSC ? 260 : 310;
}
}