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