]> 4ch.mooo.com Git - 16.git/commitdiff
bakapi.exe has tile support switch wwww
authorsparky4 <sparky4@cock.li>
Sun, 3 Apr 2016 18:32:31 +0000 (13:32 -0500)
committersparky4 <sparky4@cock.li>
Sun, 3 Apr 2016 18:32:31 +0000 (13:32 -0500)
makefile
src/bakapi.c
src/lib/16_in.c
src/lib/16_in.h
src/lib/bakapee.h

index 8d94ab0f1f1dd27465aa27a66a43194ffc48371f..3de9313ee78bfa1d56bf2551b98107437b690481 100755 (executable)
--- a/makefile
+++ b/makefile
@@ -95,8 +95,8 @@ all: $(EXEC)  joytest.exe
 16.exe: 16.$(OBJ) mapread.$(OBJ) jsmn.$(OBJ) $(16LIBOBJS) gfx.lib
        wcl $(FLAGS) $(16FLAGS) 16.$(OBJ) mapread.$(OBJ) jsmn.$(OBJ) $(16LIBOBJS) gfx.lib -fm=16.map
 
-bakapi.exe: bakapi.$(OBJ) gfx.lib# modex.lib
-       wcl $(FLAGS) $(BAKAPIFLAGS) bakapi.$(OBJ) gfx.lib -fm=bakapi.map
+bakapi.exe: bakapi.$(OBJ) gfx.lib $(DOSLIBLIBS)
+       wcl $(FLAGS) $(BAKAPIFLAGS) bakapi.$(OBJ) gfx.lib $(DOSLIBLIBS) -fm=bakapi.map
 #modex.lib
 #
 #Test Executables!
index eccaa3550e504272bceff3ed9a11b4647e2f0ec5..28faa99d7c53c9663811565cf58873b06fd7e277 100755 (executable)
@@ -44,7 +44,35 @@ main(int argc, char *argvar[])
 #ifdef MXLIB
        VGAmodeX(1, &gvar);
 #else
-       mxSetMode(3);
+               probe_dos();
+       if (!probe_vga()) {
+               printf("VGA probe failed\n");
+               return 1;
+       }
+       int10_setmode(19);
+       update_state_from_vga();
+       vga_enable_256color_modex(); // VGA mode X
+       vga_state.vga_width = 320; // VGA lib currently does not update this
+       vga_state.vga_height = 240; // VGA lib currently does not update this
+
+//#if 1 // 320x240 test mode: this is how Project 16 is using our code, enable for test case
+       {
+               struct vga_mode_params cm;
+
+               vga_read_crtc_mode(&cm);
+
+               // 320x240 mode 60Hz
+               cm.vertical_total = 525;
+               cm.vertical_start_retrace = 0x1EA;
+               cm.vertical_end_retrace = 0x1EC;
+               cm.vertical_display_end = 480;
+               cm.vertical_blank_start = 489;
+               cm.vertical_blank_end = 517;
+
+               vga_write_crtc_mode(&cm,0);
+       }
+       vga_state.vga_height = 240; // VGA lib currently does not update this
+//#endif
 #endif
        bakapee.xx = rand()&0%gvar.video.page[0].width;
        bakapee.yy = rand()&0%gvar.video.page[0].height;
@@ -78,13 +106,13 @@ main(int argc, char *argvar[])
                }
                else
                {
-                       #ifndef MXLIB
-                       mxChangeMode(0);
+#ifndef MXLIB
+                       int10_setmode(3);
 #else
                        VGAmodeX(0, &gvar);
 #endif
                        // user imput switch
-                       fprintf(stderr, "xx=%d  yy=%d\n", bakapee.xx, bakapee.yy);
+                       fprintf(stderr, "xx=%d  yy=%d   tile=%d\n", bakapee.xx, bakapee.yy, bakapee.tile);
                        printf("Enter 1, 2, 3, 4, or 6 to run a screensaver, or enter 0 to quit.\n", getch());  // prompt the user
                        //scanf("%d", &key);
                        if(scanf("%d", &key) != 1)
@@ -93,16 +121,61 @@ main(int argc, char *argvar[])
                        }
                        getch();
                        //if(key==3){xx=yy=0;} // crazy screen saver wwww
-                       if(key==0){ d=0; }else{
-                               gvar.video.page[0] = modexDefaultPage(&gvar.video.page[0]);
-                               gvar.video.page[0].width += (TILEWH*2);
-                               gvar.video.page[0].height += (TILEWH*2);
+                       switch (key)
+                       {
+                               case 0:
+                                       d=0;
+                               break;
+                               case 65536:
+                                       switch (bakapee.tile)
+                                       {
+                                               case 0:
+                                                       bakapee.tile=1;
+                                               break;
+                                               case 1:
+                                                       bakapee.tile=0;
+                                               break;
+                                       }
+                                       d=2;
+                               default:
 #ifdef MXLIB
-                               VGAmodeX(1, &gvar);
+                                       gvar.video.page[0] = modexDefaultPage(&gvar.video.page[0]);
+                                       gvar.video.page[0].width += (TILEWH*2);
+                                       gvar.video.page[0].height += (TILEWH*2);
+                                       VGAmodeX(1, &gvar);
 #else
-                               mxChangeMode(3);
+                                               probe_dos();
+       if (!probe_vga()) {
+               printf("VGA probe failed\n");
+               return 1;
+       }
+       int10_setmode(19);
+       update_state_from_vga();
+       vga_enable_256color_modex(); // VGA mode X
+       vga_state.vga_width = 320; // VGA lib currently does not update this
+       vga_state.vga_height = 240; // VGA lib currently does not update this
+
+//#if 1 // 320x240 test mode: this is how Project 16 is using our code, enable for test case
+       {
+               struct vga_mode_params cm;
+
+               vga_read_crtc_mode(&cm);
+
+               // 320x240 mode 60Hz
+               cm.vertical_total = 525;
+               cm.vertical_start_retrace = 0x1EA;
+               cm.vertical_end_retrace = 0x1EC;
+               cm.vertical_display_end = 480;
+               cm.vertical_blank_start = 489;
+               cm.vertical_blank_end = 517;
+
+               vga_write_crtc_mode(&cm,0);
+       }
+       vga_state.vga_height = 240; // VGA lib currently does not update this
+//#endif
 #endif
-                               modexShowPage(&gvar.video.page[0]);
+                                       modexShowPage(&gvar.video.page[0]);
+                               break;
                        }
                }
        }
index 1863e2ad2c98636f5a59957933637aeb529fe4b8..66c98dd6936b55fa262243f7951c830bf3b5db67 100755 (executable)
@@ -38,7 +38,7 @@
 \r
 #include "src/lib/16_in.h"\r
 \r
-byte testkeyin=0,testcontrolnoisy=0,testctrltype=0;\r
+boolean testkeyin=0,testcontrolnoisy=0,testctrltype=0;\r
 \r
 /*\r
 =============================================================================\r
index ec9b56a2f424b25454f12fed1e8c3e5f77720d25..0990a55089d68ccdcf3b3cd786c7d0ab991e324c 100755 (executable)
@@ -42,7 +42,7 @@
 //#define TESTCONTROLNOISY\r
 #endif\r
 \r
-extern byte testkeyin,testcontrolnoisy,testctrltype;\r
+extern boolean testkeyin,testcontrolnoisy,testctrltype;\r
 \r
 //if else for gfxtesting and direction\r
 //player[pn].d == 2 ||\r
index c7f352661e9c06a7ddc72b0c40e4ea3b178c13ac..e06c0b8f51378b9b33dcf2a16dfc0ece7fa66bfa 100755 (executable)
 \r
 #include "src/lib/16_head.h"\r
 #include "src/lib/modex16.h"\r
+#include <hw/cpu/cpu.h>\r
+#include <hw/dos/dos.h>\r
+#include <hw/vga/vga.h>\r
 //#include "src/lib/modex/modex.h"\r
-#include "16/x/modex.h"\r
+//#include "16/x/modex.h"\r
 \r
 #define TILEWH 16\r
 #define QUADWH                 TILEWH/2\r