]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/modex16.c
about todo shiftjis support!
[16.git] / src / lib / modex16.c
index 4c127c735f455206480848f153b27ea1e88ce1a2..acc0058b7950f7f23c96b1a77f17b593cd8e0e62 100644 (file)
@@ -969,14 +969,40 @@ byte modexgetPixel(int x, int y)
 \r
 }\r
 \r
-void bputs(word x, unsigned y, , const char *s)\r
+void modexprint(word x, word y, word t, word col, const byte *str)\r
 {
-       int j;
-       word s, o, t, w;\r
-       word addr = (word) l;\r
+       word i, s, o, w, j, xp;
+       byte l[16];\r
+       word addr = (word) l;
+       word chw=0;
+       byte c;
+
+       switch(t)\r
+       {\r
+               case 0:
+                       w=14;\r
+               break;\r
+               case 1:
+                       w=8;\r
+               break;\r
+               case 2:
+                       w=8;\r
+               break;\r
+               case 3:
+                       w=16;\r
+               break;\r
+               default:
+                       t=3;\r
+                       w=16;\r
+               break;\r
+       }
+\r
        s=romFonts[t].seg;\r
-       o=romFonts[t].off;\r
+       o=romFonts[t].off;
 \r
+       for(; *str != '\0'; str++)\r
+       {
+       c = *(str);
        //load the letter 'A'\r
        __asm {\r
                MOV DI, addr\r
@@ -995,15 +1021,13 @@ void bputs(word x, unsigned y, , const char *s)
                JNZ L1\r
        }
 \r
-       for(; *s != '\0'; s++)\r
-       {\r
                for(i=0; i<w; i++)
                {\r
                        j=1<<8;
-                       x=0;\r
+                       xp=0;\r
                        while(j)
                        {
-                               modexputPixel(x, i, l[i] & j ? 15:0);
+                               modexputPixel(x+xp+chw, y+i, l[i] & j ? col:0);
                                xp++;
                                j>>=1;
                        }