modified: data/g.pal
modified: exmmtest.exe
modified: src/lib/16_mm.c
modified: src/lib/16_mm.h
- //find out how many blocks it span!
- if(seglength>0xfffflu)
+ //find out how many blocks it spans!
+ /*++++if(seglength>0xffffu)
- scan->segm=seglength/0xffffu;
+ scan->sega=(word)seglength/0xffffu;
//
// take the given range out of the block
//
// take the given range out of the block
-printf("segm=%u ", scan->segm);
+//++++printf("sega=%u ", scan->sega);
printf("ex=%lu ", extra);
printf("len=%u ", scan->length);
printf("segsta=%x ", segstart);
printf("ex=%lu ", extra);
printf("len=%u ", scan->length);
printf("segsta=%x ", segstart);
void MM_Startup(mminfo_t *mm, mminfotype *mmi)
{
int i;
void MM_Startup(mminfo_t *mm, mminfotype *mmi)
{
int i;
- dword length;//,farlen;
void huge *start;
unsigned segstart,seglength,endfree;
void huge *start;
unsigned segstart,seglength,endfree;
MM_GetNewBlock(mm);
mm->mmhead = mm->mmnew; // this will allways be the first node
mm->mmnew->start = 0;
MM_GetNewBlock(mm);
mm->mmhead = mm->mmnew; // this will allways be the first node
mm->mmnew->start = 0;
- mm->mmnew->length = 0xffff; //todo: mm make it fucking massive as fuck!~
+ mm->mmnew->length = 0xffff;
mm->mmnew->attributes = LOCKBIT;
mm->mmnew->next = NULL;
mm->mmrover = mm->mmhead;
mm->mmnew->attributes = LOCKBIT;
mm->mmnew->next = NULL;
mm->mmrover = mm->mmhead;
_nheapgrow();
length=_memavl();
start = (void huge *)(mm->nearheap = malloc(length));
_nheapgrow();
length=_memavl();
start = (void huge *)(mm->nearheap = malloc(length));
length -= 16-(FP_OFF(start)&15);
length -= SAVENEARHEAP;
seglength = length / 16; // now in paragraphs
segstart = FP_SEG(start)+(FP_OFF(start)+15)/16;
MML_UseSpace(segstart,seglength, mm);
mmi->nearheap = length;
length -= 16-(FP_OFF(start)&15);
length -= SAVENEARHEAP;
seglength = length / 16; // now in paragraphs
segstart = FP_SEG(start)+(FP_OFF(start)+15)/16;
MML_UseSpace(segstart,seglength, mm);
mmi->nearheap = length;
+ //printf("near heap ok!\n");
//
// get all available far conventional memory segments
//
// get all available far conventional memory segments
//---- length=farcoreleft();
_fheapgrow();
length=_memavl();
//---- length=farcoreleft();
_fheapgrow();
length=_memavl();
- //length-=farlen;
- start = mm->farheap = halloc(length, sizeof(dword));
+ start = mm->farheap = halloc(length, sizeof(byte));
//start = mm->farheap = _fmalloc(length);
length -= 16-(FP_OFF(start)&15);
length -= SAVEFARHEAP;
//start = mm->farheap = _fmalloc(length);
length -= 16-(FP_OFF(start)&15);
length -= SAVEFARHEAP;
MML_UseSpace(segstart,seglength, mm);
mmi->farheap = length;
mmi->mainmem = mmi->nearheap + mmi->farheap;
MML_UseSpace(segstart,seglength, mm);
mmi->farheap = length;
mmi->mainmem = mmi->nearheap + mmi->farheap;
+ //printf("far heap ok!\n");
void MM_ShowMemory(mminfo_t *mm)
{
mmblocktype huge *scan;
void MM_ShowMemory(mminfo_t *mm)
{
mmblocktype huge *scan;
- unsigned color,temp;//, i;
long end,owner;
char scratch[160],str[16];
long end,owner;
char scratch[160],str[16];
typedef struct mmblockstruct
{
typedef struct mmblockstruct
{
- word start,length,segm;
//dword start,length;
//word start;
//dword length;
//dword start,length;
//word start;
//dword length;
- ///word segm; //how many 64kb segment blocks it takes up if there is many data!
+ //++++word sega; //how many 64kb segment blocks it takes up if there is many data!
unsigned attributes;
memptr *useptr; // pointer to the segment start
struct mmblockstruct huge *next;
unsigned attributes;
memptr *useptr; // pointer to the segment start
struct mmblockstruct huge *next;