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
100 int color = data[0] & 0x0F;
102 if (!(data[1] & 0x0F)) {
122 int array_offset = low ? 0 : 8;
125 for (i = 0; i < 8; i++) {
126 color = (data[2 * i] << 6) + (data[2 * i + 1] & 0x3F);
127 r = ((color >> 8) & 0x000F) * 17;
128 g = ((color >> 4) & 0x000F) * 17;
129 b = ((
color ) & 0x000F) * 17;
130 palette[i + array_offset] = 0xFF
U << 24 | r << 16 | g << 8 |
b;
154 if (!((data[4 + y] >> (5 - x)) & 0x01))
155 color = data[0] & 0x0F;
157 color = data[1] & 0x0F;
159 ai = ci + x + (stride * (ri + y));
175 int in_tl_x,
int in_tl_y,
uint8_t *in,
180 in += in_tl_x + in_tl_y *
stride;
181 out += out_tl_x + out_tl_y *
stride;
182 for (y = 0; y < h; y++)
183 memcpy(out + y * stride, in + y * stride, w);
191 for (y = tl_y; y < tl_y + h; y++)
192 memset(out + tl_x + y * stride, color, w);
196 int in_tl_x,
int in_tl_y,
uint8_t *in,
208 AVFrame *new_frame,
int roll_over)
211 int hscmd, h_off, hinc, vscmd, v_off, vinc;
217 color = data[0] & 0x0F;
218 hscmd = (data[1] & 0x30) >> 4;
219 vscmd = (data[2] & 0x30) >> 4;
245 memcpy(out +
FFMAX(0, hinc) + stride * y,
246 in +
FFMAX(0, hinc) - hinc + (y - vinc) * stride,
247 FFMIN(stride + hinc, stride));
252 stride, vinc, stride, roll_over);
256 stride, -1 * vinc, stride, roll_over);
273 int buf_size = avpkt->
size;
295 command = bytestream_get_byte(&buf);
296 inst = bytestream_get_byte(&buf);
306 if (!(cdg_data[1] & 0x0F))
307 memset(cc->
frame.
data[0], cdg_data[0] & 0x0F,
351 cc->
frame = new_frame;
378 .
name =
"cdgraphics",