CDVD: catch MEC/NVM file exception

It will stop the emulation and open a nice box with an error message instead of terminate PCSX2
This commit is contained in:
Gregory Hainaut 2016-08-15 14:09:01 +02:00
parent deb7121fde
commit 0f1c10230a
1 changed files with 599 additions and 592 deletions

View File

@ -1420,6 +1420,7 @@ static __fi void fail_pol_cal()
static void cdvdWrite16(u8 rt) // SCOMMAND static void cdvdWrite16(u8 rt) // SCOMMAND
{ {
try {
// cdvdTN diskInfo; // cdvdTN diskInfo;
// cdvdTD trackInfo; // cdvdTD trackInfo;
// int i, lbn, type, min, sec, frm, address; // int i, lbn, type, min, sec, frm, address;
@ -2034,6 +2035,12 @@ static void cdvdWrite16(u8 rt) // SCOMMAND
//Console.WriteLn("SCMD - 0x%x\n", rt); //Console.WriteLn("SCMD - 0x%x\n", rt);
cdvd.ParamP = 0; cdvd.ParamP = 0;
cdvd.ParamC = 0; cdvd.ParamC = 0;
} catch (Exception::CannotCreateStream& ex) {
Cpu->ThrowException(Exception::RuntimeError()
.SetDiagMsg(L"Failed to read/write NMV/MEC file.")
.SetUserMsg(pxE( L"Failed to read/write NMV/MEC file. Check your bios setup/permission settings"))
);
}
} }
static __fi void cdvdWrite17(u8 rt) { // SDATAIN static __fi void cdvdWrite17(u8 rt) { // SDATAIN