From bd6e01565dbec72a1062838645659b86c353756b Mon Sep 17 00:00:00 2001 From: ripsaw8080 Date: Fri, 13 Mar 2015 12:35:30 +0000 Subject: [PATCH] Amend previous MSCDEX change to use presence of cdrom device to determine the installed condition, which means unmounting will not revert to the uninstalled condition. Pass unhandled functions back to the multiplex handler, which if nothing else will generate log messages about them being unhandled. Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3902 --- src/dos/dos_mscdex.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/dos/dos_mscdex.cpp b/src/dos/dos_mscdex.cpp index ab166b47..d33af13d 100644 --- a/src/dos/dos_mscdex.cpp +++ b/src/dos/dos_mscdex.cpp @@ -1158,14 +1158,13 @@ static Bitu MSCDEX_Interrupt_Handler(void) { static bool MSCDEX_Handler(void) { if(reg_ah == 0x11) { if(reg_al == 0x00) { - if (mscdex->GetNumDrives()>0) { - PhysPt check = PhysMake(SegValue(ss),reg_sp); - if(mem_readw(check+6) == 0xDADA) { - //MSCDEX sets word on stack to ADAD if it DADA on entry. - mem_writew(check+6,0xADAD); - } - reg_al = 0xff; + if (mscdex->rootDriverHeaderSeg==0) return false; + PhysPt check = PhysMake(SegValue(ss),reg_sp); + if(mem_readw(check+6) == 0xDADA) { + //MSCDEX sets word on stack to ADAD if it DADA on entry. + mem_writew(check+6,0xADAD); } + reg_al = 0xff; return true; } else { LOG(LOG_MISC,LOG_ERROR)("NETWORK REDIRECTOR USED!!!"); @@ -1176,7 +1175,7 @@ static bool MSCDEX_Handler(void) { } if (reg_ah!=0x15) return false; // not handled here, continue chain - if (mscdex->GetNumDrives()==0) return true; // do nothing if MSCDEX not active + if (mscdex->rootDriverHeaderSeg==0) return false; // not handled if MSCDEX not installed PhysPt data = PhysMake(SegValue(es),reg_bx); MSCDEX_LOG("MSCDEX: INT 2F %04X BX= %04X CX=%04X",reg_ax,reg_bx,reg_cx); @@ -1184,7 +1183,7 @@ static bool MSCDEX_Handler(void) { case 0x1500: /* Install check */ reg_bx = mscdex->GetNumDrives(); - reg_cx = mscdex->GetFirstDrive(); + if (reg_bx>0) reg_cx = mscdex->GetFirstDrive(); reg_al = 0xff; return true; case 0x1501: /* Get cdrom driver info */