|
|
1.1.1.5 ! root 1: /* ! 2: Hatari - vdi2.c 1.1 root 3: 1.1.1.5 ! root 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. 1.1 root 6: 1.1.1.5 ! root 7: Screen Conversion, monochrome VDI resolution ! 8: */ 1.1 root 9: 10: 1.1.1.3 root 11: static void ConvertVDIRes_2Colour(void) 1.1 root 12: { 1.1.1.5 ! root 13: Uint16 *edi, *ebp; ! 14: Uint32 *esi; ! 15: Uint16 eax, ebx; ! 16: int y, x, update; ! 17: ! 18: edi = (Uint16 *)pSTScreen; /* ST format screen */ ! 19: ebp = (Uint16 *)pSTScreenCopy; /* Previous ST format screen */ ! 20: update = ScrUpdateFlag & PALETTEMASK_UPDATEMASK; ! 21: ! 22: for (y = 0; y < VDIHeight; y++) ! 23: { ! 24: ! 25: esi = (Uint32 *)pPCScreenDest; /* PC format screen, byte per pixel 256 colors */ ! 26: ! 27: x = VDIWidth >> 4; /* Amount to draw across in 16-pixels (4 bytes) */ ! 28: ! 29: do /* x-loop */ ! 30: { ! 31: /* Do 16 pixels at one time */ ! 32: ebx = *edi; ! 33: ! 34: if (update || ebx != *ebp) /* Does differ? */ ! 35: { ! 36: bScreenContentsChanged = TRUE; 1.1.1.2 root 37: 38: #if SDL_BYTEORDER == SDL_BIG_ENDIAN 1.1.1.5 ! root 39: /* Plot in 'right-order' on big endian systems */ ! 40: HIGH_BUILD_PIXELS_0 ; /* Generate pixels [4,5,6,7] */ ! 41: PLOT_HIGH_640_8BIT(3) ; ! 42: HIGH_BUILD_PIXELS_1 ; /* Generate pixels [0,1,2,3] */ ! 43: PLOT_HIGH_640_8BIT(2) ; ! 44: HIGH_BUILD_PIXELS_2 ; /* Generate pixels [12,13,14,15] */ ! 45: PLOT_HIGH_640_8BIT(1) ; ! 46: HIGH_BUILD_PIXELS_3 ; /* Generate pixels [8,9,10,11] */ ! 47: PLOT_HIGH_640_8BIT(0) ; 1.1.1.2 root 48: #else 1.1.1.5 ! root 49: /* Plot in 'wrong-order', as ebx is 68000 endian */ ! 50: HIGH_BUILD_PIXELS_0 ; /* Generate pixels [4,5,6,7] */ ! 51: PLOT_HIGH_640_8BIT(1) ; ! 52: HIGH_BUILD_PIXELS_1 ; /* Generate pixels [0,1,2,3] */ ! 53: PLOT_HIGH_640_8BIT(0) ; ! 54: HIGH_BUILD_PIXELS_2 ; /* Generate pixels [12,13,14,15] */ ! 55: PLOT_HIGH_640_8BIT(3) ; ! 56: HIGH_BUILD_PIXELS_3 ; /* Generate pixels [8,9,10,11] */ ! 57: PLOT_HIGH_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.