[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

@ -323,7 +323,7 @@ void XmaContextNew::Decode(XMA_CONTEXT_DATA* data) {
"Processing context {} (offset {}, buffer {}, ptr {:p}, output buffer " "Processing context {} (offset {}, buffer {}, ptr {:p}, output buffer "
"{:08X}, output buffer count {})", "{:08X}, output buffer count {})",
id(), data->input_buffer_read_offset, data->current_buffer, id(), data->input_buffer_read_offset, data->current_buffer,
current_input_buffer, data->output_buffer_ptr, static_cast<void*>(current_input_buffer), data->output_buffer_ptr,
data->output_buffer_block_count); data->output_buffer_block_count);
const uint32_t current_input_size = GetCurrentInputBufferSize(data); const uint32_t current_input_size = GetCurrentInputBufferSize(data);

View File

@ -357,7 +357,7 @@ void XmaContextOld::Decode(XMA_CONTEXT_DATA* data) {
"Processing context {} (offset {}, buffer {}, ptr {:p}, output buffer " "Processing context {} (offset {}, buffer {}, ptr {:p}, output buffer "
"{:08X}, output buffer count {})", "{:08X}, output buffer count {})",
id(), data->input_buffer_read_offset, data->current_buffer, id(), data->input_buffer_read_offset, data->current_buffer,
current_input_buffer, data->output_buffer_ptr, static_cast<void*>(current_input_buffer), data->output_buffer_ptr,
data->output_buffer_block_count); data->output_buffer_block_count);
if (is_stream_done_) { if (is_stream_done_) {

View File

@ -465,7 +465,8 @@ bool MMIOHandler::ExceptionCallback(Exception* ex) {
auto p = reinterpret_cast<const uint8_t*>(rip); auto p = reinterpret_cast<const uint8_t*>(rip);
DecodedLoadStore decoded_load_store; DecodedLoadStore decoded_load_store;
if (!TryDecodeLoadStore(p, decoded_load_store)) { if (!TryDecodeLoadStore(p, decoded_load_store)) {
XELOGE("Unable to decode MMIO load or store instruction at {}", p); XELOGE("Unable to decode MMIO load or store instruction at {}",
static_cast<const void*>(p));
assert_always("Unknown MMIO instruction type"); assert_always("Unknown MMIO instruction type");
return false; return false;
} }

View File

@ -20,6 +20,7 @@
#include <utility> #include <utility>
#include "third_party/dxbc/DXBCChecksum.h" #include "third_party/dxbc/DXBCChecksum.h"
#include "third_party/fmt/include/fmt/xchar.h"
#include "xenia/base/assert.h" #include "xenia/base/assert.h"
#include "xenia/base/cvar.h" #include "xenia/base/cvar.h"

View File

@ -43,6 +43,8 @@
#include "xenia/gpu/xenos.h" #include "xenia/gpu/xenos.h"
#include "xenia/ui/d3d12/d3d12_util.h" #include "xenia/ui/d3d12/d3d12_util.h"
#include "third_party/fmt/include/fmt/xchar.h"
DEFINE_bool(d3d12_dxbc_disasm, false, DEFINE_bool(d3d12_dxbc_disasm, false,
"Disassemble DXBC shaders after generation.", "D3D12"); "Disassemble DXBC shaders after generation.", "D3D12");
DEFINE_bool( DEFINE_bool(

View File

@ -1072,8 +1072,9 @@ bool GetResolveInfo(const RegisterFile& regs, const Memory& memory,
"Incorrect resolve sample selected for {}-sample {}: {}, treating like " "Incorrect resolve sample selected for {}-sample {}: {}, treating like "
"{}", "{}",
1 << uint32_t(rb_surface_info.msaa_samples), 1 << uint32_t(rb_surface_info.msaa_samples),
is_depth ? "depth" : "color", rb_copy_control.copy_sample_select, is_depth ? "depth" : "color",
sample_select); static_cast<uint32_t>(rb_copy_control.copy_sample_select),
static_cast<uint32_t>(sample_select));
} }
info_out.copy_dest_coordinate_info.copy_sample_select = sample_select; info_out.copy_dest_coordinate_info.copy_sample_select = sample_select;
// Get the format to pass to the shader in a unified way - for depth (for // Get the format to pass to the shader in a unified way - for depth (for

View File

@ -90,9 +90,9 @@ void COMMAND_PROCESSOR::DisassembleCurrentPacket() XE_RESTRICT {
packet_info.count, packet_info.predicated); packet_info.count, packet_info.predicated);
#define LOG_ACTION_FIELD(__type, name) \ #define LOG_ACTION_FIELD(__type, name) \
logger("\t" #name " = {:08X}\n", action.__type.name) logger("\t" #name " = {:08X}\n", static_cast<uint32_t>(action.__type.name))
#define LOG_ACTION_FIELD_DEC(__type, name) \ #define LOG_ACTION_FIELD_DEC(__type, name) \
logger("\t" #name " = {}\n", action.__type.name) logger("\t" #name " = {}\n", static_cast<size_t>(action.__type.name))
#define LOG_ENDIANNESS(__type, name) \ #define LOG_ENDIANNESS(__type, name) \
logger("\t" #name " = {}\n", \ logger("\t" #name " = {}\n", \

View File

@ -485,9 +485,10 @@ void SDLInputDriver::OnControllerDeviceAdded(const SDL_Event& event) {
"ProductID(0x{:04X}), " "ProductID(0x{:04X}), "
"GUID({})", "GUID({})",
SDL_GameControllerName(controller), SDL_GameControllerName(controller),
SDL_JoystickGetType(SDL_GameControllerGetJoystick(controller)), static_cast<uint32_t>(
SDL_JoystickGetType(SDL_GameControllerGetJoystick(controller))),
#if SDL_VERSION_ATLEAST(2, 0, 12) #if SDL_VERSION_ATLEAST(2, 0, 12)
SDL_GameControllerGetType(controller), static_cast<uint32_t>(SDL_GameControllerGetType(controller)),
#else #else
"?", "?",
#endif #endif

View File

@ -79,7 +79,8 @@ void WinKeyInputDriver::ParseKeyBinding(ui::VirtualKey output_key,
key_bindings_.push_back(key_binding); key_bindings_.push_back(key_binding);
XELOGI("winkey: \"{}\" binds key 0x{:X} to controller input {}.", XELOGI("winkey: \"{}\" binds key 0x{:X} to controller input {}.",
source_token, key_binding.input_key, description); source_token, static_cast<uint16_t>(key_binding.input_key),
description);
} }
} }

View File

@ -1069,7 +1069,8 @@ bool KernelState::Save(ByteStream* stream) {
stream->Write<uint32_t>(static_cast<uint32_t>(object->type())); stream->Write<uint32_t>(static_cast<uint32_t>(object->type()));
if (!object->Save(stream)) { 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(); assert_always();
// Revert backwards and overwrite if a save failed. // 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"); XELOGE("XNA executables are not yet implemented");
return X_STATUS_NOT_IMPLEMENTED; return X_STATUS_NOT_IMPLEMENTED;
} else { } else {
XELOGE("Unknown module magic: {:08X}", magic); XELOGE("Unknown module magic: {:08X}", magic.get());
return X_STATUS_NOT_IMPLEMENTED; return X_STATUS_NOT_IMPLEMENTED;
} }
} }
@ -661,8 +661,8 @@ void UserModule::Dump() {
for (uint32_t i = 0; i < opt_alternate_title_id->count(); i++) { for (uint32_t i = 0; i < opt_alternate_title_id->count(); i++) {
if (opt_alternate_title_id->values[i] != 0) { if (opt_alternate_title_id->values[i] != 0) {
title_ids.append( title_ids.append(fmt::format(
fmt::format(" {:08X},", opt_alternate_title_id->values[i])); " {:08X},", opt_alternate_title_id->values[i].get()));
} }
} }
// Remove last character as it is not necessary // Remove last character as it is not necessary

View File

@ -221,7 +221,7 @@ bool AchievementManager::DoesAchievementExist(
void AchievementManager::ShowAchievementEarnedNotification( void AchievementManager::ShowAchievementEarnedNotification(
const AchievementGpdStructure* achievement) const { const AchievementGpdStructure* achievement) const {
const std::string description = const std::string description =
fmt::format("{}G - {}", achievement->gamerscore, fmt::format("{}G - {}", achievement->gamerscore.get(),
xe::to_utf8(xe::load_and_swap<std::u16string>( xe::to_utf8(xe::load_and_swap<std::u16string>(
achievement->achievement_name.c_str()))); 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); memory_->TranslateVirtual<uint32_t*>(data->deployment_type_ptr);
*deployment_type = static_cast<uint32_t>(kernel_state_->deployment_type_); *deployment_type = static_cast<uint32_t>(kernel_state_->deployment_type_);
XELOGD("XTitleGetDeploymentType({:08X}, {:08X}", XELOGD("XTitleGetDeploymentType({:08X}, {:08X}",
data->deployment_type_ptr, data->overlapped_ptr); data->deployment_type_ptr.get(), data->overlapped_ptr.get());
return X_E_SUCCESS; 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); static_assert_size(decltype(*args), 8);
assert_true(args->xmp_client == 0x00000002); 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( kernel_state_->emulator()->audio_media_player()->SetVolume(
float(args->value)); float(args->value));
return X_E_SUCCESS; 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); static_assert_size(decltype(*args), 16);
XELOGD("XMPCaptureOutput({:08X}, {:08X}, {:08X}, {:08X})", XELOGD("XMPCaptureOutput({:08X}, {:08X}, {:08X}, {:08X})",
args->xmp_client, args->callback, args->context, args->xmp_client.get(), args->callback.get(), args->context.get(),
args->title_render); args->title_render.get());
kernel_state_->emulator()->audio_media_player()->SetCaptureCallback( kernel_state_->emulator()->audio_media_player()->SetCaptureCallback(
args->callback, args->context, static_cast<bool>(args->title_render)); args->callback, args->context, static_cast<bool>(args->title_render));
return X_E_SUCCESS; return X_E_SUCCESS;

View File

@ -175,7 +175,7 @@ std::unordered_set<uint32_t> ContentManager::FindPublisherTitleIds(
for (const auto& entry : publisher_entries) { for (const auto& entry : publisher_entries) {
std::filesystem::path path_to_publisher_dir = std::filesystem::path path_to_publisher_dir =
entry.path / entry.name / 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)) { if (!std::filesystem::exists(path_to_publisher_dir)) {
continue; continue;

View File

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

View File

@ -32,6 +32,7 @@
#endif #endif
#include "third_party/fmt/include/fmt/format.h" #include "third_party/fmt/include/fmt/format.h"
#include "third_party/fmt/include/fmt/xchar.h"
DEFINE_int32(avpack, 8, DEFINE_int32(avpack, 8,
"Video modes\n" "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, auto result = kernel_state()->app_manager()->DispatchMessageSync(app, message,
arg1, arg2); arg1, arg2);
if (result == X_ERROR_NOT_FOUND) { if (result == X_ERROR_NOT_FOUND) {
XELOGE("XMsgInProcessCall: app {:08X} undefined", app); XELOGE("XMsgInProcessCall: app {:08X} undefined",
static_cast<uint32_t>(app));
} }
return result; return result;
} }
@ -37,7 +38,8 @@ dword_result_t XMsgSystemProcessCall_entry(dword_t app, dword_t message,
auto result = kernel_state()->app_manager()->DispatchMessageAsync( auto result = kernel_state()->app_manager()->DispatchMessageAsync(
app, message, buffer, buffer_length); app, message, buffer, buffer_length);
if (result == X_ERROR_NOT_FOUND) { if (result == X_ERROR_NOT_FOUND) {
XELOGE("XMsgSystemProcessCall: app {:08X} undefined", app); XELOGE("XMsgSystemProcessCall: app {:08X} undefined",
static_cast<uint32_t>(app));
} }
return result; 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)); std::memcpy(buffer_ptr, &xnet_startup_params, sizeof(XNetStartupParams));
return 0; return 0;
default: 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); 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 v1 = option->value1;
auto v2 = option->value2; // typically 0? 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(); 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: case 1:
desc = fmt::format( desc = fmt::format(
"Game requested to open marketplace page for offer ID 0x{:016X}.", "Game requested to open marketplace page for offer ID 0x{:016X}.",
offer_id); static_cast<uint32_t>(offer_id));
break; break;
default: default:
desc = fmt::format("Unknown marketplace op {:d}", ui_type); desc = fmt::format("Unknown marketplace op {:d}",
static_cast<uint32_t>(ui_type));
break; break;
} }
@ -871,7 +872,7 @@ dword_result_t XamShowMarketplaceDownloadItemsUI_entry(
} }
for (uint32_t i = 0; i < num_offers; i++) { 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 += desc +=

View File

@ -412,7 +412,7 @@ dword_result_t XamUserWriteProfileSettings_entry(
"XamUserWriteProfileSettings: setting index [{}]:" "XamUserWriteProfileSettings: setting index [{}]:"
" from={} setting_id={:08X} data.type={}", " from={} setting_id={:08X} data.type={}",
n, (uint32_t)setting.from, (uint32_t)setting.setting_id, n, (uint32_t)setting.from, (uint32_t)setting.setting_id,
setting.data.type); static_cast<uint32_t>(setting.data.type));
switch (setting_type) { switch (setting_type) {
case X_USER_DATA_TYPE::CONTENT: case X_USER_DATA_TYPE::CONTENT:
@ -445,7 +445,7 @@ dword_result_t XamUserWriteProfileSettings_entry(
case X_USER_DATA_TYPE::DATETIME: case X_USER_DATA_TYPE::DATETIME:
default: { default: {
XELOGE("XamUserWriteProfileSettings: Unimplemented data type {}", XELOGE("XamUserWriteProfileSettings: Unimplemented data type {}",
setting_type); static_cast<uint32_t>(setting_type));
} break; } 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, void KeBugCheckEx_entry(dword_t code, dword_t param1, dword_t param2,
dword_t param3, dword_t param4) { dword_t param3, dword_t param4) {
XELOGD("*** STOP: 0x{:08X} (0x{:08X}, 0x{:08X}, 0x{:08X}, 0x{:08X})", code, XELOGD("*** STOP: 0x{:08X} (0x{:08X}, 0x{:08X}, 0x{:08X}, 0x{:08X})",
param1, param2, param3, param4); 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); fflush(stdout);
xe::debugging::Break(); xe::debugging::Break();
assert_always(); assert_always();

View File

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

View File

@ -647,8 +647,10 @@ void Memory::DumpMap() {
XELOGE(" System Page Size: {0} ({0:08X})", system_page_size_); XELOGE(" System Page Size: {0} ({0:08X})", system_page_size_);
XELOGE(" System Allocation Granularity: {0} ({0:08X})", XELOGE(" System Allocation Granularity: {0} ({0:08X})",
system_allocation_granularity_); system_allocation_granularity_);
XELOGE(" Virtual Membase: {}", virtual_membase_); XELOGE(" Virtual Membase: {}",
XELOGE(" Physical Membase: {}", physical_membase_); static_cast<void*>(virtual_membase_));
XELOGE(" Physical Membase: {}",
static_cast<void*>(physical_membase_));
XELOGE(""); XELOGE("");
XELOGE("------------------------------------------------------------------"); XELOGE("------------------------------------------------------------------");
XELOGE("Virtual Heaps"); XELOGE("Virtual Heaps");

View File

@ -41,13 +41,14 @@ bool DiscImageDevice::Initialize() {
state.size = mmap_->size(); state.size = mmap_->size();
auto result = Verify(&state); auto result = Verify(&state);
if (result != Error::kSuccess) { if (result != Error::kSuccess) {
XELOGE("Failed to verify disc image header: {}", result); XELOGE("Failed to verify disc image header: {}",
static_cast<int32_t>(result));
return false; return false;
} }
result = ReadAllEntries(&state, state.ptr + state.root_offset); result = ReadAllEntries(&state, state.ptr + state.root_offset);
if (result != Error::kSuccess) { if (result != Error::kSuccess) {
XELOGE("Failed to read all GDFX entries: {}", result); XELOGE("Failed to read all GDFX entries: {}", static_cast<int32_t>(result));
return false; return false;
} }

View File

@ -93,7 +93,8 @@ bool XContentContainerDevice::Initialize() {
auto header_loading_result = ReadHeaderAndVerify(header_file); auto header_loading_result = ReadHeaderAndVerify(header_file);
if (header_loading_result != Result::kSuccess) { if (header_loading_result != Result::kSuccess) {
XELOGE("Error reading XContent header: {}", header_loading_result); XELOGE("Error reading XContent header: {}",
static_cast<int32_t>(header_loading_result));
fclose(header_file); fclose(header_file);
return false; return false;
} }

View File

@ -158,8 +158,8 @@ std::unique_ptr<XContentContainerEntry> StfsContainerDevice::ReadEntry(
XELOGW( XELOGW(
"STFS file {} only found {} bytes for file, expected {} ({} " "STFS file {} only found {} bytes for file, expected {} ({} "
"bytes missing)", "bytes missing)",
name, dir_entry->length - remaining_size, dir_entry->length, name, dir_entry->length.get() - remaining_size,
remaining_size); dir_entry->length.get(), remaining_size);
assert_always(); assert_always();
} }

View File

@ -47,7 +47,8 @@ SvodContainerDevice::Result SvodContainerDevice::LoadHostFiles(
if (fragment_files.size() != header_->content_metadata.data_file_count) { if (fragment_files.size() != header_->content_metadata.data_file_count) {
XELOGE("SVOD expecting {} data fragments, but {} are present.", XELOGE("SVOD expecting {} data fragments, but {} are present.",
header_->content_metadata.data_file_count, fragment_files.size()); header_->content_metadata.data_file_count.get(),
fragment_files.size());
return Result::kFileMismatch; return Result::kFileMismatch;
} }

2
third_party/fmt vendored

@ -1 +1 @@
Subproject commit 7bdf0628b1276379886c7f6dda2cef2b3b374f0b Subproject commit 0c9fce2ffefecfdce794e1859584e25877b7b592