X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tools%2Fmkt1.c;h=70d4a5c8ef97fcd8fbfdcb359b36ace274551f9e;hb=40d22a8e7610b2fdde5cfe6178605262ef0d61d7;hp=b19584bba1febc1332d4ac725d92473ed9f22ce3;hpb=c5b61ac25d64d5fb1e8d825e6b44c6c50b05ab34;p=picodrive.git diff --git a/tools/mkt1.c b/tools/mkt1.c index b19584b..70d4a5c 100644 --- a/tools/mkt1.c +++ b/tools/mkt1.c @@ -20,7 +20,7 @@ static void out(int r, int is_last) unsigned char pattern_db[0x100]; -static int check(unsigned char i) +static int check_label(unsigned char i) { if (!pattern_db[i]) { fprintf(fo, "tile%i%i%i%i%i%i%i%i:\n", (i&0x80)?1:0, (i&0x40)?1:0, (i&0x20)?1:0, (i&0x10)?1:0, @@ -44,22 +44,22 @@ int main() for (i = 0xff; i > 0; i--) { - if (check(i)) continue; + if (check_label(i)) continue; - if (i & 0x01) out(0, 0); - check(i&0xfe); - if (i & 0x02) out(1, 0); - check(i&0xfc); - if (i & 0x04) out(2, 0); - check(i&0xf8); - if (i & 0x08) out(3, 0); - check(i&0xf0); - if (i & 0x10) out(4, 0); - check(i&0xe0); - if (i & 0x20) out(5, 0); - check(i&0xc0); - if (i & 0x40) out(6, 0); - check(i&0x80); + if (i & 0x01) out(0, !(i&0xfe)); + check_label(i&0xfe); + if (i & 0x02) out(1, !(i&0xfc)); + check_label(i&0xfc); + if (i & 0x04) out(2, !(i&0xf8)); + check_label(i&0xf8); + if (i & 0x08) out(3, !(i&0xf0)); + check_label(i&0xf0); + if (i & 0x10) out(4, !(i&0xe0)); + check_label(i&0xe0); + if (i & 0x20) out(5, !(i&0xc0)); + check_label(i&0xc0); + if (i & 0x40) out(6, !(i&0x80)); + check_label(i&0x80); if (i & 0x80) out(7, 1); }