# HG changeset patch # User Matti Hamalainen # Date 1558948928 -10800 # Node ID 3b5be00759edac1eb536c175b772046ea5a2ed29 # Parent 2129d4ac6f45aed0f7ea1018c1e19f34a1f5a65e Add initial (and incomplete) support for Marq's PETSCII editor PRG export format. diff -r 2129d4ac6f45 -r 3b5be00759ed tools/lib64fmts.c --- a/tools/lib64fmts.c Mon May 27 11:29:37 2019 +0300 +++ b/tools/lib64fmts.c Mon May 27 12:22:08 2019 +0300 @@ -61,6 +61,31 @@ } +static const Uint8 fmtMarqPETSCII_ID[] = +{ + 0x0b, 0x08, 0xef, 0x00, 0x9e, 0x32, 0x30, 0x36, 0x31, 0x00, 0x00, 0x00, + 0xa9, 0x0b, 0x8d, 0x11, 0xd0, 0xa9, 0x17, 0x8d, 0x18, 0xd0, 0xa9, 0x0f, + 0x8d, 0x20, 0xd0, 0xa9, 0x0e, 0x8d, 0x21, 0xd0, 0xa2, 0x00, 0xa0, 0xfa, + 0xbd, 0x61, 0x08, 0x9d, 0x00, 0x04, 0xbd, 0x5b, 0x09, 0x9d, 0xfa, 0x04, + 0xbd, 0x55, 0x0a, 0x9d, 0xf4, 0x05, 0xbd, 0x4f, 0x0b, 0x9d, 0xee, 0x06, + 0xbd, 0x49, 0x0c, 0x9d, 0x00, 0xd8, 0xbd, 0x43, 0x0d, 0x9d, 0xfa, 0xd8, + 0xbd, 0x3d, 0x0e, 0x9d, 0xf4, 0xd9, 0xbd, 0x37, 0x0f, 0x9d, 0xee, 0xda, + 0xe8, 0x88, 0xd0, 0xcc, 0xa9, 0x1b, 0x8d, 0x11, 0xd0, 0x4c, 0x5e, 0x08, +}; + +static int fmtProbeMarqPETSCII(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) +{ + (void) fmt; + + if (buf->len == 2098 && + DM_MEMCMP_SIZE(buf->data + 2, fmtMarqPETSCII_ID) == 0 + ) + return DM_PROBE_SCORE_MAX; + + return DM_PROBE_SCORE_FALSE; +} + + static int fmtProbeKoalaPainter(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) { int score = DM_PROBE_SCORE_FALSE; @@ -2007,6 +2032,29 @@ NULL, NULL, { }, &dmC64CommonFormats[8] }, + { + "pet", "Marq's PETSCII (unpacked)", 0x0801, 0, DM_FMT_RD, + fmtProbeMarqPETSCII, + NULL, NULL, + { + D64_FMT_HIRES | D64_FMT_CHAR, + D64_SCR_WIDTH , D64_SCR_HEIGHT, + D64_SCR_CH_WIDTH, D64_SCR_CH_HEIGHT, + 1, 1, + NULL, NULL, + NULL, + { + { DO_COPY , DS_SCREEN_RAM , 0x60, 0, 0, 0, NULL, NULL }, + { DO_COPY , DS_COLOR_RAM , 0x60 + 1000, 0, 0, 0, NULL, NULL }, + + { DO_SET_MEM_LO , DS_D020 , 0x17, 0, 0, 0, NULL, NULL }, + { DO_SET_MEM_LO , DS_BGCOL , 0x1c, 0, 0, 0, NULL, NULL }, + + { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL }, + } + }, + NULL + }, }; const int ndmC64ImageFormats = sizeof(dmC64ImageFormats) / sizeof(dmC64ImageFormats[0]);