diff --git a/roms/saa5050/genrom.c b/roms/saa5050/genrom.c new file mode 100644 index 0000000..9d93bb3 --- /dev/null +++ b/roms/saa5050/genrom.c @@ -0,0 +1,180 @@ +#include +#include +#include +#include + +// Characters on a 5x9 matrix. This is padded up to 16 rows when the +// ROM is generated +static uint8_t saa5050_charset[] = { + 0,0,0,0,0,0,0,0,0, + 4,4,4,4,4,0,4,0,0, + 10,10,10,0,0,0,0,0,0, + 6,9,8,28,8,8,31,0,0, + 14,21,20,14,5,21,14,0,0, + 24,25,2,4,8,19,3,0,0, + 8,20,20,8,21,18,13,0,0, + 4,4,4,0,0,0,0,0,0, + + 2,4,8,8,8,4,2,0,0, + 8,4,2,2,2,4,8,0,0, + 4,21,14,4,14,21,4,0,0, + 0,4,4,31,4,4,0,0,0, + 0,0,0,0,0,4,4,8,0, + 0,0,0,14,0,0,0,0,0, + 0,0,0,0,0,0,4,0,0, + 0,1,2,4,8,16,0,0,0, + + 4,10,17,17,17,10,4,0,0, + 4,12,4,4,4,4,14,0,0, + 14,17,1,6,8,16,31,0,0, + 31,1,2,6,1,17,14,0,0, + 2,6,10,18,31,2,2,0,0, + 31,16,30,1,1,17,14,0,0, + 6,8,16,30,17,17,14,0,0, + 31,1,2,4,8,8,8,0,0, + + 14,17,17,14,17,17,14,0,0, + 14,17,17,15,1,2,12,0,0, + 0,0,4,0,0,0,4,0,0, + 0,0,4,0,0,4,4,8,0, + 2,4,8,16,8,4,2,0,0, + 0,0,31,0,31,0,0,0,0, + 8,4,2,1,2,4,8,0,0, + 14,17,2,4,4,0,4,0,0, + + 14,17,23,21,23,16,14,0,0, + 4,10,17,17,31,17,17,0,0, + 30,17,17,30,17,17,30,0,0, + 14,17,16,16,16,17,14,0,0, + 30,17,17,17,17,17,30,0,0, + 31,16,16,30,16,16,31,0,0, + 31,16,16,30,16,16,16,0,0, + 14,17,16,16,19,17,15,0,0, + + 17,17,17,31,17,17,17,0,0, + 14,4,4,4,4,4,14,0,0, + 1,1,1,1,1,17,14,0,0, + 17,18,20,24,20,18,17,0,0, + 16,16,16,16,16,16,31,0,0, + 17,27,21,21,17,17,17,0,0, + 17,17,25,21,19,17,17,0,0, + 14,17,17,17,17,17,14,0,0, + + 30,17,17,30,16,16,16,0,0, + 14,17,17,17,21,18,13,0,0, + 30,17,17,30,20,18,17,0,0, + 14,17,16,14,1,17,14,0,0, + 31,4,4,4,4,4,4,0,0, + 17,17,17,17,17,17,14,0,0, + 17,17,17,10,10,4,4,0,0, + 17,17,17,21,21,21,10,0,0, + + 17,17,10,4,10,17,17,0,0, + 17,17,10,4,4,4,4,0,0, + 31,1,2,4,8,16,31,0,0, + 0,4,8,31,8,4,0,0,0, + 16,16,16,16,22,1,2,4,7, + 0,4,2,31,2,4,0,0,0, + 0,4,14,21,4,4,0,0,0, + 10,10,31,10,31,10,10,0,0, + + 0,0,0,31,0,0,0,0,0, + 0,0,14,1,15,17,15,0,0, + 16,16,30,17,17,17,30,0,0, + 0,0,15,16,16,16,15,0,0, + 1,1,15,17,17,17,15,0,0, + 0,0,14,17,31,16,14,0,0, + 2,4,4,14,4,4,4,0,0, + 0,0,15,17,17,17,15,1,14, + + 16,16,30,17,17,17,17,0,0, + 4,0,12,4,4,4,14,0,0, + 4,0,4,4,4,4,4,4,8, + 8,8,9,10,12,10,9,0,0, + 12,4,4,4,4,4,14,0,0, + 0,0,26,21,21,21,21,0,0, + 0,0,30,17,17,17,17,0,0, + 0,0,14,17,17,17,14,0,0, + + 0,0,30,17,17,17,30,16,16, + 0,0,15,17,17,17,15,1,1, + 0,0,11,12,8,8,8,0,0, + 0,0,15,16,14,1,30,0,0, + 4,4,14,4,4,4,2,0,0, + 0,0,17,17,17,17,15,0,0, + 0,0,17,17,10,10,4,0,0, + 0,0,17,17,21,21,10,0,0, + + 0,0,17,10,4,10,17,0,0, + 0,0,17,17,17,17,15,1,14, + 0,0,31,2,4,8,31,0,0, + 8,8,8,8,9,3,5,7,1, + 10,10,10,10,10,10,10,0,0, + 24,4,24,4,25,3,5,7,1, + 0,4,0,31,0,4,0,0,0, + 31,31,31,31,31,31,31,0,0, +}; + +/* Generates 6x10 teletext graphics symbol according to specified code */ +void gen_gfx(char code,char *base) +{ + char *c; + int r; + + for (r = 0, c = base; r < 10; r++, c++) { + /* Set unused bit 7 to 1 to flag these characters as graphics (the + * implementation uses this to determine whether hold and separated + * modes should be applied */ + *c = 128; + if (r < 3) { + // 1 2 + if (code & 1) *c += 56; + if (code & 2) *c += 7; + } else if (r < 7) { + // 4 8 + if (code & 4) *c += 56; + if (code & 8) *c += 7; + } else { + // 16 64 + if (code & 16) *c += 56; + if (code & 64) *c += 7; + } + } +} + +int main(void) { + char *outbuf; + int ch,row; + + outbuf = malloc(256 * 16); + if (outbuf == NULL) { + fprintf(stderr,"Out of memory\n"); + return 1; + } + + /* Unused locations are blank (all zero) */ + memset(outbuf,0,256 * 16); + + /* Copy character bitmaps to locations 32-127 and 160-255 */ + for (ch = 0; ch < 96; ch++) { + for (row = 0; row < 9; row++) { + outbuf[16 * (32 + ch) + row + 1] = saa5050_charset[9 * ch + row]; + outbuf[16 * (160 + ch) + row + 1] = saa5050_charset[9 * ch + row]; + } + } + + /* Generate graphics in locations 160-191 and 224-255 */ + for (ch = 160; ch < 192; ch++) { + gen_gfx(ch,&outbuf[16 * ch]); + } + for (ch = 224; ch < 256; ch++) { + gen_gfx(ch,&outbuf[16 * ch]); + } + + /* Write to stdout */ + fwrite(outbuf,256 * 16,1,stdout); + + free(outbuf); + return 0; +} + diff --git a/roms/saa5050/saa5050.hex b/roms/saa5050/saa5050.hex new file mode 100644 index 0000000..f696b00 --- /dev/null +++ b/roms/saa5050/saa5050.hex @@ -0,0 +1,257 @@ +:1000000000000000000000000000000000000000F0 +:1000100000000000000000000000000000000000E0 +:1000200000000000000000000000000000000000D0 +:1000300000000000000000000000000000000000C0 +:1000400000000000000000000000000000000000B0 +:1000500000000000000000000000000000000000A0 +:100060000000000000000000000000000000000090 +:100070000000000000000000000000000000000080 +:100080000000000000000000000000000000000070 +:100090000000000000000000000000000000000060 +:1000A0000000000000000000000000000000000050 +:1000B0000000000000000000000000000000000040 +:1000C0000000000000000000000000000000000030 +:1000D0000000000000000000000000000000000020 +:1000E0000000000000000000000000000000000010 +:1000F0000000000000000000000000000000000000 +:1001000000000000000000000000000000000000EF +:1001100000000000000000000000000000000000DF +:1001200000000000000000000000000000000000CF +:1001300000000000000000000000000000000000BF +:1001400000000000000000000000000000000000AF +:10015000000000000000000000000000000000009F +:10016000000000000000000000000000000000008F +:10017000000000000000000000000000000000007F +:10018000000000000000000000000000000000006F +:10019000000000000000000000000000000000005F +:1001A000000000000000000000000000000000004F +:1001B000000000000000000000000000000000003F +:1001C000000000000000000000000000000000002F +:1001D000000000000000000000000000000000001F +:1001E000000000000000000000000000000000000F +:1001F00000000000000000000000000000000000FF +:1002000000000000000000000000000000000000EE +:1002100000040404040400040000000000000000C6 +:10022000000A0A0A000000000000000000000000B0 +:10023000000609081C08081F00000000000000005C +:10024000000E15140E05150E000000000000000041 +:100250000018190204081303000000000000000049 +:10026000000814140815120D000000000000000022 +:100270000004040400000000000000000000000072 +:10028000000204080808040200000000000000004A +:100290000008040202020408000000000000000040 +:1002A0000004150E040E15040000000000000000FC +:1002B000000004041F04040000000000000000000F +:1002C000000000000000040408000000000000001E +:1002D000000000000E000000000000000000000010 +:1002E000000000000000000400000000000000000A +:1002F00000000102040810000000000000000000DF +:1003000000040A1111110A0400000000000000009E +:1003100000040C040404040E0000000000000000AF +:10032000000E11010608101F000000000000000070 +:10033000001F01020601110E000000000000000075 +:100340000002060A121F0202000000000000000066 +:10035000001F101E0101110E00000000000000002F +:10036000000608101E11110E000000000000000021 +:10037000001F01020408080800000000000000003F +:10038000000E11110E11110E0000000000000000FF +:10039000000E11110F01020C00000000000000000F +:1003A0000000000400000004000000000000000045 +:1003B0000000000400000404080000000000000029 +:1003C0000002040810080402000000000000000001 +:1003D0000000001F001F00000000000000000000DF +:1003E00000080402010204080000000000000000F0 +:1003F000000E1102040400040000000000000000D0 +:10040000000E11171517100E00000000000000006C +:1004100000040A11111F111100000000000000006B +:10042000001E11111E11111E00000000000000002E +:10043000000E11101010110E00000000000000004E +:10044000001E11111111111E00000000000000001B +:10045000001F10101E10101F000000000000000000 +:10046000001F10101E1010100000000000000000FF +:10047000000E11101013110F00000000000000000A +:10048000001111111F1111110000000000000000E7 +:10049000000E04040404040E00000000000000002C +:1004A000000101010101110E000000000000000028 +:1004B00000111214181412110000000000000000B6 +:1004C000001010101010101F0000000000000000AD +:1004D00000111B1515111111000000000000000093 +:1004E0000011111915131111000000000000000087 +:1004F000000E11111111110E00000000000000008B +:10050000001E11111E10101000000000000000005D +:10051000000E11111115120D000000000000000066 +:10052000001E11111E141211000000000000000036 +:10053000000E11100E01110E00000000000000005E +:10054000001F040404040404000000000000000074 +:10055000001111111111110E000000000000000027 +:10056000001111110A0A040400000000000000003C +:10057000001111111515150A0000000000000000FF +:100580000011110A040A111100000000000000000F +:100590000011110A0404040400000000000000001F +:1005A000001F01020408101F0000000000000000EE +:1005B000000004081F080400000000000000000004 +:1005C00000101010101601020407000000000000C7 +:1005D000000004021F0204000000000000000000F0 +:1005E0000000040E150404000000000000000000DC +:1005F000000A0A1F0A1F0A0A00000000000000008B +:10060000000000001F0000000000000000000000CB +:100610000000000E010F110F00000000000000009C +:100620000010101E1111111E00000000000000003B +:100630000000000F1010100F00000000000000006C +:100640000001010F1111110F000000000000000057 +:100650000000000E111F100E00000000000000003E +:10066000000204040E040404000000000000000066 +:100670000000000F1111110F010E0000000000001A +:100680000010101E111111110000000000000000E8 +:100690000004000C0404040E000000000000000030 +:1006A0000004000404040404040800000000000026 +:1006B000000808090A0C0A090000000000000000F8 +:1006C000000C04040404040E0000000000000000FC +:1006D0000000001A151515150000000000000000AC +:1006E0000000001E111111110000000000000000A8 +:1006F0000000000E1111110E0000000000000000AB +:100700000000001E1111111E10100000000000005A +:100710000000000F1111110F010100000000000086 +:100720000000000B0C08080800000000000000009A +:100730000000000F100E011E00000000000000006D +:100740000004040E04040402000000000000000085 +:10075000000000111111110F000000000000000046 +:1007600000000011110A0A0400000000000000004F +:10077000000000111115150A000000000000000023 +:10078000000000110A040A1100000000000000002F +:10079000000000111111110F010E000000000000F7 +:1007A0000000001F0204081F0000000000000000FD +:1007B0000008080808090305070100000000000000 +:1007C000000A0A0A0A0A0A0A0000000000000000E3 +:1007D00000180418041903050701000000000000B8 +:1007E000000004001F0004000000000000000000E2 +:1007F000001F1F1F1F1F1F1F000000000000000020 +:1008000000000000000000000000000000000000E8 +:1008100000000000000000000000000000000000D8 +:1008200000000000000000000000000000000000C8 +:1008300000000000000000000000000000000000B8 +:1008400000000000000000000000000000000000A8 +:100850000000000000000000000000000000000098 +:100860000000000000000000000000000000000088 +:100870000000000000000000000000000000000078 +:100880000000000000000000000000000000000068 +:100890000000000000000000000000000000000058 +:1008A0000000000000000000000000000000000048 +:1008B0000000000000000000000000000000000038 +:1008C0000000000000000000000000000000000028 +:1008D0000000000000000000000000000000000018 +:1008E0000000000000000000000000000000000008 +:1008F00000000000000000000000000000000000F8 +:1009000000000000000000000000000000000000E7 +:1009100000000000000000000000000000000000D7 +:1009200000000000000000000000000000000000C7 +:1009300000000000000000000000000000000000B7 +:1009400000000000000000000000000000000000A7 +:100950000000000000000000000000000000000097 +:100960000000000000000000000000000000000087 +:100970000000000000000000000000000000000077 +:100980000000000000000000000000000000000067 +:100990000000000000000000000000000000000057 +:1009A0000000000000000000000000000000000047 +:1009B0000000000000000000000000000000000037 +:1009C0000000000000000000000000000000000027 +:1009D0000000000000000000000000000000000017 +:1009E0000000000000000000000000000000000007 +:1009F00000000000000000000000000000000000F7 +:100A000080808080808080808080000000000000E6 +:100A1000B8B8B8808080808080800000000000002E +:100A200087878780808080808080000000000000B1 +:100A3000BFBFBF80808080808080000000000000F9 +:100A4000808080B8B8B8B8808080000000000000C6 +:100A5000B8B8B8B8B8B8B88080800000000000000E +:100A6000878787B8B8B8B880808000000000000091 +:100A7000BFBFBFB8B8B8B8808080000000000000D9 +:100A8000808080878787878080800000000000004A +:100A9000B8B8B88787878780808000000000000092 +:100AA0008787878787878780808000000000000015 +:100AB000BFBFBF878787878080800000000000005D +:100AC000808080BFBFBFBF8080800000000000002A +:100AD000B8B8B8BFBFBFBF80808000000000000072 +:100AE000878787BFBFBFBF808080000000000000F5 +:100AF000BFBFBFBFBFBFBF8080800000000000003D +:100B000080808080808080B8B8B80000000000003D +:100B1000B8B8B880808080B8B8B800000000000085 +:100B200087878780808080B8B8B800000000000008 +:100B3000BFBFBF80808080B8B8B800000000000050 +:100B4000808080B8B8B8B8B8B8B80000000000001D +:100B5000B8B8B8B8B8B8B8B8B8B800000000000065 +:100B6000878787B8B8B8B8B8B8B8000000000000E8 +:100B7000BFBFBFB8B8B8B8B8B8B800000000000030 +:100B800080808087878787B8B8B8000000000000A1 +:100B9000B8B8B887878787B8B8B8000000000000E9 +:100BA00087878787878787B8B8B80000000000006C +:100BB000BFBFBF87878787B8B8B8000000000000B4 +:100BC000808080BFBFBFBFB8B8B800000000000081 +:100BD000B8B8B8BFBFBFBFB8B8B8000000000000C9 +:100BE000878787BFBFBFBFB8B8B80000000000004C +:100BF000BFBFBFBFBFBFBFB8B8B800000000000094 +:100C0000000E11171517100E000000000000000064 +:100C100000040A11111F1111000000000000000063 +:100C2000001E11111E11111E000000000000000026 +:100C3000000E11101010110E000000000000000046 +:100C4000001E11111111111E000000000000000013 +:100C5000001F10101E10101F0000000000000000F8 +:100C6000001F10101E1010100000000000000000F7 +:100C7000000E11101013110F000000000000000002 +:100C8000001111111F1111110000000000000000DF +:100C9000000E04040404040E000000000000000024 +:100CA000000101010101110E000000000000000020 +:100CB00000111214181412110000000000000000AE +:100CC000001010101010101F0000000000000000A5 +:100CD00000111B151511111100000000000000008B +:100CE000001111191513111100000000000000007F +:100CF000000E11111111110E000000000000000083 +:100D0000001E11111E101010000000000000000055 +:100D1000000E11111115120D00000000000000005E +:100D2000001E11111E14121100000000000000002E +:100D3000000E11100E01110E000000000000000056 +:100D4000001F04040404040400000000000000006C +:100D5000001111111111110E00000000000000001F +:100D6000001111110A0A0404000000000000000034 +:100D7000001111111515150A0000000000000000F7 +:100D80000011110A040A1111000000000000000007 +:100D90000011110A04040404000000000000000017 +:100DA000001F01020408101F0000000000000000E6 +:100DB000000004081F0804000000000000000000FC +:100DC00000101010101601020407000000000000BF +:100DD000000004021F0204000000000000000000E8 +:100DE0000000040E150404000000000000000000D4 +:100DF000000A0A1F0A1F0A0A000000000000000083 +:100E000080808080808080878787000000000000CD +:100E1000B8B8B88080808087878700000000000015 +:100E20008787878080808087878700000000000098 +:100E3000BFBFBF80808080878787000000000000E0 +:100E4000808080B8B8B8B8878787000000000000AD +:100E5000B8B8B8B8B8B8B8878787000000000000F5 +:100E6000878787B8B8B8B887878700000000000078 +:100E7000BFBFBFB8B8B8B8878787000000000000C0 +:100E80008080808787878787878700000000000031 +:100E9000B8B8B88787878787878700000000000079 +:100EA00087878787878787878787000000000000FC +:100EB000BFBFBF8787878787878700000000000044 +:100EC000808080BFBFBFBF87878700000000000011 +:100ED000B8B8B8BFBFBFBF87878700000000000059 +:100EE000878787BFBFBFBF878787000000000000DC +:100EF000BFBFBFBFBFBFBF87878700000000000024 +:100F000080808080808080BFBFBF00000000000024 +:100F1000B8B8B880808080BFBFBF0000000000006C +:100F200087878780808080BFBFBF000000000000EF +:100F3000BFBFBF80808080BFBFBF00000000000037 +:100F4000808080B8B8B8B8BFBFBF00000000000004 +:100F5000B8B8B8B8B8B8B8BFBFBF0000000000004C +:100F6000878787B8B8B8B8BFBFBF000000000000CF +:100F7000BFBFBFB8B8B8B8BFBFBF00000000000017 +:100F800080808087878787BFBFBF00000000000088 +:100F9000B8B8B887878787BFBFBF000000000000D0 +:100FA00087878787878787BFBFBF00000000000053 +:100FB000BFBFBF87878787BFBFBF0000000000009B +:100FC000808080BFBFBFBFBFBFBF00000000000068 +:100FD000B8B8B8BFBFBFBFBFBFBF000000000000B0 +:100FE000878787BFBFBFBFBFBFBF00000000000033 +:100FF000BFBFBFBFBFBFBFBFBFBF0000000000007B +:00000001FF diff --git a/roms/saa5050/saa5050.rom b/roms/saa5050/saa5050.rom new file mode 100644 index 0000000000000000000000000000000000000000..71565e3cf7af216396dab97af8326a10b103347b GIT binary patch literal 4096 zcmeHIZI;?F40N(y)}++LfVPN!54KLs6~2q79l2%3yWkyRKFeO4H!Qp%+9q@F)&z&2L$odRdL_UkD8!HE=vpHgXx={pRvnKWD9n{b;3# zKa%HHa4z#an|eUPlyCEVoo&AstPQ9BSoRVRVjQREWwzh+f1sK3%HecA9n>G$z_jA> zr&b%UluJF@_#kb+SsVgLKInh3^Ge>Hhy1h62g67c{Sw~hi|Lv?Uu)H8io=JN8$G;@ z|1vM8z7SJOdR$=jzi`7J&j@jBqu~Re9)qW;;iKn6rp;So!9N&nxTCgZ87Br_X-~oB-R8WdI}^d3*oB9014j6`&d7 zI?ekQxuose`^Pgsyq{^JKgV;t7#U^bW(>VFH-=V?jesqIbBTt$f!i?pl^4 zdIDI-(090E=pBZh^@u+f4imtHhu&f6vBj8jzQb^Km;fgJcw4{z|G)A7KZhNLF_HOk z7=*)^9ftuhOPpEJI}F0%K6~m9JzQv_?{LK{5FUERLys-)iQZul4imt{pT)qiC3=V9 u=r9}|24H