|
|
1.1 root 1: /*
1.1.1.2 root 2: Hatari - low320x8.c
1.1.1.5 root 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.2 root 6:
7: Screen conversion function, Low Res to 320x8Bit
1.1 root 8: */
9:
1.1.1.3 root 10: static void ConvertLowRes_320x8Bit(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: Convert_StartFrame(); /* Start frame, track palettes */
1.1.1.2 root 19:
1.1.1.5 root 20: for (y = STScreenStartHorizLine; y < STScreenEndHorizLine; y++)
21: {
1.1.1.2 root 22:
1.1.1.5 root 23: /* Get screen addresses, 'edi'-ST screen, 'ebp'-Previous ST screen, 'esi'-PC screen */
24: eax = STScreenLineOffset[y] + STScreenLeftSkipBytes; /* Offset for this line + Amount to skip on left hand side */
25: edi = (Uint32 *)((Uint8 *)pSTScreen + eax); /* ST format screen 4-plane 16 colors */
26: ebp = (Uint32 *)((Uint8 *)pSTScreenCopy + eax); /* Previous ST format screen */
27: esi = (Uint32 *)pPCScreenDest; /* PC format screen, byte per pixel 256 colors */
1.1.1.3 root 28:
1.1.1.5 root 29: update = AdjustLinePaletteRemap(y) & PALETTEMASK_UPDATEMASK;
1.1.1.2 root 30:
1.1.1.5 root 31: x = STScreenWidthBytes>>3; /* Amount to draw across in 16-pixels(8 bytes) */
1.1.1.2 root 32:
1.1.1.5 root 33: do /* x-loop */
34: {
35: /* Do 16 pixels at one time */
36: ebx = *edi;
37: ecx = *(edi+1);
1.1.1.2 root 38:
1.1.1.5 root 39: if (update || ebx!=*ebp || ecx!=*(ebp+1)) /* Does differ? */
40: {
41: /* copy word */
1.1.1.2 root 42:
1.1.1.6 root 43: bScreenContentsChanged = true;
1.1.1.2 root 44:
45: #if SDL_BYTEORDER == SDL_BIG_ENDIAN
1.1.1.5 root 46: /* Plot pixels */
1.1.1.7 root 47: LOW_BUILD_PIXELS_0 ; /* Generate 'ecx' as pixels [12,13,14,15] */
1.1.1.5 root 48: PLOT_LOW_320_8BIT(3) ;
1.1.1.7 root 49: LOW_BUILD_PIXELS_1 ; /* Generate 'ecx' as pixels [4,5,6,7] */
1.1.1.5 root 50: PLOT_LOW_320_8BIT(1) ;
1.1.1.7 root 51: LOW_BUILD_PIXELS_2 ; /* Generate 'ecx' as pixels [8,9,10,11] */
1.1.1.5 root 52: PLOT_LOW_320_8BIT(2) ;
1.1.1.7 root 53: LOW_BUILD_PIXELS_3 ; /* Generate 'ecx' as pixels [0,1,2,3] */
1.1.1.5 root 54: PLOT_LOW_320_8BIT(0) ;
1.1.1.2 root 55: #else
1.1.1.5 root 56: /* Plot pixels */
57: LOW_BUILD_PIXELS_0 ; /* Generate 'ecx' as pixels [4,5,6,7] */
58: PLOT_LOW_320_8BIT(1) ;
59: LOW_BUILD_PIXELS_1 ; /* Generate 'ecx' as pixels [12,13,14,15] */
60: PLOT_LOW_320_8BIT(3) ;
61: LOW_BUILD_PIXELS_2 ; /* Generate 'ecx' as pixels [0,1,2,3] */
62: PLOT_LOW_320_8BIT(0) ;
63: LOW_BUILD_PIXELS_3 ; /* Generate 'ecx' as pixels [8,9,10,11] */
64: PLOT_LOW_320_8BIT(2) ;
1.1.1.2 root 65: #endif
1.1.1.5 root 66: }
1.1.1.2 root 67:
1.1.1.5 root 68: esi += 4; /* Next PC pixels */
69: edi += 2; /* Next ST pixels */
70: ebp += 2; /* Next ST copy pixels */
71: }
72: while (--x); /* Loop on X */
1.1 root 73:
1.1.1.5 root 74: pPCScreenDest = (((Uint8 *)pPCScreenDest)+PCScreenBytesPerLine); /* Offset to next line */
75: }
1.1 root 76: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.