sehugg / dithertron

Retro 8-bit bitmap converter supporting many formats
GNU General Public License v3.0
75 stars 11 forks source link

Added code to handle VIC FLI properly #17

Closed robin-raymond closed 1 year ago

robin-raymond commented 1 year ago

Added code to handle VIC FLI properly

Related to: https://github.com/sehugg/dithertron/issues/10

In FLI mode the raster cycle accuracy has to be exact to the raster beam position aligned with the clock cycle. This is a complex procedure using a double IRQ.

Even when done correctly, FLI isn't perfect as the left side of the screen lacks proper coloring for 24 pixels. This is known as the 'FLI bug" and it's present in both multi-color mode and hires mode. Without accurate clock cycles that FLI bug error on the left side increases (until nothing gets displayed at all).

In FLI mode, the only color choices available for the left side of the screen for multi-color mode is: background, light grey or orange (yuck). In hires mode, it's light grey and that's it.

The solution is to either ignore the bug and use a patched emulator which doesn't have the FLI bug (even though real C64 hardware has the bug), work with those awful colors and accept a glitched left side, or blank the left (and optionally the left and right). That's why so many choices exist for FLI modes since what is the right option is picture/usage dependent.

Other changes made:

robin-raymond commented 1 year ago

FYI - This is a branch adds to the https://github.com/sehugg/dithertron/pull/14 branch.

sehugg commented 1 year ago

Wow, this is really something! I'll take a closer look this weekend and merge. Thanks!

sehugg commented 1 year ago

Looks great! Very thoroughly commented code. I like having all the different variants, and it's clever how you model the grey border in the dither algorithm! I'll think of a way to present these in a submenu, there are other systems that have multiple variants that could benefit too. Thanks!

robin-raymond commented 1 year ago

Thank you! Glad you like the changes! I definitely wanted a way for the user to see what they were getting with FLI before they got a puzzling surprise running the code (that surprise led me down this rabbit hole of changes). Plus it has a nice side effect of maximizing what can be obtained from the "bad line" area (which works better or worse depending on the image).

I'm not much on the UI tech so I don't think I could help in that area otherwise I'd help out.