Overhaul logging.

This commit is contained in:
gibbed
2020-02-28 14:30:48 -06:00
committed by Rick Gibbed
parent de3c91ab2c
commit a48bb71c2f
107 changed files with 954 additions and 854 deletions

View File

@@ -36,15 +36,15 @@ X_RESULT UnknownFEApp::DispatchMessageSync(uint32_t message,
assert_true(buffer_length == sizeof(message_data));
auto unk = memory_->TranslateVirtual<xe::be<uint32_t>*>(data->unk_44);
*unk = 0;
XELOGD("UnknownFEApp(0x00020021)('%s', %.8X, %.8X, %.8X)", data->unk_00,
(uint32_t)data->unk_40, (uint32_t)data->unk_44,
XELOGD("UnknownFEApp(0x00020021)('{}', {:08X}, {:08X}, {:08X})",
data->unk_00, (uint32_t)data->unk_40, (uint32_t)data->unk_44,
(uint32_t)data->unk_48);
return X_ERROR_SUCCESS;
}
}
XELOGE(
"Unimplemented 0xFE message app=%.8X, msg=%.8X, arg1=%.8X, "
"arg2=%.8X",
"Unimplemented 0xFE message app={:08X}, msg={:08X}, arg1={:08X}, "
"arg2={:08X}",
app_id(), message, buffer_ptr, buffer_length);
return X_STATUS_UNSUCCESSFUL;
}

View File

@@ -36,8 +36,8 @@ X_RESULT XgiApp::DispatchMessageSync(uint32_t message, uint32_t buffer_ptr,
uint32_t user_index = xe::load_and_swap<uint32_t>(buffer + 0);
uint32_t context_id = xe::load_and_swap<uint32_t>(buffer + 16);
uint32_t context_value = xe::load_and_swap<uint32_t>(buffer + 20);
XELOGD("XGIUserSetContextEx(%.8X, %.8X, %.8X)", user_index, context_id,
context_value);
XELOGD("XGIUserSetContextEx({:08X}, {:08X}, {:08X})", user_index,
context_id, context_value);
return X_ERROR_SUCCESS;
}
case 0x000B0007: {
@@ -45,7 +45,7 @@ X_RESULT XgiApp::DispatchMessageSync(uint32_t message, uint32_t buffer_ptr,
uint32_t property_id = xe::load_and_swap<uint32_t>(buffer + 16);
uint32_t value_size = xe::load_and_swap<uint32_t>(buffer + 20);
uint32_t value_ptr = xe::load_and_swap<uint32_t>(buffer + 24);
XELOGD("XGIUserSetPropertyEx(%.8X, %.8X, %d, %.8X)", user_index,
XELOGD("XGIUserSetPropertyEx({:08X}, {:08X}, {}, {:08X})", user_index,
property_id, value_size, value_ptr);
return X_ERROR_SUCCESS;
}
@@ -53,7 +53,7 @@ X_RESULT XgiApp::DispatchMessageSync(uint32_t message, uint32_t buffer_ptr,
assert_true(!buffer_length || buffer_length == 8);
uint32_t achievement_count = xe::load_and_swap<uint32_t>(buffer + 0);
uint32_t achievements_ptr = xe::load_and_swap<uint32_t>(buffer + 4);
XELOGD("XGIUserWriteAchievements(%.8X, %.8X)", achievement_count,
XELOGD("XGIUserWriteAchievements({:08X}, {:08X})", achievement_count,
achievements_ptr);
return X_ERROR_SUCCESS;
}
@@ -72,9 +72,11 @@ X_RESULT XgiApp::DispatchMessageSync(uint32_t message, uint32_t buffer_ptr,
uint32_t session_info_ptr = xe::load_and_swap<uint32_t>(buffer + 0x14);
uint32_t nonce_ptr = xe::load_and_swap<uint32_t>(buffer + 0x18);
XELOGD("XGISessionCreateImpl(%.8X, %.8X, %d, %d, %.8X, %.8X, %.8X)",
session_ptr, flags, num_slots_public, num_slots_private, user_xuid,
session_info_ptr, nonce_ptr);
XELOGD(
"XGISessionCreateImpl({:08X}, {:08X}, {}, {}, {:08X}, {:08X}, "
"{:08X})",
session_ptr, flags, num_slots_public, num_slots_private, user_xuid,
session_info_ptr, nonce_ptr);
return X_STATUS_SUCCESS;
}
case 0x000B0011: {
@@ -89,7 +91,7 @@ X_RESULT XgiApp::DispatchMessageSync(uint32_t message, uint32_t buffer_ptr,
uint32_t private_slots_array = xe::load_and_swap<uint32_t>(buffer + 0x10);
assert_zero(unk_0);
XELOGD("XGISessionJoinLocal(%.8X, %d, %d, %.8X, %.8X)", session_ptr,
XELOGD("XGISessionJoinLocal({:08X}, {}, {}, {:08X}, {:08X})", session_ptr,
user_count, unk_0, user_index_array, private_slots_array);
return X_STATUS_SUCCESS;
}
@@ -102,8 +104,8 @@ X_RESULT XgiApp::DispatchMessageSync(uint32_t message, uint32_t buffer_ptr,
context_ptr ? memory_->TranslateVirtual(context_ptr) : nullptr;
uint32_t context_id =
context ? xe::load_and_swap<uint32_t>(context + 0) : 0;
XELOGD("XGIUserGetContext(%.8X, %.8X(%.8X))", user_index, context_ptr,
context_id);
XELOGD("XGIUserGetContext({:08X}, {:08X}{:08X}))", user_index,
context_ptr, context_id);
uint32_t value = 0;
if (context) {
xe::store_and_swap<uint32_t>(context + 4, value);
@@ -115,8 +117,10 @@ X_RESULT XgiApp::DispatchMessageSync(uint32_t message, uint32_t buffer_ptr,
return X_ERROR_SUCCESS;
}
}
XELOGE("Unimplemented XGI message app=%.8X, msg=%.8X, arg1=%.8X, arg2=%.8X",
app_id(), message, buffer_ptr, buffer_length);
XELOGE(
"Unimplemented XGI message app={:08X}, msg={:08X}, arg1={:08X}, "
"arg2={:08X}",
app_id(), message, buffer_ptr, buffer_length);
return X_STATUS_UNSUCCESSFUL;
}

View File

@@ -31,13 +31,13 @@ X_RESULT XLiveBaseApp::DispatchMessageSync(uint32_t message,
case 0x00058004: {
// Called on startup, seems to just return a bool in the buffer.
assert_true(!buffer_length || buffer_length == 4);
XELOGD("XLiveBaseGetLogonId(%.8X)", buffer_ptr);
XELOGD("XLiveBaseGetLogonId({:08X})", buffer_ptr);
xe::store_and_swap<uint32_t>(buffer + 0, 1); // ?
return X_ERROR_SUCCESS;
}
case 0x00058006: {
assert_true(!buffer_length || buffer_length == 4);
XELOGD("XLiveBaseGetNatType(%.8X)", buffer_ptr);
XELOGD("XLiveBaseGetNatType({:08X})", buffer_ptr);
xe::store_and_swap<uint32_t>(buffer + 0, 1); // XONLINE_NAT_OPEN
return X_ERROR_SUCCESS;
}
@@ -46,12 +46,12 @@ X_RESULT XLiveBaseApp::DispatchMessageSync(uint32_t message,
// We should create a XamEnumerate-able empty list here, but I'm not
// sure of the format.
// buffer_length seems to be the same ptr sent to 0x00058004.
XELOGD("XLiveBaseFriendsCreateEnumerator(%.8X, %.8X) unimplemented",
XELOGD("XLiveBaseFriendsCreateEnumerator({:08X}, {:08X}) unimplemented",
buffer_ptr, buffer_length);
return X_STATUS_UNSUCCESSFUL;
}
case 0x00058023: {
XELOGD("XliveBaseUnk58023(%.8X, %.8X) unimplemented", buffer_ptr,
XELOGD("XliveBaseUnk58023({:08X}, {:08X}) unimplemented", buffer_ptr,
buffer_length);
return X_STATUS_UNSUCCESSFUL;
}
@@ -59,14 +59,14 @@ X_RESULT XLiveBaseApp::DispatchMessageSync(uint32_t message,
// Required to be successful for Forza 4 to detect signed-in profile
// Doesn't seem to set anything in the given buffer, probably only takes
// input
XELOGD("XLiveBaseUnk58046(%.8X, %.8X) unimplemented", buffer_ptr,
XELOGD("XLiveBaseUnk58046({:08X}, {:08X}) unimplemented", buffer_ptr,
buffer_length);
return X_ERROR_SUCCESS;
}
}
XELOGE(
"Unimplemented XLIVEBASE message app=%.8X, msg=%.8X, arg1=%.8X, "
"arg2=%.8X",
"Unimplemented XLIVEBASE message app={:08X}, msg={:08X}, arg1={:08X}, "
"arg2={:08X}",
app_id(), message, buffer_ptr, buffer_length);
return X_STATUS_UNSUCCESSFUL;
}

View File

@@ -35,7 +35,7 @@ X_RESULT XmpApp::XMPGetStatus(uint32_t state_ptr) {
// here to keep from starving real threads.
xe::threading::Sleep(std::chrono::milliseconds(1));
XELOGD("XMPGetStatus(%.8X)", state_ptr);
XELOGD("XMPGetStatus({:08X})", state_ptr);
xe::store_and_swap<uint32_t>(memory_->TranslateVirtual(state_ptr),
static_cast<uint32_t>(state_));
return X_ERROR_SUCCESS;
@@ -47,10 +47,11 @@ X_RESULT XmpApp::XMPCreateTitlePlaylist(uint32_t songs_ptr, uint32_t song_count,
uint32_t flags,
uint32_t out_song_handles,
uint32_t out_playlist_handle) {
XELOGD("XMPCreateTitlePlaylist(%.8X, %.8X, %.8X(%s), %.8X, %.8X, %.8X)",
songs_ptr, song_count, playlist_name_ptr,
xe::to_utf8(playlist_name).c_str(), flags, out_song_handles,
out_playlist_handle);
XELOGD(
"XMPCreateTitlePlaylist({:08X}, {:08X}, {:08X}({}), {:08X}, {:08X}, "
"{:08X})",
songs_ptr, song_count, playlist_name_ptr, xe::to_utf8(playlist_name),
flags, out_song_handles, out_playlist_handle);
auto playlist = std::make_unique<Playlist>();
playlist->handle = ++next_playlist_handle_;
playlist->name = playlist_name;
@@ -99,7 +100,7 @@ X_RESULT XmpApp::XMPCreateTitlePlaylist(uint32_t songs_ptr, uint32_t song_count,
}
X_RESULT XmpApp::XMPDeleteTitlePlaylist(uint32_t playlist_handle) {
XELOGD("XMPDeleteTitlePlaylist(%.8X)", playlist_handle);
XELOGD("XMPDeleteTitlePlaylist({:08X})", playlist_handle);
auto global_lock = global_critical_region_.Acquire();
auto it = playlists_.find(playlist_handle);
if (it == playlists_.end()) {
@@ -117,13 +118,13 @@ X_RESULT XmpApp::XMPDeleteTitlePlaylist(uint32_t playlist_handle) {
X_RESULT XmpApp::XMPPlayTitlePlaylist(uint32_t playlist_handle,
uint32_t song_handle) {
XELOGD("XMPPlayTitlePlaylist(%.8X, %.8X)", playlist_handle, song_handle);
XELOGD("XMPPlayTitlePlaylist({:08X}, {:08X})", playlist_handle, song_handle);
Playlist* playlist = nullptr;
{
auto global_lock = global_critical_region_.Acquire();
auto it = playlists_.find(playlist_handle);
if (it == playlists_.end()) {
XELOGE("Playlist %.8X not found", playlist_handle);
XELOGE("Playlist {:08X} not found", playlist_handle);
return X_ERROR_NOT_FOUND;
}
playlist = it->second;
@@ -156,7 +157,7 @@ X_RESULT XmpApp::XMPContinue() {
X_RESULT XmpApp::XMPStop(uint32_t unk) {
assert_zero(unk);
XELOGD("XMPStop(%.8X)", unk);
XELOGD("XMPStop({:08X})", unk);
active_playlist_ = nullptr; // ?
active_song_index_ = 0;
state_ = State::kIdle;
@@ -258,7 +259,7 @@ X_RESULT XmpApp::DispatchMessageSync(uint32_t message, uint32_t buffer_ptr,
uint32_t repeat_mode = xe::load_and_swap<uint32_t>(buffer + 8);
uint32_t flags = xe::load_and_swap<uint32_t>(buffer + 12);
assert_true(xmp_client == 0x00000002);
XELOGD("XMPSetPlaybackBehavior(%.8X, %.8X, %.8X)", playback_mode,
XELOGD("XMPSetPlaybackBehavior({:08X}, {:08X}, {:08X})", playback_mode,
repeat_mode, flags);
playback_mode_ = static_cast<PlaybackMode>(playback_mode);
repeat_mode_ = static_cast<RepeatMode>(repeat_mode);
@@ -282,7 +283,7 @@ X_RESULT XmpApp::DispatchMessageSync(uint32_t message, uint32_t buffer_ptr,
}* args = memory_->TranslateVirtual<decltype(args)>(buffer_ptr);
assert_true(args->xmp_client == 0x00000002);
XELOGD("XMPGetVolume(%.8X)", uint32_t(args->volume_ptr));
XELOGD("XMPGetVolume({:08X})", uint32_t(args->volume_ptr));
xe::store_and_swap<float>(memory_->TranslateVirtual(args->volume_ptr),
volume_);
return X_ERROR_SUCCESS;
@@ -292,7 +293,7 @@ X_RESULT XmpApp::DispatchMessageSync(uint32_t message, uint32_t buffer_ptr,
uint32_t xmp_client = xe::load_and_swap<uint32_t>(buffer + 0);
float float_value = xe::load_and_swap<float>(buffer + 4);
assert_true(xmp_client == 0x00000002);
XELOGD("XMPSetVolume(%g)", float_value);
XELOGD("XMPSetVolume({})", float_value);
volume_ = float_value;
return X_ERROR_SUCCESS;
}
@@ -332,7 +333,7 @@ X_RESULT XmpApp::DispatchMessageSync(uint32_t message, uint32_t buffer_ptr,
auto info = memory_->TranslateVirtual(info_ptr);
assert_true(xmp_client == 0x00000002);
assert_zero(unk_ptr);
XELOGE("XMPGetInfo?(%.8X, %.8X)", unk_ptr, info_ptr);
XELOGE("XMPGetInfo?({:08X}, {:08X})", unk_ptr, info_ptr);
if (!active_playlist_) {
return X_STATUS_UNSUCCESSFUL;
}
@@ -370,8 +371,8 @@ X_RESULT XmpApp::DispatchMessageSync(uint32_t message, uint32_t buffer_ptr,
assert_true(args->xmp_client == 0x00000002);
assert_true(args->controller == 0x00000000);
XELOGD("XMPSetPlaybackController(%.8X, %.8X)", uint32_t(args->controller),
uint32_t(args->locked));
XELOGD("XMPSetPlaybackController({:08X}, {:08X})",
uint32_t(args->controller), uint32_t(args->locked));
disabled_ = args->locked;
if (disabled_) {
@@ -390,7 +391,7 @@ X_RESULT XmpApp::DispatchMessageSync(uint32_t message, uint32_t buffer_ptr,
}* args = memory_->TranslateVirtual<decltype(args)>(buffer_ptr);
assert_true(args->xmp_client == 0x00000002);
XELOGD("XMPGetPlaybackController(%.8X, %.8X, %.8X)",
XELOGD("XMPGetPlaybackController({:08X}, {:08X}, {:08X})",
uint32_t(args->xmp_client), uint32_t(args->controller_ptr),
uint32_t(args->locked_ptr));
xe::store_and_swap<uint32_t>(
@@ -410,8 +411,8 @@ X_RESULT XmpApp::DispatchMessageSync(uint32_t message, uint32_t buffer_ptr,
uint32_t repeat_mode_ptr = xe::load_and_swap<uint32_t>(buffer + 8);
uint32_t unk3_ptr = xe::load_and_swap<uint32_t>(buffer + 12);
assert_true(xmp_client == 0x00000002);
XELOGD("XMPGetPlaybackBehavior(%.8X, %.8X, %.8X)", playback_mode_ptr,
repeat_mode_ptr, unk3_ptr);
XELOGD("XMPGetPlaybackBehavior({:08X}, {:08X}, {:08X})",
playback_mode_ptr, repeat_mode_ptr, unk3_ptr);
if (playback_mode_ptr) {
xe::store_and_swap<uint32_t>(
memory_->TranslateVirtual(playback_mode_ptr),
@@ -447,8 +448,10 @@ X_RESULT XmpApp::DispatchMessageSync(uint32_t message, uint32_t buffer_ptr,
return X_STATUS_UNSUCCESSFUL;
}
}
XELOGE("Unimplemented XMP message app=%.8X, msg=%.8X, arg1=%.8X, arg2=%.8X",
app_id(), message, buffer_ptr, buffer_length);
XELOGE(
"Unimplemented XMP message app={:08X}, msg={:08X}, arg1={:08X}, "
"arg2={:08X}",
app_id(), message, buffer_ptr, buffer_length);
return X_STATUS_UNSUCCESSFUL;
}

View File

@@ -189,7 +189,7 @@ dword_result_t XamContentCreateEnumerator(dword_t user_index, dword_t device_id,
content_data.Write(ptr);
}
XELOGD("XamContentCreateEnumerator: added %d items to enumerator",
XELOGD("XamContentCreateEnumerator: added {} items to enumerator",
e->item_count());
*handle_out = e->handle();

View File

@@ -114,8 +114,9 @@ dword_result_t keXamBuildResourceLocator(uint64_t module,
std::u16string path;
if (!module) {
path = fmt::format(u"file://media:/{0}.xzp#{0}", container, resource);
XELOGD("XamBuildResourceLocator(%s) returning locator to local file %s.xzp",
xe::to_utf8(container).c_str(), xe::to_utf8(container).c_str());
XELOGD(
"XamBuildResourceLocator({0}) returning locator to local file {0}.xzp",
xe::to_utf8(container));
} else {
path = fmt::format(u"section://{:X},{}#{}", (uint32_t)module, container,
resource);
@@ -358,8 +359,9 @@ dword_result_t XamEnumerate(dword_t handle, dword_t flags, lpvoid_t buffer,
// Known culprits:
// Final Fight: Double Impact (saves)
XELOGW(
"Broken usage of XamEnumerate! buffer length=%.X vs actual length=%.X "
"(item size=%.X, items per enumerate=%u)",
"Broken usage of XamEnumerate! buffer length={:X} vs actual "
"length={:X} "
"(item size={:X}, items per enumerate={})",
(uint32_t)buffer_length, actual_buffer_length, e->item_size(),
e->items_per_enumerate());
}
@@ -430,4 +432,4 @@ void RegisterInfoExports(xe::cpu::ExportResolver* export_resolver,
} // namespace xam
} // namespace kernel
} // namespace xe
} // namespace xe

View File

@@ -23,7 +23,7 @@ dword_result_t XMsgInProcessCall(dword_t app, dword_t message, dword_t arg1,
auto result = kernel_state()->app_manager()->DispatchMessageSync(app, message,
arg1, arg2);
if (result == X_ERROR_NOT_FOUND) {
XELOGE("XMsgInProcessCall: app %.8X undefined", (uint32_t)app);
XELOGE("XMsgInProcessCall: app {:08X} undefined", app);
}
return result;
}
@@ -34,7 +34,7 @@ dword_result_t XMsgSystemProcessCall(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 %.8X undefined", (uint32_t)app);
XELOGE("XMsgSystemProcessCall: app {:08X} undefined", app);
}
return result;
}
@@ -46,7 +46,7 @@ dword_result_t XMsgStartIORequest(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("XMsgStartIORequest: app %.8X undefined", (uint32_t)app);
XELOGE("XMsgStartIORequest: app {:08X} undefined", app);
}
if (overlapped_ptr) {
kernel_state()->CompleteOverlappedImmediate(overlapped_ptr, result);
@@ -63,7 +63,7 @@ dword_result_t XMsgStartIORequestEx(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("XMsgStartIORequestEx: app %.8X undefined", (uint32_t)app);
XELOGE("XMsgStartIORequestEx: app {:08X} undefined", app);
}
if (overlapped_ptr) {
kernel_state()->CompleteOverlappedImmediate(overlapped_ptr, result);

View File

@@ -196,7 +196,7 @@ dword_result_t NetDll_XNetGetOpt(dword_t one, dword_t option_id,
std::memcpy(buffer_ptr, &xnet_startup_params, sizeof(XNetStartupParams));
return 0;
default:
XELOGE("NetDll_XNetGetOpt: option %d unimplemented", option_id);
XELOGE("NetDll_XNetGetOpt: option {} unimplemented", option_id);
return 0x2726; // WSAEINVAL
}
}
@@ -537,7 +537,7 @@ SHIM_CALL NetDll_XNetQosServiceLookup_shim(PPCContext* ppc_context,
uint32_t event_handle = SHIM_GET_ARG_32(2);
uint32_t out_ptr = SHIM_GET_ARG_32(3);
XELOGD("NetDll_XNetQosServiceLookup(%d, %d, %.8X, %.8X)", caller, zero,
XELOGD("NetDll_XNetQosServiceLookup({}, {}, {:08X}, {:08X})", caller, zero,
event_handle, out_ptr);
// Non-zero is error.

View File

@@ -172,8 +172,9 @@ dword_result_t XamUserReadProfileSettings(
}
} else {
any_missing = true;
XELOGE("XamUserReadProfileSettings requested unimplemented setting %.8X",
setting_id);
XELOGE(
"XamUserReadProfileSettings requested unimplemented setting {:08X}",
setting_id);
}
}
@@ -288,8 +289,8 @@ dword_result_t XamUserWriteProfileSettings(
for (uint32_t n = 0; n < setting_count; ++n) {
const X_USER_WRITE_PROFILE_SETTING& settings_data = settings[n];
XELOGD(
"XamUserWriteProfileSettings: setting index [%d]:"
" from=%d setting_id=%.8X data.type=%d",
"XamUserWriteProfileSettings: setting index [{}]:"
" from={} setting_id={:08X} data.type={}",
n, (uint32_t)settings_data.from, (uint32_t)settings_data.setting_id,
settings_data.type);
@@ -327,7 +328,7 @@ dword_result_t XamUserWriteProfileSettings(
case UserProfile::Setting::Type::DATETIME:
default:
XELOGE("XamUserWriteProfileSettings: Unimplemented data type %d",
XELOGE("XamUserWriteProfileSettings: Unimplemented data type {}",
settingType);
break;
};