From: sparky4 Date: Tue, 30 Jun 2015 00:22:54 +0000 (-0500) Subject: started to work on mm libery~ X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=97d898169d2e247f35d2467ea38ff8d2dc3e7720;p=16.git started to work on mm libery~ modified: exmmtest.exe modified: src/lib/16_mm.c modified: src/lib/16_mm.h --- diff --git a/exmmtest.exe b/exmmtest.exe index ee5838f3..3306249c 100644 Binary files a/exmmtest.exe and b/exmmtest.exe differ diff --git a/src/lib/16_mm.c b/src/lib/16_mm.c index 9dbc0eef..52fdf8e9 100644 --- a/src/lib/16_mm.c +++ b/src/lib/16_mm.c @@ -43,6 +43,48 @@ EMS / XMS unmanaged routines */ #include "src/lib/16_mm.h" + +/* +============================================================================= + + GLOBAL VARIABLES + +============================================================================= +*/ + +mminfotype mminfo; +memptr bufferseg; +boolean mmerror; + +void (* beforesort) (void); +void (* aftersort) (void); + +/* +============================================================================= + + LOCAL VARIABLES + +============================================================================= +*/ + +boolean mmstarted; + +void far *farheap; +void *nearheap; + +mmblocktype far mmblocks[MAXBLOCKS] + ,far *mmhead,far *mmfree,far *mmrover,far *mmnew; + +boolean bombonerror; + +unsigned totalEMSpages,freeEMSpages,EMSpageframe,EMSpagesmapped,EMShandle; +unsigned int EMSVer; + +void (* XMSaddr) (void); // far pointer to XMS driver + +unsigned numUMBs,UMBbase[MAXUMBS]; + +static char *ParmStringsexmm[] = {"noems","noxms",""}; /* ====================== @@ -570,7 +612,7 @@ emsskip: if (MML_CheckForXMS()) { // printf("XMS!\n"); - MML_SetupXMS(); // allocate as many UMBs as possible +//++++ MML_SetupXMS(); // allocate as many UMBs as possible } // @@ -599,11 +641,16 @@ void MM_Shutdown (void) if (!mminfo.mmstarted) return; - _ffree (farheap); - free (nearheap); - hfree(hugeheap); - MML_ShutdownEMS (); - MML_ShutdownXMS (); + _ffree (farheap); + printf("far freed\n"); + free (nearheap); + printf("near freed\n"); + //hfree(hugeheap); + printf("huge freed\n"); + MML_ShutdownEMS (); + printf("EMS freed\n"); +//++++ MML_ShutdownXMS (); + printf("XMS freed\n"); } //========================================================================== @@ -1175,4 +1222,3 @@ US_CheckParm(char *parm,char **strings) } return(-1); } - diff --git a/src/lib/16_mm.h b/src/lib/16_mm.h index fceb1550..701f002d 100644 --- a/src/lib/16_mm.h +++ b/src/lib/16_mm.h @@ -135,11 +135,11 @@ typedef struct mmblockstruct ============================================================================= */ -static mminfotype mminfo; +/*static mminfotype mminfo; static memptr bufferseg; static void (* beforesort) (void); -static void (* aftersort) (void); +static void (* aftersort) (void);*/ /* ============================================================================= @@ -149,7 +149,7 @@ static void (* aftersort) (void); ============================================================================= */ -static void huge *hugeheap; +/*static void huge *hugeheap; static void far *farheap; static void *nearheap; @@ -162,9 +162,7 @@ static unsigned int EMSVer; static void (* XMSaddr) (void); // far pointer to XMS driver -static unsigned numUMBs,UMBbase[MAXUMBS]; - -static char *ParmStringsexmm[] = {"noems","noxms",""}; +static unsigned numUMBs,UMBbase[MAXUMBS];*/ //==========================================================================