|
|
1.1.1.2 root 1: /* Screen Conversion, Medium Res to 640x16Bit */
1.1 root 2:
1.1.1.3 root 3:
1.1.1.5 root 4: static void ConvertMediumRes_640x16Bit(void)
1.1 root 5: {
1.1.1.2 root 6: Uint32 *edi, *ebp;
7: Uint16 *esi;
1.1.1.4 root 8: Uint32 eax;
1.1.1.5 root 9: int y;
1.1.1.2 root 10:
11: Convert_StartFrame(); /* Start frame, track palettes */
12:
1.1.1.5 root 13: for (y = STScreenStartHorizLine; y < STScreenEndHorizLine; y++) {
14:
15: eax = STScreenLineOffset[y] + STScreenLeftSkipBytes; /* Offset for this line + Amount to skip on left hand side */
1.1.1.2 root 16: edi = (Uint32 *)((Uint8 *)pSTScreen + eax); /* ST format screen 4-plane 16 colours */
17: ebp = (Uint32 *)((Uint8 *)pSTScreenCopy + eax); /* Previous ST format screen */
1.1.1.3 root 18: esi = (Uint16 *)pPCScreenDest; /* PC format screen */
19:
1.1.1.5 root 20: if( (AdjustLinePaletteRemap(y) & 0x00030000)==0 ) /* Change palette table */
1.1.1.4 root 21: Line_ConvertLowRes_640x16Bit(edi, ebp, (Uint32 *)esi, eax);
1.1.1.3 root 22: else
1.1.1.4 root 23: Line_ConvertMediumRes_640x16Bit(edi, ebp, esi, eax);
1.1.1.3 root 24:
1.1.1.5 root 25: /* Offset to next line */
1.1.1.6 ! root 26: pPCScreenDest = (((Uint8 *)pPCScreenDest)+PCScreenBytesPerLine*2);
1.1 root 27: }
28: }
1.1.1.3 root 29:
30:
1.1.1.5 root 31: static void Line_ConvertMediumRes_640x16Bit(Uint32 *edi, Uint32 *ebp, Uint16 *esi, Uint32 eax)
1.1 root 32: {
1.1.1.5 root 33: Uint32 ebx, ecx;
34: int x;
1.1.1.2 root 35:
1.1.1.5 root 36: x = STScreenWidthBytes>>2; /* Amount to draw across in 16-pixels (4 bytes) */
1.1.1.2 root 37:
38: do /* x-loop */
39: {
40:
41: /* Do 16 pixels at one time */
42: ebx=*edi;
1.1 root 43:
1.1.1.3 root 44: if( (ScrUpdateFlag&0xe0000000) || ebx!=*ebp ) /* Does differ? */
45: { /* copy word */
1.1.1.2 root 46:
47: bScreenContentsChanged=TRUE;
1.1 root 48:
1.1.1.2 root 49: #if SDL_BYTEORDER == SDL_BIG_ENDIAN
50: /* Plot in 'right-order' on big endian systems */
51: if( !bScrDoubleY ) /* Double on Y? */
52: {
53: MED_BUILD_PIXELS_0 ; /* Generate 'ecx' as pixels [4,5,6,7] */
54: PLOT_MED_640_16BIT(12) ;
55: MED_BUILD_PIXELS_1 ; /* Generate 'ecx' as pixels [12,13,14,15] */
56: PLOT_MED_640_16BIT(4) ;
57: MED_BUILD_PIXELS_2 ; /* Generate 'ecx' as pixels [0,1,2,3] */
58: PLOT_MED_640_16BIT(8) ;
59: MED_BUILD_PIXELS_3 ; /* Generate 'ecx' as pixels [8,9,10,11] */
60: PLOT_MED_640_16BIT(0) ;
61: }
62: else
63: {
64: MED_BUILD_PIXELS_0 ; /* Generate 'ecx' as pixels [4,5,6,7] */
65: PLOT_MED_640_16BIT_DOUBLE_Y(12) ;
66: MED_BUILD_PIXELS_1 ; /* Generate 'ecx' as pixels [12,13,14,15] */
67: PLOT_MED_640_16BIT_DOUBLE_Y(4) ;
68: MED_BUILD_PIXELS_2 ; /* Generate 'ecx' as pixels [0,1,2,3] */
69: PLOT_MED_640_16BIT_DOUBLE_Y(8) ;
70: MED_BUILD_PIXELS_3 ; /* Generate 'ecx' as pixels [8,9,10,11] */
71: PLOT_MED_640_16BIT_DOUBLE_Y(0) ;
72: }
73: #else
74: /* Plot in 'wrong-order', as ebx is 68000 endian */
75: if( !bScrDoubleY ) /* Double on Y? */
76: {
77: MED_BUILD_PIXELS_0 ; /* Generate 'ecx' as pixels [4,5,6,7] */
78: PLOT_MED_640_16BIT(4) ;
79: MED_BUILD_PIXELS_1 ; /* Generate 'ecx' as pixels [12,13,14,15] */
80: PLOT_MED_640_16BIT(12) ;
81: MED_BUILD_PIXELS_2 ; /* Generate 'ecx' as pixels [0,1,2,3] */
82: PLOT_MED_640_16BIT(0) ;
83: MED_BUILD_PIXELS_3 ; /* Generate 'ecx' as pixels [8,9,10,11] */
84: PLOT_MED_640_16BIT(8) ;
85: }
86: else
87: {
88: MED_BUILD_PIXELS_0 ; /* Generate 'ecx' as pixels [4,5,6,7] */
89: PLOT_MED_640_16BIT_DOUBLE_Y(4) ;
90: MED_BUILD_PIXELS_1 ; /* Generate 'ecx' as pixels [12,13,14,15] */
91: PLOT_MED_640_16BIT_DOUBLE_Y(12) ;
92: MED_BUILD_PIXELS_2 ; /* Generate 'ecx' as pixels [0,1,2,3] */
93: PLOT_MED_640_16BIT_DOUBLE_Y(0) ;
94: MED_BUILD_PIXELS_3 ; /* Generate 'ecx' as pixels [8,9,10,11] */
95: PLOT_MED_640_16BIT_DOUBLE_Y(8) ;
96: }
97: #endif
98: }
99:
100: esi += 16; /* Next PC pixels */
101: edi += 1; /* Next ST pixels */
102: ebp += 1; /* Next ST copy pixels */
103: }
1.1.1.5 root 104: while( --x ); /* Loop on X */
1.1.1.2 root 105:
106: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.