johanberntsson / ozmoo

A Z-machine interpreter for the Commodore 64 and similar computers
GNU General Public License v2.0
117 stars 19 forks source link

Improve handling of reverse video in buffered text output #14

Closed ZornsLemma closed 4 years ago

ZornsLemma commented 4 years ago

Hi,

I noticed that the "styled text" test in etude.z5 doesn't show reverse video, even though Ozmoo supports it. I've investigated and the problem seems to be that the reverse/normal video control codes get processed immediately but the intervening text is buffered, so we've reverted to normal video by the time the buffered text is output.

These changes add a parallel print_buffer2 (I'm assuming there is enough room at the bottom of the stack for this) and track the s_reverse status for buffered text in there. This will slow down buffered text processing a little bit, of course; I don't know if you think this is a problem or not.

I've attached a composite screenshot showing the results with and without this change; without on the left, with on the right.

Let me know if you have any questions, of course!

Cheers.

Steve ozmoo-reverse-video

johanberntsson commented 4 years ago

Good catch. Having reverse text is definitely an improvement, and the solution has the benefit of being simple to understand and maintain. We'll merge it. Thanks!

ZornsLemma commented 4 years ago

Great, thanks!