[Kernel] Recording more Xam app messages

- Recording more xam app messages for future reference
- Removed mistakes from messenger_app.h
- Added xime app for future reference
- Added missing buffer_ptr, buffer_length to unknown message id logs
This commit is contained in:
The-Little-Wolf 2024-08-31 23:17:23 -07:00
parent 0deafaf9f9
commit 36d92fad93
10 changed files with 150 additions and 20 deletions

View File

@ -13,6 +13,7 @@
#include "xenia/kernel/xam/apps/messenger_app.h"
#include "xenia/kernel/xam/apps/xam_app.h"
#include "xenia/kernel/xam/apps/xgi_app.h"
#include "xenia/kernel/xam/apps/xime_app.h"
#include "xenia/kernel/xam/apps/xlivebase_app.h"
#include "xenia/kernel/xam/apps/xmp_app.h"
@ -26,6 +27,7 @@ App::App(KernelState* kernel_state, uint32_t app_id)
app_id_(app_id) {}
void AppManager::RegisterApps(KernelState* kernel_state, AppManager* manager) {
manager->RegisterApp(std::make_unique<apps::XimeApp>(kernel_state));
manager->RegisterApp(std::make_unique<apps::MessengerApp>(kernel_state));
manager->RegisterApp(std::make_unique<apps::XmpApp>(kernel_state));
manager->RegisterApp(std::make_unique<apps::XgiApp>(kernel_state));

View File

@ -29,7 +29,8 @@ X_RESULT MessengerApp::DispatchMessageSync(uint32_t message,
case 0x00200002: {
// Used on start in blades dashboard v5759 (marketplace update) and
// possibly to 6717 with netplay
XELOGD("MessengerUnk200002, unimplemented");
XELOGD("MessengerUnk200002({:08X}, {:08X}), unimplemented", buffer_ptr,
buffer_length);
return X_E_FAIL;
}
}

View File

@ -7,8 +7,8 @@
******************************************************************************
*/
#ifndef XENIA_KERNEL_XAM_APPS_UNKNOWN_F7_APP_H_
#define XENIA_KERNEL_XAM_APPS_UNKNOWN_F7_APP_H_
#ifndef XENIA_KERNEL_XAM_APPS_MESSENGER_APP_H_
#define XENIA_KERNEL_XAM_APPS_MESSENGER_APP_H_
#include "xenia/kernel/kernel_state.h"
#include "xenia/kernel/xam/app_manager.h"
@ -31,4 +31,4 @@ class MessengerApp : public App {
} // namespace kernel
} // namespace xe
#endif // XENIA_KERNEL_XAM_APPS_UNKNOWN_FE_APP_H_
#endif XENIA_KERNEL_XAM_APPS_MESSENGER_APP_H_

View File

@ -84,10 +84,6 @@ X_HRESULT XamApp::DispatchMessageSync(uint32_t message, uint32_t buffer_ptr,
(uint32_t)data->unk_48);
return X_E_SUCCESS;
}
case 0x00021012: {
XELOGD("XamApp(0x00021012)");
return X_E_SUCCESS;
}
case 0x00022005: {
struct message_data {
xe::be<uint32_t> deployment_type_ptr;
@ -101,6 +97,13 @@ X_HRESULT XamApp::DispatchMessageSync(uint32_t message, uint32_t buffer_ptr,
data->deployment_type_ptr, data->overlapped_ptr);
return X_E_SUCCESS;
}
case 0x0002B003: {
// Games used in:
// 4D5309C9
XELOGD("XamUnk2B003({:08X}, {:08X}), unimplemented", buffer_ptr,
buffer_length);
return X_E_SUCCESS;
}
}
XELOGE(
"Unimplemented XAM message app={:08X}, msg={:08X}, arg1={:08X}, "

View File

@ -166,13 +166,15 @@ X_HRESULT XgiApp::DispatchMessageSync(uint32_t message, uint32_t buffer_ptr,
// Called after opening xbox live arcade and clicking on xbox live v5759
// to 5787 and called after clicking xbox live in the game library from
// v6683 to v6717
XELOGD("XGIUnkB0036, unimplemented");
XELOGD("XGIUnkB0036({:08X}, {:08X}), unimplemented", buffer_ptr,
buffer_length);
return X_E_FAIL;
}
case 0x000B003D: {
// Games used in:
// - 5451082a (netplay build).
XELOGD("XGIUnkB003D, unimplemented");
XELOGD("XGIUnkB003D({:08X}, {:08X}), unimplemented", buffer_ptr,
buffer_length);
return X_E_FAIL;
}
case 0x000B0041: {
@ -200,7 +202,8 @@ X_HRESULT XgiApp::DispatchMessageSync(uint32_t message, uint32_t buffer_ptr,
return X_E_FAIL;
}
case 0x000B0071: {
XELOGD("XGI 0x000B0071, unimplemented");
XELOGD("XGIUnkB0071({:08X}, {:08X}), unimplemented", buffer_ptr,
buffer_length);
return X_E_SUCCESS;
}
}

View File

@ -0,0 +1,68 @@
/**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2024 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
#include "xenia/kernel/xam/apps/xime_app.h"
#include "xenia/base/logging.h"
#include "xenia/base/threading.h"
namespace xe {
namespace kernel {
namespace xam {
namespace apps {
XimeApp::XimeApp(KernelState* kernel_state) : App(kernel_state, 0xF5) {}
X_RESULT XimeApp::DispatchMessageSync(uint32_t message, uint32_t buffer_ptr,
uint32_t buffer_length) {
// NOTE: buffer_length may be zero or valid.
auto buffer = memory_->TranslateVirtual(buffer_ptr);
switch (message) {
case 0x00400001: {
// XIME_INIT
XELOGD("XimeInit({:08X}, {:08X}), unimplemented", buffer_ptr,
buffer_length);
return X_E_SUCCESS;
}
case 0x00400002: {
// XIME_UNINIT
XELOGD("XimeUninit({:08X}, {:08X}), unimplemented", buffer_ptr,
buffer_length);
return X_E_SUCCESS;
}
case 0x00400003: {
// XIME_SET_PROPERTY
XELOGD("XimeSetProperty({:08X}, {:08X}), unimplemented", buffer_ptr,
buffer_length);
return X_E_SUCCESS;
}
case 0x00400004: {
// XIME_SET_CHARACTER
XELOGD("XimeSetCharacter({:08X}, {:08X}), unimplemented", buffer_ptr,
buffer_length);
return X_E_SUCCESS;
}
case 0x00400005: {
// XIME_GET_STRING
XELOGD("XimeGetString({:08X}, {:08X}), unimplemented", buffer_ptr,
buffer_length);
return X_E_SUCCESS;
}
}
XELOGE(
"Unimplemented Xime message app=%.8X, msg=%.8X, arg1=%.8X, "
"arg2=%.8X",
app_id(), message, buffer_ptr, buffer_length);
return X_STATUS_UNSUCCESSFUL;
}
} // namespace apps
} // namespace xam
} // namespace kernel
} // namespace xe

View File

@ -0,0 +1,34 @@
/**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2024 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
#ifndef XENIA_KERNEL_XAM_APPS_XIME_APP_H_
#define XENIA_KERNEL_XAM_APPS_XIME_APP_H_
#include "xenia/kernel/kernel_state.h"
#include "xenia/kernel/xam/app_manager.h"
namespace xe {
namespace kernel {
namespace xam {
namespace apps {
class XimeApp : public App {
public:
explicit XimeApp(KernelState* kernel_state);
X_RESULT DispatchMessageSync(uint32_t message, uint32_t buffer_ptr,
uint32_t buffer_length) override;
};
} // namespace apps
} // namespace xam
} // namespace kernel
} // namespace xe
#endif XENIA_KERNEL_XAM_APPS_XIME_APP_H_

View File

@ -30,18 +30,21 @@ X_HRESULT XLiveBaseApp::DispatchMessageSync(uint32_t message,
switch (message) {
case 0x0005008C: {
// Called on startup of blades dashboard v1888 to v2858
XELOGD("XLiveBaseUnk5008C, unimplemented");
XELOGD("XLiveBaseUnk5008C({:08X}, {:08X}), unimplemented", buffer_ptr,
buffer_length);
return X_E_FAIL;
}
case 0x00050094: {
// Called on startup of blades dashboard v4532 to v4552
XELOGD("XLiveBaseUnk50094, unimplemented");
XELOGD("XLiveBaseUnk50094({:08X}, {:08X}), unimplemented", buffer_ptr,
buffer_length);
return X_E_FAIL;
}
case 0x00058003: {
// Called on startup of dashboard (netplay build)
XELOGD("XLiveBaseLogonGetHR, unimplemented");
return X_E_SUCCESS;
// Always receives a buffer ptr and buffer length of zero
XELOGD("XLiveBaseLogonGetHR, implemented by netplay build");
return X_ONLINE_E_LOGON_NO_NETWORK_CONNECTION;
}
case 0x00058004: {
// Called on startup, seems to just return a bool in the buffer.

View File

@ -479,7 +479,11 @@ X_HRESULT XmpApp::DispatchMessageSync(uint32_t message, uint32_t buffer_ptr,
case 0x0007002B: {
// Called on the NXE and Kinect dashboard after clicking on the picture,
// video, and music library
XELOGD("XMPUnk7002B, unimplemented");
// XMsgStartIORequest(0xfa,0x7002b,0,&local_30,0x14) at Function_90109D98
// in minimediaplayer.xex 1888 or Function_9210F138 in dash.xex 1888
assert_true(!buffer_length || buffer_length == 20);
XELOGD("XMPUnk7002B({:08X}, {:08X}), unimplemented", buffer_ptr,
buffer_length);
return X_E_FAIL;
}
case 0x0007002E: {
@ -502,7 +506,8 @@ X_HRESULT XmpApp::DispatchMessageSync(uint32_t message, uint32_t buffer_ptr,
}
case 0x0007002F: {
// Called on the start up of all dashboard versions before kinect
XELOGD("XMPUnk7002F, unimplemented");
XELOGD("XMPUnk7002F({:08X}, {:08X}), unimplemented", buffer_ptr,
buffer_length);
return X_E_FAIL;
}
case 0x0007003D: {
@ -514,14 +519,18 @@ X_HRESULT XmpApp::DispatchMessageSync(uint32_t message, uint32_t buffer_ptr,
case 0x00070044: {
// Called on the start up of all dashboard versions before kinect
// When it returns X_E_FAIL you can access the music player up to version
// 5787
XELOGD("XMPUnk70044, unimplemented");
// 5787. XMsgStartIORequest(0xfa,0x70044,0,&local_20,0x10) at (Both 1888)
// Function_90109848 in minimediaplayer.xex or Function_9210E538 in dash
assert_true(!buffer_length || buffer_length == 16);
XELOGD("XMPUnk70044({:08X}, {:08X}), unimplemented", buffer_ptr,
buffer_length);
return X_E_FAIL;
}
case 0x00070053: {
// Called on the blades dashboard after clicking on the picture,
// video, and music library
XELOGD("XMPUnk70053, unimplemented");
XELOGD("XMPUnk70053({:08X}, {:08X}), unimplemented", buffer_ptr,
buffer_length);
return X_E_FAIL;
}
}

View File

@ -109,6 +109,9 @@ typedef uint32_t X_RESULT;
#define X_ERROR_NO_SUCH_USER X_RESULT_FROM_WIN32(0x00000525L)
#define X_ERROR_FUNCTION_FAILED X_RESULT_FROM_WIN32(0x0000065BL)
#define X_ERROR_EMPTY X_RESULT_FROM_WIN32(0x000010D2L)
#define X_ERROR_LOGON_NO_NETWORK_CONNECTION X_RESULT_FROM_WIN32(0x00151000L)
#define X_ERROR_SERVICE_NOT_FOUND X_RESULT_FROM_WIN32(0x00151100L)
#define X_ERROR_CONNECTION_INVALID X_RESULT_FROM_WIN32(0x00151802L)
// HRESULT codes
typedef uint32_t X_HRESULT;
@ -126,6 +129,10 @@ typedef uint32_t X_HRESULT;
#define X_E_NOTFOUND X_HRESULT_FROM_WIN32(X_ERROR_NOT_FOUND)
#define X_E_NO_SUCH_USER X_HRESULT_FROM_WIN32(X_ERROR_NO_SUCH_USER)
#define X_ONLINE_E_LOGON_NO_NETWORK_CONNECTION X_HRESULT_FROM_WIN32(X_ERROR_LOGON_NO_NETWORK_CONNECTION)
#define X_ONLINE_S_LOGON_CONNECTION_ESTABLISHED static_cast<X_HRESULT>(0x001510F0L)
#define X_ONLINE_S_LOGON_DISCONNECTED static_cast<X_HRESULT>(0x001510F1L)
//IOCTL_, used by NtDeviceIoControlFile
constexpr uint32_t X_IOCTL_DISK_GET_DRIVE_GEOMETRY = 0x70000;
constexpr uint32_t X_IOCTL_DISK_GET_PARTITION_INFO = 0x74004;