comparison tools/lib64fmts.c @ 2428:09082816665d

Fix write support of Abyss Connection PETSCII-Editor 4.61 (unpacked) format.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 31 Jan 2020 21:48:45 +0200
parents 5d391c31ebc9
children 4dbb6572622d
comparison
equal deleted inserted replaced
2427:f07e3e66ca58 2428:09082816665d
124 return DMERR_OK; 124 return DMERR_OK;
125 } 125 }
126 126
127 127
128 static int fmtEncodeHiresPETSCIICharsetData( 128 static int fmtEncodeHiresPETSCIICharsetData(
129 const DMC64EncDecOp *op, DMGrowBuf *buf, const DMC64Image *img) 129 const DMC64EncDecOp *op, DMGrowBuf *buf, const DMC64Image *img,
130 const DMC64ImageCommonFormat *fmt)
130 { 131 {
131 Uint8 val; 132 Uint8 val;
133 (void) fmt;
132 134
133 switch (img->extraInfo[D64_EI_CHAR_CASE]) 135 switch (img->extraInfo[D64_EI_CHAR_CASE])
134 { 136 {
135 case 0: val = 0x14; break; 137 case 0: val = 0x14; break;
136 case 1: val = 0x17; break; 138 case 1: val = 0x17; break;
144 146
145 147
146 static int fmtEncodeMarqPETSCIIData(const DMC64EncDecOp *op, DMGrowBuf *buf, 148 static int fmtEncodeMarqPETSCIIData(const DMC64EncDecOp *op, DMGrowBuf *buf,
147 const DMC64Image *img, const DMC64ImageCommonFormat *fmt) 149 const DMC64Image *img, const DMC64ImageCommonFormat *fmt)
148 { 150 {
149 (void) fmt;
150
151 memcpy(buf->data, 151 memcpy(buf->data,
152 fmtMarqPETSCII_ID1, sizeof(fmtMarqPETSCII_ID1)); 152 fmtMarqPETSCII_ID1, sizeof(fmtMarqPETSCII_ID1));
153 153
154 memcpy(buf->data + sizeof(fmtMarqPETSCII_ID1), 154 memcpy(buf->data + sizeof(fmtMarqPETSCII_ID1),
155 fmtMarqPETSCII_ID2, sizeof(fmtMarqPETSCII_ID2)); 155 fmtMarqPETSCII_ID2, sizeof(fmtMarqPETSCII_ID2));
156 156
157 memcpy(buf->data + sizeof(fmtMarqPETSCII_ID1) + sizeof(fmtMarqPETSCII_ID2), 157 memcpy(buf->data + sizeof(fmtMarqPETSCII_ID1) + sizeof(fmtMarqPETSCII_ID2),
158 fmtMarqPETSCII_ID3, sizeof(fmtMarqPETSCII_ID3)); 158 fmtMarqPETSCII_ID3, sizeof(fmtMarqPETSCII_ID3));
159 159
160 return fmtEncodeHiresPETSCIICharsetData(op, buf, img); 160 return fmtEncodeHiresPETSCIICharsetData(op, buf, img, fmt);
161 } 161 }
162 162
163 163
164 static const Uint8 fmtPetsciiKrisszHu_ID1[] = 164 static const Uint8 fmtPetsciiKrisszHu_ID1[] =
165 { 165 {
277 277
278 278
279 static int fmtEncodeCocaPETSCIIData(const DMC64EncDecOp *op, DMGrowBuf *buf, 279 static int fmtEncodeCocaPETSCIIData(const DMC64EncDecOp *op, DMGrowBuf *buf,
280 const DMC64Image *img, const DMC64ImageCommonFormat *fmt) 280 const DMC64Image *img, const DMC64ImageCommonFormat *fmt)
281 { 281 {
282 (void) fmt;
283
284 memcpy(buf->data, 282 memcpy(buf->data,
285 fmtCocaPETSCII_ID1, sizeof(fmtCocaPETSCII_ID1)); 283 fmtCocaPETSCII_ID1, sizeof(fmtCocaPETSCII_ID1));
286 284
287 return fmtEncodeHiresPETSCIICharsetData(op, buf, img); 285 return fmtEncodeHiresPETSCIICharsetData(op, buf, img, fmt);
288 } 286 }
289 287
290 288
291 static int fmtProbeKoalaPainter(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) 289 static int fmtProbeKoalaPainter(const DMGrowBuf *buf, const DMC64ImageFormat *fmt)
292 { 290 {
2860 D64_SCR_CH_WIDTH, D64_SCR_CH_HEIGHT, 2858 D64_SCR_CH_WIDTH, D64_SCR_CH_HEIGHT,
2861 1, 1, 2859 1, 1,
2862 NULL, NULL, 2860 NULL, NULL,
2863 NULL, 2861 NULL,
2864 { 2862 {
2865 { DO_FUNC , 0 , 0x33ea - 0x3000, 0, 0, 0, NULL, fmtEncodeCocaPETSCIIData, DF_NORMAL }, 2863 { DO_FUNC , 0 , 0x33ea - 0x3000, 0, 0, 0, NULL, fmtEncodeHiresPETSCIICharsetData, DF_NORMAL },
2866 { DO_COPY , DS_SCREEN_RAM , 0x0000 , 0, 0, 0, NULL, NULL, DF_NORMAL }, 2864 { DO_COPY , DS_SCREEN_RAM , 0x0000 , 0, 0, 0, NULL, NULL, DF_NORMAL },
2867 { DO_COPY , DS_COLOR_RAM , 0x0400 , 0, 0, 0, NULL, NULL, DF_NORMAL }, 2865 { DO_COPY , DS_COLOR_RAM , 0x0400 , 0, 0, 0, NULL, NULL, DF_NORMAL },
2868 2866
2869 { DO_SET_MEM_LO , DS_D020 , 0x33e8 - 0x3000, 0, 0, 0, NULL, NULL, DF_NORMAL }, 2867 { DO_SET_MEM_LO , DS_D020 , 0x33e8 - 0x3000, 0, 0, 0, NULL, NULL, DF_NORMAL },
2870 { DO_SET_MEM_LO , DS_BGCOL , 0x33e9 - 0x3000, 0, 0, 0, NULL, NULL, DF_NORMAL }, 2868 { DO_SET_MEM_LO , DS_BGCOL , 0x33e9 - 0x3000, 0, 0, 0, NULL, NULL, DF_NORMAL },