From: sparky4 Date: Sat, 27 Jun 2015 19:46:44 +0000 (-0500) Subject: wwww debugy~ X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=6ca6ac83797249d4f46c245d12aa974427779573;p=16.git wwww debugy~ modified: exmmtest.exe modified: src/exmmtest.c modified: src/lib/16_mm.c modified: src/lib/16_mm.h --- diff --git a/exmmtest.exe b/exmmtest.exe index f6c00a31..4708e685 100644 Binary files a/exmmtest.exe and b/exmmtest.exe differ diff --git a/src/exmmtest.c b/src/exmmtest.c index 587fbd5b..b950051b 100644 --- a/src/exmmtest.c +++ b/src/exmmtest.c @@ -30,7 +30,9 @@ main(int argc, char *argv[]) printf("start!\n"); MM_Startup(); printf("done!\n"); + printf("&main()=%Fp\n", *argv[0]); MM_ShowMemory(); + MM_Report(); printf("stop!\n"); MM_Shutdown(); printf("done!\n"); diff --git a/src/lib/16_mm.c b/src/lib/16_mm.c index dcb1428c..acb71982 100644 --- a/src/lib/16_mm.c +++ b/src/lib/16_mm.c @@ -115,6 +115,7 @@ void MML_SetupEMS (void) boolean errorflag=false; union REGS CPURegs; + EMSVer = 0; totalEMSpages = freeEMSpages = EMSpageframe = EMSpagesmapped = 0; __asm @@ -128,6 +129,7 @@ void MML_SetupEMS (void) int EMS_INT or ah,ah jnz error + mov [EMSVer],ax // set EMSVer cmp al,0x32 // only work on ems 3.2 or greater jb error @@ -1019,7 +1021,7 @@ fprintf(stdout, "%s", scratch); ====================== */ -long MM_UnusedMemory (void) +dword MM_UnusedMemory (void) { unsigned free; mmblocktype far *scan; @@ -1049,7 +1051,7 @@ long MM_UnusedMemory (void) ====================== */ -long MM_TotalFree (void) +dword MM_TotalFree (void) { unsigned free; mmblocktype far *scan; @@ -1070,6 +1072,48 @@ long MM_TotalFree (void) //========================================================================== +/* +===================== += += MM_Report += +===================== +*/ + +void MM_Report(void) +{ + printf("EMM %x available\n", EMSVer); + printf("totalEMSpages=%u\n", totalEMSpages); + printf("freeEMSpages=%u\n", freeEMSpages); + printf("EMSpageframe=%Fp\n", EMSpageframe); + printf("UnusedMemory=%lu\n", MM_UnusedMemory()); + printf("TotalFree=%lu\n", MM_TotalFree()); +} + +//========================================================================== + +/* +===================== += += MM_EMSVer += +===================== + + +int MM_EMSVer(void) +{ + int EMSver; + __asm + { + mov ah,EMS_VERSION + int EMS_INT + mov EMSver,ax + } + return(EMSver); +}*/ + +//========================================================================== + /* ===================== = @@ -1083,6 +1127,8 @@ void MM_BombOnError (boolean bomb) bombonerror = bomb; } +//========================================================================== + /////////////////////////////////////////////////////////////////////////// // // US_CheckParm() - checks to see if a string matches one of a set of diff --git a/src/lib/16_mm.h b/src/lib/16_mm.h index fecff72c..a18f0db7 100644 --- a/src/lib/16_mm.h +++ b/src/lib/16_mm.h @@ -161,6 +161,7 @@ static mmblocktype far mmblocks[MAXBLOCKS] static boolean bombonerror; static unsigned totalEMSpages,freeEMSpages,EMSpageframe,EMSpagesmapped,EMShandle; +static unsigned int EMSVer; static void (* XMSaddr) (void); // far pointer to XMS driver @@ -183,8 +184,10 @@ void MM_SortMem (void); void MM_ShowMemory (void); -long MM_UnusedMemory (void); -long MM_TotalFree (void); +dword MM_UnusedMemory (void); +dword MM_TotalFree (void); +void MM_Report(void); +//int MM_EMSVer(void); void MM_BombOnError (boolean bomb);