OSDN Git Service

i do not know why it messes up so much on far heap
authorsparky4 <sparky4@cock.li>
Wed, 22 Jul 2015 11:55:28 +0000 (06:55 -0500)
committersparky4 <sparky4@cock.li>
Wed, 22 Jul 2015 11:55:28 +0000 (06:55 -0500)
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

18 files changed:
16.exe
DEBUG.TXT
fmemtest.exe
fontgfx.exe
fonttest.exe
inputest.exe
makefile
maptest.exe
mmtest.exe
palettec.exe
pcxtest.exe
sountest.exe
src/lib/16_mm.c
src/lib/16_mm.h
src/mmtest.c
test.exe
test2.exe
tsthimem.exe

diff --git a/16.exe b/16.exe
index adba10f..adda6ad 100644 (file)
Binary files a/16.exe and b/16.exe differ
index 3b35d09..ec1c08b 100644 (file)
--- a/DEBUG.TXT
+++ b/DEBUG.TXT
@@ -1,4 +1,4 @@
-Seg:1411       Size:557915488  Owner:0x1511\r
-Seg:8bfd       Size:-385858080 Owner:0x8ba6\r
+Seg:a17        Size:1092657440 Owner:0x11c6\r
+Seg:19cb       Size:-1669231296        Owner:0xc417\r
 \r
 MM_ShowMemory: Memory block order currupted!\r
index e10d1ba..875686c 100644 (file)
Binary files a/fmemtest.exe and b/fmemtest.exe differ
index 6b0a4ea..ac4912d 100644 (file)
Binary files a/fontgfx.exe and b/fontgfx.exe differ
index 20ff5d6..b8327e4 100644 (file)
Binary files a/fonttest.exe and b/fonttest.exe differ
index 22a7b6d..4731161 100644 (file)
Binary files a/inputest.exe and b/inputest.exe differ
index b1f470a..c22da3b 100644 (file)
--- 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)
index 33832a1..7480d47 100644 (file)
Binary files a/maptest.exe and b/maptest.exe differ
index 9fc2d18..263dbf6 100644 (file)
Binary files a/mmtest.exe and b/mmtest.exe differ
index 224f773..196f524 100644 (file)
Binary files a/palettec.exe and b/palettec.exe differ
index 6aaad16..e2a7093 100644 (file)
Binary files a/pcxtest.exe and b/pcxtest.exe differ
index e4ab3b0..841f817 100644 (file)
Binary files a/sountest.exe and b/sountest.exe differ
index dfb9256..bf7536f 100644 (file)
@@ -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);
index 8b21403..7949cce 100644 (file)
@@ -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;
 
index 38b7ea1..6f63584 100644 (file)
@@ -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
index fa7d51c..e04c291 100644 (file)
Binary files a/test.exe and b/test.exe differ
index 335a1cb..77e009f 100644 (file)
Binary files a/test2.exe and b/test2.exe differ
index f8e7c77..24c25b0 100644 (file)
Binary files a/tsthimem.exe and b/tsthimem.exe differ