home *** CD-ROM | disk | FTP | other *** search
/ ftp.whtech.com / ftp.whtech.com.7z / ftp.whtech.com / emulators / v9t9 / linux / sources / V9t9 / source / Generate / generatevdpdrawrow.c < prev    next >
Encoding:
C/C++ Source or Header  |  2006-10-19  |  656 b   |  33 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\tdrawrow%d(u8 *o,u8 f,u8 b)\n", i);
  14.         printf("{\n\t");
  15.         for (b = 0; b < 8; b++)
  16.             if (i & (0x80 >> b))
  17.                 printf("o[%d]=f;\t", b);
  18.             else
  19.                 printf("o[%d]=b;\t", b);
  20.         printf("\n}\n\n");
  21.  
  22.     }
  23.  
  24.     printf("void MODIFIER (*vdpdrawrow[])(u8 *,u8,u8)=\n{\n");
  25.     for (i = 0; i < 256; i++) {
  26.         printf("drawrow%d%s", i, i != 255 ? "," : "\n};");
  27.  
  28.         if ((i % 6) == 5)
  29.             printf("\n");
  30.     }
  31.     exit(0);
  32. }
  33.