comparison tools/lib64fmts.c @ 2130:3b5be00759ed

Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 27 May 2019 12:22:08 +0300
parents 2129d4ac6f45
children 898c1edadbc6
comparison
equal deleted inserted replaced
2129:2129d4ac6f45 2130:3b5be00759ed
56 56
57 memcpy(buf->data + 2, fmtMicroIllustratorMagicID_1, sizeof(fmtMicroIllustratorMagicID_1)); 57 memcpy(buf->data + 2, fmtMicroIllustratorMagicID_1, sizeof(fmtMicroIllustratorMagicID_1));
58 memcpy(buf->data + 9, fmtMicroIllustratorMagicID_2, sizeof(fmtMicroIllustratorMagicID_2)); 58 memcpy(buf->data + 9, fmtMicroIllustratorMagicID_2, sizeof(fmtMicroIllustratorMagicID_2));
59 59
60 return DMERR_OK; 60 return DMERR_OK;
61 }
62
63
64 static const Uint8 fmtMarqPETSCII_ID[] =
65 {
66 0x0b, 0x08, 0xef, 0x00, 0x9e, 0x32, 0x30, 0x36, 0x31, 0x00, 0x00, 0x00,
67 0xa9, 0x0b, 0x8d, 0x11, 0xd0, 0xa9, 0x17, 0x8d, 0x18, 0xd0, 0xa9, 0x0f,
68 0x8d, 0x20, 0xd0, 0xa9, 0x0e, 0x8d, 0x21, 0xd0, 0xa2, 0x00, 0xa0, 0xfa,
69 0xbd, 0x61, 0x08, 0x9d, 0x00, 0x04, 0xbd, 0x5b, 0x09, 0x9d, 0xfa, 0x04,
70 0xbd, 0x55, 0x0a, 0x9d, 0xf4, 0x05, 0xbd, 0x4f, 0x0b, 0x9d, 0xee, 0x06,
71 0xbd, 0x49, 0x0c, 0x9d, 0x00, 0xd8, 0xbd, 0x43, 0x0d, 0x9d, 0xfa, 0xd8,
72 0xbd, 0x3d, 0x0e, 0x9d, 0xf4, 0xd9, 0xbd, 0x37, 0x0f, 0x9d, 0xee, 0xda,
73 0xe8, 0x88, 0xd0, 0xcc, 0xa9, 0x1b, 0x8d, 0x11, 0xd0, 0x4c, 0x5e, 0x08,
74 };
75
76 static int fmtProbeMarqPETSCII(const DMGrowBuf *buf, const DMC64ImageFormat *fmt)
77 {
78 (void) fmt;
79
80 if (buf->len == 2098 &&
81 DM_MEMCMP_SIZE(buf->data + 2, fmtMarqPETSCII_ID) == 0
82 )
83 return DM_PROBE_SCORE_MAX;
84
85 return DM_PROBE_SCORE_FALSE;
61 } 86 }
62 87
63 88
64 static int fmtProbeKoalaPainter(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) 89 static int fmtProbeKoalaPainter(const DMGrowBuf *buf, const DMC64ImageFormat *fmt)
65 { 90 {
2005 "cdhm", "Cosmos Designs Hires Manager (unpacked)", 0x4000, 16385, DM_FMT_RDWR, 2030 "cdhm", "Cosmos Designs Hires Manager (unpacked)", 0x4000, 16385, DM_FMT_RDWR,
2006 fmtProbeCosmosDesignsHiresManager, 2031 fmtProbeCosmosDesignsHiresManager,
2007 NULL, NULL, 2032 NULL, NULL,
2008 { }, &dmC64CommonFormats[8] 2033 { }, &dmC64CommonFormats[8]
2009 }, 2034 },
2035 {
2036 "pet", "Marq's PETSCII (unpacked)", 0x0801, 0, DM_FMT_RD,
2037 fmtProbeMarqPETSCII,
2038 NULL, NULL,
2039 {
2040 D64_FMT_HIRES | D64_FMT_CHAR,
2041 D64_SCR_WIDTH , D64_SCR_HEIGHT,
2042 D64_SCR_CH_WIDTH, D64_SCR_CH_HEIGHT,
2043 1, 1,
2044 NULL, NULL,
2045 NULL,
2046 {
2047 { DO_COPY , DS_SCREEN_RAM , 0x60, 0, 0, 0, NULL, NULL },
2048 { DO_COPY , DS_COLOR_RAM , 0x60 + 1000, 0, 0, 0, NULL, NULL },
2049
2050 { DO_SET_MEM_LO , DS_D020 , 0x17, 0, 0, 0, NULL, NULL },
2051 { DO_SET_MEM_LO , DS_BGCOL , 0x1c, 0, 0, 0, NULL, NULL },
2052
2053 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL },
2054 }
2055 },
2056 NULL
2057 },
2010 }; 2058 };
2011 2059
2012 const int ndmC64ImageFormats = sizeof(dmC64ImageFormats) / sizeof(dmC64ImageFormats[0]); 2060 const int ndmC64ImageFormats = sizeof(dmC64ImageFormats) / sizeof(dmC64ImageFormats[0]);
2013 2061