From 03b11936b949dbb651e1cac8da8aa3629ca11fa9 Mon Sep 17 00:00:00 2001 From: sparky4 Date: Tue, 28 Jul 2015 21:43:22 -0500 Subject: [PATCH] FUCKING BORLAND C VERSION OF EMMTEST.EXE FOR TESTING AND EXPERIMEWNTAL UNDERSTASN8INGD FUCK!!! 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 | 139 +++++++++++++++++++++++++++++++++++++++ 16/exmmtest/wtf_this.wat | 1 + 16/segm/pee.c | 2 +- DEBUG.16 | 19 +++++- MMDUMP.16 | Bin 127 -> 396 bytes 5 files changed, 157 insertions(+), 4 deletions(-) create mode 100644 16/exmmtest/exmmtest.c create mode 100644 16/exmmtest/wtf_this.wat diff --git a/16/exmmtest/exmmtest.c b/16/exmmtest/exmmtest.c new file mode 100644 index 00000000..afbc9d04 --- /dev/null +++ b/16/exmmtest/exmmtest.c @@ -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 , 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 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(); + + /* 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); + //PM_Startup(); + //PM_UnlockMainMem(); + 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)); + //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 index 00000000..3f027eef --- /dev/null +++ b/16/exmmtest/wtf_this.wat @@ -0,0 +1 @@ +MORE FUCKING BORLAND C BEHAVIOR TESTING!! wwww \ No newline at end of file diff --git a/16/segm/pee.c b/16/segm/pee.c index ba762518..03c13ab3 100644 --- a/16/segm/pee.c +++ b/16/segm/pee.c @@ -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; diff --git a/DEBUG.16 b/DEBUG.16 index b9314b32..b8b544cc 100644 --- a/DEBUG.16 +++ b/DEBUG.16 @@ -1,3 +1,16 @@ -Seg:f886 Size:1975520253 Owner:0x2e06 - -MM_ShowMemory: Memory block order currupted! +Seg:0 Size:6828 Owner:0x1674 +Seg:1b85 Size:33 Owner:0x46c7 +Seg:1ba6 Size:256 Owner:0xc25c +Seg:1f4b Size:45238 Owner:0x90c3 +Seg:d022 Size:4294967263 Owner:0x91e8 +Seg:d022 Size:4294967263 Owner:0x8b04 +Seg:d022 Size:4294967263 Owner:0x26b8 +Seg:d022 Size:4294967263 Owner:0xf04e +Seg:d022 Size:4294967263 Owner:0x7f94 +Seg:d022 Size:4294967263 Owner:0xc01b +Seg:d022 Size:4294967263 Owner:0x1a2 +Seg:d022 Size:4294967263 Owner:0x9005 +Seg:d022 Size:4294967263 Owner:0x3350 +Seg:d022 Size:4294967263 Owner:0x2b8 +Seg:d022 Size:419 Owner:0x2eb8 +Seg:e000 Size:4294909951 Owner:0xc02b diff --git a/MMDUMP.16 b/MMDUMP.16 index d9f595ef864b3de0b5ceabb024911d8bf77fd373..60f5dafbc176fc15bbaebf38ed3bb91cd5e35144 100644 GIT binary patch literal 396 zcmZ{gK@I{T3`Jd=cn93+!sJsZ43l^msmvL?k6YJX$D=41W5ks8d;PyHE`XOA_C#iP zc5 u?_d!3!n(uYX}~EdezC$Q)Z}d