{"id":88,"date":"2012-05-26T09:28:16","date_gmt":"2012-05-26T09:28:16","guid":{"rendered":"http:\/\/retroramblings.net\/?p=88"},"modified":"2012-05-26T09:48:50","modified_gmt":"2012-05-26T09:48:50","slug":"experimenting-with-tg68-3","status":"publish","type":"post","link":"https:\/\/retroramblings.net\/?p=88","title":{"rendered":"Experimenting with TG68"},"content":{"rendered":"<p><strong>Part 3 &#8211; Writing to the framebuffer<\/strong><\/p>\n<p>The previous instalment of this project saw a working VGA framebuffer being filled by an automated hardware process.\u00a0 Since then I&#8217;ve managed to get the TG68 processor running a program from a blockram-based ROM, and writing to the DE1 board&#8217;s SDRAM.<\/p>\n<p><a href=\"http:\/\/retroramblings.net\/wp-content\/uploads\/2012\/05\/framebuffer2.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-89\" title=\"framebuffer2\" src=\"http:\/\/retroramblings.net\/wp-content\/uploads\/2012\/05\/framebuffer2.jpg\" alt=\"The framebuffer being filled by the TG68.\" width=\"643\" height=\"500\" srcset=\"https:\/\/retroramblings.net\/wp-content\/uploads\/2012\/05\/framebuffer2.jpg 643w, https:\/\/retroramblings.net\/wp-content\/uploads\/2012\/05\/framebuffer2-300x233.jpg 300w, https:\/\/retroramblings.net\/wp-content\/uploads\/2012\/05\/framebuffer2-385x300.jpg 385w\" sizes=\"auto, (max-width: 643px) 100vw, 643px\" \/><\/a><\/p>\n<p>The memory map for the TG68 looks something like this:<\/p>\n<ul>\n<li>$000000: ROM (at the moment the ROM code just runs sequentially from $000008.\u00a0 Will eventually need to put an interrupt table in place and move the code elsewhere.)<\/li>\n<li>$0FFFFA: A couple of variables<\/li>\n<li>$100000: The frambuffer<\/li>\n<li>$7FFFFE: The initial stack pointer<\/li>\n<\/ul>\n<p>For the ROM I use an M4K blockram, with initial contents specified with an MIF file.\u00a0 To create the MIF I first assemble the code with <a href=\"http:\/\/www.easy68k.com\/\" target=\"_blank\">Easy68K<\/a>, then convert the S-Record file it produces to MIF format using <a href=\"http:\/\/srecord.sourceforge.net\/\" target=\"_blank\">srec_cat<\/a>, like so:<\/p>\n<pre>srec_cat in.S68 -o out.mif -mif 16<\/pre>\n<p>The ROM program currently backfills the screen, then draws random rectangles in an incrementing colour.\u00a0 The display is Hi-Colour (5-6-5) bit, which is dithered to fit the DE1&#8217;s 4-bit-per-gun output.<\/p>\n<p>The complete project, for anyone who&#8217;s interested, <a href=\"http:\/\/retroramblings.net\/downloads\/DE1_TG68Test_Part3_VGA2.zip\">can be found here<\/a>.<\/p>\n<p>Currently the fill-rate is pretty lousy since only a single 16-bit word can be written per slot.\u00a0 I need to add a writethrough cache of some kind, preferably one capable of merging successive writes to a single burst.<\/p>\n<p>Possible future plans for the project include:<\/p>\n<ul>\n<li>CPU cache &#8211; separate instruction and data.\u00a0 Just one burst (64 bit) initially.<\/li>\n<li>Writeback cache &#8211; to allow (a) the CPU to continue working while a write is in progress, and (b) to gang sequential writes into a single burst write.<br \/>\nSprite controller &#8211; just one sprite for mouse pointer.<\/li>\n<li>Multiple screenmodes.\n<ul>\n<li>\u00a08bit<\/li>\n<li>\u00a0lowres<\/li>\n<li>\u00a0scandoubled?<\/li>\n<li>\u00a0PAL?<\/li>\n<\/ul>\n<\/li>\n<li>Sprite controller.\u00a0 Just one sprite, for a mouse pointer.<\/li>\n<li>A colourtable for indexed modes<\/li>\n<li>VBlank interrupt<\/li>\n<li>Interrupts in general<\/li>\n<li>SD card interface<\/li>\n<li>PS\/2 controller<\/li>\n<li>Hardware registers for framebuffer address, sprite position, PS2 data, etc.<\/li>\n<li>Sound<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Part 3 &#8211; Writing to the framebuffer The previous instalment of this project saw a working VGA framebuffer being filled by an automated hardware process.\u00a0 Since then I&#8217;ve managed to get the TG68 processor running a program from a blockram-based &hellip; <a href=\"https:\/\/retroramblings.net\/?p=88\">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,1],"tags":[],"class_list":["post-88","post","type-post","status-publish","format-standard","hentry","category-fpga","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/posts\/88","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/retroramblings.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=88"}],"version-history":[{"count":6,"href":"https:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/posts\/88\/revisions"}],"predecessor-version":[{"id":94,"href":"https:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/posts\/88\/revisions\/94"}],"wp:attachment":[{"href":"https:\/\/retroramblings.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=88"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/retroramblings.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=88"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/retroramblings.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=88"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}