[XAM] Enable storing IPTV name.
Still needs to be exposed in UI (optional)
This commit is contained in:
@@ -31,6 +31,7 @@ XamState::XamState(Emulator* emulator, KernelState* kernel_state)
|
|||||||
achievement_manager_ = std::make_unique<AchievementManager>();
|
achievement_manager_ = std::make_unique<AchievementManager>();
|
||||||
|
|
||||||
LoadLanguageLocaleFallback();
|
LoadLanguageLocaleFallback();
|
||||||
|
LoadIptvServiceName();
|
||||||
|
|
||||||
AppManager::RegisterApps(kernel_state, app_manager_.get());
|
AppManager::RegisterApps(kernel_state, app_manager_.get());
|
||||||
}
|
}
|
||||||
@@ -60,6 +61,17 @@ void XamState::LoadLanguageLocaleFallback() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void XamState::LoadIptvServiceName() {
|
||||||
|
constexpr uint32_t address = 0x80D10000;
|
||||||
|
|
||||||
|
if (kernel_state_->memory()
|
||||||
|
->LookupHeap(0x80000000)
|
||||||
|
->AllocFixed(address, 0x78, 0x1000, kMemoryAllocationCommit,
|
||||||
|
kMemoryProtectRead | kMemoryProtectWrite)) {
|
||||||
|
iptv_name_address_ = address;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
UserProfile* XamState::GetUserProfile(uint32_t user_index) const {
|
UserProfile* XamState::GetUserProfile(uint32_t user_index) const {
|
||||||
if (user_index >= XUserMaxUserCount && user_index < XUserIndexLatest) {
|
if (user_index >= XUserMaxUserCount && user_index < XUserIndexLatest) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|||||||
@@ -66,6 +66,8 @@ class XamState {
|
|||||||
return language_fallback_address_[index];
|
return language_fallback_address_[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t GetIptvNameAddress() const { return iptv_name_address_; }
|
||||||
|
|
||||||
X_DASH_APP_INFO dash_app_info_ = {};
|
X_DASH_APP_INFO dash_app_info_ = {};
|
||||||
uint32_t dash_backstack_nodes_count_ = 0;
|
uint32_t dash_backstack_nodes_count_ = 0;
|
||||||
X_DASH_BACKSTACK_DATA dash_backstack_data_[2] = {};
|
X_DASH_BACKSTACK_DATA dash_backstack_data_[2] = {};
|
||||||
@@ -76,6 +78,7 @@ class XamState {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void LoadLanguageLocaleFallback();
|
void LoadLanguageLocaleFallback();
|
||||||
|
void LoadIptvServiceName();
|
||||||
|
|
||||||
KernelState* kernel_state_;
|
KernelState* kernel_state_;
|
||||||
|
|
||||||
@@ -89,6 +92,7 @@ class XamState {
|
|||||||
|
|
||||||
// Custom XAM stuff
|
// Custom XAM stuff
|
||||||
std::array<uint32_t, 0x12> language_fallback_address_{};
|
std::array<uint32_t, 0x12> language_fallback_address_{};
|
||||||
|
uint32_t iptv_name_address_{};
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace xam
|
} // namespace xam
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
#include "xenia/base/filesystem.h"
|
#include "xenia/base/filesystem.h"
|
||||||
|
|
||||||
#include "xenia/base/byte_order.h"
|
#include "xenia/base/byte_order.h"
|
||||||
|
#include "xenia/base/string_util.h"
|
||||||
#include "xenia/xbox.h"
|
#include "xenia/xbox.h"
|
||||||
|
|
||||||
#include <ranges>
|
#include <ranges>
|
||||||
@@ -113,6 +114,10 @@ void XConfig::SetDefaults() {
|
|||||||
memcpy(xconfig_data_.user.tz_dlt_date.data(), tz.tz_dlt_date.data(), 4);
|
memcpy(xconfig_data_.user.tz_dlt_date.data(), tz.tz_dlt_date.data(), 4);
|
||||||
xconfig_data_.user.tz_std_bias = tz.tz_std_bias;
|
xconfig_data_.user.tz_std_bias = tz.tz_std_bias;
|
||||||
xconfig_data_.user.tz_dlt_bias = tz.tz_dlt_bias;
|
xconfig_data_.user.tz_dlt_bias = tz.tz_dlt_bias;
|
||||||
|
|
||||||
|
xe::string_util::copy_and_swap_truncating(
|
||||||
|
xconfig_data_.iptv.service_provider_name.data(), u"Xenia TV",
|
||||||
|
xconfig_data_.iptv.service_provider_name.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
void XConfig::FlushToFile() {
|
void XConfig::FlushToFile() {
|
||||||
|
|||||||
@@ -799,7 +799,7 @@ struct XConfigData {
|
|||||||
struct Iptv {
|
struct Iptv {
|
||||||
xe::be<uint32_t> checksum; // 0x000
|
xe::be<uint32_t> checksum; // 0x000
|
||||||
xe::be<uint32_t> version; // 0x004
|
xe::be<uint32_t> version; // 0x004
|
||||||
std::array<uint8_t, 120> service_provider_name; // 0x008 wchar
|
std::array<char16_t, 60> service_provider_name; // 0x008 wchar
|
||||||
std::array<uint8_t, 128> provisioning_server_url; // 0x080 wchar
|
std::array<uint8_t, 128> provisioning_server_url; // 0x080 wchar
|
||||||
std::array<uint8_t, 128> support_info; // 0x100 wchar
|
std::array<uint8_t, 128> support_info; // 0x100 wchar
|
||||||
std::array<uint8_t, 128> bootstrap_server_url; // 0x180 wchar
|
std::array<uint8_t, 128> bootstrap_server_url; // 0x180 wchar
|
||||||
@@ -1033,6 +1033,10 @@ class XConfig {
|
|||||||
// XCONFIG_CONSOLE_PC_TITLE_EXEMPTIONS,
|
// XCONFIG_CONSOLE_PC_TITLE_EXEMPTIONS,
|
||||||
// Console, keyboard_layout),
|
// Console, keyboard_layout),
|
||||||
|
|
||||||
|
// -- XCONFIG_IPTV (0x7) --------------------------------------------
|
||||||
|
XCONFIG_FIELD(XCONFIG_IPTV_CATEGORY, XCONFIG_IPTV_SERVICE_PROVIDER_NAME,
|
||||||
|
Iptv, service_provider_name),
|
||||||
|
|
||||||
// -- XCONFIG_SYSTEM (0xA) ---------------------------------------------
|
// -- XCONFIG_SYSTEM (0xA) ---------------------------------------------
|
||||||
XCONFIG_FIELD(XCONFIG_SYSTEM_CATEGORY, XCONFIG_SYSTEM_ALARM_TIME, System,
|
XCONFIG_FIELD(XCONFIG_SYSTEM_CATEGORY, XCONFIG_SYSTEM_ALARM_TIME, System,
|
||||||
alarm_time),
|
alarm_time),
|
||||||
|
|||||||
Reference in New Issue
Block a user