X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Flib%2F16_mm.c;h=f03d56a1ae306b95c0f91a333d4af7830f07ec1c;hb=cf3bed60e91dc628e3bb76aaae3f0f8222ac3c38;hp=7ef1d7e03a0202a852273998a7cd50df1b5484b8;hpb=2588b333e82d462937d437971a2d881299782076;p=16.git diff --git a/src/lib/16_mm.c b/src/lib/16_mm.c index 7ef1d7e0..f03d56a1 100644 --- a/src/lib/16_mm.c +++ b/src/lib/16_mm.c @@ -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,9 +441,10 @@ void MML_UseSpace(/*d*/word segstart, dword seglength, mminfo_t *mm) scan = scan->next; } + //find out how many blocks it span! if(seglength>0xfffflu) { - segm=seglength/0xfffflu; + scan->segm=seglength/0xfffflu; } // @@ -460,8 +462,8 @@ void MML_UseSpace(/*d*/word segstart, dword seglength, mminfo_t *mm) inc ax mov ds,ax }*/ +printf("segm=%u ", scan->segm); printf("ex=%lu ", extra); -printf("segm=%u ", segm); printf("len=%u ", scan->length); printf("segsta=%u ", segstart); printf("seglen=%lu\n", seglength); @@ -632,11 +634,11 @@ void MM_Startup(mminfo_t *mm, mminfotype *mmi) MML_SetupEMS(mm); // allocate space 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! //TODO: EMS4! AND EMS 3.2 MASSIVE DATA HANDLMENT! - MML_UseSpace(mm->EMSpageframe,(mm->EMSpagesmapped)*0x4000lu, mm); + MML_UseSpace(mm->EMSpageframe,(/*++++mm->EMSpagesmapped++++*/4)*0x4000lu, mm); //printf("EMS3\n"); MM_MapEMS(mm); // map in used pages //printf("EMS4\n"); - mmi->EMSmem = (mm->EMSpagesmapped)*0x4000lu; + mmi->EMSmem = (/*++++mm->EMSpagesmapped++++*/4)*0x4000lu; } // @@ -1036,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); @@ -1060,8 +1062,7 @@ void MM_ShowMemory(mminfo_t *mm) color = 12; // red = locked if(scan->start<=end) { - printf("scan->start=%d\n", scan->start); - printf("MM_ShowMemory: Memory block order currupted!\n"); + printf("\nMM_ShowMemory: Memory block order currupted!\n"); return; } end = scan->start+scan->length-1; @@ -1071,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");