]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/modex16.c
0.c is under study wwww
[16.git] / src / lib / modex16.c
index 6ffd01dc0a2e9bcd051a89a65a10e7fe91815ae8..94386cad2b154d27d6a0e60faa0ce27bfed23704 100755 (executable)
@@ -199,7 +199,7 @@ modexDefaultPage(page_t *p)
        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.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.stridew=p->sw/4;//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
+       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
@@ -1162,9 +1169,9 @@ void modexprintmeminfo(video_t *v)
                printf("        [%u]=", i);\r
                printf("(%Fp)", (v->page[i].data));\r
                printf(" size=%u        ", v->page[i].pagesize);\r
+               printf("w=%lu  h=%lu ", (unsigned long)v->page[i].width, (unsigned long)v->page[i].height);\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(" pi=%u", v->page[i].pi);\r
+               printf("pi=%u", v->page[i].pi);\r
                printf("\n");\r
        }\r
 }\r