--- hatari/src/convert/low320x16.c 2019/04/01 07:09:50 1.1.1.3 +++ hatari/src/convert/low320x16.c 2019/04/01 07:12:50 1.1.1.4 @@ -1,25 +1,25 @@ /* Screen Conversion, Low Res to 320x16Bit */ -void ConvertLowRes_320x16Bit(void) +static void ConvertLowRes_320x16Bit(void) { Uint32 *edi, *ebp; Uint16 *esi; Uint32 eax, edx; - register Uint32 ebx, ecx; + Uint32 ebx, ecx; + int y, x; Convert_StartFrame(); /* Start frame, track palettes */ - ScrY = STScreenStartHorizLine; /* Starting line in ST screen */ - do /* y-loop */ - { - eax = STScreenLineOffset[ScrY] + STScreenLeftSkipBytes; /* Offset for this line + Amount to skip on left hand side */ + 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 colours */ ebp = (Uint32 *)((Uint8 *)pSTScreenCopy + eax); /* Previous ST format screen */ esi = (Uint16 *)pPCScreenDest; /* PC format screen */ - AdjustLinePaletteRemap(); + AdjustLinePaletteRemap(y); - ScrX=STScreenWidthBytes>>3; /* Amount to draw across in 16-pixels(8 bytes) */ + x = STScreenWidthBytes>>3; /* Amount to draw across in 16-pixels(8 bytes) */ do /* x-loop */ { @@ -59,12 +59,9 @@ void ConvertLowRes_320x16Bit(void) edi += 2; /* Next ST pixels */ ebp += 2; /* Next ST copy pixels */ } - while( --ScrX ); /* Loop on X */ + while( --x ); /* Loop on X */ pPCScreenDest = (void *)(((Uint8 *)pPCScreenDest)+PCScreenBytesPerLine); /* Offset to next line */ - ScrY += 1; } - while( ScrY < STScreenEndHorizLine ); /* Loop on Y */ - }