1 static int EmulateScanFull16_176Interpolate(unsigned int scan,unsigned short *data)
\r
3 unsigned short *ps=NULL,*end=NULL;
\r
4 unsigned char *pd=NULL;
\r
8 retValue = 1-(gLineTable[scan+1]-gLineTable[scan]);
\r
9 scan = gLineTable[scan];
\r
11 if ((int)scan< 0) return 0; // Out of range
\r
12 if ((int)scan>=176) return 0; // Out of range
\r
14 pd=Targ.screen+gLineOffsets[scan];//Targ.screen+scan*2+Targ.screen_offset+8;
\r
16 xpitch=-Targ.scanline_length;
\r
17 if((Pico.video.reg[12]&1))
\r
19 ps=data; end=ps+320;
\r
20 // Reduce 14 pixels into 9
\r
23 *(unsigned short *)pd=gColorMapTab[ps[0]];pd+=xpitch;
\r
24 *(unsigned short *)pd=(unsigned short)((gColorMapTab[ps[1]]+gColorMapTab[ps[2]])>>1);pd+=xpitch;
\r
25 *(unsigned short *)pd=gColorMapTab[ps[3]];pd+=xpitch;
\r
26 *(unsigned short *)pd=(unsigned short)((gColorMapTab[ps[4]]+gColorMapTab[ps[5]])>>1);pd+=xpitch;
\r
27 *(unsigned short *)pd=gColorMapTab[ps[6]];pd+=xpitch;
\r
28 *(unsigned short *)pd=(unsigned short)((gColorMapTab[ps[7]]+gColorMapTab[ps[8]])>>1);pd+=xpitch;
\r
29 *(unsigned short *)pd=(unsigned short)((gColorMapTab[ps[9]]+gColorMapTab[ps[10]])>>1);pd+=xpitch;
\r
30 *(unsigned short *)pd=gColorMapTab[ps[11]];pd+=xpitch;
\r
31 *(unsigned short *)pd=(unsigned short)((gColorMapTab[ps[12]]+gColorMapTab[ps[13]])>>1);pd+=xpitch;
\r
38 ps=data+32; end=ps+256;
\r
40 // Reduce 5 pixels into 4
\r
43 *(unsigned short *)pd=gColorMapTab[ps[0]];pd+=xpitch;
\r
44 *(unsigned short *)pd=gColorMapTab[ps[1]];pd+=xpitch;
\r
45 *(unsigned short *)pd=(unsigned short)((gColorMapTab[ps[2]]+gColorMapTab[ps[3]])>>1);pd+=xpitch;
\r
46 *(unsigned short *)pd=gColorMapTab[ps[4]];pd+=xpitch;
\r
54 static int EmulateScanFullRight16_176Interpolate(unsigned int scan,unsigned short *data)
\r
56 unsigned short *ps=NULL,*end=NULL;
\r
57 unsigned char *pd=NULL;
\r
61 retValue = 1-(gLineTable[scan+1]-gLineTable[scan]);
\r
62 scan = gLineTable[scan];
\r
64 if ((int)scan< 0) return 0; // Out of range
\r
65 if ((int)scan>=176) return 0; // Out of range
\r
67 pd=Targ.screen+gLineOffsets[scan];//Targ.screen+Targ.scanline_length-scan*2-8;
\r
69 xpitch=+Targ.scanline_length;
\r
70 if((Pico.video.reg[12]&1))
\r
72 ps=data; end=ps+320;
\r
73 // Reduce 14 pixels into 9
\r
76 *(unsigned short *)pd=gColorMapTab[ps[0]];pd+=xpitch;
\r
77 *(unsigned short *)pd=(unsigned short)((gColorMapTab[ps[1]]+gColorMapTab[ps[2]])>>1);pd+=xpitch;
\r
78 *(unsigned short *)pd=gColorMapTab[ps[3]];pd+=xpitch;
\r
79 *(unsigned short *)pd=(unsigned short)((gColorMapTab[ps[4]]+gColorMapTab[ps[5]])>>1);pd+=xpitch;
\r
80 *(unsigned short *)pd=gColorMapTab[ps[6]];pd+=xpitch;
\r
81 *(unsigned short *)pd=(unsigned short)((gColorMapTab[ps[7]]+gColorMapTab[ps[8]])>>1);pd+=xpitch;
\r
82 *(unsigned short *)pd=(unsigned short)((gColorMapTab[ps[9]]+gColorMapTab[ps[10]])>>1);pd+=xpitch;
\r
83 *(unsigned short *)pd=gColorMapTab[ps[11]];pd+=xpitch;
\r
84 *(unsigned short *)pd=(unsigned short)((gColorMapTab[ps[12]]+gColorMapTab[ps[13]])>>1);pd+=xpitch;
\r
91 ps=data+32; end=ps+256;
\r
92 // Reduce 5 pixels into 4
\r
95 *(unsigned short *)pd=gColorMapTab[ps[0]];pd+=xpitch;
\r
96 *(unsigned short *)pd=gColorMapTab[ps[1]];pd+=xpitch;
\r
97 *(unsigned short *)pd=(unsigned short)((gColorMapTab[ps[2]]+gColorMapTab[ps[3]])>>1);pd+=xpitch;
\r
98 *(unsigned short *)pd=gColorMapTab[ps[4]];pd+=xpitch;
\r
109 static int EmulateScan16_176Interpolate(unsigned int scan,unsigned short *data)
\r
111 unsigned short *ps=NULL,*end=NULL;
\r
112 unsigned char *pd=NULL;
\r
116 retValue = 1-(gLineTable[scan+1]-gLineTable[scan]);
\r
117 scan = gLineTable[scan];
\r
119 if ((int)scan< 0) return 0; // Out of range
\r
120 if ((int)scan>=176) return 0; // Out of range
\r
122 pd=Targ.screen+gLineOffsets[scan];//Targ.screen+scan*Targ.scanline_length;
\r
125 if((Pico.video.reg[12]&1))
\r
127 ps=data; end=ps+320;
\r
128 // Reduce 9 pixels into 5
\r
131 *(unsigned short *)pd=(unsigned short)((gColorMapTab[ps[0]]+gColorMapTab[ps[1]])>>1);pd+=xpitch;
\r
132 *(unsigned short *)pd=(unsigned short)((gColorMapTab[ps[2]]+gColorMapTab[ps[3]])>>1);pd+=xpitch;
\r
133 *(unsigned short *)pd=(unsigned short)((gColorMapTab[ps[4]]+gColorMapTab[ps[5]])>>1);pd+=xpitch;
\r
134 *(unsigned short *)pd=(unsigned short)((gColorMapTab[ps[6]]+gColorMapTab[ps[7]])>>1);pd+=xpitch;
\r
135 *(unsigned short *)pd=gColorMapTab[ps[8]];pd+=xpitch;
\r
142 ps=data+32; end=ps+256;
\r
143 // Reduce 10 pixels into 7
\r
146 *(unsigned short *)pd=gColorMapTab[ps[0]];pd+=xpitch;
\r
147 *(unsigned short *)pd=(unsigned short)((gColorMapTab[ps[1]]+gColorMapTab[ps[2]])>>1);pd+=xpitch;
\r
148 *(unsigned short *)pd=gColorMapTab[ps[3]];pd+=xpitch;
\r
149 *(unsigned short *)pd=(unsigned short)((gColorMapTab[ps[4]]+gColorMapTab[ps[5]])>>1);pd+=xpitch;
\r
150 *(unsigned short *)pd=gColorMapTab[ps[6]];pd+=xpitch;
\r
151 *(unsigned short *)pd=(unsigned short)((gColorMapTab[ps[7]]+gColorMapTab[ps[8]])>>1);pd+=xpitch;
\r
152 *(unsigned short *)pd=gColorMapTab[ps[9]];pd+=xpitch;
\r
161 static int EmulateStretchScan16_176Interpolate(unsigned int scan,unsigned short *data)
\r
163 unsigned short *ps=NULL,*end=NULL;
\r
164 unsigned char *pd=NULL;
\r
168 retValue = 1-(gLineTable[scan+1]-gLineTable[scan]);
\r
169 scan = gLineTable[scan];
\r
172 return 0; // Out of range
\r
173 if ((int)scan>=208)
\r
174 return 0; // Out of range
\r
176 pd=Targ.screen+gLineOffsets[scan];//Targ.screen+scan*Targ.scanline_length;
\r
179 if((Pico.video.reg[12]&1))
\r
181 ps=data; end=ps+320;
\r
182 // Reduce 9 pixels into 5
\r
185 *(unsigned short *)pd=(unsigned short)((gColorMapTab[ps[0]]+gColorMapTab[ps[1]])>>1);pd+=xpitch;
\r
186 *(unsigned short *)pd=(unsigned short)((gColorMapTab[ps[2]]+gColorMapTab[ps[3]])>>1);pd+=xpitch;
\r
187 *(unsigned short *)pd=(unsigned short)((gColorMapTab[ps[4]]+gColorMapTab[ps[5]])>>1);pd+=xpitch;
\r
188 *(unsigned short *)pd=(unsigned short)((gColorMapTab[ps[6]]+gColorMapTab[ps[7]])>>1);pd+=xpitch;
\r
189 *(unsigned short *)pd=gColorMapTab[ps[8]];pd+=xpitch;
\r
196 ps=data+32; end=ps+256;
\r
197 // Reduce 10 pixels into 7
\r
200 *(unsigned short *)pd=gColorMapTab[ps[0]];pd+=xpitch;
\r
201 *(unsigned short *)pd=(unsigned short)((gColorMapTab[ps[1]]+gColorMapTab[ps[2]])>>1);pd+=xpitch;
\r
202 *(unsigned short *)pd=gColorMapTab[ps[3]];pd+=xpitch;
\r
203 *(unsigned short *)pd=(unsigned short)((gColorMapTab[ps[4]]+gColorMapTab[ps[5]])>>1);pd+=xpitch;
\r
204 *(unsigned short *)pd=gColorMapTab[ps[6]];pd+=xpitch;
\r
205 *(unsigned short *)pd=(unsigned short)((gColorMapTab[ps[7]]+gColorMapTab[ps[8]])>>1);pd+=xpitch;
\r
206 *(unsigned short *)pd=gColorMapTab[ps[9]];pd+=xpitch;
\r