#include #include #include #include #include /* usage: # extract the 1K atari ROM font: dd if=atariosb.rom of=romfont bs=256 skip=8 count=4 # extract the Apple II Taipan font: dd if=taipan.dsk of=font bs=256 skip=54 count=3 # create the Atari 8-bit Taipan font: cat romfont font | ./convfont > taifont.raw # or, create the Atari 8-bit Taipan font as a binary load: cat romfont font | ./convfont -x > taifont.xex */ /* taipan font file order: 0-31: `a-z{|}" block 32-63: @A-Z[\]^_ 64-95: space !"#$%&'()*+,-./0-9:;>== 0); } void clear0bits(unsigned char *b, int lim) { do { *b++ &= 0xfe; } while(--lim > 0); } int main(int argc, char **argv) { int i, j; unsigned char font[1024], xex[6]; read(0, font, 1024); read(0, font + (96 * 8), 32 * 8); bitswap(font + (96 * 8), 32 * 8); read(0, font + (32 * 8), 32 * 8); bitswap(font + (32 * 8), 32 * 8); read(0, font + (0 * 8), 32 * 8); bitswap(font + (0 * 8), 32 * 8); /* this stuff is from visual inspection via bitmapdump.pl */ clear0bits(font + 0x1f8, 7); clear0bits(font + 0x301, 7); clear0bits(font + 0x308, 8); clear0bits(font + 0x330, 8); clear0bits(font + 0x3a0, 8); clear0bits(font + 0x3d8, 8); clear0bits(font + 0x3e8, 8); clear0bits(font + 0x040, 16); clear0bits(font + 0x1e8, 8); /* fix the vertical bar */ font[0x3e0] = font[0x3e1] = font[0x3e2] = font[0x3e3] = font[0x3e4] = font[0x3e5] = font[0x3e6] = font[0x3e7] = 0x18; /* stick ship data where it goes */ for(i=0; shipdata[i][0]; i++) { for(j=0; j<8; j++) { font[ shipdata[i][0] * 8 + j ] = shipdata[i][j+1]; } } if(argc > 1) { xex[0] = xex[1] = 0xff; xex[2] = FONT_ADDR % 256; xex[3] = FONT_ADDR / 256; /* load address $2000 */ xex[4] = 0xff; xex[5] = 0x23; /* end address $23ff */ write(1, xex, 6); } write(1, font, 1024); i = open("LORCHA.DAT", O_WRONLY | O_CREAT, 0666); write(i, shipshape, sizeof(shipshape)); close(i); i = open("DAMAGED.DAT", O_WRONLY | O_CREAT, 0666); write(i, damaged_shipshape, sizeof(damaged_shipshape)); close(i); return 0; }