Merge pull request #1161 from Nekotekina/master

Various changes
This commit is contained in:
Hykem 2015-08-02 16:54:27 +01:00
commit 0541371a0e
210 changed files with 9981 additions and 7048 deletions

View file

@ -7,7 +7,7 @@
#define noexcept _NOEXCEPT_OP
#endif
#if defined(_MSC_VER)
#if defined(_MSC_VER) && _MSC_VER <= 1800
#define thread_local __declspec(thread)
#elif __APPLE__
#define thread_local __thread

View file

@ -1,85 +0,0 @@
#include "stdafx.h"
#include "Utilities/SSemaphore.h"
#include "Emu/System.h"
void SSemaphore::wait()
{
u32 order;
{
std::lock_guard<std::mutex> lock(m_mutex);
if (m_count && m_out_order == m_in_order)
{
m_count--;
return;
}
order = m_in_order++;
}
std::unique_lock<std::mutex> cv_lock(m_cv_mutex);
while (true)
{
CHECK_EMU_STATUS;
m_cond.wait_for(cv_lock, std::chrono::milliseconds(1));
{
std::lock_guard<std::mutex> lock(m_mutex);
if (m_count)
{
if (m_out_order == order)
{
m_count--;
m_out_order++;
return;
}
else
{
m_cond.notify_one();
}
}
}
}
}
bool SSemaphore::try_wait()
{
std::lock_guard<std::mutex> lock(m_mutex);
if (m_count && m_in_order == m_out_order)
{
m_count--;
return true;
}
else
{
return false;
}
}
void SSemaphore::post()
{
std::lock_guard<std::mutex> lock(m_mutex);
if (m_count < m_max)
{
m_count++;
}
else
{
return;
}
m_cond.notify_one();
}
bool SSemaphore::post_and_wait()
{
// TODO: merge these functions? Probably has a race condition.
if (try_wait()) return false;
post();
wait();
return true;
}

View file

@ -1,41 +0,0 @@
#pragma once
class SSemaphore
{
const u32 m_max;
u32 m_count;
u32 m_in_order;
u32 m_out_order;
std::mutex m_cv_mutex;
std::mutex m_mutex;
std::condition_variable m_cond;
public:
SSemaphore(u32 value, u32 max = 1)
: m_max(max > 0 ? max : 0xffffffff)
, m_count(value > m_max ? m_max : value)
, m_in_order(0)
, m_out_order(0)
{
}
SSemaphore()
: m_max(0xffffffff)
, m_count(0)
, m_in_order(0)
, m_out_order(0)
{
}
~SSemaphore()
{
}
void wait();
bool try_wait();
void post();
bool post_and_wait();
};

120
Utilities/Semaphore.cpp Normal file
View file

@ -0,0 +1,120 @@
#include "stdafx.h"
#include "Utilities/Semaphore.h"
bool semaphore_t::try_wait()
{
// check m_value without interlocked op
if (m_var.load().value == 0)
{
return false;
}
// try to decrement m_value atomically
const auto old = m_var.atomic_op([](sync_var_t& var)
{
if (var.value)
{
var.value--;
}
});
// recheck atomic result
if (old.value == 0)
{
return false;
}
return true;
}
bool semaphore_t::try_post()
{
// check m_value without interlocked op
if (m_var.load().value >= max_value)
{
return false;
}
// try to increment m_value atomically
const auto old = m_var.atomic_op([&](sync_var_t& var)
{
if (var.value < max_value)
{
var.value++;
}
});
// recheck atomic result
if (old.value >= max_value)
{
return false;
}
if (old.waiters)
{
// notify waiting thread
std::lock_guard<std::mutex> lock(m_mutex);
m_cv.notify_one();
}
return true;
}
void semaphore_t::wait()
{
if (m_var.atomic_op([](sync_var_t& var) -> bool
{
if (var.value)
{
var.value--;
return true;
}
else
{
//var.waiters++;
return false;
}
}))
{
return;
}
std::unique_lock<std::mutex> lock(m_mutex);
m_var.atomic_op([](sync_var_t& var)
{
var.waiters++;
});
while (!m_var.atomic_op([](sync_var_t& var) -> bool
{
if (var.value)
{
var.value--;
var.waiters--;
return true;
}
else
{
return false;
}
}))
{
m_cv.wait(lock);
}
}
bool semaphore_t::post_and_wait()
{
// TODO: merge these functions? Probably has a race condition.
if (try_wait()) return false;
try_post();
wait();
return true;
}

37
Utilities/Semaphore.h Normal file
View file

@ -0,0 +1,37 @@
#pragma once
class semaphore_t
{
// semaphore mutex
std::mutex m_mutex;
// semaphore condition variable
std::condition_variable m_cv;
struct sync_var_t
{
u32 value; // current semaphore value
u32 waiters; // current amount of waiters
};
// current semaphore value
atomic_t<sync_var_t> m_var;
public:
// max semaphore value
const u32 max_value;
semaphore_t(u32 max_value = 1, u32 value = 0)
: m_var({ value, 0 })
, max_value(max_value)
{
}
bool try_wait();
bool try_post();
void wait();
bool post_and_wait();
};

View file

@ -109,15 +109,14 @@ enum x64_op_t : u32
X64OP_NONE,
X64OP_LOAD, // obtain and put the value into x64 register
X64OP_STORE, // take the value from x64 register or an immediate and use it
// example: add eax,[rax] -> X64OP_LOAD_ADD (add the value to x64 register)
// example: add [rax],eax -> X64OP_LOAD_ADD_STORE (this will probably never happen for MMIO registers)
X64OP_MOVS,
X64OP_STOS,
X64OP_XCHG,
X64OP_CMPXCHG,
X64OP_LOAD_AND_STORE, // lock and [mem],reg
X64OP_LOAD_OR_STORE, // TODO: lock or [mem], reg
X64OP_INC, // TODO: lock inc [mem]
X64OP_DEC, // TODO: lock dec [mem]
};
void decode_x64_reg_op(const u8* code, x64_op_t& out_op, x64_reg_t& out_reg, size_t& out_size, size_t& out_length)
@ -272,6 +271,18 @@ void decode_x64_reg_op(const u8* code, x64_op_t& out_op, x64_reg_t& out_reg, siz
switch (op2)
{
case 0x11:
{
if (!repe && !repne && !oso) // MOVUPS xmm/m, xmm
{
out_op = X64OP_STORE;
out_reg = get_modRM_reg_xmm(code, rex);
out_size = 16;
out_length += get_modRM_size(code);
return;
}
break;
}
case 0x7f:
{
if ((repe && !oso) || (!repe && oso)) // MOVDQU/MOVDQA xmm/m, xmm
@ -470,7 +481,6 @@ void decode_x64_reg_op(const u8* code, x64_op_t& out_op, x64_reg_t& out_reg, siz
}
}
LOG_WARNING(MEMORY, "decode_x64_reg_op(%016llxh): unsupported opcode found (%016llX%016llX)", (size_t)code - out_length, *(be_t<u64>*)(code - out_length), *(be_t<u64>*)(code - out_length + 8));
out_op = X64OP_NONE;
out_reg = X64_NOT_SET;
out_size = 0;
@ -789,9 +799,18 @@ bool handle_access_violation(u32 addr, bool is_writing, x64_context* context)
// decode single x64 instruction that causes memory access
decode_x64_reg_op(code, op, reg, d_size, i_size);
auto report_opcode = [=]()
{
if (op == X64OP_NONE)
{
LOG_ERROR(MEMORY, "decode_x64_reg_op(%016llxh): unsupported opcode found (%016llX%016llX)", code, *(be_t<u64>*)(code), *(be_t<u64>*)(code + 8));
}
};
if ((d_size | d_size + addr) >= 0x100000000ull)
{
LOG_ERROR(MEMORY, "Invalid d_size (0x%llx)", d_size);
report_opcode();
return false;
}
@ -801,6 +820,7 @@ bool handle_access_violation(u32 addr, bool is_writing, x64_context* context)
if ((a_size | a_size + addr) >= 0x100000000ull)
{
LOG_ERROR(MEMORY, "Invalid a_size (0x%llx)", a_size);
report_opcode();
return false;
}
@ -817,6 +837,7 @@ bool handle_access_violation(u32 addr, bool is_writing, x64_context* context)
if (a_size != 4 || !d_size || !i_size)
{
LOG_ERROR(MEMORY, "Invalid or unsupported instruction (op=%d, reg=%d, d_size=%lld, a_size=0x%llx, i_size=%lld)", op, reg, d_size, a_size, i_size);
report_opcode();
return false;
}
@ -847,6 +868,7 @@ bool handle_access_violation(u32 addr, bool is_writing, x64_context* context)
default:
{
LOG_ERROR(MEMORY, "Invalid or unsupported operation (op=%d, reg=%d, d_size=%lld, i_size=%lld)", op, reg, d_size, i_size);
report_opcode();
return false;
}
}
@ -863,6 +885,7 @@ bool handle_access_violation(u32 addr, bool is_writing, x64_context* context)
if (!d_size || !i_size)
{
LOG_ERROR(MEMORY, "Invalid or unsupported instruction (op=%d, reg=%d, d_size=%lld, a_size=0x%llx, i_size=%lld)", op, reg, d_size, a_size, i_size);
report_opcode();
return false;
}
@ -1074,6 +1097,7 @@ bool handle_access_violation(u32 addr, bool is_writing, x64_context* context)
default:
{
LOG_ERROR(MEMORY, "Invalid or unsupported operation (op=%d, reg=%d, d_size=%lld, a_size=0x%llx, i_size=%lld)", op, reg, d_size, a_size, i_size);
report_opcode();
return false;
}
}

View file

@ -298,16 +298,16 @@ struct cast_armv7_gpr<s32, false>
};
template<>
struct cast_armv7_gpr<bool, false>
struct cast_armv7_gpr<b8, false>
{
force_inline static u32 to_gpr(const bool& value)
force_inline static u32 to_gpr(const b8& value)
{
return value;
}
force_inline static bool from_gpr(const u32& reg)
force_inline static b8 from_gpr(const u32& reg)
{
return reinterpret_cast<const bool&>(reg);
return reg != 0;
}
};

View file

@ -14,7 +14,7 @@ s32 sceDbgSetBreakOnErrorState(SceDbgBreakOnErrorState state)
throw EXCEPTION("");
}
s32 sceDbgAssertionHandler(vm::cptr<char> pFile, s32 line, bool stop, vm::cptr<char> pComponent, vm::cptr<char> pMessage, armv7_va_args_t va_args)
s32 sceDbgAssertionHandler(vm::cptr<char> pFile, s32 line, b8 stop, vm::cptr<char> pComponent, vm::cptr<char> pMessage, armv7_va_args_t va_args)
{
throw EXCEPTION("");
}

View file

@ -1,5 +1,5 @@
#pragma once
using SceKernelDeci4pCallback = func_def<s32(s32 notifyId, s32 notifyCount, s32 notifyArg, vm::ptr<void> pCommon)>;
using SceKernelDeci4pCallback = s32(s32 notifyId, s32 notifyCount, s32 notifyArg, vm::ptr<void> pCommon);
extern psv_log_base sceDeci4p;

View file

@ -1,6 +1,6 @@
#pragma once
using SceFiberEntry = func_def<void(u32 argOnInitialize, u32 argOnRun)>;
using SceFiberEntry = void(u32 argOnInitialize, u32 argOnRun);
struct set_alignment(8) SceFiber
{

View file

@ -14,7 +14,7 @@ void sceFiosTerminate()
throw EXCEPTION("");
}
bool sceFiosIsInitialized(vm::ptr<SceFiosParams> pOutParameters)
b8 sceFiosIsInitialized(vm::ptr<SceFiosParams> pOutParameters)
{
throw EXCEPTION("");
}
@ -29,7 +29,7 @@ void sceFiosSetGlobalDefaultOpAttr(vm::cptr<SceFiosOpAttr> pAttr)
throw EXCEPTION("");
}
bool sceFiosGetGlobalDefaultOpAttr(vm::ptr<SceFiosOpAttr> pOutAttr)
b8 sceFiosGetGlobalDefaultOpAttr(vm::ptr<SceFiosOpAttr> pOutAttr)
{
throw EXCEPTION("");
}
@ -39,7 +39,7 @@ void sceFiosSetThreadDefaultOpAttr(vm::cptr<SceFiosOpAttr> pAttr)
throw EXCEPTION("");
}
bool sceFiosGetThreadDefaultOpAttr(vm::ptr<SceFiosOpAttr> pOutAttr)
b8 sceFiosGetThreadDefaultOpAttr(vm::ptr<SceFiosOpAttr> pOutAttr)
{
throw EXCEPTION("");
}
@ -59,7 +59,7 @@ u32 sceFiosGetSuspendCount()
throw EXCEPTION("");
}
bool sceFiosIsSuspended()
b8 sceFiosIsSuspended()
{
throw EXCEPTION("");
}
@ -84,7 +84,7 @@ void sceFiosCloseAllFiles()
throw EXCEPTION("");
}
bool sceFiosIsIdle()
b8 sceFiosIsIdle()
{
throw EXCEPTION("");
}
@ -104,7 +104,7 @@ u32 sceFiosGetAllOps(vm::ptr<s32> pOutArray, u32 arraySize)
throw EXCEPTION("");
}
bool sceFiosIsValidHandle(s32 h)
b8 sceFiosIsValidHandle(s32 h)
{
throw EXCEPTION("");
}
@ -129,12 +129,12 @@ s32 sceFiosVprintf(vm::cptr<char> pFormat) // va_list
throw EXCEPTION("");
}
s32 sceFiosFileExists(vm::cptr<SceFiosOpAttr> pAttr, vm::cptr<char> pPath, vm::ptr<bool> pOutExists)
s32 sceFiosFileExists(vm::cptr<SceFiosOpAttr> pAttr, vm::cptr<char> pPath, vm::ptr<b8> pOutExists)
{
throw EXCEPTION("");
}
bool sceFiosFileExistsSync(vm::cptr<SceFiosOpAttr> pAttr, vm::cptr<char> pPath)
b8 sceFiosFileExistsSync(vm::cptr<SceFiosOpAttr> pAttr, vm::cptr<char> pPath)
{
throw EXCEPTION("");
}
@ -159,12 +159,12 @@ s32 sceFiosFileDeleteSync(vm::cptr<SceFiosOpAttr> pAttr, vm::cptr<char> pPath)
throw EXCEPTION("");
}
s32 sceFiosDirectoryExists(vm::cptr<SceFiosOpAttr> pAttr, vm::cptr<char> pPath, vm::ptr<bool> pOutExists)
s32 sceFiosDirectoryExists(vm::cptr<SceFiosOpAttr> pAttr, vm::cptr<char> pPath, vm::ptr<b8> pOutExists)
{
throw EXCEPTION("");
}
bool sceFiosDirectoryExistsSync(vm::cptr<SceFiosOpAttr> pAttr, vm::cptr<char> pPath)
b8 sceFiosDirectoryExistsSync(vm::cptr<SceFiosOpAttr> pAttr, vm::cptr<char> pPath)
{
throw EXCEPTION("");
}
@ -189,12 +189,12 @@ s32 sceFiosDirectoryDeleteSync(vm::cptr<SceFiosOpAttr> pAttr, vm::cptr<char> pPa
throw EXCEPTION("");
}
s32 sceFiosExists(vm::cptr<SceFiosOpAttr> pAttr, vm::cptr<char> pPath, vm::ptr<bool> pOutExists)
s32 sceFiosExists(vm::cptr<SceFiosOpAttr> pAttr, vm::cptr<char> pPath, vm::ptr<b8> pOutExists)
{
throw EXCEPTION("");
}
bool sceFiosExistsSync(vm::cptr<SceFiosOpAttr> pAttr, vm::cptr<char> pPath)
b8 sceFiosExistsSync(vm::cptr<SceFiosOpAttr> pAttr, vm::cptr<char> pPath)
{
throw EXCEPTION("");
}
@ -459,7 +459,7 @@ vm::cptr<char> sceFiosDHGetPath(s32 dh)
throw EXCEPTION("");
}
bool sceFiosOpIsDone(s32 op)
b8 sceFiosOpIsDone(s32 op)
{
throw EXCEPTION("");
}
@ -499,7 +499,7 @@ void sceFiosOpCancel(s32 op)
throw EXCEPTION("");
}
bool sceFiosOpIsCancelled(s32 op)
b8 sceFiosOpIsCancelled(s32 op)
{
throw EXCEPTION("");
}

View file

@ -1,8 +1,8 @@
#pragma once
using SceFiosOpCallback = func_def<s32(vm::ptr<void> pContext, s32 op, u8 event, s32 err)>;
using SceFiosVprintfCallback = func_def<s32(vm::cptr<char> fmt, va_list ap)>;
using SceFiosMemcpyCallback = func_def<vm::ptr<void>(vm::ptr<void> dst, vm::cptr<void> src, u32 len)>;
using SceFiosOpCallback = s32(vm::ptr<void> pContext, s32 op, u8 event, s32 err);
using SceFiosVprintfCallback = s32(vm::cptr<char> fmt, va_list ap);
using SceFiosMemcpyCallback = vm::ptr<void>(vm::ptr<void> dst, vm::cptr<void> src, u32 len);
enum SceFiosWhence : s32
{
@ -100,7 +100,7 @@ struct SceFiosOverlay
char src[292];
};
using SceFiosIOFilterCallback = func_def<void()>;
using SceFiosIOFilterCallback = void();
struct SceFiosPsarcDearchiverContext
{

View file

@ -85,7 +85,7 @@ s32 sceGxmDestroyContext(vm::ptr<SceGxmContext> context)
throw EXCEPTION("");
}
void sceGxmSetValidationEnable(vm::ptr<SceGxmContext> context, bool enable)
void sceGxmSetValidationEnable(vm::ptr<SceGxmContext> context, b8 enable)
{
throw EXCEPTION("");
}
@ -388,7 +388,7 @@ s32 sceGxmColorSurfaceInitDisabled(vm::ptr<SceGxmColorSurface> surface)
throw EXCEPTION("");
}
bool sceGxmColorSurfaceIsEnabled(vm::cptr<SceGxmColorSurface> surface)
b8 sceGxmColorSurfaceIsEnabled(vm::cptr<SceGxmColorSurface> surface)
{
throw EXCEPTION("");
}
@ -473,7 +473,7 @@ void sceGxmDepthStencilSurfaceSetBackgroundStencil(vm::ptr<SceGxmDepthStencilSur
throw EXCEPTION("");
}
bool sceGxmDepthStencilSurfaceIsEnabled(vm::cptr<SceGxmDepthStencilSurface> surface)
b8 sceGxmDepthStencilSurfaceIsEnabled(vm::cptr<SceGxmDepthStencilSurface> surface)
{
throw EXCEPTION("");
}
@ -544,17 +544,17 @@ SceGxmProgramType sceGxmProgramGetType(vm::cptr<SceGxmProgram> program)
throw EXCEPTION("");
}
bool sceGxmProgramIsDiscardUsed(vm::cptr<SceGxmProgram> program)
b8 sceGxmProgramIsDiscardUsed(vm::cptr<SceGxmProgram> program)
{
throw EXCEPTION("");
}
bool sceGxmProgramIsDepthReplaceUsed(vm::cptr<SceGxmProgram> program)
b8 sceGxmProgramIsDepthReplaceUsed(vm::cptr<SceGxmProgram> program)
{
throw EXCEPTION("");
}
bool sceGxmProgramIsSpriteCoordUsed(vm::cptr<SceGxmProgram> program)
b8 sceGxmProgramIsSpriteCoordUsed(vm::cptr<SceGxmProgram> program)
{
throw EXCEPTION("");
}
@ -634,7 +634,7 @@ u32 sceGxmProgramParameterGetContainerIndex(vm::cptr<SceGxmProgramParameter> par
throw EXCEPTION("");
}
bool sceGxmProgramParameterIsSamplerCube(vm::cptr<SceGxmProgramParameter> parameter)
b8 sceGxmProgramParameterIsSamplerCube(vm::cptr<SceGxmProgramParameter> parameter)
{
throw EXCEPTION("");
}

View file

@ -29,7 +29,7 @@ enum
SCE_GXM_ERROR_DRIVER = 0x805B0017,
};
using SceGxmDisplayQueueCallback = func_def<void(vm::cptr<void> callbackData)>;
using SceGxmDisplayQueueCallback = void(vm::cptr<void> callbackData);
struct SceGxmInitializeParams
{
@ -1193,12 +1193,12 @@ struct SceGxmShaderPatcher;
struct SceGxmRegisteredProgram;
using SceGxmShaderPatcherHostAllocCallback = func_def<vm::ptr<void>(vm::ptr<void> userData, u32 size)>;
using SceGxmShaderPatcherHostFreeCallback = func_def<void(vm::ptr<void> userData, vm::ptr<void> mem)>;
using SceGxmShaderPatcherBufferAllocCallback = func_def<vm::ptr<void>(vm::ptr<void> userData, u32 size)>;
using SceGxmShaderPatcherBufferFreeCallback = func_def<void(vm::ptr<void> userData, vm::ptr<void> mem)>;
using SceGxmShaderPatcherUsseAllocCallback = func_def<vm::ptr<void>(vm::ptr<void> userData, u32 size, vm::ptr<u32> usseOffset)>;
using SceGxmShaderPatcherUsseFreeCallback = func_def<void(vm::ptr<void> userData, vm::ptr<void> mem)>;
using SceGxmShaderPatcherHostAllocCallback = vm::ptr<void>(vm::ptr<void> userData, u32 size);
using SceGxmShaderPatcherHostFreeCallback = void(vm::ptr<void> userData, vm::ptr<void> mem);
using SceGxmShaderPatcherBufferAllocCallback = vm::ptr<void>(vm::ptr<void> userData, u32 size);
using SceGxmShaderPatcherBufferFreeCallback = void(vm::ptr<void> userData, vm::ptr<void> mem);
using SceGxmShaderPatcherUsseAllocCallback = vm::ptr<void>(vm::ptr<void> userData, u32 size, vm::ptr<u32> usseOffset);
using SceGxmShaderPatcherUsseFreeCallback = void(vm::ptr<void> userData, vm::ptr<void> mem);
struct SceGxmShaderPatcherParams
{

View file

@ -29,8 +29,8 @@ enum SceHttpAuthType : s32
SCE_HTTP_AUTH_RESERVED2
};
using SceHttpAuthInfoCallback = func_def<s32(s32 request, SceHttpAuthType authType, vm::cptr<char> realm, vm::ptr<char> username, vm::ptr<char> password, s32 needEntity, vm::pptr<u8> entityBody, vm::ptr<u32> entitySize, vm::ptr<s32> save, vm::ptr<void> userArg)>;
using SceHttpRedirectCallback = func_def<s32(s32 request, s32 statusCode, vm::ptr<s32> method, vm::cptr<char> location, vm::ptr<void> userArg)>;
using SceHttpAuthInfoCallback = s32(s32 request, SceHttpAuthType authType, vm::cptr<char> realm, vm::ptr<char> username, vm::ptr<char> password, s32 needEntity, vm::pptr<u8> entityBody, vm::ptr<u32> entitySize, vm::ptr<s32> save, vm::ptr<void> userArg);
using SceHttpRedirectCallback = s32(s32 request, s32 statusCode, vm::ptr<s32> method, vm::cptr<char> location, vm::ptr<void> userArg);
struct SceHttpMemoryPoolStats
{
@ -54,8 +54,8 @@ struct SceHttpUriElement
u8 reserved[10];
};
using SceHttpCookieRecvCallback = func_def<s32(s32 request, vm::cptr<char> url, vm::cptr<char> cookieHeader, u32 headerLen, vm::ptr<void> userArg)>;
using SceHttpCookieSendCallback = func_def<s32(s32 request, vm::cptr<char> url, vm::cptr<char> cookieHeader, vm::ptr<void> userArg)>;
using SceHttpCookieRecvCallback = s32(s32 request, vm::cptr<char> url, vm::cptr<char> cookieHeader, u32 headerLen, vm::ptr<void> userArg);
using SceHttpCookieSendCallback = s32(s32 request, vm::cptr<char> url, vm::cptr<char> cookieHeader, vm::ptr<void> userArg);
struct SceHttpsData
{
@ -69,6 +69,6 @@ struct SceHttpsCaList
le_t<s32> caNum;
};
using SceHttpsCallback = func_def<s32(u32 verifyEsrr, vm::cptr<vm::ptr<SceSslCert>> sslCert, s32 certNum, vm::ptr<void> userArg)>;
using SceHttpsCallback = s32(u32 verifyEsrr, vm::cptr<vm::ptr<SceSslCert>> sslCert, s32 certNum, vm::ptr<void> userArg);
extern psv_log_base sceHttp;

View file

@ -1,6 +1,6 @@
#pragma once
using SceImeCharFilter = func_def<s32(u16 ch)>;
using SceImeCharFilter = s32(u16 ch);
struct SceImeRect
{
@ -46,7 +46,7 @@ struct SceImePreeditGeometry
le_t<u32> height;
};
using SceImeEventHandler = func_def<void(vm::ptr<void> arg, vm::cptr<SceImeEvent> e)>;
using SceImeEventHandler = void(vm::ptr<void> arg, vm::cptr<SceImeEvent> e);
struct SceImeParam
{

View file

@ -305,7 +305,7 @@ struct SceKernelAllocMemBlockOpt
// Thread Manager definitions (threads)
using SceKernelThreadEntry = func_def<s32(u32 argSize, vm::ptr<void> pArgBlock)>;
using SceKernelThreadEntry = s32(u32 argSize, vm::ptr<void> pArgBlock);
struct SceKernelThreadOptParam
{
@ -370,7 +370,7 @@ struct SceKernelSystemInfo
// Thread Manager definitions (callbacks)
using SceKernelCallbackFunction = func_def<s32(s32 notifyId, s32 notifyCount, s32 notifyArg, vm::ptr<void> pCommon)>;
using SceKernelCallbackFunction = s32(s32 notifyId, s32 notifyCount, s32 notifyArg, vm::ptr<void> pCommon);
struct SceKernelCallbackInfo
{
@ -388,7 +388,7 @@ struct SceKernelCallbackInfo
// Thread Manager definitions (events)
using SceKernelThreadEventHandler = func_def<s32(s32 type, s32 threadId, s32 arg, vm::ptr<void> pCommon)>;
using SceKernelThreadEventHandler = s32(s32 type, s32 threadId, s32 arg, vm::ptr<void> pCommon);
struct SceKernelEventInfo
{

View file

@ -1,5 +1,5 @@
#pragma once
using atexit_func_t = func_def<void(vm::ptr<void>)>;
using atexit_func_t = void(vm::ptr<void>);
extern psv_log_base sceLibc;

View file

@ -70,8 +70,8 @@ struct SceLocationHeadingInfo
le_t<u64> timestamp;
};
using SceLocationLocationInfoCallback = func_def<void(s32 result, u8 handle, vm::cptr<SceLocationLocationInfo> location, vm::ptr<void> userdata)>;
using SceLocationHeadingInfoCallback = func_def<void(s32 result, u8 handle, vm::cptr<SceLocationHeadingInfo> heading, vm::ptr<void> userdata)>;
using SceLocationLocationInfoCallback = void(s32 result, u8 handle, vm::cptr<SceLocationLocationInfo> location, vm::ptr<void> userdata);
using SceLocationHeadingInfoCallback = void(s32 result, u8 handle, vm::cptr<SceLocationHeadingInfo> heading, vm::ptr<void> userdata);
struct SceLocationPermissionInfo
{

View file

@ -115,8 +115,8 @@ struct SceNetEmulationParam
u8 reserved[44];
};
using SceNetResolverFunctionAllocate = func_def<vm::ptr<void>(u32 size, s32 rid, vm::cptr<char> name, vm::ptr<void> user)>;
using SceNetResolverFunctionFree = func_def<void(vm::ptr<void> ptr, s32 rid, vm::cptr<char> name, vm::ptr<void> user)>;
using SceNetResolverFunctionAllocate = vm::ptr<void>(u32 size, s32 rid, vm::cptr<char> name, vm::ptr<void> user);
using SceNetResolverFunctionFree = void(vm::ptr<void> ptr, s32 rid, vm::cptr<char> name, vm::ptr<void> user);
struct SceNetResolverParam
{

View file

@ -42,6 +42,6 @@ struct SceNetCtlAdhocPeerInfo
SceNetInAddr inet_addr;
};
using SceNetCtlCallback = func_def<void(s32 event_type, vm::ptr<void> arg)>;
using SceNetCtlCallback = void(s32 event_type, vm::ptr<void> arg);
extern psv_log_base sceNetCtl;

View file

@ -95,7 +95,7 @@ struct SceNgsCallbackInfo
vm::lptr<void> pUserData;
};
using SceNgsCallbackFunc = func_def<void(vm::cptr<SceNgsCallbackInfo> pCallbackInfo)>;
using SceNgsCallbackFunc = void(vm::cptr<SceNgsCallbackInfo> pCallbackInfo);
struct SceSulphaNgsConfig
{

View file

@ -10,7 +10,7 @@ enum SceNpBasicFriendListEventType : s32
SCE_NP_BASIC_FRIEND_LIST_EVENT_TYPE_DELETED = 4
};
using SceNpBasicFriendListEventHandler = func_def<void(SceNpBasicFriendListEventType eventType, vm::cptr<SceNpId> friendId, vm::ptr<void> userdata)>;
using SceNpBasicFriendListEventHandler = void(SceNpBasicFriendListEventType eventType, vm::cptr<SceNpId> friendId, vm::ptr<void> userdata);
enum SceNpBasicFriendOnlineStatusEventType : s32
{
@ -28,7 +28,7 @@ enum SceNpBasicFriendOnlineStatus : s32
SCE_NP_BASIC_FRIEND_ONLINE_STATUS_ONLINE_IN_CONTEXT = 4
};
using SceNpBasicFriendOnlineStatusEventHandler = func_def<void(SceNpBasicFriendOnlineStatusEventType eventType, vm::cptr<SceNpId> friendId, SceNpBasicFriendOnlineStatus status, vm::ptr<void> userdata)>;
using SceNpBasicFriendOnlineStatusEventHandler = void(SceNpBasicFriendOnlineStatusEventType eventType, vm::cptr<SceNpId> friendId, SceNpBasicFriendOnlineStatus status, vm::ptr<void> userdata);
enum SceNpBasicBlockListEventType : s32
{
@ -38,7 +38,7 @@ enum SceNpBasicBlockListEventType : s32
SCE_NP_BASIC_BLOCK_LIST_EVENT_TYPE_DELETED = 4
};
using SceNpBasicBlockListEventHandler = func_def<void(SceNpBasicBlockListEventType eventType, vm::cptr<SceNpId> playerId, vm::ptr<void> userdata)>;
using SceNpBasicBlockListEventHandler = void(SceNpBasicBlockListEventType eventType, vm::cptr<SceNpId> playerId, vm::ptr<void> userdata);
enum SceNpBasicFriendGamePresenceEventType : s32
{
@ -72,7 +72,7 @@ struct SceNpBasicGamePresence
SceNpBasicInGamePresence inGamePresence;
};
using SceNpBasicFriendGamePresenceEventHandler = func_def<void(SceNpBasicFriendGamePresenceEventType eventtype, vm::cptr<SceNpId> friendId, vm::cptr<SceNpBasicGamePresence> presence, vm::ptr<void> userdata)>;
using SceNpBasicFriendGamePresenceEventHandler = void(SceNpBasicFriendGamePresenceEventType eventtype, vm::cptr<SceNpId> friendId, vm::cptr<SceNpBasicGamePresence> presence, vm::ptr<void> userdata);
struct SceNpBasicInGameDataMessage
{
@ -80,7 +80,7 @@ struct SceNpBasicInGameDataMessage
le_t<u32> dataSize;
};
using SceNpBasicInGameDataMessageEventHandler = func_def<void(vm::cptr<SceNpId> from, vm::cptr<SceNpBasicInGameDataMessage> message, vm::ptr<void> userdata)>;
using SceNpBasicInGameDataMessageEventHandler = void(vm::cptr<SceNpId> from, vm::cptr<SceNpBasicInGameDataMessage> message, vm::ptr<void> userdata);
struct SceNpBasicEventHandlers
{

View file

@ -117,7 +117,7 @@ struct SceNpTicketVersion
le_t<u16> minor;
};
using SceNpAuthCallback = func_def<s32(s32 id, s32 result, vm::ptr<void> arg)>;
using SceNpAuthCallback = s32(s32 id, s32 result, vm::ptr<void> arg);
struct SceNpAuthRequestParameter
{

View file

@ -7,6 +7,6 @@ struct SceNpOptParam
le_t<u32> optParamSize;
};
using SceNpServiceStateCallback = func_def<void(SceNpServiceState state, vm::ptr<void> userdata)>;
using SceNpServiceStateCallback = void(SceNpServiceState state, vm::ptr<void> userdata);
extern psv_log_base sceNpManager;

View file

@ -109,7 +109,7 @@ struct SceNpMatching2World
le_t<u32> curNumOfTotalLobbyMember;
le_t<u32> curNumOfRoom;
le_t<u32> curNumOfTotalRoomMember;
bool withEntitlementId;
b8 withEntitlementId;
SceNpEntitlementId entitlementId;
u8 padding[3];
};
@ -214,9 +214,9 @@ struct SceNpMatching2GroupLabel
struct SceNpMatching2RoomGroupConfig
{
le_t<u32> slotNum;
bool withLabel;
b8 withLabel;
SceNpMatching2GroupLabel label;
bool withPassword;
b8 withPassword;
u8 padding[2];
};
@ -224,7 +224,7 @@ struct SceNpMatching2RoomGroupConfig
struct SceNpMatching2RoomGroupPasswordConfig
{
u8 groupId;
bool withPassword;
b8 withPassword;
u8 padding[1];
};
@ -240,8 +240,8 @@ struct SceNpMatching2RoomMemberBinAttrInternal
struct SceNpMatching2RoomGroup
{
u8 groupId;
bool withPassword;
bool withLabel;
b8 withPassword;
b8 withLabel;
u8 padding[1];
SceNpMatching2GroupLabel label;
le_t<u32> slotNum;
@ -382,13 +382,13 @@ struct SceNpMatching2InvitationData
le_t<u32> optDataLen;
};
using SceNpMatching2RequestCallback = func_def<void(u16 ctxId, u32 reqId, u16 event, s32 errorCode, vm::cptr<void> data, vm::ptr<void> arg)>;
using SceNpMatching2LobbyEventCallback = func_def<void(u16 ctxId, u64 lobbyId, u16 event, s32 errorCode, vm::cptr<void> data, vm::ptr<void> arg)>;
using SceNpMatching2RoomEventCallback = func_def<void(u16 ctxId, u64 roomId, u16 event, s32 errorCode, vm::cptr<void> data, vm::ptr<void> arg)>;
using SceNpMatching2LobbyMessageCallback = func_def<void(u16 ctxId, u64 lobbyId, u16 srcMemberId, u16 event, s32 errorCode, vm::cptr<void> data, vm::ptr<void> arg)>;
using SceNpMatching2RoomMessageCallback = func_def<void(u16 ctxId, u64 roomId, u16 srcMemberId, u16 event, s32 errorCode, vm::cptr<void> data, vm::ptr<void> arg)>;
using SceNpMatching2SignalingCallback = func_def<void(u16 ctxId, u64 roomId, u16 peerMemberId, u16 event, s32 errorCode, vm::ptr<void> arg)>;
using SceNpMatching2ContextCallback = func_def<void(u16 ctxId, u16 event, u8 eventCause, s32 errorCode, vm::ptr<void> arg)>;
using SceNpMatching2RequestCallback = void(u16 ctxId, u32 reqId, u16 event, s32 errorCode, vm::cptr<void> data, vm::ptr<void> arg);
using SceNpMatching2LobbyEventCallback = void(u16 ctxId, u64 lobbyId, u16 event, s32 errorCode, vm::cptr<void> data, vm::ptr<void> arg);
using SceNpMatching2RoomEventCallback = void(u16 ctxId, u64 roomId, u16 event, s32 errorCode, vm::cptr<void> data, vm::ptr<void> arg);
using SceNpMatching2LobbyMessageCallback = void(u16 ctxId, u64 lobbyId, u16 srcMemberId, u16 event, s32 errorCode, vm::cptr<void> data, vm::ptr<void> arg);
using SceNpMatching2RoomMessageCallback = void(u16 ctxId, u64 roomId, u16 srcMemberId, u16 event, s32 errorCode, vm::cptr<void> data, vm::ptr<void> arg);
using SceNpMatching2SignalingCallback = void(u16 ctxId, u64 roomId, u16 peerMemberId, u16 event, s32 errorCode, vm::ptr<void> arg);
using SceNpMatching2ContextCallback = void(u16 ctxId, u16 event, u8 eventCause, s32 errorCode, vm::ptr<void> arg);
struct SceNpMatching2RequestOptParam
{
@ -638,7 +638,7 @@ struct SceNpMatching2SendRoomChatMessageRequest
struct SceNpMatching2SendRoomChatMessageResponse
{
bool filtered;
b8 filtered;
};
@ -794,7 +794,7 @@ struct SceNpMatching2GetLobbyMemberDataInternalListRequest
le_t<u32> memberIdNum;
vm::lcptr<u16> attrId;
le_t<u32> attrIdNum;
bool extendedData;
b8 extendedData;
u8 padding[7];
};
@ -822,7 +822,7 @@ struct SceNpMatching2SendLobbyChatMessageRequest
struct SceNpMatching2SendLobbyChatMessageResponse
{
bool filtered;
b8 filtered;
};
@ -899,7 +899,7 @@ struct SceNpMatching2SignalingOptParamUpdateInfo
struct SceNpMatching2RoomMessageInfo
{
bool filtered;
b8 filtered;
u8 castType;
u8 padding[2];
vm::lptr<SceNpMatching2RoomMessageDestination> dst;
@ -942,7 +942,7 @@ struct SceNpMatching2LobbyMemberDataInternalUpdateInfo
struct SceNpMatching2LobbyMessageInfo
{
bool filtered;
b8 filtered;
u8 castType;
u8 padding[2];
vm::lptr<SceNpMatching2LobbyMessageDestination> dst;

View file

@ -9,6 +9,6 @@ struct ScePhotoExportParam
char reserved[32];
};
using ScePhotoExportCancelFunc = func_def<s32(vm::ptr<void>)>;
using ScePhotoExportCancelFunc = s32(vm::ptr<void>);
extern psv_log_base scePhotoExport;

View file

@ -14,7 +14,7 @@ void sceRazorCaptureSetTriggerNextFrame(vm::cptr<char> captureFilename)
throw EXCEPTION("");
}
bool sceRazorCaptureIsInProgress()
b8 sceRazorCaptureIsInProgress()
{
throw EXCEPTION("");
}

View file

@ -1,6 +1,6 @@
#pragma once
using SceSulphaCallback = func_def<void(vm::ptr<void> arg)>;
using SceSulphaCallback = void(vm::ptr<void> arg);
struct SceSulphaConfig
{

View file

@ -153,6 +153,6 @@ struct SceUltUlthread
CHECK_SIZE(SceUltUlthread, 256);
using SceUltUlthreadEntry = func_def<s32(u32 arg)>;
using SceUltUlthreadEntry = s32(u32 arg);
extern psv_log_base sceUlt;

View file

@ -114,7 +114,7 @@ struct SceVoicePortParam
};
};
using SceVoiceEventCallback = func_def<void(vm::ptr<void> event)>;
using SceVoiceEventCallback = void(vm::ptr<void> event);
struct SceVoiceInitParam
{

View file

@ -25,6 +25,11 @@ public:
void Init()
{
on_load = nullptr;
on_unload = nullptr;
on_stop = nullptr;
on_error = nullptr;
m_init();
}

View file

@ -2,6 +2,11 @@
#include "Utilities/Thread.h"
namespace vm
{
class waiter_lock_t;
}
enum CPUThreadType
{
CPU_THREAD_PPU,
@ -53,6 +58,8 @@ public:
using thread_t::is_current;
using thread_t::get_thread_ctrl;
friend vm::waiter_lock_t;
protected:
CPUThread(CPUThreadType type, const std::string& name, std::function<std::string()> thread_name);

View file

@ -2488,7 +2488,7 @@ void ppu_interpreter::LVLX(PPUThread& CPU, ppu_opcode_t op)
void ppu_interpreter::LDBRX(PPUThread& CPU, ppu_opcode_t op)
{
const u64 addr = op.ra ? CPU.GPR[op.ra] + CPU.GPR[op.rb] : CPU.GPR[op.rb];
CPU.GPR[op.rd] = vm::get_ref<u64>(VM_CAST(addr));
CPU.GPR[op.rd] = vm::get_ref<le_t<u64>>(VM_CAST(addr));
}
void ppu_interpreter::LSWX(PPUThread& CPU, ppu_opcode_t op)
@ -2514,7 +2514,7 @@ void ppu_interpreter::LSWX(PPUThread& CPU, ppu_opcode_t op)
void ppu_interpreter::LWBRX(PPUThread& CPU, ppu_opcode_t op)
{
const u64 addr = op.ra ? CPU.GPR[op.ra] + CPU.GPR[op.rb] : CPU.GPR[op.rb];
CPU.GPR[op.rd] = vm::get_ref<u32>(VM_CAST(addr));
CPU.GPR[op.rd] = vm::get_ref<le_t<u32>>(VM_CAST(addr));
}
void ppu_interpreter::LFSX(PPUThread& CPU, ppu_opcode_t op)
@ -2619,7 +2619,7 @@ void ppu_interpreter::STVLX(PPUThread& CPU, ppu_opcode_t op)
void ppu_interpreter::STDBRX(PPUThread& CPU, ppu_opcode_t op)
{
const u64 addr = op.ra ? CPU.GPR[op.ra] + CPU.GPR[op.rb] : CPU.GPR[op.rb];
vm::get_ref<u64>(VM_CAST(addr)) = CPU.GPR[op.rs];
vm::get_ref<le_t<u64>>(VM_CAST(addr)) = CPU.GPR[op.rs];
}
void ppu_interpreter::STSWX(PPUThread& CPU, ppu_opcode_t op)
@ -2644,7 +2644,7 @@ void ppu_interpreter::STSWX(PPUThread& CPU, ppu_opcode_t op)
void ppu_interpreter::STWBRX(PPUThread& CPU, ppu_opcode_t op)
{
const u64 addr = op.ra ? CPU.GPR[op.ra] + CPU.GPR[op.rb] : CPU.GPR[op.rb];
vm::get_ref<u32>(VM_CAST(addr)) = (u32)CPU.GPR[op.rs];
vm::get_ref<le_t<u32>>(VM_CAST(addr)) = (u32)CPU.GPR[op.rs];
}
void ppu_interpreter::STFSX(PPUThread& CPU, ppu_opcode_t op)
@ -2722,7 +2722,7 @@ void ppu_interpreter::LVLXL(PPUThread& CPU, ppu_opcode_t op)
void ppu_interpreter::LHBRX(PPUThread& CPU, ppu_opcode_t op)
{
const u64 addr = op.ra ? CPU.GPR[op.ra] + CPU.GPR[op.rb] : CPU.GPR[op.rb];
CPU.GPR[op.rd] = vm::get_ref<u16>(VM_CAST(addr));
CPU.GPR[op.rd] = vm::get_ref<le_t<u16>>(VM_CAST(addr));
}
void ppu_interpreter::SRAW(PPUThread& CPU, ppu_opcode_t op)
@ -2809,7 +2809,7 @@ void ppu_interpreter::STVLXL(PPUThread& CPU, ppu_opcode_t op)
void ppu_interpreter::STHBRX(PPUThread& CPU, ppu_opcode_t op)
{
const u64 addr = op.ra ? CPU.GPR[op.ra] + CPU.GPR[op.rb] : CPU.GPR[op.rb];
vm::get_ref<u16>(VM_CAST(addr)) = (u16)CPU.GPR[op.rs];
vm::get_ref<le_t<u16>>(VM_CAST(addr)) = (u16)CPU.GPR[op.rs];
}
void ppu_interpreter::EXTSH(PPUThread& CPU, ppu_opcode_t op)

View file

@ -3072,7 +3072,7 @@ private:
void LDBRX(u32 rd, u32 ra, u32 rb)
{
const u64 addr = ra ? CPU.GPR[ra] + CPU.GPR[rb] : CPU.GPR[rb];
CPU.GPR[rd] = vm::get_ref<u64>(VM_CAST(addr));
CPU.GPR[rd] = vm::get_ref<le_t<u64>>(VM_CAST(addr));
}
void LSWX(u32 rd, u32 ra, u32 rb)
{
@ -3096,7 +3096,7 @@ private:
void LWBRX(u32 rd, u32 ra, u32 rb)
{
const u64 addr = ra ? CPU.GPR[ra] + CPU.GPR[rb] : CPU.GPR[rb];
CPU.GPR[rd] = vm::get_ref<u32>(VM_CAST(addr));
CPU.GPR[rd] = vm::get_ref<le_t<u32>>(VM_CAST(addr));
}
void LFSX(u32 frd, u32 ra, u32 rb)
{
@ -3208,7 +3208,7 @@ private:
void STDBRX(u32 rs, u32 ra, u32 rb)
{
const u64 addr = ra ? CPU.GPR[ra] + CPU.GPR[rb] : CPU.GPR[rb];
vm::get_ref<u64>(VM_CAST(addr)) = CPU.GPR[rs];
vm::get_ref<le_t<u64>>(VM_CAST(addr)) = CPU.GPR[rs];
}
void STSWX(u32 rs, u32 ra, u32 rb)
{
@ -3231,7 +3231,7 @@ private:
void STWBRX(u32 rs, u32 ra, u32 rb)
{
const u64 addr = ra ? CPU.GPR[ra] + CPU.GPR[rb] : CPU.GPR[rb];
vm::get_ref<u32>(VM_CAST(addr)) = (u32)CPU.GPR[rs];
vm::get_ref<le_t<u32>>(VM_CAST(addr)) = (u32)CPU.GPR[rs];
}
void STFSX(u32 frs, u32 ra, u32 rb)
{
@ -3321,7 +3321,7 @@ private:
void LHBRX(u32 rd, u32 ra, u32 rb)
{
const u64 addr = ra ? CPU.GPR[ra] + CPU.GPR[rb] : CPU.GPR[rb];
CPU.GPR[rd] = vm::get_ref<u16>(VM_CAST(addr));
CPU.GPR[rd] = vm::get_ref<le_t<u16>>(VM_CAST(addr));
}
void SRAW(u32 ra, u32 rs, u32 rb, u32 rc)
{
@ -3402,7 +3402,7 @@ private:
void STHBRX(u32 rs, u32 ra, u32 rb)
{
const u64 addr = ra ? CPU.GPR[ra] + CPU.GPR[rb] : CPU.GPR[rb];
vm::get_ref<u16>(VM_CAST(addr)) = (u16)CPU.GPR[rs];
vm::get_ref<le_t<u16>>(VM_CAST(addr)) = (u16)CPU.GPR[rs];
}
void EXTSH(u32 ra, u32 rs, u32 rc)
{

View file

@ -981,16 +981,16 @@ struct cast_ppu_gpr<s64, false>
};
template<>
struct cast_ppu_gpr<bool, false>
struct cast_ppu_gpr<b8, false>
{
force_inline static u64 to_gpr(const bool& value)
force_inline static u64 to_gpr(const b8& value)
{
return value;
}
force_inline static bool from_gpr(const u64& reg)
force_inline static b8 from_gpr(const u64& reg)
{
return reinterpret_cast<const bool&>(reg);
return static_cast<u32>(reg) != 0;
}
};

View file

@ -1,11 +1,12 @@
#pragma once
#include "SPUThread.h"
enum : u32
{
RAW_SPU_OFFSET = 0x00100000,
RAW_SPU_BASE_ADDR = 0xE0000000,
RAW_SPU_LS_OFFSET = 0x00000000,
RAW_SPU_OFFSET = 0x00100000,
RAW_SPU_BASE_ADDR = 0xE0000000,
RAW_SPU_LS_OFFSET = 0x00000000,
RAW_SPU_PROB_OFFSET = 0x00040000,
};

View file

@ -33,12 +33,12 @@ template<typename T> struct _to_atomic_subtype<T, 16>
template<typename T> using atomic_subtype_t = typename _to_atomic_subtype<T>::type;
// result wrapper to deal with void result type
template<typename RT> struct atomic_op_result_t
template<typename T, typename RT, typename VT> struct atomic_op_result_t
{
RT result;
template<typename T, typename... Args> inline atomic_op_result_t(T func, Args&&... args)
: result(std::move(func(std::forward<Args>(args)...)))
template<typename... Args> inline atomic_op_result_t(T func, VT& var, Args&&... args)
: result(std::move(func(var, std::forward<Args>(args)...)))
{
}
@ -48,16 +48,53 @@ template<typename RT> struct atomic_op_result_t
}
};
// void specialization
template<> struct atomic_op_result_t<void>
// void specialization: result is the initial value of the first arg
template<typename T, typename VT> struct atomic_op_result_t<T, void, VT>
{
template<typename T, typename... Args> inline atomic_op_result_t(T func, Args&&... args)
VT result;
template<typename... Args> inline atomic_op_result_t(T func, VT& var, Args&&... args)
: result(var)
{
func(std::forward<Args>(args)...);
func(var, std::forward<Args>(args)...);
}
inline void move()
inline VT move()
{
return std::move(result);
}
};
// member function specialization
template<typename CT, typename... FArgs, typename RT, typename VT> struct atomic_op_result_t<RT(CT::*)(FArgs...), RT, VT>
{
RT result;
template<typename... Args> inline atomic_op_result_t(RT(CT::*func)(FArgs...), VT& var, Args&&... args)
: result(std::move((var.*func)(std::forward<Args>(args)...)))
{
}
inline RT move()
{
return std::move(result);
}
};
// member function void specialization
template<typename CT, typename... FArgs, typename VT> struct atomic_op_result_t<void(CT::*)(FArgs...), void, VT>
{
VT result;
template<typename... Args> inline atomic_op_result_t(void(CT::*func)(FArgs...), VT& var, Args&&... args)
: result(var)
{
(var.*func)(std::forward<Args>(args)...);
}
inline VT move()
{
return std::move(result);
}
};
@ -144,7 +181,7 @@ public:
}
// perform an atomic operation on data (callable object version, first arg is a reference to atomic type)
template<typename F, typename... Args> auto atomic_op(F func, Args&&... args) volatile -> decltype(func(std::declval<T&>(), args...))
template<typename F, typename... Args, typename RT = std::result_of_t<F(T&, Args...)>> auto atomic_op(F func, Args&&... args) volatile -> decltype(atomic_op_result_t<F, RT, T>::result)
{
while (true)
{
@ -155,19 +192,13 @@ public:
subtype _new = old;
// call atomic op for the local copy of the old value and save the return value of the function
atomic_op_result_t<std::result_of_t<F(T&, Args...)>> result(func, to_type(_new), args...);
atomic_op_result_t<F, RT, T> result(func, to_type(_new), args...);
// atomically compare value with `old`, replace with `_new` and return on success
if (sync_bool_compare_and_swap(&sub_data, old, _new)) return result.move();
}
}
// perform an atomic operation on data (member function version)
template<typename RT, typename... FArgs, typename CT, typename... Args, typename = std::enable_if_t<std::is_same<T, CT>::value>> auto atomic_op(RT(CT::* func)(FArgs...), Args&&... args) volatile -> decltype((std::declval<T&>().*func)(args...))
{
return atomic_op(std::mem_fn(func), std::forward<Args>(args)...);
}
// atomic bitwise OR, returns previous data
force_inline const type _or(const type& right) volatile
{

View file

@ -80,6 +80,8 @@ namespace vm
std::array<atomic_t<u8>, 0x100000000ull / 4096> g_pages = {}; // information about every page
const thread_ctrl_t* const INVALID_THREAD = reinterpret_cast<const thread_ctrl_t*>(~0ull);
//using reservation_mutex_t = std::mutex;
class reservation_mutex_t
{
@ -152,7 +154,7 @@ namespace vm
std::mutex g_waiter_list_mutex;
waiter_t* _add_waiter(CPUThread& thread, u32 addr, u32 size)
waiter_t* _add_waiter(thread_t& thread, u32 addr, u32 size)
{
std::lock_guard<std::mutex> lock(g_waiter_list_mutex);
@ -242,25 +244,18 @@ namespace vm
addr = 0;
mask = ~0;
// signal thread (must not be signaled yet)
if (!thread->signal())
{
throw EXCEPTION("Thread already signaled");
}
// signal thread
thread->cv.notify_one();
return true;
}
waiter_lock_t::waiter_lock_t(CPUThread& thread, u32 addr, u32 size)
: m_waiter(_add_waiter(thread, addr, size))
, m_lock(thread.mutex, std::adopt_lock) // must be locked in _add_waiter
{
}
void waiter_lock_t::wait()
{
while (!m_waiter->thread->unsignal())
// if another thread successfully called pred(), it must be set to null
while (m_waiter->pred)
{
// if pred() called by another thread threw an exception, it'll be rethrown
if (m_waiter->pred())
{
return;
@ -270,15 +265,6 @@ namespace vm
m_waiter->thread->cv.wait(m_lock);
}
// if another thread successfully called pred(), it must be set to null
if (m_waiter->pred)
{
// if pred() called by another thread threw an exception, rethrow it
m_waiter->pred();
throw EXCEPTION("Unexpected");
}
}
waiter_lock_t::~waiter_lock_t()

View file

@ -4,7 +4,7 @@
const class thread_ctrl_t* get_current_thread_ctrl();
class CPUThread;
class thread_t;
namespace vm
{
@ -38,13 +38,13 @@ namespace vm
{
u32 addr = 0;
u32 mask = ~0;
CPUThread* thread = nullptr;
thread_t* thread = nullptr;
std::function<bool()> pred;
waiter_t() = default;
waiter_t* reset(u32 addr, u32 size, CPUThread& thread)
waiter_t* reset(u32 addr, u32 size, thread_t& thread)
{
this->addr = addr;
this->mask = ~(size - 1);
@ -62,6 +62,9 @@ namespace vm
bool try_notify();
};
// for internal use
waiter_t* _add_waiter(thread_t& thread, u32 addr, u32 size);
class waiter_lock_t
{
waiter_t* m_waiter;
@ -70,7 +73,11 @@ namespace vm
public:
waiter_lock_t() = delete;
waiter_lock_t(CPUThread& thread, u32 addr, u32 size);
template<typename T> inline waiter_lock_t(T& thread, u32 addr, u32 size)
: m_waiter(_add_waiter(static_cast<thread_t&>(thread), addr, size))
, m_lock(thread.mutex, std::adopt_lock) // must be locked in _add_waiter
{
}
waiter_t* operator ->() const
{
@ -83,7 +90,7 @@ namespace vm
};
// wait until pred() returns true, addr must be aligned to size which must be a power of 2, pred() may be called by any thread
template<typename F, typename... Args> auto wait_op(CPUThread& thread, u32 addr, u32 size, F pred, Args&&... args) -> decltype(static_cast<void>(pred(args...)))
template<typename T, typename F, typename... Args> auto wait_op(T& thread, u32 addr, u32 size, F pred, Args&&... args) -> decltype(static_cast<void>(pred(args...)))
{
// return immediately if condition passed (optimistic case)
if (pred(args...)) return;
@ -174,7 +181,7 @@ namespace vm
const u32 size; // total size
const u64 flags; // currently unused
atomic_t<u32> used{}; // amount of memory used, may be increased manually prevent some memory from allocating
atomic_t<u32> used{}; // amount of memory used, may be increased manually to prevent some memory from allocating
// Search and map memory (don't pass alignment smaller than 4096)
u32 alloc(u32 size, u32 align = 4096);
@ -396,14 +403,12 @@ namespace vm
}
void close();
u32 stack_push(CPUThread& CPU, u32 size, u32 align, u32& old_pos);
void stack_pop(CPUThread& CPU, u32 addr, u32 old_pos);
}
#include "vm_ref.h"
#include "vm_ptr.h"
#include "vm_var.h"
class CPUThread;
namespace vm
{
@ -439,4 +444,9 @@ namespace vm
return m_begin + m_position;
}
};
u32 stack_push(CPUThread& cpu, u32 size, u32 align, u32& old_pos);
void stack_pop(CPUThread& cpu, u32 addr, u32 old_pos);
}
#include "vm_var.h"

View file

@ -116,8 +116,6 @@ namespace vm
{
AT m_addr;
using type = func_def<RT(T...)>;
AT addr() const
{
return m_addr;
@ -141,7 +139,7 @@ namespace vm
RT operator()(ARMv7Context& context, T... args) const;
// conversion to another function pointer
template<typename AT2> operator _ptr_base<type, AT2>() const
template<typename AT2> operator _ptr_base<RT(T...), AT2>() const
{
return{ VM_CAST(m_addr) };
}

View file

@ -224,9 +224,9 @@ typedef s32(CellGcmContextCallback)(vm::ptr<CellGcmContextData>, u32);
struct CellGcmContextData
{
be_t<u32> begin;
be_t<u32> end;
be_t<u32> current;
vm::bptr<u32> begin;
vm::bptr<u32> end;
vm::bptr<u32> current;
vm::bptr<CellGcmContextCallback> callback;
};

View file

@ -2,7 +2,7 @@
#include "rpcs3/Ini.h"
#include "Utilities/Log.h"
#include "Emu/Memory/Memory.h"
#include "sysutil_video.h"
#include "Emu/SysCalls/Modules/cellVideoOut.h"
#include "GSManager.h"
#include "Null/NullGSRender.h"

View file

@ -12,7 +12,6 @@ GSLock::GSLock(GSRender& renderer, GSLockType type)
switch (m_type)
{
case GS_LOCK_NOT_WAIT: m_renderer.m_cs_main.lock(); break;
case GS_LOCK_WAIT_FLUSH: m_renderer.m_sem_flush.wait(); break;
case GS_LOCK_WAIT_FLIP: m_renderer.m_sem_flip.wait(); break;
}
}
@ -22,8 +21,7 @@ GSLock::~GSLock()
switch (m_type)
{
case GS_LOCK_NOT_WAIT: m_renderer.m_cs_main.unlock(); break;
case GS_LOCK_WAIT_FLUSH: m_renderer.m_sem_flush.post(); break;
case GS_LOCK_WAIT_FLIP: m_renderer.m_sem_flip.post(); break;
case GS_LOCK_WAIT_FLIP: m_renderer.m_sem_flip.try_post(); break;
}
}

View file

@ -17,7 +17,6 @@ struct GSRender : public RSXThread
enum GSLockType
{
GS_LOCK_NOT_WAIT,
GS_LOCK_WAIT_FLUSH,
GS_LOCK_WAIT_FLIP,
};

View file

@ -5,7 +5,7 @@
#include "Emu/System.h"
#include "Emu/RSX/GSManager.h"
#include "Emu/RSX/GSRender.h"
#include "Emu/RSX/sysutil_video.h"
#include "Emu/SysCalls/Modules/cellVideoOut.h"
#include "RSXThread.h"
#include "Emu/SysCalls/Callback.h"
@ -258,6 +258,8 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, const u32 args_addr, const
});
}
m_sem_flip.post_and_wait();
auto sync = [&]()
{
double limit;
@ -2499,14 +2501,6 @@ void RSXThread::Task()
if (put == get || !Emu.IsRunning())
{
if (put == get)
{
if (m_flip_status == 0)
m_sem_flip.post_and_wait();
m_sem_flush.post_and_wait();
}
std::this_thread::sleep_for(std::chrono::milliseconds(1)); // hack
continue;
}

View file

@ -5,7 +5,7 @@
#include "RSXFragmentProgram.h"
#include <stack>
#include "Utilities/SSemaphore.h"
#include "Utilities/Semaphore.h"
#include "Utilities/Thread.h"
#include "Utilities/Timer.h"
@ -155,8 +155,7 @@ public:
public:
std::mutex m_cs_main;
SSemaphore m_sem_flush;
SSemaphore m_sem_flip;
semaphore_t m_sem_flip;
u64 m_last_flip_time;
vm::ptr<void(u32)> m_flip_handler;
vm::ptr<void(u32)> m_user_handler;

View file

@ -4,47 +4,83 @@
extern Module cellAdec;
extern Module cellAtrac;
extern Module cellAtracMulti;
extern Module cellAudio;
extern Module cellAvconfExt;
extern Module cellBGDL;
extern Module cellCamera;
extern Module cellCelp8Enc;
extern Module cellCelpEnc;
extern Module cellDaisy;
extern Module cellDmux;
extern Module cellFiber;
extern Module cellFont;
extern Module cellFontFT;
extern Module cellFs;
extern Module cellGame;
extern Module cellGameExec;
extern Module cellGcmSys;
extern Module cellGem;
extern Module cellGifDec;
extern Module cellHttp;
extern Module cellHttps;
extern Module cellHttpUtil;
extern Module cellImeJp;
extern Module cellJpgDec;
extern Module cellJpgEnc;
extern Module cellKey2char;
extern Module cellL10n;
extern Module cellMic;
extern Module cellSysutil;
extern Module cellMusic;
extern Module cellMusicDecode;
extern Module cellMusicExport;
extern Module cellNetCtl;
extern Module cellOskDialog;
extern Module cellOvis;
extern Module cellPamf;
extern Module cellPhotoDecode;
extern Module cellPhotoExport;
extern Module cellPhotoImportUtil;
extern Module cellPngDec;
extern Module cellPngEnc;
extern Module cellPrint;
extern Module cellRec;
extern Module cellRemotePlay;
extern Module cellResc;
extern Module cellRtc;
extern Module cellRudp;
extern Module cellSail;
extern Module cellSailRec;
extern Module cellSaveData;
extern Module cellMinisSaveData;
extern Module cellScreenshot;
extern Module cellSearch;
extern Module cellSysutil;
extern Module cellSheap;
extern Module cellSpudll;
extern Module cellSpurs;
extern Module cellSpursJq;
extern Module cellSsl;
extern Module cellSubdisplay;
extern Module cellSync;
extern Module cellSync2;
extern Module cellSysconf;
extern Module cellSysmodule;
extern Module cellSysutil;
extern Module cellSysutilAp;
extern Module cellSysutilAvc;
extern Module cellSysutilAvc2;
extern Module cellSysutilMisc;
extern Module cellUsbd;
extern Module cellUsbPspcm;
extern Module cellUserInfo;
extern Module cellVdec;
extern Module cellVideoExport;
extern Module cellVideoUpload;
extern Module cellVoice;
extern Module cellVpost;
extern Module libmixer;
extern Module libsnd3;
extern Module libsynth2;
extern Module sceNp;
extern Module sceNp2;
extern Module sceNpClans;
@ -61,17 +97,32 @@ extern Module sys_lv2dbg;
struct ModuleInfo
{
s32 id; //-1 is used by module with only name
const char* name;
Module* module;
const s32 id; // -1 if the module doesn't have corresponding CELL_SYSMODULE_* id
const char* const name;
Module* const module;
explicit operator bool() const
{
return module != nullptr;
}
operator Module*() const
{
return module;
}
Module* operator ->() const
{
return module;
}
}
static const g_module_list[] =
const g_module_list[] =
{
{ 0x0000, "sys_net", &sys_net },
{ 0x0001, "sys_http", nullptr },
{ 0x0002, "cellHttpUtil", nullptr },
{ 0x0003, "cellSsl", nullptr },
{ 0x0004, "cellHttps", nullptr },
{ 0x0001, "cellHttp", &cellHttp },
{ 0x0002, "cellHttpUtil", &cellHttpUtil },
{ 0x0003, "cellSsl", &cellSsl },
{ 0x0004, "cellHttps", &cellHttps },
{ 0x0005, "libvdec", &cellVdec },
{ 0x0006, "cellAdec", &cellAdec },
{ 0x0007, "cellDmux", &cellDmux },
@ -79,8 +130,8 @@ static const g_module_list[] =
{ 0x0009, "cellRtc", &cellRtc },
{ 0x000a, "cellSpurs", &cellSpurs },
{ 0x000b, "cellOvis", &cellOvis },
{ 0x000c, "cellSheap", nullptr },
{ 0x000d, "sys_sync", &cellSync },
{ 0x000c, "cellSheap", &cellSheap },
{ 0x000d, "cellSync", &cellSync },
{ 0x000e, "sys_fs", &cellFs },
{ 0x000f, "cellJpgDec", &cellJpgDec },
{ 0x0010, "cellGcmSys", &cellGcmSys },
@ -94,13 +145,13 @@ static const g_module_list[] =
{ 0x0018, "cellPngDec", &cellPngDec },
{ 0x0019, "cellFont", &cellFont },
{ 0x001a, "cellFontFT", &cellFontFT },
{ 0x001b, "cellFreetype", nullptr },
{ 0x001b, "cell_FreeType2", nullptr },
{ 0x001c, "cellUsbd", &cellUsbd },
{ 0x001d, "cellSail", &cellSail },
{ 0x001e, "cellL10n", &cellL10n },
{ 0x001f, "cellResc", &cellResc },
{ 0x0020, "cellDaisy", nullptr },
{ 0x0021, "cellKey2char", nullptr },
{ 0x0020, "cellDaisy", &cellDaisy },
{ 0x0021, "cellKey2char", &cellKey2char },
{ 0x0022, "cellMic", &cellMic },
{ 0x0023, "cellCamera", &cellCamera },
{ 0x0024, "cellVdecMpeg2", nullptr },
@ -110,119 +161,137 @@ static const g_module_list[] =
{ 0x0028, "cellAdecAtx", nullptr },
{ 0x0029, "cellAdecAt3", nullptr },
{ 0x002a, "cellDmuxPamf", nullptr },
{ 0x002b, "?", nullptr },
{ 0x002c, "?", nullptr },
{ 0x002d, "?", nullptr },
{ 0x002e, "sys_lv2dbg", &sys_lv2dbg },
{ 0x0030, "cellUsbpspcm", nullptr },
{ 0x0031, "cellAvconfExt", &cellAvconfExt },
{ 0x002f, "cellSysutilAvcExt", &cellSysutilAvc },
{ 0x0030, "cellUsbPspcm", &cellUsbPspcm },
{ 0x0031, "cellSysutilAvconfExt", &cellAvconfExt },
{ 0x0032, "cellUserInfo", &cellUserInfo },
{ 0x0033, "cellSysutilSavedata", nullptr },
{ 0x0034, "cellSubdisplay", &cellSubdisplay },
{ 0x0035, "cellSysutilRec", nullptr },
{ 0x0036, "cellVideoExport", nullptr },
{ 0x0037, "cellGameExec", nullptr },
{ 0x0033, "cellSaveData", &cellSaveData },
{ 0x0034, "cellSubDisplay", &cellSubdisplay },
{ 0x0035, "cellRec", &cellRec },
{ 0x0036, "cellVideoExportUtility", &cellVideoExport },
{ 0x0037, "cellGameExec", &cellGameExec },
{ 0x0038, "sceNp2", &sceNp2 },
{ 0x0039, "cellSysutilAp", &cellSysutilAp },
{ 0x003a, "sceNpClans", &sceNpClans },
{ 0x003b, "cellSysutilOskExt", nullptr },
{ 0x003b, "cellOskExtUtility", &cellOskDialog },
{ 0x003c, "cellVdecDivx", nullptr },
{ 0x003d, "cellJpgEnc", nullptr },
{ 0x003d, "cellJpgEnc", &cellJpgEnc },
{ 0x003e, "cellGame", &cellGame },
{ 0x003f, "cellBgdl", nullptr },
{ 0x0040, "cellFreetypeTT", nullptr },
{ 0x0041, "cellSysutilVideoUpload", nullptr },
{ 0x0042, "cellSysutilSysconfExt", nullptr },
{ 0x003f, "cellBGDLUtility", &cellBGDL },
{ 0x0040, "cell_FreeType2", nullptr },
{ 0x0041, "cellVideoUpload", &cellVideoUpload },
{ 0x0042, "cellSysconfExtUtility", &cellSysconf },
{ 0x0043, "cellFiber", &cellFiber },
{ 0x0044, "sceNpCommerce2", &sceNpCommerce2 },
{ 0x0045, "sceNpTus", &sceNpTus },
{ 0x0046, "cellVoice", &cellVoice },
{ 0x0047, "cellAdecCelp8", nullptr },
{ 0x0048, "cellCelp8Enc", nullptr },
{ 0x0049, "cellLicenseArea", nullptr },
{ 0x004a, "cellMusic2", nullptr },
{ 0x0048, "cellCelp8Enc", &cellCelp8Enc },
{ 0x0049, "cellSysutilMisc", &cellSysutilMisc },
{ 0x004a, "cellMusicUtility", &cellMusic }, // 2
{ 0x004e, "cellScreenShotUtility", &cellScreenshot },
{ 0x004f, "cellMusicDecode", nullptr },
{ 0x004f, "cellMusicDecodeUtility", &cellMusicDecode },
{ 0x0050, "cellSpursJq", &cellSpursJq },
{ 0x0052, "cellPngEnc", nullptr },
{ 0x0053, "cellMusicDecode2", nullptr },
{ 0x0052, "cellPngEnc", &cellPngEnc },
{ 0x0053, "cellMusicDecodeUtility", &cellMusicDecode }, // 2
{ 0x0055, "cellSync2", &cellSync2 },
{ 0x0056, "sceNpUtil", &sceNpUtil },
{ 0x0057, "cellRudp", &cellRudp },
{ 0x0059, "sceNpSns", &sceNpSns },
{ 0x005a, "cellGem", &cellGem },
{ 0xf00a, "cellCelpEnc", nullptr },
{ 0x005a, "libgem", &cellGem },
{ 0xf00a, "cellCelpEnc", &cellCelpEnc },
{ 0xf010, "cellGifDec", &cellGifDec },
{ 0xf019, "cellAdecCelp", nullptr },
{ 0xf01b, "cellAdecM2bc", nullptr },
{ 0xf01d, "cellAdecM4aac", nullptr },
{ 0xf01e, "cellAdecMp3", nullptr },
{ 0xf023, "cellImejp", nullptr },
{ 0xf028, "cellMusic", nullptr },
{ 0xf029, "cellPhotoExport", nullptr },
{ 0xf02a, "cellPrint", nullptr },
{ 0xf02b, "cellPhotoImport", nullptr },
{ 0xf02c, "cellMusicExport", nullptr },
{ 0xf02e, "cellPhotoDecode", nullptr },
{ 0xf02f, "cellSearch", &cellSearch },
{ 0xf030, "cellAvchat2", nullptr },
{ 0xf034, "cellSailRec", nullptr },
{ 0xf023, "cellImeJpUtility", &cellImeJp },
{ 0xf028, "cellMusicUtility", &cellMusic },
{ 0xf029, "cellPhotoUtility", &cellPhotoExport },
{ 0xf02a, "cellPrintUtility", &cellPrint },
{ 0xf02b, "cellPhotoImportUtil", &cellPhotoImportUtil },
{ 0xf02c, "cellMusicExportUtility", &cellMusicExport },
{ 0xf02e, "cellPhotoDecodeUtil", &cellPhotoDecode },
{ 0xf02f, "cellSearchUtility", &cellSearch },
{ 0xf030, "cellSysutilAvc2", &cellSysutilAvc2 },
{ 0xf034, "cellSailRec", &cellSailRec },
{ 0xf035, "sceNpTrophy", &sceNpTrophy },
{ 0xf053, "cellAdecAt3multi", nullptr },
{ 0xf054, "cellLibatrac3multi", nullptr },
{ 0xf054, "cellAtracMulti", &cellAtracMulti },
{ -1, "cellSysmodule", &cellSysmodule },
{ -1, "libmixer", &libmixer },
{ -1, "sysPrxForUser", &sysPrxForUser },
{ -1, "sys_libc", &sys_libc },
{ -1, "cellMinisSaveData", &cellMinisSaveData },
{ -1, "cellSpudll", &cellSpudll },
{ -1, "cellRemotePlay", &cellRemotePlay },
{ -1, "libsnd3", &libsnd3 },
{ -1, "libsynth2", &libsynth2 },
};
void ModuleManager::Init()
{
if (initialized)
if (m_init)
{
Close();
}
clear_ppu_functions();
for (auto& m : g_module_list)
std::unordered_set<Module*> processed;
for (auto& module : g_module_list)
{
if (m.module)
if (module && processed.emplace(module).second)
{
m.module->Init();
module->Init();
}
}
initialized = true;
m_init = true;
}
ModuleManager::ModuleManager()
: initialized(false)
{
}
ModuleManager::~ModuleManager()
{
Close();
}
void ModuleManager::Close()
{
for (auto& m : g_module_list)
if (!m_init)
{
if (m.module && m.module->on_stop)
return;
}
std::unordered_set<Module*> processed;
for (auto& module : g_module_list)
{
if (module && module->on_stop && processed.emplace(module).second)
{
m.module->on_stop();
module->on_stop();
}
}
initialized = false;
m_init = false;
}
Module* ModuleManager::GetModuleByName(const char* name)
{
for (auto& m : g_module_list)
for (auto& module : g_module_list)
{
if (!strcmp(name, m.name))
if (!strcmp(name, module.name))
{
return m.module;
return module;
}
}
@ -231,11 +300,11 @@ Module* ModuleManager::GetModuleByName(const char* name)
Module* ModuleManager::GetModuleById(u16 id)
{
for (auto& m : g_module_list)
for (auto& module : g_module_list)
{
if (m.id == id)
if (module.id == id)
{
return m.module;
return module;
}
}
@ -244,9 +313,9 @@ Module* ModuleManager::GetModuleById(u16 id)
bool ModuleManager::CheckModuleId(u16 id)
{
for (auto& m : g_module_list)
for (auto& module : g_module_list)
{
if (m.id == id)
if (module.id == id)
{
return true;
}

View file

@ -4,7 +4,7 @@ class Module;
class ModuleManager
{
bool initialized;
bool m_init = false;
public:
ModuleManager();
@ -12,7 +12,8 @@ public:
void Init();
void Close();
Module* GetModuleByName(const char* name);
Module* GetModuleById(u16 id);
bool CheckModuleId(u16 id);
static Module* GetModuleByName(const char* name);
static Module* GetModuleById(u16 id);
static bool CheckModuleId(u16 id);
};

View file

@ -35,37 +35,19 @@ u32 add_ppu_func(ModuleFunc func)
u32 add_ppu_func_sub(StaticFunc func)
{
g_ppu_func_subs.push_back(func);
g_ppu_func_subs.emplace_back(func);
return func.index;
}
u32 add_ppu_func_sub(const char group[8], const SearchPatternEntry ops[], const size_t count, const char* name, Module* module, ppu_func_caller func)
u32 add_ppu_func_sub(const std::initializer_list<SearchPatternEntry>& ops, const char* name, Module* module, ppu_func_caller func)
{
char group_name[9] = {};
if (group)
{
strcpy_trunc(group_name, group);
}
StaticFunc sf;
sf.index = add_ppu_func(ModuleFunc(get_function_id(name), 0, module, name, func));
sf.name = name;
sf.group = *(u64*)group_name;
sf.found = 0;
sf.ops = ops;
for (u32 i = 0; i < count; i++)
{
SearchPatternEntry op;
op.type = ops[i].type;
op.data = _byteswap_ulong(ops[i].data); // TODO: use be_t<>
op.mask = _byteswap_ulong(ops[i].mask);
op.num = ops[i].num;
assert(!op.mask || (op.data & ~op.mask) == 0);
sf.ops.push_back(op);
}
return add_ppu_func_sub(sf);
return add_ppu_func_sub(std::move(sf));
}
ModuleFunc* get_ppu_func_by_nid(u32 nid, u32* out_index)
@ -198,6 +180,12 @@ void execute_ppu_func_by_index(PPUThread& CPU, u32 index)
CPU.PC = VM_CAST(CPU.LR & ~3) - 4;
}
// execute module-specific error check
if ((s64)CPU.GPR[3] < 0 && func->module && func->module->on_error)
{
func->module->on_error(CPU.GPR[3], func);
}
CPU.hle_code = last_code;
}
else
@ -234,7 +222,7 @@ void hook_ppu_func(vm::ptr<u32> base, u32 pos, u32 size)
for (auto& sub : g_ppu_func_subs)
{
bool found = true;
bool found = sub.ops.size() != 0;
for (u32 k = pos, x = 0; x + 1 <= sub.ops.size(); k++, x++)
{
@ -251,8 +239,8 @@ void hook_ppu_func(vm::ptr<u32> base, u32 pos, u32 size)
continue;
}
const u32 data = sub.ops[x].data;
const u32 mask = sub.ops[x].mask;
const u32 data = sub.ops[x].data.data();
const u32 mask = sub.ops[x].mask.data();
const bool match = (base[k].data() & mask) == data;
@ -344,7 +332,7 @@ void hook_ppu_func(vm::ptr<u32> base, u32 pos, u32 size)
if (found)
{
LOG_SUCCESS(LOADER, "Function '%s' hooked (addr=0x%x)", sub.name, (base + pos).addr());
LOG_SUCCESS(LOADER, "Function '%s' hooked (addr=*0x%x)", sub.name, base + pos);
sub.found++;
base[pos] = HACK(sub.index | EIF_PERFORM_BLR);
}
@ -360,11 +348,6 @@ void hook_ppu_funcs(vm::ptr<u32> base, u32 size)
{
using namespace PPU_instr;
if (!Ini.HLEHookStFunc.GetValue())
{
return;
}
// TODO: optimize search
for (u32 i = 0; i < size; i++)
{
@ -377,95 +360,12 @@ void hook_ppu_funcs(vm::ptr<u32> base, u32 size)
hook_ppu_func(base, i, size);
}
// check function groups
// check functions
for (u32 i = 0; i < g_ppu_func_subs.size(); i++)
{
if (g_ppu_func_subs[i].found) // start from some group
if (g_ppu_func_subs[i].found > 1)
{
const u64 group = g_ppu_func_subs[i].group;
if (!group)
{
// skip if group not set
continue;
}
enum : u32
{
GSR_SUCCESS = 0, // every function from this group has been found once
GSR_MISSING = 1, // (error) some function not found
GSR_EXCESS = 2, // (error) some function found twice or more
};
u32 res = GSR_SUCCESS;
// analyse
for (u32 j = 0; j < g_ppu_func_subs.size(); j++) if (g_ppu_func_subs[j].group == group)
{
u32 count = g_ppu_func_subs[j].found;
if (count == 0) // not found
{
// check if this function has been found with different pattern
for (u32 k = 0; k < g_ppu_func_subs.size(); k++) if (g_ppu_func_subs[k].group == group)
{
if (k != j && g_ppu_func_subs[k].index == g_ppu_func_subs[j].index)
{
count += g_ppu_func_subs[k].found;
}
}
if (count == 0)
{
res |= GSR_MISSING;
LOG_ERROR(LOADER, "Function '%s' not found", g_ppu_func_subs[j].name);
}
else if (count > 1)
{
res |= GSR_EXCESS;
}
}
else if (count == 1) // found
{
// ensure that this function has NOT been found with different pattern
for (u32 k = 0; k < g_ppu_func_subs.size(); k++) if (g_ppu_func_subs[k].group == group)
{
if (k != j && g_ppu_func_subs[k].index == g_ppu_func_subs[j].index)
{
if (g_ppu_func_subs[k].found)
{
res |= GSR_EXCESS;
LOG_ERROR(LOADER, "Function '%s' hooked twice", g_ppu_func_subs[j].name);
}
}
}
}
else
{
res |= GSR_EXCESS;
LOG_ERROR(LOADER, "Function '%s' hooked twice", g_ppu_func_subs[j].name);
}
}
// clear data
for (u32 j = 0; j < g_ppu_func_subs.size(); j++)
{
if (g_ppu_func_subs[j].group == group) g_ppu_func_subs[j].found = 0;
}
char group_name[9] = {};
*(u64*)group_name = group;
if (res == GSR_SUCCESS)
{
LOG_SUCCESS(LOADER, "Function group [%s] successfully hooked", group_name);
}
else
{
LOG_ERROR(LOADER, "Function group [%s] failed:%s%s", group_name,
(res & GSR_MISSING ? " missing;" : ""),
(res & GSR_EXCESS ? " excess;" : ""));
}
LOG_ERROR(LOADER, "Function '%s' hooked %u times", g_ppu_func_subs[i].found);
}
}
}
@ -610,6 +510,11 @@ Module::~Module()
void Module::Init()
{
on_load = nullptr;
on_unload = nullptr;
on_stop = nullptr;
on_error = nullptr;
m_init();
}

View file

@ -62,8 +62,8 @@ enum : u32
struct SearchPatternEntry
{
u32 type;
u32 data;
u32 mask;
be_t<u32> data;
be_t<u32> mask;
u32 num; // supplement info
};
@ -72,7 +72,6 @@ struct StaticFunc
u32 index;
const char* name;
std::vector<SearchPatternEntry> ops;
u64 group;
u32 found;
std::unordered_map<u32, u32> labels;
};
@ -88,17 +87,18 @@ class Module : public LogBase
public:
Module(const char* name, void(*init)());
Module(Module &other) = delete;
Module(Module &&other) = delete;
Module(Module& other) = delete;
Module(Module&& other) = delete;
Module &operator =(Module &other) = delete;
Module &operator =(Module &&other) = delete;
Module& operator =(Module& other) = delete;
Module& operator =(Module&& other) = delete;
~Module();
std::function<void()> on_load;
std::function<void()> on_unload;
std::function<void()> on_stop;
std::function<void(s64 value, ModuleFunc* func)> on_error;
void Init();
void Load();
@ -119,7 +119,7 @@ void clear_ppu_functions();
u32 get_function_id(const char* name);
u32 add_ppu_func_sub(StaticFunc sf);
u32 add_ppu_func_sub(const char group[8], const SearchPatternEntry ops[], size_t count, const char* name, Module* module, ppu_func_caller func);
u32 add_ppu_func_sub(const std::initializer_list<SearchPatternEntry>& ops, const char* name, Module* module, ppu_func_caller func);
void hook_ppu_funcs(vm::ptr<u32> base, u32 size);
@ -151,15 +151,13 @@ template<typename T, typename... Args> inline auto hle_call_func(PPUThread& CPU,
#define REG_UNNAMED(module, nid) add_ppu_func(ModuleFunc(0x##nid, 0, &module, "_nid_"#nid, bind_func(_nid_##nid)))
#define REG_SUB(module, group, ns, name, ...) \
const SearchPatternEntry name##_table[] = {__VA_ARGS__}; \
add_ppu_func_sub(group, name##_table, sizeof(name##_table) / sizeof(SearchPatternEntry), #name, &module, bind_func(ns::name))
#define REG_SUB(module, ns, name, ...) add_ppu_func_sub({ __VA_ARGS__ }, #name, &module, bind_func(ns::name))
#define se_op_all(type, op, sup) []() { s32 XXX = 0; SearchPatternEntry res = { (type), (op), 0, (sup) }; XXX = -1; res.mask = (op) ^ ~res.data; return res; }()
#define se_op(op) se_op_all(SPET_MASKED_OPCODE, op, 0)
#define se_opt_op(op) se_op_all(SPET_OPTIONAL_MASKED_OPCODE, op, 0)
#define se_label(label) { SPET_LABEL, (label) }
#define se_br_label(op, label) se_op_all(SPET_BRANCH_TO_LABEL, op, label)
#define se_func_call(op, name) se_op_all(SPET_BRANCH_TO_FUNC, op, get_function_id(#name))
#define SP_OP(type, op, sup) []() { s32 XXX = 0; SearchPatternEntry res = { (type), (op), 0, (sup) }; XXX = -1; res.mask = (op) ^ ~res.data; return res; }()
#define SP_I(op) SP_OP(SPET_MASKED_OPCODE, op, 0)
#define OPT_SP_I(op) SP_OP(SPET_OPTIONAL_MASKED_OPCODE, op, 0)
#define SET_LABEL(label) { SPET_LABEL, (label) }
#define SP_LABEL_BR(op, label) SP_OP(SPET_BRANCH_TO_LABEL, op, label)
#define SP_CALL(op, name) SP_OP(SPET_BRANCH_TO_FUNC, op, get_function_id(#name))
#define UNIMPLEMENTED_FUNC(module) module.Error("%s", __FUNCTION__)

View file

@ -368,7 +368,7 @@ enum CellAdecMsgType : s32
CELL_ADEC_MSG_TYPE_SEQDONE,
};
using CellAdecCbMsg = func_def<s32(u32 handle, CellAdecMsgType msgType, s32 msgData, u32 cbArg)>;
using CellAdecCbMsg = s32(u32 handle, CellAdecMsgType msgType, s32 msgData, u32 cbArg);
struct CellAdecCb
{

View file

@ -3,8 +3,6 @@
#include "Emu/System.h"
#include "Emu/SysCalls/Modules.h"
extern Module cellAtrac;
#include "cellAtrac.h"
s32 cellAtracSetDataAndGetMemSize(vm::ptr<CellAtracHandle> pHandle, vm::ptr<u8> pucBufferAddr, u32 uiReadByte, u32 uiBufferByte, vm::ptr<u32> puiWorkMemByte)

View file

@ -28,32 +28,6 @@ enum
CELL_ATRAC_ERROR_ILLEGAL_SPU_THREAD_PRIORITY = 0x80610382,
};
enum
{
CELL_ATRACMULTI_ERROR_API_FAIL = 0x80610b01,
CELL_ATRACMULTI_ERROR_READSIZE_OVER_BUFFER = 0x80610b11,
CELL_ATRACMULTI_ERROR_UNKNOWN_FORMAT = 0x80610b12,
CELL_ATRACMULTI_ERROR_READSIZE_IS_TOO_SMALL = 0x80610b13,
CELL_ATRACMULTI_ERROR_ILLEGAL_SAMPLING_RATE = 0x80610b14,
CELL_ATRACMULTI_ERROR_ILLEGAL_DATA = 0x80610b15,
CELL_ATRACMULTI_ERROR_NO_DECODER = 0x80610b21,
CELL_ATRACMULTI_ERROR_UNSET_DATA = 0x80610b22,
CELL_ATRACMULTI_ERROR_DECODER_WAS_CREATED = 0x80610b23,
CELL_ATRACMULTI_ERROR_ALLDATA_WAS_DECODED = 0x80610b31,
CELL_ATRACMULTI_ERROR_NODATA_IN_BUFFER = 0x80610b32,
CELL_ATRACMULTI_ERROR_NOT_ALIGNED_OUT_BUFFER = 0x80610b33,
CELL_ATRACMULTI_ERROR_NEED_SECOND_BUFFER = 0x80610b34,
CELL_ATRACMULTI_ERROR_ALLDATA_IS_ONMEMORY = 0x80610b41,
CELL_ATRACMULTI_ERROR_ADD_DATA_IS_TOO_BIG = 0x80610b42,
CELL_ATRACMULTI_ERROR_NONEED_SECOND_BUFFER = 0x80610b51,
CELL_ATRACMULTI_ERROR_UNSET_LOOP_NUM = 0x80610b61,
CELL_ATRACMULTI_ERROR_ILLEGAL_SAMPLE = 0x80610b71,
CELL_ATRACMULTI_ERROR_ILLEGAL_RESET_BYTE = 0x80610b72,
CELL_ATRACMULTI_ERROR_ILLEGAL_PPU_THREAD_PRIORITY = 0x80610b81,
CELL_ATRACMULTI_ERROR_ILLEGAL_SPU_THREAD_PRIORITY = 0x80610b82,
CELL_ATRACMULTI_ERROR_API_PARAMETER = 0x80610b91,
};
// Remain Frame
enum : s32
{
@ -62,7 +36,7 @@ enum : s32
CELL_ATRAC_LOOP_STREAM_DATA_IS_ON_MEMORY = -3,
};
union CellAtracHandle
struct set_alignment(8) CellAtracHandle
{
vm::ptr<u8> pucWorkMem;
// ...
@ -83,3 +57,5 @@ struct CellAtracExtRes
vm::ptr<struct CellSpurs> pSpurs;
u8 priority[8];
};
extern Module cellAtrac;

View file

@ -0,0 +1,238 @@
#include "stdafx.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"
#include "Emu/SysCalls/Modules.h"
#include "cellAtracMulti.h"
s32 cellAtracMultiSetDataAndGetMemSize(vm::ptr<CellAtracMultiHandle> pHandle, vm::ptr<u8> pucBufferAddr, u32 uiReadByte, u32 uiBufferByte, u32 uiOutputChNum, vm::ptr<s32> piTrackArray, vm::ptr<u32> puiWorkMemByte)
{
cellAtracMulti.Warning("cellAtracMultiSetDataAndGetMemSize(pHandle=*0x%x, pucBufferAddr=*0x%x, uiReadByte=0x%x, uiBufferByte=0x%x, uiOutputChNum=%d, piTrackArray=*0x%x, puiWorkMemByte=*0x%x)",
pHandle, pucBufferAddr, uiReadByte, uiBufferByte, uiOutputChNum, piTrackArray, puiWorkMemByte);
*puiWorkMemByte = 0x1000;
return CELL_OK;
}
s32 cellAtracMultiCreateDecoder(vm::ptr<CellAtracMultiHandle> pHandle, vm::ptr<u8> pucWorkMem, u32 uiPpuThreadPriority, u32 uiSpuThreadPriority)
{
cellAtracMulti.Warning("cellAtracMultiCreateDecoder(pHandle=*0x%x, pucWorkMem=*0x%x, uiPpuThreadPriority=%d, uiSpuThreadPriority=%d)", pHandle, pucWorkMem, uiPpuThreadPriority, uiSpuThreadPriority);
pHandle->pucWorkMem = pucWorkMem;
return CELL_OK;
}
s32 cellAtracMultiCreateDecoderExt(vm::ptr<CellAtracMultiHandle> pHandle, vm::ptr<u8> pucWorkMem, u32 uiPpuThreadPriority, vm::ptr<CellAtracMultiExtRes> pExtRes)
{
cellAtracMulti.Warning("cellAtracMultiCreateDecoderExt(pHandle=*0x%x, pucWorkMem=*0x%x, uiPpuThreadPriority=%d, pExtRes=*0x%x)", pHandle, pucWorkMem, uiPpuThreadPriority, pExtRes);
pHandle->pucWorkMem = pucWorkMem;
return CELL_OK;
}
s32 cellAtracMultiDeleteDecoder(vm::ptr<CellAtracMultiHandle> pHandle)
{
cellAtracMulti.Warning("cellAtracMultiDeleteDecoder(pHandle=*0x%x)", pHandle);
return CELL_OK;
}
s32 cellAtracMultiDecode(vm::ptr<CellAtracMultiHandle> pHandle, vm::ptr<float> pfOutAddr, vm::ptr<u32> puiSamples, vm::ptr<u32> puiFinishflag, vm::ptr<s32> piRemainFrame)
{
cellAtracMulti.Warning("cellAtracMultiDecode(pHandle=*0x%x, pfOutAddr=*0x%x, puiSamples=*0x%x, puiFinishFlag=*0x%x, piRemainFrame=*0x%x)", pHandle, pfOutAddr, puiSamples, puiFinishflag, piRemainFrame);
*puiSamples = 0;
*puiFinishflag = 1;
*piRemainFrame = CELL_ATRACMULTI_ALLDATA_IS_ON_MEMORY;
return CELL_OK;
}
s32 cellAtracMultiGetStreamDataInfo(vm::ptr<CellAtracMultiHandle> pHandle, vm::pptr<u8> ppucWritePointer, vm::ptr<u32> puiWritableByte, vm::ptr<u32> puiReadPosition)
{
cellAtracMulti.Warning("cellAtracMultiGetStreamDataInfo(pHandle=*0x%x, ppucWritePointer=**0x%x, puiWritableByte=*0x%x, puiReadPosition=*0x%x)", pHandle, ppucWritePointer, puiWritableByte, puiReadPosition);
*ppucWritePointer = pHandle->pucWorkMem;
*puiWritableByte = 0x1000;
*puiReadPosition = 0;
return CELL_OK;
}
s32 cellAtracMultiAddStreamData(vm::ptr<CellAtracMultiHandle> pHandle, u32 uiAddByte)
{
cellAtracMulti.Warning("cellAtracMultiAddStreamData(pHandle=*0x%x, uiAddByte=0x%x)", pHandle, uiAddByte);
return CELL_OK;
}
s32 cellAtracMultiGetRemainFrame(vm::ptr<CellAtracMultiHandle> pHandle, vm::ptr<s32> piRemainFrame)
{
cellAtracMulti.Warning("cellAtracMultiGetRemainFrame(pHandle=*0x%x, piRemainFrame=*0x%x)", pHandle, piRemainFrame);
*piRemainFrame = CELL_ATRACMULTI_ALLDATA_IS_ON_MEMORY;
return CELL_OK;
}
s32 cellAtracMultiGetVacantSize(vm::ptr<CellAtracMultiHandle> pHandle, vm::ptr<u32> puiVacantSize)
{
cellAtracMulti.Warning("cellAtracMultiGetVacantSize(pHandle=*0x%x, puiVacantSize=*0x%x)", pHandle, puiVacantSize);
*puiVacantSize = 0x1000;
return CELL_OK;
}
s32 cellAtracMultiIsSecondBufferNeeded(vm::ptr<CellAtracMultiHandle> pHandle)
{
cellAtracMulti.Warning("cellAtracMultiIsSecondBufferNeeded(pHandle=*0x%x)", pHandle);
return 0;
}
s32 cellAtracMultiGetSecondBufferInfo(vm::ptr<CellAtracMultiHandle> pHandle, vm::ptr<u32> puiReadPosition, vm::ptr<u32> puiDataByte)
{
cellAtracMulti.Warning("cellAtracMultiGetSecondBufferInfo(pHandle=*0x%x, puiReadPosition=*0x%x, puiDataByte=*0x%x)", pHandle, puiReadPosition, puiDataByte);
*puiReadPosition = 0;
*puiDataByte = 0; // write to null block will occur
return CELL_OK;
}
s32 cellAtracMultiSetSecondBuffer(vm::ptr<CellAtracMultiHandle> pHandle, vm::ptr<u8> pucSecondBufferAddr, u32 uiSecondBufferByte)
{
cellAtracMulti.Warning("cellAtracMultiSetSecondBuffer(pHandle=*0x%x, pucSecondBufferAddr=*0x%x, uiSecondBufferByte=0x%x)", pHandle, pucSecondBufferAddr, uiSecondBufferByte);
return CELL_OK;
}
s32 cellAtracMultiGetChannel(vm::ptr<CellAtracMultiHandle> pHandle, vm::ptr<u32> puiChannel)
{
cellAtracMulti.Warning("cellAtracMultiGetChannel(pHandle=*0x%x, puiChannel=*0x%x)", pHandle, puiChannel);
*puiChannel = 2;
return CELL_OK;
}
s32 cellAtracMultiGetMaxSample(vm::ptr<CellAtracMultiHandle> pHandle, vm::ptr<u32> puiMaxSample)
{
cellAtracMulti.Warning("cellAtracMultiGetMaxSample(pHandle=*0x%x, puiMaxSample=*0x%x)", pHandle, puiMaxSample);
*puiMaxSample = 512;
return CELL_OK;
}
s32 cellAtracMultiGetNextSample(vm::ptr<CellAtracMultiHandle> pHandle, vm::ptr<u32> puiNextSample)
{
cellAtracMulti.Warning("cellAtracMultiGetNextSample(pHandle=*0x%x, puiNextSample=*0x%x)", pHandle, puiNextSample);
*puiNextSample = 0;
return CELL_OK;
}
s32 cellAtracMultiGetSoundInfo(vm::ptr<CellAtracMultiHandle> pHandle, vm::ptr<s32> piEndSample, vm::ptr<s32> piLoopStartSample, vm::ptr<s32> piLoopEndSample)
{
cellAtracMulti.Warning("cellAtracMultiGetSoundInfo(pHandle=*0x%x, piEndSample=*0x%x, piLoopStartSample=*0x%x, piLoopEndSample=*0x%x)", pHandle, piEndSample, piLoopStartSample, piLoopEndSample);
*piEndSample = 0;
*piLoopStartSample = 0;
*piLoopEndSample = 0;
return CELL_OK;
}
s32 cellAtracMultiGetNextDecodePosition(vm::ptr<CellAtracMultiHandle> pHandle, vm::ptr<u32> puiSamplePosition)
{
cellAtracMulti.Warning("cellAtracMultiGetNextDecodePosition(pHandle=*0x%x, puiSamplePosition=*0x%x)", pHandle, puiSamplePosition);
*puiSamplePosition = 0;
return CELL_ATRACMULTI_ERROR_ALLDATA_WAS_DECODED;
}
s32 cellAtracMultiGetBitrate(vm::ptr<CellAtracMultiHandle> pHandle, vm::ptr<u32> puiBitrate)
{
cellAtracMulti.Warning("cellAtracMultiGetBitrate(pHandle=*0x%x, puiBitrate=*0x%x)", pHandle, puiBitrate);
*puiBitrate = 128;
return CELL_OK;
}
s32 cellAtracMultiGetTrackArray(vm::ptr<CellAtracMultiHandle> pHandle, vm::ptr<s32> piTrackArray)
{
cellAtracMulti.Error("cellAtracMultiGetTrackArray(pHandle=*0x%x, piTrackArray=*0x%x)", pHandle, piTrackArray);
return CELL_OK;
}
s32 cellAtracMultiGetLoopInfo(vm::ptr<CellAtracMultiHandle> pHandle, vm::ptr<s32> piLoopNum, vm::ptr<u32> puiLoopStatus)
{
cellAtracMulti.Warning("cellAtracMultiGetLoopInfo(pHandle=*0x%x, piLoopNum=*0x%x, puiLoopStatus=*0x%x)", pHandle, piLoopNum, puiLoopStatus);
*piLoopNum = 0;
*puiLoopStatus = 0;
return CELL_OK;
}
s32 cellAtracMultiSetLoopNum(vm::ptr<CellAtracMultiHandle> pHandle, s32 iLoopNum)
{
cellAtracMulti.Warning("cellAtracMultiSetLoopNum(pHandle=*0x%x, iLoopNum=%d)", pHandle, iLoopNum);
return CELL_OK;
}
s32 cellAtracMultiGetBufferInfoForResetting(vm::ptr<CellAtracMultiHandle> pHandle, u32 uiSample, vm::ptr<CellAtracMultiBufferInfo> pBufferInfo)
{
cellAtracMulti.Warning("cellAtracMultiGetBufferInfoForResetting(pHandle=*0x%x, uiSample=0x%x, pBufferInfo=*0x%x)", pHandle, uiSample, pBufferInfo);
pBufferInfo->pucWriteAddr = pHandle->pucWorkMem;
pBufferInfo->uiWritableByte = 0x1000;
pBufferInfo->uiMinWriteByte = 0;
pBufferInfo->uiReadPosition = 0;
return CELL_OK;
}
s32 cellAtracMultiResetPlayPosition(vm::ptr<CellAtracMultiHandle> pHandle, u32 uiSample, u32 uiWriteByte, vm::ptr<s32> piTrackArray)
{
cellAtracMulti.Warning("cellAtracMultiResetPlayPosition(pHandle=*0x%x, uiSample=0x%x, uiWriteByte=0x%x, piTrackArray=*0x%x)", pHandle, uiSample, uiWriteByte, piTrackArray);
return CELL_OK;
}
s32 cellAtracMultiGetInternalErrorInfo(vm::ptr<CellAtracMultiHandle> pHandle, vm::ptr<s32> piResult)
{
cellAtracMulti.Warning("cellAtracMultiGetInternalErrorInfo(pHandle=*0x%x, piResult=*0x%x)", pHandle, piResult);
*piResult = 0;
return CELL_OK;
}
Module cellAtracMulti("cellAtrac", []()
{
REG_FUNC(cellAtracMulti, cellAtracMultiSetDataAndGetMemSize);
REG_FUNC(cellAtracMulti, cellAtracMultiCreateDecoder);
REG_FUNC(cellAtracMulti, cellAtracMultiCreateDecoderExt);
REG_FUNC(cellAtracMulti, cellAtracMultiDeleteDecoder);
REG_FUNC(cellAtracMulti, cellAtracMultiDecode);
REG_FUNC(cellAtracMulti, cellAtracMultiGetStreamDataInfo);
REG_FUNC(cellAtracMulti, cellAtracMultiAddStreamData);
REG_FUNC(cellAtracMulti, cellAtracMultiGetRemainFrame);
REG_FUNC(cellAtracMulti, cellAtracMultiGetVacantSize);
REG_FUNC(cellAtracMulti, cellAtracMultiIsSecondBufferNeeded);
REG_FUNC(cellAtracMulti, cellAtracMultiGetSecondBufferInfo);
REG_FUNC(cellAtracMulti, cellAtracMultiSetSecondBuffer);
REG_FUNC(cellAtracMulti, cellAtracMultiGetChannel);
REG_FUNC(cellAtracMulti, cellAtracMultiGetMaxSample);
REG_FUNC(cellAtracMulti, cellAtracMultiGetNextSample);
REG_FUNC(cellAtracMulti, cellAtracMultiGetSoundInfo);
REG_FUNC(cellAtracMulti, cellAtracMultiGetNextDecodePosition);
REG_FUNC(cellAtracMulti, cellAtracMultiGetBitrate);
REG_FUNC(cellAtracMulti, cellAtracMultiGetTrackArray);
REG_FUNC(cellAtracMulti, cellAtracMultiGetLoopInfo);
REG_FUNC(cellAtracMulti, cellAtracMultiSetLoopNum);
REG_FUNC(cellAtracMulti, cellAtracMultiGetBufferInfoForResetting);
REG_FUNC(cellAtracMulti, cellAtracMultiResetPlayPosition);
REG_FUNC(cellAtracMulti, cellAtracMultiGetInternalErrorInfo);
});

View file

@ -0,0 +1,62 @@
#pragma once
namespace vm { using namespace ps3; }
// Return Codes
enum
{
CELL_ATRACMULTI_ERROR_API_FAIL = 0x80610b01,
CELL_ATRACMULTI_ERROR_READSIZE_OVER_BUFFER = 0x80610b11,
CELL_ATRACMULTI_ERROR_UNKNOWN_FORMAT = 0x80610b12,
CELL_ATRACMULTI_ERROR_READSIZE_IS_TOO_SMALL = 0x80610b13,
CELL_ATRACMULTI_ERROR_ILLEGAL_SAMPLING_RATE = 0x80610b14,
CELL_ATRACMULTI_ERROR_ILLEGAL_DATA = 0x80610b15,
CELL_ATRACMULTI_ERROR_NO_DECODER = 0x80610b21,
CELL_ATRACMULTI_ERROR_UNSET_DATA = 0x80610b22,
CELL_ATRACMULTI_ERROR_DECODER_WAS_CREATED = 0x80610b23,
CELL_ATRACMULTI_ERROR_ALLDATA_WAS_DECODED = 0x80610b31,
CELL_ATRACMULTI_ERROR_NODATA_IN_BUFFER = 0x80610b32,
CELL_ATRACMULTI_ERROR_NOT_ALIGNED_OUT_BUFFER = 0x80610b33,
CELL_ATRACMULTI_ERROR_NEED_SECOND_BUFFER = 0x80610b34,
CELL_ATRACMULTI_ERROR_ALLDATA_IS_ONMEMORY = 0x80610b41,
CELL_ATRACMULTI_ERROR_ADD_DATA_IS_TOO_BIG = 0x80610b42,
CELL_ATRACMULTI_ERROR_NONEED_SECOND_BUFFER = 0x80610b51,
CELL_ATRACMULTI_ERROR_UNSET_LOOP_NUM = 0x80610b61,
CELL_ATRACMULTI_ERROR_ILLEGAL_SAMPLE = 0x80610b71,
CELL_ATRACMULTI_ERROR_ILLEGAL_RESET_BYTE = 0x80610b72,
CELL_ATRACMULTI_ERROR_ILLEGAL_PPU_THREAD_PRIORITY = 0x80610b81,
CELL_ATRACMULTI_ERROR_ILLEGAL_SPU_THREAD_PRIORITY = 0x80610b82,
CELL_ATRACMULTI_ERROR_API_PARAMETER = 0x80610b91,
};
// Remain Frame
enum : s32
{
CELL_ATRACMULTI_ALLDATA_IS_ON_MEMORY = -1,
CELL_ATRACMULTI_NONLOOP_STREAM_DATA_IS_ON_MEMORY = -2,
CELL_ATRACMULTI_LOOP_STREAM_DATA_IS_ON_MEMORY = -3,
};
struct set_alignment(8) CellAtracMultiHandle
{
vm::ptr<u8> pucWorkMem;
// ...
};
CHECK_MAX_SIZE(CellAtracMultiHandle, 512);
struct CellAtracMultiBufferInfo
{
vm::ptr<u8> pucWriteAddr;
be_t<u32> uiWritableByte;
be_t<u32> uiMinWriteByte;
be_t<u32> uiReadPosition;
};
struct CellAtracMultiExtRes
{
vm::ptr<struct CellSpurs> pSpurs;
u8 priority[8];
};
extern Module cellAtracMulti;

View file

@ -0,0 +1,259 @@
#include "stdafx.h"
#include "Emu/Memory/Memory.h"
#include "Emu/SysCalls/Modules.h"
#include "cellAudioOut.h"
extern Module cellSysutil;
s32 cellAudioOutGetSoundAvailability(u32 audioOut, u32 type, u32 fs, u32 option)
{
cellSysutil.Warning("cellAudioOutGetSoundAvailability(audioOut=%d, type=%d, fs=0x%x, option=%d)", audioOut, type, fs, option);
option = 0;
s32 available = 8; // should be at least 2
switch (fs)
{
case CELL_AUDIO_OUT_FS_32KHZ:
case CELL_AUDIO_OUT_FS_44KHZ:
case CELL_AUDIO_OUT_FS_48KHZ:
case CELL_AUDIO_OUT_FS_88KHZ:
case CELL_AUDIO_OUT_FS_96KHZ:
case CELL_AUDIO_OUT_FS_176KHZ:
case CELL_AUDIO_OUT_FS_192KHZ:
break;
default: return CELL_AUDIO_OUT_ERROR_UNSUPPORTED_SOUND_MODE;
}
switch (type)
{
case CELL_AUDIO_OUT_CODING_TYPE_LPCM: break;
case CELL_AUDIO_OUT_CODING_TYPE_AC3: available = 0; break;
case CELL_AUDIO_OUT_CODING_TYPE_DTS: available = 0; break;
default: return CELL_AUDIO_OUT_ERROR_UNSUPPORTED_SOUND_MODE;
}
switch (audioOut)
{
case CELL_AUDIO_OUT_PRIMARY: return available;
case CELL_AUDIO_OUT_SECONDARY: return 0;
}
return CELL_AUDIO_OUT_ERROR_ILLEGAL_CONFIGURATION;
}
s32 cellAudioOutGetSoundAvailability2(u32 audioOut, u32 type, u32 fs, u32 ch, u32 option)
{
cellSysutil.Warning("cellAudioOutGetSoundAvailability2(audioOut=%d, type=%d, fs=0x%x, ch=%d, option=%d)", audioOut, type, fs, ch, option);
option = 0;
s32 available = 8; // should be at least 2
switch (fs)
{
case CELL_AUDIO_OUT_FS_32KHZ:
case CELL_AUDIO_OUT_FS_44KHZ:
case CELL_AUDIO_OUT_FS_48KHZ:
case CELL_AUDIO_OUT_FS_88KHZ:
case CELL_AUDIO_OUT_FS_96KHZ:
case CELL_AUDIO_OUT_FS_176KHZ:
case CELL_AUDIO_OUT_FS_192KHZ:
break;
default: return CELL_AUDIO_OUT_ERROR_UNSUPPORTED_SOUND_MODE;
}
switch (ch)
{
case 2: break;
case 6: available = 0; break;
case 8: available = 0; break;
default: return CELL_AUDIO_OUT_ERROR_UNSUPPORTED_SOUND_MODE;
}
switch (type)
{
case CELL_AUDIO_OUT_CODING_TYPE_LPCM: break;
case CELL_AUDIO_OUT_CODING_TYPE_AC3: available = 0; break;
case CELL_AUDIO_OUT_CODING_TYPE_DTS: available = 0; break;
default: return CELL_AUDIO_OUT_ERROR_UNSUPPORTED_SOUND_MODE;
}
switch (audioOut)
{
case CELL_AUDIO_OUT_PRIMARY: return available;
case CELL_AUDIO_OUT_SECONDARY: return 0;
}
return CELL_AUDIO_OUT_ERROR_ILLEGAL_CONFIGURATION;
}
s32 cellAudioOutGetState(u32 audioOut, u32 deviceIndex, vm::ptr<CellAudioOutState> state)
{
cellSysutil.Warning("cellAudioOutGetState(audioOut=0x%x, deviceIndex=0x%x, state=*0x%x)", audioOut, deviceIndex, state);
*state = {};
switch (audioOut)
{
case CELL_AUDIO_OUT_PRIMARY:
state->state = CELL_AUDIO_OUT_OUTPUT_STATE_ENABLED;
state->encoder = CELL_AUDIO_OUT_CODING_TYPE_LPCM;
state->downMixer = CELL_AUDIO_OUT_DOWNMIXER_NONE;
state->soundMode.type = CELL_AUDIO_OUT_CODING_TYPE_LPCM;
state->soundMode.channel = CELL_AUDIO_OUT_CHNUM_8;
state->soundMode.fs = CELL_AUDIO_OUT_FS_48KHZ;
state->soundMode.reserved = 0;
state->soundMode.layout = CELL_AUDIO_OUT_SPEAKER_LAYOUT_8CH_LREClrxy;
return CELL_OK;
case CELL_AUDIO_OUT_SECONDARY:
state->state = CELL_AUDIO_OUT_OUTPUT_STATE_DISABLED;
return CELL_OK;
}
return CELL_AUDIO_OUT_ERROR_UNSUPPORTED_AUDIO_OUT;
}
s32 cellAudioOutConfigure(u32 audioOut, vm::ptr<CellAudioOutConfiguration> config, vm::ptr<CellAudioOutOption> option, u32 waitForEvent)
{
cellSysutil.Warning("cellAudioOutConfigure(audioOut=%d, config=*0x%x, option=*0x%x, waitForEvent=%d)", audioOut, config, option, waitForEvent);
switch (audioOut)
{
case CELL_AUDIO_OUT_PRIMARY:
if (config->channel)
{
//Emu.GetAudioManager().GetInfo().mode.channel = config->channel;
}
//Emu.GetAudioManager().GetInfo().mode.encoder = config->encoder;
if (config->downMixer)
{
//Emu.GetAudioManager().GetInfo().mode.downMixer = config->downMixer;
}
return CELL_OK;
case CELL_AUDIO_OUT_SECONDARY:
return CELL_OK;
}
return CELL_AUDIO_OUT_ERROR_UNSUPPORTED_AUDIO_OUT;
}
s32 cellAudioOutGetConfiguration(u32 audioOut, vm::ptr<CellAudioOutConfiguration> config, vm::ptr<CellAudioOutOption> option)
{
cellSysutil.Warning("cellAudioOutGetConfiguration(audioOut=%d, config=*0x%x, option=*0x%x)", audioOut, config, option);
if (option) *option = {};
*config = {};
switch (audioOut)
{
case CELL_AUDIO_OUT_PRIMARY:
config->channel = CELL_AUDIO_OUT_CHNUM_8;
config->encoder = CELL_AUDIO_OUT_CODING_TYPE_LPCM;
config->downMixer = CELL_AUDIO_OUT_DOWNMIXER_NONE;
return CELL_OK;
case CELL_AUDIO_OUT_SECONDARY:
return CELL_OK;
}
return CELL_AUDIO_OUT_ERROR_UNSUPPORTED_AUDIO_OUT;
}
s32 cellAudioOutGetNumberOfDevice(u32 audioOut)
{
cellSysutil.Warning("cellAudioOutGetNumberOfDevice(audioOut=%d)", audioOut);
switch (audioOut)
{
case CELL_AUDIO_OUT_PRIMARY: return 1;
case CELL_AUDIO_OUT_SECONDARY: return 0;
}
return CELL_AUDIO_OUT_ERROR_UNSUPPORTED_AUDIO_OUT;
}
s32 cellAudioOutGetDeviceInfo(u32 audioOut, u32 deviceIndex, vm::ptr<CellAudioOutDeviceInfo> info)
{
cellSysutil.Todo("cellAudioOutGetDeviceInfo(audioOut=%d, deviceIndex=%d, info=*0x%x)", audioOut, deviceIndex, info);
if (deviceIndex) return CELL_AUDIO_OUT_ERROR_DEVICE_NOT_FOUND;
info->portType = CELL_AUDIO_OUT_PORT_HDMI;
info->availableModeCount = 1;
info->state = CELL_AUDIO_OUT_DEVICE_STATE_AVAILABLE;
info->latency = 1000;
info->availableModes[0].type = CELL_AUDIO_OUT_CODING_TYPE_LPCM;
info->availableModes[0].channel = CELL_AUDIO_OUT_CHNUM_8;
info->availableModes[0].fs = CELL_AUDIO_OUT_FS_48KHZ;
info->availableModes[0].layout = CELL_AUDIO_OUT_SPEAKER_LAYOUT_8CH_LREClrxy;
return CELL_OK;
}
s32 cellAudioOutSetCopyControl(u32 audioOut, u32 control)
{
cellSysutil.Warning("cellAudioOutSetCopyControl(audioOut=%d, control=%d)", audioOut, control);
switch (audioOut)
{
case CELL_AUDIO_OUT_PRIMARY:
case CELL_AUDIO_OUT_SECONDARY:
break;
default: return CELL_AUDIO_OUT_ERROR_UNSUPPORTED_AUDIO_OUT;
}
switch (control)
{
case CELL_AUDIO_OUT_COPY_CONTROL_COPY_FREE:
case CELL_AUDIO_OUT_COPY_CONTROL_COPY_ONCE:
case CELL_AUDIO_OUT_COPY_CONTROL_COPY_NEVER:
break;
default: return CELL_AUDIO_OUT_ERROR_ILLEGAL_PARAMETER;
}
return CELL_OK;
}
s32 cellAudioOutRegisterCallback()
{
throw EXCEPTION("");
}
s32 cellAudioOutUnregisterCallback()
{
throw EXCEPTION("");
}
void cellSysutil_AudioOut_init()
{
REG_FUNC(cellSysutil, cellAudioOutGetState);
REG_FUNC(cellSysutil, cellAudioOutConfigure);
REG_FUNC(cellSysutil, cellAudioOutGetSoundAvailability);
REG_FUNC(cellSysutil, cellAudioOutGetSoundAvailability2);
REG_FUNC(cellSysutil, cellAudioOutGetDeviceInfo);
REG_FUNC(cellSysutil, cellAudioOutGetNumberOfDevice);
REG_FUNC(cellSysutil, cellAudioOutGetConfiguration);
REG_FUNC(cellSysutil, cellAudioOutSetCopyControl);
REG_FUNC(cellSysutil, cellAudioOutRegisterCallback);
REG_FUNC(cellSysutil, cellAudioOutUnregisterCallback);
}

View file

@ -1,17 +1,87 @@
#include "stdafx.h"
#include "Ini.h"
#include "Emu/Memory/Memory.h"
#include "Emu/SysCalls/Modules.h"
#include "Emu/RSX/sysutil_video.h"
namespace vm { using namespace ps3; }
#include "Ini.h"
#include "cellAudioIn.h"
#include "cellAudioOut.h"
#include "cellVideoOut.h"
extern Module cellAvconfExt;
s32 cellAudioOutUnregisterDevice()
{
throw EXCEPTION("");
}
s32 cellAudioOutGetDeviceInfo2()
{
throw EXCEPTION("");
}
s32 cellVideoOutSetXVColor()
{
throw EXCEPTION("");
}
s32 cellVideoOutSetupDisplay()
{
throw EXCEPTION("");
}
s32 cellAudioInGetDeviceInfo()
{
throw EXCEPTION("");
}
s32 cellVideoOutConvertCursorColor()
{
UNIMPLEMENTED_FUNC(cellAvconfExt);
return CELL_OK;
throw EXCEPTION("");
}
s32 cellVideoOutGetGamma()
{
throw EXCEPTION("");
}
s32 cellAudioInGetAvailableDeviceInfo()
{
throw EXCEPTION("");
}
s32 cellAudioOutGetAvailableDeviceInfo()
{
throw EXCEPTION("");
}
s32 cellVideoOutSetGamma()
{
throw EXCEPTION("");
}
s32 cellAudioOutRegisterDevice()
{
throw EXCEPTION("");
}
s32 cellAudioOutSetDeviceMode()
{
throw EXCEPTION("");
}
s32 cellAudioInSetDeviceMode()
{
throw EXCEPTION("");
}
s32 cellAudioInRegisterDevice()
{
throw EXCEPTION("");
}
s32 cellAudioInUnregisterDevice()
{
throw EXCEPTION("");
}
s32 cellVideoOutGetScreenSize(u32 videoOut, vm::ptr<float> screenSize)
@ -41,22 +111,23 @@ s32 cellVideoOutGetScreenSize(u32 videoOut, vm::ptr<float> screenSize)
return CELL_VIDEO_OUT_ERROR_VALUE_IS_NOT_SET;
}
s32 cellVideoOutGetGamma()
{
UNIMPLEMENTED_FUNC(cellAvconfExt);
return CELL_OK;
}
s32 cellVideoOutSetGamma()
{
UNIMPLEMENTED_FUNC(cellAvconfExt);
return CELL_OK;
}
Module cellAvconfExt("cellAvconfExt", []()
{
REG_FUNC(cellAvconfExt, cellAudioOutUnregisterDevice);
REG_FUNC(cellAvconfExt, cellAudioOutGetDeviceInfo2);
REG_FUNC(cellAvconfExt, cellVideoOutSetXVColor);
REG_FUNC(cellAvconfExt, cellVideoOutSetupDisplay);
REG_FUNC(cellAvconfExt, cellAudioInGetDeviceInfo);
REG_FUNC(cellAvconfExt, cellVideoOutConvertCursorColor);
REG_FUNC(cellAvconfExt, cellVideoOutGetScreenSize);
REG_FUNC(cellAvconfExt, cellVideoOutGetGamma);
REG_FUNC(cellAvconfExt, cellAudioInGetAvailableDeviceInfo);
REG_FUNC(cellAvconfExt, cellAudioOutGetAvailableDeviceInfo);
REG_FUNC(cellAvconfExt, cellVideoOutSetGamma);
REG_FUNC(cellAvconfExt, cellAudioOutRegisterDevice);
REG_FUNC(cellAvconfExt, cellAudioOutSetDeviceMode);
REG_FUNC(cellAvconfExt, cellAudioInSetDeviceMode);
REG_FUNC(cellAvconfExt, cellAudioInRegisterDevice);
REG_FUNC(cellAvconfExt, cellAudioInUnregisterDevice);
REG_FUNC(cellAvconfExt, cellVideoOutGetScreenSize);
});

View file

@ -1,8 +1,9 @@
#include "stdafx.h"
#if 0
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"
#include "Emu/SysCalls/Modules.h"
void cellBgdl_init();
Module cellBgdl(0x003f, cellBgdl_init);
extern Module cellBGDL;
// Return Codes
enum
@ -15,35 +16,34 @@ enum
CELL_BGDL_UTIL_ERROR_INITIALIZE = 0x8002ce05,
};
int cellBGDLGetInfo()
s32 cellBGDLGetInfo()
{
UNIMPLEMENTED_FUNC(cellBgdl);
UNIMPLEMENTED_FUNC(cellBGDL);
return CELL_OK;
}
int cellBGDLGetInfo2()
s32 cellBGDLGetInfo2()
{
UNIMPLEMENTED_FUNC(cellBgdl);
UNIMPLEMENTED_FUNC(cellBGDL);
return CELL_OK;
}
int cellBGDLSetMode()
s32 cellBGDLSetMode()
{
UNIMPLEMENTED_FUNC(cellBgdl);
UNIMPLEMENTED_FUNC(cellBGDL);
return CELL_OK;
}
int cellBGDLGetMode()
s32 cellBGDLGetMode()
{
UNIMPLEMENTED_FUNC(cellBgdl);
UNIMPLEMENTED_FUNC(cellBGDL);
return CELL_OK;
}
void cellBgdl_init()
Module cellBGDL("cellBGDL", []()
{
REG_FUNC(cellBgdl, cellBGDLGetInfo);
REG_FUNC(cellBgdl, cellBGDLGetInfo2);
REG_FUNC(cellBgdl, cellBGDLSetMode);
REG_FUNC(cellBgdl, cellBGDLGetMode);
}
#endif
REG_FUNC(cellBGDL, cellBGDLGetInfo);
REG_FUNC(cellBGDL, cellBGDLGetInfo2);
REG_FUNC(cellBGDL, cellBGDLSetMode);
REG_FUNC(cellBGDL, cellBGDLGetMode);
});

View file

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

View file

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

View file

@ -1,8 +1,9 @@
#include "stdafx.h"
#if 0
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"
#include "Emu/SysCalls/Modules.h"
void cellCelp8Enc_init();
Module cellCelp8Enc(0x0048, cellCelp8Enc_init);
extern Module cellCelp8Enc;
// Return Codes
enum
@ -15,61 +16,61 @@ enum
CELL_CELP8ENC_ERROR_CORE_ARG = 0x806140b3,
};
int cellCelp8EncQueryAttr()
s32 cellCelp8EncQueryAttr()
{
UNIMPLEMENTED_FUNC(cellCelp8Enc);
return CELL_OK;
}
int cellCelp8EncOpen()
s32 cellCelp8EncOpen()
{
UNIMPLEMENTED_FUNC(cellCelp8Enc);
return CELL_OK;
}
int cellCelp8EncOpenEx()
s32 cellCelp8EncOpenEx()
{
UNIMPLEMENTED_FUNC(cellCelp8Enc);
return CELL_OK;
}
int cellCelp8EncClose()
s32 cellCelp8EncClose()
{
UNIMPLEMENTED_FUNC(cellCelp8Enc);
return CELL_OK;
}
int cellCelp8EncStart()
s32 cellCelp8EncStart()
{
UNIMPLEMENTED_FUNC(cellCelp8Enc);
return CELL_OK;
}
int cellCelp8EncEnd()
s32 cellCelp8EncEnd()
{
UNIMPLEMENTED_FUNC(cellCelp8Enc);
return CELL_OK;
}
int cellCelp8EncEncodeFrame()
s32 cellCelp8EncEncodeFrame()
{
UNIMPLEMENTED_FUNC(cellCelp8Enc);
return CELL_OK;
}
int cellCelp8EncWaitForOutput()
s32 cellCelp8EncWaitForOutput()
{
UNIMPLEMENTED_FUNC(cellCelp8Enc);
return CELL_OK;
}
int cellCelp8EncGetAu()
s32 cellCelp8EncGetAu()
{
UNIMPLEMENTED_FUNC(cellCelp8Enc);
return CELL_OK;
}
void cellCelp8Enc_init()
Module cellCelp8Enc("cellCelp8Enc", []()
{
REG_FUNC(cellCelp8Enc, cellCelp8EncQueryAttr);
REG_FUNC(cellCelp8Enc, cellCelp8EncOpen);
@ -80,5 +81,4 @@ void cellCelp8Enc_init()
REG_FUNC(cellCelp8Enc, cellCelp8EncEncodeFrame);
REG_FUNC(cellCelp8Enc, cellCelp8EncWaitForOutput);
REG_FUNC(cellCelp8Enc, cellCelp8EncGetAu);
}
#endif
});

View file

@ -1,8 +1,9 @@
#include "stdafx.h"
#if 0
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"
#include "Emu/SysCalls/Modules.h"
void cellCelpEnc_init();
Module cellCelpEnc(0xf00a, cellCelpEnc_init);
extern Module cellCelpEnc;
// Return Codes
enum
@ -15,61 +16,61 @@ enum
CELL_CELPENC_ERROR_CORE_ARG = 0x80614083,
};
int cellCelpEncQueryAttr()
s32 cellCelpEncQueryAttr()
{
UNIMPLEMENTED_FUNC(cellCelpEnc);
return CELL_OK;
}
int cellCelpEncOpen()
s32 cellCelpEncOpen()
{
UNIMPLEMENTED_FUNC(cellCelpEnc);
return CELL_OK;
}
int cellCelpEncOpenEx()
s32 cellCelpEncOpenEx()
{
UNIMPLEMENTED_FUNC(cellCelpEnc);
return CELL_OK;
}
int cellCelpEncClose()
s32 cellCelpEncClose()
{
UNIMPLEMENTED_FUNC(cellCelpEnc);
return CELL_OK;
}
int cellCelpEncStart()
s32 cellCelpEncStart()
{
UNIMPLEMENTED_FUNC(cellCelpEnc);
return CELL_OK;
}
int cellCelpEncEnd()
s32 cellCelpEncEnd()
{
UNIMPLEMENTED_FUNC(cellCelpEnc);
return CELL_OK;
}
int cellCelpEncEncodeFrame()
s32 cellCelpEncEncodeFrame()
{
UNIMPLEMENTED_FUNC(cellCelpEnc);
return CELL_OK;
}
int cellCelpEncWaitForOutput()
s32 cellCelpEncWaitForOutput()
{
UNIMPLEMENTED_FUNC(cellCelpEnc);
return CELL_OK;
}
int cellCelpEncGetAu()
s32 cellCelpEncGetAu()
{
UNIMPLEMENTED_FUNC(cellCelpEnc);
return CELL_OK;
}
void cellCelpEnc_init()
Module cellCelpEnc("cellCelpEnc", []()
{
REG_FUNC(cellCelpEnc, cellCelpEncQueryAttr);
REG_FUNC(cellCelpEnc, cellCelpEncOpen);
@ -80,5 +81,4 @@ void cellCelpEnc_init()
REG_FUNC(cellCelpEnc, cellCelpEncEncodeFrame);
REG_FUNC(cellCelpEnc, cellCelpEncWaitForOutput);
REG_FUNC(cellCelpEnc, cellCelpEncGetAu);
}
#endif
});

View file

@ -0,0 +1,322 @@
#include "stdafx.h"
#include "Emu/Memory/Memory.h"
#include "Emu/SysCalls/Modules.h"
extern Module cellDaisy;
s32 _ZN4cell5Daisy17LFQueue2PushCloseEPNS0_8LFQueue2EPFiPvjE()
{
throw EXCEPTION("");
}
s32 _ZN4cell5Daisy21LFQueue2GetPopPointerEPNS0_8LFQueue2EPij()
{
throw EXCEPTION("");
}
s32 _QN4cell5Daisy4Lock15completeConsumeEj()
{
throw EXCEPTION("");
}
s32 _QN4cell5Daisy9_snprintfEPcjPKcz()
{
throw EXCEPTION("");
}
s32 _ZN4cell5Daisy4Lock7popOpenEv()
{
throw EXCEPTION("");
}
s32 _ZN4cell5Daisy26LFQueue2CompletePopPointerEPNS0_8LFQueue2EiPFiPvjEj()
{
throw EXCEPTION("");
}
s32 _ZN4cell5Daisy22ScatterGatherInterlock7releaseEv()
{
throw EXCEPTION("");
}
s32 _QN4cell5Daisy4Lock7popOpenEv()
{
throw EXCEPTION("");
}
s32 _ZN4cell5Daisy22ScatterGatherInterlockC1EPVNS0_16_AtomicInterlockEjPjjh()
{
throw EXCEPTION("");
}
s32 _QN4cell5Daisy22ScatterGatherInterlockC1EPVNS0_16_AtomicInterlockEjPjjh()
{
throw EXCEPTION("");
}
s32 _ZN4cell5Daisy9_snprintfEPcjPKcz()
{
throw EXCEPTION("");
}
s32 _ZN4cell5Daisy29LFQueue2HasUnfinishedConsumerEPNS0_8LFQueue2Ej()
{
throw EXCEPTION("");
}
s32 _ZN4cell5Daisy4Lock18getNextHeadPointerEv()
{
throw EXCEPTION("");
}
s32 _ZN4cell5Daisy4Lock10initializeEj()
{
throw EXCEPTION("");
}
s32 _ZN4cell5Daisy22ScatterGatherInterlockC1EPVNS0_16_AtomicInterlockEjPvPFiS5_jE()
{
throw EXCEPTION("");
}
s32 _ZN4cell5Daisy22ScatterGatherInterlockC2EPVNS0_16_AtomicInterlockEjPjjh()
{
throw EXCEPTION("");
}
s32 _ZN4cell5Daisy4Lock15completeProduceEj()
{
throw EXCEPTION("");
}
s32 _QN4cell5Daisy16LFQueue2PushOpenEPNS0_8LFQueue2E()
{
throw EXCEPTION("");
}
s32 _QN4cell5Daisy16LFQueue2PopCloseEPNS0_8LFQueue2EPFiPvjE()
{
throw EXCEPTION("");
}
s32 _QN4cell5Daisy4Lock8popCloseEv()
{
throw EXCEPTION("");
}
s32 _ZN4cell5Daisy4Lock8popCloseEv()
{
throw EXCEPTION("");
}
s32 _ZN4cell5Daisy22ScatterGatherInterlockD2Ev()
{
throw EXCEPTION("");
}
s32 _QN4cell5Daisy21LFQueue2GetPopPointerEPNS0_8LFQueue2EPij()
{
throw EXCEPTION("");
}
s32 _ZN4cell5Daisy4Lock18getNextTailPointerEv()
{
throw EXCEPTION("");
}
s32 _ZN4cell5Daisy4Lock8pushOpenEv()
{
throw EXCEPTION("");
}
s32 _QN4cell5Daisy29LFQueue2HasUnfinishedConsumerEPNS0_8LFQueue2Ej()
{
throw EXCEPTION("");
}
s32 _ZN4cell5Daisy4Lock9pushCloseEv()
{
throw EXCEPTION("");
}
s32 _QN4cell5Daisy22ScatterGatherInterlockD2Ev()
{
throw EXCEPTION("");
}
s32 _QN4cell5Daisy15LFQueue2PopOpenEPNS0_8LFQueue2E()
{
throw EXCEPTION("");
}
s32 _QN4cell5Daisy22ScatterGatherInterlockC1EPVNS0_16_AtomicInterlockEjPvPFiS5_jE()
{
throw EXCEPTION("");
}
s32 _ZN4cell5Daisy22ScatterGatherInterlockD1Ev()
{
throw EXCEPTION("");
}
s32 _QN4cell5Daisy4Lock10initializeEj()
{
throw EXCEPTION("");
}
s32 _QN4cell5Daisy4Lock15completeProduceEj()
{
throw EXCEPTION("");
}
s32 _ZN4cell5Daisy16LFQueue2PopCloseEPNS0_8LFQueue2EPFiPvjE()
{
throw EXCEPTION("");
}
s32 _ZN4cell5Daisy15LFQueue2PopOpenEPNS0_8LFQueue2E()
{
throw EXCEPTION("");
}
s32 _QN4cell5Daisy17LFQueue2PushCloseEPNS0_8LFQueue2EPFiPvjE()
{
throw EXCEPTION("");
}
s32 _QN4cell5Daisy22ScatterGatherInterlockC2EPVNS0_16_AtomicInterlockEjPvPFiS5_jE()
{
throw EXCEPTION("");
}
s32 _QN4cell5Daisy22ScatterGatherInterlock21proceedSequenceNumberEv()
{
throw EXCEPTION("");
}
s32 _ZN4cell5Daisy22ScatterGatherInterlockC2EPVNS0_16_AtomicInterlockEjPvPFiS5_jE()
{
throw EXCEPTION("");
}
s32 _QN4cell5Daisy22ScatterGatherInterlockC2EPVNS0_16_AtomicInterlockEjPjjh()
{
throw EXCEPTION("");
}
s32 _ZN4cell5Daisy4Lock15completeConsumeEj()
{
throw EXCEPTION("");
}
s32 _ZN4cell5Daisy22ScatterGatherInterlock21proceedSequenceNumberEv()
{
throw EXCEPTION("");
}
s32 _QN4cell5Daisy4Lock18getNextHeadPointerEv()
{
throw EXCEPTION("");
}
s32 _QN4cell5Daisy4Lock9pushCloseEv()
{
throw EXCEPTION("");
}
s32 _QN4cell5Daisy26LFQueue2CompletePopPointerEPNS0_8LFQueue2EiPFiPvjEj()
{
throw EXCEPTION("");
}
s32 _ZN4cell5Daisy22ScatterGatherInterlock5probeEj()
{
throw EXCEPTION("");
}
s32 _QN4cell5Daisy4Lock8pushOpenEv()
{
throw EXCEPTION("");
}
s32 _QN4cell5Daisy22ScatterGatherInterlock5probeEj()
{
throw EXCEPTION("");
}
s32 _QN4cell5Daisy22ScatterGatherInterlockD1Ev()
{
throw EXCEPTION("");
}
s32 _ZN4cell5Daisy16LFQueue2PushOpenEPNS0_8LFQueue2E()
{
throw EXCEPTION("");
}
s32 _QN4cell5Daisy4Lock18getNextTailPointerEv()
{
throw EXCEPTION("");
}
s32 _QN4cell5Daisy22ScatterGatherInterlock7releaseEv()
{
throw EXCEPTION("");
}
Module cellDaisy("cellDaisy", []()
{
REG_FUNC(cellDaisy, _ZN4cell5Daisy17LFQueue2PushCloseEPNS0_8LFQueue2EPFiPvjE);
REG_FUNC(cellDaisy, _ZN4cell5Daisy21LFQueue2GetPopPointerEPNS0_8LFQueue2EPij);
REG_FUNC(cellDaisy, _QN4cell5Daisy4Lock15completeConsumeEj);
REG_FUNC(cellDaisy, _QN4cell5Daisy9_snprintfEPcjPKcz);
REG_FUNC(cellDaisy, _ZN4cell5Daisy4Lock7popOpenEv);
REG_FUNC(cellDaisy, _ZN4cell5Daisy26LFQueue2CompletePopPointerEPNS0_8LFQueue2EiPFiPvjEj);
REG_FUNC(cellDaisy, _ZN4cell5Daisy22ScatterGatherInterlock7releaseEv);
REG_FUNC(cellDaisy, _QN4cell5Daisy4Lock7popOpenEv);
REG_FUNC(cellDaisy, _ZN4cell5Daisy22ScatterGatherInterlockC1EPVNS0_16_AtomicInterlockEjPjjh);
REG_FUNC(cellDaisy, _QN4cell5Daisy22ScatterGatherInterlockC1EPVNS0_16_AtomicInterlockEjPjjh);
REG_FUNC(cellDaisy, _ZN4cell5Daisy9_snprintfEPcjPKcz);
REG_FUNC(cellDaisy, _ZN4cell5Daisy29LFQueue2HasUnfinishedConsumerEPNS0_8LFQueue2Ej);
REG_FUNC(cellDaisy, _ZN4cell5Daisy4Lock18getNextHeadPointerEv);
REG_FUNC(cellDaisy, _ZN4cell5Daisy4Lock10initializeEj);
REG_FUNC(cellDaisy, _ZN4cell5Daisy22ScatterGatherInterlockC1EPVNS0_16_AtomicInterlockEjPvPFiS5_jE);
REG_FUNC(cellDaisy, _ZN4cell5Daisy22ScatterGatherInterlockC2EPVNS0_16_AtomicInterlockEjPjjh);
REG_FUNC(cellDaisy, _ZN4cell5Daisy4Lock15completeProduceEj);
REG_FUNC(cellDaisy, _QN4cell5Daisy16LFQueue2PushOpenEPNS0_8LFQueue2E);
REG_FUNC(cellDaisy, _QN4cell5Daisy16LFQueue2PopCloseEPNS0_8LFQueue2EPFiPvjE);
REG_FUNC(cellDaisy, _QN4cell5Daisy4Lock8popCloseEv);
REG_FUNC(cellDaisy, _ZN4cell5Daisy4Lock8popCloseEv);
REG_FUNC(cellDaisy, _ZN4cell5Daisy22ScatterGatherInterlockD2Ev);
REG_FUNC(cellDaisy, _QN4cell5Daisy21LFQueue2GetPopPointerEPNS0_8LFQueue2EPij);
REG_FUNC(cellDaisy, _ZN4cell5Daisy4Lock18getNextTailPointerEv);
REG_FUNC(cellDaisy, _ZN4cell5Daisy4Lock8pushOpenEv);
REG_FUNC(cellDaisy, _QN4cell5Daisy29LFQueue2HasUnfinishedConsumerEPNS0_8LFQueue2Ej);
REG_FUNC(cellDaisy, _ZN4cell5Daisy4Lock9pushCloseEv);
REG_FUNC(cellDaisy, _QN4cell5Daisy22ScatterGatherInterlockD2Ev);
REG_FUNC(cellDaisy, _QN4cell5Daisy15LFQueue2PopOpenEPNS0_8LFQueue2E);
REG_FUNC(cellDaisy, _QN4cell5Daisy22ScatterGatherInterlockC1EPVNS0_16_AtomicInterlockEjPvPFiS5_jE);
REG_FUNC(cellDaisy, _ZN4cell5Daisy22ScatterGatherInterlockD1Ev);
REG_FUNC(cellDaisy, _QN4cell5Daisy4Lock10initializeEj);
REG_FUNC(cellDaisy, _QN4cell5Daisy4Lock15completeProduceEj);
REG_FUNC(cellDaisy, _ZN4cell5Daisy16LFQueue2PopCloseEPNS0_8LFQueue2EPFiPvjE);
REG_FUNC(cellDaisy, _ZN4cell5Daisy15LFQueue2PopOpenEPNS0_8LFQueue2E);
REG_FUNC(cellDaisy, _QN4cell5Daisy17LFQueue2PushCloseEPNS0_8LFQueue2EPFiPvjE);
REG_FUNC(cellDaisy, _QN4cell5Daisy22ScatterGatherInterlockC2EPVNS0_16_AtomicInterlockEjPvPFiS5_jE);
REG_FUNC(cellDaisy, _QN4cell5Daisy22ScatterGatherInterlock21proceedSequenceNumberEv);
REG_FUNC(cellDaisy, _ZN4cell5Daisy22ScatterGatherInterlockC2EPVNS0_16_AtomicInterlockEjPvPFiS5_jE);
REG_FUNC(cellDaisy, _QN4cell5Daisy22ScatterGatherInterlockC2EPVNS0_16_AtomicInterlockEjPjjh);
REG_FUNC(cellDaisy, _ZN4cell5Daisy4Lock15completeConsumeEj);
REG_FUNC(cellDaisy, _ZN4cell5Daisy22ScatterGatherInterlock21proceedSequenceNumberEv);
REG_FUNC(cellDaisy, _QN4cell5Daisy4Lock18getNextHeadPointerEv);
REG_FUNC(cellDaisy, _QN4cell5Daisy4Lock9pushCloseEv);
REG_FUNC(cellDaisy, _QN4cell5Daisy26LFQueue2CompletePopPointerEPNS0_8LFQueue2EiPFiPvjEj);
REG_FUNC(cellDaisy, _ZN4cell5Daisy22ScatterGatherInterlock5probeEj);
REG_FUNC(cellDaisy, _QN4cell5Daisy4Lock8pushOpenEv);
REG_FUNC(cellDaisy, _QN4cell5Daisy22ScatterGatherInterlock5probeEj);
REG_FUNC(cellDaisy, _QN4cell5Daisy22ScatterGatherInterlockD1Ev);
REG_FUNC(cellDaisy, _ZN4cell5Daisy16LFQueue2PushOpenEPNS0_8LFQueue2E);
REG_FUNC(cellDaisy, _QN4cell5Daisy4Lock18getNextTailPointerEv);
REG_FUNC(cellDaisy, _QN4cell5Daisy22ScatterGatherInterlock7releaseEv);
});

View file

@ -877,7 +877,7 @@ s32 cellDmuxClose(u32 handle)
return CELL_OK;
}
s32 cellDmuxSetStream(u32 handle, u32 streamAddress, u32 streamSize, bool discontinuity, u64 userData)
s32 cellDmuxSetStream(u32 handle, u32 streamAddress, u32 streamSize, b8 discontinuity, u64 userData)
{
cellDmux.Log("cellDmuxSetStream(handle=0x%x, streamAddress=0x%x, streamSize=%d, discontinuity=%d, userData=0x%llx)", handle, streamAddress, streamSize, discontinuity, userData);

View file

@ -165,7 +165,7 @@ struct CellDmuxType
struct CellDmuxPamfSpecificInfo
{
be_t<u32> thisSize;
bool programEndCodeCb;
b8 programEndCodeCb;
};
struct CellDmuxType2
@ -198,20 +198,20 @@ struct CellDmuxResourceEx
/*
struct CellDmuxResource2Ex
{
bool isResourceEx; //true
b8 isResourceEx; //true
CellDmuxResourceEx resourceEx;
};
struct CellDmuxResource2NoEx
{
bool isResourceEx; //false
b8 isResourceEx; //false
CellDmuxResource resource;
};
*/
struct CellDmuxResource2
{
bool isResourceEx;
b8 isResourceEx;
be_t<u32> memAddr;
be_t<u32> memSize;
be_t<u32> ppuThreadPriority;
@ -219,7 +219,7 @@ struct CellDmuxResource2
be_t<u32> shit[4];
};
using CellDmuxCbMsg = func_def<u32(u32 demuxerHandle, vm::ptr<CellDmuxMsg> demuxerMsg, u32 cbArg)>;
using CellDmuxCbMsg = u32(u32 demuxerHandle, vm::ptr<CellDmuxMsg> demuxerMsg, u32 cbArg);
struct CellDmuxCb
{
@ -227,7 +227,7 @@ struct CellDmuxCb
be_t<u32> cbArg;
};
using CellDmuxCbEsMsg = func_def<u32(u32 demuxerHandle, u32 esHandle, vm::ptr<CellDmuxEsMsg> esMsg, u32 cbArg)>;
using CellDmuxCbEsMsg = u32(u32 demuxerHandle, u32 esHandle, vm::ptr<CellDmuxEsMsg> esMsg, u32 cbArg);
struct CellDmuxEsCb
{
@ -270,7 +270,7 @@ struct CellDmuxAuInfoEx
be_t<u32> auAddr;
be_t<u32> auSize;
be_t<u32> reserved;
bool isRap;
b8 isRap;
be_t<u64> userData;
CellCodecTimeStamp pts;
CellCodecTimeStamp dts;

View file

@ -8,19 +8,23 @@
extern Module cellFont;
std::unique_ptr<CellFontInternal> g_font;
struct font_instance_t
{
std::atomic<bool> init{ false };
}
g_font;
// Functions
s32 cellFontInitializeWithRevision(u64 revisionFlags, vm::ptr<CellFontConfig> config)
{
cellFont.Warning("cellFontInitializeWithRevision(revisionFlags=0x%llx, config=*0x%x)", revisionFlags, config);
if (g_font->m_bInitialized)
if (g_font.init.load())
{
return CELL_FONT_ERROR_ALREADY_INITIALIZED;
}
if (config->FileCache.size < 24)
if (config->fc_size < 24)
{
return CELL_FONT_ERROR_INVALID_PARAMETER;
}
@ -30,11 +34,11 @@ s32 cellFontInitializeWithRevision(u64 revisionFlags, vm::ptr<CellFontConfig> co
cellFont.Error("cellFontInitializeWithRevision: Unknown flags (0x%x)", config->flags);
}
g_font->m_buffer_addr = config->FileCache.buffer_addr;
g_font->m_buffer_size = config->FileCache.size;
g_font->m_userFontEntrys_addr = config->userFontEntrys_addr;
g_font->m_userFontEntryMax = config->userFontEntryMax;
g_font->m_bInitialized = true;
if (g_font.init.exchange(true))
{
throw EXCEPTION("Unexpected");
}
return CELL_OK;
}
@ -44,11 +48,11 @@ s32 cellFontGetRevisionFlags(vm::ptr<u64> revisionFlags)
return CELL_OK;
}
s32 cellFontInit(PPUThread& CPU, vm::ptr<CellFontConfig> config)
s32 cellFontInit(PPUThread& ppu, vm::ptr<CellFontConfig> config)
{
cellFont.Warning("cellFontInit(config=*0x%x)", config);
vm::stackvar<be_t<u64>> revisionFlags(CPU);
vm::stackvar<be_t<u64>> revisionFlags(ppu);
revisionFlags.value() = 0;
cellFontGetRevisionFlags(revisionFlags);
@ -59,12 +63,15 @@ s32 cellFontEnd()
{
cellFont.Warning("cellFontEnd()");
if (!g_font->m_bInitialized)
if (!g_font.init.load())
{
return CELL_FONT_ERROR_UNINITIALIZED;
}
g_font->m_bInitialized = false;
if (!g_font.init.exchange(false))
{
throw EXCEPTION("Unexpected");
}
return CELL_OK;
}
@ -79,7 +86,7 @@ s32 cellFontOpenFontMemory(vm::ptr<CellFontLibrary> library, u32 fontAddr, u32 f
{
cellFont.Warning("cellFontOpenFontMemory(library=*0x%x, fontAddr=0x%x, fontSize=%d, subNum=%d, uniqueId=%d, font=*0x%x)", library, fontAddr, fontSize, subNum, uniqueId, font);
if (!g_font->m_bInitialized)
if (!g_font.init.load())
{
return CELL_FONT_ERROR_UNINITIALIZED;
}
@ -115,11 +122,11 @@ s32 cellFontOpenFontFile(vm::ptr<CellFontLibrary> library, vm::cptr<char> fontPa
return ret;
}
s32 cellFontOpenFontset(PPUThread& CPU, vm::ptr<CellFontLibrary> library, vm::ptr<CellFontType> fontType, vm::ptr<CellFont> font)
s32 cellFontOpenFontset(PPUThread& ppu, vm::ptr<CellFontLibrary> library, vm::ptr<CellFontType> fontType, vm::ptr<CellFont> font)
{
cellFont.Warning("cellFontOpenFontset(library=*0x%x, fontType=*0x%x, font=*0x%x)", library, fontType, font);
if (!g_font->m_bInitialized)
if (!g_font.init.load())
{
return CELL_FONT_ERROR_UNINITIALIZED;
}
@ -195,7 +202,7 @@ s32 cellFontOpenFontset(PPUThread& CPU, vm::ptr<CellFontLibrary> library, vm::pt
return CELL_FONT_ERROR_NO_SUPPORT_FONTSET;
}
vm::stackvar<char> f(CPU, (u32)file.length() + 1, 1);
vm::stackvar<char> f(ppu, (u32)file.length() + 1, 1);
memcpy(f.get_ptr(), file.c_str(), file.size() + 1);
s32 ret = cellFontOpenFontFile(library, f, 0, 0, font); //TODO: Find the correct values of subNum, uniqueId
font->origin = CELL_FONT_OPEN_FONTSET;
@ -227,7 +234,7 @@ s32 cellFontCreateRenderer(vm::ptr<CellFontLibrary> library, vm::ptr<CellFontRen
{
cellFont.Todo("cellFontCreateRenderer(library=*0x%x, config=*0x%x, Renderer=*0x%x)", library, config, Renderer);
if (!g_font->m_bInitialized)
if (!g_font.init.load())
{
return CELL_FONT_ERROR_UNINITIALIZED;
}
@ -241,26 +248,21 @@ void cellFontRenderSurfaceInit(vm::ptr<CellFontRenderSurface> surface, vm::ptr<v
{
cellFont.Warning("cellFontRenderSurfaceInit(surface=*0x%x, buffer=*0x%x, bufferWidthByte=%d, pixelSizeByte=%d, w=%d, h=%d)", surface, buffer, bufferWidthByte, pixelSizeByte, w, h);
surface->buffer_addr = buffer.addr();
surface->widthByte = bufferWidthByte;
surface->pixelSizeByte = pixelSizeByte;
surface->width = w;
surface->height = h;
if (!buffer)
{
surface->buffer_addr = vm::alloc(bufferWidthByte * h, vm::main); // TODO: Huge memory leak
}
surface->buffer = buffer;
surface->widthByte = bufferWidthByte;
surface->pixelSizeByte = pixelSizeByte;
surface->width = w;
surface->height = h;
}
void cellFontRenderSurfaceSetScissor(vm::ptr<CellFontRenderSurface> surface, s32 x0, s32 y0, s32 w, s32 h)
{
cellFont.Warning("cellFontRenderSurfaceSetScissor(surface=*0x%x, x0=%d, y0=%d, w=%d, h=%d)", surface, x0, y0, w, h);
surface->Scissor.x0 = x0;
surface->Scissor.y0 = y0;
surface->Scissor.x1 = w;
surface->Scissor.y1 = h;
surface->sc_x0 = x0;
surface->sc_y0 = y0;
surface->sc_x1 = w;
surface->sc_y1 = h;
}
s32 cellFontSetScalePixel(vm::ptr<CellFont> font, float w, float h)
@ -374,7 +376,7 @@ s32 cellFontRenderCharGlyphImage(vm::ptr<CellFont> font, u32 code, vm::ptr<CellF
baseLineY = (int)((float)ascent * scale); // ???
// Move the rendered character to the surface
unsigned char* buffer = vm::get_ptr<unsigned char>(surface->buffer_addr);
unsigned char* buffer = vm::get_ptr<unsigned char>(surface->buffer.addr());
for (u32 ypos = 0; ypos < (u32)height; ypos++)
{
if ((u32)y + ypos + yoff + baseLineY >= surface->height)
@ -457,12 +459,12 @@ s32 cellFontGetCharGlyphMetrics(vm::ptr<CellFont> font, u32 code, vm::ptr<CellFo
// TODO: Add the rest of the information
metrics->width = (x1-x0) * scale;
metrics->height = (y1-y0) * scale;
metrics->Horizontal.bearingX = (float)leftSideBearing * scale;
metrics->Horizontal.bearingY = 0.f;
metrics->Horizontal.advance = (float)advanceWidth * scale;
metrics->Vertical.bearingX = 0.f;
metrics->Vertical.bearingY = 0.f;
metrics->Vertical.advance = 0.f;
metrics->h_bearingX = (float)leftSideBearing * scale;
metrics->h_bearingY = 0.f;
metrics->h_advance = (float)advanceWidth * scale;
metrics->v_bearingX = 0.f;
metrics->v_bearingY = 0.f;
metrics->v_advance = 0.f;
return CELL_OK;
}
@ -473,11 +475,11 @@ s32 cellFontGraphicsSetFontRGBA()
return CELL_OK;
}
s32 cellFontOpenFontsetOnMemory(PPUThread& CPU, vm::ptr<CellFontLibrary> library, vm::ptr<CellFontType> fontType, vm::ptr<CellFont> font)
s32 cellFontOpenFontsetOnMemory(PPUThread& ppu, vm::ptr<CellFontLibrary> library, vm::ptr<CellFontType> fontType, vm::ptr<CellFont> font)
{
cellFont.Todo("cellFontOpenFontsetOnMemory(library=*0x%x, fontType=*0x%x, font=*0x%x)", library, fontType, font);
if (!g_font->m_bInitialized)
if (!g_font.init.load())
{
return CELL_FONT_ERROR_UNINITIALIZED;
}
@ -632,7 +634,7 @@ s32 cellFontGetCharGlyphMetricsVertical()
Module cellFont("cellFont", []()
{
g_font = std::make_unique<CellFontInternal>();
g_font.init = false;
REG_FUNC(cellFont, cellFontInit);
REG_FUNC(cellFont, cellFontSetFontsetOpenMode);

View file

@ -32,21 +32,6 @@ enum
CELL_FONT_ERROR_NO_SUPPORT_SURFACE = 0x80540040,
};
struct CellFontLibrary
{
u32 libraryType, libraryVersion;
//u32 SystemClosed[];
};
struct CellFontMemoryInterface
{
u32 Object_addr; //void*
//CellFontMallocCallback Malloc;
//CellFontFreeCallback Free;
//CellFontReallocCallback Realloc;
//CellFontCallocCallback Calloc;
};
// Font Set Types
enum
{
@ -115,24 +100,6 @@ enum
CELL_FONT_MAP_UNICODE = 1,
};
struct CellFontConfig
{
struct
{
be_t<u32> buffer_addr;
be_t<u32> size;
} FileCache;
be_t<u32> userFontEntryMax;
be_t<u32> userFontEntrys_addr;
be_t<u32> flags;
};
struct CellFontRenderer
{
void *systemReserved[64];
};
//Custom enum to determine the origin of a CellFont object
enum
{
@ -142,20 +109,46 @@ enum
CELL_FONT_OPEN_MEMORY,
};
struct stbtt_fontinfo;
struct CellFont
using CellFontMallocCallback = vm::ptr<void>(vm::ptr<void> arg, u32 size);
using CellFontFreeCallback = void(vm::ptr<void> arg, vm::ptr<void> ptr);
using CellFontReallocCallback = vm::ptr<void>(vm::ptr<void> arg, vm::ptr<void> p, u32 reallocSize);
using CellFontCallocCallback = vm::ptr<void>(vm::ptr<void> arg, u32 num, u32 size);
struct CellFontMemoryInterface
{
//void* SystemReserved[64];
be_t<float> scale_x;
be_t<float> scale_y;
be_t<float> slant;
be_t<u32> renderer_addr;
vm::bptr<void> arg;
vm::bptr<CellFontMallocCallback> malloc;
vm::bptr<CellFontFreeCallback> free;
vm::bptr<CellFontReallocCallback> realloc;
vm::bptr<CellFontCallocCallback> calloc;
};
be_t<u32> fontdata_addr;
be_t<u32> origin;
stbtt_fontinfo* stbfont;
// hack: don't place anything after pointer
struct CellFontEntry
{
be_t<u32> lock;
be_t<u32> uniqueId;
vm::bcptr<void> fontLib;
vm::bptr<void> fontH;
};
struct CellFontConfig
{
// FileCache
vm::bptr<u32> fc_buffer;
be_t<u32> fc_size;
be_t<u32> userFontEntryMax;
vm::bptr<CellFontEntry> userFontEntrys;
be_t<u32> flags;
};
struct CellFontLibrary
{
be_t<u32> libraryType;
be_t<u32> libraryVersion;
// ...
};
struct CellFontType
@ -164,119 +157,89 @@ struct CellFontType
be_t<u32> map;
};
struct CellFontInitGraphicsConfigGcm
{
be_t<u32> configType;
struct
{
be_t<u32> address;
be_t<u32> size;
} GraphicsMemory;
struct
{
be_t<u32> address;
be_t<u32> size;
} MappedMainMemory;
struct
{
be_t<s16> slotNumber;
be_t<s16> slotCount;
} VertexShader;
};
struct CellFontGraphics
{
u32 graphicsType;
u32 SystemClosed_addr;
};
struct CellFontHorizontalLayout
{
be_t<float> baseLineY;
be_t<float> lineHeight;
be_t<float> effectHeight;
be_t<f32> baseLineY;
be_t<f32> lineHeight;
be_t<f32> effectHeight;
};
struct CellFontVerticalLayout
{
be_t<float> baseLineX;
be_t<float> lineWidth;
be_t<float> effectWidth;
be_t<f32> baseLineX;
be_t<f32> lineWidth;
be_t<f32> effectWidth;
};
struct CellFontGlyphMetrics
{
be_t<float> width;
be_t<float> height;
be_t<f32> width;
be_t<f32> height;
struct
{
be_t<float> bearingX;
be_t<float> bearingY;
be_t<float> advance;
} Horizontal;
be_t<f32> h_bearingX;
be_t<f32> h_bearingY;
be_t<f32> h_advance;
struct
{
be_t<float> bearingX;
be_t<float> bearingY;
be_t<float> advance;
} Vertical;
};
struct CellFontImageTransInfo
{
be_t<u32> Image_addr;
be_t<u32> imageWidthByte;
be_t<u32> imageWidth;
be_t<u32> imageHeight;
be_t<u32> Surface_addr;
be_t<u32> surfWidthByte;
};
struct CellFontRendererConfig
{
struct BufferingPolicy
{
be_t<u32> buffer;
be_t<u32> initSize;
be_t<u32> maxSize;
be_t<u32> expandSize;
be_t<u32> resetSize;
};
be_t<f32> v_bearingX;
be_t<f32> v_bearingY;
be_t<f32> v_advance;
};
struct CellFontRenderSurface
{
be_t<u32> buffer_addr;
be_t<u32> widthByte;
be_t<u32> pixelSizeByte;
be_t<u32> width, height;
vm::bptr<void> buffer;
be_t<s32> widthByte;
be_t<s32> pixelSizeByte;
be_t<s32> width;
be_t<s32> height;
struct
{
be_t<u32> x0, y0;
be_t<u32> x1, y1;
} Scissor;
// Scissor
be_t<u32> sc_x0;
be_t<u32> sc_y0;
be_t<u32> sc_x1;
be_t<u32> sc_y1;
};
// Internal Datatypes
struct CellFontInternal //Module cellFont
struct CellFontImageTransInfo
{
u32 m_buffer_addr, m_buffer_size;
u32 m_userFontEntrys_addr, m_userFontEntryMax;
vm::bptr<u8> image;
be_t<u32> imageWidthByte;
be_t<u32> imageWidth;
be_t<u32> imageHeight;
vm::bptr<void> surface;
be_t<u32> surfWidthByte;
};
bool m_bInitialized;
bool m_bFontGcmInitialized;
struct CellFont
{
be_t<float> scale_x;
be_t<float> scale_y;
be_t<float> slant;
be_t<u32> renderer_addr;
CellFontInternal()
: m_buffer_addr(0)
, m_buffer_size(0)
, m_bInitialized(false)
, m_bFontGcmInitialized(false)
{
}
};
be_t<u32> fontdata_addr;
be_t<u32> origin;
struct stbtt_fontinfo* stbfont;
// hack: don't place anything after pointer
};
struct CellFontRendererConfig
{
// Buffering Policy
vm::bptr<void> buffer;
be_t<u32> initSize;
be_t<u32> maxSize;
be_t<u32> expandSize;
be_t<u32> resetSize;
};
struct CellFontRenderer
{
void *systemReserved[64];
};
struct CellFontGraphics
{
be_t<u32> graphicsType;
// ...
};

View file

@ -2,20 +2,14 @@
#include "Emu/Memory/Memory.h"
#include "Emu/SysCalls/Modules.h"
#include "cellFont.h"
#include "cellFontFT.h"
extern Module cellFontFT;
CCellFontFTInternal* s_fontFtInternalInstance = nullptr;
s32 cellFontInitLibraryFreeTypeWithRevision(u64 revisionFlags, vm::ptr<CellFontLibraryConfigFT> config, vm::pptr<CellFontLibrary> lib)
{
cellFontFT.Warning("cellFontInitLibraryFreeTypeWithRevision(revisionFlags=0x%llx, config=*0x%x, lib=**0x%x)", revisionFlags, config, lib);
//if (s_fontInternalInstance->m_bInitialized)
//return CELL_FONT_ERROR_UNINITIALIZED;
lib->set(vm::alloc(sizeof(CellFontLibrary), vm::main));
return CELL_OK;
@ -35,13 +29,6 @@ s32 cellFontFTGetInitializedRevisionFlags()
Module cellFontFT("cellFontFT", []()
{
s_fontFtInternalInstance = new CCellFontFTInternal();
cellFontFT.on_stop = []()
{
delete s_fontFtInternalInstance;
};
REG_FUNC(cellFontFT, cellFontInitLibraryFreeTypeWithRevision);
REG_FUNC(cellFontFT, cellFontFTGetRevisionFlags);
REG_FUNC(cellFontFT, cellFontFTGetInitializedRevisionFlags);

View file

@ -1,30 +1,13 @@
#pragma once
#include "cellFont.h"
namespace vm { using namespace ps3; }
struct CellFontLibraryConfigFT
{
u32 library_addr; //void*
vm::bptr<void> library;
CellFontMemoryInterface MemoryIF;
};
struct CellFontRendererConfigFT
{
struct {
u32 buffer_addr; //void*
u32 initSize;
u32 maxSize;
u32 expandSize;
u32 resetSize;
} BufferingPolicy;
};
struct CCellFontFTInternal
{
bool m_bInitialized;
CCellFontFTInternal()
: m_bInitialized(false)
{
}
};
using CellFontRendererConfigFT = CellFontRendererConfig;

View file

@ -14,6 +14,8 @@
extern Module cellFs;
extern u32 _fd_to_id(u32 fd);
s32 cellFsOpen(vm::cptr<char> path, s32 flags, vm::ptr<u32> fd, vm::cptr<void> arg, u64 size)
{
cellFs.Warning("cellFsOpen(path=*0x%x, flags=%#o, fd=*0x%x, arg=*0x%x, size=0x%llx) -> sys_fs_open()", path, flags, fd, arg, size);
@ -207,9 +209,9 @@ s32 cellFsGetFreeSize(vm::cptr<char> path, vm::ptr<u32> block_size, vm::ptr<u64>
s32 cellFsGetDirectoryEntries(u32 fd, vm::ptr<CellFsDirectoryEntry> entries, u32 entries_size, vm::ptr<u32> data_count)
{
cellFs.Warning("cellFsGetDirectoryEntries(fd=0x%x, entries=*0x%x, entries_size=0x%x, data_count=*0x%x)", fd, entries, entries_size, data_count);
cellFs.Warning("cellFsGetDirectoryEntries(fd=%d, entries=*0x%x, entries_size=0x%x, data_count=*0x%x)", fd, entries, entries_size, data_count);
const auto directory = Emu.GetIdManager().get<lv2_dir_t>(fd);
const auto directory = Emu.GetIdManager().get<lv2_dir_t>(_fd_to_id(fd));
if (!directory)
{
@ -250,11 +252,11 @@ s32 cellFsGetDirectoryEntries(u32 fd, vm::ptr<CellFsDirectoryEntry> entries, u32
s32 cellFsReadWithOffset(u32 fd, u64 offset, vm::ptr<void> buf, u64 buffer_size, vm::ptr<u64> nread)
{
cellFs.Log("cellFsReadWithOffset(fd=0x%x, offset=0x%llx, buf=*0x%x, buffer_size=0x%llx, nread=*0x%x)", fd, offset, buf, buffer_size, nread);
cellFs.Log("cellFsReadWithOffset(fd=%d, offset=0x%llx, buf=*0x%x, buffer_size=0x%llx, nread=*0x%x)", fd, offset, buf, buffer_size, nread);
// TODO: use single sys_fs_fcntl syscall
const auto file = Emu.GetIdManager().get<lv2_file_t>(fd);
const auto file = Emu.GetIdManager().get<lv2_file_t>(_fd_to_id(fd));
if (!file || file->flags & CELL_FS_O_WRONLY)
{
@ -281,11 +283,11 @@ s32 cellFsReadWithOffset(u32 fd, u64 offset, vm::ptr<void> buf, u64 buffer_size,
s32 cellFsWriteWithOffset(u32 fd, u64 offset, vm::cptr<void> buf, u64 data_size, vm::ptr<u64> nwrite)
{
cellFs.Log("cellFsWriteWithOffset(fd=0x%x, offset=0x%llx, buf=*0x%x, data_size=0x%llx, nwrite=*0x%x)", fd, offset, buf, data_size, nwrite);
cellFs.Log("cellFsWriteWithOffset(fd=%d, offset=0x%llx, buf=*0x%x, data_size=0x%llx, nwrite=*0x%x)", fd, offset, buf, data_size, nwrite);
// TODO: use single sys_fs_fcntl syscall
const auto file = Emu.GetIdManager().get<lv2_file_t>(fd);
const auto file = Emu.GetIdManager().get<lv2_file_t>(_fd_to_id(fd));
if (!file || !(file->flags & CELL_FS_O_ACCMODE))
{
@ -312,7 +314,7 @@ s32 cellFsWriteWithOffset(u32 fd, u64 offset, vm::cptr<void> buf, u64 data_size,
s32 cellFsStReadInit(u32 fd, vm::cptr<CellFsRingBuffer> ringbuf)
{
cellFs.Warning("cellFsStReadInit(fd=0x%x, ringbuf=*0x%x)", fd, ringbuf);
cellFs.Warning("cellFsStReadInit(fd=%d, ringbuf=*0x%x)", fd, ringbuf);
if (ringbuf->copy & ~CELL_FS_ST_COPYLESS)
{
@ -329,7 +331,7 @@ s32 cellFsStReadInit(u32 fd, vm::cptr<CellFsRingBuffer> ringbuf)
return CELL_FS_EINVAL;
}
const auto file = Emu.GetIdManager().get<lv2_file_t>(fd);
const auto file = Emu.GetIdManager().get<lv2_file_t>(_fd_to_id(fd));
if (!file)
{
@ -365,9 +367,9 @@ s32 cellFsStReadInit(u32 fd, vm::cptr<CellFsRingBuffer> ringbuf)
s32 cellFsStReadFinish(u32 fd)
{
cellFs.Warning("cellFsStReadFinish(fd=0x%x)", fd);
cellFs.Warning("cellFsStReadFinish(fd=%d)", fd);
const auto file = Emu.GetIdManager().get<lv2_file_t>(fd);
const auto file = Emu.GetIdManager().get<lv2_file_t>(_fd_to_id(fd));
if (!file)
{
@ -388,9 +390,9 @@ s32 cellFsStReadFinish(u32 fd)
s32 cellFsStReadGetRingBuf(u32 fd, vm::ptr<CellFsRingBuffer> ringbuf)
{
cellFs.Warning("cellFsStReadGetRingBuf(fd=0x%x, ringbuf=*0x%x)", fd, ringbuf);
cellFs.Warning("cellFsStReadGetRingBuf(fd=%d, ringbuf=*0x%x)", fd, ringbuf);
const auto file = Emu.GetIdManager().get<lv2_file_t>(fd);
const auto file = Emu.GetIdManager().get<lv2_file_t>(_fd_to_id(fd));
if (!file)
{
@ -412,9 +414,9 @@ s32 cellFsStReadGetRingBuf(u32 fd, vm::ptr<CellFsRingBuffer> ringbuf)
s32 cellFsStReadGetStatus(u32 fd, vm::ptr<u64> status)
{
cellFs.Warning("cellFsStReadGetRingBuf(fd=0x%x, status=*0x%x)", fd, status);
cellFs.Warning("cellFsStReadGetRingBuf(fd=%d, status=*0x%x)", fd, status);
const auto file = Emu.GetIdManager().get<lv2_file_t>(fd);
const auto file = Emu.GetIdManager().get<lv2_file_t>(_fd_to_id(fd));
if (!file)
{
@ -446,9 +448,9 @@ s32 cellFsStReadGetStatus(u32 fd, vm::ptr<u64> status)
s32 cellFsStReadGetRegid(u32 fd, vm::ptr<u64> regid)
{
cellFs.Warning("cellFsStReadGetRingBuf(fd=0x%x, regid=*0x%x)", fd, regid);
cellFs.Warning("cellFsStReadGetRingBuf(fd=%d, regid=*0x%x)", fd, regid);
const auto file = Emu.GetIdManager().get<lv2_file_t>(fd);
const auto file = Emu.GetIdManager().get<lv2_file_t>(_fd_to_id(fd));
if (!file)
{
@ -467,9 +469,9 @@ s32 cellFsStReadGetRegid(u32 fd, vm::ptr<u64> regid)
s32 cellFsStReadStart(u32 fd, u64 offset, u64 size)
{
cellFs.Warning("cellFsStReadStart(fd=0x%x, offset=0x%llx, size=0x%llx)", fd, offset, size);
cellFs.Warning("cellFsStReadStart(fd=%d, offset=0x%llx, size=0x%llx)", fd, offset, size);
const auto file = Emu.GetIdManager().get<lv2_file_t>(fd);
const auto file = Emu.GetIdManager().get<lv2_file_t>(_fd_to_id(fd));
if (!file)
{
@ -548,9 +550,9 @@ s32 cellFsStReadStart(u32 fd, u64 offset, u64 size)
s32 cellFsStReadStop(u32 fd)
{
cellFs.Warning("cellFsStReadStop(fd=0x%x)", fd);
cellFs.Warning("cellFsStReadStop(fd=%d)", fd);
const auto file = Emu.GetIdManager().get<lv2_file_t>(fd);
const auto file = Emu.GetIdManager().get<lv2_file_t>(_fd_to_id(fd));
if (!file)
{
@ -579,9 +581,9 @@ s32 cellFsStReadStop(u32 fd)
s32 cellFsStRead(u32 fd, vm::ptr<u8> buf, u64 size, vm::ptr<u64> rsize)
{
cellFs.Warning("cellFsStRead(fd=0x%x, buf=*0x%x, size=0x%llx, rsize=*0x%x)", fd, buf, size, rsize);
cellFs.Warning("cellFsStRead(fd=%d, buf=*0x%x, size=0x%llx, rsize=*0x%x)", fd, buf, size, rsize);
const auto file = Emu.GetIdManager().get<lv2_file_t>(fd);
const auto file = Emu.GetIdManager().get<lv2_file_t>(_fd_to_id(fd));
if (!file)
{
@ -613,9 +615,9 @@ s32 cellFsStRead(u32 fd, vm::ptr<u8> buf, u64 size, vm::ptr<u64> rsize)
s32 cellFsStReadGetCurrentAddr(u32 fd, vm::ptr<u32> addr, vm::ptr<u64> size)
{
cellFs.Warning("cellFsStReadGetCurrentAddr(fd=0x%x, addr=*0x%x, size=*0x%x)", fd, addr, size);
cellFs.Warning("cellFsStReadGetCurrentAddr(fd=%d, addr=*0x%x, size=*0x%x)", fd, addr, size);
const auto file = Emu.GetIdManager().get<lv2_file_t>(fd);
const auto file = Emu.GetIdManager().get<lv2_file_t>(_fd_to_id(fd));
if (!file)
{
@ -646,9 +648,9 @@ s32 cellFsStReadGetCurrentAddr(u32 fd, vm::ptr<u32> addr, vm::ptr<u64> size)
s32 cellFsStReadPutCurrentAddr(u32 fd, vm::ptr<u8> addr, u64 size)
{
cellFs.Warning("cellFsStReadPutCurrentAddr(fd=0x%x, addr=*0x%x, size=0x%llx)", fd, addr, size);
cellFs.Warning("cellFsStReadPutCurrentAddr(fd=%d, addr=*0x%x, size=0x%llx)", fd, addr, size);
const auto file = Emu.GetIdManager().get<lv2_file_t>(fd);
const auto file = Emu.GetIdManager().get<lv2_file_t>(_fd_to_id(fd));
if (!file)
{
@ -673,9 +675,9 @@ s32 cellFsStReadPutCurrentAddr(u32 fd, vm::ptr<u8> addr, u64 size)
s32 cellFsStReadWait(u32 fd, u64 size)
{
cellFs.Warning("cellFsStReadWait(fd=0x%x, size=0x%llx)", fd, size);
cellFs.Warning("cellFsStReadWait(fd=%d, size=0x%llx)", fd, size);
const auto file = Emu.GetIdManager().get<lv2_file_t>(fd);
const auto file = Emu.GetIdManager().get<lv2_file_t>(_fd_to_id(fd));
if (!file)
{
@ -702,9 +704,9 @@ s32 cellFsStReadWait(u32 fd, u64 size)
s32 cellFsStReadWaitCallback(u32 fd, u64 size, fs_st_cb_t func)
{
cellFs.Warning("cellFsStReadWaitCallback(fd=0x%x, size=0x%llx, func=*0x%x)", fd, size, func);
cellFs.Warning("cellFsStReadWaitCallback(fd=%d, size=0x%llx, func=*0x%x)", fd, size, func);
const auto file = Emu.GetIdManager().get<lv2_file_t>(fd);
const auto file = Emu.GetIdManager().get<lv2_file_t>(_fd_to_id(fd));
if (!file)
{
@ -867,12 +869,12 @@ using fs_aio_cb_t = vm::ptr<void(vm::ptr<CellFsAio> xaio, s32 error, s32 xid, u6
void fsAio(vm::ptr<CellFsAio> aio, bool write, s32 xid, fs_aio_cb_t func)
{
cellFs.Notice("FS AIO Request(%d): fd=0x%x, offset=0x%llx, buf=*0x%x, size=0x%llx, user_data=0x%llx", xid, aio->fd, aio->offset, aio->buf, aio->size, aio->user_data);
cellFs.Notice("FS AIO Request(%d): fd=%d, offset=0x%llx, buf=*0x%x, size=0x%llx, user_data=0x%llx", xid, aio->fd, aio->offset, aio->buf, aio->size, aio->user_data);
s32 error = CELL_OK;
u64 result = 0;
const auto file = Emu.GetIdManager().get<lv2_file_t>(aio->fd);
const auto file = Emu.GetIdManager().get<lv2_file_t>(_fd_to_id(aio->fd));
if (!file || (!write && file->flags & CELL_FS_O_WRONLY) || (write && !(file->flags & CELL_FS_O_ACCMODE)))
{
@ -964,9 +966,9 @@ s32 cellFsSetDefaultContainer(u32 id, u32 total_limit)
s32 cellFsSetIoBufferFromDefaultContainer(u32 fd, u32 buffer_size, u32 page_type)
{
cellFs.Todo("cellFsSetIoBufferFromDefaultContainer(fd=0x%x, buffer_size=%d, page_type=%d)", fd, buffer_size, page_type);
cellFs.Todo("cellFsSetIoBufferFromDefaultContainer(fd=%d, buffer_size=%d, page_type=%d)", fd, buffer_size, page_type);
const auto file = Emu.GetIdManager().get<lv2_file_t>(fd);
const auto file = Emu.GetIdManager().get<lv2_file_t>(_fd_to_id(fd));
if (!file)
{

View file

@ -89,6 +89,43 @@ s32 cellHddGameCheck(PPUThread& CPU, u32 version, vm::cptr<char> dirName, u32 er
return CELL_OK;
}
s32 cellHddGameCheck2()
{
throw EXCEPTION("");
}
s32 cellHddGameGetSizeKB()
{
throw EXCEPTION("");
}
s32 cellHddGameSetSystemVer()
{
throw EXCEPTION("");
}
s32 cellHddGameExitBroken()
{
throw EXCEPTION("");
}
s32 cellGameDataGetSizeKB()
{
throw EXCEPTION("");
}
s32 cellGameDataSetSystemVer()
{
throw EXCEPTION("");
}
s32 cellGameDataExitBroken()
{
throw EXCEPTION("");
}
s32 cellGameBootCheck(vm::ptr<u32> type, vm::ptr<u32> attributes, vm::ptr<CellGameContentSize> size, vm::ptr<char[CELL_GAME_DIRNAME_SIZE]> dirName)
{
cellGame.Warning("cellGameBootCheck(type=*0x%x, attributes=*0x%x, size=*0x%x, dirName=*0x%x)", type, attributes, size, dirName);
@ -575,14 +612,63 @@ s32 cellGameThemeInstallFromBuffer()
return CELL_OK;
}
s32 cellDiscGameGetBootDiscInfo()
{
throw EXCEPTION("");
}
s32 cellDiscGameRegisterDiscChangeCallback()
{
throw EXCEPTION("");
}
s32 cellDiscGameUnregisterDiscChangeCallback()
{
throw EXCEPTION("");
}
s32 cellGameRegisterDiscChangeCallback()
{
throw EXCEPTION("");
}
s32 cellGameUnregisterDiscChangeCallback()
{
throw EXCEPTION("");
}
void cellSysutil_GameData_init()
{
extern Module cellSysutil;
REG_FUNC(cellSysutil, cellHddGameCheck);
REG_FUNC(cellSysutil, cellHddGameCheck2);
REG_FUNC(cellSysutil, cellHddGameGetSizeKB);
REG_FUNC(cellSysutil, cellHddGameSetSystemVer);
REG_FUNC(cellSysutil, cellHddGameExitBroken);
REG_FUNC(cellSysutil, cellGameDataGetSizeKB);
REG_FUNC(cellSysutil, cellGameDataSetSystemVer);
REG_FUNC(cellSysutil, cellGameDataExitBroken);
REG_FUNC(cellSysutil, cellGameDataCheckCreate);
REG_FUNC(cellSysutil, cellGameDataCheckCreate2);
REG_FUNC(cellSysutil, cellDiscGameGetBootDiscInfo);
REG_FUNC(cellSysutil, cellDiscGameRegisterDiscChangeCallback);
REG_FUNC(cellSysutil, cellDiscGameUnregisterDiscChangeCallback);
REG_FUNC(cellSysutil, cellGameRegisterDiscChangeCallback);
REG_FUNC(cellSysutil, cellGameUnregisterDiscChangeCallback);
}
Module cellGame("cellGame", []()
{
contentInfo = "";
usrdir = "";
path_set = false;
// (TODO: Disc Exchange functions missing)
REG_FUNC(cellGame, cellGameBootCheck);
REG_FUNC(cellGame, cellGamePatchCheck);
REG_FUNC(cellGame, cellGameDataCheck);
@ -592,7 +678,6 @@ Module cellGame("cellGame", []()
REG_FUNC(cellGame, cellGameDeleteGameData);
REG_FUNC(cellGame, cellGameGetParamInt);
//cellGame.AddFunc(, cellGameSetParamInt);
REG_FUNC(cellGame, cellGameGetParamString);
REG_FUNC(cellGame, cellGameSetParamString);
REG_FUNC(cellGame, cellGameGetSizeKB);
@ -603,17 +688,4 @@ Module cellGame("cellGame", []()
REG_FUNC(cellGame, cellGameThemeInstall);
REG_FUNC(cellGame, cellGameThemeInstallFromBuffer);
//cellGame.AddFunc(, CellGameThemeInstallCallback);
});
void cellSysutil_GameData_init()
{
REG_FUNC(cellGame, cellHddGameCheck);
//REG_FUNC(cellGame, cellHddGameCheck2);
//REG_FUNC(cellGame, cellHddGameGetSizeKB);
//REG_FUNC(cellGame, cellHddGameSetSystemVer);
//REG_FUNC(cellGame, cellHddGameExitBroken);
REG_FUNC(cellGame, cellGameDataCheckCreate);
REG_FUNC(cellGame, cellGameDataCheckCreate2);
}

View file

@ -0,0 +1,46 @@
#include "stdafx.h"
#include "Emu/Memory/Memory.h"
#include "Emu/SysCalls/Modules.h"
extern Module cellGameExec;
s32 cellGameSetExitParam()
{
throw EXCEPTION("");
}
s32 cellGameGetHomeDataExportPath()
{
throw EXCEPTION("");
}
s32 cellGameGetHomePath()
{
throw EXCEPTION("");
}
s32 cellGameGetHomeDataImportPath()
{
throw EXCEPTION("");
}
s32 cellGameGetHomeLaunchOptionPath()
{
throw EXCEPTION("");
}
s32 cellGameGetBootGameInfo()
{
throw EXCEPTION("");
}
Module cellGameExec("cellGameExec", []()
{
REG_FUNC(cellGameExec, cellGameSetExitParam);
REG_FUNC(cellGameExec, cellGameGetHomeDataExportPath);
REG_FUNC(cellGameExec, cellGameGetHomePath);
REG_FUNC(cellGameExec, cellGameGetHomeDataImportPath);
REG_FUNC(cellGameExec, cellGameGetHomeLaunchOptionPath);
REG_FUNC(cellGameExec, cellGameGetBootGameInfo);
});

View file

@ -320,9 +320,9 @@ void _cellGcmFunc15(vm::ptr<CellGcmContextData> context)
u32 g_defaultCommandBufferBegin, g_defaultCommandBufferFragmentCount;
// Called by cellGcmInit
s32 _cellGcmInitBody(vm::ptr<CellGcmContextData> context, u32 cmdSize, u32 ioSize, u32 ioAddress)
s32 _cellGcmInitBody(vm::pptr<CellGcmContextData> context, u32 cmdSize, u32 ioSize, u32 ioAddress)
{
cellGcmSys.Warning("_cellGcmInitBody(context=*0x%x, cmdSize=0x%x, ioSize=0x%x, ioAddress=0x%x)", context, cmdSize, ioSize, ioAddress);
cellGcmSys.Warning("_cellGcmInitBody(context=**0x%x, cmdSize=0x%x, ioSize=0x%x, ioAddress=0x%x)", context, cmdSize, ioSize, ioAddress);
if(!local_size && !local_addr)
{
@ -365,8 +365,8 @@ s32 _cellGcmInitBody(vm::ptr<CellGcmContextData> context, u32 cmdSize, u32 ioSiz
g_defaultCommandBufferBegin = ioAddress;
g_defaultCommandBufferFragmentCount = cmdSize / (32 * 1024);
current_context.begin = g_defaultCommandBufferBegin + 4096; // 4 kb reserved at the beginning
current_context.end = g_defaultCommandBufferBegin + 32 * 1024 - 4; // 4b at the end for jump
current_context.begin.set(g_defaultCommandBufferBegin + 4096); // 4 kb reserved at the beginning
current_context.end.set(g_defaultCommandBufferBegin + 32 * 1024 - 4); // 4b at the end for jump
current_context.current = current_context.begin;
current_context.callback.set(Emu.GetRSXCallback() - 4);
@ -376,7 +376,7 @@ s32 _cellGcmInitBody(vm::ptr<CellGcmContextData> context, u32 cmdSize, u32 ioSiz
gcm_info.label_addr = vm::alloc(0x1000, vm::main); // ???
vm::get_ref<CellGcmContextData>(gcm_info.context_addr) = current_context;
vm::write32(context.addr(), gcm_info.context_addr);
context->set(gcm_info.context_addr);
auto& ctrl = vm::get_ref<CellGcmControl>(gcm_info.control_addr);
ctrl.put.store(0);
@ -480,59 +480,46 @@ void cellGcmSetFlipStatus()
Emu.GetGSManager().GetRender().m_flip_status = 0;
}
s32 cellGcmSetPrepareFlip(PPUThread& CPU, vm::ptr<CellGcmContextData> ctxt, u32 id)
s32 cellGcmSetPrepareFlip(PPUThread& ppu, vm::ptr<CellGcmContextData> ctxt, u32 id)
{
cellGcmSys.Log("cellGcmSetPrepareFlip(ctx=0x%x, id=0x%x)", ctxt.addr(), id);
cellGcmSys.Log("cellGcmSetPrepareFlip(ctx=*0x%x, id=0x%x)", ctxt, id);
if(id > 7)
if (id > 7)
{
cellGcmSys.Error("cellGcmSetPrepareFlip : CELL_GCM_ERROR_FAILURE");
return CELL_GCM_ERROR_FAILURE;
}
GSLockCurrent gslock(GS_LOCK_WAIT_FLUSH);
u32 current = ctxt->current;
if (current + 8 == ctxt->begin)
if (ctxt->current + 2 >= ctxt->end)
{
cellGcmSys.Error("cellGcmSetPrepareFlip : queue is full");
return CELL_GCM_ERROR_FAILURE;
}
if (current + 8 >= ctxt->end)
{
cellGcmSys.Error("Bad flip!");
if (s32 res = ctxt->callback(CPU, ctxt, 8 /* ??? */))
if (s32 res = ctxt->callback(ppu, ctxt, 8 /* ??? */))
{
cellGcmSys.Error("cellGcmSetPrepareFlip : callback failed (0x%08x)", res);
return res;
}
}
current = ctxt->current;
vm::write32(current, 0x3fead | (1 << 18));
vm::write32(current + 4, id);
ctxt->current += 8;
*ctxt->current++ = 0x3fead | (1 << 18);
*ctxt->current++ = id;
if(ctxt.addr() == gcm_info.context_addr)
if (ctxt.addr() == gcm_info.context_addr)
{
auto& ctrl = vm::get_ref<CellGcmControl>(gcm_info.control_addr);
ctrl.put.atomic_op([](be_t<u32>& value)
{
value += 8;
});
vm::get_ref<CellGcmControl>(gcm_info.control_addr).put += 8;
}
return id;
}
s32 cellGcmSetFlip(PPUThread& CPU, vm::ptr<CellGcmContextData> ctxt, u32 id)
s32 cellGcmSetFlip(PPUThread& ppu, vm::ptr<CellGcmContextData> ctxt, u32 id)
{
cellGcmSys.Log("cellGcmSetFlip(ctx=0x%x, id=0x%x)", ctxt.addr(), id);
cellGcmSys.Log("cellGcmSetFlip(ctxt=*0x%x, id=0x%x)", ctxt, id);
s32 res = cellGcmSetPrepareFlip(CPU, ctxt, id);
return res < 0 ? CELL_GCM_ERROR_FAILURE : CELL_OK;
if (s32 res = cellGcmSetPrepareFlip(ppu, ctxt, id))
{
if (res < 0) return CELL_GCM_ERROR_FAILURE;
}
return CELL_OK;
}
s32 cellGcmSetSecondVFrequency(u32 freq)
@ -610,9 +597,10 @@ void cellGcmSetVBlankHandler(vm::ptr<void(u32)> handler)
s32 cellGcmSetWaitFlip(vm::ptr<CellGcmContextData> ctxt)
{
cellGcmSys.Log("cellGcmSetWaitFlip(ctx=*0x%x)", ctxt);
cellGcmSys.Warning("cellGcmSetWaitFlip(ctx=*0x%x)", ctxt);
// TODO: emit RSX command for "wait flip" operation
GSLockCurrent lock(GS_LOCK_WAIT_FLIP);
return CELL_OK;
}
@ -1101,18 +1089,18 @@ void cellGcmSetDefaultCommandBuffer()
// Other
//------------------------------------------------------------------------
s32 _cellGcmSetFlipCommand(PPUThread& CPU, vm::ptr<CellGcmContextData> ctx, u32 id)
s32 _cellGcmSetFlipCommand(PPUThread& ppu, vm::ptr<CellGcmContextData> ctx, u32 id)
{
cellGcmSys.Log("cellGcmSetFlipCommand(ctx=*0x%x, id=0x%x)", ctx, id);
return cellGcmSetPrepareFlip(CPU, ctx, id);
return cellGcmSetPrepareFlip(ppu, ctx, id);
}
s32 _cellGcmSetFlipCommandWithWaitLabel(PPUThread& CPU, vm::ptr<CellGcmContextData> ctx, u32 id, u32 label_index, u32 label_value)
s32 _cellGcmSetFlipCommandWithWaitLabel(PPUThread& ppu, vm::ptr<CellGcmContextData> ctx, u32 id, u32 label_index, u32 label_value)
{
cellGcmSys.Log("cellGcmSetFlipCommandWithWaitLabel(ctx=*0x%x, id=0x%x, label_index=0x%x, label_value=0x%x)", ctx, id, label_index, label_value);
s32 res = cellGcmSetPrepareFlip(CPU, ctx, id);
s32 res = cellGcmSetPrepareFlip(ppu, ctx, id);
vm::write32(gcm_info.label_addr + 0x10 * label_index, label_value);
return res < 0 ? CELL_GCM_ERROR_FAILURE : CELL_OK;
}
@ -1200,9 +1188,7 @@ static bool isInCommandBufferExcept(u32 getPos, u32 bufferBegin, u32 bufferEnd)
return true;
}
// TODO: This function was originally located in lv2/SC_GCM and appears in RPCS3 as a lv2 syscall with id 1023,
// which according to lv2 dumps isn't the case. So, is this a proper place for this function?
// TODO: Avoid using syscall 1023 for calling this function
s32 cellGcmCallback(vm::ptr<CellGcmContextData> context, u32 count)
{
cellGcmSys.Log("cellGcmCallback(context=*0x%x, count=0x%x)", context, count);
@ -1210,16 +1196,16 @@ s32 cellGcmCallback(vm::ptr<CellGcmContextData> context, u32 count)
auto& ctrl = vm::get_ref<CellGcmControl>(gcm_info.control_addr);
const std::chrono::time_point<std::chrono::system_clock> enterWait = std::chrono::system_clock::now();
// Flush command buffer (ie allow RSX to read up to context->current)
ctrl.put.exchange(getOffsetFromAddress(context->current));
ctrl.put.exchange(getOffsetFromAddress(context->current.addr()));
std::pair<u32, u32> newCommandBuffer = getNextCommandBufferBeginEnd(context->current);
std::pair<u32, u32> newCommandBuffer = getNextCommandBufferBeginEnd(context->current.addr());
u32 offset = getOffsetFromAddress(newCommandBuffer.first);
// Write jump instruction
vm::write32(context->current, CELL_GCM_METHOD_FLAG_JUMP | offset);
*context->current = CELL_GCM_METHOD_FLAG_JUMP | offset;
// Update current command buffer
context->begin = newCommandBuffer.first;
context->current = newCommandBuffer.first;
context->end = newCommandBuffer.second;
context->begin.set(newCommandBuffer.first);
context->current.set(newCommandBuffer.first);
context->end.set(newCommandBuffer.second);
// Wait for rsx to "release" the new command buffer
while (!Emu.IsStopped())
@ -1235,55 +1221,6 @@ s32 cellGcmCallback(vm::ptr<CellGcmContextData> context, u32 count)
}
return CELL_OK;
//if (0)
//{
// auto& ctrl = vm::get_ref<CellGcmControl>(gcm_info.control_addr);
// be_t<u32> res = context->current - context->begin - ctrl.put.load();
// if (res != 0)
// {
// GSLockCurrent gslock(GS_LOCK_WAIT_FLUSH);
// }
// memmove(vm::get_ptr<void>(context->begin), vm::get_ptr<void>(context->current - res), res);
// context->current = context->begin + res;
// ctrl.put.store(res);
// ctrl.get.store(0);
// return CELL_OK;
//}
//auto& ctrl = vm::get_ref<CellGcmControl>(gcm_info.control_addr);
// preparations for changing the place (for optimized FIFO mode)
//auto cmd = vm::ptr<u32>::make(context->current);
//cmd[0] = 0x41D6C;
//cmd[1] = 0x20;
//cmd[2] = 0x41D74;
//cmd[3] = 0; // some incrementing by module value
//context->current += 0x10;
//if (0)
//{
// const u32 address = context->begin;
// const u32 upper = offsetTable.ioAddress[address >> 20]; // 12 bits
// assert(upper != 0xFFFF);
// const u32 offset = (upper << 20) | (address & 0xFFFFF);
// vm::write32(context->current, CELL_GCM_METHOD_FLAG_JUMP | offset); // set JUMP cmd
// auto& ctrl = vm::get_ref<CellGcmControl>(gcm_info.control_addr);
// ctrl.put.exchange(offset);
//}
//else
//{
// vm::write32(context->current, CELL_GCM_METHOD_FLAG_JUMP | CELL_GCM_METHOD_FLAG_NON_INCREMENT | (0));
//}
//context->current = context->begin; // rewind to the beginning
// TODO: something is missing
return CELL_OK;
}
//----------------------------------------------------------------------------

View file

@ -6,193 +6,108 @@
extern Module cellGem;
struct cellGemInternal
{
bool m_bInitialized;
CellGemAttribute attribute;
cellGemInternal()
: m_bInitialized(false)
{
}
};
cellGemInternal cellGemInstance;
s32 cellGemCalibrate()
{
UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK;
}
s32 cellGemClearStatusFlags()
{
UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK;
}
s32 cellGemConvertVideoFinish()
{
UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK;
}
s32 cellGemConvertVideoStart()
{
UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK;
}
s32 cellGemEnableCameraPitchAngleCorrection()
{
UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK;
}
s32 cellGemEnableMagnetometer()
{
UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK;
}
s32 cellGemEnd()
{
cellGem.Warning("cellGemEnd()");
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
cellGemInstance.m_bInitialized = false;
return CELL_OK;
}
s32 cellGemFilterState()
{
UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK;
}
s32 cellGemForceRGB()
{
UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK;
}
s32 cellGemGetAccelerometerPositionInDevice()
{
UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK;
}
s32 cellGemGetAllTrackableHues()
{
UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK;
}
s32 cellGemGetCameraState()
{
UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK;
}
s32 cellGemGetEnvironmentLightingColor()
{
UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK;
}
s32 cellGemGetHuePixels()
{
UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK;
}
s32 cellGemGetImageState()
{
UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK;
}
s32 cellGemGetInertialState()
{
UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK;
}
s32 cellGemGetInfo(vm::ptr<CellGemInfo> info)
{
cellGem.Warning("cellGemGetInfo(info=0x%x)", info.addr());
cellGem.Todo("cellGemGetInfo(info=*0x%x)", info);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
info->max_connect = cellGemInstance.attribute.max_connect;
// TODO: Support many controllers to be connected
info->now_connect = 1;
info->status[0] = CELL_GEM_STATUS_READY;
info->port[0] = 7;
*info = {};
return CELL_OK;
}
@ -201,59 +116,41 @@ s32 cellGemGetMemorySize(s32 max_connect)
{
cellGem.Warning("cellGemGetMemorySize(max_connect=%d)", max_connect);
if (max_connect > CELL_GEM_MAX_NUM)
if (max_connect > CELL_GEM_MAX_NUM || max_connect <= 0)
{
return CELL_GEM_ERROR_INVALID_PARAMETER;
}
return 1024 * 1024 * max_connect; // 1 MB * max_connect
return max_connect <= 2 ? 0x120000 : 0x140000;
}
s32 cellGemGetRGB()
{
UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK;
}
s32 cellGemGetRumble()
{
UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK;
}
s32 cellGemGetState()
{
UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK;
}
s32 cellGemGetStatusFlags()
{
UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK;
}
s32 cellGemGetTrackerHue()
{
UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK;
}
@ -267,22 +164,12 @@ s32 cellGemInit(vm::ptr<CellGemAttribute> attribute)
{
cellGem.Warning("cellGemInit(attribute=*0x%x)", attribute);
if (cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_ALREADY_INITIALIZED;
cellGemInstance.m_bInitialized = true;
cellGemInstance.attribute = *attribute;
return CELL_OK;
}
s32 cellGemInvalidateCalibration()
{
UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK;
}
@ -295,98 +182,65 @@ s32 cellGemIsTrackableHue()
s32 cellGemPrepareCamera()
{
UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK;
}
s32 cellGemPrepareVideoConvert()
{
UNIMPLEMENTED_FUNC(cellGem);
return CELL_OK;
}
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
s32 cellGemReadExternalPortDeviceInfo()
{
UNIMPLEMENTED_FUNC(cellGem);
return CELL_OK;
}
s32 cellGemReset()
{
UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK;
}
s32 cellGemSetRumble()
{
UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK;
}
s32 cellGemSetYaw()
{
UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK;
}
s32 cellGemTrackHues()
{
UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK;
}
s32 cellGemUpdateFinish()
{
UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK;
}
s32 cellGemUpdateStart()
{
UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK;
}
s32 cellGemWriteExternalPort()
{
UNIMPLEMENTED_FUNC(cellGem);
if (!cellGemInstance.m_bInitialized)
return CELL_GEM_ERROR_UNINITIALIZED;
return CELL_OK;
}
Module cellGem("cellGem", []()
{
cellGemInstance.m_bInitialized = false;
//REG_FUNC(cellGem, cellGemAttributeInit);
REG_FUNC(cellGem, cellGemCalibrate);
REG_FUNC(cellGem, cellGemClearStatusFlags);
REG_FUNC(cellGem, cellGemConvertVideoFinish);
@ -410,21 +264,18 @@ Module cellGem("cellGem", []()
REG_FUNC(cellGem, cellGemGetState);
REG_FUNC(cellGem, cellGemGetStatusFlags);
REG_FUNC(cellGem, cellGemGetTrackerHue);
//REG_FUNC(cellGem, cellGemGetVideoConvertSize);
REG_FUNC(cellGem, cellGemHSVtoRGB);
REG_FUNC(cellGem, cellGemInit);
REG_FUNC(cellGem, cellGemInvalidateCalibration);
REG_FUNC(cellGem, cellGemIsTrackableHue);
REG_FUNC(cellGem, cellGemPrepareCamera);
REG_FUNC(cellGem, cellGemPrepareVideoConvert);
//REG_FUNC(cellGem, cellGemReadExternalPortDeviceInfo);
REG_FUNC(cellGem, cellGemReadExternalPortDeviceInfo);
REG_FUNC(cellGem, cellGemReset);
REG_FUNC(cellGem, cellGemSetRumble);
REG_FUNC(cellGem, cellGemSetYaw);
REG_FUNC(cellGem, cellGemTrackHues);
REG_FUNC(cellGem, cellGemUpdateFinish);
REG_FUNC(cellGem, cellGemUpdateStart);
//REG_FUNC(cellGem, cellGemVideoConvertAttributeInit);
//REG_FUNC(cellGem, cellGemVideoConvertAttributeInitRgba);
REG_FUNC(cellGem, cellGemWriteExternalPort);
});

View file

@ -186,4 +186,4 @@ struct CellGemVideoConvertAttribute
be_t<u32> buffer_memory;
be_t<u32> video_data_out;
u8 alpha;
};
};

View file

@ -74,6 +74,11 @@ s32 cellGifDecOpen(
return CELL_OK;
}
s32 cellGifDecExtOpen()
{
throw EXCEPTION("");
}
s32 cellGifDecReadHeader(
CellGifDecMainHandle mainHandle,
CellGifDecSubHandle subHandle,
@ -131,6 +136,11 @@ s32 cellGifDecReadHeader(
return CELL_OK;
}
s32 cellGifDecExtReadHeader()
{
throw EXCEPTION("");
}
s32 cellGifDecSetParameter(
CellGifDecMainHandle mainHandle,
CellGifDecSubHandle subHandle,
@ -167,6 +177,11 @@ s32 cellGifDecSetParameter(
return CELL_OK;
}
s32 cellGifDecExtSetParameter()
{
throw EXCEPTION("");
}
s32 cellGifDecDecodeData(
CellGifDecMainHandle mainHandle,
CellGifDecSubHandle subHandle,
@ -293,6 +308,11 @@ s32 cellGifDecDecodeData(
return CELL_OK;
}
s32 cellGifDecExtDecodeData()
{
throw EXCEPTION("");
}
s32 cellGifDecClose(CellGifDecMainHandle mainHandle, CellGifDecSubHandle subHandle)
{
cellGifDec.Warning("cellGifDecClose(mainHandle=0x%x, subHandle=0x%x)", mainHandle, subHandle);
@ -327,8 +347,8 @@ Module cellGifDec("cellGifDec", []()
REG_FUNC(cellGifDec, cellGifDecClose);
REG_FUNC(cellGifDec, cellGifDecDestroy);
/*REG_FUNC(cellGifDec, cellGifDecExtOpen);
REG_FUNC(cellGifDec, cellGifDecExtOpen);
REG_FUNC(cellGifDec, cellGifDecExtReadHeader);
REG_FUNC(cellGifDec, cellGifDecExtSetParameter);
REG_FUNC(cellGifDec, cellGifDecExtDecodeData);*/
REG_FUNC(cellGifDec, cellGifDecExtDecodeData);
});

View file

@ -57,8 +57,8 @@ using CellGifDecMainHandle = vm::ptr<struct GifDecoder>;
using CellGifDecSubHandle = u32; // vm::ptr<struct GifStream>;
// Callbacks for memory management
using CellGifDecCbControlMalloc = func_def<vm::ptr<void>(u32 size, vm::ptr<void> cbCtrlMallocArg)>;
using CellGifDecCbControlFree = func_def<s32(vm::ptr<void> ptr, vm::ptr<void> cbCtrlFreeArg)>;
using CellGifDecCbControlMalloc = vm::ptr<void>(u32 size, vm::ptr<void> cbCtrlMallocArg);
using CellGifDecCbControlFree = s32(vm::ptr<void> ptr, vm::ptr<void> cbCtrlFreeArg);
// Structs
struct CellGifDecThreadInParam

View file

@ -0,0 +1,719 @@
#include "stdafx.h"
#include "Emu/Memory/Memory.h"
#include "Emu/SysCalls/Modules.h"
extern Module cellHttp;
extern Module cellHttps;
s32 cellHttpInit()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpEnd()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpsInit()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpsEnd()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpSetProxy()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpGetProxy()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpInitCookie()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpEndCookie()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpAddCookieWithClientId()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpSessionCookieFlush()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpCookieExportWithClientId()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpCookieImportWithClientId()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientSetCookieSendCallback()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientSetCookieRecvCallback()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpCreateClient()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpDestroyClient()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientSetAuthenticationCallback()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientSetTransactionStateCallback()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientSetRedirectCallback()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientSetProxy()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientGetProxy()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientSetVersion()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientGetVersion()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientSetPipeline()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientGetPipeline()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientSetKeepAlive()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientGetKeepAlive()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientSetAutoRedirect()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientGetAutoRedirect()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientSetAutoAuthentication()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientGetAutoAuthentication()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientSetAuthenticationCacheStatus()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientGetAuthenticationCacheStatus()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientSetCookieStatus()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientGetCookieStatus()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientSetUserAgent()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientGetUserAgent()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientSetResponseBufferMax()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientGetResponseBufferMax()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientCloseAllConnections()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientCloseConnections()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientPollConnections()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientSetRecvTimeout()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientGetRecvTimeout()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientSetSendTimeout()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientGetSendTimeout()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientSetConnTimeout()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientGetConnTimeout()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientSetTotalPoolSize()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientGetTotalPoolSize()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientSetPerHostPoolSize()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientGetPerHostPoolSize()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientSetPerHostKeepAliveMax()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientGetPerHostKeepAliveMax()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientSetPerPipelineMax()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientGetPerPipelineMax()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientSetRecvBufferSize()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientGetRecvBufferSize()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientSetSendBufferSize()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientGetSendBufferSize()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientGetAllHeaders()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientSetHeader()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientGetHeader()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientAddHeader()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientDeleteHeader()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientSetSslCallback()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientSetSslClientCertificate()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpCreateTransaction()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpDestroyTransaction()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpTransactionGetUri()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpTransactionCloseConnection()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpTransactionReleaseConnection()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpTransactionAbortConnection()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpSendRequest()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpRequestSetContentLength()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpRequestGetContentLength()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpRequestSetChunkedTransferStatus()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpRequestGetChunkedTransferStatus()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpRequestGetAllHeaders()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpRequestSetHeader()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpRequestGetHeader()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpRequestAddHeader()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpRequestDeleteHeader()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpRecvResponse()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpResponseGetAllHeaders()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpResponseGetHeader()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpResponseGetContentLength()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpResponseGetStatusCode()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpResponseGetStatusLine()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpTransactionGetSslCipherName()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpTransactionGetSslCipherId()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpTransactionGetSslCipherVersion()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpTransactionGetSslCipherBits()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpTransactionGetSslCipherString()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpTransactionGetSslVersion()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpTransactionGetSslId()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientSetSslVersion()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientGetSslVersion()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
s32 cellHttpClientSetSslIdDestroyCallback()
{
UNIMPLEMENTED_FUNC(cellHttp);
return CELL_OK;
}
Module cellHttp("cellHttp", []()
{
REG_FUNC(cellHttp, cellHttpInit);
REG_FUNC(cellHttp, cellHttpEnd);
REG_FUNC(cellHttp, cellHttpsInit);
REG_FUNC(cellHttp, cellHttpsEnd);
REG_FUNC(cellHttp, cellHttpSetProxy);
REG_FUNC(cellHttp, cellHttpGetProxy);
REG_FUNC(cellHttp, cellHttpInitCookie);
REG_FUNC(cellHttp, cellHttpEndCookie);
REG_FUNC(cellHttp, cellHttpAddCookieWithClientId);
REG_FUNC(cellHttp, cellHttpSessionCookieFlush);
REG_FUNC(cellHttp, cellHttpCookieExportWithClientId);
REG_FUNC(cellHttp, cellHttpCookieImportWithClientId);
REG_FUNC(cellHttp, cellHttpClientSetCookieSendCallback);
REG_FUNC(cellHttp, cellHttpClientSetCookieRecvCallback);
REG_FUNC(cellHttp, cellHttpCreateClient);
REG_FUNC(cellHttp, cellHttpDestroyClient);
REG_FUNC(cellHttp, cellHttpClientSetAuthenticationCallback);
REG_FUNC(cellHttp, cellHttpClientSetTransactionStateCallback);
REG_FUNC(cellHttp, cellHttpClientSetRedirectCallback);
REG_FUNC(cellHttp, cellHttpClientSetProxy);
REG_FUNC(cellHttp, cellHttpClientGetProxy);
REG_FUNC(cellHttp, cellHttpClientSetVersion);
REG_FUNC(cellHttp, cellHttpClientGetVersion);
REG_FUNC(cellHttp, cellHttpClientSetPipeline);
REG_FUNC(cellHttp, cellHttpClientGetPipeline);
REG_FUNC(cellHttp, cellHttpClientSetKeepAlive);
REG_FUNC(cellHttp, cellHttpClientGetKeepAlive);
REG_FUNC(cellHttp, cellHttpClientSetAutoRedirect);
REG_FUNC(cellHttp, cellHttpClientGetAutoRedirect);
REG_FUNC(cellHttp, cellHttpClientSetAutoAuthentication);
REG_FUNC(cellHttp, cellHttpClientGetAutoAuthentication);
REG_FUNC(cellHttp, cellHttpClientSetAuthenticationCacheStatus);
REG_FUNC(cellHttp, cellHttpClientGetAuthenticationCacheStatus);
REG_FUNC(cellHttp, cellHttpClientSetCookieStatus);
REG_FUNC(cellHttp, cellHttpClientGetCookieStatus);
REG_FUNC(cellHttp, cellHttpClientSetUserAgent);
REG_FUNC(cellHttp, cellHttpClientGetUserAgent);
REG_FUNC(cellHttp, cellHttpClientSetResponseBufferMax);
REG_FUNC(cellHttp, cellHttpClientGetResponseBufferMax);
REG_FUNC(cellHttp, cellHttpClientCloseAllConnections);
REG_FUNC(cellHttp, cellHttpClientCloseConnections);
REG_FUNC(cellHttp, cellHttpClientPollConnections);
REG_FUNC(cellHttp, cellHttpClientSetRecvTimeout);
REG_FUNC(cellHttp, cellHttpClientGetRecvTimeout);
REG_FUNC(cellHttp, cellHttpClientSetSendTimeout);
REG_FUNC(cellHttp, cellHttpClientGetSendTimeout);
REG_FUNC(cellHttp, cellHttpClientSetConnTimeout);
REG_FUNC(cellHttp, cellHttpClientGetConnTimeout);
REG_FUNC(cellHttp, cellHttpClientSetTotalPoolSize);
REG_FUNC(cellHttp, cellHttpClientGetTotalPoolSize);
REG_FUNC(cellHttp, cellHttpClientSetPerHostPoolSize);
REG_FUNC(cellHttp, cellHttpClientGetPerHostPoolSize);
REG_FUNC(cellHttp, cellHttpClientSetPerHostKeepAliveMax);
REG_FUNC(cellHttp, cellHttpClientGetPerHostKeepAliveMax);
REG_FUNC(cellHttp, cellHttpClientSetPerPipelineMax);
REG_FUNC(cellHttp, cellHttpClientGetPerPipelineMax);
REG_FUNC(cellHttp, cellHttpClientSetRecvBufferSize);
REG_FUNC(cellHttp, cellHttpClientGetRecvBufferSize);
REG_FUNC(cellHttp, cellHttpClientSetSendBufferSize);
REG_FUNC(cellHttp, cellHttpClientGetSendBufferSize);
REG_FUNC(cellHttp, cellHttpClientGetAllHeaders);
REG_FUNC(cellHttp, cellHttpClientSetHeader);
REG_FUNC(cellHttp, cellHttpClientGetHeader);
REG_FUNC(cellHttp, cellHttpClientAddHeader);
REG_FUNC(cellHttp, cellHttpClientDeleteHeader);
REG_FUNC(cellHttp, cellHttpClientSetSslCallback);
REG_FUNC(cellHttp, cellHttpClientSetSslClientCertificate);
REG_FUNC(cellHttp, cellHttpCreateTransaction);
REG_FUNC(cellHttp, cellHttpDestroyTransaction);
REG_FUNC(cellHttp, cellHttpTransactionGetUri);
REG_FUNC(cellHttp, cellHttpTransactionCloseConnection);
REG_FUNC(cellHttp, cellHttpTransactionReleaseConnection);
REG_FUNC(cellHttp, cellHttpTransactionAbortConnection);
REG_FUNC(cellHttp, cellHttpSendRequest);
REG_FUNC(cellHttp, cellHttpRequestSetContentLength);
REG_FUNC(cellHttp, cellHttpRequestGetContentLength);
REG_FUNC(cellHttp, cellHttpRequestSetChunkedTransferStatus);
REG_FUNC(cellHttp, cellHttpRequestGetChunkedTransferStatus);
REG_FUNC(cellHttp, cellHttpRequestGetAllHeaders);
REG_FUNC(cellHttp, cellHttpRequestSetHeader);
REG_FUNC(cellHttp, cellHttpRequestGetHeader);
REG_FUNC(cellHttp, cellHttpRequestAddHeader);
REG_FUNC(cellHttp, cellHttpRequestDeleteHeader);
REG_FUNC(cellHttp, cellHttpRecvResponse);
REG_FUNC(cellHttp, cellHttpResponseGetAllHeaders);
REG_FUNC(cellHttp, cellHttpResponseGetHeader);
REG_FUNC(cellHttp, cellHttpResponseGetContentLength);
REG_FUNC(cellHttp, cellHttpResponseGetStatusCode);
REG_FUNC(cellHttp, cellHttpResponseGetStatusLine);
REG_FUNC(cellHttp, cellHttpTransactionGetSslCipherName);
REG_FUNC(cellHttp, cellHttpTransactionGetSslCipherId);
REG_FUNC(cellHttp, cellHttpTransactionGetSslCipherVersion);
REG_FUNC(cellHttp, cellHttpTransactionGetSslCipherBits);
REG_FUNC(cellHttp, cellHttpTransactionGetSslCipherString);
REG_FUNC(cellHttp, cellHttpTransactionGetSslVersion);
REG_FUNC(cellHttp, cellHttpTransactionGetSslId);
REG_FUNC(cellHttp, cellHttpClientSetSslVersion);
REG_FUNC(cellHttp, cellHttpClientGetSslVersion);
REG_FUNC(cellHttp, cellHttpClientSetSslIdDestroyCallback);
});
Module cellHttps("cellHttps", []()
{
// cellHttps doesn't have functions (cellHttpsInit belongs to cellHttp, for example)
});

View file

@ -1,130 +1,130 @@
#include "stdafx.h"
#if 0
#include "Emu/Memory/Memory.h"
#include "Emu/SysCalls/Modules.h"
void cellHttpUtil_init();
Module cellHttpUtil(0x0002, cellHttpUtil_init);
extern Module cellHttpUtil;
int cellHttpUtilParseUri()
s32 cellHttpUtilParseUri()
{
UNIMPLEMENTED_FUNC(cellHttpUtil);
return CELL_OK;
}
int cellHttpUtilParseUriPath()
s32 cellHttpUtilParseUriPath()
{
UNIMPLEMENTED_FUNC(cellHttpUtil);
return CELL_OK;
}
int cellHttpUtilParseProxy()
s32 cellHttpUtilParseProxy()
{
UNIMPLEMENTED_FUNC(cellHttpUtil);
return CELL_OK;
}
int cellHttpUtilParseStatusLine()
s32 cellHttpUtilParseStatusLine()
{
UNIMPLEMENTED_FUNC(cellHttpUtil);
return CELL_OK;
}
int cellHttpUtilParseHeader()
s32 cellHttpUtilParseHeader()
{
UNIMPLEMENTED_FUNC(cellHttpUtil);
return CELL_OK;
}
int cellHttpUtilBuildRequestLine()
s32 cellHttpUtilBuildRequestLine()
{
UNIMPLEMENTED_FUNC(cellHttpUtil);
return CELL_OK;
}
int cellHttpUtilBuildHeader()
s32 cellHttpUtilBuildHeader()
{
UNIMPLEMENTED_FUNC(cellHttpUtil);
return CELL_OK;
}
int cellHttpUtilBuildUri()
s32 cellHttpUtilBuildUri()
{
UNIMPLEMENTED_FUNC(cellHttpUtil);
return CELL_OK;
}
int cellHttpUtilCopyUri()
s32 cellHttpUtilCopyUri()
{
UNIMPLEMENTED_FUNC(cellHttpUtil);
return CELL_OK;
}
int cellHttpUtilMergeUriPath()
s32 cellHttpUtilMergeUriPath()
{
UNIMPLEMENTED_FUNC(cellHttpUtil);
return CELL_OK;
}
int cellHttpUtilSweepPath()
s32 cellHttpUtilSweepPath()
{
UNIMPLEMENTED_FUNC(cellHttpUtil);
return CELL_OK;
}
int cellHttpUtilCopyStatusLine()
s32 cellHttpUtilCopyStatusLine()
{
UNIMPLEMENTED_FUNC(cellHttpUtil);
return CELL_OK;
}
int cellHttpUtilCopyHeader()
s32 cellHttpUtilCopyHeader()
{
UNIMPLEMENTED_FUNC(cellHttpUtil);
return CELL_OK;
}
int cellHttpUtilAppendHeaderValue()
s32 cellHttpUtilAppendHeaderValue()
{
UNIMPLEMENTED_FUNC(cellHttpUtil);
return CELL_OK;
}
int cellHttpUtilEscapeUri()
s32 cellHttpUtilEscapeUri()
{
UNIMPLEMENTED_FUNC(cellHttpUtil);
return CELL_OK;
}
int cellHttpUtilUnescapeUri()
s32 cellHttpUtilUnescapeUri()
{
UNIMPLEMENTED_FUNC(cellHttpUtil);
return CELL_OK;
}
int cellHttpUtilFormUrlEncode()
s32 cellHttpUtilFormUrlEncode()
{
UNIMPLEMENTED_FUNC(cellHttpUtil);
return CELL_OK;
}
int cellHttpUtilFormUrlDecode()
s32 cellHttpUtilFormUrlDecode()
{
UNIMPLEMENTED_FUNC(cellHttpUtil);
return CELL_OK;
}
int cellHttpUtilBase64Encoder()
s32 cellHttpUtilBase64Encoder()
{
UNIMPLEMENTED_FUNC(cellHttpUtil);
return CELL_OK;
}
int cellHttpUtilBase64Decoder()
s32 cellHttpUtilBase64Decoder()
{
UNIMPLEMENTED_FUNC(cellHttpUtil);
return CELL_OK;
}
void cellHttpUtil_init()
Module cellHttpUtil("cellHttpUtil", []()
{
REG_FUNC(cellHttpUtil, cellHttpUtilParseUri);
REG_FUNC(cellHttpUtil, cellHttpUtilParseUriPath);
@ -149,5 +149,4 @@ void cellHttpUtil_init()
REG_FUNC(cellHttpUtil, cellHttpUtilFormUrlDecode);
REG_FUNC(cellHttpUtil, cellHttpUtilBase64Encoder);
REG_FUNC(cellHttpUtil, cellHttpUtilBase64Decoder);
}
#endif
});

View file

@ -1,8 +1,8 @@
#include "stdafx.h"
#if 0
#include "Emu/Memory/Memory.h"
#include "Emu/SysCalls/Modules.h"
void cellImejp_init();
Module cellImejp(0xf023, cellImejp_init);
extern Module cellImeJp;
// Return Codes
enum
@ -16,291 +16,296 @@ enum
CELL_IMEJP_ERROR_OTHER = 0x8002bfff,
};
int cellImeJpOpen()
s32 cellImeJpOpen()
{
UNIMPLEMENTED_FUNC(cellImejp);
UNIMPLEMENTED_FUNC(cellImeJp);
return CELL_OK;
}
int cellImeJpOpen2()
s32 cellImeJpOpen2()
{
UNIMPLEMENTED_FUNC(cellImejp);
UNIMPLEMENTED_FUNC(cellImeJp);
return CELL_OK;
}
int cellImeJpOpen3()
s32 cellImeJpOpen3()
{
UNIMPLEMENTED_FUNC(cellImejp);
UNIMPLEMENTED_FUNC(cellImeJp);
return CELL_OK;
}
int cellImeJpClose()
s32 cellImeJpClose()
{
UNIMPLEMENTED_FUNC(cellImejp);
UNIMPLEMENTED_FUNC(cellImeJp);
return CELL_OK;
}
int cellImeJpSetKanaInputMode()
s32 cellImeJpSetKanaInputMode()
{
UNIMPLEMENTED_FUNC(cellImejp);
UNIMPLEMENTED_FUNC(cellImeJp);
return CELL_OK;
}
int cellImeJpSetInputCharType()
s32 cellImeJpSetInputCharType()
{
UNIMPLEMENTED_FUNC(cellImejp);
UNIMPLEMENTED_FUNC(cellImeJp);
return CELL_OK;
}
int cellImeJpSetFixInputMode()
s32 cellImeJpSetFixInputMode()
{
UNIMPLEMENTED_FUNC(cellImejp);
UNIMPLEMENTED_FUNC(cellImeJp);
return CELL_OK;
}
int cellImeJpReset()
s32 cellImeJpAllowExtensionCharacters()
{
UNIMPLEMENTED_FUNC(cellImejp);
UNIMPLEMENTED_FUNC(cellImeJp);
return CELL_OK;
}
int cellImeJpGetStatus()
s32 cellImeJpReset()
{
UNIMPLEMENTED_FUNC(cellImejp);
UNIMPLEMENTED_FUNC(cellImeJp);
return CELL_OK;
}
int cellImeJpEnterChar()
s32 cellImeJpGetStatus()
{
UNIMPLEMENTED_FUNC(cellImejp);
UNIMPLEMENTED_FUNC(cellImeJp);
return CELL_OK;
}
int cellImeJpEnterCharExt()
s32 cellImeJpEnterChar()
{
UNIMPLEMENTED_FUNC(cellImejp);
UNIMPLEMENTED_FUNC(cellImeJp);
return CELL_OK;
}
int cellImeJpEnterString()
s32 cellImeJpEnterCharExt()
{
UNIMPLEMENTED_FUNC(cellImejp);
UNIMPLEMENTED_FUNC(cellImeJp);
return CELL_OK;
}
int cellImeJpEnterStringExt()
s32 cellImeJpEnterString()
{
UNIMPLEMENTED_FUNC(cellImejp);
UNIMPLEMENTED_FUNC(cellImeJp);
return CELL_OK;
}
int cellImeJpModeCaretRight()
s32 cellImeJpEnterStringExt()
{
UNIMPLEMENTED_FUNC(cellImejp);
UNIMPLEMENTED_FUNC(cellImeJp);
return CELL_OK;
}
int cellImeJpModeCaretLeft()
s32 cellImeJpModeCaretRight()
{
UNIMPLEMENTED_FUNC(cellImejp);
UNIMPLEMENTED_FUNC(cellImeJp);
return CELL_OK;
}
int cellImeJpBackspaceWord()
s32 cellImeJpModeCaretLeft()
{
UNIMPLEMENTED_FUNC(cellImejp);
UNIMPLEMENTED_FUNC(cellImeJp);
return CELL_OK;
}
int cellImeJpDeleteWord()
s32 cellImeJpBackspaceWord()
{
UNIMPLEMENTED_FUNC(cellImejp);
UNIMPLEMENTED_FUNC(cellImeJp);
return CELL_OK;
}
int cellImeJpAllDeleteConvertString()
s32 cellImeJpDeleteWord()
{
UNIMPLEMENTED_FUNC(cellImejp);
UNIMPLEMENTED_FUNC(cellImeJp);
return CELL_OK;
}
int cellImeJpConvertForward()
s32 cellImeJpAllDeleteConvertString()
{
UNIMPLEMENTED_FUNC(cellImejp);
UNIMPLEMENTED_FUNC(cellImeJp);
return CELL_OK;
}
int cellImeJpConvertBackward()
s32 cellImeJpConvertForward()
{
UNIMPLEMENTED_FUNC(cellImejp);
UNIMPLEMENTED_FUNC(cellImeJp);
return CELL_OK;
}
int cellImeJpCurrentPartConfirm()
s32 cellImeJpConvertBackward()
{
UNIMPLEMENTED_FUNC(cellImejp);
UNIMPLEMENTED_FUNC(cellImeJp);
return CELL_OK;
}
int cellImeJpAllConfirm()
s32 cellImeJpCurrentPartConfirm()
{
UNIMPLEMENTED_FUNC(cellImejp);
UNIMPLEMENTED_FUNC(cellImeJp);
return CELL_OK;
}
int cellImeJpConvertCancel()
s32 cellImeJpAllConfirm()
{
UNIMPLEMENTED_FUNC(cellImejp);
UNIMPLEMENTED_FUNC(cellImeJp);
return CELL_OK;
}
int cellImeJpAllConvertCancel()
s32 cellImeJpConvertCancel()
{
UNIMPLEMENTED_FUNC(cellImejp);
UNIMPLEMENTED_FUNC(cellImeJp);
return CELL_OK;
}
int cellImeJpExtendConvertArea()
s32 cellImeJpAllConvertCancel()
{
UNIMPLEMENTED_FUNC(cellImejp);
UNIMPLEMENTED_FUNC(cellImeJp);
return CELL_OK;
}
int cellImeJpShortenConvertArea()
s32 cellImeJpExtendConvertArea()
{
UNIMPLEMENTED_FUNC(cellImejp);
UNIMPLEMENTED_FUNC(cellImeJp);
return CELL_OK;
}
int cellImeJpTemporalConfirm()
s32 cellImeJpShortenConvertArea()
{
UNIMPLEMENTED_FUNC(cellImejp);
UNIMPLEMENTED_FUNC(cellImeJp);
return CELL_OK;
}
int cellImeJpPostConvert()
s32 cellImeJpTemporalConfirm()
{
UNIMPLEMENTED_FUNC(cellImejp);
UNIMPLEMENTED_FUNC(cellImeJp);
return CELL_OK;
}
int cellImeJpMoveFocusClause()
s32 cellImeJpPostConvert()
{
UNIMPLEMENTED_FUNC(cellImejp);
UNIMPLEMENTED_FUNC(cellImeJp);
return CELL_OK;
}
int cellImeJpGetFocusTop()
s32 cellImeJpMoveFocusClause()
{
UNIMPLEMENTED_FUNC(cellImejp);
UNIMPLEMENTED_FUNC(cellImeJp);
return CELL_OK;
}
int cellImeJpGetFocusLength()
s32 cellImeJpGetFocusTop()
{
UNIMPLEMENTED_FUNC(cellImejp);
UNIMPLEMENTED_FUNC(cellImeJp);
return CELL_OK;
}
int cellImeJpGetConfirmYomiString()
s32 cellImeJpGetFocusLength()
{
UNIMPLEMENTED_FUNC(cellImejp);
UNIMPLEMENTED_FUNC(cellImeJp);
return CELL_OK;
}
int cellImeJpGetConfirmString()
s32 cellImeJpGetConfirmYomiString()
{
UNIMPLEMENTED_FUNC(cellImejp);
UNIMPLEMENTED_FUNC(cellImeJp);
return CELL_OK;
}
int cellImeJpGetConvertYomiString()
s32 cellImeJpGetConfirmString()
{
UNIMPLEMENTED_FUNC(cellImejp);
UNIMPLEMENTED_FUNC(cellImeJp);
return CELL_OK;
}
int cellImeJpGetConvertString()
s32 cellImeJpGetConvertYomiString()
{
UNIMPLEMENTED_FUNC(cellImejp);
UNIMPLEMENTED_FUNC(cellImeJp);
return CELL_OK;
}
int cellImeJpGetCandidateListSize()
s32 cellImeJpGetConvertString()
{
UNIMPLEMENTED_FUNC(cellImejp);
UNIMPLEMENTED_FUNC(cellImeJp);
return CELL_OK;
}
int cellImeJpGetCandidateList()
s32 cellImeJpGetCandidateListSize()
{
UNIMPLEMENTED_FUNC(cellImejp);
UNIMPLEMENTED_FUNC(cellImeJp);
return CELL_OK;
}
int cellImeJpGetCandidateSelect()
s32 cellImeJpGetCandidateList()
{
UNIMPLEMENTED_FUNC(cellImejp);
UNIMPLEMENTED_FUNC(cellImeJp);
return CELL_OK;
}
int cellImeJpGetPredictList()
s32 cellImeJpGetCandidateSelect()
{
UNIMPLEMENTED_FUNC(cellImejp);
UNIMPLEMENTED_FUNC(cellImeJp);
return CELL_OK;
}
int cellImeJpConfirmPrediction()
s32 cellImeJpGetPredictList()
{
UNIMPLEMENTED_FUNC(cellImejp);
UNIMPLEMENTED_FUNC(cellImeJp);
return CELL_OK;
}
void cellImejp_init()
s32 cellImeJpConfirmPrediction()
{
REG_FUNC(cellImejp, cellImeJpOpen);
REG_FUNC(cellImejp, cellImeJpOpen2);
REG_FUNC(cellImejp, cellImeJpOpen3);
REG_FUNC(cellImejp, cellImeJpClose);
REG_FUNC(cellImejp, cellImeJpSetKanaInputMode);
REG_FUNC(cellImejp, cellImeJpSetInputCharType);
REG_FUNC(cellImejp, cellImeJpSetFixInputMode);
//cellImejp.AddFunc(, cellImeJpAllowExtensionCharacters);
REG_FUNC(cellImejp, cellImeJpReset);
REG_FUNC(cellImejp, cellImeJpGetStatus);
REG_FUNC(cellImejp, cellImeJpEnterChar);
REG_FUNC(cellImejp, cellImeJpEnterCharExt);
REG_FUNC(cellImejp, cellImeJpEnterString);
REG_FUNC(cellImejp, cellImeJpEnterStringExt);
REG_FUNC(cellImejp, cellImeJpModeCaretRight);
REG_FUNC(cellImejp, cellImeJpModeCaretLeft);
REG_FUNC(cellImejp, cellImeJpBackspaceWord);
REG_FUNC(cellImejp, cellImeJpDeleteWord);
REG_FUNC(cellImejp, cellImeJpAllDeleteConvertString);
REG_FUNC(cellImejp, cellImeJpConvertForward);
REG_FUNC(cellImejp, cellImeJpConvertBackward);
REG_FUNC(cellImejp, cellImeJpCurrentPartConfirm);
REG_FUNC(cellImejp, cellImeJpAllConfirm);
REG_FUNC(cellImejp, cellImeJpConvertCancel);
REG_FUNC(cellImejp, cellImeJpAllConvertCancel);
REG_FUNC(cellImejp, cellImeJpExtendConvertArea);
REG_FUNC(cellImejp, cellImeJpShortenConvertArea);
REG_FUNC(cellImejp, cellImeJpTemporalConfirm);
REG_FUNC(cellImejp, cellImeJpPostConvert);
REG_FUNC(cellImejp, cellImeJpMoveFocusClause);
REG_FUNC(cellImejp, cellImeJpGetFocusTop);
REG_FUNC(cellImejp, cellImeJpGetFocusLength);
REG_FUNC(cellImejp, cellImeJpGetConfirmYomiString);
REG_FUNC(cellImejp, cellImeJpGetConfirmString);
REG_FUNC(cellImejp, cellImeJpGetConvertYomiString);
REG_FUNC(cellImejp, cellImeJpGetConvertString);
REG_FUNC(cellImejp, cellImeJpGetCandidateListSize);
REG_FUNC(cellImejp, cellImeJpGetCandidateList);
REG_FUNC(cellImejp, cellImeJpGetCandidateSelect);
REG_FUNC(cellImejp, cellImeJpGetPredictList);
REG_FUNC(cellImejp, cellImeJpConfirmPrediction);
UNIMPLEMENTED_FUNC(cellImeJp);
return CELL_OK;
}
#endif
Module cellImeJp("cellImeJp", []()
{
REG_FUNC(cellImeJp, cellImeJpOpen);
REG_FUNC(cellImeJp, cellImeJpOpen2);
REG_FUNC(cellImeJp, cellImeJpOpen3);
REG_FUNC(cellImeJp, cellImeJpClose);
REG_FUNC(cellImeJp, cellImeJpSetKanaInputMode);
REG_FUNC(cellImeJp, cellImeJpSetInputCharType);
REG_FUNC(cellImeJp, cellImeJpSetFixInputMode);
REG_FUNC(cellImeJp, cellImeJpAllowExtensionCharacters);
REG_FUNC(cellImeJp, cellImeJpReset);
REG_FUNC(cellImeJp, cellImeJpGetStatus);
REG_FUNC(cellImeJp, cellImeJpEnterChar);
REG_FUNC(cellImeJp, cellImeJpEnterCharExt);
REG_FUNC(cellImeJp, cellImeJpEnterString);
REG_FUNC(cellImeJp, cellImeJpEnterStringExt);
REG_FUNC(cellImeJp, cellImeJpModeCaretRight);
REG_FUNC(cellImeJp, cellImeJpModeCaretLeft);
REG_FUNC(cellImeJp, cellImeJpBackspaceWord);
REG_FUNC(cellImeJp, cellImeJpDeleteWord);
REG_FUNC(cellImeJp, cellImeJpAllDeleteConvertString);
REG_FUNC(cellImeJp, cellImeJpConvertForward);
REG_FUNC(cellImeJp, cellImeJpConvertBackward);
REG_FUNC(cellImeJp, cellImeJpCurrentPartConfirm);
REG_FUNC(cellImeJp, cellImeJpAllConfirm);
REG_FUNC(cellImeJp, cellImeJpConvertCancel);
REG_FUNC(cellImeJp, cellImeJpAllConvertCancel);
REG_FUNC(cellImeJp, cellImeJpExtendConvertArea);
REG_FUNC(cellImeJp, cellImeJpShortenConvertArea);
REG_FUNC(cellImeJp, cellImeJpTemporalConfirm);
REG_FUNC(cellImeJp, cellImeJpPostConvert);
REG_FUNC(cellImeJp, cellImeJpMoveFocusClause);
REG_FUNC(cellImeJp, cellImeJpGetFocusTop);
REG_FUNC(cellImeJp, cellImeJpGetFocusLength);
REG_FUNC(cellImeJp, cellImeJpGetConfirmYomiString);
REG_FUNC(cellImeJp, cellImeJpGetConfirmString);
REG_FUNC(cellImeJp, cellImeJpGetConvertYomiString);
REG_FUNC(cellImeJp, cellImeJpGetConvertString);
REG_FUNC(cellImeJp, cellImeJpGetCandidateListSize);
REG_FUNC(cellImeJp, cellImeJpGetCandidateList);
REG_FUNC(cellImeJp, cellImeJpGetCandidateSelect);
REG_FUNC(cellImeJp, cellImeJpGetPredictList);
REG_FUNC(cellImeJp, cellImeJpConfirmPrediction);
});

View file

@ -68,6 +68,11 @@ s32 cellJpgDecOpen(u32 mainHandle, vm::ptr<u32> subHandle, vm::ptr<CellJpgDecSrc
return CELL_OK;
}
s32 cellJpgDecExtOpen()
{
throw EXCEPTION("");
}
s32 cellJpgDecClose(u32 mainHandle, u32 subHandle)
{
cellJpgDec.Warning("cellJpgDecOpen(mainHandle=0x%x, subHandle=0x%x)", mainHandle, subHandle);
@ -157,6 +162,11 @@ s32 cellJpgDecReadHeader(u32 mainHandle, u32 subHandle, vm::ptr<CellJpgDecInfo>
return CELL_OK;
}
s32 cellJpgDecExtReadHeader()
{
throw EXCEPTION("");
}
s32 cellJpgDecDecodeData(u32 mainHandle, u32 subHandle, vm::ptr<u8> data, vm::cptr<CellJpgDecDataCtrlParam> dataCtrlParam, vm::ptr<CellJpgDecDataOutInfo> dataOutInfo)
{
cellJpgDec.Log("cellJpgDecDecodeData(mainHandle=0x%x, subHandle=0x%x, data=*0x%x, dataCtrlParam=*0x%x, dataOutInfo=*0x%x)", mainHandle, subHandle, data, dataCtrlParam, dataOutInfo);
@ -293,6 +303,11 @@ s32 cellJpgDecDecodeData(u32 mainHandle, u32 subHandle, vm::ptr<u8> data, vm::cp
return CELL_OK;
}
s32 cellJpgDecExtDecodeData()
{
throw EXCEPTION("");
}
s32 cellJpgDecSetParameter(u32 mainHandle, u32 subHandle, vm::cptr<CellJpgDecInParam> inParam, vm::ptr<CellJpgDecOutParam> outParam)
{
cellJpgDec.Log("cellJpgDecSetParameter(mainHandle=0x%x, subHandle=0x%x, inParam=*0x%x, outParam=*0x%x)", mainHandle, subHandle, inParam, outParam);
@ -338,6 +353,11 @@ s32 cellJpgDecSetParameter(u32 mainHandle, u32 subHandle, vm::cptr<CellJpgDecInP
return CELL_OK;
}
s32 cellJpgDecExtSetParameter()
{
throw EXCEPTION("");
}
Module cellJpgDec("cellJpgDec", []()
{
@ -350,8 +370,8 @@ Module cellJpgDec("cellJpgDec", []()
REG_FUNC(cellJpgDec, cellJpgDecClose);
REG_FUNC(cellJpgDec, cellJpgDecDestroy);
/*REG_FUNC(cellJpgDec, cellJpgDecExtOpen);
REG_FUNC(cellJpgDec, cellJpgDecExtOpen);
REG_FUNC(cellJpgDec, cellJpgDecExtReadHeader);
REG_FUNC(cellJpgDec, cellJpgDecExtSetParameter);
REG_FUNC(cellJpgDec, cellJpgDecExtDecodeData);*/
REG_FUNC(cellJpgDec, cellJpgDecExtDecodeData);
});

View file

@ -1,8 +1,8 @@
#include "stdafx.h"
#if 0
#include "Emu/Memory/Memory.h"
#include "Emu/SysCalls/Modules.h"
void cellJpgEnc_init();
Module cellJpgEnc(0x003d, cellJpgEnc_init);
extern Module cellJpgEnc;
// Error Codes
enum
@ -15,67 +15,67 @@ enum
CELL_JPGENC_ERROR_FATAL = 0x80611196,
};
int cellJpgEncQueryAttr()
s32 cellJpgEncQueryAttr()
{
UNIMPLEMENTED_FUNC(cellJpgEnc);
return CELL_OK;
}
int cellJpgEncOpen()
s32 cellJpgEncOpen()
{
UNIMPLEMENTED_FUNC(cellJpgEnc);
return CELL_OK;
}
int cellJpgEncOpenEx()
s32 cellJpgEncOpenEx()
{
UNIMPLEMENTED_FUNC(cellJpgEnc);
return CELL_OK;
}
int cellJpgEncClose()
s32 cellJpgEncClose()
{
UNIMPLEMENTED_FUNC(cellJpgEnc);
return CELL_OK;
}
int cellJpgEncWaitForInput()
s32 cellJpgEncWaitForInput()
{
UNIMPLEMENTED_FUNC(cellJpgEnc);
return CELL_OK;
}
int cellJpgEncEncodePicture()
s32 cellJpgEncEncodePicture()
{
UNIMPLEMENTED_FUNC(cellJpgEnc);
return CELL_OK;
}
int cellJpgEncEncodePicture2()
s32 cellJpgEncEncodePicture2()
{
UNIMPLEMENTED_FUNC(cellJpgEnc);
return CELL_OK;
}
int cellJpgEncWaitForOutput()
s32 cellJpgEncWaitForOutput()
{
UNIMPLEMENTED_FUNC(cellJpgEnc);
return CELL_OK;
}
int cellJpgEncGetStreamInfo()
s32 cellJpgEncGetStreamInfo()
{
UNIMPLEMENTED_FUNC(cellJpgEnc);
return CELL_OK;
}
int cellJpgEncReset()
s32 cellJpgEncReset()
{
UNIMPLEMENTED_FUNC(cellJpgEnc);
return CELL_OK;
}
void cellJpgEnc_init()
Module cellJpgEnc("cellJpgEnc", []()
{
REG_FUNC(cellJpgEnc, cellJpgEncQueryAttr);
REG_FUNC(cellJpgEnc, cellJpgEncOpen);
@ -87,5 +87,4 @@ void cellJpgEnc_init()
REG_FUNC(cellJpgEnc, cellJpgEncWaitForOutput);
REG_FUNC(cellJpgEnc, cellJpgEncGetStreamInfo);
REG_FUNC(cellJpgEnc, cellJpgEncReset);
}
#endif
});

View file

@ -1,8 +1,8 @@
#include "stdafx.h"
#if 0
#include "Emu/Memory/Memory.h"
#include "Emu/SysCalls/Modules.h"
void cellKey2char_init();
Module cellKey2char(0x0021, cellKey2char_init);
extern Module cellKey2char;
// Return Codes
enum
@ -16,42 +16,41 @@ enum
CELL_K2C_ERROR_OTHER = 0x80121306,
};
int cellKey2CharOpen()
s32 cellKey2CharOpen()
{
UNIMPLEMENTED_FUNC(cellKey2char);
return CELL_OK;
}
int cellKey2CharClose()
s32 cellKey2CharClose()
{
UNIMPLEMENTED_FUNC(cellKey2char);
return CELL_OK;
}
int cellKey2CharGetChar()
s32 cellKey2CharGetChar()
{
UNIMPLEMENTED_FUNC(cellKey2char);
return CELL_OK;
}
int cellKey2CharSetMode()
s32 cellKey2CharSetMode()
{
UNIMPLEMENTED_FUNC(cellKey2char);
return CELL_OK;
}
int cellKey2CharSetArrangement()
s32 cellKey2CharSetArrangement()
{
UNIMPLEMENTED_FUNC(cellKey2char);
return CELL_OK;
}
void cellKey2char_init()
Module cellKey2char("cellKey2char", []()
{
REG_FUNC(cellKey2char, cellKey2CharOpen);
REG_FUNC(cellKey2char, cellKey2CharClose);
REG_FUNC(cellKey2char, cellKey2CharGetChar);
REG_FUNC(cellKey2char, cellKey2CharSetMode);
REG_FUNC(cellKey2char, cellKey2CharSetArrangement);
}
#endif
});

File diff suppressed because it is too large Load diff

View file

@ -7,27 +7,10 @@
extern Module cellMic;
struct cellMicInternal
{
bool m_bCellMicInitialized;;
cellMicInternal()
: m_bCellMicInitialized(false)
{
}
};
cellMicInternal cellMicInstance;
s32 cellMicInit()
{
cellMic.Warning("cellMicInit()");
if (cellMicInstance.m_bCellMicInitialized)
return CELL_MICIN_ERROR_ALREADY_INIT;
cellMicInstance.m_bCellMicInitialized = true;
return CELL_OK;
}
@ -35,11 +18,6 @@ s32 cellMicEnd()
{
cellMic.Warning("cellMicEnd()");
if (!cellMicInstance.m_bCellMicInitialized)
return CELL_MICIN_ERROR_NOT_INIT;
cellMicInstance.m_bCellMicInitialized = false;
return CELL_OK;
}
@ -213,8 +191,7 @@ s32 cellMicGetStatus()
s32 cellMicStopEx()
{
UNIMPLEMENTED_FUNC(cellMic);
return CELL_OK;
throw EXCEPTION("Unexpected function");
}
s32 cellMicSysShareClose()
@ -285,8 +262,6 @@ s32 cellMicGetDeviceIdentifier()
Module cellMic("cellMic", []()
{
cellMicInstance.m_bCellMicInitialized = false;
REG_FUNC(cellMic, cellMicInit);
REG_FUNC(cellMic, cellMicEnd);
REG_FUNC(cellMic, cellMicOpen);
@ -322,7 +297,7 @@ Module cellMic("cellMic", []()
REG_FUNC(cellMic, cellMicReadDsp);
REG_FUNC(cellMic, cellMicGetStatus);
REG_FUNC(cellMic, cellMicStopEx);
REG_FUNC(cellMic, cellMicStopEx); // this function shouldn't exist
REG_FUNC(cellMic, cellMicSysShareClose);
REG_FUNC(cellMic, cellMicGetFormat);
REG_FUNC(cellMic, cellMicSetMultiMicNotifyEventQueue);

View file

@ -14,7 +14,6 @@ extern u64 get_system_time();
std::unique_ptr<MsgDialogInstance> g_msg_dialog;
MsgDialogInstance::MsgDialogInstance()
: state(msgDialogNone)
{
}
@ -24,6 +23,11 @@ void MsgDialogInstance::Close()
wait_until = get_system_time();
}
s32 cellMsgDialogOpen()
{
throw EXCEPTION("");
}
s32 cellMsgDialogOpen2(u32 type, vm::cptr<char> msgString, vm::ptr<CellMsgDialogCallback> callback, vm::ptr<void> userData, vm::ptr<void> extParam)
{
cellSysutil.Warning("cellMsgDialogOpen2(type=0x%x, msgString=*0x%x, callback=*0x%x, userData=*0x%x, extParam=*0x%x)", type, msgString, callback, userData, extParam);
@ -83,7 +87,7 @@ s32 cellMsgDialogOpen2(u32 type, vm::cptr<char> msgString, vm::ptr<CellMsgDialog
}
MsgDialogState old = msgDialogNone;
if (!g_msg_dialog->state.compare_exchange_strong(old, msgDialogOpen))
if (!g_msg_dialog->state.compare_exchange_strong(old, msgDialogInit))
{
return CELL_SYSUTIL_ERROR_BUSY;
}
@ -105,33 +109,45 @@ s32 cellMsgDialogOpen2(u32 type, vm::cptr<char> msgString, vm::ptr<CellMsgDialog
std::string msg = msgString.get_ptr();
switch (type & CELL_MSGDIALOG_TYPE_SE_TYPE)
{
case CELL_MSGDIALOG_TYPE_SE_TYPE_NORMAL: cellSysutil.Warning("%s", msg); break;
case CELL_MSGDIALOG_TYPE_SE_TYPE_ERROR: cellSysutil.Error("%s", msg); break;
}
g_msg_dialog->status = CELL_MSGDIALOG_BUTTON_NONE;
CallAfter([type, msg]()
{
if (Emu.IsStopped())
{
g_msg_dialog->state.exchange(msgDialogNone);
return;
}
g_msg_dialog->Create(type, msg);
g_msg_dialog->state.exchange(msgDialogOpen);
});
while (g_msg_dialog->state == msgDialogInit)
{
if (Emu.IsStopped())
{
if (g_msg_dialog->state != msgDialogNone)
{
break;
}
CHECK_EMU_STATUS;
}
std::this_thread::sleep_for(std::chrono::milliseconds(1)); // hack
}
thread_t(WRAP_EXPR("MsgDialog Thread"), [=]()
{
switch (type & CELL_MSGDIALOG_TYPE_SE_TYPE)
{
case CELL_MSGDIALOG_TYPE_SE_TYPE_NORMAL: cellSysutil.Warning("%s", msg); break;
case CELL_MSGDIALOG_TYPE_SE_TYPE_ERROR: cellSysutil.Error("%s", msg); break;
}
g_msg_dialog->status = CELL_MSGDIALOG_BUTTON_NONE;
volatile bool m_signal = false;
CallAfter([type, msg, &m_signal]()
{
if (Emu.IsStopped()) return;
g_msg_dialog->Create(type, msg);
m_signal = true;
});
while (!m_signal)
{
CHECK_EMU_STATUS;
std::this_thread::sleep_for(std::chrono::milliseconds(1)); // hack
}
while (g_msg_dialog->state == msgDialogOpen || (s64)(get_system_time() - g_msg_dialog->wait_until) < 0)
{
if (Emu.IsStopped())
@ -142,7 +158,7 @@ s32 cellMsgDialogOpen2(u32 type, vm::cptr<char> msgString, vm::ptr<CellMsgDialog
std::this_thread::sleep_for(std::chrono::milliseconds(1)); // hack
}
if (callback && (g_msg_dialog->state != msgDialogAbort))
if (callback && g_msg_dialog->state != msgDialogAbort)
{
const s32 status = g_msg_dialog->status;
@ -245,6 +261,11 @@ s32 cellMsgDialogOpenErrorCode(PPUThread& CPU, u32 errorCode, vm::ptr<CellMsgDia
return cellMsgDialogOpen2(CELL_MSGDIALOG_DIALOG_TYPE_ERROR | CELL_MSGDIALOG_TYPE_BUTTON_TYPE_OK, message, callback, userData, extParam);
}
s32 cellMsgDialogOpenSimulViewWarning()
{
throw EXCEPTION("");
}
s32 cellMsgDialogClose(float delay)
{
cellSysutil.Warning("cellMsgDialogClose(delay=%f)", delay);
@ -350,8 +371,12 @@ s32 cellMsgDialogProgressBarInc(u32 progressBarIndex, u32 delta)
void cellSysutil_MsgDialog_init()
{
g_msg_dialog->state = msgDialogNone;
REG_FUNC(cellSysutil, cellMsgDialogOpen);
REG_FUNC(cellSysutil, cellMsgDialogOpen2);
REG_FUNC(cellSysutil, cellMsgDialogOpenErrorCode);
REG_FUNC(cellSysutil, cellMsgDialogOpenSimulViewWarning);
REG_FUNC(cellSysutil, cellMsgDialogProgressBarSetMsg);
REG_FUNC(cellSysutil, cellMsgDialogProgressBarReset);
REG_FUNC(cellSysutil, cellMsgDialogProgressBarInc);

View file

@ -82,11 +82,12 @@ enum : s32
CELL_MSGDIALOG_BUTTON_ESCAPE = 3,
};
typedef void(CellMsgDialogCallback)(s32 buttonType, vm::ptr<void> userData);
using CellMsgDialogCallback = void(s32 buttonType, vm::ptr<void> userData);
enum MsgDialogState
{
msgDialogNone,
msgDialogInit,
msgDialogOpen,
msgDialogClose,
msgDialogAbort,
@ -96,9 +97,9 @@ struct MsgDialogInstance
{
std::atomic<MsgDialogState> state;
s32 status = 0;
u64 wait_until = 0;
u32 progress_bar_count = 0;
s32 status;
u64 wait_until;
u32 progress_bar_count;
MsgDialogInstance();
virtual ~MsgDialogInstance() = default;

View file

@ -0,0 +1,142 @@
#include "stdafx.h"
#include "Emu/Memory/Memory.h"
#include "Emu/SysCalls/Modules.h"
extern Module cellMusic;
s32 cellMusicGetSelectionContext()
{
throw EXCEPTION("");
}
s32 cellMusicSetSelectionContext2()
{
throw EXCEPTION("");
}
s32 cellMusicSetVolume2()
{
throw EXCEPTION("");
}
s32 cellMusicGetContentsId()
{
throw EXCEPTION("");
}
s32 cellMusicSetSelectionContext()
{
throw EXCEPTION("");
}
s32 cellMusicInitialize2SystemWorkload()
{
throw EXCEPTION("");
}
s32 cellMusicGetPlaybackStatus2()
{
throw EXCEPTION("");
}
s32 cellMusicGetContentsId2()
{
throw EXCEPTION("");
}
s32 cellMusicFinalize()
{
throw EXCEPTION("");
}
s32 cellMusicInitializeSystemWorkload()
{
throw EXCEPTION("");
}
s32 cellMusicInitialize()
{
throw EXCEPTION("");
}
s32 cellMusicFinalize2()
{
throw EXCEPTION("");
}
s32 cellMusicGetSelectionContext2()
{
throw EXCEPTION("");
}
s32 cellMusicGetVolume()
{
throw EXCEPTION("");
}
s32 cellMusicGetPlaybackStatus()
{
throw EXCEPTION("");
}
s32 cellMusicSetPlaybackCommand2()
{
throw EXCEPTION("");
}
s32 cellMusicSetPlaybackCommand()
{
throw EXCEPTION("");
}
s32 cellMusicSelectContents2()
{
throw EXCEPTION("");
}
s32 cellMusicSelectContents()
{
throw EXCEPTION("");
}
s32 cellMusicInitialize2()
{
throw EXCEPTION("");
}
s32 cellMusicSetVolume()
{
throw EXCEPTION("");
}
s32 cellMusicGetVolume2()
{
throw EXCEPTION("");
}
Module cellMusic("cellMusic", []()
{
REG_FUNC(cellMusic, cellMusicGetSelectionContext);
REG_FUNC(cellMusic, cellMusicSetSelectionContext2);
REG_FUNC(cellMusic, cellMusicSetVolume2);
REG_FUNC(cellMusic, cellMusicGetContentsId);
REG_FUNC(cellMusic, cellMusicSetSelectionContext);
REG_FUNC(cellMusic, cellMusicInitialize2SystemWorkload);
REG_FUNC(cellMusic, cellMusicGetPlaybackStatus2);
REG_FUNC(cellMusic, cellMusicGetContentsId2);
REG_FUNC(cellMusic, cellMusicFinalize);
REG_FUNC(cellMusic, cellMusicInitializeSystemWorkload);
REG_FUNC(cellMusic, cellMusicInitialize);
REG_FUNC(cellMusic, cellMusicFinalize2);
REG_FUNC(cellMusic, cellMusicGetSelectionContext2);
REG_FUNC(cellMusic, cellMusicGetVolume);
REG_FUNC(cellMusic, cellMusicGetPlaybackStatus);
REG_FUNC(cellMusic, cellMusicSetPlaybackCommand2);
REG_FUNC(cellMusic, cellMusicSetPlaybackCommand);
REG_FUNC(cellMusic, cellMusicSelectContents2);
REG_FUNC(cellMusic, cellMusicSelectContents);
REG_FUNC(cellMusic, cellMusicInitialize2);
REG_FUNC(cellMusic, cellMusicSetVolume);
REG_FUNC(cellMusic, cellMusicGetVolume2);
});

View file

@ -1,8 +1,8 @@
#include "stdafx.h"
#if 0
#include "Emu/Memory/Memory.h"
#include "Emu/SysCalls/Modules.h"
void cellMusicDecode_init();
Module cellMusicDecode(0x004f, cellMusicDecode_init);
extern Module cellMusicDecode;
// Return Codes
enum
@ -24,67 +24,128 @@ enum
CELL_MUSIC_DECODE_ERROR_GENERIC = 0x8002C1FF,
};
int cellMusicDecodeInitialize()
s32 cellMusicDecodeInitialize()
{
UNIMPLEMENTED_FUNC(cellMusicDecode);
return CELL_OK;
}
int cellMusicDecodeInitializeSystemWorkload()
s32 cellMusicDecodeInitializeSystemWorkload()
{
UNIMPLEMENTED_FUNC(cellMusicDecode);
return CELL_OK;
}
int cellMusicDecodeFinalize()
s32 cellMusicDecodeFinalize()
{
UNIMPLEMENTED_FUNC(cellMusicDecode);
return CELL_OK;
}
int cellMusicDecodeSelectContents()
s32 cellMusicDecodeSelectContents()
{
UNIMPLEMENTED_FUNC(cellMusicDecode);
return CELL_OK;
}
int cellMusicDecodeSetDecodeCommand()
s32 cellMusicDecodeSetDecodeCommand()
{
UNIMPLEMENTED_FUNC(cellMusicDecode);
return CELL_OK;
}
int cellMusicDecodeGetDecodeStatus()
s32 cellMusicDecodeGetDecodeStatus()
{
UNIMPLEMENTED_FUNC(cellMusicDecode);
return CELL_OK;
}
int cellMusicDecodeRead()
s32 cellMusicDecodeRead()
{
UNIMPLEMENTED_FUNC(cellMusicDecode);
return CELL_OK;
}
int cellMusicDecodeGetSelectionContext()
s32 cellMusicDecodeGetSelectionContext()
{
UNIMPLEMENTED_FUNC(cellMusicDecode);
return CELL_OK;
}
int cellMusicDecodeSetSelectionContext()
s32 cellMusicDecodeSetSelectionContext()
{
UNIMPLEMENTED_FUNC(cellMusicDecode);
return CELL_OK;
}
int cellMusicDecodeGetContentsId()
s32 cellMusicDecodeGetContentsId()
{
UNIMPLEMENTED_FUNC(cellMusicDecode);
return CELL_OK;
}
void cellMusicDecode_init()
s32 cellMusicDecodeInitialize2()
{
UNIMPLEMENTED_FUNC(cellMusicDecode);
return CELL_OK;
}
s32 cellMusicDecodeInitialize2SystemWorkload()
{
UNIMPLEMENTED_FUNC(cellMusicDecode);
return CELL_OK;
}
s32 cellMusicDecodeFinalize2()
{
UNIMPLEMENTED_FUNC(cellMusicDecode);
return CELL_OK;
}
s32 cellMusicDecodeSelectContents2()
{
UNIMPLEMENTED_FUNC(cellMusicDecode);
return CELL_OK;
}
s32 cellMusicDecodeSetDecodeCommand2()
{
UNIMPLEMENTED_FUNC(cellMusicDecode);
return CELL_OK;
}
s32 cellMusicDecodeGetDecodeStatus2()
{
UNIMPLEMENTED_FUNC(cellMusicDecode);
return CELL_OK;
}
s32 cellMusicDecodeRead2()
{
UNIMPLEMENTED_FUNC(cellMusicDecode);
return CELL_OK;
}
s32 cellMusicDecodeGetSelectionContext2()
{
UNIMPLEMENTED_FUNC(cellMusicDecode);
return CELL_OK;
}
s32 cellMusicDecodeSetSelectionContext2()
{
UNIMPLEMENTED_FUNC(cellMusicDecode);
return CELL_OK;
}
s32 cellMusicDecodeGetContentsId2()
{
UNIMPLEMENTED_FUNC(cellMusicDecode);
return CELL_OK;
}
Module cellMusicDecode("cellMusicDecode", []()
{
REG_FUNC(cellMusicDecode, cellMusicDecodeInitialize);
REG_FUNC(cellMusicDecode, cellMusicDecodeInitializeSystemWorkload);
@ -96,5 +157,15 @@ void cellMusicDecode_init()
REG_FUNC(cellMusicDecode, cellMusicDecodeGetSelectionContext);
REG_FUNC(cellMusicDecode, cellMusicDecodeSetSelectionContext);
REG_FUNC(cellMusicDecode, cellMusicDecodeGetContentsId);
}
#endif
REG_FUNC(cellMusicDecode, cellMusicDecodeInitialize2);
REG_FUNC(cellMusicDecode, cellMusicDecodeInitialize2SystemWorkload);
REG_FUNC(cellMusicDecode, cellMusicDecodeFinalize2);
REG_FUNC(cellMusicDecode, cellMusicDecodeSelectContents2);
REG_FUNC(cellMusicDecode, cellMusicDecodeSetDecodeCommand2);
REG_FUNC(cellMusicDecode, cellMusicDecodeGetDecodeStatus2);
REG_FUNC(cellMusicDecode, cellMusicDecodeRead2);
REG_FUNC(cellMusicDecode, cellMusicDecodeGetSelectionContext2);
REG_FUNC(cellMusicDecode, cellMusicDecodeSetSelectionContext2);
REG_FUNC(cellMusicDecode, cellMusicDecodeGetContentsId2);
});

View file

@ -1,8 +1,8 @@
#include "stdafx.h"
#if 0
#include "Emu/Memory/Memory.h"
#include "Emu/SysCalls/Modules.h"
void cellMusicExport_init();
Module cellMusicExport(0xf02c, cellMusicExport_init);
extern Module cellMusicExport;
// Return Codes
enum
@ -21,42 +21,41 @@ enum
CELL_MUSIC_EXPORT_UTIL_ERROR_INITIALIZE = 0x8002c60a,
};
int cellMusicExportInitialize()
s32 cellMusicExportInitialize()
{
UNIMPLEMENTED_FUNC(cellMusicExport);
return CELL_OK;
}
int cellMusicExportInitialize2()
s32 cellMusicExportInitialize2()
{
UNIMPLEMENTED_FUNC(cellMusicExport);
return CELL_OK;
}
int cellMusicExportFinalize()
s32 cellMusicExportFinalize()
{
UNIMPLEMENTED_FUNC(cellMusicExport);
return CELL_OK;
}
int cellMusicExportFromFile()
s32 cellMusicExportFromFile()
{
UNIMPLEMENTED_FUNC(cellMusicExport);
return CELL_OK;
}
int cellMusicExportProgress()
s32 cellMusicExportProgress()
{
UNIMPLEMENTED_FUNC(cellMusicExport);
return CELL_OK;
}
void cellMusicExport_init()
Module cellMusicExport("cellMusicExport", []()
{
REG_FUNC(cellMusicExport, cellMusicExportInitialize);
REG_FUNC(cellMusicExport, cellMusicExportInitialize2);
REG_FUNC(cellMusicExport, cellMusicExportFinalize);
REG_FUNC(cellMusicExport, cellMusicExportFromFile);
REG_FUNC(cellMusicExport, cellMusicExportProgress);
}
#endif
});

View file

@ -28,32 +28,16 @@
extern Module cellNetCtl;
std::unique_ptr<CellNetCtlInternal> g_netCtl;
s32 cellNetCtlInit()
{
cellNetCtl.Log("cellNetCtlInit()");
if (g_netCtl->m_bInitialized)
{
return CELL_NET_CTL_ERROR_NOT_TERMINATED;
}
g_netCtl->m_bInitialized = true;
cellNetCtl.Warning("cellNetCtlInit()");
return CELL_OK;
}
s32 cellNetCtlTerm()
{
cellNetCtl.Log("cellNetCtlTerm()");
if (!g_netCtl->m_bInitialized)
{
return CELL_NET_CTL_ERROR_NOT_INITIALIZED;
}
g_netCtl->m_bInitialized = false;
cellNetCtl.Warning("cellNetCtlTerm()");
return CELL_OK;
}
@ -268,10 +252,55 @@ s32 cellNetCtlGetNatInfo(vm::ptr<CellNetCtlNatInfo> natInfo)
return CELL_OK;
}
s32 cellGameUpdateInit()
{
throw EXCEPTION("");
}
s32 cellGameUpdateTerm()
{
throw EXCEPTION("");
}
s32 cellGameUpdateCheckStartAsync()
{
throw EXCEPTION("");
}
s32 cellGameUpdateCheckFinishAsync()
{
throw EXCEPTION("");
}
s32 cellGameUpdateCheckStartWithoutDialogAsync()
{
throw EXCEPTION("");
}
s32 cellGameUpdateCheckAbort()
{
throw EXCEPTION("");
}
s32 cellGameUpdateCheckStartAsyncEx()
{
throw EXCEPTION("");
}
s32 cellGameUpdateCheckFinishAsyncEx()
{
throw EXCEPTION("");
}
s32 cellGameUpdateCheckStartWithoutDialogAsyncEx()
{
throw EXCEPTION("");
}
Module cellNetCtl("cellNetCtl", []()
{
g_netCtl = std::make_unique<CellNetCtlInternal>();
REG_FUNC(cellNetCtl, cellNetCtlInit);
REG_FUNC(cellNetCtl, cellNetCtlTerm);
@ -286,4 +315,15 @@ Module cellNetCtl("cellNetCtl", []()
REG_FUNC(cellNetCtl, cellNetCtlNetStartDialogUnloadAsync);
REG_FUNC(cellNetCtl, cellNetCtlGetNatInfo);
REG_FUNC(cellNetCtl, cellGameUpdateInit);
REG_FUNC(cellNetCtl, cellGameUpdateTerm);
REG_FUNC(cellNetCtl, cellGameUpdateCheckStartAsync);
REG_FUNC(cellNetCtl, cellGameUpdateCheckFinishAsync);
REG_FUNC(cellNetCtl, cellGameUpdateCheckStartWithoutDialogAsync);
REG_FUNC(cellNetCtl, cellGameUpdateCheckAbort);
REG_FUNC(cellNetCtl, cellGameUpdateCheckStartAsyncEx);
REG_FUNC(cellNetCtl, cellGameUpdateCheckFinishAsyncEx);
REG_FUNC(cellNetCtl, cellGameUpdateCheckStartWithoutDialogAsyncEx);
});

View file

@ -196,18 +196,6 @@ enum
CELL_NET_CTL_NATINFO_NAT_TYPE_3 = 3,
};
struct CellNetCtlInternal
{
bool m_bInitialized;
CellNetCtlInternal()
: m_bInitialized(false)
{
}
};
extern std::unique_ptr<CellNetCtlInternal> g_netCtl;
struct CellNetCtlEtherAddr
{
u8 data[6];

View file

@ -0,0 +1,193 @@
#include "stdafx.h"
#include "Emu/Memory/Memory.h"
#include "Emu/SysCalls/Modules.h"
extern Module cellOskDialog;
s32 cellOskDialogLoadAsync()
{
throw EXCEPTION("");
}
s32 cellOskDialogUnloadAsync()
{
throw EXCEPTION("");
}
s32 cellOskDialogGetSize()
{
throw EXCEPTION("");
}
s32 cellOskDialogAbort()
{
throw EXCEPTION("");
}
s32 cellOskDialogSetDeviceMask()
{
throw EXCEPTION("");
}
s32 cellOskDialogSetSeparateWindowOption()
{
throw EXCEPTION("");
}
s32 cellOskDialogSetInitialInputDevice()
{
throw EXCEPTION("");
}
s32 cellOskDialogSetInitialKeyLayout()
{
throw EXCEPTION("");
}
s32 cellOskDialogDisableDimmer()
{
throw EXCEPTION("");
}
s32 cellOskDialogSetKeyLayoutOption()
{
throw EXCEPTION("");
}
s32 cellOskDialogAddSupportLanguage()
{
throw EXCEPTION("");
}
s32 cellOskDialogSetLayoutMode()
{
throw EXCEPTION("");
}
s32 cellOskDialogGetInputText()
{
throw EXCEPTION("");
}
s32 cellOskDialogExtInputDeviceUnlock()
{
throw EXCEPTION("");
}
s32 cellOskDialogExtRegisterKeyboardEventHookCallback()
{
throw EXCEPTION("");
}
s32 cellOskDialogExtAddJapaneseOptionDictionary()
{
throw EXCEPTION("");
}
s32 cellOskDialogExtEnableClipboard()
{
throw EXCEPTION("");
}
s32 cellOskDialogExtSendFinishMessage()
{
throw EXCEPTION("");
}
s32 cellOskDialogExtAddOptionDictionary()
{
throw EXCEPTION("");
}
s32 cellOskDialogExtSetInitialScale()
{
throw EXCEPTION("");
}
s32 cellOskDialogExtInputDeviceLock()
{
throw EXCEPTION("");
}
s32 cellOskDialogExtSetBaseColor()
{
throw EXCEPTION("");
}
s32 cellOskDialogExtRegisterConfirmWordFilterCallback()
{
throw EXCEPTION("");
}
s32 cellOskDialogExtUpdateInputText()
{
throw EXCEPTION("");
}
s32 cellOskDialogExtDisableHalfByteKana()
{
throw EXCEPTION("");
}
s32 cellOskDialogExtSetPointerEnable()
{
throw EXCEPTION("");
}
s32 cellOskDialogExtUpdatePointerDisplayPos()
{
throw EXCEPTION("");
}
s32 cellOskDialogExtEnableHalfByteKana()
{
throw EXCEPTION("");
}
s32 cellOskDialogExtRegisterForceFinishCallback()
{
throw EXCEPTION("");
}
void cellSysutil_OskDialog_init()
{
extern Module cellSysutil;
// cellOskDialog functions:
REG_FUNC(cellSysutil, cellOskDialogLoadAsync);
REG_FUNC(cellSysutil, cellOskDialogUnloadAsync);
REG_FUNC(cellSysutil, cellOskDialogGetSize);
REG_FUNC(cellSysutil, cellOskDialogAbort);
REG_FUNC(cellSysutil, cellOskDialogSetDeviceMask);
REG_FUNC(cellSysutil, cellOskDialogSetSeparateWindowOption);
REG_FUNC(cellSysutil, cellOskDialogSetInitialInputDevice);
REG_FUNC(cellSysutil, cellOskDialogSetInitialKeyLayout);
REG_FUNC(cellSysutil, cellOskDialogDisableDimmer);
REG_FUNC(cellSysutil, cellOskDialogSetKeyLayoutOption);
REG_FUNC(cellSysutil, cellOskDialogAddSupportLanguage);
REG_FUNC(cellSysutil, cellOskDialogSetLayoutMode);
REG_FUNC(cellSysutil, cellOskDialogGetInputText);
}
Module cellOskDialog("cellOskDialog", []()
{
// cellOskDialogExt functions:
REG_FUNC(cellOskDialog, cellOskDialogExtInputDeviceUnlock);
REG_FUNC(cellOskDialog, cellOskDialogExtRegisterKeyboardEventHookCallback);
REG_FUNC(cellOskDialog, cellOskDialogExtAddJapaneseOptionDictionary);
REG_FUNC(cellOskDialog, cellOskDialogExtEnableClipboard);
REG_FUNC(cellOskDialog, cellOskDialogExtSendFinishMessage);
REG_FUNC(cellOskDialog, cellOskDialogExtAddOptionDictionary);
REG_FUNC(cellOskDialog, cellOskDialogExtSetInitialScale);
REG_FUNC(cellOskDialog, cellOskDialogExtInputDeviceLock);
REG_FUNC(cellOskDialog, cellOskDialogExtSetBaseColor);
REG_FUNC(cellOskDialog, cellOskDialogExtRegisterConfirmWordFilterCallback);
REG_FUNC(cellOskDialog, cellOskDialogExtUpdateInputText);
REG_FUNC(cellOskDialog, cellOskDialogExtDisableHalfByteKana);
REG_FUNC(cellOskDialog, cellOskDialogExtSetPointerEnable);
REG_FUNC(cellOskDialog, cellOskDialogExtUpdatePointerDisplayPos);
REG_FUNC(cellOskDialog, cellOskDialogExtEnableHalfByteKana);
REG_FUNC(cellOskDialog, cellOskDialogExtRegisterForceFinishCallback);
});

View file

@ -83,6 +83,11 @@ s32 cellPadPeriphGetInfo(vm::ptr<CellPadPeriphInfo> info)
return CELL_OK;
}
s32 cellPadPeriphGetData()
{
throw EXCEPTION("");
}
s32 cellPadGetData(u32 port_no, vm::ptr<CellPadData> data)
{
sys_io.Log("cellPadGetData(port_no=%d, data=*0x%x)", port_no, data);
@ -262,6 +267,11 @@ s32 cellPadGetData(u32 port_no, vm::ptr<CellPadData> data)
return CELL_OK;
}
s32 cellPadGetRawData(u32 port_no, vm::ptr<CellPadData> data)
{
throw EXCEPTION("");
}
s32 cellPadGetDataExtra(u32 port_no, vm::ptr<u32> device_type, vm::ptr<CellPadData> data)
{
sys_io.Log("cellPadGetDataExtra(port_no=%d, device_type=*0x%x, device_type=*0x%x)", port_no, device_type, data);
@ -526,23 +536,26 @@ s32 cellPadLddUnregisterController(s32 handle)
return CELL_OK;
}
void cellPad_init()
{
REG_FUNC(sys_io, cellPadInit);
REG_FUNC(sys_io, cellPadEnd);
REG_FUNC(sys_io, cellPadClearBuf);
REG_FUNC(sys_io, cellPadGetData);
REG_FUNC(sys_io, cellPadGetRawData); //
REG_FUNC(sys_io, cellPadGetDataExtra);
REG_FUNC(sys_io, cellPadSetActDirect);
REG_FUNC(sys_io, cellPadGetInfo);
REG_FUNC(sys_io, cellPadGetInfo); //
REG_FUNC(sys_io, cellPadGetInfo2);
REG_FUNC(sys_io, cellPadPeriphGetInfo);
REG_FUNC(sys_io, cellPadPeriphGetData);
REG_FUNC(sys_io, cellPadSetPortSetting);
REG_FUNC(sys_io, cellPadInfoPressMode);
REG_FUNC(sys_io, cellPadInfoSensorMode);
REG_FUNC(sys_io, cellPadSetPressMode);
REG_FUNC(sys_io, cellPadSetSensorMode);
REG_FUNC(sys_io, cellPadGetCapabilityInfo);
REG_FUNC(sys_io, cellPadInfoPressMode); //
REG_FUNC(sys_io, cellPadInfoSensorMode); //
REG_FUNC(sys_io, cellPadSetPressMode); //
REG_FUNC(sys_io, cellPadSetSensorMode); //
REG_FUNC(sys_io, cellPadGetCapabilityInfo); //
REG_FUNC(sys_io, cellPadLddRegisterController);
REG_FUNC(sys_io, cellPadLddDataInsert);
REG_FUNC(sys_io, cellPadLddGetPortNo);

View file

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

View file

@ -157,7 +157,7 @@ struct CellPamfEp
// Entry point iterator
struct CellPamfEpIterator
{
bool isPamf;
b8 isPamf;
be_t<u32> index;
be_t<u32> num;
be_t<u32> pCur_addr;

View file

@ -1,8 +1,8 @@
#include "stdafx.h"
#if 0
#include "Emu/Memory/Memory.h"
#include "Emu/SysCalls/Modules.h"
void cellPhotoDecode_init();
Module cellPhotoDecode(0xf02e, cellPhotoDecode_init);
extern Module cellPhotoDecode;
// Return Codes
enum
@ -32,35 +32,34 @@ struct CellPhotoDecodeReturnParam
};
// Functions
int cellPhotoDecodeInitialize()
s32 cellPhotoDecodeInitialize()
{
UNIMPLEMENTED_FUNC(cellPhotoDecode);
return CELL_OK;
}
int cellPhotoDecodeInitialize2()
s32 cellPhotoDecodeInitialize2()
{
UNIMPLEMENTED_FUNC(cellPhotoDecode);
return CELL_OK;
}
int cellPhotoDecodeFinalize()
s32 cellPhotoDecodeFinalize()
{
UNIMPLEMENTED_FUNC(cellPhotoDecode);
return CELL_OK;
}
int cellPhotoDecodeFromFile()
s32 cellPhotoDecodeFromFile()
{
UNIMPLEMENTED_FUNC(cellPhotoDecode);
return CELL_OK;
}
void cellPhotoDecode_init()
Module cellPhotoDecode("cellPhotoDecode", []()
{
REG_FUNC(cellPhotoDecode, cellPhotoDecodeInitialize);
REG_FUNC(cellPhotoDecode, cellPhotoDecodeInitialize2);
REG_FUNC(cellPhotoDecode, cellPhotoDecodeFinalize);
REG_FUNC(cellPhotoDecode, cellPhotoDecodeFromFile);
}
#endif
});

View file

@ -1,8 +1,8 @@
#include "stdafx.h"
#if 0
#include "Emu/Memory/Memory.h"
#include "Emu/SysCalls/Modules.h"
void cellPhotoExport_init();
Module cellPhotoExport(0xf029, cellPhotoExport_init);
extern Module cellPhotoExport;
// Return Codes
enum
@ -21,43 +21,69 @@ enum
CELL_PHOTO_EXPORT_UTIL_ERROR_INITIALIZE = 0x8002c20a,
};
int cellPhotoExportInitialize()
s32 cellPhotoInitialize()
{
UNIMPLEMENTED_FUNC(cellPhotoExport);
return CELL_OK;
}
int cellPhotoExportInitialize2()
s32 cellPhotoFinalize()
{
UNIMPLEMENTED_FUNC(cellPhotoExport);
return CELL_OK;
}
int cellPhotoExportFinalize()
s32 cellPhotoRegistFromFile()
{
UNIMPLEMENTED_FUNC(cellPhotoExport);
return CELL_OK;
}
int cellPhotoExportFromFile()
s32 cellPhotoExportInitialize()
{
UNIMPLEMENTED_FUNC(cellPhotoExport);
return CELL_OK;
}
int cellPhotoExportProgress()
s32 cellPhotoExportInitialize2()
{
UNIMPLEMENTED_FUNC(cellPhotoExport);
return CELL_OK;
}
void cellPhotoExport_init()
s32 cellPhotoExportFinalize()
{
UNIMPLEMENTED_FUNC(cellPhotoExport);
return CELL_OK;
}
s32 cellPhotoExportFromFile()
{
UNIMPLEMENTED_FUNC(cellPhotoExport);
return CELL_OK;
}
s32 cellPhotoExportFromFileWithCopy()
{
UNIMPLEMENTED_FUNC(cellPhotoExport);
return CELL_OK;
}
s32 cellPhotoExportProgress()
{
UNIMPLEMENTED_FUNC(cellPhotoExport);
return CELL_OK;
}
Module cellPhotoExport("cellPhotoExport", []()
{
REG_FUNC(cellPhotoExport, cellPhotoInitialize);
REG_FUNC(cellPhotoExport, cellPhotoFinalize);
REG_FUNC(cellPhotoExport, cellPhotoRegistFromFile);
REG_FUNC(cellPhotoExport, cellPhotoExportInitialize);
REG_FUNC(cellPhotoExport, cellPhotoExportInitialize2);
REG_FUNC(cellPhotoExport, cellPhotoExportFinalize);
REG_FUNC(cellPhotoExport, cellPhotoExportFromFile);
//cellPhotoExport.AddFunc(, cellPhotoExportFromFileWithCopy);
REG_FUNC(cellPhotoExport, cellPhotoExportFromFileWithCopy);
REG_FUNC(cellPhotoExport, cellPhotoExportProgress);
}
#endif
});

View file

@ -1,8 +1,8 @@
#include "stdafx.h"
#if 0
#include "Emu/Memory/Memory.h"
#include "Emu/SysCalls/Modules.h"
void cellPhotoImport_init();
Module cellPhotoImport(0xf02b, cellPhotoImport_init);
extern Module cellPhotoImportUtil;
// Return Codes
enum
@ -41,21 +41,20 @@ struct CellPhotoImportSetParam
};
// Functions
int _cellPhotoImport()
s32 cellPhotoImport()
{
UNIMPLEMENTED_FUNC(cellPhotoImport);
UNIMPLEMENTED_FUNC(cellPhotoImportUtil);
return CELL_OK;
}
int _cellPhotoImport2()
s32 cellPhotoImport2()
{
UNIMPLEMENTED_FUNC(cellPhotoImport);
UNIMPLEMENTED_FUNC(cellPhotoImportUtil);
return CELL_OK;
}
void cellPhotoImport_init()
Module cellPhotoImportUtil("cellPhotoImport", []()
{
REG_FUNC(cellPhotoImport, _cellPhotoImport);
REG_FUNC(cellPhotoImport, _cellPhotoImport2);
}
#endif
REG_FUNC(cellPhotoImportUtil, cellPhotoImport);
REG_FUNC(cellPhotoImportUtil, cellPhotoImport2);
});

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