Files
ppsspp/UI/MainScreen.h
T
Henrik RydgårdandClaude Opus 5.5 d331bd6c8c UI: Play UMD Video discs in the XMB, straight from the game list
With firmware 2.71 or later installed, picking a UMD Video disc boots the XMB with the disc in the
drive and UMD auto-start forced on for that boot, so the disc's menu comes up. Without one, the
info screen saying UMD Video isn't supported shows as before. The info screen's Play does the same.

A disc with both a game and video asks which to start. For the video, the XMB comes up with
auto-start forced off, since auto-start runs the game.

Older firmware can't play these: 1.50, 2.00 and 2.60 crash in video_plugin or paf with a video disc
in the drive, and 2.50 refuses it. 2.71 through 6.61 reach Bourne Supremacy's menu.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-23 10:46:59 +02:00

142 lines
4.4 KiB
C++

// Copyright (c) 2013- PPSSPP Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0 or later versions.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#pragma once
#include <functional>
#include <string_view>
#include "Common/File/Path.h"
#include "Common/UI/UIScreen.h"
#include "Common/UI/ViewGroup.h"
#include "Common/UI/TabHolder.h"
#include "Common/UI/PopupScreens.h"
#include "UI/BaseScreens.h"
#include "Common/File/PathBrowser.h"
#include "UI/GameBrowser.h"
class RemoteISOBrowseScreen;
struct HighlightedBackground {
Path gamePath;
double startTime;
double endTime;
};
class MainScreen : public UIBaseScreen {
public:
MainScreen();
~MainScreen();
bool isTopLevel() const override { return true; }
const char *tag() const override { return "Main"; }
// Horrible hack to show the demos & homebrew tab after having installed a game from a zip file.
static bool showHomebrewTab;
bool key(const KeyInput &touch) override;
bool WantsTextInput() const override;
protected:
ViewLayoutMode LayoutMode() const override { return ViewLayoutMode::IgnoreBottomInset; }
void CreateViews() override;
void CreateRecentTab();
GameBrowser *CreateBrowserTab(const Path &path, std::string_view title, std::string_view howToTitle, std::string_view howToUri, BrowseFlags browseFlags, int *viewMode, float *scrollPos);
void CreateMainButtons(UI::ViewGroup *parent, bool vertical);
void DrawBackground(UIContext &dc) override;
void update() override;
void sendMessage(UIMessage message, const char *value) override;
void dialogFinished(const Screen *dialog, DialogResult result) override;
void DrawBackgroundFor(UIContext &dc, const Path &gamePath, float alpha);
void OnGameSelected(UI::EventParams &e);
void OnGameSelectedInstant(UI::EventParams &e);
void OnGameHighlight(UI::EventParams &e);
// Event handlers
void OnLoadFile(UI::EventParams &e);
void OnGameSettings(UI::EventParams &e);
void OnCredits(UI::EventParams &e);
void OnPPSSPPOrg(UI::EventParams &e);
void OnForums(UI::EventParams &e);
void OnDownloadUpgrade(UI::EventParams &e);
void OnAllowStorage(UI::EventParams &e);
UI::TabHolder *tabHolder_ = nullptr;
Path restoreFocusGamePath_;
std::vector<GameBrowser *> gameBrowsers_;
std::vector<HighlightedBackground> highlightedBackgrounds_;
Path highlightedGamePath_;
bool backFromStore_ = false;
bool lockBackgroundAudio_ = false;
int packGeneration_ = 0; // GamePacker::Generation() the game lists were made at.
bool lastVertical_ = false;
bool confirmedTemporary_ = false;
bool searchChanged_ = false;
std::string searchFilter_;
friend class RemoteISOBrowseScreen;
private:
void InstantHighlight(const Path &path);
};
class UmdReplaceScreen : public UIBaseDialogScreen {
public:
// insert: put a disc into the empty drive (the VSH) rather than swap the one a game is running from.
explicit UmdReplaceScreen(bool insert = false) : insert_(insert) {}
const char *tag() const override { return "UmdReplace"; }
protected:
void CreateViews() override;
void update() override;
private:
void OnGameSelected(UI::EventParams &e);
void OnGameSettings(UI::EventParams &e);
void UseDisc(const Path &path);
bool insert_;
};
class GridSettingsPopupScreen : public UI::PopupScreen {
public:
GridSettingsPopupScreen(std::string_view label) : PopupScreen(label) {}
void CreatePopupContents(UI::ViewGroup *parent) override;
UI::Event OnRecentChanged;
const char *tag() const override { return "GridSettings"; }
private:
void GridPlusClick(UI::EventParams &e);
void GridMinusClick(UI::EventParams &e);
void OnRecentClearClick(UI::EventParams &e);
const float MAX_GAME_GRID_SCALE = 3.0f;
const float MIN_GAME_GRID_SCALE = 0.8f;
};
void LaunchBuyGold(ScreenManager *screenManager);
// vshmain.prx, if the installed firmware's XMB can play UMD Video discs. Empty otherwise.
Path GetUmdVideoVSHPath();