Changeset 41 in Thomson for tools/gfx2mo5/libraw2mo5.c


Ignore:
Timestamp:
07/03/2013 22:29:47 (7 years ago)
Author:
pulkomandy
Message:

Allow gfx with less than 200px height.
Allow to set the color for unused cells.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/gfx2mo5/libraw2mo5.c

    r37 r41  
    1111#include <string.h>
    1212
    13 unsigned char *raw2mo5(unsigned char *input, bool fixup)
     13unsigned char *raw2mo5(unsigned char *input, int height, int fixup)
    1414{
    1515  unsigned char *tmpBuffer;
     
    2626
    2727  bool lfo = false;
    28   for (y = 0; y < 200; y++)
     28  for (y = 0; y < height; y++)
    2929        for (x = 0; x < 320; x+=8) {
    3030                int fore = 255;
     
    5858                }
    5959
    60                 if (fore == 255) fore = 7;
     60                if (fore == 255) fore = fixup;
    6161                if (fore != 255) {
    6262                        previous &= 0xF;
     
    7171                // are both FORME or both FOND, else we get an ugly glitch on the
    7272                // EFGJ033 Gate Array MO5!
    73                 if(fixup && oldlfo == !(tmpBuffer[(y*320+x)/8] & 0x80))
     73                if(fixup > 0 && oldlfo == !(tmpBuffer[(y*320+x)/8] & 0x80))
    7474                {
    7575                        previous = (previous >> 4) | (previous << 4);
Note: See TracChangeset for help on using the changeset viewer.