From c7ca4b996a01ab3bfa016a553ddcf0c8427c9369 Mon Sep 17 00:00:00 2001 From: DH Date: Sun, 24 Nov 2013 02:01:57 +0200 Subject: [PATCH] Fixed compilation errors Minor improvements --- rpcs3/Emu/Cell/PPUInterpreter.h | 4 ++-- rpcs3/Emu/SysCalls/Modules.cpp | 6 ------ rpcs3/Emu/SysCalls/Modules.h | 6 ++++++ rpcs3/Emu/SysCalls/Modules/cellGame.cpp | 14 ++++++-------- rpcs3/Emu/SysCalls/Modules/cellRtc.cpp | 2 +- rpcs3/Gui/MemoryViewer.cpp | 16 ++++++++-------- 6 files changed, 23 insertions(+), 25 deletions(-) diff --git a/rpcs3/Emu/Cell/PPUInterpreter.h b/rpcs3/Emu/Cell/PPUInterpreter.h index 8afde576c9..b6b54d4302 100644 --- a/rpcs3/Emu/Cell/PPUInterpreter.h +++ b/rpcs3/Emu/Cell/PPUInterpreter.h @@ -3269,10 +3269,10 @@ private: { double res; -#ifdef _MSVC_VER +#ifdef _MSC_VER if(_fpclass(CPU.FPR[frb]) >= _FPCLASS_NZ) #else - if(_fpclass(CPU.FPR[frb]) == FP_ZERO || signbit(CPU.FPR[frb]) == 0) + if(_fpclass(CPU.FPR[frb]) == FP_ZERO || signbit(CPU.FPR[frb]) == 0) #endif { res = static_cast(1.0 / CPU.FPR[frb]); diff --git a/rpcs3/Emu/SysCalls/Modules.cpp b/rpcs3/Emu/SysCalls/Modules.cpp index ccc0cf1f31..f50beceadf 100644 --- a/rpcs3/Emu/SysCalls/Modules.cpp +++ b/rpcs3/Emu/SysCalls/Modules.cpp @@ -470,9 +470,3 @@ u32 Module::GetNewId(void* data, u8 flags) { return Emu.GetIdManager().GetNewID(GetName(), data, flags); } - -template -__forceinline void Module::AddFunc(u32 id, T func) -{ - m_funcs_list.Move(new ModuleFunc(id, bind_func(func))); -} diff --git a/rpcs3/Emu/SysCalls/Modules.h b/rpcs3/Emu/SysCalls/Modules.h index eb7384bc36..1c72a92117 100644 --- a/rpcs3/Emu/SysCalls/Modules.h +++ b/rpcs3/Emu/SysCalls/Modules.h @@ -70,6 +70,12 @@ public: template __forceinline void AddFunc(u32 id, T func); }; +template +__forceinline void Module::AddFunc(u32 id, T func) +{ + m_funcs_list.Move(new ModuleFunc(id, bind_func(func))); +} + bool IsLoadedFunc(u32 id); bool CallFunc(u32 num); bool UnloadFunc(u32 id); diff --git a/rpcs3/Emu/SysCalls/Modules/cellGame.cpp b/rpcs3/Emu/SysCalls/Modules/cellGame.cpp index a438e5d7ee..0fcec5e42b 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellGame.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellGame.cpp @@ -110,14 +110,13 @@ int cellGameGetParamInt(u32 id, mem32_t value) return CELL_GAME_ERROR_PARAM; // TODO: Locate the PARAM.SFO. The following path is in most cases wrong. - vfsStream* f = Emu.GetVFS().Open("/app_home/PARAM.SFO", vfsRead); - PSFLoader psf(*f); + vfsFile f("/app_home/PARAM.SFO"); + PSFLoader psf(f); if(!psf.Load(false)) return CELL_GAME_ERROR_FAILURE; - psf.Close(); switch(id) - { // TODO: Is the endianness right? + { case CELL_GAME_PARAMID_PARENTAL_LEVEL: value = psf.m_info.parental_lvl; break; case CELL_GAME_PARAMID_RESOLUTION: value = psf.m_info.resolution; break; case CELL_GAME_PARAMID_SOUND_FORMAT: value = psf.m_info.sound_format; break; @@ -137,11 +136,10 @@ int cellGameGetParamString(u32 id, mem_list_ptr_t buf, u32 bufsize) return CELL_GAME_ERROR_PARAM; // TODO: Locate the PARAM.SFO. The following path is in most cases wrong. - vfsStream* f = Emu.GetVFS().Open("/app_home/PARAM.SFO", vfsRead); - PSFLoader psf(*f); + vfsFile f("/app_home/PARAM.SFO"); + PSFLoader psf(f); if(!psf.Load(false)) return CELL_GAME_ERROR_FAILURE; - psf.Close(); switch(id) { @@ -253,4 +251,4 @@ void cellGame_init() cellGame.AddFunc(0xd24e3928, cellGameThemeInstall); cellGame.AddFunc(0x87406734, cellGameThemeInstallFromBuffer); //cellGame.AddFunc(, CellGameThemeInstallCallback); -} \ No newline at end of file +} diff --git a/rpcs3/Emu/SysCalls/Modules/cellRtc.cpp b/rpcs3/Emu/SysCalls/Modules/cellRtc.cpp index 32c6c9f094..eb03cc225f 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellRtc.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellRtc.cpp @@ -48,7 +48,7 @@ long convertToUNIXTime(u16 seconds, u16 minutes, u16 hours, u16 days, int years) u64 convertToWin32FILETIME(u16 seconds, u16 minutes, u16 hours, u16 days, int years) { long unixtime = convertToUNIXTime(seconds, minutes, hours, days, years); - u64 win32time = u64(unixtime) * u64(10000000) + u64(116444736000000000); + u64 win32time = u64(unixtime) * u64(10000000) + u64(116444736000000000); u64 win32filetime = win32time | win32time >> 32; return win32filetime; } diff --git a/rpcs3/Gui/MemoryViewer.cpp b/rpcs3/Gui/MemoryViewer.cpp index 6006ec1e2a..8a11fdff42 100644 --- a/rpcs3/Gui/MemoryViewer.cpp +++ b/rpcs3/Gui/MemoryViewer.cpp @@ -223,9 +223,9 @@ void MemoryViewerPanel::ShowImage(wxCommandEvent& WXUNUSED(event)) f_image_viewer->SetBackgroundColour(wxColour(240,240,240)); //This fix the ugly background color under Windows f_image_viewer->SetAutoLayout(true); f_image_viewer->SetClientSize(wxSize(sizex,sizey)); - f_image_viewer->Show(); + f_image_viewer->Show(); - wxClientDC* dc_canvas = new wxClientDC(f_image_viewer); + wxClientDC dc_canvas(f_image_viewer); u32 addr = m_addr; for(int y = 0; y < sizex; y++) { @@ -238,8 +238,8 @@ void MemoryViewerPanel::ShowImage(wxCommandEvent& WXUNUSED(event)) R = Memory.IsGoodAddr(addr+0) ? Memory.Read8(addr+0) : 0; G = Memory.IsGoodAddr(addr+1) ? Memory.Read8(addr+1) : 0; B = Memory.IsGoodAddr(addr+2) ? Memory.Read8(addr+2) : 0; - dc_canvas->SetPen(wxPen(wxColour(R,G,B), 3)); - dc_canvas->DrawPoint(x,y); + dc_canvas.SetPen(wxPen(wxColour(R,G,B), 3)); + dc_canvas.DrawPoint(x,y); addr += 3; break; case(1): //ARGB @@ -247,8 +247,8 @@ void MemoryViewerPanel::ShowImage(wxCommandEvent& WXUNUSED(event)) R = Memory.IsGoodAddr(addr+1) ? Memory.Read8(addr+1) : 0; G = Memory.IsGoodAddr(addr+2) ? Memory.Read8(addr+2) : 0; B = Memory.IsGoodAddr(addr+3) ? Memory.Read8(addr+3) : 0; - dc_canvas->SetPen(wxPen(wxColour(R,G,B), 3)); - dc_canvas->DrawPoint(x,y); + dc_canvas.SetPen(wxPen(wxColour(R,G,B), 3)); + dc_canvas.DrawPoint(x,y); addr += 4; break; case(2): //RGBA @@ -256,8 +256,8 @@ void MemoryViewerPanel::ShowImage(wxCommandEvent& WXUNUSED(event)) G = Memory.IsGoodAddr(addr+1) ? Memory.Read8(addr+1) : 0; B = Memory.IsGoodAddr(addr+2) ? Memory.Read8(addr+2) : 0; //A = Memory.IsGoodAddr(addr+3) ? Memory.Read8(addr+3) : 0; - dc_canvas->SetPen(wxPen(wxColour(R,G,B), 3)); - dc_canvas->DrawPoint(x,y); + dc_canvas.SetPen(wxPen(wxColour(R,G,B), 3)); + dc_canvas.DrawPoint(x,y); addr += 4; break; }