sehugg / dithertron

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

Added Vic 20 cell based export support #21

Closed robin-raymond closed 1 year ago

robin-raymond commented 1 year ago

The Vic 20 does not have a dedicated bitmap mode. However, due to its screen resolution, it's possible to remap the character map allowing for a pseudo bitmap from screen characters. Effectively the C64 does this same model too internally, although it has dedicated text vs screen modes to make this process more explicit as a bitmap mode.

The Vic 20 has two graphics mode capabilities, hires and multi. In hires mode the Vic 20 can choose a character cell color or the common background color from a restricted palette. In multi 10-color mode the Vic 20 can choose the background, border, aux common colors or from a character cell block color.

The code changes were made to accommodate the Vic 20:

The export Vic routine further abstracts by providing helper routines to convert the param into screen data (i.e. put the nybbles into the correct screen position), handle FLI (including the possibility of future Vic FLI), and allowing the specialization of extra data on each platform while keeping the logic entirely common across the platforms.

A helper routine was added to map integer value pixel patterns onto an array buffer in a generic fashion.

The other target systems that are cell based could use this new routine too but I did not update them as they work and messing with them without having unit tests sounds a bit dangerous.

robin-raymond commented 1 year ago

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

robin-raymond commented 1 year ago

FYI - I am reworking this a bit so it can also handle Zx spectrum.