Some warnings fixed

This commit is contained in:
Nekotekina 2014-08-31 00:41:01 +04:00
parent fb1d7d3982
commit 9e2bb9e9d2
36 changed files with 308 additions and 313 deletions

View File

@ -14,7 +14,7 @@ LogManager *gLogManager = nullptr;
u32 LogMessage::size() u32 LogMessage::size()
{ {
//1 byte for NULL terminator //1 byte for NULL terminator
return sizeof(LogMessage::size_type) + sizeof(LogType) + sizeof(LogSeverity) + sizeof(std::string::value_type)*mText.size() + 1; return (u32)(sizeof(LogMessage::size_type) + sizeof(LogType) + sizeof(LogSeverity) + sizeof(std::string::value_type) * mText.size() + 1);
} }
void LogMessage::serialize(char *output) void LogMessage::serialize(char *output)

View File

@ -162,7 +162,7 @@ public:
} }
else else
{ {
for (u32 i = addr / 4096; i <= (addr + size - 1) / 4096; i++) for (u32 i = (u32)addr / 4096; i <= ((u32)addr + size - 1) / 4096; i++)
{ {
if (!m_pages[i]) return false; // TODO: define page parameters if (!m_pages[i]) return false; // TODO: define page parameters
} }
@ -718,7 +718,7 @@ public:
u32 AppendRawBytes(const u8 *bytes, size_t count) u32 AppendRawBytes(const u8 *bytes, size_t count)
{ {
memmove(Memory + this->m_addr, bytes, count); memmove(Memory + this->m_addr, bytes, count);
this->m_addr += count; this->m_addr += (u32)count;
return this->m_addr; return this->m_addr;
} }
@ -835,7 +835,7 @@ class MemoryAllocator
public: public:
MemoryAllocator(u32 size = sizeof(T), u32 align = 1) MemoryAllocator(u32 size = sizeof(T), u32 align = 1)
: m_size(size) : m_size(size)
, m_addr(Memory.Alloc(size, align)) , m_addr((u32)Memory.Alloc(size, align))
, m_ptr((T*)&Memory[m_addr]) , m_ptr((T*)&Memory[m_addr])
{ {
} }

View File

@ -153,7 +153,7 @@ __forceinline void Module::AddFuncSub(const char group[8], const u64 ops[], cons
{ {
SFuncOp op; SFuncOp op;
op.mask = ops[i] >> 32; op.mask = ops[i] >> 32;
op.crc = ops[i]; op.crc = (u32)ops[i];
if (op.mask) op.crc &= op.mask; if (op.mask) op.crc &= op.mask;
op.mask = re(op.mask); op.mask = re(op.mask);
op.crc = re(op.crc); op.crc = re(op.crc);

View File

@ -96,8 +96,8 @@ int cellFontOpenFontFile(mem_ptr_t<CellFontLibrary> library, mem8_ptr_t fontPath
if (!f.IsOpened()) if (!f.IsOpened())
return CELL_FONT_ERROR_FONT_OPEN_FAILED; return CELL_FONT_ERROR_FONT_OPEN_FAILED;
u32 fileSize = f.GetSize(); u32 fileSize = (u32)f.GetSize();
u32 bufferAddr = Memory.Alloc(fileSize, 1); // Freed in cellFontCloseFont u32 bufferAddr = (u32)Memory.Alloc(fileSize, 1); // Freed in cellFontCloseFont
f.Read(Memory.VirtualToRealAddr(bufferAddr), fileSize); f.Read(Memory.VirtualToRealAddr(bufferAddr), fileSize);
int ret = cellFontOpenFontMemory(library.GetAddr(), bufferAddr, fileSize, subNum, uniqueId, font.GetAddr()); int ret = cellFontOpenFontMemory(library.GetAddr(), bufferAddr, fileSize, subNum, uniqueId, font.GetAddr());
font->origin = CELL_FONT_OPEN_FONT_FILE; font->origin = CELL_FONT_OPEN_FONT_FILE;
@ -180,7 +180,7 @@ int cellFontOpenFontset(mem_ptr_t<CellFontLibrary> library, mem_ptr_t<CellFontTy
return CELL_FONT_ERROR_NO_SUPPORT_FONTSET; return CELL_FONT_ERROR_NO_SUPPORT_FONTSET;
} }
u32 file_addr = Memory.Alloc(file.length()+1, 1); u32 file_addr = (u32)Memory.Alloc((u32)file.length() + 1, 1);
Memory.WriteString(file_addr, file); Memory.WriteString(file_addr, file);
int ret = cellFontOpenFontFile(library.GetAddr(), file_addr, 0, 0, font.GetAddr()); //TODO: Find the correct values of subNum, uniqueId int ret = cellFontOpenFontFile(library.GetAddr(), file_addr, 0, 0, font.GetAddr()); //TODO: Find the correct values of subNum, uniqueId
font->origin = CELL_FONT_OPEN_FONTSET; font->origin = CELL_FONT_OPEN_FONTSET;
@ -234,7 +234,7 @@ void cellFontRenderSurfaceInit(mem_ptr_t<CellFontRenderSurface> surface, u32 buf
surface->height = h; surface->height = h;
if (!buffer_addr) if (!buffer_addr)
surface->buffer_addr = Memory.Alloc(bufferWidthByte * h, 1); // TODO: Huge memory leak surface->buffer_addr = (u32)Memory.Alloc(bufferWidthByte * h, 1); // TODO: Huge memory leak
} }
void cellFontRenderSurfaceSetScissor(mem_ptr_t<CellFontRenderSurface> surface, s32 x0, s32 y0, s32 w, s32 h) void cellFontRenderSurfaceSetScissor(mem_ptr_t<CellFontRenderSurface> surface, s32 x0, s32 y0, s32 w, s32 h)
@ -250,8 +250,6 @@ void cellFontRenderSurfaceSetScissor(mem_ptr_t<CellFontRenderSurface> surface, s
int cellFontSetScalePixel(mem_ptr_t<CellFont> font, float w, float h) int cellFontSetScalePixel(mem_ptr_t<CellFont> font, float w, float h)
{ {
w = GetCurrentPPUThread().FPR[1]; // TODO: Something is wrong with the float arguments
h = GetCurrentPPUThread().FPR[2]; // TODO: Something is wrong with the float arguments
cellFont->Log("cellFontSetScalePixel(font_addr=0x%x, w=%f, h=%f)", font.GetAddr(), w, h); cellFont->Log("cellFontSetScalePixel(font_addr=0x%x, w=%f, h=%f)", font.GetAddr(), w, h);
font->scale_x = w; font->scale_x = w;
@ -305,8 +303,6 @@ int cellFontDestroyRenderer()
int cellFontSetupRenderScalePixel(mem_ptr_t<CellFont> font, float w, float h) int cellFontSetupRenderScalePixel(mem_ptr_t<CellFont> font, float w, float h)
{ {
w = GetCurrentPPUThread().FPR[1]; // TODO: Something is wrong with the float arguments
h = GetCurrentPPUThread().FPR[2]; // TODO: Something is wrong with the float arguments
cellFont->Log("cellFontSetupRenderScalePixel(font_addr=0x%x, w=%f, h=%f)", font.GetAddr(), w, h); cellFont->Log("cellFontSetupRenderScalePixel(font_addr=0x%x, w=%f, h=%f)", font.GetAddr(), w, h);
if (!font->renderer_addr) if (!font->renderer_addr)
@ -330,8 +326,6 @@ int cellFontGetRenderCharGlyphMetrics(mem_ptr_t<CellFont> font, u32 code, mem_pt
int cellFontRenderCharGlyphImage(mem_ptr_t<CellFont> font, u32 code, mem_ptr_t<CellFontRenderSurface> surface, float x, float y, mem_ptr_t<CellFontGlyphMetrics> metrics, mem_ptr_t<CellFontImageTransInfo> transInfo) int cellFontRenderCharGlyphImage(mem_ptr_t<CellFont> font, u32 code, mem_ptr_t<CellFontRenderSurface> surface, float x, float y, mem_ptr_t<CellFontGlyphMetrics> metrics, mem_ptr_t<CellFontImageTransInfo> transInfo)
{ {
x = GetCurrentPPUThread().FPR[1]; // TODO: Something is wrong with the float arguments
y = GetCurrentPPUThread().FPR[2]; // TODO: Something is wrong with the float arguments
cellFont->Log("cellFontRenderCharGlyphImage(font_addr=0x%x, code=0x%x, surface_addr=0x%x, x=%f, y=%f, metrics_addr=0x%x, trans_addr=0x%x)", cellFont->Log("cellFontRenderCharGlyphImage(font_addr=0x%x, code=0x%x, surface_addr=0x%x, x=%f, y=%f, metrics_addr=0x%x, trans_addr=0x%x)",
font.GetAddr(), code, surface.GetAddr(), x, y, metrics.GetAddr(), transInfo.GetAddr()); font.GetAddr(), code, surface.GetAddr(), x, y, metrics.GetAddr(), transInfo.GetAddr());
@ -348,7 +342,7 @@ int cellFontRenderCharGlyphImage(mem_ptr_t<CellFont> font, u32 code, mem_ptr_t<C
int baseLineY; int baseLineY;
int ascent, descent, lineGap; int ascent, descent, lineGap;
stbtt_GetFontVMetrics(font->stbfont, &ascent, &descent, &lineGap); stbtt_GetFontVMetrics(font->stbfont, &ascent, &descent, &lineGap);
baseLineY = ascent * scale; baseLineY = (int)((float)ascent * scale); // ???
// Move the rendered character to the surface // Move the rendered character to the surface
unsigned char* buffer = (unsigned char*)Memory.VirtualToRealAddr(surface->buffer_addr); unsigned char* buffer = (unsigned char*)Memory.VirtualToRealAddr(surface->buffer_addr);
@ -376,7 +370,6 @@ int cellFontEndLibrary()
int cellFontSetEffectSlant(mem_ptr_t<CellFont> font, float slantParam) int cellFontSetEffectSlant(mem_ptr_t<CellFont> font, float slantParam)
{ {
slantParam = GetCurrentPPUThread().FPR[1]; // TODO: Something is wrong with the float arguments
cellFont->Log("cellFontSetEffectSlant(font_addr=0x%x, slantParam=%f)", font.GetAddr(), slantParam); cellFont->Log("cellFontSetEffectSlant(font_addr=0x%x, slantParam=%f)", font.GetAddr(), slantParam);
if (slantParam < -1.0 || slantParam > 1.0) if (slantParam < -1.0 || slantParam > 1.0)
@ -386,11 +379,11 @@ int cellFontSetEffectSlant(mem_ptr_t<CellFont> font, float slantParam)
return CELL_FONT_OK; return CELL_FONT_OK;
} }
int cellFontGetEffectSlant(mem_ptr_t<CellFont> font, mem32_t slantParam) int cellFontGetEffectSlant(mem_ptr_t<CellFont> font, mem_ptr_t<be_t<float>> slantParam)
{ {
cellFont->Warning("cellFontSetEffectSlant(font_addr=0x%x, slantParam_addr=0x%x)", font.GetAddr(), slantParam.GetAddr()); cellFont->Warning("cellFontSetEffectSlant(font_addr=0x%x, slantParam_addr=0x%x)", font.GetAddr(), slantParam.GetAddr());
slantParam = font->slant; //Does this conversion from be_t<float> to *mem32_t work? *slantParam = font->slant;
return CELL_FONT_OK; return CELL_FONT_OK;
} }

View File

@ -21,7 +21,7 @@ int cellFontInitLibraryFreeTypeWithRevision(u64 revisionFlags, mem_ptr_t<CellFon
//if (s_fontInternalInstance->m_bInitialized) //if (s_fontInternalInstance->m_bInitialized)
//return CELL_FONT_ERROR_UNINITIALIZED; //return CELL_FONT_ERROR_UNINITIALIZED;
Memory.Write32(lib_addr_addr, Memory.Alloc(sizeof(CellFontLibrary), 1)); Memory.Write32(lib_addr_addr, (u32)Memory.Alloc(sizeof(CellFontLibrary), 1));
return CELL_OK; return CELL_OK;
} }

View File

@ -29,7 +29,7 @@ const u32 tiled_pitches[] = {
u32 local_size = 0; u32 local_size = 0;
u32 local_addr = 0; u32 local_addr = 0;
u32 system_mode = 0; u64 system_mode = 0;
CellGcmConfig current_config; CellGcmConfig current_config;
CellGcmContextData current_context; CellGcmContextData current_context;
@ -65,8 +65,8 @@ CellGcmOffsetTable offsetTable;
void InitOffsetTable() void InitOffsetTable()
{ {
offsetTable.ioAddress = Memory.Alloc(3072 * sizeof(u16), 1); offsetTable.ioAddress = (u32)Memory.Alloc(3072 * sizeof(u16), 1);
offsetTable.eaAddress = Memory.Alloc(512 * sizeof(u16), 1); offsetTable.eaAddress = (u32)Memory.Alloc(512 * sizeof(u16), 1);
_sys_memset(offsetTable.ioAddress, 0xFF, 3072 * sizeof(u16)); _sys_memset(offsetTable.ioAddress, 0xFF, 3072 * sizeof(u16));
_sys_memset(offsetTable.eaAddress, 0xFF, 512 * sizeof(u16)); _sys_memset(offsetTable.eaAddress, 0xFF, 512 * sizeof(u16));
@ -79,7 +79,7 @@ void InitOffsetTable()
u32 cellGcmGetLabelAddress(u8 index) u32 cellGcmGetLabelAddress(u8 index)
{ {
cellGcmSys->Log("cellGcmGetLabelAddress(index=%d)", index); cellGcmSys->Log("cellGcmGetLabelAddress(index=%d)", index);
return Memory.RSXCMDMem.GetStartAddr() + 0x10 * index; return (u32)Memory.RSXCMDMem.GetStartAddr() + 0x10 * index;
} }
u32 cellGcmGetReportDataAddressLocation(u32 index, u32 location) u32 cellGcmGetReportDataAddressLocation(u32 index, u32 location)
@ -91,7 +91,7 @@ u32 cellGcmGetReportDataAddressLocation(u32 index, u32 location)
cellGcmSys->Error("cellGcmGetReportDataAddressLocation: Wrong local index (%d)", index); cellGcmSys->Error("cellGcmGetReportDataAddressLocation: Wrong local index (%d)", index);
return 0; return 0;
} }
return Memory.RSXFBMem.GetStartAddr() + index * 0x10; return (u32)Memory.RSXFBMem.GetStartAddr() + index * 0x10;
} }
if (location == CELL_GCM_LOCATION_MAIN) { if (location == CELL_GCM_LOCATION_MAIN) {
@ -146,7 +146,7 @@ u32 cellGcmGetNotifyDataAddress(u32 index)
*/ */
u32 _cellGcmFunc12() u32 _cellGcmFunc12()
{ {
return Memory.RSXFBMem.GetStartAddr(); // TODO return (u32)Memory.RSXFBMem.GetStartAddr(); // TODO
} }
u32 cellGcmGetReport(u32 type, u32 index) u32 cellGcmGetReport(u32 type, u32 index)
@ -174,7 +174,7 @@ u32 cellGcmGetReportDataAddress(u32 index)
cellGcmSys->Error("cellGcmGetReportDataAddress: Wrong local index (%d)", index); cellGcmSys->Error("cellGcmGetReportDataAddress: Wrong local index (%d)", index);
return 0; return 0;
} }
return Memory.RSXFBMem.GetStartAddr() + index * 0x10; return (u32)Memory.RSXFBMem.GetStartAddr() + index * 0x10;
} }
u32 cellGcmGetReportDataLocation(u32 index, u32 location) u32 cellGcmGetReportDataLocation(u32 index, u32 location)
@ -332,7 +332,7 @@ s32 _cellGcmInitBody(mem_ptr_t<CellGcmContextData> context, u32 cmdSize, u32 ioS
if(!local_size && !local_addr) if(!local_size && !local_addr)
{ {
local_size = 0xf900000; // TODO: Get sdk_version in _cellGcmFunc15 and pass it to gcmGetLocalMemorySize local_size = 0xf900000; // TODO: Get sdk_version in _cellGcmFunc15 and pass it to gcmGetLocalMemorySize
local_addr = Memory.RSXFBMem.GetStartAddr(); local_addr = (u32)Memory.RSXFBMem.GetStartAddr();
Memory.RSXFBMem.AllocAlign(local_size); Memory.RSXFBMem.AllocAlign(local_size);
} }
@ -374,7 +374,7 @@ s32 _cellGcmInitBody(mem_ptr_t<CellGcmContextData> context, u32 cmdSize, u32 ioS
current_context.current = current_context.begin; current_context.current = current_context.begin;
current_context.callback = Emu.GetRSXCallback() - 4; current_context.callback = Emu.GetRSXCallback() - 4;
gcm_info.context_addr = Memory.MainMem.AllocAlign(0x1000); gcm_info.context_addr = (u32)Memory.MainMem.AllocAlign(0x1000);
gcm_info.control_addr = gcm_info.context_addr + 0x40; gcm_info.control_addr = gcm_info.context_addr + 0x40;
Memory.WriteData(gcm_info.context_addr, current_context); Memory.WriteData(gcm_info.context_addr, current_context);
@ -387,9 +387,9 @@ s32 _cellGcmInitBody(mem_ptr_t<CellGcmContextData> context, u32 cmdSize, u32 ioS
auto& render = Emu.GetGSManager().GetRender(); auto& render = Emu.GetGSManager().GetRender();
render.m_ctxt_addr = context.GetAddr(); render.m_ctxt_addr = context.GetAddr();
render.m_gcm_buffers_addr = Memory.Alloc(sizeof(CellGcmDisplayInfo) * 8, sizeof(CellGcmDisplayInfo)); render.m_gcm_buffers_addr = (u32)Memory.Alloc(sizeof(CellGcmDisplayInfo) * 8, sizeof(CellGcmDisplayInfo));
render.m_zculls_addr = Memory.Alloc(sizeof(CellGcmZcullInfo) * 8, sizeof(CellGcmZcullInfo)); render.m_zculls_addr = (u32)Memory.Alloc(sizeof(CellGcmZcullInfo) * 8, sizeof(CellGcmZcullInfo));
render.m_tiles_addr = Memory.Alloc(sizeof(CellGcmTileInfo) * 15, sizeof(CellGcmTileInfo)); render.m_tiles_addr = (u32)Memory.Alloc(sizeof(CellGcmTileInfo) * 15, sizeof(CellGcmTileInfo));
render.m_gcm_buffers_count = 0; render.m_gcm_buffers_count = 0;
render.m_gcm_current_buffer = 0; render.m_gcm_current_buffer = 0;
render.m_main_mem_addr = 0; render.m_main_mem_addr = 0;
@ -814,7 +814,7 @@ s32 cellGcmAddressToOffset(u64 address, mem32_t offset)
// Address in local memory // Address in local memory
if (Memory.RSXFBMem.IsInMyRange(address)) { if (Memory.RSXFBMem.IsInMyRange(address)) {
result = address - Memory.RSXFBMem.GetStartAddr(); result = (u32)(address - Memory.RSXFBMem.GetStartAddr());
} }
// Address in main memory else check // Address in main memory else check
else else
@ -838,7 +838,7 @@ u32 cellGcmGetMaxIoMapSize()
{ {
cellGcmSys->Log("cellGcmGetMaxIoMapSize()"); cellGcmSys->Log("cellGcmGetMaxIoMapSize()");
return Memory.RSXIOMem.GetEndAddr() - Memory.RSXIOMem.GetStartAddr() - Memory.RSXIOMem.GetReservedAmount(); return (u32)(Memory.RSXIOMem.GetEndAddr() - Memory.RSXIOMem.GetStartAddr() - Memory.RSXIOMem.GetReservedAmount());
} }
void cellGcmGetOffsetTable(mem_ptr_t<CellGcmOffsetTable> table) void cellGcmGetOffsetTable(mem_ptr_t<CellGcmOffsetTable> table)
@ -901,7 +901,7 @@ s32 cellGcmMapLocalMemory(u64 address, u64 size)
if (!local_size && !local_addr) if (!local_size && !local_addr)
{ {
local_size = 0xf900000; //TODO local_size = 0xf900000; //TODO
local_addr = Memory.RSXFBMem.GetStartAddr(); local_addr = (u32)Memory.RSXFBMem.GetStartAddr();
Memory.RSXFBMem.AllocAlign(local_size); Memory.RSXFBMem.AllocAlign(local_size);
Memory.Write32(address, local_addr); Memory.Write32(address, local_addr);
Memory.Write32(size, local_size); Memory.Write32(size, local_size);
@ -915,25 +915,25 @@ s32 cellGcmMapLocalMemory(u64 address, u64 size)
return CELL_OK; return CELL_OK;
} }
s32 cellGcmMapMainMemory(u64 ea, u32 size, mem32_t offset) s32 cellGcmMapMainMemory(u32 ea, u32 size, mem32_t offset)
{ {
cellGcmSys->Warning("cellGcmMapMainMemory(ea=0x%x,size=0x%x,offset_addr=0x%x)", ea, size, offset.GetAddr()); cellGcmSys->Warning("cellGcmMapMainMemory(ea=0x%x,size=0x%x,offset_addr=0x%x)", ea, size, offset.GetAddr());
u64 io; u32 io;
if ((ea & 0xFFFFF) || (size & 0xFFFFF)) return CELL_GCM_ERROR_FAILURE; if ((ea & 0xFFFFF) || (size & 0xFFFFF)) return CELL_GCM_ERROR_FAILURE;
//check if the mapping was successfull //check if the mapping was successfull
if (io = Memory.RSXIOMem.Map(ea, size, 0)) if (io = (u32)Memory.RSXIOMem.Map(ea, size, 0))
{ {
// convert to offset // convert to offset
io = io - Memory.RSXIOMem.GetStartAddr(); io = io - (u32)Memory.RSXIOMem.GetStartAddr();
//fill the offset table //fill the offset table
for (u32 i = 0; i<(size >> 20); i++) for (u32 i = 0; i<(size >> 20); i++)
{ {
Memory.Write16(offsetTable.ioAddress + ((ea >> 20) + i)*sizeof(u16), (io >> 20) + i); Memory.Write16(offsetTable.ioAddress + ((ea >> 20) + i) * sizeof(u16), (u16)(io >> 20) + i);
Memory.Write16(offsetTable.eaAddress + ((io >> 20) + i)*sizeof(u16), (ea >> 20) + i); Memory.Write16(offsetTable.eaAddress + ((io >> 20) + i) * sizeof(u16), (u16)(ea >> 20) + i);
} }
offset = io; offset = io;

View File

@ -30,7 +30,7 @@ void cellGcmGetOffsetTable(mem_ptr_t<CellGcmOffsetTable> table);
s32 cellGcmIoOffsetToAddress(u32 ioOffset, u64 address); s32 cellGcmIoOffsetToAddress(u32 ioOffset, u64 address);
s32 cellGcmMapEaIoAddress(u32 ea, u32 io, u32 size); s32 cellGcmMapEaIoAddress(u32 ea, u32 io, u32 size);
s32 cellGcmMapEaIoAddressWithFlags(u32 ea, u32 io, u32 size, u32 flags); s32 cellGcmMapEaIoAddressWithFlags(u32 ea, u32 io, u32 size, u32 flags);
s32 cellGcmMapMainMemory(u64 ea, u32 size, mem32_t offset); s32 cellGcmMapMainMemory(u32 ea, u32 size, mem32_t offset);
s32 cellGcmReserveIoMapSize(u32 size); s32 cellGcmReserveIoMapSize(u32 size);
s32 cellGcmUnmapEaIoAddress(u64 ea); s32 cellGcmUnmapEaIoAddress(u64 ea);
s32 cellGcmUnmapIoAddress(u64 io); s32 cellGcmUnmapIoAddress(u64 io);

View File

@ -84,7 +84,7 @@ int cellGifDecReadHeader(u32 mainHandle, u32 subHandle, mem_ptr_t<CellGifDecInfo
case se32(CELL_GIFDEC_FILE): case se32(CELL_GIFDEC_FILE):
cellFsLseek(fd, 0, CELL_SEEK_SET, pos.GetAddr()); cellFsLseek(fd, 0, CELL_SEEK_SET, pos.GetAddr());
cellFsRead(fd, buffer.GetAddr(), buffer.GetSize(), nread); cellFsRead(fd, buffer.GetAddr(), buffer.GetSize(), nread.GetAddr());
break; break;
} }
@ -155,7 +155,7 @@ int cellGifDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const m
const CellGifDecOutParam& current_outParam = subHandle_data->outParam; const CellGifDecOutParam& current_outParam = subHandle_data->outParam;
//Copy the GIF file to a buffer //Copy the GIF file to a buffer
MemoryAllocator<unsigned char> gif(fileSize); MemoryAllocator<unsigned char> gif((u32)fileSize);
MemoryAllocator<u64> pos, nread; MemoryAllocator<u64> pos, nread;
switch(subHandle_data->src.srcSelect.ToBE()) switch(subHandle_data->src.srcSelect.ToBE())
@ -166,7 +166,7 @@ int cellGifDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const m
case se32(CELL_GIFDEC_FILE): case se32(CELL_GIFDEC_FILE):
cellFsLseek(fd, 0, CELL_SEEK_SET, pos.GetAddr()); cellFsLseek(fd, 0, CELL_SEEK_SET, pos.GetAddr());
cellFsRead(fd, gif.GetAddr(), gif.GetSize(), nread); cellFsRead(fd, gif.GetAddr(), gif.GetSize(), nread.GetAddr());
break; break;
} }
@ -174,14 +174,14 @@ int cellGifDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const m
int width, height, actual_components; int width, height, actual_components;
auto image = std::unique_ptr<unsigned char,decltype(&::free)> auto image = std::unique_ptr<unsigned char,decltype(&::free)>
( (
stbi_load_from_memory(gif.GetPtr(), fileSize, &width, &height, &actual_components, 4), stbi_load_from_memory(gif.GetPtr(), (s32)fileSize, &width, &height, &actual_components, 4),
&::free &::free
); );
if (!image) if (!image)
return CELL_GIFDEC_ERROR_STREAM_FORMAT; return CELL_GIFDEC_ERROR_STREAM_FORMAT;
const int bytesPerLine = dataCtrlParam->outputBytesPerLine; const int bytesPerLine = (u32)dataCtrlParam->outputBytesPerLine;
const char nComponents = 4; const char nComponents = 4;
uint image_size = width * height * nComponents; uint image_size = width * height * nComponents;

View File

@ -93,7 +93,7 @@ int cellJpgDecReadHeader(u32 mainHandle, u32 subHandle, mem_ptr_t<CellJpgDecInfo
CellJpgDecInfo& current_info = subHandle_data->info; CellJpgDecInfo& current_info = subHandle_data->info;
//Write the header to buffer //Write the header to buffer
MemoryAllocator<u8> buffer(fileSize); MemoryAllocator<u8> buffer((u32)fileSize);
MemoryAllocator<be_t<u64>> pos, nread; MemoryAllocator<be_t<u64>> pos, nread;
switch(subHandle_data->src.srcSelect.ToBE()) switch(subHandle_data->src.srcSelect.ToBE())
@ -104,7 +104,7 @@ int cellJpgDecReadHeader(u32 mainHandle, u32 subHandle, mem_ptr_t<CellJpgDecInfo
case se32(CELL_JPGDEC_FILE): case se32(CELL_JPGDEC_FILE):
cellFsLseek(fd, 0, CELL_SEEK_SET, pos.GetAddr()); cellFsLseek(fd, 0, CELL_SEEK_SET, pos.GetAddr());
cellFsRead(fd, buffer.GetAddr(), buffer.GetSize(), nread); cellFsRead(fd, buffer.GetAddr(), buffer.GetSize(), nread.GetAddr());
break; break;
} }
@ -162,7 +162,7 @@ int cellJpgDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const m
const CellJpgDecOutParam& current_outParam = subHandle_data->outParam; const CellJpgDecOutParam& current_outParam = subHandle_data->outParam;
//Copy the JPG file to a buffer //Copy the JPG file to a buffer
MemoryAllocator<unsigned char> jpg(fileSize); MemoryAllocator<unsigned char> jpg((u32)fileSize);
MemoryAllocator<u64> pos, nread; MemoryAllocator<u64> pos, nread;
switch(subHandle_data->src.srcSelect.ToBE()) switch(subHandle_data->src.srcSelect.ToBE())
@ -173,7 +173,7 @@ int cellJpgDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const m
case se32(CELL_JPGDEC_FILE): case se32(CELL_JPGDEC_FILE):
cellFsLseek(fd, 0, CELL_SEEK_SET, pos.GetAddr()); cellFsLseek(fd, 0, CELL_SEEK_SET, pos.GetAddr());
cellFsRead(fd, jpg.GetAddr(), jpg.GetSize(), nread); cellFsRead(fd, jpg.GetAddr(), jpg.GetSize(), nread.GetAddr());
break; break;
} }
@ -181,7 +181,7 @@ int cellJpgDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const m
int width, height, actual_components; int width, height, actual_components;
auto image = std::unique_ptr<unsigned char,decltype(&::free)> auto image = std::unique_ptr<unsigned char,decltype(&::free)>
( (
stbi_load_from_memory(jpg.GetPtr(), fileSize, &width, &height, &actual_components, 4), stbi_load_from_memory(jpg.GetPtr(), (s32)fileSize, &width, &height, &actual_components, 4),
&::free &::free
); );
@ -189,7 +189,7 @@ int cellJpgDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const m
return CELL_JPGDEC_ERROR_STREAM_FORMAT; return CELL_JPGDEC_ERROR_STREAM_FORMAT;
const bool flip = current_outParam.outputMode == CELL_JPGDEC_BOTTOM_TO_TOP; const bool flip = current_outParam.outputMode == CELL_JPGDEC_BOTTOM_TO_TOP;
const int bytesPerLine = dataCtrlParam->outputBytesPerLine; const int bytesPerLine = (u32)dataCtrlParam->outputBytesPerLine;
size_t image_size = width * height; size_t image_size = width * height;
switch((u32)current_outParam.outputColorSpace) switch((u32)current_outParam.outputColorSpace)
@ -274,7 +274,7 @@ int cellJpgDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const m
dataOutInfo->status = CELL_JPGDEC_DEC_STATUS_FINISH; dataOutInfo->status = CELL_JPGDEC_DEC_STATUS_FINISH;
if(dataCtrlParam->outputBytesPerLine) if(dataCtrlParam->outputBytesPerLine)
dataOutInfo->outputLines = image_size / dataCtrlParam->outputBytesPerLine; dataOutInfo->outputLines = (u32)(image_size / dataCtrlParam->outputBytesPerLine);
return CELL_OK; return CELL_OK;
} }

View File

@ -122,7 +122,7 @@ int cellMsgDialogOpen2(u32 type, mem_list_ptr_t<u8> msgString, mem_func_ptr_t<Ce
} }
if (callback && (g_msg_dialog_state != msgDialogAbort)) if (callback && (g_msg_dialog_state != msgDialogAbort))
callback.async(status, userData); callback.async((s32)status, userData); // TODO: this callback should be registered
CallAfter([&]() CallAfter([&]()
{ {
@ -230,7 +230,7 @@ int cellMsgDialogOpenErrorCode(u32 errorCode, mem_func_ptr_t<CellMsgDialogCallba
} }
if (callback) if (callback)
callback(status, userData); callback((s32)status, userData);
return CELL_OK; return CELL_OK;
} }

View File

@ -198,7 +198,7 @@ int cellPngDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const m
const CellPngDecOutParam& current_outParam = subHandle_data->outParam; const CellPngDecOutParam& current_outParam = subHandle_data->outParam;
//Copy the PNG file to a buffer //Copy the PNG file to a buffer
MemoryAllocator<unsigned char> png(fileSize); MemoryAllocator<unsigned char> png((u32)fileSize);
MemoryAllocator<u64> pos, nread; MemoryAllocator<u64> pos, nread;
switch(subHandle_data->src.srcSelect.ToBE()) switch(subHandle_data->src.srcSelect.ToBE())
@ -217,13 +217,13 @@ int cellPngDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const m
int width, height, actual_components; int width, height, actual_components;
auto image = std::unique_ptr<unsigned char,decltype(&::free)> auto image = std::unique_ptr<unsigned char,decltype(&::free)>
( (
stbi_load_from_memory(png.GetPtr(), fileSize, &width, &height, &actual_components, 4), stbi_load_from_memory(png.GetPtr(), (s32)fileSize, &width, &height, &actual_components, 4),
&::free &::free
); );
if (!image) return CELL_PNGDEC_ERROR_STREAM_FORMAT; if (!image) return CELL_PNGDEC_ERROR_STREAM_FORMAT;
const bool flip = current_outParam.outputMode == CELL_PNGDEC_BOTTOM_TO_TOP; const bool flip = current_outParam.outputMode == CELL_PNGDEC_BOTTOM_TO_TOP;
const int bytesPerLine = 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)

View File

@ -15,7 +15,7 @@ PICTURE_SIZE = (1.0f),
UV_DELTA_PS = (1.f / 8.f), UV_DELTA_PS = (1.f / 8.f),
UV_DELTA_LB = (1.f / 6.f), UV_DELTA_LB = (1.f / 6.f),
XY_DELTA_LB = (1.f / 8.f), XY_DELTA_LB = (1.f / 8.f),
PI = 3.1415926535897932384626433832795; PI = 3.141592741f;
void BuildupVertexBufferNR() void BuildupVertexBufferNR()
{ {
@ -124,8 +124,8 @@ void BuildupVertexBufferUN(s32 srcIdx)
float U_PS1 = U_CENTER + U_PS; float U_PS1 = U_CENTER + U_PS;
float U2_FS0 = 0.0f; float U2_FS0 = 0.0f;
float V2_FS0 = 0.0f; float V2_FS0 = 0.0f;
float U2_FS1 = s_rescInternalInstance->m_dstWidth; float U2_FS1 = (float)s_rescInternalInstance->m_dstWidth;
float V2_FS1 = s_rescInternalInstance->m_dstHeight; float V2_FS1 = (float)s_rescInternalInstance->m_dstHeight;
mem_ptr_t<RescVertex_t> vv(s_rescInternalInstance->m_vertexArrayEA); mem_ptr_t<RescVertex_t> vv(s_rescInternalInstance->m_vertexArrayEA);

View File

@ -225,7 +225,7 @@ int cellRtcTickAddMinutes(mem_ptr_t<CellRtcTick> pTick0, mem_ptr_t<CellRtcTick>
cellRtc->Log("cellRtcTickAddMinutes(pTick0=0x%x, pTick1=0x%x, lAdd=%lld)", pTick0.GetAddr(), pTick1.GetAddr(), lAdd); cellRtc->Log("cellRtcTickAddMinutes(pTick0=0x%x, pTick1=0x%x, lAdd=%lld)", pTick0.GetAddr(), pTick1.GetAddr(), lAdd);
rDateTime date = rDateTime((time_t)pTick1->tick); rDateTime date = rDateTime((time_t)pTick1->tick);
rTimeSpan minutes = rTimeSpan(0, lAdd, 0, 0); rTimeSpan minutes = rTimeSpan(0, lAdd, 0, 0); // ???
date.Add(minutes); date.Add(minutes);
pTick0->tick = date.GetTicks(); pTick0->tick = date.GetTicks();
@ -237,7 +237,7 @@ int cellRtcTickAddHours(mem_ptr_t<CellRtcTick> pTick0, mem_ptr_t<CellRtcTick> pT
cellRtc->Log("cellRtcTickAddHours(pTick0=0x%x, pTick1=0x%x, iAdd=%d)", pTick0.GetAddr(), pTick1.GetAddr(), iAdd); cellRtc->Log("cellRtcTickAddHours(pTick0=0x%x, pTick1=0x%x, iAdd=%d)", pTick0.GetAddr(), pTick1.GetAddr(), iAdd);
rDateTime date = rDateTime((time_t)pTick1->tick); rDateTime date = rDateTime((time_t)pTick1->tick);
rTimeSpan hours = rTimeSpan(iAdd, 0, 0, 0); rTimeSpan hours = rTimeSpan(iAdd, 0, 0, 0); // ???
date.Add(hours); date.Add(hours);
pTick0->tick = date.GetTicks(); pTick0->tick = date.GetTicks();
@ -249,7 +249,7 @@ int cellRtcTickAddDays(mem_ptr_t<CellRtcTick> pTick0, mem_ptr_t<CellRtcTick> pTi
cellRtc->Log("cellRtcTickAddDays(pTick0=0x%x, pTick1=0x%x, iAdd=%d)", pTick0.GetAddr(), pTick1.GetAddr(), iAdd); cellRtc->Log("cellRtcTickAddDays(pTick0=0x%x, pTick1=0x%x, iAdd=%d)", pTick0.GetAddr(), pTick1.GetAddr(), iAdd);
rDateTime date = rDateTime((time_t)pTick1->tick); rDateTime date = rDateTime((time_t)pTick1->tick);
rDateSpan days = rDateSpan(0, 0, 0, iAdd); rDateSpan days = rDateSpan(0, 0, 0, iAdd); // ???
date.Add(days); date.Add(days);
pTick0->tick = date.GetTicks(); pTick0->tick = date.GetTicks();

File diff suppressed because it is too large Load Diff

View File

@ -764,7 +764,7 @@ void cellSpursJq_init()
#ifdef PRX_DEBUG #ifdef PRX_DEBUG
CallAfter([]() CallAfter([]()
{ {
libspurs_jq = Memory.PRXMem.AllocAlign(sizeof(libspurs_jq_data), 4096); libspurs_jq = (u32)Memory.PRXMem.AllocAlign(sizeof(libspurs_jq_data), 4096);
memcpy(Memory + libspurs_jq, libspurs_jq_data, sizeof(libspurs_jq_data)); memcpy(Memory + libspurs_jq, libspurs_jq_data, sizeof(libspurs_jq_data));
libspurs_jq_rtoc = libspurs_jq + 0x17E80; libspurs_jq_rtoc = libspurs_jq + 0x17E80;

View File

@ -1451,7 +1451,7 @@ s32 syncLFQueueCompletePushPointer(mem_ptr_t<CellSyncLFQueue> queue, s32 pointer
if (exch) if (exch)
{ {
assert(fpSendSignal); assert(fpSendSignal);
return fpSendSignal((u64)queue->m_eaSignal, var6); return fpSendSignal((u32)queue->m_eaSignal, var6);
} }
} }
else else
@ -1532,7 +1532,7 @@ s32 _cellSyncLFQueuePushBody(mem_ptr_t<CellSyncLFQueue> queue, u32 buffer_addr,
else else
{ {
#ifdef PRX_DEBUG #ifdef PRX_DEBUG
res = GetCurrentPPUThread().FastCall(libsre + 0x3050, libsre_rtoc, queue.GetAddr(), position_v.GetAddr(), isBlocking, 0); res = (s32)GetCurrentPPUThread().FastCall(libsre + 0x3050, libsre_rtoc, queue.GetAddr(), position_v.GetAddr(), isBlocking, 0);
position = position_v->ToLE(); position = position_v->ToLE();
#else #else
res = syncLFQueueGetPushPointer2(queue, position, isBlocking, 0); res = syncLFQueueGetPushPointer2(queue, position, isBlocking, 0);
@ -1575,7 +1575,7 @@ s32 _cellSyncLFQueuePushBody(mem_ptr_t<CellSyncLFQueue> queue, u32 buffer_addr,
else else
{ {
#ifdef PRX_DEBUG #ifdef PRX_DEBUG
res = GetCurrentPPUThread().FastCall(libsre + 0x355C, libsre_rtoc, queue.GetAddr(), position, 0); res = (s32)GetCurrentPPUThread().FastCall(libsre + 0x355C, libsre_rtoc, queue.GetAddr(), position, 0);
#else #else
res = syncLFQueueCompletePushPointer2(queue, position, nullptr); res = syncLFQueueCompletePushPointer2(queue, position, nullptr);
#endif #endif
@ -1844,7 +1844,7 @@ s32 syncLFQueueCompletePopPointer(mem_ptr_t<CellSyncLFQueue> queue, s32 pointer,
if (exch) if (exch)
{ {
assert(fpSendSignal); assert(fpSendSignal);
return fpSendSignal((u64)queue->m_eaSignal, var6); return fpSendSignal((u32)queue->m_eaSignal, var6);
} }
} }
else else
@ -1923,7 +1923,7 @@ s32 _cellSyncLFQueuePopBody(mem_ptr_t<CellSyncLFQueue> queue, u32 buffer_addr, u
else else
{ {
#ifdef PRX_DEBUG #ifdef PRX_DEBUG
res = GetCurrentPPUThread().FastCall(libsre + 0x39AC, libsre_rtoc, queue.GetAddr(), position_v.GetAddr(), isBlocking, 0); res = (s32)GetCurrentPPUThread().FastCall(libsre + 0x39AC, libsre_rtoc, queue.GetAddr(), position_v.GetAddr(), isBlocking, 0);
position = position_v->ToLE(); position = position_v->ToLE();
#else #else
res = syncLFQueueGetPopPointer2(queue, position, isBlocking, 0); res = syncLFQueueGetPopPointer2(queue, position, isBlocking, 0);
@ -1963,7 +1963,7 @@ s32 _cellSyncLFQueuePopBody(mem_ptr_t<CellSyncLFQueue> queue, u32 buffer_addr, u
else else
{ {
#ifdef PRX_DEBUG #ifdef PRX_DEBUG
res = GetCurrentPPUThread().FastCall(libsre + 0x3EB8, libsre_rtoc, queue.GetAddr(), position, 0, 0); res = (s32)GetCurrentPPUThread().FastCall(libsre + 0x3EB8, libsre_rtoc, queue.GetAddr(), position, 0, 0);
#else #else
res = syncLFQueueCompletePopPointer2(queue, position, nullptr, 0); res = syncLFQueueCompletePopPointer2(queue, position, nullptr, 0);
#endif #endif
@ -2088,7 +2088,7 @@ s32 _cellSyncLFQueueGetSignalAddress(mem_ptr_t<CellSyncLFQueue> queue, mem32_t p
return CELL_SYNC_ERROR_ALIGN; return CELL_SYNC_ERROR_ALIGN;
} }
ppSignal = queue->m_eaSignal; ppSignal = (u32)queue->m_eaSignal;
return CELL_OK; return CELL_OK;
} }
@ -2206,7 +2206,7 @@ void cellSync_init()
#ifdef PRX_DEBUG #ifdef PRX_DEBUG
CallAfter([]() CallAfter([]()
{ {
libsre = Memory.PRXMem.AllocAlign(sizeof(libsre_data), 4096); libsre = (u32)Memory.PRXMem.AllocAlign(sizeof(libsre_data), 4096);
memcpy(Memory + libsre, libsre_data, sizeof(libsre_data)); memcpy(Memory + libsre, libsre_data, sizeof(libsre_data));
libsre_rtoc = libsre + 0x399B0; libsre_rtoc = libsre + 0x399B0;

View File

@ -15,7 +15,7 @@ u32 libsync2;
u32 libsync2_rtoc; u32 libsync2_rtoc;
#endif #endif
int _cellSync2MutexAttributeInitialize() s64 _cellSync2MutexAttributeInitialize()
{ {
#ifdef PRX_DEBUG #ifdef PRX_DEBUG
cellSync2->Warning("%s()", __FUNCTION__); cellSync2->Warning("%s()", __FUNCTION__);
@ -26,7 +26,7 @@ int _cellSync2MutexAttributeInitialize()
#endif #endif
} }
int cellSync2MutexEstimateBufferSize() s64 cellSync2MutexEstimateBufferSize()
{ {
#ifdef PRX_DEBUG #ifdef PRX_DEBUG
cellSync2->Warning("%s()", __FUNCTION__); cellSync2->Warning("%s()", __FUNCTION__);
@ -37,7 +37,7 @@ int cellSync2MutexEstimateBufferSize()
#endif #endif
} }
int cellSync2MutexInitialize() s64 cellSync2MutexInitialize()
{ {
#ifdef PRX_DEBUG #ifdef PRX_DEBUG
cellSync2->Warning("%s()", __FUNCTION__); cellSync2->Warning("%s()", __FUNCTION__);
@ -48,7 +48,7 @@ int cellSync2MutexInitialize()
#endif #endif
} }
int cellSync2MutexFinalize() s64 cellSync2MutexFinalize()
{ {
#ifdef PRX_DEBUG #ifdef PRX_DEBUG
cellSync2->Warning("%s()", __FUNCTION__); cellSync2->Warning("%s()", __FUNCTION__);
@ -59,7 +59,7 @@ int cellSync2MutexFinalize()
#endif #endif
} }
int cellSync2MutexLock() s64 cellSync2MutexLock()
{ {
#ifdef PRX_DEBUG #ifdef PRX_DEBUG
cellSync2->Warning("%s()", __FUNCTION__); cellSync2->Warning("%s()", __FUNCTION__);
@ -70,7 +70,7 @@ int cellSync2MutexLock()
#endif #endif
} }
int cellSync2MutexTryLock() s64 cellSync2MutexTryLock()
{ {
#ifdef PRX_DEBUG #ifdef PRX_DEBUG
cellSync2->Warning("%s()", __FUNCTION__); cellSync2->Warning("%s()", __FUNCTION__);
@ -81,7 +81,7 @@ int cellSync2MutexTryLock()
#endif #endif
} }
int cellSync2MutexUnlock() s64 cellSync2MutexUnlock()
{ {
#ifdef PRX_DEBUG #ifdef PRX_DEBUG
cellSync2->Warning("%s()", __FUNCTION__); cellSync2->Warning("%s()", __FUNCTION__);
@ -92,7 +92,7 @@ int cellSync2MutexUnlock()
#endif #endif
} }
int _cellSync2CondAttributeInitialize() s64 _cellSync2CondAttributeInitialize()
{ {
#ifdef PRX_DEBUG #ifdef PRX_DEBUG
cellSync2->Warning("%s()", __FUNCTION__); cellSync2->Warning("%s()", __FUNCTION__);
@ -103,7 +103,7 @@ int _cellSync2CondAttributeInitialize()
#endif #endif
} }
int cellSync2CondEstimateBufferSize() s64 cellSync2CondEstimateBufferSize()
{ {
#ifdef PRX_DEBUG #ifdef PRX_DEBUG
cellSync2->Warning("%s()", __FUNCTION__); cellSync2->Warning("%s()", __FUNCTION__);
@ -114,7 +114,7 @@ int cellSync2CondEstimateBufferSize()
#endif #endif
} }
int cellSync2CondInitialize() s64 cellSync2CondInitialize()
{ {
#ifdef PRX_DEBUG #ifdef PRX_DEBUG
cellSync2->Warning("%s()", __FUNCTION__); cellSync2->Warning("%s()", __FUNCTION__);
@ -125,7 +125,7 @@ int cellSync2CondInitialize()
#endif #endif
} }
int cellSync2CondFinalize() s64 cellSync2CondFinalize()
{ {
#ifdef PRX_DEBUG #ifdef PRX_DEBUG
cellSync2->Warning("%s()", __FUNCTION__); cellSync2->Warning("%s()", __FUNCTION__);
@ -136,7 +136,7 @@ int cellSync2CondFinalize()
#endif #endif
} }
int cellSync2CondWait() s64 cellSync2CondWait()
{ {
#ifdef PRX_DEBUG #ifdef PRX_DEBUG
cellSync2->Warning("%s()", __FUNCTION__); cellSync2->Warning("%s()", __FUNCTION__);
@ -147,7 +147,7 @@ int cellSync2CondWait()
#endif #endif
} }
int cellSync2CondSignal() s64 cellSync2CondSignal()
{ {
#ifdef PRX_DEBUG #ifdef PRX_DEBUG
cellSync2->Warning("%s()", __FUNCTION__); cellSync2->Warning("%s()", __FUNCTION__);
@ -158,7 +158,7 @@ int cellSync2CondSignal()
#endif #endif
} }
int cellSync2CondSignalAll() s64 cellSync2CondSignalAll()
{ {
#ifdef PRX_DEBUG #ifdef PRX_DEBUG
cellSync2->Warning("%s()", __FUNCTION__); cellSync2->Warning("%s()", __FUNCTION__);
@ -169,7 +169,7 @@ int cellSync2CondSignalAll()
#endif #endif
} }
int _cellSync2SemaphoreAttributeInitialize() s64 _cellSync2SemaphoreAttributeInitialize()
{ {
#ifdef PRX_DEBUG #ifdef PRX_DEBUG
cellSync2->Warning("%s()", __FUNCTION__); cellSync2->Warning("%s()", __FUNCTION__);
@ -180,7 +180,7 @@ int _cellSync2SemaphoreAttributeInitialize()
#endif #endif
} }
int cellSync2SemaphoreEstimateBufferSize() s64 cellSync2SemaphoreEstimateBufferSize()
{ {
#ifdef PRX_DEBUG #ifdef PRX_DEBUG
cellSync2->Warning("%s()", __FUNCTION__); cellSync2->Warning("%s()", __FUNCTION__);
@ -191,7 +191,7 @@ int cellSync2SemaphoreEstimateBufferSize()
#endif #endif
} }
int cellSync2SemaphoreInitialize() s64 cellSync2SemaphoreInitialize()
{ {
#ifdef PRX_DEBUG #ifdef PRX_DEBUG
cellSync2->Warning("%s()", __FUNCTION__); cellSync2->Warning("%s()", __FUNCTION__);
@ -202,7 +202,7 @@ int cellSync2SemaphoreInitialize()
#endif #endif
} }
int cellSync2SemaphoreFinalize() s64 cellSync2SemaphoreFinalize()
{ {
#ifdef PRX_DEBUG #ifdef PRX_DEBUG
cellSync2->Warning("%s()", __FUNCTION__); cellSync2->Warning("%s()", __FUNCTION__);
@ -213,7 +213,7 @@ int cellSync2SemaphoreFinalize()
#endif #endif
} }
int cellSync2SemaphoreAcquire() s64 cellSync2SemaphoreAcquire()
{ {
#ifdef PRX_DEBUG #ifdef PRX_DEBUG
cellSync2->Warning("%s()", __FUNCTION__); cellSync2->Warning("%s()", __FUNCTION__);
@ -224,7 +224,7 @@ int cellSync2SemaphoreAcquire()
#endif #endif
} }
int cellSync2SemaphoreTryAcquire() s64 cellSync2SemaphoreTryAcquire()
{ {
#ifdef PRX_DEBUG #ifdef PRX_DEBUG
cellSync2->Warning("%s()", __FUNCTION__); cellSync2->Warning("%s()", __FUNCTION__);
@ -235,7 +235,7 @@ int cellSync2SemaphoreTryAcquire()
#endif #endif
} }
int cellSync2SemaphoreRelease() s64 cellSync2SemaphoreRelease()
{ {
#ifdef PRX_DEBUG #ifdef PRX_DEBUG
cellSync2->Warning("%s()", __FUNCTION__); cellSync2->Warning("%s()", __FUNCTION__);
@ -246,7 +246,7 @@ int cellSync2SemaphoreRelease()
#endif #endif
} }
int cellSync2SemaphoreGetCount() s64 cellSync2SemaphoreGetCount()
{ {
#ifdef PRX_DEBUG #ifdef PRX_DEBUG
cellSync2->Warning("%s()", __FUNCTION__); cellSync2->Warning("%s()", __FUNCTION__);
@ -257,7 +257,7 @@ int cellSync2SemaphoreGetCount()
#endif #endif
} }
int _cellSync2QueueAttributeInitialize() s64 _cellSync2QueueAttributeInitialize()
{ {
#ifdef PRX_DEBUG #ifdef PRX_DEBUG
cellSync2->Warning("%s()", __FUNCTION__); cellSync2->Warning("%s()", __FUNCTION__);
@ -268,7 +268,7 @@ int _cellSync2QueueAttributeInitialize()
#endif #endif
} }
int cellSync2QueueEstimateBufferSize() s64 cellSync2QueueEstimateBufferSize()
{ {
#ifdef PRX_DEBUG #ifdef PRX_DEBUG
cellSync2->Warning("%s()", __FUNCTION__); cellSync2->Warning("%s()", __FUNCTION__);
@ -279,7 +279,7 @@ int cellSync2QueueEstimateBufferSize()
#endif #endif
} }
int cellSync2QueueInitialize() s64 cellSync2QueueInitialize()
{ {
#ifdef PRX_DEBUG #ifdef PRX_DEBUG
cellSync2->Warning("%s()", __FUNCTION__); cellSync2->Warning("%s()", __FUNCTION__);
@ -290,7 +290,7 @@ int cellSync2QueueInitialize()
#endif #endif
} }
int cellSync2QueueFinalize() s64 cellSync2QueueFinalize()
{ {
#ifdef PRX_DEBUG #ifdef PRX_DEBUG
cellSync2->Warning("%s()", __FUNCTION__); cellSync2->Warning("%s()", __FUNCTION__);
@ -301,7 +301,7 @@ int cellSync2QueueFinalize()
#endif #endif
} }
int cellSync2QueuePush() s64 cellSync2QueuePush()
{ {
#ifdef PRX_DEBUG #ifdef PRX_DEBUG
cellSync2->Warning("%s()", __FUNCTION__); cellSync2->Warning("%s()", __FUNCTION__);
@ -312,7 +312,7 @@ int cellSync2QueuePush()
#endif #endif
} }
int cellSync2QueueTryPush() s64 cellSync2QueueTryPush()
{ {
#ifdef PRX_DEBUG #ifdef PRX_DEBUG
cellSync2->Warning("%s()", __FUNCTION__); cellSync2->Warning("%s()", __FUNCTION__);
@ -323,7 +323,7 @@ int cellSync2QueueTryPush()
#endif #endif
} }
int cellSync2QueuePop() s64 cellSync2QueuePop()
{ {
#ifdef PRX_DEBUG #ifdef PRX_DEBUG
cellSync2->Warning("%s()", __FUNCTION__); cellSync2->Warning("%s()", __FUNCTION__);
@ -334,7 +334,7 @@ int cellSync2QueuePop()
#endif #endif
} }
int cellSync2QueueTryPop() s64 cellSync2QueueTryPop()
{ {
#ifdef PRX_DEBUG #ifdef PRX_DEBUG
cellSync2->Warning("%s()", __FUNCTION__); cellSync2->Warning("%s()", __FUNCTION__);
@ -345,7 +345,7 @@ int cellSync2QueueTryPop()
#endif #endif
} }
int cellSync2QueueGetSize() s64 cellSync2QueueGetSize()
{ {
#ifdef PRX_DEBUG #ifdef PRX_DEBUG
cellSync2->Warning("%s()", __FUNCTION__); cellSync2->Warning("%s()", __FUNCTION__);
@ -356,7 +356,7 @@ int cellSync2QueueGetSize()
#endif #endif
} }
int cellSync2QueueGetDepth() s64 cellSync2QueueGetDepth()
{ {
#ifdef PRX_DEBUG #ifdef PRX_DEBUG
cellSync2->Warning("%s()", __FUNCTION__); cellSync2->Warning("%s()", __FUNCTION__);
@ -408,7 +408,7 @@ void cellSync2_init()
#ifdef PRX_DEBUG #ifdef PRX_DEBUG
CallAfter([]() CallAfter([]()
{ {
libsync2 = Memory.PRXMem.AllocAlign(sizeof(libsync2_data), 4096); libsync2 = (u32)Memory.PRXMem.AllocAlign(sizeof(libsync2_data), 4096);
memcpy(Memory + libsync2, libsync2_data, sizeof(libsync2_data)); memcpy(Memory + libsync2, libsync2_data, sizeof(libsync2_data));
libsync2_rtoc = libsync2 + 0xF280; libsync2_rtoc = libsync2 + 0xF280;
@ -427,7 +427,7 @@ void cellSync2_init()
FIX_IMPORT(sysPrxForUser, sys_lwmutex_create , libsync2 + 0x62D0); FIX_IMPORT(sysPrxForUser, sys_lwmutex_create , libsync2 + 0x62D0);
FIX_IMPORT(sysPrxForUser, sys_ppu_thread_get_id , libsync2 + 0x62F0); FIX_IMPORT(sysPrxForUser, sys_ppu_thread_get_id , libsync2 + 0x62F0);
FIX_IMPORT(sysPrxForUser, _sys_memset , libsync2 + 0x6310); FIX_IMPORT(sysPrxForUser, _sys_memset , libsync2 + 0x6310);
FIX_IMPORT(sysPrxForUser, _sys_printf , libsync2 + 0x6330); FIX_IMPORT(sysPrxForUser, _sys_prs64f , libsync2 + 0x6330);
fix_import(sysPrxForUser, 0x9FB6228E , libsync2 + 0x6350); fix_import(sysPrxForUser, 0x9FB6228E , libsync2 + 0x6350);
FIX_IMPORT(sysPrxForUser, sys_lwmutex_destroy , libsync2 + 0x6370); FIX_IMPORT(sysPrxForUser, sys_lwmutex_destroy , libsync2 + 0x6370);
FIX_IMPORT(sysPrxForUser, _sys_strncpy , libsync2 + 0x6390); FIX_IMPORT(sysPrxForUser, _sys_strncpy , libsync2 + 0x6390);

View File

@ -74,7 +74,7 @@ void addSaveDataEntry(std::vector<SaveDataEntry>& saveEntries, const std::string
saveEntry.title = psf.GetString("TITLE"); saveEntry.title = psf.GetString("TITLE");
saveEntry.subtitle = psf.GetString("SUB_TITLE"); saveEntry.subtitle = psf.GetString("SUB_TITLE");
saveEntry.details = psf.GetString("DETAIL"); saveEntry.details = psf.GetString("DETAIL");
saveEntry.sizeKB = getSaveDataSize(saveDir)/1024; saveEntry.sizeKB = (u32)(getSaveDataSize(saveDir) / 1024);
saveEntry.st_atime_ = 0; // TODO saveEntry.st_atime_ = 0; // TODO
saveEntry.st_mtime_ = 0; // TODO saveEntry.st_mtime_ = 0; // TODO
saveEntry.st_ctime_ = 0; // TODO saveEntry.st_ctime_ = 0; // TODO
@ -209,7 +209,7 @@ void getSaveDataStat(SaveDataEntry entry, mem_ptr_t<CellSaveDataStatGet> statGet
} }
} }
statGet->fileList.SetAddr(be_t<u32>::MakeFromLE(Memory.Alloc(sizeof(CellSaveDataFileStat)* fileEntries.size(), sizeof(CellSaveDataFileStat)))); statGet->fileList.SetAddr(be_t<u32>::MakeFromLE((u32)Memory.Alloc(sizeof(CellSaveDataFileStat) * (u32)fileEntries.size(), sizeof(CellSaveDataFileStat))));
for (u32 i=0; i<fileEntries.size(); i++) for (u32 i=0; i<fileEntries.size(); i++)
memcpy(&statGet->fileList[i], &fileEntries[i], sizeof(CellSaveDataFileStat)); memcpy(&statGet->fileList[i], &fileEntries[i], sizeof(CellSaveDataFileStat));
} }
@ -256,13 +256,13 @@ s32 modifySaveDataFiles(mem_func_ptr_t<CellSaveDataFileCallback>& funcFile, mem_
{ {
case CELL_SAVEDATA_FILEOP_READ: case CELL_SAVEDATA_FILEOP_READ:
file = Emu.GetVFS().OpenFile(filepath, vfsRead); file = Emu.GetVFS().OpenFile(filepath, vfsRead);
fileGet->excSize = file->Read(buf, std::min(fileSet->fileSize, fileSet->fileBufSize)); // TODO: This may fail for big files because of the dest pointer. fileGet->excSize = (u32)file->Read(buf, (u32)std::min(fileSet->fileSize, fileSet->fileBufSize)); // TODO: This may fail for big files because of the dest pointer.
break; break;
case CELL_SAVEDATA_FILEOP_WRITE: case CELL_SAVEDATA_FILEOP_WRITE:
Emu.GetVFS().CreateFile(filepath); Emu.GetVFS().CreateFile(filepath);
file = Emu.GetVFS().OpenFile(filepath, vfsWrite); file = Emu.GetVFS().OpenFile(filepath, vfsWrite);
fileGet->excSize = file->Write(buf, std::min(fileSet->fileSize, fileSet->fileBufSize)); // TODO: This may fail for big files because of the dest pointer. fileGet->excSize = (u32)file->Write(buf, (u32)std::min(fileSet->fileSize, fileSet->fileBufSize)); // TODO: This may fail for big files because of the dest pointer.
break; break;
case CELL_SAVEDATA_FILEOP_DELETE: case CELL_SAVEDATA_FILEOP_DELETE:

View File

@ -702,11 +702,11 @@ int cellVdecGetPicItem(u32 handle, mem32_t picItem_ptr)
info->startAddr = 0x00000123; // invalid value (no address for picture) info->startAddr = 0x00000123; // invalid value (no address for picture)
info->size = a128(av_image_get_buffer_size(vdec->ctx->pix_fmt, vdec->ctx->width, vdec->ctx->height, 1)); info->size = a128(av_image_get_buffer_size(vdec->ctx->pix_fmt, vdec->ctx->width, vdec->ctx->height, 1));
info->auNum = 1; info->auNum = 1;
info->auPts[0].lower = vf.pts; info->auPts[0].lower = (u32)vf.pts;
info->auPts[0].upper = vf.pts >> 32; info->auPts[0].upper = vf.pts >> 32;
info->auPts[1].lower = 0xffffffff; info->auPts[1].lower = 0xffffffff;
info->auPts[1].upper = 0xffffffff; info->auPts[1].upper = 0xffffffff;
info->auDts[0].lower = vf.dts; info->auDts[0].lower = (u32)vf.dts;
info->auDts[0].upper = vf.dts >> 32; info->auDts[0].upper = vf.dts >> 32;
info->auDts[1].lower = 0xffffffff; info->auDts[1].lower = 0xffffffff;
info->auDts[1].upper = 0xffffffff; info->auDts[1].upper = 0xffffffff;

View File

@ -162,7 +162,7 @@ int cellSSPlayerCreate(mem32_t handle, mem_ptr_t<CellSSPlayerConfig> config)
p.m_channels = config->channels; p.m_channels = config->channels;
ssp.push_back(p); ssp.push_back(p);
handle = ssp.size() - 1; handle = (u32)ssp.size() - 1;
return CELL_OK; return CELL_OK;
} }

View File

@ -404,7 +404,7 @@ int sceNpTrophyGetTrophyInfo(u32 context, u32 handle, s32 trophyId, mem_ptr_t<Sc
} }
data->trophyId = trophyId; data->trophyId = trophyId;
data->unlocked = ctxt.tropusr->GetTrophyUnlockState(trophyId); data->unlocked = ctxt.tropusr->GetTrophyUnlockState(trophyId) ? true : false; // ???
data->timestamp.tick = ctxt.tropusr->GetTrophyTimestamp(trophyId); data->timestamp.tick = ctxt.tropusr->GetTrophyTimestamp(trophyId);
} }
} }

View File

@ -32,24 +32,24 @@ int _sys_heap_create_heap(const u32 heap_addr, const u32 align, const u32 size)
return heap_id; return heap_id;
} }
int _sys_heap_malloc(const u32 heap_id, const u32 size) u32 _sys_heap_malloc(const u32 heap_id, const u32 size)
{ {
sysPrxForUser->Warning("_sys_heap_malloc(heap_id=%d, size=0x%x)", heap_id, size); sysPrxForUser->Warning("_sys_heap_malloc(heap_id=%d, size=0x%x)", heap_id, size);
HeapInfo* heap; HeapInfo* heap;
if(!sysPrxForUser->CheckId(heap_id, heap)) return CELL_ESRCH; if(!sysPrxForUser->CheckId(heap_id, heap)) return CELL_ESRCH;
return Memory.Alloc(size, 1); return (u32)Memory.Alloc(size, 1);
} }
int _sys_heap_memalign(u32 heap_id, u32 align, u32 size) u32 _sys_heap_memalign(u32 heap_id, u32 align, u32 size)
{ {
sysPrxForUser->Warning("_sys_heap_memalign(heap_id=%d, align=0x%x, size=0x%x)", heap_id, align, size); sysPrxForUser->Warning("_sys_heap_memalign(heap_id=%d, align=0x%x, size=0x%x)", heap_id, align, size);
HeapInfo* heap; HeapInfo* heap;
if(!sysPrxForUser->CheckId(heap_id, heap)) return CELL_ESRCH; if(!sysPrxForUser->CheckId(heap_id, heap)) return CELL_ESRCH;
return Memory.Alloc(size, align); return (u32)Memory.Alloc(size, align);
} }
void sys_initialize_tls() void sys_initialize_tls()
@ -172,7 +172,7 @@ s32 _sys_memcmp(u32 addr1, u32 addr2, u32 size)
return memcmp(Memory + addr1, Memory + addr2, size); return memcmp(Memory + addr1, Memory + addr2, size);
} }
s32 _sys_strlen(u32 addr) s64 _sys_strlen(u32 addr)
{ {
sysPrxForUser->Log("_sys_strlen(addr=0x%x)", addr); sysPrxForUser->Log("_sys_strlen(addr=0x%x)", addr);
@ -251,7 +251,7 @@ s32 _sys_spu_printf_finalize()
return CELL_OK; return CELL_OK;
} }
s32 _sys_spu_printf_attach_group(u32 arg) s64 _sys_spu_printf_attach_group(u32 arg)
{ {
sysPrxForUser->Warning("_sys_spu_printf_attach_group(arg=0x%x)", arg); sysPrxForUser->Warning("_sys_spu_printf_attach_group(arg=0x%x)", arg);
@ -263,7 +263,7 @@ s32 _sys_spu_printf_attach_group(u32 arg)
return GetCurrentPPUThread().FastCall(Memory.Read32(spu_printf_agcb), Memory.Read32(spu_printf_agcb + 4), arg); return GetCurrentPPUThread().FastCall(Memory.Read32(spu_printf_agcb), Memory.Read32(spu_printf_agcb + 4), arg);
} }
s32 _sys_spu_printf_detach_group(u32 arg) s64 _sys_spu_printf_detach_group(u32 arg)
{ {
sysPrxForUser->Warning("_sys_spu_printf_detach_group(arg=0x%x)", arg); sysPrxForUser->Warning("_sys_spu_printf_detach_group(arg=0x%x)", arg);
@ -275,7 +275,7 @@ s32 _sys_spu_printf_detach_group(u32 arg)
return GetCurrentPPUThread().FastCall(Memory.Read32(spu_printf_dgcb), Memory.Read32(spu_printf_dgcb + 4), arg); return GetCurrentPPUThread().FastCall(Memory.Read32(spu_printf_dgcb), Memory.Read32(spu_printf_dgcb + 4), arg);
} }
s32 _sys_spu_printf_attach_thread(u32 arg) s64 _sys_spu_printf_attach_thread(u32 arg)
{ {
sysPrxForUser->Warning("_sys_spu_printf_attach_thread(arg=0x%x)", arg); sysPrxForUser->Warning("_sys_spu_printf_attach_thread(arg=0x%x)", arg);
@ -287,7 +287,7 @@ s32 _sys_spu_printf_attach_thread(u32 arg)
return GetCurrentPPUThread().FastCall(Memory.Read32(spu_printf_atcb), Memory.Read32(spu_printf_atcb + 4), arg); return GetCurrentPPUThread().FastCall(Memory.Read32(spu_printf_atcb), Memory.Read32(spu_printf_atcb + 4), arg);
} }
s32 _sys_spu_printf_detach_thread(u32 arg) s64 _sys_spu_printf_detach_thread(u32 arg)
{ {
sysPrxForUser->Warning("_sys_spu_printf_detach_thread(arg=0x%x)", arg); sysPrxForUser->Warning("_sys_spu_printf_detach_thread(arg=0x%x)", arg);

View File

@ -66,7 +66,7 @@ int sdata_unpack(const std::string& packed_file, const std::string& unpacked_fil
u32 blockSize = re32(*(u32*)&buffer[0x84]); u32 blockSize = re32(*(u32*)&buffer[0x84]);
u64 filesizeOutput = re64(*(u64*)&buffer[0x88]); u64 filesizeOutput = re64(*(u64*)&buffer[0x88]);
u64 filesizeInput = packed_stream->GetSize(); u64 filesizeInput = packed_stream->GetSize();
u32 blockCount = (filesizeOutput + blockSize-1) / blockSize; u32 blockCount = (u32)((filesizeOutput + blockSize - 1) / blockSize);
// SDATA file is compressed // SDATA file is compressed
if (flags & 0x1) if (flags & 0x1)
@ -99,7 +99,7 @@ int sdata_unpack(const std::string& packed_file, const std::string& unpacked_fil
packed_stream->Seek(packed_stream->Tell() + t1); packed_stream->Seek(packed_stream->Tell() + t1);
if (!(blockCount-i-1)) if (!(blockCount-i-1))
blockSize = filesizeOutput-i*blockSize; blockSize = (u32)(filesizeOutput - i * blockSize);
packed_stream->Read(buffer+256, blockSize); packed_stream->Read(buffer+256, blockSize);
unpacked_stream->Write(buffer+256, blockSize); unpacked_stream->Write(buffer+256, blockSize);

View File

@ -345,7 +345,7 @@ int socketselect()
int sys_net_initialize_network_ex(mem_ptr_t<sys_net_initialize_parameter> param) int sys_net_initialize_network_ex(mem_ptr_t<sys_net_initialize_parameter> param)
{ {
sys_net->Warning("sys_net_initialize_network_ex(param_addr=0x%x)", param.GetAddr()); sys_net->Warning("sys_net_initialize_network_ex(param_addr=0x%x)", param.GetAddr());
g_lastError.SetAddr(Memory.Alloc(4, 1)); g_lastError.SetAddr((u32)Memory.Alloc(4, 1));
#ifdef _WIN32 #ifdef _WIN32
WSADATA wsaData; WSADATA wsaData;
WORD wVersionRequested = MAKEWORD(1,1); WORD wVersionRequested = MAKEWORD(1,1);

View File

@ -916,7 +916,7 @@ struct SyscallTableCleaner_t
void default_syscall() void default_syscall()
{ {
declCPU(); declCPU();
u32 code = CPU.GPR[11]; u32 code = (u32)CPU.GPR[11];
//TODO: remove this //TODO: remove this
switch(code) switch(code)
{ {

View File

@ -52,12 +52,12 @@ s32 sys_memory_allocate_from_container(u32 size, u32 cid, u32 flags, u32 alloc_a
{ {
case SYS_MEMORY_PAGE_SIZE_1M: case SYS_MEMORY_PAGE_SIZE_1M:
if(size & 0xfffff) return CELL_EALIGN; if(size & 0xfffff) return CELL_EALIGN;
ct->addr = Memory.Alloc(size, 0x100000); ct->addr = (u32)Memory.Alloc(size, 0x100000);
break; break;
case SYS_MEMORY_PAGE_SIZE_64K: case SYS_MEMORY_PAGE_SIZE_64K:
if(size & 0xffff) return CELL_EALIGN; if(size & 0xffff) return CELL_EALIGN;
ct->addr = Memory.Alloc(size, 0x10000); ct->addr = (u32)Memory.Alloc(size, 0x10000);
break; break;
default: return CELL_EINVAL; default: return CELL_EINVAL;
@ -113,7 +113,7 @@ s32 sys_memory_container_create(mem32_t cid, u32 yield_size)
sys_memory.Warning("sys_memory_container_create(cid_addr=0x%x, yield_size=0x%x)", cid.GetAddr(), yield_size); sys_memory.Warning("sys_memory_container_create(cid_addr=0x%x, yield_size=0x%x)", cid.GetAddr(), yield_size);
yield_size &= ~0xfffff; //round down to 1 MB granularity yield_size &= ~0xfffff; //round down to 1 MB granularity
u64 addr = Memory.Alloc(yield_size, 0x100000); //1 MB alignment u32 addr = (u32)Memory.Alloc(yield_size, 0x100000); //1 MB alignment
if(!addr) if(!addr)
return CELL_ENOMEM; return CELL_ENOMEM;

View File

@ -35,7 +35,7 @@ struct MemoryContainerInfo
u32 addr; u32 addr;
u32 size; u32 size;
MemoryContainerInfo(u64 addr, u32 size) MemoryContainerInfo(u32 addr, u32 size)
: addr(addr) : addr(addr)
, size(size) , size(size)
{ {

View File

@ -26,13 +26,13 @@ s32 sys_mmapper_allocate_address(u32 size, u64 flags, u32 alignment, u32 alloc_a
case SYS_MEMORY_PAGE_SIZE_1M: case SYS_MEMORY_PAGE_SIZE_1M:
if(AlignAddr(size, alignment) & 0xfffff) if(AlignAddr(size, alignment) & 0xfffff)
return CELL_EALIGN; return CELL_EALIGN;
addr = Memory.Alloc(size, 0x100000); addr = (u32)Memory.Alloc(size, 0x100000);
break; break;
case SYS_MEMORY_PAGE_SIZE_64K: case SYS_MEMORY_PAGE_SIZE_64K:
if(AlignAddr(size, alignment) & 0xffff) if(AlignAddr(size, alignment) & 0xffff)
return CELL_EALIGN; return CELL_EALIGN;
addr = Memory.Alloc(size, 0x10000); addr = (u32)Memory.Alloc(size, 0x10000);
break; break;
} }
@ -64,13 +64,13 @@ s32 sys_mmapper_allocate_memory(u32 size, u64 flags, mem32_t mem_id)
case SYS_MEMORY_PAGE_SIZE_1M: case SYS_MEMORY_PAGE_SIZE_1M:
if(size & 0xfffff) if(size & 0xfffff)
return CELL_EALIGN; return CELL_EALIGN;
addr = Memory.Alloc(size, 0x100000); addr = (u32)Memory.Alloc(size, 0x100000);
break; break;
case SYS_MEMORY_PAGE_SIZE_64K: case SYS_MEMORY_PAGE_SIZE_64K:
if(size & 0xffff) if(size & 0xffff)
return CELL_EALIGN; return CELL_EALIGN;
addr = Memory.Alloc(size, 0x10000); addr = (u32)Memory.Alloc(size, 0x10000);
break; break;
default: default:
@ -102,13 +102,13 @@ s32 sys_mmapper_allocate_memory_from_container(u32 size, u32 cid, u64 flags, mem
case SYS_MEMORY_PAGE_SIZE_1M: case SYS_MEMORY_PAGE_SIZE_1M:
if(size & 0xfffff) if(size & 0xfffff)
return CELL_EALIGN; return CELL_EALIGN;
ct->addr = Memory.Alloc(size, 0x100000); ct->addr = (u32)Memory.Alloc(size, 0x100000);
break; break;
case SYS_MEMORY_PAGE_SIZE_64K: case SYS_MEMORY_PAGE_SIZE_64K:
if(size & 0xffff) if(size & 0xffff)
return CELL_EALIGN; return CELL_EALIGN;
ct->addr = Memory.Alloc(size, 0x10000); ct->addr = (u32)Memory.Alloc(size, 0x10000);
break; break;
default: default:

View File

@ -5,11 +5,11 @@
struct mmapper_info struct mmapper_info
{ {
u64 addr; u32 addr;
u32 size; u32 size;
u32 flags; u64 flags;
mmapper_info(u64 _addr, u32 _size, u32 _flags) mmapper_info(u32 _addr, u32 _size, u64 _flags)
: addr(_addr) : addr(_addr)
, size(_size) , size(_size)
, flags(_flags) , flags(_flags)

View File

@ -108,7 +108,7 @@ s32 sys_ppu_thread_get_priority(u64 thread_id, u32 prio_addr)
CPUThread* thr = Emu.GetCPU().GetThread(thread_id); CPUThread* thr = Emu.GetCPU().GetThread(thread_id);
if(!thr) return CELL_ESRCH; if(!thr) return CELL_ESRCH;
Memory.Write32(prio_addr, thr->GetPrio()); Memory.Write32(prio_addr, (s32)thr->GetPrio());
return CELL_OK; return CELL_OK;
} }
@ -119,7 +119,7 @@ s32 sys_ppu_thread_get_stack_information(u32 info_addr)
declCPU(); declCPU();
Memory.Write32(info_addr, CPU.GetStackAddr()); Memory.Write32(info_addr, (u32)CPU.GetStackAddr());
Memory.Write32(info_addr + 4, CPU.GetStackSize()); Memory.Write32(info_addr + 4, CPU.GetStackSize());
return CELL_OK; return CELL_OK;

View File

@ -32,8 +32,8 @@ s32 sys_prx_load_module(u32 path_addr, u64 flags, mem_ptr_t<sys_prx_load_module_
// Create the PRX object and return its id // Create the PRX object and return its id
sys_prx_t* prx = new sys_prx_t(); sys_prx_t* prx = new sys_prx_t();
prx->size = f.GetSize(); prx->size = (u32)f.GetSize();
prx->address = Memory.Alloc(prx->size, 4); prx->address = (u32)Memory.Alloc(prx->size, 4);
prx->path = path; prx->path = path;
// Load the PRX into memory // Load the PRX into memory

View File

@ -344,7 +344,7 @@ void Emulator::Load()
thread.AddArgv(m_elf_path); thread.AddArgv(m_elf_path);
//thread.AddArgv("-emu"); //thread.AddArgv("-emu");
m_rsx_callback = Memory.MainMem.AllocAlign(4 * 4) + 4; m_rsx_callback = (u32)Memory.MainMem.AllocAlign(4 * 4) + 4;
Memory.Write32(m_rsx_callback - 4, m_rsx_callback); Memory.Write32(m_rsx_callback - 4, m_rsx_callback);
mem32_ptr_t callback_data(m_rsx_callback); mem32_ptr_t callback_data(m_rsx_callback);
@ -352,7 +352,7 @@ void Emulator::Load()
callback_data += SC(2); callback_data += SC(2);
callback_data += BCLR(0x10 | 0x04, 0, 0, 0); callback_data += BCLR(0x10 | 0x04, 0, 0, 0);
m_ppu_thr_exit = Memory.MainMem.AllocAlign(4 * 4); m_ppu_thr_exit = (u32)Memory.MainMem.AllocAlign(4 * 4);
mem32_ptr_t ppu_thr_exit_data(m_ppu_thr_exit); mem32_ptr_t ppu_thr_exit_data(m_ppu_thr_exit);
//ppu_thr_exit_data += ADDI(3, 0, 0); // why it kills return value (GPR[3]) ? //ppu_thr_exit_data += ADDI(3, 0, 0); // why it kills return value (GPR[3]) ?
@ -360,7 +360,7 @@ void Emulator::Load()
ppu_thr_exit_data += SC(2); ppu_thr_exit_data += SC(2);
ppu_thr_exit_data += BCLR(0x10 | 0x04, 0, 0, 0); ppu_thr_exit_data += BCLR(0x10 | 0x04, 0, 0, 0);
m_ppu_thr_stop = Memory.MainMem.AllocAlign(2 * 4); m_ppu_thr_stop = (u32)Memory.MainMem.AllocAlign(2 * 4);
mem32_ptr_t ppu_thr_stop_data(m_ppu_thr_stop); mem32_ptr_t ppu_thr_stop_data(m_ppu_thr_stop);
ppu_thr_stop_data += SC(4); ppu_thr_stop_data += SC(4);
@ -494,8 +494,8 @@ void Emulator::SavePoints(const std::string& path)
{ {
std::ofstream f(path, std::ios::binary | std::ios::trunc); std::ofstream f(path, std::ios::binary | std::ios::trunc);
u32 break_count = m_break_points.size(); u32 break_count = (u32)m_break_points.size();
u32 marked_count = m_marked_points.size(); u32 marked_count = (u32)m_marked_points.size();
f << bpdb_version << break_count << marked_count; f << bpdb_version << break_count << marked_count;
@ -519,7 +519,7 @@ void Emulator::LoadPoints(const std::string& path)
if (!f.is_open()) if (!f.is_open())
return; return;
f.seekg(0, std::ios::end); f.seekg(0, std::ios::end);
int length = f.tellg(); int length = (int)f.tellg();
f.seekg(0, std::ios::beg); f.seekg(0, std::ios::beg);
u32 break_count, marked_count; u32 break_count, marked_count;
u16 version; u16 version;

View File

@ -231,7 +231,7 @@ bool ELF64Loader::LoadEhdrInfo(s64 offset)
return false; return false;
} }
entry = ehdr.GetEntry(); entry = (u32)ehdr.GetEntry();
if(entry == 0) if(entry == 0)
{ {
LOG_ERROR(LOADER, "elf64 error: entry is null!"); LOG_ERROR(LOADER, "elf64 error: entry is null!");
@ -320,12 +320,12 @@ bool ELF64Loader::LoadPhdrData(u64 offset)
if (phdr.p_vaddr < min_addr) if (phdr.p_vaddr < min_addr)
{ {
min_addr = phdr.p_vaddr; min_addr = (u32)phdr.p_vaddr;
} }
if (phdr.p_vaddr + phdr.p_memsz > max_addr) if (phdr.p_vaddr + phdr.p_memsz > max_addr)
{ {
max_addr = phdr.p_vaddr + phdr.p_memsz; max_addr = (u32)(phdr.p_vaddr + phdr.p_memsz);
} }
if (phdr.p_vaddr != phdr.p_paddr) if (phdr.p_vaddr != phdr.p_paddr)
@ -334,7 +334,7 @@ bool ELF64Loader::LoadPhdrData(u64 offset)
phdr.p_paddr, phdr.p_vaddr); phdr.p_paddr, phdr.p_vaddr);
} }
if(!Memory.MainMem.IsInMyRange(offset + phdr.p_vaddr, phdr.p_memsz)) if(!Memory.MainMem.IsInMyRange(offset + phdr.p_vaddr, (u32)phdr.p_memsz))
{ {
#ifdef LOADER_DEBUG #ifdef LOADER_DEBUG
LOG_WARNING(LOADER, "Skipping..."); LOG_WARNING(LOADER, "Skipping...");
@ -348,13 +348,15 @@ bool ELF64Loader::LoadPhdrData(u64 offset)
case 0x00000001: //LOAD case 0x00000001: //LOAD
if(phdr.p_memsz) if(phdr.p_memsz)
{ {
Memory.MainMem.AllocFixed(offset + phdr.p_vaddr, phdr.p_memsz); if (!Memory.MainMem.AllocFixed(offset + phdr.p_vaddr, (u32)phdr.p_memsz))
{
if(phdr.p_filesz) LOG_ERROR(LOADER, "%s(): AllocFixed(0x%llx, 0x%llx) failed", __FUNCTION__, offset + phdr.p_vaddr, phdr.p_memsz);
}
else if (phdr.p_filesz)
{ {
elf64_f.Seek(phdr.p_offset); elf64_f.Seek(phdr.p_offset);
elf64_f.Read(&Memory[offset + phdr.p_vaddr], phdr.p_filesz); elf64_f.Read(&Memory[offset + phdr.p_vaddr], phdr.p_filesz);
Emu.GetSFuncManager().StaticAnalyse(&Memory[offset + phdr.p_vaddr], phdr.p_filesz, phdr.p_vaddr); Emu.GetSFuncManager().StaticAnalyse(&Memory[offset + phdr.p_vaddr], (u32)phdr.p_filesz, (u32)phdr.p_vaddr);
} }
} }
break; break;
@ -460,13 +462,13 @@ bool ELF64Loader::LoadPhdrData(u64 offset)
LOG_NOTICE(LOADER, "*** nid: 0x%x (0x%x)", nid, stub.s_nid + i*4); LOG_NOTICE(LOADER, "*** nid: 0x%x (0x%x)", nid, stub.s_nid + i*4);
LOG_NOTICE(LOADER, "*** text: 0x%x (0x%x)", text, stub.s_text + i*4); LOG_NOTICE(LOADER, "*** text: 0x%x (0x%x)", text, stub.s_text + i*4);
#endif #endif
Memory.Write32(stub.s_text + i*4, tbl + i*8); Memory.Write32(stub.s_text + i*4, (u32)tbl + i*8);
mem32_ptr_t out_tbl(tbl + i*8); mem32_ptr_t out_tbl((u32)tbl + i*8);
out_tbl += dst + i*section; out_tbl += (u32)dst + i*section;
out_tbl += Emu.GetModuleManager().GetFuncNumById(nid); out_tbl += Emu.GetModuleManager().GetFuncNumById(nid);
mem32_ptr_t out_dst(dst + i*section); mem32_ptr_t out_dst((u32)dst + i*section);
out_dst += OR(11, 2, 2, 0); out_dst += OR(11, 2, 2, 0);
out_dst += SC(2); out_dst += SC(2);
out_dst += BCLR(0x10 | 0x04, 0, 0, 0); out_dst += BCLR(0x10 | 0x04, 0, 0, 0);
@ -512,16 +514,16 @@ bool ELF64Loader::LoadShdrData(u64 offset)
const u64 addr = shdr.sh_addr; const u64 addr = shdr.sh_addr;
const u64 size = shdr.sh_size; const u64 size = shdr.sh_size;
if(size == 0 || !Memory.IsGoodAddr(offset + addr, size)) continue; if(size == 0 || !Memory.IsGoodAddr(offset + addr, (u32)size)) continue;
if(shdr.sh_addr && shdr.sh_addr < min_addr) if(shdr.sh_addr && shdr.sh_addr < min_addr)
{ {
min_addr = shdr.sh_addr; min_addr = (u32)shdr.sh_addr;
} }
if(shdr.sh_addr + shdr.sh_size > max_addr) if(shdr.sh_addr + shdr.sh_size > max_addr)
{ {
max_addr = shdr.sh_addr + shdr.sh_size; max_addr = (u32)(shdr.sh_addr + shdr.sh_size);
} }
if((shdr.sh_type == SHT_RELA) || (shdr.sh_type == SHT_REL)) if((shdr.sh_type == SHT_RELA) || (shdr.sh_type == SHT_REL))

View File

@ -145,10 +145,10 @@ bool TROPUSRLoader::Generate(const std::string& filepath, const std::string& con
} }
TROPUSREntry4 entry4 = { be_t<u32>::MakeFromBE(se32(4)), be_t<u32>::MakeFromBE(se32(sizeof(TROPUSREntry4) - 0x10)), TROPUSREntry4 entry4 = { be_t<u32>::MakeFromBE(se32(4)), be_t<u32>::MakeFromBE(se32(sizeof(TROPUSREntry4) - 0x10)),
be_t<u32>::MakeFromLE(m_table4.size()), be_t<u32>::MakeFromBE(se32(0)), be_t<u32>::MakeFromLE(trophy_id), be_t<u32>::MakeFromLE((u32)m_table4.size()), be_t<u32>::MakeFromBE(se32(0)), be_t<u32>::MakeFromLE(trophy_id),
be_t<u32>::MakeFromLE(trophy_grade), be_t<u32>::MakeFromBE(se32(0xFFFFFFFF)) }; be_t<u32>::MakeFromLE(trophy_grade), be_t<u32>::MakeFromBE(se32(0xFFFFFFFF)) };
TROPUSREntry6 entry6 = { be_t<u32>::MakeFromBE(se32(6)), be_t<u32>::MakeFromBE(se32(sizeof(TROPUSREntry6) - 0x10)), TROPUSREntry6 entry6 = { be_t<u32>::MakeFromBE(se32(6)), be_t<u32>::MakeFromBE(se32(sizeof(TROPUSREntry6) - 0x10)),
be_t<u32>::MakeFromLE(m_table6.size()), be_t<u32>::MakeFromBE(0), be_t<u32>::MakeFromLE(trophy_id) }; be_t<u32>::MakeFromLE((u32)m_table6.size()), be_t<u32>::MakeFromBE(0), be_t<u32>::MakeFromLE(trophy_id) };
m_table4.push_back(entry4); m_table4.push_back(entry4);
m_table6.push_back(entry6); m_table6.push_back(entry6);
@ -157,10 +157,10 @@ bool TROPUSRLoader::Generate(const std::string& filepath, const std::string& con
u64 offset = sizeof(TROPUSRHeader) + 2 * sizeof(TROPUSRTableHeader); u64 offset = sizeof(TROPUSRHeader) + 2 * sizeof(TROPUSRTableHeader);
TROPUSRTableHeader table4header = { be_t<u32>::MakeFromBE(se32(4)), be_t<u32>::MakeFromBE(se32(sizeof(TROPUSREntry4)-0x10)), TROPUSRTableHeader table4header = { be_t<u32>::MakeFromBE(se32(4)), be_t<u32>::MakeFromBE(se32(sizeof(TROPUSREntry4)-0x10)),
be_t<u32>::MakeFromBE(se32(1)), be_t<u32>::MakeFromLE(m_table4.size()), be_t<u64>::MakeFromLE(offset) }; be_t<u32>::MakeFromBE(se32(1)), be_t<u32>::MakeFromLE((u32)m_table4.size()), be_t<u64>::MakeFromLE(offset) };
offset += m_table4.size() * sizeof(TROPUSREntry4); offset += m_table4.size() * sizeof(TROPUSREntry4);
TROPUSRTableHeader table6header = { be_t<u32>::MakeFromBE(se32(6)), be_t<u32>::MakeFromBE(se32(sizeof(TROPUSREntry6)-0x10)), TROPUSRTableHeader table6header = { be_t<u32>::MakeFromBE(se32(6)), be_t<u32>::MakeFromBE(se32(sizeof(TROPUSREntry6)-0x10)),
be_t<u32>::MakeFromBE(se32(1)), be_t<u32>::MakeFromLE(m_table6.size()), be_t<u64>::MakeFromLE(offset) }; be_t<u32>::MakeFromBE(se32(1)), be_t<u32>::MakeFromLE((u32)m_table6.size()), be_t<u64>::MakeFromLE(offset) };
offset += m_table6.size() * sizeof(TROPUSREntry6); offset += m_table6.size() * sizeof(TROPUSREntry6);
m_tableHeaders.clear(); m_tableHeaders.clear();
@ -169,7 +169,7 @@ bool TROPUSRLoader::Generate(const std::string& filepath, const std::string& con
m_header.magic = 0x818F54AD; m_header.magic = 0x818F54AD;
m_header.unk1 = 0x00010000; m_header.unk1 = 0x00010000;
m_header.tables_count = m_tableHeaders.size(); m_header.tables_count = (u32)m_tableHeaders.size();
m_header.unk2 = 0; m_header.unk2 = 0;
Save(filepath); Save(filepath);
@ -178,7 +178,7 @@ bool TROPUSRLoader::Generate(const std::string& filepath, const std::string& con
u32 TROPUSRLoader::GetTrophiesCount() u32 TROPUSRLoader::GetTrophiesCount()
{ {
return m_table6.size(); return (u32)m_table6.size();
} }
u32 TROPUSRLoader::GetTrophyUnlockState(u32 id) u32 TROPUSRLoader::GetTrophyUnlockState(u32 id)
@ -189,7 +189,7 @@ u32 TROPUSRLoader::GetTrophyUnlockState(u32 id)
return m_table6[id].trophy_state; // Let's assume the trophies are stored ordered return m_table6[id].trophy_state; // Let's assume the trophies are stored ordered
} }
u32 TROPUSRLoader::GetTrophyTimestamp(u32 id) u64 TROPUSRLoader::GetTrophyTimestamp(u32 id)
{ {
if (id >= m_table6.size()) if (id >= m_table6.size())
LOG_WARNING(LOADER, "TROPUSRLoader::GetTrophyTimestamp: Invalid id=%d", id); LOG_WARNING(LOADER, "TROPUSRLoader::GetTrophyTimestamp: Invalid id=%d", id);

View File

@ -79,7 +79,7 @@ public:
virtual u32 GetTrophiesCount(); virtual u32 GetTrophiesCount();
virtual u32 GetTrophyUnlockState(u32 id); virtual u32 GetTrophyUnlockState(u32 id);
virtual u32 GetTrophyTimestamp(u32 id); virtual u64 GetTrophyTimestamp(u32 id);
virtual bool UnlockTrophy(u32 id, u64 timestamp1, u64 timestamp2); virtual bool UnlockTrophy(u32 id, u64 timestamp1, u64 timestamp2);
}; };

View File

@ -42,14 +42,14 @@ typedef uint16_t u16;
typedef uint32_t u32; typedef uint32_t u32;
typedef uint64_t u64; typedef uint64_t u64;
static const u32 U32_MAX = 0xffffffff; static const u32 U32_MAX = 0xffffffffu;
typedef int8_t s8; typedef int8_t s8;
typedef int16_t s16; typedef int16_t s16;
typedef int32_t s32; typedef int32_t s32;
typedef int64_t s64; typedef int64_t s64;
static const s32 S32_MIN = -0x80000000; static const s32 S32_MIN = (s32)0x80000000u;
static const s32 S32_MAX = 0x7fffffff; static const s32 S32_MAX = 0x7fffffff;
union u128 union u128