<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:series="https://publishpress.com/"
	>

<channel>
	<title>Emulation Archives - Krystof.IO</title>
	<atom:link href="https://krystof.io/tags/emulation/feed/" rel="self" type="application/rss+xml" />
	<link>https://krystof.io/tags/emulation/</link>
	<description>Numerous hobbies, various ramblings.</description>
	<lastBuildDate>Mon, 29 May 2023 20:37:10 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.2.9</generator>

<image>
	<url>https://krystof.io/wp-content/uploads/2019/10/cropped-site-icon-low-32x32.jpg</url>
	<title>Emulation Archives - Krystof.IO</title>
	<link>https://krystof.io/tags/emulation/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>MiSTer FPGA Initial Setup and Network Mounting</title>
		<link>https://krystof.io/mister-fpga-initial-setup-and-network-mounting/</link>
					<comments>https://krystof.io/mister-fpga-initial-setup-and-network-mounting/#respond</comments>
		
		<dc:creator><![CDATA[Eric R. Krystof]]></dc:creator>
		<pubDate>Sat, 08 Apr 2023 02:24:56 +0000</pubDate>
				<category><![CDATA[Retro Gaming]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Emulation]]></category>
		<category><![CDATA[Build Log]]></category>
		<category><![CDATA[fpga]]></category>
		<guid isPermaLink="false">https://krystof.io/?p=2216</guid>

					<description><![CDATA[<p>Gathering a bunch of parts and building a MiSTer FPGA kit and case and performing some initial setup and network share mounting.</p>
<p>The post <a rel="nofollow" href="https://krystof.io/mister-fpga-initial-setup-and-network-mounting/">MiSTer FPGA Initial Setup and Network Mounting</a> appeared first on <a rel="nofollow" href="https://krystof.io">Krystof.IO</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading" id="h-what-is-mister-fpga">What is MiSTer FPGA?</h2>



<p>I like to think of MiSTer FPGA as <em>hardware emulation</em> vs the <em>software emulation</em> I&#8217;m used to.  The MiSTer suite of cores and utilities are designed to be installed on the Terasic DE10-Nano FPGA board, and various add on boards to support more USB components or video/audio output.  MiSTer FPGA is a project that coordinates different &#8216;cores&#8217; (e.g. old computer systems or game consoles) and applies them to the FPGA board, effectively instructing the FPGA board to act as the chipsets of these old retro computer and console systems. </p>



<p><em>FPGA</em> itself stands for &#8216;Field Programmable Gate Array&#8217;.   It is a type of integrated circuit that can be programmed by the user to perform specific functions.  So think of it like a blank slate chip that you can program to act as another chip.  That&#8217;s how we do the hardware emulation.  Since this reprogramming of the chip can happen without having to manufacture a new chip, we can use the term &#8216;Field Programmable&#8217; &#8211; you can reprogram it <em>in the field</em>, outside of a chip manufacturing plant.</p>



<h2 class="wp-block-heading">Why MiSTer FPGA?</h2>



<p>I wanted to try MiSTer FPGA because I&#8217;ve never messed with <em>hardware</em> emulation.  It&#8217;s always been on the real deal or with software emulation (like DOSBOX or VICE).  My understanding is that lag is nearly non-existent when compared to emulators, and the &#8216;cores&#8217; (the systems we&#8217;re emulating) run more true to the original hardware than their software emulating counterparts.  Want to know some of the cores directly supported?  Check out the <a href="https://github.com/MiSTer-devel/Wiki_MiSTer/wiki/Cores" target="_blank" rel="noreferrer noopener">core list here</a>.</p>



<p>My motivation for doing this is because while I like to have genuine retro systems of the old systems I had as a child, I don&#8217;t care to try to own an Apple IIe, or an Atari ST.  I was a Commodore guy, so while I want to tinker with those systems, I definitely don&#8217;t want to hit up e-bay and start trying to build my own piece-by-piece setup for a system I never owned or had no vested interest in.  (See how I through that line in there?  I never owned a Commodore PET, but I wouldn&#8217;t turn a free one down)</p>



<p>The <a href="https://github.com/MiSTer-devel/Wiki_MiSTer/wiki" target="_blank" rel="noreferrer noopener">MiSTer Wiki</a> page has excellent information, tutorials, and references.</p>



<h2 class="wp-block-heading">The Parts List</h2>



<p>So from the hardware standpoint, we need at a minimum the Terasic DE10-Nano board.  This is the specific model of FPGA board that the open source MiSTer FPGA project software (Mr. Fusion) expects to be installed on, so it&#8217;s a must.  After that you have all sorts of add ons and adapters (adapters to even hook up old console specific adapters like light guns) to enhance your retro gaming experience.  I went with the following (links to where you could find them included &#8211; not necessarily the only place, but at least one place)</p>



<ul>
<li><a href="https://www.terasic.com.tw/cgi-bin/page/archive.pl?Language=English&amp;No=1046&amp;PartNo=8#order_list" target="_blank" rel="noreferrer noopener nofollow">Terasic DE10-Nano board</a> &#8211; The bare minimum as stated above.  I ordered mine from Terasic directly.</li>



<li><a href="https://misterfpga.co.uk/product/usb-hub-for-mister-fpga/" target="_blank" rel="noreferrer noopener nofollow">USB Hub V2.1 for MiSTer</a> &#8211; This gives us more USB ports to connect keyboards, mice, joysticks, etc. to the Terasic board.  It&#8217;s a powered HUB that is designed to mount underneath the Terasic.  It comes with a splitter power cable to split your power supply between the USB board and the Terasic <em>(but if you use the digital IO board you don&#8217;t use the splitter, see that part for more detail)</em></li>



<li><a href="https://misterfpga.co.uk/product/mister-sdram-128mb-module/" target="_blank" rel="noreferrer noopener nofollow">128MB SDRam Module</a> &#8211; Not required for all the cores, but it is required for enough of them that I wanted to mess with.  This slides into the top part of the Terasic board.  You can see the <a href="https://github.com/MiSTer-devel/Wiki_MiSTer/wiki/Cores-that-use-SDRAM" target="_blank" rel="noreferrer noopener">cores that require SDRam here</a>.</li>



<li><strong>I/O Boards:</strong> There are typically two I/O boards that people use for this.  I&#8217;m going to try both, but you only install one at a time.  Generally, for those that want to stream HDMI but play on a CRT, you&#8217;ll get the Analog board.  The Digital board offers some extra expansion capabilities, though.  Regardless of which one you get, <strong>this board sits on TOP of the Terasic, so when combined with the USB hub below, the Terasic is in the middle.</strong> Of note are the three switch buttons on top to easily access Reset, OSD (On screen display), and user defined functions.  Cases for these are also available, and assume you have the standard 3 board setup (USB board + Terasic board + IO Board)
<ul>
<li><a href="https://misterfpga.co.uk/product/mister-digital-io-board/?attribute_fan-type=Noctua+NF-A4x10" target="_blank" rel="noreferrer noopener nofollow">MiSTer Digital IO Board v1.2</a> &#8211; The MiSTer FPGA Digital IO Board v1.2 provides the following features: a dedicated power switch to turn the unit on and off with over-voltage protection, a 3.5mm audio jack for ADC In (Tape Input) a separate ADC-In addon board is not required, 3.5mm&nbsp;Mini-TOSLINK &amp; Digital TOSLINK Connectors, a secondary microSD card slot the functionality depends upon the core being used, a fan speed control jumper providing 3.3 volts or 5 volts, three status LEDs (red, yellow, green), three large push buttons providing system reset, on screen display menu and game reset, an expansion connector in the form of a USB 3.0 connector however this is not for standard USB devices. <strong>If you use this board, it comes with a cable so you power your entire setup through this board, power goes through the GPIO pins into the Terasic, and then you use the included barrel cable to go from the Terasic to the USB board.  So one power cable powers all three boards connected together.</strong>  <strong><a href="https://misterfpga.co.uk/product/mister-case-acrylic/?attribute_mister-case-colour=Neptune+Blue&amp;attribute_io-board-type=Digital+IO+v1.2" target="_blank" rel="noreferrer noopener">Acrylic Case Link</a></strong></li>



<li><a href="https://misterfpga.co.uk/product/mister-fpga-analog-io-board/?attribute_fan-type=Noctua+NF-A4x10" target="_blank" rel="noreferrer noopener nofollow">MiSTer Analog IO Board v6.1</a> &#8211; The MiSTer FPGA Analog IO board v6.1 includes the following useful features: a VGA (DB15) connector allowing for the output of a VGA/RGB/YPbPr signal depending on the cable being used, a 3.5mm audio jack with Mini-TOSLINK providing analog audio output and digital audio output, a secondary microSD card slot the functionality depends upon the core being used, a fan speed control providing a 3.3 volt / 5 volt selector jumper, a status LED control jumper allowing switching on or off the built in LEDs, a Sync-on-Green switch, three status LEDs (red, yellow, green), three large push buttons providing system reset, on screen display menu and game reset, an expansion connector in the form of a USB 3.0 connector however this is not for standard USB devices.  <strong><a href="https://misterfpga.co.uk/product/mister-case-acrylic/?attribute_mister-case-colour=Neptune+Blue&amp;attribute_io-board-type=Analog+IO+v5.5+%28Or+Newer%29" target="_blank" rel="noreferrer noopener">Acrylic Case Link</a></strong>
<ul>
<li>Configuration of the video output signal on the IO board is controlled via the MiSTer.ini file, more information on how to configure and download of the MiSTer.ini file see the <a href="https://github.com/MiSTer-devel/Wiki_MiSTer/wiki/Configuration-Files" target="_blank" rel="noreferrer noopener">https://github.com/MiSTer-devel/Wiki_MiSTer/wiki/Configuration-Files</a> configuration</li>
</ul>
</li>
</ul>
</li>



<li><strong>Wifi/Bluetooth USB Dongles</strong> &#8211; Generally, I think you can use whatever ones you may already have.  Terasic sells some from their site, I used some I already had.  They fit nicely into the USB board to give you connectivity as you desire.  Not every dongle dangles properly, so here are some recommended adapters for <a href="https://mister-devel.github.io/MkDocs_MiSTer/basics/wifi/" target="_blank" rel="noreferrer noopener nofollow">Wifi </a>and <a href="https://mister-devel.github.io/MkDocs_MiSTer/basics/bluetooth/" target="_blank" rel="noreferrer noopener nofollow">Bluetooth</a>.</li>
</ul>



<p>I also picked up some more &#8216;odd&#8217; add ons for this as well, more specific to my gaming taste:</p>



<ul>
<li><a href="https://ultimatemister.com/product/mister-snac-iec-c64/" target="_blank" rel="noreferrer noopener nofollow">MiSTer SNAC-IEC CBM 1541 Connector</a> &#8211; I believe with this I can hook up a real 1541 drive to the kit and use it with the C64 core. </li>



<li><a href="https://ultimatemister.com/product/ultimate-deamon-pro-dual-genesis/" target="_blank" rel="noreferrer noopener nofollow">Ultimate Dameon x2 Player MiSTer FPGA adapter</a> &#8211; The&nbsp;<strong>Ultimate Deamon PRO USB Dual Encoder</strong>&nbsp;for ATARI / SEGA MEGADRIVE / GENESIS.  This small form-factor USB adapter makes it possible to use SEGA MEGADRIVE / GENESIS controllers on your PC (Windows, Mac OS X, Linux), Raspberry Pi or MiSTer. The adapter has a&nbsp;<strong>native 1ms/1000Hz polling rate</strong>&nbsp;so input lag is minimal (the average is 0.75ms with a wired controller). Fully assembled in a Aluminium enclosure and includes&nbsp;<strong>USB-C cable</strong>&nbsp;to connect this adapter to your favorite&nbsp;setup.  (from <a href="https://ultimatemister.com/" target="_blank" rel="noreferrer noopener">ultimatemister.com</a>)</li>



<li><a href="https://misterfpga.co.uk/product/mister-real-time-clock-board-rtc/" target="_blank" rel="noreferrer noopener">MiSTer RTC Real Time Clock Board 1.4</a> &#8211; For cores that use a clock, mainly if your FPGA kit isn&#8217;t going to be internet connected for automatic time syncing, this one&#8217;s for you. I don&#8217;t believe you need this if you&#8217;ll have internet connectivity, though.</li>
</ul>



<h2 class="wp-block-heading" id="h-putting-the-parts-together">Putting the parts together</h2>



<p>While you don&#8217;t *need* a digital IO board or USB hub connected to your DE10-Nano, it sure makes things easier.  Our final configuration when this is setup will be the DE10-Nano sandwiched in between the USB hub board on the bottom, and the digital IO board on the top.  Wrap the acrylic case around it and we&#8217;re done.</p>



<h3 class="wp-block-heading">A note on orientation.</h3>



<p>When I say &#8216;top&#8217; or &#8216;right&#8217;, I&#8217;m orienting my Nano like the pictures on Terasic&#8217;s website.  The ethernet adapter is on the right side when the board is facing up:</p>


<div class="wp-block-image">
<figure class="aligncenter size-large is-resized"><img decoding="async" src="https://krystof.io/wp-content/uploads/2023/04/image-5-1024x779.png" alt="" class="wp-image-2231" width="512" height="390" srcset="https://krystof.io/wp-content/uploads/2023/04/image-5-1024x779.png 1024w, https://krystof.io/wp-content/uploads/2023/04/image-5-300x228.png 300w, https://krystof.io/wp-content/uploads/2023/04/image-5-768x585.png 768w, https://krystof.io/wp-content/uploads/2023/04/image-5-1170x891.png 1170w, https://krystof.io/wp-content/uploads/2023/04/image-5-585x445.png 585w, https://krystof.io/wp-content/uploads/2023/04/image-5-1320x1005.png 1320w, https://krystof.io/wp-content/uploads/2023/04/image-5.png 1390w" sizes="(max-width: 512px) 100vw, 512px" /></figure></div>


<h3 class="wp-block-heading">Heatsink</h3>



<p>Nothing wrong with that.  Picked mine up from <a href="https://misterfpga.co.uk/product/mister-fpga-ultimate-heatsink/" target="_blank" rel="noreferrer noopener nofollow">https://misterfpga.co.uk/product/mister-fpga-ultimate-heatsink/</a>, made to fit the Cyclone V SoC on the DE10-Nano board.</p>


<div class="wp-block-image">
<figure class="aligncenter size-medium"><img decoding="async" loading="lazy" width="300" height="208" src="https://krystof.io/wp-content/uploads/2023/04/image-300x208.png" alt="" class="wp-image-2224" srcset="https://krystof.io/wp-content/uploads/2023/04/image-300x208.png 300w, https://krystof.io/wp-content/uploads/2023/04/image-768x533.png 768w, https://krystof.io/wp-content/uploads/2023/04/image-585x406.png 585w, https://krystof.io/wp-content/uploads/2023/04/image.png 877w" sizes="(max-width: 300px) 100vw, 300px" /></figure></div>


<h3 class="wp-block-heading">USB HUB Board</h3>



<p>The USB Hub board sits below the DE10-Nano, and you&#8217;ll need to remove the standoffs from the Nano (I gently twisted with pliers, keep the screws for later but you&#8217;ll need to remove them) so that you can mount the USB board below it.  On the ethernet side of the Nano, on the very top right, there&#8217;s the USB-Micro style OTG (On The Go) port, which is how we connect the HUB to the Nano.  My board comes with a slick adapter that plugs into four pins of the USB board:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img decoding="async" loading="lazy" src="https://krystof.io/wp-content/uploads/2023/04/image-3.png" alt="" class="wp-image-2229" width="323" height="297" srcset="https://krystof.io/wp-content/uploads/2023/04/image-3.png 646w, https://krystof.io/wp-content/uploads/2023/04/image-3-300x275.png 300w, https://krystof.io/wp-content/uploads/2023/04/image-3-585x537.png 585w" sizes="(max-width: 323px) 100vw, 323px" /><figcaption class="wp-element-caption">The adapter that joins the USB board to the Nano. Top is for the Nano, bottom is for the USB board.</figcaption></figure></div>

<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img decoding="async" loading="lazy" src="https://krystof.io/wp-content/uploads/2023/04/image-1.png" alt="" class="wp-image-2226" width="278" height="280" srcset="https://krystof.io/wp-content/uploads/2023/04/image-1.png 370w, https://krystof.io/wp-content/uploads/2023/04/image-1-298x300.png 298w, https://krystof.io/wp-content/uploads/2023/04/image-1-150x150.png 150w" sizes="(max-width: 278px) 100vw, 278px" /><figcaption class="wp-element-caption">USB Board, Top right side &#8211; four pins where the adapter plugs into.</figcaption></figure></div>


<p>and then zig zags up and out to the plug into the Nano&#8217;s OTG port:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img decoding="async" loading="lazy" src="https://krystof.io/wp-content/uploads/2023/04/image-2.png" alt="" class="wp-image-2227" width="338" height="375" srcset="https://krystof.io/wp-content/uploads/2023/04/image-2.png 451w, https://krystof.io/wp-content/uploads/2023/04/image-2-271x300.png 271w" sizes="(max-width: 338px) 100vw, 338px" /></figure></div>


<p>So with the standoffs screwed into each other (leaving the top screws since we&#8217;ll be putting the digital board on top), we&#8217;re ready to continue.</p>



<h3 class="wp-block-heading">128MB SDRam Addon Board</h3>



<p>I next installed the ram board.  I could have done this prior to the USB board, but if nothing else I wanted to do it before a placed the I/O board on top of the Nano.  The two large SDRam chips face the inside of the nano for my version, and there&#8217;s a label on the opposite side that says &#8216;this side faces outwards&#8217;, so that helps orient you.  The SDRam goes into the pin header on the TOP of the Nano.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img decoding="async" loading="lazy" src="https://krystof.io/wp-content/uploads/2023/04/image-4.png" alt="" class="wp-image-2230" width="375" height="266" srcset="https://krystof.io/wp-content/uploads/2023/04/image-4.png 750w, https://krystof.io/wp-content/uploads/2023/04/image-4-300x212.png 300w, https://krystof.io/wp-content/uploads/2023/04/image-4-585x414.png 585w" sizes="(max-width: 375px) 100vw, 375px" /><figcaption class="wp-element-caption">This side faces inward, towards the center of your Nano.</figcaption></figure></div>


<h3 class="wp-block-heading">Digital IO Board (Or Analog if you have that)</h3>



<p>Next up is the IO Board, but before we install it, <strong>(for Digital IO Boards only),</strong> we need to flip a switch on the Nano.  Namely, SW3, and it&#8217;s right here (in our orientation, SW3 is on the left side of the bank, SW0 is on the right side)</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" loading="lazy" width="616" height="330" src="https://krystof.io/wp-content/uploads/2023/04/image-6.png" alt="" class="wp-image-2232" srcset="https://krystof.io/wp-content/uploads/2023/04/image-6.png 616w, https://krystof.io/wp-content/uploads/2023/04/image-6-300x161.png 300w, https://krystof.io/wp-content/uploads/2023/04/image-6-585x313.png 585w" sizes="(max-width: 616px) 100vw, 616px" /><figcaption class="wp-element-caption">Flip this baby UP.</figcaption></figure></div>


<p>After flipping it on (UP) (and ONLY for the digital IO board &#8211; for the analog IO board, all switches should be down/off), we&#8217;re ready to put the Digital board on top.  Our orientation has the &#8216;green&#8217; LED above the Red LED, this is how the IO board will look when putting it on top of the Nano if you&#8217;re using the orientation we are for our Nano (ethernet port on the right side).  We also put another set of standoffs on top of the Nano for this to rest on.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img decoding="async" loading="lazy" src="https://krystof.io/wp-content/uploads/2023/04/Screenshot-2023-04-07-143124.png" alt="" class="wp-image-2233" width="381" height="231" srcset="https://krystof.io/wp-content/uploads/2023/04/Screenshot-2023-04-07-143124.png 762w, https://krystof.io/wp-content/uploads/2023/04/Screenshot-2023-04-07-143124-300x182.png 300w, https://krystof.io/wp-content/uploads/2023/04/Screenshot-2023-04-07-143124-585x355.png 585w" sizes="(max-width: 381px) 100vw, 381px" /></figure></div>


<p>One troublesome thing I noticed was there are more headers (holes) on the Nano then there are pins on the IO board, so you&#8217;ll want to be careful.  With our orientation we&#8217;ve been using, the digital IO board <em>carefully</em> slides into the pins on the Nano. Gently make sure all of the pins line up. On the both top and bottom sides of the Nano, you&#8217;ll have more headers (holes) on the Nano then you actually will pins from the digital IO board.  Here are some shots from the <a href="https://misterfpga.co.uk" target="_blank" rel="noreferrer noopener nofollow">misterfpga.co.uk</a> site that show the differences of top and bottom headers/vs pins:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img decoding="async" loading="lazy" src="https://krystof.io/wp-content/uploads/2023/04/image-7.png" alt="" class="wp-image-2234" width="582" height="370" srcset="https://krystof.io/wp-content/uploads/2023/04/image-7.png 582w, https://krystof.io/wp-content/uploads/2023/04/image-7-300x191.png 300w" sizes="(max-width: 582px) 100vw, 582px" /><figcaption class="wp-element-caption">View on the &#8216;BOTTOM&#8217; side of the nano/io board.  Red LED in front if you have the bottom facing you.</figcaption></figure></div>

<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" loading="lazy" width="576" height="378" src="https://krystof.io/wp-content/uploads/2023/04/image-8.png" alt="" class="wp-image-2235" srcset="https://krystof.io/wp-content/uploads/2023/04/image-8.png 576w, https://krystof.io/wp-content/uploads/2023/04/image-8-300x197.png 300w" sizes="(max-width: 576px) 100vw, 576px" /><figcaption class="wp-element-caption">View on the &#8216;TOP&#8217; side of the nano/io board.  Green LED in front if you have the top facing you.</figcaption></figure></div>


<p>At pretty much anytime during this install, we could have turned the whole thing on and tried things out (hooking up a keyboard, HDMI, and power), but we&#8217;re going to cover that later.  For now, on to the Acrylic Case.  (If you&#8217;re not using a case, you can screw the IO board into the brass standoffs it should be touching &#8211; but if you ARE using a case, no screws yet)</p>



<h3 class="wp-block-heading">Acrylic Case</h3>



<p>More parts!  Don&#8217;t worry &#8211; it&#8217;s not uncommon that you will leave here with more brass standoffs than you started with, as individual parts often come with extras.  My case is designed for the digital IO board AND USB board in the mix.  There are other case variants that use the Analog IO board and USB board, naturally.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" loading="lazy" width="1024" height="631" src="https://krystof.io/wp-content/uploads/2023/04/image-9-1024x631.png" alt="" class="wp-image-2237" srcset="https://krystof.io/wp-content/uploads/2023/04/image-9-1024x631.png 1024w, https://krystof.io/wp-content/uploads/2023/04/image-9-300x185.png 300w, https://krystof.io/wp-content/uploads/2023/04/image-9-768x474.png 768w, https://krystof.io/wp-content/uploads/2023/04/image-9-1170x721.png 1170w, https://krystof.io/wp-content/uploads/2023/04/image-9-585x361.png 585w, https://krystof.io/wp-content/uploads/2023/04/image-9.png 1257w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure></div>


<p>Put the top standoffs into your digital IO board now, before you start building your case walls.  (You can do it afterwards, it&#8217;s just annoying).  Rest the MiSTer on top of the bottom part of the case, and build your walls up by aligning holes to case sides.  The tabs on the case sides slid together easily enough for me.</p>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" width="851" height="419" src="https://krystof.io/wp-content/uploads/2023/04/image-10.png" alt="" class="wp-image-2239" srcset="https://krystof.io/wp-content/uploads/2023/04/image-10.png 851w, https://krystof.io/wp-content/uploads/2023/04/image-10-300x148.png 300w, https://krystof.io/wp-content/uploads/2023/04/image-10-768x378.png 768w, https://krystof.io/wp-content/uploads/2023/04/image-10-585x288.png 585w" sizes="(max-width: 851px) 100vw, 851px" /></figure>



<p>The part that was roughest for me was the three little separate plastic buttons that rest on top of the Digital IO board&#8217;s buttons.  I found it easiest to put the buttons in the top side of the case, turn the MiSTer upside down, and align the case top and buttons that way.</p>



<p>With the case top on, and making sure the buttons were in place, I put the four screws in to the top of the case, securing the boards and case all together.  We&#8217;re done assembling our FPGA sandwich!</p>



<h3 class="wp-block-heading">Power setup</h3>



<p>When using this style of kit, where we have the IO board on top of the Nano on top of the USB hub, we really only need to give power to one component, and then we daisy chain power down to the other two boards.  We power the Digital IO board directly, which then gives power to the Nano, then we use the included Male to Male barrel connector to go from Nano to USB board.  So my power side/HDMI side looks like this:</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" loading="lazy" width="1024" height="689" src="https://krystof.io/wp-content/uploads/2023/04/image-11-1024x689.png" alt="" class="wp-image-2241" srcset="https://krystof.io/wp-content/uploads/2023/04/image-11-1024x689.png 1024w, https://krystof.io/wp-content/uploads/2023/04/image-11-300x202.png 300w, https://krystof.io/wp-content/uploads/2023/04/image-11-768x517.png 768w, https://krystof.io/wp-content/uploads/2023/04/image-11-1170x787.png 1170w, https://krystof.io/wp-content/uploads/2023/04/image-11-585x393.png 585w, https://krystof.io/wp-content/uploads/2023/04/image-11.png 1185w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure></div>


<p>Don&#8217;t forget, the Digital IO board also comes with a power switch on the bottom left (a simple slider switch).  I&#8217;m also using an inline switch power adapter, just make sure you&#8217;re turning all the right parts on.  I just leave the digital board switch on and use the inline adapter switch, but you do you. 🙂  After this point, I hook up the HDMI, and USB keyboard/mouse and I&#8217;m ready to go&#8230; after we flash the SD card with the Mr. Fusion software.</p>



<h2 class="wp-block-heading">Flashing the MicroSD card with Mr. Fusion</h2>



<p>If you have your case on, you&#8217;ll notice that the SD card is a royal pain in the ass to get out easily.  If I just trimmed my fingernails, I end up having to use a tiny pliers to grab the card after I release it with a push (it&#8217;s a spring-loaded-grabber SD Card type, but when releasing the card it *barely* clears the case if at all).  This is another reason I want to avoid having to take the SD Card in and out of the kit, it&#8217;s too damn annoying.  This is why I&#8217;m thinking most people would want to SCP into their MiSTer, use USB memory cards, or use network shares instead of ever having to remove the microSD card every time they wanted to add something.  I&#8217;m going with the network mount for the purposes of this document.</p>



<p>So, if you haven&#8217;t yet, remove the SD Card and put it into your favorite PC.  I like to use <a href="https://www.balena.io/etcher" target="_blank" rel="noreferrer noopener nofollow">balenaEtcher</a>, so I grab that and the <a href="https://github.com/MiSTer-devel/mr-fusion/releases" target="_blank" rel="noreferrer noopener">latest Mr. Fusion release</a> (at time of writing, 2.7), and let the etcher do its thing.</p>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" width="802" height="511" src="https://krystof.io/wp-content/uploads/2023/04/Screenshot-2023-04-07-103639.png" alt="" class="wp-image-2243" srcset="https://krystof.io/wp-content/uploads/2023/04/Screenshot-2023-04-07-103639.png 802w, https://krystof.io/wp-content/uploads/2023/04/Screenshot-2023-04-07-103639-300x191.png 300w, https://krystof.io/wp-content/uploads/2023/04/Screenshot-2023-04-07-103639-768x489.png 768w, https://krystof.io/wp-content/uploads/2023/04/Screenshot-2023-04-07-103639-585x373.png 585w" sizes="(max-width: 802px) 100vw, 802px" /></figure>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" loading="lazy" width="214" height="299" src="https://krystof.io/wp-content/uploads/2023/04/Screenshot-2023-04-07-103800.png" alt="" class="wp-image-2244"/><figcaption class="wp-element-caption">This is your goal.</figcaption></figure></div>


<div data-padding="10" class="wp-block-simple-blocks-info-block" style="background-color:#1a6ad9;color:#ffffff;padding:10px"><div data-iconsize="20" data-iconspace="20" class="icon" style="margin-right:20px"><span class="dashicon dashicons dashicons-info"></span></div><div>Having troubles getting a successfully validated flashing of the Mr. Fusion image?  I shut down my anti-virus temporarily, and made sure any Windows explorer windows weren&#8217;t open (I think the windows auto mounting of cards after the initial writing of the image causes some confusion when validating the image etching)</div></div>



<p></p>



<p>Putting this back into the MiSTer (the MicroSD card slot is on the bottom side of the Nano board, so you should make the gold contacts of the MicroSD face UP when you slide it in), we&#8217;re now finally ready to boot this thing up and configure some of the software.</p>



<h2 class="wp-block-heading">First boot</h2>



<p>If everything has gone okay (and why wouldn&#8217;t it, things never break or go wrong, right?), you&#8217;ll see this on your monitor:</p>


<div class="wp-block-image">
<figure class="aligncenter size-large is-resized"><img decoding="async" loading="lazy" src="https://krystof.io/wp-content/uploads/2023/04/image-12-1024x576.png" alt="" class="wp-image-2247" width="768" height="432" srcset="https://krystof.io/wp-content/uploads/2023/04/image-12-1024x576.png 1024w, https://krystof.io/wp-content/uploads/2023/04/image-12-300x169.png 300w, https://krystof.io/wp-content/uploads/2023/04/image-12-768x432.png 768w, https://krystof.io/wp-content/uploads/2023/04/image-12-1536x864.png 1536w, https://krystof.io/wp-content/uploads/2023/04/image-12-1170x658.png 1170w, https://krystof.io/wp-content/uploads/2023/04/image-12-585x329.png 585w, https://krystof.io/wp-content/uploads/2023/04/image-12-1320x743.png 1320w, https://krystof.io/wp-content/uploads/2023/04/image-12.png 1920w" sizes="(max-width: 768px) 100vw, 768px" /><figcaption class="wp-element-caption">You made it!</figcaption></figure></div>


<p>This will reboot, and then come to a screen that at first, made me think the flashing didn&#8217;t work right.  I didn&#8217;t know what to expect, so don&#8217;t be alarmed, and in fact, you should expect see this:</p>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="1024" height="576" src="https://krystof.io/wp-content/uploads/2023/04/image-13-1024x576.png" alt="" class="wp-image-2252" srcset="https://krystof.io/wp-content/uploads/2023/04/image-13-1024x576.png 1024w, https://krystof.io/wp-content/uploads/2023/04/image-13-300x169.png 300w, https://krystof.io/wp-content/uploads/2023/04/image-13-768x432.png 768w, https://krystof.io/wp-content/uploads/2023/04/image-13-1536x864.png 1536w, https://krystof.io/wp-content/uploads/2023/04/image-13-1170x658.png 1170w, https://krystof.io/wp-content/uploads/2023/04/image-13-585x329.png 585w, https://krystof.io/wp-content/uploads/2023/04/image-13-1320x743.png 1320w, https://krystof.io/wp-content/uploads/2023/04/image-13.png 1920w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">Everything is fine.  Seriously.  I&#8217;m not kidding. No /s here.  For reals.</figcaption></figure>



<p>All this means is that you&#8217;ve loaded up Mr. Fusion and are looking at a blank core menu because, well, the initial flashing doesn&#8217;t install <strong>any</strong> cores.  We&#8217;ll have to do that ourselves in a bit.  First things first.  Connectivity.  <strong>Well, one more thing first.  If the flashing static background starts annoying you, hit F1 on your keyboard to change it.  This also easily screws up encoding, as I was streaming his at the time and all of the static made the rest of the stream overlays pixelate.</strong></p>



<h2 class="wp-block-heading">Initial Network Connectivity</h2>



<p>If you&#8217;re hard wired in, you should already have an IP address.  If not, you should hit Escape,  which will bring up the system settings, and select the &#8216;Scripts&#8217; directory.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img decoding="async" loading="lazy" src="https://krystof.io/wp-content/uploads/2023/04/image-14.png" alt="" class="wp-image-2255" width="387" height="316" srcset="https://krystof.io/wp-content/uploads/2023/04/image-14.png 773w, https://krystof.io/wp-content/uploads/2023/04/image-14-300x245.png 300w, https://krystof.io/wp-content/uploads/2023/04/image-14-768x627.png 768w, https://krystof.io/wp-content/uploads/2023/04/image-14-585x478.png 585w" sizes="(max-width: 387px) 100vw, 387px" /></figure></div>


<p>At the warning, type yes (since you do want to run the script), and select &#8216;wifi&#8217; and hit return.  Assuming you have a wifi dongle plugged in (and if not, you should just go hard wired with ethernet), you&#8217;ll see the list of SSIDs &#8211; select yours and enter your password.  After that point, you should get taken back to the main menu, but you&#8217;ll have a little &#8216;Wifi&#8217; signal icon in the upper bar of your menu now.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img decoding="async" loading="lazy" src="https://krystof.io/wp-content/uploads/2023/04/image-15.png" alt="" class="wp-image-2256" width="384" height="311" srcset="https://krystof.io/wp-content/uploads/2023/04/image-15.png 768w, https://krystof.io/wp-content/uploads/2023/04/image-15-300x243.png 300w, https://krystof.io/wp-content/uploads/2023/04/image-15-585x474.png 585w" sizes="(max-width: 384px) 100vw, 384px" /></figure></div>


<p>Now we&#8217;re cooking.  Next steps are to download the well known &#8216;update_all&#8217; script (not the stock update script that comes with the install &#8211; which definitely works if you only want to use that) that downloads all the stuff that the update script does, as well as a lot of neat and/or experimental features <em>should you desire it</em> and performs general updates and downloading of additional scripts.  But first let&#8217;s go over where I&#8217;m storing all of the files the downloader is going to download.</p>



<h2 class="wp-block-heading">MiSTer file paths and network mount considerations</h2>



<p>MiSTer FPGA has a fairly standard directory structure it uses to look up files, be it cores or roms.  Whether it&#8217;s network storage or the SD Card itself, MiSTer mounts a well known directory structure referenced here: <a href="https://mister-devel.github.io/MkDocs_MiSTer/cores/paths" target="_blank" rel="noreferrer noopener">https://mister-devel.github.io/MkDocs_MiSTer/cores/paths</a></p>



<p><strong>to do any of the following, we need to login via SSH to our running MiSTer.</strong>  To see these directories in action, you can use <a href="https://www.putty.org/" target="_blank" rel="noreferrer noopener">PuTTY</a> to open up a terminal into your MiSTer.  The default account is root and the default password is 1.  (So&#8230; maybe we&#8217;ll change that later)</p>



<p>After you login, know that all of the directories MiSTer is going to care about are under /media.  The basic key directories are:</p>



<figure class="wp-block-table"><table><tbody><tr><td>/media/fat</td><td>The root of your SD Card.  If you were to shutdown the MiSTer and mount your card in your windows machine, the contents of that card would be here.</td></tr><tr><td>/media/fat/_Arcade</td><td>Arcade cores go here.  Cores are the systems, not the games, remember.</td></tr><tr><td>/media/fat/_Computer</td><td>Computer cores go here.  These are things like the Apple II, Commodore 64, etc.</td></tr><tr><td>/media/fat/_Console</td><td>Console cores go here &#8211; Nintendo, Genesis, etc.</td></tr><tr><td>/media/fat/config</td><td>Configuration files &#8211; generally for each core as you modify and save configurations.</td></tr><tr><td>/media/fat/games</td><td>These are where all your games go.  Generally subdirectories under here line up with cores, so /media/fat/games/c64 would be where you put your C64 disk/cart/program images.</td></tr></tbody></table></figure>



<p>You won&#8217;t have some of these directories yet because we haven&#8217;t downloaded anything with the update_all script yet (you&#8217;ll at least have a Scripts directory because we&#8217;ve already run files from there).  Previously I mentioned that I did NOT want to constantly remove the MicroSD card to add content to my MiSTer.  I would think most people don&#8217;t want to do this, especially with a case because getting those SD cards in and out easily is <strong>annoying</strong>.  So, I figure I had these options:</p>



<ul>
<li>Use the SD card for primary storage, let the update_all script download cores to the SD card, and use SCP/SSH to transfer files to the MicroSD card to my computer.  Doable, but slightly cumbersome</li>



<li>Use a USB Stick (which the MiSTer should automount according to the core paths page referenced in the github link above.  Here we can at least windows to do a little easier transfer, but we still have to move the stick between files.</li>



<li>Use a Samba share &#8211; You can enable the Samba (Windows file share) service on the MiSTer and expose your SDCard over the network as described here: <a href="https://mister-devel.github.io/MkDocs_MiSTer/setup/games/" target="_blank" rel="noreferrer noopener">https://mister-devel.github.io/MkDocs_MiSTer/setup/games/</a>  Also doable, but I prefer to not really use the SDCard except for booting up the MiSTer and storing some configuration data.</li>



<li>Use the CIFS mount scripts and download all cores and games onto my Synology NAS, and then have MiSTer mount those directories instead (even thinking it&#8217;s /media/fat, when it&#8217;s really talking to my NAS).  I liked this because virtually all files are on my NAS, so I can use that from windows more easily than SFTP, and I&#8217;m not constantly writing to the MiSTer SD Card.  <strong>This is the option this document will describe further down below</strong>.</li>
</ul>



<p>So, my goal is to create a NAS share, and have MiSTer mount the FPGA directories for cores, systems, etc. on the NAS, but making it think it&#8217;s still under /media/fat (reason being if anything we ever install assumes /media/fat is used, it will just work).  The primary directories we&#8217;ll leave on the SD card itself are /media/linux and /media/config, which are much more towards MiSTer even running things properly.  The cores and games, however, will live on my NAS.</p>



<p>So I created a share and made a dedicate user for it, this way it wasn&#8217;t going to see any other directories on the NAS and things are neatly organized.  For the CIFS mount to work, the directories must already exist, so I created the directories I needed by using a template.zip file from a forum thread I found on doing this exact thing, referenced <a href="https://misterfpga.org/viewtopic.php?t=3246" target="_blank" rel="noreferrer noopener">here</a>.  However, I found I needed to add a couple of directories to that template, so I&#8217;ve created my own, which you can grab here.  It&#8217;s just a zip file with empty directories to get you started.  All I did was just unzip it to the root of my NAS MiSTer share.</p>


<div class="sdm_download_item "><div class="sdm_download_item_top"><div class="sdm_download_thumbnail"></div><div class="sdm_download_title">MiSTer FPGA NAS Directory Template</div></div><div style="clear:both;"></div><div class="sdm_download_description"><p>This zip is a bunch of empty directories you unzip to the root of your NAS share dedicated to your MiSTer FPGA.  These directories should exist on the NAS share so when you run the cifs_mount.sh script, your MiSTer will see those /media/fat/ subdirectories, but they&#8217;ll actually point to the NAS and not your SD card.</p>
</div><div class="sdm_download_link"><span class="sdm_download_button"><a href="https://krystof.io/?sdm_process_download=1&download_id=2260" class="sdm_download green" title="MiSTer FPGA NAS Directory Template" target="_self">Download Now!</a></span><span class="sdm_download_item_count"><span class="sdm_item_count_number">1714</span><span class="sdm_item_count_string"> Downloads</span></span></div></div><div class="sdm_clear_float"></div>



<p>(The reason we do this is that those directories must exist to mount them on the MiSTer, otherwise when the download runs it will download files to the /media/fat/games directory on the SD CARD, not the network mount that we want.  We&#8217;re using CIFS to trick MiSTer into thinking /media/fat/games is on the SD card when it&#8217;s really on the network, remember.)</p>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" width="673" height="734" src="https://krystof.io/wp-content/uploads/2023/04/Screenshot-2023-04-07-104946.png" alt="" class="wp-image-2265" srcset="https://krystof.io/wp-content/uploads/2023/04/Screenshot-2023-04-07-104946.png 673w, https://krystof.io/wp-content/uploads/2023/04/Screenshot-2023-04-07-104946-275x300.png 275w, https://krystof.io/wp-content/uploads/2023/04/Screenshot-2023-04-07-104946-585x638.png 585w" sizes="(max-width: 673px) 100vw, 673px" /></figure>



<p>These are the empty directories included in the zip file.  (Ignore #recycle, that&#8217;s from my Synology NAS)</p>



<h2 class="wp-block-heading">Download and configure the CIFS_MOUNT scripts</h2>



<p>Now that we have those directories created, we need to tell the MiSTer how to mount them.  To do that, we&#8217;ll download to our /media/fat/Scripts directory (which will NOT be part of our NAS) the two scripts cifs_mount.sh and cifs_umount.sh from <a href="https://github.com/MiSTer-devel/Scripts_MiSTer" target="_blank" rel="noreferrer noopener">https://github.com/MiSTer-devel/Scripts_MiSTer</a>.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
cd /media/fat/Scripts
wget https://raw.githubusercontent.com/MiSTer-devel/Scripts_MiSTer/master/cifs_mount.sh
wget https://raw.githubusercontent.com/MiSTer-devel/Scripts_MiSTer/master/cifs_umount.sh
</pre></div>


<p>Now, in that same directory, we need to create a cifs_mount.ini file.  Here&#8217;s mine, you&#8217;d obviously use a real IP address for your NAS, a real username, and real password.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
# NAS IP (If server name doesn&#039;t work, use IP)
SERVER=&quot;192.168.50.10&quot;

#The share name on the NAS
SHARE=&quot;mister&quot;
USERNAME=&quot;mister&quot;
PASSWORD=&quot;mister&quot;

#Local directory/directories where the share will be mounted.
LOCAL_DIR=&quot;*&quot;

#mfsymlinks most likely is necessary so the update_all ArcadeOrganizer download works.
ADDITIONAL_MOUNT_OPTIONS=&quot;vers=3.11,mfsymlinks&quot;

#&quot;true&quot; in order to wait for the CIFS server to be reachable;
#useful when using this script at boot time.
WAIT_FOR_SERVER=&quot;true&quot;

#&quot;true&quot; for automounting CIFS shares at boot time;
#it will create start/kill scripts in /etc/network/if-up.d and /etc/network/if-down.d.
MOUNT_AT_BOOT=&quot;true&quot;

#========= ADVANCED OPTIONS =========
BASE_PATH=&quot;/media/fat&quot;
#MISTER_CIFS_URL=&quot;https://github.com/MiSTer-devel/CIFS_MiSTer&quot;
KERNEL_MODULES=&quot;md4.ko|md5.ko|des_generic.ko|fscache.ko|cifs.ko&quot;
IFS=&quot;|&quot;
SINGLE_CIFS_CONNECTION=&quot;true&quot;
#Pipe &quot;|&quot; separated list of directories which will never be mounted when LOCAL_DIR=&quot;*&quot;
SPECIAL_DIRECTORIES=&quot;config|linux|System Volume Information|#recycle&quot;
</pre></div>


<p>You can see in the SPECIAL_DIRECTORIES section we ignore config and linux, which we&#8217;ll always want to leave on our SDCard for stability.  The rest of the directories are mounted from the NAS IF they exist on the NAS already.</p>



<p>So, saving that file, my scripts directory now looks like this:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
/media/fat/Scripts# ls -l
total 160
-rwxr-xr-x 1 root root   911 Apr  6 00:18 cifs_mount.ini
-rwxr-xr-x 1 root root 12993 Apr  6 00:17 cifs_mount.sh
-rwxr-xr-x 1 root root  1051 Apr  6 00:17 cifs_umount.sh
-rwxr-xr-x 1 root root  4662 Jan  1  1980 update.sh
-rwxr-xr-x 1 root root 10638 Jan  1  1980 wifi.sh

</pre></div>


<p>I then invoked the ./cifs_mount.sh command to make sure it worked, and voila, here was my output:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
./cifs_mount.sh
</pre></div>


<figure class="wp-block-image size-full is-resized"><img decoding="async" loading="lazy" src="https://krystof.io/wp-content/uploads/2023/04/image-16.png" alt="" class="wp-image-2268" width="347" height="524" srcset="https://krystof.io/wp-content/uploads/2023/04/image-16.png 463w, https://krystof.io/wp-content/uploads/2023/04/image-16-199x300.png 199w" sizes="(max-width: 347px) 100vw, 347px" /></figure>



<p>And now, all of these new directories appear on /media/fat (but most of them are on our NAS!)</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" loading="lazy" src="https://krystof.io/wp-content/uploads/2023/04/image-17.png" alt="" class="wp-image-2269" width="609" height="639" srcset="https://krystof.io/wp-content/uploads/2023/04/image-17.png 812w, https://krystof.io/wp-content/uploads/2023/04/image-17-286x300.png 286w, https://krystof.io/wp-content/uploads/2023/04/image-17-768x806.png 768w, https://krystof.io/wp-content/uploads/2023/04/image-17-585x614.png 585w" sizes="(max-width: 609px) 100vw, 609px" /></figure>



<p>Now, if you&#8217;re ever unsure as to whether or not the directory you see under /media/fat is local to the SD card or not, check out the mounts by doing a cat /proc/mounts.  You&#8217;ll see output like this:</p>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" width="840" height="612" src="https://krystof.io/wp-content/uploads/2023/04/image-18.png" alt="" class="wp-image-2270" srcset="https://krystof.io/wp-content/uploads/2023/04/image-18.png 840w, https://krystof.io/wp-content/uploads/2023/04/image-18-300x219.png 300w, https://krystof.io/wp-content/uploads/2023/04/image-18-768x560.png 768w, https://krystof.io/wp-content/uploads/2023/04/image-18-585x426.png 585w" sizes="(max-width: 840px) 100vw, 840px" /></figure>



<p>You can see all of the directories that are actually mounted to the NAS.  These are the same directories our update_all script is going to download to (as well as config/linux/Scripts, but those stay local on the SD card because we&#8217;ve either ignored them or did not create a matching directory on the NAS).</p>



<p><strong>You should be able to reboot your MiSTer and SSH into it again and see these mounts are still there.</strong></p>



<h2 class="wp-block-heading">Download and run theypsilon&#8217;s update_all.sh script</h2>



<p>Finally, the moment we&#8217;ve all been waiting for&#8230; let&#8217;s get things updated and downloaded.</p>



<p>SSH back into your MiSTer if you rebooted, and in the Scripts directory download the update_all.sh script from theypsilon&#8217;s git hub.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
cd /media/fat/Scripts
wget https://raw.githubusercontent.com/theypsilon/Update_All_MiSTer/master/update_all.sh
</pre></div>


<p>Then, execute it.   The update_all.sh script takes a while to run &#8211; you may want to run it from the OSD on the MiSTer, or you can still run it via SSH if you prefer.  On the MiSTer OSD you&#8217;d see this (Hit ESC to get to the System Settings menu, then select Scripts):</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img decoding="async" loading="lazy" src="https://krystof.io/wp-content/uploads/2023/04/image-19.png" alt="" class="wp-image-2272" width="387" height="311" srcset="https://krystof.io/wp-content/uploads/2023/04/image-19.png 773w, https://krystof.io/wp-content/uploads/2023/04/image-19-300x241.png 300w, https://krystof.io/wp-content/uploads/2023/04/image-19-768x618.png 768w, https://krystof.io/wp-content/uploads/2023/04/image-19-585x471.png 585w" sizes="(max-width: 387px) 100vw, 387px" /></figure></div>


<p>Select update_all and you&#8217;ll be greeted with a preamble.  If you want to use default download options, just let it go, otherwise, hit UP ARROW and you can configure to download optional items. (If you&#8217;re on Wifi, this may take a while, might be best to do an initial update via ethernet cable)</p>



<p> </p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img decoding="async" loading="lazy" src="https://krystof.io/wp-content/uploads/2023/04/image-20.png" alt="" class="wp-image-2273" width="404" height="461" srcset="https://krystof.io/wp-content/uploads/2023/04/image-20.png 539w, https://krystof.io/wp-content/uploads/2023/04/image-20-263x300.png 263w" sizes="(max-width: 404px) 100vw, 404px" /></figure></div>


<p>I hit UP and was greeted to the main settings page.  Where I enabled this and that, but regardless it&#8217;s going to download the primary cores, scripts, and folder setup structure for /media/fat/games.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img decoding="async" loading="lazy" src="https://krystof.io/wp-content/uploads/2023/04/image-21.png" alt="" class="wp-image-2274" width="452" height="260" srcset="https://krystof.io/wp-content/uploads/2023/04/image-21.png 603w, https://krystof.io/wp-content/uploads/2023/04/image-21-300x172.png 300w, https://krystof.io/wp-content/uploads/2023/04/image-21-585x336.png 585w" sizes="(max-width: 452px) 100vw, 452px" /></figure></div>


<p>You can always just take the defaults, &#8216;Exit and Run update all&#8217;, and run it later if you want to download Disabled items.  </p>



<p>That runs for a looooooong time.</p>



<div data-padding="10" class="wp-block-simple-blocks-info-block" style="background-color:#000000;color:#ffffff;padding:10px"><div data-iconsize="20" data-iconspace="20" class="icon" style="margin-right:20px"><span class="dashicon dashicons dashicons-info"></span></div><div>Note &#8211; if you enabled the Arcade Organizer and run into an error regarding symlinks, make sure you look at the details of my cifs_mount.ini file &#8211; it attempts to address that in there, and once I made the change (mfsymlinks), I had no issues running update_all.</div></div>



<p>At the very end of the script, barring any issues, you&#8217;ll see this:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img decoding="async" loading="lazy" src="https://krystof.io/wp-content/uploads/2023/04/image-22.png" alt="" class="wp-image-2275" width="332" height="336" srcset="https://krystof.io/wp-content/uploads/2023/04/image-22.png 663w, https://krystof.io/wp-content/uploads/2023/04/image-22-296x300.png 296w, https://krystof.io/wp-content/uploads/2023/04/image-22-585x593.png 585w" sizes="(max-width: 332px) 100vw, 332px" /></figure></div>


<p>Your MiSTer will now reboot, and we&#8217;re done with the initial downloading.  If you look at your NAS share now, you&#8217;ll see it holds plenty of files and takes up a bit more space:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img decoding="async" loading="lazy" src="https://krystof.io/wp-content/uploads/2023/04/image-23.png" alt="" class="wp-image-2276" width="867" height="690" srcset="https://krystof.io/wp-content/uploads/2023/04/image-23.png 867w, https://krystof.io/wp-content/uploads/2023/04/image-23-300x239.png 300w, https://krystof.io/wp-content/uploads/2023/04/image-23-768x611.png 768w, https://krystof.io/wp-content/uploads/2023/04/image-23-585x466.png 585w" sizes="(max-width: 867px) 100vw, 867px" /></figure></div>


<h2 class="wp-block-heading">Rebooting and final touches</h2>



<p><strong>A note on starting up your MiSTer now that you&#8217;re mounting a bunch of folders on your NAS:</strong>  Now that you&#8217;re &#8216;tricking&#8217; MiSTer into thinking /media/fat/&lt;some of your directories&gt; are local and not on the NAS, you may be occasionally surprised if you menu under &#8216;Arcade&#8217;, &#8216;Console&#8217;, or &#8216;Computer&#8217; is empty when you first start up.  Don&#8217;t be.  Just go back to the root of the menu (hit that OSD button on your case, or just escape out), wait a tick for the cifs_mount.sh script to finish in the background, and then you&#8217;ll see your cores and games visible.  It&#8217;s just on the initial boot up, and usually only takes a few seconds after the menu shows up.</p>



<p>Once that was all said and done, I went to the Scripts directory again and executed the timezone script to set my timezone properly.</p>



<p>Now, that pretty much concludes this round documenting my initial setup.   Some good reference links:</p>



<p><strong>HotKeys:</strong> <a href="https://mister-devel.github.io/MkDocs_MiSTer/basics/hotkey/" target="_blank" rel="noreferrer noopener">https://mister-devel.github.io/MkDocs_MiSTer/basics/hotkey/</a></p>



<p><strong>Defining GamePads:</strong> <a href="https://mister-devel.github.io/MkDocs_MiSTer/setup/controller/" target="_blank" rel="noreferrer noopener">https://mister-devel.github.io/MkDocs_MiSTer/setup/controller/</a></p>



<p>MiSTer FPGA Documentation: <a href="https://mister-devel.github.io/MkDocs_MiSTer/" target="_blank" rel="noreferrer noopener">https://mister-devel.github.io/MkDocs_MiSTer/</a></p>



<p>MiSTer Wiki on GitHub: <a href="https://github.com/MiSTer-devel/Wiki_MiSTer/wiki" target="_blank" rel="noreferrer noopener">https://github.com/MiSTer-devel/Wiki_MiSTer/wiki</a></p>



<p>SMB/CIFS Mount Threads: <a href="https://misterfpga.org/viewtopic.php?t=3246&amp;start=30" target="_blank" rel="noreferrer noopener">https://misterfpga.org/viewtopic.php?t=3246&amp;start=30</a><a href="https://misterfpga.org/viewtopic.php?t=4972" target="_blank" rel="noreferrer noopener">https://misterfpga.org/viewtopic.php?t=4972</a></p>



<p>theypsilon&#8217;s Update_All_MiSTer repo: <a href="https://github.com/theypsilon/Update_All_MiSTer" target="_blank" rel="noreferrer noopener">https://github.com/theypsilon/Update_All_MiSTer</a></p>



<p></p>
<p>The post <a rel="nofollow" href="https://krystof.io/mister-fpga-initial-setup-and-network-mounting/">MiSTer FPGA Initial Setup and Network Mounting</a> appeared first on <a rel="nofollow" href="https://krystof.io">Krystof.IO</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://krystof.io/mister-fpga-initial-setup-and-network-mounting/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		
		<series:name><![CDATA[FPGAdventures]]></series:name>
	</item>
		<item>
		<title>Retro Gaming PC Build Log Part 2 : Commodore 64</title>
		<link>https://krystof.io/retro-gaming-pc-build-log-part-2-commodore-64/</link>
					<comments>https://krystof.io/retro-gaming-pc-build-log-part-2-commodore-64/#respond</comments>
		
		<dc:creator><![CDATA[Eric R. Krystof]]></dc:creator>
		<pubDate>Mon, 15 Aug 2022 01:10:25 +0000</pubDate>
				<category><![CDATA[Retro Gaming]]></category>
		<category><![CDATA[Commodore]]></category>
		<category><![CDATA[VICE]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Emulation]]></category>
		<category><![CDATA[Build Log]]></category>
		<guid isPermaLink="false">https://krystof.io/?p=1882</guid>

					<description><![CDATA[<p>Working through LaunchBox and VICE emulator configs for Commodore 64 game emulation</p>
<p>The post <a rel="nofollow" href="https://krystof.io/retro-gaming-pc-build-log-part-2-commodore-64/">Retro Gaming PC Build Log Part 2 : Commodore 64</a> appeared first on <a rel="nofollow" href="https://krystof.io">Krystof.IO</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Figured I&#8217;d start off with my favorite system &#8211; The Commodore 64.  Here are the key software components I used:</p>



<figure class="wp-block-table"><table><tbody><tr><td><a href="https://c64preservation.com/dp.php?pg=nibtools" target="_blank" rel="noreferrer noopener">Nib Tools</a></td><td>Used to convert any images that are .nib format to .G64 format that VICE can read.  D64 images are for unprotected (no copy protection) disks, while  .g64 and .nib are two formats that retain all of the copy protection.  So we&#8217;re going from NIB -&gt; G64</td></tr><tr><td>VICE 3.6.1 (<a href="https://vice-emu.sourceforge.io/windows.html" target="_blank" rel="noreferrer noopener" class="broken_link">Windows 64-bit SDL version</a>)</td><td>VICE is the emulator I&#8217;m most familiar with from my Diorama project and RetroPie tinkering, so I&#8217;ll continue with that here, same reason for the SDL version over GTK3.  </td></tr></tbody></table></figure>



<h2 class="wp-block-heading" id="h-nibconv-and-nib-disks">Nibconv and .NIB disks</h2>



<p>I have some disk images that are already the D64 or G64 type, and some that are .NIB.  I need to convert those using the nibconv from the Nib Tools package first.  A simple batch file that worked for me (drop it in the folder where you have nibconv.exe and .NIB files and it will handle the rest.  It deletes the G64 file first since mine would lock if the file already existed.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
for %%f in (*.nib) do (
	del &quot;%%~nf.g64&quot;
	nibconv &quot;%%~nf.nib&quot; &quot;%%~nf.g64&quot;
)
pause
</pre></div>


<h2 class="wp-block-heading">VICE install</h2>



<p>VICE doesn&#8217;t install &#8211; it just unpacks into a directory.  I put mine in a common emulators folder D:\Emulators\SDL2VICE-3.6.1-win64.  Underneath there are all sorts of binaries and such but the primary one is x64sc, and that&#8217;s what I&#8217;ll be configuring as I test out some games.</p>



<h2 class="wp-block-heading">First LaunchBox import and adding VICE as an emulator</h2>



<p>I put my Bruce Lee G64 file in a temporary directory just to try this out.  I&#8217;m going to let LaunchBox manage the Commodore 64 ROM files necessary, so it will &#8216;move it&#8217; into the LaunchBox Games directory on import:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img decoding="async" loading="lazy" src="https://krystof.io/wp-content/uploads/2022/08/image.png" alt="" class="wp-image-1892" width="542" height="399" srcset="https://krystof.io/wp-content/uploads/2022/08/image.png 722w, https://krystof.io/wp-content/uploads/2022/08/image-300x221.png 300w, https://krystof.io/wp-content/uploads/2022/08/image-585x431.png 585w" sizes="(max-width: 542px) 100vw, 542px" /></figure></div>

<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img decoding="async" loading="lazy" src="https://krystof.io/wp-content/uploads/2022/08/image-1.png" alt="" class="wp-image-1893" width="545" height="404" srcset="https://krystof.io/wp-content/uploads/2022/08/image-1.png 727w, https://krystof.io/wp-content/uploads/2022/08/image-1-300x222.png 300w, https://krystof.io/wp-content/uploads/2022/08/image-1-585x434.png 585w" sizes="(max-width: 545px) 100vw, 545px" /></figure></div>


<p>Now here is where I may deviate from most.  I like the <em>idea</em> of RetroArch, and perhaps I&#8217;ll revisit it in the future, but I found while I can create global configurations to be shared across multiple emulators, I really liked having features in the later versions of emulators that don&#8217;t have an updated RetroArch core, or the core has crippled some features I desire.  So in general, I rarely use RetroArch at this time.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img decoding="async" loading="lazy" src="https://krystof.io/wp-content/uploads/2022/08/image-2.png" alt="" class="wp-image-1894" width="548" height="409" srcset="https://krystof.io/wp-content/uploads/2022/08/image-2.png 731w, https://krystof.io/wp-content/uploads/2022/08/image-2-300x224.png 300w, https://krystof.io/wp-content/uploads/2022/08/image-2-585x436.png 585w" sizes="(max-width: 548px) 100vw, 548px" /><figcaption>This page REALLY messed me up.  It actually populated RetroArch into the Associated Platforms list of the &#8216;Manually Configured Emulator&#8217;.  So I had to wipe those out (read on to see how that was diagnosed)</figcaption></figure></div>

<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img decoding="async" loading="lazy" src="https://krystof.io/wp-content/uploads/2022/08/image-3.png" alt="" class="wp-image-1928" width="549" height="413" srcset="https://krystof.io/wp-content/uploads/2022/08/image-3.png 732w, https://krystof.io/wp-content/uploads/2022/08/image-3-300x225.png 300w, https://krystof.io/wp-content/uploads/2022/08/image-3-585x440.png 585w" sizes="(max-width: 549px) 100vw, 549px" /></figure></div>


<p>For starters, all I&#8217;m populating is the name (VICE 64) and the location to x64sc.exe (The VICE C64 binary)</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" loading="lazy" width="564" height="111" src="https://krystof.io/wp-content/uploads/2022/08/image-4-edited.png" alt="" class="wp-image-1932" srcset="https://krystof.io/wp-content/uploads/2022/08/image-4-edited.png 564w, https://krystof.io/wp-content/uploads/2022/08/image-4-edited-300x59.png 300w" sizes="(max-width: 564px) 100vw, 564px" /></figure></div>


<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" width="732" height="176" src="https://krystof.io/wp-content/uploads/2022/08/image-6.png" alt="" class="wp-image-1934" srcset="https://krystof.io/wp-content/uploads/2022/08/image-6.png 732w, https://krystof.io/wp-content/uploads/2022/08/image-6-300x72.png 300w, https://krystof.io/wp-content/uploads/2022/08/image-6-585x141.png 585w" sizes="(max-width: 732px) 100vw, 732px" /></figure>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" width="733" height="129" src="https://krystof.io/wp-content/uploads/2022/08/image-7.png" alt="" class="wp-image-1935" srcset="https://krystof.io/wp-content/uploads/2022/08/image-7.png 733w, https://krystof.io/wp-content/uploads/2022/08/image-7-300x53.png 300w, https://krystof.io/wp-content/uploads/2022/08/image-7-585x103.png 585w" sizes="(max-width: 733px) 100vw, 733px" /></figure>



<p>I let it populate all the checkboxes for both LaunchBox and EMU Movies.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img decoding="async" loading="lazy" src="https://krystof.io/wp-content/uploads/2022/08/image-8.png" alt="" class="wp-image-1936" width="548" height="410" srcset="https://krystof.io/wp-content/uploads/2022/08/image-8.png 731w, https://krystof.io/wp-content/uploads/2022/08/image-8-300x224.png 300w, https://krystof.io/wp-content/uploads/2022/08/image-8-585x437.png 585w" sizes="(max-width: 548px) 100vw, 548px" /></figure></div>

<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img decoding="async" loading="lazy" src="https://krystof.io/wp-content/uploads/2022/08/image-9.png" alt="" class="wp-image-1937" width="543" height="403" srcset="https://krystof.io/wp-content/uploads/2022/08/image-9.png 724w, https://krystof.io/wp-content/uploads/2022/08/image-9-300x223.png 300w, https://krystof.io/wp-content/uploads/2022/08/image-9-585x434.png 585w" sizes="(max-width: 543px) 100vw, 543px" /></figure></div>


<p>I leave these options as default:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" loading="lazy" width="549" height="309" src="https://krystof.io/wp-content/uploads/2022/08/image-10.png" alt="" class="wp-image-1938" srcset="https://krystof.io/wp-content/uploads/2022/08/image-10.png 549w, https://krystof.io/wp-content/uploads/2022/08/image-10-300x169.png 300w" sizes="(max-width: 549px) 100vw, 549px" /></figure></div>

<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" loading="lazy" width="722" height="204" src="https://krystof.io/wp-content/uploads/2022/08/image-11.png" alt="" class="wp-image-1939" srcset="https://krystof.io/wp-content/uploads/2022/08/image-11.png 722w, https://krystof.io/wp-content/uploads/2022/08/image-11-300x85.png 300w, https://krystof.io/wp-content/uploads/2022/08/image-11-585x165.png 585w" sizes="(max-width: 722px) 100vw, 722px" /></figure></div>


<p>After searching the online databases for media, I now show Bruce Lee in my LaunchBox main view:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" loading="lazy" width="628" height="420" src="https://krystof.io/wp-content/uploads/2022/08/image-12.png" alt="" class="wp-image-1940" srcset="https://krystof.io/wp-content/uploads/2022/08/image-12.png 628w, https://krystof.io/wp-content/uploads/2022/08/image-12-300x201.png 300w, https://krystof.io/wp-content/uploads/2022/08/image-12-585x391.png 585w, https://krystof.io/wp-content/uploads/2022/08/image-12-263x175.png 263w" sizes="(max-width: 628px) 100vw, 628px" /></figure></div>


<h2 class="wp-block-heading">Testing the first game &#8211; Failure and Fix</h2>



<p>Double clicking on Bruce Lee does&#8230; nothing.  I see nothing.  I got nothing.  What gives?</p>



<p>I decide to launch the emulator directly (x64sc.exe in the VICE directory) and it worked fine:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img decoding="async" loading="lazy" src="https://krystof.io/wp-content/uploads/2022/08/image-13.png" alt="" class="wp-image-1943" width="338" height="272" srcset="https://krystof.io/wp-content/uploads/2022/08/image-13.png 676w, https://krystof.io/wp-content/uploads/2022/08/image-13-300x241.png 300w, https://krystof.io/wp-content/uploads/2022/08/image-13-585x470.png 585w" sizes="(max-width: 338px) 100vw, 338px" /></figure></div>


<p>I then decided to load the G64 image directly through VICE, bypassing LaunchBox.  Result:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img decoding="async" loading="lazy" src="https://krystof.io/wp-content/uploads/2022/08/image-14.png" alt="" class="wp-image-1944" width="336" height="268" srcset="https://krystof.io/wp-content/uploads/2022/08/image-14.png 671w, https://krystof.io/wp-content/uploads/2022/08/image-14-300x239.png 300w, https://krystof.io/wp-content/uploads/2022/08/image-14-585x466.png 585w" sizes="(max-width: 336px) 100vw, 336px" /></figure></div>


<p>Okay.  So now I now there&#8217;s something up with LaunchBox dealing with VICE.  I&#8217;m actually used to loading VICE first on my RetroPie and loading the image directly.  So this means I&#8217;ve got a command line argument issue.  Turns out LaunchBox tried to force my hand with RetroArch even though I wanted to configure the emulator manually!</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" loading="lazy" width="288" height="224" src="https://krystof.io/wp-content/uploads/2022/08/image-16.png" alt="" class="wp-image-1946"/><figcaption>I didn&#8217;t ask for this, and I don&#8217;t want it.  It also pre populated entries in the &#8216;Associated Platforms&#8217; screen which causes it to think it needs a -f parameter and a RetroArch core.  </figcaption></figure></div>


<p>Perhaps I should have set the emulator up first, but if you run into this, you&#8217;ll see in your emulator config under &#8216;associated platforms&#8217; a WIDE list of items, and they also populate well known RetroArch cores.  </p>



<p>I missed the little &#8216;pop up&#8217; that stated it populated RetroArch for me.  I wish it hadn&#8217;t done that, it caused me a small headache.  So I went back into my VICE config and wiped out ALL of the associated platforms, left that tab, went back to an empty one (so it doesn&#8217;t show the RetroArch core column), and added one entry for Commodore 64 like so:</p>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="1024" height="143" src="https://krystof.io/wp-content/uploads/2022/08/image-15-1024x143.png" alt="" class="wp-image-1945" srcset="https://krystof.io/wp-content/uploads/2022/08/image-15-1024x143.png 1024w, https://krystof.io/wp-content/uploads/2022/08/image-15-300x42.png 300w, https://krystof.io/wp-content/uploads/2022/08/image-15-768x108.png 768w, https://krystof.io/wp-content/uploads/2022/08/image-15-585x82.png 585w, https://krystof.io/wp-content/uploads/2022/08/image-15.png 1164w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>After that, VICE finally launched from LaunchBox properly:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img decoding="async" loading="lazy" src="https://krystof.io/wp-content/uploads/2022/08/image-17.png" alt="" class="wp-image-1947" width="669" height="514" srcset="https://krystof.io/wp-content/uploads/2022/08/image-17.png 669w, https://krystof.io/wp-content/uploads/2022/08/image-17-300x230.png 300w, https://krystof.io/wp-content/uploads/2022/08/image-17-585x449.png 585w" sizes="(max-width: 669px) 100vw, 669px" /><figcaption>Finally!</figcaption></figure></div>


<h2 class="wp-block-heading">Configuring VICE on Windows</h2>



<p>Great, now we know we can launch at least one game from LaunchBox using VICE.  Now I need to configure it to my tastes.  First off, it&#8217;s a tiny window in the center of the screen, and not full screen.  There are plenty of other things I like to configure for VICE, and here is where I&#8217;ll record those &#8216;default&#8217; settings I immediately set into the VICE configuration when I first install VICE.  I may tweak this over time but the settings below are my current reference settings of choice.</p>



<p>First off, VICE by default is storing it&#8217;s settings in C:\Users\&lt;userid&gt;\AppData\Roaming\vice.  Underneath there is a sdl-vice.ini after saving the first time and vice.log for any interesting execution log statements.  Good to know.</p>



<p>Side note: Try out wireless gamepads for the PC (Like XBOX controllers).  Luna loves chewing cables.</p>



<p>Here are the highlights for my VICE 3.61 Windows SDL version&#8217;s settings that deviate from the known defaults.</p>



<ul><li>SDL audio instead of WMM &#8211; Things sounded horrendous otherwise.</li><li>NTSC Mode vs Pal- I had NTSC, but sometimes images I have require PAL.  So I set up both</li><li>I set the VICE snapshots directory to the Snapshots directory I created underneath my C64 LaunchBox game folder for easier visibility.</li><li>I set the drive sound emulation to 1.  It&#8217;s just music to my ears.</li><li>Joystick &#8211; I set by default, Joystick 2 to my game controller (a generic gamepad), and Joystick 1 to the numeric keypad.  VICE by default sets my A button to Joystick firing, B button to bring up the VICE menu.  I manually set the Y button to toggle WARP speed on and off, and the X button to &#8216;swap&#8217; the Joystick ports.  I also set the left trigger to the &#8216;Load snapshot&#8217; menu, and the right trigger to &#8216;Save snapshot&#8217; menu.</li></ul>



<p>What I ended up doing was creating two emulator profiles &#8211; one for NTSC and one for PAL.  The two config files allow me to tweak the two &#8216;versions&#8217; of C64 emulation differently, and sometimes I just need to do that for some games.</p>



<p>VICE 64 &#8211; NTSC setup example (points to NTSC config)</p>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" width="648" height="200" src="https://krystof.io/wp-content/uploads/2022/08/image-23.png" alt="" class="wp-image-1978" srcset="https://krystof.io/wp-content/uploads/2022/08/image-23.png 648w, https://krystof.io/wp-content/uploads/2022/08/image-23-300x93.png 300w, https://krystof.io/wp-content/uploads/2022/08/image-23-585x181.png 585w" sizes="(max-width: 648px) 100vw, 648px" /></figure>



<p>VICE 64 PAL &#8211; PAL setup example (points to PAL config)</p>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" width="619" height="205" src="https://krystof.io/wp-content/uploads/2022/08/image-22.png" alt="" class="wp-image-1977" srcset="https://krystof.io/wp-content/uploads/2022/08/image-22.png 619w, https://krystof.io/wp-content/uploads/2022/08/image-22-300x99.png 300w, https://krystof.io/wp-content/uploads/2022/08/image-22-585x194.png 585w" sizes="(max-width: 619px) 100vw, 619px" /></figure>



<p>Current reference settings:</p>



<p><strong>sdl-vice-ntsc.ini:</strong></p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
&#91;C64SC]
SDLStatusbar=1
SoundDeviceName=&quot;sdl&quot;
VirtualDevice1=1
MachineVideoStandard=2
IECReset=1
CIA1Model=0
CIA2Model=0
KernalRev=-1
VICIIFullscreen=1
VICIIModel=3
SidModel=0
JoyPort10Device=0
JoyPort9Device=0
JoyPort8Device=0
JoyPort7Device=0
JoyPort6Device=0
JoyPort5Device=0
JoyPort4Device=0
JoyPort3Device=0
JoyDevice1=4
EventSnapshotDir=&quot;D:\LaunchBox\Games\Commodore 64\Snapshots\&quot;
GlueLogic=0
DriveSoundEmulation=1

</pre></div>


<p><strong>sdl-vice-pal.ini:</strong></p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
&#91;C64SC]
SDLStatusbar=1
SoundDeviceName=&quot;sdl&quot;
VirtualDevice1=1
IECReset=1
CIA1Model=0
CIA2Model=0
KernalRev=-1
VICIIFullscreen=1
VICIIModel=0
SidModel=0
JoyPort10Device=0
JoyPort9Device=0
JoyPort8Device=0
JoyPort7Device=0
JoyPort6Device=0
JoyPort5Device=0
JoyPort4Device=0
JoyPort3Device=0
JoyDevice1=4
EventSnapshotDir=&quot;D:\LaunchBox\Games\Commodore 64\Snapshots\&quot;
GlueLogic=0
DriveSoundEmulation=1

</pre></div>


<p>LaunchBox specific settings:</p>



<p>Command line parameters:</p>



<ul><li>-chdir &#8220;D:\LaunchBox\Games\Commodore 64&#8221;  (Sets the autostart image directory to our games folder)</li></ul>



<h2 class="wp-block-heading">Game Specific Settings</h2>



<p>Game specific tweaks and oddities</p>



<figure class="wp-block-table"><table><tbody><tr><td><strong>Game</strong></td><td><strong>Command Line</strong></td></tr><tr><td>Jingle Disks</td><td>Couldn&#8217;t fix this with command line alone.  Must manually Load &#8220;Jingle&#8221;,8,1 and go from there.</td></tr></tbody></table></figure>
<p>The post <a rel="nofollow" href="https://krystof.io/retro-gaming-pc-build-log-part-2-commodore-64/">Retro Gaming PC Build Log Part 2 : Commodore 64</a> appeared first on <a rel="nofollow" href="https://krystof.io">Krystof.IO</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://krystof.io/retro-gaming-pc-build-log-part-2-commodore-64/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		
		<series:name><![CDATA[Retro Gaming PC Build Log]]></series:name>
	</item>
		<item>
		<title>Retro Gaming PC Build Log Part 1 : Host PC and Front End</title>
		<link>https://krystof.io/retro-gaming-pc-build-log-part-1-host-pc-and-front-end/</link>
					<comments>https://krystof.io/retro-gaming-pc-build-log-part-1-host-pc-and-front-end/#respond</comments>
		
		<dc:creator><![CDATA[Eric R. Krystof]]></dc:creator>
		<pubDate>Sun, 14 Aug 2022 18:10:49 +0000</pubDate>
				<category><![CDATA[Retro Gaming]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Emulation]]></category>
		<category><![CDATA[Build Log]]></category>
		<category><![CDATA[GOG]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[MS-DOS]]></category>
		<guid isPermaLink="false">https://krystof.io/?p=1841</guid>

					<description><![CDATA[<p>A fresh install of Windows and software for emulating and playing old installs from my software collection and third parties like Steam and GOG</p>
<p>The post <a rel="nofollow" href="https://krystof.io/retro-gaming-pc-build-log-part-1-host-pc-and-front-end/">Retro Gaming PC Build Log Part 1 : Host PC and Front End</a> appeared first on <a rel="nofollow" href="https://krystof.io">Krystof.IO</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading" id="h-the-goal">The Goal</h2>



<p>It seems when I&#8217;m able to come anywhere near close to dusting off some retro gaming work, I boot up whatever RetroPie or Windows based system I&#8217;ve set up for some retro gaming years back and can&#8217;t for the life of me remember how I set things up from either a taxonomy standpoint, controller setup, emulator configurations, and more.  I&#8217;m using these build logs to document my thought processes at the time and &#8216;Figure it out&#8217;.</p>



<h2 class="wp-block-heading" id="h-the-hardware">The Hardware</h2>



<p>Now, I&#8217;m not a retro gaming purist.  I&#8217;m at best <em>retro gaming purist adjacent.</em>  This means I love playing games on the older hardware, but with limited space, I can&#8217;t set up <em>all the things.</em>  I can set up some retro systems here and there, but I can&#8217;t set up everything in one big retro corner.  I&#8217;ve taken up enough corners in this house with my hobbies.  In fact, I&#8217;m fresh out of corners.  So, I&#8217;m going to emulate quite a bit, whether it&#8217;s Stella for the Atari 2600 or DOSBOX for Ultima Underworld.  I very much enjoy playing games on the original hardware when I can &#8211; but when it comes to easily streaming live content or looking up videos and articles about the game, it is very much easier to do it on a PC running emulation software.  Plus, I get to compare how the emulators compare to the real deal at my leisure. </p>



<p>Most of the time you don&#8217;t need a fancy machine to emulate old retro games &#8211; look at <a href="https://retropie.org.uk" target="_blank" rel="noreferrer noopener">RetroPie </a>for example.  You can emulate a metric crap ton of games on a Raspberry Pi.  The machine I chose is a bit beefier than I would need, but that&#8217;s because it&#8217;s available to me.  Why not a Pi?  I have a lot of DOS and Windows games as part of my &#8216;<a href="https://krystof.io/bucket-list/">Bucket List</a>&#8216; which rules out the Pi right quick &#8211; the Pi is great for certain computer and console emulation, but starts to have some issues in retro libraries of later eras (like Windows 9X games).  Plus, some of those may require some video acceleration &#8211; and for that I&#8217;ve an NVIDIA card to take care of the heavy lifting.  It&#8217;s not for the latest and greatest, but it will do for the oldest and greatest just fine.</p>



<p>It&#8217;s a 2018 ASUS GR8 II-6GT024Z VR Ready Mini PC Gaming Desktop with Intel Core i7-7700 and GeForce GTX 1060 6G Video Card.  All things considered it&#8217;s a powerhouse when it comes to what I need for retro gaming, even if it&#8217;s not available for purchase anymore and won&#8217;t be supported by Windows 11.</p>



<div class="wp-block-group is-layout-flow"><div class="wp-block-group__inner-container">
<div class="wp-block-columns is-layout-flex wp-container-3">
<div class="wp-block-column is-layout-flow">
<figure class="wp-block-image size-full is-resized"><img decoding="async" loading="lazy" src="https://krystof.io/wp-content/uploads/2022/08/asus-retro-machine.jpg" alt="" class="wp-image-1858" width="255" height="440" srcset="https://krystof.io/wp-content/uploads/2022/08/asus-retro-machine.jpg 509w, https://krystof.io/wp-content/uploads/2022/08/asus-retro-machine-174x300.jpg 174w" sizes="(max-width: 255px) 100vw, 255px" /><figcaption>I&#8217;ll run your Windows 10, pal, but that&#8217;s about it.  My dial doesn&#8217;t go to 11.</figcaption></figure>
</div>



<div class="wp-block-column is-layout-flow">
<p>Here are the basic specs:</p>



<figure class="wp-block-table"><table><tbody><tr><th>Processor</th><td>‎4.2 GHz core_i7</td></tr><tr><th>RAM</th><td>‎16 GB DDR4</td></tr><tr><th>Hard Drive</th><td>‎1 TB SSD</td></tr><tr><th>Graphics Coprocessor</th><td>‎NVIDIA GeForce GTX 1060</td></tr><tr><th>Chipset Brand</th><td>‎NVIDIA</td></tr><tr><th>Card Description</th><td>‎Dedicated</td></tr><tr><th>Graphics Card Ram Size</th><td>‎6 GB</td></tr><tr><th>Wireless Type</th><td>‎802.11ab</td></tr><tr><th>Number of USB 3.0 Ports</th><td>‎4</td></tr></tbody></table></figure>
</div>
</div>
</div></div>



<p class="has-text-align-left">So, while I type this, I&#8217;m performing that fresh Windows 10 install to start from scratch and begin the documentation process.  While we wait for that, let&#8217;s talk about the <strong>primary</strong> front end I&#8217;ll be using.</p>



<h2 class="wp-block-heading">Don&#8217;t forget to pack your LaunchBox</h2>



<p>I&#8217;ve tried a few front ends over the years, and most of the time they&#8217;re targeting specific emulating systems (MAME for example, has plenty of front ends, but that&#8217;s assuming you&#8217;re primarily dealing with MAME things).  I really adored HyperSpin in the mid 2010s, but I haven&#8217;t checked it out lately.  I think I&#8217;ll still use HyperSpin for a dedicated MAME cabinet (Project Pedestal), but I&#8217;m not considering it for this round.</p>



<p>I played around with LaunchBox quite a few years ago when it was in the early years, and I&#8217;ve been enjoying seeing the updates and enhancements (like BigBox) since then.  With the inherent support for multiple platforms and the capability for me to examine the datafiles (they&#8217;re stored in XML files inside the LaunchBox directory) easily, I can use LaunchBox to store configurations for the various games and I can also export that data to my &#8216;<a href="https://krystof.io/bucket-list/">Bucket List</a>&#8216; database, and from there I can auto populate my Twitch stream with box art, game metadata, and my personal high scores and playtime.  </p>



<p>I also wanted to be able to have some custom data points, which LaunchBox supports.  For example:</p>



<ul><li>Series Index &#8211; I use a field I call Series Index to indicate what order I should play a game when it&#8217;s part of a series.  Sometimes the titles aren&#8217;t an indicator (looking at you, GoldBox RPGs), and while I could use release date, I liked having a dedicated data-point.</li><li>Port Indicator &#8211; I don&#8217;t do this for all the games, but for some where I want to try out different versions, like say &#8216;BurgerTime&#8217; on Atari 2600, Intellivision, Commodore 64, etc. &#8211; I use this to link together individual game/platform combinations together.</li></ul>



<p>LaunchBox also has created a database to pull a lot of metadata down for recognized games, along with <a href="https://emumovies.com" target="_blank" rel="noreferrer noopener">EmuMovies </a>integration for video and additional art.  We can also pull down manuals, which is a big help so I don&#8217;t have to find the ASCII text files or open my game boxes up needlessly.  </p>



<p>So, I head over to the <a href="https://www.launchbox-app.com" target="_blank" rel="noreferrer noopener">LaunchBox </a>site, purchased a lifetime license, and went to work on the install.  You can of course install the free version, but I purchased it a looooong time ago, so I&#8217;m going to use my permanent license.</p>



<p>I&#8217;m leaving some hard drive space for the OS, but most of my stuff will be installed on a D: drive so I can keep some parts separated from the main OS.  We&#8217;ll see how well that works &#8211; ideally nothing should FORCE me to stay on the C: drive but you never know.  Personal preference, really &#8211; I could do all this on C: if I really wanted to.</p>



<p>After launching LaunchBox, I attached my GOG profile and my EmuMovies account subscription for future game and metadata downloads.</p>



<p>That&#8217;s it for this round.  Next chapters will probably be platform specific as I set up emulators and related utilities.</p>
<p>The post <a rel="nofollow" href="https://krystof.io/retro-gaming-pc-build-log-part-1-host-pc-and-front-end/">Retro Gaming PC Build Log Part 1 : Host PC and Front End</a> appeared first on <a rel="nofollow" href="https://krystof.io">Krystof.IO</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://krystof.io/retro-gaming-pc-build-log-part-1-host-pc-and-front-end/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		
		<series:name><![CDATA[Retro Gaming PC Build Log]]></series:name>
	</item>
		<item>
		<title>DOSBox Shaders Comparison For Modern DOS Retro Gaming</title>
		<link>https://krystof.io/dosbox-shaders-comparison-for-modern-dos-retro-gaming/</link>
					<comments>https://krystof.io/dosbox-shaders-comparison-for-modern-dos-retro-gaming/#comments</comments>
		
		<dc:creator><![CDATA[Eric R. Krystof]]></dc:creator>
		<pubDate>Sun, 28 Jun 2020 14:46:58 +0000</pubDate>
				<category><![CDATA[Retro Gaming]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Dos Box]]></category>
		<category><![CDATA[Emulation]]></category>
		<guid isPermaLink="false">https://krystof.io/?p=1524</guid>

					<description><![CDATA[<p>Let's compare different dosbox shaders and see if we can make modern gaming look old again.</p>
<p>The post <a rel="nofollow" href="https://krystof.io/dosbox-shaders-comparison-for-modern-dos-retro-gaming/">DOSBox Shaders Comparison For Modern DOS Retro Gaming</a> appeared first on <a rel="nofollow" href="https://krystof.io">Krystof.IO</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<div data-padding="10" class="wp-block-simple-blocks-info-block" style="background-color:#050597;color:#ffffff;padding:10px"><div data-iconsize="20" data-iconspace="20" class="icon" style="margin-right:20px"><span class="dashicon dashicons dashicons-info"></span></div><div>I&#8217;ve recently switched to DOSBOX-X for a more modern DOSBOX build with shaders support.  See how I configured that in the build log! <a href="https://krystof.io/retro-gaming-pc-build-log-part-3-pc-games-with-gog/">Retro Gaming PC Build Log Part 3 : PC Games with GOG</a></div></div>



<p>The basic version of DOSBox does not contain support for &#8216;shaders&#8217;. Those little bits of code and configuration that can make a modern retro gaming screen look cell shaded, dotted like an old school CRT monitor, or even curved and blurred like an old TV tube. So how do I get shaders? We have to utilize a fork or variant of DOSBox.  Let&#8217;s run a comparison of these shaders in a MSDOS Retro Gaming screenshot session of DOOM.</p>



<p>I have plans for three dioramas.  One is complete &#8211; the <a href="https://krystof.io/diorama-64-part-1-overview/">C64 years</a>.  I still have an Atari 2600 and IBM PC diorama to do, and the latter is a bit more technically challenging when it comes to actually playing the games.  Not only do I have to worry about DOS games, but Windows 3.1, Windows 95, and even some Windows 98 gaming, and attempting to make all of those games work on one small PC that will host the actual gameplay.</p>



<h2 class="wp-block-heading">Why DosBox at all?</h2>



<p>Between the old copies of games I have on CD and floppy images (I saved a lot of crap digitally if not physically), the actual CDs themselves, and sites like GOG.com, I&#8217;ll be able to relive a lot of my old gaming days.  This is, of course, thanks in no small part to a little program called <a aria-label="undefined (opens in a new tab)" href="https://www.dosbox.com/" target="_blank" rel="noreferrer noopener nofollow">DOSBox</a>.</p>



<p>From their site to explain it best:  <em>DOSBox is an emulator that recreates a MS-DOS compatible environment (complete with Sound, Input, Graphics and even basic networking). This environment is complete enough to run many classic MS-DOS games completely unmodified. </em></p>



<p>It&#8217;s the de facto standard for running DOS games on modern hardware.  </p>



<div data-padding="10" class="wp-block-simple-blocks-info-block" style="background-color:#000000;color:#ffffff;padding:10px"><div data-iconsize="20" data-iconspace="20" class="icon" style="margin-right:20px"><svg aria-hidden="true" role="img" focusable="false" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewbox="0 0 20 20" class="dashicon dashicons-info"><path d="M10 2c4.42 0 8 3.58 8 8s-3.58 8-8 8-8-3.58-8-8 3.58-8 8-8zm1 4c0-.55-.45-1-1-1s-1 .45-1 1 .45 1 1 1 1-.45 1-1zm0 9V9H9v6h2z"></path></svg></div><div>This article refers to functionality I utilized in a specific DOSBox variant known as DOSBox Optionals, compiled by Marty Shepard.  More info on that below.</div></div>



<p></p>



<h3 class="wp-block-heading">I am 32 flavors and then some</h3>



<p>To that end, there&#8217;s almost always a variant of DOSBox that gains popularity for a while because DOSBox &#8216;proper&#8217; doesn&#8217;t support every single feature a DOS gamer might want to utilize when playing a game (e.g. Voodoo 3Dfx support).  There are a decent number of variants that fall under the label of &#8216;SVN Builds&#8217;, you can check em all out here: <a aria-label="undefined (opens in a new tab)" href="https://www.dosbox.com/wiki/SVN_Builds" target="_blank" rel="noreferrer noopener nofollow">https://www.dosbox.com/wiki/SVN_Builds</a>.  </p>



<p>One of the most popular variants today is called <a label="undefined (opens in a new tab)" href="https://dosboxece.yesterplay.net/" target="_blank" rel="noreferrer noopener nofollow" class="broken_link">DOSBox ECE</a>, standing for Enhanced Community Edition.  It emulates 3Dfx hardware and supports up to 384 MB of ram, two things that the standard DOSBox build doesn&#8217;t cover.  </p>



<p>Remember that you don&#8217;t have to use one version of DOSBox for every single game you play, although if you <em>could</em>, that would be ideal from a configuration management standpoint,  as each variant may have different config file options available.</p>



<p>Now we have variants like DOSBox X, SVN Daum, ECE, and even CRT, which first caught my eye because, while I don&#8217;t always play with shaders (I dislike them on VICE), I wanted to see what the DOSBox world had to offer me.  However, I wanted a relatively recent version of DOSBox with shaders.   The hunt begins.</p>



<h3 class="wp-block-heading">DOSBox CRT is close but no cigar</h3>



<p><a aria-label="undefined (opens in a new tab)" href="https://mattiasgustavsson.itch.io/dosbox-crt" target="_blank" rel="noreferrer noopener nofollow">DOSBox CRT</a> fit the bill at first &#8211; it&#8217;s essentially DOSBox 0.74 with a custom shader to give that real CRT look and feel.  As much as I liked the inner screen rendering of it, this version essentially paints a CRT border around the screen that becomes part of your DOSBox window&#8230; I did not find this palatable:</p>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="1024" height="726" src="https://krystof.io/wp-content/uploads/2020/06/dosbox-crt-1024x726.jpg" alt="" class="wp-image-1538" srcset="https://krystof.io/wp-content/uploads/2020/06/dosbox-crt-1024x726.jpg 1024w, https://krystof.io/wp-content/uploads/2020/06/dosbox-crt-300x213.jpg 300w, https://krystof.io/wp-content/uploads/2020/06/dosbox-crt-768x545.jpg 768w, https://krystof.io/wp-content/uploads/2020/06/dosbox-crt-1170x830.jpg 1170w, https://krystof.io/wp-content/uploads/2020/06/dosbox-crt-585x415.jpg 585w, https://krystof.io/wp-content/uploads/2020/06/dosbox-crt.jpg 1437w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>Go away monitor border&#8230; I didn&#8217;t ask for you.</figcaption></figure>



<p>Good job and a nod to Mattias Gustavsson for compiling his custom shader work into DOSBox.  It just wasn&#8217;t for me.  So our hunt continues.  I didn&#8217;t want to use Retroarch for this, and I wanted something a little more recently maintained&#8230;</p>



<h3 class="wp-block-heading">An Optionals requirement is found</h3>



<p>I stumbled across another DOSBox variant called <a aria-label="undefined (opens in a new tab)" href="https://github.com/MartyShepard/DOSBox-Optionals" target="_blank" rel="noreferrer noopener nofollow">DOSBox Optionals</a>, created by Marty Shepard with near latest enhancements of DOSBox ECE, standard DOSBox, and other patches people have released that aren&#8217;t incorporated into the &#8216;standard DOSBox&#8217; build.  Marty has done a fantastic job of grouping all of these enhancements into a single DOSBox build that also supported the shader patch by <a aria-label="undefined (opens in a new tab)" href="https://github.com/duganchen/dosbox_shaders" target="_blank" rel="noreferrer noopener nofollow">duganchen</a>.  VOGONS thread about that support <a aria-label="undefined (opens in a new tab)" href="https://www.vogons.org/viewtopic.php?f=41&amp;t=43068" target="_blank" rel="noreferrer noopener nofollow">here</a>.  </p>



<p>I downloaded and extracted DOSBox Optionals and opened up the dosbox.conf.  Yikes! The sheer number of options and documentation to each option compared to the normal DOSBox install was amazing.  I recommend trying it out &#8211; I&#8217;ve tried a handful of titles with it thus far and they&#8217;ve worked, though I did discover a speech pitch issue.  I&#8217;ll cover that later in this post.</p>



<h2 class="wp-block-heading">Throwing Shade&#8230;rs.</h2>



<p>So without any &#8216;shaders&#8217;&#8230; What does DOSBox Optionals look like?  Let&#8217;s compare shader to non shader.   Given that I&#8217;m scaling my screen up, my no-shader view will have a slight blurring to it &#8211; but that&#8217;s not the shader.</p>



<p>Using DOSBox Optionals I took a &#8216;before and after&#8217; screen shot of &#8216;<strong>no shader</strong>&#8216; and the &#8216;<strong>crt-lottes_mod</strong>&#8216; shader.  You can drag the vertical slider below with your mouse and immediately see a difference.</p>


<div id="twenty20-1" class="twenty20" style="width: 100% !important; clear: both;"><div class="twentytwenty-container twenty20-1 t20-hover"><img class="skip-lazy" src="https://krystof.io/wp-content/uploads/2020/06/no-shader.jpg" /><img class="skip-lazy" src="https://krystof.io/wp-content/uploads/2020/06/dos-crt-lottes_mod.jpg" /></div><script>jQuery( document ).ready(function( $ ) {$(".twentytwenty-container.twenty20-1[data-orientation!='vertical']").twentytwenty({default_offset_pct: 0.5,move_slider_on_hover: true});$(".twenty20-1 .twentytwenty-before-label").html("No Shader");$(".twenty20-1 .twentytwenty-after-label").html("crt-lottes_mod");});</script></div>



<p>Please note that the new defaults <strong>(scaler=none, aspect=on)</strong> are needed for the shaders to work as designed.</p>



<p>The results?   Immediate shift to a more &#8216;dot-based&#8217; look, a little darker and very much closer to a curved CRT.  Compare yourself &#8211; the left side is without any shader and the right side is with &#8216;crt-lottes_mod&#8217; selected.  Drag the line to move your comparison from left to right.</p>



<p>Let&#8217;s zoom in and see what it looks like:</p>


<div id="twenty20-2" class="twenty20" style="width: 100% !important; clear: both;"><div class="twentytwenty-container twenty20-2 t20-hover"><img class="skip-lazy" src="https://krystof.io/wp-content/uploads/2020/06/closeup-no-shader.jpg" /><img class="skip-lazy" src="https://krystof.io/wp-content/uploads/2020/06/closeup-crt-lottes_mod-shader.jpg" /></div><script>jQuery( document ).ready(function( $ ) {$(".twentytwenty-container.twenty20-2[data-orientation!='vertical']").twentytwenty({default_offset_pct: 0.5,move_slider_on_hover: true});$(".twenty20-2 .twentytwenty-before-label").html("No Shader");$(".twenty20-2 .twentytwenty-after-label").html("crt-lottes_mod");});</script></div>



<p>I&#8217;m impressed.  You really get a sense of the dots and CRT nature of the view, and the phrase &#8216;dot pitch&#8217;, which I haven&#8217;t thought about in probably a decade, comes right back like it was yesterday.  This isn&#8217;t just any simple scan-line filter.</p>



<h3 class="wp-block-heading">Quick rundown of 13 shaders in DOSBox and DOOM</h3>



<p>What about some of the other shaders?  Let&#8217;s take a look &#8211; you can use the compare slider to look at the same screen shot of DOS and the same screen shot area of DOOM and compare shaders.  I imagine one shader might be good for one game and one for another &#8211; or if you&#8217;re playing CGA, EGA, VGA, or ANSI text games, you very well might want a specific kind of shader for those resolutions and colors.</p>


<div id="twenty20-3" class="twenty20" style="width: 100% !important; clear: both;"><div class="twentytwenty-container twenty20-3 t20-hover"><img class="skip-lazy" src="https://krystof.io/wp-content/uploads/2020/06/dosbox-doom-scanline-examples.jpg" /><img class="skip-lazy" src="https://krystof.io/wp-content/uploads/2020/06/dosbox-msdos-scanline-examples.jpg" /></div><script>jQuery( document ).ready(function( $ ) {$(".twentytwenty-container.twenty20-3[data-orientation!='vertical']").twentytwenty({default_offset_pct: 0.5,move_slider_on_hover: true});$(".twenty20-3 .twentytwenty-before-label").html("DOOM");$(".twenty20-3 .twentytwenty-after-label").html("DOS Text");});</script></div>



<p>For me, I&#8217;ve really got my eye on crt-lottes_mod and crt-easymode.  GTU looks like a contender as well.  Some of these other shaders are just nuts &#8211; FixingPixelArt gives one hell of a blur for example, and the xbr (#4,#5) shaders give it a &#8216;behind stained-glass&#8217; feel to me.</p>



<h3 class="wp-block-heading">Modifying shaders for testing</h3>



<p>As much as I like crt-lottes_mod, I have some tweaks I&#8217;d like to make:</p>



<ul><li>I don&#8217;t like curvature shaders.  I know it&#8217;s trying to be more realistic, it&#8217;s just so damn off-putting to me, I&#8217;d like to disable it.</li><li>It&#8217;s a little too dark &#8211; I&#8217;d like to increase the brightness a little bit.</li></ul>



<p>I started to wonder &#8211; if I do this, does it end up looking like crt-easymode?  Let&#8217;s tweak it a bit and find out.</p>



<p>I&#8217;m going to head over to the SHADERS/crt-lottes_mod.frag file and tweak a few values:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
#define warpX 0.000 //0.021, 0.007
#define warpY 0.000 //0.045, 0.021 
#define brightboost 1.0
</pre></div>


<p>Let&#8217;s compare crt-easymode to my custom-mod-v1:</p>


<div id="twenty20-4" class="twenty20" style="width: 100% !important; clear: both;"><div class="twentytwenty-container twenty20-4 t20-hover"><img class="skip-lazy" src="https://krystof.io/wp-content/uploads/2020/06/doom-title-crt-easymode-shader.jpg" /><img class="skip-lazy" src="https://krystof.io/wp-content/uploads/2020/06/doom-title-crt-lottes_mod-mycustom-shader.jpg" /></div><script>jQuery( document ).ready(function( $ ) {$(".twentytwenty-container.twenty20-4[data-orientation!='vertical']").twentytwenty({default_offset_pct: 0.5,move_slider_on_hover: true});$(".twenty20-4 .twentytwenty-before-label").html("crt-easymode");$(".twenty20-4 .twentytwenty-after-label").html("crt-lottes_mod w/ my customization");});</script></div>



<p>Granted, you could spend all day playing around with parameters, and while I feel the lottes_mod definitely has a lot more in the way of customization options, I&#8217;m leaning towards crt-easymode even with the modifications I made to flatten lottes and brighten the screen.  This is just to get something going to see if I like it enough.  It&#8217;s also a little lighter on the GPU than lottes will be from what I gather, which is good since I won&#8217;t be playing my DOSBox titles on a super high end modern machine.</p>



<h2 class="wp-block-heading">DOSBox Optionals comes with free Chipmunks</h2>



<p>Once I found a shader setting I wanted to try out for a bit, I needed to test a few titles on DOSBox Optionals to make sure it worked for my gaming tastes.  Optionals comes packaged with a demo for DUNE2, one of the first Real Time Strategy games, and a Westwood classic.</p>



<p>I fired up the demo and as soon as the voice synthesis came on, I could tell something was just a bit&#8230; chipmunky.  This was with default settings that come with the DOSBox Optionals install.  Listen to this:</p>



<figure class="wp-block-audio"><audio controls src="https://krystof.io/wp-content/uploads/2020/06/dune-intro-chipmunk.mp3"></audio></figure>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="800" height="492" src="https://krystof.io/wp-content/uploads/2020/06/dune-chipmunk.jpg" alt="" class="wp-image-1568" srcset="https://krystof.io/wp-content/uploads/2020/06/dune-chipmunk.jpg 800w, https://krystof.io/wp-content/uploads/2020/06/dune-chipmunk-300x185.jpg 300w, https://krystof.io/wp-content/uploads/2020/06/dune-chipmunk-768x472.jpg 768w, https://krystof.io/wp-content/uploads/2020/06/dune-chipmunk-585x360.jpg 585w" sizes="(max-width: 800px) 100vw, 800px" /><figcaption>I DID NOT SIGN UP FOR THIS</figcaption></figure>



<p>This did *not* happen running the same DUNE 2 demo on regular DOSBox, so I knew it was something specific to Optionals.  But what?  What patch is inserting Alvin into my games?  I found this <a aria-label="undefined (opens in a new tab)" href="https://www.vogons.org/viewtopic.php?t=33896" target="_blank" rel="noreferrer noopener nofollow">VOGONS thread</a> referencing elevated pitch in DOSBox, calling out this code in particular:</p>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="1024" height="415" src="https://krystof.io/wp-content/uploads/2020/06/image-1024x415.png" alt="" class="wp-image-1569" srcset="https://krystof.io/wp-content/uploads/2020/06/image-1024x415.png 1024w, https://krystof.io/wp-content/uploads/2020/06/image-300x121.png 300w, https://krystof.io/wp-content/uploads/2020/06/image-768x311.png 768w, https://krystof.io/wp-content/uploads/2020/06/image-1536x622.png 1536w, https://krystof.io/wp-content/uploads/2020/06/image-1170x474.png 1170w, https://krystof.io/wp-content/uploads/2020/06/image-585x237.png 585w, https://krystof.io/wp-content/uploads/2020/06/image.png 1702w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>I found a reference to Goldplay while searching the DOSBox Optionals repository:</p>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="893" height="400" src="https://krystof.io/wp-content/uploads/2020/06/image-1.png" alt="" class="wp-image-1570" srcset="https://krystof.io/wp-content/uploads/2020/06/image-1.png 893w, https://krystof.io/wp-content/uploads/2020/06/image-1-300x134.png 300w, https://krystof.io/wp-content/uploads/2020/06/image-1-768x344.png 768w, https://krystof.io/wp-content/uploads/2020/06/image-1-585x262.png 585w" sizes="(max-width: 893px) 100vw, 893px" /></figure>



<p>Snippet pulled from <a href="https://github.com/MartyShepard/DOSBox-Optionals/blob/master/dosbox/tOptionals/src/hardware/sblaster.cpp" target="_blank" aria-label="undefined (opens in a new tab)" rel="noreferrer noopener nofollow">https://github.com/MartyShepard/DOSBox-Optionals/blob/master/dosbox/tOptionals/src/hardware/sblaster.cpp</a> at the time of this writing.</p>



<p>So, Goldplay.  We&#8217;re now just a bit above my pay grade &#8211; it&#8217;s DMA transfers, sample rates, and IRQ programming.  Nevertheless, I set <code>goldplay = true</code> in the dosbox.conf and voila:</p>



<figure class="wp-block-audio"><audio controls src="https://krystof.io/wp-content/uploads/2020/06/dune-intro-normal.mp3"></audio><figcaption>Good bye, Alvin.  The sands of Arrakis have finally rid us of your presence.</figcaption></figure>



<p>I&#8217;ll have to keep that configuration option in mind in the future if something seems off in Speech.  But between DUNE2, the demo and the game, along with Ultima Underworld, I needed to have this setting set to true for speech to sound proper.</p>



<h2 class="wp-block-heading">Conclusion</h2>



<p>Got some shader settings you like?  I&#8217;d love to know if there&#8217;s a favorite preset or game/app you use a particular shader for.  I&#8217;ll probably stick with crt-easymode for now, though I might look at the shader configuration and tweak a few things and see what happens.  That&#8217;s what shader configs are all about &#8211; experimentation &#8211; because if a shader just isn&#8217;t doing anything for you, and it&#8217;s not reminding you of the monitor model you played that game on &#8211; tweak it!</p>



<h2 class="wp-block-heading">References</h2>



<ul><li><a href="https://github.com/MartyShepard/DOSBox-Optionals">https://github.com/MartyShepard/DOSBox-Optionals</a> &#8211; DOSBox Optionals Repo</li><li><a href="https://github.com/duganchen/dosbox_shaders">https://github.com/duganchen/dosbox_shaders</a> &#8211; Duganchen&#8217;s shaders included in DOSBox Optionals</li><li><a href="https://mattiasgustavsson.itch.io/dosbox-crt">https://mattiasgustavsson.itch.io/dosbox-crt</a> &#8211; DOSBox CRT Build</li><li><a href="https://www.vogons.org/viewtopic.php?t=33896">https://www.vogons.org/viewtopic.php?t=33896</a> &#8211; VOGONs thread regarding sample rate and DMA for SoundBlaster devices</li><li><a aria-label="undefined (opens in a new tab)" href="http://filthypants.blogspot.com/2015/04/more-crt-shaders.html" target="_blank" rel="noreferrer noopener nofollow">http://filthypants.blogspot.com/2015/04/more-crt-shaders.html</a> &#8211; A good article referencing example shots of these shaders utlized in other emulators like RetroArch.</li><li><a href="https://emulation.gametechwiki.com/index.php/CRT_Shaders">https://emulation.gametechwiki.com/index.php/CRT_Shaders</a> &#8211; General Shaders article &#8211; references a lot of shaders converted over to DOSBox (Duganchen&#8217;s build) and included in DOSBox Optionals.</li><li><a href="https://scalibq.wordpress.com/2017/03/12/dma-activation/">https://scalibq.wordpress.com/2017/03/12/dma-activation/</a> lots of technical information but references SoundBlaster GoldPlay</li></ul>



<p></p>
<p>The post <a rel="nofollow" href="https://krystof.io/dosbox-shaders-comparison-for-modern-dos-retro-gaming/">DOSBox Shaders Comparison For Modern DOS Retro Gaming</a> appeared first on <a rel="nofollow" href="https://krystof.io">Krystof.IO</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://krystof.io/dosbox-shaders-comparison-for-modern-dos-retro-gaming/feed/</wfw:commentRss>
			<slash:comments>18</slash:comments>
		
		<enclosure url="https://krystof.io/wp-content/uploads/2020/06/dune-intro-chipmunk.mp3" length="184621" type="audio/mpeg" />
<enclosure url="https://krystof.io/wp-content/uploads/2020/06/dune-intro-normal.mp3" length="184621" type="audio/mpeg" />

			</item>
		<item>
		<title>Patching the VICE emulator to light up floppy drive LEDs</title>
		<link>https://krystof.io/patching-the-vice-emulator-to-light-up-floppy-drive-leds/</link>
					<comments>https://krystof.io/patching-the-vice-emulator-to-light-up-floppy-drive-leds/#respond</comments>
		
		<dc:creator><![CDATA[Eric R. Krystof]]></dc:creator>
		<pubDate>Sat, 15 Feb 2020 17:03:24 +0000</pubDate>
				<category><![CDATA[Retro Gaming]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[Commodore]]></category>
		<category><![CDATA[VICE]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[Emulation]]></category>
		<guid isPermaLink="false">https://krystof.io/?p=1379</guid>

					<description><![CDATA[<p>To make the miniature floppy drive LED light up when VICE is using the virtual disk image, we need to patch VICE source code and write some new code to pass instructions on to the PI and toggle the LED activity light.</p>
<p>The post <a rel="nofollow" href="https://krystof.io/patching-the-vice-emulator-to-light-up-floppy-drive-leds/">Patching the VICE emulator to light up floppy drive LEDs</a> appeared first on <a rel="nofollow" href="https://krystof.io">Krystof.IO</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>In a previous article of the <a href="https://krystof.io/series/diorama-64">Diorama 64</a> series, we <a href="https://krystof.io/installing-the-vice-commodore-emulator-for-console-mode-on-a-fresh-raspberry-pi-4/">installed VICE 3.4</a>, unmodified, on our Raspberry Pi 4.  I didn&#8217;t cover any customization of <a rel="noreferrer noopener" label="VICE  (opens in a new tab)" href="http://vice-emu.sourceforge.net/" target="_blank" class="broken_link">VICE </a>in that article because I wanted to &#8216;walk before I run&#8217;.  However, our goal is to take a miniature floppy drive model, shove a LED into it, and have our VICE emulator control when the LED blinks on or off, mirroring the Commodore 1541 disk drive activity LED.  This article won&#8217;t cover the circuit itself (that&#8217;s a later article), but it is focused on modifying the VICE source code, and using some Python to transfer data from VICE and drive the Raspberry PI&#8217;s GPIO pins, which would later drive an LED light.</p>



<p>While the circuit details will come in a later article, here&#8217;s a little visual of the circuit setup &#8211; a Raspberry Pi 4 with GPIO pins attached to a breakout board, attached to a breadboard.  The top breadboard is used to drive a separate power source for the LEDs, but you can see the green &#8216;power&#8217; LEDs and one of the red &#8216;activity&#8217; LEDs light up there, that&#8217;s all driven by the Raspberry PI and VICE.</p>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="866" height="506" src="https://krystof.io/wp-content/uploads/2020/02/vice-python-test-circuit.jpg" alt="" class="wp-image-1385" srcset="https://krystof.io/wp-content/uploads/2020/02/vice-python-test-circuit.jpg 866w, https://krystof.io/wp-content/uploads/2020/02/vice-python-test-circuit-300x175.jpg 300w, https://krystof.io/wp-content/uploads/2020/02/vice-python-test-circuit-768x449.jpg 768w, https://krystof.io/wp-content/uploads/2020/02/vice-python-test-circuit-585x342.jpg 585w" sizes="(max-width: 866px) 100vw, 866px" /><figcaption class="wp-element-caption">Pretend those LEDs are inside tiny disk drive models. </figcaption></figure>



<h2 class="wp-block-heading" id="h-high-level-design">High Level Design</h2>



<p>Since VICE is an open source project (thank goodness!), I figured I&#8217;d need to get in that code and see if I can detect when the virtual floppy drives are being used.  If I could do that, I&#8217;d want to send that data to a different program that would be responsible for driving the Raspberry Pi GPIO pins, which then drive the LEDs.  I purposefully did not want to drive the LEDs directly from VICE itself &#8211; I wanted to affect the actual emulator process as little as possible.  Just enough to get the data out of VICE.  After that, some other process takes the data and controls the circuit.  The secondary program would be written in Python, primarily because it&#8217;s very easy to interface with the Raspberry PI with the Python GPIO libraries.  VICE, of course, is written in C.</p>



<p>So I&#8217;d have a C program that gathers data, and a Python program that does something with it.  We typically call that a <strong>Publisher/Subscriber</strong> scenario.  VICE is the <em><strong>Publisher</strong></em> as it is sourcing data, and making it available (publishing) for other processes to use, and VICE isn&#8217;t getting any data back &#8211; this is a one-sided conversation.  Our Python program will be one of the <strong><em>Subscribers</em></strong><em> </em>as it will poll for new &#8216;messages&#8217; or changes in state.  The Python program will then, in turn, send signals via the GPIO library and Raspberry PI GPIO pins to the Darlington Array, which controls individual LEDs, namely our Commodore 1541 Floppy Disk Drive Activity Lights.  Here&#8217;s a high level flow:</p>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="1024" height="576" src="https://krystof.io/wp-content/uploads/2020/02/2020-02-06_15-28-45-1024x576.jpg" alt="" class="wp-image-1387" srcset="https://krystof.io/wp-content/uploads/2020/02/2020-02-06_15-28-45-1024x576.jpg 1024w, https://krystof.io/wp-content/uploads/2020/02/2020-02-06_15-28-45-300x169.jpg 300w, https://krystof.io/wp-content/uploads/2020/02/2020-02-06_15-28-45-768x432.jpg 768w, https://krystof.io/wp-content/uploads/2020/02/2020-02-06_15-28-45-1170x658.jpg 1170w, https://krystof.io/wp-content/uploads/2020/02/2020-02-06_15-28-45-585x329.jpg 585w, https://krystof.io/wp-content/uploads/2020/02/2020-02-06_15-28-45.jpg 1440w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">High level design flow &#8211; in this article we cover VICE and Python.</figcaption></figure>



<p>The first real question I pondered was how I&#8217;d get a C program and a Python program on a Raspberry PI to share data, even if the conversation is one-sided.  I figured I had four options off the top of my head:</p>



<ol>
<li><strong>Datafile access</strong> &#8211; Vice writes to a file that the Python program constantly reads from to determine drive status.  While this is definitely feasible, I wanted to avoid constant file-system access, OS caching or not.  The LED is meant to blink on and off rapidly, that&#8217;s a lot of file updates to apply on a SD card.</li>



<li><strong>Networking Channel</strong> &#8211; UDP or TCP, some sort of client/server or packet broadcast.  This would be necessary if the diorama was remote (an interesting idea), but ultimately the emulator and the consumer are on the same machine, so I wanted to keep the communications channel a little tighter.</li>



<li><strong>UNIX Sockets</strong> &#8211; Since the Raspberry Pi 4 is running Raspbian, it supports UNIX style sockets for a simple IPC (Inter-process Communication) channel between the VICE and Python processes.  However, it&#8217;s still a lot of code to inject into VICE.</li>



<li><strong><em>The Winner</em> &#8211; Shared Memory</strong> &#8211; I finally decided on a shared memory solution to avoid a lot of unnecessary and potentially harmful patching to VICE with any networking related code (the less I&#8217;m in VICE the less I affect its processing), along with Python recently getting support for shared memory between disparate processes with Python 3.8 and above.  </li>
</ol>



<p>While we are calling this a &#8216;Publisher/Subscriber&#8217; model, it&#8217;s a very loose fit &#8211; there&#8217;s no middle-ware here handling message flow &#8211; it&#8217;s a bit bucket we poll for state changes every few milliseconds.  Therefore, I hesitate to apply the terminology of &#8216;Publisher/Subscriber&#8217; without a few grains of salt.   Thy key point: VICE is decoupled from the consuming process(es).</p>



<h2 class="wp-block-heading" id="h-patching-vice">Patching VICE</h2>



<p>Remember where we compiled <a href="https://krystof.io/installing-the-vice-commodore-emulator-for-console-mode-on-a-fresh-raspberry-pi-4/">VICE on the command line</a>?  Even if a binary was available, the reason why I wanted to compile VICE was because I knew I&#8217;d be tinkering with the source code.  To that end, I downloaded their SVN source and started searching through the code for key strings like &#8216;1541&#8217;, &#8216;drive&#8217;, &#8216;floppy&#8217;, etc. until I found drive.c and drive.h.  I won&#8217;t include the whole pieces here, but this part is what I found particularly interesting &#8211; I wanted to find some place to initialize the shared memory, and some place to write to it so we can &#8216;publish&#8217; our floppy drive status updates.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: cpp; title: ; notranslate">
/* Initialize the hardware-level drive emulation (should be called at least
   once before anything else).  Return 0 on success, -1 on error.  */
int drive_init(void)
{
    unsigned int dnr;
    drive_t *drive;

    if (rom_loaded) {
        return 0;
    }

//..... More
}
</pre></div>


<p>Great!  <em>drive_init</em> sounds like a good hook method &#8211; we don&#8217;t want to constantly be creating shared memory segments, create it once, but write to it many times.  Here&#8217;s where I figured I&#8217;d place the &#8216;publishing&#8217; code:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: cpp; title: ; notranslate">
static void drive_led_update(drive_t *drive, drive_t *drive0)
{
    int my_led_status = 0;
    CLOCK led_period;
    unsigned int led_pwm;

    /* Actually update the LED status only if the `trap idle&#039;
       idling method is being used, as the LED status could be
       incorrect otherwise.  */

    if (drive0-&gt;idling_method != DRIVE_IDLE_SKIP_CYCLES) {
        my_led_status = drive-&gt;led_status;
    }

//More.....
}
</pre></div>


<p>So now, we know the two spots that sound like they&#8217;d be great for initialization and continuous updates of our shared memory with drive status.  Let&#8217;s look at the modifications necessary, then.   Our goal is to allocate some shared memory (just enough to hold drive status for drive devices 8 through 11), and when VICE is updating it&#8217;s UI LED, we want to update shared memory with that status, a simple 1 or 0 toggle will suffice.  That&#8217;s a pretty straightforward hook!</p>



<h3 class="wp-block-heading" id="h-modifications-for-drive-c"><strong>Modifications for drive.c</strong></h3>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: cpp; title: ; notranslate">
#include &lt;fcntl.h&gt;
#include &lt;sys/shm.h&gt;
#include &lt;sys/stat.h&gt;
#include &lt;sys/mman.h&gt;
#include &lt;unistd.h&gt;

const char *led_shm_name = &quot;vice-drive-led-shm&quot;;

void *viceDriveLedShmPointer;

void init_drive_led_shm(void) {

	int shm_fd;

	const int SIZE = 16;

	/* create the shared memory object */
	shm_fd = shm_open(led_shm_name, O_CREAT | O_RDWR, 0666);

	/* configure the size of the shared memory object */
	ftruncate(shm_fd, SIZE);

	/* memory map the shared memory object */
	viceDriveLedShmPointer = mmap(0, SIZE, PROT_WRITE, MAP_SHARED, shm_fd, 0);

	sprintf(viceDriveLedShmPointer, &quot;%s&quot;, &quot;80900010&quot;);
}

void update_shm_drive_status(unsigned int driveNumber,
		int driveLedStatus) {
//      Uncomment for some simple and extreme debugging
//	log_warning(drive_log, &quot;Hey! Drive %d Status : %d&quot;, driveNumber,
//			driveLedStatus);

	if (drive_init_was_called) {
		((char*) viceDriveLedShmPointer)&#91;(driveNumber * 2) + 1] = (
				driveLedStatus == 0 ? &#039;0&#039; : &#039;1&#039;);
	}
}

//  Call our initialization method from drive_init
init_drive_led_shm();

//  Add this to update our status in the existing function drive_led_update
update_shm_drive_status(drive-&gt;mynumber, my_led_status);
</pre></div>


<h3 class="wp-block-heading" id="h-modifications-to-drive-h"><strong>Modifications to drive.h</strong></h3>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: cpp; title: ; notranslate">
extern void init_drive_led_shm(void);
extern void update_shm_drive_status(unsigned int driveNumber, int driveLedStatus);
</pre></div>


<h3 class="wp-block-heading" id="h-modifications-for-compilation"><strong>Modifications for compilation</strong></h3>



<p>There&#8217;s not much else to this &#8211; all I needed to add  (and this was a quite a bit of stumbling around on my part as I&#8217;m not comfortable or familiar with automake/autoconf) was adding the system libraries to work with shared memory to the configuration file configure.proto, around line 3316, before references to GFXOUTPUT_DRIVERS</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
dnl Patch to add -lrt for shared memory IPC work
echo &quot;Patch to add -lrt for shared memory IPC work&quot;
old_LIBS=&quot;$LIBS&quot;
LIBS=&quot;$LIBS -lrt&quot;
</pre></div>


<h3 class="wp-block-heading" id="h-github-repo">Github repo</h3>



<p>Of course, you don&#8217;t have to copy these and paste them yourselves.  I put a GitHub repo for my modifications here:</p>



<p><a href="https://github.com/erkrystof/vice">https://github.com/erkrystof/vice</a></p>



<p>You&#8217;ll want to check the tags for &#8216;pure VICE&#8217; and tags for my modifications to see deltas or pull the version you desire.</p>



<p>When I wrote this &#8211; there was one tag that represented my modifications and VICE 3.4 combined:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
git clone --single-branch --branch 3.4-Modded-1.0 https://github.com/erkrystof/vice
</pre></div>


<h2 class="wp-block-heading" id="h-running-vice-with-our-patch">Running VICE with our patch</h2>



<p>After running the same build commands as I did when installing basic VICE, executing the binary should have no discernible difference (unless you un-comment that log statement) in the logs for the way VICE handles.</p>



<p>However, you should now notice there&#8217;s a piece of shared memory  you can see, and that you can read, given that everything in *nix is a file.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
pi@vice-pi:/dev/shm $ ls -l
total 4
-rw-r--r-- 1 pi pi 16 Feb  9 09:16 vice-drive-led-shm
pi@vice-pi:/dev/shm $ cat vice-drive-led-shm
80900010
pi@vice-pi:/dev/shm $

</pre></div>


<p>Excellent, we now know it&#8217;s working!  If I loop over that in an SSH console, just to see, and run VICE and load a floppy, you should see the second byte (0/1 &#8211; the drive 8 status LED) flip between 1 and 0.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
for i in {1..10000}; do cat vice-drive-led-shm; echo ... Counter: $i; done
#Sample output:
80900010... Counter: 43
80900010... Counter: 44
80900010... Counter: 45
81900010... Counter: 46  &lt;----- We have activity on drive 8
81900010... Counter: 47
81900010... Counter: 48
81900010... Counter: 49
</pre></div>


<p>Looking good so far.  So VICE is essentially done &#8211; it&#8217;s &#8216;publishing&#8217; drive status to an area in shared memory that we&#8217;ll now want to read from and drive the LEDs connected to the Raspberry Pi GPIO pins.</p>



<h2 class="wp-block-heading" id="h-reading-the-1541-drive-status-with-python">Reading the 1541 drive status with Python</h2>



<p>We&#8217;re halfway there &#8211; the next step is to work on a separate process &#8211; our subscriber that reads the VICE drive status and sends commands to the Raspberry Pi&#8217;s GPIO pins to drive our LEDs.  I could have done this in C, matching how we read shared memory that we&#8217;re writing to in VICE, but I wasn&#8217;t familiar with driving a Raspberry Pi&#8217;s GPIO pins from C.  I am a bit more comfortable with the GPIO libraries available in Python, however, though the question of reading shared memory needed an answer.</p>



<p>Granted, I could probably just read from <code>/dev/shm/vice-drive-led-shm</code>, but I really wanted to keep this semi-portable in the sense that I wanted to use the available shared-memory libraries instead of  a known *nix-specific file behavior.  After doing some research on Python and shared memory, it turns out we need a more recent version of Python than may come with your default Raspbian install &#8211; Python 3.8 or greater.</p>



<h3 class="wp-block-heading" id="h-python-3-8-or-greater-and-rpi-gpio-libraries">Python 3.8 or greater and RPi.GPIO libraries</h3>



<p>For that installation, I&#8217;m going to divert away from this article to a separate one that&#8217;s not necessarily part of the series as reference if you need it &#8211; <a href="https://krystof.io/installing-alternative-python-versions-on-raspberry-pi/">How to install Python 3.8 on the Raspberry Pi</a>. </p>



<p>If you already have Python 3.8 or greater, you&#8217;ll just need to make sure you have the RPi GPIO library installed:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
sudo python3.8 -m pip install RPi.GPIO
</pre></div>


<h3 class="wp-block-heading" id="h-a-simple-python-client">A simple Python client</h3>



<p>The latest source code for the Python piece is available on <a rel="noreferrer noopener" aria-label="GitHub (opens in a new tab)" href="https://github.com/erkrystof/diorama-64-1541-status-consumer-gpio-led-driver" target="_blank">GitHub</a>, although I&#8217;ll go over this roughly below.  </p>



<div data-padding="10" class="wp-block-simple-blocks-info-block" style="background-color:#000000;color:#ffffff;padding:10px"><div data-iconsize="20" data-iconspace="20" class="icon" style="margin-right:20px"><svg aria-hidden="true" role="img" focusable="false" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewbox="0 0 20 20" class="dashicon dashicons-info"><path d="M10 2c4.42 0 8 3.58 8 8s-3.58 8-8 8-8-3.58-8-8 3.58-8 8-8zm1 4c0-.55-.45-1-1-1s-1 .45-1 1 .45 1 1 1 1-.45 1-1zm0 9V9H9v6h2z"></path></svg></div><div>I&#8217;m not a Python programmer by trade &#8211; this was just enough to illustrate the point of reading shared memory and routing commands to the Raspberry Pi, not a gold standard of Python coding.</div></div>



<h4 class="wp-block-heading" id="h-initialization">Initialization</h4>



<p>Let&#8217;s look at the first chunk, primarily initialization and some structure:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: python; title: ; notranslate">
powerLedsPin = 23
drive8ActivityPin = 27
drive9ActivityPin = 22

DRIVE_8_ACTIVITY_INDEX = 1
DRIVE_9_ACTIVITY_INDEX = 3

GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
GPIO.setup(&#91;powerLedsPin,drive8ActivityPin,drive9ActivityPin],
        GPIO.OUT, initial=GPIO.HIGH)
</pre></div>


<p>My diorama has four &#8216;devices&#8217; &#8211; two 1541 floppy drives, a Commodore keyboard, and a Commodore monitor.  We use one pin for all green &#8216;power&#8217; LEDs, since I didn&#8217;t feel like controlling power LEDs separately, it&#8217;s all the same output.  For the floppy drive activity LEDs, however, I needed them controlled separately, so I created a drive 8 and drive 9 pin and reserved them to pins 27 and 22, respectively.</p>



<p>After that I&#8217;m setting up the state to be HIGH &#8211; initialize all LEDs as on.</p>



<h4 class="wp-block-heading" id="h-load-the-shared-memory-reference">Load the shared memory reference</h4>



<p>Our primary code must first initialize the reference to shared memory:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: python; title: ; notranslate">
try:
    print (&quot;Consumix Python version starting up.&quot;)

    while (True):
        try:
            shm_vice = shared_memory.SharedMemory(name=&quot;vice-drive-led-shm&quot;, create=False, size=16)
            break;
        except Exception as e:
            print (e)
            print (&quot;Error Trying to Open Shared Memory... Trying again in a bit.&quot;)
            time.sleep(.5)
            continue

    print (&quot;Shared memory found, let&#039;s read it.&quot;)
</pre></div>


<p> We&#8217;re using the same shared memory name we used in VICE, and we say &#8216;create=False&#8217; since VICE is responsible for creating the shared memory object &#8211; we are just reading 16 bytes worth.  In the case that the Python program starts before VICE, we catch the exception and try again in a little bit.  I had to add that slightly fault tolerant try/catch loop as this Python client ends up staring <em>before</em> VICE when I startup my Raspberry Pi.</p>



<h4 class="wp-block-heading" id="h-read-shared-write-led">Read Shared, Write LED</h4>



<p>Now that we&#8217;ve loaded our shared memory reference, we read from the shared memory, place it into a character array, and update the LEDs with a loop and a function:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: python; title: ; notranslate">
while (True):
        driveData = array.array(&#039;b&#039;,shm_vice.buf&#91;:8])
        driveDataString = driveData.tostring().decode(&quot;utf-8&quot;)
        updateLEDLighting(driveDataString)
        time.sleep(0.025)

#... more stuff after....
#update function for reference:

def updateLEDLighting(driveDataString):
    if (driveDataString&#91;DRIVE_8_ACTIVITY_INDEX] == &#039;1&#039;):
        GPIO.output(drive8ActivityPin,GPIO.HIGH)
    else:
        GPIO.output(drive8ActivityPin,GPIO.LOW)

    if (driveDataString&#91;DRIVE_9_ACTIVITY_INDEX] == &#039;1&#039;):
        GPIO.output(drive9ActivityPin,GPIO.HIGH)
    else:
        GPIO.output(drive9ActivityPin,GPIO.LOW)
</pre></div>


<p>It&#8217;s a pretty simple program overall &#8211; but it does the job.  Since I only ended up wiring up two drives, I only read the drive 8 and 9 data, and ignore 10 and 11.</p>



<h3 class="wp-block-heading" id="h-a-note-on-python-shared-memory">A note on Python shared memory</h3>



<p>This isn&#8217;t as fault tolerant as I&#8217;d like though &#8211; if you quit your Python client, the shared memory reference seems to be <strong><em>destroyed</em></strong> &#8211; which completely baffles me.  The creator of a resource is in charge of closing it, not some other process.  So if VICE is creating the shared memory, I could understand if my Python client needs to open and close a <em>reference</em>, but not the shared memory itself.  </p>



<p>Regardless, when I close my Python client, it destroys the shared memory object completely, even if I try to &#8216;close&#8217; the reference ahead of time.  Perhaps I&#8217;ve wired something up wrong here &#8211; but i think, based on some of these links referencing the shared-memory usage in Python 3.8, that I&#8217;m not entirely crazy.</p>



<p><a rel="noreferrer noopener" aria-label=" (opens in a new tab)" href="https://bugs.python.org/issue38119" target="_blank">https://bugs.python.org/issue38119</a></p>



<p>Now, I&#8217;m not really worried about this myself &#8211; but it could be an interesting read for others &#8211; as far as my Python client goes, I don&#8217;t need to restart it, so it shouldn&#8217;t start closing the shared memory VICE created on me.  What I may need to do now and then is restart VICE, however, and this setup handles that just fine (my patched-VICE simply uses the existing shared-memory object and the Python client keeps reading happily).</p>



<h2 class="wp-block-heading" id="h-the-outcome">The outcome</h2>



<p>Load up VICE and the Python client, and watch your GPIO pins toggle high and low with drive activity.  You can debug by tailing the shared memory object as we did above, you could use an oscilloscope or multimeter to watch some voltage changes on the GPIO pins, or you could do what I did &#8211; have some LEDs on the pins and watch them blink on and off &#8211; which is exactly what I&#8217;m looking for.</p>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="1024" height="576" src="https://krystof.io/wp-content/uploads/2020/02/20200105_141239-1024x576.jpg" alt="" class="wp-image-1417" srcset="https://krystof.io/wp-content/uploads/2020/02/20200105_141239-1024x576.jpg 1024w, https://krystof.io/wp-content/uploads/2020/02/20200105_141239-300x169.jpg 300w, https://krystof.io/wp-content/uploads/2020/02/20200105_141239-768x432.jpg 768w, https://krystof.io/wp-content/uploads/2020/02/20200105_141239-1536x864.jpg 1536w, https://krystof.io/wp-content/uploads/2020/02/20200105_141239-scaled.jpg 2048w, https://krystof.io/wp-content/uploads/2020/02/20200105_141239-1170x658.jpg 1170w, https://krystof.io/wp-content/uploads/2020/02/20200105_141239-1920x1080.jpg 1920w, https://krystof.io/wp-content/uploads/2020/02/20200105_141239-585x329.jpg 585w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">Green Power LEDs are go, and drive 8 is active (Red LED lit)</figcaption></figure>



<p></p>
<p>The post <a rel="nofollow" href="https://krystof.io/patching-the-vice-emulator-to-light-up-floppy-drive-leds/">Patching the VICE emulator to light up floppy drive LEDs</a> appeared first on <a rel="nofollow" href="https://krystof.io">Krystof.IO</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://krystof.io/patching-the-vice-emulator-to-light-up-floppy-drive-leds/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		
		<series:name><![CDATA[Diorama 64]]></series:name>
	</item>
		<item>
		<title>Installing the VICE Commodore Emulator for Console Mode on a fresh Raspberry Pi 4</title>
		<link>https://krystof.io/installing-the-vice-commodore-emulator-for-console-mode-on-a-fresh-raspberry-pi-4/</link>
					<comments>https://krystof.io/installing-the-vice-commodore-emulator-for-console-mode-on-a-fresh-raspberry-pi-4/#comments</comments>
		
		<dc:creator><![CDATA[Eric R. Krystof]]></dc:creator>
		<pubDate>Sun, 12 Jan 2020 19:46:25 +0000</pubDate>
				<category><![CDATA[Retro Gaming]]></category>
		<category><![CDATA[VICE]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[Commodore]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Emulation]]></category>
		<guid isPermaLink="false">https://krystof.io/?p=999</guid>

					<description><![CDATA[<p>Let's download, compile, and install the VICE Commodore 64 emulator on a fresh Raspberry Pi 4 install. We'll make sure it works in a non windows console by running a Commodore demo program.</p>
<p>The post <a rel="nofollow" href="https://krystof.io/installing-the-vice-commodore-emulator-for-console-mode-on-a-fresh-raspberry-pi-4/">Installing the VICE Commodore Emulator for Console Mode on a fresh Raspberry Pi 4</a> appeared first on <a rel="nofollow" href="https://krystof.io">Krystof.IO</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>At the time of this writing, there&#8217;s no binary package ready to install on the Raspberry Pi 4.  Also, I need to make sure I can run the <a label=" (opens in a new tab)" rel="noreferrer noopener" href="http://vice-emu.sourceforge.net/" target="_blank" class="broken_link">VICE</a> emulator on the console and <strong>not</strong> in X-Windows for my diorama project.  That install isn&#8217;t difficult but isn&#8217;t a single line or two either, so we&#8217;ll start from scratch on a fresh Raspbian lite install.  This article assumes some familiarity with how VICE works.  Let&#8217;s install VICE on a Raspberry Pi 4! </p>



<h2 class="wp-block-heading" id="h-raspberry-pi-4-version-log">Raspberry Pi 4 Version Log</h2>



<div data-padding="10" class="wp-block-simple-blocks-info-block" style="background-color:#0010f4;color:#ffffff;padding:10px"><div data-iconsize="20" data-iconspace="20" class="icon" style="margin-right:20px"><span class="dashicon dashicons dashicons-info"></span></div><div>EVOLVING VERSIONS NOTE: <br>This document evolves over time &#8211; things change and old versions of Raspbian just stop being supported, and we try to make it work with the latest versions.  I&#8217;ve generally had better luck with Buster compared to Bullseye, but we try to get both up and running.</div></div>



<p>All of these in records in the table below imply the general settings changes to the VICE config presented later in the document (<em>VICE/PI General Settings I change regardless of version</em>).  Also, make sure to check out settings specific to the OS you&#8217;re using later in this document!</p>



<figure class="wp-block-table is-style-stripes"><table><tbody><tr><td>OK For Use</td><td>Raspberry PI OS Version</td><td>VICE Version</td><td>Raspi 4B Status PAL</td><td>Raspi 4B Status NTSC</td><td>Raspi 400 Status PAL</td><td>Raspi 400 Status NTSC</td><td>Install Script Links</td></tr><tr><td>Yes</td><td><a href="https://downloads.raspberrypi.org/raspios_lite_armhf/images/raspios_lite_armhf-2023-02-22/2023-02-21-raspios-bullseye-armhf-lite.img.xz">2023-02-21-raspios-bullseye-armhf-lite.img.xz</a></td><td>3.5 <a href="http://svn.code.sf.net/p/vice-emu/code/tags/v3.5/vice/" target="_blank" rel="noreferrer noopener">SVN</a>/ <a href="http://svn.code.sf.net/p/vice-emu/code/tags/v3.5/vice/NEWS" target="_blank" rel="noreferrer noopener">Changelog </a>/ <a href="https://sourceforge.net/projects/vice-emu/files/releases/vice-3.5.tar.gz/download" target="_blank" rel="noreferrer noopener" class="broken_link">Tarball</a></td><td>OK!</td><td>OK!</td><td>OK!</td><td>OK!</td><td><a href="https://github.com/erkrystof/vice/blob/master/install-vice-3.5-raspi-4-bullseye-2023-02-21.sh" target="_blank" rel="noreferrer noopener">GitHub </a>/ <a href="https://raw.githubusercontent.com/erkrystof/vice/master/install-vice-3.5-raspi-4-bullseye-2023-02-21.sh" target="_blank" rel="noreferrer noopener">Raw</a></td></tr><tr><td>Yes</td><td><a href="https://downloads.raspberrypi.org/raspios_oldstable_lite_armhf/images/raspios_oldstable_lite_armhf-2023-02-22/2023-02-21-raspios-buster-armhf-lite.img.xz">2023-02-21-raspios-buster-armhf-lite.img.xz</a></td><td>3.5 <a href="http://svn.code.sf.net/p/vice-emu/code/tags/v3.5/vice/" target="_blank" rel="noreferrer noopener">SVN</a>/ <a href="http://svn.code.sf.net/p/vice-emu/code/tags/v3.5/vice/NEWS" target="_blank" rel="noreferrer noopener">Changelog </a>/ <a href="https://sourceforge.net/projects/vice-emu/files/releases/vice-3.5.tar.gz/download" target="_blank" rel="noreferrer noopener" class="broken_link">Tarball</a></td><td>OK!</td><td>OK!</td><td>OK!</td><td>OK!</td><td><a href="https://github.com/erkrystof/vice/blob/master/install-vice-3.5-raspi-4-buster-2023-02-21.sh" target="_blank" rel="noreferrer noopener">GitHub </a>/ <a href="https://raw.githubusercontent.com/erkrystof/vice/master/install-vice-3.5-raspi-4-buster-2023-02-21.sh" target="_blank" rel="noreferrer noopener">Raw</a> </td></tr><tr><td>Yes</td><td><a href="https://downloads.raspberrypi.org/raspios_lite_armhf/images/raspios_lite_armhf-2023-02-22/2023-02-21-raspios-bullseye-armhf-lite.img.xz" rel="nofollow">2023-02-21-raspios-bullseye-armhf-lite.img.xz</a>  </td><td>3.7.1 <a href="http://svn.code.sf.net/p/vice-emu/code/tags/v3.7.1/vice/" target="_blank" rel="noreferrer noopener nofollow">SVN</a> / <a href="http://svn.code.sf.net/p/vice-emu/code/tags/v3.7.1/vice/NEWS" target="_blank" rel="noreferrer noopener nofollow">Changelog</a> / <a href="https://sourceforge.net/projects/vice-emu/files/releases/vice-3.7.1.tar.gz/download" rel="nofollow" class="broken_link">Tarball</a></td><td>OK!</td><td>OK!</td><td>OK!</td><td>OK!</td><td><a href="https://github.com/erkrystof/vice/blob/master/install-vice-3.7.1-raspi-4-bullseye-2023-02-21.sh" target="_blank" rel="noreferrer noopener">GitHub</a> / <a href="https://raw.githubusercontent.com/erkrystof/vice/master/install-vice-3.7.1-raspi-4-bullseye-2023-02-21.sh" target="_blank" rel="noreferrer noopener">Raw</a> </td></tr><tr><td>Yes</td><td><a href="https://downloads.raspberrypi.org/raspios_oldstable_lite_armhf/images/raspios_oldstable_lite_armhf-2023-02-22/2023-02-21-raspios-buster-armhf-lite.img.xz" rel="nofollow">2023-02-21-raspios-buster-armhf-lite.img.xz</a></td><td>3.7.1 <a href="http://svn.code.sf.net/p/vice-emu/code/tags/v3.7.1/vice/" target="_blank" rel="noreferrer noopener nofollow">SVN</a> / <a href="http://svn.code.sf.net/p/vice-emu/code/tags/v3.7.1/vice/NEWS" target="_blank" rel="noreferrer noopener nofollow">Changelog</a> / <a href="https://sourceforge.net/projects/vice-emu/files/releases/vice-3.7.1.tar.gz/download" class="broken_link">Tarball</a></td><td>OK!</td><td>OK!</td><td>OK!</td><td>OK!</td><td><a href="https://github.com/erkrystof/vice/blob/master/install-vice-3.7.1-raspi-4-buster-2023-02-21.sh" target="_blank" rel="noreferrer noopener">GitHub </a>/ <a href="https://raw.githubusercontent.com/erkrystof/vice/master/install-vice-3.7.1-raspi-4-buster-2023-02-21.sh" target="_blank" rel="noreferrer noopener">Raw</a> </td></tr></tbody></table><figcaption class="wp-element-caption">This is your VICE life now, and it&#8217;s changing every SVN tag at a time.</figcaption></figure>



<div data-padding="10" class="wp-block-simple-blocks-info-block" style="background-color:#3279dd;color:#ffffff;padding:10px"><div data-iconsize="20" data-iconspace="20" class="icon" style="margin-right:20px"><span class="dashicon dashicons dashicons-info"></span></div><div>Which binary to run? x64sc or x64?  The configure line from VICE in the script has &#8216;&#8211;enable-x64&#8217;.  By default VICE builds create an x64sc binary, but NOT an x64 binary anymore.  What&#8217;s the difference?  Seems the SC binary is preferred as it focuses on accuracy of emulation over speed.  That being said, I find I like to use x64 on the C64 Demo Scene that still lives on to this day &#8211; otherwise the demos were occasionally quite choppy.  For normal game play I use x64sc but fall back to x64 if I detect heavy lag.  Your mileage may vary.  I find a lot of C64 scene demos don&#8217;t work well with x64sc, and I often fall back to x64.</div></div>



<p>Simplest way to execute the scripts is to copy the Raw link and on your raspberry pi console /ssh, do this:</p>



<pre class="wp-block-code"><code>wget -O - &lt;raw script url> | bash</code></pre>



<h3 class="wp-block-heading" id="h-test-programs">Test Programs</h3>



<p>I&#8217;ve also added some <a href="https://github.com/erkrystof/vice/tree/master/testprograms" target="_blank" rel="noreferrer noopener nofollow">test programs</a> I can easily download from my VICE script github.  I use these to test very basic SID/graphics functionality.  Here are the credits to the great demo makers that made them:</p>



<p><strong>delaytest.d64</strong> &#8211; Written by the 8-bit guy &#8211; useful for testing lag, and also gives an audio ping each time you press a key. I start here for just the most basic &#8216;is this thing on?&#8217; approach.</p>



<p><strong>Booze Design &#8211; Remains (PAL)</strong> &#8211; Lovely haunting track.  <a href="https://csdb.dk/release/?id=187524" target="_blank" rel="noreferrer noopener">https://csdb.dk/release/?id=187524</a></p>



<p><strong>SHAPE &#8211; Disco Apocalypso</strong> <strong>(PAL)</strong>  &#8211; Up beat and great visuals. <a href="https://csdb.dk/release/?id=133935" target="_blank" rel="noreferrer noopener">https://csdb.dk/release/?id=133935</a></p>



<p><strong>Fairlight &#8211; 2600 (PAL) &#8211; </strong><a href="https://csdb.dk/release/?id=197187" target="_blank" rel="noreferrer noopener">https://csdb.dk/release/?id=197187</a></p>



<p><strong>Style &#8211; Shine On (NTSC)</strong> &#8211; <a href="https://style64.org/release/shine-style" target="_blank" rel="noreferrer noopener">https://style64.org/release/shine-style</a> &#8211; At least some graphics and smooth SID music for NTSC testing</p>



<p>Looking for more demos and such?</p>



<p><a href="https://csdb.dk" target="_blank" rel="noreferrer noopener">https://csdb.dk</a></p>



<p><a href="http://www.atlantis-prophecy.org/recollection/?load=home" target="_blank" rel="noreferrer noopener">http://www.atlantis-prophecy.org/recollection/?load=home</a></p>



<h3 class="wp-block-heading">VICE/PI General Settings I change regardless of version</h3>



<p><em>Unless noted here, I don&#8217;t change any system settings on my raspberry pi workbench setup, except for enabling Wifi and SSH, everything is is left as the default when Raspberry Pi OS installs.</em></p>



<p>These seem to be the best general settings for things to play smoothly on the PI.  They mostly involve removing the raster line filter and adjusting audio settings.</p>



<ul>
<li>Apply these settings in your VICE Config:
<ol>
<li>Machine Settings -&gt; Model Settings -&gt; SID Settings:
<ol>
<li>SID Model -&gt; 8580 + digi boost (ReSID)</li>



<li>reSID sampling method -&gt; Fast</li>
</ol>
</li>



<li>Video Settings -&gt; Size Settings
<ol>
<li>Disable double size</li>



<li>Disable double scan</li>



<li>Select Fullscreen</li>
</ol>
</li>



<li>Video Settings -&gt; Render filter
<ol>
<li>Select &#8216;None&#8217;</li>
</ol>
</li>



<li>Sound Settings
<ol>
<li>Buffer size 50msec</li>



<li>Frequency 22050 Hz</li>
</ol>
</li>
</ol>
</li>
</ul>



<p>In C64 VICE Config form (/home/pi/.config/vice/sdl-vicerc, this looks like this:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
&#91;C64]
MenuKey=293
MenuKeyUp=273
MenuKeyDown=274
MenuKeyLeft=276
MenuKeyRight=275
MenuKeyPageUp=280
MenuKeyPageDown=281
MenuKeyHome=278
MenuKeyEnd=279
SoundDeviceName="alsa"
SoundSampleRate=22050
SoundBufferSize=50
AspectRatio="1.000000"
VICIIVideoCache=0
VICIIDoubleScan=0
VICIIDoubleSize=0
VICIIFullscreen=1
VICIIFilter=0
SDLStatusbar=1
SidResidSampling=0
SidEngine=1
SidModel=2
ETHERNETCARTBase=56832
Acia1Base=56832
</pre></div>


<p>Sometimes, I mess with the sound sample rate when I&#8217;m capturing HDMI output and streaming <em>It seems I need to set audio sample rate to 44100 to get my HDMI capture device to grab audio into OBS, but as far as the VICE/PI goes, I heard audio fine through my speakers.</em> (<code>SoundSampleRate=44100</code>)</p>



<p><em>If you need to change your sample rate if you&#8217;re capturing output</em>, you can try the various options in here: (Menu or config file)</p>



<ul>
<li>Sound Settings -&gt; 
<ul>
<li>Frequency 44100 Hz</li>
</ul>
</li>
</ul>



<p>This generally sets a config file line:</p>



<p><code>SoundSampleRate=44100</code></p>



<h3 class="wp-block-heading">VICE/PI Version specific settings I&#8217;ve changed</h3>



<h4 class="wp-block-heading">2023-02-21-raspios-buster-armhf-lite.img.xz / VICE specifics</h4>



<p><strong>Synopsis: </strong>Apply general settings and you&#8217;re good to go.</p>



<p><strong>Raw Notes:</strong> After applying recommended generic settings, test programs ran fine (Before that, no so much).  I was locked in at 100%/50fps using x64 and PAL/NTSC using the <strong>x64 </strong>binary.  The <strong>x64sc </strong>binary still chews more CPU and runs slightly slower (naturally).  <strong>I still recommend applying the generic settings I use though, since I had issues with NTSC (read on&#8230;)</strong></p>



<p>However, on NTSC, I do notice the CPU/FPS drop from 100% to 80%, jump back up again.  <strong>This was before applying my general settings.  </strong>Once I applied those, everything worked well, no stutters or CPU drops.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h4 class="wp-block-heading">2023-02-21-raspios-bullseye-armhf-lite.img.xz / VICE specifics</h4>



<p><strong>Synopsis: </strong>Apply general settings and change to fkms video driver, and then choose HDMI output in raspi-config.</p>



<p><strong>Raw Notes: </strong>After executing the script and applying the generic settings, I noticed the strange 100% to 80% CPU drops go away.  This has to be something with the audio layer, imho.  Now, I just wasn&#8217;t getting audio (maybe on headphones on the 4B, but the 400 doesn&#8217;t have a headphone jack)</p>



<p>When I switched default audio to HDMI 0 in raspi-config, <strong>that broke ALSA in vice</strong> (error message), but I also noticed even when playing demos, the CPU was locked at 100%.  Something with the sound layers&#8230;  I&#8217;ve tried changing to SDL and I get no audio at all (I&#8217;m only in console mode, remember)</p>



<p>So, next, I tried the <strong>no longer supported but still available fkms overlay</strong> setting in <strong>/boot/config.txt</strong>.  After setting that and rebooting, I was able to select HDMI in raspi-config and I got audio.  So far, so good.  I&#8217;m not happy about having to use fkms still for bullseye, but it at least got it working.</p>



<p>So, for me to get this working on Bullseye, I make the following changes:</p>



<ol>
<li>Make the general settings changes to sound/display in my general settings section (this is a must)</li>



<li>Bring in fkms driver for HDMI audio:</li>
</ol>



<p>Edit your <strong>/boot/config.txt</strong> and change the following:</p>



<p>BEFORE:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
# Enable DRM VC4 V3D driver
dtoverlay=vc4-kms-v3d
</pre></div>


<p>AFTER:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
# Enable DRM VC4 V3D driver
dtoverlay=vc4-fkms-v3d
</pre></div>


<p>You must reboot after <strong>/boot/config.txt</strong> changes. <strong>You must also go into raspi-config and choose your audio device</strong> (this is how I was able to get VICE HDMI Audio on the 400) </p>



<p>Side note: I had <strong>flashing video artifacts on bullseye</strong>, but <strong>only when I was going through a USB HDMI capture device</strong>.  Direct HDMI worked fine.  Not sure why video is flashing so much when not going through the USB HDMI capture device on bullseye when it didn&#8217;t happen on buster at all.  I&#8217;ve got another HDMI capture device I might use to see if it&#8217;s something specific with the flasher.  Is there some refresh rate configuration difference between buster and bullseye? Same hardware, same firmware, just different OS versions and vice dependencies.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p>The rest of the document is a bit of a ramble since these versions change all the time but it covers the high level.</p>



<p><strong><em>To that end, given all the changes that constantly happen in VICE, PI, and such, the video below is no longer 100% accurate.  It still covers the general setup tasks, but the script is the source of truth as versions and methods change over time.</em></strong></p>



<figure class="wp-block-embed aligncenter is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe loading="lazy" title="Installing the VICE Commodore Emulator for Console Mode on a Fresh Raspberry Pi 4" width="1170" height="658" src="https://www.youtube.com/embed/uRVTAgqs7pU?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
</div></figure>



<hr class="wp-block-separator has-css-opacity"/>



<div data-padding="10" class="wp-block-simple-blocks-info-block" style="background-color:#0010f4;color:#ffffff;padding:10px"><div data-iconsize="20" data-iconspace="20" class="icon" style="margin-right:20px"><span class="dashicon dashicons dashicons-info"></span></div><div>You may wonder why I am doing it this way vs RetroPie, Combian 64, or BMC64&#8230; I probably could have, but I knew I&#8217;d be in the VICE source code a bit in a later article so I wanted to start with the basics first and make sure I could compile VICE myself.  Plus, at this time , the packages referenced above aren&#8217;t completely ready for the Raspberry Pi 4. </div></div>



<hr class="wp-block-separator has-css-opacity"/>



<h2 class="wp-block-heading" id="h-hardware-before-the-software">Hardware before the Software</h2>



<p>This part is pretty simple &#8211; you&#8217;ll need:</p>



<ul>
<li>Raspberry Pi 4 Model B, or Raspberry Pi 3B+</li>



<li>Micro SD Card (we&#8217;re generally at the days of 16GB or higher)</li>



<li>Micro HDMI cable (or full HDMI if you&#8217;re using a Raspberry Pi 3B+)</li>



<li>Keyboard / Mouse for initial setup, Wifi connectivity for later SSH connectivity.</li>
</ul>



<div data-padding="10" class="wp-block-simple-blocks-info-block" style="background-color:#0010f4;color:#ffffff;padding:10px"><div data-iconsize="20" data-iconspace="20" class="icon" style="margin-right:20px"><span class="dashicon dashicons dashicons-info"></span></div><div>Got a Raspberry Pi 3B?  I&#8217;ve added notes on that at the very end of this document.</div></div>



<h2 class="wp-block-heading" id="h-write-the-raspberry-pi-4-image">Write The Raspberry Pi 4 Image</h2>



<p>We&#8217;ll start with a fresh SD Card and a <a aria-label=" (opens in a new tab)" href="https://www.raspberrypi.org" target="_blank" rel="noreferrer noopener">Raspberry Pi 4</a>.   We&#8217;re going to burn <a label=" (opens in a new tab)" href="https://www.raspberrypi.org/downloads/raspbian/" target="_blank" rel="noreferrer noopener" class="broken_link">Raspberry Pi OS L</a><a href="https://www.raspberrypi.org/downloads/raspbian/" class="broken_link">ite</a> (I&#8217;m not using a window environment) on to the SD Card using <a aria-label=" (opens in a new tab)" href="https://www.balena.io/etcher/" target="_blank" rel="noreferrer noopener">Balena Etcher</a>.</p>


<div class="wp-block-image is-style-default">
<figure class="aligncenter size-large"><img decoding="async" loading="lazy" width="515" height="309" src="https://krystof.io/wp-content/uploads/2019/12/balena-etcher.jpg" alt="" class="wp-image-1004" srcset="https://krystof.io/wp-content/uploads/2019/12/balena-etcher.jpg 515w, https://krystof.io/wp-content/uploads/2019/12/balena-etcher-300x180.jpg 300w" sizes="(max-width: 515px) 100vw, 515px" /></figure></div>


<h2 class="wp-block-heading" id="h-boot-the-raspberry-pi-and-get-connected"> Boot the Raspberry Pi and get connected.</h2>



<p>We know our default password is <em>raspberry</em> and our default user name is <em>pi</em>.  You should change these if you&#8217;re going to keep this install around.  Regardless, we need to set just a couple of things before we start with VICE &#8211; such as my desire for SSH access so I could copy/paste commands more easily.  Here are those steps after you give yourself a good old fashioned <code>sudo raspi-config</code>:</p>



<ol>
<li>Set hostname to vice-pi-install (This makes it unique and through <a href="https://www.howtogeek.com/167190/how-and-why-to-assign-the-.local-domain-to-your-raspberry-pi/" class="broken_link">bonjour </a>lets me access it from my Windows PC as <strong>vice-pi-install.local</strong>.)</li>



<li>Set WIFI up to my access point (Country Code and SSID)</li>



<li>Allow SPI interface access (my diorama is going to be controlling an LCD through SPI) &#8211; <strong>This is purely optional </strong>&#8211; I used it because I&#8217;m hooking up some custom circuits to my Pi.</li>



<li>Allow SSH interface access (so we can copy/paste from a Windows SSH client) &#8211; Optional if you just want to type all the commands directly to your Pi console.</li>



<li>Setup locale, keyboard, etc. </li>



<li>Verify Internet Connectivity (ping google.com)</li>



<li>Perform your normal <strong><code>apt update / apt upgrade</code></strong> commands to update your system.</li>
</ol>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
sudo apt update
sudo apt upgrade
</pre></div>


<h2 class="wp-block-heading" id="h-download-and-execute-the-install-script">Download and execute the install script</h2>



<p>I&#8217;ve created a few scripts for various versions to do all this work on a Pi Install.  Check the table at the very start of this document for matching scripts to install based on your PI or VICE or PI OS version  (Yeah, it can be that twitchy).  Download the script you want,  chmod +x the script, and run it.  Look it over yourself if you&#8217;re concerned about just running some guy&#8217;s script.</p>



<p>You can execute your script directly by doing this if you don&#8217;t feel like downloading it, chmod-ing it, and executing it manually:</p>



<pre class="wp-block-code"><code>wget -O - https://raw.githubusercontent.com/erkrystof/vice/master/&lt;insertscriptnamehere&gt;.sh | bash</code></pre>



<p id="block-6664aacb-64da-4b18-beca-9ec7d167a79c">What the script does at a high level:</p>



<ol>
<li>Performs the general sudo apt update/upgrade</li>



<li>Downloads SDL from libsdl.org</li>



<li>Compiles and installs SDL and other SDL libraries</li>



<li>Downloads VICE compilation dependencies</li>



<li>Downloads VICE source code from sourceforge.net</li>



<li>Configures VICE to enable fast-sid options and the x64 &#8216;old&#8217; binary build (as well as the new binary x64sc)</li>



<li>Installs VICE into your home directory (/home/pi/vice-&lt;version-number>) &#8211; Because I dislike /usr/local for vice.</li>



<li>Binaries will be in the bin directory of where we installed VICE.  You&#8217;d generally run x64 for the &#8216;older&#8217; but smoother for PAL Demos binary, or the x64sc (technically more accurate, but uses more CPU and causes PIs to stutter in demos)</li>
</ol>



<p>The latest version of the script will always be at the link above.  It&#8217;s configured so if it runs into any error, it aborts. </p>



<div data-padding="10" class="wp-block-simple-blocks-info-block" style="background-color:#0010f4;color:#ffffff;padding:10px"><div data-iconsize="20" data-iconspace="20" class="icon" style="margin-right:20px"><span class="dashicon dashicons dashicons-info"></span></div><div>This script takes about 45 minutes to execute.  You are free to examine the script ahead of time to make sure it seems safe for your system.  I promise I&#8217;m not doing anything untoward.  It&#8217;s downloading, compiling, and taking VICE straight from the source.</div></div>



<h3 class="wp-block-heading" id="h-why-compile-sdl-on-the-pi">Why compile SDL on the Pi?</h3>



<p>We used to have to do this from a fork from Retropie, and in previous cases before that I could just install the sdl libraries and use those.  However, I&#8217;ve found that every time I try to do that with the latest versions of Raspi-OS and VICE, I end up getting an SDL related error trying to draw the screen when launching from the console &#8211; so for now, I compile the SDL libraries on the Pi and things seem to work.  In previous versions of Buster, I couldn&#8217;t get this to work from SDL directly, I had to use RetroPie&#8217;s fork and manipulations on some videocore headers.  <em>I no longer need to do that for what I&#8217;m assuming are changes in the OS version over the past couple of years.</em></p>



<p><s><strong><em>We will build SDL2-2.0.14 from&nbsp;<a rel="noreferrer noopener" href="https://github.com/RetroPie/SDL-mirror" target="_blank">RetroPie’s fork</a>&nbsp;that has&nbsp;<a href="https://github.com/RetroPie/SDL-mirror/tree/retropie-2.0.14" target="_blank" rel="noreferrer noopener">Raspberry Pi specific modifications</a></em></strong>. Part of the compilation below is from RetroPie’s SDL 2.0 install script. To learn more about the excellent RetroPie project, head on over to their site&nbsp;<a rel="noreferrer noopener" href="https://retropie.org.uk/" target="_blank">here</a>.  I&#8217;ve made a fork off that repo and that&#8217;s where I&#8217;m pulling from in my script &#8211; it&#8217;s just in case I need to make any tweaks.</s></p>



<h2 class="wp-block-heading">Apply generic settings for sound/video options in VICE.</h2>



<p>See the <em>VICE/PI General Settings I change regardless of version</em> section for that.  Also, if you&#8217;re in Bullseye, there are some specific tweaks in the Bullseye section to apply.</p>



<h2 class="wp-block-heading" id="h-download-a-demo-and-see-it-perform-horribly-or-wonderfully">Download a demo and see it perform horribly or wonderfully?</h2>



<p>I downloaded a simple demo from csdb.dk by Booze Design known as &#8216;<a aria-label=" (opens in a new tab)" href="https://csdb.dk/release/?id=179123" target="_blank" rel="noreferrer noopener">The Elder Scrollers</a>&#8216;.  Downloaded the .D64 file and uploaded that to the VICE Pi.  Moving into the /home/pi/viceinstall/bin directory, I typed ./x64 and was greeted with an old blue friend:</p>



<figure class="wp-block-image size-large is-style-default"><img decoding="async" loading="lazy" width="1024" height="576" src="https://krystof.io/wp-content/uploads/2019/12/commodore-64-ready-1024x576.jpg" alt="" class="wp-image-1021" srcset="https://krystof.io/wp-content/uploads/2019/12/commodore-64-ready-1024x576.jpg 1024w, https://krystof.io/wp-content/uploads/2019/12/commodore-64-ready-300x169.jpg 300w, https://krystof.io/wp-content/uploads/2019/12/commodore-64-ready-768x432.jpg 768w, https://krystof.io/wp-content/uploads/2019/12/commodore-64-ready-1536x864.jpg 1536w, https://krystof.io/wp-content/uploads/2019/12/commodore-64-ready.jpg 1920w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">Hello, Retro my old friend&#8230;</figcaption></figure>



<p>Now, depending on how this all comes together, you might have a really tiny C64 screen in the corner of your big monitor.  Simply hit F12, scroll down to Video Settings -&gt; Screen Settings -&gt; Fullscreen.</p>



<p><strong>Noticing stuttering and other issues?  </strong>Look at the settings in the top part of the document that I apply generically as well as for certain OS/VICE combinations and try those.</p>



<h2 class="wp-block-heading" id="h-apply-settings-and-watch-a-demo-perform-smoothly">Apply settings and watch a demo perform smoothly</h2>



<p>Finally, after modifying my settings, restarting VICE, and after autostarting the demo image I downloaded, I was able to sit back and enjoy classic SID sound from the Elder Scrollers demo:</p>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="1024" height="576" src="https://krystof.io/wp-content/uploads/2019/12/the-elder-scrollers-1024x576.jpg" alt="" class="wp-image-1020" srcset="https://krystof.io/wp-content/uploads/2019/12/the-elder-scrollers-1024x576.jpg 1024w, https://krystof.io/wp-content/uploads/2019/12/the-elder-scrollers-300x169.jpg 300w, https://krystof.io/wp-content/uploads/2019/12/the-elder-scrollers-768x432.jpg 768w, https://krystof.io/wp-content/uploads/2019/12/the-elder-scrollers-1536x864.jpg 1536w, https://krystof.io/wp-content/uploads/2019/12/the-elder-scrollers.jpg 1920w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">I&#8217;ve come to scroll with you again&#8230;</figcaption></figure>



<p>With that, we finish the install of VICE on a Raspberry Pi 4 in console mode as the foundation of my Diorama 64 project.  Any thoughts or concerns, things that didn&#8217;t work well for you with your install?  Leave a comment down below or join the discord at <a rel="noreferrer noopener" aria-label="https://discord.gg/wbngTy8 (opens in a new tab)" href="https://discord.gg/wbngTy8" target="_blank">https://discord.gg/wbngTy8</a> and we can chat.  Next up: the Raspberry Pi 4 and the LCD display turned monitor.</p>



<h2 class="wp-block-heading" id="h-raspberry-pi-3b-instructions">Raspberry Pi 3B+ Instructions</h2>



<p>** May not work, I have NOT updated this yet for VICE 3.6.1 **</p>



<p>Generally, the build is very similar.  I&#8217;m going to skip all the discussion points and run down what I think seems to work on a Raspberry Pi 3B.  The key differences are how we build SDL.  I didn&#8217;t seem to need to change any graphic related driver setting to get this to work.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
sudo apt update
sudo apt upgrade

#SDL for Raspi-3B dependencies
sudo apt-get install libfontconfig-dev qt5-default automake mercurial \
 libtool libfreeimage-dev libopenal-dev libpango1.0-dev libsndfile-dev \
 libudev-dev libtiff5-dev libwebp-dev libasound2-dev libaudio-dev \
 libxrandr-dev libxcursor-dev libxi-dev libxinerama-dev libxss-dev \
 libesd0-dev freeglut3-dev libmodplug-dev libsmpeg-dev libjpeg-dev

mkdir ~/sdlwork
cd ~/sdlwork

hg clone http://hg.libsdl.org/SDL
cd SDL

./autogen.sh
./configure --disable-pulseaudio --disable-esd --disable-video-mir --disable-video-wayland \
 --disable-video-opengl --host=arm-raspberry-linux-gnueabihf
make
sudo make install

cd ~/sdlwork

wget http://www.libsdl.org/projects/SDL_image/release/SDL2_image-2.0.5.tar.gz
wget http://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.4.tar.gz
wget http://www.libsdl.org/projects/SDL_net/release/SDL2_net-2.0.1.tar.gz
wget http://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-2.0.15.tar.gz

tar zxvf SDL2_image-2.0.5.tar.gz
tar zxvf SDL2_mixer-2.0.4.tar.gz
tar zxvf SDL2_net-2.0.1.tar.gz
tar zxvf SDL2_ttf-2.0.15.tar.gz

cd SDL2_image-2.0.5 
./autogen.sh 
./configure 
make 
sudo make install
cd ..

cd SDL2_mixer-2.0.4
./autogen.sh 
./configure 
make 
sudo make install
cd ..

cd SDL2_net-2.0.1 
./autogen.sh 
./configure 
make 
sudo make install
cd ..

#Interestingly enough TTF builds just fine on the 3B.

cd SDL2_ttf-2.0.15
./autogen.sh
./configure
make
sudo make install
cd ..

#Now, on to VICE for the Raspi 3B

sudo apt install libmpg123-dev libpng-dev zlib1g-dev libasound2-dev libvorbis-dev libflac-dev \
 libpcap-dev automake bison flex subversion libjpeg-dev portaudio19-dev texinfo xa65

mkdir ~/vicework
cd ~/vicework

#3.4 is the latest VICE release
svn checkout svn://svn.code.sf.net/p/vice-emu/code/tags/v3.4/

cd ./v3.4/vice
./autogen.sh 
./configure --prefix=/home/pi/viceinstall --enable-sdlui2 --without-oss --enable-ethernet \
 --disable-catweasel --without-pulse
make -j $(nproc)

# I got an error here for the running of make install - you may or may not need to do the sudo.
sudo make install

#after this point, I went directly to the vice install directory and ran it
cd ~/viceinstall/bin
./x64sc
</pre></div>


<h2 class="wp-block-heading" id="h-references">References:</h2>



<ul>
<li><a rel="noreferrer noopener" aria-label=" (opens in a new tab)" href="https://www.balena.io/etcher/" target="_blank">Balena Etcher</a></li>



<li><a rel="noreferrer noopener" label=" (opens in a new tab)" href="https://www.howtogeek.com/167190/how-and-why-to-assign-the-.local-domain-to-your-raspberry-pi/" target="_blank" class="broken_link">Enabling Bonjour for your Raspberry Pi</a></li>



<li><a rel="noreferrer noopener" label=" (opens in a new tab)" href="http://vice-emu.sourceforge.net/" target="_blank" class="broken_link">VICE Homepage</a></li>



<li><a rel="noreferrer noopener" aria-label=" (opens in a new tab)" href="https://www.lemon64.com/forum/viewtopic.php?t=69443&amp;sid=b254aba4aa2e196e85420ada952765e5" target="_blank">Lemon 64 Thread on Custom SDL Build</a> </li>



<li><a href="https://choccyhobnob.com/sdl2-2-0-8-on-raspberry-pi/" target="_blank" rel="noreferrer noopener" label="SDL on Raspi (for 3B compile) (opens in a new tab)" class="broken_link">SDL on Raspi (for 3B compile)</a></li>



<li><a rel="noreferrer noopener" aria-label=" (opens in a new tab)" href="https://github.com/midwan/amiberry/wiki/Compile-SDL2-from-source" target="_blank">Compiling SDL2 from source</a></li>



<li><a rel="noreferrer noopener" aria-label=" (opens in a new tab)" href="https://www.lemon64.com/forum/viewtopic.php?t=44766&amp;sid=390e12b2777730f68569acebafcbb945" target="_blank">x64 vs x64sc VICE binaries</a></li>



<li><a rel="noreferrer noopener" aria-label=" (opens in a new tab)" href="https://csdb.dk/release/?id=179123" target="_blank">The Elder Scrollers Demo</a></li>
</ul>
<p>The post <a rel="nofollow" href="https://krystof.io/installing-the-vice-commodore-emulator-for-console-mode-on-a-fresh-raspberry-pi-4/">Installing the VICE Commodore Emulator for Console Mode on a fresh Raspberry Pi 4</a> appeared first on <a rel="nofollow" href="https://krystof.io">Krystof.IO</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://krystof.io/installing-the-vice-commodore-emulator-for-console-mode-on-a-fresh-raspberry-pi-4/feed/</wfw:commentRss>
			<slash:comments>68</slash:comments>
		
		
		
		<series:name><![CDATA[Diorama 64]]></series:name>
	</item>
		<item>
		<title>The &#8216;Working&#8217; Commodore 64/128 Diorama and Raspberry Pi VICE Emulator</title>
		<link>https://krystof.io/diorama-64-part-1-overview/</link>
					<comments>https://krystof.io/diorama-64-part-1-overview/#comments</comments>
		
		<dc:creator><![CDATA[Eric R. Krystof]]></dc:creator>
		<pubDate>Sun, 05 Jan 2020 00:53:04 +0000</pubDate>
				<category><![CDATA[Arcade Building]]></category>
		<category><![CDATA[Commodore]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[VICE]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Emulation]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<guid isPermaLink="false">https://krystof.io/?p=973</guid>

					<description><![CDATA[<p>A ‘working’ diorama of my 1980s Commodore 128/64 computer room, with mirrored LCD display monitor and working 1541 disk drive lights. Driven by a Raspberry PI, custom circuit board, and VICE C64 emulator. Additional flavor added in the form of miniature floppy disks, game boxes, and wall posters, advertisements, and game maps from my youth.</p>
<p>The post <a rel="nofollow" href="https://krystof.io/diorama-64-part-1-overview/">The &#8216;Working&#8217; Commodore 64/128 Diorama and Raspberry Pi VICE Emulator</a> appeared first on <a rel="nofollow" href="https://krystof.io">Krystof.IO</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>A little bit of backstory:  It&#8217;s 1985 and the Nintendo Entertainment System begins its assault on North American wallets in the late fall season.  As a child of the 1980&#8217;s, I was ready and willing to throw my parent&#8217;s savings towards the Nintendo firing lines.  The problem was, Dad was an unwilling partner.</p>



<p><strong>10 Year Old Me:</strong> <em>Dad, I want a Nintendo!</em></p>



<p><strong>Older, Wiser Father: </strong><em>Well, Son, I bought you this Commodore 128 Computer instead.</em></p>



<p> <strong>10 Year Old Me:</strong> <em>God damn it, Dad (internal dialogue).</em> </p>



<p>There went my hopes and dreams of having a Nintendo &#8211; replaced with this many keyed Commodore paperweight.  Dad&#8217;s goal, unbeknownst to me, was simple &#8211; get something that <em>could play games</em> but could also be used to <em>learn about computers</em>.  One day I was bored enough to pick up the manual&#8230;</p>



<div class="wp-block-image"><figure class="aligncenter size-medium"><img decoding="async" loading="lazy" width="300" height="300" src="https://krystof.io/wp-content/uploads/2019/12/Commodore-128-System-Guide-300x300.jpg" alt="" class="wp-image-981" srcset="https://krystof.io/wp-content/uploads/2019/12/Commodore-128-System-Guide-300x300.jpg 300w, https://krystof.io/wp-content/uploads/2019/12/Commodore-128-System-Guide-150x150.jpg 150w, https://krystof.io/wp-content/uploads/2019/12/Commodore-128-System-Guide.jpg 814w" sizes="(max-width: 300px) 100vw, 300px" /><figcaption>Hello, Mr. Krystof.  This is Fate knocking.<br>It&#8217;s time to open this up.</figcaption></figure></div>



<p>I don&#8217;t remember which exact program I first built &#8211; but I do recall it was making use of the Commodore&#8217;s sprite mechanisms &#8211; some extremely crude animations and graphics manipulation.  Of course, most of the time with the Commodore 128 was spent in it&#8217;s &#8217;64 mode&#8217;, where almost all of the software library resided.</p>



<p>Nevertheless, thanks to my Nintendo-dodging father, I knew exactly what field I was going to get into in some way, shape, or form, by the time I was eleven.  I never had a console beyond the Atari 2600 until I was in my late thirties.</p>



<p>Fast forward through the years and Dad&#8217;s &#8216;spare room&#8217; (or &#8216;pit of crap&#8217; according to my mother) became the &#8216;computer room&#8217; as far as I was concerned.  Now, in the present, I want to pay homage to that era with a diorama capturing the spirit of that back room.  I also wanted to <em>play some of those old games again</em>, along with games <em>I never knew existed</em> at the time.</p>



<h2 class="wp-block-heading" id="h-birth-of-a-diorama-emulator-combo">Birth of a diorama / emulator combo</h2>



<p>I&#8217;ve put together Raspberry Pi <a href="https://krystof.io/the-tardis-arcade-hardware-invasion/" target="_blank" rel="noreferrer noopener" aria-label=" (opens in a new tab)">emulator setups before</a>, and I wanted to create one for myself, and I wanted to use this to specifically target my Commodore days.  While you&#8217;ll see a model of a Commodore 128, anybody who really used one will tell you it spends most of it&#8217;s time in &#8217;64 mode&#8217; since it was backwards compatible.  So the first thought was a 3D printed case that looks like a Commodore computer to wrap around my Raspberry Pi.</p>



<p>I found a few models online on sites like Thingiverse, an example being this <a rel="noreferrer noopener" aria-label=" (opens in a new tab)" href="https://www.thingiverse.com/thing:1954782" target="_blank">one</a>.  </p>



<div class="wp-block-image"><figure class="aligncenter size-medium"><img decoding="async" loading="lazy" width="300" height="225" src="https://krystof.io/wp-content/uploads/2019/12/raspberrypi-c64-case-300x225.jpg" alt="" class="wp-image-990" srcset="https://krystof.io/wp-content/uploads/2019/12/raspberrypi-c64-case-300x225.jpg 300w, https://krystof.io/wp-content/uploads/2019/12/raspberrypi-c64-case.jpg 628w" sizes="(max-width: 300px) 100vw, 300px" /><figcaption>I loved this model by Freakadude, but I really needed the Commodore 128 look.</figcaption></figure></div>



<p>I liked the idea, but I thought maybe I could add something to it &#8211; like LEDs?  A monitor?  A 1541 disk drive to hold an SD Card?  This will run the popular <a rel="noreferrer noopener" label=" (opens in a new tab)" href="http://vice-emu.sourceforge.net/" target="_blank" class="broken_link">VICE</a> Commodore emulator, so I figured a retro case like this to display the <a rel="noreferrer noopener" label=" (opens in a new tab)" href="https://www.raspberrypi.org/products/raspberry-pi-4-model-b/" target="_blank" class="broken_link">Raspberry Pi 4</a> I was planning to use would be a cool little project to take on.   Unfortunately, my brain wasn&#8217;t going to let me get off that easily.</p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading" id="h-my-brain-goes-down-a-creative-spiral">My brain goes down a creative spiral.</h3>



<p>If I&#8217;m going to print a case and a little disk drive, why not a monitor?  Instead of that, what about a little computer desk and smaller versions of those components?  My mother does 1/12th scale miniatures (1 inch = 1 foot) as a hobby, so I just naturally went with that scale.   The more I thought about it, the more I realized trying to rebuild the Commodore setup I had as a child was really the way to go.  We (sadly) sold those pieces long ago; I felt building a diorama that captured the spirit of that room was now my goal.</p>



<p>Now I know I&#8217;m building a &#8216;room&#8217;, what about those LEDs?  Could I incorporate some simple little power LEDs into each component &#8211; monitor, disk drives, and keyboard?</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img decoding="async" loading="lazy" width="1024" height="576" src="https://krystof.io/wp-content/uploads/2020/01/20191206_155205-1024x576.jpg" alt="" class="wp-image-1085" srcset="https://krystof.io/wp-content/uploads/2020/01/20191206_155205-1024x576.jpg 1024w, https://krystof.io/wp-content/uploads/2020/01/20191206_155205-300x169.jpg 300w, https://krystof.io/wp-content/uploads/2020/01/20191206_155205-768x432.jpg 768w, https://krystof.io/wp-content/uploads/2020/01/20191206_155205-1536x864.jpg 1536w, https://krystof.io/wp-content/uploads/2020/01/20191206_155205-scaled.jpg 2048w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>It&#8217;s 1 and 1/2 inches wide.</figcaption></figure></div>



<p>If I&#8217;m going to build and/or manipulate 3D models to house LEDs for power &#8211; what about disk drive activity?  Could I have the classic red activity light on a 1541 disk drive turn on when the VICE emulator loads &#8216;virtual&#8217; floppy disk data?</p>



<p>If I&#8217;m going to manipulate power and activity LEDs for the components&#8230; what about a tiny LCD screen inside the Commodore 1802 monitor?  Could I play animations?  Show the &#8216;READY&#8217; screen?  Could I even mirror the Raspberry Pi output?</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img decoding="async" loading="lazy" width="1024" height="576" src="https://krystof.io/wp-content/uploads/2020/01/20191110_165347-1024x576.jpg" alt="" class="wp-image-1086" srcset="https://krystof.io/wp-content/uploads/2020/01/20191110_165347-1024x576.jpg 1024w, https://krystof.io/wp-content/uploads/2020/01/20191110_165347-300x169.jpg 300w, https://krystof.io/wp-content/uploads/2020/01/20191110_165347-768x432.jpg 768w, https://krystof.io/wp-content/uploads/2020/01/20191110_165347-1536x864.jpg 1536w, https://krystof.io/wp-content/uploads/2020/01/20191110_165347-scaled.jpg 2048w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>Not quite 1/12 scale, but it&#8217;s actually legible and that&#8217;s what I wanted.</figcaption></figure></div>



<p>If I&#8217;m going to do all that, I should get some sort of Commodore styled keyboard of some sort to type with so I can use those special <a href="https://en.wikipedia.org/wiki/PETSCII">PETSCII</a> keys.  </p>



<p>The VICE emulator also had some special keys for those common emulator functions, like mounting a virtual floppy image, pausing the emulator, loading/saving emulator machine state, etc.  Maybe I could build a little &#8216;mini-macro&#8217; keyboard to shorten those keystrokes.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img decoding="async" loading="lazy" width="1024" height="576" src="https://krystof.io/wp-content/uploads/2020/01/20191208_202526-1024x576.jpg" alt="" class="wp-image-1087" srcset="https://krystof.io/wp-content/uploads/2020/01/20191208_202526-1024x576.jpg 1024w, https://krystof.io/wp-content/uploads/2020/01/20191208_202526-300x169.jpg 300w, https://krystof.io/wp-content/uploads/2020/01/20191208_202526-768x432.jpg 768w, https://krystof.io/wp-content/uploads/2020/01/20191208_202526-1536x864.jpg 1536w, https://krystof.io/wp-content/uploads/2020/01/20191208_202526-scaled.jpg 2048w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>Never built a keyboard of any kind until now, this was a fun exercise.</figcaption></figure></div>



<p>I had a few other design ideas that went farther, but this is where I stopped.  If I went too far, I knew I&#8217;d never get it done.  Nevertheless, that was my thought process behind the diorama / emulator combo.  I wanted to pay homage to that era as well as have a working emulator.</p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading" id="h-the-diorama-is-still-a-room">The Diorama is still a &#8216;room&#8217;</h2>



<p>My mother has been creating miniatures for years now &#8211; primarily 1/12 &#8216;dollhouse&#8217; scale.  Once I mentioned the idea of the diorama to her, her &#8216;miniature brain&#8217; (ahem, don&#8217;t read that literally) went to work and she built the structure for the room box, carpet, desk, shelves, and even the old rolling chair we had plus some family pets.  It really started to feel like this diorama would capture the spirit of the computer room of my youth.  What I wasn&#8217;t expecting was mixing some &#8216;old me&#8217; and &#8216;young me&#8217;, as she found a figure, and with some paint in the right spots, created&#8230; mini-me.</p>



<div data-padding="10" class="wp-block-simple-blocks-info-block" style="background-color:#000000;color:#ffffff;padding:10px"><div data-iconsize="20" data-iconspace="20" class="icon" style="margin-right:20px"><svg aria-hidden="true" role="img" focusable="false" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewbox="0 0 20 20" class="dashicon dashicons-info"><path d="M10 2c4.42 0 8 3.58 8 8s-3.58 8-8 8-8-3.58-8-8 3.58-8 8-8zm1 4c0-.55-.45-1-1-1s-1 .45-1 1 .45 1 1 1 1-.45 1-1zm0 9V9H9v6h2z"></path></svg></div><div>Yes, I know it&#8217;s a guy with a beard&#8230; It&#8217;s the old me in the young me&#8217;s room.  Man that sounds creepy.</div></div>



<div class="wp-block-image"><figure class="aligncenter size-large"><img decoding="async" loading="lazy" width="576" height="1024" src="https://krystof.io/wp-content/uploads/2020/01/IMG_20191015_192807795-576x1024.jpg" alt="" class="wp-image-1094" srcset="https://krystof.io/wp-content/uploads/2020/01/IMG_20191015_192807795-576x1024.jpg 576w, https://krystof.io/wp-content/uploads/2020/01/IMG_20191015_192807795-169x300.jpg 169w, https://krystof.io/wp-content/uploads/2020/01/IMG_20191015_192807795-768x1366.jpg 768w, https://krystof.io/wp-content/uploads/2020/01/IMG_20191015_192807795-864x1536.jpg 864w, https://krystof.io/wp-content/uploads/2020/01/IMG_20191015_192807795-scaled.jpg 1152w" sizes="(max-width: 576px) 100vw, 576px" /><figcaption>It&#8217;s not that far off, really.</figcaption></figure></div>



<p>She created her own prototype of the diorama with a domed room, with myself and my Siamese Luna enjoying what little air is left under this glass by playing some Pac-Man (which I&#8217;d be replacing with Commodore specifics).</p>



<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img decoding="async" loading="lazy" src="https://krystof.io/wp-content/uploads/2020/01/IMG_20191103_174350649-576x1024.jpg" alt="" class="wp-image-1098" width="288" height="512" srcset="https://krystof.io/wp-content/uploads/2020/01/IMG_20191103_174350649-576x1024.jpg 576w, https://krystof.io/wp-content/uploads/2020/01/IMG_20191103_174350649-169x300.jpg 169w, https://krystof.io/wp-content/uploads/2020/01/IMG_20191103_174350649-768x1366.jpg 768w, https://krystof.io/wp-content/uploads/2020/01/IMG_20191103_174350649-864x1536.jpg 864w, https://krystof.io/wp-content/uploads/2020/01/IMG_20191103_174350649-scaled.jpg 1152w" sizes="(max-width: 288px) 100vw, 288px" /></figure></div>



<h2 class="wp-block-heading" id="h-making-the-mini-commodore-parts">Making The Mini Commodore Parts </h2>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="1024" height="496" src="https://krystof.io/wp-content/uploads/2020/01/Resized_20191017_202858-1024x496.jpeg" alt="" class="wp-image-1095" srcset="https://krystof.io/wp-content/uploads/2020/01/Resized_20191017_202858-1024x496.jpeg 1024w, https://krystof.io/wp-content/uploads/2020/01/Resized_20191017_202858-300x145.jpeg 300w, https://krystof.io/wp-content/uploads/2020/01/Resized_20191017_202858-768x372.jpeg 768w, https://krystof.io/wp-content/uploads/2020/01/Resized_20191017_202858-1536x744.jpeg 1536w, https://krystof.io/wp-content/uploads/2020/01/Resized_20191017_202858-scaled.jpeg 2048w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>Some resin, some filament&#8230; All Retro.</figcaption></figure>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<p>Taking a few models from Thingiverse (the series article on the modeling will have the details), and modifying them for some future LED wiring, I went to work recreating the system we had &#8211; A Commodore 128, two 1541 drives, and a monitor.  I also went about creating some floppy disks which you can see below, though I ended up making them thinner later.</p>



<div class="wp-block-envira-envira-gallery"><div class="envira-gallery-feed-output"><img class="envira-gallery-feed-image" tabindex="0" src="https://krystof.io/wp-content/uploads/2020/01/Resized_20191103_095418.jpeg" title="" alt="" /></div></div>



<p>After slimming down those floppies I created envelopes resembling some of the makers I remembered from my youth &#8211; Commodore branded floppies, BONUS, Elephant, Maxell, and Verbatim.  You may also recognize an EA branded floppy envelope from the days where EA was ground breaking and universally adored.</p>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="1024" height="496" src="https://krystof.io/wp-content/uploads/2020/01/Resized_20191103_153824-1024x496.jpeg" alt="" class="wp-image-1092" srcset="https://krystof.io/wp-content/uploads/2020/01/Resized_20191103_153824-1024x496.jpeg 1024w, https://krystof.io/wp-content/uploads/2020/01/Resized_20191103_153824-300x145.jpeg 300w, https://krystof.io/wp-content/uploads/2020/01/Resized_20191103_153824-768x372.jpeg 768w, https://krystof.io/wp-content/uploads/2020/01/Resized_20191103_153824-1536x744.jpeg 1536w, https://krystof.io/wp-content/uploads/2020/01/Resized_20191103_153824-scaled.jpeg 2048w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>3D printed floppies, write protection notches included.</figcaption></figure>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="1024" height="576" src="https://krystof.io/wp-content/uploads/2020/01/20191223_141023-scaled-1024x576.jpg" alt="" class="wp-image-1101" srcset="https://krystof.io/wp-content/uploads/2020/01/20191223_141023-scaled-1024x576.jpg 1024w, https://krystof.io/wp-content/uploads/2020/01/20191223_141023-scaled-300x169.jpg 300w, https://krystof.io/wp-content/uploads/2020/01/20191223_141023-scaled-768x432.jpg 768w, https://krystof.io/wp-content/uploads/2020/01/20191223_141023-scaled-1536x864.jpg 1536w, https://krystof.io/wp-content/uploads/2020/01/20191223_141023-scaled.jpg 2048w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>Game Boxes &#8211; Those floppies and manuals have to go somewhere.  Also going to need some posters for the back wall of that diorama.</figcaption></figure>



<h2 class="wp-block-heading" id="h-a-living-breathing-commodore">A &#8216;living, breathing&#8217; Commodore.</h2>



<p>The LED related goals of the diorama: <strong>Power LEDs</strong> and <strong>drive activity LEDs</strong> that match our VICE emulator install.  When you load a virtual floppy in VICE, I want the drive 8 LED to light up.  That requires a customization we&#8217;ve made to VICE itself (details in the series article), but it all has to come together connecting to the Raspberry Pi, a custom circuit board, and power.  Needless to say, the breadboard came in mighty useful during this endeavor.</p>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="768" height="1024" src="https://krystof.io/wp-content/uploads/2020/01/img_20191208_201211-768x1024.jpg" alt="" class="wp-image-1102" srcset="https://krystof.io/wp-content/uploads/2020/01/img_20191208_201211-768x1024.jpg 768w, https://krystof.io/wp-content/uploads/2020/01/img_20191208_201211-225x300.jpg 225w, https://krystof.io/wp-content/uploads/2020/01/img_20191208_201211-1152x1536.jpg 1152w, https://krystof.io/wp-content/uploads/2020/01/img_20191208_201211.jpg 1536w" sizes="(max-width: 768px) 100vw, 768px" /><figcaption>The &#8216;Sleep / Shutdown&#8217; button, and the drive LEDs in the background.</figcaption></figure>



<p>Also, I wanted the 3d printed monitor to work as an enclosure for a small LCD that mirrors the HDMI output of the Raspberry Pi &#8211; here&#8217;s the initial capture I took when it somehow didn&#8217;t melt upon plugging all of it together:</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img decoding="async" loading="lazy" width="320" height="165" src="https://krystof.io/wp-content/uploads/2020/01/Dual-Display.gif" alt="" class="wp-image-1091"/></figure></div>



<h2 class="wp-block-heading" id="h-twitching-the-progression">Twitching The Progression</h2>



<p>I decided to clean up the work space <em>a little bit</em> and get the <a rel="noreferrer noopener" aria-label="Twitch  (opens in a new tab)" href="https://www.twitch.tv/mrkrystof" target="_blank">Twitch </a>stream going.  Figured I&#8217;d work on this and if anyone decided to stop by and chat about it, they could.  In fact, they did.  So far I&#8217;ve met a few interested in the old Commodore retro scene, some more on the electronics side of the circuit, and some just curious as to what the hell I&#8217;m doing.</p>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="1024" height="576" src="https://krystof.io/wp-content/uploads/2020/01/20191219_184626-1024x576.jpg" alt="" class="wp-image-1082" srcset="https://krystof.io/wp-content/uploads/2020/01/20191219_184626-1024x576.jpg 1024w, https://krystof.io/wp-content/uploads/2020/01/20191219_184626-300x169.jpg 300w, https://krystof.io/wp-content/uploads/2020/01/20191219_184626-768x432.jpg 768w, https://krystof.io/wp-content/uploads/2020/01/20191219_184626-1536x864.jpg 1536w, https://krystof.io/wp-content/uploads/2020/01/20191219_184626-scaled.jpg 2048w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>Testing the final circuit build and the dual display of the VICE screens.</figcaption></figure>



<h2 class="wp-block-heading" id="h-diorama-emulator-parts-breakdown">Diorama/Emulator Parts Breakdown</h2>



<p>This diorama / emulator combo breaks down into these major components, and thus the series articles for more detail follow this list.  As I wrap up each one I&#8217;ll post the links here for posterity.</p>



<ul><li><strong>Raspberry Pi 4</strong> &#8211; The heart of the electronics &#8211; this runs the emulator as well as drives the circuit controlling power and drive activity LED&#8217;s. <strong>You can now see more on the VICE and OS install here: </strong> <a href="https://krystof.io/installing-the-vice-commodore-emulator-for-console-mode-on-a-fresh-raspberry-pi-4/">https://krystof.io/installing-the-vice-commodore-emulator-for-console-mode-on-a-fresh-raspberry-pi-4/</a> </li><li><strong>LCD display</strong> &#8211; this mirrors the Raspberry PI&#8217;s HDMI output, so as the big-me plays games, the mini-me in the diorama is playing the same game &#8211; or is it the other way around?</li><li> <strong>LED circuit board</strong> &#8211; This reads GPIO pin inputs from the Raspberry Pi and switches on the power and drive activity LED&#8217;s.  I also decided to try out a simple &#8216;Power&#8217; button to ease the shutdown of the Raspberry Pi. </li><li> <strong>3D Printed Commodore Models</strong> &#8211; Modified and scaled accordingly, printed in resin or filament, and painted by hand (crap-fully)  </li><li><strong>Custom VICE build and LED driver software</strong> &#8211; I created a custom VICE build to get my hook into the floppy drive activity and get that state sent to the LED circuit &#8211; so when VICE considers a floppy drive active, my LED circuit turns the LED on or off accordingly.</li><li><strong>Diorama Room</strong> containing models of our old computer desk, floppy disk holders, game boxes, and wall art I would hang in the computer room or my bedroom over the years.</li><li><strong>Input Peripherals</strong> &#8211; I need a keyboard to type on and joysticks to &#8230; joy with.</li><li><strong>Custom Keyboard Deck</strong> &#8211; This keyboard of 10 keys controls common emulator functions (mount floppy image, pause, restart emulator machine, etc.)</li><li><strong>Diorama case &#8216;base&#8217;</strong> &#8211; where we&#8217;re going to store the electronics of this diorama/emulator combo &#8211; underneath in a 3 inch tall base for the diorama to rest on.</li></ul>



<p>There are some parallel threads in the series here &#8211; I worked on many pieces at the same time &#8211; and you could to if you were recreating it.  Nevertheless, here&#8217;s how the series is presented &#8211; and I&#8217;ll do my best to keep this cohesive.</p>



<h2 class="wp-block-heading" id="h-series-breakdown">Series Breakdown</h2>



<p>As I upload articles and videos, this list will be updated and links created.  Stay tuned!</p>



<ol><li>This entry &#8211; the overview and motivation &#8211; <em><strong>Released</strong> <strong>Jan 4 2020</strong> </em></li><li><a href="https://krystof.io/installing-the-vice-commodore-emulator-for-console-mode-on-a-fresh-raspberry-pi-4/">VICE on the Raspberry Pi 4 Install</a> &#8211; Raspberry Pi 4, VICE Compiling &#8211; <strong><em>Released Jan 12 2020</em></strong></li><li><a href="https://krystof.io/mirroring-raspberry-pi-hdmi-video-to-a-st7789-1-3-inch-lcd-display/">Raspberry Pi 4 and  ST7789 LCD Install</a> &#8211; How to get frame buffer copying and display rotation working. &#8211; <strong><em>Released Jan 19 2020</em></strong></li><li><a href="https://krystof.io/patching-the-vice-emulator-to-light-up-floppy-drive-leds/">Custom VICE build and Python Shared Memory</a> &#8211; Using Linux shared memory to communicate between VICE and Python to drive the proper drive activity LEDs<strong><em> &#8211; Released Feb 15 2020</em></strong></li><li>Controlling LEDs from a Raspberry Pi and a Darlington Array &#8211; Isolating the power driving LEDs  and building the LED circuit </li><li> 3D Modeling the Commodore Computer &#8211; Modifications to support LED housing and wiring, painting, and decals </li><li>Input Peripherals &#8211; Keyboard and Joysticks and some alternate considerations</li><li>VICE Custom Keyboard Deck &#8211; Using an Arduino compatible Teensy to act as a USB HID Keyboard</li><li> Diorama Room &#8211; It&#8217;s not a diorama without some background items and finishing touches. </li><li>Diorama Case Base &#8211; Final touches and assembly of the diorama.</li><li>Retrospective &#8211; Looking back as we moved forward through this series.</li></ol>
<p>The post <a rel="nofollow" href="https://krystof.io/diorama-64-part-1-overview/">The &#8216;Working&#8217; Commodore 64/128 Diorama and Raspberry Pi VICE Emulator</a> appeared first on <a rel="nofollow" href="https://krystof.io">Krystof.IO</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://krystof.io/diorama-64-part-1-overview/feed/</wfw:commentRss>
			<slash:comments>8</slash:comments>
		
		
		
		<series:name><![CDATA[Diorama 64]]></series:name>
	</item>
	</channel>
</rss>
