mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-17 11:24:27 +01:00
Use the disc's own mpeg.prx, and say when sceMp4 won't work
A game that ships MPEG.PRX doesn't need a firmware installed to run the real module - Death Jr. loads PSP_GAME/USRDIR/MODULES/MPEG.PRX itself - but the flag came off anyway, because the decision has to be made before the game's imports resolve and nothing had looked on the disc yet. So look: a bounded walk for a file of that name, only when flash0 comes up empty, so the usual case pays nothing. The name is the easy part - about a quarter of discs ship one and it is called mpeg.prx in every case seen - but the directory is not. MODULE and MODULES are the common ones, with KMODULE, PRX, DATA/MODULE, and more at five levels deep, hence the generous depth limit. Matching on the name rather than reading each PRX to see what it exports means guessing wrong only costs us the real module. sceMp4 is the other half of this. Our HLE of it is nearly all stubs, so dropping the flag for want of firmware doesn't rescue anything - those libraries only exist in firmware 6.00 and later, and without them MP4 playback simply isn't available. Since almost nothing uses sceMp4, warning about that every boot would be noise, so NotifyLoadStatusMp4 says it instead, which only something actually asking for MP4 reaches. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
c39db565da
commit
32017202bf
2 files changed
+75
-10
No files matched your search
+14
-1
@@ -171,7 +171,20 @@ static void NotifyLoadStatusAvcodec(int state, u32 loadAddr, u32 totalSize) {
|
||||
// functions from sceAudiocodec (Init and Decode) plus ordinary kernel calls, and mp4msv.prx - the
|
||||
// 41 functions libmp4 leans on - imports nothing at all.
|
||||
static void NotifyLoadStatusMp4(int state, u32 loadAddr, u32 totalSize) {
|
||||
if (state != 1 || !(GetEffectiveDisableHLEFlags() & DisableHLEFlags::sceMp4)) {
|
||||
if (state != 1) {
|
||||
return;
|
||||
}
|
||||
if (!(GetEffectiveDisableHLEFlags() & DisableHLEFlags::sceMp4)) {
|
||||
// Only something that actually uses sceMp4 gets this far, which is why the warning lives
|
||||
// here rather than with the other firmware checks at boot: our HLE is nearly all stubs, so
|
||||
// whatever just asked for MP4 is not going to work, and this is the one moment where
|
||||
// saying so is neither noise nor too late.
|
||||
if (!pspFileSystem.GetFileInfo("flash0:/kd/libmp4.prx").exists ||
|
||||
!pspFileSystem.GetFileInfo("flash0:/kd/mp4msv.prx").exists) {
|
||||
auto sy = GetI18NCategory(I18NCat::SYSTEM);
|
||||
g_OSD.Show(OSDType::MESSAGE_WARNING, sy->T("MP4 playback needs a firmware dump from "
|
||||
"version 6.00 or later - it won't work without one"), 8.0f, "hle_no_module_sceMp4");
|
||||
}
|
||||
return;
|
||||
}
|
||||
// mp4msv first - libmp4 imports from it, and an import can only resolve to a module that is
|
||||
|
||||
Reference in new issue
Block a user