-\e[0mSeg:0 Size:9878 Owner:0x0\r
-\e[41;31m++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\e[0m\e[47;37m_\e[0m\r
+\e[0mSeg:0 Size:7705 Owner:0x0\r
+\e[41;31m+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\e[0m\e[47;37m_\e[0m\r
\e[42;32m0\r
-\e[0m\e[0mSeg:2696 Size:256 Owner:0x47b4\r
+\e[0m\e[0mSeg:1e19 Size:256 Owner:0x527c\r
\e[44;34m++++\e[0m\e[47;37m_\e[0m\r
\e[42;32m\r
-\e[0m\e[0mSeg:2796 Size:273 Owner:0x92cc\r
-\e[44;34m+++++\e[0m\e[47;37m_\e[0m\r
+\e[0m\e[0mSeg:1f19 Size:273 Owner:0x92d4\r
+\e[44;34m++++\e[0m\e[47;37m_\e[0m\r
\e[42;32m\r
-\e[0m\e[0mSeg:2d25 Size:40 Owner:0x0\r
+\e[0m\e[0mSeg:24a8 Size:40 Owner:0x0\r
\e[41;31m+\e[0m\e[47;37m_\e[0m\r
-\e[42;32m000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\r
-\e[0m\e[0mSeg:bd4d Size:8883 Owner:0x0\r
-\e[41;31m++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\e[0m\e[47;37m_\e[0m\r
+\e[42;32m000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\r
+\e[0m\e[0mSeg:b4d0 Size:11056 Owner:0x0\r
+\e[41;31m+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\e[0m\e[47;37m_\e[0m\r
\e[42;32m\r
\e[0m\e[0mSeg:e000 Size:8191 Owner:0x0\r
\e[41;31m++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\e[0m\e[47;37m_\e[0m
\ No newline at end of file
\r
== default ==\r
\r
- FREE block at 2b0b0016 of size 18\r
- USED block at 2b0b0028 of size 136\r
- USED block at 2b0b00b0 of size 50\r
- USED block at 2b0b00e2 of size 50\r
- USED block at 2b0b0114 of size 50\r
- USED block at 2b0b0146 of size 50\r
- USED block at 2b0b0178 of size 50\r
- USED block at 2b0b01aa of size 50\r
- USED block at 2b0b01dc of size 50\r
- USED block at 2b0b020e of size 50\r
- USED block at 2b0b0240 of size 50\r
- USED block at 2b0b0272 of size 50\r
- USED block at 2b0b02a4 of size 50\r
- USED block at 2b0b02d6 of size 50\r
- USED block at 2b0b0308 of size 50\r
- FREE block at 2b0b033a of size 14\r
- USED block at 2b0b0348 of size 20\r
- FREE block at 2b0b035c of size 7328\r
+ USED block at 24ca0016 of size 66\r
+ FREE block at 24ca0058 of size 18\r
+ USED block at 24ca006a of size 136\r
+ USED block at 24ca00f2 of size 20\r
+ FREE block at 24ca0106 of size 7926\r
OK - end of heap\r
\r
== near ==\r
\r
- USED block at 1b0aa346 of size 12\r
- USED block at 1b0aa352 of size 326\r
- USED block at 1b0aa498 of size 52\r
- USED block at 1b0aa4cc of size 20\r
- USED block at 1b0aa4e0 of size 20\r
- USED block at 1b0aa4f4 of size 20\r
- USED block at 1b0aa508 of size 20\r
- USED block at 1b0aa51c of size 20\r
- USED block at 1b0aa530 of size 23244\r
+ USED block at 14c99306 of size 12\r
+ USED block at 14c99312 of size 328\r
+ USED block at 14c9945a of size 52\r
+ USED block at 14c9948e of size 20\r
+ USED block at 14c994a2 of size 20\r
+ USED block at 14c994b6 of size 20\r
+ USED block at 14c994ca of size 20\r
+ USED block at 14c994de of size 20\r
+ USED block at 14c994f2 of size 27402\r
OK - end of heap\r
\r
== far ==\r
\r
- USED block at 2b0b0016 of size 18\r
- USED block at 2b0b0028 of size 136\r
- USED block at 2b0b00b0 of size 50\r
- USED block at 2b0b00e2 of size 50\r
- USED block at 2b0b0114 of size 50\r
- USED block at 2b0b0146 of size 50\r
- USED block at 2b0b0178 of size 50\r
- USED block at 2b0b01aa of size 50\r
- USED block at 2b0b01dc of size 50\r
- USED block at 2b0b020e of size 50\r
- USED block at 2b0b0240 of size 50\r
- USED block at 2b0b0272 of size 50\r
- USED block at 2b0b02a4 of size 50\r
- USED block at 2b0b02d6 of size 50\r
- USED block at 2b0b0308 of size 50\r
- USED block at 2b0b033a of size 14\r
- USED block at 2b0b0348 of size 20\r
- USED block at 2b0b035c of size 7328\r
+ USED block at 24ca0016 of size 66\r
+ USED block at 24ca0058 of size 18\r
+ USED block at 24ca006a of size 136\r
+ USED block at 24ca00f2 of size 20\r
+ USED block at 24ca0106 of size 7926\r
OK - end of heap\r
\r
Memory Type Total Used Free\r
---------------- -------- -------- --------\r
-Default 8166 806 7360\r
-Near 23734 490 23244\r
-Far 8166 806 7360\r
+Default 8166 222 7944\r
+Near 27894 492 27402\r
+Far 8166 222 7944\r
---------------- -------- -------- --------\r
-coreleft = 23242\r
-farcoreleft = 38624\r
-GetFreeSize = 15402\r
-GetNearFreeSize = 23244\r
-GetFarFreeSize = 15402\r
-memavl = 23242\r
-stackavail = 11767\r
+coreleft = 27400\r
+farcoreleft = 2422\r
+GetFreeSize = 40578\r
+GetNearFreeSize = 27402\r
+GetFarFreeSize = 40578\r
+memavl = 27400\r
+stackavail = 11848\r
/*\r
exmm test\r
*/\r
-//#include <stdio.h>\r
-//#include <bios.h>\r
-\r
#include "src/lib/16_head.h"\r
#include "src/lib/16_ca.h"\r
#include "src/lib/16_mm.h"\r
#define FILERL\r
//#define FILEREAD\r
\r
-global_game_variables_t gvar;\r
+#define PRINTBB { printf("&main()= %Fp\n", argv[0]);printf("bigbuffer= %Fp\n", bigbuffer);printf("&bigbuffer= %Fp\n", &bigbuffer);printf("bigbuffer= %04x\n", bigbuffer);printf("&bigbuffer= %04x\n", &bigbuffer); }\r
\r
void\r
main(int argc, char *argv[])\r
{\r
+ global_game_variables_t gvar;\r
#ifdef __WATCOMC__\r
__segment sega;\r
void __based(sega)* bigbuffer;\r
#ifdef __BORLANDC__\r
argc=argc;\r
#endif\r
- //printf("&main()= %Fp\n", *argv[0]);\r
- //printf("bigbuffer= %Fp\n", bigbuffer);\r
- //printf("&bigbuffer= %Fp\n", &bigbuffer);\r
- //printf("bigbuffer= %04x\n", bigbuffer);\r
- //printf("&bigbuffer= %04x\n", &bigbuffer);\r
-\r
#ifdef FILERL\r
bakapee = malloc(64);\r
#endif\r
gvar.mm.mmstarted=0;\r
\r
+ //PRINTBB\r
#ifdef FILERL\r
if(argv[1]) bakapee = argv[1];\r
else\r
- {\r
- printf("filename!: ");\r
- scanf("%[^\n]", &bakapee);\r
- }\r
-// bakapee = "data/koishi~.pcx";\r
+ //{ printf("filename!: "); scanf("%[^\n]", &bakapee); }\r
+ bakapee = "data/koishi~.pcx";\r
#endif\r
\r
// printf("main()=%Fp start MM\n", *argv[0]);\r
//PM_UnlockMainMem();\r
CA_Startup(&gvar);\r
// printf(" done!\n");\r
- //printf("&main()= %Fp\n", *argv[0]);\r
- //printf("bigbuffer= %Fp\n", bigbuffer);\r
- //printf("&bigbuffer= %Fp\n", &bigbuffer);\r
- //printf("bigbuffer= %04x\n", bigbuffer);\r
- //printf("&bigbuffer= %04x\n", &bigbuffer);\r
+ //PRINTBB\r
// getch();\r
#ifdef FILERL\r
// bakapeehandle = open(bakapee,O_RDONLY | O_BINARY, S_IREAD);\r
// close(bakapeehandle);\r
//hmm functions in cache system use the buffered stuff\r
#ifdef __WATCOMC__\r
- printf("size of big buffer~=%u\n", _bmsize(sega, bigbuffer));\r
+ printf("\nsize of big buffer~=%u\n", _bmsize(sega, bigbuffer));\r
#endif\r
#endif\r
printf("press any key to continue!\n");\r
getch();\r
- printf("[\n%s\n]\n", bigbuffer);\r
+ printf("\n\ncontents of the buffer\n[\n%s\n]\n", bigbuffer);\r
//printf("dark purple = purgable\n");\r
//printf("medium blue = non purgable\n");\r
//printf("red = locked\n");\r
printf("press any key to continue!\n");\r
getch();\r
- //++++modexEnter();\r
- //++++modexShowPage(&screen);\r
MM_ShowMemory(&gvar, &gvar.mm);\r
//getch();\r
MM_DumpData(&gvar.mm);\r
- //++++modexLeave();\r
- //++++MM_Report(&gvar.mm, &gvar.mmi);\r
+ MM_Report(&gvar);\r
// printf(" stop!\n");\r
+ getch();\r
#ifdef FILERL\r
MM_FreePtr(&bigbuffer, &gvar.mm);\r
#endif\r
printf("&near= %Fp ", &(gvar.mm.nearheap));\r
printf("&far= %Fp", &(gvar.mm.farheap));\r
printf("\n");\r
+#ifdef EXMMVERBOSE\r
printf("bigb= %Fp ", bigbuffer);\r
//printf("bigbr= %04x", bigbuffer);\r
//printf("\n");\r
printf("&bigb=%Fp ", &bigbuffer);\r
//printf("&bigb=%04x", &bigbuffer);\r
printf("\n");\r
+#endif\r
printf("========================================\n");\r
#ifdef __WATCOMC__\r
- printf("Total free: %lu\n", (dword)(GetFreeSize()));\r
+//this is far printf("Total free: %lu\n", (dword)(GetFreeSize()));\r
printf("Total near free: %lu\n", (dword)(GetNearFreeSize()));\r
printf("Total far free: %lu\n", (dword)(GetFarFreeSize()));\r
heapdump(&gvar);\r
+ #endif\r
printf("Project 16 emmtest.exe. This is just a test file!\n");\r
printf("version %s\n", VERSION);\r
-#endif\r
//printf("core left: %lu\n", (dword)_coreleft());\r
//printf("far core left: %lu\n", (dword)_farcoreleft());\r
//printf("based core left: %lu\n", (dword)_basedcoreleft());\r
unlink("profile.16w");\r
gvar->handle.profilehandle = open("profile.16w", O_CREAT | O_WRONLY | O_TEXT);\r
#endif\r
+#endif//profile\r
+\r
+#ifdef __BORLANDC__\r
+ unlink("meminfo.16b");\r
+ gvar->handle.showmemhandle = open("meminfo.16b", O_CREAT | O_WRONLY | O_TEXT);\r
+#endif\r
+#ifdef __WATCOMC__\r
+ unlink("meminfo.16w");\r
+ gvar->handle.showmemhandle = open("meminfo.16w", O_CREAT | O_WRONLY | O_TEXT);\r
#endif\r
/* CAL_SetupMapFile ();\r
CAL_SetupGrFile ();\r
#ifdef PROFILE\r
close(gvar->handle.profilehandle);\r
#endif\r
-// close(gvar->handle.showmemhandle);\r
+ close(gvar->handle.showmemhandle);\r
/*++++\r
close(maphandle);\r
close(grhandle);\r
\r
//#define NUMMAPS 39\r
//#define MAPPLANES 3\r
-#define PROFILE\r
+//++++#define PROFILE//++++\r
\r
//===========================================================================\r
\r
=====================
*/
-void MM_Report(/*page_t *page, */mminfo_t *mm, mminfotype *mmi)
+void MM_Report(global_game_variables_t *gvar)
{
+ printf("========================================\n");
+ printf(" MM_Report\n");
+ printf("========================================\n");
if(MML_CheckForEMS())
{
- printf("EMM v%x.%x available\n", mm->EMSVer>>4,mm->EMSVer&0x0F);
- printf("totalEMSpages=%u\n", mm->totalEMSpages);
- printf("freeEMSpages=%u\n", mm->freeEMSpages);
- printf("EMSpageframe=%x\n", mm->EMSpageframe);
+ printf(" LIMEMS\n");
+ printf(" EMM v%x.%x available\n", gvar->mm.EMSVer>>4,gvar->mm.EMSVer&0x0F);
+ printf(" totalEMSpages: %u ", gvar->mm.totalEMSpages); printf("freeEMSpages: %u\n", gvar->mm.freeEMSpages);
+ printf(" EMSpageframe: %x\n", gvar->mm.EMSpageframe);
}
- if(MML_CheckForXMS(mm)) printf("XMSaddr=%X\n", *XMSaddr);
- printf("near=%lu\n", mmi->nearheap);
- printf("far=%lu\n", mmi->farheap);
- printf("EMSmem=%lu\n", mmi->EMSmem);
- printf("XMSmem=%lu\n", mmi->XMSmem);
- printf("mainmem=%lu\n", mmi->mainmem);
- printf("UnusedMemory=%lu\n", MM_UnusedMemory(mm));
- printf("TotalFree=%lu\n", MM_TotalFree(mm));
- printf("TotalUsed=%lu\n", mmi->mainmem+mmi->EMSmem+mmi->XMSmem+mmi->XMSmem);
+ if(MML_CheckForXMS(&(gvar->mm)))
+ {
+ printf(" XMS\n");
+ printf(" XMSaddr: %X\n", *XMSaddr);
+ }
+ printf("near: %lu ", gvar->mmi.nearheap); printf("far: %lu\n", gvar->mmi.farheap); if(MML_CheckForEMS())
+ printf("EMSmem: %lu ", gvar->mmi.EMSmem); if(MML_CheckForXMS(&(gvar->mm))) printf("XMSmem: %lu", gvar->mmi.XMSmem); printf("\n");
+ //printf("mainmem: %lu\n", gvar->mmi.mainmem);
+ printf("Total convmem: %lu ", gvar->mmi.mainmem); printf("TotalFree: %lu ", MM_TotalFree(&(gvar->mm))); printf("TotalUsed: %lu\n", gvar->mmi.mainmem+gvar->mmi.EMSmem+gvar->mmi.XMSmem+gvar->mmi.XMSmem);
+ printf(" UnusedMemory: %lu\n", MM_UnusedMemory(&(gvar->mm)));
+ //printf("========================================\n");
}
//==========================================================================
void MM_DumpData(mminfo_t *mm);
dword MM_UnusedMemory(mminfo_t *mm);
dword MM_TotalFree(mminfo_t *mm);
-void MM_Report(/*page_t *page, */mminfo_t *mm, mminfotype *mmi);
+void MM_Report(global_game_variables_t *gvar);
static void MM_EMSerr(byte *stri, byte err);
void MM_BombOnError(boolean bomb, mminfo_t *mm);
//void MM_GetNewBlock(mminfo_t *mm);
\r
typedef struct\r
{\r
-// int showmemhandle;\r
- int profilehandle,debughandle;\r
+ int profilehandle,debughandle,showmemhandle;\r
int heaphandle;\r
} handle_t;\r
\r
{\r
byte ca_levelbit,ca_levelnum;\r
int mapon;\r
- _seg *grsegs[NUMCHUNKS];\r
- byte far grneeded[NUMCHUNKS];\r
+ //_seg *grsegs[NUMCHUNKS];\r
+ //byte far grneeded[NUMCHUNKS];\r
//huffnode huffnode;\r
} ca_t;\r
\r