1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-25 20:22:30 +01:00

Using vm::ps3 namespace moved in proper places

Various fixes
This commit is contained in:
Nekotekina 2015-06-19 18:49:38 +03:00
parent 7eacfe19f6
commit edb9595721
131 changed files with 1049 additions and 900 deletions

View File

@ -1373,7 +1373,7 @@ void thread_t::set_name(const std::string& name)
thread_t::~thread_t() thread_t::~thread_t()
{ {
if (m_state == TS_JOINABLE) if (m_state.exchange(TS_NON_EXISTENT) == TS_JOINABLE)
{ {
if (m_autojoin) if (m_autojoin)
{ {

View File

@ -15,7 +15,7 @@
#define RETURN_ERROR(code) { Emu.Pause(); sceLibKernel.Error("%s() failed: %s", __FUNCTION__, #code); return code; } #define RETURN_ERROR(code) { Emu.Pause(); sceLibKernel.Error("%s() failed: %s", __FUNCTION__, #code); return code; }
s32 sceKernelAllocMemBlock(vm::psv::ptr<const char> name, s32 type, u32 vsize, vm::psv::ptr<SceKernelAllocMemBlockOpt> pOpt) s32 sceKernelAllocMemBlock(vm::ptr<const char> name, s32 type, u32 vsize, vm::ptr<SceKernelAllocMemBlockOpt> pOpt)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
@ -25,24 +25,24 @@ s32 sceKernelFreeMemBlock(s32 uid)
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelGetMemBlockBase(s32 uid, vm::psv::pptr<void> ppBase) s32 sceKernelGetMemBlockBase(s32 uid, vm::pptr<void> ppBase)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelGetMemBlockInfoByAddr(vm::psv::ptr<void> vbase, vm::psv::ptr<SceKernelMemBlockInfo> pInfo) s32 sceKernelGetMemBlockInfoByAddr(vm::ptr<void> vbase, vm::ptr<SceKernelMemBlockInfo> pInfo)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelCreateThread( s32 sceKernelCreateThread(
vm::psv::ptr<const char> pName, vm::ptr<const char> pName,
vm::psv::ptr<SceKernelThreadEntry> entry, vm::ptr<SceKernelThreadEntry> entry,
s32 initPriority, s32 initPriority,
u32 stackSize, u32 stackSize,
u32 attr, u32 attr,
s32 cpuAffinityMask, s32 cpuAffinityMask,
vm::psv::ptr<const SceKernelThreadOptParam> pOptParam) vm::ptr<const SceKernelThreadOptParam> pOptParam)
{ {
sceLibKernel.Warning("sceKernelCreateThread(pName=*0x%x, entry=*0x%x, initPriority=%d, stackSize=0x%x, attr=0x%x, cpuAffinityMask=0x%x, pOptParam=*0x%x)", sceLibKernel.Warning("sceKernelCreateThread(pName=*0x%x, entry=*0x%x, initPriority=%d, stackSize=0x%x, attr=0x%x, cpuAffinityMask=0x%x, pOptParam=*0x%x)",
pName, entry, initPriority, stackSize, attr, cpuAffinityMask, pOptParam); pName, entry, initPriority, stackSize, attr, cpuAffinityMask, pOptParam);
@ -60,7 +60,7 @@ s32 sceKernelCreateThread(
return armv7.GetId(); return armv7.GetId();
} }
s32 sceKernelStartThread(s32 threadId, u32 argSize, vm::psv::ptr<const void> pArgBlock) s32 sceKernelStartThread(s32 threadId, u32 argSize, vm::ptr<const void> pArgBlock)
{ {
sceLibKernel.Warning("sceKernelStartThread(threadId=0x%x, argSize=0x%x, pArgBlock=*0x%x)", threadId, argSize, pArgBlock); sceLibKernel.Warning("sceKernelStartThread(threadId=0x%x, argSize=0x%x, pArgBlock=*0x%x)", threadId, argSize, pArgBlock);
@ -183,7 +183,7 @@ s32 sceKernelChangeCurrentThreadAttr(u32 clearAttr, u32 setAttr)
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelGetThreadExitStatus(s32 threadId, vm::psv::ptr<s32> pExitStatus) s32 sceKernelGetThreadExitStatus(s32 threadId, vm::ptr<s32> pExitStatus)
{ {
sceLibKernel.Todo("sceKernelGetThreadExitStatus(threadId=0x%x, pExitStatus=*0x%x)", threadId, pExitStatus); sceLibKernel.Todo("sceKernelGetThreadExitStatus(threadId=0x%x, pExitStatus=*0x%x)", threadId, pExitStatus);
@ -204,21 +204,21 @@ s32 sceKernelCheckWaitableStatus()
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelGetThreadInfo(s32 threadId, vm::psv::ptr<SceKernelThreadInfo> pInfo) s32 sceKernelGetThreadInfo(s32 threadId, vm::ptr<SceKernelThreadInfo> pInfo)
{ {
sceLibKernel.Todo("sceKernelGetThreadInfo(threadId=0x%x, pInfo=*0x%x)", threadId, pInfo); sceLibKernel.Todo("sceKernelGetThreadInfo(threadId=0x%x, pInfo=*0x%x)", threadId, pInfo);
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelGetThreadRunStatus(vm::psv::ptr<SceKernelThreadRunStatus> pStatus) s32 sceKernelGetThreadRunStatus(vm::ptr<SceKernelThreadRunStatus> pStatus)
{ {
sceLibKernel.Todo("sceKernelGetThreadRunStatus(pStatus=*0x%x)", pStatus); sceLibKernel.Todo("sceKernelGetThreadRunStatus(pStatus=*0x%x)", pStatus);
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelGetSystemInfo(vm::psv::ptr<SceKernelSystemInfo> pInfo) s32 sceKernelGetSystemInfo(vm::ptr<SceKernelSystemInfo> pInfo)
{ {
sceLibKernel.Todo("sceKernelGetSystemInfo(pInfo=*0x%x)", pInfo); sceLibKernel.Todo("sceKernelGetSystemInfo(pInfo=*0x%x)", pInfo);
@ -260,7 +260,7 @@ s32 sceKernelDelayThreadCB(u32 usec)
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelWaitThreadEnd(s32 threadId, vm::psv::ptr<s32> pExitStatus, vm::psv::ptr<u32> pTimeout) s32 sceKernelWaitThreadEnd(s32 threadId, vm::ptr<s32> pExitStatus, vm::ptr<u32> pTimeout)
{ {
sceLibKernel.Warning("sceKernelWaitThreadEnd(threadId=0x%x, pExitStatus=*0x%x, pTimeout=*0x%x)", threadId, pExitStatus, pTimeout); sceLibKernel.Warning("sceKernelWaitThreadEnd(threadId=0x%x, pExitStatus=*0x%x, pTimeout=*0x%x)", threadId, pExitStatus, pTimeout);
@ -295,7 +295,7 @@ s32 sceKernelWaitThreadEnd(s32 threadId, vm::psv::ptr<s32> pExitStatus, vm::psv:
return SCE_OK; return SCE_OK;
} }
s32 sceKernelWaitThreadEndCB(s32 threadId, vm::psv::ptr<s32> pExitStatus, vm::psv::ptr<u32> pTimeout) s32 sceKernelWaitThreadEndCB(s32 threadId, vm::ptr<s32> pExitStatus, vm::ptr<u32> pTimeout)
{ {
sceLibKernel.Todo("sceKernelWaitThreadEndCB(threadId=0x%x, pExitStatus=*0x%x, pTimeout=*0x%x)", threadId, pExitStatus, pTimeout); sceLibKernel.Todo("sceKernelWaitThreadEndCB(threadId=0x%x, pExitStatus=*0x%x, pTimeout=*0x%x)", threadId, pExitStatus, pTimeout);
@ -304,7 +304,7 @@ s32 sceKernelWaitThreadEndCB(s32 threadId, vm::psv::ptr<s32> pExitStatus, vm::ps
// Callback functions // Callback functions
s32 sceKernelCreateCallback(vm::psv::ptr<const char> pName, u32 attr, vm::psv::ptr<SceKernelCallbackFunction> callbackFunc, vm::psv::ptr<void> pCommon) s32 sceKernelCreateCallback(vm::ptr<const char> pName, u32 attr, vm::ptr<SceKernelCallbackFunction> callbackFunc, vm::ptr<void> pCommon)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
@ -334,7 +334,7 @@ s32 sceKernelCheckCallback()
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelGetCallbackInfo(s32 callbackId, vm::psv::ptr<SceKernelCallbackInfo> pInfo) s32 sceKernelGetCallbackInfo(s32 callbackId, vm::ptr<SceKernelCallbackInfo> pInfo)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
@ -356,44 +356,44 @@ s32 sceKernelUnregisterCallbackFromEventAll(s32 eventId)
// Event functions // Event functions
s32 sceKernelWaitEvent(s32 eventId, u32 waitPattern, vm::psv::ptr<u32> pResultPattern, vm::psv::ptr<u64> pUserData, vm::psv::ptr<u32> pTimeout) s32 sceKernelWaitEvent(s32 eventId, u32 waitPattern, vm::ptr<u32> pResultPattern, vm::ptr<u64> pUserData, vm::ptr<u32> pTimeout)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelWaitEventCB(s32 eventId, u32 waitPattern, vm::psv::ptr<u32> pResultPattern, vm::psv::ptr<u64> pUserData, vm::psv::ptr<u32> pTimeout) s32 sceKernelWaitEventCB(s32 eventId, u32 waitPattern, vm::ptr<u32> pResultPattern, vm::ptr<u64> pUserData, vm::ptr<u32> pTimeout)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelPollEvent(s32 eventId, u32 bitPattern, vm::psv::ptr<u32> pResultPattern, vm::psv::ptr<u64> pUserData) s32 sceKernelPollEvent(s32 eventId, u32 bitPattern, vm::ptr<u32> pResultPattern, vm::ptr<u64> pUserData)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelCancelEvent(s32 eventId, vm::psv::ptr<s32> pNumWaitThreads) s32 sceKernelCancelEvent(s32 eventId, vm::ptr<s32> pNumWaitThreads)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelGetEventInfo(s32 eventId, vm::psv::ptr<SceKernelEventInfo> pInfo) s32 sceKernelGetEventInfo(s32 eventId, vm::ptr<SceKernelEventInfo> pInfo)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelWaitMultipleEvents(vm::psv::ptr<SceKernelWaitEvent> pWaitEventList, s32 numEvents, u32 waitMode, vm::psv::ptr<SceKernelResultEvent> pResultEventList, vm::psv::ptr<u32> pTimeout) s32 sceKernelWaitMultipleEvents(vm::ptr<SceKernelWaitEvent> pWaitEventList, s32 numEvents, u32 waitMode, vm::ptr<SceKernelResultEvent> pResultEventList, vm::ptr<u32> pTimeout)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelWaitMultipleEventsCB(vm::psv::ptr<SceKernelWaitEvent> pWaitEventList, s32 numEvents, u32 waitMode, vm::psv::ptr<SceKernelResultEvent> pResultEventList, vm::psv::ptr<u32> pTimeout) s32 sceKernelWaitMultipleEventsCB(vm::ptr<SceKernelWaitEvent> pWaitEventList, s32 numEvents, u32 waitMode, vm::ptr<SceKernelResultEvent> pResultEventList, vm::ptr<u32> pTimeout)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
// Event flag functions // Event flag functions
s32 sceKernelCreateEventFlag(vm::psv::ptr<const char> pName, u32 attr, u32 initPattern, vm::psv::ptr<const SceKernelEventFlagOptParam> pOptParam) s32 sceKernelCreateEventFlag(vm::ptr<const char> pName, u32 attr, u32 initPattern, vm::ptr<const SceKernelEventFlagOptParam> pOptParam)
{ {
sceLibKernel.Error("sceKernelCreateEventFlag(pName=*0x%x, attr=0x%x, initPattern=0x%x, pOptParam=*0x%x)", pName, attr, initPattern, pOptParam); sceLibKernel.Error("sceKernelCreateEventFlag(pName=*0x%x, attr=0x%x, initPattern=0x%x, pOptParam=*0x%x)", pName, attr, initPattern, pOptParam);
@ -410,7 +410,7 @@ s32 sceKernelDeleteEventFlag(s32 evfId)
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelOpenEventFlag(vm::psv::ptr<const char> pName) s32 sceKernelOpenEventFlag(vm::ptr<const char> pName)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
@ -420,17 +420,17 @@ s32 sceKernelCloseEventFlag(s32 evfId)
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelWaitEventFlag(s32 evfId, u32 bitPattern, u32 waitMode, vm::psv::ptr<u32> pResultPat, vm::psv::ptr<u32> pTimeout) s32 sceKernelWaitEventFlag(s32 evfId, u32 bitPattern, u32 waitMode, vm::ptr<u32> pResultPat, vm::ptr<u32> pTimeout)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelWaitEventFlagCB(s32 evfId, u32 bitPattern, u32 waitMode, vm::psv::ptr<u32> pResultPat, vm::psv::ptr<u32> pTimeout) s32 sceKernelWaitEventFlagCB(s32 evfId, u32 bitPattern, u32 waitMode, vm::ptr<u32> pResultPat, vm::ptr<u32> pTimeout)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelPollEventFlag(s32 evfId, u32 bitPattern, u32 waitMode, vm::psv::ptr<u32> pResultPat) s32 sceKernelPollEventFlag(s32 evfId, u32 bitPattern, u32 waitMode, vm::ptr<u32> pResultPat)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
@ -445,19 +445,19 @@ s32 sceKernelClearEventFlag(s32 evfId, u32 bitPattern)
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelCancelEventFlag(s32 evfId, u32 setPattern, vm::psv::ptr<s32> pNumWaitThreads) s32 sceKernelCancelEventFlag(s32 evfId, u32 setPattern, vm::ptr<s32> pNumWaitThreads)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelGetEventFlagInfo(s32 evfId, vm::psv::ptr<SceKernelEventFlagInfo> pInfo) s32 sceKernelGetEventFlagInfo(s32 evfId, vm::ptr<SceKernelEventFlagInfo> pInfo)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
// Semaphore functions // Semaphore functions
s32 sceKernelCreateSema(vm::psv::ptr<const char> pName, u32 attr, s32 initCount, s32 maxCount, vm::psv::ptr<const SceKernelSemaOptParam> pOptParam) s32 sceKernelCreateSema(vm::ptr<const char> pName, u32 attr, s32 initCount, s32 maxCount, vm::ptr<const SceKernelSemaOptParam> pOptParam)
{ {
sceLibKernel.Error("sceKernelCreateSema(pName=*0x%x, attr=0x%x, initCount=%d, maxCount=%d, pOptParam=*0x%x)", pName, attr, initCount, maxCount, pOptParam); sceLibKernel.Error("sceKernelCreateSema(pName=*0x%x, attr=0x%x, initCount=%d, maxCount=%d, pOptParam=*0x%x)", pName, attr, initCount, maxCount, pOptParam);
@ -488,7 +488,7 @@ s32 sceKernelDeleteSema(s32 semaId)
return SCE_OK; return SCE_OK;
} }
s32 sceKernelOpenSema(vm::psv::ptr<const char> pName) s32 sceKernelOpenSema(vm::ptr<const char> pName)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
@ -498,7 +498,7 @@ s32 sceKernelCloseSema(s32 semaId)
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelWaitSema(s32 semaId, s32 needCount, vm::psv::ptr<u32> pTimeout) s32 sceKernelWaitSema(s32 semaId, s32 needCount, vm::ptr<u32> pTimeout)
{ {
sceLibKernel.Error("sceKernelWaitSema(semaId=0x%x, needCount=%d, pTimeout=*0x%x)", semaId, needCount, pTimeout); sceLibKernel.Error("sceKernelWaitSema(semaId=0x%x, needCount=%d, pTimeout=*0x%x)", semaId, needCount, pTimeout);
@ -514,7 +514,7 @@ s32 sceKernelWaitSema(s32 semaId, s32 needCount, vm::psv::ptr<u32> pTimeout)
return SCE_OK; return SCE_OK;
} }
s32 sceKernelWaitSemaCB(s32 semaId, s32 needCount, vm::psv::ptr<u32> pTimeout) s32 sceKernelWaitSemaCB(s32 semaId, s32 needCount, vm::ptr<u32> pTimeout)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
@ -529,19 +529,19 @@ s32 sceKernelSignalSema(s32 semaId, s32 signalCount)
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelCancelSema(s32 semaId, s32 setCount, vm::psv::ptr<s32> pNumWaitThreads) s32 sceKernelCancelSema(s32 semaId, s32 setCount, vm::ptr<s32> pNumWaitThreads)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelGetSemaInfo(s32 semaId, vm::psv::ptr<SceKernelSemaInfo> pInfo) s32 sceKernelGetSemaInfo(s32 semaId, vm::ptr<SceKernelSemaInfo> pInfo)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
// Mutex functions // Mutex functions
s32 sceKernelCreateMutex(vm::psv::ptr<const char> pName, u32 attr, s32 initCount, vm::psv::ptr<const SceKernelMutexOptParam> pOptParam) s32 sceKernelCreateMutex(vm::ptr<const char> pName, u32 attr, s32 initCount, vm::ptr<const SceKernelMutexOptParam> pOptParam)
{ {
sceLibKernel.Error("sceKernelCreateMutex(pName=*0x%x, attr=0x%x, initCount=%d, pOptParam=*0x%x)", pName, attr, initCount, pOptParam); sceLibKernel.Error("sceKernelCreateMutex(pName=*0x%x, attr=0x%x, initCount=%d, pOptParam=*0x%x)", pName, attr, initCount, pOptParam);
@ -558,7 +558,7 @@ s32 sceKernelDeleteMutex(s32 mutexId)
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelOpenMutex(vm::psv::ptr<const char> pName) s32 sceKernelOpenMutex(vm::ptr<const char> pName)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
@ -568,12 +568,12 @@ s32 sceKernelCloseMutex(s32 mutexId)
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelLockMutex(s32 mutexId, s32 lockCount, vm::psv::ptr<u32> pTimeout) s32 sceKernelLockMutex(s32 mutexId, s32 lockCount, vm::ptr<u32> pTimeout)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelLockMutexCB(s32 mutexId, s32 lockCount, vm::psv::ptr<u32> pTimeout) s32 sceKernelLockMutexCB(s32 mutexId, s32 lockCount, vm::ptr<u32> pTimeout)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
@ -588,61 +588,61 @@ s32 sceKernelUnlockMutex(s32 mutexId, s32 unlockCount)
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelCancelMutex(s32 mutexId, s32 newCount, vm::psv::ptr<s32> pNumWaitThreads) s32 sceKernelCancelMutex(s32 mutexId, s32 newCount, vm::ptr<s32> pNumWaitThreads)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelGetMutexInfo(s32 mutexId, vm::psv::ptr<SceKernelMutexInfo> pInfo) s32 sceKernelGetMutexInfo(s32 mutexId, vm::ptr<SceKernelMutexInfo> pInfo)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
// Lightweight mutex functions // Lightweight mutex functions
s32 sceKernelCreateLwMutex(vm::psv::ptr<SceKernelLwMutexWork> pWork, vm::psv::ptr<const char> pName, u32 attr, s32 initCount, vm::psv::ptr<const SceKernelLwMutexOptParam> pOptParam) s32 sceKernelCreateLwMutex(vm::ptr<SceKernelLwMutexWork> pWork, vm::ptr<const char> pName, u32 attr, s32 initCount, vm::ptr<const SceKernelLwMutexOptParam> pOptParam)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelDeleteLwMutex(vm::psv::ptr<SceKernelLwMutexWork> pWork) s32 sceKernelDeleteLwMutex(vm::ptr<SceKernelLwMutexWork> pWork)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelLockLwMutex(vm::psv::ptr<SceKernelLwMutexWork> pWork, s32 lockCount, vm::psv::ptr<u32> pTimeout) s32 sceKernelLockLwMutex(vm::ptr<SceKernelLwMutexWork> pWork, s32 lockCount, vm::ptr<u32> pTimeout)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelLockLwMutexCB(vm::psv::ptr<SceKernelLwMutexWork> pWork, s32 lockCount, vm::psv::ptr<u32> pTimeout) s32 sceKernelLockLwMutexCB(vm::ptr<SceKernelLwMutexWork> pWork, s32 lockCount, vm::ptr<u32> pTimeout)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelTryLockLwMutex(vm::psv::ptr<SceKernelLwMutexWork> pWork, s32 lockCount) s32 sceKernelTryLockLwMutex(vm::ptr<SceKernelLwMutexWork> pWork, s32 lockCount)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelUnlockLwMutex(vm::psv::ptr<SceKernelLwMutexWork> pWork, s32 unlockCount) s32 sceKernelUnlockLwMutex(vm::ptr<SceKernelLwMutexWork> pWork, s32 unlockCount)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelGetLwMutexInfo(vm::psv::ptr<SceKernelLwMutexWork> pWork, vm::psv::ptr<SceKernelLwMutexInfo> pInfo) s32 sceKernelGetLwMutexInfo(vm::ptr<SceKernelLwMutexWork> pWork, vm::ptr<SceKernelLwMutexInfo> pInfo)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelGetLwMutexInfoById(s32 lwMutexId, vm::psv::ptr<SceKernelLwMutexInfo> pInfo) s32 sceKernelGetLwMutexInfoById(s32 lwMutexId, vm::ptr<SceKernelLwMutexInfo> pInfo)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
// Condition variable functions // Condition variable functions
s32 sceKernelCreateCond(vm::psv::ptr<const char> pName, u32 attr, s32 mutexId, vm::psv::ptr<const SceKernelCondOptParam> pOptParam) s32 sceKernelCreateCond(vm::ptr<const char> pName, u32 attr, s32 mutexId, vm::ptr<const SceKernelCondOptParam> pOptParam)
{ {
sceLibKernel.Error("sceKernelCreateCond(pName=*0x%x, attr=0x%x, mutexId=0x%x, pOptParam=*0x%x)", pName, attr, mutexId, pOptParam); sceLibKernel.Error("sceKernelCreateCond(pName=*0x%x, attr=0x%x, mutexId=0x%x, pOptParam=*0x%x)", pName, attr, mutexId, pOptParam);
@ -659,7 +659,7 @@ s32 sceKernelDeleteCond(s32 condId)
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelOpenCond(vm::psv::ptr<const char> pName) s32 sceKernelOpenCond(vm::ptr<const char> pName)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
@ -669,12 +669,12 @@ s32 sceKernelCloseCond(s32 condId)
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelWaitCond(s32 condId, vm::psv::ptr<u32> pTimeout) s32 sceKernelWaitCond(s32 condId, vm::ptr<u32> pTimeout)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelWaitCondCB(s32 condId, vm::psv::ptr<u32> pTimeout) s32 sceKernelWaitCondCB(s32 condId, vm::ptr<u32> pTimeout)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
@ -694,61 +694,61 @@ s32 sceKernelSignalCondTo(s32 condId, s32 threadId)
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelGetCondInfo(s32 condId, vm::psv::ptr<SceKernelCondInfo> pInfo) s32 sceKernelGetCondInfo(s32 condId, vm::ptr<SceKernelCondInfo> pInfo)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
// Lightweight condition variable functions // Lightweight condition variable functions
s32 sceKernelCreateLwCond(vm::psv::ptr<SceKernelLwCondWork> pWork, vm::psv::ptr<const char> pName, u32 attr, vm::psv::ptr<SceKernelLwMutexWork> pLwMutex, vm::psv::ptr<const SceKernelLwCondOptParam> pOptParam) s32 sceKernelCreateLwCond(vm::ptr<SceKernelLwCondWork> pWork, vm::ptr<const char> pName, u32 attr, vm::ptr<SceKernelLwMutexWork> pLwMutex, vm::ptr<const SceKernelLwCondOptParam> pOptParam)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelDeleteLwCond(vm::psv::ptr<SceKernelLwCondWork> pWork) s32 sceKernelDeleteLwCond(vm::ptr<SceKernelLwCondWork> pWork)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelWaitLwCond(vm::psv::ptr<SceKernelLwCondWork> pWork, vm::psv::ptr<u32> pTimeout) s32 sceKernelWaitLwCond(vm::ptr<SceKernelLwCondWork> pWork, vm::ptr<u32> pTimeout)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelWaitLwCondCB(vm::psv::ptr<SceKernelLwCondWork> pWork, vm::psv::ptr<u32> pTimeout) s32 sceKernelWaitLwCondCB(vm::ptr<SceKernelLwCondWork> pWork, vm::ptr<u32> pTimeout)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelSignalLwCond(vm::psv::ptr<SceKernelLwCondWork> pWork) s32 sceKernelSignalLwCond(vm::ptr<SceKernelLwCondWork> pWork)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelSignalLwCondAll(vm::psv::ptr<SceKernelLwCondWork> pWork) s32 sceKernelSignalLwCondAll(vm::ptr<SceKernelLwCondWork> pWork)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelSignalLwCondTo(vm::psv::ptr<SceKernelLwCondWork> pWork, s32 threadId) s32 sceKernelSignalLwCondTo(vm::ptr<SceKernelLwCondWork> pWork, s32 threadId)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelGetLwCondInfo(vm::psv::ptr<SceKernelLwCondWork> pWork, vm::psv::ptr<SceKernelLwCondInfo> pInfo) s32 sceKernelGetLwCondInfo(vm::ptr<SceKernelLwCondWork> pWork, vm::ptr<SceKernelLwCondInfo> pInfo)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelGetLwCondInfoById(s32 lwCondId, vm::psv::ptr<SceKernelLwCondInfo> pInfo) s32 sceKernelGetLwCondInfoById(s32 lwCondId, vm::ptr<SceKernelLwCondInfo> pInfo)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
// Time functions // Time functions
s32 sceKernelGetSystemTime(vm::psv::ptr<SceKernelSysClock> pClock) s32 sceKernelGetSystemTime(vm::ptr<SceKernelSysClock> pClock)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
@ -765,7 +765,7 @@ u32 sceKernelGetSystemTimeLow()
// Timer functions // Timer functions
s32 sceKernelCreateTimer(vm::psv::ptr<const char> pName, u32 attr, vm::psv::ptr<const SceKernelTimerOptParam> pOptParam) s32 sceKernelCreateTimer(vm::ptr<const char> pName, u32 attr, vm::ptr<const SceKernelTimerOptParam> pOptParam)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
@ -775,7 +775,7 @@ s32 sceKernelDeleteTimer(s32 timerId)
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelOpenTimer(vm::psv::ptr<const char> pName) s32 sceKernelOpenTimer(vm::ptr<const char> pName)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
@ -795,7 +795,7 @@ s32 sceKernelStopTimer(s32 timerId)
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelGetTimerBase(s32 timerId, vm::psv::ptr<SceKernelSysClock> pBase) s32 sceKernelGetTimerBase(s32 timerId, vm::ptr<SceKernelSysClock> pBase)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
@ -805,7 +805,7 @@ u64 sceKernelGetTimerBaseWide(s32 timerId)
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelGetTimerTime(s32 timerId, vm::psv::ptr<SceKernelSysClock> pClock) s32 sceKernelGetTimerTime(s32 timerId, vm::ptr<SceKernelSysClock> pClock)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
@ -815,7 +815,7 @@ u64 sceKernelGetTimerTimeWide(s32 timerId)
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelSetTimerTime(s32 timerId, vm::psv::ptr<SceKernelSysClock> pClock) s32 sceKernelSetTimerTime(s32 timerId, vm::ptr<SceKernelSysClock> pClock)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
@ -825,24 +825,24 @@ u64 sceKernelSetTimerTimeWide(s32 timerId, u64 clock)
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelSetTimerEvent(s32 timerId, s32 type, vm::psv::ptr<SceKernelSysClock> pInterval, s32 fRepeat) s32 sceKernelSetTimerEvent(s32 timerId, s32 type, vm::ptr<SceKernelSysClock> pInterval, s32 fRepeat)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelCancelTimer(s32 timerId, vm::psv::ptr<s32> pNumWaitThreads) s32 sceKernelCancelTimer(s32 timerId, vm::ptr<s32> pNumWaitThreads)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelGetTimerInfo(s32 timerId, vm::psv::ptr<SceKernelTimerInfo> pInfo) s32 sceKernelGetTimerInfo(s32 timerId, vm::ptr<SceKernelTimerInfo> pInfo)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
// Reader/writer lock functions // Reader/writer lock functions
s32 sceKernelCreateRWLock(vm::psv::ptr<const char> pName, u32 attr, vm::psv::ptr<const SceKernelRWLockOptParam> pOptParam) s32 sceKernelCreateRWLock(vm::ptr<const char> pName, u32 attr, vm::ptr<const SceKernelRWLockOptParam> pOptParam)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
@ -852,7 +852,7 @@ s32 sceKernelDeleteRWLock(s32 rwLockId)
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelOpenRWLock(vm::psv::ptr<const char> pName) s32 sceKernelOpenRWLock(vm::ptr<const char> pName)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
@ -862,12 +862,12 @@ s32 sceKernelCloseRWLock(s32 rwLockId)
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelLockReadRWLock(s32 rwLockId, vm::psv::ptr<u32> pTimeout) s32 sceKernelLockReadRWLock(s32 rwLockId, vm::ptr<u32> pTimeout)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelLockReadRWLockCB(s32 rwLockId, vm::psv::ptr<u32> pTimeout) s32 sceKernelLockReadRWLockCB(s32 rwLockId, vm::ptr<u32> pTimeout)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
@ -882,12 +882,12 @@ s32 sceKernelUnlockReadRWLock(s32 rwLockId)
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelLockWriteRWLock(s32 rwLockId, vm::psv::ptr<u32> pTimeout) s32 sceKernelLockWriteRWLock(s32 rwLockId, vm::ptr<u32> pTimeout)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelLockWriteRWLockCB(s32 rwLockId, vm::psv::ptr<u32> pTimeout) s32 sceKernelLockWriteRWLockCB(s32 rwLockId, vm::ptr<u32> pTimeout)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
@ -902,49 +902,49 @@ s32 sceKernelUnlockWriteRWLock(s32 rwLockId)
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelCancelRWLock(s32 rwLockId, vm::psv::ptr<s32> pNumReadWaitThreads, vm::psv::ptr<s32> pNumWriteWaitThreads, s32 flag) s32 sceKernelCancelRWLock(s32 rwLockId, vm::ptr<s32> pNumReadWaitThreads, vm::ptr<s32> pNumWriteWaitThreads, s32 flag)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceKernelGetRWLockInfo(s32 rwLockId, vm::psv::ptr<SceKernelRWLockInfo> pInfo) s32 sceKernelGetRWLockInfo(s32 rwLockId, vm::ptr<SceKernelRWLockInfo> pInfo)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
// IO/File functions // IO/File functions
s32 sceIoRemove(vm::psv::ptr<const char> filename) s32 sceIoRemove(vm::ptr<const char> filename)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceIoMkdir(vm::psv::ptr<const char> dirname, s32 mode) s32 sceIoMkdir(vm::ptr<const char> dirname, s32 mode)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceIoRmdir(vm::psv::ptr<const char> dirname) s32 sceIoRmdir(vm::ptr<const char> dirname)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceIoRename(vm::psv::ptr<const char> oldname, vm::psv::ptr<const char> newname) s32 sceIoRename(vm::ptr<const char> oldname, vm::ptr<const char> newname)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceIoDevctl(vm::psv::ptr<const char> devname, s32 cmd, vm::psv::ptr<const void> arg, u32 arglen, vm::psv::ptr<void> bufp, u32 buflen) s32 sceIoDevctl(vm::ptr<const char> devname, s32 cmd, vm::ptr<const void> arg, u32 arglen, vm::ptr<void> bufp, u32 buflen)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceIoSync(vm::psv::ptr<const char> devname, s32 flag) s32 sceIoSync(vm::ptr<const char> devname, s32 flag)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceIoOpen(vm::psv::ptr<const char> filename, s32 flag, s32 mode) s32 sceIoOpen(vm::ptr<const char> filename, s32 flag, s32 mode)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
@ -954,7 +954,7 @@ s32 sceIoClose(s32 fd)
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceIoIoctl(s32 fd, s32 cmd, vm::psv::ptr<const void> argp, u32 arglen, vm::psv::ptr<void> bufp, u32 buflen) s32 sceIoIoctl(s32 fd, s32 cmd, vm::ptr<const void> argp, u32 arglen, vm::ptr<void> bufp, u32 buflen)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
@ -969,27 +969,27 @@ s32 sceIoLseek32(s32 fd, s32 offset, s32 whence)
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceIoRead(s32 fd, vm::psv::ptr<void> buf, u32 nbyte) s32 sceIoRead(s32 fd, vm::ptr<void> buf, u32 nbyte)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceIoWrite(s32 fd, vm::psv::ptr<const void> buf, u32 nbyte) s32 sceIoWrite(s32 fd, vm::ptr<const void> buf, u32 nbyte)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceIoPread(s32 fd, vm::psv::ptr<void> buf, u32 nbyte, s64 offset) s32 sceIoPread(s32 fd, vm::ptr<void> buf, u32 nbyte, s64 offset)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceIoPwrite(s32 fd, vm::psv::ptr<const void> buf, u32 nbyte, s64 offset) s32 sceIoPwrite(s32 fd, vm::ptr<const void> buf, u32 nbyte, s64 offset)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceIoDopen(vm::psv::ptr<const char> dirname) s32 sceIoDopen(vm::ptr<const char> dirname)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
@ -999,17 +999,17 @@ s32 sceIoDclose(s32 fd)
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceIoDread(s32 fd, vm::psv::ptr<SceIoDirent> buf) s32 sceIoDread(s32 fd, vm::ptr<SceIoDirent> buf)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceIoChstat(vm::psv::ptr<const char> name, vm::psv::ptr<const SceIoStat> buf, u32 cbit) s32 sceIoChstat(vm::ptr<const char> name, vm::ptr<const SceIoStat> buf, u32 cbit)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }
s32 sceIoGetstat(vm::psv::ptr<const char> name, vm::psv::ptr<SceIoStat> buf) s32 sceIoGetstat(vm::ptr<const char> name, vm::ptr<SceIoStat> buf)
{ {
throw __FUNCTION__; throw __FUNCTION__;
} }

View File

@ -269,339 +269,337 @@ union SceKernelSysClock
{ {
struct struct
{ {
u32 low; le_t<u32> low;
u32 hi; le_t<u32> hi;
}; };
u64 quad; le_t<u64> quad;
}; };
struct SceKernelCallFrame struct SceKernelCallFrame
{ {
u32 sp; le_t<u32> sp;
u32 pc; le_t<u32> pc;
}; };
// Memory Manager definitions // Memory Manager definitions
typedef s32 SceKernelMemoryType;
struct SceKernelMemBlockInfo struct SceKernelMemBlockInfo
{ {
u32 size; le_t<u32> size;
vm::psv::ptr<void> mappedBase; vm::lptr<void> mappedBase;
u32 mappedSize; le_t<u32> mappedSize;
SceKernelMemoryType memoryType; le_t<s32> memoryType; // SceKernelMemoryType
u32 access; le_t<u32> access;
}; };
struct SceKernelAllocMemBlockOpt struct SceKernelAllocMemBlockOpt
{ {
u32 size; le_t<u32> size;
u32 attr; le_t<u32> attr;
u32 alignment; le_t<u32> alignment;
s32 uidBaseBlock; le_t<s32> uidBaseBlock;
vm::psv::ptr<const char> strBaseBlockName; vm::lcptr<char> strBaseBlockName;
}; };
// Thread Manager definitions (threads) // Thread Manager definitions (threads)
typedef s32(SceKernelThreadEntry)(u32 argSize, vm::psv::ptr<void> pArgBlock); using SceKernelThreadEntry = func_def<s32(u32 argSize, vm::ptr<void> pArgBlock)>;
struct SceKernelThreadOptParam struct SceKernelThreadOptParam
{ {
u32 size; le_t<u32> size;
u32 attr; le_t<u32> attr;
}; };
struct SceKernelThreadInfo struct SceKernelThreadInfo
{ {
u32 size; le_t<u32> size;
s32 processId; le_t<s32> processId;
char name[32]; char name[32];
u32 attr; le_t<u32> attr;
u32 status; le_t<u32> status;
vm::psv::ptr<SceKernelThreadEntry> entry; vm::lptr<SceKernelThreadEntry> entry;
vm::psv::ptr<void> pStack; vm::lptr<void> pStack;
u32 stackSize; le_t<u32> stackSize;
s32 initPriority; le_t<s32> initPriority;
s32 currentPriority; le_t<s32> currentPriority;
s32 initCpuAffinityMask; le_t<s32> initCpuAffinityMask;
s32 currentCpuAffinityMask; le_t<s32> currentCpuAffinityMask;
s32 currentCpuId; le_t<s32> currentCpuId;
s32 lastExecutedCpuId; le_t<s32> lastExecutedCpuId;
u32 waitType; le_t<u32> waitType;
s32 waitId; le_t<s32> waitId;
s32 exitStatus; le_t<s32> exitStatus;
SceKernelSysClock runClocks; SceKernelSysClock runClocks;
u32 intrPreemptCount; le_t<u32> intrPreemptCount;
u32 threadPreemptCount; le_t<u32> threadPreemptCount;
u32 threadReleaseCount; le_t<u32> threadReleaseCount;
s32 changeCpuCount; le_t<s32> changeCpuCount;
s32 fNotifyCallback; le_t<s32> fNotifyCallback;
s32 reserved; le_t<s32> reserved;
}; };
struct SceKernelThreadRunStatus struct SceKernelThreadRunStatus
{ {
u32 size; le_t<u32> size;
struct struct
{ {
s32 processId; le_t<s32> processId;
s32 threadId; le_t<s32> threadId;
s32 priority; le_t<s32> priority;
} cpuInfo[4]; } cpuInfo[4];
}; };
struct SceKernelSystemInfo struct SceKernelSystemInfo
{ {
u32 size; le_t<u32> size;
u32 activeCpuMask; le_t<u32> activeCpuMask;
struct struct
{ {
SceKernelSysClock idleClock; SceKernelSysClock idleClock;
u32 comesOutOfIdleCount; le_t<u32> comesOutOfIdleCount;
u32 threadSwitchCount; le_t<u32> threadSwitchCount;
} cpuInfo[4]; } cpuInfo[4];
}; };
// Thread Manager definitions (callbacks) // Thread Manager definitions (callbacks)
typedef s32(SceKernelCallbackFunction)(s32 notifyId, s32 notifyCount, s32 notifyArg, vm::psv::ptr<void> pCommon); using SceKernelCallbackFunction = func_def<s32(s32 notifyId, s32 notifyCount, s32 notifyArg, vm::ptr<void> pCommon)>;
struct SceKernelCallbackInfo struct SceKernelCallbackInfo
{ {
u32 size; le_t<u32> size;
s32 callbackId; le_t<s32> callbackId;
char name[32]; char name[32];
u32 attr; le_t<u32> attr;
s32 threadId; le_t<s32> threadId;
vm::psv::ptr<SceKernelCallbackFunction> callbackFunc; vm::lptr<SceKernelCallbackFunction> callbackFunc;
s32 notifyId; le_t<s32> notifyId;
s32 notifyCount; le_t<s32> notifyCount;
s32 notifyArg; le_t<s32> notifyArg;
vm::psv::ptr<void> pCommon; vm::lptr<void> pCommon;
}; };
// Thread Manager definitions (events) // Thread Manager definitions (events)
typedef s32(SceKernelThreadEventHandler)(s32 type, s32 threadId, s32 arg, vm::psv::ptr<void> pCommon); using SceKernelThreadEventHandler = func_def<s32(s32 type, s32 threadId, s32 arg, vm::psv::ptr<void> pCommon)>;
struct SceKernelEventInfo struct SceKernelEventInfo
{ {
u32 size; le_t<u32> size;
s32 eventId; le_t<s32> eventId;
char name[32]; char name[32];
u32 attr; le_t<u32> attr;
u32 eventPattern; le_t<u32> eventPattern;
u64 userData; le_t<u64> userData;
u32 numWaitThreads; le_t<u32> numWaitThreads;
s32 reserved[1]; le_t<s32> reserved[1];
}; };
struct SceKernelWaitEvent struct SceKernelWaitEvent
{ {
s32 eventId; le_t<s32> eventId;
u32 eventPattern; le_t<u32> eventPattern;
}; };
struct SceKernelResultEvent struct SceKernelResultEvent
{ {
s32 eventId; le_t<s32> eventId;
s32 result; le_t<s32> result;
u32 resultPattern; le_t<u32> resultPattern;
s32 reserved[1]; le_t<s32> reserved[1];
u64 userData; le_t<u64> userData;
}; };
// Thread Manager definitions (event flags) // Thread Manager definitions (event flags)
struct SceKernelEventFlagOptParam struct SceKernelEventFlagOptParam
{ {
u32 size; le_t<u32> size;
}; };
struct SceKernelEventFlagInfo struct SceKernelEventFlagInfo
{ {
u32 size; le_t<u32> size;
s32 evfId; le_t<s32> evfId;
char name[32]; char name[32];
u32 attr; le_t<u32> attr;
u32 initPattern; le_t<u32> initPattern;
u32 currentPattern; le_t<u32> currentPattern;
s32 numWaitThreads; le_t<s32> numWaitThreads;
}; };
// Thread Manager definitions (semaphores) // Thread Manager definitions (semaphores)
struct SceKernelSemaOptParam struct SceKernelSemaOptParam
{ {
u32 size; le_t<u32> size;
}; };
struct SceKernelSemaInfo struct SceKernelSemaInfo
{ {
u32 size; le_t<u32> size;
s32 semaId; le_t<s32> semaId;
char name[32]; char name[32];
u32 attr; le_t<u32> attr;
s32 initCount; le_t<s32> initCount;
s32 currentCount; le_t<s32> currentCount;
s32 maxCount; le_t<s32> maxCount;
s32 numWaitThreads; le_t<s32> numWaitThreads;
}; };
// Thread Manager definitions (mutexes) // Thread Manager definitions (mutexes)
struct SceKernelMutexOptParam struct SceKernelMutexOptParam
{ {
u32 size; le_t<u32> size;
s32 ceilingPriority; le_t<s32> ceilingPriority;
}; };
struct SceKernelMutexInfo struct SceKernelMutexInfo
{ {
u32 size; le_t<u32> size;
s32 mutexId; le_t<s32> mutexId;
char name[32]; char name[32];
u32 attr; le_t<u32> attr;
s32 initCount; le_t<s32> initCount;
s32 currentCount; le_t<s32> currentCount;
s32 currentOwnerId; le_t<s32> currentOwnerId;
s32 numWaitThreads; le_t<s32> numWaitThreads;
}; };
// Thread Manager definitions (lightweight mutexes) // Thread Manager definitions (lightweight mutexes)
struct SceKernelLwMutexWork struct SceKernelLwMutexWork
{ {
s32 data[4]; le_t<s32> data[4];
}; };
struct SceKernelLwMutexOptParam struct SceKernelLwMutexOptParam
{ {
u32 size; le_t<u32> size;
}; };
struct SceKernelLwMutexInfo struct SceKernelLwMutexInfo
{ {
u32 size; le_t<u32> size;
s32 uid; le_t<s32> uid;
char name[32]; char name[32];
u32 attr; le_t<u32> attr;
vm::psv::ptr<SceKernelLwMutexWork> pWork; vm::lptr<SceKernelLwMutexWork> pWork;
s32 initCount; le_t<s32> initCount;
s32 currentCount; le_t<s32> currentCount;
s32 currentOwnerId; le_t<s32> currentOwnerId;
s32 numWaitThreads; le_t<s32> numWaitThreads;
}; };
// Thread Manager definitions (condition variables) // Thread Manager definitions (condition variables)
struct SceKernelCondOptParam struct SceKernelCondOptParam
{ {
u32 size; le_t<u32> size;
}; };
struct SceKernelCondInfo struct SceKernelCondInfo
{ {
u32 size; le_t<u32> size;
s32 condId; le_t<s32> condId;
char name[32]; char name[32];
u32 attr; le_t<u32> attr;
s32 mutexId; le_t<s32> mutexId;
u32 numWaitThreads; le_t<u32> numWaitThreads;
}; };
// Thread Manager definitions (lightweight condition variables) // Thread Manager definitions (lightweight condition variables)
struct SceKernelLwCondWork struct SceKernelLwCondWork
{ {
s32 data[4]; le_t<s32> data[4];
}; };
struct SceKernelLwCondOptParam struct SceKernelLwCondOptParam
{ {
u32 size; le_t<u32> size;
}; };
struct SceKernelLwCondInfo struct SceKernelLwCondInfo
{ {
u32 size; le_t<u32> size;
s32 uid; le_t<s32> uid;
char name[32]; char name[32];
u32 attr; le_t<u32> attr;
vm::psv::ptr<SceKernelLwCondWork> pWork; vm::lptr<SceKernelLwCondWork> pWork;
vm::psv::ptr<SceKernelLwMutexWork> pLwMutex; vm::lptr<SceKernelLwMutexWork> pLwMutex;
u32 numWaitThreads; le_t<u32> numWaitThreads;
}; };
// Thread Manager definitions (timers) // Thread Manager definitions (timers)
struct SceKernelTimerOptParam struct SceKernelTimerOptParam
{ {
u32 size; le_t<u32> size;
}; };
struct SceKernelTimerInfo struct SceKernelTimerInfo
{ {
u32 size; le_t<u32> size;
s32 timerId; le_t<s32> timerId;
char name[32]; char name[32];
u32 attr; le_t<u32> attr;
s32 fActive; le_t<s32> fActive;
SceKernelSysClock baseTime; SceKernelSysClock baseTime;
SceKernelSysClock currentTime; SceKernelSysClock currentTime;
SceKernelSysClock schedule; SceKernelSysClock schedule;
SceKernelSysClock interval; SceKernelSysClock interval;
s32 type; le_t<s32> type;
s32 fRepeat; le_t<s32> fRepeat;
s32 numWaitThreads; le_t<s32> numWaitThreads;
s32 reserved[1]; le_t<s32> reserved[1];
}; };
// Thread Manager definitions (reader/writer locks) // Thread Manager definitions (reader/writer locks)
struct SceKernelRWLockOptParam struct SceKernelRWLockOptParam
{ {
u32 size; le_t<u32> size;
}; };
struct SceKernelRWLockInfo struct SceKernelRWLockInfo
{ {
u32 size; le_t<u32> size;
s32 rwLockId; le_t<s32> rwLockId;
char name[32]; char name[32];
u32 attr; le_t<u32> attr;
s32 lockCount; le_t<s32> lockCount;
s32 writeOwnerId; le_t<s32> writeOwnerId;
s32 numReadWaitThreads; le_t<s32> numReadWaitThreads;
s32 numWriteWaitThreads; le_t<s32> numWriteWaitThreads;
}; };
// IO/File Manager definitions // IO/File Manager definitions
struct SceIoStat struct SceIoStat
{ {
s32 mode; le_t<s32> mode;
u32 attr; le_t<u32> attr;
s64 size; le_t<s64> size;
SceDateTime ctime; SceDateTime ctime;
SceDateTime atime; SceDateTime atime;
SceDateTime mtime; SceDateTime mtime;
u64 _private[6]; le_t<u64> _private[6];
}; };
struct SceIoDirent struct SceIoDirent
{ {
SceIoStat d_stat; SceIoStat d_stat;
char d_name[256]; char d_name[256];
vm::psv::ptr<void> d_private; vm::lptr<void> d_private;
s32 dummy; le_t<s32> dummy;
}; };
// Module // Module

View File

@ -1,13 +1,18 @@
#pragma once #pragma once
#include "Emu/Memory/Memory.h" #include "Emu/Memory/Memory.h"
#include "ARMv7Context.h" #include "ARMv7Context.h"
#include "Emu/SysCalls/LogBase.h" #include "Emu/SysCalls/LogBase.h"
namespace vm { using namespace psv; }
// PSV module class // PSV module class
class psv_log_base : public LogBase class psv_log_base : public LogBase
{ {
using init_func_t = void(*)();
std::string m_name; std::string m_name;
void(*m_init_func)(); init_func_t m_init;
public: public:
std::function<void()> on_load; std::function<void()> on_load;
@ -15,15 +20,15 @@ public:
std::function<void()> on_stop; std::function<void()> on_stop;
public: public:
psv_log_base(const std::string& name, void(*init_func)()) psv_log_base(const std::string& name, init_func_t init)
: m_name(name) : m_name(name)
, m_init_func(init_func) , m_init(init)
{ {
} }
void Init() void Init()
{ {
m_init_func(); m_init();
} }
virtual const std::string& GetName() const override virtual const std::string& GetName() const override
@ -140,7 +145,7 @@ namespace psv_func_detail
force_inline static T get_arg(ARMv7Context& context) force_inline static T get_arg(ARMv7Context& context)
{ {
// TODO: check // TODO: check
return cast_from_armv7_gpr<T>(vm::psv::read32(context.SP + sizeof(u32) * (g_count - 5))); return cast_from_armv7_gpr<T>(vm::read32(context.SP + sizeof(u32) * (g_count - 5)));
} }
force_inline static void put_arg(ARMv7Context& context, const T& arg) force_inline static void put_arg(ARMv7Context& context, const T& arg)
@ -149,7 +154,7 @@ namespace psv_func_detail
const int stack_pos = (g_count - 5) * 4 - FIXED_STACK_FRAME_SIZE; const int stack_pos = (g_count - 5) * 4 - FIXED_STACK_FRAME_SIZE;
static_assert(stack_pos < 0, "TODO: Increase fixed stack frame size (arg count limit broken)"); static_assert(stack_pos < 0, "TODO: Increase fixed stack frame size (arg count limit broken)");
vm::psv::write32(context.SP + stack_pos, cast_to_armv7_gpr<T>(arg)); vm::write32(context.SP + stack_pos, cast_to_armv7_gpr<T>(arg));
} }
}; };
@ -159,7 +164,7 @@ namespace psv_func_detail
force_inline static u64 get_arg(ARMv7Context& context) force_inline static u64 get_arg(ARMv7Context& context)
{ {
// TODO: check // TODO: check
return vm::psv::read64(context.SP + sizeof(u32) * (g_count - 5)); return vm::read64(context.SP + sizeof(u32) * (g_count - 5));
} }
force_inline static void put_arg(ARMv7Context& context, u64 arg) force_inline static void put_arg(ARMv7Context& context, u64 arg)
@ -168,7 +173,7 @@ namespace psv_func_detail
const int stack_pos = (g_count - 5) * 4 - FIXED_STACK_FRAME_SIZE; const int stack_pos = (g_count - 5) * 4 - FIXED_STACK_FRAME_SIZE;
static_assert(stack_pos < -4, "TODO: Increase fixed stack frame size (arg count limit broken)"); static_assert(stack_pos < -4, "TODO: Increase fixed stack frame size (arg count limit broken)");
vm::psv::write64(context.SP + stack_pos, arg); vm::write64(context.SP + stack_pos, arg);
} }
}; };
@ -178,7 +183,7 @@ namespace psv_func_detail
force_inline static s64 get_arg(ARMv7Context& context) force_inline static s64 get_arg(ARMv7Context& context)
{ {
// TODO: check // TODO: check
return vm::psv::read64(context.SP + sizeof(u32) * (g_count - 5)); return vm::read64(context.SP + sizeof(u32) * (g_count - 5));
} }
force_inline static void put_arg(ARMv7Context& context, s64 arg) force_inline static void put_arg(ARMv7Context& context, s64 arg)
@ -187,7 +192,7 @@ namespace psv_func_detail
const int stack_pos = (g_count - 5) * 4 - FIXED_STACK_FRAME_SIZE; const int stack_pos = (g_count - 5) * 4 - FIXED_STACK_FRAME_SIZE;
static_assert(stack_pos < -4, "TODO: Increase fixed stack frame size (arg count limit broken)"); static_assert(stack_pos < -4, "TODO: Increase fixed stack frame size (arg count limit broken)");
vm::psv::write64(context.SP + stack_pos, arg); vm::write64(context.SP + stack_pos, arg);
} }
}; };
@ -619,27 +624,34 @@ enum psv_error_codes
struct SceDateTime struct SceDateTime
{ {
u16 year; le_t<u16> year;
u16 month; le_t<u16> month;
u16 day; le_t<u16> day;
u16 hour; le_t<u16> hour;
u16 minute; le_t<u16> minute;
u16 second; le_t<u16> second;
u32 microsecond; le_t<u32> microsecond;
}; };
struct SceFVector3 struct SceFVector3
{ {
float x, y, z; le_t<float> x, y, z;
}; };
struct SceFQuaternion struct SceFQuaternion
{ {
float x, y, z, w; le_t<float> x, y, z, w;
}; };
union SceUMatrix4 union SceUMatrix4
{ {
float f[4][4]; struct
s32 i[4][4]; {
le_t<float> f[4][4];
};
struct
{
le_t<s32> i[4][4];
};
}; };

View File

@ -36,8 +36,3 @@ void AudioManager::Close()
delete m_audio_out; delete m_audio_out;
m_audio_out = nullptr; m_audio_out = nullptr;
} }
u8 AudioManager::GetState()
{
return CELL_AUDIO_OUT_OUTPUT_STATE_ENABLED;
}

View File

@ -1,31 +1,16 @@
#pragma once #pragma once
#include "sysutil_audio.h"
#include "AudioThread.h" #include "AudioThread.h"
// it cannot be configured currently, and it must NOT use cellSysutil definitions
struct AudioInfo struct AudioInfo
{ {
struct
{
u8 type;
u8 channel;
u8 encoder;
u8 fs;
u32 layout;
u32 downMixer;
} mode;
AudioInfo() AudioInfo()
{ {
} }
void Init() void Init()
{ {
mode.type = CELL_AUDIO_OUT_CODING_TYPE_LPCM;
mode.channel = CELL_AUDIO_OUT_CHNUM_8;
mode.fs = CELL_AUDIO_OUT_FS_48KHZ;
mode.layout = CELL_AUDIO_OUT_SPEAKER_LAYOUT_8CH_LREClrxy;
mode.encoder = CELL_AUDIO_OUT_CODING_TYPE_LPCM;
mode.downMixer = CELL_AUDIO_OUT_DOWNMIXER_NONE;
} }
}; };
@ -42,6 +27,4 @@ public:
AudioThread& GetAudioOut() { assert(m_audio_out); return *m_audio_out; } AudioThread& GetAudioOut() { assert(m_audio_out); return *m_audio_out; }
AudioInfo& GetInfo() { return m_audio_info; } AudioInfo& GetInfo() { return m_audio_info; }
};
u8 GetState();
};

View File

@ -12,4 +12,4 @@ public:
virtual void Close() = 0; virtual void Close() = 0;
virtual void Stop() = 0; virtual void Stop() = 0;
virtual void AddData(const void* src, int size) = 0; virtual void AddData(const void* src, int size) = 0;
}; };

View File

@ -4,8 +4,8 @@
u32 PPCDecoder::DecodeMemory(const u32 address) u32 PPCDecoder::DecodeMemory(const u32 address)
{ {
u32 instr = vm::read32(address); u32 instr = vm::ps3::read32(address);
Decode(instr); Decode(instr);
return sizeof(u32); return sizeof(u32);
} }

View File

@ -751,8 +751,8 @@ ppu_thread::ppu_thread(u32 entry, const std::string& name, u32 stack_size, u32 p
thread->SetName(name); thread->SetName(name);
thread->SetEntry(entry); thread->SetEntry(entry);
thread->SetStackSize(stack_size ? stack_size : Emu.GetInfo().GetProcParam().primary_stacksize); thread->SetStackSize(stack_size ? stack_size : Emu.GetPrimaryStackSize());
thread->SetPrio(prio ? prio : Emu.GetInfo().GetProcParam().primary_prio); thread->SetPrio(prio ? prio : Emu.GetPrimaryPrio());
argc = 0; argc = 0;
} }
@ -764,14 +764,14 @@ cpu_thread& ppu_thread::args(std::initializer_list<std::string> values)
assert(argc == 0); assert(argc == 0);
envp.set(vm::alloc(align((u32)sizeof(*envp), stack_align), vm::main)); envp.set(vm::alloc(align(sizeof32(u64), stack_align), vm::main));
*envp = 0; *envp = 0;
argv.set(vm::alloc(sizeof(*argv) * values.size(), vm::main)); argv.set(vm::alloc(sizeof32(u64) * (u32)values.size(), vm::main));
for (auto &arg : values) for (auto &arg : values)
{ {
u32 arg_size = align(u32(arg.size() + 1), stack_align); const u32 arg_size = align(u32(arg.size() + 1), stack_align);
u32 arg_addr = vm::alloc(arg_size, vm::main); const u32 arg_addr = vm::alloc(arg_size, vm::main);
std::strcpy(vm::get_ptr<char>(arg_addr), arg.c_str()); std::strcpy(vm::get_ptr<char>(arg_addr), arg.c_str());

View File

@ -828,9 +828,9 @@ PPUThread& GetCurrentPPUThread();
class ppu_thread : cpu_thread class ppu_thread : cpu_thread
{ {
static const u32 stack_align = 0x10; static const u32 stack_align = 0x10;
vm::ptr<u64> argv; vm::_ptr_base<be_t<u64>> argv;
u32 argc; u32 argc;
vm::ptr<u64> envp; vm::_ptr_base<be_t<u64>> envp;
public: public:
ppu_thread(u32 entry, const std::string& name = "", u32 stack_size = 0, u32 prio = 0); ppu_thread(u32 entry, const std::string& name = "", u32 stack_size = 0, u32 prio = 0);

View File

@ -1,40 +0,0 @@
#include "stdafx.h"
#include "Emu/Memory/Memory.h"
#include "SPURSManager.h"
SPURSManagerEventFlag::SPURSManagerEventFlag(u32 flagClearMode, u32 flagDirection)
{
this->flagClearMode = flagClearMode;
this->flagDirection = flagDirection;
}
SPURSManagerTasksetAttribute::SPURSManagerTasksetAttribute(u64 args, vm::ptr<const u8> priority, u32 maxContention)
{
this->args = args;
this->maxContention = maxContention;
}
SPURSManager::SPURSManager()
{
}
void SPURSManager::Finalize()
{
}
void SPURSManager::AttachLv2EventQueue(u32 queue, vm::ptr<u8> port, int isDynamic)
{
//TODO:
}
void SPURSManager::DetachLv2EventQueue(u8 port)
{
//TODO:
}
SPURSManagerTaskset::SPURSManagerTaskset(u32 address, SPURSManagerTasksetAttribute *tattr)
{
this->tattr = tattr;
this->address = address;
}

View File

@ -1,52 +0,0 @@
#pragma once
class SPURSManagerEventFlag
{
public:
SPURSManagerEventFlag(u32 flagClearMode, u32 flagDirection);
u32 _getDirection() const
{
return this->flagDirection;
}
u32 _getClearMode() const
{
return this->flagClearMode;
}
protected:
be_t<u32> flagClearMode;
be_t<u32> flagDirection;
};
class SPURSManagerTasksetAttribute
{
public:
SPURSManagerTasksetAttribute(u64 args, vm::ptr<const u8> priority, u32 maxContention);
protected:
be_t<u64> args;
be_t<u32> maxContention;
};
class SPURSManagerTaskset
{
public:
SPURSManagerTaskset(u32 address, SPURSManagerTasksetAttribute *tattr);
protected:
u32 address;
SPURSManagerTasksetAttribute *tattr;
};
// Main SPURS manager class.
class SPURSManager
{
public:
SPURSManager();
void Finalize();
void AttachLv2EventQueue(u32 queue, vm::ptr<u8> port, int isDynamic);
void DetachLv2EventQueue(u8 port);
};

View File

@ -4,8 +4,6 @@
#include "Emu/System.h" #include "Emu/System.h"
#include "Utilities/File.h" #include "Utilities/File.h"
#include "Emu/SysCalls/lv2/sys_time.h"
#include "SPUInstrTable.h" #include "SPUInstrTable.h"
#include "SPUDisAsm.h" #include "SPUDisAsm.h"
@ -20,6 +18,8 @@
using namespace asmjit; using namespace asmjit;
using namespace asmjit::host; using namespace asmjit::host;
extern u64 get_system_time();
SPURecompilerCore::SPURecompilerCore(SPUThread& cpu) SPURecompilerCore::SPURecompilerCore(SPUThread& cpu)
: m_enc(new SPURecompiler(cpu, *this)) : m_enc(new SPURecompiler(cpu, *this))
, m_int(new SPUInterpreter(cpu)) , m_int(new SPUInterpreter(cpu))
@ -95,7 +95,7 @@ void SPURecompilerCore::Compile(u16 pos)
while (true) while (true)
{ {
const u32 opcode = vm::read32(CPU.offset + pos * 4); const u32 opcode = vm::ps3::read32(CPU.offset + pos * 4);
m_enc->do_finalize = false; m_enc->do_finalize = false;
if (opcode) if (opcode)
{ {

View File

@ -1219,8 +1219,6 @@ spu_thread::spu_thread(u32 entry, const std::string& name, u32 stack_size, u32 p
thread->SetName(name); thread->SetName(name);
thread->SetEntry(entry); thread->SetEntry(entry);
thread->SetStackSize(stack_size ? stack_size : Emu.GetInfo().GetProcParam().primary_stacksize); thread->SetStackSize(stack_size ? stack_size : Emu.GetPrimaryStackSize());
thread->SetPrio(prio ? prio : Emu.GetInfo().GetProcParam().primary_prio); thread->SetPrio(prio ? prio : Emu.GetPrimaryPrio());
argc = 0;
} }

View File

@ -582,21 +582,21 @@ public:
void halt(); void halt();
u8 read8(u32 lsa) const { return vm::read8(lsa + offset); } u8 read8(u32 lsa) const { return vm::read8(lsa + offset); }
u16 read16(u32 lsa) const { return vm::read16(lsa + offset); } u16 read16(u32 lsa) const { return vm::ps3::read16(lsa + offset); }
u32 read32(u32 lsa) const { return vm::read32(lsa + offset); } u32 read32(u32 lsa) const { return vm::ps3::read32(lsa + offset); }
u64 read64(u32 lsa) const { return vm::read64(lsa + offset); } u64 read64(u32 lsa) const { return vm::ps3::read64(lsa + offset); }
u128 read128(u32 lsa) const { return vm::read128(lsa + offset); } u128 read128(u32 lsa) const { return vm::ps3::read128(lsa + offset); }
void write8(u32 lsa, u8 data) const { vm::write8(lsa + offset, data); } void write8(u32 lsa, u8 data) const { vm::write8(lsa + offset, data); }
void write16(u32 lsa, u16 data) const { vm::write16(lsa + offset, data); } void write16(u32 lsa, u16 data) const { vm::ps3::write16(lsa + offset, data); }
void write32(u32 lsa, u32 data) const { vm::write32(lsa + offset, data); } void write32(u32 lsa, u32 data) const { vm::ps3::write32(lsa + offset, data); }
void write64(u32 lsa, u64 data) const { vm::write64(lsa + offset, data); } void write64(u32 lsa, u64 data) const { vm::ps3::write64(lsa + offset, data); }
void write128(u32 lsa, u128 data) const { vm::write128(lsa + offset, data); } void write128(u32 lsa, u128 data) const { vm::ps3::write128(lsa + offset, data); }
void write16(u32 lsa, be_t<u16> data) const { vm::write16(lsa + offset, data); } void write16(u32 lsa, be_t<u16> data) const { vm::ps3::write16(lsa + offset, data); }
void write32(u32 lsa, be_t<u32> data) const { vm::write32(lsa + offset, data); } void write32(u32 lsa, be_t<u32> data) const { vm::ps3::write32(lsa + offset, data); }
void write64(u32 lsa, be_t<u64> data) const { vm::write64(lsa + offset, data); } void write64(u32 lsa, be_t<u64> data) const { vm::ps3::write64(lsa + offset, data); }
void write128(u32 lsa, be_t<u128> data) const { vm::write128(lsa + offset, data); } void write128(u32 lsa, be_t<u128> data) const { vm::ps3::write128(lsa + offset, data); }
void RegisterHleFunction(u32 addr, std::function<bool(SPUThread & SPU)> function) void RegisterHleFunction(u32 addr, std::function<bool(SPUThread & SPU)> function)
{ {
@ -702,35 +702,11 @@ SPUThread& GetCurrentSPUThread();
class spu_thread : cpu_thread class spu_thread : cpu_thread
{ {
static const u32 stack_align = 0x10;
vm::ptr<u64> argv;
u32 argc;
vm::ptr<u64> envp;
public: public:
spu_thread(u32 entry, const std::string& name = "", u32 stack_size = 0, u32 prio = 0); spu_thread(u32 entry, const std::string& name = "", u32 stack_size = 0, u32 prio = 0);
cpu_thread& args(std::initializer_list<std::string> values) override cpu_thread& args(std::initializer_list<std::string> values) override
{ {
if (!values.size())
return *this;
assert(argc == 0);
envp.set(Memory.MainMem.AllocAlign((u32)sizeof(envp), stack_align));
*envp = 0;
argv.set(Memory.MainMem.AllocAlign(u32(sizeof(argv)* values.size()), stack_align));
for (auto &arg : values)
{
u32 arg_size = align(u32(arg.size() + 1), stack_align);
u32 arg_addr = (u32)Memory.MainMem.AllocAlign(arg_size, stack_align);
std::strcpy(vm::get_ptr<char>(arg_addr), arg.c_str());
argv[argc++] = arg_addr;
}
return *this; return *this;
} }
@ -740,10 +716,6 @@ public:
spu.Run(); spu.Run();
spu.GPR[3].from64(argc);
spu.GPR[4].from64(argv.addr());
spu.GPR[5].from64(envp.addr());
return *this; return *this;
} }
}; };

View File

@ -63,7 +63,7 @@ public:
} }
// must be called from the constructor called through make() to get further ID of current object // must be called from the constructor called through make() to get further ID of current object
u32 get_cur_id() u32 get_current_id()
{ {
// if called correctly from make(), the mutex is locked // if called correctly from make(), the mutex is locked
// if called illegally, the mutex is unlocked with high probability (wrong ID is returned otherwise) // if called illegally, the mutex is unlocked with high probability (wrong ID is returned otherwise)

View File

@ -436,7 +436,7 @@ bool VirtualMemoryBlock::Read32(const u32 addr, u32* value)
u32 realAddr; u32 realAddr;
if (!getRealAddr(addr, realAddr)) if (!getRealAddr(addr, realAddr))
return false; return false;
*value = vm::read32(realAddr); *value = vm::ps3::read32(realAddr);
return true; return true;
} }
@ -445,7 +445,7 @@ bool VirtualMemoryBlock::Write32(const u32 addr, const u32 value)
u32 realAddr; u32 realAddr;
if (!getRealAddr(addr, realAddr)) if (!getRealAddr(addr, realAddr))
return false; return false;
vm::write32(realAddr, value); vm::ps3::write32(realAddr, value);
return true; return true;
} }

View File

@ -142,20 +142,20 @@ namespace vm
return cast_ptr<T>::cast(addr, func); return cast_ptr<T>::cast(addr, func);
} }
static u8 read8(u32 addr)
{
return get_ref<u8>(addr);
}
static void write8(u32 addr, u8 value)
{
get_ref<u8>(addr) = value;
}
namespace ps3 namespace ps3
{ {
void init(); void init();
static u8 read8(u32 addr)
{
return get_ref<u8>(addr);
}
static void write8(u32 addr, u8 value)
{
get_ref<u8>(addr) = value;
}
static u16 read16(u32 addr) static u16 read16(u32 addr)
{ {
return get_ref<be_t<u16>>(addr); return get_ref<be_t<u16>>(addr);
@ -216,16 +216,6 @@ namespace vm
{ {
void init(); void init();
static u8 read8(u32 addr)
{
return get_ref<u8>(addr);
}
static void write8(u32 addr, u8 value)
{
get_ref<u8>(addr) = value;
}
static u16 read16(u32 addr) static u16 read16(u32 addr)
{ {
return get_ref<u16>(addr); return get_ref<u16>(addr);
@ -298,15 +288,15 @@ namespace vm
u32 alloc_offset; u32 alloc_offset;
template<typename T = char> template<typename T = char>
ptr<T> alloc(u32 count = 1) const _ptr_base<T> alloc(u32 count = 1) const
{ {
return ptr<T>::make(allocator(count * sizeof(T))); return{ allocator(count * sizeof32(T)) };
} }
template<typename T = char> template<typename T = char>
ptr<T> fixed_alloc(u32 addr, u32 count = 1) const _ptr_base<T> fixed_alloc(u32 addr, u32 count = 1) const
{ {
return ptr<T>::make(fixed_allocator(addr, count * sizeof(T))); return{ fixed_allocator(addr, count * sizeof32(T)) };
} }
}; };

View File

@ -184,9 +184,6 @@ namespace vm
template<typename T> using lcptr = lptr<const T>; template<typename T> using lcptr = lptr<const T>;
} }
// PS3 emulation is main now, so lets it be as default
using namespace ps3;
struct null_t struct null_t
{ {
template<typename T, typename AT> operator _ptr_base<T, AT>() const template<typename T, typename AT> operator _ptr_base<T, AT>() const

View File

@ -103,9 +103,6 @@ namespace vm
// default reference for PSV HLE structures (LE reference to LE data) // default reference for PSV HLE structures (LE reference to LE data)
template<typename T> using lref = lrefl<T>; template<typename T> using lref = lrefl<T>;
} }
//PS3 emulation is main now, so lets it be as default
using namespace ps3;
} }
// postfix increment operator for vm::_ref_base // postfix increment operator for vm::_ref_base

View File

@ -1,10 +1,10 @@
#include "stdafx.h" #include "stdafx.h"
#include "FragmentProgramDecompiler.h"
#include "Utilities/Log.h" #include "Utilities/Log.h"
#include "Emu/Memory/Memory.h" #include "Emu/Memory/Memory.h"
#include "Emu/System.h" #include "Emu/System.h"
#include "FragmentProgramDecompiler.h"
FragmentProgramDecompiler::FragmentProgramDecompiler(u32 addr, u32& size, u32 ctrl) : FragmentProgramDecompiler::FragmentProgramDecompiler(u32 addr, u32& size, u32 ctrl) :
m_addr(addr), m_addr(addr),
m_size(size), m_size(size),
@ -114,7 +114,7 @@ std::string FragmentProgramDecompiler::AddConst()
return name; return name;
} }
auto data = vm::ptr<u32>::make(m_addr + m_size + 4 * sizeof(u32)); auto data = vm::ps3::ptr<u32>::make(m_addr + m_size + 4 * sizeof(u32));
m_offset = 2 * 4 * sizeof(u32); m_offset = 2 * 4 * sizeof(u32);
u32 x = GetData(data[0]); u32 x = GetData(data[0]);
@ -335,7 +335,7 @@ std::string FragmentProgramDecompiler::BuildCode()
std::string FragmentProgramDecompiler::Decompile() std::string FragmentProgramDecompiler::Decompile()
{ {
auto data = vm::ptr<u32>::make(m_addr); auto data = vm::ps3::ptr<u32>::make(m_addr);
m_size = 0; m_size = 0;
m_location = 0; m_location = 0;
m_loop_count = 0; m_loop_count = 0;

View File

@ -1,8 +1,9 @@
#include "stdafx.h" #include "stdafx.h"
#include "VertexProgramDecompiler.h"
#include "Utilities/Log.h" #include "Utilities/Log.h"
#include "Emu/System.h" #include "Emu/System.h"
#include "VertexProgramDecompiler.h"
std::string VertexProgramDecompiler::GetMask(bool is_sca) std::string VertexProgramDecompiler::GetMask(bool is_sca)
{ {
std::string ret; std::string ret;

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
namespace vm { using namespace ps3; }
enum enum
{ {
CELL_GCM_DISPLAY_HSYNC = 1, CELL_GCM_DISPLAY_HSYNC = 1,

View File

@ -1,5 +1,6 @@
#pragma once #pragma once
#include "GSRender.h"
struct GSRender;
struct GSInfo struct GSInfo
{ {
@ -13,7 +14,6 @@ struct GSInfo
u16 refreshRates; u16 refreshRates;
u32 pitch; u32 pitch;
} mode; } mode;
//CellVideoOutDisplayMode mode;
GSInfo() GSInfo()
{ {

View File

@ -1,125 +0,0 @@
// Copyright (C) 2015 AlexAltea (https://github.com/AlexAltea/nucleus)
#include "stdafx.h"
#include "RSXDMA.h"
#include "Emu/Memory/Memory.h"
#include "Utilities/Log.h"
DMAObject dma_address(u32 dma_object)
{
// NOTE: RAMIN is not emulated, therefore DMA Objects are hardcoded in this function
switch (dma_object) {
case RSX_CONTEXT_DMA_REPORT_LOCATION_LOCAL:
return DMAObject{ 0x40300000, 0x8000, DMAObject::READWRITE }; // TODO: Inconsistency: Gitbrew says R starting at 0x1400, test says RW starting at 0x0.
case RSX_CONTEXT_DMA_DEVICE_RW:
return DMAObject{ 0x40000000, 0x1000, DMAObject::READWRITE };
case RSX_CONTEXT_DMA_DEVICE_R:
return DMAObject{ 0x40000000, 0x1000, DMAObject::READWRITE }; // TODO: Inconsistency: Gitbrew says R, test says RW
case RSX_CONTEXT_DMA_SEMAPHORE_RW:
return DMAObject{ 0x40100000, 0x1000, DMAObject::READWRITE };
case RSX_CONTEXT_DMA_SEMAPHORE_R:
return DMAObject{ 0x40100000, 0x1000, DMAObject::READWRITE }; // TODO: Inconsistency: Gitbrew says R, test says RW
default:
LOG_WARNING(RSX, "Unknown DMA object (0x%08x)", dma_object);
return DMAObject{};
}
}
u8 dma_read8(u32 dma_object, u8 offset)
{
const DMAObject& dma = dma_address(dma_object);
if (dma.addr && dma.flags & DMAObject::READ)
{
return vm::read8(dma.addr + offset);
}
LOG_WARNING(RSX, "Illegal DMA 8-bit read");
return 0;
}
u16 dma_read16(u32 dma_object, u16 offset)
{
const DMAObject& dma = dma_address(dma_object);
if (dma.addr && dma.flags & DMAObject::READ)
{
return vm::read16(dma.addr + offset);
}
LOG_WARNING(RSX, "Illegal DMA 16-bit read");
return 0;
}
u32 dma_read32(u32 dma_object, u32 offset)
{
const DMAObject& dma = dma_address(dma_object);
if (dma.addr && dma.flags & DMAObject::READ)
{
return vm::read32(dma.addr + offset);
}
LOG_WARNING(RSX, "Illegal DMA 32-bit read");
return 0;
}
u64 dma_read64(u32 dma_object, u64 offset)
{
const DMAObject& dma = dma_address(dma_object);
if (dma.addr && dma.flags & DMAObject::READ)
{
return vm::read64(dma.addr + offset);
}
LOG_WARNING(RSX, "Illegal DMA 64-bit read");
return 0;
}
void dma_write8(u32 dma_object, u32 offset, u8 value)
{
const DMAObject& dma = dma_address(dma_object);
if (dma.addr && dma.flags & DMAObject::WRITE)
{
return vm::write8(dma.addr + offset, value);
}
LOG_WARNING(RSX, "Illegal DMA 32-bit write");
}
void dma_write16(u32 dma_object, u32 offset, u16 value)
{
const DMAObject& dma = dma_address(dma_object);
if (dma.addr && dma.flags & DMAObject::WRITE)
{
return vm::write16(dma.addr + offset, value);
}
LOG_WARNING(RSX, "Illegal DMA 32-bit write");
}
void dma_write32(u32 dma_object, u32 offset, u32 value)
{
const DMAObject& dma = dma_address(dma_object);
if (dma.addr && dma.flags & DMAObject::WRITE)
{
return vm::write32(dma.addr + offset, value);
}
LOG_WARNING(RSX, "Illegal DMA 32-bit write");
}
void dma_write64(u32 dma_object, u32 offset, u64 value)
{
const DMAObject& dma = dma_address(dma_object);
if (dma.addr && dma.flags & DMAObject::WRITE)
{
return vm::write64(dma.addr + offset, value);
}
LOG_WARNING(RSX, "Illegal DMA 64-bit write");
}

View File

@ -1,46 +0,0 @@
// Copyright (C) 2015 AlexAltea (https://github.com/AlexAltea/nucleus)
#pragma once
enum {
RSX_CONTEXT_DMA_TO_MEMORY_GET_NOTIFY0 = 0x66604200, // Target: lpar_reports[0x1000 : 0x????]
RSX_CONTEXT_DMA_TO_MEMORY_GET_NOTIFY1 = 0x66604201, // Target: lpar_reports[0x1000 : 0x????]
RSX_CONTEXT_DMA_TO_MEMORY_GET_NOTIFY2 = 0x66604202, // Target: lpar_reports[0x1000 : 0x????]
RSX_CONTEXT_DMA_TO_MEMORY_GET_NOTIFY3 = 0x66604203, // Target: lpar_reports[0x1000 : 0x????]
RSX_CONTEXT_DMA_TO_MEMORY_GET_NOTIFY4 = 0x66604204, // Target: lpar_reports[0x1000 : 0x????]
RSX_CONTEXT_DMA_TO_MEMORY_GET_NOTIFY5 = 0x66604205, // Target: lpar_reports[0x1000 : 0x????]
RSX_CONTEXT_DMA_TO_MEMORY_GET_NOTIFY6 = 0x66604206, // Target: lpar_reports[0x1000 : 0x????]
RSX_CONTEXT_DMA_TO_MEMORY_GET_NOTIFY7 = 0x66604207, // Target: lpar_reports[0x1000 : 0x????]
RSX_CONTEXT_DMA_TO_MEMORY_GET_NOTIFY8 = 0x66604208, // Target: lpar_reports[0x1000 : 0x????]
RSX_CONTEXT_DMA_NOTIFY_MAIN_0 = 0x6660420F,
RSX_CONTEXT_DMA_SEMAPHORE_RW = 0x66606660, // Target: lpar_reports[0x0000 : 0x1000] (Read/Write)
RSX_CONTEXT_DMA_SEMAPHORE_R = 0x66616661, // Target: lpar_reports[0x0000 : 0x1000] (Read)
RSX_CONTEXT_DMA_REPORT_LOCATION_LOCAL = 0x66626660, // Target: lpar_reports[0x1400 : 0x9400]
RSX_CONTEXT_DMA_REPORT_LOCATION_MAIN = 0xBAD68000,
RSX_CONTEXT_DMA_DEVICE_RW = 0x56616660,
RSX_CONTEXT_DMA_DEVICE_R = 0x56616661,
};
struct DMAObject {
// Flags
enum {
READ = 1 << 0,
WRITE = 1 << 1,
READWRITE = READ | WRITE,
};
u32 addr;
u32 size;
u32 flags;
};
// RSX Direct Memory Access
DMAObject dma_address(u32 dma_object);
u8 dma_read8(u32 dma_object, u32 offset);
u16 dma_read16(u32 dma_object, u32 offset);
u32 dma_read32(u32 dma_object, u32 offset);
u64 dma_read64(u32 dma_object, u32 offset);
void dma_write8(u32 dma_object, u32 offset, u8 value);
void dma_write16(u32 dma_object, u32 offset, u16 value);
void dma_write32(u32 dma_object, u32 offset, u32 value);
void dma_write64(u32 dma_object, u32 offset, u64 value);

View File

@ -4,19 +4,20 @@
#include "Emu/Memory/Memory.h" #include "Emu/Memory/Memory.h"
#include "Emu/System.h" #include "Emu/System.h"
#include "Emu/RSX/GSManager.h" #include "Emu/RSX/GSManager.h"
#include "Emu/RSX/RSXDMA.h" #include "Emu/RSX/GSRender.h"
#include "Emu/RSX/sysutil_video.h" #include "Emu/RSX/sysutil_video.h"
#include "RSXThread.h" #include "RSXThread.h"
#include "Emu/SysCalls/Callback.h" #include "Emu/SysCalls/Callback.h"
#include "Emu/SysCalls/CB_FUNC.h" #include "Emu/SysCalls/CB_FUNC.h"
#include "Emu/SysCalls/lv2/sys_time.h"
extern "C" extern "C"
{ {
#include "libswscale/swscale.h" #include "libswscale/swscale.h"
} }
extern u64 get_system_time();
#define ARGS(x) (x >= count ? OutOfArgsCount(x, cmd, count, args.addr()) : args[x].value()) #define ARGS(x) (x >= count ? OutOfArgsCount(x, cmd, count, args.addr()) : args[x].value())
#define CMD_DEBUG 0 #define CMD_DEBUG 0

View File

@ -9,28 +9,24 @@
void CallbackManager::Register(const std::function<s32(PPUThread& PPU)>& func) void CallbackManager::Register(const std::function<s32(PPUThread& PPU)>& func)
{ {
{ std::lock_guard<std::mutex> lock(m_mutex);
std::lock_guard<std::mutex> lock(m_mutex);
m_cb_list.push_back([=](CPUThread& CPU) -> s32 m_cb_list.push_back([=](CPUThread& CPU) -> s32
{ {
assert(CPU.GetType() == CPU_THREAD_PPU); assert(CPU.GetType() == CPU_THREAD_PPU);
return func(static_cast<PPUThread&>(CPU)); return func(static_cast<PPUThread&>(CPU));
}); });
}
} }
void CallbackManager::Async(const std::function<void(PPUThread& PPU)>& func) void CallbackManager::Async(const std::function<void(PPUThread& PPU)>& func)
{ {
{ std::lock_guard<std::mutex> lock(m_mutex);
std::lock_guard<std::mutex> lock(m_mutex);
m_async_list.push_back([=](CPUThread& CPU) m_async_list.push_back([=](CPUThread& CPU)
{ {
assert(CPU.GetType() == CPU_THREAD_PPU); assert(CPU.GetType() == CPU_THREAD_PPU);
func(static_cast<PPUThread&>(CPU)); func(static_cast<PPUThread&>(CPU));
}); });
}
m_cv.notify_one(); m_cv.notify_one();
} }

View File

@ -1,4 +1,5 @@
#include "stdafx.h" #include "stdafx.h"
#include "Modules.h"
#include "ModuleManager.h" #include "ModuleManager.h"
extern Module cellAdec; extern Module cellAdec;

View File

@ -1,5 +1,6 @@
#pragma once #pragma once
#include "Modules.h"
class Module;
class ModuleManager class ModuleManager
{ {

View File

@ -1,8 +1,11 @@
#pragma once #pragma once
#include "Emu/SysCalls/SC_FUNC.h" #include "Emu/SysCalls/SC_FUNC.h"
#include "ErrorCodes.h" #include "ErrorCodes.h"
#include "LogBase.h" #include "LogBase.h"
namespace vm { using namespace ps3; }
class Module; class Module;
// flags set in ModuleFunc // flags set in ModuleFunc

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
namespace vm { using namespace ps3; }
// Error Codes // Error Codes
enum enum
{ {

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
namespace vm { using namespace ps3; }
// Return Codes // Return Codes
enum enum
{ {

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
namespace vm { using namespace ps3; }
// Error codes // Error codes
enum enum
{ {

View File

@ -0,0 +1,90 @@
#pragma once
namespace vm { using namespace ps3; }
// Error codes
enum
{
CELL_AUDIO_IN_ERROR_NOT_IMPLEMENTED = 0x8002b260,
CELL_AUDIO_IN_ERROR_ILLEGAL_CONFIGURATION = 0x8002b261,
CELL_AUDIO_IN_ERROR_ILLEGAL_PARAMETER = 0x8002b262,
CELL_AUDIO_IN_ERROR_PARAMETER_OUT_OF_RANGE = 0x8002b263,
CELL_AUDIO_IN_ERROR_DEVICE_NOT_FOUND = 0x8002b264,
CELL_AUDIO_IN_ERROR_UNSUPPORTED_AUDIO_IN = 0x8002b265,
CELL_AUDIO_IN_ERROR_UNSUPPORTED_SOUND_MODE = 0x8002b266,
CELL_AUDIO_IN_ERROR_CONDITION_BUSY = 0x8002b267,
};
enum
{
CELL_AUDIO_IN_SINGLE_DEVICE_MODE = 0,
CELL_AUDIO_IN_MULTI_DEVICE_MODE = 1,
CELL_AUDIO_IN_MULTI_DEVICE_MODE_2 = 2,
};
enum CellAudioInPortType
{
CELL_AUDIO_IN_PORT_USB = 3,
CELL_AUDIO_IN_PORT_BLUETOOTH = 4,
};
enum CellAudioInDeviceState
{
CELL_AUDIO_IN_DEVICE_STATE_UNAVAILABLE = 0,
CELL_AUDIO_IN_DEVICE_STATE_AVAILABLE = 1,
};
enum CellAudioInCodingType
{
CELL_AUDIO_IN_CODING_TYPE_LPCM = 0,
};
enum CellAudioInChnum
{
CELL_AUDIO_IN_CHNUM_NONE = 0,
CELL_AUDIO_IN_CHNUM_1 = 1,
CELL_AUDIO_IN_CHNUM_2 = 2,
};
enum CellAudioInFs
{
CELL_AUDIO_IN_FS_UNDEFINED = 0x00,
CELL_AUDIO_IN_FS_8KHZ = 0x01,
CELL_AUDIO_IN_FS_12KHZ = 0x02,
CELL_AUDIO_IN_FS_16KHZ = 0x04,
CELL_AUDIO_IN_FS_24KHZ = 0x08,
CELL_AUDIO_IN_FS_32KHZ = 0x10,
CELL_AUDIO_IN_FS_48KHZ = 0x20,
};
struct CellAudioInSoundMode
{
u8 type;
u8 channel;
be_t<u16> fs;
u8 reserved[4];
};
struct CellAudioInDeviceInfo
{
u8 portType;
u8 availableModeCount;
u8 state;
u8 deviceNumber;
u8 reserved[12];
be_t<u64> deviceId;
be_t<u64> type;
char name[64];
CellAudioInSoundMode availableModes[16];
};
struct CellAudioInRegistrationOption
{
//(Omitted)
};
struct CellAudioInDeviceConfiguration
{
u8 volume;
u8 reserved[31];
};

View File

@ -0,0 +1,179 @@
#pragma once
namespace vm { using namespace ps3; }
// Error codes
enum
{
CELL_AUDIO_OUT_ERROR_NOT_IMPLEMENTED = 0x8002b240,
CELL_AUDIO_OUT_ERROR_ILLEGAL_CONFIGURATION = 0x8002b241,
CELL_AUDIO_OUT_ERROR_ILLEGAL_PARAMETER = 0x8002b242,
CELL_AUDIO_OUT_ERROR_PARAMETER_OUT_OF_RANGE = 0x8002b243,
CELL_AUDIO_OUT_ERROR_DEVICE_NOT_FOUND = 0x8002b244,
CELL_AUDIO_OUT_ERROR_UNSUPPORTED_AUDIO_OUT = 0x8002b245,
CELL_AUDIO_OUT_ERROR_UNSUPPORTED_SOUND_MODE = 0x8002b246,
CELL_AUDIO_OUT_ERROR_CONDITION_BUSY = 0x8002b247,
};
enum CellAudioOut
{
CELL_AUDIO_OUT_PRIMARY = 0,
CELL_AUDIO_OUT_SECONDARY = 1,
};
enum CellAudioOutDownMixer
{
CELL_AUDIO_OUT_DOWNMIXER_NONE = 0,
CELL_AUDIO_OUT_DOWNMIXER_TYPE_A = 1,
CELL_AUDIO_OUT_DOWNMIXER_TYPE_B = 2,
};
enum
{
CELL_AUDIO_OUT_SINGLE_DEVICE_MODE = 0,
CELL_AUDIO_OUT_MULTI_DEVICE_MODE = 1,
CELL_AUDIO_OUT_MULTI_DEVICE_MODE_2 = 2,
};
enum CellAudioOutPortType
{
CELL_AUDIO_OUT_PORT_HDMI = 0,
CELL_AUDIO_OUT_PORT_SPDIF = 1,
CELL_AUDIO_OUT_PORT_ANALOG = 2,
CELL_AUDIO_OUT_PORT_USB = 3,
CELL_AUDIO_OUT_PORT_BLUETOOTH = 4,
CELL_AUDIO_OUT_PORT_NETWORK = 5,
};
enum CellAudioOutDeviceState
{
CELL_AUDIO_OUT_DEVICE_STATE_UNAVAILABLE = 0,
CELL_AUDIO_OUT_DEVICE_STATE_AVAILABLE = 1,
};
enum CellAudioOutOutputState
{
CELL_AUDIO_OUT_OUTPUT_STATE_ENABLED = 0,
CELL_AUDIO_OUT_OUTPUT_STATE_DISABLED = 1,
CELL_AUDIO_OUT_OUTPUT_STATE_PREPARING = 2,
};
enum CellAudioOutCodingType
{
CELL_AUDIO_OUT_CODING_TYPE_LPCM = 0,
CELL_AUDIO_OUT_CODING_TYPE_AC3 = 1,
CELL_AUDIO_OUT_CODING_TYPE_MPEG1 = 2,
CELL_AUDIO_OUT_CODING_TYPE_MP3 = 3,
CELL_AUDIO_OUT_CODING_TYPE_MPEG2 = 4,
CELL_AUDIO_OUT_CODING_TYPE_AAC = 5,
CELL_AUDIO_OUT_CODING_TYPE_DTS = 6,
CELL_AUDIO_OUT_CODING_TYPE_ATRAC = 7,
CELL_AUDIO_OUT_CODING_TYPE_BITSTREAM = 0xff,
};
enum CellAudioOutChnum
{
CELL_AUDIO_OUT_CHNUM_2 = 2,
CELL_AUDIO_OUT_CHNUM_4 = 4,
CELL_AUDIO_OUT_CHNUM_6 = 6,
CELL_AUDIO_OUT_CHNUM_8 = 8,
};
enum CellAudioOutFs
{
CELL_AUDIO_OUT_FS_32KHZ = 0x01,
CELL_AUDIO_OUT_FS_44KHZ = 0x02,
CELL_AUDIO_OUT_FS_48KHZ = 0x04,
CELL_AUDIO_OUT_FS_88KHZ = 0x08,
CELL_AUDIO_OUT_FS_96KHZ = 0x10,
CELL_AUDIO_OUT_FS_176KHZ = 0x20,
CELL_AUDIO_OUT_FS_192KHZ = 0x40,
};
enum
{
CELL_AUDIO_OUT_SPEAKER_LAYOUT_2CH = 0x00000001,
CELL_AUDIO_OUT_SPEAKER_LAYOUT_6CH_LREClr = 0x00010000,
CELL_AUDIO_OUT_SPEAKER_LAYOUT_8CH_LREClrxy = 0x40000000,
};
enum
{
CELL_AUDIO_OUT_COPY_CONTROL_COPY_FREE = 0,
CELL_AUDIO_OUT_COPY_CONTROL_COPY_ONCE = 1,
CELL_AUDIO_OUT_COPY_CONTROL_COPY_NEVER = 2,
};
struct CellAudioOutConfiguration
{
u8 channel;
u8 encoder;
u8 reserved[10];
be_t<u32> downMixer;
};
struct CellAudioOutSoundMode
{
u8 type;
u8 channel;
u8 fs;
u8 reserved;
be_t<u32> layout;
};
struct CellAudioOutDeviceInfo
{
u8 portType;
u8 availableModeCount;
u8 state;
u8 reserved[3];
be_t<u16> latency;
CellAudioOutSoundMode availableModes[16];
};
struct CellAudioOutState
{
u8 state;
u8 encoder;
u8 reserved[6];
be_t<u32> downMixer;
CellAudioOutSoundMode soundMode;
};
struct CellAudioOutSoundMode2
{
u8 type;
u8 channel;
be_t<u16> fs;
u8 reserved[4];
};
struct CellAudioOutDeviceInfo2
{
u8 portType;
u8 availableModeCount;
u8 state;
u8 deviceNumber;
u8 reserved[12];
be_t<u64> deviceId;
be_t<u64> type;
char name[64];
CellAudioOutSoundMode2 availableModes2[16];
};
struct CellAudioOutOption
{
//(Omitted)
};
struct CellAudioOutRegistrationOption
{
//(Omitted)
};
struct CellAudioOutDeviceConfiguration
{
//(Omitted)
};

View File

@ -4,6 +4,8 @@
#include "Emu/SysCalls/Modules.h" #include "Emu/SysCalls/Modules.h"
#include "Emu/RSX/sysutil_video.h" #include "Emu/RSX/sysutil_video.h"
namespace vm { using namespace ps3; }
extern Module cellAvconfExt; extern Module cellAvconfExt;
s32 cellVideoOutConvertCursorColor() s32 cellVideoOutConvertCursorColor()

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
namespace vm { using namespace ps3; }
// Error Codes // Error Codes
enum enum
{ {

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
namespace vm { using namespace ps3; }
// Error Codes // Error Codes
enum enum
{ {

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
namespace vm { using namespace ps3; }
// Return Codes // Return Codes
enum enum
{ {

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
namespace vm { using namespace ps3; }
// Error codes // Error codes
enum enum
{ {

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
namespace vm { using namespace ps3; }
struct CellFontLibraryConfigFT struct CellFontLibraryConfigFT
{ {
u32 library_addr; //void* u32 library_addr; //void*

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
namespace vm { using namespace ps3; }
struct CellFsDirectoryEntry struct CellFsDirectoryEntry
{ {
CellFsStat attribute; CellFsStat attribute;

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
namespace vm { using namespace ps3; }
// Return Codes // Return Codes
enum enum
{ {

View File

@ -7,6 +7,7 @@
//#include "Emu/RSX/GCM.h" //#include "Emu/RSX/GCM.h"
#include "Emu/RSX/GSManager.h" #include "Emu/RSX/GSManager.h"
#include "Emu/RSX/GSRender.h"
//#include "Emu/SysCalls/lv2/sys_process.h" //#include "Emu/SysCalls/lv2/sys_process.h"
#include "cellGcmSys.h" #include "cellGcmSys.h"

View File

@ -1,4 +1,7 @@
#pragma once #pragma once
namespace vm { using namespace ps3; }
#include "Emu/RSX/GCM.h" #include "Emu/RSX/GCM.h"
enum enum

View File

@ -1,7 +1,8 @@
#pragma once #pragma once
// Had to use define, since enum doesn't allow floats namespace vm { using namespace ps3; }
#define CELL_GEM_SPHERE_RADIUS_MM = 22.5f;
static const float CELL_GEM_SPHERE_RADIUS_MM = 22.5f;
// Error Codes // Error Codes
enum enum

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
namespace vm { using namespace ps3; }
// Return Codes // Return Codes
enum enum
{ {

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
namespace vm { using namespace ps3; }
//Return Codes //Return Codes
enum enum
{ {

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
namespace vm { using namespace ps3; }
enum CELL_KB_ERROR_CODE enum CELL_KB_ERROR_CODE
{ {
CELL_KB_ERROR_FATAL = 0x80121001, CELL_KB_ERROR_FATAL = 0x80121001,

View File

@ -33,7 +33,7 @@ s32 UTF16stoUTF8s(vm::ptr<const char16_t> utf16, vm::ref<u32> utf16_len, vm::ptr
// return SRCIllegal; // return SRCIllegal;
//} //}
if (utf8) if (utf8 != vm::null)
{ {
if (len > max_len) if (len > max_len)
{ {

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
namespace vm { using namespace ps3; }
// L10nResult // L10nResult
enum enum
{ {

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
namespace vm { using namespace ps3; }
// Error Codes // Error Codes
enum enum
{ {
@ -20,4 +22,4 @@ enum
CELL_MICIN_ERROR_SYSTEM_NOT_FOUND = 0x8014010e, CELL_MICIN_ERROR_SYSTEM_NOT_FOUND = 0x8014010e,
CELL_MICIN_ERROR_FATAL = 0x8014010f, CELL_MICIN_ERROR_FATAL = 0x8014010f,
CELL_MICIN_ERROR_DEVICE_NOT_SUPPORT = 0x80140110, CELL_MICIN_ERROR_DEVICE_NOT_SUPPORT = 0x80140110,
}; };

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
namespace vm { using namespace ps3; }
enum CELL_MOUSE_ERROR_CODE enum CELL_MOUSE_ERROR_CODE
{ {
CELL_MOUSE_ERROR_FATAL = 0x80121201, CELL_MOUSE_ERROR_FATAL = 0x80121201,

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
namespace vm { using namespace ps3; }
enum enum
{ {
CELL_MSGDIALOG_ERROR_PARAM = 0x8002b301, CELL_MSGDIALOG_ERROR_PARAM = 0x8002b301,

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
namespace vm { using namespace ps3; }
// Error Codes // Error Codes
enum enum
{ {

View File

@ -2,6 +2,8 @@
#include "Emu/Memory/Memory.h" #include "Emu/Memory/Memory.h"
#include "Emu/SysCalls/Modules.h" #include "Emu/SysCalls/Modules.h"
namespace vm { using namespace ps3; }
extern Module cellOvis; extern Module cellOvis;
// Return Codes // Return Codes

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
namespace vm { using namespace ps3; }
enum CELL_PAD_ERROR_CODE enum CELL_PAD_ERROR_CODE
{ {
CELL_PAD_ERROR_FATAL = 0x80121101, CELL_PAD_ERROR_FATAL = 0x80121101,

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
namespace vm { using namespace ps3; }
// Error Codes // Error Codes
enum enum
{ {

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
namespace vm { using namespace ps3; }
enum CellPngTxtType enum CellPngTxtType
{ {
CELL_PNG_TEXT = 0, CELL_PNG_TEXT = 0,

View File

@ -1,4 +1,7 @@
#pragma once #pragma once
namespace vm { using namespace ps3; }
#include "cellPng.h" #include "cellPng.h"
enum : u32 enum : u32

View File

@ -6,6 +6,7 @@
#include "cellSysutil.h" #include "cellSysutil.h"
#include "Emu/RSX/sysutil_video.h" #include "Emu/RSX/sysutil_video.h"
#include "Emu/RSX/GSManager.h" #include "Emu/RSX/GSManager.h"
#include "Emu/RSX/GSRender.h"
#include "cellResc.h" #include "cellResc.h"
extern Module cellResc; extern Module cellResc;

View File

@ -3,6 +3,8 @@
#define roundup(x,a) (((x)+(a)-1)&(~((a)-1))) #define roundup(x,a) (((x)+(a)-1)&(~((a)-1)))
#define SEVIRITY 80.f #define SEVIRITY 80.f
namespace vm { using namespace ps3; }
#include "Emu/RSX/GCM.h" #include "Emu/RSX/GCM.h"
enum enum

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
namespace vm { using namespace ps3; }
// Return Codes // Return Codes
enum enum
{ {

View File

@ -1,3 +1,7 @@
#pragma once
namespace vm { using namespace ps3; }
// Return Codes // Return Codes
enum enum
{ {
@ -42,11 +46,11 @@ enum
CELL_RUDP_ERROR_KEEP_ALIVE_FAILURE = 0x80770026, CELL_RUDP_ERROR_KEEP_ALIVE_FAILURE = 0x80770026,
}; };
typedef vm::ptr<u32>(CellRudpAllocatorFuncAlloc)(u32 size); using CellRudpAllocatorFuncAlloc = func_def<vm::ptr<u32>(u32 size)>;
typedef u32(CellRudpAllocatorFuncFree)(vm::ptr<u32> ptr); using CellRudpAllocatorFuncFree = func_def<u32(vm::ptr<u32> ptr)>;
struct CellRudpAllocator struct CellRudpAllocator
{ {
vm::ptr<CellRudpAllocatorFuncAlloc> app_malloc; vm::bptr<CellRudpAllocatorFuncAlloc> app_malloc;
vm::ptr<CellRudpAllocatorFuncFree> app_free; vm::bptr<CellRudpAllocatorFuncFree> app_free;
}; };

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
namespace vm { using namespace ps3; }
// Error Codes // Error Codes
enum enum
{ {

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
namespace vm { using namespace ps3; }
// Return codes // Return codes
enum enum
{ {

View File

@ -1,3 +1,7 @@
#pragma once
namespace vm { using namespace ps3; }
// Return Codes // Return Codes
enum enum
{ {
@ -11,7 +15,7 @@ enum
struct CellScreenShotSetParam struct CellScreenShotSetParam
{ {
const char *photo_title; vm::bcptr<char> photo_title;
const char *game_title; vm::bcptr<char> game_title;
const char *game_comment; vm::bcptr<char> game_comment;
}; };

View File

@ -1,3 +1,7 @@
#pragma once
namespace vm { using namespace ps3; }
// Error Codes // Error Codes
enum enum
{ {
@ -162,7 +166,7 @@ enum CellSearchEvent
CELL_SEARCH_EVENT_SCENESEARCH_RESULT, CELL_SEARCH_EVENT_SCENESEARCH_RESULT,
}; };
typedef void(CellSearchSystemCallback)(CellSearchEvent event, s32 result, vm::ptr<const u32> param, vm::ptr<u32> userData); using CellSearchSystemCallback = func_def<void(CellSearchEvent event, s32 result, vm::cptr<u32> param, vm::ptr<u32> userData)>;
struct CellSearchContentId struct CellSearchContentId
{ {

View File

@ -17,7 +17,6 @@
#include "Emu/SysCalls/lv2/sys_process.h" #include "Emu/SysCalls/lv2/sys_process.h"
#include "Emu/SysCalls/lv2/sys_semaphore.h" #include "Emu/SysCalls/lv2/sys_semaphore.h"
#include "Emu/SysCalls/lv2/sys_event.h" #include "Emu/SysCalls/lv2/sys_event.h"
#include "Emu/Cell/SPURSManager.h"
#include "sysPrxForUser.h" #include "sysPrxForUser.h"
#include "cellSpurs.h" #include "cellSpurs.h"
@ -111,7 +110,7 @@ s32 spursInit(
u32 sem; u32 sem;
for (u32 i = 0; i < 0x10; i++) for (u32 i = 0; i < 0x10; i++)
{ {
sem = Emu.GetIdManager().make<lv2_sema_t>(0, 1, SYS_SYNC_PRIORITY, *(u64*)"_spuWkl"); sem = Emu.GetIdManager().make<lv2_sema_t>(SYS_SYNC_PRIORITY, 1, *(u64*)"_spuWkl", 0);
assert(sem && ~sem); // should rollback if semaphore creation failed and return the error assert(sem && ~sem); // should rollback if semaphore creation failed and return the error
spurs->m.wklF1[i].sem = sem; spurs->m.wklF1[i].sem = sem;
} }
@ -119,12 +118,12 @@ s32 spursInit(
{ {
for (u32 i = 0; i < 0x10; i++) for (u32 i = 0; i < 0x10; i++)
{ {
sem = Emu.GetIdManager().make<lv2_sema_t>(0, 1, SYS_SYNC_PRIORITY, *(u64*)"_spuWkl"); sem = Emu.GetIdManager().make<lv2_sema_t>(SYS_SYNC_PRIORITY, 1, *(u64*)"_spuWkl", 0);
assert(sem && ~sem); assert(sem && ~sem);
spurs->m.wklF2[i].sem = sem; spurs->m.wklF2[i].sem = sem;
} }
} }
sem = Emu.GetIdManager().make<lv2_sema_t>(0, 1, SYS_SYNC_PRIORITY, *(u64*)"_spuPrv"); sem = Emu.GetIdManager().make<lv2_sema_t>(SYS_SYNC_PRIORITY, 1, *(u64*)"_spuPrv", 0);
assert(sem && ~sem); assert(sem && ~sem);
spurs->m.semPrv = sem; spurs->m.semPrv = sem;
spurs->m.unk11 = -1; spurs->m.unk11 = -1;
@ -1556,7 +1555,7 @@ s32 cellSpursEventFlagAttachLv2EventQueue(vm::ptr<CellSpursEventFlag> eventFlag)
if (eventFlag->m.direction == CELL_SPURS_EVENT_FLAG_ANY2ANY) if (eventFlag->m.direction == CELL_SPURS_EVENT_FLAG_ANY2ANY)
{ {
vm::var<be_t<u32>> eventPortId; vm::var<be_t<u32>> eventPortId;
rc = sys_event_port_create(vm::ptr<u32>::make(eventPortId.addr()), SYS_EVENT_PORT_LOCAL, 0); rc = sys_event_port_create(vm::ref<u32>::make(eventPortId.addr()), SYS_EVENT_PORT_LOCAL, 0);
if (rc == CELL_OK) if (rc == CELL_OK)
{ {
rc = sys_event_port_connect_local(eventPortId.value(), eventQueueId); rc = sys_event_port_connect_local(eventPortId.value(), eventQueueId);

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
namespace vm { using namespace ps3; }
// Core return codes. // Core return codes.
enum enum
{ {
@ -292,11 +294,6 @@ struct CellSpursAttribute
be_t<u32> swlMaxSpu; // 0x40 be_t<u32> swlMaxSpu; // 0x40
be_t<u32> swlIsPreem; // 0x44 be_t<u32> swlIsPreem; // 0x44
} m; } m;
// alternative implementation
struct
{
} c;
}; };
}; };
@ -520,12 +517,6 @@ struct CellSpurs
_sub_str1 wklF2[0x10]; // 0x1200 _sub_str1 wklF2[0x10]; // 0x1200
_sub_str4 wklH2[0x10]; // 0x1A00 _sub_str4 wklH2[0x10]; // 0x1A00
} m; } m;
// alternative implementation
struct
{
SPURSManager *spurs;
} c;
}; };
force_inline atomic_be_t<u8>& wklState(const u32 wid) force_inline atomic_be_t<u8>& wklState(const u32 wid)
@ -614,8 +605,6 @@ struct CellSpursEventFlag
be_t<u32> eventPortId; // 0x78 be_t<u32> eventPortId; // 0x78
be_t<u32> eventQueueId; // 0x7C be_t<u32> eventQueueId; // 0x7C
} m; } m;
SPURSManagerEventFlag *eventFlag;
}; };
}; };
@ -679,8 +668,6 @@ struct CellSpursTaskset
u32 event_flag_id2; // 0x189C u32 event_flag_id2; // 0x189C
u8 unk3[0x60]; // 0x18A0 u8 unk3[0x60]; // 0x18A0
} m; } m;
SPURSManagerTaskset *taskset;
}; };
}; };

View File

@ -1,2 +1,3 @@
#pragma once #pragma once
namespace vm { using namespace ps3; }

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
namespace vm { using namespace ps3; }
// Return Codes // Return Codes
enum enum
{ {
@ -58,8 +60,8 @@ struct CellSubDisplayParam
be_t<s32> mode; be_t<s32> mode;
be_t<s32> nGroup; be_t<s32> nGroup;
be_t<s32> nPeer; be_t<s32> nPeer;
vm::ptr<CellSubDisplayVideoParam> videoParam; vm::bptr<CellSubDisplayVideoParam> videoParam;
vm::ptr<CellSubDisplayAudioParam> audioParam; vm::bptr<CellSubDisplayAudioParam> audioParam;
}; };
struct CellSubDisplayPSPId struct CellSubDisplayPSPId
@ -80,4 +82,4 @@ struct CellSubDisplayPeerInfo
CellSubDisplayNickname pspNickname; CellSubDisplayNickname pspNickname;
}; };
typedef void(*CellSubDisplayHandler)(s32 cbMsg, u64 cbParam, u32 *userdata); using CellSubDisplayHandler = func_def<void(s32 cbMsg, u64 cbParam, vm::ptr<void> userdata)>;

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
namespace vm { using namespace ps3; }
// Return Codes // Return Codes
enum enum
{ {

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
namespace vm { using namespace ps3; }
// Return Codes // Return Codes
enum enum
{ {

View File

@ -4,6 +4,8 @@
#include "Emu/SysCalls/ModuleManager.h" #include "Emu/SysCalls/ModuleManager.h"
#include "Emu/SysCalls/Modules.h" #include "Emu/SysCalls/Modules.h"
namespace vm { using namespace ps3; }
extern Module cellSysmodule; extern Module cellSysmodule;
enum enum

View File

@ -10,12 +10,13 @@
#include "rpcs3/Ini.h" #include "rpcs3/Ini.h"
#include "Emu/FS/vfsFile.h" #include "Emu/FS/vfsFile.h"
#include "Loader/PSF.h" #include "Loader/PSF.h"
#include "Emu/Audio/sysutil_audio.h"
#include "Emu/RSX/sysutil_video.h" #include "Emu/RSX/sysutil_video.h"
#include "Emu/RSX/GSManager.h" #include "Emu/RSX/GSManager.h"
#include "Emu/Audio/AudioManager.h" #include "Emu/Audio/AudioManager.h"
#include "Emu/FS/VFS.h" #include "Emu/FS/VFS.h"
#include "cellMsgDialog.h" #include "cellMsgDialog.h"
#include "cellAudioIn.h"
#include "cellAudioOut.h"
#include "cellSysutil.h" #include "cellSysutil.h"
extern Module cellSysutil; extern Module cellSysutil;
@ -479,21 +480,21 @@ int cellAudioOutGetState(u32 audioOut, u32 deviceIndex, vm::ptr<CellAudioOutStat
switch(audioOut) switch(audioOut)
{ {
case CELL_AUDIO_OUT_PRIMARY: case CELL_AUDIO_OUT_PRIMARY:
state->state = Emu.GetAudioManager().GetState(); state->state = CELL_AUDIO_OUT_OUTPUT_STATE_ENABLED;
state->encoder = Emu.GetAudioManager().GetInfo().mode.encoder; state->encoder = CELL_AUDIO_OUT_CODING_TYPE_LPCM;
state->downMixer = Emu.GetAudioManager().GetInfo().mode.downMixer; state->downMixer = CELL_AUDIO_OUT_DOWNMIXER_NONE;
state->soundMode.type = Emu.GetAudioManager().GetInfo().mode.type; state->soundMode.type = CELL_AUDIO_OUT_CODING_TYPE_LPCM;
state->soundMode.channel = Emu.GetAudioManager().GetInfo().mode.channel; state->soundMode.channel = CELL_AUDIO_OUT_CHNUM_8;
state->soundMode.fs = Emu.GetAudioManager().GetInfo().mode.fs; state->soundMode.fs = CELL_AUDIO_OUT_FS_48KHZ;
state->soundMode.reserved = 0; state->soundMode.reserved = 0;
state->soundMode.layout = Emu.GetAudioManager().GetInfo().mode.layout; state->soundMode.layout = CELL_AUDIO_OUT_SPEAKER_LAYOUT_8CH_LREClrxy;
return CELL_AUDIO_OUT_SUCCEEDED; return CELL_OK;
case CELL_AUDIO_OUT_SECONDARY: case CELL_AUDIO_OUT_SECONDARY:
state->state = CELL_AUDIO_OUT_OUTPUT_STATE_DISABLED; state->state = CELL_AUDIO_OUT_OUTPUT_STATE_DISABLED;
return CELL_AUDIO_OUT_SUCCEEDED; return CELL_OK;
} }
return CELL_AUDIO_OUT_ERROR_UNSUPPORTED_AUDIO_OUT; return CELL_AUDIO_OUT_ERROR_UNSUPPORTED_AUDIO_OUT;
@ -509,20 +510,20 @@ int cellAudioOutConfigure(u32 audioOut, vm::ptr<CellAudioOutConfiguration> confi
case CELL_AUDIO_OUT_PRIMARY: case CELL_AUDIO_OUT_PRIMARY:
if (config->channel) if (config->channel)
{ {
Emu.GetAudioManager().GetInfo().mode.channel = config->channel; //Emu.GetAudioManager().GetInfo().mode.channel = config->channel;
} }
Emu.GetAudioManager().GetInfo().mode.encoder = config->encoder; //Emu.GetAudioManager().GetInfo().mode.encoder = config->encoder;
if(config->downMixer) if(config->downMixer)
{ {
Emu.GetAudioManager().GetInfo().mode.downMixer = config->downMixer; //Emu.GetAudioManager().GetInfo().mode.downMixer = config->downMixer;
} }
return CELL_AUDIO_OUT_SUCCEEDED; return CELL_OK;
case CELL_AUDIO_OUT_SECONDARY: case CELL_AUDIO_OUT_SECONDARY:
return CELL_AUDIO_OUT_SUCCEEDED; return CELL_OK;
} }
return CELL_AUDIO_OUT_ERROR_UNSUPPORTED_AUDIO_OUT; return CELL_AUDIO_OUT_ERROR_UNSUPPORTED_AUDIO_OUT;
@ -538,15 +539,15 @@ int cellAudioOutGetConfiguration(u32 audioOut, vm::ptr<CellAudioOutConfiguration
switch(audioOut) switch(audioOut)
{ {
case CELL_AUDIO_OUT_PRIMARY: case CELL_AUDIO_OUT_PRIMARY:
config->channel = Emu.GetAudioManager().GetInfo().mode.channel; config->channel = CELL_AUDIO_OUT_CHNUM_8;
config->encoder = Emu.GetAudioManager().GetInfo().mode.encoder; config->encoder = CELL_AUDIO_OUT_CODING_TYPE_LPCM;
config->downMixer = Emu.GetAudioManager().GetInfo().mode.downMixer; config->downMixer = CELL_AUDIO_OUT_DOWNMIXER_NONE;
return CELL_AUDIO_OUT_SUCCEEDED; return CELL_OK;
case CELL_AUDIO_OUT_SECONDARY: case CELL_AUDIO_OUT_SECONDARY:
return CELL_AUDIO_OUT_SUCCEEDED; return CELL_OK;
} }
return CELL_AUDIO_OUT_ERROR_UNSUPPORTED_AUDIO_OUT; return CELL_AUDIO_OUT_ERROR_UNSUPPORTED_AUDIO_OUT;
@ -580,7 +581,7 @@ int cellAudioOutGetDeviceInfo(u32 audioOut, u32 deviceIndex, vm::ptr<CellAudioOu
info->availableModes[0].fs = CELL_AUDIO_OUT_FS_48KHZ; info->availableModes[0].fs = CELL_AUDIO_OUT_FS_48KHZ;
info->availableModes[0].layout = CELL_AUDIO_OUT_SPEAKER_LAYOUT_8CH_LREClrxy; info->availableModes[0].layout = CELL_AUDIO_OUT_SPEAKER_LAYOUT_8CH_LREClrxy;
return CELL_AUDIO_OUT_SUCCEEDED; return CELL_OK;
} }
int cellAudioOutSetCopyControl(u32 audioOut, u32 control) int cellAudioOutSetCopyControl(u32 audioOut, u32 control)
@ -606,7 +607,7 @@ int cellAudioOutSetCopyControl(u32 audioOut, u32 control)
default: return CELL_AUDIO_OUT_ERROR_ILLEGAL_PARAMETER; default: return CELL_AUDIO_OUT_ERROR_ILLEGAL_PARAMETER;
} }
return CELL_AUDIO_OUT_SUCCEEDED; return CELL_OK;
} }

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
namespace vm { using namespace ps3; }
enum enum
{ {
CELL_SYSUTIL_ERROR_TYPE = 0x8002b101, CELL_SYSUTIL_ERROR_TYPE = 0x8002b101,
@ -218,3 +220,39 @@ struct CellWebBrowserConfig2
be_t<float> resolution_factor; be_t<float> resolution_factor;
be_t<s32> magic_number_; be_t<s32> magic_number_;
}; };
enum CellSysutilBgmPlaybackStatusState
{
CELL_SYSUTIL_BGMPLAYBACK_STATUS_PLAY = 0,
CELL_SYSUTIL_BGMPLAYBACK_STATUS_STOP = 1
};
enum CellSysutilBgmPlaybackStatusEnabled
{
CELL_SYSUTIL_BGMPLAYBACK_STATUS_ENABLE = 0,
CELL_SYSUTIL_BGMPLAYBACK_STATUS_DISABLE = 1
};
struct CellSysutilBgmPlaybackStatus
{
u8 playerState;
u8 enableState;
char contentId[16];
u8 currentFadeRatio;
char reserved[13];
};
struct CellSysutilBgmPlaybackStatus2
{
u8 playerState;
char reserved[7];
};
struct CellSysutilBgmPlaybackExtraParam
{
be_t<s32> systemBgmFadeInTime;
be_t<s32> systemBgmFadeOutTime;
be_t<s32> gameBgmFadeInTime;
be_t<s32> gameBgmFadeOutTime;
char reserved[8];
};

View File

@ -2,6 +2,8 @@
#include "Emu/Memory/Memory.h" #include "Emu/Memory/Memory.h"
#include "Emu/SysCalls/Modules.h" #include "Emu/SysCalls/Modules.h"
namespace vm { using namespace ps3; }
extern Module cellSysutilAp; extern Module cellSysutilAp;
// Return Codes // Return Codes

View File

@ -1,3 +1,7 @@
#pragma once
namespace vm { using namespace ps3; }
// Return Codes // Return Codes
enum enum
{ {
@ -36,4 +40,4 @@ enum
USBD_HC_CC_XACT = 0x2, USBD_HC_CC_XACT = 0x2,
USBD_HC_CC_BABBLE = 0x4, USBD_HC_CC_BABBLE = 0x4,
USBD_HC_CC_DATABUF = 0x8, USBD_HC_CC_DATABUF = 0x8,
}; };

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
namespace vm { using namespace ps3; }
// Return Codes // Return Codes
enum enum
{ {

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
namespace vm { using namespace ps3; }
// Error Codes // Error Codes
enum enum
{ {

View File

@ -3,6 +3,8 @@
#include "Emu/System.h" #include "Emu/System.h"
#include "Emu/SysCalls/Modules.h" #include "Emu/SysCalls/Modules.h"
namespace vm { using namespace ps3; }
extern Module cellVoice; extern Module cellVoice;
// Error Codes // Error Codes

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
namespace vm { using namespace ps3; }
// Error Codes // Error Codes
enum enum
{ {
@ -325,4 +327,4 @@ public:
: to_rgba(rgba) : to_rgba(rgba)
{ {
} }
}; };

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
namespace vm { using namespace ps3; }
// Error Codes // Error Codes
enum enum
{ {

View File

@ -1,4 +1,7 @@
#pragma once #pragma once
namespace vm { using namespace ps3; }
#include "cellRtc.h" #include "cellRtc.h"
// Error Codes // Error Codes

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
namespace vm { using namespace ps3; }
// Return codes // Return codes
enum enum
{ {

View File

@ -1,4 +1,7 @@
#pragma once #pragma once
namespace vm { using namespace ps3; }
#include "cellRtc.h" #include "cellRtc.h"
// Return codes // Return codes

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
namespace vm { using namespace ps3; }
// Return codes // Return codes
enum enum
{ {

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
namespace vm { using namespace ps3; }
// Error codes // Error codes
enum enum
{ {

View File

@ -1,4 +1,7 @@
#pragma once #pragma once
namespace vm { using namespace ps3; }
#include "cellRtc.h" #include "cellRtc.h"
// Constants for TUS functions and structures // Constants for TUS functions and structures

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
namespace vm { using namespace ps3; }
struct HeapInfo struct HeapInfo
{ {
const std::string name; const std::string name;

View File

@ -4,6 +4,8 @@
#include "Emu/SysCalls/Modules.h" #include "Emu/SysCalls/Modules.h"
#include "Emu/Cell/PPUInstrTable.h" #include "Emu/Cell/PPUInstrTable.h"
namespace vm { using namespace ps3; }
extern Module sys_libc; extern Module sys_libc;
namespace sys_libc_func namespace sys_libc_func

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
namespace vm { using namespace ps3; }
struct sys_net_initialize_parameter struct sys_net_initialize_parameter
{ {
be_t<u32> memory_addr; be_t<u32> memory_addr;

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
namespace vm { using namespace ps3; }
//error codes //error codes
enum AudioErrorCode enum AudioErrorCode
{ {

View File

@ -4,7 +4,7 @@
#include "Utilities/AutoPause.h" #include "Utilities/AutoPause.h"
#include "Emu/Memory/Memory.h" #include "Emu/Memory/Memory.h"
#include "Emu/System.h" #include "Emu/System.h"
#include "ModuleManager.h" #include "Modules.h"
#include "lv2/sleep_queue.h" #include "lv2/sleep_queue.h"
#include "lv2/sys_lwmutex.h" #include "lv2/sys_lwmutex.h"

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
namespace vm { using namespace ps3; }
// attr_protocol (waiting scheduling policy) // attr_protocol (waiting scheduling policy)
enum enum
{ {

View File

@ -13,7 +13,7 @@
SysCallBase sys_cond("sys_cond"); SysCallBase sys_cond("sys_cond");
s32 sys_cond_create(vm::ptr<u32> cond_id, u32 mutex_id, vm::ptr<sys_cond_attribute_t> attr) s32 sys_cond_create(vm::ref<u32> cond_id, u32 mutex_id, vm::ptr<sys_cond_attribute_t> attr)
{ {
sys_cond.Warning("sys_cond_create(cond_id=*0x%x, mutex_id=0x%x, attr=*0x%x)", cond_id, mutex_id, attr); sys_cond.Warning("sys_cond_create(cond_id=*0x%x, mutex_id=0x%x, attr=*0x%x)", cond_id, mutex_id, attr);
@ -37,7 +37,7 @@ s32 sys_cond_create(vm::ptr<u32> cond_id, u32 mutex_id, vm::ptr<sys_cond_attribu
throw __FUNCTION__; throw __FUNCTION__;
} }
*cond_id = Emu.GetIdManager().make<lv2_cond_t>(mutex, attr->name_u64); cond_id = Emu.GetIdManager().make<lv2_cond_t>(mutex, attr->name_u64);
return CELL_OK; return CELL_OK;
} }

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
namespace vm { using namespace ps3; }
struct lv2_mutex_t; struct lv2_mutex_t;
struct sys_cond_attribute_t struct sys_cond_attribute_t
@ -40,7 +42,7 @@ REG_ID_TYPE(lv2_cond_t, 0x86); // SYS_COND_OBJECT
class PPUThread; class PPUThread;
// SysCalls // SysCalls
s32 sys_cond_create(vm::ptr<u32> cond_id, u32 mutex_id, vm::ptr<sys_cond_attribute_t> attr); s32 sys_cond_create(vm::ref<u32> cond_id, u32 mutex_id, vm::ptr<sys_cond_attribute_t> attr);
s32 sys_cond_destroy(u32 cond_id); s32 sys_cond_destroy(u32 cond_id);
s32 sys_cond_wait(PPUThread& CPU, u32 cond_id, u64 timeout); s32 sys_cond_wait(PPUThread& CPU, u32 cond_id, u64 timeout);
s32 sys_cond_signal(u32 cond_id); s32 sys_cond_signal(u32 cond_id);

View File

@ -13,7 +13,7 @@
SysCallBase sys_event("sys_event"); SysCallBase sys_event("sys_event");
s32 sys_event_queue_create(vm::ptr<u32> equeue_id, vm::ptr<sys_event_queue_attr> attr, u64 event_queue_key, s32 size) s32 sys_event_queue_create(vm::ref<u32> equeue_id, vm::ptr<sys_event_queue_attr> attr, u64 event_queue_key, s32 size)
{ {
sys_event.Warning("sys_event_queue_create(equeue_id=*0x%x, attr=*0x%x, event_queue_key=0x%llx, size=%d)", equeue_id, attr, event_queue_key, size); sys_event.Warning("sys_event_queue_create(equeue_id=*0x%x, attr=*0x%x, event_queue_key=0x%llx, size=%d)", equeue_id, attr, event_queue_key, size);
@ -47,7 +47,7 @@ s32 sys_event_queue_create(vm::ptr<u32> equeue_id, vm::ptr<sys_event_queue_attr>
return CELL_EEXIST; return CELL_EEXIST;
} }
*equeue_id = Emu.GetIdManager().add(std::move(queue)); equeue_id = Emu.GetIdManager().add(std::move(queue));
return CELL_OK; return CELL_OK;
} }
@ -91,7 +91,7 @@ s32 sys_event_queue_destroy(u32 equeue_id, s32 mode)
return CELL_OK; return CELL_OK;
} }
s32 sys_event_queue_tryreceive(u32 equeue_id, vm::ptr<sys_event_t> event_array, s32 size, vm::ptr<u32> number) s32 sys_event_queue_tryreceive(u32 equeue_id, vm::ptr<sys_event_t> event_array, s32 size, vm::ref<u32> number)
{ {
sys_event.Log("sys_event_queue_tryreceive(equeue_id=0x%x, event_array=*0x%x, size=%d, number=*0x%x)", equeue_id, event_array, size, number); sys_event.Log("sys_event_queue_tryreceive(equeue_id=0x%x, event_array=*0x%x, size=%d, number=*0x%x)", equeue_id, event_array, size, number);
@ -124,7 +124,7 @@ s32 sys_event_queue_tryreceive(u32 equeue_id, vm::ptr<sys_event_t> event_array,
queue->events.pop_front(); queue->events.pop_front();
} }
*number = count; number = count;
return CELL_OK; return CELL_OK;
} }
@ -206,7 +206,7 @@ s32 sys_event_queue_drain(u32 equeue_id)
return CELL_OK; return CELL_OK;
} }
s32 sys_event_port_create(vm::ptr<u32> eport_id, s32 port_type, u64 name) s32 sys_event_port_create(vm::ref<u32> eport_id, s32 port_type, u64 name)
{ {
sys_event.Warning("sys_event_port_create(eport_id=*0x%x, port_type=%d, name=0x%llx)", eport_id, port_type, name); sys_event.Warning("sys_event_port_create(eport_id=*0x%x, port_type=%d, name=0x%llx)", eport_id, port_type, name);
@ -216,7 +216,7 @@ s32 sys_event_port_create(vm::ptr<u32> eport_id, s32 port_type, u64 name)
return CELL_EINVAL; return CELL_EINVAL;
} }
*eport_id = Emu.GetIdManager().make<lv2_event_port_t>(port_type, name); eport_id = Emu.GetIdManager().make<lv2_event_port_t>(port_type, name);
return CELL_OK; return CELL_OK;
} }

Some files were not shown because too many files have changed in this diff Show More