From: sparky4 Date: Tue, 30 Jun 2015 18:41:36 +0000 (-0500) Subject: wwww X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=30f65fd0522760590835d2404e8a9ee8d438b410;p=16.git wwww modified: 16.exe modified: exmmtest.exe modified: maptest.exe modified: src/lib/16_mm.c modified: src/lib/16_mm.h --- diff --git a/16.exe b/16.exe index bb8b419c..ff14de13 100644 Binary files a/16.exe and b/16.exe differ diff --git a/exmmtest.exe b/exmmtest.exe index c52affc1..e5cb3dfc 100644 Binary files a/exmmtest.exe and b/exmmtest.exe differ diff --git a/maptest.exe b/maptest.exe index 30bb5541..785bed3f 100644 Binary files a/maptest.exe and b/maptest.exe differ diff --git a/src/lib/16_mm.c b/src/lib/16_mm.c index b609f2e7..5ff94f28 100644 --- a/src/lib/16_mm.c +++ b/src/lib/16_mm.c @@ -150,7 +150,7 @@ boolean MML_CheckForEMS (void) ======================= */ -void MML_SetupEMS (void) +unsigned MML_SetupEMS (void) { char str[80],str2[10]; unsigned err; @@ -214,8 +214,10 @@ End: strcpy(str,"MML_SetupEMS: EMS error 0x"); itoa(err,str2,16); strcpy(str,str2); - printf("%s\n",str); - } + printf("%s\n",str); + return err; + } + return 0; } @@ -257,7 +259,7 @@ void MML_ShutdownEMS (void) ==================== */ -void MM_MapEMS (void) +unsigned MM_MapEMS (void) { char str[80],str2[10]; unsigned err; @@ -287,10 +289,11 @@ void MM_MapEMS (void) strcpy(str,"MM_MapEMS: EMS error 0x"); itoa(err,str2,16); strcpy(str,str2); - printf("%s\n",str); + printf("%s\n",str); + return err; } } - return; + return 0; } //========================================================================== @@ -1084,8 +1087,8 @@ dword MM_UnusedMemory (void) scan = scan->next; } -// return free*16l; - return free; + return free*16l; +// return free; } //========================================================================== @@ -1117,8 +1120,8 @@ dword MM_TotalFree (void) scan = scan->next; } -// return free*16l; - return free; + return free*16l; +// return free; } //========================================================================== diff --git a/src/lib/16_mm.h b/src/lib/16_mm.h index 6b1c535e..5889aaaa 100644 --- a/src/lib/16_mm.h +++ b/src/lib/16_mm.h @@ -26,11 +26,11 @@ #include "src/lib/lib_head.h" //++++mh #include "src/lib/16_in.h" -//****#if 1 // 1 == Debug/Dev ; 0 == Production/final +#ifdef __DEBUG__ // 1 == Debug/Dev ; 0 == Production/final #define OUT_OF_MEM_MSG "MM_GetPtr: Out of memory!\nYou were short :%ld bytes" -//****#else -//****#define OUT_OF_MEM_MSG "\npee\n" -//****#endif +#else +#define OUT_OF_MEM_MSG "\npee\n" +#endif #define SAVENEARHEAP 0x400 // space to leave in data segment @@ -79,6 +79,7 @@ #define XMS_FREEUMB 0x11 //========================================================================== +//I hope this is correct! //__segment seg; typedef void __based(__self) * memptr; //__based(seg) * memptr; @@ -192,8 +193,9 @@ void MM_BombOnError (boolean bomb); // boolean MML_CheckForEMS (void); +unsigned MML_SetupEMS (void); void MML_ShutdownEMS (void); -void MM_MapEMS (void); +unsigned MM_MapEMS (void); boolean MML_CheckForXMS (void); void MML_ShutdownXMS (void); void MML_UseSpace (unsigned segstart, unsigned seglength);