]> 4ch.mooo.com Git - 16.git/commitdiff
FUCKING BORLAND C VERSION OF EMMTEST.EXE FOR TESTING AND EXPERIMEWNTAL UNDERSTASN8ING...
authorsparky4 <sparky4@cock.li>
Wed, 29 Jul 2015 02:43:22 +0000 (21:43 -0500)
committersparky4 <sparky4@cock.li>
Wed, 29 Jul 2015 02:43:22 +0000 (21:43 -0500)
new file:   16/exmmtest/exmmtest.c
new file:   16/exmmtest/wtf_this.wat
modified:   16/segm/pee.c
modified:   DEBUG.16
modified:   MMDUMP.16

16/exmmtest/exmmtest.c [new file with mode: 0644]
16/exmmtest/wtf_this.wat [new file with mode: 0644]
16/segm/pee.c
DEBUG.16
MMDUMP.16

diff --git a/16/exmmtest/exmmtest.c b/16/exmmtest/exmmtest.c
new file mode 100644 (file)
index 0000000..afbc9d0
--- /dev/null
@@ -0,0 +1,139 @@
+/* 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 <http://www.gnu.org/licenses/>, or
+ * write to the Free Software Foundation, Inc., 51 Franklin Street,
+ * Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ */
+/*
+       exmm test
+*/
+#include <stdio.h>
+#include <bios.h>
+
+#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\r
+\r
+#pragma warn -pro\r
+#pragma warn -use
+
+//file load or read definition
+#define FILERL
+#define FILEREAD
+
+void
+main(int argc, char *argv[])
+{
+       mminfo_t mm; mminfotype mmi;
+       __segment segu;
+#ifdef FILERL
+       memptr bigbuffer;
+       char *bakapee;
+//     int bakapeehandle;
+       word baka;
+#endif
+       //static page_t screen;
+
+       //mmi.segu=FP_SEG(segu);
+
+       printf("&main()=%Fp\n", *argv[0]);
+       printf("&segu=%p\n", (segu));
+       //printf("mmi.segu=%p\n", (mmi.segu));
+
+#ifdef FILERL
+       bakapee = malloc(64);
+//     memset(bakapee, 0, 64);
+#endif
+       mm.mmstarted=0;
+
+#ifdef FILERL
+       if(argv[1]) bakapee = argv[1];
+       else bakapee = "data/koishi~~.pcx";
+#endif
+
+       textInit();\r
+
+       /* setup camera and screen~ */
+       //bug!!!\r
+       //screen = modexDefaultPage();\r
+       /*screen.width += (16*2);\r
+       screen.height += (16*2);*/
+
+       printf("main()=%Fp      start MM\n", *argv[0]);
+       MM_Startup(&mm, &mmi);
+       //PM_Startup();\r
+       //PM_UnlockMainMem();\r
+       CA_Startup();
+       printf("                done!\n");
+       /*if(FP_SEG(*argv[0])==0)
+       {
+               MM_Report(&screen, &mm, &mmi);
+               MM_Shutdown(&mm);
+               printf("&main()=%Fp\n", *argv[0]);
+               printf("&main() == %u\n", FP_SEG(*argv[0]));
+               exit(-5);
+       }*/
+       printf("&main()=%Fp\n", *argv[0]);
+       printf("&segu=%p\n", (segu));\r
+       //printf("mmi.segu=%p\n", (mmi.segu));
+#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(segu, 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("_bios_memsize=%u\n", _bios_memsize());
+}
diff --git a/16/exmmtest/wtf_this.wat b/16/exmmtest/wtf_this.wat
new file mode 100644 (file)
index 0000000..3f027ee
--- /dev/null
@@ -0,0 +1 @@
+MORE FUCKING BORLAND C BEHAVIOR TESTING!! wwww
\ No newline at end of file
index ba7625181e78943044f63bf336e6065b2c2d2e64..03c13ab3e98e83b325ee7540e28b6851b68d4b64 100644 (file)
@@ -26,7 +26,7 @@
 #ifdef __WATCOMC__
 //typedef void __based(__self) * memptr;
 //typedef __segment * memptr;
-typedef _segment * memptr;
+typedef __segment * memptr;
 #endif
 #ifdef __BORLANDC__
 typedef void _seg * memptr;
index b9314b32e3d858849b228e7e4a766f6cb4a39cd2..b8b544cc361bb939399ce9c55ec35ac4e2c79037 100644 (file)
--- a/DEBUG.16
+++ b/DEBUG.16
@@ -1,3 +1,16 @@
-Seg:f886       Size:1975520253 Owner:0x2e06\r
-\r
-MM_ShowMemory: Memory block order currupted!\r
+Seg:0  Size:6828       Owner:0x1674\r
+Seg:1b85       Size:33 Owner:0x46c7\r
+Seg:1ba6       Size:256        Owner:0xc25c\r
+Seg:1f4b       Size:45238      Owner:0x90c3\r
+Seg:d022       Size:4294967263 Owner:0x91e8\r
+Seg:d022       Size:4294967263 Owner:0x8b04\r
+Seg:d022       Size:4294967263 Owner:0x26b8\r
+Seg:d022       Size:4294967263 Owner:0xf04e\r
+Seg:d022       Size:4294967263 Owner:0x7f94\r
+Seg:d022       Size:4294967263 Owner:0xc01b\r
+Seg:d022       Size:4294967263 Owner:0x1a2\r
+Seg:d022       Size:4294967263 Owner:0x9005\r
+Seg:d022       Size:4294967263 Owner:0x3350\r
+Seg:d022       Size:4294967263 Owner:0x2b8\r
+Seg:d022       Size:419        Owner:0x2eb8\r
+Seg:e000       Size:4294909951 Owner:0xc02b\r
index d9f595ef864b3de0b5ceabb024911d8bf77fd373..60f5dafbc176fc15bbaebf38ed3bb91cd5e35144 100644 (file)
Binary files a/MMDUMP.16 and b/MMDUMP.16 differ