Conflicts fixed

This commit is contained in:
Nekotekina 2014-09-06 02:54:42 +04:00
commit b0d9fba418
5 changed files with 273 additions and 167 deletions

View File

@ -11,7 +11,7 @@ void InitProcTable()
#undef OPENGL_PROC
#undef OPENGL_PROC2
#endif
#ifdef __UNIX__
#ifdef __unix__
glewExperimental = true;
glewInit();
#endif

View File

@ -704,233 +704,247 @@ int cellSaveDataAutoLoad2(u32 version, vm::ptr<const char> dirName, u32 errDialo
int cellSaveDataListAutoSave(u32 version, u32 errDialog, vm::ptr<CellSaveDataSetList> setList, vm::ptr<CellSaveDataSetBuf> setBuf, vm::ptr<CellSaveDataFixedCallback> funcFixed,
vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile, u32 container, vm::ptr<void> userdata)
{
cellSysutil->Warning("cellSaveDataListAutoSave(version=%d, errDialog=%d, setBuf=0x%x, funcFixed=0x%x, funcStat=0x%x, funcFile=0x%x, container=0x%x, userdata_addr=0x%x)",
cellSysutil->Todo("cellSaveDataListAutoSave(version=%d, errDialog=%d, setBuf=0x%x, funcFixed=0x%x, funcStat=0x%x, funcFile=0x%x, container=0x%x, userdata_addr=0x%x)",
version, errDialog, setList.addr(), setBuf.addr(), funcFixed.addr(), funcStat.addr(), funcFile.addr(), container, userdata.addr());
vm::var<CellSaveDataCBResult> result;
vm::var<CellSaveDataListGet> listGet;
vm::var<CellSaveDataFixedSet> fixedSet;
vm::var<CellSaveDataStatGet> statGet;
vm::var<CellSaveDataStatSet> statSet;
//vm::var<CellSaveDataCBResult> result;
//vm::var<CellSaveDataListGet> listGet;
//vm::var<CellSaveDataFixedSet> fixedSet;
//vm::var<CellSaveDataStatGet> statGet;
//vm::var<CellSaveDataStatSet> statSet;
std::string saveBaseDir = "/dev_hdd0/home/00000001/savedata/"; // TODO: Get the path of the current user
vfsDir dir(saveBaseDir);
//std::string saveBaseDir = "/dev_hdd0/home/00000001/savedata/"; // TODO: Get the path of the current user
//vfsDir dir(saveBaseDir);
if (!dir.IsOpened())
return CELL_SAVEDATA_ERROR_INTERNAL;
//if (!dir.IsOpened())
// return CELL_SAVEDATA_ERROR_INTERNAL;
std::string dirNamePrefix = setList->dirNamePrefix.get_ptr();
std::vector<SaveDataEntry> saveEntries;
//std::string dirNamePrefix = setList->dirNamePrefix.get_ptr();
//std::vector<SaveDataEntry> saveEntries;
for (const DirEntryInfo* entry = dir.Read(); entry; entry = dir.Read())
{
if (entry->flags & DirEntry_TypeDir && entry->name.substr(0, dirNamePrefix.size()) == dirNamePrefix)
{
// Count the amount of matches and the amount of listed directories
listGet->dirListNum++;
if (listGet->dirListNum > setBuf->dirListMax)
continue;
listGet->dirNum++;
//for (const DirEntryInfo* entry = dir.Read(); entry; entry = dir.Read())
//{
// if (entry->flags & DirEntry_TypeDir && entry->name.substr(0, dirNamePrefix.size()) == dirNamePrefix)
// {
// // Count the amount of matches and the amount of listed directories
// listGet->dirListNum++;
// if (listGet->dirListNum > setBuf->dirListMax)
// continue;
// listGet->dirNum++;
std::string saveDir = saveBaseDir + entry->name;
addSaveDataEntry(saveEntries, saveDir);
}
}
// std::string saveDir = saveBaseDir + entry->name;
// addSaveDataEntry(saveEntries, saveDir);
// }
//}
// Sort the entries and fill the listGet->dirList array
std::sort(saveEntries.begin(), saveEntries.end(), sortSaveDataEntry(setList->sortType, setList->sortOrder));
listGet->dirList = vm::bptr<CellSaveDataDirList>::make(setBuf->buf.addr());
auto dirList = vm::get_ptr<CellSaveDataDirList>(listGet->dirList.addr());
//// Sort the entries and fill the listGet->dirList array
//std::sort(saveEntries.begin(), saveEntries.end(), sortSaveDataEntry(setList->sortType, setList->sortOrder));
//listGet->dirList = vm::bptr<CellSaveDataDirList>::make(setBuf->buf.addr());
//auto dirList = vm::get_ptr<CellSaveDataDirList>(listGet->dirList.addr());
for (u32 i = 0; i<saveEntries.size(); i++) {
strcpy_trunc(dirList[i].dirName, saveEntries[i].dirName.c_str());
strcpy_trunc(dirList[i].listParam, saveEntries[i].listParam.c_str());
*dirList[i].reserved = {};
}
//for (u32 i = 0; i<saveEntries.size(); i++) {
// strcpy_trunc(dirList[i].dirName, saveEntries[i].dirName.c_str());
// strcpy_trunc(dirList[i].listParam, saveEntries[i].listParam.c_str());
// *dirList[i].reserved = {};
//}
throw fmt::Format("%s(): implementation broken", __FUNCTION__);
funcFixed(result, listGet, fixedSet);
//funcFixed(result, listGet, fixedSet);
if (result->result < 0) {
cellSysutil->Error("cellSaveDataListAutoSave: CellSaveDataListCallback failed."); // TODO: Once we verify that the entire SysCall is working, delete this debug error message.
return CELL_SAVEDATA_ERROR_CBRESULT;
}
//if (result->result < 0) {
// cellSysutil->Error("cellSaveDataListAutoSave: CellSaveDataListCallback failed."); // TODO: Once we verify that the entire SysCall is working, delete this debug error message.
// return CELL_SAVEDATA_ERROR_CBRESULT;
//}
/*setSaveDataList(saveEntries, (u32)listSet->fixedList.addr(), listSet->fixedListNum);
if (listSet->newData)
addNewSaveDataEntry(saveEntries, (u32)listSet->newData.addr());
if (saveEntries.size() == 0) {
cellSysutil->Warning("cellSaveDataListAutoSave: No save entries found!"); // TODO: Find a better way to handle this error
return CELL_SAVEDATA_RET_OK;
}
//setSaveDataList(saveEntries, (u32)listSet->fixedList.addr(), listSet->fixedListNum);
//if (listSet->newData)
// addNewSaveDataEntry(saveEntries, (u32)listSet->newData.addr());
//if (saveEntries.size() == 0) {
// cellSysutil->Warning("cellSaveDataListAutoSave: No save entries found!"); // TODO: Find a better way to handle this error
// return CELL_SAVEDATA_RET_OK;
//}
u32 focusIndex = focusSaveDataEntry(saveEntries, listSet->focusPosition);
// TODO: Display the dialog here
u32 selectedIndex = focusIndex; // TODO: Until the dialog is implemented, select always the focused entry
getSaveDataStat(saveEntries[selectedIndex], statGet.addr());
result->userdata_addr = userdata_addr;
//u32 focusIndex = focusSaveDataEntry(saveEntries, listSet->focusPosition);
//// TODO: Display the dialog here
//u32 selectedIndex = focusIndex; // TODO: Until the dialog is implemented, select always the focused entry
//getSaveDataStat(saveEntries[selectedIndex], statGet.addr());
//result->userdata_addr = userdata_addr;
funcStat(result, statGet, statSet);
Memory.Free(statGet->fileList.addr());
if (result->result < 0) {
cellSysutil->Error("cellSaveDataListAutoSave: CellSaveDataStatCallback failed."); // TODO: Once we verify that the entire SysCall is working, delete this debug error message.
return CELL_SAVEDATA_ERROR_CBRESULT;
}*/
//funcStat(result, statGet, statSet);
//Memory.Free(statGet->fileList.addr());
//if (result->result < 0) {
// cellSysutil->Error("cellSaveDataListAutoSave: CellSaveDataStatCallback failed."); // TODO: Once we verify that the entire SysCall is working, delete this debug error message.
// return CELL_SAVEDATA_ERROR_CBRESULT;
//}
/*if (statSet->setParam)
addNewSaveDataEntry(saveEntries, (u32)listSet->newData.addr()); // TODO: This *is* wrong
*/
// Enter the loop where the save files are read/created/deleted.
s32 ret = modifySaveDataFiles(funcFile, result, saveBaseDir + (char*)statGet->dir.dirName);
///*if (statSet->setParam)
//addNewSaveDataEntry(saveEntries, (u32)listSet->newData.addr()); // TODO: This *is* wrong
//*/
//// Enter the loop where the save files are read/created/deleted.
//s32 ret = modifySaveDataFiles(funcFile, result, saveBaseDir + (char*)statGet->dir.dirName);
return CELL_SAVEDATA_RET_OK;
}
int cellSaveDataListAutoLoad(u32 version, u32 errDialog, vm::ptr<CellSaveDataSetList> setList, vm::ptr<CellSaveDataSetBuf> setBuf, vm::ptr<CellSaveDataFixedCallback> funcFixed,
vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile, u32 container, vm::ptr<void> userdata)
{
cellSysutil->Warning("cellSaveDataListAutoLoad(version=%d, errDialog=%d, setBuf=0x%x, funcFixed=0x%x, funcStat=0x%x, funcFile=0x%x, container=0x%x, userdata_addr=0x%x)",
cellSysutil->Todo("cellSaveDataListAutoLoad(version=%d, errDialog=%d, setBuf=0x%x, funcFixed=0x%x, funcStat=0x%x, funcFile=0x%x, container=0x%x, userdata_addr=0x%x)",
version, errDialog, setList.addr(), setBuf.addr(), funcFixed.addr(), funcStat.addr(), funcFile.addr(), container, userdata.addr());
vm::var<CellSaveDataCBResult> result;
vm::var<CellSaveDataListGet> listGet;
vm::var<CellSaveDataFixedSet> fixedSet;
vm::var<CellSaveDataStatGet> statGet;
vm::var<CellSaveDataStatSet> statSet;
//vm::var<CellSaveDataCBResult> result;
//vm::var<CellSaveDataListGet> listGet;
//vm::var<CellSaveDataFixedSet> fixedSet;
//vm::var<CellSaveDataStatGet> statGet;
//vm::var<CellSaveDataStatSet> statSet;
std::string saveBaseDir = "/dev_hdd0/home/00000001/savedata/"; // TODO: Get the path of the current user
vfsDir dir(saveBaseDir);
//std::string saveBaseDir = "/dev_hdd0/home/00000001/savedata/"; // TODO: Get the path of the current user
//vfsDir dir(saveBaseDir);
if (!dir.IsOpened())
return CELL_SAVEDATA_ERROR_INTERNAL;
//if (!dir.IsOpened())
// return CELL_SAVEDATA_ERROR_INTERNAL;
std::string dirNamePrefix = setList->dirNamePrefix.get_ptr();
std::vector<SaveDataEntry> saveEntries;
//std::string dirNamePrefix = setList->dirNamePrefix.get_ptr();
//std::vector<SaveDataEntry> saveEntries;
for (const DirEntryInfo* entry = dir.Read(); entry; entry = dir.Read())
{
if (entry->flags & DirEntry_TypeDir && entry->name.substr(0, dirNamePrefix.size()) == dirNamePrefix)
{
// Count the amount of matches and the amount of listed directories
listGet->dirListNum++;
if (listGet->dirListNum > setBuf->dirListMax)
continue;
listGet->dirNum++;
//for (const DirEntryInfo* entry = dir.Read(); entry; entry = dir.Read())
//{
// if (entry->flags & DirEntry_TypeDir && entry->name.substr(0, dirNamePrefix.size()) == dirNamePrefix)
// {
// // Count the amount of matches and the amount of listed directories
// listGet->dirListNum++;
// if (listGet->dirListNum > setBuf->dirListMax)
// continue;
// listGet->dirNum++;
std::string saveDir = saveBaseDir + entry->name;
addSaveDataEntry(saveEntries, saveDir);
}
}
// std::string saveDir = saveBaseDir + entry->name;
// addSaveDataEntry(saveEntries, saveDir);
// }
//}
// Sort the entries and fill the listGet->dirList array
std::sort(saveEntries.begin(), saveEntries.end(), sortSaveDataEntry(setList->sortType, setList->sortOrder));
listGet->dirList = vm::bptr<CellSaveDataDirList>::make(setBuf->buf.addr());
auto dirList = vm::get_ptr<CellSaveDataDirList>(listGet->dirList.addr());
//// Sort the entries and fill the listGet->dirList array
//std::sort(saveEntries.begin(), saveEntries.end(), sortSaveDataEntry(setList->sortType, setList->sortOrder));
//listGet->dirList = vm::bptr<CellSaveDataDirList>::make(setBuf->buf.addr());
//auto dirList = vm::get_ptr<CellSaveDataDirList>(listGet->dirList.addr());
for (u32 i = 0; i<saveEntries.size(); i++) {
strcpy_trunc(dirList[i].dirName, saveEntries[i].dirName);
strcpy_trunc(dirList[i].listParam, saveEntries[i].listParam);
*dirList[i].reserved = {};
}
//for (u32 i = 0; i<saveEntries.size(); i++) {
// strcpy_trunc(dirList[i].dirName, saveEntries[i].dirName);
// strcpy_trunc(dirList[i].listParam, saveEntries[i].listParam);
// *dirList[i].reserved = {};
//}
throw fmt::Format("%s(): implementation broken", __FUNCTION__);
funcFixed(result, listGet, fixedSet);
//funcFixed(result, listGet, fixedSet);
if (result->result < 0) {
cellSysutil->Error("cellSaveDataListAutoLoad: CellSaveDataListCallback failed."); // TODO: Once we verify that the entire SysCall is working, delete this debug error message.
return CELL_SAVEDATA_ERROR_CBRESULT;
}
//if (result->result < 0) {
// cellSysutil->Error("cellSaveDataListAutoLoad: CellSaveDataListCallback failed."); // TODO: Once we verify that the entire SysCall is working, delete this debug error message.
// return CELL_SAVEDATA_ERROR_CBRESULT;
//}
/*setSaveDataList(saveEntries, (u32)listSet->fixedList.addr(), listSet->fixedListNum);
if (listSet->newData)
addNewSaveDataEntry(saveEntries, (u32)listSet->newData.addr());
if (saveEntries.size() == 0) {
cellSysutil->Warning("cellSaveDataListAutoLoad: No save entries found!"); // TODO: Find a better way to handle this error
return CELL_SAVEDATA_RET_OK;
}
//setSaveDataList(saveEntries, (u32)listSet->fixedList.addr(), listSet->fixedListNum);
//if (listSet->newData)
// addNewSaveDataEntry(saveEntries, (u32)listSet->newData.addr());
//if (saveEntries.size() == 0) {
// cellSysutil->Warning("cellSaveDataListAutoLoad: No save entries found!"); // TODO: Find a better way to handle this error
// return CELL_SAVEDATA_RET_OK;
//}
u32 focusIndex = focusSaveDataEntry(saveEntries, listSet->focusPosition);
// TODO: Display the dialog here
u32 selectedIndex = focusIndex; // TODO: Until the dialog is implemented, select always the focused entry
getSaveDataStat(saveEntries[selectedIndex], statGet.addr());
result->userdata_addr = userdata_addr;
//u32 focusIndex = focusSaveDataEntry(saveEntries, listSet->focusPosition);
//// TODO: Display the dialog here
//u32 selectedIndex = focusIndex; // TODO: Until the dialog is implemented, select always the focused entry
//getSaveDataStat(saveEntries[selectedIndex], statGet.addr());
//result->userdata_addr = userdata_addr;
funcStat(result.addr(), statGet.addr(), statSet.addr());
Memory.Free(statGet->fileList.addr());
//funcStat(result.addr(), statGet.addr(), statSet.addr());
//Memory.Free(statGet->fileList.addr());
if (result->result < 0) {
cellSysutil->Error("cellSaveDataListAutoLoad: CellSaveDataStatCallback failed."); // TODO: Once we verify that the entire SysCall is working, delete this debug error message.
return CELL_SAVEDATA_ERROR_CBRESULT;
}*/
//if (result->result < 0) {
// cellSysutil->Error("cellSaveDataListAutoLoad: CellSaveDataStatCallback failed."); // TODO: Once we verify that the entire SysCall is working, delete this debug error message.
// return CELL_SAVEDATA_ERROR_CBRESULT;
//}
/*if (statSet->setParam)
// TODO: Write PARAM.SFO file
*/
// Enter the loop where the save files are read/created/deleted.
s32 ret = modifySaveDataFiles(funcFile, result, saveBaseDir + (char*)statGet->dir.dirName);
///*if (statSet->setParam)
//// TODO: Write PARAM.SFO file
//*/
//// Enter the loop where the save files are read/created/deleted.
//s32 ret = modifySaveDataFiles(funcFile, result, saveBaseDir + (char*)statGet->dir.dirName);
return CELL_SAVEDATA_RET_OK;
}
int cellSaveDataDelete2() //sys_memory_container_t container
int cellSaveDataDelete2(u32 container)
{
UNIMPLEMENTED_FUNC(cellSysutil);
cellSysutil->Todo("cellSaveDataDelete2(container=0x%x)", container);
return CELL_SAVEDATA_RET_CANCEL;
}
int cellSaveDataFixedDelete() //CellSaveDataSetList *setList, CellSaveDataSetBuf *setBuf, CellSaveDataFixedCallback funcFixed, CellSaveDataDoneCallback funcDone, sys_memory_container_t container, void *userdata
int cellSaveDataFixedDelete(vm::ptr<CellSaveDataSetList> setList, vm::ptr<CellSaveDataSetBuf> setBuf, vm::ptr<CellSaveDataFixedCallback> funcFixed, vm::ptr<CellSaveDataDoneCallback> funcDone,
u32 container, u32 userdata_addr)
{
UNIMPLEMENTED_FUNC(cellSysutil);
cellSysutil->Todo("cellSaveDataFixedDelete(setList=0x%x, setBuf=0x%x, funcFixed=0x%x, funcDone=0x%x, container=0x%x, userdata_addr=0x%x)", setList.addr(), setBuf.addr(), funcFixed.addr(),
funcDone.addr(), container, userdata_addr);
return CELL_SAVEDATA_RET_OK;
}
int cellSaveDataUserListSave() //u32 version, CellSysutilUserId userId, CellSaveDataSetList *setList, CellSaveDataSetBuf *setBuf, CellSaveDataListCallback funcList, CellSaveDataStatCallback funcStat, CellSaveDataFileCallback funcFile, sys_memory_container_t container, void *userdata
int cellSaveDataUserListSave(u32 version, u32 userId, vm::ptr<CellSaveDataSetList> setList, vm::ptr<CellSaveDataSetBuf> setBuf, vm::ptr<CellSaveDataListCallback> funcList,
vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile, u32 container, u32 userdata_addr)
{
UNIMPLEMENTED_FUNC(cellSysutil);
cellSysutil->Todo("cellSaveDataUserListSave(version=%d, userId=%d, setList=0x%x, setBuf=0x%x, funcList=0x%x, funcStat=0x%x, funcFile=0x%x, container=0x%x, userdata_addr=0x%x)", version,
userId, setList.addr(), setBuf.addr(), funcList.addr(), funcStat.addr(), funcFile.addr(), container, userdata_addr);
return CELL_SAVEDATA_RET_OK;
}
int cellSaveDataUserListLoad() //u32 version, CellSysutilUserId userId, CellSaveDataSetList *setList, CellSaveDataSetBuf *setBuf, CellSaveDataListCallback funcList, CellSaveDataStatCallback funcStat, CellSaveDataFileCallback funcFile, sys_memory_container_t container, void *userdata
int cellSaveDataUserListLoad(u32 version, u32 userId, vm::ptr<CellSaveDataSetList> setList, vm::ptr<CellSaveDataSetBuf> setBuf, vm::ptr<CellSaveDataListCallback> funcList,
vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile, u32 container, u32 userdata_addr)
{
UNIMPLEMENTED_FUNC(cellSysutil);
cellSysutil->Todo("cellSaveDataUserListLoad(version=%d, userId=%d, setList=0x%x, setBuf=0x%x, funcList=0x%x, funcStat=0x%x, funcFile=0x%x, container=0x%x, userdata_addr=0x%x)", version,
userId, setList.addr(), setBuf.addr(), funcList.addr(), funcStat.addr(), funcFile.addr(), container, userdata_addr);
return CELL_SAVEDATA_RET_OK;
}
int cellSaveDataUserFixedSave() //u32 version, CellSysutilUserId userId, CellSaveDataSetList *setList, CellSaveDataSetBuf *setBuf, CellSaveDataFixedCallback funcFixed, CellSaveDataStatCallback funcStat, CellSaveDataFileCallback funcFile, sys_memory_container_t container, void *userdata
int cellSaveDataUserFixedSave(u32 version, u32 userId, vm::ptr<CellSaveDataSetList> setList, vm::ptr<CellSaveDataSetBuf> setBuf, vm::ptr<CellSaveDataFixedCallback> funcFixed,
vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile, u32 container, u32 userdata_addr)
{
UNIMPLEMENTED_FUNC(cellSysutil);
cellSysutil->Todo("cellSaveDataUserFixedSave(version=%d, userId=%d, setList=0x%x, setBuf=0x%x, funcFixed=0x%x, funcStat=0x%x, funcFile=0x%x, container=0x%x, userdata_addr=0x%x)", version,
userId, setList.addr(), setBuf.addr(), funcFixed.addr(), funcStat.addr(), funcFile.addr(), container, userdata_addr);
return CELL_SAVEDATA_RET_OK;
}
int cellSaveDataUserFixedLoad() //u32 version, CellSysutilUserId userId, CellSaveDataSetList *setList, CellSaveDataSetBuf *setBuf, CellSaveDataFixedCallback funcFixed, CellSaveDataStatCallback funcStat, CellSaveDataFileCallback funcFile, sys_memory_container_t container, void *userdata
int cellSaveDataUserFixedLoad(u32 version, u32 userId, vm::ptr<CellSaveDataSetList> setList, vm::ptr<CellSaveDataSetBuf> setBuf, vm::ptr<CellSaveDataFixedCallback> funcFixed,
vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile, u32 container, u32 userdata_addr)
{
UNIMPLEMENTED_FUNC(cellSysutil);
cellSysutil->Todo("cellSaveDataUserFixedLoad(version=%d, userId=%d, setList=0x%x, setBuf=0x%x, funcFixed=0x%x, funcStat=0x%x, funcFile=0x%x, container=0x%x, userdata_addr=0x%x)", version,
userId, setList.addr(), setBuf.addr(), funcFixed.addr(), funcStat.addr(), funcFile.addr(), container, userdata_addr);
return CELL_SAVEDATA_RET_OK;
}
int cellSaveDataUserAutoSave() //u32 version, CellSysutilUserId userId, const char *dirName, u32 errDialog, CellSaveDataSetBuf *setBuf, CellSaveDataStatCallback funcStat, CellSaveDataFileCallback funcFile, sys_memory_container_t container, void *userdata
int cellSaveDataUserAutoSave(u32 version, u32 userId, u32 dirName_addr, u32 errDialog, vm::ptr<CellSaveDataSetBuf> setBuf, vm::ptr<CellSaveDataStatCallback> funcStat,
vm::ptr<CellSaveDataFileCallback> funcFile, u32 container, u32 userdata_addr)
{
UNIMPLEMENTED_FUNC(cellSysutil);
cellSysutil->Todo("cellSaveDataUserAutoSave(version=%d, userId=%d, dirName_addr=0x%x, errDialog=%d, setBuf=0x%x, funcStat=0x%x, funcFile=0x%x, container=0x%x, userdata_addr=0x%x)", version,
userId, dirName_addr, errDialog, setBuf.addr(), funcStat.addr(), funcFile.addr(), container, userdata_addr);
return CELL_SAVEDATA_RET_OK;
}
int cellSaveDataUserAutoLoad() //u32 version, CellSysutilUserId userId, const char *dirName, u32 errDialog, CellSaveDataSetBuf *setBuf, CellSaveDataStatCallback funcStat, CellSaveDataFileCallback funcFile, sys_memory_container_t container, void *userdata
int cellSaveDataUserAutoLoad(u32 version, u32 userId, u32 dirName_addr, u32 errDialog, vm::ptr<CellSaveDataSetBuf> setBuf, vm::ptr<CellSaveDataStatCallback> funcStat,
vm::ptr<CellSaveDataFileCallback> funcFile, u32 container, u32 userdata_addr)
{
UNIMPLEMENTED_FUNC(cellSysutil);
cellSysutil->Todo("cellSaveDataUserAutoLoad(version=%d, userId=%d, dirName_addr=0x%x, errDialog=%d, setBuf=0x%x, funcStat=0x%x, funcFile=0x%x, container=0x%x, userdata_addr=0x%x)", version,
userId, dirName_addr, errDialog, setBuf.addr(), funcStat.addr(), funcFile.addr(), container, userdata_addr);
return CELL_SAVEDATA_RET_OK;
}
int cellSaveDataUserListAutoSave() //u32 version, CellSysutilUserId userId, u32 errDialog, CellSaveDataSetList *setList, CellSaveDataSetBuf *setBuf, CellSaveDataFixedCallback funcFixed, CellSaveDataStatCallback funcStat, CellSaveDataFileCallback funcFile, sys_memory_container_t container, void *userdata
int cellSaveDataUserListAutoSave(u32 version, u32 userId, u32 errDialog, vm::ptr<CellSaveDataSetList> setList, vm::ptr<CellSaveDataSetBuf> setBuf, vm::ptr<CellSaveDataFixedCallback> funcFixed,
vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile, u32 container, u32 userdata_addr)
{
UNIMPLEMENTED_FUNC(cellSysutil);
cellSysutil->Todo("cellSaveDataUserListAutoSave(version=%d, userId=%d, errDialog=%d, setList=0x%x, setBuf=0x%x, funcFixed=0x%x, funcStat=0x%x, funcFile=0x%x, container=0x%x, userdata_addr=0x%x)",
version, userId, errDialog, setList.addr(), setBuf.addr(), funcFixed.addr(), funcStat.addr(), funcFile.addr(), container, userdata_addr);
return CELL_SAVEDATA_RET_OK;
}
int cellSaveDataUserListAutoLoad() //u32 version, CellSysutilUserId userId, u32 errDialog, CellSaveDataSetList *setList, CellSaveDataSetBuf *setBuf, CellSaveDataFixedCallback funcFixed, CellSaveDataStatCallback funcStat, CellSaveDataFileCallback funcFile, sys_memory_container_t container, void *userdata
int cellSaveDataUserListAutoLoad(u32 version, u32 userId, u32 errDialog, vm::ptr<CellSaveDataSetList> setList, vm::ptr<CellSaveDataSetBuf> setBuf, vm::ptr<CellSaveDataFixedCallback> funcFixed,
vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile, u32 container, u32 userdata_addr)
{
UNIMPLEMENTED_FUNC(cellSysutil);
cellSysutil->Todo("cellSaveDataUserListAutoLoad(version=%d, userId=%d, errDialog=%D, setList=0x%x, setBuf=0x%x, funcFixed=0x%x, funcStat=0x%x, funcFile=0x%x, container=0x%x, userdata_addr=0x%x)",
version, userId, errDialog, setList.addr(), setBuf.addr(), funcFixed.addr(), funcStat.addr(), funcFile.addr(), container, userdata_addr);
return CELL_SAVEDATA_RET_OK;
}

View File

@ -15,24 +15,36 @@ u32 libsync2;
u32 libsync2_rtoc;
#endif
s64 _cellSync2MutexAttributeInitialize()
s64 _cellSync2MutexAttributeInitialize(vm::ptr<CellSync2MutexAttribute> attr)
{
#ifdef PRX_DEBUG
cellSync2->Warning("%s()", __FUNCTION__);
return GetCurrentPPUThread().FastCall2(libsync2 + 0x16A0, libsync2_rtoc);
#else
UNIMPLEMENTED_FUNC(cellSync2);
cellSync2->Warning("_cellSync2MutexAttributeInitialize(attr_addr=0x%x)", attr.addr());
attr->threadTypes = CELL_SYNC2_THREAD_TYPE_PPU_THREAD | CELL_SYNC2_THREAD_TYPE_PPU_FIBER |
CELL_SYNC2_THREAD_TYPE_SPURS_TASK | CELL_SYNC2_THREAD_TYPE_SPURS_JOB |
CELL_SYNC2_THREAD_TYPE_SPURS_JOBQUEUE_JOB;
attr->maxWaiters = 15;
attr->recursive = false;
strcpy(attr->name, "CellSync2Mutex");
return CELL_OK;
#endif
}
s64 cellSync2MutexEstimateBufferSize()
s64 cellSync2MutexEstimateBufferSize(vm::ptr<CellSync2MutexAttribute> attr, u64 bufferSize)
{
#ifdef PRX_DEBUG
cellSync2->Warning("%s()", __FUNCTION__);
return GetCurrentPPUThread().FastCall2(libsync2 + 0xC3C, libsync2_rtoc);
#else
UNIMPLEMENTED_FUNC(cellSync2);
cellSync2->Todo("cellSync2MutexEstimateBufferSize(attr_addr=0x%x, bufferSize=%d)", attr.addr(), bufferSize);
if (attr->maxWaiters > 32768)
return CELL_SYNC2_ERROR_INVAL;
return CELL_OK;
#endif
}
@ -92,24 +104,32 @@ s64 cellSync2MutexUnlock()
#endif
}
s64 _cellSync2CondAttributeInitialize()
s64 _cellSync2CondAttributeInitialize(vm::ptr<CellSync2CondAttribute> attr)
{
#ifdef PRX_DEBUG
cellSync2->Warning("%s()", __FUNCTION__);
return GetCurrentPPUThread().FastCall2(libsync2 + 0x26DC, libsync2_rtoc);
#else
UNIMPLEMENTED_FUNC(cellSync2);
cellSync2->Warning("_cellSync2CondAttributeInitialize(attr_addr=0x%x)", attr.addr());
attr->maxWaiters = 15;
strcpy(attr->name, "CellSync2Cond");
return CELL_OK;
#endif
}
s64 cellSync2CondEstimateBufferSize()
s64 cellSync2CondEstimateBufferSize(vm::ptr<CellSync2CondAttribute> attr, u64 bufferSize)
{
#ifdef PRX_DEBUG
cellSync2->Warning("%s()", __FUNCTION__);
return GetCurrentPPUThread().FastCall2(libsync2 + 0x1B90, libsync2_rtoc);
#else
UNIMPLEMENTED_FUNC(cellSync2);
cellSync2->Todo("cellSync2MutexEstimateBufferSize(attr_addr=0x%x, bufferSize=%d)", attr.addr(), bufferSize);
if (attr->maxWaiters == 0 || attr->maxWaiters > 32768)
return CELL_SYNC2_ERROR_INVAL;
return CELL_OK;
#endif
}
@ -169,24 +189,35 @@ s64 cellSync2CondSignalAll()
#endif
}
s64 _cellSync2SemaphoreAttributeInitialize()
s64 _cellSync2SemaphoreAttributeInitialize(vm::ptr<CellSync2SemaphoreAttribute> attr)
{
#ifdef PRX_DEBUG
cellSync2->Warning("%s()", __FUNCTION__);
return GetCurrentPPUThread().FastCall2(libsync2 + 0x5644, libsync2_rtoc);
#else
UNIMPLEMENTED_FUNC(cellSync2);
cellSync2->Warning("_cellSync2SemaphoreAttributeInitialize(attr_addr=0x%x)", attr.addr());
attr->threadTypes = CELL_SYNC2_THREAD_TYPE_PPU_THREAD | CELL_SYNC2_THREAD_TYPE_PPU_FIBER |
CELL_SYNC2_THREAD_TYPE_SPURS_TASK | CELL_SYNC2_THREAD_TYPE_SPURS_JOB |
CELL_SYNC2_THREAD_TYPE_SPURS_JOBQUEUE_JOB;
attr->maxWaiters = 1;
strcpy(attr->name, "CellSync2Semaphore");
return CELL_OK;
#endif
}
s64 cellSync2SemaphoreEstimateBufferSize()
s64 cellSync2SemaphoreEstimateBufferSize(vm::ptr<CellSync2SemaphoreAttribute> attr, u64 bufferSize)
{
#ifdef PRX_DEBUG
cellSync2->Warning("%s()", __FUNCTION__);
return GetCurrentPPUThread().FastCall2(libsync2 + 0x4AC4, libsync2_rtoc);
#else
UNIMPLEMENTED_FUNC(cellSync2);
cellSync2->Todo("cellSync2MutexEstimateBufferSize(attr_addr=0x%x, bufferSize=%d)", attr.addr(), bufferSize);
if (attr->maxWaiters == 0 || attr->maxWaiters > 32768)
return CELL_SYNC2_ERROR_INVAL;
return CELL_OK;
#endif
}
@ -257,24 +288,39 @@ s64 cellSync2SemaphoreGetCount()
#endif
}
s64 _cellSync2QueueAttributeInitialize()
s64 _cellSync2QueueAttributeInitialize(vm::ptr<CellSync2QueueAttribute> attr)
{
#ifdef PRX_DEBUG
cellSync2->Warning("%s()", __FUNCTION__);
return GetCurrentPPUThread().FastCall2(libsync2 + 0x3C5C, libsync2_rtoc);
#else
UNIMPLEMENTED_FUNC(cellSync2);
cellSync2->Warning("_cellSync2QueueAttributeInitialize(attr_addr=0x%x)", attr.addr());
attr->threadTypes = CELL_SYNC2_THREAD_TYPE_PPU_THREAD | CELL_SYNC2_THREAD_TYPE_PPU_FIBER |
CELL_SYNC2_THREAD_TYPE_SPURS_TASK | CELL_SYNC2_THREAD_TYPE_SPURS_JOB |
CELL_SYNC2_THREAD_TYPE_SPURS_JOBQUEUE_JOB;
attr->elementSize = 16;
attr->depth = 1024;
attr->maxPushWaiters = 15;
attr->maxPopWaiters = 15;
strcpy(attr->name, "CellSync2Queue");
return CELL_OK;
#endif
}
s64 cellSync2QueueEstimateBufferSize()
s64 cellSync2QueueEstimateBufferSize(vm::ptr<CellSync2QueueAttribute> attr, u64 bufferSize)
{
#ifdef PRX_DEBUG
cellSync2->Warning("%s()", __FUNCTION__);
return GetCurrentPPUThread().FastCall2(libsync2 + 0x2A98, libsync2_rtoc);
#else
UNIMPLEMENTED_FUNC(cellSync2);
cellSync2->Todo("cellSync2MutexEstimateBufferSize(attr_addr=0x%x, bufferSize=%d)", attr.addr(), bufferSize);
if (attr->elementSize == 0 || attr->elementSize > 16384 || !attr->elementSize % 16 || attr->depth == 0 || attr->depth > 4294967292 ||
attr->maxPushWaiters > 32768 || attr->maxPopWaiters > 32768)
return CELL_SYNC2_ERROR_INVAL;
return CELL_OK;
#endif
}

View File

@ -15,4 +15,50 @@ enum
CELL_SYNC2_ERROR_NOT_SUPPORTED_THREAD = 0x80410C12,
CELL_SYNC2_ERROR_NO_NOTIFIER = 0x80410C13,
CELL_SYNC2_ERROR_NO_SPU_CONTEXT_STORAGE = 0x80410C14,
};
// Constants
enum
{
CELL_SYNC2_NAME_MAX_LENGTH = 31,
CELL_SYNC2_THREAD_TYPE_PPU_THREAD = 1 << 0,
CELL_SYNC2_THREAD_TYPE_PPU_FIBER = 1 << 1,
CELL_SYNC2_THREAD_TYPE_SPURS_TASK = 1 << 2,
CELL_SYNC2_THREAD_TYPE_SPURS_JOBQUEUE_JOB = 1 << 3,
CELL_SYNC2_THREAD_TYPE_SPURS_JOB = 1 << 8,
};
struct CellSync2MutexAttribute
{
be_t<u16> threadTypes;
be_t<u16> maxWaiters;
bool recursive;
char name[CELL_SYNC2_NAME_MAX_LENGTH + 1];
u8 reserved[];
};
struct CellSync2CondAttribute
{
be_t<u16> maxWaiters;
char name[CELL_SYNC2_NAME_MAX_LENGTH + 1];
u8 reserved[];
};
struct CellSync2SemaphoreAttribute
{
be_t<u16> threadTypes;
be_t<u16> maxWaiters;
char name[CELL_SYNC2_NAME_MAX_LENGTH + 1];
u8 reserved[];
};
struct CellSync2QueueAttribute
{
be_t<u32> threadTypes;
be_t<u64> elementSize;
be_t<u32> depth;
be_t<u16> maxPushWaiters;
be_t<u16> maxPopWaiters;
char name[CELL_SYNC2_NAME_MAX_LENGTH + 1];
u8 reserved[];
};

View File

@ -31,7 +31,7 @@
#include <wx/msw/wrapwin.h>
#endif
#ifdef __UNIX__
#ifdef __unix__
#include <X11/Xlib.h>
#endif
@ -180,7 +180,7 @@ void Rpcs3App::SendDbgCommand(DbgCommand id, CPUThread* thr)
Rpcs3App::Rpcs3App()
{
#if defined(__UNIX__) && !defined(__APPLE__)
#if defined(__unix__) && !defined(__APPLE__)
XInitThreads();
#endif
}