1 /* Project 16 Source Code~
\r
2 * Copyright (C) 2012-2016 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
23 #include "src/lib/16_vl.h"
\r
24 #include "src/lib/16_sprit.h"
\r
25 #include "src/lib/16_ca.h"
\r
26 #include "src/lib/16_mm.h"
\r
28 static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */
\r
31 static global_game_variables_t gvar;
\r
42 gvar.mm.mmstarted=0;
\r
44 MM_Startup(&gvar.mm, &gvar.mmi);
\r
46 printf("loading\n");
\r
47 if(CA_LoadFile("data/spri/chikyuu.vrs", &bigbuffer, &gvar)) baka=1; else baka=0;
\r
49 // DOSLIB: check our environment
\r
52 // DOSLIB: what CPU are we using?
\r
53 // NTS: I can see from the makefile Sparky4 intends this to run on 8088 by the -0 switch in CFLAGS.
\r
54 // So this code by itself shouldn't care too much what CPU it's running on. Except that other
\r
55 // parts of this project (DOSLIB itself) rely on CPU detection to know what is appropriate for
\r
56 // the CPU to carry out tasks. --J.C.
\r
59 // DOSLIB: check for VGA
\r
61 printf("VGA probe failed\n");
\r
64 // hardware must be VGA or higher!
\r
65 if (!(vga_state.vga_flags & VGA_IS_VGA)) {
\r
66 printf("This program requires VGA or higher graphics hardware\n");
\r
70 VGAmodeX(1, 1, &gvar);
\r
71 modexHiganbanaPageSetup(&gvar.video);
\r
73 /* non sprite comparison */
\r
75 modexCopyPageRegion(&gvar.video.page[0], &gvar.video.page[0], 0, 0, 0, 0, 320, 240);
\r
76 t1 = (*clockw-start) /18.2;
\r
80 t2 = (*clockw-start)/18.2;
\r
87 modexPalUpdate0(pal);
\r
94 VGAmodeX(0, 1, &gvar);
\r
95 MM_ShowMemory(&gvar, &gvar.mm);
\r
96 MM_DumpData(&gvar.mm);
\r
98 MM_FreePtr(&bigbuffer, &gvar.mm);
\r
100 CA_Shutdown(&gvar);
\r
101 MM_Shutdown(&gvar.mm);
\r
102 //printf("CPU to VGA: %f\n", t1);
\r
103 //printf("VGA to VGA: %f\n", t2);
\r
105 printf("Project 16 vgacamm.exe. This is just a test file!\n");
\r
106 printf("version %s\n", VERSION);
\r
107 printf("t1: %f\n", t1);
\r
108 printf("t2: %f\n", t2);
\r
109 printf("gvar.video.page[0].width: %u\n", gvar.video.page[0].width);
\r
110 printf("gvar.video.page[0].height: %u\n", gvar.video.page[0].height);
\r
111 // printf("Num %d", num_of_vrl);
\r
112 if(baka) printf("\nyay!\n");
\r
113 else printf("\npoo!\n");
\r