home *** CD-ROM | disk | FTP | other *** search
/ ftp.whtech.com / ftp.whtech.com.7z / ftp.whtech.com / emulators / v9t9 / linux / sources / V9t9 / source / Generate / generatevdpdrawrowtext.c < prev    next >
Encoding:
C/C++ Source or Header  |  2006-10-19  |  654 b   |  34 lines

  1.  
  2. #include <stdio.h>
  3.  
  4. int
  5. main(void)
  6. {
  7.     unsigned int i, b;
  8.  
  9.     printf("#include \"16bit.h\"\n");
  10.     printf("#if __MWERKS__ && __INTEL__\n"
  11.            "#define MODIFIER\n" "#else\n" "#define MODIFIER\n" "#endif\n");
  12.     for (i = 0; i < 256; i++) {
  13.         printf("static MODIFIER void\tdrawrowtext%d(u8 *o)\n", i);
  14.         printf("{\n\t");
  15.         for (b = 0; b < 6; b++)
  16.             if (i & (0x80 >> b))
  17.                 printf("o[%d]=16;\t", b);
  18.             else
  19.                 printf("o[%d]=0;\t", b);
  20.         printf("\n}\n\n");
  21.  
  22.  
  23.     }
  24.  
  25.     printf("void MODIFIER (*vdpdrawrowtext[])(u8 *)=\n{\n");
  26.     for (i = 0; i < 256; i++) {
  27.         printf("drawrowtext%d%s", i, i != 255 ? "," : "\n};");
  28.  
  29.         if ((i % 6) == 5)
  30.             printf("\n");
  31.     }
  32.     exit(0);
  33. }
  34.