|
|
1.1.1.6 root 1: /*
2: Hatari - low320x16.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 320x16Bit
8: */
1.1 root 9:
1.1.1.4 root 10: static void ConvertLowRes_320x16Bit(void)
1.1 root 11: {
1.1.1.6 root 12: Uint32 *edi, *ebp;
13: Uint16 *esi;
14: Uint32 eax, edx;
15: Uint32 ebx, ecx;
16: int y, x, update;
17:
18: Convert_StartFrame(); /* Start frame, track palettes */
19:
20: for (y = STScreenStartHorizLine; y < STScreenEndHorizLine; y++)
21: {
22:
23: eax = STScreenLineOffset[y] + STScreenLeftSkipBytes; /* Offset for this line + Amount to skip on left hand side */
24: edi = (Uint32 *)((Uint8 *)pSTScreen + eax); /* ST format screen 4-plane 16 colors */
25: ebp = (Uint32 *)((Uint8 *)pSTScreenCopy + eax); /* Previous ST format screen */
26: esi = (Uint16 *)pPCScreenDest; /* PC format screen */
27:
28: update = AdjustLinePaletteRemap(y) & PALETTEMASK_UPDATEMASK;
1.1 root 29:
1.1.1.6 root 30: x = STScreenWidthBytes>>3; /* 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: if (update || ebx!=*ebp || ecx!=*(ebp+1)) /* Does differ? */
39: {
40: /* copy word */
41:
1.1.1.7 root 42: bScreenContentsChanged = true;
1.1 root 43:
1.1.1.2 root 44: #if SDL_BYTEORDER == SDL_BIG_ENDIAN
1.1.1.6 root 45: /* Plot pixels */
1.1.1.8 ! root 46: LOW_BUILD_PIXELS_0 ; /* Generate 'ecx' as pixels [12,13,14,15] */
1.1.1.6 root 47: PLOT_LOW_320_16BIT(12) ;
1.1.1.8 ! root 48: LOW_BUILD_PIXELS_1 ; /* Generate 'ecx' as pixels [4,5,6,7] */
1.1.1.6 root 49: PLOT_LOW_320_16BIT(4) ;
1.1.1.8 ! root 50: LOW_BUILD_PIXELS_2 ; /* Generate 'ecx' as pixels [8,9,10,11] */
1.1.1.6 root 51: PLOT_LOW_320_16BIT(8) ;
1.1.1.8 ! root 52: LOW_BUILD_PIXELS_3 ; /* Generate 'ecx' as pixels [0,1,2,3] */
1.1.1.6 root 53: PLOT_LOW_320_16BIT(0) ;
1.1 root 54: #else
1.1.1.6 root 55: /* Plot pixels */
56: LOW_BUILD_PIXELS_0 ; /* Generate 'ecx' as pixels [4,5,6,7] */
57: PLOT_LOW_320_16BIT(4) ;
58: LOW_BUILD_PIXELS_1 ; /* Generate 'ecx' as pixels [12,13,14,15] */
59: PLOT_LOW_320_16BIT(12) ;
60: LOW_BUILD_PIXELS_2 ; /* Generate 'ecx' as pixels [0,1,2,3] */
61: PLOT_LOW_320_16BIT(0) ;
62: LOW_BUILD_PIXELS_3 ; /* Generate 'ecx' as pixels [8,9,10,11] */
63: PLOT_LOW_320_16BIT(8) ;
1.1 root 64: #endif
1.1.1.6 root 65: }
1.1 root 66:
1.1.1.6 root 67: esi += 16; /* Next PC pixels */
68: edi += 2; /* Next ST pixels */
69: ebp += 2; /* Next ST copy pixels */
70: }
71: while (--x); /* Loop on X */
72:
73: /* Offset to next line: */
74: pPCScreenDest = (((Uint8 *)pPCScreenDest)+PCScreenBytesPerLine);
75: }
1.1 root 76: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.