|
|
1.1 ! root 1: /* ! 2: Hatari - low320x32.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 320x32Bit ! 8: */ ! 9: ! 10: static void ConvertLowRes_320x32Bit(void) ! 11: { ! 12: Uint32 *edi, *ebp; ! 13: Uint32 *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 = (Uint32 *)pPCScreenDest; /* PC format screen */ ! 27: ! 28: update = AdjustLinePaletteRemap(y) & PALETTEMASK_UPDATEMASK; ! 29: ! 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: ! 42: bScreenContentsChanged = TRUE; ! 43: ! 44: #if SDL_BYTEORDER == SDL_BIG_ENDIAN ! 45: /* Plot pixels */ ! 46: LOW_BUILD_PIXELS_0 ; /* Generate 'ecx' as pixels [4,5,6,7] */ ! 47: PLOT_LOW_320_32BIT(12) ; ! 48: LOW_BUILD_PIXELS_1 ; /* Generate 'ecx' as pixels [12,13,14,15] */ ! 49: PLOT_LOW_320_32BIT(4) ; ! 50: LOW_BUILD_PIXELS_2 ; /* Generate 'ecx' as pixels [0,1,2,3] */ ! 51: PLOT_LOW_320_32BIT(8) ; ! 52: LOW_BUILD_PIXELS_3 ; /* Generate 'ecx' as pixels [8,9,10,11] */ ! 53: PLOT_LOW_320_32BIT(0) ; ! 54: #else ! 55: /* Plot pixels */ ! 56: LOW_BUILD_PIXELS_0 ; /* Generate 'ecx' as pixels [4,5,6,7] */ ! 57: PLOT_LOW_320_32BIT(4) ; ! 58: LOW_BUILD_PIXELS_1 ; /* Generate 'ecx' as pixels [12,13,14,15] */ ! 59: PLOT_LOW_320_32BIT(12) ; ! 60: LOW_BUILD_PIXELS_2 ; /* Generate 'ecx' as pixels [0,1,2,3] */ ! 61: PLOT_LOW_320_32BIT(0) ; ! 62: LOW_BUILD_PIXELS_3 ; /* Generate 'ecx' as pixels [8,9,10,11] */ ! 63: PLOT_LOW_320_32BIT(8) ; ! 64: #endif ! 65: } ! 66: ! 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: } ! 76: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.