Snake Temple
A downloadable game
For Commodore 64 and DOS
Why?
Seeing a full game for the Oric Atmos in just 10 lines of BASIC, I was inspired to re-implement it for the Commodore 64 and expand on it a little, making use of that machine's features.
My BASIC version was a lot larger at about 190 lines of BASIC code. Heck, even the victory fanfare I used for the win condition takes up 9 lines of BASIC code. It was a lot of fun to do, and It took quite a bit of optimisation to run somewhat acceptably. You can download that BASIC version on here. The performance seems to match that of the original Oric version that I started from, taking about 40 seconds to generate the maze.
However, I decided this was a good candidate for my first-ever 6502 assembly project and I ported the entire thing to assembly, resulting in a whopping 1900 lines of assembly code. The speed-up is tremendous, though, easily being more than a hundred times faster in starting up, and giving a much more enjoyable gameplay experience.
And I didn't stop there. I also ported the game to 8086 assembly (no 80186+ instructions used). That version runs in CGA, EGA (and Tandy, using the EGA assets) and VGA/MCGA. The fact that I have 1344 bytes of uncompressed tile graphics in there (488 bytes per graphics mode) pushes the compiled binary past the 4kB barrier to 4548 bytes. It's pretty much functionally identical to the C64 version, though it adds a joystick calibration screen. Source code for that is also included.
Controls
Commodore 64 version
On the menu, use the CRSR ⇑/⇓ keys or space to move the cursor to another menu option. Use the CRSR ⇐/⇒ keys or RETURN to change the selected option's value. Use the CRSR ⇒ key or RETURN to execute the selected action.
During the game, press HOME to return to the menu.
Available control schemes:
- WASZ : diamond shape W/A/S/Z for up/left/right/down respectively
- WASD : common PC control scheme
- QAOP : Q/A for up/down, O/P for left/right
- CURSOR : use the cursor keys (good on an emulator, not so much on the real C64)
- JSTK 1 : joystick in port #1
- JSTK 2 : joystick in port #2
If you have the choice of either joystick port, prefer port #2.
DOS version
On the menu, use the up and down arrow keys or space to move the cursor to another menu option. Use the left and right arrow keys or Enter to change the selected option's value. Use the right arrow key or Enter to execute the selected action.
During the game, press ESC to return to the menu.
Available control schemes:
- CURSOR : use the arrow keys
- WASD : common PC control scheme
- QAOP : Q/A for up/down, O/P for left/right
- JSTK 1 : primary joystick
- JSTK 2 : secondary joystick
When starting a new game using a joystick, there is a short calibration routine, due to the analogue nature of classic IBM PC joysticks.
Running the game
Commodore 64 version
Mount the disk image of the version you want to run, then issue the following commands:
LOAD"*",8 RUN
This will load the BASIC version directly, or a small loader stub for the 6502 assembly language version. Running this should get you into the game. If you do try the BASIC version, be patient, as it takes about 40 seconds to generate the maze on start-up.
DOS version
Unpack the ZIP file and run SNAKETPL.COM in DOSBox or on real hardware.
Source code
A full repository is available on GitHub.
C64 BASIC version
The BASIC version can, once loaded, simply be LIST-ed.
6502 Assembly version
For the 6502 assembly language version, I used the xa open-source 6502 cross assembler by André Fachat et al.
Rebuilding from source is very simple, but make sure the strings are embedded as PETSCREEN codes instead of PETSCII:
xa -O PETSCREEN snake-temple.s
8086 Assembly version
For the 8086 assembly language version, I used Borland Turbo Assembler 5.0.
A make file is included, so you can build it by simply running
make
when the TASM\BIN directory is in the path.
| Status | Released |
| Rating | Rated 5.0 out of 5 stars (3 total ratings) |
| Author | Steven Don |
| Tags | Commodore 64, maze, Retro |
| Content | No generative AI was used |
Download
Click download now to get access to the following files:
Development log
- DOS portAug 07, 2026
- New featuresAug 02, 2026







Comments
Log in with itch.io to leave a comment.
Great stuff
Thank you!
Nice game, though it seems to have a few bugs. Our German-language review can be found at 02:15:45. English subtitles are also available. Subscription to our YouTube and Twitch channel is welcome. 🙂
That wasn’t a bug. You had the controls set to WASZ, not WASD. The third menu option allows you to select different control schemes, including WASD or a joystick (unfortunately, WASZ is mislabelled as WASX on the screen, due to a typo - which has now been fixed).
Thanks for trying it out!
Good game! I added it to my video along with other C64 games released in July.
Thank you. That’s really cool!
very good
Thank you!
Assembler question, if i may:
Source code line 283 has this instruction:
bit #$80
In the .prg file this is translated as opcode $89, which is illegal opcode NOP imm.
How is that working?
Especially since XA says: "undocumented opcodes are intentionally not supported."
And when i compile your source code, the generated code is partly at different locations. Weird.
P.S. Fun little game! I won! ;-)
Yes, you are right. That instruction is wrong. It was supposed to be simply
bit $80and test the acculumator. Somehow, the assembler didn’t flag this. It still works because it is effectively a NOP as you mentioned, and thelda PLAYER_HP_Hon line 281 already sets the negative flag appropriately. Good catch! That line can be removed. I’ll fix it along with an upcoming feature update.The version of xa that I have is 2.4.0 and it was installed from the standard Ubuntu 24.04 repository. This change looks like it was introduced in 2.4.1 and Ubuntu hasn’t updated yet.
The new version fixes this bug, and adds several features.
Wow :-) Your game is really nice. I've played it a few times (with the basic and the 6502 versions) - now I'm curious to check the source code too.
Congratulations :D
Thank you so much, my friend!
Very nice littl' game! I'm just wondering, why you choose this kinda controls, instead of the very common WASD? Thanks for sharing this with us!
Thank you so much. And thanks for letting me use your video too.
To echo what I said on Reddit, my initial version used the C64 cursor keys, which is actually an awful experience due to having to use shift to go up or left. I intend to add configurable controls (or at least a selectable control scheme) and joystick support in a future update.
You are very welcome :). I absolutly enjoying your game!
The new version has selectable controls, including joystick support!
Very nice!