Dirty Tricks 6502 Programmers Use

I’ve been reading for last week 6502 Software Development by Scanlon. I’ve been sick and its been keeping me company. It is weird reading a technical programming book which is “by the book” and then read some of the code I’ve been using/borrowing/suggesting recently. My code has been riddled with so many intentional bugs/glitches to get amazing side effects. I really wonder what Scanlon would have said after reading what went on below… it is a great read for people into 6502 asm.


Trogue64: Drain of Doom (Beta)

Yes… It is in a state for review –so download it here: Trogue.

You’ll need VICE or compatible emulator. It runs best in NTSC, but I spent a lot of time getting it stable under various PAL systems.

Sometime in the ’80s, a zombie outbreak plagued the local town. A daring group of heroes lured the undead to an abandoned mine. On the 64th level, they blocked the trogue (drain) and flooded the mine.

Recently, a depth alarm has gone off — the mine is draining. Someone has popped the Trogue!

Start from the lowest part of the mine, activate 9 pumps to flood the ravenous undead before they can escape. Each pump raises the water level, so move fast — or join the ranks of the undead!

Trogue64 Intro

All the levels are randomly generated, with a basic AI for the monsters and turn-based movement/combat. You level your character up through combat, which in turn boosts your maximum hitpoints. There is a timer though, water rushing in as the player activates the pumps on various levels. Too many pumps at once and risk drowning, not enough (say 9) by the end and you can’t escape.

There is a crowbar for extra damage, a medkit to heal, oxygen tanks for those water moments and a holy hand grenade when the denizens of the mine overwhelm you. Sometimes there is a clue that a pump exists on a level or just an old plan for that area is just lying on the floor (it might be a little outdated).

Watch the border water meter, it shows the current water level and the mine level.

Quick Introduction and play intro of Trogue64

Trogue64 Programming Notes: Part 1 GFX

Before we begin…

There were a lot of things that I learned in the process of making this game. I can’t imagine making something like this back in the day. I’ve always had a lot of respect for the games and software developed for the machine on the machine. Without emulation, this would have been a real mess.


I’ve never made MultiColor GFX (serious ones) and it was always this mystery to get a koala painter image going with a scroller. I always wanted to make an ESI Intro (that eagle one). Draw a cool picture, make a custom font scroller and bang out a simple tune. I could do everything but the picture.. there was always something getting in the way.

Cross Development is really hard in the MC Picture side of things. I’m used to Photoshop or Deluxe Paint for source material.. but getting it looking ok on the commie was a royal pain. At the end after piles of crashing plugins and ageing software, I found something that works great:

Watch Dan do the magic…

Photoshop using the Dan Fessler method -> GangEd ( https://csdb.dk/release/?id=19831 ) -> PRG for Import or Viewing on Real C64 -> MMC64 Cart

Photoshop could be replaced by any other bitmap software, but it is what I am comfortable with. GangEd is great for the conversion and troublesome as an editor. I would love to help clean up that application.

I’m colour blind ( Protanopia ), so having some colour conversion or colour by numbers is really helpful. So the tool/dev chain above really helps.. if I had to come up with gradients by eye… well that is not going to happen. Also having the commodore palette files for photoshop is really helpful.

A great resource for gradients is Daniel Krajzewicz’s notes on his blog.

I can do sprites and fonts ala code, which in the day I also had a nice editor from Compute! Gazette — but SpritePad and CharPad are awesome tools. It’s also handy to load snapshots from VICE and see charsets that have been modified by code or have as a reference for where things are.

One of my “like to have” addons for Trogue64 is fade/pattern wipe for the intro graphic. It’s not hard but I had to draw the line somewhere to get this to Beta.

TROGUE64 – RGCD C64 16kb Cartridge Game Dev Compo 2019

I have been meaning to get involved with one of these compo’s for a while now — so here we go!

This is a rogue-like based game, where the player starts at the bottom of mine (which was flooded) to trap all the zombies in the local town. For some reason, the player was checking the containment and triggered the drain of the mine. Getting sucked to the bottom, they must make it back to the top before the denizens of the mine or the water flooding back into the mine drowns them…

Trogue is actually a word, it means the drains in a mine. Lucky 🙂

Cat Weasel v4 Running in an XP VM

I’ve managed connect my PCI Catweasel card to pass-though on my ESXi server. I took a bit of work and it’s not perfect (ie no Joysticks or Mice work) but the disk subsystem works great. I added to my server a Multi-Function 3 1/2 drive with USB reader, which I thought was a stretch to get working — but in the end, it was fine. I also added a TEAC 5 1/4 drive which reads and writes perfectly. The Disk Imaging tools work reasonably well but get stuck sometimes.

I tested some Amiga, Apple and C64 floppies and was surprised how fast they imaged or transferred down.

Stability was an issue initially, but after making some adjustments to processor and memory layout of the VM, XP and the Catweasel card are working great. The other subsystems on the card are not used, but what I really wanted was a multi-format disk reader and writer.

Click on the thumbnail to see the desktop in action.

AL-1000: Saved from Oblivion.

The Commodore AL-1000, which is akin to a mini-PET (heavy and boxy). It uses tubes to display the numbers. There was some roughhousing with this venerable calculator and it needed some TLC to get going. The calculator was abandoned a long while back and found after someone was cleaning out some buildings nearby. A tip from a friend helped save this new addition.

C64: First 8K Generic Cart

As of today, I made my first C64 cartridge. Most of my programming experience is either through floppy or tape-based storage. Making a ROM/BIN file and getting it to work was tougher than I thought. It was more problems with getting a CRT/BIN combo into the toolchain for testing in an emulator than to actually make a cart and burn an EEPROM. My first cart is nothing amazing, but it pumps out the INC $d021’s.

C64 NIC: Networking on the Commodore 64

I have a few of these guys in a box, mostly for a long term project that I have been working on. I haven’t had much need for them in the last while as VICE has great networking support.

Lately, it has been crazy fun doing TCP/IP communications with the IP65 networking stack. It’s definitely the way to go for making games that need updates from time to time. Write a bootloader that fits in ROM, place it in the socket and off you go. Yes, there are issues with a ROM update later on and that you need to have internet access to enjoy the software. Oh well, it is a connected world.

One of these guys needs to get crossed with a 16 MB REU. It would be a pretty awesome combo. But for now; this thing is still great.