From 131553c47950259dcf2c0d1d41617f6fa91c6749 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Strohh=C3=A4cker?= Date: Wed, 6 Jun 2007 15:44:40 +0000 Subject: [PATCH] initialize private dos segment early; move int33 handler out of rom (Kippesoep) Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2874 --- include/dos_inc.h | 5 ++++- src/dos/dos_tables.cpp | 7 +++---- src/ints/mouse.cpp | 6 +++--- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/include/dos_inc.h b/include/dos_inc.h index 04c91b72..14a594b3 100644 --- a/include/dos_inc.h +++ b/include/dos_inc.h @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dos_inc.h,v 1.65 2007-01-08 20:36:53 qbix79 Exp $ */ +/* $Id: dos_inc.h,v 1.66 2007-06-06 15:44:40 c2woody Exp $ */ #ifndef DOSBOX_DOS_INC_H #define DOSBOX_DOS_INC_H @@ -85,6 +85,9 @@ enum { RETURN_EXIT=0,RETURN_CTRLC=1,RETURN_ABORT=2,RETURN_TSR=3}; #define DOS_SDA_OFS 0 #define DOS_MEM_START 0x102 //First Segment that DOS can use +#define DOS_PRIVATE_SEGMENT 0xc800 +#define DOS_PRIVATE_SEGMENT_END 0xd000 + /* internal Dos Tables */ extern DOS_File * Files[DOS_FILES]; diff --git a/src/dos/dos_tables.cpp b/src/dos/dos_tables.cpp index 5962f524..e8a4b26e 100644 --- a/src/dos/dos_tables.cpp +++ b/src/dos/dos_tables.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dos_tables.cpp,v 1.26 2007-01-08 20:36:53 qbix79 Exp $ */ +/* $Id: dos_tables.cpp,v 1.27 2007-06-06 15:44:40 c2woody Exp $ */ #include "dosbox.h" #include "mem.h" @@ -40,10 +40,10 @@ RealPt DOS_TableLowCase; static Bitu call_casemap; -static Bit16u dos_memseg; +static Bit16u dos_memseg=DOS_PRIVATE_SEGMENT; Bit16u DOS_GetMemory(Bit16u pages) { - if (pages+dos_memseg>=0xd000) { + if (pages+dos_memseg>=DOS_PRIVATE_SEGMENT_END) { E_Exit("DOS:Not enough memory for internal tables"); } Bit16u page=dos_memseg; @@ -73,7 +73,6 @@ static Bit8u country_info[0x22] = { }; void DOS_SetupTables(void) { - dos_memseg=0xc800; Bit16u seg,seg2;Bitu i; dos.tables.mediaid=RealMake(DOS_GetMemory(4),0); dos.tables.tempdta=RealMake(DOS_GetMemory(4),0); diff --git a/src/ints/mouse.cpp b/src/ints/mouse.cpp index b038727d..a0c8711b 100644 --- a/src/ints/mouse.cpp +++ b/src/ints/mouse.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: mouse.cpp,v 1.67 2007-06-03 16:46:33 c2woody Exp $ */ +/* $Id: mouse.cpp,v 1.68 2007-06-06 15:44:40 c2woody Exp $ */ #include #include @@ -961,8 +961,8 @@ Bitu MOUSE_UserInt_CB_Handler(void) { void MOUSE_Init(Section* sec) { // Callback for mouse interrupt 0x33 call_int33=CALLBACK_Allocate(); - RealPt i33loc=RealMake(CB_SEG+1,(call_int33*CB_SIZE)-0x10); -// RealPt i33loc=RealMake(DOS_GetMemory(0x1)-1,0x10); // need another location +// RealPt i33loc=RealMake(CB_SEG+1,(call_int33*CB_SIZE)-0x10); + RealPt i33loc=RealMake(DOS_GetMemory(0x1)-1,0x10); CALLBACK_Setup(call_int33,&INT33_Handler,CB_MOUSE,Real2Phys(i33loc),"Mouse"); // Wasteland needs low(seg(int33))!=0 and low(ofs(int33))!=0 real_writed(0,0x33<<2,i33loc);