|
|
1.1.1.5 ! root 1: /* ! 2: Hatari - vdi16.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, 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; ! 14: Uint32 eax, edx; ! 15: Uint32 ebx, ecx; ! 16: int y, x, update; ! 17: ! 18: edx = eax = 0; ! 19: ! 20: /* Get screen addresses, 'edi'-ST screen, 'ebp'-Previous ST screen, ! 21: * 'esi'-PC screen */ ! 22: ! 23: edi = (Uint32 *)pSTScreen; /* ST format screen 4-plane 16 colors */ ! 24: ebp = (Uint32 *)pSTScreenCopy; /* Previous ST format screen */ ! 25: update = ScrUpdateFlag & PALETTEMASK_UPDATEMASK; ! 26: ! 27: for (y = 0; y < VDIHeight; y++) ! 28: { ! 29: ! 30: esi = (Uint32 *)pPCScreenDest; /* PC format screen, byte per pixel 256 colors */ ! 31: ! 32: x = VDIWidth >> 4; /* Amount to draw across - in 16-pixels (8 bytes) */ ! 33: ! 34: do /* x-loop */ ! 35: { ! 36: /* Do 16 pixels at one time */ ! 37: ebx = *edi; ! 38: ecx = *(edi+1); ! 39: ! 40: /* Full update? or just test changes? */ ! 41: if (update || ebx != *ebp || ecx != *(ebp+1)) /* Does differ? */ ! 42: { ! 43: bScreenContentsChanged = TRUE; 1.1.1.2 root 44: 45: #if SDL_BYTEORDER == SDL_BIG_ENDIAN 1.1.1.5 ! root 46: /* Plot pixels */ ! 47: LOW_BUILD_PIXELS_0 ; /* Generate 'ecx' as pixels [4,5,6,7] */ ! 48: PLOT_LOW_320_8BIT(3) ; ! 49: LOW_BUILD_PIXELS_1 ; /* Generate 'ecx' as pixels [12,13,14,15] */ ! 50: PLOT_LOW_320_8BIT(1) ; ! 51: LOW_BUILD_PIXELS_2 ; /* Generate 'ecx' as pixels [0,1,2,3] */ ! 52: PLOT_LOW_320_8BIT(2) ; ! 53: LOW_BUILD_PIXELS_3 ; /* Generate 'ecx' as pixels [8,9,10,11] */ ! 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 */ ! 73: ! 74: /* Offset to next line */ ! 75: pPCScreenDest = (((Uint8 *)pPCScreenDest) + PCScreenBytesPerLine); ! 76: } 1.1 root 77: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.