Is it possible to further improve homebrew detection?
NABN00B opened this issue · 17 comments
By chance I stumbled upon an edge case scenario where the demo version of TOCA Race Driver 3 is detected as homebrew (and has its DISC_ID and DISC_VERSION overwritten by a fake ID and 1.00).
Turns out it passes the check for the DISC_TOTAL check (it doesn't contain that field).
Lines 572 to 579 in 172e334
The same thing happens to a bunch of utility apps.
Examples and their intended DISC_ID and DISC_VERSION fields:
- Race Driver 3
ULED900091.00 - Go!Messenger
ULES008561.01 - DMB Tuner
NPHW000111.0.0 - Music Unlimited
NPIA090021.20(doesn't get fake ID and version, but detected as homebrew regardless) - SensMe™ channels
NPIA000131.50 - コミックリーダー
NPJW000011.10Japanese comic reader
I understand that NPIAxxxxx should be detected as Internal like on the report DB website, but that hasn't been implemented in the emulator.
The website clearly has different filter(s) for homebrew though.
So I'm wondering if it's possible to improve homebrew detection. The code here seems to do more checks:
Lines 161 to 174 in 172e334
Is checking for
DISC_TOTAL necessary beside these other checks?
Pinging @unknownbrackets and @LunaMoo -- I believe you two were involved in setting up these checks. Perhaps you remember why the homebrew check is the way it is.
Another question is that do we need to generate a fake ID for every homebrew? Wouldn't it make sense to do so only if uses a commonly recycled ID (eg UCJS10041) or if it doesn't have one?
We had to base it on something, previously homebrew was a mess due to not having any gameID or re-using existing demos gameID's which ofc was terrible as many features wasn't working at all and when they worked, savestates etc. were shared between different software.
The DISC_TOTAL check was added because it was the first thing I found that always existed in full commercial games and never existed in homebrew which is important mostly for the sake of cheats and workarounds/game specific hacks. You could find a different variable that only exists in full games and never in homebrew, but it might as well end up having edge case as well and maybe even in the other direction which would be far worse. DISC_TOTAL soo far worked quite well to make things safe for actual games.
If it's just one demo, it could be included as exception (at least as long as it's not one of those demos used in multiply homebrew), however an edge case of demo version doesn't really feel important.
Homebrew is really unreliable with game ID's, if someone would specifically made a homebrew and cared for it to have an unique gameID and didn't wanted fakeID in PPSSPP, he could also edit his homebrew config specifically to avoid it being detected as homebrew by PPSSPP or even propose a new emulator specific parameter or value of an parameter that wouldn't affect real PSP while telling PPSSPP "this is a homebrew, but let's allow it to have it's own gameID" and it wouldn't really matter either. Edit: actually an unique made up gameID I think wouldn't really work on real PSP that's why the situation was soo stupid and require fakeID workaround and not just caused by laziness of homebrew devs.
What matters is that everything we launch have to have any (prefferably unique) gameID, and that full commercial games have their real gameID.
As LunaMoo says, it's indeed really important to have unique-enough game IDs, if only just for the fact that savestates will clash if we don't.
#20786 may help a bit with investigation of other possible params to check.
Note that it made it obvious that currently when loading homebrew we drop all the parameters except name and the generated ID, which doesn't seem like the right thing...
Before doing anything, can we get rid of setting the label of GameRegion::OTHER to "Homebrew" on the game info screen? It's a source of confusion.
Lines 394 to 401 in 061913c

Okay, I messed around a bit with a case where the game has a DISC_ID in PARAM.SFO but a fake ID is generated for it anyway because it fails to pass the DISC_TOTAL check.
It seems the checks at the two different places aren't even harmonized, resulting in a wonky situation.
- When I create / delete a game config while ingame it's done with real
DISC_ID, - but when I create / delete it from the game info screen it's done with generated fake ID.
- Thankfully savestates are created with real
DISC_ID, so this behavior should be fixable.
I believe anything you put into PSP/GAME folder was treated as homebrew. As such commercial games shouldn't really be placed there.
I believe anything you put into PSP/GAME folder was treated as homebrew. As such commercial games shouldn't really be placed there.
I don't think that's true by itself, everywhere I look the (discID.empty() || !info->disc_total) checks are also present.
Actually, that's exactly where commercial demos live on the real PSP, hence the name of the tab to show that folder ("Homebrew & Demos").
And yeah, @NABN00B , this is definitely a problem. We should centralize the ID generation, and have it be used by the GameInfoCache.
Actually, that's exactly where commercial demos live on the real PSP, hence the name of the tab to show that folder ("Homebrew & Demos").
Where do PSN downloads (full games, Minis etc) go?
Same dir (/PSP/GAME)
On an unmodified PSP, when you use the launch game from memstick option, it simply lists what it can find in /PSP/GAME .
(Modified PSPs of course check additional directories and add ISOs to the list)
Hm? I tested with Moppi Flower and it created a config with FLOW id even when in-game. Lemme try again...
Hm? I tested with Moppi Flower and it created a config with FLOW id even when in-game. Lemme try again...
That game doesn't fit into the scenario I described, because it doesn't have a DISC_ID field that could be overwritten by the generated fake ID.
Oh yeah, this doesn't fix the TOCA demo problem, that's right. But it did fix a problem with other homebrew..
EDIT: Wait, hm, the problem seems worse. hang on
Never mind, the logic just doesn't work. Sorry, I got confused.
Still needs fixing.
Urgh, we have like three different ways of checking for homebrew... GameInfoCache has its own logic.
I can reuse that on the pause screen to make it a little more consistent, but we really need to clean this all up.
Snuck in a quick fix so now at least the logic is the same on the PauseScreen and GameScreen.

