Wednesday, January 30, 2013

RC 2013 WW Wrap-Up

The month is drawing to a close, and this will probably be my last post before the end of the Retrochallenge 2013 Winter Warmup event.  So, let me give a quick update on the latest developments.  I'll also tell you where to get my Simon clone, in case you want to try it for yourself...

Draggin' The Line

I recognize that a software project which requires hardware that only I have is a bit like masturbation.  Don't worry!  I took pity on you and implemented keyboard support in my Simon clone.  I hacked a keyboard handling routine onto the end of my game loop.  Within that code I map the W, E, S, and D keys to the four colors of the game.  Any key can be used to start the game.

In case you are wondering, that key map was not my first choice.  I'm right-handed, and I originally thought to use the U, I, J, and K keys.  The CoCo uses a typical matrix circuit for it's keyboard, and it turns-out that the U, I, and J keys are all on the same row of the matrix.  That would be fine, but it happens that the CoCo also uses two of the keyboard matrix row inputs for reading the joystick buttons.  Of course, the line for the left joystick button is the same as the line for the U, I, and J keys.  Pressing the joystick button tended to be interpreted as pushing one of the keys on the keyboard!  Not good.

I suppose I could have just switched to the right joystick port, but the left joystick port seems to be the traditional favorite for player one (or a single player).  I also tried to avoid the problem by checking the joystick button immediately before checking the keyboard, and skipping the keyboard check if the joystick button was pressed.  That helped a little, but fate still found a way for the joystick button to interfere with the keyboard.  Fortunately, it wasn't too hard to find another grouping of keys that did not interfere with the joystick.

Enter The Dragon

The Dragon is extremely similar to the CoCo -- so similar that most software written for one will work on the other with few if any changes at all.  One sticking point is that the keyboard matrices are different.  The difference is minor, amounting to a mere shifting of rows of keys.  But, it is certainly enough to scramble the mapping between keys and their functions.

A variety of solutions to this situation are possible.  These include avoiding the keyboard completely, producing slightly different binaries for both the CoCo and the Dragon, or doing some sort of runtime probe to make a guess about which machine is running the software.  The approach I took is to simply enable both sets of keyboard inputs.  The W, E, S, and D keys should work on both the Dragon and the CoCo, while each will have four other keys that will also operate the game.  It will be a little weird if you happen to hit one of the other active keys, but I don't think that will be a big hindrance to enjoying the game.  Oh, and those keys don't interfere with the joystick buttons on the Dragon either!

Ship It!

Software is like art:  it is never finished, just abandoned.  Simon is reasonably well defined, but I'm sure that I could continue to tinker with this implementation indefinitely.  One of the great things about the Retrochallenge events is that they have a deadline.  In honor of that, I am releasing Follow Me, my clone of Simon for the Tandy Color Computer.

The git tree is available now.  In addition, I have made some files available for download:

Follow Me LOADM'able binary: followme.bin
Follow Me CLOADM'able audio file: followme.wav
License information for the above: COPYING
Text file describing the above: README

New Horizons

So, what next?  Well, there is The CoCo Coding Contest, which is already in progress.  I plan to expand upon my work from last summer's Retrochallenge event, using my 44-color CoCo graphics mode to make a sliding puzzle game.  Winners will be announced at this year's Chicago-area CoCoFEST! I hope everyone can make it there this year! :-)

I recently realized that the Tandy 1000 used the same joysticks as the CoCo.  Also, the Tandy 1000 has some interesting sound and video hardware that is a bit different from other PCs from that era.  Maybe it would be fun to implement something to use my rotary controller on a Tandy 1000?  Well, I guess we'll see...

5 comments:

  1. Great stuff John... I always enjoy following your projects. Inspiring!

    ReplyDelete
  2. That's a superb project, idiosyncratic but delivered and usable!

    It's always satisfying to see others have to deal with switch-bounce and other mechanical and electrical disturbances - I have had those kinds of difficulties in the past, glad I was not alone!

    -- Mike

    ReplyDelete
  3. Thanks, guys! Its always nice to have an audience. :-)

    ReplyDelete
  4. I always enjoy reading about your projects. I end up learning something new everytime and enjoy the great write up you do. Looking forward to cocofest! This year.

    ReplyDelete