]> 4ch.mooo.com Git - 16.git/blobdiff - src/0.c
__seguse.txt added to show _seg usage also OpenVGMFile needs to be ported to 16_snd...
[16.git] / src / 0.c
diff --git a/src/0.c b/src/0.c
index 2d55bcdfdddc3edbabe1432e1423531f9eb3ff23..96d8e7aa0553f5f0061cfd473c3af4fdcb463537 100755 (executable)
--- a/src/0.c
+++ b/src/0.c
@@ -1,3 +1,25 @@
+/* Project 16 Source Code~\r
+ * Copyright (C) 2012-2017 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\r
+ *\r
+ * This file is part of Project 16.\r
+ *\r
+ * Project 16 is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 3 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * Project 16 is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>, or\r
+ * write to the Free Software Foundation, Inc., 51 Franklin Street,\r
+ * Fifth Floor, Boston, MA 02110-1301 USA.\r
+ *\r
+ */\r
+\r
 #include <hw/cpu/cpu.h>\r
 #include <hw/dos/dos.h>\r
 #include <hw/vga/vga.h>\r
@@ -12,9 +34,7 @@
 \r
 #define INITTNUM 1\r
 \r
-player_t player[MaxPlayers];\r
 map_view_t mv[4];\r
-\r
 map_t map;//junk var\r
 \r
 int main(int argc,char **argv)\r
@@ -81,14 +101,14 @@ int main(int argc,char **argv)
        vrl_lineoffs = vrl1_vgax_genlineoffsets(vrl_header,buffer+sizeof(*vrl_header),bufsz-sizeof(*vrl_header));\r
        if (vrl_lineoffs == NULL) return 1;\r
 \r
-       IN_Startup();\r
-       IN_Default(0,&player,ctrl_Keyboard1);\r
-       EN_initplayer(&player, 0);\r
+       IN_Startup(&gvar);\r
+       IN_Default(0,&gvar.player[0],ctrl_Keyboard1, &gvar);\r
+       EN_initPlayer(&gvar.player[0], &gvar.video);\r
 \r
        /* setup camera and screen~ */\r
        modexHiganbanaPageSetup(&gvar.video);\r
-       ZC_MVSetup(&mv, &map, &gvar);\r
-       ZC_ShowMV(&mv, gvar.video.sp, 0);\r
+       ZC_MVSetup(&gvar.mv, &map, &gvar);\r
+       ZC_ShowMV(&gvar.mv, gvar.video.sp, 0);\r
 \r
 //     VL_PatternDraw(video_t *video, word pn, boolean sw, boolean allsw);\r
        VL_PatternDraw(&gvar.video, 0/*gvar.video.sp*/, 0, 1);\r
@@ -120,24 +140,24 @@ int main(int argc,char **argv)
 \r
                while(!IN_KeyDown(sc_Escape))\r
                {\r
-                       IN_ReadControl(0,&player);\r
-                       if(IN_KeyDown(68)){ gvar.kurokku.fpscap=!gvar.kurokku.fpscap; IN_UserInput(1,1); } //f10\r
-                       PANKEYFUN;\r
+                       IN_ReadControl(&gvar.player[0], &gvar);\r
+                       if(IN_KeyDown(68)){ gvar.kurokku.fpscap=!gvar.kurokku.fpscap; IN_UserInput(1, &gvar); } //f10\r
+                       TAIL_PANKEYFUN;\r
                        if(IN_KeyDown(sc_Space) || zerostoppause)       //space\r
                        {\r
                                anim=!anim;\r
                                DRAWCORNERBOXES;\r
-                               if(!zerostoppause) IN_UserInput(1,1); else zerostoppause=0;\r
+                               if(!zerostoppause) IN_UserInput(1, &gvar); else zerostoppause=0;\r
                        }\r
                        if(IN_KeyDown(sc_R)){\r
                                gvar.video.page[0].dx=gvar.video.page[0].dy=gvar.video.page[1].dx=gvar.video.page[1].dy=16;\r
-                               mv[0].tx = mv[0].ty = mv[1].tx = mv[1].ty = INITTNUM;\r
+                               gvar.mv[0].tx = gvar.mv[0].ty = gvar.mv[1].tx = gvar.mv[1].ty = INITTNUM;\r
                                VL_ShowPage(&gvar.video.page[gvar.video.sp], 1, 0);\r
-                               player[0].enti.q = 1; player[0].enti.d = 2;\r
+                               gvar.player[0].enti.q = 1; gvar.player[0].enti.d = 2;\r
                                x=y=0;\r
                                xdir=ydir=1;\r
                        } //R\r
-                       FUNCTIONKEYFUNCTIONS0EXE;\r
+                       TAIL_FUNCTIONKEYFUNCTIONS0EXE;\r
 \r
                        if(anim && !noanim)\r
                        {\r
@@ -193,11 +213,11 @@ draw_vrl1_vgax_modex(x-rx,y-ry,vrl_header,vrl_lineoffs,buffer+sizeof(*vrl_header
                }\r
        }\r
 \r
-       IN_UserInput(1,1);\r
+       IN_UserInput(1, &gvar);\r
 \r
 //===========================================================================//\r
 \r
-       ZC_ShowMV(&mv, 0, 0);\r
+       ZC_ShowMV(&gvar.mv, 0, 0);\r
 if(!noanim) {\r
        /* another handy "demo" effect using VGA write mode 1.\r
         * we can take what's on screen and vertically squash it like an old analog TV set turning off. */\r
@@ -281,7 +301,7 @@ if(!noanim) {
                }\r
        }\r
 }\r
-       IN_Shutdown();\r
+       IN_Shutdown(&gvar);\r
        VGAmodeX(0, 1, &gvar);\r
        free(vrl_lineoffs);\r
        buffer = NULL;\r
@@ -292,7 +312,7 @@ if(!noanim) {
        printf("\nProject 16 0.exe. This is just a test file!\n");\r
        printf("version %s\n", VERSION);\r
        //SCROLLEXITMESG;\r
-       printf("mv 0\n- tx=%d   ty=%d   dx=%d   dy=%d\n", mv[0].tx, mv[0].ty, gvar.video.page[0].dx, gvar.video.page[0].dy);\r
-       printf("mv 1\n- tx=%d   ty=%d   dx=%d   dy=%d\n", mv[1].tx, mv[1].ty, gvar.video.page[1].dx, gvar.video.page[1].dy);\r
+       printf("mv 0\n- tx=%d   ty=%d   dx=%d   dy=%d\n", gvar.mv[0].tx, gvar.mv[0].ty, gvar.video.page[0].dx, gvar.video.page[0].dy);\r
+       printf("mv 1\n- tx=%d   ty=%d   dx=%d   dy=%d\n", gvar.mv[1].tx, gvar.mv[1].ty, gvar.video.page[1].dx, gvar.video.page[1].dy);\r
        return 0;\r
 }\r