]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/16_vl.c
__seguse.txt added to show _seg usage also OpenVGMFile needs to be ported to 16_snd...
[16.git] / src / lib / 16_vl.c
index 9cada1518efc164b7cd2952c1daf65163aecfdcb..2e5fa42e184eb9d6ed18da64adc0fc4a1abe8503 100755 (executable)
@@ -644,41 +644,39 @@ modexPalSave(byte *palette) {
 }\r
 \r
 \r
-byte *\r
+/*byte *\r
 modexNewPal() {\r
        byte *ptr;\r
-       ptr = malloc(PAL_SIZE);\r
+       ptr = m a l l o c(PAL_SIZE);\r
 \r
-       /* handle errors */\r
+       // handle errors\r
        if(!ptr) {\r
                printf("Could not allocate palette.\n");\r
        }\r
 \r
        return ptr;\r
-}\r
+}*/\r
 \r
 \r
 void\r
-modexLoadPalFile(byte *filename, byte **palette) {\r
+modexLoadPalFile(byte *filename, byte *palette) {\r
        FILE *file;\r
        byte *ptr;\r
 \r
-       /* free the palette if it exists */\r
-       if(*palette) {\r
-       free(*palette);\r
-       }\r
+       // free the palette if it exists\r
+       //if(*palette) { free(*palette); }\r
 \r
-       /* allocate the new palette */\r
-       *palette = modexNewPal();\r
+       // allocate the new palette\r
+       //*palette = modexNewPal();\r
 \r
-       /* open the file */\r
+       // open the file\r
        file = fopen(filename, "rb");\r
        if(!file) {\r
-       printf("Could not open palette file: %s\n", filename);\r
+               printf("Could not open palette file: %s\n", filename);\r
        }\r
 \r
        /* read the file */\r
-       ptr = *palette;\r
+       ptr = palette;\r
        while(!feof(file)) {\r
        *ptr++ = fgetc(file);\r
        }\r
@@ -859,18 +857,18 @@ void modexDrawChar(page_t *page, int x/*for planar selection only*/, word t, wor
        }\r
 }\r
 \r
-void modexprint(page_t *page, sword x, sword y, word t, word col, word bgcol, const byte *str)\r
+void modexprint(page_t *page, sword x, sword y, word t, boolean tlsw, word col, word bgcol, const byte *str)\r
 {\r
        word s, o, w;\r
-       sword x_draw;\r
+       word x_draw;\r
        //word addr = (word) romFontsData.l;\r
        word addrq;\r
        word addrr;\r
        byte c;\r
 \r
-       x-=page->tlx; y-=page->tly;\r
+       if(tlsw){ x-=page->tlx; y-=page->tly; }\r
        x_draw = x/4;\r
-       addrq = (page->stridew) * y + (x_draw) +\r
+       addrq = (page->stridew) * y + (word)(x_draw) +\r
                ((word)page->data);\r
        addrr = addrq;\r
        s=romFonts[t].seg;\r
@@ -1002,7 +1000,7 @@ void modexpdump(page_t *pee)
        int palq=(mult)*TILEWH;\r
        int palcol=0;\r
        int palx, paly;\r
-       for(paly=0; paly<palq; paly+=mult){\r
+       for(paly=TILEWH*8; paly<palq+TILEWH*8; paly+=mult){\r
                for(palx=TILEWH*12; palx<palq+TILEWH*12; palx+=mult){\r
                                modexClearRegion(pee, palx+TILEWH, paly+TILEWH, mult, mult, palcol);\r
                        palcol++;\r