Closed visual-trials closed 10 months ago
HW testing results:
Below are the photos videos of these tests:
https://github.com/X16Community/vera-module/assets/17767704/a413d88f-093c-4553-91fd-a77674357c19
https://github.com/X16Community/vera-module/assets/17767704/dca9fa3a-5c25-45cd-b591-c4812b8839f5
https://github.com/X16Community/vera-module/assets/17767704/c726ebea-44d2-4aeb-a32b-d39a60bbe4c3
https://github.com/X16Community/vera-module/assets/17767704/6d74ca2c-526b-48e7-b2a9-539a0eefddae
There is a bug in the layer renderer that makes 8-pixel-wide 2bpp tiles dissapear when trying to horizontally flip it.
As it turns out this is an old bug that has been in there since the beginning.
The bug has been reproduced on real hardware (for 0.3.1 and for 0.3.2): The hflipped arrows are not visible. When run on the emulator it looks like this (which is correct):
When looking at the verilog it became clear that the value for hflipped_xcnt was incorrect in the case of 2bpp 8-pixel-wide tiles: when flipped the value of xcnt_r was negated which resulted in hflipped_xcnt becoming >= 8. This is problematic since render_data_r[31:16] were zeroes (in this specific case).
The solution was to create a 2bpp-specific value for hflipped_xcnt named hflipped_xcnt_2bpp. This one makes sure that bit3 is set to 0 in this specific situation.
The result is a working 2bpp 8-pixel-wide hflip:
The LUT-cost is 9 LUTs.
This bitsteam still has to be tested more thouroughly. Most notably other layer modes/color depths.
Link to discord discussion:
https://discord.com/channels/547559626024157184/549247967945687071/1196902079189504050