From dd304cbef1ab9f8ebbdd69b175b02cd45cdf687d Mon Sep 17 00:00:00 2001 From: ripsaw8080 Date: Fri, 17 Aug 2018 14:28:56 +0000 Subject: [PATCH] Return correct error code for verify sectors function when an invalid drive is specified. Fixes Hugo Troll game installers. Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4137 --- src/ints/bios_disk.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ints/bios_disk.cpp b/src/ints/bios_disk.cpp index c3683db4..d2afcaa8 100644 --- a/src/ints/bios_disk.cpp +++ b/src/ints/bios_disk.cpp @@ -325,6 +325,8 @@ static Bitu INT13_DiskHandler(void) { //drivenum = 0; //LOG_MSG("INT13: Function %x called on drive %x (dos drive %d)", reg_ah, reg_dl, drivenum); + + // NOTE: the 0xff error code returned in some cases is questionable; 0x01 seems more correct switch(reg_ah) { case 0x0: /* Reset disk */ { @@ -440,7 +442,10 @@ static Bitu INT13_DiskHandler(void) { CALLBACK_SCF(true); return CBRET_NONE; } - if(driveInactive(drivenum)) return CBRET_NONE; + if(driveInactive(drivenum)) { + reg_ah = last_status; + return CBRET_NONE; + } /* TODO: Finish coding this section */ /*