From 85d23e2c3258acc4a5cc9154619031fe43276c00 Mon Sep 17 00:00:00 2001 From: raven02 Date: Mon, 29 Dec 2014 06:53:31 +0800 Subject: [PATCH] format fix --- rpcs3/Emu/System.cpp | 50 +++++++++++++++++--------------------------- 1 file changed, 19 insertions(+), 31 deletions(-) diff --git a/rpcs3/Emu/System.cpp b/rpcs3/Emu/System.cpp index eb71c23467..9e9da63152 100644 --- a/rpcs3/Emu/System.cpp +++ b/rpcs3/Emu/System.cpp @@ -87,8 +87,6 @@ void Emulator::Init() m_modules_init[0]->Init(); 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) @@ -141,7 +139,7 @@ void Emulator::CheckStatus() //if (IsAllStoped) //{ - // //ConLog.Warning("all stoped!"); + // //LOG_WARNING(GENERAL, "all stoped!"); // 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, " ");//used to be skip_line + LOG_NOTICE(LOADER, " "); //used to be skip_line vfsFile sfo("/app_home/../PARAM.SFO"); PSFLoader psf(sfo); psf.Load(false); @@ -246,16 +244,16 @@ void Emulator::Load() Emu.GetVFS().Mount("/dev_bdvd/", bdvd, new vfsDeviceLocalFile()); 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); } 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()); return; @@ -299,37 +297,31 @@ void Emulator::Load() void Emulator::Run() { - if(!IsReady()) + if (!IsReady()) { Load(); if(!IsReady()) return; } - if(IsRunning()) Stop(); - if(IsPaused()) + if (IsRunning()) Stop(); + + if (IsPaused()) { Resume(); return; } + SendDbgCommand(DID_START_EMU); - //ConLog.Write("run..."); 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(); SendDbgCommand(DID_STARTED_EMU); } void Emulator::Pause() { - if(!IsRunning()) return; - //ConLog.Write("pause..."); + if (!IsRunning()) return; SendDbgCommand(DID_PAUSE_EMU); if (InterlockedCompareExchange((volatile u32*)&m_status, Paused, Running) == Running) @@ -340,21 +332,19 @@ void Emulator::Pause() void Emulator::Resume() { - if(!IsPaused()) return; - //ConLog.Write("resume..."); + if (!IsPaused()) return; SendDbgCommand(DID_RESUME_EMU); m_status = Running; CheckStatus(); - //if(IsRunning() && Ini.CPUDecoderMode.GetValue() != 1) GetCPU().Exec(); + SendDbgCommand(DID_RESUMED_EMU); } void Emulator::Stop() { if(IsStopped()) return; - //ConLog.Write("shutdown..."); SendDbgCommand(DID_STOP_EMU); m_status = Stopped; @@ -396,7 +386,6 @@ void Emulator::Stop() CurGameInfo.Reset(); Memory.Close(); - //if(m_memory_viewer && m_memory_viewer->IsShown()) m_memory_viewer->Hide(); SendDbgCommand(DID_STOPPED_EMU); } @@ -409,12 +398,12 @@ void Emulator::SavePoints(const std::string& path) f << bpdb_version << break_count << marked_count; - if(break_count) + if (break_count) { f.write(reinterpret_cast(&m_break_points[0]), sizeof(u64) * break_count); } - if(marked_count) + if (marked_count) { f.write(reinterpret_cast(&m_marked_points[0]), sizeof(u64) * marked_count); } @@ -435,20 +424,19 @@ void Emulator::LoadPoints(const std::string& path) u16 version; f >> version >> break_count >> marked_count; - if(version != bpdb_version || - (sizeof(u16) + break_count * sizeof(u64) + sizeof(u32) + marked_count * sizeof(u64) + sizeof(u32)) != length) + if (version != bpdb_version || (sizeof(u16) + break_count * sizeof(u64) + sizeof(u32) + marked_count * sizeof(u64) + sizeof(u32)) != length) { LOG_ERROR(LOADER, "'%s' is broken", path.c_str()); return; } - if(break_count > 0) + if (break_count > 0) { m_break_points.resize(break_count); f.read(reinterpret_cast(&m_break_points[0]), sizeof(u64) * break_count); } - if(marked_count > 0) + if (marked_count > 0) { m_marked_points.resize(marked_count); f.read(reinterpret_cast(&m_marked_points[0]), sizeof(u64) * marked_count); @@ -467,4 +455,4 @@ void CallAfter(std::function func) void SetCallAfterCallback(CallAfterCbType cb) { CallAfterCallback = cb; -} \ No newline at end of file +}