Mercurial > hg > dmlib
comparison tools/lib64fmts.c @ 2185:6ba6ca5632d2
Make GunPaint v1.1 writing more accurate.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 12 Jun 2019 21:30:09 +0300 |
parents | e1b7c021db8a |
children | dc8a443accdf |
comparison
equal
deleted
inserted
replaced
2184:5dc1e323d3d4 | 2185:6ba6ca5632d2 |
---|---|
513 dmGrowBufFree(&mem); | 513 dmGrowBufFree(&mem); |
514 return res; | 514 return res; |
515 } | 515 } |
516 | 516 |
517 | 517 |
518 static const char *fmtGunPaint_MagicID = "GUNPAINT (JZ) "; | 518 static const char *fmtGunPaint_MagicID = "GUNPAINT (JZ) "; |
519 #define fmtGunPaint_MagicLen (14) | 519 #define fmtGunPaint_MagicLen (16) |
520 #define fmtGunPaint_MagicOffs (0x3e8) | 520 #define fmtGunPaint_MagicOffs (0x03e8) |
521 | 521 |
522 static int fmtProbeGunPaint(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) | 522 static int fmtProbeGunPaint(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
523 { | 523 { |
524 if (buf->len > fmtGunPaint_MagicOffs + fmtGunPaint_MagicLen && | 524 if (buf->len > fmtGunPaint_MagicOffs + fmtGunPaint_MagicLen && |
525 dmCompareAddr16(buf, 0, fmt->addr) && | 525 dmCompareAddr16(buf, 0, fmt->addr) && |
2248 fmtDecodeFunPaint2, fmtEncodeFunPaint2Packed, | 2248 fmtDecodeFunPaint2, fmtEncodeFunPaint2Packed, |
2249 { }, &dmC64CommonFormats[3] | 2249 { }, &dmC64CommonFormats[3] |
2250 }, | 2250 }, |
2251 | 2251 |
2252 { | 2252 { |
2253 "gun", "GunPaint (unpacked)", 0x4000, 0, DM_FMT_RDWR, | 2253 "gun", "GunPaint v1.1 (unpacked)", 0x4000, 33603, DM_FMT_RDWR, |
2254 fmtProbeGunPaint, | 2254 fmtProbeGunPaint, |
2255 NULL, NULL, | 2255 NULL, NULL, |
2256 { | 2256 { |
2257 D64_FMT_MC | D64_FMT_FLI | D64_FMT_ILACE, | 2257 D64_FMT_MC | D64_FMT_FLI | D64_FMT_ILACE, |
2258 D64_SCR_WIDTH, D64_SCR_HEIGHT, | 2258 D64_SCR_WIDTH, D64_SCR_HEIGHT, |
2259 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, | 2259 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, |
2260 1, 1, | 2260 1, 1, |
2261 NULL, NULL, | 2261 NULL, NULL, |
2262 fmtGetPixelFunPaint2, // The format is essentially same as FP2 | 2262 fmtGetPixelFunPaint2, // The format is essentially same as FP2 |
2263 { | 2263 { |
2264 DEF_REPEAT_BLOCK_8(DS_SCREEN_RAM, 0x0000, 0, 0x400, 0), | 2264 DEF_REPEAT_BLOCK_8(DS_SCREEN_RAM , 0x0000, 0, 0x400, 0), |
2265 { DO_COPY , DS_BITMAP_RAM , 0x2000, 0, 0 , 0, NULL, NULL }, | 2265 { DO_COPY , DS_BITMAP_RAM , 0x2000, 0, 0 , 0, NULL, NULL }, |
2266 { DO_COPY , DS_EXTRA_DATA , 0x3f4f, 0, 177, 0, NULL, NULL }, | 2266 { DO_COPY , DS_EXTRA_DATA , 0x3f4f, 0, 177, 0, NULL, NULL }, |
2267 { DO_COPY , DS_COLOR_RAM , 0x4000, 0, 0 , 0, NULL, NULL }, | 2267 { DO_COPY , DS_COLOR_RAM , 0x4000, 0, 0 , 0, NULL, NULL }, |
2268 DEF_REPEAT_BLOCK_8(DS_SCREEN_RAM, 0x4400, 8, 0x400, 0), | 2268 DEF_REPEAT_BLOCK_8(DS_SCREEN_RAM , 0x4400, 8, 0x400, 0), |
2269 { DO_COPY , DS_BITMAP_RAM , 0x6400, 1, 0 , 0, NULL, NULL }, | 2269 { DO_COPY , DS_BITMAP_RAM , 0x6400, 1, 0 , 0, NULL, NULL }, |
2270 // GunPaint does not store the last 3 d021 values .. so set them to black | 2270 // GunPaint does not store the last 3 d021 values .. so set them to black |
2271 // XXX TODO: According to some, the last 4 should be same .. | 2271 // XXX TODO: According to some, the last 4 should be same .. |
2272 { DO_SET_MEM , DS_EXTRA_DATA , 0 , 0, 3 , 20+177, NULL, NULL }, | 2272 { DO_SET_MEM , DS_EXTRA_DATA , 0 , 0, 3 , 20+177, NULL, NULL }, |
2273 { DO_FUNC , 0 , 0x2742, 0, 1 , 0, fmtTruePaintGetLaceType, NULL }, | 2273 { DO_FUNC , 0 , 0x2742, 0, 1 , 0, fmtTruePaintGetLaceType, NULL }, |
2274 { DO_FUNC , 0 , fmtGunPaint_MagicOffs, 0, fmtGunPaint_MagicLen, 0, NULL, fmtEncodeGunPaint }, | 2274 { DO_FUNC , 0 , 0 , 0, 0 , 0, NULL, fmtEncodeGunPaint }, |
2275 { DO_LAST , 0 , 0 , 0, 0 , 0, NULL, NULL }, | 2275 { DO_LAST , 0 , 0 , 0, 0 , 0, NULL, NULL }, |
2276 } | 2276 } |
2277 }, | 2277 }, |
2278 NULL | 2278 NULL |
2279 }, | 2279 }, |