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