1 /* Project 16 Source Code~
\r
2 * Copyright (C) 2012-2017 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover
\r
4 * This file is part of Project 16.
\r
6 * Project 16 is free software; you can redistribute it and/or modify
\r
7 * it under the terms of the GNU General Public License as published by
\r
8 * the Free Software Foundation; either version 3 of the License, or
\r
9 * (at your option) any later version.
\r
11 * Project 16 is distributed in the hope that it will be useful,
\r
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
14 * GNU General Public License for more details.
\r
16 * You should have received a copy of the GNU General Public License
\r
17 * along with this program. If not, see <http://www.gnu.org/licenses/>, or
\r
18 * write to the Free Software Foundation, Inc., 51 Franklin Street,
\r
19 * Fifth Floor, Boston, MA 02110-1301 USA.
\r
25 #include "src/lib/16_head.h"
\r
26 #include "src/lib/16_tail.h"
\r
27 #include "src/lib/16_pm.h"
\r
28 #include "src/lib/16_ca.h"
\r
29 #include "src/lib/16_mm.h"
\r
30 #include "src/lib/16_hc.h"
\r
31 //#include "src/lib/16_vl.h"
\r
37 //file load or read definition
\r
39 //#define EXMMVERBOSE
\r
40 //#ifdef __BORLANDC__
\r
44 #define BBUF bigbuffer//gvar.ca.tinf[0]
\r
46 void VGAmodeX(sword vq, boolean cmem, global_game_variables_t *gv)
\r
48 printf("VGAmodeX dummy:\n %Fp %Fp %Fp\n", &vq, &cmem, gv);
\r
51 printf("&main()= %Fp\n", argv[0]);\
\r
53 printf(" %Fp\t", BBUF);\
\r
54 printf("&%Fp\n", &BBUF);\
\r
55 printf(" %04x\t", BBUF);\
\r
56 printf("& %04x\n", &BBUF);\
\r
58 //printf("&main()= %Fp\n", *argv[0]);
\r
59 //printf("bigbuffer= %Fp\n", bigbuffer);
\r
60 //printf("&bigbuffer= %Fp\n", &bigbuffer);
\r
61 //printf("bigbuffer= %04x\n", bigbuffer);
\r
62 //printf("&bigbuffer= %04x\n", &bigbuffer);
\r
67 char __based( void ) * scrptr;
\r
71 printf( "Top left character is '%c'.\n", *(screen:>scrptr) );
\r
72 // printf("Next string is: [");
\r
73 // while(*scrptr<16)
\r
75 // printf("%c", *(screen:>scrptr));
\r
81 // printf("press any key to continue!\n");
\r
87 main(int argc, char *argv[])
\r
90 static global_game_variables_t gvar;
\r
92 //#ifdef __WATCOMC__
\r
95 //static byte bakapee[64];
\r
96 char *bakapee1, *bakapee2;
\r
103 bakapee1 = malloc(64);
\r
104 bakapee2 = malloc(64);
\r
108 #ifdef __DEBUG_PM__
\r
109 dbg_debugpm=1; //debug pm
\r
114 if(argv[1]){ bakapee1 = argv[1];
\r
115 if(argv[2]) bakapee2 = argv[2]; }
\r
117 //{ printf("filename!: "); scanf("%[^\n]", &bakapee); }
\r
118 bakapee1 = "data/koishi~.pcx";
\r
119 bakapee2 = "data/test.map";
\r
121 //printf("main()=%Fp start MM\n", *argv[0]);
\r
125 #ifdef __DEBUG_PM__
\r
129 PM_Startup(&gvar); PM_CheckMainMem(&gvar); PM_UnlockMainMem(&gvar);
\r
130 #ifdef __DEBUG_PM__
\r
135 // printf(" done!\n");
\r
137 PRINTBB; printf("press any key to continue!\n"); getch();
\r
141 // printf("size of big buffer~=%u\n", _bmsize(segu, BBUF));
\r
145 if(CA_ReadFile(bakapee2, &BBUF, &gvar)) baka=1; else baka=0;
\r
151 if(CA_LoadFile(bakapee1, &BBUF, &gvar)) baka=1; else baka=0;
\r
153 //#ifdef __WATCOMC__
\r
154 // printf("\nsize of big buffer~=%u\n", _bmsize(sega, BBUF));
\r
157 printf("contents of the buffer\n[\n%s\n]\n", (BBUF));
\r
161 //printf("dark purple = purgable\n");
\r
162 //printf("medium blue = non purgable\n");
\r
163 //printf("red = locked\n");
\r
164 // printf("press any key to continue!\n");
\r
165 // DebugMemory_(&gvar, 1);
\r
166 if(baka) printf("\nyay!\n");
\r
167 else printf("\npoo!\n");
\r
168 printf("press any key to continue!\n");
\r
173 DebugMemory_(&gvar, 1);
\r
174 MM_DumpData(&gvar);
\r
176 //printf("bakapee1=%s\n", bakapee1);
\r
177 //printf("bakapee2=%s\n", bakapee2);
\r
178 MM_FreePtr(&BBUF, &gvar);
\r
180 #ifdef __DEBUG_PM__
\r
183 PM_Shutdown(&gvar);
\r
185 CA_Shutdown(&gvar);
\r
186 MM_Shutdown(&gvar);
\r
187 free(bakapee1); free(bakapee2);
\r
188 printf("========================================\n");
\r
189 printf("near= %Fp ", gvar.mm.nearheap);
\r
190 printf("far= %Fp", gvar.mm.farheap);
\r
192 printf("&near= %Fp ", &(gvar.mm.nearheap));
\r
193 printf("&far= %Fp", &(gvar.mm.farheap));
\r
196 printf("bigb= %Fp ", BBUF);
\r
197 //printf("bigbr= %04x", BBUF);
\r
199 printf("&bigb=%Fp ", &BBUF);
\r
200 //printf("&bigb=%04x", &BBUF);
\r
202 printf("========================================\n");
\r
206 //this is far printf("Total free: %lu\n", (dword)(GetFreeSize()));
\r
207 printf("Total near free: %lub\n", (dword)(GetNearFreeSize()));
\r
208 printf("Total far free: %lub\n", (dword)(GetFarFreeSize()));
\r
212 #ifdef __BORLANDC__
\r
213 //printf("core left: %lu\n", (dword)_coreleft());
\r
214 //printf("far core left: %lu\n", (dword)_farcoreleft());
\r
215 printf("core left: %lu\n", (dword)coreleft());
\r
216 printf("far core left: %lu\n", (dword)farcoreleft());
\r
218 printf("Project 16 exmmtest.exe. This is just a test file!\n");
\r
219 printf("version %s\n", VERSION);
\r
222 //printf("based core left: %lu\n", (dword)_basedcoreleft());
\r
223 //printf("huge core left: %lu\n", (dword)_hugecoreleft());
\r