|
|
1.1 root 1: /* 1.1.1.2 ! root 2: Hatari - low320x8.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 function, Low Res to 320x8Bit 1.1 root 8: */ 9: 1.1.1.2 ! root 10: void ConvertLowRes_320x8Bit(void) 1.1 root 11: { 1.1.1.2 ! root 12: Uint32 *edi, *ebp; ! 13: Uint32 *esi; ! 14: Uint32 eax, edx; ! 15: register Uint32 ebx, ecx; ! 16: ! 17: edx = 0; ! 18: ! 19: Convert_StartFrame(); /* Start frame, track palettes */ ! 20: ScrY = STScreenStartHorizLine; /* Starting line in ST screen */ ! 21: ! 22: do /* y-loop */ ! 23: { ! 24: /* Get screen addresses, 'edi'-ST screen, 'ebp'-Previous ST screen, 'esi'-PC screen */ ! 25: eax = STScreenLineOffset[ScrY] + STScreenLeftSkipBytes; /* Offset for this line + Amount to skip on left hand side */ ! 26: edi = (Uint32 *)((Uint8 *)pSTScreen + eax); /* ST format screen 4-plane 16 colours */ ! 27: ebp = (Uint32 *)((Uint8 *)pSTScreenCopy + eax); /* Previous ST format screen */ ! 28: esi = (Uint32 *)pPCScreenDest; /* PC format screen, byte per pixel 256 colors */ ! 29: ! 30: AdjustLinePaletteRemap(); ! 31: ! 32: ScrX = STScreenWidthBytes>>3; /* 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: if((ScrUpdateFlag&0xe0000000) || ebx!=*ebp || ecx!=*(ebp+1)) /* Does differ? */ ! 41: { /* copy word */ ! 42: ! 43: bScreenContentsChanged = TRUE; ! 44: ! 45: #if SDL_BYTEORDER == SDL_BIG_ENDIAN ! 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) ; ! 55: #else ! 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) ; ! 65: #endif ! 66: } ! 67: ! 68: esi += 4; /* Next PC pixels */ ! 69: edi += 2; /* Next ST pixels */ ! 70: ebp += 2; /* Next ST copy pixels */ ! 71: } ! 72: while(--ScrX); /* Loop on X */ 1.1 root 73: 1.1.1.2 ! root 74: pPCScreenDest = (void *)(((Uint8 *)pPCScreenDest)+PCScreenBytesPerLine); /* Offset to next line */ ! 75: ScrY += 1; 1.1 root 76: } 1.1.1.2 ! root 77: while(ScrY < STScreenEndHorizLine); /* Loop on Y */ 1.1 root 78: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.