Minor formatting fix, cellRudp fix

This commit is contained in:
Nekotekina 2015-07-27 17:59:21 +03:00
parent 16b7d204d2
commit 5815d90eb4
17 changed files with 150 additions and 146 deletions

View File

@ -18,7 +18,7 @@ s32 cellCameraInit()
return CELL_CAMERA_ERROR_DEVICE_NOT_FOUND;
}
if (g_camera->init.exchange(true))
if (g_camera->init)
{
return CELL_CAMERA_ERROR_ALREADY_INIT;
}
@ -60,6 +60,11 @@ s32 cellCameraInit()
}
// TODO: Some other default attributes? Need to check the actual behaviour on a real PS3.
if (g_camera->init.exchange(true))
{
throw EXCEPTION("Unexpected");
}
return CELL_OK;
}
@ -67,11 +72,16 @@ s32 cellCameraEnd()
{
cellCamera.Warning("cellCameraEnd()");
if (!g_camera->init.exchange(false))
if (!g_camera->init)
{
return CELL_CAMERA_ERROR_NOT_INIT;
}
if (!g_camera->init.exchange(false))
{
throw EXCEPTION("Unexpected");
}
return CELL_OK;
}

View File

@ -315,13 +315,13 @@ struct CellCameraReadEx
// Custom struct to keep track of cameras
struct camera_t
{
std::atomic<bool> init{ false };
struct attr_t
{
u32 v1, v2;
};
std::atomic<bool> init{ false };
attr_t attr[500]{};
static const char* get_attr_name(s32 value)

View File

@ -458,7 +458,7 @@ s32 cellPamfReaderGetEsFilterId(vm::ptr<CellPamfReader> pSelf, vm::ptr<CellCodec
s32 cellPamfReaderGetStreamInfo(vm::ptr<CellPamfReader> pSelf, vm::ptr<void> pInfo, u32 size)
{
cellPamf.Warning("cellPamfReaderGetStreamInfo(pSelf=*0x%x, pInfo_addr=0x%x, size=%d)", pSelf, pInfo, size);
cellPamf.Warning("cellPamfReaderGetStreamInfo(pSelf=*0x%x, pInfo=*0x%x, size=%d)", pSelf, pInfo, size);
assert((u32)pSelf->stream < (u32)pSelf->pAddr->stream_count);
auto& header = pSelf->pAddr->stream_headers[pSelf->stream];

View File

@ -8,52 +8,71 @@
extern Module cellRudp;
struct cellRudpInternal
struct RudpInternal
{
bool m_bInitialized;
CellRudpAllocator allocator;
std::atomic<bool> init;
// allocator functions
std::function<vm::ptr<void>(PPUThread& ppu, u32 size)> malloc;
std::function<void(PPUThread& ppu, vm::ptr<void> ptr)> free;
// event handler function
vm::ptr<CellRudpEventHandler> handler;
u32 argument;
cellRudpInternal()
: m_bInitialized(false)
{
}
};
cellRudpInternal cellRudpInstance;
vm::ptr<void> handler_arg;
}
g_rudp;
s32 cellRudpInit(vm::ptr<CellRudpAllocator> allocator)
{
cellRudp.Warning("cellRudpInit(allocator_addr=0x%x)", allocator.addr());
cellRudp.Warning("cellRudpInit(allocator=*0x%x)", allocator);
if (cellRudpInstance.m_bInitialized)
if (g_rudp.init.load())
{
cellRudp.Error("cellRudpInit(): cellRudp has already been initialized.");
return CELL_RUDP_ERROR_ALREADY_INITIALIZED;
}
if (allocator)
{
cellRudpInstance.allocator = *allocator.get_ptr();
g_rudp.malloc = allocator->app_malloc;
g_rudp.free = allocator->app_free;
}
else
{
g_rudp.malloc = [](PPUThread& ppu, u32 size)
{
return vm::ptr<void>::make(vm::alloc(size, vm::main));
};
g_rudp.free = [](PPUThread& ppu, vm::ptr<void> ptr)
{
if (!vm::dealloc(ptr.addr(), vm::main))
{
throw EXCEPTION("Memory deallocation failed (ptr=0x%x)", ptr);
}
};
}
cellRudpInstance.m_bInitialized = true;
if (g_rudp.init.exchange(true))
{
throw EXCEPTION("Unexpected");
}
return CELL_OK;
}
s32 cellRudpEnd()
{
cellRudp.Log("cellRudpEnd()");
cellRudp.Warning("cellRudpEnd()");
if (!cellRudpInstance.m_bInitialized)
if (!g_rudp.init.load())
{
cellRudp.Error("cellRudpEnd(): cellRudp has not been initialized.");
return CELL_RUDP_ERROR_NOT_INITIALIZED;
}
cellRudpInstance.m_bInitialized = false;
if (!g_rudp.init.exchange(false))
{
throw EXCEPTION("Unexpected");
}
return CELL_OK;
}
@ -64,22 +83,17 @@ s32 cellRudpEnableInternalIOThread()
return CELL_OK;
}
s32 cellRudpSetEventHandler(vm::ptr<CellRudpEventHandler> handler, vm::ptr<u32> arg)
s32 cellRudpSetEventHandler(vm::ptr<CellRudpEventHandler> handler, vm::ptr<void> arg)
{
cellRudp.Todo("cellRudpSetEventHandler(handler=0x%x, arg_addr=0x%x)", handler, arg.addr());
cellRudp.Todo("cellRudpSetEventHandler(handler=*0x%x, arg=*0x%x)", handler, arg);
if (!cellRudpInstance.m_bInitialized)
if (!g_rudp.init.load())
{
cellRudp.Error("cellRudpInit(): cellRudp has not been initialized.");
return CELL_RUDP_ERROR_NOT_INITIALIZED;
}
if (arg)
{
cellRudpInstance.argument = *arg.get_ptr();
}
cellRudpInstance.handler = handler;
g_rudp.handler = handler;
g_rudp.handler_arg = arg;
return CELL_OK;
}
@ -216,6 +230,12 @@ s32 cellRudpPollWait()
return CELL_OK;
}
s32 cellRudpPollCancel()
{
UNIMPLEMENTED_FUNC(cellRudp);
return CELL_OK;
}
s32 cellRudpNetReceived()
{
UNIMPLEMENTED_FUNC(cellRudp);
@ -230,7 +250,7 @@ s32 cellRudpProcessEvents()
Module cellRudp("cellRudp", []()
{
cellRudpInstance.m_bInitialized = false;
g_rudp.init = false;
REG_FUNC(cellRudp, cellRudpInit);
REG_FUNC(cellRudp, cellRudpEnd);
@ -263,7 +283,7 @@ Module cellRudp("cellRudp", []()
REG_FUNC(cellRudp, cellRudpPollDestroy);
REG_FUNC(cellRudp, cellRudpPollControl);
REG_FUNC(cellRudp, cellRudpPollWait);
//REG_FUNC(cellRudp, cellRudpPollCancel);
REG_FUNC(cellRudp, cellRudpPollCancel);
REG_FUNC(cellRudp, cellRudpNetReceived);
REG_FUNC(cellRudp, cellRudpProcessEvents);

View File

@ -77,10 +77,10 @@ enum
CELL_RUDP_POLL_EV_ERROR = 0x0008,
};
typedef s32(CellRudpEventHandler)(s32 event_id, s32 soc, vm::cptr<u8> data, u32 datalen, vm::cptr<sys_net_sockaddr> addr, u32 addrlen, vm::ptr<u32> arg);
using CellRudpEventHandler = s32(s32 event_id, s32 soc, vm::cptr<u8> data, u32 datalen, vm::cptr<sys_net_sockaddr> addr, u32 addrlen, vm::ptr<void> arg);
using CellRudpAllocatorFuncAlloc = vm::ptr<u32>(u32 size);
using CellRudpAllocatorFuncFree = u32(vm::ptr<u32> ptr);
using CellRudpAllocatorFuncAlloc = vm::ptr<void>(u32 size);
using CellRudpAllocatorFuncFree = void(vm::ptr<void> ptr);
struct CellRudpAllocator
{

View File

@ -12,7 +12,7 @@ extern Module cellSail;
s32 cellSailMemAllocatorInitialize(vm::ptr<CellSailMemAllocator> pSelf, vm::ptr<CellSailMemAllocatorFuncs> pCallbacks)
{
cellSail.Warning("cellSailMemAllocatorInitialize(pSelf_addr=0x%x, pCallbacks_addr=0x%x)", pSelf.addr(), pCallbacks.addr());
cellSail.Warning("cellSailMemAllocatorInitialize(pSelf=*0x%x, pCallbacks=*0x%x)", pSelf, pCallbacks);
pSelf->callbacks = pCallbacks;
@ -75,7 +75,7 @@ s32 cellSailDescriptorGetMediaInfo()
s32 cellSailDescriptorSetAutoSelection(vm::ptr<CellSailDescriptor> pSelf, b8 autoSelection)
{
cellSail.Warning("cellSailDescriptorSetAutoSelection(pSelf_addr=0x%x, autoSelection=%s)", pSelf.addr(), autoSelection ? "true" : "false");
cellSail.Warning("cellSailDescriptorSetAutoSelection(pSelf=*0x%x, autoSelection=%d)", pSelf, autoSelection);
if (pSelf) {
pSelf->autoSelection = autoSelection;
@ -87,7 +87,7 @@ s32 cellSailDescriptorSetAutoSelection(vm::ptr<CellSailDescriptor> pSelf, b8 aut
s32 cellSailDescriptorIsAutoSelection(vm::ptr<CellSailDescriptor> pSelf)
{
cellSail.Warning("cellSailDescriptorIsAutoSelection(pSelf_addr=0x%x)", pSelf.addr());
cellSail.Warning("cellSailDescriptorIsAutoSelection(pSelf=*0x%x)", pSelf);
if (pSelf)
return pSelf->autoSelection;
@ -97,7 +97,7 @@ s32 cellSailDescriptorIsAutoSelection(vm::ptr<CellSailDescriptor> pSelf)
s32 cellSailDescriptorCreateDatabase(vm::ptr<CellSailDescriptor> pSelf, vm::ptr<void> pDatabase, u32 size, u64 arg)
{
cellSail.Warning("cellSailDescriptorCreateDatabase(pSelf=0x%x, pDatabase=0x%x, size=0x%x, arg=0x%x", pSelf.addr(), pDatabase.addr(), size, arg);
cellSail.Warning("cellSailDescriptorCreateDatabase(pSelf=*0x%x, pDatabase=*0x%x, size=0x%x, arg=0x%x", pSelf, pDatabase, size, arg);
switch ((s32)pSelf->streamType) {
case CELL_SAIL_STREAM_PAMF:
@ -516,17 +516,23 @@ s32 cellSailPlayerInitialize()
return CELL_OK;
}
s32 cellSailPlayerInitialize2(vm::ptr<CellSailPlayer> pSelf, vm::ptr<CellSailMemAllocator> pAllocator, vm::ptr<CellSailPlayerFuncNotified> pCallback, u64 callbackArg,
vm::ptr<CellSailPlayerAttribute> pAttribute, vm::ptr<CellSailPlayerResource> pResource)
s32 cellSailPlayerInitialize2(
vm::ptr<CellSailPlayer> pSelf,
vm::ptr<CellSailMemAllocator> pAllocator,
vm::ptr<CellSailPlayerFuncNotified> pCallback,
vm::ptr<void> callbackArg,
vm::ptr<CellSailPlayerAttribute> pAttribute,
vm::ptr<CellSailPlayerResource> pResource)
{
cellSail.Warning("cellSailPlayerInitialize2(pSelf_addr=0x%x, pAllocator_addr=0x%x, pCallback=0x%x, callbackArg=%d, pAttribute_addr=0x%x, pResource=0x%x)", pSelf.addr(),
pAllocator.addr(), pCallback.addr(), callbackArg, pAttribute.addr(), pResource.addr());
cellSail.Warning("cellSailPlayerInitialize2(pSelf=*0x%x, pAllocator=*0x%x, pCallback=*0x%x, callbackArg=*0x%x, pAttribute=*0x%x, pResource=*0x%x)",
pSelf, pAllocator, pCallback, callbackArg, pAttribute, pResource);
pSelf->allocator = pAllocator;
pSelf->allocator = *pAllocator;
pSelf->callback = pCallback;
pSelf->callbackArgument = callbackArg;
pSelf->attribute = pAttribute;
pSelf->resource = pResource;
pSelf->callbackArg = callbackArg;
pSelf->attribute = *pAttribute;
pSelf->resource = *pResource;
pSelf->paused = true;
return CELL_OK;
}
@ -617,7 +623,7 @@ s32 cellSailPlayerBoot()
s32 cellSailPlayerAddDescriptor(vm::ptr<CellSailPlayer> pSelf, vm::ptr<CellSailDescriptor> pDesc)
{
cellSail.Warning("cellSailPlayerAddDescriptor(pSelf_addr=0x%x, pDesc_addr=0x%x)", pSelf.addr(), pDesc.addr());
cellSail.Warning("cellSailPlayerAddDescriptor(pSelf=*0x%x, pDesc=*0x%x)", pSelf, pDesc);
if (pSelf && pSelf->descriptors < 3 && pDesc)
{
@ -633,14 +639,13 @@ s32 cellSailPlayerAddDescriptor(vm::ptr<CellSailPlayer> pSelf, vm::ptr<CellSailD
return CELL_OK;
}
s32 cellSailPlayerCreateDescriptor(vm::ptr<CellSailPlayer> pSelf, s32 streamType, vm::ptr<u32> pMediaInfo, vm::cptr<char> pUri, vm::ptr<u32> ppDesc)
s32 cellSailPlayerCreateDescriptor(vm::ptr<CellSailPlayer> pSelf, s32 streamType, vm::ptr<u32> pMediaInfo, vm::cptr<char> pUri, vm::pptr<CellSailDescriptor> ppDesc)
{
cellSail.Warning("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());
cellSail.Warning("cellSailPlayerCreateDescriptor(pSelf=*0x%x, streamType=%d, pMediaInfo=*0x%x, pUri=*0x%x, ppDesc=**0x%x)", pSelf, streamType, pMediaInfo, pUri, ppDesc);
u32 descriptorAddress = vm::alloc(sizeof(CellSailDescriptor), vm::main);
auto descriptor = vm::ptr<CellSailDescriptor>::make(descriptorAddress);
*ppDesc = descriptorAddress;
*ppDesc = descriptor;
descriptor->streamType = streamType;
descriptor->registered = false;
@ -680,7 +685,6 @@ s32 cellSailPlayerCreateDescriptor(vm::ptr<CellSailPlayer> pSelf, s32 streamType
cellSail.Error("Unhandled stream type: %d", streamType);
}
//cellSail.Todo("pSelf_addr=0x%x, pDesc_addr=0x%x", pSelf.addr(), descriptor.addr());
//cellSailPlayerAddDescriptor(pSelf, ppDesc);
return CELL_OK;
@ -688,7 +692,7 @@ s32 cellSailPlayerCreateDescriptor(vm::ptr<CellSailPlayer> pSelf, s32 streamType
s32 cellSailPlayerDestroyDescriptor(vm::ptr<CellSailPlayer> pSelf, vm::ptr<CellSailDescriptor> pDesc)
{
cellSail.Todo("cellSailPlayerAddDescriptor(pSelf_addr=0x%x, pDesc_addr=0x%x)", pSelf.addr(), pDesc.addr());
cellSail.Todo("cellSailPlayerAddDescriptor(pSelf=*0x%x, pDesc=*0x%x)", pSelf, pDesc);
if (pDesc->registered)
return CELL_SAIL_ERROR_INVALID_STATE;
@ -698,7 +702,7 @@ s32 cellSailPlayerDestroyDescriptor(vm::ptr<CellSailPlayer> pSelf, vm::ptr<CellS
s32 cellSailPlayerRemoveDescriptor(vm::ptr<CellSailPlayer> pSelf, vm::ptr<CellSailDescriptor> ppDesc)
{
cellSail.Warning("cellSailPlayerAddDescriptor(pSelf_addr=0x%x, pDesc_addr=0x%x)", pSelf.addr(), ppDesc.addr());
cellSail.Warning("cellSailPlayerAddDescriptor(pSelf=*0x%x, pDesc=*0x%x)", pSelf, ppDesc);
if (pSelf->descriptors > 0)
{
@ -712,7 +716,7 @@ s32 cellSailPlayerRemoveDescriptor(vm::ptr<CellSailPlayer> pSelf, vm::ptr<CellSa
s32 cellSailPlayerGetDescriptorCount(vm::ptr<CellSailPlayer> pSelf)
{
cellSail.Warning("cellSailPlayerGetDescriptorCount(pSelf_addr=0x%x)", pSelf.addr());
cellSail.Warning("cellSailPlayerGetDescriptorCount(pSelf=*0x%x)", pSelf);
return pSelf->descriptors;
}
@ -814,19 +818,19 @@ s32 cellSailPlayerCancel()
s32 cellSailPlayerSetPaused(vm::ptr<CellSailPlayer> pSelf, b8 paused)
{
cellSail.Todo("cellSailPlayerSetPaused(pSelf_addr=0x%x, paused=%d)", pSelf.addr(), paused);
cellSail.Todo("cellSailPlayerSetPaused(pSelf=*0x%x, paused=%d)", pSelf, paused);
return CELL_OK;
}
s32 cellSailPlayerIsPaused(vm::ptr<CellSailPlayer> pSelf)
{
cellSail.Warning("cellSailPlayerIsPaused(pSelf_addr=0x%x)", pSelf.addr());
cellSail.Warning("cellSailPlayerIsPaused(pSelf=*0x%x)", pSelf);
return pSelf->paused;
}
s32 cellSailPlayerSetRepeatMode(vm::ptr<CellSailPlayer> pSelf, s32 repeatMode, vm::ptr<CellSailStartCommand> pCommand)
{
cellSail.Warning("cellSailPlayerSetRepeatMode(pSelf_addr=0x%x, repeatMode=%d, pCommand_addr=0x%x)", pSelf.addr(), repeatMode, pCommand.addr());
cellSail.Warning("cellSailPlayerSetRepeatMode(pSelf=*0x%x, repeatMode=%d, pCommand=*0x%x)", pSelf, repeatMode, pCommand);
pSelf->repeatMode = repeatMode;
pSelf->playbackCommand = pCommand;
@ -836,7 +840,7 @@ s32 cellSailPlayerSetRepeatMode(vm::ptr<CellSailPlayer> pSelf, s32 repeatMode, v
s32 cellSailPlayerGetRepeatMode(vm::ptr<CellSailPlayer> pSelf, vm::ptr<CellSailStartCommand> pCommand)
{
cellSail.Warning("cellSailPlayerGetRepeatMode(pSelf_addr=0x%x, pCommand_addr=0x%x)", pSelf.addr(), pCommand.addr());
cellSail.Warning("cellSailPlayerGetRepeatMode(pSelf=*0x%x, pCommand=*0x%x)", pSelf, pCommand);
pCommand = pSelf->playbackCommand;

View File

@ -1097,17 +1097,16 @@ struct CellSailPlayerResource
struct CellSailPlayer
{
vm::ptr<CellSailMemAllocator> allocator;
CellSailMemAllocator allocator;
vm::ptr<CellSailPlayerFuncNotified> callback;
be_t<u64> callbackArgument;
vm::ptr<CellSailPlayerAttribute> attribute;
vm::ptr<CellSailPlayerResource> resource;
vm::ptr<void> callbackArg;
CellSailPlayerAttribute attribute;
CellSailPlayerResource resource;
vm::ptr<CellSailStartCommand> playbackCommand;
be_t<s32> repeatMode;
be_t<s32> descriptors;
s32 repeatMode;
s32 descriptors;
vm::ptr<CellSailDescriptor> registeredDescriptors[2];
bool paused = true;
be_t<u64> internalData[26];
bool paused;
};
CHECK_SIZE(CellSailPlayer, 0x100);
CHECK_MAX_SIZE(CellSailPlayer, 0x100);

View File

@ -129,28 +129,28 @@ s32 npDrmIsAvailable(u32 k_licensee_addr, vm::cptr<char> drm_path)
s32 sceNpDrmIsAvailable(u32 k_licensee_addr, vm::cptr<char> drm_path)
{
sceNp.Warning("sceNpDrmIsAvailable(k_licensee_addr=0x%x, drm_path_addr=0x%x('%s'))", k_licensee_addr, drm_path.addr(), drm_path.get_ptr());
sceNp.Warning("sceNpDrmIsAvailable(k_licensee=*0x%x, drm_path=*0x%x)", k_licensee_addr, drm_path);
return npDrmIsAvailable(k_licensee_addr, drm_path);
}
s32 sceNpDrmIsAvailable2(u32 k_licensee_addr, vm::cptr<char> drm_path)
{
sceNp.Warning("sceNpDrmIsAvailable2(k_licensee_addr=0x%x, drm_path_addr=0x%x('%s'))", k_licensee_addr, drm_path.addr(), drm_path.get_ptr());
sceNp.Warning("sceNpDrmIsAvailable2(k_licensee=*0x%x, drm_path=*0x%x)", k_licensee_addr, drm_path);
return npDrmIsAvailable(k_licensee_addr, drm_path);
}
s32 sceNpDrmVerifyUpgradeLicense(vm::cptr<char> content_id)
{
sceNp.Todo("sceNpDrmVerifyUpgradeLicense(content_id_addr=0x%x)", content_id.addr());
sceNp.Todo("sceNpDrmVerifyUpgradeLicense(content_id=*0x%x)", content_id);
return CELL_OK;
}
s32 sceNpDrmVerifyUpgradeLicense2(vm::cptr<char> content_id)
{
sceNp.Todo("sceNpDrmVerifyUpgradeLicense2(content_id_addr=0x%x)", content_id.addr());
sceNp.Todo("sceNpDrmVerifyUpgradeLicense2(content_id=*0x%x)", content_id);
return CELL_OK;
}
@ -163,7 +163,7 @@ s32 sceNpDrmExecuteGamePurchase()
s32 sceNpDrmGetTimelimit(vm::ptr<const char> path, vm::ptr<u64> time_remain)
{
sceNp.Warning("sceNpDrmGetTimelimit(path_addr=0x%x, time_remain=0x%x)", path.addr(), time_remain.addr());
sceNp.Warning("sceNpDrmGetTimelimit(path=*0x%x, time_remain=*0x%x)", path, time_remain);
*time_remain = 0x7FFFFFFFFFFFFFFFULL;
@ -280,7 +280,7 @@ s32 sceNpBasicAddFriend()
s32 sceNpBasicGetFriendListEntryCount(vm::ptr<u32> count)
{
sceNp.Warning("sceNpBasicGetFriendListEntryCount(count_addr=0x%x)", count.addr());
sceNp.Warning("sceNpBasicGetFriendListEntryCount(count=*0x%x)", count);
if (!g_sceNp->m_bSceNpInitialized)
{
@ -337,7 +337,7 @@ s32 sceNpBasicAddPlayersHistoryAsync()
s32 sceNpBasicGetPlayersHistoryEntryCount(u32 options, vm::ptr<u32> count)
{
sceNp.Todo("sceNpBasicGetPlayersHistoryEntryCount(options=%d, count_addr=0x%x)", options, count.addr());
sceNp.Todo("sceNpBasicGetPlayersHistoryEntryCount(options=%d, count=*0x%x)", options, count);
if (!g_sceNp->m_bSceNpInitialized)
{
@ -379,7 +379,7 @@ s32 sceNpBasicGetBlockListEntry()
s32 sceNpBasicGetMessageAttachmentEntryCount(vm::ptr<u32> count)
{
sceNp.Todo("sceNpBasicGetMessageAttachmentEntryCount(count_addr=0x%x)", count.addr());
sceNp.Todo("sceNpBasicGetMessageAttachmentEntryCount(count=*0x%x)", count);
if (!g_sceNp->m_bSceNpInitialized)
{
@ -391,7 +391,7 @@ s32 sceNpBasicGetMessageAttachmentEntryCount(vm::ptr<u32> count)
s32 sceNpBasicGetMessageAttachmentEntry(u32 index, vm::ptr<SceNpUserInfo> from)
{
sceNp.Todo("sceNpBasicGetMessageAttachmentEntry(index=%d, from_addr=0x%x)", index, from.addr());
sceNp.Todo("sceNpBasicGetMessageAttachmentEntry(index=%d, from=*0x%x)", index, from);
if (!g_sceNp->m_bSceNpInitialized)
{
@ -415,7 +415,7 @@ s32 sceNpBasicGetCustomInvitationEntry()
s32 sceNpBasicGetMatchingInvitationEntryCount(vm::ptr<u32> count)
{
sceNp.Todo("sceNpBasicGetMatchingInvitationEntryCount(count_addr=0x%x)", count.addr());
sceNp.Todo("sceNpBasicGetMatchingInvitationEntryCount(count=*0x%x)", count);
if (!g_sceNp->m_bSceNpInitialized)
{
@ -427,7 +427,7 @@ s32 sceNpBasicGetMatchingInvitationEntryCount(vm::ptr<u32> count)
s32 sceNpBasicGetMatchingInvitationEntry(u32 index, vm::ptr<SceNpUserInfo> from)
{
sceNp.Todo("sceNpBasicGetMatchingInvitationEntry(index=%d, from_addr=0x%x)", index, from.addr());
sceNp.Todo("sceNpBasicGetMatchingInvitationEntry(index=%d, from=*0x%x)", index, from);
if (!g_sceNp->m_bSceNpInitialized)
{
@ -439,7 +439,7 @@ s32 sceNpBasicGetMatchingInvitationEntry(u32 index, vm::ptr<SceNpUserInfo> from)
s32 sceNpBasicGetClanMessageEntryCount(vm::ptr<u32> count)
{
sceNp.Todo("sceNpBasicGetClanMessageEntryCount(count_addr=0x%x)", count.addr());
sceNp.Todo("sceNpBasicGetClanMessageEntryCount(count=*0x%x)", count);
if (!g_sceNp->m_bSceNpInitialized)
{
@ -451,7 +451,7 @@ s32 sceNpBasicGetClanMessageEntryCount(vm::ptr<u32> count)
s32 sceNpBasicGetClanMessageEntry(u32 index, vm::ptr<SceNpUserInfo> from)
{
sceNp.Todo("sceNpBasicGetClanMessageEntry(index=%d, from_addr=0x%x)", index, from.addr());
sceNp.Todo("sceNpBasicGetClanMessageEntry(index=%d, from=*0x%x)", index, from);
if (!g_sceNp->m_bSceNpInitialized)
{
@ -463,7 +463,7 @@ s32 sceNpBasicGetClanMessageEntry(u32 index, vm::ptr<SceNpUserInfo> from)
s32 sceNpBasicGetMessageEntryCount(u32 type, vm::ptr<u32> count)
{
sceNp.Warning("sceNpBasicGetMessageEntryCount(type=%d, count_addr=0x%x)", type, count.addr());
sceNp.Warning("sceNpBasicGetMessageEntryCount(type=%d, count=*0x%x)", type, count);
if (!g_sceNp->m_bSceNpInitialized)
{
@ -478,7 +478,7 @@ s32 sceNpBasicGetMessageEntryCount(u32 type, vm::ptr<u32> count)
s32 sceNpBasicGetMessageEntry(u32 type, u32 index, vm::ptr<SceNpUserInfo> from)
{
sceNp.Todo("sceNpBasicGetMessageEntry(type=%d, index=%d, from_addr=0x%x)", type, index, from.addr());
sceNp.Todo("sceNpBasicGetMessageEntry(type=%d, index=%d, from=*0x%x)", type, index, from);
if (!g_sceNp->m_bSceNpInitialized)
{
@ -490,7 +490,7 @@ s32 sceNpBasicGetMessageEntry(u32 type, u32 index, vm::ptr<SceNpUserInfo> from)
s32 sceNpBasicGetEvent(vm::ptr<s32> event, vm::ptr<SceNpUserInfo> from, vm::ptr<s32> data, vm::ptr<u32> size)
{
sceNp.Warning("sceNpBasicGetEvent(event_addr=0x%x, from_addr=0x%x, data_addr=0x%x, size_addr=0x%x)", event.addr(), from.addr(), data.addr(), size.addr());
sceNp.Warning("sceNpBasicGetEvent(event=*0x%x, from=*0x%x, data=*0x%x, size=*0x%x)", event, from, data, size);
if (!g_sceNp->m_bSceNpInitialized)
{
@ -920,7 +920,7 @@ s32 sceNpManagerUnregisterCallback()
s32 sceNpManagerGetStatus(vm::ptr<u32> status)
{
sceNp.Warning("sceNpManagerGetStatus(status_addr=0x%x)", status.addr());
sceNp.Warning("sceNpManagerGetStatus(status=*0x%x)", status);
if (!g_sceNp->m_bSceNpInitialized)
{
@ -983,7 +983,7 @@ s32 sceNpManagerGetAccountAge()
s32 sceNpManagerGetContentRatingFlag(vm::ptr<u32> isRestricted, vm::ptr<u32> age)
{
sceNp.Warning("sceNpManagerGetContentRatingFlag(isRestricted_addr=0x%x, age_addr=0x%x)", isRestricted.addr(), age.addr());
sceNp.Warning("sceNpManagerGetContentRatingFlag(isRestricted=*0x%x, age=*0x%x)", isRestricted, age);
if (!g_sceNp->m_bSceNpInitialized)
{

View File

@ -64,7 +64,7 @@ s32 sceNpMatching2Init(u32 poolsize, s32 priority)
s32 sceNpMatching2Init2(u32 poolsize, s32 priority, vm::ptr<SceNpMatching2UtilityInitParam> param)
{
sceNp2.Todo("sceNpMatching2Init2(poolsize=%d, priority=%d, param_addr=0x%x)", poolsize, priority, param.addr());
sceNp2.Todo("sceNpMatching2Init2(poolsize=%d, priority=%d, param=*0x%x)", poolsize, priority, param);
if (!g_sceNp2->m_bSceNp2Initialized)
{

View File

@ -838,15 +838,15 @@ s64 sys_prx_exitspawn_with_level()
return CELL_OK;
}
s32 sys_spu_elf_get_information(u32 elf_img, vm::ptr<u32> entry, vm::ptr<u32> nseg)
s32 sys_spu_elf_get_information(u32 elf_img, vm::ptr<u32> entry, vm::ptr<s32> nseg)
{
sysPrxForUser.Todo("sys_spu_elf_get_information(elf_img=0x%x, entry_addr=0x%x, nseg_addr=0x%x)", elf_img, entry.addr(), nseg.addr());
sysPrxForUser.Todo("sys_spu_elf_get_information(elf_img=0x%x, entry=*0x%x, nseg=*0x%x)", elf_img, entry, nseg);
return CELL_OK;
}
s32 sys_spu_elf_get_segments(u32 elf_img, vm::ptr<sys_spu_segment> segments, s32 nseg)
{
sysPrxForUser.Todo("sys_spu_elf_get_segments(elf_img=0x%x, segments_addr=0x%x, nseg=0x%x)", elf_img, segments.addr(), nseg);
sysPrxForUser.Todo("sys_spu_elf_get_segments(elf_img=0x%x, segments=*0x%x, nseg=0x%x)", elf_img, segments, nseg);
return CELL_OK;
}

View File

@ -364,8 +364,7 @@ namespace sys_net_func
s32 socketselect(s32 nfds, vm::ptr<sys_net_fd_set> readfds, vm::ptr<sys_net_fd_set> writefds, vm::ptr<sys_net_fd_set> exceptfds, vm::ptr<sys_net_timeval> timeout)
{
sys_net.Warning("socketselect(nfds=%d, readfds_addr=0x%x, writefds_addr=0x%x, exceptfds_addr=0x%x, timeout_addr=0x%x)",
nfds, readfds.addr(), writefds.addr(), exceptfds.addr(), timeout.addr());
sys_net.Warning("socketselect(nfds=%d, readfds=*0x%x, writefds=*0x%x, exceptfds=*0x%x, timeout=*0x%x)", nfds, readfds, writefds, exceptfds, timeout);
timeval _timeout;

View File

@ -38,6 +38,6 @@ struct sys_net_fd_set
struct sys_net_timeval
{
be_t<s32> tv_sec;
be_t<s32> tv_usec;
};
be_t<s64> tv_sec;
be_t<s64> tv_usec;
};

View File

@ -218,28 +218,6 @@ namespace ppu_func_detail
}
};
template<>
struct func_binder<void> // redundant specialization to bypass internal compiler error in MSVC
{
using func_t = void(*)();
static force_inline void do_call(PPUThread& CPU, func_t func)
{
func();
}
};
template<typename RT>
struct func_binder<RT> // redundant specialization to bypass internal compiler error in MSVC
{
using func_t = RT(*)();
static force_inline void do_call(PPUThread& CPU, func_t func)
{
bind_result<RT, result_type<RT>::value>::put_result(CPU, func());
}
};
template<typename RT, typename... T>
struct func_binder
{

View File

@ -324,7 +324,7 @@ s32 process_get_sdk_version(u32 pid, s32& ver)
s32 sys_process_get_sdk_version(u32 pid, vm::ptr<s32> version)
{
sys_process.Warning("sys_process_get_sdk_version(pid=0x%x, version_addr=0x%x)", pid, version.addr());
sys_process.Warning("sys_process_get_sdk_version(pid=0x%x, version=*0x%x)", pid, version);
s32 sdk_ver;
s32 ret = process_get_sdk_version(pid, sdk_ver);
@ -347,8 +347,8 @@ s32 sys_process_kill(u32 pid)
s32 sys_process_wait_for_child(u32 pid, vm::ptr<u32> status, u64 unk)
{
sys_process.Todo("sys_process_wait_for_child(pid=0x%x, status_addr=0x%x, unk=0x%llx",
pid, status.addr(), unk);
sys_process.Todo("sys_process_wait_for_child(pid=0x%x, status=*0x%x, unk=0x%llx", pid, status, unk);
return CELL_OK;
}

View File

@ -61,7 +61,7 @@ s32 sys_spu_initialize(u32 max_usable_spu, u32 max_raw_spu)
s32 sys_spu_image_open(vm::ptr<sys_spu_image> img, vm::cptr<char> path)
{
sys_spu.Warning("sys_spu_image_open(img_addr=0x%x, path_addr=0x%x [%s])", img.addr(), path.addr(), path.get_ptr());
sys_spu.Warning("sys_spu_image_open(img=*0x%x, path=*0x%x)", img, path);
vfsFile f(path.get_ptr());
if(!f.IsOpened())

View File

@ -8,9 +8,9 @@
SysCallBase sys_tty("sys_tty");
s32 sys_tty_read(s32 ch, vm::ptr<void> buf, u32 len, vm::ptr<u32> preadlen)
s32 sys_tty_read(s32 ch, vm::ptr<char> buf, u32 len, vm::ptr<u32> preadlen)
{
sys_tty.Error("sys_tty_read(ch=%d, buf_addr=0x%x, len=%d, preadlen_addr=0x%x)", ch, buf.addr(), len, preadlen.addr());
sys_tty.Error("sys_tty_read(ch=%d, buf=*0x%x, len=%d, preadlen=*0x%x)", ch, buf, len, preadlen);
// We currently do not support reading from the Console
*preadlen = 0;
@ -18,31 +18,25 @@ s32 sys_tty_read(s32 ch, vm::ptr<void> buf, u32 len, vm::ptr<u32> preadlen)
return CELL_OK;
}
s32 sys_tty_write(s32 ch, vm::cptr<void> buf, u32 len, vm::ptr<u32> pwritelen)
s32 sys_tty_write(s32 ch, vm::cptr<char> buf, u32 len, vm::ptr<u32> pwritelen)
{
sys_tty.Log("sys_tty_write(ch=%d, buf_addr=0x%x, len=%d, preadlen_addr=0x%x)", ch, buf.addr(), len, pwritelen.addr());
sys_tty.Log("sys_tty_write(ch=%d, buf=*0x%x, len=%d, pwritelen=*0x%x)", ch, buf, len, pwritelen);
if (ch > 15)
{
sys_tty.Error("sys_tty_write(): specified channel was higher than 15.");
return CELL_EINVAL;
}
if ((s32) len <= 0)
if ((s32)len <= 0)
{
sys_tty.Error("sys_tty_write(): specified length was 0.");
*pwritelen = 0;
return CELL_OK;
}
const std::string data((const char*)buf.get_ptr(), len);
if (ch == SYS_TTYP_PPU_STDOUT || ch == SYS_TTYP_SPU_STDOUT || (ch >= SYS_TTYP_USER1 && ch <= SYS_TTYP_USER13)) {
LOG_NOTICE(TTY, "%s", data.c_str());
}
if (ch == SYS_TTYP_PPU_STDERR) {
LOG_ERROR(TTY, "%s", data.c_str());
}
log_message(Log::LogType::TTY, ch == SYS_TTYP_PPU_STDERR ? Log::Severity::Error : Log::Severity::Notice, { buf.get_ptr(), len });
*pwritelen = (u32)data.size();
*pwritelen = len;
return CELL_OK;
}

View File

@ -25,5 +25,5 @@ enum
};
// SysCalls
s32 sys_tty_read(s32 ch, vm::ptr<void> buf, u32 len, vm::ptr<u32> preadlen);
s32 sys_tty_write(s32 ch, vm::cptr<void> buf, u32 len, vm::ptr<u32> pwritelen);
s32 sys_tty_read(s32 ch, vm::ptr<char> buf, u32 len, vm::ptr<u32> preadlen);
s32 sys_tty_write(s32 ch, vm::cptr<char> buf, u32 len, vm::ptr<u32> pwritelen);