{"id":1382,"date":"2020-03-06T20:45:04","date_gmt":"2020-03-06T20:45:04","guid":{"rendered":"http:\/\/retroramblings.net\/?p=1382"},"modified":"2020-03-07T23:48:06","modified_gmt":"2020-03-07T23:48:06","slug":"a-minimal-osd-component","status":"publish","type":"post","link":"http:\/\/retroramblings.net\/?p=1382","title":{"rendered":"A minimal OSD component"},"content":{"rendered":"\n<p><strong>Porting an arcade core to the Turbo Chameleon 64 \u2013 Part 2 \u2013 2020-03-06<\/strong><\/p>\n\n\n\n<p>For the Chameleon64 port of Rampage I needed some way of showing an On-Screen Display.  While the core doesn&#8217;t have many options to worry about, I did want to be able to display a &#8220;Loading&#8221; message and an &#8220;Error&#8221; message if loading the ROM failed.<\/p>\n\n\n\n<p>There are several different ways we could approach this, but as you&#8217;ll recall from part 1, we&#8217;re very short of block RAM for this project, so minimising block RAM usage will be my priority.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>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&#8217;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&#8217;t eat into the M9K budget &#8211; but if we use this method for the Rampage port we have to find space for the font somewhere.  Unless we&#8217;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.<\/p>\n\n\n\n<p>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 &#8211; so we end up using 3 M9Ks for this style of OSD.<\/p>\n\n\n\n<p>My first thought was that I don&#8217;t need the OSD for this project to be very large on screen &#8211; I only really need a few characters, so I don&#8217;t need a large bitmapped display or text buffer &#8211; and if it&#8217;s small enough then implementing it as logic rather than RAM is feasable.<\/p>\n\n\n\n<p>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.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"192\" height=\"280\" src=\"http:\/\/retroramblings.net\/wp-content\/uploads\/2020\/03\/RampageOSD.jpg\" alt=\"\" class=\"wp-image-1383\"\/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Porting an arcade core to the Turbo Chameleon 64 \u2013 Part 2 \u2013 2020-03-06 For the Chameleon64 port of Rampage I needed some way of showing an On-Screen Display. While the core doesn&#8217;t have many options to worry about, I &hellip; <a href=\"http:\/\/retroramblings.net\/?p=1382\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,8],"tags":[],"class_list":["post-1382","post","type-post","status-publish","format-standard","hentry","category-fpga","category-hardware"],"_links":{"self":[{"href":"http:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/posts\/1382","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/retroramblings.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1382"}],"version-history":[{"count":3,"href":"http:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/posts\/1382\/revisions"}],"predecessor-version":[{"id":1387,"href":"http:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/posts\/1382\/revisions\/1387"}],"wp:attachment":[{"href":"http:\/\/retroramblings.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1382"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/retroramblings.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1382"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/retroramblings.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1382"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}