Robert Wm. Gomez's

Welcome to Pages of Fun!

This is the personal Web site of Robert Wm. Gomez. I am an artist, musician and nerd living in Chicago, Illinois who has been maintaining this site (in one form or another) since 1996. Enjoy your visit!

Apple ][ Graphic Adventure Part II

In my previous post I wrote about the impetus behind this project. To start, I knew that my code was going to be structured around the Haunted House program in the excellent book Write your Own Adventure Programs for your Microcomputer. As I have written before, this book was crucial in my development as a programmer (I haven't developed much beyond it). I would love to do this project in 6502 machine code and I have been trying very hard to learn 6502 assembly programming. But, although I've gotten a better understanding of machine code, there's serious lack of noob-friendly practical learning exercises available out there. Sure I can draw pixels at lightning speed, but, after reading most of Assembly Lines, I still have no idea how to do a simple INPUT command or mimic an array.

So, Applesoft BASIC it is! With emulation and modern computing I have been able to develop my code on a Windows PC and then quickly run it in emulation. My workflow isn't nearly as fancy as some other retro-programmers. I type my Applesoft in a text editor, then in AppleWin I paste the entire code listing into an emulated apple using SHIFT+INSERT. The benefit of using emulation as a development environment is that you can throttle the emulation to run hundreds of times faster (hit ScrLK) than real hardware. This makes testing small changes a breeze.

My first task was to see if I could successfully load a Graphics Magician image into a program. The program itself is a bit of a UI nightmare. Without a manual or reference card, it's nearly impossible to know what keys do what. On top of that, the program requires that you use a joystick to move the drawing cursor on the screen. Fortunately, the manual can be found online and you can use a PC mouse as a joystick within AppleWin. I managed to crank out a couple of silly images for testing and save them to my game disk.

I then used to code provided in the manual to write a simple Applesoft program that displays the image:

5 HIMEM: 32768
20 PRINT CHR$ (4);"BLOAD ROOM1.SPC,A32768"
30 HGR
40 A = 32768:HI = INT (A / 256):LO = A - HI * 256: POKE 0,LO: POKE 1,HI
50 CALL 36096

In order for this code to work, you are required to copy PICDRAWH from the Graphics Magician disk to your disk. This is the machine code rendering engine that is loaded into memory at the top of this program. The MAXFILES1 DOS command apparently frees up some memory by limiting the amount of open files. This command needs to be the first one in your code, before any string assignments, etc. I think HIMEM does something similar with allocating memory locations. I have never written an Applesoft program so large that it required memory management so the purpose of these commands alludes me somewhat. As this project grows, I may have to familiarize myself with them.

You will see CHR$(4) often in Applesoft programs. CHR$() is a function that retrieves the keyboard character in assigned to the numerical value in then parenthesis. For example, PRINT CHR$(65) prints the letter A. In this case, character number four is the equivalent of keying in CTRL+D. That instructs the computer that the next PRINTed string should be executed as a DOS command rather than PRINTed to the screen.

The Graphics Magician file is ROOM1.SPC. BLOAD ROOM1.SPC,A32768 loads the drawing code into memory location 32768. That seems like a crazy random number but it is actually $8000 in hexidecimal. HGR switches to high-resolution graphics mode and then line 40 stores the memory address of the picture into a location PICDRAWH will know to look. Finally, the CALL 36096 triggers the PICDRAWH draw routines.

There's a lot of fancy stuff going on here, but it does the job as advertised. The Graphics Magician manual also goes deeper with more code that shows how to string multiple images into slide shows and how to overlay objects over backgrounds. More on that when I get to my object code. For now, this proof-of-concept was enough to get a simple working prototype up and running.

Apple ][ Graphic Adventure Part I

Having recently played the Apple ][ game Transylvania and its sequel, I was inspired to mess with the art program which those games used. The Graphics Magician was a huge hit for Penguin Software, but I never actually had a chance to use it when we had an Apple ][. I just remember it being advertised in every computer magazine I had.

Based on a True Story by Norm MacDonald (8/10)

He starts off with a typical comedian's memoir and, after about three pages, Norm gives up and go total autofiction. There's a grain of truth in every chapter, but each quickly descends into madness. It's not just cheap jokes (there's much of that, including the famous "Moth Joke"). Eventually, the fourth wall is broken and it becomes a smart, thrilling story.

Friday by Robert A. Heinlein (4/10)

Even as an audio book, this was a chore to get through. It's a tale of a future with super human artificial persons (the titular Friday), violent city states, and coporatized family structures. Oh, and lots of cringey sex talk. I suspect Heinlein was a swinger who wanted moral justifications for whatever dark seeded perversions he held. Unfortunately, he writes like a seventh grader and also has a seventh-grade boy's understanding of women. So dumb.

The Lady Hermit (9/10)

Cheng Pei Pei is great in the excellent swordfighting movie about a master in hiding who takes on a young apprentice with the hope that she'll help defeat her arch enemy. It's beautifully shot and has a nice love triangle sub-plot to appease girly Crouching Tiger fans. The martial arts are not the greatest ever filmed, but it more than makes up for it in gore and crazy miniature effects. Temple of Doom owes much to this movie's rope bridge scene.

Samurai Cop (6/10)

I'm sure I would have enjoyed this more if I had watched it with friends and alcohol. Samurai Cop is a classic "so bad it's good" movie with terrible acting, writing and directing. It's filled with typical z-movie inexplicable moments and several painfully long love scenes. The best part of the movie is Frank the side kick and his goofy expressions.

The Crimson Crown on Apple ][ (8/10)

A Fortress Looms across the Chasm

This sequel to the classic Apple ][ adventure game Transylvania has you returning to the same locations as the first game once again to fight the evil Vampire. The game is twice as big and is a bit more refined. I played the updated 1985 version of the game which runs on the Comprehend game engine which is probably the best implementation of a text/graphics hybrid adventure system. You can use a few prepositions and, in this game, you can command other characters to complete puzzles.

Transylvania on Apple ][ (8/10)

A Menacing Werewolf in Transylvania

Transylvania is a hybrid text/graphical adventure originally for the Apple ][. This was a big hit back in the day and was ported to just about every other 8-bit machine. I loved these types of adventure games but was really, really bad at them. In hindsight, most of them were brutally unfair and prone to the bad game design cliches of the era such as instant death and guess-the-verb puzzles. Still, I remember seeing screenshots of that menacing werewolf in issues of Softalk or A+ magazine and wanting to try this game.

The Black Cat (7/10)

I think this might be the fourth Italian horror movie I've seen that's based on Poe's story, The Black Cat. None of them actually follow the original story except for the inclusion of the titular cat and a scene where someone is bricked up behind a basement wall. This is Lucio Fulci's take and, as such, includes a little bit of corny gore (the burning scene is probably the best) and a lot extreme close-up eye shots. Outside of the beautiful photography and R-rated elements, this seems like a made for T.V. movie.

Crippled Avengers (7/10)

I assumed that they would have hired actual disabled people to star in this and expected it to be a little more tasteless than it was. Alas, the lead "cripples" are all played by actual abled kung-fu masters. They do show a child having his arms off, so there's that. It also features a man being turned into an idiot through head compression. Apparently rudimentary medical science isn't really that big in Hong Kong. The main focus here is acrobatic fighting with hoops, chains and poles. The disabilities don't really play into the fighting styles beyond the initial training montages.