X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fmodex16.c;h=70e8e871b063aff8f5bc568cc0f49d6f8e00e941;hb=6d7a981e6e607a373d9418d064ab6dc881d10282;hp=6a4fbe1c5f819bfa01246b98a5d9438435143ad3;hpb=9f7214fd9c7455cdde58349d0be24c4bd0343ab5;p=16.git diff --git a/src/lib/modex16.c b/src/lib/modex16.c index 6a4fbe1c..70e8e871 100755 --- a/src/lib/modex16.c +++ b/src/lib/modex16.c @@ -94,9 +94,12 @@ void modexEnter(sword vq, boolean cmem, global_game_variables_t *gv) case 1: //CRTParmCount = sizeof(ModeX_320x240regs) / sizeof(ModeX_320x240regs[0]); /* width and height */ - gv->video.page[0].sw=vga_state.vga_width = 320; // VGA lib currently does not update this - gv->video.page[0].sh=vga_state.vga_height = 240; // VGA lib currently does not update this + gv->video.page[0].sw = vga_state.vga_width = 320; // VGA lib currently does not update this + gv->video.page[0].sh = vga_state.vga_height = 240; // VGA lib currently does not update this + // mode X BYTE mode + cm.word_mode = 0; + cm.dword_mode = 0; // 320x240 mode 60Hz cm.horizontal_total=0x5f + 5; /* CRTC[0] -5 */ cm.horizontal_display_end=0x4f + 1; /* CRTC[1] -1 */ @@ -115,10 +118,7 @@ void modexEnter(sword vq, boolean cmem, global_game_variables_t *gv) cm.clock_select = 0; /* misc register = 0xE3 25MHz */ cm.vsync_neg = 1; cm.hsync_neg = 1; - - cm.scanline_div2=1; /* CRTC[0x17] bit 2 */ - cm.scan_double=0; /* CRTC[0x09] bit 7 */ - cm.max_scanline=4; /* CRTC[0x09] bit 4-0 */ + cm.offset = (vga_state.vga_width / (4 * 2)); // 320 wide (40 x 4 pixel groups x 2) break; case 2: // TODO: 160x120 according to ModeX_160x120regs return; @@ -132,6 +132,7 @@ void modexEnter(sword vq, boolean cmem, global_game_variables_t *gv) return; } + vga_state.vga_stride = cm.offset * 2; vga_write_crtc_mode(&cm,0); /* clear video memory */ @@ -875,23 +876,11 @@ byte modexgetPixel(page_t *page, int x, int y) } -void modexhlin(page_t *page, word xl, word xh, word y, word color) -{ - word x; - word yy=0; - - for(x=0;x=page[0].sw-1){ x=0; yy+=4; } - modexClearRegion(page, x+xl, y+yy, 4, 4, color); - } - //modexputPixel(page, x+xl, y, color); -} - -void modexprint(page_t *page, word x, word y, word t, word col, word bgcol, const byte *str, boolean q) +void modexprint(page_t *page, word x, word y, word t, word col, word bgcol, const byte *str) { word s, o, w; word addr = (word) romFontsData.l; + word addrq = (page->width/4) * y + (x / 4) + ((word)page->data); byte c; s=romFonts[t].seg; @@ -928,7 +917,8 @@ void modexprint(page_t *page, word x, word y, word t, word col, word bgcol, cons JNZ L1 } //TODO: OPTIMIZE THIS!!!! - modexDrawCharPBuf(page, x, y, t, col, bgcol, q); + modexDrawCharPBuf(page, x/*for mode X planar use*/, y/*redunant, remove*/, t, col, bgcol, addrq); + addrq += 2; /* move 8 pixels over (2 x 4 planar pixels per byte) */ //if(!q) getch(); }