[XAM/User] XamUserCreateTitlesPlayedEnumerator - Skip titles without achievements

It mimics behaviour of real 360 dashboard that
skips info about demos and system apps

also smaller code style changes
This commit is contained in:
Gliniak 2019-12-24 12:27:05 +01:00 committed by illusion
parent 120ce49328
commit a81346ac1e
1 changed files with 22 additions and 19 deletions

View File

@ -9,19 +9,17 @@
#include <cstring>
#include "xenia/base/cvar.h"
#include "xenia/base/logging.h"
#include "xenia/kernel/kernel_state.h"
#include "xenia/kernel/util/shim_utils.h"
#include "xenia/kernel/xam/xam_private.h"
#include "xenia/kernel/xam/xdbf/xdbf.h"
#include "xenia/kernel/xenumerator.h"
#include "xenia/kernel/xthread.h"
#include "xenia/xbox.h"
#include "xenia/kernel/xam/xdbf/xdbf.h"
#include "xenia/base/cvar.h"
DEFINE_bool(signin_state, true,
"User signed in", "Kernel");
DEFINE_bool(signin_state, true, "User signed in", "Kernel");
namespace xe {
namespace kernel {
@ -713,6 +711,11 @@ dword_result_t XamUserCreateTitlesPlayedEnumerator(
if (title.title_id == kDashboardID)
continue;
// TODO: Look for better check to provide information about demo title
// or system title
if (!title.gamerscore_total || !title.achievements_possible)
continue;
auto* details = (xdbf::X_XDBF_GPD_TITLEPLAYED*)e->AppendItem();
details->title_id = title.title_id;
details->achievements_possible = title.achievements_possible;
@ -733,12 +736,12 @@ dword_result_t XamUserCreateTitlesPlayedEnumerator(
return X_ERROR_SUCCESS;
}
DECLARE_XAM_EXPORT1(XamUserCreateTitlesPlayedEnumerator, kUserProfiles, kImplemented);
DECLARE_XAM_EXPORT1(XamUserCreateTitlesPlayedEnumerator, kUserProfiles,
kImplemented);
dword_result_t XamReadTile(dword_t section_id, dword_t game_id, qword_t item_id,
dword_t offset, lpdword_t output_ptr,
lpdword_t buffer_size_ptr,
dword_t overlapped) {
lpdword_t buffer_size_ptr, dword_t overlapped) {
uint32_t buffer_size = buffer_size_ptr ? *buffer_size_ptr : 0;
if (!output_ptr) {
@ -753,7 +756,8 @@ dword_result_t XamReadTile(dword_t section_id, dword_t game_id, qword_t item_id,
}
// Section 2 == images
Entry* entry = game_spa->GetEntry((uint16_t)SpaSection::kImage, item_id.value());
Entry* entry =
game_spa->GetEntry((uint16_t)SpaSection::kImage, item_id.value());
if (!buffer_size) {
buffer_size = entry->info.size;
@ -769,8 +773,8 @@ dword_result_t XamReadTile(dword_t section_id, dword_t game_id, qword_t item_id,
}
DECLARE_XAM_EXPORT1(XamReadTile, kUserProfiles, kSketchy);
dword_result_t XamReadTileEx(dword_t section_id, dword_t game_id, qword_t item_id,
dword_t offset, dword_t unk1,
dword_result_t XamReadTileEx(dword_t section_id, dword_t game_id,
qword_t item_id, dword_t offset, dword_t unk1,
dword_t unk2, lpdword_t output_ptr) {
return XamReadTile(section_id, game_id, item_id, offset, output_ptr, 0, 0);
}
@ -788,6 +792,5 @@ DECLARE_XAM_EXPORT1(XamUserIsOnlineEnabled, kUserProfiles, kStub);
} // namespace kernel
} // namespace xe
void xe::kernel::xam::RegisterUserExports(
xe::cpu::ExportResolver* export_resolver, KernelState* kernel_state) {}