A minimal OSD component

Porting an arcade core to the Turbo Chameleon 64 – Part 2 – 2020-03-06

For the Chameleon64 port of Rampage I needed some way of showing an On-Screen Display. While the core doesn’t have many options to worry about, I did want to be able to display a “Loading” message and an “Error” message if loading the ROM failed.

There are several different ways we could approach this, but as you’ll recall from part 1, we’re very short of block RAM for this project, so minimising block RAM usage will be my priority.

The classic Minimig design and other projects which evolved from it such as MiST use a bitmapped on-screen display. The OSD module used by MiST takes a couple of hundred logic elements and 2 M9Ks for 16384 bits of bitmapped display RAM. A font of sorts is required, but will be stored in the program ROM of whatever’s supplying the OSD data. On the MiST this is an external microcontroller, not anything running on the FPGA, so the space taken up by the font doesn’t eat into the M9K budget – but if we use this method for the Rampage port we have to find space for the font somewhere. Unless we’re going to bootstrap a larger control program into SDRAM, and add extra read/write ports to the SDRAM controller, this effectively means we use an extra M9K for the font.

My previous control module which I used for the PC-Engine, MSX and Megadrive cores uses a character-based display, in which the OSD module itself contains a font (requiring 1 M9K of block RAM) and a text buffer. On Cyclone III the text buffer seems to be implemented as a pair of M9Ks, even though it would comfortably fit within one – so we end up using 3 M9Ks for this style of OSD.

My first thought was that I don’t need the OSD for this project to be very large on screen – I only really need a few characters, so I don’t need a large bitmapped display or text buffer – and if it’s small enough then implementing it as logic rather than RAM is feasable.

This leaves the problem of the font. I fired up GIMP and started pixel-painting some messages to see just how small they could be made while remaining readable, and soon realised that I could do everything I needed to do for Rampage within a 24-pixel by 5-pixel box. Stacking the various messages vertically, I was then able to save in .xbm format and produce a C source file to be included in the firmware of the project. The OSD thus takes around 250 logic elements, and adds 105 bytes of bitmapped graphics data to the firmware.

Leave a Reply

Your email address will not be published. Required fields are marked *