X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Flib%2F16_vl.c;h=2e5fa42e184eb9d6ed18da64adc0fc4a1abe8503;hb=5c33a30248aff1745430cd0e926c343242e4c889;hp=9cada1518efc164b7cd2952c1daf65163aecfdcb;hpb=da91d7bf4f1cb7511a382d30023afdb8b8e620ab;p=16.git diff --git a/src/lib/16_vl.c b/src/lib/16_vl.c index 9cada151..2e5fa42e 100755 --- a/src/lib/16_vl.c +++ b/src/lib/16_vl.c @@ -644,41 +644,39 @@ modexPalSave(byte *palette) { } -byte * +/*byte * modexNewPal() { byte *ptr; - ptr = malloc(PAL_SIZE); + ptr = m a l l o c(PAL_SIZE); - /* handle errors */ + // handle errors if(!ptr) { printf("Could not allocate palette.\n"); } return ptr; -} +}*/ void -modexLoadPalFile(byte *filename, byte **palette) { +modexLoadPalFile(byte *filename, byte *palette) { FILE *file; byte *ptr; - /* free the palette if it exists */ - if(*palette) { - free(*palette); - } + // free the palette if it exists + //if(*palette) { free(*palette); } - /* allocate the new palette */ - *palette = modexNewPal(); + // allocate the new palette + //*palette = modexNewPal(); - /* open the file */ + // open the file file = fopen(filename, "rb"); if(!file) { - printf("Could not open palette file: %s\n", filename); + printf("Could not open palette file: %s\n", filename); } /* read the file */ - ptr = *palette; + ptr = palette; while(!feof(file)) { *ptr++ = fgetc(file); } @@ -859,18 +857,18 @@ void modexDrawChar(page_t *page, int x/*for planar selection only*/, word t, wor } } -void modexprint(page_t *page, sword x, sword y, word t, word col, word bgcol, const byte *str) +void modexprint(page_t *page, sword x, sword y, word t, boolean tlsw, word col, word bgcol, const byte *str) { word s, o, w; - sword x_draw; + word x_draw; //word addr = (word) romFontsData.l; word addrq; word addrr; byte c; - x-=page->tlx; y-=page->tly; + if(tlsw){ x-=page->tlx; y-=page->tly; } x_draw = x/4; - addrq = (page->stridew) * y + (x_draw) + + addrq = (page->stridew) * y + (word)(x_draw) + ((word)page->data); addrr = addrq; s=romFonts[t].seg; @@ -1002,7 +1000,7 @@ void modexpdump(page_t *pee) int palq=(mult)*TILEWH; int palcol=0; int palx, paly; - for(paly=0; paly