|
|
1.1.1.2 root 1: /* Screen Conversion, High Res to 640x8Bit */
1.1 root 2:
3:
1.1.1.4 ! root 4: static void ConvertHighRes_640x8Bit(void)
1.1 root 5: {
1.1.1.2 root 6: Uint16 *edi, *ebp;
7: Uint32 *esi;
1.1.1.4 ! root 8: Uint16 eax, ebx;
! 9: int y, x;
1.1.1.2 root 10:
1.1 root 11: /*
1.1.1.2 root 12: // This is the method that I first used in Hatari...
13: // ...but I now rewrote the old WinSTon method, too.
14: // Don't know what is faster, so I didn't removed my
15: // first method here completely...
16: Uint8 *src=pSTScreen;
17: Uint8 *osrc=pSTScreenCopy;
18: Uint8 *dst=pPCScreenDest;
19: int i;
20: for(i=0; i<640*400/8; i++, src++, osrc++)
21: {
22: if( *osrc==*src )
23: dst+=8;
24: else
25: {
26: if( *src & 128 ) *dst++ = 1; else *dst++ = 0;
27: if( *src & 64 ) *dst++ = 1; else *dst++ = 0;
28: if( *src & 32 ) *dst++ = 1; else *dst++ = 0;
29: if( *src & 16 ) *dst++ = 1; else *dst++ = 0;
30: if( *src & 8 ) *dst++ = 1; else *dst++ = 0;
31: if( *src & 4 ) *dst++ = 1; else *dst++ = 0;
32: if( *src & 2 ) *dst++ = 1; else *dst++ = 0;
33: if( *src & 1 ) *dst++ = 1; else *dst++ = 0;
34: }
35: }
36: bScreenContentsChanged = TRUE;
37: return;
1.1 root 38: */
39:
1.1.1.2 root 40: /* Here's now the rewrite of the original WinSTon method: */
41:
42: edi = (Uint16 *)pSTScreen; /* ST format screen */
43: ebp = (Uint16 *)pSTScreenCopy; /* Previous ST format screen */
44: esi = (Uint32 *)pPCScreenDest; /* PC format screen */
45:
46: /* NOTE 'ScrUpdateFlag' is already set (to full update or check, no palettes) */
47:
1.1.1.4 ! root 48: for (y = STScreenStartHorizLine; y < STScreenEndHorizLine; y++) {
1.1.1.2 root 49:
1.1.1.4 ! root 50: for (x = 0; x < 40; x++) {
1.1.1.2 root 51:
52: /* Do 16 pixels at one time */
53: ebx = *edi;
54:
55: if( (ScrUpdateFlag&0xe0000000) || ebx!=*ebp ) /* Does differ? */
56: {
57: bScreenContentsChanged = TRUE;
58:
59: #if SDL_BYTEORDER == SDL_BIG_ENDIAN
60: /* Plot in 'right-order' on big endian systems */
61: HIGH_BUILD_PIXELS_0 ; /* Generate pixels [4,5,6,7] */
62: PLOT_HIGH_640_8BIT(3) ;
63: HIGH_BUILD_PIXELS_1 ; /* Generate pixels [0,1,2,3] */
64: PLOT_HIGH_640_8BIT(2) ;
65: HIGH_BUILD_PIXELS_2 ; /* Generate pixels [12,13,14,15] */
66: PLOT_HIGH_640_8BIT(1) ;
67: HIGH_BUILD_PIXELS_3 ; /* Generate pixels [8,9,10,11] */
68: PLOT_HIGH_640_8BIT(0) ;
69: #else
70: /* Plot in 'wrong-order', as ebx is 68000 endian */
71: HIGH_BUILD_PIXELS_0 ; /* Generate pixels [4,5,6,7] */
72: PLOT_HIGH_640_8BIT(1) ;
73: HIGH_BUILD_PIXELS_1 ; /* Generate pixels [0,1,2,3] */
74: PLOT_HIGH_640_8BIT(0) ;
75: HIGH_BUILD_PIXELS_2 ; /* Generate pixels [12,13,14,15] */
76: PLOT_HIGH_640_8BIT(3) ;
77: HIGH_BUILD_PIXELS_3 ; /* Generate pixels [8,9,10,11] */
78: PLOT_HIGH_640_8BIT(2) ;
79: #endif
80: }
81:
82: esi += 4; /* Next PC pixels */
83: edi += 1; /* Next ST pixels */
84: ebp += 1; /* Next ST copy pixels */
85: }
86:
87: /*?? esi = esi -40*8 +PCScreenBytesPerLine/2;*/ /* Back to start of line + Offset to next line */
1.1 root 88: }
89: }
1.1.1.2 root 90:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.