From 38117780b50f291b5d099ea9edc35c2d52f8fc2e Mon Sep 17 00:00:00 2001 From: Ulf Wohlers Date: Fri, 8 Nov 2002 14:13:54 +0000 Subject: [PATCH] Added int 27 handler (tsr) Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@490 --- src/dos/dos.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/dos/dos.cpp b/src/dos/dos.cpp index a7e24bc0..07ae0e9a 100644 --- a/src/dos/dos.cpp +++ b/src/dos/dos.cpp @@ -32,7 +32,7 @@ DOS_Block dos; DOS_InfoBlock dos_infoblock; Bit8u dos_copybuf[0x10000]; -static Bitu call_20,call_21; +static Bitu call_20,call_21,call_27; void DOS_SetError(Bit16u code) { dos.errorcode=code; @@ -840,6 +840,13 @@ static Bitu DOS_20Handler(void) { return CBRET_NONE; } +static Bitu DOS_27Handler(void) +{ + // Terminate & stay resident + Bit16u para = (reg_dx/16)+((reg_dx % 16)>0); + if (DOS_ResizeMemory(dos.psp,¶)) DOS_Terminate(true); + return CBRET_NONE; +} void DOS_Init(Section* sec) { MSG_Add("DOS_CONFIGFILE_HELP","Setting a memory size to 0 will disable it.\n"); @@ -851,6 +858,10 @@ void DOS_Init(Section* sec) { CALLBACK_Setup(call_21,DOS_21Handler,CB_IRET); RealSetVec(0x21,CALLBACK_RealPointer(call_21)); + call_27=CALLBACK_Allocate(); + CALLBACK_Setup(call_27,DOS_27Handler,CB_IRET); + RealSetVec(0x27,CALLBACK_RealPointer(call_27)); + DOS_SetupFiles(); /* Setup system File tables */ DOS_SetupDevices(); /* Setup dos devices */ DOS_SetupTables();