|
|
1.1.1.5 ! root 1: /* ! 2: Hatari - vdi4.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 4 colors ! 8: */ 1.1 root 9: 10: 1.1.1.3 root 11: static void ConvertVDIRes_4Colour(void) 1.1 root 12: { 1.1.1.5 ! root 13: Uint32 *edi, *ebp; ! 14: Uint32 *esi; ! 15: Uint32 eax, ebx, ecx; ! 16: int y, x, update; 1.1.1.2 root 17: 1.1.1.5 ! root 18: /* Get screen addresses, 'edi'-ST screen, 'ebp'-Previous ST screen, 'esi'-PC screen */ ! 19: edi = (Uint32 *)pSTScreen; /* ST format screen 2-plane 4 colors */ ! 20: ebp = (Uint32 *)pSTScreenCopy; /* Previous ST format screen */ ! 21: update = ScrUpdateFlag & PALETTEMASK_UPDATEMASK; 1.1.1.2 root 22: 1.1.1.5 ! root 23: for (y = 0; y < VDIHeight; y++) ! 24: { 1.1.1.3 root 25: 1.1.1.5 ! root 26: esi = (Uint32 *)pPCScreenDest; /* PC format screen, byte per pixel 256 colors */ 1.1.1.2 root 27: 1.1.1.5 ! root 28: x = VDIWidth >> 4; /* Amount to draw across - in 16-pixels (4 bytes) */ 1.1.1.2 root 29: 1.1.1.5 ! root 30: do /* x-loop */ ! 31: { ! 32: /* Do 16 pixels at one time */ ! 33: ebx = *edi; 1.1.1.2 root 34: 1.1.1.5 ! root 35: if (update || ebx != *ebp) /* Update? */ ! 36: { ! 37: bScreenContentsChanged = TRUE; 1.1.1.2 root 38: 1.1.1.5 ! root 39: /* Plot pixels */ 1.1.1.2 root 40: #if SDL_BYTEORDER == SDL_BIG_ENDIAN 1.1.1.5 ! root 41: MED_BUILD_PIXELS_0 ; /* Generate 'ecx' as pixels [4,5,6,7] */ ! 42: PLOT_MED_640_8BIT(3) ; ! 43: MED_BUILD_PIXELS_1 ; /* Generate 'ecx' as pixels [12,13,14,15] */ ! 44: PLOT_MED_640_8BIT(1) ; ! 45: MED_BUILD_PIXELS_2 ; /* Generate 'ecx' as pixels [0,1,2,3] */ ! 46: PLOT_MED_640_8BIT(2) ; ! 47: MED_BUILD_PIXELS_3 ; /* Generate 'ecx' as pixels [8,9,10,11] */ ! 48: PLOT_MED_640_8BIT(0) ; 1.1.1.2 root 49: #else 1.1.1.5 ! root 50: MED_BUILD_PIXELS_0 ; /* Generate 'ecx' as pixels [4,5,6,7] */ ! 51: PLOT_MED_640_8BIT(1) ; ! 52: MED_BUILD_PIXELS_1 ; /* Generate 'ecx' as pixels [12,13,14,15] */ ! 53: PLOT_MED_640_8BIT(3) ; ! 54: MED_BUILD_PIXELS_2 ; /* Generate 'ecx' as pixels [0,1,2,3] */ ! 55: PLOT_MED_640_8BIT(0) ; ! 56: MED_BUILD_PIXELS_3 ; /* Generate 'ecx' as pixels [8,9,10,11] */ ! 57: PLOT_MED_640_8BIT(2) ; 1.1.1.2 root 58: #endif 1.1.1.5 ! root 59: } 1.1.1.2 root 60: 1.1.1.5 ! root 61: esi += 4; /* Next PC pixels */ ! 62: edi += 1; /* Next ST pixels */ ! 63: ebp += 1; /* Next ST copy pixels */ ! 64: } ! 65: while (--x); /* Loop on X */ ! 66: ! 67: /* Offset to next line */ ! 68: pPCScreenDest = (((Uint8 *)pPCScreenDest) + PCScreenBytesPerLine); ! 69: } 1.1 root 70: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.