From: sparky4 Date: Sat, 1 Aug 2015 00:11:14 +0000 (-0500) Subject: THE STACK IS FUCKING UP EVERYTHING! WWWW X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=f25bc68773faab4e860312669d8f19f6ce2ff737;p=16.git THE STACK IS FUCKING UP EVERYTHING! WWWW modified: 16.exe new file: DEBUG.16 new file: MMDUMP.16 modified: bakapi.exe modified: exmmtest.exe modified: fmemtest.exe modified: fontgfx.exe modified: fonttest.exe modified: inputest.exe modified: makefile modified: maptest.exe modified: palettec.exe modified: pcxtest.exe modified: scroll.exe modified: sega.exe modified: sountest.exe modified: src/exmmtest.c modified: test.exe modified: test2.exe modified: tsthimem.exe --- diff --git a/16.exe b/16.exe index 85e6fc4a..94c1d6cf 100644 Binary files a/16.exe and b/16.exe differ diff --git a/DEBUG.16 b/DEBUG.16 new file mode 100644 index 00000000..c5222828 --- /dev/null +++ b/DEBUG.16 @@ -0,0 +1,6 @@ +Seg:0 Size:5623 Owner:0xcc80 +Seg:15f7 Size:256 Owner:0x5a06 +Seg:16f7 Size:273 Owner:0x92a8 +Seg:1c92 Size:17 Owner:0x5d5a +Seg:1e93 Size:49517 Owner:0x9bec +Seg:e000 Size:4294909951 Owner:0x468d diff --git a/MMDUMP.16 b/MMDUMP.16 new file mode 100644 index 00000000..4f7180f2 Binary files /dev/null and b/MMDUMP.16 differ diff --git a/bakapi.exe b/bakapi.exe index a30c1bb0..317cc1d8 100644 Binary files a/bakapi.exe and b/bakapi.exe differ diff --git a/exmmtest.exe b/exmmtest.exe index 324f4f9d..ec710680 100644 Binary files a/exmmtest.exe and b/exmmtest.exe differ diff --git a/fmemtest.exe b/fmemtest.exe index a5a7ab9a..d5018602 100644 Binary files a/fmemtest.exe and b/fmemtest.exe differ diff --git a/fontgfx.exe b/fontgfx.exe index bf8a3afa..d5dd6f94 100644 Binary files a/fontgfx.exe and b/fontgfx.exe differ diff --git a/fonttest.exe b/fonttest.exe index 4de46206..92c4b884 100644 Binary files a/fonttest.exe and b/fonttest.exe differ diff --git a/inputest.exe b/inputest.exe index c8083960..0f715093 100644 Binary files a/inputest.exe and b/inputest.exe differ diff --git a/makefile b/makefile index 9eafa639..6842c148 100644 --- a/makefile +++ b/makefile @@ -22,13 +22,12 @@ WCPULIB=$(SRCLIB)wcpu$(DIRSEP) 16FLAGS=-fh=16.hed BAKAPIFLAGS=-fh=bakapi.hed -#-st -zu -SFLAGS=-k32768#51200#49152#24576 +SFLAGS=-sg -st -of+ -k32768#51200#49152#24576 DFLAGS=-DTARGET_MSDOS=16 -DMSDOS=1 $(SFLAGS) -ZFLAGS=-zk0 -zq# -zu# -zm# -zc# -zdp# -zp16 -zq -CFLAGS=-mc -ei -wo -x -OFLAGS=-otexanbhrml -ol+ -FLAGS=-0 -d2 -lr $(OFLAGS) $(CFLAGS) $(DFLAGS) $(ZFLAGS) +ZFLAGS=-zk0 -zq -zu# -zm# -zc# -zdp# -zp16 +CFLAGS=-mc -lr -l=dos -wo -x -d2 +OFLAGS=-onatx -oh -oi -ei -zp8 -0 -fpi87#-oebrml -ol+ +FLAGS=$(OFLAGS) $(CFLAGS) $(DFLAGS) $(ZFLAGS) DOSLIBEXMMOBJ = himemsys.$(OBJ) emm.$(OBJ) DOSLIBOBJ = adlib.$(OBJ) midi.$(OBJ) 8254.$(OBJ) 8259.$(OBJ) dos.$(OBJ) cpu.$(OBJ) diff --git a/maptest.exe b/maptest.exe index 2b70d831..cbe8df70 100644 Binary files a/maptest.exe and b/maptest.exe differ diff --git a/palettec.exe b/palettec.exe index 7f2d2708..def0ef72 100644 Binary files a/palettec.exe and b/palettec.exe differ diff --git a/pcxtest.exe b/pcxtest.exe index 491a9cff..2d23d88c 100644 Binary files a/pcxtest.exe and b/pcxtest.exe differ diff --git a/scroll.exe b/scroll.exe index 9d132349..7d734535 100644 Binary files a/scroll.exe and b/scroll.exe differ diff --git a/sega.exe b/sega.exe index f71de577..4d7e238c 100644 Binary files a/sega.exe and b/sega.exe differ diff --git a/sountest.exe b/sountest.exe index db2fbe05..6a219c15 100644 Binary files a/sountest.exe and b/sountest.exe differ diff --git a/src/exmmtest.c b/src/exmmtest.c index a1457aae..c0bbc332 100644 --- a/src/exmmtest.c +++ b/src/exmmtest.c @@ -1,146 +1,146 @@ -/* Project 16 Source Code~ - * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669 - * - * This file is part of Project 16. - * - * Project 16 is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * Project 16 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see , or - * write to the Free Software Foundation, Inc., 51 Franklin Street, - * Fifth Floor, Boston, MA 02110-1301 USA. - * - */ -/* - exmm test -*/ -#include -#include - -#include "src/lib/16_head.h" -#include "src/lib/16_ca.h" -#include "src/lib/16_mm.h" -//#include "src/lib/modex16.h" -//#pragma hdrstop +/* Project 16 Source Code~ + * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669 + * + * This file is part of Project 16. + * + * Project 16 is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Project 16 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see , or + * write to the Free Software Foundation, Inc., 51 Franklin Street, + * Fifth Floor, Boston, MA 02110-1301 USA. + * + */ +/* + exmm test +*/ +#include +#include + +#include "src/lib/16_head.h" +#include "src/lib/16_ca.h" +#include "src/lib/16_mm.h" +//#include "src/lib/modex16.h" +#pragma hdrstop + +#pragma warn -pro +#pragma warn -use + +//file load or read definition +#define FILERL +//#define FILEREAD + +void +main(int argc, char *argv[]) +{ + mminfo_t mm; mminfotype mmi; + __segment sega; + void __based(sega)* bigbuffer; +#ifdef FILERL + char *bakapee; + word baka; +#endif + //static page_t screen; + + printf("&main()= %Fp\n", *argv[0]); + printf("bigbuffer= %Fp\n", bigbuffer); + printf("&bigbuffer= %Fp\n", &bigbuffer); + printf("bigbuffer= %04x\n", bigbuffer); + printf("&bigbuffer= %04x\n", &bigbuffer); + +#ifdef FILERL + bakapee = malloc(64); +#endif + mm.mmstarted=0; + +#ifdef FILERL + if(argv[1]) bakapee = argv[1]; + else bakapee = "data/koishi~.pcx"; +#endif -//#pragma warn -pro -//#pragma warn -use - -//file load or read definition -#define FILERL -//#define FILEREAD - -void -main(int argc, char *argv[]) -{ - mminfo_t mm; mminfotype mmi; - __segment sega; - void __based(sega)* bigbuffer; -#ifdef FILERL - char *bakapee; - word baka; -#endif - //static page_t screen; - - printf("&main()= %Fp\n", *argv[0]); - printf("bigbuffer= %Fp\n", bigbuffer); - printf("&bigbuffer= %Fp\n", &bigbuffer); - printf("bigbuffer= %04x\n", bigbuffer); - printf("&bigbuffer= %04x\n", &bigbuffer); - -#ifdef FILERL - bakapee = malloc(64); -#endif - mm.mmstarted=0; - -#ifdef FILERL - if(argv[1]) bakapee = argv[1]; - else bakapee = "data/koishi~.pcx"; -#endif - textInit(); - - /* setup camera and screen~ */ + + /* setup camera and screen~ */ //bug!!! //screen = modexDefaultPage(); /*screen.width += (16*2); - screen.height += (16*2);*/ - - printf("main()=%Fp start MM\n", *argv[0]); - MM_Startup(&mm, &mmi); + screen.height += (16*2);*/ + + printf("main()=%Fp start MM\n", *argv[0]); + MM_Startup(&mm, &mmi); //PM_Startup(); //PM_UnlockMainMem(); - CA_Startup(); - printf(" done!\n"); - printf("&main()= %Fp\n", *argv[0]); - printf("bigbuffer= %Fp\n", bigbuffer); - 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)); -// if(CA_FarRead(bakapeehandle,(void far *)&bigbuffer,sizeof(bigbuffer),&mm)) -#ifdef FILEREAD - printf(" read\n"); - if(CA_ReadFile(bakapee, &bigbuffer, &mm)) -#else - printf(" load\n"); - if(CA_LoadFile(bakapee, &bigbuffer, &mm, &mmi)) -#endif - baka=1; - else - baka=0; -// close(bakapeehandle); - //hmm functions in cache system use the buffered stuff - 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(); - //++++modexEnter(); - //++++modexShowPage(&screen); - MM_ShowMemory(/*&screen, */&mm); - //getch(); - MM_DumpData(&mm); - //++++modexLeave(); - MM_Report(&mm, &mmi); - printf(" stop!\n"); -#ifdef FILERL - MM_FreePtr(&bigbuffer, &mm); -#endif - //PM_Shutdown(); - CA_Shutdown(); - MM_Shutdown(&mm); - printf(" done!\n"); -#ifdef FILERL - free(bakapee); - if(baka) printf("\nyay!\n"); - else printf("\npoo!\n"); -#endif - printf("bigbuffer= %Fp\n", bigbuffer); - printf("&bigbuffer= %Fp\n", &bigbuffer); - printf("bigbuffer= %04x\n", bigbuffer); - printf("&bigbuffer= %04x\n", &bigbuffer); - printf("\n\n"); - printf("Total free: %lu\n", (dword)(GetFreeSize())); - printf("Total near free: %lu\n", (dword)(GetNearFreeSize())); - printf("Total far free: %lu\n", (dword)(GetFarFreeSize())); - getch(); - printf("\n"); - heapdump(); - printf("core left: %lu\n", (dword)_coreleft()); - printf("far core left: %lu\n", (dword)_farcoreleft()); - //printf("based core left: %lu\n", (dword)_basedcoreleft()); - //printf("huge core left: %lu\n", (dword)_hugecoreleft()); -} + CA_Startup(); + printf(" done!\n"); + printf("&main()= %Fp\n", *argv[0]); + printf("bigbuffer= %Fp\n", bigbuffer); + 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)); +// if(CA_FarRead(bakapeehandle,(void far *)&bigbuffer,sizeof(bigbuffer),&mm)) +#ifdef FILEREAD + printf(" read\n"); + if(CA_ReadFile(bakapee, &bigbuffer, &mm)) +#else + printf(" load\n"); + if(CA_LoadFile(bakapee, &bigbuffer, &mm, &mmi)) +#endif + baka=1; + else + baka=0; +// close(bakapeehandle); + //hmm functions in cache system use the buffered stuff + 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(); + //++++modexEnter(); + //++++modexShowPage(&screen); + MM_ShowMemory(/*&screen, */&mm); + //getch(); + MM_DumpData(&mm); + //++++modexLeave(); + MM_Report(&mm, &mmi); + printf(" stop!\n"); +#ifdef FILERL + MM_FreePtr(&bigbuffer, &mm); +#endif + //PM_Shutdown(); + CA_Shutdown(); + MM_Shutdown(&mm); + printf(" done!\n"); +#ifdef FILERL + free(bakapee); + if(baka) printf("\nyay!\n"); + else printf("\npoo!\n"); +#endif + printf("bigbuffer= %Fp\n", bigbuffer); + printf("&bigbuffer= %Fp\n", &bigbuffer); + printf("bigbuffer= %04x\n", bigbuffer); + printf("&bigbuffer= %04x\n", &bigbuffer); + printf("\n\n"); + printf("Total free: %lu\n", (dword)(GetFreeSize())); + printf("Total near free: %lu\n", (dword)(GetNearFreeSize())); + printf("Total far free: %lu\n", (dword)(GetFarFreeSize())); + getch(); + printf("\n"); + heapdump(); + printf("core left: %lu\n", (dword)_coreleft()); + printf("far core left: %lu\n", (dword)_farcoreleft()); + //printf("based core left: %lu\n", (dword)_basedcoreleft()); + //printf("huge core left: %lu\n", (dword)_hugecoreleft()); +} diff --git a/test.exe b/test.exe index 4b164a39..f92b0fb3 100644 Binary files a/test.exe and b/test.exe differ diff --git a/test2.exe b/test2.exe index 17b2e157..b3bfa877 100644 Binary files a/test2.exe and b/test2.exe differ diff --git a/tsthimem.exe b/tsthimem.exe index 405febaa..07b43325 100644 Binary files a/tsthimem.exe and b/tsthimem.exe differ