From: sparky4 Date: Mon, 20 Jul 2015 16:50:20 +0000 (-0500) Subject: modified: DEBUG.TXT X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=39b1ba0a4ebc6b2b16fd15180157f98d0d7750bd;p=16.git modified: DEBUG.TXT modified: MMDUMP.TXT modified: exmmtest.exe modified: src/exmmtest.c modified: src/lib/16_mm.c --- diff --git a/DEBUG.TXT b/DEBUG.TXT index 3a6e9de4..727d142b 100644 --- a/DEBUG.TXT +++ b/DEBUG.TXT @@ -1,3 +1,5 @@ -Seg:7e9 Size:577552 Owner:0x50fd - -MM_ShowMemory: Memory block order currupted! +Seg:0 Size:140000 Owner:0xb80b +Seg:222e Size:4096 Owner:0xfba0 +Seg:3035 Size:1028480 Owner:0x5040 +Seg:3974 Size:682176 Owner:0xeb70 +Seg:e000 Size:131056 Owner:0x1e8d diff --git a/MMDUMP.TXT b/MMDUMP.TXT index e69de29b..36624a83 100644 Binary files a/MMDUMP.TXT and b/MMDUMP.TXT differ diff --git a/exmmtest.exe b/exmmtest.exe index 14f23bc6..746a1061 100644 Binary files a/exmmtest.exe and b/exmmtest.exe differ diff --git a/src/exmmtest.c b/src/exmmtest.c index fc470d6f..6f3b3d8b 100644 --- a/src/exmmtest.c +++ b/src/exmmtest.c @@ -42,6 +42,8 @@ main(int argc, char *argv[]) if(argv[1]) bakapee = argv[1]; else bakapee = "data/koishi~~.pcx"; + if(argv[2]) + #define FILEINIT textInit(); @@ -54,7 +56,12 @@ main(int argc, char *argv[]) MM_Startup(&mm, &mmi); printf("done!\n"); printf("&main()=%Fp\n", *argv[0]); - if(CA_ReadFile(bakapee, &bigbuffer, &mm/*, &mmi*/)) baka=1; +#ifdef FILEINIT + if(CA_ReadFile(bakapee, &bigbuffer, &mm/*, &mmi*/)) +#else + if(CA_LoadFile(bakapee, &bigbuffer, &mm, &mmi)) +#endif + baka=1; else baka=0; //MM_GetPtr(&bigbuffer, mmi.nearheap, &mm, &mmi); diff --git a/src/lib/16_mm.c b/src/lib/16_mm.c index b6af09e5..b554e0ed 100644 --- a/src/lib/16_mm.c +++ b/src/lib/16_mm.c @@ -273,7 +273,7 @@ unsigned MM_MapEMS(mminfo_t *mm) union REGS CPURegs; EMShandle=mm->EMShandle; - for (i=0;i<4/*mm->EMSpagesmapped*/;i++) + for (i=0;iEMSpagesmapped;i++) { __asm { @@ -303,33 +303,33 @@ unsigned MM_MapEMS(mminfo_t *mm) return 0; } -/* -SUB EMS.MapXPages (PhysicalStart, LogicalStart, NumPages, Handle) +void MM_MapXEMS(mminfo_t *mm) +{ + union REGS CPURegs; + +//SUB EMS.MapXPages(PhysicalStart, LogicalStart, NumPages, Handle) - 'Maps up to 4 logical EMS pages to physical pages in the page frame, where: - ' - 'PhysicalStart = Physical page first logical page is mapped to - 'LogicalStart = First logical page to map - 'NumPages = Number of pages to map (1 to 4) - 'Handle = EMS handle logical pages are allocated to + //Maps up to 4 logical EMS pages to physical pages in the page frame, where: + // + //PhysicalStart = Physical page first logical page is mapped to + //LogicalStart = First logical page to map + //NumPages = Number of pages to map (1 to 4) + //Handle = EMS handle logical pages are allocated to - 'Create a buffer containing the page information - FOR x = 0 TO NumPages - 1 + ///Create a buffer containing the page information + /*FOR x = 0 TO NumPages - 1 MapInfo$ = MapInfo$ + MKI$(LogicalStart + x) + MKI$(PhysicalStart + x) NEXT - Regs.ax = &H5000 'Map the pages in the buffer - Regs.cx = NumPages 'to the pageframe - Regs.dx = Handle - Regs.ds = VARSEG(MapInfo$) - Regs.si = SADD(MapInfo$) - InterruptX &H67, Regs, Regs - EMS.Error = (Regs.ax AND &HFF00&) \ &H100 'Store the status code + Regs.ax = &H5000 //Map the pages in the buffer + Regs.cx = NumPages //to the pageframe + Regs.dx = Handle + Regs.ds = VARSEG(MapInfo$) + Regs.si = SADD(MapInfo$) + InterruptX &H67, Regs, Regs + EMS.Error = (Regs.ax AND &HFF00&) \ &H100 //Store the status code*/ -END SUB -*/ -void MM_MapXEMS(mminfo_t *mm) -{ +//END SUB } @@ -596,7 +596,7 @@ void MM_Startup(mminfo_t *mm, mminfotype *mmi) if(mm->mmstarted) MM_Shutdown(mm); - +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! mm->mmstarted = true; mm->bombonerror = true; // @@ -609,7 +609,7 @@ void MM_Startup(mminfo_t *mm, mminfotype *mmi) mm->mmblocks[i].next = &(mm->mmblocks[i+1]); } mm->mmblocks[i].next = NULL; - +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! // // locked block of all memory until we punch out free space // @@ -620,7 +620,7 @@ void MM_Startup(mminfo_t *mm, mminfotype *mmi) mm->mmnew->attributes = LOCKBIT; mm->mmnew->next = NULL; mm->mmrover = mm->mmhead; - +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! // farlen=_bios_memsize()*1024; // @@ -636,7 +636,7 @@ void MM_Startup(mminfo_t *mm, mminfotype *mmi) segstart = FP_SEG(start)+(FP_OFF(start)+15)/16; MML_UseSpace(segstart,seglength, mm); mmi->nearheap = length; - //printf("near heap ok!\n"); + printf("near heap ok!\n"); // // get all available far conventional memory segments @@ -653,7 +653,7 @@ void MM_Startup(mminfo_t *mm, mminfotype *mmi) MML_UseSpace(segstart,seglength, mm); mmi->farheap = length; mmi->mainmem = mmi->nearheap + mmi->farheap; - //printf("far heap ok!\n"); + printf("far heap ok!\n"); // @@ -1319,9 +1319,10 @@ void MM_Report(page_t *page, mminfo_t *mm, mminfotype *mmi) if(MML_CheckForEMS()) { printf("Expanded memory manager present. EMM v%x.%x available\n", mm->EMSVer>>4,mm->EMSVer&0x0F); - printf("totalEMSpages=%u\n", mm->totalEMSpages); - printf("Page frame @0x%04x\n", mm->freeEMSpages); - printf("EMSpageframe=%x\n", mm->EMSpageframe); + printf("totalEMSpages=%u ", mm->totalEMSpages); + printf("freeEMSpages=%u\n", mm->freeEMSpages); + printf("Page frame @0x%04x\n", mm->EMSpageframe); + //printf("EMSpageframe=%x\n", ); } if(MML_CheckForXMS(mm)) printf("XMSaddr=%Fp\n", *XMSaddr); printf("near=%lu\n", mmi->nearheap);