{"id":905,"date":"2014-08-25T15:54:20","date_gmt":"2014-08-25T15:54:20","guid":{"rendered":"http:\/\/retroramblings.net\/?p=905"},"modified":"2014-08-25T15:54:20","modified_gmt":"2014-08-25T15:54:20","slug":"onechipmsx-in-chameleons-clothing-2","status":"publish","type":"post","link":"http:\/\/retroramblings.net\/?p=905","title":{"rendered":"OneChipMSX in Chameleon&#8217;s Clothing?"},"content":{"rendered":"<p><strong>Part 2: the first milestone.<\/strong><\/p>\n<p>Today I have successfully booted OneChipMSX on the Turbo Chameleon 64!<\/p>\n<p><a href=\"http:\/\/retroramblings.net\/wp-content\/uploads\/2014\/08\/OCMSX.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-908\" alt=\"OCMSX\" src=\"http:\/\/retroramblings.net\/wp-content\/uploads\/2014\/08\/OCMSX.jpg\" width=\"621\" height=\"500\" srcset=\"http:\/\/retroramblings.net\/wp-content\/uploads\/2014\/08\/OCMSX.jpg 621w, http:\/\/retroramblings.net\/wp-content\/uploads\/2014\/08\/OCMSX-300x241.jpg 300w, http:\/\/retroramblings.net\/wp-content\/uploads\/2014\/08\/OCMSX-372x300.jpg 372w\" sizes=\"auto, (max-width: 621px) 100vw, 621px\" \/><\/a><\/p>\n<p><!--more-->To do this I&#8217;ve had to make some changes to the OneChipMSX source tree, and while I&#8217;d hoped that I&#8217;d be able to keep the main core pretty much untouched, and do the Chameleon-specific stuff externally, it hasn&#8217;t quite worked out that way.<\/p>\n<p>The first problem I encountered was that the Chameleon has no EPCS4 configuration device, so I would need to load the BIOS from somewhere else.\u00a0 My choices were the Chameleon&#8217;s own flash, or SD card.\u00a0 The former option might seem like the most sensible choice at a quick glance, but it&#8217;s actually quite complicated, since the Chameleon has flash space for a number of different cores, so the BIOS&#8217;s location within flash would depend upon which flash slot contained the core!\u00a0 I thus chose loading from SD card, added an extra control CPU and simplified the Initial Program Loader.<\/p>\n<p>The next problem was that the OneChipMSX clocks the SD card a little too fast for the Chameleon.\u00a0 Unlike most other SD-equipped FPGA boards, some of the SD card signals are routed through a CPLD inside the Chameleon which multiplexes a number of signals.\u00a0 This CPLD is responsible for accessing the C64 when the chameleon is in cartridge mode, so there&#8217;s a limit to how promptly SPI signals are forwarded to the SD card.\u00a0 Halving the OCMSX&#8217;s SPI clock speed seems to have done the trick (which is good because I haven&#8217;t yet figured out how to stall the T80 on SPI writes, so making the SPI clock slower still is currently not an option!)<\/p>\n<p>Finally, the PS\/2 keyboard posed a problem.\u00a0 The OCMSX source tree forwards bidirectional PS\/2 clock and data signals into the heart of the core.\u00a0 This is in contrast to most other projects, which generally have separate in and out signals for clock and data, and merge them into their respective bidirectional signals in the toplevel.\u00a0 The Chameleon64, again, routes these signals through the MUX in a way that requires in and out signals to be separate in the toplevel, so I had to adjust the innermost PS\/2 component and main MSX core accordingly.<\/p>\n<p>With these changes, however, the core boots and works on both DE1 and Chameleon64 (though the cartridge slot signals that Caro&#8217;s DE1 port forwards to the GPIO headers on the DE1 are temporarily disabled.)<\/p>\n<p>The BIOS is loaded from SD card rather than EPCS, which means you can upload the core on the fly via JTAG and it will work.\u00a0 You need an SD card (not SDHC) which needs to be FAT16 formatted, and which needs to contain <a href=\"http:\/\/www.caro.su\/msx\/ocm_de1.htm\">the MSX2 bios from this page<\/a>.<\/p>\n<p>If you&#8217;re content to just play around in BASIC that should be all you need &#8211; otherwise you&#8217;ll want to add MSXDOS to the card &#8211; I&#8217;m told that <a href=\"http:\/\/www.konamiman.com\/msx\/msx-e.html#nextor\">Nextor<\/a> can be used for this purpose, but haven&#8217;t yet had a chance to try it.<\/p>\n<p>Full <a href=\"https:\/\/github.com\/robinsonb5\/OneChipMSX\">source is on GitHub<\/a> (surprise, surprise!) while a binary .rbf file for the Chameleon can be found here: <a href=\"http:\/\/retroramblings.net\/downloads\/ChameleonOCMSX-20140825.zip\">ChameleonOCMSX-20140825.zip.<\/a> The repo is tagged at the appropriate point, too.<\/p>\n<p>Please note, this is still very much experimental, and there&#8217;s a long way to go yet before it can be considered usable.\u00a0 Feel free to tinker with it, but don&#8217;t expect a fully-working, polished product!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Part 2: the first milestone. Today I have successfully booted OneChipMSX on the Turbo Chameleon 64!<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-905","post","type-post","status-publish","format-standard","hentry","category-fpga"],"_links":{"self":[{"href":"http:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/posts\/905","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=905"}],"version-history":[{"count":4,"href":"http:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/posts\/905\/revisions"}],"predecessor-version":[{"id":910,"href":"http:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/posts\/905\/revisions\/910"}],"wp:attachment":[{"href":"http:\/\/retroramblings.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=905"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/retroramblings.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=905"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/retroramblings.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=905"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}