Changeset 9fb0db9 in thomson


Ignore:
Timestamp:
Mar 7, 2013, 10:29:47 PM (11 years ago)
Author:
Adrien Destugues <pulkomandy@…>
Branches:
main
Children:
6b23e9a
Parents:
62e3665
Message:

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

git-svn-id: svn://localhost/thomson@41 85ae3b6b-dc8f-4344-a89d-598714f2e4e5

Location:
tools/gfx2mo5
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • tools/gfx2mo5/libraw2mo5.c

    r62e3665 r9fb0db9  
    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);
  • tools/gfx2mo5/libraw2mo5.h

    r62e3665 r9fb0db9  
    1010#define LIBRAW2mo5_H 1
    1111
    12 unsigned char * raw2mo5(unsigned char *input, bool fixup);
     12unsigned char * raw2mo5(unsigned char *input, int height, int fixup);
    1313
    1414#endif
  • tools/gfx2mo5/png2mo5.c

    r62e3665 r9fb0db9  
    127127  png_read_image(png_ptr, ptrRow);
    128128
    129   outBuffer = raw2mo5(inBuffer, argc > 3);
     129  outBuffer = raw2mo5(inBuffer, height, argc > 3 ? atoi(argv[3]):-1);
    130130
    131131  int pxsize = width * height / 8;
Note: See TracChangeset for help on using the changeset viewer.