tag:blogger.com,1999:blog-48706406206689611762024-03-15T13:03:06.966-07:00The Retrobits PodcastOld skool computing, modern day fun!Earlhttp://www.blogger.com/profile/02764499302821614422noreply@blogger.comBlogger52125tag:blogger.com,1999:blog-4870640620668961176.post-71972044266420553582022-08-20T21:02:00.000-07:002022-08-20T21:02:23.631-07:00Show 148 - My Altair 8800 Adventure, Part I<div style="text-align: left;">In Show 148, I talk about my continuing adventure with a generous donation I received of MITS Altair equipment. It's been quite a ride!</div><div style="text-align: left;"><br /></div><div style="text-align: left;">Direct Download:</div><div style="text-align: left;"><a href="https://traffic.libsyn.com/secure/retrobits/RBP-2022-08-20-148.mp3">https://traffic.libsyn.com/secure/retrobits/RBP-2022-08-20-148.mp3</a></div><div style="text-align: left;"><br /></div><div><h3 style="text-align: left;">Links</h3></div><div><ul style="text-align: left;"><li>Adrian's Digital Basement YouTube channels: <a href="https://www.youtube.com/c/adriansdigitalbasement">https://www.youtube.com/c/adriansdigitalbasement</a> and <a href="https://www.youtube.com/channel/UCbtwi4wK1YXd9AyV_4UcE6g">https://www.youtube.com/channel/UCbtwi4wK1YXd9AyV_4UcE6g</a></li><li>RMC - The Cave YouTube channel: <a href="https://www.youtube.com/c/RMCRetro">https://www.youtube.com/c/RMCRetro</a></li><li>The FDC+: <a href="https://deramp.com/fdc_plus.html">https://deramp.com/fdc_plus.html</a></li><li>DeRamp - a great resource for some old systems including the Altair 8800: <a href="https://deramp.com/">https://deramp.com/</a></li><li>Information on the Altair Clone by Mike Douglas: <a href="https://altairclone.com/">https://altairclone.com/</a></li><li>Mike Douglas' YouTube channel: <a href="https://www.youtube.com/user/deramp5113">https://www.youtube.com/user/deramp5113</a></li></ul><div><br /></div></div><div>This episode is Copyright 2022 by Earl Evans.<br /><a href="http://creativecommons.org/licenses/by/4.0/" rel="license"><img alt="Creative Commons License" src="http://i.creativecommons.org/l/by/4.0/88x31.png" style="border-width: 0px;" /></a><br />This work is licensed under a <a href="http://creativecommons.org/licenses/by/4.0/" rel="license">Creative Commons Attribution 4.0 International License</a>.</div><div><br /></div>Earlhttp://www.blogger.com/profile/02764499302821614422noreply@blogger.com5tag:blogger.com,1999:blog-4870640620668961176.post-58525297437499420392021-10-02T17:57:00.000-07:002021-10-02T17:57:07.057-07:00RetroChallenge 2021/10 Hello World<p> Hi all! Time for RetroChallenge 2021/10 thrills and spills!</p><p><b>Summary:</b></p><p>My project is to control an <a href="https://www.adafruit.com/product/1430" target="_blank">8x5 NeoPixel RGB LED</a> array from an Altair 8800bt computer, with an Arduino Uno R3 gluing the two together.</p><p><b>Details:</b></p><p>A while back I received an amazing donation from a former employee of <a href="https://en.wikipedia.org/wiki/Pertec_Computer" target="_blank">Pertec</a> (the company who bought MITS back in the 70s). This included an Altair 8800bt (turnkey model) and lots and lots of MITS S100 boards.</p><p>The 8800bt works, and didn't actually require much restoration. I did completely disassemble it and clean everything, and tested the power supply before trying it with any boards installed. All went well with the reassembly and the system functions nicely.</p><p>It's currently equipped with an iCom 3812 dual density dual 8" drive system, the associated interface card, and a CP/M 2.2 version designed for this combination of computer and drive.</p><p>Here's a picture of the 8800bt from the front:</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh13-iA0nADFOHxSJDMjPfzOW5sbKl4jgN36RVlxtHakWNrgJA3glDnTFx1NYMXY7HgYWjOQUkFGUkXe50RACdgL_rUcIE93Vtxpn01Oqt7t1_jHLx0-QEPkGf5CEGy2Vjr-IlaMBeswVE/s2048/Altair+8800bt.jpg" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh13-iA0nADFOHxSJDMjPfzOW5sbKl4jgN36RVlxtHakWNrgJA3glDnTFx1NYMXY7HgYWjOQUkFGUkXe50RACdgL_rUcIE93Vtxpn01Oqt7t1_jHLx0-QEPkGf5CEGy2Vjr-IlaMBeswVE/s2048/Altair+8800bt.jpg" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh13-iA0nADFOHxSJDMjPfzOW5sbKl4jgN36RVlxtHakWNrgJA3glDnTFx1NYMXY7HgYWjOQUkFGUkXe50RACdgL_rUcIE93Vtxpn01Oqt7t1_jHLx0-QEPkGf5CEGy2Vjr-IlaMBeswVE/s2048/Altair+8800bt.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1536" data-original-width="2048" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh13-iA0nADFOHxSJDMjPfzOW5sbKl4jgN36RVlxtHakWNrgJA3glDnTFx1NYMXY7HgYWjOQUkFGUkXe50RACdgL_rUcIE93Vtxpn01Oqt7t1_jHLx0-QEPkGf5CEGy2Vjr-IlaMBeswVE/s320/Altair+8800bt.jpg" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: left;">I don't have a top for either the 8800bt or the drive unit. (If there's a good opportunity, I'll explain that in a subsequent post.)</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">Here's the 8800bt from the top/side, facing the front side of the S100 cards:</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3ZhA4KVjX8h2wAmEJ7vmfZ40gO90qYaXSmskiMeK-IyZonO1O3MFCpLjts8dj2qJDfaVkktQU3OAwiOXssaV8UXVQX6F1hNK5uu2K1VgK3lx5vJNBWAXh_sizK0giadULvrWO10jPzl4/s2048/Inside+of+8800bt.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1536" data-original-width="2048" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3ZhA4KVjX8h2wAmEJ7vmfZ40gO90qYaXSmskiMeK-IyZonO1O3MFCpLjts8dj2qJDfaVkktQU3OAwiOXssaV8UXVQX6F1hNK5uu2K1VgK3lx5vJNBWAXh_sizK0giadULvrWO10jPzl4/s320/Inside+of+8800bt.jpg" width="320" /></a></div><br /><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">The card that's in front with the rainbow cable coming out of the top is one that I'll be talking about a lot. It's a MITS 88-4PIO (manual on deramp.com <a href="https://deramp.com/downloads/altair/hardware/MITS%2088-4PIO.pdf" target="_blank">here</a>) - a 4 port parallel interface card, based on the Motorola 6820 Peripheral Interface Adapter (PIA) chip.</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">Here's a picture of the iCom 3812 dual drive unit:</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgugGK3yEfLYLwYiPcKmrYPCqXgxWpqGOxvCz8-YVmOs_XrZe64777vs51Xqgb52tXy22q8Z1VEifIbjeLnLueYqsmhilxnOkkKVlFiQvAFpUH0JHQUPZhtk0-S_lSQxnvfTw8RL2LBJg4/s2048/iCom+3812+drive+system.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1536" data-original-width="2048" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgugGK3yEfLYLwYiPcKmrYPCqXgxWpqGOxvCz8-YVmOs_XrZe64777vs51Xqgb52tXy22q8Z1VEifIbjeLnLueYqsmhilxnOkkKVlFiQvAFpUH0JHQUPZhtk0-S_lSQxnvfTw8RL2LBJg4/s320/iCom+3812+drive+system.jpg" width="320" /></a></div><br /><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">(Sorry for the NEC monitor photobombing the 3812 on the left. New tech always trying to sneak in the picture...)</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">The drive system doesn't have much to do with the project, other than it's what I'll be using for program storage and running CP/M. For more info on this drive and others in the same family, check out some YouTubes from Mike Douglas:</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">3202: <a href="https://www.youtube.com/watch?v=ihqOO0bFTdw">https://www.youtube.com/watch?v=ihqOO0bFTdw</a></div><div class="separator" style="clear: both; text-align: left;">3712: <a href="https://www.youtube.com/watch?v=Md1oEWf171o">https://www.youtube.com/watch?v=Md1oEWf171o</a></div><div class="separator" style="clear: both; text-align: left;">3812: <a href="https://www.youtube.com/watch?v=Mz-BIgUBhKA">https://www.youtube.com/watch?v=Mz-BIgUBhKA</a></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;"><b>Current Status:</b></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">Full disclosure - the Altair is already able to talk to an Arduino Uno R3 via the 88-4PIO board. I hooked this up a while back and wrote some 8080 assembly code (and C code on the Arduino) to get the two talking.</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">However, the code I wrote on both sides was a pretty ugly proof of concept, and there's still much more to be done:</div><div class="separator" style="clear: both; text-align: left;"><ul style="text-align: left;"><li>Create a protocol for the Altair to send blocks of 40 (8x5) 24-bit RGB codes to the Arduino</li><li>Implement that protocol on the Altair and the Arduino</li><li>Connect the Arduino to the NeoPixel array, and test that the Arduino can control the LEDs (this should be easy - the code is already out there, and the LED array has been tested before)</li><li>Write a program on the Altair that lets the user select a pattern or animation for the LEDs, and then sends this pattern or animation to the Arduino using the protocol mentioned above</li><li>Write it all up as I go and post it here</li><li>Make one or more videos about the process, and also link those here</li></ul><div>And not to mention, have fun! </div><div><br /></div><div>One downside is that RGB LEDs don't always come across well on camera. It's tough to get a picture or video of them that does justice. But I'll do my best.</div><div><br /></div><div>See you in the next post!</div><div><br /></div><div>- Earl</div><div><br /></div></div>Earlhttp://www.blogger.com/profile/00491259029760076753noreply@blogger.com0tag:blogger.com,1999:blog-4870640620668961176.post-40687471067424590332018-09-30T20:36:00.000-07:002018-09-30T20:36:32.407-07:00Where do we go from here<h4>
Initial Goal Reached - Stretch Goals TBD</h4>
<br />
My goal for the Retrochallenge 2018/09 was to get a retro CPU core running on my FPGA board.<br />
<br />
Mission accomplished - I used:<br />
<br />
<ul>
<li>The well-respected open-source <a href="https://github.com/Arlet/verilog-6502">Arlet 6502 core</a>,</li>
<li>Verilog code to create 64K of RAM with pre-loaded contents,</li>
<li>Some other Verilog glue code to put those pieces together, and jump-start the 6502 with a reset pulse.</li>
</ul>
<br />
The pre-loaded contents, specified by a simple HEX file, made the 6502 perform a few easy operations (like load a direct value into the accumulator), then jump to an endless loop padded with NOPs. On start-up, the 6502 jumps to the address specified at $FFFC and $FFFD. I placed the address $0400 at those RAM locations, and the program itself at $0400.<br />
<br />
Since I had no I/O, it was a challenge to validate the program was actually running. I was able to do this by watching the contents of the PC (program counter) using the built-in debugging tools of Xilinx Vivado, the development software used to program my FPGA.<br />
<br />
Initial challenges, some of which were documented in my earlier blog entries, included the RAM not working right and my HEX file not being properly formatted. I did make it through those challenges, borrowing from work documented on the <a href="http://c64onfpga.blogspot.com/">C64 on an FPGA</a> blog.<br />
<br />
However, my stretch goals were to expand that into something that looked like a retro computer. I didn't get very far down that road.<br />
<br />
The 6502 chip uses memory-mapped I/O. In order to get data in or out of the 6502, it would be necessary for me to modify the RAM interface so that certain addresses would, instead of storing/loading to actual RAM, would transfer data to/from some other circuitry instead. I did get this working just a little bit - I created a Verilog register and connected it to the 4 LEDs on the Zybo board. Then, I modified the RAM interface so that, if location hex E000 was written to, the output (lower 4 bits) would appear on the LEDs. This was actually pretty awesome, and worked well. But it's not very much I/O :-)<br />
<br />
<h4>
Where From Here</h4>
<div>
<br /></div>
Learning digital design by doing has a lot of challenges, but you can learn lots of great stuff. One thing I learned is how FIFO (first-in, first-out) blocks can be useful in an FPGA design. You write info into the goes-in side of the FIFO, and another circuit reads that value in the goes-out side. The FIFO will tell you when it's empty (nothing to read) and full (when the data that's been written has filled the available storage of the FIFO). The goes-in and goes-out sides can use different clocks, meaning that the FIFO can help when you cross clock domains. This is important. I'm still learning more about what this means, but it's super helpful when two disparate digital circuits need to give data to each other.<br />
<br />
So, for I/O, what I want to do is have two FIFOs, one for 6502 input, the other for output. If you write a byte to whatever I pick for the output memory address on the 6502, it will push that byte to the output FIFO. If you read a corresponding input address on the 6502, it will read the byte from the input FIFO. In both cases, the full or empty indicators of the FIFO would be checked as appropriate.<br />
<br />
On the other end of those FIFOs, I'd like to put a RS232 UART. This will enable the 6502 to send and receive via a standard serial connection. Bang, Bob's your uncle, I/O. It will take some Verilog glue logic to hook this all up, but when done, I don't see any reason it wouldn't work.<br />
<br />
Even though Retrochallenge is over, I'm going to keep going with this. Now that I have a working 6502, I'm hungry for more.<br />
<br />
Thanks for reading! Stay Tuned!<br />
<br />
<br />
<br />
<br />Earlhttp://www.blogger.com/profile/00491259029760076753noreply@blogger.com2tag:blogger.com,1999:blog-4870640620668961176.post-85460946879592489422018-09-08T09:45:00.001-07:002018-09-08T09:45:59.330-07:00That time when I didn't smash my FPGA board into small piecesAs the old sports intro goes, there is the <a href="https://www.youtube.com/watch?v=P2AZH4FeGsc">thrill of victory, and the agony of defeat</a>.<br />
<br />
Trying to learn how FPGAs work is obviously feasible, and many have succeeded in doing so, even without being a trained EE. However, I'm finding that it's not for the faint of heart. In my last blog post, I mentioned that I like to learn things in the deep end of the pool. That end of the pool can be exhausting, and you might splash a lot of water without making much forward progress.<br />
<br />
But as things go, just when you think you're sinking, some kind, sharing soul on the Internet throws you a life preserver.<br />
<br />
My goal for the current Retrochallenge is to get a retro CPU core working on my FPGA board, and have it run a simple program. Since that's been done before many times, and most of the work has already been open-sourced, it shouldn't be a heavy lift. But each FPGA board and development toolchain is different. There are breaking changes between versions of the FPGA vendor's tools. And, even more so than in the software development world, documentation can be terse or non-existent.<br />
<br />
Some details - I'm trying to get the following to work:<br />
<ul>
<li>A Zybo development board (original, revision B) with a Zynq-7000 XC7Z010 chip,</li>
<li>The Vivado HLx toolset, used to create solutions for Xilinx FPGAs,</li>
<li>A <a href="https://github.com/Arlet/verilog-6502">6502 core</a>, written in Verilog by Arlet Ottens, and</li>
<li>A simple 6502 program written on the above, proving that the 6502 core is functional</li>
</ul>
<div>
<br /></div>
<div>
And it turns out, that in desperate Google searches, I found <a href="http://c64onfpga.blogspot.com/">a project that does all of the above</a>, and more.</div>
<br />
From the work done on the "C64 on an FPGA" blog by Johan Steenkamp, I should be able to learn the necessary steps to get a 6502 running on my Zybo. The author not only does the work, but graciously teaches you <b>how</b> it works.<br />
<br />
It's kind of cheating, but my goal is to learn, so I can build upon what I've learned. <a href="https://quoteinvestigator.com/2013/03/06/artists-steal/">Good artists copy, great artists steal</a>.<br />
<br />
More to come...<br />
<br />Earlhttp://www.blogger.com/profile/00491259029760076753noreply@blogger.com0tag:blogger.com,1999:blog-4870640620668961176.post-68469516674398967592018-09-07T11:51:00.000-07:002018-09-07T11:51:57.024-07:00Every Now, And Again (why my CPU isn't working)<h4>
It can run, but it can't hide (or jump, or fetch)</h4>
<br />
If my FPGA-based 6502 can "free run" (<a href="http://www.retrobits.com/2018/09/rc-201809-part-01-run-free-little-cpu.html">described in an earlier post</a>), why can't it run even a simple program?<br />
<br />
<i>Short answer</i><br />
<br />
My theory is currently this - from the time the CPU indicates what memory address it wants to access, and when the result is actually available to the CPU, there is a delay (latency). That delay is messing up memory accesses, and confusing the CPU.<br />
<br />
<i>Long answer</i><br />
<br />
OK, you asked for it. Let's start with synchronous versus combinational circuits.<br />
<br />
<h4>
Every now, and again (quoted from <a href="https://www.youtube.com/watch?v=e3W62BArRZY">Ben Bailey</a>, with apologies...)</h4>
<div>
<br /></div>
Some digital circuit components and circuits do what they do instantly. As an example, let's take the venerable AND gate. The 2 input AND gate has, as the name implies, two inputs, and one output. When both of the inputs are ON, the output of the AND gate is ON. When one or both of the inputs are OFF, the output of the AND gate is OFF.<br />
<br />
Now, how often does the AND gate check its inputs? Well, now. And now. And every now. Basically, the AND gate, always vigilant, watches its inputs and provides the appropriate output instantaneously. What a trooper.<br />
<br />
(Some of you who know physics and stuff might be growling at me now about things like ramp time, propagation delay and other practical phenomenon that prevent an AND gate from being truly instantaneous. Disclaimer: I am describing an idealized, abstracted, super-relativistic AND gate...)<br />
<br />
If you wire the output of one AND gate into an input of another gate (like an OR gate), the output of the AND gate also changes the state of the OR gate instantly(-ish). Circuits wired like that are called <a href="https://en.wikipedia.org/wiki/Combinational_logic">combinational</a>, or "time independent".<br />
<br />
<h4>
To the beat of the drum</h4>
<br />
As you either know or have guessed, not all digital circuits work like this. A quote that has been (perhaps mistakenly) attributed to Albert Einstein is that "Time is what keeps everything from happening all at once." In <a href="https://en.wikipedia.org/wiki/Synchronous_circuit">synchronous</a> digital circuits, a clock is what keeps everything from happening all at once. More to the point, a clock is how various operations of the circuit maintain synchronization with each other. You could say the clock is like the drum major in a marching band, keeping everyone stepping in sync.<br />
<br />
An example of a simple synchronous circuit is a <a href="https://www.electronics-tutorials.ws/sequential/seq_4.html">D-style flip flop</a>. In this circuit, there is an input (D), an output (Q), and a clock. (There can be some more I/Os, but ignore those for now...) Whenever the clock "ticks", the value currently at the input of D is copied to Q, and remembered there. D could change a hundred times between clock ticks, and Q wouldn't change - Q only remembers what the value of D was at the last clock tick. It's like a little one-bit storage location.<br />
<br />
Just like a combinational circuit with multiple connected gates, synchronous components like the flip flop can be daisy-chained into more complex circuits. Therefore, some operations performed in a synchronous circuit can take more than one clock cycle to propagate. For example, the output of flip-flop A may be connected to the input of flip-flop B, and B to C, and so on. By the time you get to flip-flop Z, a change in A will have taken nearly 30 clock cycles to reach flip-flop Z.<br />
<br />
RAM memory access can be like this. During one clock cycle, you might place the address of the memory chunk (e.g., byte) that you want to read on the address lines. Later, in a subsequent clock cycle, the data at that address is available to be read on the data lines. How many clock cycles before the data is available? This depends on the design. It can be anywhere from one clock cycle to many.<br />
<br />
In the case of the Block RAM (BRAM) on my FPGA, the latency is 2 clock cycles. But the 6502 CPU core I'm using expects the data to be ready in <b>1 clock cycle</b>. Therefore, the CPU is getting bogus data, and things are going awry.<br />
<br />
<h4>
CPU, hold your horses</h4>
<br />
My guess is that this RAM latency issue is truly the culprit. The CPU free-runs OK, which shows that it's operating when it has valid values on the data lines.<br />
<br />
<i>But assuming I'm right, how do I fix it?</i><br />
<br />
I'm not sure about the best way to handle this. In my Google searches, I've found discussions of:<br />
<br />
<ul>
<li>Using mixed clock "domains" (where the RAM is clocked at a higher, fixed multiple of the CPU clock so it gets data to the CPU on time),</li>
<li>Using an input line on the 6502 called "RDY", which pauses the CPU until memory is ready, and,</li>
<li>Other stuff that I don't quite understand.</li>
</ul>
<br />
One of the interesting aspects of this project is that I'm flailing in the deep end of the pool. I've found that this is often where I learn things.<br />
<br />Earlhttp://www.blogger.com/profile/00491259029760076753noreply@blogger.com0tag:blogger.com,1999:blog-4870640620668961176.post-90267979292659972482018-09-03T14:08:00.000-07:002018-09-03T14:08:43.112-07:00RC 2018/09 Part 01 - Run Free Little CPU, Run FreeMy first test with a couple of different 6502 CPU cores on the Zybo FPGA board was a partial failure, but that's OK. I'm farther along than I was before.<br />
<br />
<h4>
What Is Goal One</h4>
<br />
My first goal is to get a retro CPU core on the FPGA board to do something called a "Free Run" - an activity documented on a real chip in <a href="https://coronax.wordpress.com/2012/11/11/running-in-circles/">this blog post</a>.<br />
<br />
Here's the concept - instead of connecting actual RAM or ROM to the CPU, you instead hard-wire the data lines so that the CPU sees the same value at <b><i>every</i></b> memory address. In the case of a free run, that value is a CPU instruction called a "NOP", for No Operation. This instruction tells the CPU to do nothing, move to the next memory location, and execute the instruction there.<br />
<br />
Since the data lines are hard-wired with the value of NOP, the CPU will see NOPs everywhere. So, it will start at some location (more on that in a future post), move to the next location, and so on, until it reaches the end of its memory space. It will then roll around to to bottom of memory (location zero), and keep going around again, forever.<br />
<br />
Why do this? Well, even though the CPU address lines aren't actually changing the data that the CPU is seeing, the address lines still happily increment. You can watch them do this, and seeing them bounce up and down shows the CPU is running.<br />
<br />
And for some reason, mine isn't.<br />
<br />
<h4>
What's What</h4>
<div>
<br /></div>
<div>
Here's a bit more about the FPGA chip and board that I'm using.</div>
<div>
<br /></div>
<div>
The FPGA I'm using is a Zynq-7000, model XC7Z010. The Zynq family is a really interesting series of chips. They combine, on the same silicon, an ARM processor (with varying speeds and numbers of cores), interfaces for a variety of physical devices, some general purpose I/O pins, and most importantly, FPGA functionality ("<a href="https://www.quora.com/What-are-FPGA-core-and-FPGA-fabric-And-what-is-the-difference-between-FPGA-fabric-and-FPGA-core">fabric</a>"). For this project, I'm not using the ARM at all, and will only use a small bit of the I/O capabilities.</div>
<div>
<br /></div>
<div>
The software used to program this chip is called Xilinx Vivado HLx. If you're used to lightweight tool chains in the software development world, then the FPGA world will surprise you. Vivado requires 20+ GB on your hard drive, and the install process takes a long time. For this project, I downloaded and installed the latest, version 2018.2.</div>
<div>
<br /></div>
<h4>
What Works</h4>
<div>
<br /></div>
<div>
In the past, I've tried a couple of times to get a retro CPU core in Verilog or VHDL to simply compile under Vivado, and failed. But this time, I got a couple of different cores working, and even set up enough of a project to generate a <a href="https://www.xilinx.com/html_docs/xilinx2018_1/SDK_Doc/SDK_concepts/concept_fpgabitstream.html">bitstream</a> and download it to the board. It didn't work, but this is still progress.</div>
<div>
<br /></div>
<div>
<br /></div>
<h4>
What Doesn't Work</h4>
<div>
<br /></div>
<div>
I'm using a simple Verilog 6502 CPU core. As far as I can tell, the inputs are wired such that the CPU should run, and I also supplied a clock signal to the CPU to make it go. But the address lines aren't bouncing up and down - they are staying off. So, I've got some more work to do.</div>
<div>
<br /></div>
<h4>
What's Next</h4>
<div>
<br /></div>
<div>
When creating FPGA designs, Real Hardware Engineers (which I am, most decidedly, not) write test benches and do simulations, using various tools that permit a digital design to be executed in software and debugged. Simulation and test benches are really important, and they're something I really haven't studied enough. My method (let's throw it on the board and see what sticks) is that of a hobbyist, and it's OK, but it might not get me through this project. So, digging further into the simulation and test bench abilities of Vivado may be my next step.</div>
<div>
<br /></div>
<div>
More to come...</div>
<div>
<br /></div>
Earlhttp://www.blogger.com/profile/00491259029760076753noreply@blogger.com0tag:blogger.com,1999:blog-4870640620668961176.post-66163987339980578022018-09-02T12:06:00.000-07:002018-09-02T12:06:59.355-07:00RC2018/09 Part 00Retrochallenge 2018/09 is off to the races! Here's a description of my devious plans...<br />
<br />
<h4>
The What</h4>
<br />
My goal for the 2018/09 Retrochallenge event is to get a retro CPU core running on my <a href="https://store.digilentinc.com/zybo-zynq-7000-arm-fpga-soc-trainer-board/">Zybo</a> FPGA development board.<br />
<br />
The end result doesn't have to do much...it could just be a 6502 blinking an LED, or a Z80 running a short program and depositing a value into a register. It would be lovely to wind up with a retro computer implementation like a virtual PET or CP/M machine, but that would be a stretch goal!<br />
<br />
<h4>
The Why</h4>
<br />
Years before I wrote my first computer program, I loved tinkering with electronics. My parents started me out with a Radio Shack <a href="https://www.radiomuseum.org/r/radio_shac_science_fair_crystal_rad.html">crystal radio</a> when I was 5, then a few years later bought me a Science Fair 65 in 1 kit. That kit was awesome - <a href="https://www.youtube.com/watch?v=znO3OWPSk4I">even Rod Serling thought so</a>. I learned how transistors, capacitors, resistors, etc. worked, and how they combined to form useful stuff like radios, sirens, and other fun gadgets. If I wasn't a geek already, this sealed the deal.<br />
<br />
A few years after that, I stumbled upon solid-state digital circuits, and my journey down the rabbit hole was complete. After successfully nagging my dad (on multiple occasions) to buy me a bunch of stuff at the local discount electronics shop, I would spend hours wiring up my solderless breadboard with 74xx TTL ICs, 555 timers, LEDs and switches. The <a href="http://bugbookcomputermuseum.com/BugBook-Titles-Originial.html">BUGBOOK original book series</a> (BUGBOOK I, BUGBOOK II) was a wonderful introduction to this world of digital chips. This season of my life taught me about rudimentary Boolean logic, and how to fry things by hooking them up backwards. The opportunity to see 1s and 0s up close has been useful my whole career. That said, once I leapt into the world of microcomputers, my electronics hobby took a decades-long back seat.<br />
<br />
Enter the world of the Parallax Propeller, Arduino, Raspberry Pi and the like, and I was happily dragged back into the world of hacking around with electronics. These modern microcontroller boards combine programming, breadboarding, built-in I/O, and are all documented with the cumulative knowledge of the Internet. I'm almost glad this wasn't around when I was a kid, or I likely would have never emerged from my bedroom.<br />
<br />
Moving along with the maker community flow, I noticed programmable logic devices such as CPLDs and FPGAs being discussed with more frequency. I wondered, what are these funky things, and what can be done with them? A podcast listener heard my musings and graciously sent me a <a href="https://alchitry.com/products/mojo-v3">Mojo</a> FPGA board to play around with. I learned that this was a 21st century version of my TTL tinkering, albeit a gajillion times more powerful and very "virtual" in nature. With an FPGA, you dictate the circuit you need (usually in a specialized "hardware description language" or HDL like Verilog or VHDL), and the circuit appears almost magically inside the FPGA chip. Wow!<br />
<br />
What kinds of circuits can you make? Almost anything within the speed and size boundaries of the FPGA, it turns out, including modern day digital reproductions of the CPUs of old, like the 6502, Z80, 6809, 68000, 8086, and more. I knew I wanted to, at some point, make an old CPU live on a modern FPGA board. Now, this has been done by many people already, and for my first go, I'll be using their work and just adapting it to my particular FPGA board. This could turn out to be easy or tough. Finding out is part of the point of this Retrochallenge entry.<br />
<br />
<h4>
The How</h4>
<br />
Designs on FPGAs or other logic devices are often called "cores". (I'm not sure why.) It seems there are "cores" in the open source world for all ye CPUs of olde, many of them written in the HDLs that I referred to earlier. I'll take one of these, compile it for my particular board using the tool set for that board (Xilinx Vivado HLx), and make it do something. (Well, that's the plan.)<br />
<br />
If that works out OK, then I'll try to do more, like combining that CPU with other circuits to make a rudimentary computer.<br />
<br />
More to come!Earlhttp://www.blogger.com/profile/00491259029760076753noreply@blogger.com1tag:blogger.com,1999:blog-4870640620668961176.post-27510042845425434882014-10-04T11:15:00.002-07:002014-10-04T11:21:55.062-07:00Show 147 - Jeff Ledger and the Micromite CompanionFor show 147, I speak with Jeff Ledger, longtime Commodore and Propeller enthusiast, and creator of the Micromite Companion (MMC). The MMC is a single-board kit computer with two brains - a <a href="http://geoffg.net/micromite.html">Micromite</a>, and a <a href="http://www.parallax.com/microcontrollers/propeller">Propeller</a>. Jeff explains how these two come together to make a computer styled in the retro spirit, but with modern day parts. (Old skool computing, modern day fun?)<br />
<br />
Links: <br />
<br />
<a href="http://www.computerhistory.org/_static/atchm/early-digital-research-cpm-source-code/">Early Digital Research CP/M Source Code (Computer History Museum) </a><br />
<a href="http://propellerpowered.com/">The PropellerPowered website</a><br />
<a href="http://forums.propellerpowered.com/">The PropellerPowered Forums</a><br />
<a href="http://traffic.libsyn.com/retrobits/RBP-2014-10-04-147.mp3">Direct link to the MP3</a> <br /><br />
This episode is Copyright 2014 by Earl Evans.<br />
<a href="http://creativecommons.org/licenses/by/4.0/" rel="license"><img alt="Creative Commons License" src="http://i.creativecommons.org/l/by/4.0/88x31.png" style="border-width: 0;" /></a><br />
This work is licensed under a <a href="http://creativecommons.org/licenses/by/4.0/" rel="license">Creative Commons Attribution 4.0 International License</a>.
Earlhttp://www.blogger.com/profile/00491259029760076753noreply@blogger.com0tag:blogger.com,1999:blog-4870640620668961176.post-42233287575509765272014-08-03T12:09:00.000-07:002014-08-03T12:09:24.250-07:00Getting REAL with Retrochallenge23:59 GMT is staring me in the face, daring me to get my Fortran program done in time. But alas, it wasn't meant to be.<br />
<br />
I'm throwing in the towel, with two of nine programs done. As explained in my last post, I'm actually really happy with the time I spent. It taught me a lot and I intend to keep going with programming these platforms. The effort has, though, reminded me of <a href="http://en.wikipedia.org/wiki/Murphy%27s_law">Murphy's Law</a>...and to never enumerate your juvenile poultry until the proper process of incubation has thoroughly materialized.<br />
<br />
I was so, so close on the Fortran program. Ironically, the roadblock is a problem I thought I'd solved early on - random numbers.<br />
<br />
My PDP-11 is a lot of fun. But it has a shortcoming that really got in my way for Retrochallenge - no Floating Point Processor. The 11/23+ CPU card (KDF11-BA) can have floating point, or not. On mine, it's not. Therefore, to use Fortran, I have to ensure I never, ever use floating point in the program, and I have to use a special library in the LINK phase to even get the programs to run. Fortran really likes floating point, and is somewhat loathe to run without it. I guess that makes sense for a language derived from "<a href="http://en.wikipedia.org/wiki/Fortran">Formula Translating System</a>".<br />
<br />
The pseudo-random number generators out there for Fortran, including the one that comes with the DEC compiler, also typically want floating point. I ain't got none. So there you have it.<br />
<br />
I thought I'd found a good INTEGER based algorithm, but it turned out to be so darned complicated to use that there's no way I'd implement it in time to save the day.<br />
<br />
<h3>
Workflows</h3>
<br />
So instead, here is my promised post about modern=>retro workflows.<br />
<br />
I've learned so much during this RC that it's tough to write it all down. However, here are some workflow highlights from my programming efforts.<br />
<br />
I wanted to write my source code on a modern PC because I'm lazy. There, I said it. I like (no, love) modern programmer's text editors. I've always tried to be the first on my block with cool, syntax-highlighting, macro-enabled editors. <a href="http://en.wikipedia.org/wiki/Brief_%28text_editor%29">Brief</a> was one of my favorites of all time.<br />
<br />
For this excursion, I chose <a href="http://www.jedit.org/">Jedit</a>. I'm not really a fan of Java client-side applications, but Jedit is an exception. It's clean, feature-filled, and supports Forth and Fortran natively. I used it for both the Atari 800/X-Forth and PDP-11/Fortran projects.<br />
<br />
But, how to get the source code to the target platforms? Easy! Well, heh, I probably spent more time figuring this stuff out than it would have taken me to edit on the local platforms. But hey, take time to save time, I always say. Actually, maybe that's the first time I've said that. But I'll always say it from now on.<br />
<br />
For Atari 800/X-Forth:<br />
<br />
<ul>
<li>I used <a href="http://aspeqt.sourceforge.net/">aspeqt</a> (an open-source Atari peripheral emulator) to simulate disk drives for the Atari, connected via an <a href="http://www.atarimax.com/sio2pc/documentation/">SIO2PC</a> adapter. In aspeqt, I mounted a Windows folder as a virtual drive. To the Atari, the folder looked like a disk drive, so I could transparently load things from it.</li>
<li>Alas, the Atari uses ATASCII, and Jedit naturally edits in ASCII. So when I wanted to make the Forth source file available to the Atari, I had to convert it. For this, I used a cute little utility called <a href="http://raster.atariportal.cz/forpc/dratex.htm">Dratex</a>. It's simple, but fast, and works easily.</li>
<li>Once the source file was in ATASCII format, I loaded it from the virtual folder (that the Atari saw as drive D2), and voila!</li>
</ul>
<br />
For PDP-11/Fortran 77:<br />
<br />
<ul>
<li><a href="http://www.dbit.com/">E11</a> is a most excellent PDP-11 emulator, and is free for personal/hobbyist use. I admit that during most of the Fortran development, I used the emulator. (Keeping a <a href="http://www.cosam.org/computers/dec/pdp11-23/">real PDP-11 with dual RL02 drives</a> running for extended periods makes the electric company happy, but makes my pocketbook sad.)</li>
<li>E11 can map the main "SLU" console (and, actually, many of the emulated terminal interfaces) to a Telnet session. From there, I connected to my emulated PDP-11 with the <a href="http://en.sourceforge.jp/projects/ttssh2/">Tera Term</a> terminal emulator program.</li>
<li>Once code in Jedit was ready for a test, I would open a Tera Term session to E11, and simply paste the code into the terminal window. Tera Term has a configurable delay in between lines when pasting, and this helps the host machine to keep up. Once the source code was pasted, I would save it, compile it, and test!</li>
</ul>
<br />
Thanks as always to the folks running the Retrochallenge for a fun outing. I just love it. I hope to participate every time, till smoking capacitors do us part.<br />
<br />
See you next time,<br />
<br />
- Earl<br />
<br />
Earlhttp://www.blogger.com/profile/00491259029760076753noreply@blogger.com0tag:blogger.com,1999:blog-4870640620668961176.post-72580163793650524882014-08-01T15:45:00.001-07:002014-08-01T15:49:40.763-07:00Craps program for the Epson PX-8 in BASICWithout any ado, here's the Retrochallenge 2014 SC craps program that I wrote for the Epson PX-8 in BASIC.<br />
<br />
First, a video demonstration:<br />
<br />
<iframe allowfullscreen="" frameborder="0" height="315" src="//www.youtube.com/embed/x6xC5F3FbUg" width="560"></iframe>
<br />
<br />
Now, the source code:<br />
<br />
<span style="color: red;"><b><span style="font-family: "Courier New",Courier,monospace;">1000 REM Remove menu bar and set text screen mode<br />1010 SCREEN 0,0,0<br />1020 CLS<br />1030 PRINT "Welcome to RC-CRAPS! What is your name: ";<br />1040 LINE INPUT N$<br />1050 REM Get random seed from 614.4 KHz clock at Z80 I/O reg 0 and 1<br />1060 R=INP(1)*256+INP(0)<br />1070 R=R-32768!<br />1080 RANDOMIZE R<br />1090 PRINT "Hello ";N$;"! Would you like instructions? (Y/N): ";<br />1100 YN$=INPUT$(1)<br />1110 IF YN$="y" OR YN$="Y" THEN GOSUB 1630<br />1120 BR%=1000<br />1130 CLS<br />1140 PRINT "You have ";<br />1150 PRINT USING "$#####";BR%;<br />1160 PRINT " in the bank."<br />1170 PRINT "Your bet? (1-50 dollars, or Q to quit: ";<br />1180 LINE INPUT BT$<br />1190 IF LEFT$(BT$,1) = "q" OR LEFT$(BT$,1) = "Q" THEN 1870<br />1200 BT% = VAL(BT$)<br />1210 IF BT%<1 OR BT%>50 THEN 1170<br />1220 PRINT "(P)ASS/win or (D)ON'T PASS/lose?: ";<br />1230 PD$=INPUT$(1)<br />1240 PRINT<br />1250 IF INSTR("PpDd",PD$)=0 THEN 1220<br />1260 PRINT<br />1270 GOSUB 1800<br />1280 IF (P%=7) OR (P%=11) THEN 1320<br />1290 IF (P%=2) OR (P%=3) THEN 1370<br />1300 IF (P%=12) THEN 1420<br />1310 GOTO 1450<br />1320 REM win<br />1330 PRINT "You win!"<br />1340 IF PD$="p" OR PD$="P" THEN PRINT "You bet you would win. Good job!":BR%=BR%+BT%<br />1350 IF PD$="d" OR PD$="D" THEN PRINT "You bet against yourself. OOPS!":BR%=BR%-BT%<br />1360 GOTO 1140<br />1370 REM lose<br />1380 PRINT "You lose!"<br />1390 IF PD$="p" OR PD$="P" THEN PRINT "You bet you would win. OOPS!":BR%=BR%-BT%<br />1400 IF PD$="d" OR PD$="D" THEN PRINT "You bet against yourself. Good job!":BR%=BR%+BT%<br />1410 GOTO 1140<br />1420 REM push<br />1430 PRINT "You rolled boxcars (12). No win or loss."<br />1440 GOTO 1140<br />1450 REM continue point roll<br />1460 PT%=P%<br />1470 PRINT "Your point is";PT%<br />1480 GOSUB 1800<br />1490 IF P% = 7 THEN 1530<br />1500 IF PT% = P% THEN 1570<br />1510 PRINT "Keep playing!"<br />1520 GOTO 1470<br />1530 PRINT "You lose"<br />1540 IF PD$="p" OR PD$="P" THEN PRINT "You bet you would win. OOPS!":BR%=BR%-BT%<br />1550 IF PD$="d" OR PD$="D" THEN PRINT "You bet against yourself. Good job!":BR%=BR%+BT%<br />1560 GOTO 1140<br />1570 PRINT "You win"<br />1580 IF PD$="p" OR PD$="P" THEN PRINT "You bet you would win. Good job!":BR%=BR%+BT%<br />1590 IF PD$="d" OR PD$="D" THEN PRINT "You bet against yourself. OOPS!":BR%=BR%-BT%<br />1600 GOTO 1140<br />1610 GOTO 1140<br />1620 END<br />1630 CLS<br />1640 PRINT "RC-CRAPS rules:"<br />1650 PRINT "1. The bank gives you an initial bankroll. Use it wisely!"<br />1660 PRINT "2. Make a bet on PASS (win) or DON'T PASS (loss). Max bet is $50."<br />1670 PRINT "3. Make an initial roll of the dice:"<br />1680 PRINT " 7 or 11 wins. 2 or 3 loses. 12 is a 'do over' (no win or loss)"<br />1690 PRINT<br />1700 PRINT "Press any key for next page...";<br />1710 NT$=INPUT$(1)<br />1720 CLS<br />1730 PRINT "4. Any other roll sets your 'point'. Rolling this again is your goal."<br />1740 PRINT "5. Roll again until you roll your point for a win, or 7 for a loss."<br />1750 PRINT "6. Good luck! Remember, what happens in RC-CRAPS, stays in RC-CRAPS!"<br />1760 PRINT<br />1770 PRINT "Press any key to continue...";<br />1780 NT$=INPUT$(1)<br />1790 RETURN<br />1800 REM Two dice at random<br />1810 PRINT "Press any key to roll the dice!"<br />1820 NT$=INPUT$(1):PRINT<br />1830 D1%=INT(RND(1)*6)+1:D2%=INT(RND(1)*6)+1<br />1840 P%=D1%+D2%<br />1850 PRINT "You rolled a";D1%;"and a";D2%;"for a";P%;"!"<br />1860 RETURN<br />1870 CLS<br />1880 PRINT "Thanks for playing RC-CRAPS!"<br />1890 PRINT "You left with $";BR%;"in the bank!"<br />1900 END</span></b></span>Earlhttp://www.blogger.com/profile/00491259029760076753noreply@blogger.com0tag:blogger.com,1999:blog-4870640620668961176.post-48472434077418442052014-08-01T11:17:00.001-07:002014-08-01T11:17:29.130-07:00Travails and TriumphsI started this year's summer Retrochallenge with a simple goal - develop three games (craps, roulette, and 21) for three different computer/language combos:<br />
<br />
<ul>
<li>PDP-11 with Fortran 77</li>
<li>Epson PX-8 with BASIC</li>
<li>Atari 800 with Forth</li>
</ul>
<br />
The logic of the games is not tough, especially if you simplify it a bit for computer play. However, I bumped into enough issues that in the end, I will likely only have 1 game (craps) for each of the platforms.<br />
<br />
On the face of it, this might seem like a disappointment, but I'm actually pretty pleased. This Retrochallenge got me programming again, revived my love for an old friend (Fortran), and taught me more things about Forth, a language and programming paradigm which I'm really coming to respect.<br />
<br />
We've been given a couple of extra days to finish our RC entries, so I'll probably have the Fortran game ready by then. For now, I wanted to share some things I've learned (or re-learned) along the way about writing code for my target platforms.<br />
<br />
<h3>
TL;DR Version</h3>
<br />
<br />
I'm covering quite a bit of ground below. If you're tight on time, here is the summary:<br />
<br />
<ul>
<li><b>PX-8</b>: It's tough in BASIC to manage a big program, mostly due to line numbers and the lack of named subroutines. Also, an 8-line display on your target platform makes this even more challenging.</li>
<li><b>Atari/X-Forth</b>: Lack of complete documentation and mediocre text I/O meant I had to do some "roll your own" development.</li>
<li><b>PDP-11/Fortran 77</b>: Printing control characters for terminal control (e.g., clearing the screen) turned out to be tough to figure out. Solved this by creating a BYTE array, putting the control codes into the array with a DATA statement, then calling an OS subroutine for raw output.</li>
</ul>
<br />
Below - the gory details...<br />
<br />
<h3>
If it's BASIC, why is it hard</h3>
<h3>
</h3>
First up, BASIC on the PX-8.<br />
<br />
Programming in BASIC is often a shoot from the hip exercise. The interpretive, interactive environment lends itself to this. But the freedom isn't without cost.<br />
<br />
For instance - line numbers are, quite frankly, a drag. I'm pretty sure the PX-8 BASIC is a Microsoft derivative (it has that style to it), so it's a serviceable language, thankfully with a <b>RENUMBER</b> statement. You missed some code and need to insert it? No problem, go for it (assuming you left space - didn't you?), and then use RENUMBER to smooth things out again. For the uninitiated, the RENUMBER command takes a BASIC program with erratic line numbers like this:<br />
<br />
<b><span style="color: red;"><span style="font-family: "Courier New",Courier,monospace;">10 PRINT</span></span></b><br />
<b><span style="color: red;"><span style="font-family: "Courier New",Courier,monospace;">12 PRINT "Oops, I left this line out"</span></span></b><br />
<b><span style="color: red;"><span style="font-family: "Courier New",Courier,monospace;">15 PRINT "And this one, too!"</span></span></b><br />
<b><span style="color: red;"><span style="font-family: "Courier New",Courier,monospace;">20 GOTO 12</span></span></b><br />
<br />
and makes it look like this:<br />
<br />
<br />
<b><span style="color: red;"><span style="font-family: "Courier New",Courier,monospace;">10 PRINT</span></span></b><br />
<b><span style="color: red;"><span style="font-family: "Courier New",Courier,monospace;">20 PRINT "Oops, I left this line out"</span></span></b><br />
<b><span style="color: red;"><span style="font-family: "Courier New",Courier,monospace;">30 PRINT "And this one, too!"</span></span></b><br />
<b><span style="color: red;"><span style="font-family: "Courier New",Courier,monospace;">40 GOTO 20</span></span></b><br />
<br />
Notice that along with renumbering the program to even spaces of 10, it also fixes things like the GOTO statement, putting the new correct line number into the code.<br />
<br />
This is all well and good, but it can wreak havoc on your code if you've set aside chunks of line numbers for subroutines. For example:<br />
<br />
<span style="color: red;"><span style="font-family: "Courier New",Courier,monospace;"><b>10 PRINT "I'll call a subroutine at line 1000".</b></span></span><br />
<span style="color: red;"><span style="font-family: "Courier New",Courier,monospace;"><b>20 GOSUB 1000</b></span></span><br />
<span style="color: red;"><span style="font-family: "Courier New",Courier,monospace;"><b>30 PRINT "I'm back from the subroutine."</b></span></span><br />
<span style="color: red;"><span style="font-family: "Courier New",Courier,monospace;"><b>40 GOTO 9999 : REM END</b></span></span><br />
<span style="color: red;"><span style="font-family: "Courier New",Courier,monospace;"><b>1000 PRINT "I'm in the subroutine at line 1000."</b></span></span><br />
<span style="color: red;"><span style="font-family: "Courier New",Courier,monospace;"><b>1010 RETURN</b></span></span><br />
<span style="color: red;"><span style="font-family: "Courier New",Courier,monospace;"><b>9999 END</b></span></span><br />
<br />
If I RENUMBER this program, the subroutine's nice line number separation from the rest of the program will be lost.<br />
<br />
If I could call a subroutine by name or label instead of by line number, then everything would be awesome! But I can't. So as a BASIC program gets bigger, it's harder and harder to manage.<br />
<br />
To make things even more spicy, there is only an 8 line screen on the PX-8. You can't see many line numbers all at once, making it more difficult to get the big picture of your program.<br />
<br />
Getting past these issues can be tough. Here are some possible solutions:<br />
<br />
<ul>
<li>Plan out your subroutines in advance. Set aside line number chunks for them. Make sure you have plenty of spacing so you don't wander into your subroutines from your main code. Don't RENUMBER until the very end, or at least, until you're tired of knowing where your subroutines are :-)</li>
<li>Use ranges in the LIST command to help see small chunks of the code at one time without it scrolling up the screen.</li>
<li>Keep a notebook beside you (or a Notepad window) to scribble some notes on where things are in your program, what variables you use for what purpose, etc.)</li>
</ul>
<br />
<h3>
Bringing Forth The Text</h3>
<br />
The Atari 800 has several varieties of the <a href="http://atariwiki.strotmann.de/wiki/Wiki.jsp?page=Forth">Forth</a> environment. For Retrochallenge, after some experimentation, I chose <a href="http://atariwiki.strotmann.de/wiki/Wiki.jsp?page=X-FORTH">X-Forth</a>, for three reasons:<br />
<br />
<ul>
<li>X-Forth uses standard ASCII (or in this case, <a href="http://en.wikipedia.org/wiki/ATASCII">ATASCII</a>) files for source code, rather than relying on the more primitive and frustrating "screen" concept of older Forths. This makes it possible to edit your Forth words in a nice text editor, then load them into the Forth environment.</li>
<li>Also, X-Forth is sort of a hybrid between the older figForth and the more modern ANSI Forth. While not all of the newer standard is supported, there is enough there to make life more pleasant.</li>
<li>It's GPL licensed. </li>
</ul>
<br />
Right off the bat, the first challenge with X-Forth was documentation. The web page notes "more detailed tutorial to come!", but for now, there's an amount of hunt and peck required to figure things out.<br />
<br />
This hit me first when trying to figure out acquiring and processing text (e.g., the user's name). Older Forth systems seem a bit lacking when it comes to text I/O and character string manipulation. Compared to BASIC's INPUT, LINE INPUT, MID$, CHR$, etc., the offerings in Forth are pretty pedestrian. That's the bad news. The good news is, much of Forth is pretty close to the metal, and the location of things in memory is quite visible to the programmer. Don't have a word you need? Just write it! And that's what I did.<br />
<br />
The <b>EXPECT </b>word in Forth prompts the user for input. You provide EXPECT with a maximum input length and memory location, and EXPECT puts the user input into that memory area, followed by one or more null (0) bytes. Let's say you type HELLO [return]. In memory, at the location you specified, will go 6 bytes - the ASCII for H E L L O, and a zero byte. In X-Forth's EXPECT word, there is no way to figure out how many characters the user typed. This turns out to be a problem, as we'll see.<br />
<br />
The <b>TYPE </b>word in Forth prints text of a specified length from a specified memory address. If EXPECT is like INPUT, then TYPE is sort of like PRINT. However, TYPE doesn't know about the null byte at the end - it just outputs the length of text you give it. This means if you set aside 25 characters for the user's name, and the user only typed 7 characters in the EXPECT statement (above), then TYPE will output not just the name, but also the rest of the 25 characters, most of which will be garbage.<br />
<br />
Note that EXPECT guarantees a zero byte at the end of the input. So, I wrote a PRINT word in Forth, which simply starts at the provided memory address and prints the bytes one at a time until it encounters the zero terminator. Here's the source code:<br />
<br />
<b><span style="color: red;"><span style="font-family: "Courier New",Courier,monospace;">: PRINT ( addr -- )<br /> ( Prints chars starting at )<br /> ( addr until reaches null )<br /> ( Better than TYPE, which )<br /> ( outputs the nulls and )<br /> ( other junk in the string )<br /> ( area. )<br /> BEGIN DUP C@ 0= IF<br /> DROP 1<br /> ELSE<br /> DUP C@ EMIT 1 + 0 THEN<br /> UNTIL<br /> ;</span></span></b><br />
<br />
If in the future I want to use Forth for some more advanced programming, it would benefit me to write some words (perhaps in assembly) to do more robust I/O, conversion, and substring processing.<br />
<br />
Also, Forth heavily uses the "stack", a <a href="http://en.wikipedia.org/wiki/LIFO_%28computing%29">LIFO</a> area of memory for storing intermediate values as your program executes. To be true to the language, I used the stack as much as possible, rather than punting and using defined variables (which Forth supports). To make sure the "stack effect" of my words was as intended, I would open a Notepad and run through the code, updating a pretend stack as I went. Doing this bench test exercise revealed subtle bugs in my code and was quite enlightening. <br />
<br />
<h3>
CLEARing up Fortran</h3>
<br />
For the PDP-11 version of craps, I'm assuming the user has a VT100/ANSI-compatible terminal. (Oh no! Don't make your code platform-dependent!) So, I wanted to print out some control codes to clear the screen, home the cursor, etc. This, too, was a challenge.<br />
<br />
First, Fortran 77 has a function to convert an integer to a character: CHAR(int). However, that function isn't supported in PDP-11 Fortran 77. Bummer! How do I get a non-printable value into a character string so I can print it?<br />
<br />
Answer: I don't. The easiest way was to populate a BYTE array with the correct codes, then call a SYSLIB function from Fortran to write the values. Here's some sample source code:<br />
<br />
<span style="color: red;"><b><span style="font-family: "Courier New",Courier,monospace;"> PROGRAM CLSCR<br /> BYTE CLS(5)<br /> BYTE HOME(4)<br /> DATA CLS/27,'[','2','J',128/<br /> DATA HOME/27,'[','H',128/<br /> CALL PRINT(CLS)<br /> CALL PRINT(HOME)<br /> END</span></b></span><br />
<br />
Note the use of the DATA statement - this takes values and crams them into variables. It gave me a way to get non-printable values (like ASCII 27 for ESC) into a BYTE array.<br />
<br />
Also, note the CALL PRINT statements. PRINT is a function in the system library that takes an address as an argument, then prints characters from that address forward until it reaches a 0 or 128 byte. A zero termination will result in a CR/LF being printed following the characters, where a 128 will result in no line termination (this is what I wanted).<br />
<br />
Interestingly, the PRINT subroutine is very similar to the operation of the PRINT word I created for X-Forth!<br />
<br />
That's all that I'll bore you with for now. Suffice it to say, I'm having a blast. It's very likely I'll keep going with these projects once the Retrochallenge is over - it will be fun to leverage the knowledge I've accumulated.<br />
<br />
I have two more blog posts to come - one on the workflows I set up to program on a PC and move the code to the target platforms, and finally, a blog post (hopefully) on the final craps game in Fortran. Stay tuned... <br />
<br />
Earlhttp://www.blogger.com/profile/00491259029760076753noreply@blogger.com4tag:blogger.com,1999:blog-4870640620668961176.post-83388633784346382122014-07-28T16:59:00.002-07:002014-07-28T17:05:55.312-07:00RC Craps for Atari 800/X-ForthTo recap - for this year's summer <a href="http://retrochallenge.org/">Retrochallenge</a>, I want to write 9 games - 3 each on 3 different platform/language combinations. Two of the nine are complete! And with a recent time extension granted by our illustrious organizer, I might just get all 9 done.<br />
<br />
This blog post documents Craps on the Atari 800, using the <a href="http://atariwiki.strotmann.de/wiki/Wiki.jsp?page=X-FORTH">X-Forth</a> language.<br />
<br />
X-Forth is a derivative of <a href="http://atariwiki.strotmann.de/wiki/Wiki.jsp?page=Extended%20Atari%20FIG-Forth%20APX20029">figForth</a>, but intends to be more compatible with the <a href="http://www.taygeta.com/forth/dpans.html">ANSI Forth</a> standard. However, it's not completely ANSI-compatible yet. This means it can take some digging and trial and error to figure out which Forth words are implemented, and whether their behavior is figForth or ANSI. While there is no manual, there are a couple of sample programs that helped me riddle this all out.<br />
<br />
I'd like to go more into details on some of the things I learned, but while I go write the deep-dive, here's a video demo of the program, and the source code. Note that neither are incredibly impressive. There is no color, sound or graphics - weird for a game on the Atari. Right now, it's all text. However, when you look at how a Forth program is unpacked - words within words, culminating in atomic definitions - it won't be hard to modify the program in a modular fashion to get some more exciting UI implemented.<br />
<br />
Here's the video:<br />
<br />
<iframe allowfullscreen="" frameborder="0" height="315" src="//www.youtube.com/embed/ThLASnhYkyw" width="560"></iframe>
<br />
And here's the source code:<br />
<br />
<span style="font-family: "Courier New",Courier,monospace;">( RC-CRAPS for Atari 800/X-Forth )<br />( Version 0.1 )<br />( Licensed under Creative Commons )<br />( BY-NC-SA 3.0 )<br />( By Earl Evans )<br />( www.retrobits.com )<br />( for Retrochallenge SC 2014! )<br /><br />( TO-DO: )<br />( Add graphics and sound! )<br />( Find better psuedo-random )<br />( number generator. )<br />( Make input routines more )<br />( bulletproof, perhaps with )<br />( assembly-language words. )<br /><br />125 EMIT ( Clear screen )<br /><br />CR<br />." RC-CRAPS for Atari 800/X-Forth." CR<br />." Version 0.1"<br />." Licensed under Creative Commons" CR<br />." creativecommons.org/licenses/" CR<br />." by-nc-sa/3.0/" CR CR<br />." RANDOM word courtesy of" CR<br />." James M. Reneau, Ph.D. via Creative" CR<br />." Commons at:" CR<br />." www.renejm.net/" CR<br />." 6502FIGForthHandyRandom" CR<br /><br />CR<br />." Initializing variables"<br /><br />1000 VARIABLE BANKROLL<br />0 VARIABLE BET<br />21 CONSTANT NAME-LEN<br />-1 VARIABLE PLAYER NAME-LEN ALLOT<br />PLAYER NAME-LEN 32 FILL<br />0 VARIABLE POINT<br />0 VARIABLE SEEDHIGH<br />0 VARIABLE SEEDLOW<br />0 VARIABLE RANDOMSEED<br />0 VARIABLE RANDOMKICK<br /><br />CR<br />." Loading Utility Functions"<br /><br />: WAITKEY ( -- )<br /> ( Waits for a keypress )<br /> KEY DROP ;<br /><br />: CLS ( -- )<br /> ( Clears the Atari screen )<br /> 125 EMIT ;<br /><br />: PRINT ( addr -- )<br /> ( Prints chars starting at )<br /> ( addr until reaches null )<br /> ( Better than TYPE, which )<br /> ( outputs the nulls and )<br /> ( other junk in the string )<br /> ( area. )<br /> BEGIN DUP C@ 0= IF<br /> DROP 1<br /> ELSE<br /> DUP C@ EMIT 1 + 0 THEN<br /> UNTIL<br /> ;<br /><br />: POKEY-RND ( -- n )<br /> ( Gets a psuedo random value )<br /> ( from the Atari 800 POKEY )<br /> ( chip, leaves on stack. )<br /> 53770 C@<br /> ;<br /><br />CR<br />." Loading RANDOM"<br /><br />: RANDOM ( M -- N )<br /> ( RETURN A RANDOM INTEGER FROM 0 TO M-1 )<br /> ( NOT VERY GOOD AND WILL CYCLE FOR VALUES )<br /> ( - WORKS OK WITH 100, AND 10)<br /> ( BY JAMES RENEAU - 2012-05-12 )<br /> ( - LICENSED UNDER CREATIVE COMMONS A-NC-SA )<br /> RANDOMSEED @<br /> 67 * 103 + ABS 16383 MOD<br /> DUP RANDOMSEED ! <br /> RANDOMKICK @<br /> 101 + ABS 16383 MOD<br /> DUP RANDOMKICK !<br /> + SWAP MOD<br />;<br /><br />CR<br />." Loading ASK-NAME"<br /><br />: ASK-NAME ( -- )<br /> ( Asks for player name, places in PLAYER )<br /> CR ." Please enter your name: "<br /> PLAYER NAME-LEN EXPECT<br /> ;<br /><br />CR<br />." Loading ASK-YN"<br /><br />: ASK-YN ( -- n )<br /> ( Asks yes or no, if y or Y leaves 1 on<br /> ( the stack, 0 otherwise )<br /> KEY DUP 89 = SWAP 121 = OR IF 1 ELSE 0 THEN<br /> ;<br /><br />CR<br />." Loading ASK-BET"<br /><br />: ASK-BET ( -- n )<br /> ( Asks for a bet amount 1 - 50, leaves )<br /> ( on stack )<br /> CR ." Enter bet: "<br /> QUERY BL WORD HERE NUMBER DROP SWAP DROP<br /> BET !<br /> ;<br /><br />CR<br />." Loading GET-RN"<br /><br />: GET-RN ( -- n )<br /> ( Leaves random number 1 to 6 on stack )<br /> 6 RANDOM 1 +<br /> ;<br /><br />CR<br />." Loading SHOW-HELP"<br /><br />: SHOW-HELP ( -- )<br /> ( Displays help for playing the game )<br /> CLS<br /> ." Make a bet $1-$50." CR<br /> ." Throw the first roll." CR<br /> ." 7 or 11 wins. 2 or 3 loses." CR<br /> ." 12 pushes." CR CR<br /> ." Any other roll becomes your 'point'." CR<br /> ." Roll until you get your point (win)" CR<br /> ." or get a 7 (lose)." CR CR<br /> ." Press any key to continue..."<br /> WAITKEY<br /> CLS<br /> ;<br /><br />CR<br />." Loading INTRO"<br /><br />: INTRO ( -- )<br /> ( Provides an intro to the game )<br /> CLS CR <br /> ." Welcome to RC-CRAPS version 0.1!" CR<br /> ." Would you like instructions (Y/N)? "<br /> ASK-YN IF SHOW-HELP THEN<br /> ;<br /><br />CR<br />." Loading ROLL"<br /><br />: ROLL ( -- n )<br /> ( One roll of the dice, leaves )<br /> ( dice total on stack )<br /> CR<br /> ." Press any key to roll dice..."<br /> WAITKEY<br /> GET-RN GET-RN<br /> CR ." You rolled " DUP . ." + " SWAP DUP . ." = " + DUP .<br /> POINT @ DUP 0= IF<br /> DROP<br /> ELSE<br /> CR ." You are trying for a " .<br /> THEN<br /> ;<br /><br />CR<br />." Loading CHECK-WIN"<br /><br />: CHECK-WIN ( n -- n )<br /> ( Expects total of latest roll )<br /> ( on the stack. Leaves a code )<br /> ( on the stack of 0=roll again, )<br /> ( 1=win, 2=loss, 3=tie. )<br /> POINT @ 0= IF ( First roll )<br /> DUP 7 = SWAP DUP 11 = ROT OR IF ( win )<br /> DROP 1<br /> ELSE DUP 2 = SWAP DUP 3 = ROT OR IF ( loss )<br /> DROP 2<br /> ELSE DUP 12 = IF ( tie )<br /> DROP 3<br /> ELSE POINT ! 0 THEN THEN THEN ( roll again )<br /> ELSE ( not the first roll )<br /> DUP POINT @ = IF ( win )<br /> DROP 1<br /> ELSE DUP 7 = IF ( loss )<br /> DROP 2<br /> ELSE DROP 0 THEN THEN ( roll again )<br /> THEN<br /> ;<br /> <br /><br />CR<br />." Loading PLAY-ROUND"<br /><br />: PLAY-ROUND ( -- n )<br /> ( Plays a round of the game )<br /> ( Leaves 1 on the stack for )<br /> ( another round, or 0 on the )<br /> ( stack to quit. )<br /> ASK-BET<br /> 0 POINT ! ( Set initial "point" to zero )<br /> BEGIN<br /> ROLL CHECK-WIN<br /> DUP 0= IF<br /> CR ." Roll again!"<br /> ELSE DUP 1 = IF<br /> CR ." You win!"<br /> BANKROLL @ BET @ + BANKROLL !<br /> ELSE DUP 2 = IF<br /> CR ." You lose!"<br /> BANKROLL @ BET @ - BANKROLL !<br /> ELSE DUP 3 = IF<br /> CR ." Boxcars - no win or loss!"<br /> THEN THEN THEN THEN<br /> UNTIL<br /> CR ." Your bankroll is: $" BANKROLL @ .<br /> CR ." Play again (Y/N)? "<br /> ASK-YN 0= IF 1 ELSE 0 THEN<br /> ;<br /><br />CR<br />." Loading PLAY-GAME"<br /><br />: PLAY-GAME ( -- )<br /> ( Plays the entire game, exits )<br /> ( to OK when done )<br /> POKEY-RND SEEDHIGH !<br /> INTRO<br /> POKEY-RND SEEDLOW !<br /> ASK-NAME<br /> POKEY-RND RANDOMKICK ! SEEDHIGH @ SEEDLOW @ * RANDOMSEED !<br /> BEGIN PLAY-ROUND UNTIL<br /> CR ." Thanks, " PLAYER PRINT <br /> CR ." for playing RC-CRAPS!"<br /> CR ." Your final bankroll was: $" BANKROLL @ . CR CR<br /> ;<br /><br /> CR<br />." RC-CRAPS load complete!" CR<br />." Type PLAY-GAME [return] to play." CR<br />CR<br /><br /> </span>Earlhttp://www.blogger.com/profile/00491259029760076753noreply@blogger.com0tag:blogger.com,1999:blog-4870640620668961176.post-21656968393668286752014-07-07T23:00:00.000-07:002014-07-07T23:00:28.700-07:00Well, that's random<b>Why random numbers? </b><br />
<br />
In order to make a fun game of chance, you need random numbers. Dice rolls, card shuffles, or a roulette wheel are no fun if they're predictable.<br />
<br />
<b>Mommy, where do randoms come from? </b><br />
<br />
There are mathematical formulas that can provide a stream of seemingly random numbers. These are called pseudo-random number generators, or PRNGs. You start off a PRNG with a truly random "seed" number, from which the PRNG derives a sequence of numbers. Although this sequence gives the appearance of being random, it is completely predictable - each time the PRNG is started with the same seed, it will produce the same resulting sequence of numbers.<br />
<br />
<b>It all starts with a seed... </b><br />
<br />
Thus, the initial seed for a PRNG must be truly as random as possible. Computers are great at many things, but being unpredictable isn't one of them - so to get some randomness (or "entropy" as it's called in Information Theory), we need the human touch. In this case, quite literally.<br />
<br />
For each of the platforms I'm using for my Retrochallenge entry (Atari 800, Epson PX-8, PDP-11/23+), I wanted to find a suitably fast-changing clock or register that could be used as a seed. To get this value at a random time, you ask the user to press a key to perform some action (e.g., get their initial bankroll - thanks Ian!). After their key press, a value is sampled from the high-speed clock and used as the seed value. As long as that clock is fast enough, then voila, there's your random number seed.<br />
<br />
<b>Harvesting the seed </b><br />
<br />
The PX-8 was the most ideal. There is a 614.4 KHz clock that updates a rolling 16-bit register, the value of which can be read with from the BASIC "INP" function. This function reads values from Z80 I/O registers. Since 614.4 KHz will update the value more than 600,000 times per second, it is unlikely in the extreme that a user could predict when to press a key even if they wanted to.<br />
<br />
The Atari 800 and PDP-11 were not as good, but still passable. Each have memory-mapped registers that update at 60 Hz. Typically called "ticks", these are internal clocks for the computer's functions. In the Atari, it's part of the ANTIC video chip, and for the PDP-11, it's a component of the line clock. Reading the value of minutes, seconds and ticks after a user key press should provide an ample source of randomness. On the PDP-11, there is a system library function, callable from Fortran, called "GTIM", that provides the current count of ticks. On the Atari, in Forth, the value can be read with "C@", the Forth equivalent of a one-byte PEEK function.<br />
<br />
<b>Now we have a seed, how 'bout some numbers?</b><br />
<br />
PX-8 BASIC also has a PRNG built-in. You seed it with the "RANDOMIZE" statement, then use the RND function to get random numbers (fractions 0<=x<1). For Forth and Fortran, I need to provide the PRNGs; however, there are happily some good ones online.<br />
<br />
So hey, pal, no counting cards in my RC casino!<br />
<br />Earlhttp://www.blogger.com/profile/00491259029760076753noreply@blogger.com3tag:blogger.com,1999:blog-4870640620668961176.post-69458389862308800772014-06-30T23:53:00.000-07:002014-06-30T23:53:47.141-07:00Retrochallenge 2014 - Get SetNow it's 11:37 PM Pacific Time, and the excitement is building on the West Coast of the US, where Retrochallenge 2014 is about to commence!<br />
<br />
The computers are ready. But, alone, are they enough to stand up to the tests of character and strength that await them? Take heart, there is help from the sidelines.<br />
<br />
<b>The Raspberry Pi</b><br />
<br />
Serving once again as a trusty virtual disk drive for the PX-8, the Raspberry Pi is ready to retrieve and store BASIC programs:<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-SK_5fMVrjpuB9ciWrgUBz1kLlgFTByPwPGhJZC0rh_sxFBkrHA9uiJlumC5f8hDZyiPiWfLeyoWSgaX7aC7kBYqGiib_kj-aBNYVqm15rGvexfMRs0lz4W_-OPmoPZm5-ME-KeqvGdo/s1600/100_1032.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-SK_5fMVrjpuB9ciWrgUBz1kLlgFTByPwPGhJZC0rh_sxFBkrHA9uiJlumC5f8hDZyiPiWfLeyoWSgaX7aC7kBYqGiib_kj-aBNYVqm15rGvexfMRs0lz4W_-OPmoPZm5-ME-KeqvGdo/s1600/100_1032.JPG" height="193" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The Raspberry Pi wishes it was a PX-8</td></tr>
</tbody></table>
<br />
<b>SIO2PC</b><br />
<br />
Hey, the PX-8 isn't the only kid that gets to play with a virtual disk drive. The SIO2PC, a device which conveniently hooks an Atari 8-bit system to a modern PC, festooned with blinky lights, is standing by:<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKi1HJCis4ZG2ywwFNyvzxNY-oNyDxbO8ZGwLznpGWA9tKl1YnhX8BRrJNAswtOtTOgz7pLzcM7RzNulo4qJEcOPp84iTIPVJjm6RRnzmAZB510JItFJHhkrZM-jQJT8SMWy2hJb5QS9s/s1600/100_1031.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKi1HJCis4ZG2ywwFNyvzxNY-oNyDxbO8ZGwLznpGWA9tKl1YnhX8BRrJNAswtOtTOgz7pLzcM7RzNulo4qJEcOPp84iTIPVJjm6RRnzmAZB510JItFJHhkrZM-jQJT8SMWy2hJb5QS9s/s1600/100_1031.JPG" height="320" width="146" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Tomorrow, these LEDs shall blink</td></tr>
</tbody></table>
<br />
<br />
<b>The Manuals</b><br />
<br />
Books are the stuff of life, and the reference materials are also waiting in their corner. Here are, in no particular order, the Atari 800 "Purple Book", the KED editor (PDP-11) quick reference, and the Epson PX-8 BASIC Reference Guide:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXJ2zshRStWVKJBWUEtY7bvPl-hsylXgi7zXMUYVhmRg2zrngP26sMuJ3wO8qbHzb1OiJfOwim-m_2lLLzBV0GGnpRY7Ip5jRBdtAy9aEdT5mqTjllLprRgRyaB8Fl_8ND56dIEa7vrvw/s1600/100_1029.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXJ2zshRStWVKJBWUEtY7bvPl-hsylXgi7zXMUYVhmRg2zrngP26sMuJ3wO8qbHzb1OiJfOwim-m_2lLLzBV0GGnpRY7Ip5jRBdtAy9aEdT5mqTjllLprRgRyaB8Fl_8ND56dIEa7vrvw/s1600/100_1029.JPG" height="320" width="270" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0FMgum78hiWfmadk-oQOWcWysC_61oL1Xk2Fzc34HF6cfligisekcTjMjuHeL19Vp5STmjrrGhZ4rScbYNk3mC9klHyIFO26oHomOjSrimf59ijSOuPJqDTfeatgHqKqq1DXfVld8VuA/s1600/100_1030.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0FMgum78hiWfmadk-oQOWcWysC_61oL1Xk2Fzc34HF6cfligisekcTjMjuHeL19Vp5STmjrrGhZ4rScbYNk3mC9klHyIFO26oHomOjSrimf59ijSOuPJqDTfeatgHqKqq1DXfVld8VuA/s1600/100_1030.JPG" height="240" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiykbesoVLEKn6bMTa8cuAVls1GTsKVMDmdzauN6lZzsbUzBwiZ40i0PIfN81jqqQN_uTYEHdWM4ZC8_n3gy_YJN_ETrqmMamIvWOG_kM6dJwLkdND7T8afMpwKauO-v4Y1jjzhT8UUDCg/s1600/100_1033.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiykbesoVLEKn6bMTa8cuAVls1GTsKVMDmdzauN6lZzsbUzBwiZ40i0PIfN81jqqQN_uTYEHdWM4ZC8_n3gy_YJN_ETrqmMamIvWOG_kM6dJwLkdND7T8afMpwKauO-v4Y1jjzhT8UUDCg/s1600/100_1033.JPG" height="240" width="320" /></a></div>
<br />
<br />
Notice that nothing is powered on... No, my friends, that celebration comes in just a few minutes, as these digital animals are let out of their time-boxed cage! BWA HA HA HA HA HA.<br />
<br />
Ha.<br />
<br />
See you in the morning!<br />
<br />Earlhttp://www.blogger.com/profile/00491259029760076753noreply@blogger.com0tag:blogger.com,1999:blog-4870640620668961176.post-33526349147035743912014-06-30T23:19:00.000-07:002014-06-30T23:19:13.913-07:00Retrochallenge 2014 - On Your MarksIt's 10:49 PM Pacific Time in Portland, Oregon. The temp is 74 degrees outside, and it's going to be a whopping 98 tomorrow. That's 36.6 Celsius, quite warm by any measure.
In just over an hour, this year's Retrochallenge will begin for those of us on the West Coast of the US. Much of the world has already started. Eclipsing the Olympics and even the current World Cup frenzy, the Retrochallenge is the ultimate test of strength, agility, and stamina.<br />
<br />
OK, so, maybe that's over the top. However, I'm quite excited. In preparation, I've readied my systems. Here they are, in descending order of gross metric tonnage:<br />
<br />
<b>The PDP-11/23+</b><br />
<br />
Weighing in at over 300 pounds (>136 kilos) is the PDP-11/23+. It's loaded with the venerable Fortran 77 compiler. I love to say venerable. I'm not even sure what it means. But it's impressive.<br />
<br />
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipbI30sHl1Wjs-3XqWcnQfMD1O0RB7g19bAUtBwVQhColVZvKTFycheE_moP-WWNJzv2L5HzLPr4QBbvfTc-i250126CRHHE84VJUaXy2j8U1boCN4KuYJYoFFI5fM3Rxq0oZ1e9Sz6Dg/s1600/100_1019.JPG" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipbI30sHl1Wjs-3XqWcnQfMD1O0RB7g19bAUtBwVQhColVZvKTFycheE_moP-WWNJzv2L5HzLPr4QBbvfTc-i250126CRHHE84VJUaXy2j8U1boCN4KuYJYoFFI5fM3Rxq0oZ1e9Sz6Dg/s320/100_1019.JPG" height="320" width="240" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The venerable PDP-11/23+ with venerable Fortran 77 </td></tr>
</tbody></table>
<br />
<b>The Atari 800</b><br />
<br />
Yes, this is the original Atari 800, packed with 1.79 MHz of raw 6502 power, and running the venerable Extended Fig-Forth.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixbFcwoaPXTLyD41Kv98nftvWzGDmjV1pMlxA549qturOrOpvK2xUnfHrGx7FsAEqIsxl7UQXLn1ztfjbRbF4CLrUlHOmeqjkZTPXMxlkJiBpWKqXDJJGJkrKYREKfRR1UsbpUWsAYOmM/s1600/100_1018.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixbFcwoaPXTLyD41Kv98nftvWzGDmjV1pMlxA549qturOrOpvK2xUnfHrGx7FsAEqIsxl7UQXLn1ztfjbRbF4CLrUlHOmeqjkZTPXMxlkJiBpWKqXDJJGJkrKYREKfRR1UsbpUWsAYOmM/s1600/100_1018.JPG" height="320" width="226" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Atari 800 with Commodore monitor</td></tr>
</tbody></table>
<br />
<br />
<b>The Epson PX-8</b><br />
<br />
Last but not least (except in weight), the Epson PX-8 and BASIC in ROM stand ready to meet any challenge. It's sitting next to my Dell E6430, but they don't talk much. Generation gap.<br />
<br />
I guess it's not venerable, but it is cute:<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3odPVxE_gUw_oGGFdTzAUat0cSKEazhgOHg9glM8Ch3oOiB9ePp1YgAW4wPn6JudMOZQILqNHQop1gLHXz2dMwuLG5C_lO97jx7zU2P-xclaiYJKB59H1HCt1CzOifyOjzx3mCKHkFnU/s1600/100_1021.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3odPVxE_gUw_oGGFdTzAUat0cSKEazhgOHg9glM8Ch3oOiB9ePp1YgAW4wPn6JudMOZQILqNHQop1gLHXz2dMwuLG5C_lO97jx7zU2P-xclaiYJKB59H1HCt1CzOifyOjzx3mCKHkFnU/s1600/100_1021.JPG" height="240" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The Epson PX-8 and Dell E6430, brothers from another mother</td></tr>
</tbody></table>
<br />
<br />
All this takes massive, Earth-shaking power to run:<br />
<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifZnTx8Yhix12fVUHIg4T9DQJRsYr5_OzDNhN3f-PYs0u6A8Q2jOF1qOlnN-hKhRrPv_ndzrux4e0bZmku28UCbYCyVkAIpp-sM4uLE4LSjX7kNXlRHh4dLI8WuFZaznt22KdyXOEnmpU/s1600/100_1022.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifZnTx8Yhix12fVUHIg4T9DQJRsYr5_OzDNhN3f-PYs0u6A8Q2jOF1qOlnN-hKhRrPv_ndzrux4e0bZmku28UCbYCyVkAIpp-sM4uLE4LSjX7kNXlRHh4dLI8WuFZaznt22KdyXOEnmpU/s1600/100_1022.JPG" height="240" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">60 Hz and loving it</td></tr>
</tbody></table>
<br />
(Do you think this is a fire hazard?)<br />
<br />
These computers have accoutrements, which I will describe in the next blog post ("Get Set")!<br />
<br />
I am shaking out the muscles, and getting ready for the sprint!<br />
<br />Earlhttp://www.blogger.com/profile/00491259029760076753noreply@blogger.com0tag:blogger.com,1999:blog-4870640620668961176.post-19961237828613202132014-06-13T13:06:00.000-07:002014-06-13T13:09:25.122-07:00Retrochallenge Summer 2014For my Retrochallenge Summer 2014 entry, I want to do a 3 x 3 game marathon.<br />
<br />
3 games:<br />
<ul>
<li>21</li>
<li>Craps</li>
<li>Roulette</li>
</ul>
<br />
3 platforms - choice of:<br />
<ul>
<li>Commodore VIC-20</li>
<li>Commodore 64</li>
<li>Commodore 128 </li>
<li>Apple II</li>
<li>Atari 800</li>
<li>TRS-80 Model 100</li>
<li>Epson PX-8</li>
<li>PDP-11 with VT-100 terminal</li>
</ul>
<br />
Language choices:<br />
<ul>
<li>C</li>
<li>Forth</li>
<li>BASIC</li>
</ul>
<br />
Challenges:<br />
<ul>
<li>Will need a good pseudo random number generator (PRNG) and a good seed</li>
<li>Will have to understand the I/O approaches for each of the three chosen platforms and languages</li>
<li>Will have to decide which subset of rules for each of the games will be implemented</li>
</ul>
<br />
So, super-duper success is all nine games (3 x 3) implemented, including graphics and sound applicable to the platform(s). Just barely crossing the finish line is one game on one platform. No games equals total loss and utter humiliation.<br />
<br />
If you have suggestions on platforms or languages, let me know!<br />
<br />
<br />
<br />Earlhttp://www.blogger.com/profile/00491259029760076753noreply@blogger.com2tag:blogger.com,1999:blog-4870640620668961176.post-20911058945263695132014-05-26T17:55:00.001-07:002014-05-31T13:01:52.801-07:00Show 146 - Building a Modern Day RetrocomputerHi there!<br />
<br />
In Show 146, I discuss building a modern computer styled after systems from days gone by. Here are some links from the episode:<br />
<br />
<ul>
<li>
<a href="http://traffic.libsyn.com/retrobits/RBP-2014-05-25-146.mp3">Direct MP3 episode download</a>
</li>
<li>
<a href="http://time.com/69316/basic/">Time Magazine - Fifty Years of BASIC</a>
</li>
<li>
<a href="http://www.pcworld.com/article/2140220/the-mainframe-turns-50-or-why-the-ibm-system360-launch-was-the-dawn-of-enterprise-it.html">PC World - The mainframe turns 50, or, why the IBM System/360 launch was the dawn of enterprise IT</a>
</li>
<li>
<a href="http://rcrpodcast.com/episodes/2014/4/27/rcr-episode-73.html">RCR Podcast #73 - BASIC and the IBM System/360 are discussed</a>
</li>
<li>
<a href="https://www.youtube.com/watch?v=S84vl5759Ec">YouTube - Homebrew Computer Club Reunion, 2013</a>
</li>
<li>
<a href="http://www.classiccomputing.com/CC/HB_Book.html">The Complete Historically Brewed by David Greelish - available now in eBook!</a>
</li>
<li>
<a href="http://uk.rs-online.com/web/p/single-board-computers/7755003/">The FIGnition inFUZE SBC Kit</a>
</li>
<li>
<a href="https://www.tindie.com/products/Propellerpowered/propellerpowered-pocket-mini-computer/">Propellerpowered Pocket Mini Computer</a>
</li>
<li>
Some links for Parallax Propeller resources: <a href="http://www.parallax.com/">Home Page</a>, <a href="http://forums.parallax.com/">Forums</a>, and <a href="http://obex.parallax.com/">Object Exchange</a>.
</li>
</ul>
This episode is Copyright 2014 by Earl Evans.<br />
<a href="http://creativecommons.org/licenses/by/4.0/" rel="license"><img alt="Creative Commons License" src="http://i.creativecommons.org/l/by/4.0/88x31.png" style="border-width: 0;" /></a><br />
This work is licensed under a <a href="http://creativecommons.org/licenses/by/4.0/" rel="license">Creative Commons Attribution 4.0 International License</a>.
Earlhttp://www.blogger.com/profile/00491259029760076753noreply@blogger.com1tag:blogger.com,1999:blog-4870640620668961176.post-21655026664822369582014-01-31T20:52:00.001-08:002014-01-31T21:56:08.855-08:00Retrochallenge Winter Warmup 2014 Success!A few years ago, inspired by software disk drive emulators for the Epson PX-8 laptop computer, I set out to find a self-contained hardware/software combination that could serve as a portable drive. This would be a functional replacement for the PF-10 portable drive, which is unobtainium these days.<br />
<br />
With the conclusion of this year's Retrochallenge Winter Warmup 2014, I'm quite a bit closer to the goal. The only thing missing is battery power, which I might be able to solve at some point.<br />
<br />
Before going into gory details, here is a video of the drive emulator in action:<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/oicc21AhkrU?feature=player_embedded' frameborder='0'></iframe></div>
<br />
<br />
Now, the rest of the story...<br />
<br />
HARDWARE <br />
<br />
The Epson PX-8 is one of the first notebook computers. It's a gem. For a long time, they were still available (recently) brand-new in box. Alas, the distributor is now out of stock. I used the PX-8 back in the day, and worked on the support team for them at Epson. I did an <a href="http://retrobits.libsyn.com/show-049-the-epson-px-8-laptop-computer">entire podcast episode</a> on this computer, so have a listen if you'd like to learn more. <br />
<br />
The centerpiece of the drive emulator project is the Raspberry Pi - a $35 single board Linux computer. You can do a LOT of stuff with it. If this fine device has not made it onto your radar as yet, have a look at these links:<br />
<br />
<a href="http://en.wikipedia.org/wiki/Raspberrypi">Raspberry Pi on Wikipedia</a><br />
<br />
<a href="http://www.raspberrypi.org/">Raspberry Pi Official Site</a><br />
<br />
Slapped on top of the Raspberry Pi is another key ingredient - the <a href="http://www.piface.org.uk/products/piface_control_and_display/">PiFace Control and Display</a> (PiFaceCAD). It is a combination of things designed to help you control your Raspberry Pi without requiring the standard KVM (keyboard/video/mouse) setup. Here's a picture, with credit to the distributor, <a href="http://www.element14.com/community/welcome">Element14</a>:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3n7QyJtWW_R229NGolRE1hSU43j0wfyH1JWnIpAiXkUzNTY78j9IQDjJXrYFmdz6jb20QU5Sri2b5PKvQvt3mREAkyrBiiHD668r2UOpTGHyDIQYYw3ALTOw0pJp2igVtsVejg9fWZMM/s1600/piface_display.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3n7QyJtWW_R229NGolRE1hSU43j0wfyH1JWnIpAiXkUzNTY78j9IQDjJXrYFmdz6jb20QU5Sri2b5PKvQvt3mREAkyrBiiHD668r2UOpTGHyDIQYYw3ALTOw0pJp2igVtsVejg9fWZMM/s1600/piface_display.PNG" height="293" width="320" /></a></div>
<br />
<br />
It has a backlit 16x2 LCD display, 5 pushbuttons plus a rocker/button combo on the back, an infrared remote control reader (which I did not use), and a socket which attaches to the I/O pins on top of the Raspberry Pi. You can program all the functionality with Python, as well as do some things from C. I used Python, given it has good support for calls to the operating system.<br />
<br />
To round out the hardware, I used a FTDI USB to RS232 converter as the serial port to connect the Raspberry Pi with the Epson PX-8. The final connection to the PX-8 required a custom cable, a mini DIN 8 to DB9. I will provide more info on this in a future post, and you can also find <a href="http://fjkraan.home.xs4all.nl/comp/px4/vfloppy/connectIt.html">info on building such cables</a> at Fred J. Kraan's site for the PX-8.<br />
<br />
SOFTWARE<br />
<br />
There are two key pieces of software, plus some configuration, involved in making this all work.<br />
<br />
First, credit again to Fred J. Kraan for the <a href="http://fjkraan.home.xs4all.nl/comp/px4/vfloppy/">vfloppy software</a>, a disk drive emulator and set of associated disk image management utilities for the Epson PX-8. The software is updated from time to time, and not too long ago, switched to a new disk image format to make it compatible with a PX-8 emulator.<br />
<br />
The vfloppy program is a command-line tool, so I needed to instrument it somehow to work with the PiFace CAD. Python was the natural choice for the "glue" logic to create a UI on the LCD screen, and launch the software with the disk image selected by the user. The "subprocess" module in Python permits the invocation of processes, and then control of those processes throughout their life cycle.<br />
<br />
So, in short, I wrote a Python program to:<br />
<br />
<ul>
<li>Present a UI for the user to select a disk image</li>
<li>Monitor the PiFaceCAD buttons for interaction</li>
<li>Once an image was selected, run the vfloppy program and save the process ID</li>
<li>When user pressed "SELECT", stop the vfloppy program, and permit a new image selection, running vfloppy again once selected</li>
<li>Exit the program if "EXIT" is selected, and stop the vfloppy process</li>
</ul>
CONFIGURATION <br />
<br />
Writing the program wasn't the complete picture, however. The Raspberry Pi needed to run the program on boot-up. To accomplish this, I performed these steps:<br />
<ul>
<li> Created a new user on the Raspberry Pi</li>
<li>Added that user to groups as necessary to permit access to the Pi's I/O (gpio, spi)</li>
<li>Edited the user's startup shell script (~/.bashrc) to run the PF-2014 software on login</li>
<li>Set the Pi to auto-login the new user</li>
</ul>
With these settings in place, the Pi runs the software (which I call "PF-2014" in homage to the PF-10 disk drive for the PX-8) on startup. No hands or feet required.<br />
<br />
I learned so much during this Retrochallenge, most notably about Python. I'll blog in a later post about some of the things I picked up (they're handy!).<br />
<br />
Looking forward to the summer classic!<br />
<br />
<br />Earlhttp://www.blogger.com/profile/00491259029760076753noreply@blogger.com1tag:blogger.com,1999:blog-4870640620668961176.post-77586639621470889582014-01-17T19:53:00.001-08:002014-01-17T19:54:16.701-08:00Chess Match Info!The Commodore 64 versus Apple II chess match will air live tomorrow (Sat 1/17) at 1:00 PM Pacific, 4:00 PM Eastern.<br />
<br />
Watch live at: <a href="http://www.youtube.com/watch?v=wD35BimEOvo">http://www.youtube.com/watch?v=wD35BimEOvo</a><br />
<br />
See you then!<br />
<br />Earlhttp://www.blogger.com/profile/00491259029760076753noreply@blogger.com0tag:blogger.com,1999:blog-4870640620668961176.post-87358282060033646752014-01-10T18:27:00.000-08:002014-01-10T18:27:08.169-08:00A Nice Game of Chess?In just over a week, my <a href="http://www.rcrpodcast.com/">RCR</a> co-host Carrington and I will throw our respective 8-bit computers into a no-holds-barred cage match. Yes - the Apple II, driven by Carrington "Snagglepuss" Vanston, and the Commodore 64, piloted by Earl "Huckleberry" Evans, will soon engage in mortal combat. Two will enter, but only one will emerge.<br />
<br />
How shall they fight, you say? Why, using the Game of Kings, that crucible where only the truest bits are forged.<br />
<br />
Chess.<br />
<br />
It is our plan to live-stream the game to the Internet. Stay tuned for more details on this!<br />
<br />
- Earl<br />
<br />Earlhttp://www.blogger.com/profile/00491259029760076753noreply@blogger.com0tag:blogger.com,1999:blog-4870640620668961176.post-17560971968927249072013-12-29T14:30:00.003-08:002013-12-29T14:35:42.130-08:00Getting ready for Retrochallenge 2014 Winter WarmupHey there,<br />
<br />
I'm beginning to pull together the materials and skillz needed to complete my entry for the Retrochallenge 2014 Winter Warmup.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjy1UjoqXEqZB15bC5SHjgP1Afz53jzybhOISKPxUxZ7gURS7XnPOsR5mzipU8ExcEickME_Ad3OXMAq_HUKytrShcvauvi7Cs_VxEylboSPP7sU8YQ0x8H0TLcMXe-FDL62WvXrnmIktk/s1600/PiFace+Control+and+Display.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="213" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjy1UjoqXEqZB15bC5SHjgP1Afz53jzybhOISKPxUxZ7gURS7XnPOsR5mzipU8ExcEickME_Ad3OXMAq_HUKytrShcvauvi7Cs_VxEylboSPP7sU8YQ0x8H0TLcMXe-FDL62WvXrnmIktk/s320/PiFace+Control+and+Display.jpg" width="320" /></a></div>
<br />
<br />
My entry this time is a rerun. Once again, I seek to create a solution for an Epson PX-8 virtual disk drive, but with a twist. To recap the background and goals:<br />
<br />
<ul>
<li>The <a href="http://en.wikipedia.org/wiki/Epson_PX-8_Geneva">Epson PX-8</a> is a laptop computer produced in the mid-80s. It has CP/M 2.2 in ROM, and an 80 by 8 bitmapped LCD display. It's a cute little laptop. (I used to be on the tech support team, hence my nostalgic love of the device.)</li>
<li>There are many brand-new PX-8 computers in the wild right now, thanks to the sales of NOS from <a href="http://www.notebooksupplies.com/">Star Technology in Aurora, Colorado</a>. Sadly, they are out of stock now, but many PX-8s made it out there, and are looking for a floppy device :-)</li>
<li>The original floppy solution for the PX-8 back in the day was the PF-10 portable disk drive. Even when the PX-8 was new, these drives were rare. I had one because I worked at Epson. But most people didn't. These days, a few people have them, but they are basically unobtainium. Check out some nice images <a href="http://retrocosm.net/2011/07/11/epson-pf-10-partial-success/">on this blog post</a>.</li>
<li>The PX-8 and PF-10 talk to each other over a defined protocol, and using a simple RS232 serial link at 38400 baud. This lends itself to emulation. A couple of software solutions are out there for emulation, including the recently-updated <a href="http://fjkraan.home.xs4all.nl/comp/px4/vfloppy/">vfloppy software</a> by Fred J Kraan.</li>
<li>Originally, I had considered writing software for the <a href="http://www.parallax.com/microcontrollers/propeller">Parallax Propeller</a> to emulate the drive, using published materials and the open-source vfloppy software as a guide. However, when the <a href="http://www.raspberrypi.org/">Raspberry Pi</a> Linux-capable SBC came out, my thoughts changed. It seemed like a good idea to use the vfloppy software as-is, or perhaps with a few modifications, and the Raspberry Pi as the platform.</li>
<li>Turning the RasPi into a standalone appliance seemed like a challenge - you either need a full keyboard/mouse/monitor, or you need to terminal into the Pi somehow. However, add-ons to the rescue. <a href="http://www.piface.org.uk/">PiFace</a> makes an add-on for the Raspberry Pi called the <a href="http://www.piface.org.uk/products/piface_control_and_display/">Control and Display</a> unit. It's awesome! It's a 16x2 backlit LCD with buttons and a rocker control, and it fits right on top of the Raspberry Pi, connecting to the GPIO pin headers. This allows local, finger-press control of the Pi without a full console setup. With this, I believe I can tweak the vfloppy software and make an appliance-style virtual drive for the PX-8. It still won't be battery-powered (yet), but it will be small, self-contained, and functional.</li>
</ul>
That's my plan. This time for sure!<br />
<br />Earlhttp://www.blogger.com/profile/00491259029760076753noreply@blogger.com0tag:blogger.com,1999:blog-4870640620668961176.post-86786138690485803042013-05-22T19:14:00.002-07:002013-05-22T19:14:32.824-07:00Show 144 - Raiders of the Lost ShrinkwrapIn this episode, I take a meandering look at vintage computer collecting.<br />
<br />
Also, I talk about the upcoming release of the first episodes of <a href="http://www.nextwithoutfor.org/">Next Without For</a>, and <a href="http://www.chickenlipsradio.org/">Chicken Lips Radio</a>.<br />
<br />
- Earl<br />
<br />Earlhttp://www.blogger.com/profile/00491259029760076753noreply@blogger.com0tag:blogger.com,1999:blog-4870640620668961176.post-78134020729997322752013-04-07T22:56:00.002-07:002013-04-07T22:56:43.785-07:00Show 143 - An Interview with Bob Armstrong of Spare Time GizmosHi there,<br />
<br />
<a href="http://retrobits.libsyn.com/show-143-an-interview-with-bob-armstrong-of-spare-time-gizmos">Show 143</a>, an interview with Bob Armstrong of Spare Time Gizmos, has been posted on the Retrobits Podcast feed.<br />
<br />
This was a really fun interview - it was neat to hear about the genesis of the SBC 6120 and the Elf 2K kits.<br />
<br />
- Earl<br />
<br />
<br />Earlhttp://www.blogger.com/profile/00491259029760076753noreply@blogger.com0tag:blogger.com,1999:blog-4870640620668961176.post-82148480730112964322013-01-03T13:15:00.001-08:002013-01-03T13:15:29.663-08:00Reversi64 Development UnderwayFor <a href="http://retrochallenge.net/">Retrochallenge 2013 Winter Warmup</a>, I've started in with the Reversi64 development. Here's a rundown:<br />
<br />
Reversi64 is (will be) a networked two-player game of Reversi for the Commodore 64. It uses the <a href="http://www.retroswitch.com/products/flyer/">Flyer Internet modem</a> for communications. Once it's complete, I hope to roll it out for a couple of other Commodore platforms, including the Commodore C128 (in native mode), PET, and VIC-20.<br />
<br />
My goal is to have a working prototype by the end of the month.<br />
<br />
I've set up a website for tracking Reversi64 progress, including a dashboard of issues that I'm wrestling with, and potential solutions. It's at:<br />
<br />
<a href="http://reversi64.weebly.com/">http://reversi64.weebly.com</a><br />
<br />
Some more screenshots and blog entries to come.<br />
<br />
Onward!Earlhttp://www.blogger.com/profile/00491259029760076753noreply@blogger.com1tag:blogger.com,1999:blog-4870640620668961176.post-57094543165780943832012-11-23T15:34:00.000-08:002012-11-23T15:34:31.310-08:00PX-8 virtual disk drive - the New Adventures<b>Back to the drawing board! Let's get 'er done this time!</b><br />
<br />
<a href="http://www.batteriesplus.com/">Batteries Plus</a> made me a new, custom battery pack for my <a href="http://fjkraan.home.xs4all.nl/comp/px8/">Epson PX-8</a> laptop. It was fashioned after the old, tired battery pack. Now my PX-8 is working better than ever.<br />
<br />
With that, it's time to get back to the project idea for a portable PX-8 virtual disk drive. I would like such a device to have the following features:<br />
<ul>
<li>Use SD card media for storage of virtual disk images</li>
<li>Run from batteries (maybe rechargeable, TBD)</li>
<li>Have a decent case for transport (not just a bare PCB)</li>
<li>Have an interface which allows the user to change virtual disk images without the use of an external device (like a computer hooked up to it)</li>
</ul>
<div>
Those of you who have tuned into Retrobits know this has been a <a href="http://retrobits.libsyn.com/show-051-my-px-8-virtual-disk-drive-adventure-">long-term goal</a> for me - I've wanted to make this happen for several years, and have made a couple of fledgling attempts at it. This time I'm determined to see it through to either Epic Success or Abject Failure.</div>
<div>
<br /></div>
<div>
<b>A slice of Pi with your PX-8?</b></div>
<div>
<br /></div>
<div>
Given the time that has lapsed since I first started thinking about this, new opportunities have arisen for a solution. For instance, it seems like the <a href="http://www.raspberrypi.org/">Raspberry Pi</a> may be a suitable, low-cost platform for hosting a virtual drive. It just so happens that the coolest software for emulating a PF-10 (the 3.5" portable drives for the PX-8) is <a href="http://fjkraan.home.xs4all.nl/comp/px4/vfloppy/">vfloppy</a>, and it runs on Linux - as does the Pi. Two challenges might stand in the way, though - the need for a serial port, and battery life.</div>
<div>
<br /></div>
<div>
I've read some reports on the web that the Raspberry Pi might have issues with USB to serial devices, including ones based on the common chipsets from FTDI. I've heard it's possible to wire a serial port to the GPIO pins on the Pi, and <a href="http://codeandlife.com/2012/07/01/raspberry-pi-serial-console-with-max3232cpe/">run this through a line driver/converter</a> like the <a href="http://en.wikipedia.org/wiki/MAX232">MAX3232</a> (newer version of the MAX232) to provide a serial port without using a USB device. Maybe that's the way to go. In any case, the FTDI issues may be solved in the latest kernels - I don't know.</div>
<div>
<br /></div>
<div>
Another question is how long the RasPi would run from batteries. High-end current consumption on the RasPi is around 700 mA from my reading. Running the USB serial device might push that up. Apparently, Duracell AA alkalines have about 2200 mAH of capacity, which would give you just over 3 hours on a set of batteries. That would get pretty expensive. Rechargables would be better. Even better, someone was running their RasPi from a <a href="http://www.newtrent.com/store/iphone-external-battery.html">Newtrent iPhone charger</a>, which has 12000 mAH. That would last a LONG time, but would add weight, and it is over $50 on sale.</div>
<div>
<br /></div>
<div>
<b>More RPMs on the Propeller</b></div>
<div>
<br /></div>
<div>
Another not-quite-new but enhanced option is the original platform I considered, which is something based on the <a href="http://www.parallax.com/propeller/">Parallax Propeller</a> chip. When I started thinking about this years ago, there wasn't a good way to write in C for the Propeller, and extended RAM options were limited. Now, both those problems have gone away. There are two good C compilers for the Propeller - my favorite is the <a href="http://sourceforge.net/projects/catalina-c/">Catalina C compiler</a>. Also, there are many circuits available, some available as off the shelf products, which extend the RAM of the Propeller chip. The one I purchased was the <a href="http://www.rayslogic.com/Propeller/Products/FlashPoint/FlashPoint.htm">Flash Point RamPage</a>, which has both flash and RAM memory on board, and is supported by the Catalina compiler (and costs only $15.99!). This should make it easier to port the code from vfloppy, which is written in C also, and is GPL-licensed.</div>
<div>
<br /></div>
<div>
<b>Virtual Virtuality</b></div>
<div>
<br /></div>
<div>
For testing, and for the time being, I wanted to have a vfloppy setup to play around with. My main laptop runs Windows 8, and vfloppy needs Linux. Running Linux in a virtual machine would be cool, but would the serial port redirection work? Maybe, but I wanted to try something more exotic anyhow - I wanted to test my FTDI-based USB to serial converter. So I installed Ubuntu 12.04 in a virtual machine, hooked the FTDI device to the Windows laptop, and got the right Windows drivers for it. Then, I told VMWare Player to connect the USB device to the Linux virtual machine (which saw it, and loaded the right drivers without issue). I ran vfloppy on the Linux VM, and the PX-8 saw the virtual drives! Voila! That was simple, and all with free software.</div>
<div>
<br /></div>
<div>
By the way, to do any of this, you need the proper cable to connect the PX-8 to a PC (or other device). Information on how to make that cable can be found <a href="http://fjkraan.home.xs4all.nl/comp/px4/vfloppy/connectIt.html">here</a>.</div>
<div>
<br /></div>
<div>
I'm back in the saddle. I've got 3 days off, and I'm not afraid to use them. Out comes the Propeller - and saving my pennies for a RasPi!</div>
<div>
<br /></div>
<div>
- Earl</div>
<div>
<br /></div>
<div>
<br /></div>
Earlhttp://www.blogger.com/profile/00491259029760076753noreply@blogger.com3