]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/modex16.c
====i made a quick and dirty fix to the video issue wwww====
[16.git] / src / lib / modex16.c
index 38db05d8c2f12bbd57b57a6887765d2f0001c26d..e3e557bf7f4ee949c3cd433df5766eb8e33f7ddf 100755 (executable)
@@ -342,6 +342,8 @@ modexClearRegion(page_t *page, int x, int y, int w, int h, byte  color) {
       right=0x0f;\r
     }\r
 \r
+       //printf("modexClearRegion(x=%u, y=%u, w=%u, h=%u, left=%u, right=%u)\n", x, y, w, h, left, right);\r
+\r
     __asm {\r
            PUSHF\r
            PUSH ES\r
@@ -409,14 +411,21 @@ 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;\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 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
-    byte rclip[] = {0x0f, 0x01, 0x03, 0x07};\r
+    byte rclip[] = {0x00, 0x01, 0x03, 0x07};\r
     byte left = lclip[sx&0x03];\r
     byte right = rclip[(sx+width)&0x03];\r
 \r
+       /* handle the case which requires an extra group */\r
+       if((sx & 0x03) && !((sx+width) & 0x03)) {\r
+               right=0x0f;\r
+       }\r
+\r
+//     printf("modexCopyPageRegion(src->stridew=%u, dest->stridew=%u, sx=%u, sy=%u, dx=%u, dy=%u, width=%u, height=%u, left=%u, right=%u)\n", src->stridew, dest->stridew, sx, sy, dx, dy, width, height, left, right);\r
+\r
     __asm {\r
            PUSHF\r
            PUSH ES\r
@@ -1172,8 +1181,8 @@ void modexprintmeminfo(video_t *v)
        {\r
                printf("        [%u]=", i);\r
                printf("(%Fp)", (v->page[i].data));\r
-               printf(" size=%u", v->page[i].pagesize);\r
-               printf(" sw=%lu  sh=%lu ", (unsigned long)v->page[i].sw, (unsigned long)v->page[i].sh);\r
+               printf(" size=%u        ", v->page[i].pagesize);\r
+               printf("sw=%lu  sh=%lu ", (unsigned long)v->page[i].sw, (unsigned long)v->page[i].sh);\r
                printf(" width=%lu  height=%lu", (unsigned long)v->page[i].width, (unsigned long)v->page[i].height);\r
                printf("\n");\r
        }\r