Warning fix

This commit is contained in:
Nekotekina 2015-01-02 18:29:57 +03:00
parent 658079af55
commit 318d7276c0
7 changed files with 42 additions and 30 deletions

View file

@ -451,6 +451,8 @@ namespace PPU_opcodes
class PPUOpcodes class PPUOpcodes
{ {
public: public:
virtual ~PPUOpcodes() {}
static u32 branchTarget(const u32 pc, const u32 imm) static u32 branchTarget(const u32 pc, const u32 imm)
{ {
return pc + (imm & ~0x3ULL); return pc + (imm & ~0x3ULL);

View file

@ -229,6 +229,8 @@ namespace SPU_opcodes
class SPUOpcodes class SPUOpcodes
{ {
public: public:
virtual ~SPUOpcodes() {}
static u32 branchTarget(const u32 pc, const s32 imm) static u32 branchTarget(const u32 pc, const s32 imm)
{ {
return (pc + (imm << 2)) & 0x3fffc; return (pc + (imm << 2)) & 0x3fffc;

View file

@ -16,16 +16,18 @@ int cellVideoOutGetScreenSize(u32 videoOut, vm::ptr<float> screenSize)
{ {
cellAvconfExt->Warning("cellVideoOutGetScreenSize(videoOut=%d, screenSize_addr=0x%x)", videoOut, screenSize.addr()); cellAvconfExt->Warning("cellVideoOutGetScreenSize(videoOut=%d, screenSize_addr=0x%x)", videoOut, screenSize.addr());
if (!videoOut == CELL_VIDEO_OUT_PRIMARY) if (videoOut != CELL_VIDEO_OUT_PRIMARY)
{
return CELL_VIDEO_OUT_ERROR_UNSUPPORTED_VIDEO_OUT; return CELL_VIDEO_OUT_ERROR_UNSUPPORTED_VIDEO_OUT;
}
//TODO: Use virtual screen size //TODO: Use virtual screen size
#ifdef _WIN32 #ifdef _WIN32
HDC screen = GetDC(NULL); HDC screen = GetDC(NULL);
float diagonal = round(sqrt((pow(GetDeviceCaps(screen, HORZSIZE), 2) + pow(GetDeviceCaps(screen, VERTSIZE), 2))) * 0.0393); float diagonal = roundf(sqrtf((powf(float(GetDeviceCaps(screen, HORZSIZE)), 2) + powf(float(GetDeviceCaps(screen, VERTSIZE)), 2))) * 0.0393f);
#else #else
// TODO: Linux implementation, without using wx // TODO: Linux implementation, without using wx
// float diagonal = round(sqrt((pow(wxGetDisplaySizeMM().GetWidth(), 2) + pow(wxGetDisplaySizeMM().GetHeight(), 2))) * 0.0393); // float diagonal = roundf(sqrtf((powf(wxGetDisplaySizeMM().GetWidth(), 2) + powf(wxGetDisplaySizeMM().GetHeight(), 2))) * 0.0393f);
#endif #endif
if (Ini.GS3DTV.GetValue()) if (Ini.GS3DTV.GetValue())
@ -55,7 +57,8 @@ void cellAvconfExt_init(Module *pxThis)
{ {
cellAvconfExt = pxThis; cellAvconfExt = pxThis;
cellAvconfExt->AddFunc(0x4ec8c141, cellVideoOutConvertCursorColor); REG_FUNC(cellAvconfExt, cellVideoOutConvertCursorColor);
cellAvconfExt->AddFunc(0xfaa275a4, cellVideoOutGetScreenSize); REG_FUNC(cellAvconfExt, cellVideoOutGetScreenSize);
cellAvconfExt->AddFunc(0xc7020f62, cellVideoOutSetGamma); REG_FUNC(cellAvconfExt, cellVideoOutGetGamma);
REG_FUNC(cellAvconfExt, cellVideoOutSetGamma);
} }

View file

@ -92,7 +92,7 @@ ElementaryStream::ElementaryStream(Demuxer* dmux, u32 addr, u32 size, u32 fidMaj
, cbFunc(cbFunc) , cbFunc(cbFunc)
, cbArg(cbArg) , cbArg(cbArg)
, spec(spec) , spec(spec)
, put(memAddr) , put(a128(addr))
, put_count(0) , put_count(0)
, got_count(0) , got_count(0)
, released(0) , released(0)

View file

@ -77,13 +77,13 @@ s64 pngDecOpen(
stream->fd = 0; stream->fd = 0;
stream->src = *src; stream->src = *src;
switch (src->srcSelect.ToLE()) switch ((u32)src->srcSelect.ToBE())
{ {
case CELL_PNGDEC_BUFFER: case se32(CELL_PNGDEC_BUFFER):
stream->fileSize = src->streamSize.ToLE(); stream->fileSize = src->streamSize.ToLE();
break; break;
case CELL_PNGDEC_FILE: case se32(CELL_PNGDEC_FILE):
// Get file descriptor // Get file descriptor
vm::var<be_t<u32>> fd; vm::var<be_t<u32>> fd;
int ret = cellFsOpen(vm::ptr<const char>::make(src->fileName.addr()), 0, fd, vm::ptr<u32>::make(0), 0); int ret = cellFsOpen(vm::ptr<const char>::make(src->fileName.addr()), 0, fd, vm::ptr<u32>::make(0), 0);
@ -145,7 +145,7 @@ s64 pngReadHeader(
auto buffer_32 = buffer.To<be_t<u32>>(); auto buffer_32 = buffer.To<be_t<u32>>();
vm::var<be_t<u64>> pos, nread; vm::var<be_t<u64>> pos, nread;
switch (stream->src.srcSelect.ToBE()) switch ((u32)stream->src.srcSelect.ToBE())
{ {
case se32(CELL_PNGDEC_BUFFER): case se32(CELL_PNGDEC_BUFFER):
memmove(buffer.begin(), stream->src.streamPtr.get_ptr(), buffer.size()); memmove(buffer.begin(), stream->src.streamPtr.get_ptr(), buffer.size());
@ -206,17 +206,21 @@ s64 pngDecSetParameter(
current_outParam.outputHeight = current_info.imageHeight; current_outParam.outputHeight = current_info.imageHeight;
current_outParam.outputColorSpace = inParam->outputColorSpace; current_outParam.outputColorSpace = inParam->outputColorSpace;
switch ((u32)current_outParam.outputColorSpace) switch ((u32)current_outParam.outputColorSpace.ToBE())
{ {
case CELL_PNGDEC_PALETTE: case se32(CELL_PNGDEC_PALETTE):
case CELL_PNGDEC_GRAYSCALE: current_outParam.outputComponents = 1; break; case se32(CELL_PNGDEC_GRAYSCALE):
current_outParam.outputComponents = 1; break;
case CELL_PNGDEC_GRAYSCALE_ALPHA: current_outParam.outputComponents = 2; break; case se32(CELL_PNGDEC_GRAYSCALE_ALPHA):
current_outParam.outputComponents = 2; break;
case CELL_PNGDEC_RGB: current_outParam.outputComponents = 3; break; case se32(CELL_PNGDEC_RGB):
current_outParam.outputComponents = 3; break;
case CELL_PNGDEC_RGBA: case se32(CELL_PNGDEC_RGBA):
case CELL_PNGDEC_ARGB: current_outParam.outputComponents = 4; break; case se32(CELL_PNGDEC_ARGB):
current_outParam.outputComponents = 4; break;
default: default:
cellPngDec->Error("pngDecSetParameter: Unsupported color space (%d)", current_outParam.outputColorSpace.ToLE()); cellPngDec->Error("pngDecSetParameter: Unsupported color space (%d)", current_outParam.outputColorSpace.ToLE());
@ -250,7 +254,7 @@ s64 pngDecodeData(
vm::var<unsigned char[]> png((u32)fileSize); vm::var<unsigned char[]> png((u32)fileSize);
vm::var<be_t<u64>> pos, nread; vm::var<be_t<u64>> pos, nread;
switch (stream->src.srcSelect.ToBE()) switch ((u32)stream->src.srcSelect.ToBE())
{ {
case se32(CELL_PNGDEC_BUFFER): case se32(CELL_PNGDEC_BUFFER):
memmove(png.begin(), stream->src.streamPtr.get_ptr(), png.size()); memmove(png.begin(), stream->src.streamPtr.get_ptr(), png.size());
@ -279,10 +283,10 @@ s64 pngDecodeData(
const int bytesPerLine = (u32)dataCtrlParam->outputBytesPerLine; const int bytesPerLine = (u32)dataCtrlParam->outputBytesPerLine;
uint image_size = width * height; uint image_size = width * height;
switch ((u32)current_outParam.outputColorSpace) switch ((u32)current_outParam.outputColorSpace.ToBE())
{ {
case CELL_PNGDEC_RGB: case se32(CELL_PNGDEC_RGB):
case CELL_PNGDEC_RGBA: case se32(CELL_PNGDEC_RGBA):
{ {
const char nComponents = current_outParam.outputColorSpace == CELL_PNGDEC_RGBA ? 4 : 3; const char nComponents = current_outParam.outputColorSpace == CELL_PNGDEC_RGBA ? 4 : 3;
image_size *= nComponents; image_size *= nComponents;
@ -300,10 +304,10 @@ s64 pngDecodeData(
{ {
memcpy(data.get_ptr(), image.get(), image_size); memcpy(data.get_ptr(), image.get(), image_size);
} }
}
break; break;
}
case CELL_PNGDEC_ARGB: case se32(CELL_PNGDEC_ARGB):
{ {
const int nComponents = 4; const int nComponents = 4;
image_size *= nComponents; image_size *= nComponents;
@ -342,12 +346,12 @@ s64 pngDecodeData(
memcpy(data.get_ptr(), img, image_size); memcpy(data.get_ptr(), img, image_size);
delete[] img; delete[] img;
} }
}
break; break;
}
case CELL_PNGDEC_GRAYSCALE: case se32(CELL_PNGDEC_GRAYSCALE):
case CELL_PNGDEC_PALETTE: case se32(CELL_PNGDEC_PALETTE):
case CELL_PNGDEC_GRAYSCALE_ALPHA: case se32(CELL_PNGDEC_GRAYSCALE_ALPHA):
cellPngDec->Error("pngDecodeData: Unsupported color space (%d)", current_outParam.outputColorSpace.ToLE()); cellPngDec->Error("pngDecodeData: Unsupported color space (%d)", current_outParam.outputColorSpace.ToLE());
break; break;

View file

@ -2441,7 +2441,7 @@ s64 _cellSpursTasksetAttribute2Initialize(vm::ptr<CellSpursTasksetAttribute2> at
return GetCurrentPPUThread().FastCall2(libsre + 0x1474C, libsre_rtoc); return GetCurrentPPUThread().FastCall2(libsre + 0x1474C, libsre_rtoc);
#else #else
attribute->revision = revision; attribute->revision = revision;
attribute->name_addr = NULL; attribute->name_addr = 0;
attribute->argTaskset = 0; attribute->argTaskset = 0;
for (s32 i = 0; i < 8; i++) for (s32 i = 0; i < 8; i++)
@ -2554,7 +2554,7 @@ s64 _cellSpursTaskAttribute2Initialize(vm::ptr<CellSpursTaskAttribute2> attribut
#else #else
attribute->revision = revision; attribute->revision = revision;
attribute->sizeContext = 0; attribute->sizeContext = 0;
attribute->eaContext = NULL; attribute->eaContext = 0;
for (s32 c = 0; c < 4; c++) for (s32 c = 0; c < 4; c++)
{ {

View file

@ -67,6 +67,7 @@ std::string SyncPrimManager::GetSyncPrimName(u32 id, IDType type)
} }
break; break;
} }
default: break;
} }
LOG_ERROR(GENERAL, "SyncPrimManager::GetSyncPrimName(id=%d, type=%d) failed", id, type); LOG_ERROR(GENERAL, "SyncPrimManager::GetSyncPrimName(id=%d, type=%d) failed", id, type);