--- hatari/src/convert/med640x32.c 2019/04/09 08:47:29 1.1.1.2 +++ hatari/src/convert/med640x32.c 2019/04/09 08:53:31 1.1.1.4 @@ -1,12 +1,40 @@ /* Hatari - med640x32.c - This file is distributed under the GNU Public License, version 2 or at your - option any later version. Read the file gpl.txt for details. + This file is distributed under the GNU General Public License, version 2 + or at your option any later version. Read the file gpl.txt for details. Screen Conversion, Medium Res to 640x32Bit */ +static void ConvertMediumRes_640x32Bit(void) +{ + Uint32 *edi, *ebp; + Uint32 *esi; + Uint32 eax; + int y; + + Convert_StartFrame(); /* Start frame, track palettes */ + + for (y = STScreenStartHorizLine; y < STScreenEndHorizLine; y++) + { + + eax = STScreenLineOffset[y] + STScreenLeftSkipBytes; /* Offset for this line + Amount to skip on left hand side */ + edi = (Uint32 *)((Uint8 *)pSTScreen + eax); /* ST format screen 4-plane 16 colors */ + ebp = (Uint32 *)((Uint8 *)pSTScreenCopy + eax); /* Previous ST format screen */ + esi = (Uint32 *)pPCScreenDest; /* PC format screen */ + + if (AdjustLinePaletteRemap(y) & 0x00030000) /* Change palette table */ + Line_ConvertMediumRes_640x32Bit(edi, ebp, esi, eax); + else + Line_ConvertLowRes_640x32Bit(edi, ebp, esi, eax); + + /* Offset to next line */ + pPCScreenDest = (((Uint8 *)pPCScreenDest) + PCScreenBytesPerLine * 2); + } +} + + static void Line_ConvertMediumRes_640x32Bit(Uint32 *edi, Uint32 *ebp, Uint32 *esi, Uint32 eax) { Uint32 ebx, ecx; @@ -32,24 +60,24 @@ static void Line_ConvertMediumRes_640x32 /* Plot in 'right-order' on big endian systems */ if (!bScrDoubleY) /* Double on Y? */ { - MED_BUILD_PIXELS_0 ; /* Generate 'ecx' as pixels [4,5,6,7] */ + MED_BUILD_PIXELS_0 ; /* Generate 'ecx' as pixels [12,13,14,15] */ PLOT_MED_640_32BIT(12) ; - MED_BUILD_PIXELS_1 ; /* Generate 'ecx' as pixels [12,13,14,15] */ + MED_BUILD_PIXELS_1 ; /* Generate 'ecx' as pixels [4,5,6,7] */ PLOT_MED_640_32BIT(4) ; - MED_BUILD_PIXELS_2 ; /* Generate 'ecx' as pixels [0,1,2,3] */ + MED_BUILD_PIXELS_2 ; /* Generate 'ecx' as pixels [8,9,10,11] */ PLOT_MED_640_32BIT(8) ; - MED_BUILD_PIXELS_3 ; /* Generate 'ecx' as pixels [8,9,10,11] */ + MED_BUILD_PIXELS_3 ; /* Generate 'ecx' as pixels [0,1,2,3] */ PLOT_MED_640_32BIT(0) ; } else { - MED_BUILD_PIXELS_0 ; /* Generate 'ecx' as pixels [4,5,6,7] */ + MED_BUILD_PIXELS_0 ; /* Generate 'ecx' as pixels [12,13,14,15] */ PLOT_MED_640_32BIT_DOUBLE_Y(12) ; - MED_BUILD_PIXELS_1 ; /* Generate 'ecx' as pixels [12,13,14,15] */ + MED_BUILD_PIXELS_1 ; /* Generate 'ecx' as pixels [4,5,6,7] */ PLOT_MED_640_32BIT_DOUBLE_Y(4) ; - MED_BUILD_PIXELS_2 ; /* Generate 'ecx' as pixels [0,1,2,3] */ + MED_BUILD_PIXELS_2 ; /* Generate 'ecx' as pixels [8,9,10,11] */ PLOT_MED_640_32BIT_DOUBLE_Y(8) ; - MED_BUILD_PIXELS_3 ; /* Generate 'ecx' as pixels [8,9,10,11] */ + MED_BUILD_PIXELS_3 ; /* Generate 'ecx' as pixels [0,1,2,3] */ PLOT_MED_640_32BIT_DOUBLE_Y(0) ; } #else @@ -86,31 +114,3 @@ static void Line_ConvertMediumRes_640x32 while (--x); /* Loop on X */ } - - -static void ConvertMediumRes_640x32Bit(void) -{ - Uint32 *edi, *ebp; - Uint32 *esi; - Uint32 eax; - int y; - - Convert_StartFrame(); /* Start frame, track palettes */ - - for (y = STScreenStartHorizLine; y < STScreenEndHorizLine; y++) - { - - eax = STScreenLineOffset[y] + STScreenLeftSkipBytes; /* Offset for this line + Amount to skip on left hand side */ - edi = (Uint32 *)((Uint8 *)pSTScreen + eax); /* ST format screen 4-plane 16 colors */ - ebp = (Uint32 *)((Uint8 *)pSTScreenCopy + eax); /* Previous ST format screen */ - esi = (Uint32 *)pPCScreenDest; /* PC format screen */ - - if (AdjustLinePaletteRemap(y) & 0x00030000) /* Change palette table */ - Line_ConvertMediumRes_640x32Bit(edi, ebp, esi, eax); - else - Line_ConvertLowRes_640x32Bit(edi, ebp, esi, eax); - - /* Offset to next line */ - pPCScreenDest = (((Uint8 *)pPCScreenDest) + PCScreenBytesPerLine * 2); - } -}