]> 4ch.mooo.com Git - 16.git/commitdiff
wwww initiation of conversion ww
authorsparky4 <sparky4@cock.li>
Mon, 4 Apr 2016 20:59:58 +0000 (15:59 -0500)
committersparky4 <sparky4@cock.li>
Mon, 4 Apr 2016 20:59:58 +0000 (15:59 -0500)
makefile
src/lib/modex16.c
src/lib/modex16.h

index 8818c9d451f58a66c97fbcddec9867eb6915da2f..df7edd64a3e54c557d3befc258f492af651d2e1d 100755 (executable)
--- a/makefile
+++ b/makefile
@@ -77,7 +77,7 @@ VGMSNDOBJ = vgmSnd.$(OBJ) 16_snd.$(OBJ)
 DOSLIBOBJ = adlib.$(OBJ) 8254.$(OBJ) 8259.$(OBJ) dos.$(OBJ) cpu.$(OBJ)
 16LIBOBJS = 16_in.$(OBJ) 16_mm.$(OBJ) wcpu.$(OBJ) 16_head.$(OBJ) 16_ca.$(OBJ) kitten.$(OBJ) 16_hc.$(OBJ) 16_timer.$(OBJ)
 
-GFXLIBOBJS = modex16.$(OBJ) bitmap.$(OBJ) planar.$(OBJ) 16text.$(OBJ) bakapee.$(OBJ) scroll16.$(OBJ) 16render.$(OBJ) 16planar.$(OBJ)
+GFXLIBOBJS = modex16.$(OBJ) bitmap.$(OBJ) planar.$(OBJ) 16text.$(OBJ) bakapee.$(OBJ) scroll16.$(OBJ) 16render.$(OBJ) 16planar.$(OBJ) $(DOSLIBLIBS)
 
 DOSLIBLIBS=$(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)cpu$(DIRSEP)dos86h$(DIRSEP)cpu.lib $(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)dos$(DIRSEP)dos86h$(DIRSEP)dos.lib $(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)vga$(DIRSEP)dos86h$(DIRSEP)vga.lib
 
index 85989b492b8ede1101a311b1a9d00213b75d3ac5..cb4c53123337f7fffa4e57b33c392c25571483d5 100755 (executable)
@@ -93,18 +93,34 @@ void modexEnter(sword vq, boolean cmem, global_game_variables_t *gv)
        int CRTParmCount;\r
        /* common mode X initiation stuff~ */\r
        modexsetBaseXMode(gv->video.page);\r
+       vga_enable_256color_modex(); // VGA mode X\r
+       update_state_from_vga();\r
 \r
        switch(vq)\r
        {\r
                case 1:\r
-                       CRTParmCount = sizeof(ModeX_320x240regs) / sizeof(ModeX_320x240regs[0]);\r
+                       //CRTParmCount = sizeof(ModeX_320x240regs) / sizeof(ModeX_320x240regs[0]);\r
                        /* width and height */\r
-                       gv->video.page[0].sw=320;\r
-                       gv->video.page[0].sh=240;\r
+                       gv->video.page[0].sw=vga_state.vga_width = 320; // VGA lib currently does not update this\r
+                       gv->video.page[0].sh=vga_state.vga_height = 240; // VGA lib currently does not update this\r
 \r
                        /* send the CRTParms */\r
-                       for(i=0; i<CRTParmCount; i++) {\r
+                       /*for(i=0; i<CRTParmCount; i++) {\r
                                outpw(CRTC_INDEX, ModeX_320x240regs[i]);\r
+                       }*/\r
+                       {\r
+                       struct vga_mode_params cm;\r
+                       vga_read_crtc_mode(&cm);\r
+\r
+                       // 320x240 mode 60Hz\r
+                       cm.vertical_total = 525;\r
+                       cm.vertical_start_retrace = 0x1EA;\r
+                       cm.vertical_end_retrace = 0x1EC;\r
+                       cm.vertical_display_end = 480;\r
+                       cm.vertical_blank_start = 489;\r
+                       cm.vertical_blank_end = 517;\r
+\r
+                       vga_write_crtc_mode(&cm,0);\r
                        }\r
                break;\r
                case 2:\r
index 463104c68e64e053cf801a9f3bbd6b7a2ad43f80..312912c697b1957c1e79f95d0156189aa390cdca 100755 (executable)
 #include "src/lib/modex16/192x144_.h"
 #include "src/lib/modex16/160x120.h"
 
+#include <hw/cpu/cpu.h>
+#include <hw/dos/dos.h>
+#include <hw/vga/vga.h>
+#include <hw/vga/vrl.h>
+
 //TODO dos lib vga implementation ^^
 //#define DOSLIBVGA