]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/16_vl.c
makefile polished!! it seems everything works reletively ok and i added f6 and f7...
[16.git] / src / lib / 16_vl.c
index 15f8931e3b017224def11378640bbab50026dfd8..9369ce49ab7b2c2e88c086962684dae117fd00c0 100755 (executable)
@@ -306,7 +306,7 @@ void modexHiganbanaPageSetup(video_t *video)
 void\r
 modexShowPage(page_t *page) {\r
        word high_address, low_address, offset;\r
-//     byte crtcOffset;\r
+       byte crtcOffset;\r
 \r
        /* calculate offset */\r
        offset = (word) page->data;\r
@@ -314,7 +314,7 @@ modexShowPage(page_t *page) {
        offset += page->dx >> 2;\r
 \r
        /* calculate crtcOffset according to virtual width */\r
-//     crtcOffset = page->width >> 3;\r
+       crtcOffset = page->width >> 3;\r
 \r
        high_address = HIGH_ADDRESS | (offset & 0xff00);\r
        low_address  = LOW_ADDRESS  | (offset << 8);\r
@@ -323,8 +323,43 @@ modexShowPage(page_t *page) {
 //+=+=                                                                         while ((inp(INPUT_STATUS_1) & DISPLAY_ENABLE));\r
        outpw(CRTC_INDEX, high_address);\r
        outpw(CRTC_INDEX, low_address);\r
-//     outp(CRTC_INDEX, 0x13);\r
-//     outp(CRTC_DATA, crtcOffset);\r
+       outp(CRTC_INDEX, 0x13);\r
+       outp(CRTC_DATA, crtcOffset);\r
+\r
+       /* wait for one retrace */\r
+//+=+=                                                                         while (!(inp(INPUT_STATUS_1) & VRETRACE));\r
+\r
+       /* do PEL panning here */\r
+       outp(AC_INDEX, 0x33);\r
+       outp(AC_INDEX, (page->dx & 0x03) << 1);\r
+}\r
+\r
+//\r
+// testing version of void modexShowPage()\r
+//\r
+void\r
+modexShowPage_(page_t *page)\r
+{\r
+       word high_address, low_address, offset;\r
+       byte crtcOffset;\r
+\r
+       /* calculate offset */\r
+       offset = (word) page->data;\r
+       offset += page->dy * (page->width >> 2 );\r
+       offset += page->dx >> 2;\r
+\r
+       /* calculate crtcOffset according to virtual width */\r
+       crtcOffset = page->sw >> 3;\r
+\r
+       high_address = HIGH_ADDRESS | (offset & 0xff00);\r
+       low_address  = LOW_ADDRESS  | (offset << 8);\r
+\r
+       /* wait for appropriate timing and then program CRTC */\r
+//+=+=                                                                         while ((inp(INPUT_STATUS_1) & DISPLAY_ENABLE));\r
+       outpw(CRTC_INDEX, high_address);\r
+       outpw(CRTC_INDEX, low_address);\r
+       outp(CRTC_INDEX, 0x13);\r
+       outp(CRTC_DATA, crtcOffset);\r
 \r
        /* wait for one retrace */\r
 //+=+=                                                                         while (!(inp(INPUT_STATUS_1) & VRETRACE));\r