-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix "Akaya Akashiya Ayakashi" umd switch #9245
Changes from 2 commits
bd6764b
033e060
3f92bac
c83db04
2c58d34
860661d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,10 @@ | |
#include "Core/FileSystems/MetaFileSystem.h" | ||
#include "Core/FileSystems/ISOFileSystem.h" | ||
#include "Core/FileSystems/VirtualDiscFileSystem.h" | ||
#include "base/timeutil.h" | ||
#ifdef USING_WIN_UI | ||
#include "Windows/MainWindowMenu.h" | ||
#endif | ||
|
||
const u64 MICRO_DELAY_ACTIVATE = 4000; | ||
|
||
|
@@ -51,6 +55,7 @@ static std::vector<SceUID> umdWaitingThreads; | |
static std::map<SceUID, u64> umdPausedWaits; | ||
|
||
bool UMDReplacePermit = false; | ||
bool UMD_insterted = true; | ||
|
||
struct PspUmdInfo { | ||
u32_le size; | ||
|
@@ -225,8 +230,12 @@ void __UmdEndCallback(SceUID threadID, SceUID prevCallbackId) | |
|
||
static int sceUmdCheckMedium() | ||
{ | ||
DEBUG_LOG(SCEIO, "1=sceUmdCheckMedium()"); | ||
return 1; //non-zero: disc in drive | ||
if (UMD_insterted) { | ||
DEBUG_LOG(SCEIO, "1=sceUmdCheckMedium()"); | ||
return 1; //non-zero: disc in drive | ||
} | ||
DEBUG_LOG(SCEIO, "0=sceUmdCheckMedium()"); | ||
return 0; | ||
} | ||
|
||
static u32 sceUmdGetDiscInfo(u32 infoAddr) | ||
|
@@ -495,7 +504,9 @@ void __UmdReplace(std::string filepath) { | |
} | ||
} | ||
delete currentUMD; | ||
|
||
UMD_insterted = false; | ||
sleep_ms(200); // Wait sceUmdCheckMedium call | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm, this isn't very nice .. on the other hand, this will probably be pretty reliable as long as __UmdReplace is not called from the emulator thread. I fear though that it may be, on Android? Got to check to be sure though. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A better solution may be to schedule an event (you know, RegisterEvent and so on) that will set UMDInserted back after a little bit. |
||
UMD_insterted = true; | ||
// TODO Is this always correct if UMD was not activated? | ||
u32 notifyArg = PSP_UMD_PRESENT | PSP_UMD_READABLE | PSP_UMD_CHANGED; | ||
if (driveCBId != -1) | ||
|
@@ -510,13 +521,19 @@ static u32 sceUmdReplaceProhibit() | |
{ | ||
UMDReplacePermit = false; | ||
DEBUG_LOG(SCEIO,"sceUmdReplaceProhibit()"); | ||
#ifdef USING_WIN_UI | ||
MainWindow::ChangeMenu(); | ||
#endif | ||
return 0; | ||
} | ||
|
||
static u32 sceUmdReplacePermit() | ||
{ | ||
UMDReplacePermit = true; | ||
DEBUG_LOG(SCEIO,"sceUmdReplacePermit()"); | ||
#ifdef USING_WIN_UI | ||
MainWindow::ChangeMenu(); | ||
#endif | ||
return 0; | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rename UMDInserted , simple spelling mistake :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done