mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-22 02:32:36 +01:00
Some warnings fixed
This commit is contained in:
parent
fb1d7d3982
commit
9e2bb9e9d2
@ -14,7 +14,7 @@ LogManager *gLogManager = nullptr;
|
||||
u32 LogMessage::size()
|
||||
{
|
||||
//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)
|
||||
|
@ -162,7 +162,7 @@ public:
|
||||
}
|
||||
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
|
||||
}
|
||||
@ -718,7 +718,7 @@ public:
|
||||
u32 AppendRawBytes(const u8 *bytes, size_t count)
|
||||
{
|
||||
memmove(Memory + this->m_addr, bytes, count);
|
||||
this->m_addr += count;
|
||||
this->m_addr += (u32)count;
|
||||
return this->m_addr;
|
||||
}
|
||||
|
||||
@ -835,7 +835,7 @@ class MemoryAllocator
|
||||
public:
|
||||
MemoryAllocator(u32 size = sizeof(T), u32 align = 1)
|
||||
: m_size(size)
|
||||
, m_addr(Memory.Alloc(size, align))
|
||||
, m_addr((u32)Memory.Alloc(size, align))
|
||||
, m_ptr((T*)&Memory[m_addr])
|
||||
{
|
||||
}
|
||||
|
@ -153,7 +153,7 @@ __forceinline void Module::AddFuncSub(const char group[8], const u64 ops[], cons
|
||||
{
|
||||
SFuncOp op;
|
||||
op.mask = ops[i] >> 32;
|
||||
op.crc = ops[i];
|
||||
op.crc = (u32)ops[i];
|
||||
if (op.mask) op.crc &= op.mask;
|
||||
op.mask = re(op.mask);
|
||||
op.crc = re(op.crc);
|
||||
|
@ -96,8 +96,8 @@ int cellFontOpenFontFile(mem_ptr_t<CellFontLibrary> library, mem8_ptr_t fontPath
|
||||
if (!f.IsOpened())
|
||||
return CELL_FONT_ERROR_FONT_OPEN_FAILED;
|
||||
|
||||
u32 fileSize = f.GetSize();
|
||||
u32 bufferAddr = Memory.Alloc(fileSize, 1); // Freed in cellFontCloseFont
|
||||
u32 fileSize = (u32)f.GetSize();
|
||||
u32 bufferAddr = (u32)Memory.Alloc(fileSize, 1); // Freed in cellFontCloseFont
|
||||
f.Read(Memory.VirtualToRealAddr(bufferAddr), fileSize);
|
||||
int ret = cellFontOpenFontMemory(library.GetAddr(), bufferAddr, fileSize, subNum, uniqueId, font.GetAddr());
|
||||
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;
|
||||
}
|
||||
|
||||
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);
|
||||
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;
|
||||
@ -234,7 +234,7 @@ void cellFontRenderSurfaceInit(mem_ptr_t<CellFontRenderSurface> surface, u32 buf
|
||||
surface->height = h;
|
||||
|
||||
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)
|
||||
@ -250,8 +250,6 @@ void cellFontRenderSurfaceSetScissor(mem_ptr_t<CellFontRenderSurface> surface, s
|
||||
|
||||
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);
|
||||
|
||||
font->scale_x = w;
|
||||
@ -305,8 +303,6 @@ int cellFontDestroyRenderer()
|
||||
|
||||
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);
|
||||
|
||||
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)
|
||||
{
|
||||
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)",
|
||||
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 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
|
||||
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)
|
||||
{
|
||||
slantParam = GetCurrentPPUThread().FPR[1]; // TODO: Something is wrong with the float arguments
|
||||
cellFont->Log("cellFontSetEffectSlant(font_addr=0x%x, slantParam=%f)", font.GetAddr(), slantParam);
|
||||
|
||||
if (slantParam < -1.0 || slantParam > 1.0)
|
||||
@ -386,11 +379,11 @@ int cellFontSetEffectSlant(mem_ptr_t<CellFont> font, float slantParam)
|
||||
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());
|
||||
|
||||
slantParam = font->slant; //Does this conversion from be_t<float> to *mem32_t work?
|
||||
*slantParam = font->slant;
|
||||
return CELL_FONT_OK;
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,7 @@ int cellFontInitLibraryFreeTypeWithRevision(u64 revisionFlags, mem_ptr_t<CellFon
|
||||
//if (s_fontInternalInstance->m_bInitialized)
|
||||
//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;
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ const u32 tiled_pitches[] = {
|
||||
|
||||
u32 local_size = 0;
|
||||
u32 local_addr = 0;
|
||||
u32 system_mode = 0;
|
||||
u64 system_mode = 0;
|
||||
|
||||
CellGcmConfig current_config;
|
||||
CellGcmContextData current_context;
|
||||
@ -65,8 +65,8 @@ CellGcmOffsetTable offsetTable;
|
||||
|
||||
void InitOffsetTable()
|
||||
{
|
||||
offsetTable.ioAddress = Memory.Alloc(3072 * sizeof(u16), 1);
|
||||
offsetTable.eaAddress = Memory.Alloc(512 * sizeof(u16), 1);
|
||||
offsetTable.ioAddress = (u32)Memory.Alloc(3072 * sizeof(u16), 1);
|
||||
offsetTable.eaAddress = (u32)Memory.Alloc(512 * sizeof(u16), 1);
|
||||
|
||||
_sys_memset(offsetTable.ioAddress, 0xFF, 3072 * sizeof(u16));
|
||||
_sys_memset(offsetTable.eaAddress, 0xFF, 512 * sizeof(u16));
|
||||
@ -79,7 +79,7 @@ void InitOffsetTable()
|
||||
u32 cellGcmGetLabelAddress(u8 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)
|
||||
@ -91,7 +91,7 @@ u32 cellGcmGetReportDataAddressLocation(u32 index, u32 location)
|
||||
cellGcmSys->Error("cellGcmGetReportDataAddressLocation: Wrong local index (%d)", index);
|
||||
return 0;
|
||||
}
|
||||
return Memory.RSXFBMem.GetStartAddr() + index * 0x10;
|
||||
return (u32)Memory.RSXFBMem.GetStartAddr() + index * 0x10;
|
||||
}
|
||||
|
||||
if (location == CELL_GCM_LOCATION_MAIN) {
|
||||
@ -146,7 +146,7 @@ u32 cellGcmGetNotifyDataAddress(u32 index)
|
||||
*/
|
||||
u32 _cellGcmFunc12()
|
||||
{
|
||||
return Memory.RSXFBMem.GetStartAddr(); // TODO
|
||||
return (u32)Memory.RSXFBMem.GetStartAddr(); // TODO
|
||||
}
|
||||
|
||||
u32 cellGcmGetReport(u32 type, u32 index)
|
||||
@ -174,7 +174,7 @@ u32 cellGcmGetReportDataAddress(u32 index)
|
||||
cellGcmSys->Error("cellGcmGetReportDataAddress: Wrong local index (%d)", index);
|
||||
return 0;
|
||||
}
|
||||
return Memory.RSXFBMem.GetStartAddr() + index * 0x10;
|
||||
return (u32)Memory.RSXFBMem.GetStartAddr() + index * 0x10;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
@ -374,7 +374,7 @@ s32 _cellGcmInitBody(mem_ptr_t<CellGcmContextData> context, u32 cmdSize, u32 ioS
|
||||
current_context.current = current_context.begin;
|
||||
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;
|
||||
|
||||
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();
|
||||
render.m_ctxt_addr = context.GetAddr();
|
||||
render.m_gcm_buffers_addr = Memory.Alloc(sizeof(CellGcmDisplayInfo) * 8, sizeof(CellGcmDisplayInfo));
|
||||
render.m_zculls_addr = Memory.Alloc(sizeof(CellGcmZcullInfo) * 8, sizeof(CellGcmZcullInfo));
|
||||
render.m_tiles_addr = Memory.Alloc(sizeof(CellGcmTileInfo) * 15, sizeof(CellGcmTileInfo));
|
||||
render.m_gcm_buffers_addr = (u32)Memory.Alloc(sizeof(CellGcmDisplayInfo) * 8, sizeof(CellGcmDisplayInfo));
|
||||
render.m_zculls_addr = (u32)Memory.Alloc(sizeof(CellGcmZcullInfo) * 8, sizeof(CellGcmZcullInfo));
|
||||
render.m_tiles_addr = (u32)Memory.Alloc(sizeof(CellGcmTileInfo) * 15, sizeof(CellGcmTileInfo));
|
||||
render.m_gcm_buffers_count = 0;
|
||||
render.m_gcm_current_buffer = 0;
|
||||
render.m_main_mem_addr = 0;
|
||||
@ -814,7 +814,7 @@ s32 cellGcmAddressToOffset(u64 address, mem32_t offset)
|
||||
|
||||
// Address in local memory
|
||||
if (Memory.RSXFBMem.IsInMyRange(address)) {
|
||||
result = address - Memory.RSXFBMem.GetStartAddr();
|
||||
result = (u32)(address - Memory.RSXFBMem.GetStartAddr());
|
||||
}
|
||||
// Address in main memory else check
|
||||
else
|
||||
@ -838,7 +838,7 @@ u32 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)
|
||||
@ -901,7 +901,7 @@ s32 cellGcmMapLocalMemory(u64 address, u64 size)
|
||||
if (!local_size && !local_addr)
|
||||
{
|
||||
local_size = 0xf900000; //TODO
|
||||
local_addr = Memory.RSXFBMem.GetStartAddr();
|
||||
local_addr = (u32)Memory.RSXFBMem.GetStartAddr();
|
||||
Memory.RSXFBMem.AllocAlign(local_size);
|
||||
Memory.Write32(address, local_addr);
|
||||
Memory.Write32(size, local_size);
|
||||
@ -915,25 +915,25 @@ s32 cellGcmMapLocalMemory(u64 address, u64 size)
|
||||
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());
|
||||
|
||||
u64 io;
|
||||
u32 io;
|
||||
|
||||
if ((ea & 0xFFFFF) || (size & 0xFFFFF)) return CELL_GCM_ERROR_FAILURE;
|
||||
|
||||
//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
|
||||
io = io - Memory.RSXIOMem.GetStartAddr();
|
||||
io = io - (u32)Memory.RSXIOMem.GetStartAddr();
|
||||
|
||||
//fill the offset table
|
||||
for (u32 i = 0; i<(size >> 20); i++)
|
||||
{
|
||||
Memory.Write16(offsetTable.ioAddress + ((ea >> 20) + i)*sizeof(u16), (io >> 20) + i);
|
||||
Memory.Write16(offsetTable.eaAddress + ((io >> 20) + i)*sizeof(u16), (ea >> 20) + i);
|
||||
Memory.Write16(offsetTable.ioAddress + ((ea >> 20) + i) * sizeof(u16), (u16)(io >> 20) + i);
|
||||
Memory.Write16(offsetTable.eaAddress + ((io >> 20) + i) * sizeof(u16), (u16)(ea >> 20) + i);
|
||||
}
|
||||
|
||||
offset = io;
|
||||
|
@ -30,7 +30,7 @@ void cellGcmGetOffsetTable(mem_ptr_t<CellGcmOffsetTable> table);
|
||||
s32 cellGcmIoOffsetToAddress(u32 ioOffset, u64 address);
|
||||
s32 cellGcmMapEaIoAddress(u32 ea, u32 io, u32 size);
|
||||
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 cellGcmUnmapEaIoAddress(u64 ea);
|
||||
s32 cellGcmUnmapIoAddress(u64 io);
|
||||
|
@ -84,7 +84,7 @@ int cellGifDecReadHeader(u32 mainHandle, u32 subHandle, mem_ptr_t<CellGifDecInfo
|
||||
|
||||
case se32(CELL_GIFDEC_FILE):
|
||||
cellFsLseek(fd, 0, CELL_SEEK_SET, pos.GetAddr());
|
||||
cellFsRead(fd, buffer.GetAddr(), buffer.GetSize(), nread);
|
||||
cellFsRead(fd, buffer.GetAddr(), buffer.GetSize(), nread.GetAddr());
|
||||
break;
|
||||
}
|
||||
|
||||
@ -155,7 +155,7 @@ int cellGifDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const m
|
||||
const CellGifDecOutParam& current_outParam = subHandle_data->outParam;
|
||||
|
||||
//Copy the GIF file to a buffer
|
||||
MemoryAllocator<unsigned char> gif(fileSize);
|
||||
MemoryAllocator<unsigned char> gif((u32)fileSize);
|
||||
MemoryAllocator<u64> pos, nread;
|
||||
|
||||
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):
|
||||
cellFsLseek(fd, 0, CELL_SEEK_SET, pos.GetAddr());
|
||||
cellFsRead(fd, gif.GetAddr(), gif.GetSize(), nread);
|
||||
cellFsRead(fd, gif.GetAddr(), gif.GetSize(), nread.GetAddr());
|
||||
break;
|
||||
}
|
||||
|
||||
@ -174,14 +174,14 @@ int cellGifDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const m
|
||||
int width, height, actual_components;
|
||||
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
|
||||
);
|
||||
|
||||
if (!image)
|
||||
return CELL_GIFDEC_ERROR_STREAM_FORMAT;
|
||||
|
||||
const int bytesPerLine = dataCtrlParam->outputBytesPerLine;
|
||||
const int bytesPerLine = (u32)dataCtrlParam->outputBytesPerLine;
|
||||
const char nComponents = 4;
|
||||
uint image_size = width * height * nComponents;
|
||||
|
||||
|
@ -93,7 +93,7 @@ int cellJpgDecReadHeader(u32 mainHandle, u32 subHandle, mem_ptr_t<CellJpgDecInfo
|
||||
CellJpgDecInfo& current_info = subHandle_data->info;
|
||||
|
||||
//Write the header to buffer
|
||||
MemoryAllocator<u8> buffer(fileSize);
|
||||
MemoryAllocator<u8> buffer((u32)fileSize);
|
||||
MemoryAllocator<be_t<u64>> pos, nread;
|
||||
|
||||
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):
|
||||
cellFsLseek(fd, 0, CELL_SEEK_SET, pos.GetAddr());
|
||||
cellFsRead(fd, buffer.GetAddr(), buffer.GetSize(), nread);
|
||||
cellFsRead(fd, buffer.GetAddr(), buffer.GetSize(), nread.GetAddr());
|
||||
break;
|
||||
}
|
||||
|
||||
@ -162,7 +162,7 @@ int cellJpgDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const m
|
||||
const CellJpgDecOutParam& current_outParam = subHandle_data->outParam;
|
||||
|
||||
//Copy the JPG file to a buffer
|
||||
MemoryAllocator<unsigned char> jpg(fileSize);
|
||||
MemoryAllocator<unsigned char> jpg((u32)fileSize);
|
||||
MemoryAllocator<u64> pos, nread;
|
||||
|
||||
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):
|
||||
cellFsLseek(fd, 0, CELL_SEEK_SET, pos.GetAddr());
|
||||
cellFsRead(fd, jpg.GetAddr(), jpg.GetSize(), nread);
|
||||
cellFsRead(fd, jpg.GetAddr(), jpg.GetSize(), nread.GetAddr());
|
||||
break;
|
||||
}
|
||||
|
||||
@ -181,7 +181,7 @@ int cellJpgDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const m
|
||||
int width, height, actual_components;
|
||||
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
|
||||
);
|
||||
|
||||
@ -189,7 +189,7 @@ int cellJpgDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const m
|
||||
return CELL_JPGDEC_ERROR_STREAM_FORMAT;
|
||||
|
||||
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;
|
||||
|
||||
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;
|
||||
|
||||
if(dataCtrlParam->outputBytesPerLine)
|
||||
dataOutInfo->outputLines = image_size / dataCtrlParam->outputBytesPerLine;
|
||||
dataOutInfo->outputLines = (u32)(image_size / dataCtrlParam->outputBytesPerLine);
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
@ -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))
|
||||
callback.async(status, userData);
|
||||
callback.async((s32)status, userData); // TODO: this callback should be registered
|
||||
|
||||
CallAfter([&]()
|
||||
{
|
||||
@ -230,7 +230,7 @@ int cellMsgDialogOpenErrorCode(u32 errorCode, mem_func_ptr_t<CellMsgDialogCallba
|
||||
}
|
||||
|
||||
if (callback)
|
||||
callback(status, userData);
|
||||
callback((s32)status, userData);
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
@ -198,7 +198,7 @@ int cellPngDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const m
|
||||
const CellPngDecOutParam& current_outParam = subHandle_data->outParam;
|
||||
|
||||
//Copy the PNG file to a buffer
|
||||
MemoryAllocator<unsigned char> png(fileSize);
|
||||
MemoryAllocator<unsigned char> png((u32)fileSize);
|
||||
MemoryAllocator<u64> pos, nread;
|
||||
|
||||
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;
|
||||
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
|
||||
);
|
||||
if (!image) return CELL_PNGDEC_ERROR_STREAM_FORMAT;
|
||||
|
||||
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;
|
||||
|
||||
switch((u32)current_outParam.outputColorSpace)
|
||||
|
@ -15,7 +15,7 @@ PICTURE_SIZE = (1.0f),
|
||||
UV_DELTA_PS = (1.f / 8.f),
|
||||
UV_DELTA_LB = (1.f / 6.f),
|
||||
XY_DELTA_LB = (1.f / 8.f),
|
||||
PI = 3.1415926535897932384626433832795;
|
||||
PI = 3.141592741f;
|
||||
|
||||
void BuildupVertexBufferNR()
|
||||
{
|
||||
@ -124,8 +124,8 @@ void BuildupVertexBufferUN(s32 srcIdx)
|
||||
float U_PS1 = U_CENTER + U_PS;
|
||||
float U2_FS0 = 0.0f;
|
||||
float V2_FS0 = 0.0f;
|
||||
float U2_FS1 = s_rescInternalInstance->m_dstWidth;
|
||||
float V2_FS1 = s_rescInternalInstance->m_dstHeight;
|
||||
float U2_FS1 = (float)s_rescInternalInstance->m_dstWidth;
|
||||
float V2_FS1 = (float)s_rescInternalInstance->m_dstHeight;
|
||||
|
||||
mem_ptr_t<RescVertex_t> vv(s_rescInternalInstance->m_vertexArrayEA);
|
||||
|
||||
|
@ -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);
|
||||
|
||||
rDateTime date = rDateTime((time_t)pTick1->tick);
|
||||
rTimeSpan minutes = rTimeSpan(0, lAdd, 0, 0);
|
||||
rTimeSpan minutes = rTimeSpan(0, lAdd, 0, 0); // ???
|
||||
date.Add(minutes);
|
||||
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);
|
||||
|
||||
rDateTime date = rDateTime((time_t)pTick1->tick);
|
||||
rTimeSpan hours = rTimeSpan(iAdd, 0, 0, 0);
|
||||
rTimeSpan hours = rTimeSpan(iAdd, 0, 0, 0); // ???
|
||||
date.Add(hours);
|
||||
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);
|
||||
|
||||
rDateTime date = rDateTime((time_t)pTick1->tick);
|
||||
rDateSpan days = rDateSpan(0, 0, 0, iAdd);
|
||||
rDateSpan days = rDateSpan(0, 0, 0, iAdd); // ???
|
||||
date.Add(days);
|
||||
pTick0->tick = date.GetTicks();
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -764,7 +764,7 @@ void cellSpursJq_init()
|
||||
#ifdef PRX_DEBUG
|
||||
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));
|
||||
libspurs_jq_rtoc = libspurs_jq + 0x17E80;
|
||||
|
||||
|
@ -1451,7 +1451,7 @@ s32 syncLFQueueCompletePushPointer(mem_ptr_t<CellSyncLFQueue> queue, s32 pointer
|
||||
if (exch)
|
||||
{
|
||||
assert(fpSendSignal);
|
||||
return fpSendSignal((u64)queue->m_eaSignal, var6);
|
||||
return fpSendSignal((u32)queue->m_eaSignal, var6);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -1532,7 +1532,7 @@ s32 _cellSyncLFQueuePushBody(mem_ptr_t<CellSyncLFQueue> queue, u32 buffer_addr,
|
||||
else
|
||||
{
|
||||
#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();
|
||||
#else
|
||||
res = syncLFQueueGetPushPointer2(queue, position, isBlocking, 0);
|
||||
@ -1575,7 +1575,7 @@ s32 _cellSyncLFQueuePushBody(mem_ptr_t<CellSyncLFQueue> queue, u32 buffer_addr,
|
||||
else
|
||||
{
|
||||
#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
|
||||
res = syncLFQueueCompletePushPointer2(queue, position, nullptr);
|
||||
#endif
|
||||
@ -1844,7 +1844,7 @@ s32 syncLFQueueCompletePopPointer(mem_ptr_t<CellSyncLFQueue> queue, s32 pointer,
|
||||
if (exch)
|
||||
{
|
||||
assert(fpSendSignal);
|
||||
return fpSendSignal((u64)queue->m_eaSignal, var6);
|
||||
return fpSendSignal((u32)queue->m_eaSignal, var6);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -1923,7 +1923,7 @@ s32 _cellSyncLFQueuePopBody(mem_ptr_t<CellSyncLFQueue> queue, u32 buffer_addr, u
|
||||
else
|
||||
{
|
||||
#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();
|
||||
#else
|
||||
res = syncLFQueueGetPopPointer2(queue, position, isBlocking, 0);
|
||||
@ -1963,7 +1963,7 @@ s32 _cellSyncLFQueuePopBody(mem_ptr_t<CellSyncLFQueue> queue, u32 buffer_addr, u
|
||||
else
|
||||
{
|
||||
#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
|
||||
res = syncLFQueueCompletePopPointer2(queue, position, nullptr, 0);
|
||||
#endif
|
||||
@ -2088,7 +2088,7 @@ s32 _cellSyncLFQueueGetSignalAddress(mem_ptr_t<CellSyncLFQueue> queue, mem32_t p
|
||||
return CELL_SYNC_ERROR_ALIGN;
|
||||
}
|
||||
|
||||
ppSignal = queue->m_eaSignal;
|
||||
ppSignal = (u32)queue->m_eaSignal;
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@ -2206,7 +2206,7 @@ void cellSync_init()
|
||||
#ifdef PRX_DEBUG
|
||||
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));
|
||||
libsre_rtoc = libsre + 0x399B0;
|
||||
|
||||
|
@ -15,7 +15,7 @@ u32 libsync2;
|
||||
u32 libsync2_rtoc;
|
||||
#endif
|
||||
|
||||
int _cellSync2MutexAttributeInitialize()
|
||||
s64 _cellSync2MutexAttributeInitialize()
|
||||
{
|
||||
#ifdef PRX_DEBUG
|
||||
cellSync2->Warning("%s()", __FUNCTION__);
|
||||
@ -26,7 +26,7 @@ int _cellSync2MutexAttributeInitialize()
|
||||
#endif
|
||||
}
|
||||
|
||||
int cellSync2MutexEstimateBufferSize()
|
||||
s64 cellSync2MutexEstimateBufferSize()
|
||||
{
|
||||
#ifdef PRX_DEBUG
|
||||
cellSync2->Warning("%s()", __FUNCTION__);
|
||||
@ -37,7 +37,7 @@ int cellSync2MutexEstimateBufferSize()
|
||||
#endif
|
||||
}
|
||||
|
||||
int cellSync2MutexInitialize()
|
||||
s64 cellSync2MutexInitialize()
|
||||
{
|
||||
#ifdef PRX_DEBUG
|
||||
cellSync2->Warning("%s()", __FUNCTION__);
|
||||
@ -48,7 +48,7 @@ int cellSync2MutexInitialize()
|
||||
#endif
|
||||
}
|
||||
|
||||
int cellSync2MutexFinalize()
|
||||
s64 cellSync2MutexFinalize()
|
||||
{
|
||||
#ifdef PRX_DEBUG
|
||||
cellSync2->Warning("%s()", __FUNCTION__);
|
||||
@ -59,7 +59,7 @@ int cellSync2MutexFinalize()
|
||||
#endif
|
||||
}
|
||||
|
||||
int cellSync2MutexLock()
|
||||
s64 cellSync2MutexLock()
|
||||
{
|
||||
#ifdef PRX_DEBUG
|
||||
cellSync2->Warning("%s()", __FUNCTION__);
|
||||
@ -70,7 +70,7 @@ int cellSync2MutexLock()
|
||||
#endif
|
||||
}
|
||||
|
||||
int cellSync2MutexTryLock()
|
||||
s64 cellSync2MutexTryLock()
|
||||
{
|
||||
#ifdef PRX_DEBUG
|
||||
cellSync2->Warning("%s()", __FUNCTION__);
|
||||
@ -81,7 +81,7 @@ int cellSync2MutexTryLock()
|
||||
#endif
|
||||
}
|
||||
|
||||
int cellSync2MutexUnlock()
|
||||
s64 cellSync2MutexUnlock()
|
||||
{
|
||||
#ifdef PRX_DEBUG
|
||||
cellSync2->Warning("%s()", __FUNCTION__);
|
||||
@ -92,7 +92,7 @@ int cellSync2MutexUnlock()
|
||||
#endif
|
||||
}
|
||||
|
||||
int _cellSync2CondAttributeInitialize()
|
||||
s64 _cellSync2CondAttributeInitialize()
|
||||
{
|
||||
#ifdef PRX_DEBUG
|
||||
cellSync2->Warning("%s()", __FUNCTION__);
|
||||
@ -103,7 +103,7 @@ int _cellSync2CondAttributeInitialize()
|
||||
#endif
|
||||
}
|
||||
|
||||
int cellSync2CondEstimateBufferSize()
|
||||
s64 cellSync2CondEstimateBufferSize()
|
||||
{
|
||||
#ifdef PRX_DEBUG
|
||||
cellSync2->Warning("%s()", __FUNCTION__);
|
||||
@ -114,7 +114,7 @@ int cellSync2CondEstimateBufferSize()
|
||||
#endif
|
||||
}
|
||||
|
||||
int cellSync2CondInitialize()
|
||||
s64 cellSync2CondInitialize()
|
||||
{
|
||||
#ifdef PRX_DEBUG
|
||||
cellSync2->Warning("%s()", __FUNCTION__);
|
||||
@ -125,7 +125,7 @@ int cellSync2CondInitialize()
|
||||
#endif
|
||||
}
|
||||
|
||||
int cellSync2CondFinalize()
|
||||
s64 cellSync2CondFinalize()
|
||||
{
|
||||
#ifdef PRX_DEBUG
|
||||
cellSync2->Warning("%s()", __FUNCTION__);
|
||||
@ -136,7 +136,7 @@ int cellSync2CondFinalize()
|
||||
#endif
|
||||
}
|
||||
|
||||
int cellSync2CondWait()
|
||||
s64 cellSync2CondWait()
|
||||
{
|
||||
#ifdef PRX_DEBUG
|
||||
cellSync2->Warning("%s()", __FUNCTION__);
|
||||
@ -147,7 +147,7 @@ int cellSync2CondWait()
|
||||
#endif
|
||||
}
|
||||
|
||||
int cellSync2CondSignal()
|
||||
s64 cellSync2CondSignal()
|
||||
{
|
||||
#ifdef PRX_DEBUG
|
||||
cellSync2->Warning("%s()", __FUNCTION__);
|
||||
@ -158,7 +158,7 @@ int cellSync2CondSignal()
|
||||
#endif
|
||||
}
|
||||
|
||||
int cellSync2CondSignalAll()
|
||||
s64 cellSync2CondSignalAll()
|
||||
{
|
||||
#ifdef PRX_DEBUG
|
||||
cellSync2->Warning("%s()", __FUNCTION__);
|
||||
@ -169,7 +169,7 @@ int cellSync2CondSignalAll()
|
||||
#endif
|
||||
}
|
||||
|
||||
int _cellSync2SemaphoreAttributeInitialize()
|
||||
s64 _cellSync2SemaphoreAttributeInitialize()
|
||||
{
|
||||
#ifdef PRX_DEBUG
|
||||
cellSync2->Warning("%s()", __FUNCTION__);
|
||||
@ -180,7 +180,7 @@ int _cellSync2SemaphoreAttributeInitialize()
|
||||
#endif
|
||||
}
|
||||
|
||||
int cellSync2SemaphoreEstimateBufferSize()
|
||||
s64 cellSync2SemaphoreEstimateBufferSize()
|
||||
{
|
||||
#ifdef PRX_DEBUG
|
||||
cellSync2->Warning("%s()", __FUNCTION__);
|
||||
@ -191,7 +191,7 @@ int cellSync2SemaphoreEstimateBufferSize()
|
||||
#endif
|
||||
}
|
||||
|
||||
int cellSync2SemaphoreInitialize()
|
||||
s64 cellSync2SemaphoreInitialize()
|
||||
{
|
||||
#ifdef PRX_DEBUG
|
||||
cellSync2->Warning("%s()", __FUNCTION__);
|
||||
@ -202,7 +202,7 @@ int cellSync2SemaphoreInitialize()
|
||||
#endif
|
||||
}
|
||||
|
||||
int cellSync2SemaphoreFinalize()
|
||||
s64 cellSync2SemaphoreFinalize()
|
||||
{
|
||||
#ifdef PRX_DEBUG
|
||||
cellSync2->Warning("%s()", __FUNCTION__);
|
||||
@ -213,7 +213,7 @@ int cellSync2SemaphoreFinalize()
|
||||
#endif
|
||||
}
|
||||
|
||||
int cellSync2SemaphoreAcquire()
|
||||
s64 cellSync2SemaphoreAcquire()
|
||||
{
|
||||
#ifdef PRX_DEBUG
|
||||
cellSync2->Warning("%s()", __FUNCTION__);
|
||||
@ -224,7 +224,7 @@ int cellSync2SemaphoreAcquire()
|
||||
#endif
|
||||
}
|
||||
|
||||
int cellSync2SemaphoreTryAcquire()
|
||||
s64 cellSync2SemaphoreTryAcquire()
|
||||
{
|
||||
#ifdef PRX_DEBUG
|
||||
cellSync2->Warning("%s()", __FUNCTION__);
|
||||
@ -235,7 +235,7 @@ int cellSync2SemaphoreTryAcquire()
|
||||
#endif
|
||||
}
|
||||
|
||||
int cellSync2SemaphoreRelease()
|
||||
s64 cellSync2SemaphoreRelease()
|
||||
{
|
||||
#ifdef PRX_DEBUG
|
||||
cellSync2->Warning("%s()", __FUNCTION__);
|
||||
@ -246,7 +246,7 @@ int cellSync2SemaphoreRelease()
|
||||
#endif
|
||||
}
|
||||
|
||||
int cellSync2SemaphoreGetCount()
|
||||
s64 cellSync2SemaphoreGetCount()
|
||||
{
|
||||
#ifdef PRX_DEBUG
|
||||
cellSync2->Warning("%s()", __FUNCTION__);
|
||||
@ -257,7 +257,7 @@ int cellSync2SemaphoreGetCount()
|
||||
#endif
|
||||
}
|
||||
|
||||
int _cellSync2QueueAttributeInitialize()
|
||||
s64 _cellSync2QueueAttributeInitialize()
|
||||
{
|
||||
#ifdef PRX_DEBUG
|
||||
cellSync2->Warning("%s()", __FUNCTION__);
|
||||
@ -268,7 +268,7 @@ int _cellSync2QueueAttributeInitialize()
|
||||
#endif
|
||||
}
|
||||
|
||||
int cellSync2QueueEstimateBufferSize()
|
||||
s64 cellSync2QueueEstimateBufferSize()
|
||||
{
|
||||
#ifdef PRX_DEBUG
|
||||
cellSync2->Warning("%s()", __FUNCTION__);
|
||||
@ -279,7 +279,7 @@ int cellSync2QueueEstimateBufferSize()
|
||||
#endif
|
||||
}
|
||||
|
||||
int cellSync2QueueInitialize()
|
||||
s64 cellSync2QueueInitialize()
|
||||
{
|
||||
#ifdef PRX_DEBUG
|
||||
cellSync2->Warning("%s()", __FUNCTION__);
|
||||
@ -290,7 +290,7 @@ int cellSync2QueueInitialize()
|
||||
#endif
|
||||
}
|
||||
|
||||
int cellSync2QueueFinalize()
|
||||
s64 cellSync2QueueFinalize()
|
||||
{
|
||||
#ifdef PRX_DEBUG
|
||||
cellSync2->Warning("%s()", __FUNCTION__);
|
||||
@ -301,7 +301,7 @@ int cellSync2QueueFinalize()
|
||||
#endif
|
||||
}
|
||||
|
||||
int cellSync2QueuePush()
|
||||
s64 cellSync2QueuePush()
|
||||
{
|
||||
#ifdef PRX_DEBUG
|
||||
cellSync2->Warning("%s()", __FUNCTION__);
|
||||
@ -312,7 +312,7 @@ int cellSync2QueuePush()
|
||||
#endif
|
||||
}
|
||||
|
||||
int cellSync2QueueTryPush()
|
||||
s64 cellSync2QueueTryPush()
|
||||
{
|
||||
#ifdef PRX_DEBUG
|
||||
cellSync2->Warning("%s()", __FUNCTION__);
|
||||
@ -323,7 +323,7 @@ int cellSync2QueueTryPush()
|
||||
#endif
|
||||
}
|
||||
|
||||
int cellSync2QueuePop()
|
||||
s64 cellSync2QueuePop()
|
||||
{
|
||||
#ifdef PRX_DEBUG
|
||||
cellSync2->Warning("%s()", __FUNCTION__);
|
||||
@ -334,7 +334,7 @@ int cellSync2QueuePop()
|
||||
#endif
|
||||
}
|
||||
|
||||
int cellSync2QueueTryPop()
|
||||
s64 cellSync2QueueTryPop()
|
||||
{
|
||||
#ifdef PRX_DEBUG
|
||||
cellSync2->Warning("%s()", __FUNCTION__);
|
||||
@ -345,7 +345,7 @@ int cellSync2QueueTryPop()
|
||||
#endif
|
||||
}
|
||||
|
||||
int cellSync2QueueGetSize()
|
||||
s64 cellSync2QueueGetSize()
|
||||
{
|
||||
#ifdef PRX_DEBUG
|
||||
cellSync2->Warning("%s()", __FUNCTION__);
|
||||
@ -356,7 +356,7 @@ int cellSync2QueueGetSize()
|
||||
#endif
|
||||
}
|
||||
|
||||
int cellSync2QueueGetDepth()
|
||||
s64 cellSync2QueueGetDepth()
|
||||
{
|
||||
#ifdef PRX_DEBUG
|
||||
cellSync2->Warning("%s()", __FUNCTION__);
|
||||
@ -408,7 +408,7 @@ void cellSync2_init()
|
||||
#ifdef PRX_DEBUG
|
||||
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));
|
||||
libsync2_rtoc = libsync2 + 0xF280;
|
||||
|
||||
@ -427,7 +427,7 @@ void cellSync2_init()
|
||||
FIX_IMPORT(sysPrxForUser, sys_lwmutex_create , libsync2 + 0x62D0);
|
||||
FIX_IMPORT(sysPrxForUser, sys_ppu_thread_get_id , libsync2 + 0x62F0);
|
||||
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, sys_lwmutex_destroy , libsync2 + 0x6370);
|
||||
FIX_IMPORT(sysPrxForUser, _sys_strncpy , libsync2 + 0x6390);
|
||||
|
@ -74,7 +74,7 @@ void addSaveDataEntry(std::vector<SaveDataEntry>& saveEntries, const std::string
|
||||
saveEntry.title = psf.GetString("TITLE");
|
||||
saveEntry.subtitle = psf.GetString("SUB_TITLE");
|
||||
saveEntry.details = psf.GetString("DETAIL");
|
||||
saveEntry.sizeKB = getSaveDataSize(saveDir)/1024;
|
||||
saveEntry.sizeKB = (u32)(getSaveDataSize(saveDir) / 1024);
|
||||
saveEntry.st_atime_ = 0; // TODO
|
||||
saveEntry.st_mtime_ = 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++)
|
||||
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:
|
||||
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;
|
||||
|
||||
case CELL_SAVEDATA_FILEOP_WRITE:
|
||||
Emu.GetVFS().CreateFile(filepath);
|
||||
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;
|
||||
|
||||
case CELL_SAVEDATA_FILEOP_DELETE:
|
||||
|
@ -702,11 +702,11 @@ int cellVdecGetPicItem(u32 handle, mem32_t picItem_ptr)
|
||||
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->auNum = 1;
|
||||
info->auPts[0].lower = vf.pts;
|
||||
info->auPts[0].lower = (u32)vf.pts;
|
||||
info->auPts[0].upper = vf.pts >> 32;
|
||||
info->auPts[1].lower = 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[1].lower = 0xffffffff;
|
||||
info->auDts[1].upper = 0xffffffff;
|
||||
|
@ -162,7 +162,7 @@ int cellSSPlayerCreate(mem32_t handle, mem_ptr_t<CellSSPlayerConfig> config)
|
||||
p.m_channels = config->channels;
|
||||
|
||||
ssp.push_back(p);
|
||||
handle = ssp.size() - 1;
|
||||
handle = (u32)ssp.size() - 1;
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
|
@ -404,7 +404,7 @@ int sceNpTrophyGetTrophyInfo(u32 context, u32 handle, s32 trophyId, mem_ptr_t<Sc
|
||||
}
|
||||
|
||||
data->trophyId = trophyId;
|
||||
data->unlocked = ctxt.tropusr->GetTrophyUnlockState(trophyId);
|
||||
data->unlocked = ctxt.tropusr->GetTrophyUnlockState(trophyId) ? true : false; // ???
|
||||
data->timestamp.tick = ctxt.tropusr->GetTrophyTimestamp(trophyId);
|
||||
}
|
||||
}
|
||||
|
@ -32,24 +32,24 @@ int _sys_heap_create_heap(const u32 heap_addr, const u32 align, const u32 size)
|
||||
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);
|
||||
|
||||
HeapInfo* heap;
|
||||
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);
|
||||
|
||||
HeapInfo* heap;
|
||||
if(!sysPrxForUser->CheckId(heap_id, heap)) return CELL_ESRCH;
|
||||
|
||||
return Memory.Alloc(size, align);
|
||||
return (u32)Memory.Alloc(size, align);
|
||||
}
|
||||
|
||||
void sys_initialize_tls()
|
||||
@ -172,7 +172,7 @@ s32 _sys_memcmp(u32 addr1, u32 addr2, u32 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);
|
||||
|
||||
@ -251,7 +251,7 @@ s32 _sys_spu_printf_finalize()
|
||||
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);
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
|
@ -66,7 +66,7 @@ int sdata_unpack(const std::string& packed_file, const std::string& unpacked_fil
|
||||
u32 blockSize = re32(*(u32*)&buffer[0x84]);
|
||||
u64 filesizeOutput = re64(*(u64*)&buffer[0x88]);
|
||||
u64 filesizeInput = packed_stream->GetSize();
|
||||
u32 blockCount = (filesizeOutput + blockSize-1) / blockSize;
|
||||
u32 blockCount = (u32)((filesizeOutput + blockSize - 1) / blockSize);
|
||||
|
||||
// SDATA file is compressed
|
||||
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);
|
||||
|
||||
if (!(blockCount-i-1))
|
||||
blockSize = filesizeOutput-i*blockSize;
|
||||
blockSize = (u32)(filesizeOutput - i * blockSize);
|
||||
|
||||
packed_stream->Read(buffer+256, blockSize);
|
||||
unpacked_stream->Write(buffer+256, blockSize);
|
||||
|
@ -345,7 +345,7 @@ int socketselect()
|
||||
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());
|
||||
g_lastError.SetAddr(Memory.Alloc(4, 1));
|
||||
g_lastError.SetAddr((u32)Memory.Alloc(4, 1));
|
||||
#ifdef _WIN32
|
||||
WSADATA wsaData;
|
||||
WORD wVersionRequested = MAKEWORD(1,1);
|
||||
|
@ -916,7 +916,7 @@ struct SyscallTableCleaner_t
|
||||
void default_syscall()
|
||||
{
|
||||
declCPU();
|
||||
u32 code = CPU.GPR[11];
|
||||
u32 code = (u32)CPU.GPR[11];
|
||||
//TODO: remove this
|
||||
switch(code)
|
||||
{
|
||||
|
@ -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:
|
||||
if(size & 0xfffff) return CELL_EALIGN;
|
||||
ct->addr = Memory.Alloc(size, 0x100000);
|
||||
ct->addr = (u32)Memory.Alloc(size, 0x100000);
|
||||
break;
|
||||
|
||||
case SYS_MEMORY_PAGE_SIZE_64K:
|
||||
if(size & 0xffff) return CELL_EALIGN;
|
||||
ct->addr = Memory.Alloc(size, 0x10000);
|
||||
ct->addr = (u32)Memory.Alloc(size, 0x10000);
|
||||
break;
|
||||
|
||||
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);
|
||||
|
||||
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)
|
||||
return CELL_ENOMEM;
|
||||
|
@ -35,7 +35,7 @@ struct MemoryContainerInfo
|
||||
u32 addr;
|
||||
u32 size;
|
||||
|
||||
MemoryContainerInfo(u64 addr, u32 size)
|
||||
MemoryContainerInfo(u32 addr, u32 size)
|
||||
: addr(addr)
|
||||
, size(size)
|
||||
{
|
||||
|
@ -26,13 +26,13 @@ s32 sys_mmapper_allocate_address(u32 size, u64 flags, u32 alignment, u32 alloc_a
|
||||
case SYS_MEMORY_PAGE_SIZE_1M:
|
||||
if(AlignAddr(size, alignment) & 0xfffff)
|
||||
return CELL_EALIGN;
|
||||
addr = Memory.Alloc(size, 0x100000);
|
||||
addr = (u32)Memory.Alloc(size, 0x100000);
|
||||
break;
|
||||
|
||||
case SYS_MEMORY_PAGE_SIZE_64K:
|
||||
if(AlignAddr(size, alignment) & 0xffff)
|
||||
return CELL_EALIGN;
|
||||
addr = Memory.Alloc(size, 0x10000);
|
||||
addr = (u32)Memory.Alloc(size, 0x10000);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -64,13 +64,13 @@ s32 sys_mmapper_allocate_memory(u32 size, u64 flags, mem32_t mem_id)
|
||||
case SYS_MEMORY_PAGE_SIZE_1M:
|
||||
if(size & 0xfffff)
|
||||
return CELL_EALIGN;
|
||||
addr = Memory.Alloc(size, 0x100000);
|
||||
addr = (u32)Memory.Alloc(size, 0x100000);
|
||||
break;
|
||||
|
||||
case SYS_MEMORY_PAGE_SIZE_64K:
|
||||
if(size & 0xffff)
|
||||
return CELL_EALIGN;
|
||||
addr = Memory.Alloc(size, 0x10000);
|
||||
addr = (u32)Memory.Alloc(size, 0x10000);
|
||||
break;
|
||||
|
||||
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:
|
||||
if(size & 0xfffff)
|
||||
return CELL_EALIGN;
|
||||
ct->addr = Memory.Alloc(size, 0x100000);
|
||||
ct->addr = (u32)Memory.Alloc(size, 0x100000);
|
||||
break;
|
||||
|
||||
case SYS_MEMORY_PAGE_SIZE_64K:
|
||||
if(size & 0xffff)
|
||||
return CELL_EALIGN;
|
||||
ct->addr = Memory.Alloc(size, 0x10000);
|
||||
ct->addr = (u32)Memory.Alloc(size, 0x10000);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -5,11 +5,11 @@
|
||||
|
||||
struct mmapper_info
|
||||
{
|
||||
u64 addr;
|
||||
u32 addr;
|
||||
u32 size;
|
||||
u32 flags;
|
||||
u64 flags;
|
||||
|
||||
mmapper_info(u64 _addr, u32 _size, u32 _flags)
|
||||
mmapper_info(u32 _addr, u32 _size, u64 _flags)
|
||||
: addr(_addr)
|
||||
, size(_size)
|
||||
, flags(_flags)
|
||||
|
@ -108,7 +108,7 @@ s32 sys_ppu_thread_get_priority(u64 thread_id, u32 prio_addr)
|
||||
CPUThread* thr = Emu.GetCPU().GetThread(thread_id);
|
||||
if(!thr) return CELL_ESRCH;
|
||||
|
||||
Memory.Write32(prio_addr, thr->GetPrio());
|
||||
Memory.Write32(prio_addr, (s32)thr->GetPrio());
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
@ -119,8 +119,8 @@ s32 sys_ppu_thread_get_stack_information(u32 info_addr)
|
||||
|
||||
declCPU();
|
||||
|
||||
Memory.Write32(info_addr, CPU.GetStackAddr());
|
||||
Memory.Write32(info_addr+4, CPU.GetStackSize());
|
||||
Memory.Write32(info_addr, (u32)CPU.GetStackAddr());
|
||||
Memory.Write32(info_addr + 4, CPU.GetStackSize());
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
@ -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
|
||||
sys_prx_t* prx = new sys_prx_t();
|
||||
prx->size = f.GetSize();
|
||||
prx->address = Memory.Alloc(prx->size, 4);
|
||||
prx->size = (u32)f.GetSize();
|
||||
prx->address = (u32)Memory.Alloc(prx->size, 4);
|
||||
prx->path = path;
|
||||
|
||||
// Load the PRX into memory
|
||||
|
@ -344,7 +344,7 @@ void Emulator::Load()
|
||||
thread.AddArgv(m_elf_path);
|
||||
//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);
|
||||
|
||||
mem32_ptr_t callback_data(m_rsx_callback);
|
||||
@ -352,7 +352,7 @@ void Emulator::Load()
|
||||
callback_data += SC(2);
|
||||
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);
|
||||
//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 += 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);
|
||||
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);
|
||||
|
||||
u32 break_count = m_break_points.size();
|
||||
u32 marked_count = m_marked_points.size();
|
||||
u32 break_count = (u32)m_break_points.size();
|
||||
u32 marked_count = (u32)m_marked_points.size();
|
||||
|
||||
f << bpdb_version << break_count << marked_count;
|
||||
|
||||
@ -519,7 +519,7 @@ void Emulator::LoadPoints(const std::string& path)
|
||||
if (!f.is_open())
|
||||
return;
|
||||
f.seekg(0, std::ios::end);
|
||||
int length = f.tellg();
|
||||
int length = (int)f.tellg();
|
||||
f.seekg(0, std::ios::beg);
|
||||
u32 break_count, marked_count;
|
||||
u16 version;
|
||||
|
@ -231,7 +231,7 @@ bool ELF64Loader::LoadEhdrInfo(s64 offset)
|
||||
return false;
|
||||
}
|
||||
|
||||
entry = ehdr.GetEntry();
|
||||
entry = (u32)ehdr.GetEntry();
|
||||
if(entry == 0)
|
||||
{
|
||||
LOG_ERROR(LOADER, "elf64 error: entry is null!");
|
||||
@ -320,12 +320,12 @@ bool ELF64Loader::LoadPhdrData(u64 offset)
|
||||
|
||||
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)
|
||||
{
|
||||
max_addr = phdr.p_vaddr + phdr.p_memsz;
|
||||
max_addr = (u32)(phdr.p_vaddr + phdr.p_memsz);
|
||||
}
|
||||
|
||||
if (phdr.p_vaddr != phdr.p_paddr)
|
||||
@ -334,7 +334,7 @@ bool ELF64Loader::LoadPhdrData(u64 offset)
|
||||
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
|
||||
LOG_WARNING(LOADER, "Skipping...");
|
||||
@ -348,13 +348,15 @@ bool ELF64Loader::LoadPhdrData(u64 offset)
|
||||
case 0x00000001: //LOAD
|
||||
if(phdr.p_memsz)
|
||||
{
|
||||
Memory.MainMem.AllocFixed(offset + phdr.p_vaddr, phdr.p_memsz);
|
||||
|
||||
if(phdr.p_filesz)
|
||||
if (!Memory.MainMem.AllocFixed(offset + phdr.p_vaddr, (u32)phdr.p_memsz))
|
||||
{
|
||||
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.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;
|
||||
@ -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, "*** text: 0x%x (0x%x)", text, stub.s_text + i*4);
|
||||
#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);
|
||||
out_tbl += dst + i*section;
|
||||
mem32_ptr_t out_tbl((u32)tbl + i*8);
|
||||
out_tbl += (u32)dst + i*section;
|
||||
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 += SC(2);
|
||||
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 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)
|
||||
{
|
||||
min_addr = shdr.sh_addr;
|
||||
min_addr = (u32)shdr.sh_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))
|
||||
|
@ -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)),
|
||||
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)) };
|
||||
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_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);
|
||||
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);
|
||||
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);
|
||||
|
||||
m_tableHeaders.clear();
|
||||
@ -169,7 +169,7 @@ bool TROPUSRLoader::Generate(const std::string& filepath, const std::string& con
|
||||
|
||||
m_header.magic = 0x818F54AD;
|
||||
m_header.unk1 = 0x00010000;
|
||||
m_header.tables_count = m_tableHeaders.size();
|
||||
m_header.tables_count = (u32)m_tableHeaders.size();
|
||||
m_header.unk2 = 0;
|
||||
|
||||
Save(filepath);
|
||||
@ -178,7 +178,7 @@ bool TROPUSRLoader::Generate(const std::string& filepath, const std::string& con
|
||||
|
||||
u32 TROPUSRLoader::GetTrophiesCount()
|
||||
{
|
||||
return m_table6.size();
|
||||
return (u32)m_table6.size();
|
||||
}
|
||||
|
||||
u32 TROPUSRLoader::GetTrophyUnlockState(u32 id)
|
||||
@ -189,9 +189,9 @@ u32 TROPUSRLoader::GetTrophyUnlockState(u32 id)
|
||||
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);
|
||||
|
||||
// TODO: What timestamp does sceNpTrophyGetTrophyInfo want, timestamp1 or timestamp2?
|
||||
|
@ -79,7 +79,7 @@ public:
|
||||
virtual u32 GetTrophiesCount();
|
||||
|
||||
virtual u32 GetTrophyUnlockState(u32 id);
|
||||
virtual u32 GetTrophyTimestamp(u32 id);
|
||||
virtual u64 GetTrophyTimestamp(u32 id);
|
||||
|
||||
virtual bool UnlockTrophy(u32 id, u64 timestamp1, u64 timestamp2);
|
||||
};
|
||||
|
@ -42,14 +42,14 @@ typedef uint16_t u16;
|
||||
typedef uint32_t u32;
|
||||
typedef uint64_t u64;
|
||||
|
||||
static const u32 U32_MAX = 0xffffffff;
|
||||
static const u32 U32_MAX = 0xffffffffu;
|
||||
|
||||
typedef int8_t s8;
|
||||
typedef int16_t s16;
|
||||
typedef int32_t s32;
|
||||
typedef int64_t s64;
|
||||
|
||||
static const s32 S32_MIN = -0x80000000;
|
||||
static const s32 S32_MIN = (s32)0x80000000u;
|
||||
static const s32 S32_MAX = 0x7fffffff;
|
||||
|
||||
union u128
|
||||
|
Loading…
Reference in New Issue
Block a user