From a224f03a9cfc7aa3d325ae8762bf52ef77f031bb Mon Sep 17 00:00:00 2001 From: sparky4 Date: Fri, 9 Sep 2016 13:35:31 -0500 Subject: [PATCH] exmmtest read file works correctly for multifile stuff --- DEBUG.16W | 12 ++++++------ HEAP.16W | 52 +++++++++++++++++++++++++------------------------ MMDUMP.16W | Bin 66 -> 44 bytes src/exmmtest.c | 33 +++++++++++++++++++------------ 4 files changed, 54 insertions(+), 43 deletions(-) diff --git a/DEBUG.16W b/DEBUG.16W index f90eb59c..eb376e65 100755 --- a/DEBUG.16W +++ b/DEBUG.16W @@ -1,16 +1,16 @@ -Seg:0 Size:8030 Owner:0xbcb3 +Seg:0 Size:8041 Owner:0x0 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++_ 0 -Seg:1f5e Size:256 Owner:0x527a +Seg:1f69 Size:256 Owner:0x5274 ++++_  -Seg:205e Size:273 Owner:0x92d2 -++++_ +Seg:2069 Size:273 Owner:0x92cc ++++++_  -Seg:25df Size:40 Owner:0x0 +Seg:25ea Size:44 Owner:0x0 +_ 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Seg:b607 Size:10745 Owner:0x0 +Seg:b616 Size:10730 Owner:0x0 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++_  Seg:e000 Size:8191 Owner:0x0 diff --git a/HEAP.16W b/HEAP.16W index 1d5295a2..d4ef59d0 100755 --- a/HEAP.16W +++ b/HEAP.16W @@ -1,45 +1,47 @@ == default == - USED block at 26010016 of size 66 - FREE block at 26010058 of size 18 - USED block at 2601006a of size 136 - USED block at 260100f2 of size 20 - FREE block at 26010106 of size 7926 + USED block at 260c0016 of size 66 + USED block at 260c0058 of size 66 + FREE block at 260c009a of size 18 + USED block at 260c00ac of size 136 + USED block at 260c0134 of size 20 + FREE block at 260c0148 of size 7860 OK - end of heap == near == - USED block at 16009306 of size 12 - USED block at 16009312 of size 530 - USED block at 16009524 of size 72 - USED block at 1600956c of size 20 - USED block at 16009580 of size 20 - USED block at 16009594 of size 20 - USED block at 160095a8 of size 20 - USED block at 160095bc of size 20 - USED block at 160095d0 of size 27180 + USED block at 160b9306 of size 12 + USED block at 160b9312 of size 530 + USED block at 160b9524 of size 72 + USED block at 160b956c of size 20 + USED block at 160b9580 of size 20 + USED block at 160b9594 of size 20 + USED block at 160b95a8 of size 20 + USED block at 160b95bc of size 20 + USED block at 160b95d0 of size 27180 OK - end of heap == far == - USED block at 26010016 of size 66 - USED block at 26010058 of size 18 - USED block at 2601006a of size 136 - USED block at 260100f2 of size 20 - USED block at 26010106 of size 7926 + USED block at 260c0016 of size 66 + USED block at 260c0058 of size 66 + USED block at 260c009a of size 18 + USED block at 260c00ac of size 136 + USED block at 260c0134 of size 20 + USED block at 260c0148 of size 7860 OK - end of heap Memory Type Total Used Free ---------------- -------- -------- -------- -Default 8166 222 7944 +Default 8166 288 7878 Near 27894 714 27180 -Far 8166 222 7944 +Far 8166 288 7878 ---------------- -------- -------- -------- coreleft = 27178 -farcoreleft = 59530 -GetFreeSize = 32370 +farcoreleft = 59464 +GetFreeSize = 32304 GetNearFreeSize = 27180 -GetFarFreeSize = 32370 +GetFarFreeSize = 32304 memavl = 27178 -stackavail = 11798 +stackavail = 11792 diff --git a/MMDUMP.16W b/MMDUMP.16W index 7f77808283331490a22ef3ed19cb10f8e99cb497..9aae7dc267680df3db8d32916980c7854dcf7a2c 100755 GIT binary patch literal 44 ocmXr0FfcGmu`)F>H&M{gWzbZxRWRV?GJuF$8YL$KMFpXv0L(rJi2wiq literal 66 zcmXr0FfcGmu`)F>PgKy*WzbZxRWRV?GJuF$8l@NkMFo*WO_HsWl9P;qqH$1B0L<n+a diff --git a/src/exmmtest.c b/src/exmmtest.c index 78fa104f..02fafeb6 100755 --- a/src/exmmtest.c +++ b/src/exmmtest.c @@ -64,7 +64,7 @@ void segatesuto() void main(int argc, char *argv[]) { - byte w; + byte w=1; global_game_variables_t gvar; #ifdef __WATCOMC__ __segment sega; @@ -72,21 +72,27 @@ main(int argc, char *argv[]) memptr bigbuffer; //static byte bakapee[64]; - char *bakapee; + char *bakapee1, *bakapee2; word baka; #ifdef __BORLANDC__ argc=argc; #endif - bakapee = malloc(64); + //file name // + bakapee1 = malloc(64); + bakapee2 = malloc(64); + //file name // + gvar.mm.mmstarted=0; //PRINTBB - if(argv[1]) bakapee = argv[1]; - else + if(argv[1]){ bakapee1 = argv[1]; + if(argv[2]) bakapee2 = argv[2]; } + else{ //{ printf("filename!: "); scanf("%[^\n]", &bakapee); } - bakapee = "data/koishi~.pcx"; - + bakapee1 = "data/koishi~.pcx"; + bakapee2 = "data/test.map"; + } // printf("main()=%Fp start MM\n", *argv[0]); MM_Startup(&gvar.mm, &gvar.mmi); //PM_Startup(); @@ -105,11 +111,14 @@ for(w=0;w<2;w++) if(w>0) { printf(" read\n"); - if(CA_ReadFile(bakapee, &bigbuffer, &gvar)) baka=1; else baka=0; + if(CA_ReadFile(bakapee2, &bigbuffer, &gvar)) baka=1; else baka=0; } #endif + if(w==0) + { printf(" load\n"); - if(CA_LoadFile(bakapee, &bigbuffer, &gvar)) baka=1; else baka=0; + if(CA_LoadFile(bakapee1, &bigbuffer, &gvar)) baka=1; else baka=0; + } // close(bakapeehandle); //hmm functions in cache system use the buffered stuff #ifdef __WATCOMC__ @@ -125,6 +134,8 @@ for(w=0;w<2;w++) MM_ShowMemory(&gvar, &gvar.mm); MM_DumpData(&gvar.mm); MM_Report(&gvar); + if(baka) printf("\nyay!\n"); + else printf("\npoo!\n"); printf("press any key to continue!\n"); getch(); #ifdef FILEREAD @@ -134,9 +145,7 @@ for(w=0;w<2;w++) //PM_Shutdown(); CA_Shutdown(&gvar); MM_Shutdown(&gvar.mm); - free(bakapee); - if(baka) printf("\nyay!\n"); - else printf("\npoo!\n"); + free(bakapee1); free(bakapee2); printf("========================================\n"); printf("near= %Fp ", gvar.mm.nearheap); printf("far= %Fp", gvar.mm.farheap); -- 2.39.5