]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/modex16.c
VRSTEST.EXE NOW USES PAGE MANAGER! wwww
[16.git] / src / lib / modex16.c
index 5a33b0f97bc10520d6e66f5e1be7edccc27190cc..b8f733be22b581f1748cffffa04e1f60e988b3be 100755 (executable)
@@ -1,11 +1,11 @@
 /* Project 16 Source Code~\r
- * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\r
  *\r
  * This file is part of Project 16.\r
  *\r
  * Project 16 is free software; you can redistribute it and/or modify\r
  * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation; either verson 3 of the License, or\r
+ * the Free Software Foundation; either version 3 of the License, or\r
  * (at your option) any later version.\r
  *\r
  * Project 16 is distributed in the hope that it will be useful,\r
@@ -198,8 +198,8 @@ modexDefaultPage(page_t *p)
        page.tilemidposscreenx = page.tw/2;\r
        page.tilemidposscreeny = (page.th/2)+1;\r
        page.stridew=page.width/4;\r
-       page.pagesize = (word)(page.width/4)*page.height;\r
-       page.pi=4;\r
+       page.pagesize = (word)(page.stridew)*page.height;\r
+       page.pi=page.width*4;\r
        page.id = 0;\r
 \r
     return page;\r
@@ -225,7 +225,7 @@ modexNextPage(page_t *p) {
        result.tilesh = p->tilesh;\r
        result.stridew=p->stridew;\r
        result.pagesize = p->pagesize;\r
-       result.pi=4;\r
+       result.pi=result.width*4;\r
        result.id = p->id+1;\r
 \r
        return result;\r
@@ -249,10 +249,17 @@ modexNextPageFlexibleSize(page_t *p, word x, word y)
        result.tilesw=result.width/TILEWH;\r
        result.tilesh=result.height/TILEWH;\r
        result.id = p->id+1;\r
-       result.stridew=result.width/4;\r
-       result.pagesize = (word)(result.width/4)*result.height;\r
-       if(result.id==2)                result.pi=p->width*p->pi;\r
-       else if(result.id==3)   result.pi=p->pi;\r
+       result.stridew=p->sw/4;//result.width/4;\r
+       result.pagesize = (word)(result.stridew)*result.height;\r
+       switch(result.id)\r
+       {\r
+               case 2:\r
+                       result.pi=p->width*4;\r
+               break;\r
+               case 3:\r
+                       result.pi=p->pi;\r
+               break;\r
+       }\r
 \r
        return result;\r
 }\r
@@ -306,14 +313,14 @@ modexShowPage(page_t *page) {
     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
+    //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
+    //while (!(inp(INPUT_STATUS_1) & VRETRACE));\r
 \r
     /* do PEL panning here */\r
     outp(AC_INDEX, 0x33);\r
@@ -418,7 +425,7 @@ modexCopyPageRegion(page_t *dest, page_t *src,
 {\r
     word doffset = (word)dest->data + dy*(dest->stridew) + dx/4;\r
     word soffset = (word)src->data + sy*(src->stridew) + sx/4;\r
-    word scans   = vga_state.vga_stride+8;                             //++++0000 the quick and dirty fix of the major issue with p16 video display wwww\r
+    word scans   = vga_state.vga_stride;                               //++++0000 the quick and dirty fix of the major issue with p16 video display wwww\r
     word nextSrcRow = src->stridew - scans - 1;\r
     word nextDestRow = dest->stridew - scans - 1;\r
     byte lclip[] = {0x0f, 0x0e, 0x0c, 0x08};  /* clips for rectangles not on 4s */\r
@@ -1147,9 +1154,9 @@ modexWaitBorder() {
        // spin\r
        }\r
 \r
-//     while(!(inp(INPUT_STATUS_1)  & 8))  {\r
-//     //spin\r
-//     }\r
+       while(!(inp(INPUT_STATUS_1)  & 8))  {\r
+       //spin\r
+       }\r
 }\r
 \r
 void modexprintmeminfo(video_t *v)\r