From: sparky4 Date: Thu, 2 Jul 2015 03:22:38 +0000 (-0500) Subject: wwww X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=75f9886bf0429a7b0fca040dd54d217f85cd115b;p=16.git wwww modified: exmmtest.exe modified: src/lib/16_mm.c modified: src/lib/16_mm.h --- diff --git a/exmmtest.exe b/exmmtest.exe index 51657d3c..a4658f2a 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 e738cad5..3a45e729 100644 --- a/src/lib/16_mm.c +++ b/src/lib/16_mm.c @@ -41,7 +41,11 @@ EMS / XMS unmanaged routines ============================================================================= */ +/* + +Open Watcom port by sparky4 +*/ #include "src/lib/16_mm.h" /* @@ -52,10 +56,6 @@ EMS / XMS unmanaged routines ============================================================================= */ -//mminfo_t mminfo; -//memptr bufferseg; -//boolean mmerror; - void (* beforesort) (void); void (* aftersort) (void); void (* XMSaddr) (void); // far pointer to XMS driver @@ -68,22 +68,6 @@ void (* XMSaddr) (void); // far pointer to XMS driver ============================================================================= */ -//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",""}; /* @@ -432,6 +416,7 @@ void MML_UseSpace(unsigned segstart, unsigned seglength, mminfo_t *mm) { mmblocktype far *scan,far *last; unsigned oldend; + //++++if(mm->EMSVer) long extra; scan = last = mm->mmhead; @@ -528,7 +513,7 @@ void MM_Startup(mminfo_t *mm, mminfotype *mmi) { int i; dword length; - void far *start; + void huge *start; unsigned segstart,seglength,endfree; if(mm->mmstarted) @@ -565,7 +550,7 @@ void MM_Startup(mminfo_t *mm, mminfotype *mmi) //---- length=coreleft(); _nheapgrow(); length=_memavl(); - start = (void far *)(mm->nearheap = malloc(length)); + start = (void huge *)(mm->nearheap = malloc(length)); length -= 16-(FP_OFF(start)&15); length -= SAVENEARHEAP; diff --git a/src/lib/16_mm.h b/src/lib/16_mm.h index 1fb701a2..7ef05e23 100644 --- a/src/lib/16_mm.h +++ b/src/lib/16_mm.h @@ -90,10 +90,6 @@ typedef struct //========================================================================== -/*extern mminfotype mminfo; -extern memptr bufferseg; -extern boolean mmerror;*/ - extern void (* beforesort) (void); extern void (* aftersort) (void); extern void (* XMSaddr) (void); // far pointer to XMS driver @@ -120,7 +116,7 @@ typedef struct mmblockstruct unsigned start,length; unsigned attributes; memptr *useptr; // pointer to the segment start - struct mmblockstruct far *next; + struct mmblockstruct huge *next; } mmblocktype; @@ -137,11 +133,6 @@ typedef struct mmblocktype huge mmblocks[MAXBLOCKS],huge *mmhead,huge *mmfree,huge *mmrover,huge *mmnew; } mminfo_t; - -//#define GETNEWBLOCK {if(!(mmnew=mmfree))Quit("MM_GETNEWBLOCK: No free blocks!");mmfree=mmfree->next;} -//#define GETNEWBLOCK {if(!mmfree)MML_ClearBlock();mmnew=mmfree;mmfree=mmfree->next;} -//#define FREEBLOCK(x) {*x->useptr=NULL;x->next=mmfree;mmfree=x;} - /* ============================================================================= @@ -150,11 +141,6 @@ typedef struct ============================================================================= */ -/*static mminfotype mminfo; -static memptr bufferseg; - -static void (* beforesort) (void); -static void (* aftersort) (void);*/ /* ============================================================================= @@ -164,21 +150,6 @@ static void (* aftersort) (void);*/ ============================================================================= */ -/*static void huge *hugeheap; -static void far *farheap; -static void *nearheap; - -static mmblocktype far mmblocks[MAXBLOCKS] - ,far *mmhead,far *mmfree,far *mmrover,far *mmnew; - - -static unsigned totalEMSpages,freeEMSpages,EMSpageframe,EMSpagesmapped,EMShandle; -static unsigned int EMSVer; - -static void (* XMSaddr) (void); // far pointer to XMS driver - -static unsigned numUMBs,UMBbase[MAXUMBS];*/ - //========================================================================== boolean MML_CheckForEMS(void);