]> 4ch.mooo.com Git - 16.git/commitdiff
0.exe now shows what the hell is going on on page 2 while the user can switch to...
authorsparky4 <sparky4@cock.li>
Mon, 18 Jul 2016 14:20:50 +0000 (09:20 -0500)
committersparky4 <sparky4@cock.li>
Mon, 18 Jul 2016 14:20:50 +0000 (09:20 -0500)
src/0.c
src/0.h [new file with mode: 0755]
src/scroll.c

diff --git a/src/0.c b/src/0.c
index 6e4a8d44a2e2cf0591d5d268abcc76825ff8ddbf..559d678a3b4f240ffbb12c58dcca38e34217c5dc 100755 (executable)
--- a/src/0.c
+++ b/src/0.c
@@ -3,13 +3,14 @@
 #include <hw/vga/vga.h>
 #include <hw/vga/vrl.h>
 
-#include "src/tesuto.h"
+#include "src/0.h"
 
 #define FILENAME_1 "data/aconita.vrl"
 #define FILENAME_2 "data/aconita.pal"
 
 static unsigned char palette[768];
 global_game_variables_t gvar;
+player_t player[1];
 
 int main(int argc,char **argv) {
        struct vrl1_vgax_header *vrl_header;
@@ -22,6 +23,10 @@ int main(int argc,char **argv) {
        bakapee1=malloc(64);
        bakapee2=malloc(1024);
 
+       IN_Startup();
+       IN_Default(0,&player,ctrl_Joystick);
+       IN_initplayer(&player, 0);
+
        if (argc < 3) {
                fprintf(stderr,"drawvrl <VRL file> <palette file>\n");
                bakapee1 = FILENAME_1;//"data/aconita.vrl";
@@ -126,10 +131,16 @@ int main(int argc,char **argv) {
 
                /* do it */
                omemptr = vga_state.vga_graphics_ram; // save original mem ptr
-               while (1) {
-                       /* stop animating if the user hits ENTER */
-                       if (kbhit()) {
-                               if (getch() == 13) break;
+
+               while(!IN_KeyDown(sc_Escape))
+               {
+                       IN_ReadControl(0,&player);
+                       if(IN_KeyDown(2)) modexShowPage(&(gvar.video.page[0]));
+                       if(IN_KeyDown(3)) modexShowPage(&(gvar.video.page[1]));
+                       if(IN_KeyDown(68))      //f10
+                       {
+                               //gvar.kurokku.fpscap=!gvar.kurokku.fpscap;
+                               IN_UserInput(1,1);
                        }
 
                        /* render box bounds. y does not need modification, but x and width must be multiple of 4 */
@@ -173,8 +184,7 @@ int main(int argc,char **argv) {
                        vga_state.vga_draw_stride_limit = vga_state.vga_draw_stride = gvar.video.page[0].stridew;
 
                        /* step */
-                       x += xdir;
-                       y += ydir;
+                       x += xdir; y += ydir;
                        if ((x + vrl_header->width) >= ((gvar.video.page[0].width + gvar.video.page[0].dx) - 1) || x == -(gvar.video.page[0].dx))
                                xdir = -xdir;
                        if ((y + vrl_header->height) >= ((gvar.video.page[0].height + gvar.video.page[0].dy) - 1) || y == -(gvar.video.page[0].dy))
@@ -183,22 +193,15 @@ int main(int argc,char **argv) {
                }
        }
 
-       while (1) {
-                       /* stop animating if the user hits ENTER */
-                       if (kbhit()) {
-                               if (getch() == 13) break;
-                       }
-               modexShowPage(&(gvar.video.page[1]));
-       }
+       IN_UserInput(1,1);
 
-       while (1) {
-                       /* stop animating if the user hits ENTER */
-                       if (kbhit()) {
-                               if (getch() == 13) break;
-                       }
-               modexShowPage(&(gvar.video.page[0]));
+       while(!IN_KeyDown(sc_Escape))
+       {
+               if(IN_KeyDown(2)) modexShowPage(&(gvar.video.page[0]));
+               if(IN_KeyDown(3)) modexShowPage(&(gvar.video.page[1]));
        }
 
+       modexShowPage(&(gvar.video.page[0]));
        /* another handy "demo" effect using VGA write mode 1.
         * we can take what's on screen and vertically squash it like an old analog TV set turning off. */
        {
@@ -279,10 +282,13 @@ int main(int argc,char **argv) {
                }
        }
 
+       IN_Shutdown();
        VGAmodeX(0, 1, &gvar);
        free(vrl_lineoffs);
        buffer = NULL;
        free(buffer);
        bufsz = 0;
+       free(bakapee1);
+       free(bakapee2);
        return 0;
 }
diff --git a/src/0.h b/src/0.h
new file mode 100755 (executable)
index 0000000..2fd0b91
--- /dev/null
+++ b/src/0.h
@@ -0,0 +1,14 @@
+#ifndef __TESUTO_0_H__
+#define __TESUTO_0_H__
+
+#include "src/lib/16_head.h"
+#include "src/lib/modex16.h"
+#include "src/lib/16_in.h"
+
+#include <hw/cpu/cpu.h>
+#include <hw/dos/dos.h>
+#include <hw/vga/vga.h>
+#include <hw/vga/vrl.h>
+
+typedef unsigned char far *VGA_RAM_PTR;
+#endif
index f45b350119a9c24e9a2a469272aa260de274fbea..b496aea74df6ebd5e42eeaa56ec226a03f78cab0 100755 (executable)
@@ -115,7 +115,6 @@ void main(int argc, char *argv[])
        /* data */
        player[0].data = malloc(48*128); //TODO use exmm
        *player[0].data = bitmapLoadPcx("data/chikyuu.pcx"); // load sprite
-       //npctmp = bitmapLoadPcx("ptmp1.pcx"); // load sprite
 
        /* create the planar buffer */
 ////++++       (player[0].data) = *planar_buf_from_bitmap(&p);