Fixed compilation errors

Minor improvements
This commit is contained in:
DH 2013-11-24 02:01:57 +02:00
parent 0ff38bc8ce
commit c7ca4b996a
6 changed files with 23 additions and 25 deletions

View file

@ -3269,10 +3269,10 @@ private:
{ {
double res; double res;
#ifdef _MSVC_VER #ifdef _MSC_VER
if(_fpclass(CPU.FPR[frb]) >= _FPCLASS_NZ) if(_fpclass(CPU.FPR[frb]) >= _FPCLASS_NZ)
#else #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 #endif
{ {
res = static_cast<float>(1.0 / CPU.FPR[frb]); res = static_cast<float>(1.0 / CPU.FPR[frb]);

View file

@ -470,9 +470,3 @@ u32 Module::GetNewId(void* data, u8 flags)
{ {
return Emu.GetIdManager().GetNewID(GetName(), data, flags); return Emu.GetIdManager().GetNewID(GetName(), data, flags);
} }
template<typename T>
__forceinline void Module::AddFunc(u32 id, T func)
{
m_funcs_list.Move(new ModuleFunc(id, bind_func(func)));
}

View file

@ -70,6 +70,12 @@ public:
template<typename T> __forceinline void AddFunc(u32 id, T func); template<typename T> __forceinline void AddFunc(u32 id, T func);
}; };
template<typename T>
__forceinline void Module::AddFunc(u32 id, T func)
{
m_funcs_list.Move(new ModuleFunc(id, bind_func(func)));
}
bool IsLoadedFunc(u32 id); bool IsLoadedFunc(u32 id);
bool CallFunc(u32 num); bool CallFunc(u32 num);
bool UnloadFunc(u32 id); bool UnloadFunc(u32 id);

View file

@ -110,14 +110,13 @@ int cellGameGetParamInt(u32 id, mem32_t value)
return CELL_GAME_ERROR_PARAM; return CELL_GAME_ERROR_PARAM;
// TODO: Locate the PARAM.SFO. The following path is in most cases wrong. // TODO: Locate the PARAM.SFO. The following path is in most cases wrong.
vfsStream* f = Emu.GetVFS().Open("/app_home/PARAM.SFO", vfsRead); vfsFile f("/app_home/PARAM.SFO");
PSFLoader psf(*f); PSFLoader psf(f);
if(!psf.Load(false)) if(!psf.Load(false))
return CELL_GAME_ERROR_FAILURE; return CELL_GAME_ERROR_FAILURE;
psf.Close();
switch(id) switch(id)
{ // TODO: Is the endianness right? {
case CELL_GAME_PARAMID_PARENTAL_LEVEL: value = psf.m_info.parental_lvl; break; 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_RESOLUTION: value = psf.m_info.resolution; break;
case CELL_GAME_PARAMID_SOUND_FORMAT: value = psf.m_info.sound_format; 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<u8> buf, u32 bufsize)
return CELL_GAME_ERROR_PARAM; return CELL_GAME_ERROR_PARAM;
// TODO: Locate the PARAM.SFO. The following path is in most cases wrong. // TODO: Locate the PARAM.SFO. The following path is in most cases wrong.
vfsStream* f = Emu.GetVFS().Open("/app_home/PARAM.SFO", vfsRead); vfsFile f("/app_home/PARAM.SFO");
PSFLoader psf(*f); PSFLoader psf(f);
if(!psf.Load(false)) if(!psf.Load(false))
return CELL_GAME_ERROR_FAILURE; return CELL_GAME_ERROR_FAILURE;
psf.Close();
switch(id) switch(id)
{ {

View file

@ -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) u64 convertToWin32FILETIME(u16 seconds, u16 minutes, u16 hours, u16 days, int years)
{ {
long unixtime = convertToUNIXTime(seconds, minutes, hours, days, 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; u64 win32filetime = win32time | win32time >> 32;
return win32filetime; return win32filetime;
} }

View file

@ -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->SetBackgroundColour(wxColour(240,240,240)); //This fix the ugly background color under Windows
f_image_viewer->SetAutoLayout(true); f_image_viewer->SetAutoLayout(true);
f_image_viewer->SetClientSize(wxSize(sizex,sizey)); 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; u32 addr = m_addr;
for(int y = 0; y < sizex; y++) 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; R = Memory.IsGoodAddr(addr+0) ? Memory.Read8(addr+0) : 0;
G = Memory.IsGoodAddr(addr+1) ? Memory.Read8(addr+1) : 0; G = Memory.IsGoodAddr(addr+1) ? Memory.Read8(addr+1) : 0;
B = Memory.IsGoodAddr(addr+2) ? Memory.Read8(addr+2) : 0; B = Memory.IsGoodAddr(addr+2) ? Memory.Read8(addr+2) : 0;
dc_canvas->SetPen(wxPen(wxColour(R,G,B), 3)); dc_canvas.SetPen(wxPen(wxColour(R,G,B), 3));
dc_canvas->DrawPoint(x,y); dc_canvas.DrawPoint(x,y);
addr += 3; addr += 3;
break; break;
case(1): //ARGB case(1): //ARGB
@ -247,8 +247,8 @@ void MemoryViewerPanel::ShowImage(wxCommandEvent& WXUNUSED(event))
R = Memory.IsGoodAddr(addr+1) ? Memory.Read8(addr+1) : 0; R = Memory.IsGoodAddr(addr+1) ? Memory.Read8(addr+1) : 0;
G = Memory.IsGoodAddr(addr+2) ? Memory.Read8(addr+2) : 0; G = Memory.IsGoodAddr(addr+2) ? Memory.Read8(addr+2) : 0;
B = Memory.IsGoodAddr(addr+3) ? Memory.Read8(addr+3) : 0; B = Memory.IsGoodAddr(addr+3) ? Memory.Read8(addr+3) : 0;
dc_canvas->SetPen(wxPen(wxColour(R,G,B), 3)); dc_canvas.SetPen(wxPen(wxColour(R,G,B), 3));
dc_canvas->DrawPoint(x,y); dc_canvas.DrawPoint(x,y);
addr += 4; addr += 4;
break; break;
case(2): //RGBA case(2): //RGBA
@ -256,8 +256,8 @@ void MemoryViewerPanel::ShowImage(wxCommandEvent& WXUNUSED(event))
G = Memory.IsGoodAddr(addr+1) ? Memory.Read8(addr+1) : 0; G = Memory.IsGoodAddr(addr+1) ? Memory.Read8(addr+1) : 0;
B = Memory.IsGoodAddr(addr+2) ? Memory.Read8(addr+2) : 0; B = Memory.IsGoodAddr(addr+2) ? Memory.Read8(addr+2) : 0;
//A = Memory.IsGoodAddr(addr+3) ? Memory.Read8(addr+3) : 0; //A = Memory.IsGoodAddr(addr+3) ? Memory.Read8(addr+3) : 0;
dc_canvas->SetPen(wxPen(wxColour(R,G,B), 3)); dc_canvas.SetPen(wxPen(wxColour(R,G,B), 3));
dc_canvas->DrawPoint(x,y); dc_canvas.DrawPoint(x,y);
addr += 4; addr += 4;
break; break;
} }