Skip to content

Xbox Cloud Gaming app for PS5 Homebrew

C

My consoles: play your own Xbox (Remote Play)

Rafael Abud Ferreiraff6ebfe562f5
diff --git a/README.md b/README.md
index 00a6ccb..11fa5bb 100644
--- a/README.md
+++ b/README.md
@@ -19,6 +19,7 @@ controller.
- **Sign in on your phone** with a code shown on the TV; no password on the console.
- **Game Pass and Your games** tabs, search, and free-to-play games.
+- **My consoles**: play your own Xbox (Remote Play), its screen, games and apps.
- **Sharp picture**: upscaled to 4K on the GPU (AMD FSR 1 or Anime4K), with
compression blocks smoothed.
- **DualSense**: rumble, adaptive-trigger vibration, light bar in the game's
diff --git a/ROADMAP.md b/ROADMAP.md
index 46aa1a6..ce84cb5 100644
--- a/ROADMAP.md
+++ b/ROADMAP.md
@@ -61,6 +61,15 @@ the game closed) still ends the stream.
own pad cursor. A touchpad pointer was tried and dropped (the page
ignored the touches, and it got in the way of the account picker).
+### Remote Play (own Xbox) — v0.7.0
+The xhome offering takes the same Xbox token: "My consoles" lists the
+account's consoles (`/v6/servers/home`), and a home session is started
+with the console's serverId; the stream is the cloud one. Series X on the
+same network: 1080p, 9-17 Mbps, 7-10 ms round trip. A sleeping Xbox wakes
+through the session itself (~10 s); one that doesn't answer
+(`WaitingForServerToRegister`) is asked again, then the app says what to
+check. To try: the 4K the console announces (3840x2160).
+
## Next
| Item | Why | Size |
diff --git a/ps5/release/README.txt b/ps5/release/README.txt
index 9cc3c87..87a4f11 100644
--- a/ps5/release/README.txt
+++ b/ps5/release/README.txt
@@ -102,6 +102,14 @@ then acts as Xbox A in games too). Saved in
When a new version is out, a notification says so after sign-in.
+My consoles (Remote Play)
+-------------------------
+The third tab (R1) lists your own Xbox consoles; Cross plays one: its
+screen, games and apps, on the PS5. On the Xbox, turn on Settings >
+Devices & connections > Remote features, and choose the Sleep power
+mode so it wakes up by itself (it takes about ten seconds).
+
+
Free-to-play games
------------------
The home screen has a row of free-to-play games. Each one must be added
diff --git a/src/app/ps5_main.cpp b/src/app/ps5_main.cpp
index 31d5837..0dea908 100644
--- a/src/app/ps5_main.cpp
+++ b/src/app/ps5_main.cpp
@@ -49,7 +49,7 @@ std::unique_ptr<ui::AppUi> g_ui;
// --- Worker commands ---------------------------------------------------------
-enum Command { kNone, kSignIn, kPlay, kSignOut, kReloadLibrary };
+enum Command { kNone, kSignIn, kPlay, kSignOut, kReloadLibrary, kConsoles };
// User settings (settings.json); read by the worker, changed by the UI thread.
std::mutex g_settingsMutex;
@@ -158,6 +158,7 @@ int g_autoplaySeconds = 0;
bool g_autoplayDump = false;
int g_autoplayRuns = 1;
bool g_autoplayIdle = false;
+bool g_autoplayConsolesTab = false; // autoplay "consolestab": open My consoles, save consoles.ppm
bool g_autoplayConsoles = false; // autoplay "consoles": log the account's own consoles (xhome)
bool g_autoplayPad = false; // autoplay "pad": the physical pad stays in use, its buttons logged
bool g_autoplayDetailTest = false; // open a game to buy far down the list, save its page
@@ -206,6 +207,7 @@ void loadAutoplay() {
if (opt == "detailtest") g_autoplayDetailTest = true;
if (opt == "pad") g_autoplayPad = true;
if (opt == "consoles") g_autoplayConsoles = true;
+ if (opt == "consolestab") g_autoplayConsolesTab = true;
if (opt == "librarytest") g_autoplayLibraryTest = true;
if (opt == "imetest") g_autoplayImeTest = true;
if (opt == "menutest") g_autoplayMenuTest = true;
@@ -433,6 +435,8 @@ std::string play(auth::AuthManager& am, xcloud::GssvClient& gssv, const ui::Game
XC_LOGI("session state: %s", st.raw.c_str());
if (st.state == xcloud::SessionState::WaitingForResources)
g_ui->setLaunchStatus(ui::trf(ui::Str::InQueue, formatWait(gssv.waitTimeSeconds())));
+ if (st.state == xcloud::SessionState::Provisioning && gssv.isHome())
+ g_ui->setLaunchStatus(ui::tr(ui::Str::WakingConsole)); // a sleeping Xbox takes ~10 s
if (st.state == xcloud::SessionState::Failed) {
result = "the session failed: " + st.errorCode + " " + st.errorMessage;
break;
@@ -550,6 +554,23 @@ void priceLoop() {
}
}
}
+// "My consoles": the account's own Xbox consoles (Remote Play, the xhome
+// offering, logged in with the same Xbox token).
+void loadConsoles(auth::AuthManager& am, xcloud::GssvClient& home) {
+ std::string err;
+ std::vector<xcloud::Console> consoles;
+ bool fresh = home.session().expiresAt > auth::unixNow() + 120;
+ if ((!fresh && !am.loginOffering(home, err)) || !home.listConsoles(consoles, err)) {
+ XC_LOGW("consoles: %s", err.c_str());
+ g_ui->setConsoles({}, true);
+ return;
+ }
+ std::vector<ui::ConsoleTile> tiles;
+ for (const auto& c : consoles) tiles.push_back({c.serverId, c.deviceName, c.consoleType, c.powerState});
+ XC_LOGI("consoles: %zu", tiles.size()); // not their names or ids
+ g_ui->setConsoles(std::move(tiles), true);
+}
+
void signInAndLoad(auth::AuthManager& am, xcloud::GssvClient& gssv) {
g_ui->showSplash(ui::tr(am.hasStoredAccount() ? ui::Str::SigningIn : ui::Str::RequestingCode));
std::string err;
@@ -575,13 +596,13 @@ void signInAndLoad(auth::AuthManager& am, xcloud::GssvClient& gssv) {
c.powerState.c_str(), c.playPath.c_str(), c.outOfHomeWarning ? ", out-of-home warning" : "",
c.wirelessWarning ? ", wireless warning" : "");
if (g_autoplayTitle == "XHOME" && !consoles.empty()) {
- // Remote Play probe: stream the first console.
- ui::GameTile tile;
- tile.titleId = consoles.front().serverId;
- tile.name = "Xbox";
- bool failed = false;
- std::string result = play(am, home, tile, failed);
- XC_LOGI("AUTOPLAY END: xhome: %s", result.c_str());
+ // Remote Play: the first console, as "My consoles" plays it.
+ std::lock_guard<std::mutex> lock(g_argMutex);
+ g_playTile = {};
+ g_playTile.titleId = consoles.front().serverId;
+ g_playTile.name = "Xbox";
+ g_playTile.homeConsole = true;
+ g_command = kPlay;
return;
}
XC_LOGI("AUTOPLAY END: consoles listed");
@@ -661,6 +682,7 @@ void loadLibrary(xcloud::GssvClient& gssv) {
library->hydrate(changed, &g_stopHydration);
});
if (!g_autoplayTitle.empty() && g_autoplayTitle != "BENCH" && !g_autoplayDetailTest && !g_autoplayLibraryTest &&
+ !g_autoplayConsolesTab &&
!g_autoplayImeTest && !g_autoplayVibeTest) {
platform::sleepMs(6000); // leave the home screen up for ui.ppm
ui::GameTile tile;
@@ -683,17 +705,23 @@ void worker() {
for (;;) platform::sleepMs(1000);
}
auth::AuthManager am(platform::dataDir() + "/account.json");
- xcloud::GssvClient gssv;
+ xcloud::GssvClient gssv, home("xhome");
for (;;) {
int cmd = g_command.exchange(kNone);
g_cancel = false;
switch (cmd) {
- case kSignIn: signInAndLoad(am, gssv); break;
+ case kSignIn:
+ signInAndLoad(am, gssv);
+ loadConsoles(am, home); // empty when the sign-in failed
+ break;
+ case kConsoles: loadConsoles(am, home); break;
case kReloadLibrary: loadLibrary(gssv); break; // e.g. after a language change
case kSignOut:
am.signOut();
g_ui->setProfile({}, {});
+ g_ui->setConsoles({}, false);
signInAndLoad(am, gssv);
+ loadConsoles(am, home);
break;
case kPlay: {
ui::GameTile tile;
@@ -702,6 +730,30 @@ void worker() {
tile = g_playTile;
}
bool failed = false;
+ if (tile.homeConsole) {
+ // The user's own Xbox. One that sleeps too deeply fails
+ // at once ("... State WaitingForServerToRegister"): asked
+ // again, it often wakes.
+ std::string result;
+ for (int attempt = 0; attempt < 3 && !g_cancel; ++attempt) {
+ if (attempt) {
+ g_ui->setLaunchStatus(ui::tr(ui::Str::WakingConsole));
+ platform::sleepMs(5000);
+ }
+ result = play(am, home, tile, failed);
+ XC_LOGI("%s", result.c_str());
+ if (!failed || result.find("WaitingForServerToRegister") == std::string::npos) break;
+ }
+ if (failed && result.find("WaitingForServerToRegister") != std::string::npos)
+ g_ui->showPlayError(ui::trf(ui::Str::WakeFailed, tile.name), tile);
+ else if (failed)
+ g_ui->showPlayError(result.rfind("ERROR: ", 0) == 0 ? result.substr(7) : result, tile);
+ else
+ g_ui->showHome(ui::tr(ui::Str::StreamEnded));
+ autoplayFinished(result);
+ loadConsoles(am, home); // its state changed
+ break;
+ }
bool automatic;
{
std::lock_guard<std::mutex> lock(g_settingsMutex);
@@ -1123,6 +1175,11 @@ int main(int argc, char** argv) {
g_command = kSignOut;
break;
case ui::Action::Retry: g_command = kSignIn; break;
+ case ui::Action::ConsolesShown: {
+ int idle = kNone;
+ g_command.compare_exchange_strong(idle, kConsoles); // not over a pending command
+ break;
+ }
case ui::Action::CancelLaunch: g_cancel = true; break;
case ui::Action::PrefsChanged: {
std::lock_guard<std::mutex> lock(g_settingsMutex);
@@ -1259,6 +1316,17 @@ int main(int argc, char** argv) {
XC_LOGI("AUTOPLAY END: detail test");
}
}
+ if (g_autoplayConsolesTab && uiSaved) {
+ static uint64_t shownAt = 0;
+ if (!shownAt) {
+ g_ui->showTab(ui::Tab::Consoles);
+ shownAt = now;
+ } else if (now - shownAt > 3000) {
+ saveCanvas("consoles.ppm");
+ g_autoplayConsolesTab = false;
+ XC_LOGI("AUTOPLAY END: consoles tab");
+ }
+ }
if (!g_autoplayTitle.empty() && !uiSaved && g_ui->screen() == ui::Screen::Home) {
if (!homeSince) homeSince = now;
if (now - homeSince > 5000) {
diff --git a/src/auth/auth_manager.cpp b/src/auth/auth_manager.cpp
index a9ee3bb..b4569e2 100644
--- a/src/auth/auth_manager.cpp
+++ b/src/auth/auth_manager.cpp
@@ -56,6 +56,7 @@ bool AuthManager::save() const {
void AuthManager::signOut() {
tokens_ = {};
profile_ = {};
+ gssvXsts_ = {};
std::remove(storePath_.c_str());
}
diff --git a/src/ui/app_ui.cpp b/src/ui/app_ui.cpp
index 63b5f81..80c76a7 100644
--- a/src/ui/app_ui.cpp
+++ b/src/ui/app_ui.cpp
@@ -330,6 +330,14 @@ void AppUi::rebuild(bool keepPosition) {
dirty_ = true;
}
+void AppUi::setConsoles(std::vector<ConsoleTile> consoles, bool known) {
+ std::lock_guard<std::mutex> lock(mutex_);
+ consoles_ = std::move(consoles);
+ consolesKnown_ = known;
+ consoleFocus_ = std::min(consoleFocus_, std::max(0, static_cast<int>(consoles_.size()) - 1));
+ dirty_ = true;
+}
+
void AppUi::setLoading(bool active, size_t done, size_t total) {
std::lock_guard<std::mutex> lock(mutex_);
if (active == loading_ && done == loadingDone_ && total == loadingTotal_) return;
@@ -498,6 +506,13 @@ const GameTile* AppUi::libraryTile(int index) const {
return i < hiddenTiles_.size() ? &hiddenTiles_[i] : nullptr;
}
+void AppUi::showTab(Tab t) {
+ std::lock_guard<std::mutex> lock(mutex_);
+ tab_ = t;
+ searching_ = false;
+ dirty_ = true;
+}
+
Tab AppUi::tab() const {
std::lock_guard<std::mutex> lock(mutex_);
return tab_;
@@ -679,7 +694,7 @@ bool AppUi::accentColor(Color& out) {
if (!searchOnKeys_ && resultFocus_ >= 0 && resultFocus_ < static_cast<int>(results_.size()))
t = &results_[static_cast<size_t>(resultFocus_)];
} else {
- t = tab_ == Tab::Library ? libraryTile(gridFocus_) : focusedTile();
+ t = tab_ == Tab::Library ? libraryTile(gridFocus_) : tab_ == Tab::GamePass ? focusedTile() : nullptr;
}
break;
default: break;
@@ -860,9 +875,12 @@ AppUi::LibraryLayout AppUi::libraryLayout() const {
void AppUi::handleHome(const NavInput& in, UiEvent& ev) {
// Caller holds mutex_.
if (in.l1 || in.r1) {
- tab_ = tab_ == Tab::GamePass ? Tab::Library : Tab::GamePass;
+ // Game Pass, Your games, My consoles, round.
+ int n = static_cast<int>(tab_) + (in.r1 ? 1 : 2);
+ tab_ = static_cast<Tab>(n % 3);
searching_ = false;
dirty_ = true;
+ if (tab_ == Tab::Consoles) ev.action = Action::ConsolesShown;
return;
}
if (in.options) {
@@ -872,7 +890,7 @@ void AppUi::handleHome(const NavInput& in, UiEvent& ev) {
dirty_ = true;
return;
}
- if (in.triangle && !searching_) { // search this tab
+ if (in.triangle && !searching_ && tab_ != Tab::Consoles) { // search this tab
searching_ = true;
searchOnKeys_ = true;
query_.clear();
@@ -911,6 +929,22 @@ void AppUi::handleHome(const NavInput& in, UiEvent& ev) {
return;
}
switch (tab_) {
+ case Tab::Consoles: {
+ int n = static_cast<int>(consoles_.size());
+ if (n == 0) break;
+ int before = consoleFocus_;
+ if (in.right && consoleFocus_ + 1 < n) ++consoleFocus_;
+ if (in.left && consoleFocus_ > 0) --consoleFocus_;
+ if (consoleFocus_ != before) dirty_ = true;
+ if (in.accept) {
+ const ConsoleTile& con = consoles_[static_cast<size_t>(consoleFocus_)];
+ ev.action = Action::Play;
+ ev.game.titleId = con.serverId;
+ ev.game.name = con.name.empty() ? "Xbox" : con.name;
+ ev.game.homeConsole = true;
+ }
+ break;
+ }
case Tab::GamePass: {
if (rows_.empty()) break;
int rows = static_cast<int>(rows_.size());
@@ -1119,10 +1153,14 @@ UiEvent AppUi::handle(const NavInput& in) {
if (in.back) ev.action = Action::CancelLaunch;
break;
case Screen::Error:
- if (!errorGame_.productId.empty()) {
+ if (!errorGame_.titleId.empty()) {
if (in.accept) {
ev.action = Action::Play;
ev.game = errorGame_;
+ } else if (in.back && errorGame_.homeConsole) {
+ screen_ = Screen::Home; // back to My consoles
+ tab_ = Tab::Consoles;
+ dirty_ = true;
} else if (in.back) {
openDetails(errorGame_);
}
@@ -1357,10 +1395,10 @@ void AppUi::drawSignIn(Canvas& c, uint64_t nowMs) {
void AppUi::drawTabs(Canvas& c) {
// Centred pills in the top bar, between "L1" and "R1".
- const char* labels[2] = {tr(Str::TabGamePass), tr(Str::YourGames)};
+ const char* labels[3] = {tr(Str::TabGamePass), tr(Str::YourGames), tr(Str::TabConsoles)};
constexpr int kPx = 22, kPad = 26, kGap = 12, kH = 44, kY = 50;
- int widths[2], total = 0;
- for (int i = 0; i < 2; ++i) {
+ int widths[3], total = 0;
+ for (int i = 0; i < 3; ++i) {
widths[i] = fonts_.semibold.measure(labels[i], kPx) + 2 * kPad;
total += widths[i] + (i ? kGap : 0);
}
@@ -1371,7 +1409,7 @@ void AppUi::drawTabs(Canvas& c) {
fonts_.bold.draw(c, name, cx - fonts_.bold.measure(name, 16) / 2, fonts_.bold.centeredY(r.y, r.h, 16), 16, kGray);
};
shoulder("L1", x - 40);
- for (int i = 0; i < 2; ++i) {
+ for (int i = 0; i < 3; ++i) {
bool on = static_cast<int>(tab_) == i;
Rect r{x, kY, widths[i], kH};
if (on) c.fillRect(r, kWhite, kH / 2);
@@ -1631,9 +1669,70 @@ void AppUi::drawSearch(Canvas& c, uint64_t nowMs) {
drawToast(c, nowMs);
}
+void AppUi::drawConsoles(Canvas& c, uint64_t nowMs) {
+ drawBackground(c);
+ drawTopBar(c);
+ drawTabs(c);
+ fonts_.bold.draw(c, tr(Str::TabConsoles), kMargin, 170, 52, kWhite);
+ fonts_.regular.draw(c, tr(Str::ConsolesHint), kMargin, 240, 26, kGray);
+ if (consoles_.empty()) {
+ if (!consolesKnown_) {
+ drawSpinner(c, kW / 2.0f, 520, 26, nowMs);
+ drawCentered(c, fonts_.semibold, tr(Str::ConsolesLoading), 580, 28, kGray);
+ animating_ = true;
+ } else {
+ int y = 480;
+ for (const auto& line : fonts_.regular.wrap(tr(Str::NoConsoles), 28, 1200, 3)) {
+ drawCentered(c, fonts_.regular, line, y, 28, kGray);
+ y += 42;
+ }
+ }
+ drawHints(c, {{kIconOptions, tr(Str::Settings)}, {kIconTouchpad, tr(Str::HoldSignOut)}});
+ drawPads(c);
+ return;
+ }
+ // One card per console: a drawn Xbox, its name, model and state.
+ constexpr int kCardW = 480, kCardH = 380, kGap = 40, kTop = 320;
+ for (size_t i = 0; i < consoles_.size(); ++i) {
+ const ConsoleTile& con = consoles_[i];
+ int x = kMargin + static_cast<int>(i) * (kCardW + kGap);
+ if (x > kW) break;
+ bool focused = static_cast<int>(i) == consoleFocus_;
+ Rect card{x, kTop, kCardW, kCardH};
+ if (focused) c.strokeRect({card.x - 7, card.y - 7, card.w + 14, card.h + 14}, kWhite, 4, 22);
+ c.fillRect(card, kPanel, 16);
+ // The console: a Series X stands as a tower, the others lie flat.
+ bool tower = con.type == "XboxSeriesX";
+ Rect box = tower ? Rect{x + kCardW / 2 - 55, kTop + 40, 110, 170} : Rect{x + kCardW / 2 - 120, kTop + 90, 240, 70};
+ c.fillRect(box, rgba(20, 20, 20), 12);
+ c.strokeRect(box, rgba(70, 70, 70), 2, 12);
+ bool on = con.power == "On";
+ c.fillCircle(static_cast<float>(box.x + (tower ? box.w / 2 : 24)), static_cast<float>(box.y + (tower ? 22 : box.h / 2)),
+ tower ? 16.0f : 9.0f, on ? kGreen : rgba(90, 90, 90));
+ std::string name = con.name.empty() ? "Xbox" : con.name;
+ auto lines = fonts_.semibold.wrap(name, 30, kCardW - 48, 1);
+ if (!lines.empty()) fonts_.semibold.draw(c, lines[0], x + 24, kTop + 236, 30, kWhite);
+ std::string model = con.type == "XboxSeriesX" ? "Xbox Series X"
+ : con.type == "XboxSeriesS" ? "Xbox Series S"
+ : con.type == "XboxOneX" ? "Xbox One X"
+ : con.type == "XboxOneS" ? "Xbox One S"
+ : con.type == "XboxOne" ? "Xbox One"
+ : con.type;
+ fonts_.regular.draw(c, model, x + 24, kTop + 284, 24, kGray);
+ const char* state = on ? tr(Str::ConsoleOn)
+ : con.power == "ConnectedStandby" ? tr(Str::ConsoleSleeping)
+ : tr(Str::ConsoleOff);
+ c.fillCircle(static_cast<float>(x + 32), static_cast<float>(kTop + 336), 6, on ? rgba(60, 200, 60) : kDim);
+ fonts_.semibold.draw(c, state, x + 48, kTop + 322, 24, on ? kWhite : kGray);
+ }
+ drawHints(c, {{kIconCross, tr(Str::Play)}, {kIconOptions, tr(Str::Settings)}, {kIconTouchpad, tr(Str::HoldSignOut)}});
+ drawPads(c);
+}
+
void AppUi::drawHome(Canvas& c, uint64_t nowMs) {
if (searching_) return drawSearch(c, nowMs);
if (tab_ == Tab::Library) return drawLibrary(c, nowMs);
+ if (tab_ == Tab::Consoles) return drawConsoles(c, nowMs);
const GameTile* focus = focusedTile();
c.clear(kBg);
drawHero(c, nowMs, focus ? focus->heroUrl : std::string(), false);
@@ -1851,7 +1950,7 @@ void AppUi::drawError(Canvas& c) {
fonts_.regular.draw(c, line, panel.x + 56, y, 26, kGray);
y += 38;
}
- if (!errorGame_.productId.empty())
+ if (!errorGame_.titleId.empty())
drawHints(c, {{kIconCross, tr(Str::TryAgain)}, {kIconCircle, tr(Str::Back)}});
else
drawHints(c, {{kIconCross, tr(Str::TryAgain)}, {kIconTouchpad, tr(Str::HoldSignOut)}});
diff --git a/src/ui/app_ui.h b/src/ui/app_ui.h
index 65ce88b..837d4bc 100644
--- a/src/ui/app_ui.h
+++ b/src/ui/app_ui.h
@@ -41,6 +41,15 @@ struct GameTile {
// Console it was made for: "360", "ONE", "XS" (xcloud/titlehub.h); empty
// while unknown.
std::string platform;
+ // Not a game: the user's own Xbox (Remote Play); titleId is its serverId.
+ bool homeConsole = false;
+};
+
+// One of the user's own consoles, as "My consoles" shows it.
+struct ConsoleTile {
+ std::string serverId, name;
+ std::string type; // "XboxSeriesX", "XboxOne"...
+ std::string power; // "On", "ConnectedStandby", "Off"...
};
struct GameRow {
@@ -52,7 +61,7 @@ struct GameRow {
enum class Screen { Splash, SignIn, Home, Details, Launching, Streaming, Error, Settings };
// The home screen's tabs (L1 / R1). Triangle searches the current one.
-enum class Tab { GamePass, Library };
+enum class Tab { GamePass, Library, Consoles };
struct NavInput {
bool up = false, down = false, left = false, right = false;
@@ -78,7 +87,8 @@ struct SettingsChoice {
constexpr int kDeadzonePercent[] = {0, 5, 10, 15, 20, 25};
constexpr int kSettingRows = 7; // language, resolution, region, dead zone, triggers, confirm, light bar
-enum class Action { None, Play, SignOut, Retry, CancelLaunch, SettingsChanged, PrefsChanged };
+// ConsolesShown: "My consoles" opened (its list is refreshed).
+enum class Action { None, Play, SignOut, Retry, CancelLaunch, SettingsChanged, PrefsChanged, ConsolesShown };
// How "Your games" is sorted (R3).
enum class LibrarySort { Recent, AZ, Console, Count };
@@ -114,6 +124,8 @@ public:
// "Your games": the account's games, then those to buy; `known` false
// while the account's games load.
void setOwned(std::vector<GameTile> owned, std::vector<GameTile> purchasable, bool known);
+ // "My consoles"; `known` false while they load.
+ void setConsoles(std::vector<ConsoleTile> consoles, bool known);
// The lists' background refresh: shown as a bar in "Your games" and the
// search; `total` 0 = running, no measure yet.
void setLoading(bool active, size_t done, size_t total);
@@ -164,6 +176,8 @@ public:
void setRegions(std::vector<std::string> regions, const std::string& defaultRegion);
Screen screen() const;
Tab tab() const;
+ // Switches the home screen's tab (autoplay tests).
+ void showTab(Tab t);
void invalidate();
// --- UI thread -----------------------------------------------------------
@@ -193,6 +207,7 @@ private:
void drawSignIn(Canvas& c, uint64_t nowMs);
void drawHome(Canvas& c, uint64_t nowMs);
void drawTabs(Canvas& c);
+ void drawConsoles(Canvas& c, uint64_t nowMs);
void drawLibrary(Canvas& c, uint64_t nowMs);
void drawSearch(Canvas& c, uint64_t nowMs);
void drawCard(Canvas& c, const GameTile& t, int x, int y, bool focused, bool gamePassBadge);
@@ -253,6 +268,9 @@ private:
std::vector<Anim> rowScroll_;
Anim rowY_;
Tab tab_ = Tab::GamePass;
+ std::vector<ConsoleTile> consoles_;
+ bool consolesKnown_ = false;
+ int consoleFocus_ = 0;
std::vector<GameTile> owned_, purchasable_, hiddenTiles_; // as shown
// As received, before hiding and sorting (rebuild() derives the above).
std::vector<GameRow> allRows_;
diff --git a/src/ui/strings.cpp b/src/ui/strings.cpp
index 61adec1..ff1207f 100644
--- a/src/ui/strings.cpp
+++ b/src/ui/strings.cpp
@@ -157,6 +157,15 @@ constexpr Column kEnglish = {
"Scan to get it free", // ScanToGet
"%s is not on your account yet. It is free: scan the code on its page, choose Get, then try again (it can take a minute).", // NoEntitlementFree
"Your account can't play %s: it is not in your subscription or not bought.", // NoEntitlement
+ "My consoles", // TabConsoles
+ "On", // ConsoleOn
+ "Sleeping", // ConsoleSleeping
+ "Off", // ConsoleOff
+ "Looking for your consoles...", // ConsolesLoading
+ "No Xbox found. On your Xbox, turn on Settings > Devices & connections > Remote features, with the Sleep power mode.", // NoConsoles
+ "Play your own Xbox here: its screen, games and apps.", // ConsolesHint
+ "Waking up your Xbox...", // WakingConsole
+ "%s did not answer. Check that Remote features are on and the power mode is Sleep, or turn it on, then try again.", // WakeFailed
};
constexpr Column kPortugueseBR = {
@@ -284,6 +293,15 @@ constexpr Column kPortugueseBR = {
"Escaneie para pegar grátis",
"%s ainda não está na sua conta. É grátis: escaneie o código na página do jogo, escolha Obter e tente de novo (pode levar um minuto).",
"Sua conta não pode jogar %s: não está na sua assinatura ou não foi comprado.",
+ "Meus consoles",
+ "Ligado",
+ "Em espera",
+ "Desligado",
+ "Procurando seus consoles...",
+ "Nenhum Xbox encontrado. No seu Xbox, ative Configurações > Dispositivos e conexões > Recursos remotos, com o modo de energia Suspensão.",
+ "Jogue no seu próprio Xbox por aqui: a tela, os jogos e os apps dele.",
+ "Ligando o seu Xbox...",
+ "%s não respondeu. Confira se os Recursos remotos estão ativos e o modo de energia é Suspensão, ou ligue o console, e tente de novo.",
};
constexpr Column kSpanish = {
@@ -411,6 +429,15 @@ constexpr Column kSpanish = {
"Escanea para conseguirlo gratis",
"%s aún no está en tu cuenta. Es gratis: escanea el código en su página, elige Obtener y vuelve a intentarlo (puede tardar un minuto).",
"Tu cuenta no puede jugar a %s: no está en tu suscripción o no lo has comprado.",
+ "Mis consolas",
+ "Encendida",
+ "En reposo",
+ "Apagada",
+ "Buscando tus consolas...",
+ "No se encontró ninguna Xbox. En tu Xbox, activa Configuración > Dispositivos y conexiones > Funciones remotas, con el modo de energía Suspensión.",
+ "Juega en tu propia Xbox desde aquí: su pantalla, juegos y aplicaciones.",
+ "Encendiendo tu Xbox...",
+ "%s no respondió. Comprueba que las Funciones remotas estén activadas y el modo de energía sea Suspensión, o enciéndela, y vuelve a intentarlo.",
};
constexpr Column kFrench = {
@@ -538,6 +565,15 @@ constexpr Column kFrench = {
"Scannez pour l'obtenir gratuitement",
"%s n'est pas encore sur votre compte. Il est gratuit : scannez le code sur sa page, choisissez Obtenir, puis réessayez (cela peut prendre une minute).",
"Votre compte ne peut pas jouer à %s : il n'est pas dans votre abonnement ou n'a pas été acheté.",
+ "Mes consoles",
+ "Allumée",
+ "En veille",
+ "Éteinte",
+ "Recherche de vos consoles...",
+ "Aucune Xbox trouvée. Sur votre Xbox, activez Paramètres > Appareils et connexions > Fonctionnalités à distance, avec le mode d'alimentation Veille.",
+ "Jouez sur votre propre Xbox d'ici : son écran, ses jeux et ses applications.",
+ "Réveil de votre Xbox...",
+ "%s n'a pas répondu. Vérifiez que les fonctionnalités à distance sont activées et le mode Veille choisi, ou allumez-la, puis réessayez.",
};
constexpr Column kGerman = {
@@ -665,6 +701,15 @@ constexpr Column kGerman = {
"Scannen, um es kostenlos zu holen",
"%s ist noch nicht in deinem Konto. Es ist kostenlos: Code auf seiner Seite scannen, Abrufen wählen und erneut versuchen (kann eine Minute dauern).",
"Dein Konto kann %s nicht spielen: nicht in deinem Abo oder nicht gekauft.",
+ "Meine Konsolen",
+ "An",
+ "Im Standby",
+ "Aus",
+ "Deine Konsolen werden gesucht...",
+ "Keine Xbox gefunden. Aktiviere auf deiner Xbox Einstellungen > Geräte & Verbindungen > Remotefunktionen, mit dem Energiemodus Ruhezustand.",
+ "Spiele hier auf deiner eigenen Xbox: ihr Bildschirm, ihre Spiele und Apps.",
+ "Deine Xbox wird geweckt...",
+ "%s hat nicht geantwortet. Prüfe, ob die Remotefunktionen aktiv sind und der Energiemodus Ruhezustand ist, oder schalte sie ein und versuche es erneut.",
};
constexpr Column kItalian = {
@@ -792,6 +837,15 @@ constexpr Column kItalian = {
"Scansiona per ottenerlo gratis",
"%s non è ancora nel tuo account. È gratis: scansiona il codice nella sua pagina, scegli Ottieni e riprova (può volerci un minuto).",
"Il tuo account non può giocare a %s: non è nel tuo abbonamento o non è stato acquistato.",
+ "Le mie console",
+ "Accesa",
+ "In standby",
+ "Spenta",
+ "Ricerca delle tue console...",
+ "Nessuna Xbox trovata. Sulla tua Xbox attiva Impostazioni > Dispositivi e connessioni > Funzionalità remote, con la modalità di alimentazione Sospensione.",
+ "Gioca sulla tua Xbox da qui: il suo schermo, i giochi e le app.",
+ "Accensione della tua Xbox...",
+ "%s non ha risposto. Controlla che le Funzionalità remote siano attive e la modalità sia Sospensione, oppure accendila, e riprova.",
};
constexpr std::array<const Column*, kLangs> kTable = {&kEnglish, &kPortugueseBR, &kSpanish,
diff --git a/src/ui/strings.h b/src/ui/strings.h
index f68b4a4..e539fb6 100644
--- a/src/ui/strings.h
+++ b/src/ui/strings.h
@@ -134,6 +134,15 @@ enum class Str {
ScanToGet,
NoEntitlementFree, // "%s" = the game
NoEntitlement, // "%s" = the game
+ TabConsoles, // the third tab: the user's own Xbox consoles
+ ConsoleOn,
+ ConsoleSleeping,
+ ConsoleOff,
+ ConsolesLoading,
+ NoConsoles, // none, or remote features off
+ ConsolesHint, // under the tab's title
+ WakingConsole, // the loading screen while the Xbox wakes up
+ WakeFailed, // "%s" = the console's name
Count
};
diff --git a/tools/ps5/autotest.sh b/tools/ps5/autotest.sh
index eac4fdc..0d781c3 100755
--- a/tools/ps5/autotest.sh
+++ b/tools/ps5/autotest.sh
@@ -37,7 +37,7 @@ import io, sys
from ftplib import FTP, error_perm, error_reply
host, port, d, line = sys.argv[1], int(sys.argv[2]), sys.argv[3], sys.argv[4]
f = FTP(); f.connect(host, port, timeout=15); f.login(); f.cwd(d)
-for name in ("xcloud.log", "frame.ppm", "frame2.ppm", "stream.aus", "ui.ppm", "launch.ppm", "screen.ppm", "detail.ppm", "library.ppm", "library2.ppm", "error.ppm"):
+for name in ("xcloud.log", "frame.ppm", "frame2.ppm", "stream.aus", "ui.ppm", "launch.ppm", "screen.ppm", "detail.ppm", "library.ppm", "library2.ppm", "error.ppm", "consoles.ppm"):
try: f.sendcmd(f"DELE {name}")
except (error_perm, error_reply): pass
f.storbinary("STOR autoplay.txt", io.BytesIO(line.encode() + b"\n"))
@@ -82,7 +82,7 @@ PY
if [[ $status != *"$title_id"* ]]; then result=crashed; break; fi
fi
done
-fetch xcloud.log frame.ppm frame2.ppm stream.aus ui.ppm launch.ppm screen.ppm detail.ppm library.ppm library2.ppm error.ppm || true
+fetch xcloud.log frame.ppm frame2.ppm stream.aus ui.ppm launch.ppm screen.ppm detail.ppm library.ppm library2.ppm error.ppm consoles.ppm || true
ctl kill "$title_id" >/dev/null 2>&1 || true
# Remove the request so a manual launch behaves normally.
python3 - "$PS5_HOST" "${FTP_PORT:-2121}" "/data/homebrew/$title_id" <<'PY'