From bcc8fd57e2d26ff716122dfccc515b5df79fb1ff Mon Sep 17 00:00:00 2001 From: Flyinghead Date: Fri, 21 Dec 2018 15:31:04 +0100 Subject: [PATCH] gdrom: Notify the game that the lid is closed when swapping disc --- core/imgread/common.cpp | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/core/imgread/common.cpp b/core/imgread/common.cpp index 2e60831bf..268cbd542 100644 --- a/core/imgread/common.cpp +++ b/core/imgread/common.cpp @@ -236,6 +236,10 @@ bool InitDrive(u32 fileflags) bool DiscSwap(u32 fileflags) { + // These Additional Sense Codes mean "The lid was closed" + sns_asc = 0x28; + sns_ascq = 0x00; + sns_key = 0x6; if (settings.imgread.LoadDefaultImage) { printf("Loading default image \"%s\"\n",settings.imgread.DefaultImage); @@ -263,16 +267,10 @@ bool DiscSwap(u32 fileflags) { NullDriveDiscType=Open; gd_setdisc(); - sns_asc=0x28; - sns_ascq=0x00; - sns_key=0x6; return true; } else if (gfrv == -1) { - sns_asc=0x28; - sns_ascq=0x00; - sns_key=0x6; return false; } @@ -288,18 +286,9 @@ bool DiscSwap(u32 fileflags) //msgboxf("Selected image failed to load",MBX_ICONERROR); NullDriveDiscType=Open; gd_setdisc(); - sns_asc=0x28; - sns_ascq=0x00; - sns_key=0x6; - return true; - } - else - { - sns_asc=0x28; - sns_ascq=0x00; - sns_key=0x6; - return true; } + + return true; } #endif