-Seg:0 Size:92176 Owner:0xfe5e\r
-Seg:1681 Size:4096 Owner:0x7298\r
-Seg:1caf Size:8752 Owner:0x80\r
-Seg:5ed0 Size:529152 Owner:0x80\r
+Seg:11c3 Size:811328 Owner:0xc918\r
\r
MM_ShowMemory: Memory block order currupted!\r
#include "src/lib/16_mm.h"
#include "src/lib/modex16.h"
-//#define FILERL
+#define FILERL
//#define FILEINIT
void
main(int argc, char *argv[])
{
- mminfo_t mm; mminfotype mmi;
- memptr bigbuffer;
- __segment segu;
- char *bakapee;
- word baka;
+ static mminfo_t mm; mminfotype mmi;
+ static memptr bigbuffer;
+ static __segment segu;
+ static char *bakapee;
+ static word baka;
page_t screen;
printf("&main()=%Fp\n", *argv[0]);
boolean CA_FarRead(int handle, byte huge *dest, dword length, mminfo_t *mm)\r
{\r
boolean flag;\r
- dword fat=0;
+ /*dword fat=0;
word segm=0;
//if(mm->EMSVer<0x40)\r
if(length>0xfffflu)
}
if(!fat&&!segm)
- {\r
+ {*/\r
__asm\r
{\r
push ds\r
End:\r
}\r
return flag;
- }else return 0;//todo: EXPAND!!!\r
+ //}else return 0;//todo: EXPAND!!!\r
}\r
\r
\r
boolean CA_FarWrite(int handle, byte huge *source, dword length, mminfo_t *mm)\r
{\r
boolean flag;\r
- dword fat=0;
+ /*dword fat=0;
word segm=0;
//if(mm->EMSVer<0x40)\r
if(length>0xfffflu)
}\r
if(!fat&&!segm)
- {\r
+ {*/\r
__asm\r
{\r
push ds\r
End:\r
}\r
return flag;
- }else return 0;\r
+ //}else return 0;\r
}\r
\r
\r
//
// set up the linked list (everything in the free list;
//
- printf(" linked list making!\n");
+// printf(" linked list making!\n");
mm->mmhead = NULL;
mm->mmfree = &(mm->mmblocks[0]);
for(i=0;i<MAXBLOCKS-1;i++)
//
// locked block of all memory until we punch out free space
//
- printf(" newblock making!\n");
+// printf(" newblock making!\n");
MM_GetNewBlock(mm);
mm->mmhead = mm->mmnew; // this will allways be the first node
mm->mmnew->start = 0;
//---- length=coreleft();
//_nheapgrow();
length=_memmax();
+ //printf(" %u\n", length);
start = (void huge *)(mm->nearheap = _nmalloc(length));
length -= 16-(FP_OFF(start)&15);
length -= SAVENEARHEAP;
MML_UseSpace(mm->EMSpageframe,(MAPPAGES)*0x4000lu, mm);
printf("\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"); //bug!
printf(" EMS4\n");
- if(mm->EMSVer<0x40)
+ //if(mm->EMSVer<0x40)
MM_MapEMS(mm, mmi); // map in used pages
- else
- MM_MapXEMS(mm, mmi); // map in used pages
+ //else
+ //MM_MapXEMS(mm, mmi); // map in used pages
}
//
FILE *dumpfile;
- free (mm->nearheap);
+ //++++free(mm->nearheap);
dumpfile = fopen ("mmdump.txt","w");
if (!dumpfile){
printf("MM_DumpData: Couldn't open MMDUMP.TXT!\n");
} while (lowest != 0xffff);
- fclose (dumpfile);
+ fclose(dumpfile);
printf("MMDUMP.TXT created.\n");
}
//++++mh #include "src/lib/16_in.h"
#ifdef __DEBUG__ // 1 == Debug/Dev ; 0 == Production/final
-#define OUT_OF_MEM_MSG "MM_GetPtr: Out of memory!\nYou were short :%ld bytes"
+#define OUT_OF_MEM_MSG "MM_GetPtr: Out of memory!\nYou were short :%lu bytes"
#else
#define OUT_OF_MEM_MSG "\npee\n"
#endif
-#define SAVENEARHEAP 0x200 // space to leave in data segment
+#define SAVENEARHEAP 0//x400 // space to leave in data segment
#define SAVEFARHEAP 0//x4000 // space to leave in far heap
#define BUFFERSIZE 0x1000 // miscelanious, allways available buffer
#define BASEATTRIBUTES 0 // unlocked, non purgable
#define MAXUMBS 12
-#define MAPPAGES mm->EMSpagesmapped
+#define MAPPAGES 4//mm->EMSpagesmapped
typedef struct mmblockstruct
{