X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fmodex16.c;h=5db7bf481849910a90551b4725f801c7600daa38;hb=d31b48962de4f4384cca54f92db59ccc0bb06fbc;hp=2d018dc12f190f5abff840fd1cb0e020ac850e2f;hpb=8239a15b6eaad9b098720623339f168a54f51ca5;p=16.git diff --git a/src/lib/modex16.c b/src/lib/modex16.c index 2d018dc1..5db7bf48 100755 --- a/src/lib/modex16.c +++ b/src/lib/modex16.c @@ -95,6 +95,9 @@ void modexEnter(sword vq, boolean cmem, global_game_variables_t *gv) /* 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 + /* virtual width and height. match screen, at first */ + gv->video.page[0].height = gv->video.page[0].sh; + gv->video.page[0].width = gv->video.page[0].sw; // mode X BYTE mode cm.word_mode = 0; @@ -903,24 +906,11 @@ void modexprint(page_t *page, word x, word y, word t, word col, word bgcol, cons y += 8; continue; } - //load the letter 'A' - __asm { - MOV DI, addr - MOV SI, o - MOV ES, s - SUB AH, AH - MOV AL, c ; the letter - MOV CX, w - MUL CX - ADD SI, AX ;the address of charcter - L1: MOV AX, ES:SI - MOV DS:DI, AX - INC SI - INC DI - DEC CX - JNZ L1 - } -//TODO: OPTIMIZE THIS!!!! + + // load the character into romFontsData.l + // no need for inline assembly! + // NTS: It might even be faster to just let the modexDrawChar point directly at ROM font than to copy per char! --J.C. + _fmemcpy(romFontsData.l,MK_FP(s,o+(w*c))/*ROM font location*/,w/*char size*/); modexDrawChar(page, x_draw/*for mode X planar use*/, t, col, bgcol, addrr); x_draw += 8; /* track X for edge of screen */ addrr += 2; /* move 8 pixels over (2 x 4 planar pixels per byte) */ @@ -1032,7 +1022,7 @@ void modexcls(page_t *page, byte color, byte *Where) _fmemset(Where, color, page->width*(page->height)/4); } -/*void +void modexWaitBorder() { while(inp(INPUT_STATUS_1) & 8) { // spin @@ -1041,7 +1031,7 @@ modexWaitBorder() { while(!(inp(INPUT_STATUS_1) & 8)) { // spin } -}*/ +} void bios_cls() { VGA_ALPHA_PTR ap;