From 266504a0ac0b21453e366b7e58af30a119ddef17 Mon Sep 17 00:00:00 2001 From: Jake Date: Fri, 11 Dec 2015 11:09:24 -0600 Subject: [PATCH] CellUser: Fix cellUserInfoGetStat for 'userid_current' --- rpcs3/Emu/SysCalls/Modules/cellUserInfo.cpp | 10 ++++++++-- rpcs3/Emu/SysCalls/Modules/cellUserInfo.h | 6 ++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/rpcs3/Emu/SysCalls/Modules/cellUserInfo.cpp b/rpcs3/Emu/SysCalls/Modules/cellUserInfo.cpp index 4907dca4ab..fd174304ae 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellUserInfo.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellUserInfo.cpp @@ -13,10 +13,16 @@ s32 cellUserInfoGetStat(u32 id, vm::ptr stat) { cellUserInfo.Warning("cellUserInfoGetStat(id=%d, stat=*0x%x)", id, stat); - if (id > CELL_USERINFO_USER_MAX) + if (id > CELL_SYSUTIL_USERID_MAX) return CELL_USERINFO_ERROR_NOUSER; - char path [256]; + if (id == CELL_SYSUTIL_USERID_CURRENT) + { + // TODO: Return current user/profile when that is implemented + id = 1; + } + + char path[256]; sprintf(path, "/dev_hdd0/home/%08d", id); if (!Emu.GetVFS().ExistsDir(path)) return CELL_USERINFO_ERROR_NOUSER; diff --git a/rpcs3/Emu/SysCalls/Modules/cellUserInfo.h b/rpcs3/Emu/SysCalls/Modules/cellUserInfo.h index 33192f4f2b..a06391519c 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellUserInfo.h +++ b/rpcs3/Emu/SysCalls/Modules/cellUserInfo.h @@ -27,6 +27,12 @@ enum CellUserInfoListType CELL_USERINFO_LISTTYPE_NOCURRENT = 1, }; +enum +{ + CELL_SYSUTIL_USERID_CURRENT = 0, + CELL_SYSUTIL_USERID_MAX = 99999999, +}; + // Structs struct CellUserInfoUserStat {