Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
716 | lvd | 1 | #include "std.h" |
2 | |||
3 | #include "emul.h" |
||
4 | #include "vars.h" |
||
5 | #include "draw.h" |
||
6 | |||
7 | void draw_alco_384() |
||
8 | { |
||
9 | unsigned ofs = (comp.p7FFD & 8) << 12; |
||
10 | unsigned char *dst = rbuf; |
||
11 | for (unsigned y = 0; y < temp.scy; y++) { |
||
12 | for (unsigned x = 0; x < 6; x++) { |
||
13 | |||
14 | unsigned char *data = t.alco[y][x].s+ofs, *attr = t.alco[y][x].a+ofs; |
||
15 | unsigned d = *(unsigned*)data, a = *(unsigned*)attr; |
||
16 | *(unsigned*)dst = (d & 0xFF) + colortab_s8[a & 0xFF] + |
||
17 | ((d << 8) & 0xFF0000) + colortab_s24[(a >> 8) & 0xFF]; |
||
18 | *(unsigned*)(dst+4) = ((d >> 16) & 0xFF) + colortab_s8[(a >> 16) & 0xFF] + |
||
19 | ((d >> 8) & 0xFF0000) + colortab_s24[(a >> 24) & 0xFF]; |
||
20 | d = *(unsigned*)(data+4), a = *(unsigned*)(attr+4); |
||
21 | *(unsigned*)(dst+8) = (d & 0xFF) + colortab_s8[a & 0xFF] + |
||
22 | ((d << 8) & 0xFF0000) + colortab_s24[(a >> 8) & 0xFF]; |
||
23 | *(unsigned*)(dst+12)= ((d >> 16) & 0xFF) + colortab_s8[(a >> 16) & 0xFF] + |
||
24 | ((d >> 8) & 0xFF0000) + colortab_s24[(a >> 24) & 0xFF]; |
||
25 | dst += 16; |
||
26 | } |
||
27 | } |
||
28 | } |
||
29 | |||
30 | void draw_alco_320() |
||
31 | { |
||
32 | unsigned ofs = (comp.p7FFD & 8) << 12; |
||
33 | unsigned char *dst = rbuf; |
||
34 | unsigned base = (304-temp.scy)/2; |
||
35 | for (unsigned y = 0; y < temp.scy; y++) { |
||
36 | |||
37 | unsigned char *data = t.alco[base+y][0].s+ofs+4, *attr = t.alco[base+y][0].a+ofs+4; |
||
38 | unsigned d = *(unsigned*)data, a = *(unsigned*)attr; |
||
39 | *(unsigned*)dst = (d & 0xFF) + colortab_s8[a & 0xFF] + |
||
40 | ((d << 8) & 0xFF0000) + colortab_s24[(a >> 8) & 0xFF]; |
||
41 | *(unsigned*)(dst+4) = ((d >> 16) & 0xFF) + colortab_s8[(a >> 16) & 0xFF] + |
||
42 | ((d >> 8) & 0xFF0000) + colortab_s24[(a >> 24) & 0xFF]; |
||
43 | dst += 8; |
||
44 | |||
45 | for (unsigned x = 1; x < 5; x++) { |
||
46 | data = t.alco[base+y][x].s+ofs, attr = t.alco[base+y][x].a+ofs; |
||
47 | d = *(unsigned*)data, a = *(unsigned*)attr; |
||
48 | *(unsigned*)dst = (d & 0xFF) + colortab_s8[a & 0xFF] + |
||
49 | ((d << 8) & 0xFF0000) + colortab_s24[(a >> 8) & 0xFF]; |
||
50 | *(unsigned*)(dst+4) = ((d >> 16) & 0xFF) + colortab_s8[(a >> 16) & 0xFF] + |
||
51 | ((d >> 8) & 0xFF0000) + colortab_s24[(a >> 24) & 0xFF]; |
||
52 | d = *(unsigned*)(data+4), a = *(unsigned*)(attr+4); |
||
53 | *(unsigned*)(dst+8) = (d & 0xFF) + colortab_s8[a & 0xFF] + |
||
54 | ((d << 8) & 0xFF0000) + colortab_s24[(a >> 8) & 0xFF]; |
||
55 | *(unsigned*)(dst+12)= ((d >> 16) & 0xFF) + colortab_s8[(a >> 16) & 0xFF] + |
||
56 | ((d >> 8) & 0xFF0000) + colortab_s24[(a >> 24) & 0xFF]; |
||
57 | dst += 16; |
||
58 | } |
||
59 | |||
60 | data = t.alco[base+y][5].s+ofs, attr = t.alco[base+y][5].a+ofs; |
||
61 | d = *(unsigned*)data, a = *(unsigned*)attr; |
||
62 | *(unsigned*)dst = (d & 0xFF) + colortab_s8[a & 0xFF] + |
||
63 | ((d << 8) & 0xFF0000) + colortab_s24[(a >> 8) & 0xFF]; |
||
64 | *(unsigned*)(dst+4) = ((d >> 16) & 0xFF) + colortab_s8[(a >> 16) & 0xFF] + |
||
65 | ((d >> 8) & 0xFF0000) + colortab_s24[(a >> 24) & 0xFF]; |
||
66 | dst += 8; |
||
67 | |||
68 | } |
||
69 | } |
||
70 | |||
71 | void draw_alco_256() |
||
72 | { |
||
73 | unsigned ofs = (comp.p7FFD & 8) << 12; |
||
74 | unsigned char *dst = rbuf; |
||
75 | unsigned base = (304-temp.scy)/2; |
||
76 | for (unsigned y = 0; y < temp.scy; y++) { |
||
77 | for (unsigned x = 1; x < 5; x++) { |
||
78 | |||
79 | unsigned char *data = t.alco[base+y][x].s+ofs, *attr = t.alco[base+y][x].a+ofs; |
||
80 | unsigned d = *(unsigned*)data, a = *(unsigned*)attr; |
||
81 | *(unsigned*)dst = (d & 0xFF) + colortab_s8[a & 0xFF] + |
||
82 | ((d << 8) & 0xFF0000) + colortab_s24[(a >> 8) & 0xFF]; |
||
83 | *(unsigned*)(dst+4) = ((d >> 16) & 0xFF) + colortab_s8[(a >> 16) & 0xFF] + |
||
84 | ((d >> 8) & 0xFF0000) + colortab_s24[(a >> 24) & 0xFF]; |
||
85 | d = *(unsigned*)(data+4), a = *(unsigned*)(attr+4); |
||
86 | *(unsigned*)(dst+8) = (d & 0xFF) + colortab_s8[a & 0xFF] + |
||
87 | ((d << 8) & 0xFF0000) + colortab_s24[(a >> 8) & 0xFF]; |
||
88 | *(unsigned*)(dst+12)= ((d >> 16) & 0xFF) + colortab_s8[(a >> 16) & 0xFF] + |
||
89 | ((d >> 8) & 0xFF0000) + colortab_s24[(a >> 24) & 0xFF]; |
||
90 | dst += 16; |
||
91 | } |
||
92 | } |
||
93 | } |
||
94 | |||
95 | void draw_alco() |
||
96 | { |
||
97 | if (temp.scx == 384) { draw_alco_384(); return; } |
||
98 | if (temp.scx == 320) { draw_alco_320(); return; } |
||
99 | draw_alco_256(); |
||
100 | } |