From: sparky4 Date: Wed, 22 Jul 2015 11:55:28 +0000 (-0500) Subject: i do not know why it messes up so much on far heap X-Git-Url: http://4ch.mooo.com/gitweb/?p=16.git;a=commitdiff_plain;h=c8ffd769a0711b15dad068cdf0874cd6c89aee1c i do not know why it messes up so much on far heap modified: 16.exe modified: DEBUG.TXT modified: fmemtest.exe modified: fontgfx.exe modified: fonttest.exe modified: inputest.exe modified: makefile modified: maptest.exe modified: mmtest.exe modified: palettec.exe modified: pcxtest.exe modified: sountest.exe modified: src/lib/16_mm.c modified: src/lib/16_mm.h modified: src/mmtest.c modified: test.exe modified: test2.exe modified: tsthimem.exe --- diff --git a/16.exe b/16.exe index adba10fc..adda6ad1 100644 Binary files a/16.exe and b/16.exe differ diff --git a/DEBUG.TXT b/DEBUG.TXT index 3b35d096..ec1c08ba 100644 --- a/DEBUG.TXT +++ b/DEBUG.TXT @@ -1,4 +1,4 @@ -Seg:1411 Size:557915488 Owner:0x1511 -Seg:8bfd Size:-385858080 Owner:0x8ba6 +Seg:a17 Size:1092657440 Owner:0x11c6 +Seg:19cb Size:-1669231296 Owner:0xc417 MM_ShowMemory: Memory block order currupted! diff --git a/fmemtest.exe b/fmemtest.exe index e10d1ba5..875686c9 100644 Binary files a/fmemtest.exe and b/fmemtest.exe differ diff --git a/fontgfx.exe b/fontgfx.exe index 6b0a4ea3..ac4912df 100644 Binary files a/fontgfx.exe and b/fontgfx.exe differ diff --git a/fonttest.exe b/fonttest.exe index 20ff5d62..b8327e4b 100644 Binary files a/fonttest.exe and b/fonttest.exe differ diff --git a/inputest.exe b/inputest.exe index 22a7b6d8..47311618 100644 Binary files a/inputest.exe and b/inputest.exe differ diff --git a/makefile b/makefile index b1f470a7..c22da3b1 100644 --- a/makefile +++ b/makefile @@ -12,10 +12,11 @@ TARGET_OS = dos #-zk0 = kanji support~ #-zkl = current codepage -DFLAGS=-DTARGET_MSDOS=16 -DMSDOS=1 -zm -CFLAGS=-zk0 -wo -x -mc -zu -k32768#16384# -zdp# -zp16 -zq -OFLAGS=-ot -ox -ob -oh -or# -om -ol -ol+ -FLAGS=-0 -d2 -lr $(OFLAGS) $(CFLAGS) $(DFLAGS) +ZFLAGS=-zk0 -zc# -zu -zm# -zdp# -zp16 -zq +DFLAGS=-DTARGET_MSDOS=16 -DMSDOS=1 +CFLAGS=-wo -x -mc -wo -k32768#16384# +OFLAGS=-ot -ox -ob -oh -or -om -ol# -ol+ +FLAGS=-0 -d2 -lr $(OFLAGS) $(CFLAGS) $(DFLAGS) $(ZFLAGS) SRC=src$(DIRSEP) SRCLIB=$(SRC)lib$(DIRSEP) JSMNLIB=$(SRCLIB)jsmn$(DIRSEP) diff --git a/maptest.exe b/maptest.exe index 33832a17..7480d470 100644 Binary files a/maptest.exe and b/maptest.exe differ diff --git a/mmtest.exe b/mmtest.exe index 9fc2d181..263dbf6d 100644 Binary files a/mmtest.exe and b/mmtest.exe differ diff --git a/palettec.exe b/palettec.exe index 224f7739..196f5244 100644 Binary files a/palettec.exe and b/palettec.exe differ diff --git a/pcxtest.exe b/pcxtest.exe index 6aaad16e..e2a70937 100644 Binary files a/pcxtest.exe and b/pcxtest.exe differ diff --git a/sountest.exe b/sountest.exe index e4ab3b05..841f8170 100644 Binary files a/sountest.exe and b/sountest.exe differ diff --git a/src/lib/16_mm.c b/src/lib/16_mm.c index dfb9256c..bf7536fc 100644 --- a/src/lib/16_mm.c +++ b/src/lib/16_mm.c @@ -637,7 +637,7 @@ void MM_Startup(mminfo_t *mm, mminfotype *mmi) void huge *start; unsigned segstart,endfree; - printf("mmi->segu=%Fp\n", (mmi->segu)); + //printf("mmi->segu=%Fp\n", (mmi->segu)); if(mm->mmstarted) MM_Shutdown(mm); @@ -655,7 +655,7 @@ void MM_Startup(mminfo_t *mm, mminfotype *mmi) mm->mmblocks[i].next = &(mm->mmblocks[i+1]); } mm->mmblocks[i].next = NULL; - printf("mmi->segu=%Fp\n", (mmi->segu)); + //printf("mmi->segu=%Fp\n", (mmi->segu)); // // locked block of all memory until we punch out free space @@ -668,7 +668,7 @@ void MM_Startup(mminfo_t *mm, mminfotype *mmi) mm->mmnew->attributes = LOCKBIT; mm->mmnew->next = NULL; mm->mmrover = mm->mmhead; - printf("mmi->segu=%Fp\n", (mmi->segu)); + //printf("mmi->segu=%Fp\n", (mmi->segu)); // // get all available near conventional memory segments @@ -677,7 +677,7 @@ void MM_Startup(mminfo_t *mm, mminfotype *mmi) //---- length=coreleft(); //_nheapgrow(); length=_memmax(); - start = /*(void *)*/(mm->nearheap = _nmalloc(length)); + start = (void huge *)(mm->nearheap = _nmalloc(length)); length -= 16-(FP_OFF(start)&15); length -= SAVENEARHEAP; seglength = length / 16; // now in paragraphs @@ -705,8 +705,8 @@ void MM_Startup(mminfo_t *mm, mminfotype *mmi) // //---- length=farcoreleft(); //printf(" farheap making!\n"); - //_fheapgrow(); - length=0xffffUL*4UL;//_memavl(); + _fheapgrow(); + length=0xff;//UL*4UL;//_memavl(); start = mm->farheap = halloc(length, sizeof(byte)); //start = mm->farheap = _fmalloc(length); length -= 16-(FP_OFF(start)&15); diff --git a/src/lib/16_mm.h b/src/lib/16_mm.h index 8b214032..7949cce4 100644 --- a/src/lib/16_mm.h +++ b/src/lib/16_mm.h @@ -37,7 +37,7 @@ #define SAVENEARHEAP 0x200 // space to leave in data segment -#define SAVEFARHEAP 0 // space to leave in far heap +#define SAVEFARHEAP 0//x2000 // space to leave in far heap #define BUFFERSIZE 0x1000 // miscelanious, allways available buffer @@ -92,7 +92,7 @@ typedef struct { dword nearheap,farheap,EMSmem,XMSmem,mainmem; //__segment segu; - word segu; + //word segu; // } mminfotype; diff --git a/src/mmtest.c b/src/mmtest.c index 38b7ea15..6f635844 100644 --- a/src/mmtest.c +++ b/src/mmtest.c @@ -43,11 +43,11 @@ main(int argc, char *argv[]) word baka; //static page_t screen; - mmi.segu=FP_SEG(segu); + //mmi.segu=FP_SEG(segu); printf("&main()=%Fp\n", *argv[0]); printf("&segu=%p\n", (segu)); - printf("mmi.segu=%p\n", (mmi.segu)); + //printf("mmi.segu=%p\n", (mmi.segu)); bakapee = _nmalloc(64); // memset(bakapee, 0, 64); @@ -77,7 +77,7 @@ main(int argc, char *argv[]) }*/ printf("&main()=%Fp\n", *argv[0]); printf("&segu=%p\n", (segu)); - printf("mmi.segu=%p\n", (mmi.segu)); + //printf("mmi.segu=%p\n", (mmi.segu)); #ifdef FILERL #ifdef FILEINIT printf(" read\n"); @@ -99,12 +99,14 @@ main(int argc, char *argv[]) //++++modexEnter(); //++++modexShowPage(&screen); MM_ShowMemory(/*&screen, */&mm); - getch(); + //getch(); MM_DumpData(&mm); //++++modexLeave(); MM_Report(&mm, &mmi); printf(" stop!\n"); +#ifdef FILERL MM_FreePtr(&bigbuffer, &mm); +#endif MM_Shutdown(&mm); printf(" done!\n"); #ifdef FILERL diff --git a/test.exe b/test.exe index fa7d51c8..e04c291d 100644 Binary files a/test.exe and b/test.exe differ diff --git a/test2.exe b/test2.exe index 335a1cbb..77e009f2 100644 Binary files a/test2.exe and b/test2.exe differ diff --git a/tsthimem.exe b/tsthimem.exe index f8e7c773..24c25b02 100644 Binary files a/tsthimem.exe and b/tsthimem.exe differ