|
|
1.1.1.2 ! root 1: /* ! 2: Hatari - med640x8.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. 1.1 root 6: 1.1.1.2 ! root 7: Screen conversion, Medium Res to 640x8Bit ! 8: */ 1.1 root 9: 10: void ConvertMediumRes_640x8Bit(void) 11: { 1.1.1.2 ! root 12: Uint32 *edi, *ebp; ! 13: Uint32 *esi; ! 14: Uint32 eax; ! 15: ! 16: Convert_StartFrame(); /* Start frame, track palettes */ ! 17: ScrY = STScreenStartHorizLine; /* Starting line in ST screen */ ! 18: ! 19: do /* y-loop */ ! 20: { ! 21: eax = STScreenLineOffset[ScrY] + STScreenLeftSkipBytes; /* Offset for this line + Amount to skip on left hand side */ ! 22: edi = (Uint32 *)((Uint8 *)pSTScreen + eax); /* ST format screen 4-plane 16 colours */ ! 23: ebp = (Uint32 *)((Uint8 *)pSTScreenCopy + eax); /* Previous ST format screen */ ! 24: esi = (Uint32 *)pPCScreenDest; /* PC format screen */ ! 25: ! 26: if((AdjustLinePaletteRemap()&0x00030000) == 0) /* Change palette table */ ! 27: Line_ConvertLowRes_640x8Bit(edi, ebp, esi, eax); ! 28: else ! 29: Line_ConvertMediumRes_640x8Bit(edi, ebp, esi, eax); ! 30: ! 31: pPCScreenDest = (void *)(((Uint8 *)pPCScreenDest)+PCScreenBytesPerLine*2); /* Offset to next line */ ! 32: ScrY += 1; 1.1 root 33: } 1.1.1.2 ! root 34: while(ScrY < STScreenEndHorizLine); /* Loop on Y */ 1.1 root 35: } 1.1.1.2 ! root 36: ! 37: ! 38: void Line_ConvertMediumRes_640x8Bit(Uint32 *edi, Uint32 *ebp, Uint32 *esi, Uint32 eax) 1.1 root 39: { 1.1.1.2 ! root 40: register Uint32 ebx, ecx; ! 41: ! 42: ScrX = STScreenWidthBytes>>2; /* Amount to draw across in 16-pixels (4 bytes) */ 1.1 root 43: 1.1.1.2 ! root 44: do /* x-loop */ ! 45: { ! 46: ! 47: /* Do 16 pixels at one time */ ! 48: ebx = *edi; ! 49: ! 50: if((ScrUpdateFlag&0xe0000000) || ebx!=*ebp) /* Does differ? */ ! 51: { /* copy word */ ! 52: ! 53: bScreenContentsChanged = TRUE; ! 54: ! 55: #if SDL_BYTEORDER == SDL_BIG_ENDIAN ! 56: /* Plot in 'right-order' on big endian systems */ ! 57: if(!bScrDoubleY) /* Double on Y? */ ! 58: { ! 59: MED_BUILD_PIXELS_0 ; /* Generate 'ecx' as pixels [4,5,6,7] */ ! 60: PLOT_MED_640_8BIT(3) ; ! 61: MED_BUILD_PIXELS_1 ; /* Generate 'ecx' as pixels [12,13,14,15] */ ! 62: PLOT_MED_640_8BIT(1) ; ! 63: MED_BUILD_PIXELS_2 ; /* Generate 'ecx' as pixels [0,1,2,3] */ ! 64: PLOT_MED_640_8BIT(2) ; ! 65: MED_BUILD_PIXELS_3 ; /* Generate 'ecx' as pixels [8,9,10,11] */ ! 66: PLOT_MED_640_8BIT(0) ; ! 67: } ! 68: else ! 69: { ! 70: MED_BUILD_PIXELS_0 ; /* Generate 'ecx' as pixels [4,5,6,7] */ ! 71: PLOT_MED_640_8BIT_DOUBLE_Y(3) ; ! 72: MED_BUILD_PIXELS_1 ; /* Generate 'ecx' as pixels [12,13,14,15] */ ! 73: PLOT_MED_640_8BIT_DOUBLE_Y(1) ; ! 74: MED_BUILD_PIXELS_2 ; /* Generate 'ecx' as pixels [0,1,2,3] */ ! 75: PLOT_MED_640_8BIT_DOUBLE_Y(2) ; ! 76: MED_BUILD_PIXELS_3 ; /* Generate 'ecx' as pixels [8,9,10,11] */ ! 77: PLOT_MED_640_8BIT_DOUBLE_Y(0) ; ! 78: } ! 79: #else ! 80: /* Plot in 'wrong-order', as ebx is 68000 endian */ ! 81: if(!bScrDoubleY) /* Double on Y? */ ! 82: { ! 83: MED_BUILD_PIXELS_0 ; /* Generate 'ecx' as pixels [4,5,6,7] */ ! 84: PLOT_MED_640_8BIT(1) ; ! 85: MED_BUILD_PIXELS_1 ; /* Generate 'ecx' as pixels [12,13,14,15] */ ! 86: PLOT_MED_640_8BIT(3) ; ! 87: MED_BUILD_PIXELS_2 ; /* Generate 'ecx' as pixels [0,1,2,3] */ ! 88: PLOT_MED_640_8BIT(0) ; ! 89: MED_BUILD_PIXELS_3 ; /* Generate 'ecx' as pixels [8,9,10,11] */ ! 90: PLOT_MED_640_8BIT(2) ; ! 91: } ! 92: else ! 93: { ! 94: MED_BUILD_PIXELS_0 ; /* Generate 'ecx' as pixels [4,5,6,7] */ ! 95: PLOT_MED_640_8BIT_DOUBLE_Y(1) ; ! 96: MED_BUILD_PIXELS_1 ; /* Generate 'ecx' as pixels [12,13,14,15] */ ! 97: PLOT_MED_640_8BIT_DOUBLE_Y(3) ; ! 98: MED_BUILD_PIXELS_2 ; /* Generate 'ecx' as pixels [0,1,2,3] */ ! 99: PLOT_MED_640_8BIT_DOUBLE_Y(0) ; ! 100: MED_BUILD_PIXELS_3 ; /* Generate 'ecx' as pixels [8,9,10,11] */ ! 101: PLOT_MED_640_8BIT_DOUBLE_Y(2) ; ! 102: } ! 103: #endif ! 104: } ! 105: ! 106: esi += 4; /* Next PC pixels */ ! 107: edi += 1; /* Next ST pixels */ ! 108: ebp += 1; /* Next ST copy pixels */ ! 109: 1.1 root 110: } 1.1.1.2 ! root 111: while(--ScrX); /* Loop on X */ 1.1 root 112: } 1.1.1.2 ! root 113:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.