Friday, November 23, 2012

PX-8 virtual disk drive - the New Adventures

Back to the drawing board!  Let's get 'er done this time!

Batteries Plus made me a new, custom battery pack for my Epson PX-8 laptop.  It was fashioned after the old, tired battery pack.  Now my PX-8 is working better than ever.

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:
  • Use SD card media for storage of virtual disk images
  • Run from batteries (maybe rechargeable, TBD)
  • Have a decent case for transport (not just a bare PCB)
  • 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)
Those of you who have tuned into Retrobits know this has been a long-term goal 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.

A slice of Pi with your PX-8?

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 Raspberry Pi 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 vfloppy, 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.

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 run this through a line driver/converter like the MAX3232 (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.

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 Newtrent iPhone charger, which has 12000 mAH.  That would last a LONG time, but would add weight, and it is over $50 on sale.

More RPMs on the Propeller

Another not-quite-new but enhanced option is the original platform I considered, which is something based on the Parallax Propeller 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 Catalina C compiler.  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 Flash Point RamPage, 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.

Virtual Virtuality

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.

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 here.

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!

- Earl

Sunday, July 15, 2012

Back in the saddle

Wow, finally a breather so I can get back to programming?  Excellent!

Here's a screenshot of the NetReversi game so far.  It doesn't do anything yet (other than move the cursor), but some of the logic is built-in ready to be used:

Here's a little snippet of the code.  I'm currently using the Notepad++ editor:

Today I'm working on what might be the most difficult piece of this game - determining if a move is legal.

In Reversi, you play on a 8x8 board, with game discs that are black on one side, white on the other.  Like checkers, you and your opponent both have a color (white or black).  When you take one of your opponent's pieces, you turn it to your color by flipping it.

The way to take one of your opponent's pieces is by surrounding them on the board, either horizontally, vertically, or diagonally.  If you have one of your pieces on one side of your opponent's piece(s), and you place one of your pieces on an empty square adjacent to and on the other side of those opponent's pieces, you turn all the opponent's pieces in between to your color.  For a better explanation of the rules, you can consult Wikipedia's page on Reversi.

The thing is, since a capture can happen from any angle (horiz, vert, or diag), and since you have to circumscribe your opponent's pieces, it's actually a deceptively difficult algorithm to determine if a move is legal.  The best bet is probably to use a recursive function.

More to come, hopefully later today...

Sunday, July 1, 2012

Retrochallenge: Sharpening the Saw

After a week or two off, I'm getting back into the swing of things on my networked Reversi game for the Commodore 64.

The rules of Reversi are deceptively difficult to program.  I've been faced with creating a recursive algorithm to check whether a move is legal, and then flip the corresponding pieces accordingly.

In terms of development, I've decided on these tools at the moment:

  • CC65 C compiler for 6502-based systems (notably the C64)
  • Notepad++ for my code editor (probably will replace this part)
  • CC65 makefile for building/testing
  • VICE emulator for local testing (can't test network functions with this)
  • Real Commodore 128 and Flyer drive/network device for testing (have to move code to the device for testing)

My Retrochallenge goal is to have a working prototype of this game - a 0.1 version, if you will - by the end of July.  I'd better get coding!

Wednesday, March 14, 2012

April re-launch of The Retrobits Podcast

Hi everyone!

It's been a long one-year hiatus - much longer than I planned. But in April, The Retrobits Podcast will re-launch with new episodes.

Things have been busy here, including co-hosting the Retro Computing Roundtable with David Greelish and Carrington Vanston. That's a fun show, by the way - if you haven't checked it out, definitely take a look on iTunes.

It will be fun to be behind the mic once again for Retrobits. Hope you're all doing well out there!

- Earl