lgblgblgb / xemu

Emulations (running on Linux/Unix/Windows/macOS, utilizing SDL2) of some - mainly - 8 bit machines, including the Commodore LCD, Commodore 65, and the MEGA65 as well.
https://github.com/lgblgblgb/xemu/wiki
GNU General Public License v2.0
207 stars 32 forks source link

MEGA65/SEAM: trim & flip char horizontally combined #373

Open ghost opened 1 year ago

ghost commented 1 year ago

With my game project I use the trim as well as the flip function combined for NCM chars. As it turns out, pixel columns are cut on the wrong side in this case. Check out how it compares to hardware, TEST PRG ATTACHED below.

In order to display only the 'right' pixel data of an NCM char, I cut off half (colour ram byte 0, bit 2) and flip it horizontally (colour ram byte 0, bit 6). Provided you store the gfx to the right of the char 'pre-flipped' it will display as desired. Useful if you want to make the best use of 8x8 pixel gfx in NCM format and memory. Because the otherwise wasted memory for the right side of the NCM char is thus made usable.

During research I came across a few things:

I'm all about trimming on the correct side when horizontally flipped regarding NCM chars, realizing this issue is difficult to manage but would be great to get rid of.

Xemu version: Xemu/MEGA65 20230216142236 (next) ROM version: 920377

Attachment:
TRIMFLIP.zip

lgblgblgb commented 1 year ago

If I understand correctly, the problem here, that "trimming" and "flip" may happen in different order (as we can say here, loosely speaking) in Xemu than on a real hardware then.

ghost commented 1 year ago

See it that way too. I think I can remember, in my example, a GotoX is set after each char, that prevents trimming in some cases, whether flipped or not.

ghost commented 1 year ago

And trimming FCM/Mono chars in general uses only a 3-bit value on the hardware. Thus the char does not disappear completely.