mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-02-04 12:39:52 +00:00
fix up an issue with sceNpTrophyCreateContext (#2382)
This commit is contained in:
parent
682924b51a
commit
5d705c0e9c
@ -29,14 +29,17 @@ s32 cellGameGetHomeDataImportPath()
|
||||
fmt::throw_exception("Unimplemented" HERE);
|
||||
}
|
||||
|
||||
s32 cellGameGetHomeLaunchOptionPath()
|
||||
s32 cellGameGetHomeLaunchOptionPath(vm::ptr<char> commonPath, vm::ptr<char> personalPath)
|
||||
{
|
||||
fmt::throw_exception("Unimplemented" HERE);
|
||||
cellGameExec.todo("cellGameGetHomeLaunchOptionPath(commonPath=%s, personalPath=%s)", commonPath, personalPath);
|
||||
|
||||
// TODO: PlayStation home is not supported atm.
|
||||
return CELL_GAME_ERROR_NOAPP;
|
||||
}
|
||||
|
||||
s32 cellGameGetBootGameInfo(vm::ptr<u32> type, vm::ptr<char> dirName, vm::ptr<u32> execData)
|
||||
{
|
||||
cellGameExec.todo("cellGameGetBootGameInfo(type=*0x%x, dirName=*0x%x, execData=*0x%x)", type, dirName, execData);
|
||||
cellGameExec.todo("cellGameGetBootGameInfo(type=*0x%x, dirName=%s, execData=*0x%x)", type, dirName, execData);
|
||||
|
||||
// TODO: Support more boot types
|
||||
*type = CELL_GAME_GAMETYPE_SYS;
|
||||
|
@ -92,26 +92,50 @@ s32 sceNpTrophyAbortHandle(u32 handle)
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
void deleteTerminateChar(char* myStr,char _char) {
|
||||
|
||||
char *del = &myStr[strlen(myStr)];
|
||||
|
||||
while (del > myStr && *del != _char)
|
||||
del--;
|
||||
|
||||
if (*del == _char)
|
||||
*del = '\0';
|
||||
|
||||
return;
|
||||
}
|
||||
s32 sceNpTrophyCreateContext(vm::ptr<u32> context, vm::cptr<SceNpCommunicationId> commId, vm::cptr<SceNpCommunicationSignature> commSign, u64 options)
|
||||
{
|
||||
sceNpTrophy.warning("sceNpTrophyCreateContext(context=*0x%x, commId=*0x%x, commSign=*0x%x, options=0x%llx)", context, commId, commSign, options);
|
||||
|
||||
// rough checks for further fmt::format call
|
||||
if (commId->term || commId->num > 99)
|
||||
if (commId->num > 99)
|
||||
{
|
||||
sceNpTrophy.error("sceNpTrophyCreateContext Invalid NP_COMM_ID");
|
||||
return SCE_NP_TROPHY_ERROR_INVALID_NP_COMM_ID;
|
||||
}
|
||||
|
||||
// generate trophy context name
|
||||
std::string name = fmt::format("%s_%02d", commId->data, commId->num);
|
||||
|
||||
std::string name;
|
||||
sceNpTrophy.warning("sceNpTrophyCreateContext term=%s data=%s num=%d", commId->term, commId->data, commId->num);
|
||||
if (commId->term)
|
||||
{
|
||||
char trimchar[9];
|
||||
strcpy(trimchar, commId->data);
|
||||
deleteTerminateChar(trimchar,commId->term);
|
||||
name = fmt::format("%s_%02d", trimchar, commId->num);
|
||||
}
|
||||
else
|
||||
{
|
||||
name = fmt::format("%s_%02d", commId->data,commId->num);
|
||||
}
|
||||
|
||||
// open trophy pack file
|
||||
fs::file stream(vfs::get("/app_home/../TROPDIR/" + name + "/TROPHY.TRP"));
|
||||
|
||||
// check if exists and opened
|
||||
if (!stream)
|
||||
{
|
||||
sceNpTrophy.error("sceNpTrophyCreateContext CONF does not exist");
|
||||
return SCE_NP_TROPHY_ERROR_CONF_DOES_NOT_EXIST;
|
||||
}
|
||||
|
||||
|
@ -31,11 +31,11 @@ void MMJoystickHandler::Init(const u32 max_connect)
|
||||
supportedJoysticks = joyGetNumDevs();
|
||||
if (supportedJoysticks > 0)
|
||||
{
|
||||
LOG_ERROR(HLE, "Driver supports %u joysticks", supportedJoysticks);
|
||||
LOG_NOTICE(GENERAL, "Driver supports %u joysticks", supportedJoysticks);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_ERROR(HLE, "Driver doesn't support Joysticks");
|
||||
LOG_ERROR(GENERAL, "Driver doesn't support Joysticks");
|
||||
}
|
||||
js_info.dwSize = sizeof(js_info);
|
||||
js_info.dwFlags = JOY_RETURNALL;
|
||||
@ -43,8 +43,8 @@ void MMJoystickHandler::Init(const u32 max_connect)
|
||||
bool JoyPresent = (joyGetPosEx(JOYSTICKID1, &js_info) == JOYERR_NOERROR);
|
||||
if (JoyPresent)
|
||||
{
|
||||
LOG_ERROR(HLE, "Found connected joystick with %u buttons", js_caps.wNumButtons);
|
||||
|
||||
LOG_NOTICE(GENERAL, "Found connected joystick with %u buttons and %u axes", js_caps.wNumButtons,js_caps.wNumAxes);
|
||||
LOG_NOTICE(GENERAL, "Axes info %u %u %u %u %u %u %u %u", js_caps.wXmin, js_caps.wXmax,js_caps.wYmin,js_caps.wYmax,js_caps.wZmin,js_caps.wZmax,js_caps.wRmin,js_caps.wRmax);
|
||||
std::memset(&m_info, 0, sizeof m_info);
|
||||
m_info.max_connect = max_connect;
|
||||
|
||||
@ -90,7 +90,7 @@ void MMJoystickHandler::Init(const u32 max_connect)
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_ERROR(HLE, "Joystick not found");
|
||||
LOG_ERROR(GENERAL, "Joystick not found");
|
||||
}
|
||||
}
|
||||
|
||||
@ -102,7 +102,7 @@ void MMJoystickHandler::Close()
|
||||
{
|
||||
active = false;
|
||||
if (WaitForSingleObject(thread, THREAD_TIMEOUT) != WAIT_OBJECT_0)
|
||||
LOG_ERROR(HLE, "MMJoystick thread could not stop within %d milliseconds", (u32)THREAD_TIMEOUT);
|
||||
LOG_ERROR(GENERAL, "MMJoystick thread could not stop within %d milliseconds", (u32)THREAD_TIMEOUT);
|
||||
thread = nullptr;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user