35 #define CDG_FULL_WIDTH 300
36 #define CDG_FULL_HEIGHT 216
37 #define CDG_DISPLAY_WIDTH 294
38 #define CDG_DISPLAY_HEIGHT 204
39 #define CDG_BORDER_WIDTH 6
40 #define CDG_BORDER_HEIGHT 12
43 #define CDG_COMMAND 0x09
47 #define CDG_INST_MEMORY_PRESET 1
48 #define CDG_INST_BORDER_PRESET 2
49 #define CDG_INST_TILE_BLOCK 6
50 #define CDG_INST_SCROLL_PRESET 20
51 #define CDG_INST_SCROLL_COPY 24
52 #define CDG_INST_LOAD_PAL_LO 30
53 #define CDG_INST_LOAD_PAL_HIGH 31
54 #define CDG_INST_TILE_BLOCK_XOR 38
57 #define CDG_PACKET_SIZE 24
58 #define CDG_DATA_SIZE 16
59 #define CDG_TILE_HEIGHT 12
60 #define CDG_TILE_WIDTH 6
61 #define CDG_MINIMUM_PKT_SIZE 6
62 #define CDG_MINIMUM_SCROLL_SIZE 3
63 #define CDG_HEADER_SIZE 8
64 #define CDG_PALETTE_SIZE 16
92 int color = data[0] & 0x0F;
94 if (!(data[1] & 0x0F)) {
114 int array_offset = low ? 0 : 8;
117 for (i = 0; i < 8; i++) {
118 color = (data[2 * i] << 6) + (data[2 * i + 1] & 0x3F);
119 r = ((color >> 8) & 0x000F) * 17;
120 g = ((color >> 4) & 0x000F) * 17;
121 b = ((
color ) & 0x000F) * 17;
122 palette[i + array_offset] = 0xFF
U << 24 | r << 16 | g << 8 |
b;
146 if (!((data[4 + y] >> (5 - x)) & 0x01))
147 color = data[0] & 0x0F;
149 color = data[1] & 0x0F;
151 ai = ci + x + (stride * (ri +
y));
172 in += in_tl_x + in_tl_y * stride;
173 out += out_tl_x + out_tl_y * stride;
174 for (y = 0; y < h; y++)
175 memcpy(out + y * stride, in + y * stride, w);
183 for (y = tl_y; y < tl_y + h; y++)
184 memset(out + tl_x + y * stride, color, w);
200 AVFrame *new_frame,
int roll_over)
203 int hscmd, h_off, hinc, vscmd, v_off, vinc;
209 color = data[0] & 0x0F;
210 hscmd = (data[1] & 0x30) >> 4;
211 vscmd = (data[2] & 0x30) >> 4;
237 memcpy(out +
FFMAX(0, hinc) + stride *
y,
238 in +
FFMAX(0, hinc) - hinc + (y - vinc) * stride,
239 FFMIN(stride + hinc, stride));
244 stride, vinc, stride, roll_over);
248 stride, -1 * vinc, stride, roll_over);
265 int buf_size = avpkt->
size;
290 command = bytestream2_get_byte(&gb);
291 inst = bytestream2_get_byte(&gb);
299 if (!(cdg_data[1] & 0x0F))
300 memset(cc->
frame->
data[0], cdg_data[0] & 0x0F,
348 if (!frame->
data[0]) {
371 .
name =
"cdgraphics",