# HG changeset patch # User Matti Hamalainen # Date 1559099686 -10800 # Node ID cb4689d9ceed7d4dc781093e411747246406967d # Parent 5daed72fd2114ac3d98c9444620140804f51c797 Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files. diff -r 5daed72fd211 -r cb4689d9ceed tools/lib64fmts.c --- a/tools/lib64fmts.c Tue May 28 10:50:50 2019 +0300 +++ b/tools/lib64fmts.c Wed May 29 06:14:46 2019 +0300 @@ -112,6 +112,27 @@ } +static const Uint8 fmtPetsciiKrisszHu_ID1[] = +{ + 0x01, 0x08, 0x0b, 0x08, 0x0A, 0x00, 0x9E, 0x32, 0x30, 0x36, + 0x31, 0x00, 0x00, 0x00, 0xA9, 0x1B, 0x8D, 0x11, 0xD0, 0xA9, + 0x80, 0x8D, 0x91, 0x02, 0xA9, +}; + + +static int fmtProbePetsciiKrisszHu(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) +{ + (void) fmt; + + if (buf->len == 10193 && + DM_MEMCMP_SIZE(buf->data, fmtPetsciiKrisszHu_ID1) == 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; @@ -2095,6 +2116,30 @@ }, NULL }, + + { + "pkhu", "petscii.krissz.hu (unpacked)", 0x0801, 0, DM_FMT_RD, + fmtProbePetsciiKrisszHu, + 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 , 0x2001 - 2, 0, 0, 0, NULL, NULL }, + { DO_COPY , DS_COLOR_RAM , 0x23e9 - 2, 0, 0, 0, NULL, NULL }, + + { DO_SET_MEM_LO , DS_D020 , 0x001e - 2, 0, 0, 0, NULL, NULL }, + { DO_SET_MEM_LO , DS_BGCOL , 0x0023 - 2, 0, 0, 0, NULL, NULL }, + + { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL }, + } + }, + NULL + }, }; const int ndmC64ImageFormats = sizeof(dmC64ImageFormats) / sizeof(dmC64ImageFormats[0]);