ModuleManager cleanup

This commit is contained in:
Nekotekina 2015-07-31 21:48:45 +03:00
parent eb5974322f
commit a2646f9871
17 changed files with 432 additions and 545 deletions

View File

@ -78,6 +78,8 @@ 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;
@ -158,7 +160,11 @@ const g_module_list[] =
{ 0x0028, "cellAdecAtx", nullptr },
{ 0x0029, "cellAdecAt3", nullptr },
{ 0x002a, "cellDmuxPamf", nullptr },
{ 0x002b, "?", nullptr },
{ 0x002c, "?", nullptr },
{ 0x002d, "?", nullptr },
{ 0x002e, "sys_lv2dbg", &sys_lv2dbg },
{ 0x002f, "cellSysutilAvcExt", nullptr },
{ 0x0030, "cellUsbPspcm", &cellUsbPspcm },
{ 0x0031, "cellSysutilAvconfExt", &cellAvconfExt },
{ 0x0032, "cellUserInfo", &cellUserInfo },
@ -223,6 +229,8 @@ const g_module_list[] =
{ -1, "cellMinisSaveData", &cellMinisSaveData },
{ -1, "cellSpudll", &cellSpudll },
{ -1, "cellRemotePlay", &cellRemotePlay },
{ -1, "libsnd3", &libsnd3 },
{ -1, "libsynth2", &libsynth2 },
};
void ModuleManager::Init()

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)
@ -240,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++)
{
@ -257,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;
@ -350,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);
}
@ -366,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++)
{
@ -383,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);
}
}
}

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;
};
@ -120,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);
@ -152,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

@ -4,8 +4,6 @@
#include "Emu/SysCalls/ModuleManager.h"
#include "Emu/SysCalls/Modules.h"
namespace vm { using namespace ps3; }
extern Module cellSysmodule;
enum
@ -69,6 +67,7 @@ const char* get_module_id(u16 id)
case 0x002c: return "CELL_SYSMODULE_ADEC_AL";
case 0x002d: return "CELL_SYSMODULE_DMUX_AL";
case 0x002e: return "CELL_SYSMODULE_LV2DBG";
case 0x002f: return "CELL_SYSMODULE_SYSUTIL_AVCHAT";
case 0x0030: return "CELL_SYSMODULE_USBPSPCM";
case 0x0031: return "CELL_SYSMODULE_AVCONF_EXT";
case 0x0032: return "CELL_SYSMODULE_SYSUTIL_USERINFO";

View File

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

View File

@ -12,13 +12,8 @@
extern Module libmixer;
SurMixerConfig g_surmx;
vm::ptr<CellSurMixerNotifyCallbackFunction> surMixerCb;
vm::ptr<void> surMixerCbArg;
std::mutex mixer_mutex;
float mixdata[8*256];
u64 mixcount;
std::vector<SSPlayer> ssp;
std::vector<SSPlayer> g_ssp;
s32 cellAANAddData(u32 aan_handle, u32 aan_port, u32 offset, vm::ptr<float> addr, u32 samples)
{
@ -47,7 +42,7 @@ s32 cellAANAddData(u32 aan_handle, u32 aan_port, u32 offset, vm::ptr<float> addr
return CELL_LIBMIXER_ERROR_INVALID_PARAMATER;
}
std::lock_guard<std::mutex> lock(mixer_mutex);
std::lock_guard<std::mutex> lock(g_surmx.mutex);
if (type == CELL_SURMIXER_CHSTRIP_TYPE1A)
{
@ -55,8 +50,8 @@ s32 cellAANAddData(u32 aan_handle, u32 aan_port, u32 offset, vm::ptr<float> addr
for (u32 i = 0; i < samples; i++)
{
const float center = addr[i];
mixdata[i * 8 + 0] += center;
mixdata[i * 8 + 1] += center;
g_surmx.mixdata[i * 8 + 0] += center;
g_surmx.mixdata[i * 8 + 1] += center;
}
}
else if (type == CELL_SURMIXER_CHSTRIP_TYPE2A)
@ -66,8 +61,8 @@ s32 cellAANAddData(u32 aan_handle, u32 aan_port, u32 offset, vm::ptr<float> addr
{
const float left = addr[i * 2 + 0];
const float right = addr[i * 2 + 1];
mixdata[i * 8 + 0] += left;
mixdata[i * 8 + 1] += right;
g_surmx.mixdata[i * 8 + 0] += left;
g_surmx.mixdata[i * 8 + 1] += right;
}
}
else if (type == CELL_SURMIXER_CHSTRIP_TYPE6A)
@ -81,12 +76,12 @@ s32 cellAANAddData(u32 aan_handle, u32 aan_port, u32 offset, vm::ptr<float> addr
const float low_freq = addr[i * 6 + 3];
const float rear_left = addr[i * 6 + 4];
const float rear_right = addr[i * 6 + 5];
mixdata[i * 8 + 0] += left;
mixdata[i * 8 + 1] += right;
mixdata[i * 8 + 2] += center;
mixdata[i * 8 + 3] += low_freq;
mixdata[i * 8 + 4] += rear_left;
mixdata[i * 8 + 5] += rear_right;
g_surmx.mixdata[i * 8 + 0] += left;
g_surmx.mixdata[i * 8 + 1] += right;
g_surmx.mixdata[i * 8 + 2] += center;
g_surmx.mixdata[i * 8 + 3] += low_freq;
g_surmx.mixdata[i * 8 + 4] += rear_left;
g_surmx.mixdata[i * 8 + 5] += rear_right;
}
}
else if (type == CELL_SURMIXER_CHSTRIP_TYPE8A)
@ -94,7 +89,7 @@ s32 cellAANAddData(u32 aan_handle, u32 aan_port, u32 offset, vm::ptr<float> addr
// 7.1
for (u32 i = 0; i < samples * 8; i++)
{
mixdata[i] += addr[i];
g_surmx.mixdata[i] += addr[i];
}
}
@ -106,15 +101,15 @@ s32 cellAANConnect(u32 receive, u32 receivePortNo, u32 source, u32 sourcePortNo)
libmixer.Warning("cellAANConnect(receive=0x%x, receivePortNo=0x%x, source=0x%x, sourcePortNo=0x%x)",
receive, receivePortNo, source, sourcePortNo);
std::lock_guard<std::mutex> lock(mixer_mutex);
std::lock_guard<std::mutex> lock(g_surmx.mutex);
if (source >= ssp.size() || !ssp[source].m_created)
if (source >= g_ssp.size() || !g_ssp[source].m_created)
{
libmixer.Error("cellAANConnect(): invalid source (%d)", source);
return CELL_LIBMIXER_ERROR_INVALID_PARAMATER;
}
ssp[source].m_connected = true;
g_ssp[source].m_connected = true;
return CELL_OK;
}
@ -124,15 +119,15 @@ s32 cellAANDisconnect(u32 receive, u32 receivePortNo, u32 source, u32 sourcePort
libmixer.Warning("cellAANDisconnect(receive=0x%x, receivePortNo=0x%x, source=0x%x, sourcePortNo=0x%x)",
receive, receivePortNo, source, sourcePortNo);
std::lock_guard<std::mutex> lock(mixer_mutex);
std::lock_guard<std::mutex> lock(g_surmx.mutex);
if (source >= ssp.size() || !ssp[source].m_created)
if (source >= g_ssp.size() || !g_ssp[source].m_created)
{
libmixer.Error("cellAANDisconnect(): invalid source (%d)", source);
return CELL_LIBMIXER_ERROR_INVALID_PARAMATER;
}
ssp[source].m_connected = false;
g_ssp[source].m_connected = false;
return CELL_OK;
}
@ -147,7 +142,7 @@ s32 cellSSPlayerCreate(vm::ptr<u32> handle, vm::ptr<CellSSPlayerConfig> config)
return CELL_LIBMIXER_ERROR_INVALID_PARAMATER;
}
std::lock_guard<std::mutex> lock(mixer_mutex);
std::lock_guard<std::mutex> lock(g_surmx.mutex);
SSPlayer p;
p.m_created = true;
@ -155,8 +150,8 @@ s32 cellSSPlayerCreate(vm::ptr<u32> handle, vm::ptr<CellSSPlayerConfig> config)
p.m_active = false;
p.m_channels = config->channels;
ssp.push_back(p);
*handle = (u32)ssp.size() - 1;
g_ssp.push_back(p);
*handle = (u32)g_ssp.size() - 1;
return CELL_OK;
}
@ -164,17 +159,17 @@ s32 cellSSPlayerRemove(u32 handle)
{
libmixer.Warning("cellSSPlayerRemove(handle=0x%x)", handle);
std::lock_guard<std::mutex> lock(mixer_mutex);
std::lock_guard<std::mutex> lock(g_surmx.mutex);
if (handle >= ssp.size() || !ssp[handle].m_created)
if (handle >= g_ssp.size() || !g_ssp[handle].m_created)
{
libmixer.Error("cellSSPlayerRemove(): SSPlayer not found (%d)", handle);
return CELL_LIBMIXER_ERROR_INVALID_PARAMATER;
}
ssp[handle].m_active = false;
ssp[handle].m_created = false;
ssp[handle].m_connected = false;
g_ssp[handle].m_active = false;
g_ssp[handle].m_created = false;
g_ssp[handle].m_connected = false;
return CELL_OK;
}
@ -183,9 +178,9 @@ s32 cellSSPlayerSetWave(u32 handle, vm::ptr<CellSSPlayerWaveParam> waveInfo, vm:
{
libmixer.Warning("cellSSPlayerSetWave(handle=0x%x, waveInfo=*0x%x, commonInfo=*0x%x)", handle, waveInfo, commonInfo);
std::lock_guard<std::mutex> lock(mixer_mutex);
std::lock_guard<std::mutex> lock(g_surmx.mutex);
if (handle >= ssp.size() || !ssp[handle].m_created)
if (handle >= g_ssp.size() || !g_ssp[handle].m_created)
{
libmixer.Error("cellSSPlayerSetWave(): SSPlayer not found (%d)", handle);
return CELL_LIBMIXER_ERROR_INVALID_PARAMATER;
@ -193,11 +188,11 @@ s32 cellSSPlayerSetWave(u32 handle, vm::ptr<CellSSPlayerWaveParam> waveInfo, vm:
// TODO: check parameters
ssp[handle].m_addr = waveInfo->addr;
ssp[handle].m_samples = waveInfo->samples;
ssp[handle].m_loop_start = waveInfo->loopStartOffset - 1;
ssp[handle].m_loop_mode = commonInfo ? (u32)commonInfo->loopMode : CELL_SSPLAYER_ONESHOT;
ssp[handle].m_position = waveInfo->startOffset - 1;
g_ssp[handle].m_addr = waveInfo->addr;
g_ssp[handle].m_samples = waveInfo->samples;
g_ssp[handle].m_loop_start = waveInfo->loopStartOffset - 1;
g_ssp[handle].m_loop_mode = commonInfo ? (u32)commonInfo->loopMode : CELL_SSPLAYER_ONESHOT;
g_ssp[handle].m_position = waveInfo->startOffset - 1;
return CELL_OK;
}
@ -206,9 +201,9 @@ s32 cellSSPlayerPlay(u32 handle, vm::ptr<CellSSPlayerRuntimeInfo> info)
{
libmixer.Warning("cellSSPlayerPlay(handle=0x%x, info=*0x%x)", handle, info);
std::lock_guard<std::mutex> lock(mixer_mutex);
std::lock_guard<std::mutex> lock(g_surmx.mutex);
if (handle >= ssp.size() || !ssp[handle].m_created)
if (handle >= g_ssp.size() || !g_ssp[handle].m_created)
{
libmixer.Error("cellSSPlayerPlay(): SSPlayer not found (%d)", handle);
return CELL_LIBMIXER_ERROR_INVALID_PARAMATER;
@ -216,12 +211,12 @@ s32 cellSSPlayerPlay(u32 handle, vm::ptr<CellSSPlayerRuntimeInfo> info)
// TODO: check parameters
ssp[handle].m_active = true;
ssp[handle].m_level = info->level;
ssp[handle].m_speed = info->speed;
ssp[handle].m_x = info->position.x;
ssp[handle].m_y = info->position.y;
ssp[handle].m_z = info->position.z;
g_ssp[handle].m_active = true;
g_ssp[handle].m_level = info->level;
g_ssp[handle].m_speed = info->speed;
g_ssp[handle].m_x = info->position.x;
g_ssp[handle].m_y = info->position.y;
g_ssp[handle].m_z = info->position.z;
return CELL_OK;
}
@ -230,9 +225,9 @@ s32 cellSSPlayerStop(u32 handle, u32 mode)
{
libmixer.Warning("cellSSPlayerStop(handle=0x%x, mode=0x%x)", handle, mode);
std::lock_guard<std::mutex> lock(mixer_mutex);
std::lock_guard<std::mutex> lock(g_surmx.mutex);
if (handle >= ssp.size() || !ssp[handle].m_created)
if (handle >= g_ssp.size() || !g_ssp[handle].m_created)
{
libmixer.Error("cellSSPlayerStop(): SSPlayer not found (%d)", handle);
return CELL_LIBMIXER_ERROR_INVALID_PARAMATER;
@ -240,7 +235,7 @@ s32 cellSSPlayerStop(u32 handle, u32 mode)
// TODO: transition to stop state
ssp[handle].m_active = false;
g_ssp[handle].m_active = false;
return CELL_OK;
}
@ -249,9 +244,9 @@ s32 cellSSPlayerSetParam(u32 handle, vm::ptr<CellSSPlayerRuntimeInfo> info)
{
libmixer.Warning("cellSSPlayerSetParam(handle=0x%x, info=*0x%x)", handle, info);
std::lock_guard<std::mutex> lock(mixer_mutex);
std::lock_guard<std::mutex> lock(g_surmx.mutex);
if (handle >= ssp.size() || !ssp[handle].m_created)
if (handle >= g_ssp.size() || !g_ssp[handle].m_created)
{
libmixer.Error("cellSSPlayerSetParam(): SSPlayer not found (%d)", handle);
return CELL_LIBMIXER_ERROR_INVALID_PARAMATER;
@ -259,11 +254,11 @@ s32 cellSSPlayerSetParam(u32 handle, vm::ptr<CellSSPlayerRuntimeInfo> info)
// TODO: check parameters
ssp[handle].m_level = info->level;
ssp[handle].m_speed = info->speed;
ssp[handle].m_x = info->position.x;
ssp[handle].m_y = info->position.y;
ssp[handle].m_z = info->position.z;
g_ssp[handle].m_level = info->level;
g_ssp[handle].m_speed = info->speed;
g_ssp[handle].m_x = info->position.x;
g_ssp[handle].m_y = info->position.y;
g_ssp[handle].m_z = info->position.z;
return CELL_OK;
}
@ -272,15 +267,15 @@ s32 cellSSPlayerGetState(u32 handle)
{
libmixer.Warning("cellSSPlayerGetState(handle=0x%x)", handle);
std::lock_guard<std::mutex> lock(mixer_mutex);
std::lock_guard<std::mutex> lock(g_surmx.mutex);
if (handle >= ssp.size() || !ssp[handle].m_created)
if (handle >= g_ssp.size() || !g_ssp[handle].m_created)
{
libmixer.Warning("cellSSPlayerGetState(): SSPlayer not found (%d)", handle);
return CELL_SSPLAYER_STATE_ERROR;
}
if (ssp[handle].m_active)
if (g_ssp[handle].m_active)
{
return CELL_SSPLAYER_STATE_ON;
}
@ -319,8 +314,10 @@ s32 cellSurMixerCreate(vm::cptr<CellSurMixerConfig> config)
libmixer.Warning("*** audio port opened (port=%d)", g_surmx.audio_port);
mixcount = 0;
surMixerCb.set(0);
g_surmx.mixcount = 0;
g_surmx.cb = vm::null;
g_ssp.clear();
libmixer.Warning("*** surMixer created (ch1=%d, ch2=%d, ch6=%d, ch8=%d)", config->chStrips1, config->chStrips2, config->chStrips6, config->chStrips8);
@ -335,7 +332,7 @@ s32 cellSurMixerCreate(vm::cptr<CellSurMixerConfig> config)
{
CHECK_EMU_STATUS;
if (mixcount > (port.tag + 0)) // adding positive value (1-15): preemptive buffer filling (hack)
if (g_surmx.mixcount > (port.tag + 0)) // adding positive value (1-15): preemptive buffer filling (hack)
{
std::this_thread::sleep_for(std::chrono::milliseconds(1)); // hack
continue;
@ -345,18 +342,18 @@ s32 cellSurMixerCreate(vm::cptr<CellSurMixerConfig> config)
{
//u64 stamp0 = get_system_time();
memset(mixdata, 0, sizeof(mixdata));
if (surMixerCb)
memset(g_surmx.mixdata, 0, sizeof(g_surmx.mixdata));
if (g_surmx.cb)
{
surMixerCb(ppu, surMixerCbArg, (u32)mixcount, 256);
g_surmx.cb(ppu, g_surmx.cb_arg, (u32)g_surmx.mixcount, 256);
}
//u64 stamp1 = get_system_time();
{
std::lock_guard<std::mutex> lock(mixer_mutex);
std::lock_guard<std::mutex> lock(g_surmx.mutex);
for (auto& p : ssp) if (p.m_active && p.m_created)
for (auto& p : g_ssp) if (p.m_active && p.m_created)
{
auto v = vm::ptrl<s16>::make(p.m_addr); // 16-bit LE audio data
float left = 0.0f;
@ -406,8 +403,8 @@ s32 cellSurMixerCreate(vm::cptr<CellSurMixerConfig> config)
if (p.m_connected) // mix
{
// TODO: m_x, m_y, m_z ignored
mixdata[i * 8 + 0] += left;
mixdata[i * 8 + 1] += right;
g_surmx.mixdata[i * 8 + 0] += left;
g_surmx.mixdata[i * 8 + 1] += right;
}
if ((p.m_position == p.m_samples && p.m_speed > 0.0f) ||
(p.m_position == ~0 && p.m_speed < 0.0f)) // loop or stop
@ -432,12 +429,12 @@ s32 cellSurMixerCreate(vm::cptr<CellSurMixerConfig> config)
//u64 stamp2 = get_system_time();
auto buf = vm::get_ptr<be_t<float>>(port.addr + (mixcount % port.block) * port.channel * AUDIO_SAMPLES * sizeof(float));
auto buf = vm::get_ptr<be_t<float>>(port.addr + (g_surmx.mixcount % port.block) * port.channel * AUDIO_SAMPLES * sizeof(float));
for (u32 i = 0; i < (sizeof(mixdata) / sizeof(float)); i++)
for (auto& mixdata : g_surmx.mixdata)
{
// reverse byte order
buf[i] = mixdata[i];
*buf++ = mixdata;
}
//u64 stamp3 = get_system_time();
@ -445,16 +442,9 @@ s32 cellSurMixerCreate(vm::cptr<CellSurMixerConfig> config)
//ConLog.Write("Libmixer perf: start=%lld (cb=%lld, ssp=%lld, finalize=%lld)", stamp0 - m_config.start_time, stamp1 - stamp0, stamp2 - stamp1, stamp3 - stamp2);
}
mixcount++;
g_surmx.mixcount++;
}
{
std::lock_guard<std::mutex> lock(mixer_mutex);
ssp.clear();
}
surMixerCb.set(0);
Emu.GetIdManager().remove<PPUThread>(ppu.get_id());
};
@ -482,13 +472,13 @@ s32 cellSurMixerSetNotifyCallback(vm::ptr<CellSurMixerNotifyCallbackFunction> fu
{
libmixer.Warning("cellSurMixerSetNotifyCallback(func=*0x%x, arg=*0x%x)", func, arg);
if (surMixerCb)
if (g_surmx.cb)
{
libmixer.Error("cellSurMixerSetNotifyCallback: surMixerCb already set (*0x%x)", surMixerCb);
throw EXCEPTION("Callback already set");
}
surMixerCb = func;
surMixerCbArg = arg;
g_surmx.cb = func;
g_surmx.cb_arg = arg;
return CELL_OK;
}
@ -497,15 +487,13 @@ s32 cellSurMixerRemoveNotifyCallback(vm::ptr<CellSurMixerNotifyCallbackFunction>
{
libmixer.Warning("cellSurMixerRemoveNotifyCallback(func=*0x%x)", func);
if (surMixerCb != func)
if (g_surmx.cb != func)
{
libmixer.Error("cellSurMixerRemoveNotifyCallback: surMixerCb had different value (*0x%x)", surMixerCb);
}
else
{
surMixerCb = vm::null;
throw EXCEPTION("Callback not set");
}
g_surmx.cb = vm::null;
return CELL_OK;
}
@ -555,12 +543,12 @@ s32 cellSurMixerSurBusAddData(u32 busNo, u32 offset, vm::ptr<float> addr, u32 sa
return CELL_OK;
}
std::lock_guard<std::mutex> lock(mixer_mutex);
std::lock_guard<std::mutex> lock(g_surmx.mutex);
for (u32 i = 0; i < samples; i++)
{
// reverse byte order and mix
mixdata[i * 8 + busNo] += addr[i];
g_surmx.mixdata[i * 8 + busNo] += addr[i];
}
return CELL_OK;
@ -590,7 +578,7 @@ s32 cellSurMixerGetCurrentBlockTag(vm::ptr<u64> tag)
{
libmixer.Log("cellSurMixerGetCurrentBlockTag(tag=*0x%x)", tag);
*tag = mixcount;
*tag = g_surmx.mixcount;
return CELL_OK;
}
@ -610,23 +598,20 @@ void cellSurMixerBeep(u32 arg)
float cellSurMixerUtilGetLevelFromDB(float dB)
{
// not hooked, probably unnecessary
libmixer.Todo("cellSurMixerUtilGetLevelFromDB(dB=%f)", dB);
return 0.0f;
throw EXCEPTION("");
}
float cellSurMixerUtilGetLevelFromDBIndex(s32 index)
{
// not hooked, probably unnecessary
libmixer.Todo("cellSurMixerUtilGetLevelFromDBIndex(index=%d)", index);
return 0.0f;
throw EXCEPTION("");
}
float cellSurMixerUtilNoteToRatio(u8 refNote, u8 note)
{
// not hooked, probably unnecessary
libmixer.Todo("cellSurMixerUtilNoteToRatio(refNote=%d, note=%d)", refNote, note);
return 0.0f;
throw EXCEPTION("");
}
Module libmixer("libmixer", []()
@ -635,12 +620,12 @@ Module libmixer("libmixer", []()
libmixer.on_stop = []()
{
ssp.clear();
g_ssp.clear();
};
using namespace PPU_instr;
REG_SUB(libmixer, "surmxAAN", , cellAANAddData,
REG_SUB(libmixer,, cellAANAddData,
{ SPET_MASKED_OPCODE, 0x7c691b78, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x7c0802a6, 0xffffffff },
{ SPET_MASKED_OPCODE, 0xf821ff91, 0xffffffff },
@ -666,7 +651,7 @@ Module libmixer("libmixer", []()
{ SPET_MASKED_OPCODE, 0x4e800020, 0xffffffff },
);
REG_SUB(libmixer, "surmxAAN", , cellAANConnect,
REG_SUB(libmixer,, cellAANConnect,
{ SPET_MASKED_OPCODE, 0xf821ff71, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x7c0802a6, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x2f830000, 0xffffffff },
@ -675,18 +660,18 @@ Module libmixer("libmixer", []()
{ SPET_MASKED_OPCODE, 0x7c691b78, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x7c8a2378, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x60000003, 0xffffffff },
se_br_label(BNE(cr7, XXX), 0x24),
se_label(0x24),
SP_LABEL_BR(BNE(cr7, XXX), 0x24),
SET_LABEL(0x24),
{ SPET_MASKED_OPCODE, 0x7c0307b4, 0xffffffff },
{ SPET_MASKED_OPCODE, 0xe80100a0, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x38210090, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x7c0803a6, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x4e800020, 0xffffffff },
se_label(0x38),
SET_LABEL(0x38),
{ SPET_MASKED_OPCODE, 0x2f850000, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x78630020, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x38810070, 0xffffffff },
se_br_label(BEQ(cr7, XXX), 0x38),
SP_LABEL_BR(BEQ(cr7, XXX), 0x38),
{ SPET_MASKED_OPCODE, 0x81690000, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x38000001, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x91210074, 0xffffffff },
@ -709,7 +694,7 @@ Module libmixer("libmixer", []()
{ SPET_MASKED_OPCODE, 0x4e800020, 0xffffffff },
);
REG_SUB(libmixer, "surmxAAN", , cellAANDisconnect,
REG_SUB(libmixer,, cellAANDisconnect,
{ SPET_MASKED_OPCODE, 0xf821ff71, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x7c0802a6, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x2f830000, 0xffffffff },
@ -718,18 +703,18 @@ Module libmixer("libmixer", []()
{ SPET_MASKED_OPCODE, 0x7c691b78, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x7c8a2378, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x60000003, 0xffffffff },
se_br_label(BNE(cr7, XXX), 0x24),
se_label(0x24),
SP_LABEL_BR(BNE(cr7, XXX), 0x24),
SET_LABEL(0x24),
{ SPET_MASKED_OPCODE, 0x7c0307b4, 0xffffffff },
{ SPET_MASKED_OPCODE, 0xe80100a0, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x38210090, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x7c0803a6, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x4e800020, 0xffffffff },
se_label(0x38),
SET_LABEL(0x38),
{ SPET_MASKED_OPCODE, 0x2f850000, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x78630020, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x38810070, 0xffffffff },
se_br_label(BEQ(cr7, XXX), 0x38),
SP_LABEL_BR(BEQ(cr7, XXX), 0x38),
{ SPET_MASKED_OPCODE, 0x81690000, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x38000001, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x91210074, 0xffffffff },
@ -752,7 +737,7 @@ Module libmixer("libmixer", []()
{ SPET_MASKED_OPCODE, 0x4e800020, 0xffffffff },
);
REG_SUB(libmixer, "surmixer", , cellSurMixerCreate,
REG_SUB(libmixer,, cellSurMixerCreate,
{ SPET_MASKED_OPCODE, 0x2f830000, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x7c0802a6, 0xffffffff },
{ SPET_MASKED_OPCODE, 0xf821ff51, 0xffffffff },
@ -765,7 +750,7 @@ Module libmixer("libmixer", []()
{ SPET_MASKED_OPCODE, 0xfbe100a8, 0xffffffff },
{ SPET_MASKED_OPCODE, 0xf80100c0, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x7c7e1b78, 0xffffffff },
se_br_label(BNE(cr7, XXX), 0x6c),
SP_LABEL_BR(BNE(cr7, XXX), 0x6c),
{ SPET_MASKED_OPCODE, 0x3fe08031, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x63ff0003, 0xffffffff },
{ SPET_MASKED_OPCODE, 0xe80100c0, 0xffffffff },
@ -780,11 +765,11 @@ Module libmixer("libmixer", []()
{ SPET_MASKED_OPCODE, 0xebe100a8, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x382100b0, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x4e800020, 0xffffffff },
se_label(0x6c),
SET_LABEL(0x6c),
);
REG_SUB(libmixer, "surmixer", , cellSurMixerGetAANHandle,
se_op(LWZ(r10, r2, XXX)),
REG_SUB(libmixer,, cellSurMixerGetAANHandle,
SP_I(LWZ(r10, r2, XXX)),
{ SPET_MASKED_OPCODE, 0x3d607fce, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x616bfffe, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x812a0018, 0xffffffff },
@ -800,8 +785,8 @@ Module libmixer("libmixer", []()
{ SPET_MASKED_OPCODE, 0x4e800020, 0xffffffff },
);
REG_SUB(libmixer, "surmixer", , cellSurMixerChStripGetAANPortNo,
se_op(LWZ(r9, r2, XXX)),
REG_SUB(libmixer,, cellSurMixerChStripGetAANPortNo,
SP_I(LWZ(r9, r2, XXX)),
{ SPET_MASKED_OPCODE, 0x7c661b78, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x3c608031, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x78c60020, 0xffffffff },
@ -812,11 +797,11 @@ Module libmixer("libmixer", []()
{ SPET_MASKED_OPCODE, 0x2f800000, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x4d9e0020, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x78030020, 0xffffffff },
se_op(B(XXX, 0, 0)),
SP_I(B(XXX, 0, 0)),
);
REG_SUB(libmixer, "surmixer", , cellSurMixerSetNotifyCallback,
se_op(LWZ(r10, r2, XXX)),
REG_SUB(libmixer,, cellSurMixerSetNotifyCallback,
SP_I(LWZ(r10, r2, XXX)),
{ SPET_MASKED_OPCODE, 0x7c0802a6, 0xffffffff },
{ SPET_MASKED_OPCODE, 0xf821ff81, 0xffffffff },
{ SPET_MASKED_OPCODE, 0xf8010090, 0xffffffff },
@ -836,15 +821,15 @@ Module libmixer("libmixer", []()
{ SPET_MASKED_OPCODE, 0x7c0803a6, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x4e800020, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x419aff00, 0xffffff00 }, // beq
se_op(LWZ(r0, r10, XXX)),
SP_I(LWZ(r0, r10, XXX)),
{ SPET_MASKED_OPCODE, 0x79290020, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x38810070, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x2f800000, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x7d234b78, 0xffffffff }
);
REG_SUB(libmixer, "surmixer", , cellSurMixerRemoveNotifyCallback,
se_op(LWZ(r11, r2, XXX)),
REG_SUB(libmixer,, cellSurMixerRemoveNotifyCallback,
SP_I(LWZ(r11, r2, XXX)),
{ SPET_MASKED_OPCODE, 0x7c0802a6, 0xffffffff },
{ SPET_MASKED_OPCODE, 0xf821ff81, 0xffffffff },
{ SPET_MASKED_OPCODE, 0xf8010090, 0xffffffff },
@ -861,11 +846,11 @@ Module libmixer("libmixer", []()
{ SPET_MASKED_OPCODE, 0x4e800020, 0xffffffff }
);
REG_SUB(libmixer, "surmixer", , cellSurMixerStart,
REG_SUB(libmixer,, cellSurMixerStart,
{ SPET_MASKED_OPCODE, 0xf821ff71, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x7c0802a6, 0xffffffff },
{ SPET_MASKED_OPCODE, 0xfbc10080, 0xffffffff },
se_op(LWZ(r30, r2, XXX)),
SP_I(LWZ(r30, r2, XXX)),
{ SPET_MASKED_OPCODE, 0xf80100a0, 0xffffffff },
{ SPET_MASKED_OPCODE, 0xfba10078, 0xffffffff },
{ SPET_MASKED_OPCODE, 0xfbe10088, 0xffffffff },
@ -884,12 +869,12 @@ Module libmixer("libmixer", []()
{ SPET_MASKED_OPCODE, 0x4e800020, 0xffffffff }
);
REG_SUB(libmixer, "surmixer", , cellSurMixerSetParameter,
REG_SUB(libmixer,, cellSurMixerSetParameter,
{ SPET_MASKED_OPCODE, 0xf821ff81, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x7c0802a6, 0xffffffff },
{ SPET_MASKED_OPCODE, 0xfbc10070, 0xffffffff },
{ SPET_MASKED_OPCODE, 0xfc000890, 0xffffffff },
se_op(LWZ(r30, r2, XXX)),
SP_I(LWZ(r30, r2, XXX)),
{ SPET_MASKED_OPCODE, 0x3d208031, 0xffffffff },
{ SPET_MASKED_OPCODE, 0xf8010090, 0xffffffff },
{ SPET_MASKED_OPCODE, 0xfbe10078, 0xffffffff },
@ -914,7 +899,7 @@ Module libmixer("libmixer", []()
{ SPET_MASKED_OPCODE, 0x409d0000, 0xffff0000 }, // ble
);
REG_SUB(libmixer, "surmixer", , cellSurMixerFinalize,
REG_SUB(libmixer,, cellSurMixerFinalize,
{ SPET_MASKED_OPCODE, 0xf821ff91, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x7c0802a6, 0xffffffff },
{ SPET_MASKED_OPCODE, 0xf8010080, 0xffffffff },
@ -940,8 +925,8 @@ Module libmixer("libmixer", []()
{ SPET_MASKED_OPCODE, 0x4e800421, 0xffffffff }
);
REG_SUB(libmixer, "surmixer", , cellSurMixerSurBusAddData,
se_op(LWZ(r10, r2, XXX)),
REG_SUB(libmixer,, cellSurMixerSurBusAddData,
SP_I(LWZ(r10, r2, XXX)),
{ SPET_MASKED_OPCODE, 0x7c0802a6, 0xffffffff },
{ SPET_MASKED_OPCODE, 0xf821ff91, 0xffffffff },
{ SPET_MASKED_OPCODE, 0xf8010080, 0xffffffff },
@ -969,8 +954,8 @@ Module libmixer("libmixer", []()
{ SPET_MASKED_OPCODE, 0x419c0000, 0xffff0000 } // blt
);
REG_SUB(libmixer, "surmixer", , cellSurMixerChStripSetParameter,
se_op(LWZ(r8, r2, XXX)),
REG_SUB(libmixer,, cellSurMixerChStripSetParameter,
SP_I(LWZ(r8, r2, XXX)),
{ SPET_MASKED_OPCODE, 0x7c6b1b78, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x3c608031, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x7c8a2378, 0xffffffff },
@ -989,8 +974,8 @@ Module libmixer("libmixer", []()
{ SPET_MASKED_OPCODE, 0x40000000, 0xf0000000 } // b
);
REG_SUB(libmixer, "surmixer", , cellSurMixerPause,
se_op(LWZ(r10, r2, XXX)),
REG_SUB(libmixer,, cellSurMixerPause,
SP_I(LWZ(r10, r2, XXX)),
{ SPET_MASKED_OPCODE, 0x7c0802a6, 0xffffffff },
{ SPET_MASKED_OPCODE, 0xf821ff81, 0xffffffff },
{ SPET_MASKED_OPCODE, 0xf8010090, 0xffffffff },
@ -1014,8 +999,8 @@ Module libmixer("libmixer", []()
{ SPET_MASKED_OPCODE, 0x2f800000, 0xffffffff }
);
REG_SUB(libmixer, "surmixer", , cellSurMixerGetCurrentBlockTag,
se_op(LWZ(r11, r2, XXX)),
REG_SUB(libmixer,, cellSurMixerGetCurrentBlockTag,
SP_I(LWZ(r11, r2, XXX)),
{ SPET_MASKED_OPCODE, 0x3d208031, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x61290002, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x880b0020, 0xffffffff },
@ -1028,8 +1013,8 @@ Module libmixer("libmixer", []()
{ SPET_MASKED_OPCODE, 0x4e800020, 0xffffffff }
);
REG_SUB(libmixer, "surmixer", , cellSurMixerGetTimestamp,
se_op(LWZ(r11, r2, XXX)),
REG_SUB(libmixer,, cellSurMixerGetTimestamp,
SP_I(LWZ(r11, r2, XXX)),
{ SPET_MASKED_OPCODE, 0x7c0802a6, 0xffffffff },
{ SPET_MASKED_OPCODE, 0xf821ff91, 0xffffffff },
{ SPET_MASKED_OPCODE, 0xf8010080, 0xffffffff },
@ -1050,8 +1035,8 @@ Module libmixer("libmixer", []()
{ SPET_MASKED_OPCODE, 0x40000000, 0xf0000000 } // bl
);
REG_SUB(libmixer, "surmixer", , cellSurMixerBeep,
se_op(LWZ(r9, r2, XXX)),
REG_SUB(libmixer,, cellSurMixerBeep,
SP_I(LWZ(r9, r2, XXX)),
{ SPET_MASKED_OPCODE, 0x7c641b78, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x80690018, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x2f830000, 0xffffffff },
@ -1064,7 +1049,7 @@ Module libmixer("libmixer", []()
{ SPET_MASKED_OPCODE, 0x40000000, 0xf0000000 } // b
);
REG_SUB(libmixer, "surmxSSP", , cellSSPlayerCreate,
REG_SUB(libmixer,, cellSSPlayerCreate,
{ SPET_MASKED_OPCODE, 0xf821ff51, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x7c0802a6, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x2f840000, 0xffffffff },
@ -1098,7 +1083,7 @@ Module libmixer("libmixer", []()
{ SPET_MASKED_OPCODE, 0x40000000, 0xf0000000 } // bl
);
REG_SUB(libmixer, "surmxSSP", , cellSSPlayerRemove,
REG_SUB(libmixer,, cellSSPlayerRemove,
{ SPET_MASKED_OPCODE, 0x7c641b78, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x7c0802a6, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x3c608031, 0xffffffff },
@ -1128,7 +1113,7 @@ Module libmixer("libmixer", []()
{ SPET_MASKED_OPCODE, 0x4e800421, 0xffffffff }
);
REG_SUB(libmixer, "surmxSSP", , cellSSPlayerSetWave,
REG_SUB(libmixer,, cellSSPlayerSetWave,
{ SPET_MASKED_OPCODE, 0x7c601b78, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x78840020, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x2f800000, 0xffffffff },
@ -1141,7 +1126,7 @@ Module libmixer("libmixer", []()
{ SPET_MASKED_OPCODE, 0x4e800020, 0xffffffff }
);
REG_SUB(libmixer, "surmxSSP", , cellSSPlayerPlay,
REG_SUB(libmixer,, cellSSPlayerPlay,
{ SPET_MASKED_OPCODE, 0x7c601b78, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x3c608031, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x2f800000, 0xffffffff },
@ -1160,7 +1145,7 @@ Module libmixer("libmixer", []()
{ SPET_MASKED_OPCODE, 0x38630010, 0xffffffff }
);
REG_SUB(libmixer, "surmxSSP", , cellSSPlayerStop,
REG_SUB(libmixer,, cellSSPlayerStop,
{ SPET_MASKED_OPCODE, 0xf821ff91, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x7c0802a6, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x2f830000, 0xffffffff },
@ -1179,7 +1164,7 @@ Module libmixer("libmixer", []()
{ SPET_MASKED_OPCODE, 0x4e800020, 0xffffffff }
);
REG_SUB(libmixer, "surmxSSP", , cellSSPlayerSetParam,
REG_SUB(libmixer,, cellSSPlayerSetParam,
{ SPET_MASKED_OPCODE, 0x7c601b78, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x3c608031, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x2f800000, 0xffffffff },
@ -1198,17 +1183,17 @@ Module libmixer("libmixer", []()
{ SPET_MASKED_OPCODE, 0x2f800000, 0xffffffff }
);
REG_SUB(libmixer, "surmxSSP", , cellSSPlayerGetState,
REG_SUB(libmixer,, cellSSPlayerGetState,
{ SPET_MASKED_OPCODE, 0x7c601b78, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x3c608031, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x2f800000, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x60630003, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x4d9e0020, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x78030020, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x40000000, 0xf0000000 } // b
{ SPET_MASKED_OPCODE, 0x40000000, 0xf0000000 }, // b
);
//REG_SUB(libmixer, "surmxUti", cellSurMixerUtilGetLevelFromDB);
//REG_SUB(libmixer, "surmxUti", cellSurMixerUtilGetLevelFromDBIndex);
//REG_SUB(libmixer, "surmxUti", cellSurMixerUtilNoteToRatio);
REG_SUB(libmixer,, cellSurMixerUtilGetLevelFromDB);
REG_SUB(libmixer,, cellSurMixerUtilGetLevelFromDBIndex);
REG_SUB(libmixer,, cellSurMixerUtilNoteToRatio);
});

View File

@ -112,7 +112,7 @@ enum
CELL_SSPLAYER_STATE_ON = 0x20,
};
typedef s32(CellSurMixerNotifyCallbackFunction)(vm::ptr<void> arg, u32 counter, u32 samples);
using CellSurMixerNotifyCallbackFunction = s32(vm::ptr<void> arg, u32 counter, u32 samples);
struct CellSSPlayerConfig
{
@ -169,12 +169,20 @@ struct CellSurMixerChStripParam
struct SurMixerConfig
{
std::mutex mutex;
u32 audio_port;
s32 priority;
u32 ch_strips_1;
u32 ch_strips_2;
u32 ch_strips_6;
u32 ch_strips_8;
vm::ptr<CellSurMixerNotifyCallbackFunction> cb;
vm::ptr<void> cb_arg;
f32 mixdata[8 * 256];
u64 mixcount;
};
struct SSPlayer

View File

@ -1,12 +1,10 @@
#include "stdafx.h"
#if 0
void libsnd3_init();
Module libsnd3("libsnd3", libsnd3_init);
#include "Emu/Memory/Memory.h"
#include "Emu/SysCalls/Modules.h"
#include "libsnd3.h"
s32 cellSnd3Init() //u32 maxVoice, u32 samples, CellSnd3RequestQueueCtx *queue
s32 cellSnd3Init(u32 maxVoice, u32 samples, vm::ptr<CellSnd3RequestQueueCtx> queue)
{
UNIMPLEMENTED_FUNC(libsnd3);
return CELL_OK;
@ -18,31 +16,35 @@ s32 cellSnd3Exit()
return CELL_OK;
}
s32 cellSnd3SetOutputMode() //u32 mode
u16 cellSnd3Note2Pitch(u16 center_note, u16 center_fine, u16 note, s16 fine)
{
throw EXCEPTION("");
}
u16 cellSnd3Pitch2Note(u16 center_note, u16 center_fine, u16 pitch)
{
throw EXCEPTION("");
}
s32 cellSnd3SetOutputMode(u32 mode)
{
UNIMPLEMENTED_FUNC(libsnd3);
return CELL_OK;
}
s32 cellSnd3Synthesis() //float *pOutL, float *pOutR
s32 cellSnd3Synthesis(vm::ptr<f32> pOutL, vm::ptr<f32> pOutR)
{
UNIMPLEMENTED_FUNC(libsnd3);
return CELL_OK;
}
s32 cellSnd3SynthesisEx() //float *pOutL, float *pOutR, float *pOutRL, float *pOutRR
s32 cellSnd3SynthesisEx(vm::ptr<f32> pOutL, vm::ptr<f32> pOutR, vm::ptr<f32> pOutRL, vm::ptr<f32> pOutRR)
{
UNIMPLEMENTED_FUNC(libsnd3);
return CELL_OK;
}
s32 cellSnd3VoiceSetReserveMode() //u32 voiceNum, u32 reserveMode
{
UNIMPLEMENTED_FUNC(libsnd3);
return CELL_OK;
}
s32 cellSnd3BindSoundData() //CellSnd3DataCtx *snd3Ctx, void *hd3, u32 synthMemOffset
s32 cellSnd3BindSoundData(vm::ptr<CellSnd3DataCtx> snd3Ctx, vm::ptr<void> hd3, u32 synthMemOffset)
{
UNIMPLEMENTED_FUNC(libsnd3);
return CELL_OK;
@ -54,32 +56,30 @@ s32 cellSnd3UnbindSoundData(u32 hd3ID)
return CELL_OK;
}
s32 cellSnd3NoteOnByTone() //u32 hd3ID, u32 toneIndex, u32 note, u32 keyOnID, CellSnd3KeyOnParam *keyOnParam
s32 cellSnd3NoteOnByTone(u32 hd3ID, u32 toneIndex, u32 note, u32 keyOnID, vm::ptr<CellSnd3KeyOnParam> keyOnParam)
{
UNIMPLEMENTED_FUNC(libsnd3);
return CELL_OK; //it's NOT real value
//TODO
throw EXCEPTION("");
}
s32 cellSnd3KeyOnByTone() //u32 hd3ID, u32 toneIndex, u32 pitch,u32 keyOnID,CellSnd3KeyOnParam *keyOnParam
s32 cellSnd3KeyOnByTone(u32 hd3ID, u32 toneIndex, u32 pitch, u32 keyOnID, vm::ptr<CellSnd3KeyOnParam> keyOnParam)
{
UNIMPLEMENTED_FUNC(libsnd3);
return CELL_OK; //it's NOT real value
//TODO
throw EXCEPTION("");
}
s32 cellSnd3VoiceNoteOnByTone() //u32 hd3ID, u32 voiceNum, u32 toneIndex, u32 note, u32 keyOnID, CellSnd3KeyOnParam *keyOnParam
s32 cellSnd3VoiceNoteOnByTone(u32 hd3ID, u32 voiceNum, u32 toneIndex, u32 note, u32 keyOnID, vm::ptr<CellSnd3KeyOnParam> keyOnParam)
{
UNIMPLEMENTED_FUNC(libsnd3);
return CELL_OK; //it's NOT real value
//TODO
throw EXCEPTION("");
}
s32 cellSnd3VoiceKeyOnByTone() //u32 hd3ID, u32 voiceNum, u32 toneIndex, u32 pitch, u32 keyOnID, CellSnd3KeyOnParam *keyOnParam
s32 cellSnd3VoiceKeyOnByTone(u32 hd3ID, u32 voiceNum, u32 toneIndex, u32 pitch, u32 keyOnID, vm::ptr<CellSnd3KeyOnParam> keyOnParam)
{
throw EXCEPTION("");
}
s32 cellSnd3VoiceSetReserveMode(u32 voiceNum, u32 reserveMode)
{
UNIMPLEMENTED_FUNC(libsnd3);
return CELL_OK; //it's NOT real value
//TODO
return CELL_OK;
}
s32 cellSnd3VoiceSetSustainHold(u32 voiceNum, u32 sustainHold)
@ -136,11 +136,9 @@ s32 cellSnd3VoiceGetEnvelope(u32 voiceNum)
return CELL_OK;
}
s32 cellSnd3VoiceGetStatus() //u32 voiceNum
s32 cellSnd3VoiceGetStatus(u32 voiceNum)
{
UNIMPLEMENTED_FUNC(libsnd3);
return CELL_OK; //it's NOT real value
//TODO
throw EXCEPTION("");
}
u32 cellSnd3KeyOffByID(u32 keyOnID)
@ -149,19 +147,19 @@ u32 cellSnd3KeyOffByID(u32 keyOnID)
return CELL_OK;
}
s32 cellSnd3GetVoice() //u32 midiChannel, u32 keyOnID, CellSnd3VoiceBitCtx *voiceBit
s32 cellSnd3GetVoice(u32 midiChannel, u32 keyOnID, vm::ptr<CellSnd3VoiceBitCtx> voiceBit)
{
UNIMPLEMENTED_FUNC(libsnd3);
return CELL_OK;
}
s32 cellSnd3GetVoiceByID() //u32 keyOnID, CellSnd3VoiceBitCtx *voiceBit
s32 cellSnd3GetVoiceByID(u32 ID, vm::ptr<CellSnd3VoiceBitCtx> voiceBit)
{
UNIMPLEMENTED_FUNC(libsnd3);
return CELL_OK;
}
s32 cellSnd3NoteOn() //u32 hd3ID, u32 midiChannel, u32 midiProgram, u32 midiNote, u32 sustain,CellSnd3KeyOnParam *keyOnParam, u32 keyOnID
s32 cellSnd3NoteOn(u32 hd3ID, u32 midiChannel, u32 midiProgram, u32 midiNote, u32 sustain, vm::ptr<CellSnd3KeyOnParam> keyOnParam, u32 keyOnID)
{
UNIMPLEMENTED_FUNC(libsnd3);
return CELL_OK;
@ -173,7 +171,7 @@ s32 cellSnd3NoteOff(u32 midiChannel, u32 midiNote, u32 keyOnID)
return CELL_OK;
}
s32 cellSnd3SetSustainHold(u32 midiChannel, u32 sustainHold, u32 ID)
s32 cellSnd3SetSustainHold(u32 midiChannel, u32 sustainHold, u32 keyOnID)
{
UNIMPLEMENTED_FUNC(libsnd3);
return CELL_OK;
@ -185,32 +183,14 @@ s32 cellSnd3SetEffectType(u16 effectType, s16 returnVol, u16 delay, u16 feedback
return CELL_OK;
}
u16 cellSnd3Note2Pitch() //u16 center_note, u16 center_fine, u16 note, s16 fine
s32 cellSnd3SMFBind(vm::ptr<CellSnd3SmfCtx> smfCtx, vm::ptr<void> smf, u32 hd3ID)
{
UNIMPLEMENTED_FUNC(libsnd3);
return CELL_OK; //it's NOT real value
//TODO
throw EXCEPTION("");
}
u16 cellSnd3Pitch2Note() //u16 center_note, u16 center_fine, u16 pitch
s32 cellSnd3SMFUnbind(u32 smfID)
{
UNIMPLEMENTED_FUNC(libsnd3);
return CELL_OK; //it's NOT real value
//TODO
}
s32 cellSnd3SMFBind() //CellSnd3SmfCtx *smfCtx, void *smf, u32 hd3ID
{
UNIMPLEMENTED_FUNC(libsnd3);
return CELL_OK; //it's NOT real value
//TODO
}
s32 cellSnd3SMFUnbind() //u32 smfID
{
UNIMPLEMENTED_FUNC(libsnd3);
return CELL_OK; //it's NOT real value
//TODO
throw EXCEPTION("");
}
s32 cellSnd3SMFPlay(u32 smfID, u32 playVelocity, u32 playPan, u32 playCount)
@ -249,11 +229,9 @@ s32 cellSnd3SMFAddTempo(u32 smfID, s32 addTempo)
return CELL_OK;
}
s32 cellSnd3SMFGetTempo() //u32 smfID
s32 cellSnd3SMFGetTempo(u32 smfID)
{
UNIMPLEMENTED_FUNC(libsnd3);
return CELL_OK; //it's NOT real value
//TODO
throw EXCEPTION("");
}
s32 cellSnd3SMFSetPlayVelocity(u32 smfID, u32 playVelocity)
@ -262,11 +240,9 @@ s32 cellSnd3SMFSetPlayVelocity(u32 smfID, u32 playVelocity)
return CELL_OK;
}
s32 cellSnd3SMFGetPlayVelocity() //u32 smfID
s32 cellSnd3SMFGetPlayVelocity(u32 smfID)
{
UNIMPLEMENTED_FUNC(libsnd3);
return CELL_OK; //it's NOT real value
//TODO
throw EXCEPTION("");
}
s32 cellSnd3SMFSetPlayPanpot(u32 smfID, u32 playPanpot)
@ -281,25 +257,19 @@ s32 cellSnd3SMFSetPlayPanpotEx(u32 smfID, u32 playPanpotEx)
return CELL_OK;
}
s32 cellSnd3SMFGetPlayPanpot() //u32 smfID
s32 cellSnd3SMFGetPlayPanpot(u32 smfID)
{
UNIMPLEMENTED_FUNC(libsnd3);
return CELL_OK; //it's NOT real value
//TODO
throw EXCEPTION("");
}
s32 cellSnd3SMFGetPlayPanpotEx() //u32 smfID
s32 cellSnd3SMFGetPlayPanpotEx(u32 smfID)
{
UNIMPLEMENTED_FUNC(libsnd3);
return CELL_OK; //it's NOT real value
//TODO
throw EXCEPTION("");
}
s32 cellSnd3SMFGetPlayStatus() //u32 smfID
s32 cellSnd3SMFGetPlayStatus(u32 smfID)
{
UNIMPLEMENTED_FUNC(libsnd3);
return CELL_OK; //it's NOT real value
//TODO
throw EXCEPTION("");
}
s32 cellSnd3SMFSetPlayChannel(u32 smfID, u32 playChannelBit)
@ -308,20 +278,68 @@ s32 cellSnd3SMFSetPlayChannel(u32 smfID, u32 playChannelBit)
return CELL_OK;
}
s32 cellSnd3SMFGetPlayChannel() //u32 smfID, u32 *playChannelBit
s32 cellSnd3SMFGetPlayChannel(u32 smfID, vm::ptr<u32> playChannelBit)
{
throw EXCEPTION("");
}
s32 cellSnd3SMFGetKeyOnID(u32 smfID, u32 midiChannel, vm::ptr<u32> keyOnID)
{
UNIMPLEMENTED_FUNC(libsnd3);
return CELL_OK;
}
s32 cellSnd3SMFGetKeyOnID() //u32 smfID, u32 midiChannel, u32 *keyOnID
{
UNIMPLEMENTED_FUNC(libsnd3);
return CELL_OK;
}
void libsnd3_init()
Module libsnd3("libsnd3", []()
{
}
#endif
REG_SUB(libsnd3,, cellSnd3Init);
REG_SUB(libsnd3,, cellSnd3Exit);
REG_SUB(libsnd3,, cellSnd3Note2Pitch);
REG_SUB(libsnd3,, cellSnd3Pitch2Note);
REG_SUB(libsnd3,, cellSnd3SetOutputMode);
REG_SUB(libsnd3,, cellSnd3Synthesis);
REG_SUB(libsnd3,, cellSnd3SynthesisEx);
REG_SUB(libsnd3,, cellSnd3BindSoundData);
REG_SUB(libsnd3,, cellSnd3UnbindSoundData);
REG_SUB(libsnd3,, cellSnd3NoteOnByTone);
REG_SUB(libsnd3,, cellSnd3KeyOnByTone);
REG_SUB(libsnd3,, cellSnd3VoiceNoteOnByTone);
REG_SUB(libsnd3,, cellSnd3VoiceKeyOnByTone);
REG_SUB(libsnd3,, cellSnd3VoiceSetReserveMode);
REG_SUB(libsnd3,, cellSnd3VoiceSetSustainHold);
REG_SUB(libsnd3,, cellSnd3VoiceKeyOff);
REG_SUB(libsnd3,, cellSnd3VoiceSetPitch);
REG_SUB(libsnd3,, cellSnd3VoiceSetVelocity);
REG_SUB(libsnd3,, cellSnd3VoiceSetPanpot);
REG_SUB(libsnd3,, cellSnd3VoiceSetPanpotEx);
REG_SUB(libsnd3,, cellSnd3VoiceSetPitchBend);
REG_SUB(libsnd3,, cellSnd3VoiceAllKeyOff);
REG_SUB(libsnd3,, cellSnd3VoiceGetEnvelope);
REG_SUB(libsnd3,, cellSnd3VoiceGetStatus);
REG_SUB(libsnd3,, cellSnd3KeyOffByID);
REG_SUB(libsnd3,, cellSnd3GetVoice);
REG_SUB(libsnd3,, cellSnd3GetVoiceByID);
REG_SUB(libsnd3,, cellSnd3NoteOn);
REG_SUB(libsnd3,, cellSnd3NoteOff);
REG_SUB(libsnd3,, cellSnd3SetSustainHold);
REG_SUB(libsnd3,, cellSnd3SetEffectType);
REG_SUB(libsnd3,, cellSnd3SMFBind);
REG_SUB(libsnd3,, cellSnd3SMFUnbind);
REG_SUB(libsnd3,, cellSnd3SMFPlay);
REG_SUB(libsnd3,, cellSnd3SMFPlayEx);
REG_SUB(libsnd3,, cellSnd3SMFPause);
REG_SUB(libsnd3,, cellSnd3SMFResume);
REG_SUB(libsnd3,, cellSnd3SMFStop);
REG_SUB(libsnd3,, cellSnd3SMFAddTempo);
REG_SUB(libsnd3,, cellSnd3SMFGetTempo);
REG_SUB(libsnd3,, cellSnd3SMFSetPlayVelocity);
REG_SUB(libsnd3,, cellSnd3SMFGetPlayVelocity);
REG_SUB(libsnd3,, cellSnd3SMFSetPlayPanpot);
REG_SUB(libsnd3,, cellSnd3SMFSetPlayPanpotEx);
REG_SUB(libsnd3,, cellSnd3SMFGetPlayPanpot);
REG_SUB(libsnd3,, cellSnd3SMFGetPlayPanpotEx);
REG_SUB(libsnd3,, cellSnd3SMFGetPlayStatus);
REG_SUB(libsnd3,, cellSnd3SMFSetPlayChannel);
REG_SUB(libsnd3,, cellSnd3SMFGetPlayChannel);
REG_SUB(libsnd3,, cellSnd3SMFGetKeyOnID);
});

View File

@ -1,6 +1,6 @@
#pragma once
//libsnd3 Error Codes
// Error Codes
enum
{
CELL_SND3_ERROR_PARAM = 0x80310301,
@ -21,17 +21,6 @@ enum
CELL_SND3_ERROR_OUTPUTMODE = 0x80310310,
};
//libsnd3 datatypes
struct CellSnd3DataCtx
{
s8 system; //[CELL_SND3_DATA_CTX_SIZE], unknown identifier
};
struct CellSnd3SmfCtx
{
s8 system; //[CELL_SND3_SMF_CTX_SIZE], unknown identifier
};
struct CellSnd3KeyOnParam
{
u8 vel;
@ -42,13 +31,25 @@ struct CellSnd3KeyOnParam
struct CellSnd3VoiceBitCtx
{
be_t<u32> core; //[CELL_SND3_MAX_CORE], unknown identifier
be_t<u32> core[4];
};
struct CellSnd3DataCtx
{
s8 system[32];
};
struct CellSnd3SmfCtx
{
s8 system[352];
};
struct CellSnd3RequestQueueCtx
{
void *frontQueue;
vm::bptr<void> frontQueue;
be_t<u32> frontQueueSize;
void *rearQueue;
vm::bptr<void> rearQueue;
be_t<u32> rearQueueSize;
};
extern Module libsnd3;

View File

@ -1,24 +1,22 @@
#include "stdafx.h"
#if 0
void libsynth2_init();
Module libsynth2("libsynth2", libsynth2_init);
#include "Emu/Memory/Memory.h"
#include "Emu/SysCalls/Modules.h"
#include "libsynth2.h"
int cellSoundSynth2Config(s16 param, int value)
s32 cellSoundSynth2Config(s16 param, s32 value)
{
libsynth2.Todo("cellSoundSynth2Config(param=%d, value=%d)", param, value);
return CELL_OK;
}
int cellSoundSynth2Init(s16 flag)
s32 cellSoundSynth2Init(s16 flag)
{
libsynth2.Todo("cellSoundSynth2Init(flag=%d)", flag);
return CELL_OK;
}
int cellSoundSynth2Exit()
s32 cellSoundSynth2Exit()
{
libsynth2.Todo("cellSoundSynth2Exit()");
return CELL_OK;
@ -31,8 +29,8 @@ void cellSoundSynth2SetParam(u16 reg, u16 value)
u16 cellSoundSynth2GetParam(u16 reg)
{
libsynth2.Todo("cellSoundSynth2GetParam(register=0x%x) -> 0", reg);
return 0;
libsynth2.Todo("cellSoundSynth2GetParam(register=0x%x)", reg);
throw EXCEPTION("");
}
void cellSoundSynth2SetSwitch(u16 reg, u32 value)
@ -42,11 +40,11 @@ void cellSoundSynth2SetSwitch(u16 reg, u32 value)
u32 cellSoundSynth2GetSwitch(u16 reg)
{
libsynth2.Todo("cellSoundSynth2GetSwitch(register=0x%x) -> 0", reg);
return 0;
libsynth2.Todo("cellSoundSynth2GetSwitch(register=0x%x)", reg);
throw EXCEPTION("");
}
int cellSoundSynth2SetAddr(u16 reg, u32 value)
s32 cellSoundSynth2SetAddr(u16 reg, u32 value)
{
libsynth2.Todo("cellSoundSynth2SetAddr(register=0x%x, value=0x%x)", reg, value);
return CELL_OK;
@ -54,19 +52,19 @@ int cellSoundSynth2SetAddr(u16 reg, u32 value)
u32 cellSoundSynth2GetAddr(u16 reg)
{
libsynth2.Todo("cellSoundSynth2GetAddr(register=0x%x) -> 0", reg);
return 0;
libsynth2.Todo("cellSoundSynth2GetAddr(register=0x%x)", reg);
throw EXCEPTION("");
}
int cellSoundSynth2SetEffectAttr(s16 bus, vm::ptr<CellSoundSynth2EffectAttr> attr)
s32 cellSoundSynth2SetEffectAttr(s16 bus, vm::ptr<CellSoundSynth2EffectAttr> attr)
{
libsynth2.Todo("cellSoundSynth2SetEffectAttr(bus=%d, attr=0x%x)", bus, attr);
libsynth2.Todo("cellSoundSynth2SetEffectAttr(bus=%d, attr=*0x%x)", bus, attr);
return CELL_OK;
}
int cellSoundSynth2SetEffectMode(s16 bus, vm::ptr<CellSoundSynth2EffectAttr> attr)
s32 cellSoundSynth2SetEffectMode(s16 bus, vm::ptr<CellSoundSynth2EffectAttr> attr)
{
libsynth2.Todo("cellSoundSynth2SetEffectMode(bus=%d, attr=0x%x)", bus, attr);
libsynth2.Todo("cellSoundSynth2SetEffectMode(bus=%d, attr=*0x%x)", bus, attr);
return CELL_OK;
}
@ -75,20 +73,19 @@ void cellSoundSynth2SetCoreAttr(u16 entry, u16 value)
libsynth2.Todo("cellSoundSynth2SetCoreAttr(entry=0x%x, value=0x%x)", entry, value);
}
int cellSoundSynth2Generate(u16 samples, u32 L_addr, u32 R_addr, u32 Lr_addr, u32 Rr_addr)
s32 cellSoundSynth2Generate(u16 samples, vm::ptr<f32> Lout, vm::ptr<f32> Rout, vm::ptr<f32> Ls, vm::ptr<f32> Rs)
{
libsynth2.Todo("cellSoundSynth2Generate(samples=0x%x, left=0x%x, right=0x%x, left_rear=0x%x, right_rear=0x%x)", samples, L_addr, R_addr, Lr_addr, Rr_addr);
libsynth2.Todo("cellSoundSynth2Generate(samples=0x%x, Lout=*0x%x, Rout=*0x%x, Ls=*0x%x, Rs=*0x%x)", samples, Lout, Rout, Ls, Rs);
return CELL_OK;
}
int cellSoundSynth2VoiceTrans(s16 channel, u16 mode, u32 mem_side_addr, u32 lib_side_addr, u32 size)
s32 cellSoundSynth2VoiceTrans(s16 channel, u16 mode, vm::ptr<u8> m_addr, u32 s_addr, u32 size)
{
libsynth2.Todo("cellSoundSynth2VoiceTrans(channel=%d, mode=0x%x, m_addr=0x%x, s_addr=0x%x, size=0x%x)",
channel, mode, mem_side_addr, lib_side_addr, size);
libsynth2.Todo("cellSoundSynth2VoiceTrans(channel=%d, mode=0x%x, m_addr=*0x%x, s_addr=0x%x, size=0x%x)", channel, mode, m_addr, s_addr, size);
return CELL_OK;
}
int cellSoundSynth2VoiceTransStatus(s16 channel, s16 flag)
s32 cellSoundSynth2VoiceTransStatus(s16 channel, s16 flag)
{
libsynth2.Todo("cellSoundSynth2VoiceTransStatus(channel=%d, flag=%d)", channel, flag);
return CELL_OK;
@ -96,63 +93,34 @@ int cellSoundSynth2VoiceTransStatus(s16 channel, s16 flag)
u16 cellSoundSynth2Note2Pitch(u16 center_note, u16 center_fine, u16 note, s16 fine)
{
libsynth2.Todo("cellSoundSynth2Note2Pitch(center_note=0x%x, center_fine=0x%x, note=0x%x, fine=%d) -> 0",
center_note, center_fine, note, fine);
return 0;
libsynth2.Todo("cellSoundSynth2Note2Pitch(center_note=0x%x, center_fine=0x%x, note=0x%x, fine=%d)", center_note, center_fine, note, fine);
throw EXCEPTION("");
}
u16 cellSoundSynth2Pitch2Note(u16 center_note, u16 center_fine, u16 pitch)
{
libsynth2.Todo("cellSoundSynth2Pitch2Note(center_note=0x%x, center_fine=0x%x, pitch=0x%x) -> 0",
center_note, center_fine, pitch);
return 0;
libsynth2.Todo("cellSoundSynth2Pitch2Note(center_note=0x%x, center_fine=0x%x, pitch=0x%x)", center_note, center_fine, pitch);
throw EXCEPTION("");
}
void libsynth2_init()
Module libsynth2("libsynth2", []()
{
REG_SUB_EMPTY(libsynth2, "synth2", cellSoundSynth2Init,
/*
0xffffffff7d800026,
0xfffffffff821ff41,
0xfffffffffb610098,
0xff0000008362001c, // lwz
0xfffffffffb8100a0,
0xffffffff3f9b0008,
0xfffffffffba100a8,
0xffffffff3fa08031,
0xfffffffffbe100b8,
0xfffffffffb010080,
0xfffffffffb210088,
0xfffffffffb410090,
0xfffffffffbc100b0,
0xffffffff7c7f1b78,
0xffffffff63bd0203,
0xffffffff918100c8,
0xffffffff7c0802a6,
0xfffffffff80100d0,
0xffffffff897c7688,
0xffffffff2f8b0000,
0xffffff00409e01fc, // bne
0xffffffff38000002,
0xffffffff39200020,
0xffffffff3ba00000,
*/
);
REG_SUB_EMPTY(libsynth2, "synth2", cellSoundSynth2Exit);
REG_SUB_EMPTY(libsynth2, "synth2", cellSoundSynth2Config);
REG_SUB_EMPTY(libsynth2, "synth2", cellSoundSynth2GetAddr);
REG_SUB_EMPTY(libsynth2, "synth2", cellSoundSynth2GetParam);
REG_SUB_EMPTY(libsynth2, "synth2", cellSoundSynth2GetSwitch);
REG_SUB_EMPTY(libsynth2, "synth2", cellSoundSynth2SetAddr);
REG_SUB_EMPTY(libsynth2, "synth2", cellSoundSynth2SetParam);
REG_SUB_EMPTY(libsynth2, "synth2", cellSoundSynth2SetSwitch);
REG_SUB_EMPTY(libsynth2, "synth2", cellSoundSynth2SetEffectMode);
REG_SUB_EMPTY(libsynth2, "synth2", cellSoundSynth2SetEffectAttr);
REG_SUB_EMPTY(libsynth2, "synth2", cellSoundSynth2Note2Pitch);
REG_SUB_EMPTY(libsynth2, "synth2", cellSoundSynth2Pitch2Note);
REG_SUB_EMPTY(libsynth2, "synth2", cellSoundSynth2VoiceTrans);
REG_SUB_EMPTY(libsynth2, "synth2", cellSoundSynth2VoiceTransStatus);
REG_SUB_EMPTY(libsynth2, "synth2", cellSoundSynth2SetCoreAttr);
REG_SUB_EMPTY(libsynth2, "synth2", cellSoundSynth2Generate);
}
#endif
REG_SUB(libsynth2,, cellSoundSynth2Config);
REG_SUB(libsynth2,, cellSoundSynth2Init);
REG_SUB(libsynth2,, cellSoundSynth2Exit);
REG_SUB(libsynth2,, cellSoundSynth2SetParam);
REG_SUB(libsynth2,, cellSoundSynth2GetParam);
REG_SUB(libsynth2,, cellSoundSynth2SetSwitch);
REG_SUB(libsynth2,, cellSoundSynth2GetSwitch);
REG_SUB(libsynth2,, cellSoundSynth2SetAddr);
REG_SUB(libsynth2,, cellSoundSynth2GetAddr);
REG_SUB(libsynth2,, cellSoundSynth2SetEffectAttr);
REG_SUB(libsynth2,, cellSoundSynth2SetEffectMode);
REG_SUB(libsynth2,, cellSoundSynth2SetCoreAttr);
REG_SUB(libsynth2,, cellSoundSynth2Generate);
REG_SUB(libsynth2,, cellSoundSynth2VoiceTrans);
REG_SUB(libsynth2,, cellSoundSynth2VoiceTransStatus);
REG_SUB(libsynth2,, cellSoundSynth2Note2Pitch);
REG_SUB(libsynth2,, cellSoundSynth2Pitch2Note);
});

View File

@ -1,8 +1,8 @@
#pragma once
// Error Codes
enum
{
//libsynt2 Error Codes
CELL_SOUND_SYNTH2_ERROR_FATAL = 0x80310201,
CELL_SOUND_SYNTH2_ERROR_INVALID_PARAMETER = 0x80310202,
CELL_SOUND_SYNTH2_ERROR_ALREADY_INITIALIZED = 0x80310203,
@ -16,4 +16,6 @@ struct CellSoundSynth2EffectAttr
be_t<s16> depth_R;
be_t<u16> delay;
be_t<u16> feedback;
};
};
extern Module libsynth2;

View File

@ -22,14 +22,14 @@ Module sys_libc("sys_libc", []()
{
using namespace PPU_instr;
REG_SUB(sys_libc, "", sys_libc_func, memcpy,
se_op(CMPLDI(cr7, r5, 7)),
se_op(CLRLDI(r3, r3, 32)),
se_op(CLRLDI(r4, r4, 32)),
se_op(MR(r11, r3)),
se_op(BGT(cr7, XXX & 0xff)),
se_op(CMPDI(r5, 0)),
se_opt_op(MR(r9, r3)),
REG_SUB(sys_libc, sys_libc_func, memcpy,
SP_I(CMPLDI(cr7, r5, 7)),
SP_I(CLRLDI(r3, r3, 32)),
SP_I(CLRLDI(r4, r4, 32)),
SP_I(MR(r11, r3)),
SP_I(BGT(cr7, XXX & 0xff)),
SP_I(CMPDI(r5, 0)),
OPT_SP_I(MR(r9, r3)),
{ SPET_MASKED_OPCODE, 0x4d820020, 0xffffffff },
);
});

View File

@ -37,7 +37,7 @@
void null_func(PPUThread& ppu)
{
const auto code = ppu.GPR[11];
const u64 code = ppu.GPR[11];
LOG_ERROR(HLE, "Unimplemented syscall %lld: %s -> CELL_OK", code, SysCalls::GetFuncName(~code));
ppu.GPR[3] = 0;
}

View File

@ -370,32 +370,32 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
// Settings panels
wxNotebook* nb_config = new wxNotebook(&diag, wxID_ANY, wxPoint(6,6), wxSize(width, height));
wxPanel* p_system = new wxPanel(nb_config, wxID_ANY);
wxPanel* p_cpu = new wxPanel(nb_config, wxID_ANY);
wxPanel* p_core = new wxPanel(nb_config, wxID_ANY);
wxPanel* p_graphics = new wxPanel(nb_config, wxID_ANY);
wxPanel* p_audio = new wxPanel(nb_config, wxID_ANY);
wxPanel* p_io = new wxPanel(nb_config, wxID_ANY);
wxPanel* p_hle = new wxPanel(nb_config, wxID_ANY);
wxPanel* p_misc = new wxPanel(nb_config, wxID_ANY);
wxPanel* p_networking = new wxPanel(nb_config, wxID_ANY);
nb_config->AddPage(p_cpu, wxT("Core"));
nb_config->AddPage(p_core, wxT("Core"));
nb_config->AddPage(p_graphics, wxT("Graphics"));
nb_config->AddPage(p_audio, wxT("Audio"));
nb_config->AddPage(p_io, wxT("Input / Output"));
nb_config->AddPage(p_hle, wxT("HLE / Misc."));
nb_config->AddPage(p_misc, wxT("Miscellaneous"));
nb_config->AddPage(p_networking, wxT("Networking"));
nb_config->AddPage(p_system, wxT("System"));
wxBoxSizer* s_subpanel_system = new wxBoxSizer(wxVERTICAL);
wxBoxSizer* s_subpanel_cpu = new wxBoxSizer(wxVERTICAL);
wxBoxSizer* s_subpanel_core = new wxBoxSizer(wxVERTICAL);
wxBoxSizer* s_subpanel_graphics = new wxBoxSizer(wxVERTICAL);
wxBoxSizer* s_subpanel_audio = new wxBoxSizer(wxVERTICAL);
wxBoxSizer* s_subpanel_io = new wxBoxSizer(wxVERTICAL);
wxBoxSizer* s_subpanel_hle = new wxBoxSizer(wxVERTICAL);
wxBoxSizer* s_subpanel_misc = new wxBoxSizer(wxVERTICAL);
wxBoxSizer* s_subpanel_networking = new wxBoxSizer(wxVERTICAL);
// CPU/SPU settings
wxStaticBoxSizer* s_round_cpu_decoder = new wxStaticBoxSizer(wxVERTICAL, p_cpu, _("CPU"));
wxStaticBoxSizer* s_round_spu_decoder = new wxStaticBoxSizer(wxVERTICAL, p_cpu, _("SPU"));
// Core settings
wxStaticBoxSizer* s_round_cpu_decoder = new wxStaticBoxSizer(wxVERTICAL, p_core, _("CPU"));
wxStaticBoxSizer* s_round_spu_decoder = new wxStaticBoxSizer(wxVERTICAL, p_core, _("SPU"));
// Graphics
wxStaticBoxSizer* s_round_gs_render = new wxStaticBoxSizer(wxVERTICAL, p_graphics, _("Render"));
@ -413,8 +413,8 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
// Audio
wxStaticBoxSizer* s_round_audio_out = new wxStaticBoxSizer(wxVERTICAL, p_audio, _("Audio Out"));
// HLE / Misc.
wxStaticBoxSizer* s_round_hle_log_lvl = new wxStaticBoxSizer(wxVERTICAL, p_hle, _("Log Level"));
// Miscellaneous
wxStaticBoxSizer* s_round_hle_log_lvl = new wxStaticBoxSizer(wxVERTICAL, p_misc, _("Log Level"));
// Networking
wxStaticBoxSizer* s_round_net_status = new wxStaticBoxSizer(wxVERTICAL, p_networking, _("Connection status"));
@ -423,8 +423,8 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
// System
wxStaticBoxSizer* s_round_sys_lang = new wxStaticBoxSizer(wxVERTICAL, p_system, _("Language"));
wxComboBox* cbox_cpu_decoder = new wxComboBox(p_cpu, wxID_ANY);
wxComboBox* cbox_spu_decoder = new wxComboBox(p_cpu, wxID_ANY);
wxComboBox* cbox_cpu_decoder = new wxComboBox(p_core, wxID_ANY);
wxComboBox* cbox_spu_decoder = new wxComboBox(p_core, wxID_ANY);
wxComboBox* cbox_gs_render = new wxComboBox(p_graphics, wxID_ANY);
wxComboBox* cbox_gs_resolution = new wxComboBox(p_graphics, wxID_ANY);
wxComboBox* cbox_gs_aspect = new wxComboBox(p_graphics, wxID_ANY);
@ -435,11 +435,13 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
wxComboBox* cbox_camera = new wxComboBox(p_io, wxID_ANY);
wxComboBox* cbox_camera_type = new wxComboBox(p_io, wxID_ANY);
wxComboBox* cbox_audio_out = new wxComboBox(p_audio, wxID_ANY);
wxComboBox* cbox_hle_loglvl = new wxComboBox(p_hle, wxID_ANY);
wxComboBox* cbox_hle_loglvl = new wxComboBox(p_misc, wxID_ANY);
wxComboBox* cbox_net_status = new wxComboBox(p_networking, wxID_ANY);
wxComboBox* cbox_net_interface = new wxComboBox(p_networking, wxID_ANY);
wxComboBox* cbox_sys_lang = new wxComboBox(p_system, wxID_ANY);
wxCheckBox* chbox_core_hook_stfunc = new wxCheckBox(p_core, wxID_ANY, "Hook static functions");
wxCheckBox* chbox_core_load_liblv2 = new wxCheckBox(p_core, wxID_ANY, "Load liblv2.sprx");
wxCheckBox* chbox_gs_log_prog = new wxCheckBox(p_graphics, wxID_ANY, "Log vertex/fragment programs");
wxCheckBox* chbox_gs_dump_depth = new wxCheckBox(p_graphics, wxID_ANY, "Write Depth Buffer");
wxCheckBox* chbox_gs_dump_color = new wxCheckBox(p_graphics, wxID_ANY, "Write Color Buffers");
@ -448,16 +450,15 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
wxCheckBox* chbox_gs_3dmonitor = new wxCheckBox(p_graphics, wxID_ANY, "3D Monitor");
wxCheckBox* chbox_audio_dump = new wxCheckBox(p_audio, wxID_ANY, "Dump to file");
wxCheckBox* chbox_audio_conv = new wxCheckBox(p_audio, wxID_ANY, "Convert to 16 bit");
wxCheckBox* chbox_hle_logging = new wxCheckBox(p_hle, wxID_ANY, "Log everything");
wxCheckBox* chbox_rsx_logging = new wxCheckBox(p_hle, wxID_ANY, "RSX Logging");
wxCheckBox* chbox_hle_hook_stfunc = new wxCheckBox(p_hle, wxID_ANY, "Hook static functions");
wxCheckBox* chbox_hle_savetty = new wxCheckBox(p_hle, wxID_ANY, "Save TTY output to file");
wxCheckBox* chbox_hle_exitonstop = new wxCheckBox(p_hle, wxID_ANY, "Exit RPCS3 when process finishes");
wxCheckBox* chbox_hle_always_start = new wxCheckBox(p_hle, wxID_ANY, "Always start after boot");
wxCheckBox* chbox_hle_logging = new wxCheckBox(p_misc, wxID_ANY, "Log everything");
wxCheckBox* chbox_rsx_logging = new wxCheckBox(p_misc, wxID_ANY, "RSX Logging");
wxCheckBox* chbox_hle_savetty = new wxCheckBox(p_misc, wxID_ANY, "Save TTY output to file");
wxCheckBox* chbox_hle_exitonstop = new wxCheckBox(p_misc, wxID_ANY, "Exit RPCS3 when process finishes");
wxCheckBox* chbox_hle_always_start = new wxCheckBox(p_misc, wxID_ANY, "Always start after boot");
//Auto Pause
wxCheckBox* chbox_dbg_ap_systemcall = new wxCheckBox(p_hle, wxID_ANY, "Auto Pause at System Call");
wxCheckBox* chbox_dbg_ap_functioncall = new wxCheckBox(p_hle, wxID_ANY, "Auto Pause at Function Call");
wxCheckBox* chbox_dbg_ap_systemcall = new wxCheckBox(p_misc, wxID_ANY, "Auto Pause at System Call");
wxCheckBox* chbox_dbg_ap_functioncall = new wxCheckBox(p_misc, wxID_ANY, "Auto Pause at Function Call");
//Custom EmulationDir
wxCheckBox* chbox_emulationdir_enable = new wxCheckBox(p_system, wxID_ANY, "Use Path Below as EmulationDir ? (Need Restart)");
@ -610,10 +611,11 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
chbox_audio_conv ->SetValue(Ini.AudioConvertToU16.GetValue());
chbox_hle_logging ->SetValue(Ini.HLELogging.GetValue());
chbox_rsx_logging ->SetValue(Ini.RSXLogging.GetValue());
chbox_hle_hook_stfunc ->SetValue(Ini.HLEHookStFunc.GetValue());
chbox_hle_savetty ->SetValue(Ini.HLESaveTTY.GetValue());
chbox_hle_exitonstop ->SetValue(Ini.HLEExitOnStop.GetValue());
chbox_hle_always_start ->SetValue(Ini.HLEAlwaysStart.GetValue());
chbox_core_hook_stfunc ->SetValue(Ini.HookStFunc.GetValue());
chbox_core_load_liblv2 ->SetValue(Ini.LoadLibLv2.GetValue());
//Auto Pause related
chbox_dbg_ap_systemcall ->SetValue(Ini.DBGAutoPauseSystemCall.GetValue());
@ -668,8 +670,10 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
s_round_sys_lang->Add(cbox_sys_lang, wxSizerFlags().Border(wxALL, 5).Expand());
// Core
s_subpanel_cpu->Add(s_round_cpu_decoder, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_cpu->Add(s_round_spu_decoder, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_core->Add(s_round_cpu_decoder, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_core->Add(s_round_spu_decoder, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_core->Add(chbox_core_hook_stfunc, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_core->Add(chbox_core_load_liblv2, wxSizerFlags().Border(wxALL, 5).Expand());
// Graphics
s_subpanel_graphics->Add(s_round_gs_render, wxSizerFlags().Border(wxALL, 5).Expand());
@ -695,18 +699,17 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
s_subpanel_audio->Add(chbox_audio_dump, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_audio->Add(chbox_audio_conv, wxSizerFlags().Border(wxALL, 5).Expand());
// HLE / Misc.
s_subpanel_hle->Add(s_round_hle_log_lvl, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_hle->Add(chbox_hle_logging, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_hle->Add(chbox_rsx_logging, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_hle->Add(chbox_hle_hook_stfunc, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_hle->Add(chbox_hle_savetty, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_hle->Add(chbox_hle_exitonstop, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_hle->Add(chbox_hle_always_start, wxSizerFlags().Border(wxALL, 5).Expand());
// Miscellaneous
s_subpanel_misc->Add(s_round_hle_log_lvl, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_misc->Add(chbox_hle_logging, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_misc->Add(chbox_rsx_logging, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_misc->Add(chbox_hle_savetty, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_misc->Add(chbox_hle_exitonstop, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_misc->Add(chbox_hle_always_start, wxSizerFlags().Border(wxALL, 5).Expand());
// Auto Pause
s_subpanel_hle->Add(chbox_dbg_ap_systemcall, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_hle->Add(chbox_dbg_ap_functioncall, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_misc->Add(chbox_dbg_ap_systemcall, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_misc->Add(chbox_dbg_ap_functioncall, wxSizerFlags().Border(wxALL, 5).Expand());
// Networking
s_subpanel_networking->Add(s_round_net_status, wxSizerFlags().Border(wxALL, 5).Expand());
@ -725,11 +728,11 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
s_b_panel->Add(new wxButton(&diag, wxID_CANCEL), wxSizerFlags().Border(wxALL, 5).Bottom());
// Resize panels
diag.SetSizerAndFit(s_subpanel_cpu, false);
diag.SetSizerAndFit(s_subpanel_core, false);
diag.SetSizerAndFit(s_subpanel_graphics, false);
diag.SetSizerAndFit(s_subpanel_io, false);
diag.SetSizerAndFit(s_subpanel_audio, false);
diag.SetSizerAndFit(s_subpanel_hle, false);
diag.SetSizerAndFit(s_subpanel_misc, false);
diag.SetSizerAndFit(s_subpanel_networking, false);
diag.SetSizerAndFit(s_subpanel_system, false);
diag.SetSizerAndFit(s_b_panel, false);
@ -740,6 +743,8 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
{
Ini.CPUDecoderMode.SetValue(cbox_cpu_decoder->GetSelection());
Ini.SPUDecoderMode.SetValue(cbox_spu_decoder->GetSelection());
Ini.HookStFunc.SetValue(chbox_core_hook_stfunc->GetValue());
Ini.LoadLibLv2.SetValue(chbox_core_load_liblv2->GetValue());
Ini.GSRenderMode.SetValue(cbox_gs_render->GetSelection());
Ini.GSResolution.SetValue(ResolutionNumToId(cbox_gs_resolution->GetSelection() + 1));
Ini.GSAspectRatio.SetValue(cbox_gs_aspect->GetSelection() + 1);
@ -760,7 +765,6 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
Ini.CameraType.SetValue(cbox_camera_type->GetSelection());
Ini.HLELogging.SetValue(chbox_hle_logging->GetValue());
Ini.RSXLogging.SetValue(chbox_rsx_logging->GetValue());
Ini.HLEHookStFunc.SetValue(chbox_hle_hook_stfunc->GetValue());
Ini.HLESaveTTY.SetValue(chbox_hle_savetty->GetValue());
Ini.HLEExitOnStop.SetValue(chbox_hle_exitonstop->GetValue());
Ini.HLELogLvl.SetValue(cbox_hle_loglvl->GetSelection());

View File

@ -93,6 +93,8 @@ public:
// Core
IniEntry<u8> CPUDecoderMode;
IniEntry<u8> SPUDecoderMode;
IniEntry<bool> HookStFunc;
IniEntry<bool> LoadLibLv2;
// Graphics
IniEntry<u8> GSRenderMode;
@ -150,7 +152,6 @@ public:
IniEntry<u8> NETInterface;
IniEntry<bool> HLELogging;
IniEntry<bool> RSXLogging;
IniEntry<bool> HLEHookStFunc;
IniEntry<bool> HLESaveTTY;
IniEntry<bool> HLEExitOnStop;
IniEntry<bool> HLEAlwaysStart;
@ -174,8 +175,10 @@ public:
path = DefPath;
// Core
CPUDecoderMode.Init("CPU_DecoderMode", path);
SPUDecoderMode.Init("CPU_SPUDecoderMode", path);
CPUDecoderMode.Init("CORE_DecoderMode", path);
SPUDecoderMode.Init("CORE_SPUDecoderMode", path);
HookStFunc.Init("CORE_HookStFunc", path);
LoadLibLv2.Init("CORE_LoadLibLv2", path);
// Graphics
GSRenderMode.Init("GS_RenderMode", path);
@ -227,12 +230,11 @@ public:
PadHandlerRStickRight.Init("ControlSetings_PadHandlerRStickRight", path);
PadHandlerRStickUp.Init("ControlSetings_PadHandlerRStickUp", path);
// HLE/Misc
// Miscellaneous
HLELogging.Init("HLE_HLELogging", path);
RSXLogging.Init("RSX_Logging", path);
NETStatus.Init("NET_Status", path);
NETInterface.Init("NET_Interface", path);
HLEHookStFunc.Init("HLE_HLEHookStFunc", path);
HLESaveTTY.Init("HLE_HLESaveTTY", path);
HLEExitOnStop.Init("HLE_HLEExitOnStop", path);
HLELogLvl.Init("HLE_HLELogLvl", path);
@ -255,6 +257,8 @@ public:
// Core
CPUDecoderMode.Load(0);
SPUDecoderMode.Load(0);
HookStFunc.Load(false);
LoadLibLv2.Load(false);
// Graphics
GSRenderMode.Load(1);
@ -306,12 +310,11 @@ public:
PadHandlerRStickRight.Load(312); //WXK_END
PadHandlerRStickUp.Load(366); //WXK_PAGEUP
// HLE/Miscs
// Miscellaneous
HLELogging.Load(false);
RSXLogging.Load(false);
NETStatus.Load(0);
NETInterface.Load(0);
HLEHookStFunc.Load(false);
HLESaveTTY.Load(false);
HLEExitOnStop.Load(false);
HLELogLvl.Load(3);
@ -331,9 +334,11 @@ public:
void Save()
{
// CPU/SPU
// Core
CPUDecoderMode.Save();
SPUDecoderMode.Save();
HookStFunc.Save();
LoadLibLv2.Save();
// Graphics
GSRenderMode.Save();
@ -385,12 +390,11 @@ public:
PadHandlerRStickRight.Save();
PadHandlerRStickUp.Save();
// HLE/Miscs
// Miscellaneous
HLELogging.Save();
RSXLogging.Save();
NETStatus.Save();
NETInterface.Save();
HLEHookStFunc.Save();
HLESaveTTY.Save();
HLEExitOnStop.Save();
HLELogLvl.Save();

View File

@ -606,7 +606,11 @@ namespace loader
{
m_stream->Seek(handler::get_stream_offset() + phdr.p_offset);
m_stream->Read(phdr.p_vaddr.get_ptr(), phdr.p_filesz);
hook_ppu_funcs(vm::static_ptr_cast<be_t<u32>>(phdr.p_vaddr), phdr.p_filesz / 4);
if (Ini.HookStFunc.GetValue())
{
hook_ppu_funcs(vm::static_ptr_cast<be_t<u32>>(phdr.p_vaddr), phdr.p_filesz / 4);
}
}
}
break;

View File

@ -57,9 +57,6 @@
<Filter Include="Emu\Io\Null">
<UniqueIdentifier>{fcac6852-b45f-4cf2-afee-cf56bcea14e5}</UniqueIdentifier>
</Filter>
<Filter Include="Emu\SysCalls\currently_unused">
<UniqueIdentifier>{ead7494f-a872-4b4d-a864-1a61c3b6012f}</UniqueIdentifier>
</Filter>
<Filter Include="Emu\CPU\Cell">
<UniqueIdentifier>{13d20086-2188-425a-9856-0440fe6f79f2}</UniqueIdentifier>
</Filter>
@ -413,12 +410,6 @@
<ClCompile Include="Emu\SysCalls\ModuleManager.cpp">
<Filter>Emu\SysCalls</Filter>
</ClCompile>
<ClCompile Include="Emu\SysCalls\Modules\libsnd3.cpp">
<Filter>Emu\SysCalls\currently_unused</Filter>
</ClCompile>
<ClCompile Include="Emu\SysCalls\Modules\libsynth2.cpp">
<Filter>Emu\SysCalls\currently_unused</Filter>
</ClCompile>
<ClCompile Include="Emu\SysCalls\lv2\sys_process.cpp">
<Filter>Emu\SysCalls\lv2</Filter>
</ClCompile>
@ -926,6 +917,12 @@
<ClCompile Include="Emu\SysCalls\Modules\cellStorage.cpp">
<Filter>Emu\SysCalls\Modules</Filter>
</ClCompile>
<ClCompile Include="Emu\SysCalls\Modules\libsnd3.cpp">
<Filter>Emu\SysCalls\Modules</Filter>
</ClCompile>
<ClCompile Include="Emu\SysCalls\Modules\libsynth2.cpp">
<Filter>Emu\SysCalls\Modules</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Crypto\aes.h">
@ -1300,12 +1297,6 @@
<ClInclude Include="Emu\DbgCommand.h">
<Filter>Emu</Filter>
</ClInclude>
<ClInclude Include="Emu\SysCalls\Modules\libsnd3.h">
<Filter>Emu\SysCalls\currently_unused</Filter>
</ClInclude>
<ClInclude Include="Emu\SysCalls\Modules\libsynth2.h">
<Filter>Emu\SysCalls\currently_unused</Filter>
</ClInclude>
<ClInclude Include="Emu\Event.h">
<Filter>Emu\SysCalls</Filter>
</ClInclude>
@ -1783,5 +1774,11 @@
<ClInclude Include="Emu\SysCalls\Modules\cellAtracMulti.h">
<Filter>Emu\SysCalls\Modules</Filter>
</ClInclude>
<ClInclude Include="Emu\SysCalls\Modules\libsnd3.h">
<Filter>Emu\SysCalls\Modules</Filter>
</ClInclude>
<ClInclude Include="Emu\SysCalls\Modules\libsynth2.h">
<Filter>Emu\SysCalls\Modules</Filter>
</ClInclude>
</ItemGroup>
</Project>