X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fmodex16.c;h=94386cad2b154d27d6a0e60faa0ce27bfed23704;hb=f316394371b48430c9e1b375640b87f1d6f267ab;hp=271a84efd3cfec5743eb49ec6d42022563b84403;hpb=0360ea4c073be93ef0fcd3dae271beaa0e5daca4;p=16.git diff --git a/src/lib/modex16.c b/src/lib/modex16.c index 271a84ef..94386cad 100755 --- a/src/lib/modex16.c +++ b/src/lib/modex16.c @@ -199,6 +199,7 @@ modexDefaultPage(page_t *p) page.tilemidposscreeny = (page.th/2)+1; page.stridew=page.width/4; page.pagesize = (word)(page.width/4)*page.height; + page.pi=page.width*4; page.id = 0; return page; @@ -222,9 +223,10 @@ modexNextPage(page_t *p) { result.th = p->th; result.tilesw = p->tilesw; result.tilesh = p->tilesh; - result.id = p->id+1; result.stridew=p->stridew; result.pagesize = p->pagesize; + result.pi=result.width*4; + result.id = p->id+1; return result; } @@ -247,8 +249,17 @@ modexNextPageFlexibleSize(page_t *p, word x, word y) result.tilesw=result.width/TILEWH; result.tilesh=result.height/TILEWH; result.id = p->id+1; - result.stridew=result.width/4; + result.stridew=p->sw/4;//result.width/4; result.pagesize = (word)(result.width/4)*result.height; + switch(result.id) + { + case 2: + result.pi=p->width*4; + break; + case 3: + result.pi=p->pi; + break; + } return result; } @@ -302,14 +313,14 @@ modexShowPage(page_t *page) { low_address = LOW_ADDRESS | (offset << 8); /* wait for appropriate timing and then program CRTC */ - while ((inp(INPUT_STATUS_1) & DISPLAY_ENABLE)); + //while ((inp(INPUT_STATUS_1) & DISPLAY_ENABLE)); outpw(CRTC_INDEX, high_address); outpw(CRTC_INDEX, low_address); outp(CRTC_INDEX, 0x13); outp(CRTC_DATA, crtcOffset); /* wait for one retrace */ - while (!(inp(INPUT_STATUS_1) & VRETRACE)); + //while (!(inp(INPUT_STATUS_1) & VRETRACE)); /* do PEL panning here */ outp(AC_INDEX, 0x33); @@ -414,7 +425,7 @@ modexCopyPageRegion(page_t *dest, page_t *src, { word doffset = (word)dest->data + dy*(dest->stridew) + dx/4; word soffset = (word)src->data + sy*(src->stridew) + sx/4; - word scans = vga_state.vga_stride+8; //++++0000 the quick and dirty fix of the major issue with p16 video display wwww + word scans = vga_state.vga_stride; //++++0000 the quick and dirty fix of the major issue with p16 video display wwww word nextSrcRow = src->stridew - scans - 1; word nextDestRow = dest->stridew - scans - 1; byte lclip[] = {0x0f, 0x0e, 0x0c, 0x08}; /* clips for rectangles not on 4s */ @@ -1143,9 +1154,9 @@ modexWaitBorder() { // spin } -// while(!(inp(INPUT_STATUS_1) & 8)) { -// //spin -// } + while(!(inp(INPUT_STATUS_1) & 8)) { + //spin + } } void modexprintmeminfo(video_t *v) @@ -1158,8 +1169,9 @@ void modexprintmeminfo(video_t *v) printf(" [%u]=", i); printf("(%Fp)", (v->page[i].data)); printf(" size=%u ", v->page[i].pagesize); + printf("w=%lu h=%lu ", (unsigned long)v->page[i].width, (unsigned long)v->page[i].height); printf("sw=%lu sh=%lu ", (unsigned long)v->page[i].sw, (unsigned long)v->page[i].sh); - printf(" width=%lu height=%lu", (unsigned long)v->page[i].width, (unsigned long)v->page[i].height); + printf("pi=%u", v->page[i].pi); printf("\n"); } }