]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/16_mm.c
on the move and hasaomeideas
[16.git] / src / lib / 16_mm.c
index 8a64d1055e8c8a019e11a8ef6f5c523cdd88fb7d..cc8f9284d2b0abe537b671316abaae27a8c2fda0 100644 (file)
@@ -174,7 +174,7 @@ unsigned MML_SetupEMS(mminfo_t *mm)
                mov     [freeEMSpages],bx
                or      bx,bx
                jz      noEMS                                           // no EMS at all to allocate
-//++++EXPAND DONG!!!!
+                                                                                       //EXPAND DONG!!!!
                cmp     [EMSVer],0x40
                jb      low
                cmp     bx,[freeEMSpages]
@@ -425,11 +425,12 @@ void MML_UseSpace(/*d*/word segstart, dword seglength, mminfo_t *mm)
        mmblocktype huge *scan,huge *last;
        dword   oldend;
        ///*d*/word fat=0;
-       //word segm=0;
        dword           extra;
 
        scan = last = mm->mmhead;
        mm->mmrover = mm->mmhead;               // reset rover to start of memory
+       scan->segm=1;
+       scan->segmlen=seglength;
 
 //
 // search for the block that contains the range of segments
@@ -440,6 +441,12 @@ void MML_UseSpace(/*d*/word segstart, dword seglength, mminfo_t *mm)
                scan = scan->next;
        }
 
+       //find out how many blocks it span!
+       if(seglength>0xfffflu)
+       {
+               scan->segm=seglength/0xfffflu;
+       }
+
 //
 // take the given range out of the block
 //
@@ -455,10 +462,11 @@ void MML_UseSpace(/*d*/word segstart, dword seglength, mminfo_t *mm)
                        inc             ax
                        mov     ds,ax
                }*/
-printf("extra=%lu      ", extra);
-printf("oldend=%lu     ", oldend);
-printf("length=%lu     ", scan->length);
-printf("seglength=%lu\n", seglength);
+printf("segm=%u        ", scan->segm);
+printf("ex=%lu ", extra);
+printf("len=%u ", scan->length);
+printf("segsta=%u      ", segstart);
+printf("seglen=%lu\n", seglength);
 
 //MML_UseSpace(?segstart?, ?length?, mm);
 
@@ -1030,7 +1038,7 @@ void MM_ShowMemory(mminfo_t *mm)
        mmblocktype huge *scan;
        unsigned color,temp;//, i;
        long    end,owner;
-       char    scratch[80],str[10];
+       char    scratch[160],str[16];
 
 //**** VW_SetDefaultColors();
 //**** VW_SetLineWidth(40);
@@ -1044,7 +1052,7 @@ void MM_ShowMemory(mminfo_t *mm)
 
 //CA_OpenDebug ();
 
-       while (scan)
+       while(scan)
        {
                if(scan->attributes & PURGEBITS)
                        color = 5;              // dark purple = purgable
@@ -1054,7 +1062,7 @@ void MM_ShowMemory(mminfo_t *mm)
                        color = 12;             // red = locked
                if(scan->start<=end)
                {
-                       printf("MM_ShowMemory: Memory block order currupted!");
+                       printf("\nMM_ShowMemory: Memory block order currupted!\n");
                        return;
                }
                end = scan->start+scan->length-1;
@@ -1064,9 +1072,11 @@ void MM_ShowMemory(mminfo_t *mm)
 //++++                 VW_Hlin(end+1,scan->next->start,0,0);   // black = free
 
 //****#if 0
-printf("Location:");
-printf("%x\t", scan->start);
-strcpy (scratch,"Size:");
+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!
+strcpy(scratch,"Location:");
+ultoa (scan->start,str,16);
+strcat (scratch,str);
+strcat (scratch,"\tSize:");
 ltoa ((dword)scan->length*16,str,10);
 strcat (scratch,str);
 strcat (scratch,"\tOwner:0x");