]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/modex16.c
gvar.video.page[1].pattern_ofs added wwwwwwwww
[16.git] / src / lib / modex16.c
index 5a33b0f97bc10520d6e66f5e1be7edccc27190cc..9ae5246edcbe5f1fa893839da9e40071e1f5e9cb 100755 (executable)
@@ -197,9 +197,10 @@ modexDefaultPage(page_t *p)
        page.tilesh=page.height/TILEWH;\r
        page.tilemidposscreenx = page.tw/2;\r
        page.tilemidposscreeny = (page.th/2)+1;\r
+       page.pattern_ofs=0;\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
@@ -224,8 +225,9 @@ modexNextPage(page_t *p) {
        result.tilesw = p->tilesw;\r
        result.tilesh = p->tilesh;\r
        result.stridew=p->stridew;\r
+       result.pattern_ofs = 0x10000UL - p->pagesize;\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
@@ -248,11 +250,19 @@ modexNextPageFlexibleSize(page_t *p, word x, word y)
        result.th = result.sh/TILEWH;\r
        result.tilesw=result.width/TILEWH;\r
        result.tilesh=result.height/TILEWH;\r
+       result.pattern_ofs=0x10000UL - (p->pattern_ofs+p->pagesize);\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 +316,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 +428,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 +1157,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