[Xam/XMP App] - Clean up & improvements

- Clean up xmp app
- XMPGetTitlePlaylistBufferSize now returns proper errors
- Implement XMPGetDashInItState
- Add missing xnotifications
This commit is contained in:
The-Little-Wolf
2025-08-21 16:16:32 -07:00
committed by Radosław Gliński
parent 8545fe755e
commit 41b412fa76
4 changed files with 277 additions and 159 deletions

View File

@@ -51,6 +51,148 @@ struct XMP_SONGINFO {
};
static_assert_size(XMP_SONGINFO, 988);
struct XMP_PLAY_TITLE_PLAYLIST {
xe::be<uint32_t> xmp_client;
xe::be<uint32_t> storage_ptr;
xe::be<uint32_t> song_handle;
};
static_assert_size(XMP_PLAY_TITLE_PLAYLIST, 0xC);
struct XMP_STOP {
xe::be<uint32_t> xmp_client;
xe::be<uint32_t> unk;
};
static_assert_size(XMP_STOP, 0x8);
struct XMP_SET_PLAYBACK_BEHAVIOR {
xe::be<uint32_t> xmp_client;
xe::be<uint32_t> playback_mode;
xe::be<uint32_t> repeat_mode;
xe::be<uint32_t> flags;
};
static_assert_size(XMP_SET_PLAYBACK_BEHAVIOR, 0x10);
struct XMP_GET_STATUS {
xe::be<uint32_t> xmp_client;
xe::be<uint32_t> state_ptr;
};
static_assert_size(XMP_GET_STATUS, 0x8);
struct XMP_GET_VOLUME {
xe::be<uint32_t> xmp_client;
xe::be<uint32_t> volume_ptr;
};
static_assert_size(XMP_GET_VOLUME, 0x8);
struct XMP_SET_VOLUME {
xe::be<uint32_t> xmp_client;
xe::be<uint32_t> value;
};
static_assert_size(XMP_SET_VOLUME, 0x8);
struct XMP_CREATE_TITLE_PLAYLIST {
xe::be<uint32_t> xmp_client;
xe::be<uint32_t> storage_ptr;
xe::be<uint32_t> storage_size;
xe::be<uint32_t> songs_ptr;
xe::be<uint32_t> song_count;
xe::be<uint32_t> playlist_name_ptr;
xe::be<uint32_t> flags;
xe::be<uint32_t> song_handles_ptr;
xe::be<uint32_t> playlist_handle_ptr;
};
static_assert_size(XMP_CREATE_TITLE_PLAYLIST, 0x24);
struct XMP_GET_CURRENT_SONG {
xe::be<uint32_t> xmp_client;
xe::be<uint32_t> unk_ptr;
xe::be<uint32_t> info_ptr;
};
static_assert_size(XMP_GET_CURRENT_SONG, 0xC);
struct XMP_DELETE_TITLE_PLAYLIST {
xe::be<uint32_t> xmp_client;
xe::be<uint32_t> storage_ptr;
};
static_assert_size(XMP_DELETE_TITLE_PLAYLIST, 0x8);
struct XMP_SET_PLAYBACK_CONTROLLER {
xe::be<uint32_t> xmp_client;
xe::be<uint32_t> controller;
xe::be<uint32_t> playback_client;
};
static_assert_size(XMP_SET_PLAYBACK_CONTROLLER, 0xC);
struct XMP_GET_PLAYBACK_CONTROLLER {
xe::be<uint32_t> xmp_client;
xe::be<uint32_t> controller_ptr;
xe::be<uint32_t> locked_ptr;
};
static_assert_size(XMP_GET_PLAYBACK_CONTROLLER, 0xC);
struct XMP_CREATE_USER_PLAYLIST_ENUMERATOR {
xe::be<uint32_t> xmp_client;
xe::be<uint32_t> flags;
xe::be<uint32_t> unk_ptr;
};
static_assert_size(XMP_CREATE_USER_PLAYLIST_ENUMERATOR, 0xC);
struct XMP_GET_PLAYBACK_BEHAVIOR {
xe::be<uint32_t> xmp_client;
xe::be<uint32_t> playback_mode_ptr;
xe::be<uint32_t> repeat_mode_ptr;
xe::be<uint32_t> playback_flags_ptr;
};
static_assert_size(XMP_GET_PLAYBACK_BEHAVIOR, 0x10);
struct XMP_GET_MEDIA_SOURCES {
xe::be<uint32_t> xmp_client;
xe::be<uint32_t> unk1;
xe::be<uint32_t> unk1_ptr;
xe::be<uint32_t> unk2;
xe::be<uint32_t> unk2_ptr;
};
static_assert_size(XMP_GET_MEDIA_SOURCES, 0x14);
struct XMP_GET_TITLE_PLAYLIST_BUFFER_SIZE {
xe::be<uint32_t> xmp_client;
xe::be<uint32_t> song_count;
xe::be<uint32_t> size_ptr;
};
static_assert_size(XMP_GET_TITLE_PLAYLIST_BUFFER_SIZE, 0xC);
struct XMP_DASH_INIT {
xe::be<uint32_t> xmp_client;
xe::be<uint32_t> buffer_ptr; // used by XamEnumerate
xe::be<uint32_t> buffer_length; // used by XamEnumerate
xe::be<uint32_t> unk1;
xe::be<uint32_t> unk2;
xe::be<uint32_t> storage_ptr;
};
static_assert_size(XMP_DASH_INIT, 0x18);
struct XMP_CAPTURE_OUTPUT {
xe::be<uint32_t> xmp_client;
xe::be<uint32_t> callback;
xe::be<uint32_t> context;
xe::be<uint32_t> title_render;
};
static_assert_size(XMP_CAPTURE_OUTPUT, 0x10);
struct XMP_SET_MEDIA_SOURCE_WORKSPACE {
xe::be<uint32_t> xmp_client;
xe::be<uint32_t> unk1;
xe::be<uint32_t> storage_ptr;
xe::be<uint32_t> unk2;
};
static_assert_size(XMP_SET_MEDIA_SOURCE_WORKSPACE, 0x10);
struct XMP_GET_DASH_INIT_STATE {
xe::be<uint32_t> xmp_client;
xe::be<uint32_t> dash_init_state_ptr;
};
static_assert_size(XMP_GET_DASH_INIT_STATE, 0x8);
class XmpApp : public App {
public:
enum class State : uint32_t {
@@ -115,6 +257,9 @@ class XmpApp : public App {
X_HRESULT XMPPause();
X_HRESULT XMPNext();
X_HRESULT XMPPrevious();
X_HRESULT XMPGetTitlePlaylistBufferSize(uint32_t xmp_client,
uint32_t song_count,
uint32_t storage_ptr);
X_HRESULT DispatchMessageSync(uint32_t message, uint32_t buffer_ptr,
uint32_t buffer_length) override;