# HG changeset patch # User Matti Hamalainen # Date 1560364209 -10800 # Node ID 6ba6ca5632d2877127b1108a6a3181a27ef8f68c # Parent 5dc1e323d3d459bbd50fb83772c7114f0e5ddf7b Make GunPaint v1.1 writing more accurate. diff -r 5dc1e323d3d4 -r 6ba6ca5632d2 tools/lib64fmts.c --- a/tools/lib64fmts.c Wed Jun 12 20:33:50 2019 +0300 +++ b/tools/lib64fmts.c Wed Jun 12 21:30:09 2019 +0300 @@ -515,9 +515,9 @@ } -static const char *fmtGunPaint_MagicID = "GUNPAINT (JZ) "; -#define fmtGunPaint_MagicLen (14) -#define fmtGunPaint_MagicOffs (0x3e8) +static const char *fmtGunPaint_MagicID = "GUNPAINT (JZ) "; +#define fmtGunPaint_MagicLen (16) +#define fmtGunPaint_MagicOffs (0x03e8) static int fmtProbeGunPaint(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) { @@ -2250,7 +2250,7 @@ }, { - "gun", "GunPaint (unpacked)", 0x4000, 0, DM_FMT_RDWR, + "gun", "GunPaint v1.1 (unpacked)", 0x4000, 33603, DM_FMT_RDWR, fmtProbeGunPaint, NULL, NULL, { @@ -2261,17 +2261,17 @@ NULL, NULL, fmtGetPixelFunPaint2, // The format is essentially same as FP2 { - DEF_REPEAT_BLOCK_8(DS_SCREEN_RAM, 0x0000, 0, 0x400, 0), + DEF_REPEAT_BLOCK_8(DS_SCREEN_RAM , 0x0000, 0, 0x400, 0), { DO_COPY , DS_BITMAP_RAM , 0x2000, 0, 0 , 0, NULL, NULL }, { DO_COPY , DS_EXTRA_DATA , 0x3f4f, 0, 177, 0, NULL, NULL }, { DO_COPY , DS_COLOR_RAM , 0x4000, 0, 0 , 0, NULL, NULL }, - DEF_REPEAT_BLOCK_8(DS_SCREEN_RAM, 0x4400, 8, 0x400, 0), + DEF_REPEAT_BLOCK_8(DS_SCREEN_RAM , 0x4400, 8, 0x400, 0), { DO_COPY , DS_BITMAP_RAM , 0x6400, 1, 0 , 0, NULL, NULL }, // GunPaint does not store the last 3 d021 values .. so set them to black // XXX TODO: According to some, the last 4 should be same .. { DO_SET_MEM , DS_EXTRA_DATA , 0 , 0, 3 , 20+177, NULL, NULL }, { DO_FUNC , 0 , 0x2742, 0, 1 , 0, fmtTruePaintGetLaceType, NULL }, - { DO_FUNC , 0 , fmtGunPaint_MagicOffs, 0, fmtGunPaint_MagicLen, 0, NULL, fmtEncodeGunPaint }, + { DO_FUNC , 0 , 0 , 0, 0 , 0, NULL, fmtEncodeGunPaint }, { DO_LAST , 0 , 0 , 0, 0 , 0, NULL, NULL }, } },