Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified Data/Xips/default.xip
Binary file not shown.
1 change: 1 addition & 0 deletions build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -901,6 +901,7 @@ DESKTOP_SRCS_PLATFORM = \
$(THESEUS_SRC)/desktop/esde.cpp \
$(THESEUS_SRC)/desktop/esde_vgames.cpp \
$(THESEUS_SRC)/desktop/icon_compress.cpp \
$(THESEUS_SRC)/desktop/game_art.cpp \
$(THESEUS_SRC)/desktop/playlist.cpp \
$(THESEUS_SRC)/desktop/playlist_maker.cpp \
$(THESEUS_SRC)/desktop/preloader.cpp \
Expand Down
54 changes: 52 additions & 2 deletions theseus/desktop/desktop_nodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4253,7 +4253,7 @@ extern void DesktopLaunchTitle(const char* devicePath);
class CGamesCollection : public CNode
{
public:
CGamesCollection() : m_gen(0)
CGamesCollection() : m_gen(0), m_showHidden(false)
{
m_category[0] = 0;
m_group[0] = 0;
Expand All @@ -4273,6 +4273,8 @@ class CGamesCollection : public CNode
std::vector<int> m_slice;
// Last seen generation. Re-filter when it changes.
unsigned int m_gen;
// Hidden titles come back so a scene can offer to unhide them.
bool m_showHidden;

// Rows are folders first, then titles, so an index below the folder count
// addresses m_folders and anything above it addresses m_slice.
Expand All @@ -4293,13 +4295,19 @@ class CGamesCollection : public CNode
m_gen = g_vgames.generation;
return;
}
if (VGames_IsMarkList(m_category)) {
VGames_MarkList(m_category, m_slice);
m_gen = g_vgames.generation;
return;
}
// Match what xboxfs / Title Maker do: drive defaults to "E" for the
// harddrive view. Future-proofed for F/G if those ever come back.
int tmp[VGAMES_MAX];
int n = VGames_GetForDirectory("E", m_category, tmp, VGAMES_MAX);
size_t glen = strlen(m_group);

for (int i = 0; i < n; i++) {
if (!m_showHidden && !VGames_IsShown(g_vgames.games[tmp[i]])) continue;
const char* grp = g_vgames.games[tmp[i]].group;
const char* rest;
if (glen == 0) {
Expand Down Expand Up @@ -4369,14 +4377,50 @@ class CGamesCollection : public CNode
{
VGames_Load();
if (!cat || !*cat) return 0;
if (VGames_IsMarkList(cat)) {
std::vector<int> list;
VGames_MarkList(cat, list);
return (int)list.size();
}
int n = 0;
for (int i = 0; i < g_vgames.count; i++) {
const VirtualGame& g = g_vgames.games[i];
if (g.valid && strcasecmp(g.category, cat) == 0) n++;
if (VGames_IsShown(g) && strcasecmp(g.category, cat) == 0) n++;
}
return n;
}

// The DB row behind a list row, or -1 for folders and anything past the end.
int Row(int i)
{
EnsureFresh();
int t = TitleIndex(i);
return (t >= 0 && t < (int)m_slice.size()) ? m_slice[t] : -1;
}

int IsFavorite(int i) { int r = Row(i); return (r >= 0 && g_vgames.games[r].favorite) ? 1 : 0; }
int IsHidden(int i) { int r = Row(i); return (r >= 0 && g_vgames.games[r].hidden) ? 1 : 0; }
void SetFavorite(int i, int on) { VGames_SetFavorite(Row(i), on != 0); }
void SetHidden(int i, int on) { VGames_SetHidden(Row(i), on != 0); }

// 1 lists hidden titles too, 0 goes back to normal.
void ShowHidden(int on)
{
m_showHidden = on != 0;
Rebuild();
}

// "2026-11-12 18:40", or empty for never.
CStrObject* GetLastPlayed(int i)
{
int r = Row(i);
if (r < 0 || !g_vgames.games[r].lastPlayed) return new CStrObject;
time_t t = (time_t)g_vgames.games[r].lastPlayed;
char buf[32];
strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M", localtime(&t));
return new CStrObject(buf);
}

// 1 when the row drills down instead of launching.
int IsFolder(int i)
{
Expand Down Expand Up @@ -4506,6 +4550,12 @@ START_NODE_FUN(CGamesCollection, CNode)
NODE_FUN_SI(GetIcon)
NODE_FUN_VI(LaunchTitle)
NODE_FUN_VV(Refresh)
NODE_FUN_II(IsFavorite)
NODE_FUN_VII(SetFavorite)
NODE_FUN_II(IsHidden)
NODE_FUN_VII(SetHidden)
NODE_FUN_VI(ShowHidden)
NODE_FUN_SI(GetLastPlayed)
END_NODE_FUN()


Expand Down
11 changes: 11 additions & 0 deletions theseus/desktop/desktop_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "settings_schema.h"
#include "audio_sdl.h"
#include "media_player.h"
#include "virtual_games.h"

extern char s_xemuPath[512];
extern char g_qcowPath[512];
Expand All @@ -27,6 +28,8 @@ extern float g_masterVolume;
extern bool g_useMilkdropViz, g_showAlbumCover;
extern char g_musicRoot[512], g_moviesRoot[512], g_tvRoot[512];
extern char g_tmdbKey[128], g_romsDir[512];
extern bool g_fetchGameArt;
extern char g_steamGridDbKey[128];
extern char g_plexToken[256], g_plexClientId[64];
extern char g_xcloudRefreshToken[2048];
extern char g_jellyfinUrl[512], g_jellyfinToken[256], g_jellyfinUserId[64];
Expand All @@ -43,6 +46,10 @@ char g_currentSkin[64] = "Stock";
static int s_startupModeSaved = 0;
static void ApplyStartupMode() { g_startupMode = s_startupModeSaved; }

// The same game from two sources shows once, from the best one.
bool g_hideDuplicateGames = true;
static void ApplyDuplicates() { g_vgames.generation++; }

static void ApplyMsaa() { g_msaaChangeRequested = true; }
static void ApplyVsync() { g_vsyncChangeRequested = true; }
static void ApplyDisplay() { g_displayChangeRequested = true; }
Expand Down Expand Up @@ -158,6 +165,10 @@ static const SettingDef kDefs[] = {
S_FOLDER("TvRoot", "Library", "Media", "TV Shows Folder", g_tvRoot, ApplyLibrary),
S_STR("TMDBKey", "Library", "Media", "TMDB API Key", g_tmdbKey, "", SF_SECRET),
S_PATH("RomsDir", "Library", "Games", "ROMs Folder", g_romsDir, 0),
S_BOOL("FetchGameArt", "Library", "Games", "Download Game Art", g_fetchGameArt, "1", 0),
{ "HideDuplicateGames", "Library", "Games", "Show Each Game Once", SK_BOOL, &g_hideDuplicateGames, 0, "1", 0,
NOENUM, 0, 0, 0, NULL, ApplyDuplicates },
S_STR("SteamGridDBKey", "Library", "Games", "SteamGridDB API Key", g_steamGridDbKey, "", SF_SECRET),
S_STR("PlexToken", "Library", "Media", "Plex Token", g_plexToken, "", SF_SECRET | SF_HIDDEN),
S_STR("PlexClientId", "Library", "Media", "Plex Client", g_plexClientId, "", SF_SECRET | SF_HIDDEN),
S_STR("XcloudRefreshToken", "Library", "Media", "Xbox Sign-in", g_xcloudRefreshToken, "", SF_SECRET | SF_HIDDEN),
Expand Down
3 changes: 3 additions & 0 deletions theseus/desktop/esde_vgames.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "esde.h"
#include "esde_vgames.h"
#include "virtual_games.h"
#include "game_art.h"

#include <stdio.h>
#include <time.h>
Expand Down Expand Up @@ -115,11 +116,13 @@ void EsdeVGames_Sync(const char* esdeRoot)
snprintf(group, sizeof(group), "%s", systems[s].fullname);
VGames_SetGroup(idx, group);
g_vgames.games[idx].transient = true;
VGames_ApplyLiveMarks(idx);

// Their scraped art, cached the way Steam icons are.
c0 = clock();
const char* art = Esde_FindArt(esdeRoot, &systems[s], &games[i]);
if (art[0] && CacheIcon(art, titleID)) withArt++;
else GameArt_Hint(titleID, systems[s].name, games[i].path);
tArt += (double)(clock() - c0) / CLOCKS_PER_SEC;
total++;
}
Expand Down
Loading
Loading