format fix

This commit is contained in:
raven02 2014-12-29 06:53:31 +08:00
parent 19e1631697
commit 85d23e2c32
1 changed files with 19 additions and 31 deletions

View File

@ -87,8 +87,6 @@ void Emulator::Init()
m_modules_init[0]->Init(); m_modules_init[0]->Init();
m_modules_init.erase(m_modules_init.begin()); m_modules_init.erase(m_modules_init.begin());
} }
//if(m_memory_viewer) m_memory_viewer->Close();
//m_memory_viewer = new MemoryViewerPanel(wxGetApp().m_MainFrame);
} }
void Emulator::SetPath(const std::string& path, const std::string& elf_path) void Emulator::SetPath(const std::string& path, const std::string& elf_path)
@ -141,7 +139,7 @@ void Emulator::CheckStatus()
//if (IsAllStoped) //if (IsAllStoped)
//{ //{
// //ConLog.Warning("all stoped!"); // //LOG_WARNING(GENERAL, "all stoped!");
// Pause(); //Stop(); // Pause(); //Stop();
//} //}
} }
@ -222,7 +220,7 @@ void Emulator::Load()
LOG_NOTICE(LOADER, "%s -> %s", GetVFS().m_devices[i]->GetPs3Path().c_str(), GetVFS().m_devices[i]->GetLocalPath().c_str()); LOG_NOTICE(LOADER, "%s -> %s", GetVFS().m_devices[i]->GetPs3Path().c_str(), GetVFS().m_devices[i]->GetLocalPath().c_str());
} }
LOG_NOTICE(LOADER, " ");//used to be skip_line LOG_NOTICE(LOADER, " "); //used to be skip_line
vfsFile sfo("/app_home/../PARAM.SFO"); vfsFile sfo("/app_home/../PARAM.SFO");
PSFLoader psf(sfo); PSFLoader psf(sfo);
psf.Load(false); psf.Load(false);
@ -246,16 +244,16 @@ void Emulator::Load()
Emu.GetVFS().Mount("/dev_bdvd/", bdvd, new vfsDeviceLocalFile()); Emu.GetVFS().Mount("/dev_bdvd/", bdvd, new vfsDeviceLocalFile());
LOG_NOTICE(LOADER, "/dev_bdvd/ remounted into %s", bdvd.c_str()); LOG_NOTICE(LOADER, "/dev_bdvd/ remounted into %s", bdvd.c_str());
} }
LOG_NOTICE(LOADER, " ");//used to be skip_line LOG_NOTICE(LOADER, " "); //used to be skip_line
if(m_elf_path.empty()) if (m_elf_path.empty())
{ {
GetVFS().GetDeviceLocal(m_path, m_elf_path); GetVFS().GetDeviceLocal(m_path, m_elf_path);
} }
vfsFile f(m_elf_path); vfsFile f(m_elf_path);
if(!f.IsOpened()) if (!f.IsOpened())
{ {
LOG_ERROR(LOADER, "Elf not found! (%s - %s)", m_path.c_str(), m_elf_path.c_str()); LOG_ERROR(LOADER, "Elf not found! (%s - %s)", m_path.c_str(), m_elf_path.c_str());
return; return;
@ -299,37 +297,31 @@ void Emulator::Load()
void Emulator::Run() void Emulator::Run()
{ {
if(!IsReady()) if (!IsReady())
{ {
Load(); Load();
if(!IsReady()) return; if(!IsReady()) return;
} }
if(IsRunning()) Stop(); if (IsRunning()) Stop();
if(IsPaused())
if (IsPaused())
{ {
Resume(); Resume();
return; return;
} }
SendDbgCommand(DID_START_EMU); SendDbgCommand(DID_START_EMU);
//ConLog.Write("run...");
m_status = Running; m_status = Running;
//if(m_memory_viewer && m_memory_viewer->exit) safe_delete(m_memory_viewer);
//m_memory_viewer->SetPC(loader.GetEntry());
//m_memory_viewer->Show();
//m_memory_viewer->ShowPC();
GetCPU().Exec(); GetCPU().Exec();
SendDbgCommand(DID_STARTED_EMU); SendDbgCommand(DID_STARTED_EMU);
} }
void Emulator::Pause() void Emulator::Pause()
{ {
if(!IsRunning()) return; if (!IsRunning()) return;
//ConLog.Write("pause...");
SendDbgCommand(DID_PAUSE_EMU); SendDbgCommand(DID_PAUSE_EMU);
if (InterlockedCompareExchange((volatile u32*)&m_status, Paused, Running) == Running) if (InterlockedCompareExchange((volatile u32*)&m_status, Paused, Running) == Running)
@ -340,21 +332,19 @@ void Emulator::Pause()
void Emulator::Resume() void Emulator::Resume()
{ {
if(!IsPaused()) return; if (!IsPaused()) return;
//ConLog.Write("resume...");
SendDbgCommand(DID_RESUME_EMU); SendDbgCommand(DID_RESUME_EMU);
m_status = Running; m_status = Running;
CheckStatus(); CheckStatus();
//if(IsRunning() && Ini.CPUDecoderMode.GetValue() != 1) GetCPU().Exec();
SendDbgCommand(DID_RESUMED_EMU); SendDbgCommand(DID_RESUMED_EMU);
} }
void Emulator::Stop() void Emulator::Stop()
{ {
if(IsStopped()) return; if(IsStopped()) return;
//ConLog.Write("shutdown...");
SendDbgCommand(DID_STOP_EMU); SendDbgCommand(DID_STOP_EMU);
m_status = Stopped; m_status = Stopped;
@ -396,7 +386,6 @@ void Emulator::Stop()
CurGameInfo.Reset(); CurGameInfo.Reset();
Memory.Close(); Memory.Close();
//if(m_memory_viewer && m_memory_viewer->IsShown()) m_memory_viewer->Hide();
SendDbgCommand(DID_STOPPED_EMU); SendDbgCommand(DID_STOPPED_EMU);
} }
@ -409,12 +398,12 @@ void Emulator::SavePoints(const std::string& path)
f << bpdb_version << break_count << marked_count; f << bpdb_version << break_count << marked_count;
if(break_count) if (break_count)
{ {
f.write(reinterpret_cast<char*>(&m_break_points[0]), sizeof(u64) * break_count); f.write(reinterpret_cast<char*>(&m_break_points[0]), sizeof(u64) * break_count);
} }
if(marked_count) if (marked_count)
{ {
f.write(reinterpret_cast<char*>(&m_marked_points[0]), sizeof(u64) * marked_count); f.write(reinterpret_cast<char*>(&m_marked_points[0]), sizeof(u64) * marked_count);
} }
@ -435,20 +424,19 @@ void Emulator::LoadPoints(const std::string& path)
u16 version; u16 version;
f >> version >> break_count >> marked_count; f >> version >> break_count >> marked_count;
if(version != bpdb_version || if (version != bpdb_version || (sizeof(u16) + break_count * sizeof(u64) + sizeof(u32) + marked_count * sizeof(u64) + sizeof(u32)) != length)
(sizeof(u16) + break_count * sizeof(u64) + sizeof(u32) + marked_count * sizeof(u64) + sizeof(u32)) != length)
{ {
LOG_ERROR(LOADER, "'%s' is broken", path.c_str()); LOG_ERROR(LOADER, "'%s' is broken", path.c_str());
return; return;
} }
if(break_count > 0) if (break_count > 0)
{ {
m_break_points.resize(break_count); m_break_points.resize(break_count);
f.read(reinterpret_cast<char*>(&m_break_points[0]), sizeof(u64) * break_count); f.read(reinterpret_cast<char*>(&m_break_points[0]), sizeof(u64) * break_count);
} }
if(marked_count > 0) if (marked_count > 0)
{ {
m_marked_points.resize(marked_count); m_marked_points.resize(marked_count);
f.read(reinterpret_cast<char*>(&m_marked_points[0]), sizeof(u64) * marked_count); f.read(reinterpret_cast<char*>(&m_marked_points[0]), sizeof(u64) * marked_count);