BasiliskII-android icon indicating copy to clipboard operation
BasiliskII-android copied to clipboard

There is something wrong with tbe screen when emulated in monochrome 4 colors 16 colors and grayscale

Open PechayClub opened this issue 5 years ago • 1 comments

When i emulated a mac rom the screen is desorted

PechayClub avatar Jun 07 '20 07:06 PechayClub

To explain the problem a bit better, with < 8 bit video modes set on the mac (black & white, or 4 or 16 colours or grays), the screen is drawing corruptly, and in a way that makes it clear that individual rectangular updates are going to the screen at wrong positions that are not consistent.

What's happening is:

  • In the SDL video driver, for mac video modes with < 8-bit colour it configures SDL for 8-bit colour mode:

https://github.com/pelya/BasiliskII-android/blob/06a7bb327cea0de0265b98d16807ab679a2e6433/src/SDL/video_sdl.cpp#L442

  • Then upconverting of the lower res mac framebuffer to 8-bit for SDL is supposed to happen at blit time, but there is only logic for it present in the fast memory addressing modes case:

https://github.com/pelya/BasiliskII-android/blob/06a7bb327cea0de0265b98d16807ab679a2e6433/src/CrossPlatform/video_blit.cpp#L521

  • For the fallback "virtual" addressing mode, there is only old code that assumed that you have a framebuffer somewhere set for whatever you set the emulated mac for; it's just assuming that since UAE is taking care of all of the endianness issues on the way into and out of the emulated system the blit is just a straight copy

https://github.com/pelya/BasiliskII-android/blob/06a7bb327cea0de0265b98d16807ab679a2e6433/src/CrossPlatform/video_blit.cpp#L580

but obviously that's not leaving us with framebuffer contents suitable for the mode we set SDL to.

rakslice avatar Jan 15 '25 08:01 rakslice