1
0
Fork 0

A very fake DPB for some editor.

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2928
This commit is contained in:
Peter Veenstra 2007-07-20 18:53:52 +00:00
parent f1492eb4bc
commit 0620995611
3 changed files with 28 additions and 22 deletions

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: dos_inc.h,v 1.69 2007-06-14 08:23:46 qbix79 Exp $ */
/* $Id: dos_inc.h,v 1.70 2007-07-20 18:53:52 qbix79 Exp $ */
#ifndef DOSBOX_DOS_INC_H
#define DOSBOX_DOS_INC_H
@ -623,6 +623,7 @@ struct DOS_Block {
RealPt filenamechar;
RealPt collatingseq;
Bit8u* country;//Will be copied to dos memory. resides in real mem
Bit16u dpb; //Fake Disk parameter system using only the first entry so the drive letter matches
} tables;
Bit16u loaded_codepage;
};

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: dos.cpp,v 1.102 2007-06-13 07:25:14 qbix79 Exp $ */
/* $Id: dos.cpp,v 1.103 2007-07-20 18:53:52 qbix79 Exp $ */
#include <stdlib.h>
#include <string.h>
@ -385,12 +385,15 @@ static Bitu DOS_21Handler(void) {
dos.return_code=reg_al; //Officially a field in the SDA
dos.return_mode=RETURN_TSR;
break;
case 0x32: /* Get drive parameter block for specific drive */
case 0x1f: /* Get drive parameter block for default drive */
case 0x32: /* Get drive parameter block for specific drive */
{ /* Officially a dpb should be returned as well. The disk detection part is implemented */
Bitu drive=reg_dl;if(!drive) drive=dos.current_drive;else drive--;
Bitu drive=reg_dl;if(!drive || reg_ah==0x1f) drive=dos.current_drive;else drive--;
if(Drives[drive]) {
reg_al=0x00;
LOG(LOG_DOSMISC,LOG_ERROR)("Get drive parameter block.");
reg_al = 0x00;
SegSet16(ds,dos.tables.dpb);
reg_bx = drive;//Faking only the first entry (that is the driveletter)
LOG(LOG_DOSMISC,LOG_ERROR)("Get drive parameter block.");
} else {
reg_al=0xff;
}
@ -987,23 +990,21 @@ static Bitu DOS_21Handler(void) {
LOG(LOG_DOSMISC,LOG_NORMAL)("DOS:Windows long file name support call %2X",reg_al);
break;
case 0x68: /* FFLUSH Commit file */
CALLBACK_SCF(false); //mirek
case 0xE0:
case 0x18: /* NULL Function for CP/M compatibility or Extended rename FCB */
case 0x1d: /* NULL Function for CP/M compatibility or Extended rename FCB */
case 0x1e: /* NULL Function for CP/M compatibility or Extended rename FCB */
case 0x20: /* NULL Function for CP/M compatibility or Extended rename FCB */
case 0x6b: /* NULL Function */
case 0x61: /* UNUSED */
case 0xEF: /* Used in Ancient Art Of War CGA */
case 0x1f: /* Get drive parameter block for default drive */
case 0x68: /* FFLUSH Commit file */
CALLBACK_SCF(false); //mirek
case 0xE0:
case 0x18: /* NULL Function for CP/M compatibility or Extended rename FCB */
case 0x1d: /* NULL Function for CP/M compatibility or Extended rename FCB */
case 0x1e: /* NULL Function for CP/M compatibility or Extended rename FCB */
case 0x20: /* NULL Function for CP/M compatibility or Extended rename FCB */
case 0x6b: /* NULL Function */
case 0x61: /* UNUSED */
case 0xEF: /* Used in Ancient Art Of War CGA */
case 0x5c: /* FLOCK File region locking */
case 0x5e: /* More Network Functions */
default:
LOG(LOG_DOSMISC,LOG_ERROR)("DOS:Unhandled call %02X al=%02X. Set al to default of 0",reg_ah,reg_al);
reg_al=0x00; /* default value */
default:
LOG(LOG_DOSMISC,LOG_ERROR)("DOS:Unhandled call %02X al=%02X. Set al to default of 0",reg_ah,reg_al);
reg_al=0x00; /* default value */
break;
};
return CBRET_NONE;

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: dos_tables.cpp,v 1.28 2007-06-12 20:22:08 c2woody Exp $ */
/* $Id: dos_tables.cpp,v 1.29 2007-07-20 18:53:52 qbix79 Exp $ */
#include "dosbox.h"
#include "mem.h"
@ -145,6 +145,10 @@ void DOS_SetupTables(void) {
real_writew(seg,4,100); //File Table supports 100 files
dos_infoblock.SetFCBTable(RealMake(seg,0));
/* Create a fake DPB */
dos.tables.dpb=DOS_GetMemory(2);
for(Bitu d=0;d<26;d++) real_writeb(dos.tables.dpb,d,d);
/* Create a fake disk buffer head */
seg=DOS_GetMemory(6);
for (Bitu ct=0; ct<0x20; ct++) real_writeb(seg,ct,0);