1 static int EmulateScanFull16(unsigned int scan,unsigned short *data)
\r
3 unsigned short *ps=NULL,*end=NULL;
\r
4 unsigned short *pd=NULL;
\r
5 unsigned short *pdSrc1 = NULL;
\r
6 unsigned short *pdSrc2 = NULL;
\r
13 retValue = 1-(gLineTable[scan+1]-gLineTable[scan]);
\r
14 screenScan = gLineTable[scan];
\r
16 if ((int)screenScan< 0) return 0; // Out of range
\r
17 if ((int)screenScan>=Targ.view.iBr.iY) return 0; // Out of range
\r
19 pd=(unsigned short*)(Targ.screen+screenScan*2+Targ.screen_offset);
\r
22 xpitch=-(Targ.scanline_length>>1);
\r
23 if((Pico.video.reg[12]&1))
\r
25 ps=data; end=ps+320;
\r
28 if(gColumnStepTable[index]>1)
\r
30 *pd = gColorMapTab[*ps];
\r
32 *pd = ((gColorMapTab[*ps]+gColorMapTab[*(ps+1)])>>1);
\r
36 else if(gColumnStepTable[index]>0)
\r
38 *pd = gColorMapTab[*ps];
\r
44 *pd = ((gColorMapTab[*ps]+gColorMapTab[*(ps+1)])>>1);
\r
54 ps=data+32; end=ps+256;
\r
56 // Reduce 10 pixels into 7
\r
59 if(gNarrowColumnStepTable[index]>1)
\r
61 *pd = gColorMapTab[*ps];
\r
63 *pd = ((gColorMapTab[*ps]+gColorMapTab[*(ps+1)])>>1);
\r
66 else if(gNarrowColumnStepTable[index]>0)
\r
68 *pd = gColorMapTab[*ps];
\r
74 *pd = ((gColorMapTab[*ps]+gColorMapTab[*(ps+1)])>>1);
\r
83 if(scan>0 && screenScan != gLineTable[scan-1]+1)
\r
88 for(TInt loop=0;loop<Targ.view.iBr.iY;loop++)
\r
90 *pd=((*pdSrc1+*pdSrc2)>>1);
\r
101 static int EmulateScanFullRight16(unsigned int scan,unsigned short *data)
\r
103 unsigned short *ps=NULL,*end=NULL;
\r
104 unsigned short *pd=NULL;
\r
105 unsigned short *pdSrc1 = NULL;
\r
106 unsigned short *pdSrc2 = NULL;
\r
112 retValue = 1-(gLineTable[scan+1]-gLineTable[scan]);
\r
113 screenScan = gLineTable[scan];
\r
115 if ((int)screenScan< 0) return 0; // Out of range
\r
116 if ((int)screenScan>=Targ.view.iBr.iY) return 0; // Out of range
\r
118 pd=(unsigned short*)(Targ.screen+Targ.scanline_length-screenScan*2);
\r
121 xpitch=+(Targ.scanline_length>>1);
\r
122 if((Pico.video.reg[12]&1))
\r
124 ps=data; end=ps+320;
\r
127 if(gColumnStepTable[index]>1)
\r
129 *pd = gColorMapTab[*ps];
\r
131 *pd = ((gColorMapTab[*ps]+gColorMapTab[*(ps+1)])>>1);
\r
135 else if(gColumnStepTable[index]>0)
\r
137 *pd = gColorMapTab[*ps];
\r
143 *pd = ((gColorMapTab[*ps]+gColorMapTab[*(ps+1)])>>1);
\r
153 ps=data+32; end=ps+256;
\r
155 // Reduce 10 pixels into 7
\r
158 if(gNarrowColumnStepTable[index]>1)
\r
160 *pd = gColorMapTab[*ps];
\r
162 *pd = ((gColorMapTab[*ps]+gColorMapTab[*(ps+1)])>>1);
\r
165 else if(gNarrowColumnStepTable[index]>0)
\r
167 *pd = gColorMapTab[*ps];
\r
173 *pd = ((gColorMapTab[*ps]+gColorMapTab[*(ps+1)])>>1);
\r
182 if(scan>0 && screenScan != gLineTable[scan-1]+1)
\r
187 for(TInt loop=0;loop<Targ.view.iBr.iY;loop++)
\r
189 *pd=((*pdSrc1+*pdSrc2)>>1);
\r
202 static int EmulateScan16(unsigned int scan,unsigned short *data)
\r
205 unsigned short *ps=NULL,*end=NULL;
\r
206 unsigned short *pd=NULL;
\r
212 retValue = 1-(gLineTable[scan+1]-gLineTable[scan]);
\r
213 scan = gLineTable[scan];
\r
215 if ((int)scan< 0) return 0; // Out of range
\r
216 if ((int)scan>=Targ.view.iBr.iY) return 0; // Out of range
\r
218 pd=(unsigned short*)(Targ.screen+scan*Targ.scanline_length);
\r
221 if((Pico.video.reg[12]&1))
\r
223 ps=data; end=ps+320;
\r
226 if(gColumnStepTable[index]>0)
\r
228 *pd = gColorMapTab[*ps];
\r
235 *pd = ((gColorMapTab[*ps]+gColorMapTab[*(ps+1)])>>1);
\r
246 ps=data+32; end=ps+256;
\r
247 // Reduce 10 pixels into 7
\r
250 if(gNarrowColumnStepTable[index]>0)
\r
252 *pd = gColorMapTab[*ps];
\r
258 *pd = ((gColorMapTab[*ps]+gColorMapTab[*(ps+1)])>>1);
\r
271 static int EmulateStretchScan16(unsigned int scan,unsigned short *data)
\r
273 unsigned short *ps=NULL,*end=NULL;
\r
274 unsigned short *pd=NULL;
\r
275 unsigned short *pdSrc1 = NULL;
\r
276 unsigned short *pdSrc2 = NULL;
\r
282 retValue = 1-(gLineTable[scan+1]-gLineTable[scan]);
\r
283 screenScan = gLineTable[scan];
\r
285 if ((int)screenScan<0)
\r
286 return 0; // Out of range
\r
287 if ((int)screenScan>=Targ.view.iBr.iY)
\r
288 return 0; // Out of range
\r
290 pd=(unsigned short*)(Targ.screen+screenScan*Targ.scanline_length);
\r
293 if((Pico.video.reg[12]&1))
\r
295 ps=data; end=ps+320;
\r
298 if(gColumnStepTable[index]>1)
\r
300 *pd = gColorMapTab[*ps];
\r
302 *pd = ((gColorMapTab[*ps]+gColorMapTab[*(ps+1)])>>1);
\r
306 else if(gColumnStepTable[index]>0)
\r
308 *pd = gColorMapTab[*ps];
\r
314 *pd = ((gColorMapTab[*ps]+gColorMapTab[*(ps+1)])>>1);
\r
327 ps=data+32; end=ps+256;
\r
328 // Reduce 10 pixels into 7
\r
331 if(gNarrowColumnStepTable[index]>1)
\r
333 *pd = gColorMapTab[*ps];
\r
335 *pd = ((gColorMapTab[*ps]+gColorMapTab[*(ps+1)])>>1);
\r
338 else if(gNarrowColumnStepTable[index]>0)
\r
340 *pd = gColorMapTab[*ps];
\r
346 *pd = ((gColorMapTab[*ps]+gColorMapTab[*(ps+1)])>>1);
\r
355 if(scan>0 && screenScan != gLineTable[scan-1]+1)
\r
357 pdSrc2 = pdSrc1-Targ.scanline_length;
\r
358 pd = pdSrc1-(Targ.scanline_length>>1);
\r
360 for(TInt loop=0;loop<Targ.view.iBr.iX;loop++)
\r
362 *pd=((*pdSrc1+*pdSrc2)>>1);
\r