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