[hatari-devel] Hatari patches for bitplane conversion
Eero Tamminen
eerot at users.berlios.de
Wed Jul 22 22:23:22 CEST 2009
Hi,
On Wednesday 22 July 2009, Thomas Huth wrote:
> Ok, so we agree that the performance problems on Mac OS X are likely
> not caused by modern CPU caches, so let's stop this topic and focus on
> the real culprit (maybe Eero's LED fix already helps?).
Btw. It should be noted that with the way how current convertors work,
overlay LED will be always slower than the Statusbar. Statusbar needs to
do blitting only when something in the Statusbar itself changes, but the
overlay LED code needs to do save&restore for the area under LED on
each frame.
If we'd have line based updating:
* LED needs to be re-drawn only (if it's still ON and) if the lines on that
area changed + only that area (lines) need to be marked for blitting
(currently there's only boolean for whether whole screen needs blitting)
* The convertors could be instructed to re-convert the area under
LED after the LED is switched off. This could be done by setting
suitable lines in the ChangedLines array and convertors passing
the memcmp() check for those lines
This would make the overlay LED code both faster and simpler and
the convertors would then have a feature that user could toggle
in the Screen dialog:
- [X] update only changed lines
Implement that would be simple. Before calling the convertor:
---------
if (ConfigureParams.Screen.bUpdateOnlyChanged) {
/* do line change checks */
memset(ChangedLines, 0, sizeof(ChangedLines));
} else {
/* skip line change checks, update everything */
memset(ChangedLines, 1, sizeof(ChangedLines));
}
---------
And in convertor the code would look like this:
------------
if (!ChangedLines[line] &&
memcmp(stplanes, stplanes_copy, no_words) == 0)
{
/* checking for this line was requested,
* but there were no changes
*/
stplanes_copy += no_words;
stplanes += no_words;
continue;
}
/* line changed, convert it here and mark for blitting */
ChangedLines[line] = 1;
...conversion code...
------------
- Eero
More information about the hatari-devel
mailing list