Snake Temple
A downloadable game
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.
Controls
Move the character around the maze using W/A/S/Z for up/left/right/down respectively.
Running the game
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.
Source code
The BASIC version can, once loaded, simply be LIST-ed.
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
| Published | 18 hours ago |
| Status | Released |
| Rating | Rated 5.0 out of 5 stars (1 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:



Comments
Log in with itch.io to leave a comment.
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 litte game! I won! ;-)
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
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!