mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-18 20:04:31 +01:00
VSH: An empty UMD drive, and inserting a disc over the WebSocket debugger
The XMB, booted without a game, now starts with an empty drive: when vsh_module loads with nothing at disc0:, the drive is marked empty, and activating it tells the shell's drive callback (SceVshMediaDetectUMD) there's no disc. Activation used to report a readable disc regardless, so the shell asked for its type and showed "The disc could not be read." The disc type devctl (0x01F20001) answers 0 without a disc, as JPCSP does. game.umd.insert (path) mounts a disc image into the empty drive and calls the drive callback as inserting one does; game.umd.eject takes it out. UmdMount() is UmdReplace() without its need for a disc already in. Inserted into the 6.61 XMB, Daxter shows in the Game column with its icon, background and animated preview, and launching it boots the game to its title menu. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
b225c33639
commit
eee153b220
10 files changed
+124
-10
No files matched your search
+41
-1
@@ -177,6 +177,10 @@ static void __KernelUmdActivate()
|
||||
if (sceKernelGetCompiledSdkVersion() != 0) {
|
||||
notifyArg |= PSP_UMD_READY;
|
||||
}
|
||||
// An empty drive (the XMB's) says so: the shell otherwise asks for the disc and reports it unreadable.
|
||||
if (!UMDInserted) {
|
||||
notifyArg = PSP_UMD_NOT_PRESENT;
|
||||
}
|
||||
if (driveCBId != 0)
|
||||
__KernelNotifyCallback(driveCBId, notifyArg);
|
||||
|
||||
@@ -187,7 +191,7 @@ static void __KernelUmdActivate()
|
||||
|
||||
static void __KernelUmdDeactivate()
|
||||
{
|
||||
u32 notifyArg = PSP_UMD_PRESENT | PSP_UMD_READY;
|
||||
u32 notifyArg = UMDInserted ? PSP_UMD_PRESENT | PSP_UMD_READY : PSP_UMD_NOT_PRESENT;
|
||||
if (driveCBId != 0)
|
||||
__KernelNotifyCallback(driveCBId, notifyArg);
|
||||
|
||||
@@ -506,6 +510,42 @@ void __UmdReplace(const Path &filepath) {
|
||||
__KernelNotifyCallback(driveCBId, notifyArg);
|
||||
}
|
||||
|
||||
bool __UmdInsert(const Path &filepath, std::string *error) {
|
||||
if (UMDInserted) {
|
||||
*error = "a disc is already in the drive";
|
||||
return false;
|
||||
}
|
||||
FileLoader *fileLoader;
|
||||
if (!UmdMount(filepath, &fileLoader, *error)) {
|
||||
return false;
|
||||
}
|
||||
Achievements::ChangeUMD(filepath, fileLoader);
|
||||
|
||||
UMDInserted = true;
|
||||
UmdWakeThreads();
|
||||
if (driveCBId != 0)
|
||||
__KernelNotifyCallback(driveCBId, PSP_UMD_PRESENT | PSP_UMD_READABLE | PSP_UMD_CHANGED);
|
||||
return true;
|
||||
}
|
||||
|
||||
void __UmdEject() {
|
||||
if (!UMDInserted) {
|
||||
return;
|
||||
}
|
||||
UMDInserted = false;
|
||||
pspFileSystem.Unmount("umd0:");
|
||||
pspFileSystem.Unmount("umd1:");
|
||||
pspFileSystem.Unmount("umd:");
|
||||
pspFileSystem.Unmount("disc0:");
|
||||
UmdWakeThreads();
|
||||
if (driveCBId != 0)
|
||||
__KernelNotifyCallback(driveCBId, PSP_UMD_NOT_PRESENT | PSP_UMD_CHANGED);
|
||||
}
|
||||
|
||||
bool __UmdIsInserted() {
|
||||
return UMDInserted;
|
||||
}
|
||||
|
||||
bool getUMDReplacePermit() {
|
||||
return g_UMDReplacePermit;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user