Friday, March 29, 2013

BASIC-ly Done

Only another month until CoCoFEST!  It sounds like this will be an extra good one...see you there?  It will be a great chance for you to play Sluzzle... :-)

Lock 'N Load

When last we left Sluzzle, we were sorely in need of a loader to coordinate loading both the game binary itself and the pictures that are the object of the game.  All of that could be added to the Sluzzle binary itself, but the built-in Disk Extended Color BASIC was just itching to help out!

Just like a shell script wrapper around a finicky Unix binary, DECB provides a number of facilities that make it attractive for writing a loader program.  While the built-in options for flow control, text processing, and (especially) disk access are not necessarily great performers, they are relatively easy to use.  Plus, using them avoids dedicating time to developing such code.

The DECB loader for Sluzzle performs reasonably well and was easy to implement.  The BASIC console and disk I/O routines were much easier to use and adapt than writing the assembly language equivalents would have been to do.  Dealing with line numbers still sucks, but some minimal planning and allocation of line number ranges to specific parts of the program makes things manageable.  The Toolshed utilities also helped by letting me edit the BASIC sources on a modern PC rather than on the CoCo's keyboard.

Take Control

I added a new feature to Sluzzle -- a help screen!  That might be helpful for  people new to Sluzzle that aren't sure what controls to use.  The help screen is implemented by switching the video mode and the screen address back to the text screen used by BASIC, which will show whatever was left on the screen just before starting Sluzzle.  The loader was extended to write the control guide data before executing the Sluzzle binary.  Typing '?' while Sluzzle is active will reveal the help screen -- too bad I didn't include that in the video... :-(

PLAY Along

One final touch that is barely discernible in the video is the addition of a few music queues.  Starting, winning, and losing the game are all punctuated with some appropriate musical notes.  These are implemented using the PLAY command, which Color BASIC has in common with GW-BASIC (also from Microsoft).  The PLAY command processes a type of music macro language that is also similar to the Ring Tone Text Transfer Language once used on Nokia phones.  This is another way in which using the built-in BASIC is a lot more efficient with programmer time than writing that feature from scratch would be.

With Sluzzle complete, I have released a git tree with the Sluzzle source.  I have also released some downloadable binaries for those that aren't interested in DIY.  I hope you enjoy it as much as I do.

I don't know what will come next here.  I may want to branch out to some other machines that use the 6847?  Or maybe there will be some new ways to exploit the VDG on the CoCo?  It is hard to tell...but as always, stay tuned!


  1. Oh, I forgot to mention a few things...

    I dropped PAL support for now, as the code structure for the viewer was just irregular enough to make the block moving code more complicated than I wanted to handle. It probably won't be hard to add that back, but it isn't there now.

    The only emulator that I know can handle the 44-color video mode is Xroar. Even that one gets a video glitch every few seconds, but it is somewhat tolerable. I have not seen any version of MESS come close to handling the video timings properly. I have no idea if VCC handles it or not -- I wouldn't hold my breath.

    Speaking of Xroar, the version I am using seems to have a problem with the 1-bit sound source no longer working after the DAC sound source has been used by the PLAY command in the loader. I don't know what the issue is or if it might be corrected in the current development version -- just FYI...

  2. I released some new binaries, at the same location as above. The old binaries are still available in the 2013-03-29 sub-directory.

    The new code has a couple of minor bugfixes, along with some changes to work better with multi-drive setups. In particular, Sluzzle will probe DECB to find the last drive accessed, which it uses to load its M/L binary. Sluzzle also probes for the DECB default DRIVE, and uses that for doing the initial picture directory scan. This will be helpful for anyone that wants to make their own picture disks without having to copy the Sluzzle binaries around -- which means that I may be the only one that ever uses these features... :-)

    One final thing is that I changed the timing of the keyboard scan. Now when you hold down a key the SG24 video mode will be active. The colors on that video page are closer to the "original" image colors than the ones on the CG6 video page, so the image change should be a bit less painful to look at...or so I hope!

  3. Amazing work :) I can't wait to play it. You got me inspired to setup my CoCo 1/2 rig again. Two amazing new games you created for it.

    Just one question... when you wrote the disk routine code for DECB did you add any copy protection routines for old time sake???

    1. Ha! That would be kinda funny... :-)

      But, no -- Sluzzle is free software released under the ISC license. For that matter, Follow Me is as well. You are free to download it, copy it, modify it, and distribute the modified copied and/or the modifications themselves. The only requirement is to retain the copyright notice in the COPYING file.

      Also for what it is worth, I didn't add anything to DECB. I just used the routines that were already there. That is the beauty of writing the loader in BASIC! :-)