pelya/BasiliskII-android

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

Opened this issue · 1 comments

When i emulated a mac rom the screen is desorted

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:

return (video_depth <= VIDEO_DEPTH_8BIT) ? 8 : mac_depth_of_video_depth(video_depth);

  • 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:

// 1/2/4/8-bit mode on 8/16/32-bit screen?

  • 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

// The UAE memory handlers will blit correctly

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