mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-26 12:42:41 +01:00
Fixes
Fixed vm::vars missing be_t in a lot of cases and disabled a part of cellSailCreateDescriptor for now.
This commit is contained in:
parent
d58beb8f4c
commit
b96037f160
@ -30,7 +30,7 @@ int cellFontInitializeWithRevision(u64 revisionFlags, vm::ptr<CellFontConfig> co
|
||||
return CELL_FONT_OK;
|
||||
}
|
||||
|
||||
int cellFontGetRevisionFlags(vm::ptr<u64> revisionFlags)
|
||||
int cellFontGetRevisionFlags(vm::ptr<be_t<u64>> revisionFlags)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellFont);
|
||||
return CELL_FONT_OK;
|
||||
@ -40,7 +40,7 @@ int cellFontInit(vm::ptr<CellFontConfig> config)
|
||||
{
|
||||
cellFont->Log("cellFontInit(config=0x%x)", config.addr());
|
||||
|
||||
vm::var<u64> revisionFlags;
|
||||
vm::var<be_t<u64>> revisionFlags;
|
||||
revisionFlags.value() = 0;
|
||||
cellFontGetRevisionFlags(revisionFlags);
|
||||
return cellFontInitializeWithRevision(revisionFlags.value(), config);
|
||||
|
@ -798,7 +798,7 @@ int cellGcmSortRemapEaIoAddress()
|
||||
//----------------------------------------------------------------------------
|
||||
// Memory Mapping
|
||||
//----------------------------------------------------------------------------
|
||||
s32 cellGcmAddressToOffset(u64 address, vm::ptr<u32> offset)
|
||||
s32 cellGcmAddressToOffset(u64 address, vm::ptr<be_t<u32>> offset)
|
||||
{
|
||||
cellGcmSys->Log("cellGcmAddressToOffset(address=0x%x,offset_addr=0x%x)", address, offset.addr());
|
||||
|
||||
|
@ -24,7 +24,7 @@ u32 gcmGetLocalMemorySize();
|
||||
// SysCalls
|
||||
s32 cellGcmSetPrepareFlip(vm::ptr<CellGcmContextData> ctxt, u32 id);
|
||||
|
||||
s32 cellGcmAddressToOffset(u64 address, vm::ptr<u32> offset);
|
||||
s32 cellGcmAddressToOffset(u64 address, vm::ptr<be_t<u32>> offset);
|
||||
u32 cellGcmGetMaxIoMapSize();
|
||||
void cellGcmGetOffsetTable(vm::ptr<CellGcmOffsetTable> table);
|
||||
s32 cellGcmIoOffsetToAddress(u32 ioOffset, u64 address);
|
||||
|
@ -38,9 +38,9 @@ int cellGifDecOpen(u32 mainHandle, vm::ptr<u32> subHandle, vm::ptr<CellGifDecSrc
|
||||
|
||||
case se32(CELL_GIFDEC_FILE):
|
||||
// Get file descriptor
|
||||
vm::var<u32> fd;
|
||||
vm::var<be_t<u32>> fd;
|
||||
int ret = cellFsOpen(vm::ptr<const char>::make(src->fileName.addr()), 0, fd, vm::ptr<u32>::make(0), 0);
|
||||
current_subHandle->fd = fd;
|
||||
current_subHandle->fd = fd->ToLE();
|
||||
if (ret != CELL_OK) return CELL_GIFDEC_ERROR_OPEN_FILE;
|
||||
|
||||
// Get size of file
|
||||
@ -72,7 +72,7 @@ int cellGifDecReadHeader(u32 mainHandle, u32 subHandle, vm::ptr<CellGifDecInfo>
|
||||
|
||||
//Write the header to buffer
|
||||
vm::var<u8[13]> buffer; // Alloc buffer for GIF header
|
||||
vm::var<u64> pos, nread;
|
||||
vm::var<be_t<u64>> pos, nread;
|
||||
|
||||
switch(subHandle_data->src.srcSelect.ToBE())
|
||||
{
|
||||
@ -154,7 +154,7 @@ int cellGifDecDecodeData(u32 mainHandle, u32 subHandle, vm::ptr<u8> data, vm::pt
|
||||
|
||||
//Copy the GIF file to a buffer
|
||||
vm::var<unsigned char[]> gif((u32)fileSize);
|
||||
vm::var<u64> pos, nread;
|
||||
vm::var<be_t<u64>> pos, nread;
|
||||
|
||||
switch(subHandle_data->src.srcSelect.ToBE())
|
||||
{
|
||||
|
@ -44,9 +44,9 @@ int cellJpgDecOpen(u32 mainHandle, vm::ptr<u32> subHandle, vm::ptr<CellJpgDecSrc
|
||||
|
||||
case se32(CELL_JPGDEC_FILE):
|
||||
// Get file descriptor
|
||||
vm::var<u32> fd;
|
||||
vm::var<be_t<u32>> fd;
|
||||
int ret = cellFsOpen(vm::ptr<const char>::make(src->fileName.addr()), 0, fd, vm::ptr<u32>::make(0), 0);
|
||||
current_subHandle->fd = fd;
|
||||
current_subHandle->fd = fd->ToLE();
|
||||
if (ret != CELL_OK) return CELL_JPGDEC_ERROR_OPEN_FILE;
|
||||
|
||||
// Get size of file
|
||||
@ -92,7 +92,7 @@ int cellJpgDecReadHeader(u32 mainHandle, u32 subHandle, vm::ptr<CellJpgDecInfo>
|
||||
|
||||
//Write the header to buffer
|
||||
vm::var<u8[]> buffer((u32)fileSize);
|
||||
vm::var<u64> pos, nread;
|
||||
vm::var<be_t<u64>> pos, nread;
|
||||
|
||||
switch(subHandle_data->src.srcSelect.ToBE())
|
||||
{
|
||||
@ -161,7 +161,7 @@ int cellJpgDecDecodeData(u32 mainHandle, u32 subHandle, vm::ptr<u8> data, vm::pt
|
||||
|
||||
//Copy the JPG file to a buffer
|
||||
vm::var<unsigned char[]> jpg((u32)fileSize);
|
||||
vm::var<u64> pos, nread;
|
||||
vm::var<be_t<u64>> pos, nread;
|
||||
|
||||
switch(subHandle_data->src.srcSelect.ToBE())
|
||||
{
|
||||
|
@ -83,9 +83,9 @@ s32 pngDecOpen(
|
||||
|
||||
case se32(CELL_PNGDEC_FILE):
|
||||
// Get file descriptor
|
||||
vm::var<u32> fd;
|
||||
vm::var<be_t<u32>> fd;
|
||||
int ret = cellFsOpen(vm::ptr<const char>::make(src->fileName.addr()), 0, fd, vm::ptr<u32>::make(0), 0);
|
||||
stream->fd = fd;
|
||||
stream->fd = fd->ToLE();
|
||||
if (ret != CELL_OK) return CELL_PNGDEC_ERROR_OPEN_FILE;
|
||||
|
||||
// Get size of file
|
||||
@ -141,7 +141,7 @@ s32 pngReadHeader(
|
||||
//Write the header to buffer
|
||||
vm::var<u8[34]> buffer; // Alloc buffer for PNG header
|
||||
auto buffer_32 = buffer.To<be_t<u32>>();
|
||||
vm::var<u64> pos, nread;
|
||||
vm::var<be_t<u64>> pos, nread;
|
||||
|
||||
switch (stream->src.srcSelect.ToBE())
|
||||
{
|
||||
@ -246,7 +246,7 @@ s32 pngDecodeData(
|
||||
|
||||
//Copy the PNG file to a buffer
|
||||
vm::var<unsigned char[]> png((u32)fileSize);
|
||||
vm::var<u64> pos, nread;
|
||||
vm::var<be_t<u64>> pos, nread;
|
||||
|
||||
switch (stream->src.srcSelect.ToBE())
|
||||
{
|
||||
|
@ -14,7 +14,7 @@ extern s32 cellVideoOutConfigure(u32 videoOut, vm::ptr<CellVideoOutConfiguration
|
||||
extern int cellGcmSetFlipMode(u32 mode);
|
||||
extern void cellGcmSetFlipHandler(vm::ptr<void(*)(const u32)> handler);
|
||||
extern void cellGcmSetVBlankHandler(vm::ptr<void(*)(const u32)> handler);
|
||||
extern int cellGcmAddressToOffset(u64 address, vm::ptr<u32> offset);
|
||||
extern int cellGcmAddressToOffset(u64 address, vm::ptr<be_t<u32>> offset);
|
||||
extern int cellGcmSetDisplayBuffer(u32 id, u32 offset, u32 pitch, u32 width, u32 height);
|
||||
extern int cellGcmSetPrepareFlip(vm::ptr<CellGcmContextData> ctx, u32 id);
|
||||
extern int cellGcmSetSecondVFrequency(u32 freq);
|
||||
@ -1049,12 +1049,12 @@ int cellRescSetBufferAddress(vm::ptr<u32> colorBuffers, vm::ptr<u32> vertexArray
|
||||
s_rescInternalInstance->m_vertexArrayEA = vertexArray.addr();
|
||||
s_rescInternalInstance->m_fragmentUcodeEA = fragmentShader.addr();
|
||||
|
||||
vm::var<u32> dstOffset;
|
||||
vm::var<be_t<u32>> dstOffset;
|
||||
cellGcmAddressToOffset(s_rescInternalInstance->m_colorBuffersEA, dstOffset);
|
||||
|
||||
for (int i=0; i<GetNumColorBuffers(); i++)
|
||||
{
|
||||
s_rescInternalInstance->m_dstOffsets[i] = dstOffset + i * s_rescInternalInstance->m_dstBufInterval;
|
||||
s_rescInternalInstance->m_dstOffsets[i] = dstOffset->ToLE() + i * s_rescInternalInstance->m_dstBufInterval;
|
||||
}
|
||||
|
||||
for (int i=0; i<GetNumColorBuffers(); i++)
|
||||
|
@ -614,18 +614,21 @@ int cellSailPlayerCreateDescriptor(vm::ptr<CellSailPlayer> pSelf, s32 streamType
|
||||
cellSail->Todo("cellSailPlayerCreateDescriptor(pSelf_addr=0x%x, streamType=%d, pMediaInfo_addr=0x%x, pUri_addr=0x%x, ppDesc_addr=0x%x)", pSelf.addr(), streamType,
|
||||
pMediaInfo.addr(), pUri.addr(), ppDesc.addr());
|
||||
|
||||
CellSailDescriptor *pDesc = new CellSailDescriptor();
|
||||
vm::ptr<CellSailDescriptor> descriptor = vm::ptr<CellSailDescriptor>::make(Memory.RealToVirtualAddr(&pDesc));
|
||||
// TODO: Let the game allocate memory for the descriptor, setup the descriptor and pass it back to the game
|
||||
|
||||
descriptor->streamType = streamType;
|
||||
descriptor->registered = false;
|
||||
//CellSailDescriptor *pDesc = new CellSailDescriptor();
|
||||
//u32 descriptorAddress = pSelf->allocator->callbacks->pAlloc(pSelf->allocator->pArg, 4, descriptorAddress);
|
||||
//cellSail->Error("Address: 0x%x", descriptorAddress);
|
||||
//vm::ptr<CellSailDescriptor> descriptor = vm::ptr<CellSailDescriptor>::make(Memory.RealToVirtualAddr(&descriptorAddress));
|
||||
//descriptor->streamType = streamType;
|
||||
//descriptor->registered = false;
|
||||
|
||||
pSelf->descriptors = 0;
|
||||
pSelf->repeatMode = 0;
|
||||
ppDesc = descriptor;
|
||||
//ppDesc = descriptor;
|
||||
|
||||
cellSail->Todo("pSelf_addr=0x%x, pDesc_addr=0x%x", pSelf.addr(), descriptor.addr());
|
||||
cellSailPlayerAddDescriptor(pSelf, ppDesc);
|
||||
//cellSail->Todo("pSelf_addr=0x%x, pDesc_addr=0x%x", pSelf.addr(), descriptor.addr());
|
||||
//cellSailPlayerAddDescriptor(pSelf, ppDesc);
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
@ -618,8 +618,8 @@ union CellSailEvent
|
||||
};
|
||||
};
|
||||
|
||||
typedef void(*CellSailMemAllocatorFuncAlloc)(u32 pArg, u32 boundary, u32 size);
|
||||
typedef void(*CellSailMemAllocatorFuncFree)(u32 pArg, u32 boundary, u32 pMemory);
|
||||
typedef u32(*CellSailMemAllocatorFuncAlloc)(u32 pArg, u32 boundary, u32 size);
|
||||
typedef u32(*CellSailMemAllocatorFuncFree)(u32 pArg, u32 boundary, u32 pMemory);
|
||||
|
||||
typedef int(*CellSailSoundAdapterFuncMakeup)(u32 pArg);
|
||||
typedef int(*CellSailSoundAdapterFuncCleanup)(u32 pArg);
|
||||
@ -1102,5 +1102,4 @@ struct CellSailPlayer
|
||||
be_t<s32> repeatMode;
|
||||
be_t<u32> descriptors;
|
||||
vm::ptr<CellSailDescriptor> registeredDescriptors[2];
|
||||
be_t<u64> internalData[128];
|
||||
};
|
@ -111,7 +111,7 @@ int sdata_unpack(const std::string& packed_file, const std::string& unpacked_fil
|
||||
}
|
||||
|
||||
|
||||
int cellFsSdataOpen(vm::ptr<const char> path, int flags, vm::ptr<u32> fd, vm::ptr<u32> arg, u64 size)
|
||||
int cellFsSdataOpen(vm::ptr<const char> path, int flags, vm::ptr<be_t<u32>> fd, vm::ptr<u32> arg, u64 size)
|
||||
{
|
||||
sys_fs->Warning("cellFsSdataOpen(path=\"%s\", flags=0x%x, fd_addr=0x%x, arg_addr=0x%x, size=0x%llx) -> cellFsOpen()",
|
||||
path.get_ptr(), flags, fd.addr(), arg.addr(), size);
|
||||
@ -270,7 +270,7 @@ int cellFsAioFinish(vm::ptr<const char> mount_point)
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellFsReadWithOffset(u32 fd, u64 offset, vm::ptr<void> buf, u64 buffer_size, vm::ptr<u64> nread)
|
||||
int cellFsReadWithOffset(u32 fd, u64 offset, vm::ptr<void> buf, u64 buffer_size, vm::ptr<be_t<u64>> nread)
|
||||
{
|
||||
sys_fs->Warning("cellFsReadWithOffset(fd=%d, offset=0x%llx, buf_addr=0x%x, buffer_size=%lld nread=0x%llx)",
|
||||
fd, offset, buf.addr(), buffer_size, nread.addr());
|
||||
@ -278,7 +278,7 @@ int cellFsReadWithOffset(u32 fd, u64 offset, vm::ptr<void> buf, u64 buffer_size,
|
||||
LV2_LOCK(0);
|
||||
|
||||
int ret;
|
||||
vm::var<u64> oldPos, newPos;
|
||||
vm::var<be_t<u64>> oldPos, newPos;
|
||||
ret = cellFsLseek(fd, 0, CELL_SEEK_CUR, oldPos); // Save the current position
|
||||
if (ret) return ret;
|
||||
ret = cellFsLseek(fd, offset, CELL_SEEK_SET, newPos); // Move to the specified offset
|
||||
|
@ -30,7 +30,7 @@ struct FsRingBufferConfig
|
||||
} fs_config;
|
||||
|
||||
|
||||
s32 cellFsOpen(vm::ptr<const char> path, s32 flags, vm::ptr<u32> fd, vm::ptr<u32> arg, u64 size)
|
||||
s32 cellFsOpen(vm::ptr<const char> path, s32 flags, vm::ptr<be_t<u32>> fd, vm::ptr<u32> arg, u64 size)
|
||||
{
|
||||
sys_fs->Log("cellFsOpen(path=\"%s\", flags=0x%x, fd_addr=0x%x, arg_addr=0x%x, size=0x%llx)",
|
||||
path.get_ptr(), flags, fd.addr(), arg.addr(), size);
|
||||
@ -116,7 +116,7 @@ s32 cellFsOpen(vm::ptr<const char> path, s32 flags, vm::ptr<u32> fd, vm::ptr<u32
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellFsRead(u32 fd, vm::ptr<void> buf, u64 nbytes, vm::ptr<u64> nread)
|
||||
s32 cellFsRead(u32 fd, vm::ptr<void> buf, u64 nbytes, vm::ptr<be_t<u64>> nread)
|
||||
{
|
||||
sys_fs->Log("cellFsRead(fd=%d, buf_addr=0x%x, nbytes=0x%llx, nread_addr=0x%x)",
|
||||
fd, buf.addr(), nbytes, nread.addr());
|
||||
@ -407,7 +407,7 @@ s32 cellFsUnlink(vm::ptr<const char> path)
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellFsLseek(u32 fd, s64 offset, u32 whence, vm::ptr<u64> pos)
|
||||
s32 cellFsLseek(u32 fd, s64 offset, u32 whence, vm::ptr<be_t<u64>> pos)
|
||||
{
|
||||
sys_fs->Log("cellFsLseek(fd=%d, offset=0x%llx, whence=0x%x, pos_addr=0x%x)", fd, offset, whence, pos.addr());
|
||||
|
||||
|
@ -128,8 +128,8 @@ struct CellFsRingBuffer
|
||||
};
|
||||
|
||||
// SysCalls
|
||||
s32 cellFsOpen(vm::ptr<const char> path, s32 flags, vm::ptr<u32> fd, vm::ptr<u32> arg, u64 size);
|
||||
s32 cellFsRead(u32 fd, vm::ptr<void> buf, u64 nbytes, vm::ptr<u64> nread);
|
||||
s32 cellFsOpen(vm::ptr<const char> path, s32 flags, vm::ptr<be_t<u32>> fd, vm::ptr<u32> arg, u64 size);
|
||||
s32 cellFsRead(u32 fd, vm::ptr<void> buf, u64 nbytes, vm::ptr<be_t<u64>> nread);
|
||||
s32 cellFsWrite(u32 fd, vm::ptr<const void> buf, u64 nbytes, vm::ptr<u64> nwrite);
|
||||
s32 cellFsClose(u32 fd);
|
||||
s32 cellFsOpendir(vm::ptr<const char> path, vm::ptr<u32> fd);
|
||||
@ -143,7 +143,7 @@ s32 cellFsChmod(vm::ptr<const char> path, u32 mode);
|
||||
s32 cellFsFsync(u32 fd);
|
||||
s32 cellFsRmdir(vm::ptr<const char> path);
|
||||
s32 cellFsUnlink(vm::ptr<const char> path);
|
||||
s32 cellFsLseek(u32 fd, s64 offset, u32 whence, vm::ptr<u64> pos);
|
||||
s32 cellFsLseek(u32 fd, s64 offset, u32 whence, vm::ptr<be_t<u64>> pos);
|
||||
s32 cellFsFtruncate(u32 fd, u64 size);
|
||||
s32 cellFsTruncate(vm::ptr<const char> path, u64 size);
|
||||
s32 cellFsFGetBlockSize(u32 fd, vm::ptr<u64> sector_size, vm::ptr<u64> block_size);
|
||||
|
Loading…
Reference in New Issue
Block a user