Overhaul logging.
This commit is contained in:
@@ -48,8 +48,8 @@ KernelModule::KernelModule(KernelState* kernel_state,
|
||||
module->SetAddressRange(guest_trampoline_, guest_trampoline_size_);
|
||||
emulator_->processor()->AddModule(std::move(module));
|
||||
} else {
|
||||
XELOGW("KernelModule %s could not allocate trampoline for GetProcAddress!",
|
||||
path.c_str());
|
||||
XELOGW("KernelModule {} could not allocate trampoline for GetProcAddress!",
|
||||
path);
|
||||
}
|
||||
|
||||
OnLoad();
|
||||
@@ -99,7 +99,7 @@ uint32_t KernelModule::GetProcAddressByOrdinal(uint16_t ordinal) {
|
||||
return export_entry->variable_ptr;
|
||||
} else {
|
||||
XELOGW(
|
||||
"ERROR: var export referenced GetProcAddressByOrdinal(%.4X(%s)) is "
|
||||
"ERROR: var export referenced GetProcAddressByOrdinal({:04X}({})) is "
|
||||
"not implemented",
|
||||
ordinal, export_entry->name);
|
||||
return 0;
|
||||
@@ -127,7 +127,7 @@ uint32_t KernelModule::GetProcAddressByOrdinal(uint16_t ordinal) {
|
||||
uint32_t guest_addr =
|
||||
GenerateTrampoline(export_entry->name, handler, export_entry);
|
||||
|
||||
XELOGD("GetProcAddressByOrdinal(\"%s\", \"%s\") = %.8X", name().c_str(),
|
||||
XELOGD("GetProcAddressByOrdinal(\"{}\", \"{}\") = {:08X}", name(),
|
||||
export_entry->name, guest_addr);
|
||||
|
||||
// Register the function in our map.
|
||||
@@ -136,7 +136,7 @@ uint32_t KernelModule::GetProcAddressByOrdinal(uint16_t ordinal) {
|
||||
} else {
|
||||
// Not implemented.
|
||||
XELOGW(
|
||||
"ERROR: fn export referenced GetProcAddressByOrdinal(%.4X(%s)) is "
|
||||
"ERROR: fn export referenced GetProcAddressByOrdinal({:04X}({})) is "
|
||||
"not implemented",
|
||||
ordinal, export_entry->name);
|
||||
return 0;
|
||||
|
||||
@@ -249,7 +249,7 @@ object_ref<XThread> KernelState::LaunchModule(object_ref<UserModule> module) {
|
||||
|
||||
X_STATUS result = thread->Create();
|
||||
if (XFAILED(result)) {
|
||||
XELOGE("Could not create launch thread: %.8X", result);
|
||||
XELOGE("Could not create launch thread: {:08X}", result);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -736,7 +736,7 @@ bool KernelState::Save(ByteStream* stream) {
|
||||
stream->Write(static_cast<uint32_t>(threads.size()));
|
||||
|
||||
size_t num_threads = threads.size();
|
||||
XELOGD("Serializing %d threads...", threads.size());
|
||||
XELOGD("Serializing {} threads...", threads.size());
|
||||
for (auto thread : threads) {
|
||||
if (!thread->is_guest_thread()) {
|
||||
// Don't save host threads. They can be reconstructed on startup.
|
||||
@@ -745,7 +745,7 @@ bool KernelState::Save(ByteStream* stream) {
|
||||
}
|
||||
|
||||
if (!thread->Save(stream)) {
|
||||
XELOGD("Failed to save thread \"%s\"", thread->name().c_str());
|
||||
XELOGD("Failed to save thread \"{}\"", thread->name());
|
||||
num_threads--;
|
||||
}
|
||||
}
|
||||
@@ -759,7 +759,7 @@ bool KernelState::Save(ByteStream* stream) {
|
||||
stream->Write(static_cast<uint32_t>(objects.size()));
|
||||
|
||||
size_t num_objects = objects.size();
|
||||
XELOGD("Serializing %d objects...", num_objects);
|
||||
XELOGD("Serializing {} objects...", num_objects);
|
||||
for (auto object : objects) {
|
||||
auto prev_offset = stream->offset();
|
||||
|
||||
@@ -771,7 +771,7 @@ bool KernelState::Save(ByteStream* stream) {
|
||||
|
||||
stream->Write<uint32_t>(object->type());
|
||||
if (!object->Save(stream)) {
|
||||
XELOGD("Did not save object of type %d", object->type());
|
||||
XELOGD("Did not save object of type {}", object->type());
|
||||
assert_always();
|
||||
|
||||
// Revert backwards and overwrite if a save failed.
|
||||
@@ -802,7 +802,7 @@ bool KernelState::Restore(ByteStream* stream) {
|
||||
}
|
||||
|
||||
uint32_t num_threads = stream->Read<uint32_t>();
|
||||
XELOGD("Loading %d threads...", num_threads);
|
||||
XELOGD("Loading {} threads...", num_threads);
|
||||
for (uint32_t i = 0; i < num_threads; i++) {
|
||||
auto thread = XObject::Restore(this, XObject::kTypeThread, stream);
|
||||
if (!thread) {
|
||||
@@ -813,7 +813,7 @@ bool KernelState::Restore(ByteStream* stream) {
|
||||
}
|
||||
|
||||
uint32_t num_objects = stream->Read<uint32_t>();
|
||||
XELOGD("Loading %d objects...", num_objects);
|
||||
XELOGD("Loading {} objects...", num_objects);
|
||||
for (uint32_t i = 0; i < num_objects; i++) {
|
||||
uint32_t type = stream->Read<uint32_t>();
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ X_STATUS UserModule::LoadFromFile(const std::string_view path) {
|
||||
// TODO(benvanik): make this code shared?
|
||||
auto fs_entry = kernel_state()->file_system()->ResolvePath(path);
|
||||
if (!fs_entry) {
|
||||
XELOGE("File not found: %s", path.c_str());
|
||||
XELOGE("File not found: {}", path);
|
||||
return X_STATUS_NO_SUCH_FILE;
|
||||
}
|
||||
|
||||
@@ -109,17 +109,17 @@ X_STATUS UserModule::LoadFromFile(const std::string_view path) {
|
||||
if (patch_entry) {
|
||||
auto patch_path = patch_entry->absolute_path();
|
||||
|
||||
XELOGI("Loading XEX patch from %s", patch_path.c_str());
|
||||
XELOGI("Loading XEX patch from {}", patch_path);
|
||||
|
||||
auto patch_module = object_ref<UserModule>(new UserModule(kernel_state_));
|
||||
result = patch_module->LoadFromFile(patch_path);
|
||||
if (!result) {
|
||||
result = patch_module->xex_module()->ApplyPatch(xex_module());
|
||||
if (result) {
|
||||
XELOGE("Failed to apply XEX patch, code: %d", result);
|
||||
XELOGE("Failed to apply XEX patch, code: {}", result);
|
||||
}
|
||||
} else {
|
||||
XELOGE("Failed to load XEX patch, code: %d", result);
|
||||
XELOGE("Failed to load XEX patch, code: {}", result);
|
||||
}
|
||||
|
||||
if (result) {
|
||||
@@ -145,7 +145,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: %.8X", magic);
|
||||
XELOGE("Unknown module magic: {:08X}", magic);
|
||||
return X_STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
}
|
||||
@@ -376,8 +376,8 @@ object_ref<UserModule> UserModule::Restore(KernelState* kernel_state,
|
||||
|
||||
auto result = module->LoadFromFile(path);
|
||||
if (XFAILED(result)) {
|
||||
XELOGD("UserModule::Restore LoadFromFile(%s) FAILED - code %.8X",
|
||||
path.c_str(), result);
|
||||
XELOGD("UserModule::Restore LoadFromFile({}) FAILED - code {:08X}", path,
|
||||
result);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -801,7 +801,7 @@ void UserModule::Dump() {
|
||||
sb.Append("\n");
|
||||
}
|
||||
|
||||
xe::LogLine(xe::LogLevel::Info, 'i', sb.to_string_view());
|
||||
xe::logging::AppendLogLine(xe::LogLevel::Info, 'i', sb.to_string_view());
|
||||
}
|
||||
|
||||
} // namespace kernel
|
||||
|
||||
@@ -119,7 +119,7 @@ X_STATUS ObjectTable::AddHandle(XObject* object, X_HANDLE* out_handle) {
|
||||
// Retain so long as the object is in the table.
|
||||
object->Retain();
|
||||
|
||||
XELOGI("Added handle:%08X for %s", handle, typeid(*object).name());
|
||||
XELOGI("Added handle:{:08X} for {}", handle, typeid(*object).name());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@ X_STATUS ObjectTable::RemoveHandle(X_HANDLE handle) {
|
||||
object->handles().erase(handle_entry);
|
||||
}
|
||||
|
||||
XELOGI("Removed handle:%08X for %s", handle, typeid(*object).name());
|
||||
XELOGI("Removed handle:{:08X} for {}", handle, typeid(*object).name());
|
||||
|
||||
// Release now that the object has been removed from the table.
|
||||
object->Release();
|
||||
|
||||
@@ -494,9 +494,11 @@ void PrintKernelCall(cpu::Export* export_entry, const Tuple& params) {
|
||||
AppendKernelCallParams(string_buffer, export_entry, params);
|
||||
string_buffer.Append(')');
|
||||
if (export_entry->tags & xe::cpu::ExportTag::kImportant) {
|
||||
xe::LogLine(xe::LogLevel::Info, 'i', string_buffer.to_string_view());
|
||||
xe::logging::AppendLogLine(xe::LogLevel::Info, 'i',
|
||||
string_buffer.to_string_view());
|
||||
} else {
|
||||
xe::LogLine(xe::LogLevel::Debug, 'd', string_buffer.to_string_view());
|
||||
xe::logging::AppendLogLine(xe::LogLevel::Debug, 'd',
|
||||
string_buffer.to_string_view());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
@@ -31,7 +31,7 @@ void KeCertMonitorCallback(cpu::ppc::PPCContext* ppc_context,
|
||||
kernel::KernelState* kernel_state) {
|
||||
auto id = ppc_context->r[3];
|
||||
auto arg = ppc_context->r[4];
|
||||
XELOGI("KeCertMonitorCallback(%u, %08x)", id, arg);
|
||||
XELOGI("KeCertMonitorCallback({}, {:08X})", id, arg);
|
||||
auto xboxkrnl = kernel_state->GetKernelModule<XboxkrnlModule>("xboxkrnl.exe");
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ void KeDebugMonitorCallback(cpu::ppc::PPCContext* ppc_context,
|
||||
auto id = static_cast<DebugMonitorCommand>(ppc_context->r[3] & 0xFFFFFFFFu);
|
||||
auto arg = static_cast<uint32_t>(ppc_context->r[4] & 0xFFFFFFFFu);
|
||||
|
||||
XELOGI("KeDebugMonitorCallback(%u, %08x)", static_cast<uint32_t>(id), arg);
|
||||
XELOGI("KeDebugMonitorCallback({}, {:08X})", static_cast<uint32_t>(id), arg);
|
||||
|
||||
if (!cvars::kernel_pix) {
|
||||
SHIM_SET_RETURN_32(-1);
|
||||
@@ -55,8 +55,8 @@ void KeDebugMonitorCallback(cpu::ppc::PPCContext* ppc_context,
|
||||
switch (id) {
|
||||
case DebugMonitorCommand::PIXCommandResult: {
|
||||
auto s = kernel_state->memory()->TranslateVirtual<const char*>(arg);
|
||||
debugging::DebugPrint("%s\n", s);
|
||||
XELOGD("PIX command result: %s\n", s);
|
||||
debugging::DebugPrint("{}\n", s);
|
||||
XELOGD("PIX command result: {}\n", s);
|
||||
if (strcmp(s, "PIX!{CaptureFileCreationEnded} 0x00000000") == 0) {
|
||||
xboxkrnl->SendPIXCommand("{BeginCapture}");
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ dword_result_t XMAInitializeContext(lpvoid_t context_ptr,
|
||||
assert_true(input_buffer_0_physical_address != UINT32_MAX);
|
||||
if (input_buffer_0_physical_address == UINT32_MAX) {
|
||||
XELOGE(
|
||||
"XMAInitializeContext: Invalid input buffer 0 virtual address %.8X",
|
||||
"XMAInitializeContext: Invalid input buffer 0 virtual address {:08X}",
|
||||
input_buffer_0_guest_ptr);
|
||||
return X_E_FALSE;
|
||||
}
|
||||
@@ -143,7 +143,7 @@ dword_result_t XMAInitializeContext(lpvoid_t context_ptr,
|
||||
assert_true(input_buffer_1_physical_address != UINT32_MAX);
|
||||
if (input_buffer_1_physical_address == UINT32_MAX) {
|
||||
XELOGE(
|
||||
"XMAInitializeContext: Invalid input buffer 1 virtual address %.8X",
|
||||
"XMAInitializeContext: Invalid input buffer 1 virtual address {:08X}",
|
||||
input_buffer_1_guest_ptr);
|
||||
return X_E_FALSE;
|
||||
}
|
||||
@@ -154,7 +154,7 @@ dword_result_t XMAInitializeContext(lpvoid_t context_ptr,
|
||||
kernel_memory()->GetPhysicalAddress(output_buffer_guest_ptr);
|
||||
assert_true(output_buffer_physical_address != UINT32_MAX);
|
||||
if (output_buffer_physical_address == UINT32_MAX) {
|
||||
XELOGE("XMAInitializeContext: Invalid output buffer virtual address %.8X",
|
||||
XELOGE("XMAInitializeContext: Invalid output buffer virtual address {:08X}",
|
||||
output_buffer_guest_ptr);
|
||||
return X_E_FALSE;
|
||||
}
|
||||
@@ -234,7 +234,7 @@ dword_result_t XMASetInputBuffer0(lpvoid_t context_ptr, lpvoid_t buffer,
|
||||
assert_true(buffer_physical_address != UINT32_MAX);
|
||||
if (buffer_physical_address == UINT32_MAX) {
|
||||
// Xenia-specific safety check.
|
||||
XELOGE("XMASetInputBuffer0: Invalid buffer virtual address %.8X",
|
||||
XELOGE("XMASetInputBuffer0: Invalid buffer virtual address {:08X}",
|
||||
buffer.guest_address());
|
||||
return X_E_FALSE;
|
||||
}
|
||||
@@ -275,7 +275,7 @@ dword_result_t XMASetInputBuffer1(lpvoid_t context_ptr, lpvoid_t buffer,
|
||||
assert_true(buffer_physical_address != UINT32_MAX);
|
||||
if (buffer_physical_address == UINT32_MAX) {
|
||||
// Xenia-specific safety check.
|
||||
XELOGE("XMASetInputBuffer1: Invalid buffer virtual address %.8X",
|
||||
XELOGE("XMASetInputBuffer1: Invalid buffer virtual address {:08X}",
|
||||
buffer.guest_address());
|
||||
return X_E_FALSE;
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ void HandleSetThreadName(pointer_t<X_EXCEPTION_RECORD> record) {
|
||||
}
|
||||
|
||||
if (thread) {
|
||||
XELOGD("SetThreadName(%d, %s)", thread->thread_id(), name);
|
||||
XELOGD("SetThreadName({}, {})", thread->thread_id(), name);
|
||||
thread->set_name(name);
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ DECLARE_XBOXKRNL_EXPORT2(RtlRaiseException, kDebug, kStub, kImportant);
|
||||
|
||||
void KeBugCheckEx(dword_t code, dword_t param1, dword_t param2, dword_t param3,
|
||||
dword_t param4) {
|
||||
XELOGD("*** STOP: 0x%.8X (0x%.8X, 0x%.8X, 0x%.8X, 0x%.8X)", code, param1,
|
||||
XELOGD("*** STOP: {:#08X} ({:#08X}, {:#08X}, {:#08X}, {:#08X})", code, param1,
|
||||
param2, param3, param4);
|
||||
fflush(stdout);
|
||||
xe::debugging::Break();
|
||||
|
||||
@@ -997,7 +997,7 @@ uint32_t xeRtlNtStatusToDosError(uint32_t source_status) {
|
||||
if (!result) {
|
||||
break;
|
||||
}
|
||||
XELOGI("RtlNtStatusToDosError %X => %X", status, result);
|
||||
XELOGI("RtlNtStatusToDosError {:X} => {:X}", status, result);
|
||||
return result;
|
||||
}
|
||||
++error_table;
|
||||
|
||||
@@ -375,7 +375,7 @@ dword_result_t NtSetInformationFile(
|
||||
info = 0;
|
||||
bool delete_on_close =
|
||||
(xe::load_and_swap<uint8_t>(file_info)) ? true : false;
|
||||
XELOGW("NtSetInformationFile ignoring delete on close: %d",
|
||||
XELOGW("NtSetInformationFile ignoring delete on close: {}",
|
||||
delete_on_close);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -160,7 +160,7 @@ dword_result_t NtAllocateVirtualMemory(lpdword_t base_addr_ptr,
|
||||
}
|
||||
}
|
||||
|
||||
XELOGD("NtAllocateVirtualMemory = %.8X", address);
|
||||
XELOGD("NtAllocateVirtualMemory = {:08X}", address);
|
||||
|
||||
// Stash back.
|
||||
// Maybe set X_STATUS_ALREADY_COMMITTED if MEM_COMMIT?
|
||||
@@ -356,7 +356,7 @@ dword_result_t MmAllocatePhysicalMemoryEx(dword_t flags, dword_t region_size,
|
||||
// Failed - assume no memory available.
|
||||
return 0;
|
||||
}
|
||||
XELOGD("MmAllocatePhysicalMemoryEx = %.8X", base_address);
|
||||
XELOGD("MmAllocatePhysicalMemoryEx = {:08X}", base_address);
|
||||
|
||||
return base_address;
|
||||
}
|
||||
|
||||
@@ -65,8 +65,8 @@ bool XboxkrnlModule::SendPIXCommand(const char* cmd) {
|
||||
xe::countof(args));
|
||||
global_lock.lock();
|
||||
|
||||
XELOGD("PIX(command): %s", cmd);
|
||||
XELOGD("PIX(response): %s", response);
|
||||
XELOGD("PIX(command): {}", cmd);
|
||||
XELOGD("PIX(response): {}", response);
|
||||
|
||||
memory_->SystemHeapFree(scratch_ptr);
|
||||
|
||||
|
||||
@@ -830,7 +830,7 @@ SHIM_CALL DbgPrint_shim(PPCContext* ppc_context, KernelState* kernel_state) {
|
||||
return;
|
||||
}
|
||||
|
||||
XELOGD("(DbgPrint) %s", data.str().c_str());
|
||||
XELOGD("(DbgPrint) {}", data.str());
|
||||
|
||||
SHIM_SET_RETURN_32(X_STATUS_SUCCESS);
|
||||
}
|
||||
@@ -841,7 +841,7 @@ SHIM_CALL _snprintf_shim(PPCContext* ppc_context, KernelState* kernel_state) {
|
||||
int32_t buffer_count = SHIM_GET_ARG_32(1);
|
||||
uint32_t format_ptr = SHIM_GET_ARG_32(2);
|
||||
|
||||
XELOGD("_snprintf(%08X, %i, %08X, ...)", buffer_ptr, buffer_count,
|
||||
XELOGD("_snprintf({:08X}, {}, {:08X}, ...)", buffer_ptr, buffer_count,
|
||||
format_ptr);
|
||||
|
||||
if (buffer_ptr == 0 || buffer_count <= 0 || format_ptr == 0) {
|
||||
@@ -877,7 +877,7 @@ SHIM_CALL sprintf_shim(PPCContext* ppc_context, KernelState* kernel_state) {
|
||||
uint32_t buffer_ptr = SHIM_GET_ARG_32(0);
|
||||
uint32_t format_ptr = SHIM_GET_ARG_32(1);
|
||||
|
||||
XELOGD("sprintf(%08X, %08X, ...)", buffer_ptr, format_ptr);
|
||||
XELOGD("sprintf({:08X}, {:08X}, ...)", buffer_ptr, format_ptr);
|
||||
|
||||
if (buffer_ptr == 0 || format_ptr == 0) {
|
||||
SHIM_SET_RETURN_32(-1);
|
||||
@@ -906,7 +906,7 @@ SHIM_CALL _snwprintf_shim(PPCContext* ppc_context, KernelState* kernel_state) {
|
||||
int32_t buffer_count = SHIM_GET_ARG_32(1);
|
||||
uint32_t format_ptr = SHIM_GET_ARG_32(2);
|
||||
|
||||
XELOGD("_snwprintf(%08X, %i, %08X, ...)", buffer_ptr, buffer_count,
|
||||
XELOGD("_snwprintf({:08X}, {}, {:08X}, ...)", buffer_ptr, buffer_count,
|
||||
format_ptr);
|
||||
|
||||
if (buffer_ptr == 0 || buffer_count <= 0 || format_ptr == 0) {
|
||||
@@ -942,7 +942,7 @@ SHIM_CALL swprintf_shim(PPCContext* ppc_context, KernelState* kernel_state) {
|
||||
uint32_t buffer_ptr = SHIM_GET_ARG_32(0);
|
||||
uint32_t format_ptr = SHIM_GET_ARG_32(1);
|
||||
|
||||
XELOGD("swprintf(%08X, %08X, ...)", buffer_ptr, format_ptr);
|
||||
XELOGD("swprintf({:08X}, {:08X}, ...)", buffer_ptr, format_ptr);
|
||||
|
||||
if (buffer_ptr == 0 || format_ptr == 0) {
|
||||
SHIM_SET_RETURN_32(-1);
|
||||
@@ -972,7 +972,7 @@ SHIM_CALL _vsnprintf_shim(PPCContext* ppc_context, KernelState* kernel_state) {
|
||||
uint32_t format_ptr = SHIM_GET_ARG_32(2);
|
||||
uint32_t arg_ptr = SHIM_GET_ARG_32(3);
|
||||
|
||||
XELOGD("_vsnprintf(%08X, %i, %08X, %08X)", buffer_ptr, buffer_count,
|
||||
XELOGD("_vsnprintf({:08X}, {}, {:08X}, {:08X})", buffer_ptr, buffer_count,
|
||||
format_ptr, arg_ptr);
|
||||
|
||||
if (buffer_ptr == 0 || buffer_count <= 0 || format_ptr == 0) {
|
||||
@@ -1012,7 +1012,7 @@ SHIM_CALL _vsnwprintf_shim(PPCContext* ppc_context, KernelState* kernel_state) {
|
||||
uint32_t format_ptr = SHIM_GET_ARG_32(2);
|
||||
uint32_t arg_ptr = SHIM_GET_ARG_32(3);
|
||||
|
||||
XELOGD("_vsnwprintf(%08X, %i, %08X, %08X)", buffer_ptr, buffer_count,
|
||||
XELOGD("_vsnwprintf({:08X}, {}, {:08X}, {:08X})", buffer_ptr, buffer_count,
|
||||
format_ptr, arg_ptr);
|
||||
|
||||
if (buffer_ptr == 0 || buffer_count <= 0 || format_ptr == 0) {
|
||||
@@ -1051,7 +1051,7 @@ SHIM_CALL vsprintf_shim(PPCContext* ppc_context, KernelState* kernel_state) {
|
||||
uint32_t format_ptr = SHIM_GET_ARG_32(1);
|
||||
uint32_t arg_ptr = SHIM_GET_ARG_32(2);
|
||||
|
||||
XELOGD("vsprintf(%08X, %08X, %08X)", buffer_ptr, format_ptr, arg_ptr);
|
||||
XELOGD("vsprintf({:08X}, {:08X}, {:08X})", buffer_ptr, format_ptr, arg_ptr);
|
||||
|
||||
if (buffer_ptr == 0 || format_ptr == 0) {
|
||||
SHIM_SET_RETURN_32(-1);
|
||||
@@ -1079,7 +1079,7 @@ SHIM_CALL _vscwprintf_shim(PPCContext* ppc_context, KernelState* kernel_state) {
|
||||
uint32_t format_ptr = SHIM_GET_ARG_32(0);
|
||||
uint32_t arg_ptr = SHIM_GET_ARG_32(1);
|
||||
|
||||
XELOGD("_vscwprintf(%08X, %08X)", format_ptr, arg_ptr);
|
||||
XELOGD("_vscwprintf({:08X}, {:08X})", format_ptr, arg_ptr);
|
||||
|
||||
if (format_ptr == 0) {
|
||||
SHIM_SET_RETURN_32(-1);
|
||||
|
||||
@@ -129,7 +129,7 @@ dword_result_t ExCreateThread(lpdword_t handle_ptr, dword_t stack_size,
|
||||
X_STATUS result = thread->Create();
|
||||
if (XFAILED(result)) {
|
||||
// Failed!
|
||||
XELOGE("Thread creation failed: %.8X", result);
|
||||
XELOGE("Thread creation failed: {:08X}", result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -872,7 +872,7 @@ DECLARE_XBOXKRNL_EXPORT3(NtSignalAndWaitForSingleObjectEx, kThreading,
|
||||
|
||||
uint32_t xeKeKfAcquireSpinLock(uint32_t* lock) {
|
||||
// XELOGD(
|
||||
// "KfAcquireSpinLock(%.8X)",
|
||||
// "KfAcquireSpinLock({:08X})",
|
||||
// lock_ptr);
|
||||
|
||||
// Lock.
|
||||
|
||||
@@ -370,7 +370,7 @@ void VdSwap(lpvoid_t buffer_ptr, // ptr into primary ringbuffer
|
||||
assert_true(frontbuffer_address != UINT32_MAX);
|
||||
if (frontbuffer_address == UINT32_MAX) {
|
||||
// Xenia-specific safety check.
|
||||
XELOGE("VdSwap: Invalid front buffer virtual address 0x%.8X",
|
||||
XELOGE("VdSwap: Invalid front buffer virtual address {:#08X}",
|
||||
fetch.base_address << 12);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ int32_t XEvent::Reset() {
|
||||
void XEvent::Clear() { event_->Reset(); }
|
||||
|
||||
bool XEvent::Save(ByteStream* stream) {
|
||||
XELOGD("XEvent %.8X (%s)", handle(), manual_reset_ ? "manual" : "auto");
|
||||
XELOGD("XEvent {:08X} ({})", handle(), manual_reset_ ? "manual" : "auto");
|
||||
SaveObject(stream);
|
||||
|
||||
bool signaled = true;
|
||||
|
||||
@@ -226,7 +226,8 @@ void XFile::RemoveIOCompletionPort(uint32_t key) {
|
||||
}
|
||||
|
||||
bool XFile::Save(ByteStream* stream) {
|
||||
XELOGD("XFile %.8X (%s)", handle(), file_->entry()->absolute_path().c_str());
|
||||
XELOGD("XFile {:08X} ({})", handle(),
|
||||
file_->entry()->absolute_path().c_str());
|
||||
|
||||
if (!SaveObject(stream)) {
|
||||
return false;
|
||||
@@ -257,7 +258,7 @@ object_ref<XFile> XFile::Restore(KernelState* kernel_state,
|
||||
auto is_directory = stream->Read<bool>();
|
||||
auto is_synchronous = stream->Read<bool>();
|
||||
|
||||
XELOGD("XFile %.8X (%s)", file->handle(), abs_path.c_str());
|
||||
XELOGD("XFile {:08X} ({})", file->handle(), abs_path);
|
||||
|
||||
vfs::File* vfs_file = nullptr;
|
||||
vfs::FileAction action;
|
||||
@@ -265,7 +266,7 @@ object_ref<XFile> XFile::Restore(KernelState* kernel_state,
|
||||
abs_path, vfs::FileDisposition::kOpen, access, is_directory, &vfs_file,
|
||||
&action);
|
||||
if (XFAILED(res)) {
|
||||
XELOGE("Failed to open XFile: error %.8X", res);
|
||||
XELOGE("Failed to open XFile: error {:08X}", res);
|
||||
return object_ref<XFile>(file);
|
||||
}
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ uint32_t XModule::GetHandleFromHModule(void* hmodule) {
|
||||
}
|
||||
|
||||
bool XModule::Save(ByteStream* stream) {
|
||||
XELOGD("XModule %.8X (%s)", handle(), path().c_str());
|
||||
XELOGD("XModule {:08X} ({})", handle(), path());
|
||||
|
||||
stream->Write('XMOD');
|
||||
|
||||
@@ -99,7 +99,7 @@ object_ref<XModule> XModule::Restore(KernelState* kernel_state,
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
XELOGD("XModule %.8X (%s)", module->handle(), module->path().c_str());
|
||||
XELOGD("XModule {:08X} ({})", module->handle(), module->path());
|
||||
|
||||
module->hmodule_ptr_ = hmodule_ptr;
|
||||
return module;
|
||||
|
||||
@@ -59,7 +59,7 @@ bool XMutant::Save(ByteStream* stream) {
|
||||
|
||||
uint32_t owning_thread_handle = owning_thread_ ? owning_thread_->handle() : 0;
|
||||
stream->Write<uint32_t>(owning_thread_handle);
|
||||
XELOGD("XMutant %.8X (owner: %.8X)", handle(), owning_thread_handle);
|
||||
XELOGD("XMutant {:08X} (owner: {:08X})", handle(), owning_thread_handle);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -57,7 +57,8 @@ bool XSemaphore::Save(ByteStream* stream) {
|
||||
free_count++;
|
||||
}
|
||||
|
||||
XELOGD("XSemaphore %.8X (count %d/%d)", handle(), free_count, maximum_count_);
|
||||
XELOGD("XSemaphore {:08X} (count {}/{})", handle(), free_count,
|
||||
maximum_count_);
|
||||
|
||||
// Restore the semaphore back to its previous count.
|
||||
semaphore_->Release(free_count, nullptr);
|
||||
@@ -79,7 +80,7 @@ object_ref<XSemaphore> XSemaphore::Restore(KernelState* kernel_state,
|
||||
|
||||
sem->maximum_count_ = stream->Read<uint32_t>();
|
||||
auto free_count = stream->Read<uint32_t>();
|
||||
XELOGD("XSemaphore %.8X (count %d/%d)", sem->handle(), free_count,
|
||||
XELOGD("XSemaphore {:08X} (count {}/{})", sem->handle(), free_count,
|
||||
sem->maximum_count_);
|
||||
|
||||
sem->semaphore_ =
|
||||
|
||||
@@ -340,7 +340,7 @@ X_STATUS XThread::Create() {
|
||||
// This is thread safe.
|
||||
thread_state_ = new cpu::ThreadState(kernel_state()->processor(), thread_id_,
|
||||
stack_base_, pcr_address_);
|
||||
XELOGI("XThread%08X (%X) Stack: %.8X-%.8X", handle(), thread_id_,
|
||||
XELOGI("XThread{:08X} ({:X}) Stack: {:08X}-{:08X}", handle(), thread_id_,
|
||||
stack_limit_, stack_base_);
|
||||
|
||||
// Exports use this to get the kernel.
|
||||
@@ -493,8 +493,8 @@ X_STATUS XThread::Terminate(int exit_code) {
|
||||
}
|
||||
|
||||
void XThread::Execute() {
|
||||
XELOGKERNEL("XThread::Execute thid %d (handle=%.8X, '%s', native=%.8X)",
|
||||
thread_id_, handle(), thread_name_.c_str(), thread_->system_id());
|
||||
XELOGKERNEL("XThread::Execute thid {} (handle={:08X}, '{}', native={:08X})",
|
||||
thread_id_, handle(), thread_name_, thread_->system_id());
|
||||
|
||||
// Let the kernel know we are starting.
|
||||
kernel_state()->OnThreadExecute(this);
|
||||
@@ -593,7 +593,7 @@ void XThread::DeliverAPCs() {
|
||||
auto apc = reinterpret_cast<XAPC*>(memory()->TranslateVirtual(apc_ptr));
|
||||
bool needs_freeing = apc->kernel_routine == XAPC::kDummyKernelRoutine;
|
||||
|
||||
XELOGD("Delivering APC to %.8X", uint32_t(apc->normal_routine));
|
||||
XELOGD("Delivering APC to {:08X}", uint32_t(apc->normal_routine));
|
||||
|
||||
// Mark as uninserted so that it can be reinserted again by the routine.
|
||||
apc->enqueued = 0;
|
||||
@@ -636,7 +636,7 @@ void XThread::DeliverAPCs() {
|
||||
LockApc();
|
||||
}
|
||||
|
||||
XELOGD("Completed delivery of APC to %.8X (%.8X, %.8X, %.8X)",
|
||||
XELOGD("Completed delivery of APC to {:08X} ({:08X}, {:08X}, {:08X})",
|
||||
normal_routine, normal_context, arg1, arg2);
|
||||
|
||||
// If special, free it.
|
||||
@@ -852,13 +852,13 @@ bool XThread::Save(ByteStream* stream) {
|
||||
return false;
|
||||
}
|
||||
|
||||
XELOGD("XThread %.8X serializing...", handle());
|
||||
XELOGD("XThread {:08X} serializing...", handle());
|
||||
|
||||
uint32_t pc = 0;
|
||||
if (running_) {
|
||||
pc = emulator()->processor()->StepToGuestSafePoint(thread_id_);
|
||||
if (!pc) {
|
||||
XELOGE("XThread %.8X failed to save: could not step to a safe point!",
|
||||
XELOGE("XThread {:08X} failed to save: could not step to a safe point!",
|
||||
handle());
|
||||
assert_always();
|
||||
return false;
|
||||
@@ -930,7 +930,7 @@ object_ref<XThread> XThread::Restore(KernelState* kernel_state,
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
XELOGD("XThread %.8X", thread->handle());
|
||||
XELOGD("XThread {:08X}", thread->handle());
|
||||
|
||||
thread->thread_name_ = stream->Read<std::string>();
|
||||
|
||||
@@ -1041,8 +1041,8 @@ XHostThread::XHostThread(KernelState* kernel_state, uint32_t stack_size,
|
||||
|
||||
void XHostThread::Execute() {
|
||||
XELOGKERNEL(
|
||||
"XThread::Execute thid %d (handle=%.8X, '%s', native=%.8X, <host>)",
|
||||
thread_id_, handle(), thread_name_.c_str(), thread_->system_id());
|
||||
"XThread::Execute thid {} (handle={:08X}, '{}', native={:08X}, <host>)",
|
||||
thread_id_, handle(), thread_name_, thread_->system_id());
|
||||
|
||||
// Let the kernel know we are starting.
|
||||
kernel_state()->OnThreadExecute(this);
|
||||
|
||||
Reference in New Issue
Block a user