mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-06 00:59:18 +00:00
Warning fix
This commit is contained in:
parent
658079af55
commit
318d7276c0
@ -451,6 +451,8 @@ namespace PPU_opcodes
|
||||
class PPUOpcodes
|
||||
{
|
||||
public:
|
||||
virtual ~PPUOpcodes() {}
|
||||
|
||||
static u32 branchTarget(const u32 pc, const u32 imm)
|
||||
{
|
||||
return pc + (imm & ~0x3ULL);
|
||||
|
@ -229,6 +229,8 @@ namespace SPU_opcodes
|
||||
class SPUOpcodes
|
||||
{
|
||||
public:
|
||||
virtual ~SPUOpcodes() {}
|
||||
|
||||
static u32 branchTarget(const u32 pc, const s32 imm)
|
||||
{
|
||||
return (pc + (imm << 2)) & 0x3fffc;
|
||||
|
@ -16,16 +16,18 @@ int cellVideoOutGetScreenSize(u32 videoOut, vm::ptr<float> screenSize)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
//TODO: Use virtual screen size
|
||||
#ifdef _WIN32
|
||||
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
|
||||
// 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
|
||||
|
||||
if (Ini.GS3DTV.GetValue())
|
||||
@ -55,7 +57,8 @@ void cellAvconfExt_init(Module *pxThis)
|
||||
{
|
||||
cellAvconfExt = pxThis;
|
||||
|
||||
cellAvconfExt->AddFunc(0x4ec8c141, cellVideoOutConvertCursorColor);
|
||||
cellAvconfExt->AddFunc(0xfaa275a4, cellVideoOutGetScreenSize);
|
||||
cellAvconfExt->AddFunc(0xc7020f62, cellVideoOutSetGamma);
|
||||
REG_FUNC(cellAvconfExt, cellVideoOutConvertCursorColor);
|
||||
REG_FUNC(cellAvconfExt, cellVideoOutGetScreenSize);
|
||||
REG_FUNC(cellAvconfExt, cellVideoOutGetGamma);
|
||||
REG_FUNC(cellAvconfExt, cellVideoOutSetGamma);
|
||||
}
|
@ -92,7 +92,7 @@ ElementaryStream::ElementaryStream(Demuxer* dmux, u32 addr, u32 size, u32 fidMaj
|
||||
, cbFunc(cbFunc)
|
||||
, cbArg(cbArg)
|
||||
, spec(spec)
|
||||
, put(memAddr)
|
||||
, put(a128(addr))
|
||||
, put_count(0)
|
||||
, got_count(0)
|
||||
, released(0)
|
||||
|
@ -77,13 +77,13 @@ s64 pngDecOpen(
|
||||
stream->fd = 0;
|
||||
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();
|
||||
break;
|
||||
|
||||
case CELL_PNGDEC_FILE:
|
||||
case se32(CELL_PNGDEC_FILE):
|
||||
// Get file descriptor
|
||||
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);
|
||||
@ -145,7 +145,7 @@ s64 pngReadHeader(
|
||||
auto buffer_32 = buffer.To<be_t<u32>>();
|
||||
vm::var<be_t<u64>> pos, nread;
|
||||
|
||||
switch (stream->src.srcSelect.ToBE())
|
||||
switch ((u32)stream->src.srcSelect.ToBE())
|
||||
{
|
||||
case se32(CELL_PNGDEC_BUFFER):
|
||||
memmove(buffer.begin(), stream->src.streamPtr.get_ptr(), buffer.size());
|
||||
@ -206,17 +206,21 @@ s64 pngDecSetParameter(
|
||||
current_outParam.outputHeight = current_info.imageHeight;
|
||||
current_outParam.outputColorSpace = inParam->outputColorSpace;
|
||||
|
||||
switch ((u32)current_outParam.outputColorSpace)
|
||||
switch ((u32)current_outParam.outputColorSpace.ToBE())
|
||||
{
|
||||
case CELL_PNGDEC_PALETTE:
|
||||
case CELL_PNGDEC_GRAYSCALE: current_outParam.outputComponents = 1; break;
|
||||
case se32(CELL_PNGDEC_PALETTE):
|
||||
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 CELL_PNGDEC_ARGB: current_outParam.outputComponents = 4; break;
|
||||
case se32(CELL_PNGDEC_RGBA):
|
||||
case se32(CELL_PNGDEC_ARGB):
|
||||
current_outParam.outputComponents = 4; break;
|
||||
|
||||
default:
|
||||
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<be_t<u64>> pos, nread;
|
||||
|
||||
switch (stream->src.srcSelect.ToBE())
|
||||
switch ((u32)stream->src.srcSelect.ToBE())
|
||||
{
|
||||
case se32(CELL_PNGDEC_BUFFER):
|
||||
memmove(png.begin(), stream->src.streamPtr.get_ptr(), png.size());
|
||||
@ -279,10 +283,10 @@ s64 pngDecodeData(
|
||||
const int bytesPerLine = (u32)dataCtrlParam->outputBytesPerLine;
|
||||
uint image_size = width * height;
|
||||
|
||||
switch ((u32)current_outParam.outputColorSpace)
|
||||
switch ((u32)current_outParam.outputColorSpace.ToBE())
|
||||
{
|
||||
case CELL_PNGDEC_RGB:
|
||||
case CELL_PNGDEC_RGBA:
|
||||
case se32(CELL_PNGDEC_RGB):
|
||||
case se32(CELL_PNGDEC_RGBA):
|
||||
{
|
||||
const char nComponents = current_outParam.outputColorSpace == CELL_PNGDEC_RGBA ? 4 : 3;
|
||||
image_size *= nComponents;
|
||||
@ -300,10 +304,10 @@ s64 pngDecodeData(
|
||||
{
|
||||
memcpy(data.get_ptr(), image.get(), image_size);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case CELL_PNGDEC_ARGB:
|
||||
case se32(CELL_PNGDEC_ARGB):
|
||||
{
|
||||
const int nComponents = 4;
|
||||
image_size *= nComponents;
|
||||
@ -342,12 +346,12 @@ s64 pngDecodeData(
|
||||
memcpy(data.get_ptr(), img, image_size);
|
||||
delete[] img;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case CELL_PNGDEC_GRAYSCALE:
|
||||
case CELL_PNGDEC_PALETTE:
|
||||
case CELL_PNGDEC_GRAYSCALE_ALPHA:
|
||||
case se32(CELL_PNGDEC_GRAYSCALE):
|
||||
case se32(CELL_PNGDEC_PALETTE):
|
||||
case se32(CELL_PNGDEC_GRAYSCALE_ALPHA):
|
||||
cellPngDec->Error("pngDecodeData: Unsupported color space (%d)", current_outParam.outputColorSpace.ToLE());
|
||||
break;
|
||||
|
||||
|
@ -2441,7 +2441,7 @@ s64 _cellSpursTasksetAttribute2Initialize(vm::ptr<CellSpursTasksetAttribute2> at
|
||||
return GetCurrentPPUThread().FastCall2(libsre + 0x1474C, libsre_rtoc);
|
||||
#else
|
||||
attribute->revision = revision;
|
||||
attribute->name_addr = NULL;
|
||||
attribute->name_addr = 0;
|
||||
attribute->argTaskset = 0;
|
||||
|
||||
for (s32 i = 0; i < 8; i++)
|
||||
@ -2554,7 +2554,7 @@ s64 _cellSpursTaskAttribute2Initialize(vm::ptr<CellSpursTaskAttribute2> attribut
|
||||
#else
|
||||
attribute->revision = revision;
|
||||
attribute->sizeContext = 0;
|
||||
attribute->eaContext = NULL;
|
||||
attribute->eaContext = 0;
|
||||
|
||||
for (s32 c = 0; c < 4; c++)
|
||||
{
|
||||
|
@ -67,6 +67,7 @@ std::string SyncPrimManager::GetSyncPrimName(u32 id, IDType type)
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
|
||||
LOG_ERROR(GENERAL, "SyncPrimManager::GetSyncPrimName(id=%d, type=%d) failed", id, type);
|
||||
|
Loading…
Reference in New Issue
Block a user