_sys_ppu_thread_create fixed

This commit is contained in:
Nekotekina 2015-04-17 22:46:06 +03:00
parent 048cb7993d
commit ad02c8d510
4 changed files with 20 additions and 16 deletions

View file

@ -109,14 +109,6 @@ __noinline s32 savedata_op(
std::string base_dir = "/dev_hdd0/home/00000001/savedata/"; // TODO: Get the path of the current or specified user std::string base_dir = "/dev_hdd0/home/00000001/savedata/"; // TODO: Get the path of the current or specified user
vm::stackvar<CellSaveDataCBResult> result(CPU); vm::stackvar<CellSaveDataCBResult> result(CPU);
vm::stackvar<CellSaveDataListGet> listGet(CPU);
vm::stackvar<CellSaveDataListSet> listSet(CPU);
vm::stackvar<CellSaveDataFixedSet> fixedSet(CPU);
vm::stackvar<CellSaveDataStatGet> statGet(CPU);
vm::stackvar<CellSaveDataStatSet> statSet(CPU);
vm::stackvar<CellSaveDataFileGet> fileGet(CPU);
vm::stackvar<CellSaveDataFileSet> fileSet(CPU);
vm::stackvar<CellSaveDataDoneGet> doneGet(CPU);
result->userdata = userdata; // probably should be assigned only once (allows the callback to change it) result->userdata = userdata; // probably should be assigned only once (allows the callback to change it)
@ -126,6 +118,8 @@ __noinline s32 savedata_op(
{ {
std::vector<SaveDataEntry> save_entries; std::vector<SaveDataEntry> save_entries;
vm::stackvar<CellSaveDataListGet> listGet(CPU);
listGet->dirNum = 0; listGet->dirNum = 0;
listGet->dirListNum = 0; listGet->dirListNum = 0;
listGet->dirList.set(setBuf->buf.addr()); listGet->dirList.set(setBuf->buf.addr());
@ -205,6 +199,8 @@ __noinline s32 savedata_op(
if (funcList) if (funcList)
{ {
vm::stackvar<CellSaveDataListSet> listSet(CPU);
// List Callback // List Callback
funcList(CPU, result, listGet, listSet); funcList(CPU, result, listGet, listSet);
@ -230,7 +226,7 @@ __noinline s32 savedata_op(
// Focus save data // Focus save data
s32 focused = -1; s32 focused = -1;
switch (const u32 pos_type = listSet->focusPosition.value()) switch (const u32 pos_type = listSet->focusPosition)
{ {
case CELL_SAVEDATA_FOCUSPOS_DIRNAME: case CELL_SAVEDATA_FOCUSPOS_DIRNAME:
{ {
@ -314,6 +310,8 @@ __noinline s32 savedata_op(
if (funcFixed) if (funcFixed)
{ {
vm::stackvar<CellSaveDataFixedSet> fixedSet(CPU);
// Fixed Callback // Fixed Callback
funcFixed(CPU, result, listGet, fixedSet); funcFixed(CPU, result, listGet, fixedSet);
@ -349,6 +347,9 @@ __noinline s32 savedata_op(
} }
// get save stats // get save stats
vm::stackvar<CellSaveDataStatGet> statGet(CPU);
vm::stackvar<CellSaveDataStatSet> statSet(CPU);
std::string dir_path = base_dir + save_entry.dirName + "/"; std::string dir_path = base_dir + save_entry.dirName + "/";
std::string sfo_path = dir_path + "PARAM.SFO"; std::string sfo_path = dir_path + "PARAM.SFO";
@ -452,7 +453,7 @@ __noinline s32 savedata_op(
psf.SetString("TITLE", statSet->setParam->title); psf.SetString("TITLE", statSet->setParam->title);
} }
switch (const auto mode = statSet->reCreateMode.value() & 0xffff) switch (const auto mode = statSet->reCreateMode & 0xffff)
{ {
case CELL_SAVEDATA_RECREATE_NO: case CELL_SAVEDATA_RECREATE_NO:
case CELL_SAVEDATA_RECREATE_NO_NOBROKEN: case CELL_SAVEDATA_RECREATE_NO_NOBROKEN:
@ -497,6 +498,9 @@ __noinline s32 savedata_op(
} }
// Enter the loop where the save files are read/created/deleted // Enter the loop where the save files are read/created/deleted
vm::stackvar<CellSaveDataFileGet> fileGet(CPU);
vm::stackvar<CellSaveDataFileSet> fileSet(CPU);
fileGet->excSize = 0; fileGet->excSize = 0;
memset(fileGet->reserved, 0, sizeof(fileGet->reserved)); memset(fileGet->reserved, 0, sizeof(fileGet->reserved));
@ -516,7 +520,7 @@ __noinline s32 savedata_op(
std::string filepath = dir_path; std::string filepath = dir_path;
switch (const auto type = fileSet->fileType.value()) switch (const auto type = fileSet->fileType)
{ {
case CELL_SAVEDATA_FILETYPE_SECUREFILE: case CELL_SAVEDATA_FILETYPE_SECUREFILE:
case CELL_SAVEDATA_FILETYPE_NORMALFILE: case CELL_SAVEDATA_FILETYPE_NORMALFILE:
@ -558,7 +562,7 @@ __noinline s32 savedata_op(
std::unique_ptr<vfsStream> file; std::unique_ptr<vfsStream> file;
switch (const auto op = fileSet->fileOperation.value()) switch (const auto op = fileSet->fileOperation)
{ {
case CELL_SAVEDATA_FILEOP_READ: case CELL_SAVEDATA_FILEOP_READ:
{ {

View file

@ -985,7 +985,7 @@ s32 syncLFQueueInitialize(vm::ptr<CellSyncLFQueue> queue, vm::ptr<u8> buffer, u3
if (old_value == 2) if (old_value == 2)
{ {
if (queue->m_size != size || queue->m_depth != depth || queue->m_buffer.addr().value() != buffer.addr()) if (queue->m_size != size || queue->m_depth != depth || queue->m_buffer != buffer)
{ {
return CELL_SYNC_ERROR_INVAL; return CELL_SYNC_ERROR_INVAL;
} }

View file

@ -713,7 +713,7 @@ s32 cellVdecGetPicture(u32 handle, vm::ptr<const CellVdecPicFormat> format, vm::
std::unique_ptr<u8> alpha_plane; std::unique_ptr<u8> alpha_plane;
switch (const auto type = format->formatType.value()) switch (const auto type = format->formatType)
{ {
case CELL_VDEC_PICFMT_ARGB32_ILV: out_f = AV_PIX_FMT_ARGB; alpha_plane.reset(new u8[w * h]); break; case CELL_VDEC_PICFMT_ARGB32_ILV: out_f = AV_PIX_FMT_ARGB; alpha_plane.reset(new u8[w * h]); break;
case CELL_VDEC_PICFMT_RGBA32_ILV: out_f = AV_PIX_FMT_RGBA; alpha_plane.reset(new u8[w * h]); break; case CELL_VDEC_PICFMT_RGBA32_ILV: out_f = AV_PIX_FMT_RGBA; alpha_plane.reset(new u8[w * h]); break;

View file

@ -12,7 +12,7 @@ SysCallBase sys_ppu_thread("sys_ppu_thread");
void _sys_ppu_thread_exit(PPUThread& CPU, u64 errorcode) void _sys_ppu_thread_exit(PPUThread& CPU, u64 errorcode)
{ {
sys_ppu_thread.Warning("_sys_ppu_thread_exit(errorcode=0x%llx)", errorcode); sys_ppu_thread.Log("_sys_ppu_thread_exit(errorcode=0x%llx)", errorcode);
CPU.SetExitStatus(errorcode); CPU.SetExitStatus(errorcode);
CPU.Stop(); CPU.Stop();
@ -212,7 +212,7 @@ s32 _sys_ppu_thread_create(vm::ptr<u64> thread_id, vm::ptr<ppu_thread_param_t> p
ppu.SetPrio(prio); ppu.SetPrio(prio);
ppu.SetStackSize(stacksize < 0x4000 ? 0x4000 : stacksize); // (hack) adjust minimal stack size ppu.SetStackSize(stacksize < 0x4000 ? 0x4000 : stacksize); // (hack) adjust minimal stack size
ppu.SetJoinable(is_joinable); ppu.SetJoinable(is_joinable);
ppu.SetName(threadname.get_ptr()); ppu.SetName(threadname ? threadname.get_ptr() : "");
ppu.Run(); ppu.Run();
ppu.GPR[3] = arg; ppu.GPR[3] = arg;