X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fmodex16.c;h=ee2f1a8608b459c89d5e7a329171debf5f27eb0b;hb=34abe02e0e49c2b73912babf54fc63b5cdc56284;hp=8637d7111e4636f4c39a290bff2bd6838eda7b27;hpb=b85e69ad19bcc1ef45494d60b2ffd47fc2eeb4a3;p=16.git diff --git a/src/lib/modex16.c b/src/lib/modex16.c index 8637d711..ee2f1a86 100755 --- a/src/lib/modex16.c +++ b/src/lib/modex16.c @@ -1,11 +1,11 @@ /* Project 16 Source Code~ - * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669 + * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 * * This file is part of Project 16. * * Project 16 is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or + * the Free Software Foundation; either verson 3 of the License, or * (at your option) any later version. * * Project 16 is distributed in the hope that it will be useful, @@ -954,46 +954,24 @@ void modexhlin(page_t *page, word xl, word xh, word y, word color) void modexprint(page_t *page, word x, word y, word t, word col, word bgcol, const byte *str, boolean q) { - word i, s, o, w, j, k, xp; - byte l[1024]; - word addr = (word) l; - word chw=0; + word s, o, w; + word addr = (word) romFontsData.l; byte c; - byte z[10]; - //byte near *bakapee; - - switch(t) - { - case 0: - w=14; - break; - case 1: - w=8; - break; - case 2: - w=8; - break; - case 3: - w=16; - break; - default: - t=3; - w=16; - break; - } s=romFonts[t].seg; o=romFonts[t].off; + w=romFonts[t].charSize; + romFontsData.chw=0; for(; *str != '\0'; str++) { c = (*str); if((c=='\n'/* || c=="\ -"*/) || chw +"*/) || romFontsData.chw >=page->width) { - chw=0; - y+=w; + romFontsData.chw=0; + y+=romFonts[t].charSize; continue; } //load the letter 'A' @@ -1013,44 +991,11 @@ void modexprint(page_t *page, word x, word y, word t, word col, word bgcol, cons DEC CX JNZ L1 } - //bakapee = _nmalloc(sizeof(byte)*8); //TODO: OPTIMIZE THIS!!!! - for(i=0; idata + (((page->width/4) * (y+page->dy+i)) + ((x+page->dx+chw) / 4)), bakapee, 8);*/ - j=1<<8; - k=0; - xp=0; - //every "pixel" row - while(j) - { - if(q) - //_fmemcpy(page->data + (((page->width/4) * (y)) + ((x) / 4)), l[i] & j ? col:bgcol, 8); - modexputPixel(page, x+xp+chw, y+i, l[i] & j ? col:bgcol); - else - //printf("l[i]=%c j=%02u l[i] & j=%02u %c\n", l[i] , j, l[i] & j, l[i] & j ? '*':' '); - //printf("%c", l[i] & j ? '*':' '); - z[k]=l[i] & j ? '*':' '; - xp++; - j>>=1; - k++; - } - if(!q) - { - for(k=0;k<10;k++) - { - printf("%c", z[k]); - } - printf("\n"); - } - } - if(!q) getch(); - chw += xp; + modexDrawCharPBuf(page, x, y, t, col, bgcol, q); + + //if(!q) getch(); } - //_nfree(bakapee); } void modexprintbig(page_t *page, word x, word y, word t, word col, word bgcol, const byte *str) @@ -1155,7 +1100,7 @@ void cls(page_t *page, byte color, byte *Where) /* set map mask to all 4 planes */ outpw(SC_INDEX, 0xff02); //_fmemset(VGA, color, 16000); - _fmemset(Where, color, page->width*(page->height)); + _fmemset(Where, color, page->width*(page->height)/4); } void