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