|
|
1.1.1.5 root 1: /*
2: Hatari - vdi16.c
3:
1.1.1.8 root 4: This file is distributed under the GNU General Public License, version 2
5: or at your option any later version. Read the file gpl.txt for details.
1.1.1.5 root 6:
7: Screen Conversion, VDI resolution with 16 colors
8: */
1.1 root 9:
1.1.1.3 root 10: static void ConvertVDIRes_16Colour(void)
1.1 root 11: {
1.1.1.5 root 12: Uint32 *edi, *ebp;
13: Uint32 *esi;
1.1.1.9 ! root 14: Uint32 eax, edx; /* set & used by macros */
1.1.1.5 root 15: Uint32 ebx, ecx;
16: int y, x, update;
17:
18: /* Get screen addresses, 'edi'-ST screen, 'ebp'-Previous ST screen,
19: * 'esi'-PC screen */
20:
21: edi = (Uint32 *)pSTScreen; /* ST format screen 4-plane 16 colors */
22: ebp = (Uint32 *)pSTScreenCopy; /* Previous ST format screen */
23: update = ScrUpdateFlag & PALETTEMASK_UPDATEMASK;
24:
25: for (y = 0; y < VDIHeight; y++)
26: {
27:
28: esi = (Uint32 *)pPCScreenDest; /* PC format screen, byte per pixel 256 colors */
29:
30: x = VDIWidth >> 4; /* Amount to draw across - in 16-pixels (8 bytes) */
31:
32: do /* x-loop */
33: {
34: /* Do 16 pixels at one time */
35: ebx = *edi;
36: ecx = *(edi+1);
37:
38: /* Full update? or just test changes? */
39: if (update || ebx != *ebp || ecx != *(ebp+1)) /* Does differ? */
40: {
1.1.1.6 root 41: bScreenContentsChanged = true;
1.1.1.2 root 42:
43: #if SDL_BYTEORDER == SDL_BIG_ENDIAN
1.1.1.5 root 44: /* Plot pixels */
1.1.1.7 root 45: LOW_BUILD_PIXELS_0 ; /* Generate 'ecx' as pixels [12,13,14,15] */
1.1.1.5 root 46: PLOT_LOW_320_8BIT(3) ;
1.1.1.7 root 47: LOW_BUILD_PIXELS_1 ; /* Generate 'ecx' as pixels [4,5,6,7] */
1.1.1.5 root 48: PLOT_LOW_320_8BIT(1) ;
1.1.1.7 root 49: LOW_BUILD_PIXELS_2 ; /* Generate 'ecx' as pixels [8,9,10,11] */
1.1.1.5 root 50: PLOT_LOW_320_8BIT(2) ;
1.1.1.7 root 51: LOW_BUILD_PIXELS_3 ; /* Generate 'ecx' as pixels [0,1,2,3] */
1.1.1.5 root 52: PLOT_LOW_320_8BIT(0) ;
1.1.1.2 root 53: #else
1.1.1.5 root 54: /* Plot pixels */
55: LOW_BUILD_PIXELS_0 ; /* Generate 'ecx' as pixels [4,5,6,7] */
56: PLOT_LOW_320_8BIT(1) ;
57: LOW_BUILD_PIXELS_1 ; /* Generate 'ecx' as pixels [12,13,14,15] */
58: PLOT_LOW_320_8BIT(3) ;
59: LOW_BUILD_PIXELS_2 ; /* Generate 'ecx' as pixels [0,1,2,3] */
60: PLOT_LOW_320_8BIT(0) ;
61: LOW_BUILD_PIXELS_3 ; /* Generate 'ecx' as pixels [8,9,10,11] */
62: PLOT_LOW_320_8BIT(2) ;
1.1.1.2 root 63: #endif
1.1.1.5 root 64: }
1.1.1.2 root 65:
1.1.1.5 root 66: esi += 4; /* Next PC pixels */
67: edi += 2; /* Next ST pixels */
68: ebp += 2; /* Next ST copy pixels */
69: }
70: while (--x); /* Loop on X */
71:
72: /* Offset to next line */
73: pPCScreenDest = (((Uint8 *)pPCScreenDest) + PCScreenBytesPerLine);
74: }
1.1 root 75: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.