[3PP] Uplifted FMT version and adjusted messages

This commit is contained in:
Gliniak
2024-12-12 20:28:11 +01:00
parent 41771055f8
commit 3318ab5d4c
30 changed files with 68 additions and 43 deletions

View File

@@ -1069,7 +1069,8 @@ bool KernelState::Save(ByteStream* stream) {
stream->Write<uint32_t>(static_cast<uint32_t>(object->type()));
if (!object->Save(stream)) {
XELOGD("Did not save object of type {}", object->type());
XELOGD("Did not save object of type {}",
static_cast<uint32_t>(object->type()));
assert_always();
// Revert backwards and overwrite if a save failed.

View File

@@ -135,7 +135,7 @@ X_STATUS UserModule::LoadFromMemory(const void* addr, const size_t length) {
XELOGE("XNA executables are not yet implemented");
return X_STATUS_NOT_IMPLEMENTED;
} else {
XELOGE("Unknown module magic: {:08X}", magic);
XELOGE("Unknown module magic: {:08X}", magic.get());
return X_STATUS_NOT_IMPLEMENTED;
}
}
@@ -661,8 +661,8 @@ void UserModule::Dump() {
for (uint32_t i = 0; i < opt_alternate_title_id->count(); i++) {
if (opt_alternate_title_id->values[i] != 0) {
title_ids.append(
fmt::format(" {:08X},", opt_alternate_title_id->values[i]));
title_ids.append(fmt::format(
" {:08X},", opt_alternate_title_id->values[i].get()));
}
}
// Remove last character as it is not necessary

View File

@@ -221,7 +221,7 @@ bool AchievementManager::DoesAchievementExist(
void AchievementManager::ShowAchievementEarnedNotification(
const AchievementGpdStructure* achievement) const {
const std::string description =
fmt::format("{}G - {}", achievement->gamerscore,
fmt::format("{}G - {}", achievement->gamerscore.get(),
xe::to_utf8(xe::load_and_swap<std::u16string>(
achievement->achievement_name.c_str())));

View File

@@ -102,7 +102,7 @@ X_HRESULT XamApp::DispatchMessageSync(uint32_t message, uint32_t buffer_ptr,
memory_->TranslateVirtual<uint32_t*>(data->deployment_type_ptr);
*deployment_type = static_cast<uint32_t>(kernel_state_->deployment_type_);
XELOGD("XTitleGetDeploymentType({:08X}, {:08X}",
data->deployment_type_ptr, data->overlapped_ptr);
data->deployment_type_ptr.get(), data->overlapped_ptr.get());
return X_E_SUCCESS;
}
}

View File

@@ -250,7 +250,8 @@ X_HRESULT XmpApp::DispatchMessageSync(uint32_t message, uint32_t buffer_ptr,
static_assert_size(decltype(*args), 8);
assert_true(args->xmp_client == 0x00000002);
XELOGD("XMPSetVolume({:d}, {:g})", args->xmp_client, float(args->value));
XELOGD("XMPSetVolume({:d}, {:g})", args->xmp_client.get(),
float(args->value));
kernel_state_->emulator()->audio_media_player()->SetVolume(
float(args->value));
return X_E_SUCCESS;
@@ -476,8 +477,8 @@ X_HRESULT XmpApp::DispatchMessageSync(uint32_t message, uint32_t buffer_ptr,
static_assert_size(decltype(*args), 16);
XELOGD("XMPCaptureOutput({:08X}, {:08X}, {:08X}, {:08X})",
args->xmp_client, args->callback, args->context,
args->title_render);
args->xmp_client.get(), args->callback.get(), args->context.get(),
args->title_render.get());
kernel_state_->emulator()->audio_media_player()->SetCaptureCallback(
args->callback, args->context, static_cast<bool>(args->title_render));
return X_E_SUCCESS;

View File

@@ -175,7 +175,7 @@ std::unordered_set<uint32_t> ContentManager::FindPublisherTitleIds(
for (const auto& entry : publisher_entries) {
std::filesystem::path path_to_publisher_dir =
entry.path / entry.name /
fmt::format("{:08X}", XContentType::kPublisher);
fmt::format("{:08X}", static_cast<uint32_t>(XContentType::kPublisher));
if (!std::filesystem::exists(path_to_publisher_dir)) {
continue;

View File

@@ -364,7 +364,9 @@ std::vector<uint64_t> ProfileManager::FindProfiles() const {
if (!std::filesystem::exists(
profile.path / profile.name / kDashboardStringID /
fmt::format("{:08X}", XContentType::kProfile) / profile.name)) {
fmt::format("{:08X}",
static_cast<uint32_t>(XContentType::kProfile)) /
profile.name)) {
XELOGE("Profile {} doesn't have profile package!", profile_xuid);
continue;
}
@@ -444,7 +446,8 @@ std::filesystem::path ProfileManager::GetProfilePath(
std::filesystem::path ProfileManager::GetProfilePath(
const std::string xuid) const {
return kernel_state_->emulator()->content_root() / xuid / kDashboardStringID /
fmt::format("{:08X}", XContentType::kProfile) / xuid;
fmt::format("{:08X}", static_cast<uint32_t>(XContentType::kProfile)) /
xuid;
}
bool ProfileManager::CreateProfile(const std::string gamertag, bool autologin,

View File

@@ -32,6 +32,7 @@
#endif
#include "third_party/fmt/include/fmt/format.h"
#include "third_party/fmt/include/fmt/xchar.h"
DEFINE_int32(avpack, 8,
"Video modes\n"

View File

@@ -25,7 +25,8 @@ dword_result_t XMsgInProcessCall_entry(dword_t app, dword_t message,
auto result = kernel_state()->app_manager()->DispatchMessageSync(app, message,
arg1, arg2);
if (result == X_ERROR_NOT_FOUND) {
XELOGE("XMsgInProcessCall: app {:08X} undefined", app);
XELOGE("XMsgInProcessCall: app {:08X} undefined",
static_cast<uint32_t>(app));
}
return result;
}
@@ -37,7 +38,8 @@ dword_result_t XMsgSystemProcessCall_entry(dword_t app, dword_t message,
auto result = kernel_state()->app_manager()->DispatchMessageAsync(
app, message, buffer, buffer_length);
if (result == X_ERROR_NOT_FOUND) {
XELOGE("XMsgSystemProcessCall: app {:08X} undefined", app);
XELOGE("XMsgSystemProcessCall: app {:08X} undefined",
static_cast<uint32_t>(app));
}
return result;
}

View File

@@ -227,7 +227,8 @@ dword_result_t NetDll_XNetGetOpt_entry(dword_t one, dword_t option_id,
std::memcpy(buffer_ptr, &xnet_startup_params, sizeof(XNetStartupParams));
return 0;
default:
XELOGE("NetDll_XNetGetOpt: option {} unimplemented", option_id);
XELOGE("NetDll_XNetGetOpt: option {} unimplemented",
static_cast<uint32_t>(option_id));
return uint32_t(X_WSAError::X_WSAEINVAL);
}
}

View File

@@ -58,7 +58,7 @@ dword_result_t XamTaskSchedule_entry(lpvoid_t callback,
auto v1 = option->value1;
auto v2 = option->value2; // typically 0?
XELOGI("Got xam task args: v1 = {:08X}, v2 = {:08X}", v1, v2);
XELOGI("Got xam task args: v1 = {:08X}, v2 = {:08X}", v1.get(), v2.get());
}
uint32_t stack_size = kernel_state()->GetExecutableModule()->stack_size();

View File

@@ -781,10 +781,11 @@ dword_result_t XamShowMarketplaceUI_entry(dword_t user_index, dword_t ui_type,
case 1:
desc = fmt::format(
"Game requested to open marketplace page for offer ID 0x{:016X}.",
offer_id);
static_cast<uint32_t>(offer_id));
break;
default:
desc = fmt::format("Unknown marketplace op {:d}", ui_type);
desc = fmt::format("Unknown marketplace op {:d}",
static_cast<uint32_t>(ui_type));
break;
}
@@ -871,7 +872,7 @@ dword_result_t XamShowMarketplaceDownloadItemsUI_entry(
}
for (uint32_t i = 0; i < num_offers; i++) {
desc += fmt::format("\n0x{:16X}", offers[i]);
desc += fmt::format("\n0x{:16X}", offers[i].get());
}
desc +=

View File

@@ -412,7 +412,7 @@ dword_result_t XamUserWriteProfileSettings_entry(
"XamUserWriteProfileSettings: setting index [{}]:"
" from={} setting_id={:08X} data.type={}",
n, (uint32_t)setting.from, (uint32_t)setting.setting_id,
setting.data.type);
static_cast<uint32_t>(setting.data.type));
switch (setting_type) {
case X_USER_DATA_TYPE::CONTENT:
@@ -445,7 +445,7 @@ dword_result_t XamUserWriteProfileSettings_entry(
case X_USER_DATA_TYPE::DATETIME:
default: {
XELOGE("XamUserWriteProfileSettings: Unimplemented data type {}",
setting_type);
static_cast<uint32_t>(setting_type));
} break;
};
}

View File

@@ -148,8 +148,10 @@ DECLARE_XBOXKRNL_EXPORT2(RtlRaiseException, kDebug, kStub, kImportant);
void KeBugCheckEx_entry(dword_t code, dword_t param1, dword_t param2,
dword_t param3, dword_t param4) {
XELOGD("*** STOP: 0x{:08X} (0x{:08X}, 0x{:08X}, 0x{:08X}, 0x{:08X})", code,
param1, param2, param3, param4);
XELOGD("*** STOP: 0x{:08X} (0x{:08X}, 0x{:08X}, 0x{:08X}, 0x{:08X})",
static_cast<uint32_t>(code), static_cast<uint32_t>(param1),
static_cast<uint32_t>(param2), static_cast<uint32_t>(param3),
static_cast<uint32_t>(param4));
fflush(stdout);
xe::debugging::Break();
assert_always();

View File

@@ -229,7 +229,8 @@ dword_result_t XexGetProcedureAddress_entry(lpvoid_t hmodule, dword_t ordinal,
XELOGW(
"ERROR: XexGetProcedureAddress ordinal {} (0x{:X}) in '{}' not "
"found!",
ordinal, ordinal, module->name());
static_cast<uint32_t>(ordinal), static_cast<uint32_t>(ordinal),
module->name());
}
*out_function_ptr = 0;
result = X_STATUS_DRIVER_ENTRYPOINT_NOT_FOUND;