|
|
1.1.1.2 root 1: /* Screen Conversion, VDI Res to 2Colour (1-Bit and 8-Bit) */ 1.1 root 2: 1.1.1.2 root 3: #if 0 /* Currently unused */ 1.1.1.3 ! root 4: static void ConvertVDIRes_2Colour_1Bit(void) 1.1 root 5: { 1.1.1.2 root 6: /* Copy palette to bitmap (2 colours) */ 7: 1.1 root 8: if (HBLPalettes[0]==0x777) { 9: ScreenBMP.Colours[0].rgbRed = ScreenBMP.Colours[0].rgbGreen = ScreenBMP.Colours[0].rgbBlue = 0xff; 10: ScreenBMP.Colours[1].rgbRed = ScreenBMP.Colours[1].rgbGreen = ScreenBMP.Colours[1].rgbBlue = 0x00; 11: } 12: else { 13: ScreenBMP.Colours[0].rgbRed = ScreenBMP.Colours[0].rgbGreen = ScreenBMP.Colours[0].rgbBlue = 0x00; 14: ScreenBMP.Colours[1].rgbRed = ScreenBMP.Colours[1].rgbGreen = ScreenBMP.Colours[1].rgbBlue = 0xff; 15: } 1.1.1.2 root 16: 17: /* Simply copy ST screen, as same format! */ 1.1 root 18: memcpy(pPCScreenDest,pSTScreen,(VDIWidth/8)*VDIHeight); 19: 20: bScreenContentsChanged = TRUE; 21: } 1.1.1.2 root 22: #endif 1.1 root 23: 24: 1.1.1.3 ! root 25: static void ConvertVDIRes_2Colour(void) 1.1 root 26: { 1.1.1.2 root 27: Uint16 *edi, *ebp; 28: Uint32 *esi; 1.1.1.3 ! root 29: Uint16 eax, ebx; ! 30: int y, x; 1.1.1.2 root 31: 32: edi = (Uint16 *)pSTScreen; /* ST format screen */ 33: ebp = (Uint16 *)pSTScreenCopy; /* Previous ST format screen */ 34: 1.1.1.3 ! root 35: for (y = 0; y < VDIHeight; y++) { ! 36: 1.1.1.2 root 37: esi = (Uint32 *)pPCScreenDest; /* PC format screen, byte per pixel 256 colours */ 38: 1.1.1.3 ! root 39: x = VDIWidth >> 4; /* Amount to draw across in 16-pixels (4 bytes) */ 1.1.1.2 root 40: 41: do /* x-loop */ 42: { 43: /* Do 16 pixels at one time */ 44: ebx = *edi; 45: 46: if( (ScrUpdateFlag&0xe0000000) || ebx!=*ebp ) /* Does differ? */ 47: { 48: bScreenContentsChanged = TRUE; 49: 50: #if SDL_BYTEORDER == SDL_BIG_ENDIAN 51: /* Plot in 'right-order' on big endian systems */ 52: HIGH_BUILD_PIXELS_0 ; /* Generate pixels [4,5,6,7] */ 53: PLOT_HIGH_640_8BIT(3) ; 54: HIGH_BUILD_PIXELS_1 ; /* Generate pixels [0,1,2,3] */ 55: PLOT_HIGH_640_8BIT(2) ; 56: HIGH_BUILD_PIXELS_2 ; /* Generate pixels [12,13,14,15] */ 57: PLOT_HIGH_640_8BIT(1) ; 58: HIGH_BUILD_PIXELS_3 ; /* Generate pixels [8,9,10,11] */ 59: PLOT_HIGH_640_8BIT(0) ; 60: #else 61: /* Plot in 'wrong-order', as ebx is 68000 endian */ 62: HIGH_BUILD_PIXELS_0 ; /* Generate pixels [4,5,6,7] */ 63: PLOT_HIGH_640_8BIT(1) ; 64: HIGH_BUILD_PIXELS_1 ; /* Generate pixels [0,1,2,3] */ 65: PLOT_HIGH_640_8BIT(0) ; 66: HIGH_BUILD_PIXELS_2 ; /* Generate pixels [12,13,14,15] */ 67: PLOT_HIGH_640_8BIT(3) ; 68: HIGH_BUILD_PIXELS_3 ; /* Generate pixels [8,9,10,11] */ 69: PLOT_HIGH_640_8BIT(2) ; 70: #endif 71: } 72: 73: esi += 4; /* Next PC pixels */ 74: edi += 1; /* Next ST pixels */ 75: ebp += 1; /* Next ST copy pixels */ 76: } 1.1.1.3 ! root 77: while( --x ); /* Loop on X */ 1.1 root 78: 1.1.1.3 ! root 79: /* Offset to next line */ ! 80: pPCScreenDest = (void *)(((Uint8 *)pPCScreenDest)+PCScreenBytesPerLine); 1.1 root 81: } 82: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.