From: sparky4 Date: Fri, 31 Jul 2015 19:49:02 +0000 (-0500) Subject: wwww X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=d015e5cb7cc4d7f923a2e67bb1e3602c44ded05c;p=16.git wwww modified: 16.exe modified: DEBUG.16 modified: MMDUMP.16 modified: exmmtest.exe modified: inputest.exe modified: scroll.exe modified: sountest.exe modified: src/exmmtest.c modified: src/lib/16_head.c modified: src/lib/16_mm.c modified: src/lib/16_mm.h --- diff --git a/16.exe b/16.exe index f6e03272..a2867bbb 100644 Binary files a/16.exe and b/16.exe differ diff --git a/DEBUG.16 b/DEBUG.16 index c78ea75c..782a334a 100644 --- a/DEBUG.16 +++ b/DEBUG.16 @@ -1,17 +1,6 @@ -Seg:0 Size:6918 Owner:0x80 -Seg:1b06 Size:256 Owner:0x64b0 -Seg:218d Size:33 Owner:0x80 -Seg:235f Size:44194 Owner:0x80 -Seg:d021 Size:4294967264 Owner:0x76ff -Seg:d021 Size:4294967264 Owner:0x70bc -Seg:d021 Size:4294967264 Owner:0x8b55 -Seg:d021 Size:4294967264 Owner:0xc483 -Seg:d021 Size:4294967264 Owner:0x4c4 -Seg:d021 Size:4294967264 Owner:0x90cb -Seg:d021 Size:4294967264 Owner:0xfa7e -Seg:d021 Size:4294967264 Owner:0x104 -Seg:d021 Size:4294967264 Owner:0xfa4e -Seg:d021 Size:4294967264 Owner:0x215e -Seg:d021 Size:525 Owner:0x0 -Seg:d22e Size:1959 Owner:0x920a -Seg:e000 Size:4294909951 Owner:0x80 +Seg:0 Size:5202 Owner:0xfa +Seg:1452 Size:256 Owner:0x64d2 +Seg:1552 Size:48 Owner:0x922a +Seg:1af4 Size:18 Owner:0x2bfe +Seg:1eea Size:49430 Owner:0xff01 +Seg:e000 Size:4294909951 Owner:0x64d2 diff --git a/MMDUMP.16 b/MMDUMP.16 index 386a89ad..93afd41d 100644 Binary files a/MMDUMP.16 and b/MMDUMP.16 differ diff --git a/exmmtest.exe b/exmmtest.exe index 365cc319..6ae752a6 100644 Binary files a/exmmtest.exe and b/exmmtest.exe differ diff --git a/inputest.exe b/inputest.exe index 7a67da06..f899a674 100644 Binary files a/inputest.exe and b/inputest.exe differ diff --git a/scroll.exe b/scroll.exe index 7de0e452..b3d74af3 100644 Binary files a/scroll.exe and b/scroll.exe differ diff --git a/sountest.exe b/sountest.exe index ce98077b..dcd680a9 100644 Binary files a/sountest.exe and b/sountest.exe differ diff --git a/src/exmmtest.c b/src/exmmtest.c index fc1a901b..22397daa 100644 --- a/src/exmmtest.c +++ b/src/exmmtest.c @@ -93,6 +93,7 @@ main(int argc, char *argv[]) printf("&bigbuffer= %Fp\n", &bigbuffer); printf("bigbuffer= %04x\n", bigbuffer); printf("&bigbuffer= %04x\n", &bigbuffer); + getch(); #ifdef FILERL // bakapeehandle = open(bakapee,O_RDONLY | O_BINARY, S_IREAD); // printf("size of big buffer~=%u\n", _bmsize(segu, bigbuffer)); @@ -109,12 +110,12 @@ main(int argc, char *argv[]) baka=0; // close(bakapeehandle); //hmm functions in cache system use the buffered stuff -// printf("size of big buffer~=%u\n", _bmsize(segu, bigbuffer)); + printf("size of big buffer~=%u\n", _bmsize(sega, bigbuffer)); #endif printf("dark purple = purgable\n"); printf("medium blue = non purgable\n"); printf("red = locked\n"); -// getch(); + getch(); //++++modexEnter(); //++++modexShowPage(&screen); MM_ShowMemory(/*&screen, */&mm); @@ -135,7 +136,6 @@ main(int argc, char *argv[]) if(baka) printf("\nyay!\n"); else printf("\npoo!\n"); #endif - //printf("_bios_memsize=%u\n", _bios_memsize()); printf("bigbuffer= %Fp\n", bigbuffer); printf("&bigbuffer= %Fp\n", &bigbuffer); printf("bigbuffer= %04x\n", bigbuffer); diff --git a/src/lib/16_head.c b/src/lib/16_head.c index 8e70082e..a7be849f 100644 --- a/src/lib/16_head.c +++ b/src/lib/16_head.c @@ -475,7 +475,9 @@ print_normal_entry(kittengets(2,1,"Default"), (dword)h_total, (dword)h_used, (dw print_normal_entry(kittengets(2,1,"Near"), (dword)nh_total, (dword)nh_used, (dword)nh_free); print_normal_entry(kittengets(2,1,"Far"), (dword)fh_total, (dword)fh_used, (dword)fh_free); printf( "---------------- -------- -------- --------\n"); -//printf("memavl = %lu\n", (dword)_memavl()); +printf("coreleft = %lu\n", (dword)_coreleft()); +printf("farcoreleft = %lu\n", (dword)_farcoreleft()); +printf("memavl = %lu\n", (dword)_memavl()); printf("stackavail = %u\n", stackavail()); } diff --git a/src/lib/16_mm.c b/src/lib/16_mm.c index 38754e10..3aecccb5 100644 --- a/src/lib/16_mm.c +++ b/src/lib/16_mm.c @@ -673,9 +673,9 @@ void MM_Startup(mminfo_t *mm, mminfotype *mmi) // //---- length=coreleft(); printf(" nearheap making!\n"); - _heapgrow(); - length=_memmax();//(dword)GetFreeSize(); - start = (void huge *)(mm->nearheap = malloc(length)); + _nheapgrow(); + length=(dword)_coreleft();//(dword)_memmax();//(dword)GetFreeSize(); + start = (void huge *)(mm->nearheap = _nmalloc(length)); length -= 16-(FP_OFF(start)&15); length -= SAVENEARHEAP; seglength = length / 16; // now in paragraphs @@ -683,7 +683,8 @@ void MM_Startup(mminfo_t *mm, mminfotype *mmi) MML_UseSpace(segstart,seglength, mm); mmi->nearheap = length; printf("start=%FP segstart=%X seglen=%lu len=%lu\n", start, segstart, seglength, length); - printf(" near heap ok!\n"); + //heapdump(); + //getch(); // // get all available far conventional memory segments @@ -691,7 +692,7 @@ void MM_Startup(mminfo_t *mm, mminfotype *mmi) //---- length=farcoreleft(); printf(" farheap making!\n"); _fheapgrow(); - length=(dword)GetFarFreeSize();//0xffffUL*4UL; + length=(dword)_farcoreleft();//(dword)GetFarFreeSize();//0xffffUL*4UL; //start = mm->farheap = halloc(length, 1); start = mm->farheap = _fmalloc(length); length -= 16-(FP_OFF(start)&15); @@ -701,7 +702,7 @@ void MM_Startup(mminfo_t *mm, mminfotype *mmi) MML_UseSpace(segstart,seglength, mm); mmi->farheap = length; printf("start=%FP segstart=%X seglen=%lu len=%lu\n", start, segstart, seglength, length); - printf(" far heap ok!\n"); + heapdump(); mmi->mainmem = mmi->nearheap + mmi->farheap; @@ -751,7 +752,7 @@ 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 { 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(" XMS!\n"); - MML_SetupXMS(mm, mmi); // allocate as many UMBs as possible + //MML_SetupXMS(mm, mmi); // allocate as many UMBs as possible } // @@ -781,7 +782,7 @@ void MM_Shutdown(mminfo_t *mm) return; _ffree(mm->farheap); printf(" far freed\n"); - free(mm->nearheap); printf(" near freed\n"); + _nfree(mm->nearheap); printf(" near freed\n"); if(MML_CheckForEMS()){ MML_ShutdownEMS(mm); printf(" EMS freed\n"); } if(MML_CheckForXMS(mm)){ MML_ShutdownXMS(mm); printf(" XMS freed\n"); } } @@ -883,7 +884,7 @@ void MM_GetPtr(memptr *baseptr,dword size, mminfo_t *mm, mminfotype *mmi) if (mm->bombonerror) { printf(OUT_OF_MEM_MSG,(size-mmi->nearheap)); - exit(-5); + exit(-1); } else mm->mmerror = true; diff --git a/src/lib/16_mm.h b/src/lib/16_mm.h index 083a4d29..a17482fc 100644 --- a/src/lib/16_mm.h +++ b/src/lib/16_mm.h @@ -36,8 +36,8 @@ #endif -#define SAVENEARHEAP 0x200 // space to leave in data segment -#define SAVEFARHEAP 0x400 // space to leave in far heap +#define SAVENEARHEAP 0//x200 // space to leave in data segment +#define SAVEFARHEAP 0//x400 // space to leave in far heap #define BUFFERSIZE 0x1000 // miscelanious, allways available buffer @@ -130,7 +130,7 @@ typedef struct memptr bufferseg; boolean mmstarted, bombonerror, mmerror; void huge *farheap; - void *nearheap; + void __near *nearheap; //byte EMS_status; unsigned totalEMSpages,freeEMSpages,EMSpageframe,EMSpagesmapped,EMShandle; unsigned int EMSVer;