X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Flib%2F16_vl.c;h=652ef89c2491b898bd25908b6d63c70f5bee7504;hb=6cfcd9ddd5f8b515913ea6f0e0f84f8e4c0fb720;hp=9369ce49ab7b2c2e88c086962684dae117fd00c0;hpb=4ecf82fc48a4a19ff72cd89bce7d0bda18cf2f0c;p=16.git diff --git a/src/lib/16_vl.c b/src/lib/16_vl.c index 9369ce49..652ef89c 100755 --- a/src/lib/16_vl.c +++ b/src/lib/16_vl.c @@ -369,6 +369,37 @@ modexShowPage_(page_t *page) outp(AC_INDEX, (page->dx & 0x03) << 1); } +void +modexShowPageVsync(page_t *page) { + word high_address, low_address, offset; + byte crtcOffset; + + /* calculate offset */ + offset = (word) page->data; + offset += page->dy * (page->width >> 2 ); + offset += page->dx >> 2; + + /* calculate crtcOffset according to virtual width */ + crtcOffset = page->width >> 3; + + high_address = HIGH_ADDRESS | (offset & 0xff00); + low_address = LOW_ADDRESS | (offset << 8); + + /* wait for appropriate timing and then program CRTC */ + 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)); + + /* do PEL panning here */ + outp(AC_INDEX, 0x33); + outp(AC_INDEX, (page->dx & 0x03) << 1); +} + void modexPanPage(page_t *page, int dx, int dy) { page->dx = dx;