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
208 stars 32 forks source link

MEGA65: no horizontal tiling mode ($D04D) for non-NCM sprites #322

Closed lgblgblgb closed 2 years ago

lgblgblgb commented 2 years ago

The problem:

According to Discord (from Geehaf): https://discord.com/channels/719326990221574164/782757495180361778/939498681936257025

"The video (taken from Nexys A7 with my phone hence the quality) shows a single 24x21 black sprite being displayed, then its height being set to 200 pixels ($d055/$d056), followed by enabling tile mode ($d04d) to cover the entire screen. The sprite's x position is then updated ($d000) to reveal the screen behind - all done using only 1 sprite"

However Xemu seems to miss the horizontal sprite "extension". Test program: sprite_horizontal_tiling.zip. Two videos from Geehaf are included in this post for reference.

Interestingly, Shallan's test suite includes test program for checking horizontal tiling and it seems to work just fine in Xemu! So I suppose the problem can be the combination of features used here? Maybe ...

Solution:

Horizontal tiling in fact is implemented only for NCM sprite renderer, not for mono and MCM sprites ... I'm adding it now. Thanks to Geehaf, who tested that and found that it works nicely, but only for NCM sprites.

MEGA65 video:

https://user-images.githubusercontent.com/884916/152643727-c0ce15f3-6685-4a93-b07c-97976220e44b.mp4

Xemu video:

https://user-images.githubusercontent.com/884916/152643730-8470cd81-8b66-44aa-b76b-3b681cbb2347.mp4

lgblgblgb commented 2 years ago

I have the proposed fix now, not yet committed, I need to test, and also next branch is a bit chaotic now, I need to make some order there (even half-finished stuff not yet pushed but locally committed, etc ...) to be able to put this fix as well.