From: sparky4 <sparky4@cock.li>
Date: Mon, 6 Jul 2015 17:17:36 +0000 (-0500)
Subject: ok!
X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=2fa06f324b3d3f955a4f6dc59bc9eb57e0ca22a6;p=16.git

ok!
	modified:   exmmtest.exe
	modified:   src/lib/16_mm.c
	modified:   src/lib/16_mm.h
---

diff --git a/exmmtest.exe b/exmmtest.exe
index ac2747e9..70d36418 100644
Binary files a/exmmtest.exe and b/exmmtest.exe differ
diff --git a/src/lib/16_mm.c b/src/lib/16_mm.c
index 7ef1d7e0..f6477b4d 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);
diff --git a/src/lib/16_mm.h b/src/lib/16_mm.h
index 1ef85c95..0b2bc451 100644
--- a/src/lib/16_mm.h
+++ b/src/lib/16_mm.h
@@ -118,6 +118,8 @@ typedef struct mmblockstruct
 	//dword	start,length;
 	//word	start;
 	//dword length;
+	word segm;				//how many 64kb segment blocks it takes up if there is many data!
+	dword segmlen;		//length of the multi segment data
 	unsigned	attributes;
 	memptr		*useptr;	// pointer to the segment start
 	struct mmblockstruct huge *next;