comparison tools/lib64gfx.h @ 2238:5db6e0b63b35

Change again how the interlace type information is stored. Now store it in DMC64Image::extraInfo[] where it actually makes sense. Also add index for FLI type.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 15 Jun 2019 06:43:36 +0300
parents a36c81c3df85
children adb0480f6ebd
comparison
equal deleted inserted replaced
2237:26f1bae40fb6 2238:5db6e0b63b35
15 #ifdef __cplusplus 15 #ifdef __cplusplus
16 extern "C" { 16 extern "C" {
17 #endif 17 #endif
18 18
19 19
20 // Max defines
21 #define D64_MAX_EXTRA_DATA 16
22 #define D64_MAX_EXTRA_INFO 64
23
24
20 // Bitmap constants 25 // Bitmap constants
21 #define D64_SCR_WIDTH 320 26 #define D64_SCR_WIDTH 320
22 #define D64_SCR_HEIGHT 200 27 #define D64_SCR_HEIGHT 200
23 #define D64_SCR_CH_WIDTH (D64_SCR_WIDTH/8) 28 #define D64_SCR_CH_WIDTH (D64_SCR_WIDTH/8)
24 #define D64_SCR_CH_HEIGHT (D64_SCR_HEIGHT/8) 29 #define D64_SCR_CH_HEIGHT (D64_SCR_HEIGHT/8)
25 #define D64_MAX_EXTRA_DATA 16 30
26 #define D64_MAX_EXTRA_INFO 64
27 31
28 // C64 video screen pixel aspect ratio on PAL 32 // C64 video screen pixel aspect ratio on PAL
29 #define D64_SCR_PAR_XY (0.9365f) 33 #define D64_SCR_PAR_XY (0.9365f)
30 34
31 // Sprite constants 35 // Sprite constants
71 D64_ILACE_RES = 0x0001, // Interlace doubles resolution 75 D64_ILACE_RES = 0x0001, // Interlace doubles resolution
72 D64_ILACE_COLOR = 0x0002, // Uses color mixing 76 D64_ILACE_COLOR = 0x0002, // Uses color mixing
73 }; 77 };
74 78
75 79
80 // Different types of interlace
81 enum
82 {
83 D64_FLI_8 = 8,
84 };
85
86
76 // Charmode screen memory configuration 87 // Charmode screen memory configuration
77 enum 88 enum
78 { 89 {
79 D64_CHCFG_SCREEN, // Use screen memory 90 D64_CHCFG_SCREEN, // Use screen memory
80 D64_CHCFG_LINEAR = 1, // Generate linear pattern so that first line 91 D64_CHCFG_LINEAR = 1, // Generate linear pattern so that first line
86 enum 97 enum
87 { 98 {
88 D64_EI_CHAR_CASE = 0, 99 D64_EI_CHAR_CASE = 0,
89 D64_EI_CHAR_MODE, 100 D64_EI_CHAR_MODE,
90 D64_EI_CHAR_CUSTOM, 101 D64_EI_CHAR_CUSTOM,
102
103 D64_EI_FLI_TYPE,
104 D64_EI_ILACE_TYPE,
91 }; 105 };
92 106
93 107
94 // Image <-> bitmap conversion dithering 108 // Image <-> bitmap conversion dithering
95 enum 109 enum
130 DS_D021, 144 DS_D021,
131 DS_D022, 145 DS_D022,
132 DS_D023, 146 DS_D023,
133 DS_D024, 147 DS_D024,
134 148
135 DS_ILACE_TYPE, 149 DS_EXTRA_INFO,
136 150
137 DS_LAST 151 DS_LAST
138 }; 152 };
139 153
140 154
185 199
186 200
187 typedef struct _DMC64Image 201 typedef struct _DMC64Image
188 { 202 {
189 DMC64ImageCommonFormat *fmt; 203 DMC64ImageCommonFormat *fmt;
190 int laceType, // Interlace type (D64_ILACE_*) 204 int nblocks; // Number of internal blocks used
191 nblocks, // Number of internal blocks used
192 nbanks; // Number of videobanks used
193 205
194 // Bitmaps, color RAM, screen, etc. blocks * nblocks 206 // Bitmaps, color RAM, screen, etc. blocks * nblocks
195 // Not all of them may be allocated 207 // Not all of them may be allocated
196 DMC64MemBlock 208 DMC64MemBlock
197 *color, 209 *color,
218 typedef struct _DMC64EncDecOp 230 typedef struct _DMC64EncDecOp
219 { 231 {
220 int type; // Operation type (DO_*) 232 int type; // Operation type (DO_*)
221 int subject; // Operation "subject" (DS_*) 233 int subject; // Operation "subject" (DS_*)
222 234
223 size_t offs; // Offset in "memory" 235 int offs; // Offset in "memory"
224 int bank; // Bank number or extradata index 236 int bank; // Bank number or extradata index
225 size_t size; // Size of data (0 for "default") 237 size_t size; // Size of data (0 for "default")
226 size_t offs2; // Offset in data-block 238 size_t offs2; // Offset in data-block
227 239
228 int (*decFunction)(const struct _DMC64EncDecOp *op, DMC64Image *img, const DMGrowBuf *buf, const DMC64ImageCommonFormat *fmt); 240 int (*decFunction)(const struct _DMC64EncDecOp *op, DMC64Image *img, const DMGrowBuf *buf, const DMC64ImageCommonFormat *fmt);