X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fmodex16.c;h=9ae5246edcbe5f1fa893839da9e40071e1f5e9cb;hb=51b40bfb7f114e300c6739f98292bc7c5fe6c2d9;hp=5a33b0f97bc10520d6e66f5e1be7edccc27190cc;hpb=b7777dc50153818f0043b22f95d260416ceb0fcb;p=16.git diff --git a/src/lib/modex16.c b/src/lib/modex16.c index 5a33b0f9..9ae5246e 100755 --- a/src/lib/modex16.c +++ b/src/lib/modex16.c @@ -197,9 +197,10 @@ modexDefaultPage(page_t *p) page.tilesh=page.height/TILEWH; page.tilemidposscreenx = page.tw/2; page.tilemidposscreeny = (page.th/2)+1; + page.pattern_ofs=0; page.stridew=page.width/4; - page.pagesize = (word)(page.width/4)*page.height; - page.pi=4; + page.pagesize = (word)(page.stridew)*page.height; + page.pi=page.width*4; page.id = 0; return page; @@ -224,8 +225,9 @@ modexNextPage(page_t *p) { result.tilesw = p->tilesw; result.tilesh = p->tilesh; result.stridew=p->stridew; + result.pattern_ofs = 0x10000UL - p->pagesize; result.pagesize = p->pagesize; - result.pi=4; + result.pi=result.width*4; result.id = p->id+1; return result; @@ -248,11 +250,19 @@ modexNextPageFlexibleSize(page_t *p, word x, word y) result.th = result.sh/TILEWH; result.tilesw=result.width/TILEWH; result.tilesh=result.height/TILEWH; + result.pattern_ofs=0x10000UL - (p->pattern_ofs+p->pagesize); result.id = p->id+1; - result.stridew=result.width/4; - result.pagesize = (word)(result.width/4)*result.height; - if(result.id==2) result.pi=p->width*p->pi; - else if(result.id==3) result.pi=p->pi; + result.stridew=p->sw/4;//result.width/4; + result.pagesize = (word)(result.stridew)*result.height; + switch(result.id) + { + case 2: + result.pi=p->width*4; + break; + case 3: + result.pi=p->pi; + break; + } return result; } @@ -306,14 +316,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); @@ -418,7 +428,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 */ @@ -1147,9 +1157,9 @@ modexWaitBorder() { // spin } -// while(!(inp(INPUT_STATUS_1) & 8)) { -// //spin -// } + while(!(inp(INPUT_STATUS_1) & 8)) { + //spin + } } void modexprintmeminfo(video_t *v)