]> 4ch.mooo.com Git - 16.git/commitdiff
made g4et old video mode a function~
authorsparky4 <sparky4@cock.li>
Wed, 14 Oct 2015 22:11:07 +0000 (17:11 -0500)
committersparky4 <sparky4@cock.li>
Wed, 14 Oct 2015 22:11:07 +0000 (17:11 -0500)
src/lib/16_head.h
src/lib/modex16.c
src/lib/modex16.h

index b7f550de79787d3c9510a1e8d9d28b457826140f..b613dc127e5039944069e4fa309ab956d5e0d74a 100755 (executable)
@@ -190,7 +190,7 @@ typedef struct
 \r
 typedef struct\r
 {\r
-       int old_mode;   //old video mode before game!\r
+       long old_mode;  //old video mode before game!\r
        byte *pee;              // message for fps\r
        handle_t handle;        //handles for file logging\r
        kurokku_t kurokku;      //clock struct\r
index ba033c9df2187ff9a95d0215782842f4de85620f..c56a9ddcdb318c206c182fe1cb5a8cca520f56dd 100755 (executable)
@@ -51,9 +51,9 @@ void VGAmodeX(sword vq, global_game_variables_t *gv)
                break;\r
                case 1: // init the video\r
                        // get old video mode\r
-                       in.h.ah = 0xf;\r
-                       int86(0x10, &in, &out);\r
-                       gv->old_mode = out.h.al;\r
+                       //in.h.ah = 0xf;\r
+                       //int86(0x10, &in, &out);\r
+                       gv->old_mode = vgaGetMode();//out.h.al;\r
                        // enter mode\r
                        modex__320x240_256__Enter(gv);\r
                break;\r
@@ -78,6 +78,22 @@ vgaSetMode(byte mode)
   int86(VIDEO_INT, &regs, &regs);\r
 }\r
 \r
+//---------------------------------------------------\r
+//\r
+// Use the bios to get the current video mode\r
+//\r
+\r
+long\r
+vgaGetMode()\r
+{\r
+    union REGS rg;\r
+\r
+    rg.h.ah = 0x0f;\r
+    int86(VIDEO_INT, &rg, &rg);\r
+\r
+    return rg.h.al;\r
+}\r
+\r
 /* -========================= Entry  Points ==========================- */\r
 void\r
 modex__320x240_256__Enter(global_game_variables_t *gv)\r
index 4936de393c39122c9c2605fcb79e95cedbf92645..d7d8e193e342ae63d288ba3b50a74c91cc3bc6e3 100755 (executable)
@@ -69,6 +69,7 @@ typedef union
 void VGAmodeX(sword vq, global_game_variables_t *gv);
 void modex__320x240_256__Enter(global_game_variables_t *gv);
 void modex__192x144_256__Enter(global_game_variables_t *gv);
+long vgaGetMode();
 void modexLeave();
 void modexsetBaseXMode(void);
 page_t modexDefaultPage();