Category Archives: My Projects

DrupalZM – West of House

I’m pretty excited about DrupalZM, things are going fairly smoothly. I fixed up a few major bugs with signed number calculations and the z-character -> zscii -> ascii converter. I also implemented more opcodes, as well as the output buffer that takes care of rendering text to the screen properly and in a controlled fashion. The machine now executes until it expects user input! Definitely exciting, as this means that the object table is being correctly manipulated and read (e.g. the west of house object, the cretin (the player), the mailbox, etc). Below is text from DrupalZM – the expected text for the starting room of Zork I!

ZORK I: The Great Underground Empire
Copyright (c) 1981, 1982, 1983 Infocom, Inc. All rights reserved.
ZORK is a registered trademark of Infocom, Inc.
Revision 88 / Serial number 840726

West of House
You are standing in an open field west of a white house, with a boarded front door.
There is a small mailbox here.

>

More soon!

Shredz64 – Board Production Going Well

Just a quick heads up that things are on schedule for having a number of boards available at the upcoming World of Commodore expo in Toronto in December, and then online afterwards. The process definitely gets easier and easier as it goes, I’m pushing out about 5-10 a weekend. Stay tuned!

DrupalZM – A Good Start!

So I had some free time this weekend and decided to work on DrupalZM a bit.

A Little About the Machine

The Z-machine is an interesting virtual machine. Unlike the average system architecture, the Z-machine has no registers in the typical sense, and keeps a separate stack from main memory. It can store local variables on its stack that can be used for the current call, and global variables in memory that can be used across calls. It has opcodes for the typical operations like math, boolean logic, calling, jumping, comparing, etc, but it also has text adventure specific opcodes, like an opcode for looking up game objects and their properties (e.g. is the mailbox open, whats the name of this room, is the light on or off, etc), opcodes for looking up dictionary and lexical data for parsing, and high level opcodes like print to the screen, save, restart, etc.

Additionally, the total size of an opcode and operands can vary in length (since there are no registers, the opcodes allow you to assign results to many different locations from the stack to memory), and sometimes can be followed by high level data like a string of characters. It’s an interesting quasi-mix of typical low level processor functionality and high level operations. It’s actually pretty cool, and a bit of a challenge (I think) to program.

For those who wish to see technical specification in its full glory, you can check it out here.

Progress So Far

So that being said, I’ve set out on the long road. So far, I’ve accomplished the following:

  1. Created a Drupal module that installs the custom content type “z-machine”, that allows z-machine nodes to be added (basically a description of the game and the file it points to). This will allow Drupal site admins to easily add new stories to their website.
  2. Memory, Stack, and PC storage per user per z-machine, which means that a user’s progress will be saved at all times in any game he/she is playing. Saving and Restoring will still be available if desired of course, but there will be no need to save when done playing.
  3. When a user goes to a z-machine page, code will execute that will either read the machine from the appropriate file, or use the user’s memory if its available (i.e. they’ve played before).
  4. All opcode types except extended opcodes are processed and directed, in all forms. So this includes 0OP, 1OP, 2OPs, and VARs, in their Long, Short, and variable forms
  5. Storage and branching is fully supported for all opcodes. Return values will be stored in their correct location (Stack, local variables, global variables), and instructions that require a branch will do so to the correct address, both in their positive and negative forms (if true/if false).
  6. The stack is fully implemented, both in normal pushes and pops, as well as storing call information such as next PC, local variables, and return variable. Upon a return call, the z-machine will correctly clean the stack up and set the PC correctly
  7. About 20 opcodes (which means 40-60 or so with their different forms) have been implemented so far
  8. A full zcharacter <-> zscii <-> asciii conversion system has been implemented with abbreviation table lookup
  9. Basic object and property handling has been implemented
  10. For what’s been done so far, it fully supports versions 1-3 and some support 4-5, and little support for 6-8.
  11. I’ve made quite a bit of progress, but there is still a tonnn to go. But it’s a lot of fun. The machine can execute about 150 instructions before dying from an unknown opcode. But, in those 150 instructions, I’m already seeing text on the webbrowser! Here’s a small excerpt:

    Instruction:178 print: ZORK I: The Great Underground Empire
    Copyright (c) 1981, 1982, 1983 Infocom, Inc.
    Instruction:178 print: All rights reserved.
    Instruction:187 print:

    Instruction:16
    loadbstack push
    Instruction:73
    andstack push
    Instruction:160
    Instruction:178 print: ZORK is a registered trademark of Infocom, Inc.

    Pretty exciting! More to come…

DrupalZM – My New Project

For those eager to purchase a PSX64, don’t worry, I’m still planning on selling a batch at the upcoming World of Commodore Expo and then selling online. The following project is slow moving right now – Shredz64 is still my priority.

The Project Idea
That being said, I’ve been itching for a new project to work on. I have a few Commodore related hardware ideas, but I’m putting them off until most of the PSX64 sales are done with. I wanted another fun software project to work on in the meantime. I’m a huge fan of text adventures, both the Infocom classics (The Zork series, HGTTG, Lurking Horror, etc) and the great interactive fiction that’s still being written by the IF community (if you’re an IF fan and haven’t yet, check out the Interactive Fiction Archive, there are thousands of awesome stories on there to play, many are really amazing).

I’m also a Drupal developer as a part of my day job – we often get into conversations at work about cool vintage technologies we miss, and text adventures are one of the topics that comes up often. During one such conversation, a coworker (Hi Seth!) and I got onto the subject of how it would be great if there was a Drupal Z-machine module that allowed Drupal sites to offer text adventures for users to play online (no need for downloads). And I thought, now THAT would be a fun project. I had always wanted to write a virtual machine/emulator, and being a fan of the text adventure genre, this was perfect.

Now of course there are java, a whole slew of local, and mobile Z-machines out there (and maybe even other PHP implementations), but this is more of a fun academic exercise for myself – a big learning opportunity – the Z-machine has a hefty list of opcodes and nuances. I normally wouldn’t post this early into a project in case I lost interest or my time grew short, but I feel confident about this one, and I really want to let people follow along if they’re interested.

I’m going to post what I learn about the Z-machine from the tech specs on the web as I go, coupled with the work I do to implement that in PHP/Drupal. So far I’ve done some work reading the data file from disk, parsing information from it, and parsing op codes and operands, but I will save these details for the next (series) of posts.

Wish me luck!

Shredz64 – Difficulty Selection and Upcoming Live Demo

Thanks to a few nice, quiet hours I had tonight, I was able to do some Shredz64 development. One thing I quickly noticed at the ECCC convention last month was that Shredz64 is too hard for new players. The timing is different from Guitar Hero, and is pretty demanding on top of that, so unless you’ve been playing for a while, it’s pretty hard. This was where it was nice to see other people using it, as its hard to judge the difficulty of something you’ve been playing for a year.

So to combat this issue, I’ve added the choice to play a track in either “Easy” or “Hard” mode when selecting the song by pressing green or red, respectively.

Shredz64 - Difficulty

Selecting hard plays the track at the same difficulty as before, but selecting easy plays the track much more leniently – the notes are the same, but the note matching gives you an additional 10 pixels above and below what is considered a valid note hit in hard mode. This will hopefully make the game a little more approachable for new players coming from playing Guitar Hero.

Live Demo – TPUG’s World of Commodore Expo

Also – just a quick announcement, I will be demoing Shredz64 and the PSX64 interface, as well as selling a few PSX64s at the upcoming World of Commodore Expo hosted by TPUG in Toronto on December 6th. Even if you’re not interested in Shredz64, I urge you to check out WoC, they have quite a few demos, lots of tables with great Commodore stuff for sale, and knowledgeable and friendly people to talk to. Toronto is always a fun place to visit as well, so make a weekend of it! Hope to see you there!

Shredz64 – Production Started

If you’ve been keeping up with this blog, you’ll know that the prototypes had checked out and we were awaiting the final product. I’m happy to say we received a batch of 20 PCBs from the fab house the other day, and I’ve soldered one up, and it works great. That means that we’re good to go, it’s just a matter of us soldering them up and shipping them out! As soon as the first batch of 20 have been assembled, preregistration will close and normal sales will open. Those who preregistered will be given first priority to the purchase of a PSX64 and Shredz64. More instructions are to follow soon. After the first batch of 20 ship, more batches will come in 50 at a time. Please note, it will take a while to assemble each batch, but we will try to be timely so you won’t have to wait long.

Below is a picture of the finished product as you will receive it. Note – as you can see we changed the design slightly to use rectangular connectors which should add a lot of stress relief/protection to the cables.

When the first 20 are assembled, a final price will be posted as well. Thanks again for your continued patience, we’re definitely rolling along!

PSX64

Shredz64 – PSX64 PCB checks out!

First off, I want to apologize for not updating this blog for a few weeks, I’ve started a new job and things have been hectic getting up to speed on things. But life is starting to calm down, and more importantly, I’ve received the first PSX64 PCB, soldered on the chips, uploaded the firmware, and it works!

There are a few changes to make to the board, mainly due to the pinout of available parts (I have a large stock of voltage regulators that are a different pinout than how the board is configured). I’m also going to use rectangular headers with stress relief connectors for the PSX and DB9 cables so they can take more tugging (as opposed to soldering them directly to the board). However, these changes aren’t major and don’t require another single-board run. The next run will be a batch of 10-30 boards, which will then be available for purchase! I suspect it will be about 4 weeks or so.

Thanks to everyone who has signed up on the notification list, it won’t be too much longer now!

Shredz64 – Firmware Fix 1.0a, Shipping Progress, 3sat Neues

So, for anyone building your own PSX64, you may have noticed if you used firmware 1.0 that it didn’t work with guitar controllers. WHOOPS. The schematic wires the pots opposite to the way the firmware handles them, so the strum pot was handling the whammy bar, and vice versa. Firmware 1.0a fixes this and is available here for download. Sorry about that, too many late nights. ๐Ÿ˜‰

Also, it looks like the prototype PCB board should arrive within the next 5-7 business days, so we’re looking at 2-3 weeks after that until we can start shipping PSX64s, not too much longer now!

Lastly, I had the honor of presenting Shredz64 for Neues, a tech program on the 3sat network (Germany, Austria, Switzerland). For those with 3sat access, keep a lookout for Shredz64!

Shredz64 – PSX64 Firmware Released

Firmware (v 1.0) for the PSX64 is now available here. This version supports improved analog stick functionality, second button support for the Amiga and Sega Master System, and improved macro handling.

Shredz64 – PSX64 Schematics Online

For those wanting to build the PSX64 interface, the schematics are now online. The plans include an ICSP port for uploading firmware to the Atmega 8 MCU. Please note, these plans assume the DIP package version of the Atmega 8 – the pinout is different for the surface mount packages. Firmware will be online within the next day or two.

If you don’t have any kind of Atmel programmer, you can build a really cheap parallel programmer using these plans. It works like a champ for programming the Atmega8.