[hatari-devel] Hatari patches for bitplane conversion

Eero Tamminen eerot at users.berlios.de
Thu Jul 23 21:18:28 CEST 2009


Hi,

On Wednesday 22 July 2009, Eero Tamminen wrote:
> - [X] update only changed lines
>
> Implement that would be simple. Before calling the convertor:
> ---------
> 	if (ConfigureParams.Screen.bUpdateOnlyChanged) {

I could add this option and the logic later on (maybe with some help from
Thomas on modifying the GUI) if the convertors support ChangeLines stuff.

...
> And in convertor the code would look like this:
...

And of course when ConfigureParams.Screen.bUpdateOnlyChanged is set, only
the lines that were actually modified need to be copied to the the ST screen
copy.  And when this option isn't set i.e. screen is always completely
converted, there's no need for the ST screen copy and updating that can be
skipped completely...
-----------
	/* ChangeLines setup... */
	...
	/* screen convertor called... */
	...
	/* convert & blit always the whole screen? */
	if (!ConfigureParams.Screen.bUpdateOnlyChanged) {
		Screen_BlitWholeScreen();
		return;
	}
	/* no, update only changed lines */
	line = 0;
	while (line < MAX_SCREEN_LINES) {
		while (!ChangedLines[line] && line < MAX_SCREEN_LINES) {
			line++;
		}
		startline = line;
		while (ChangedLines[line] && line < MAX_SCREEN_LINES) {
			line++;
		}
		if (line > startline) {
			/* blit changed lines and make copy of ST screen contents */
			Screen_BlitLinesBetween(startline, line);
			memcpy(&(pSTScreenCopy[startline]),
			             &(pSTScreen[startline]),
				(line-startline)*SCREEN_LINE_BYTES);
		}
	}
-----------

(when the option is changed back to updates only, an initial copy of
the screen contents of course needs to be done before convertors are
called.)


	- Eero



More information about the hatari-devel mailing list