theC64 Challenge 3 – The Forever Extending Snake

From Richard's C64 blog!


18th-22nd May 2020

I like theC64 full size. It gives me some great fun and challenges playing C64 games. But what if I wanted to actually MAKE a game on the full size computer? Well, first of all I am used to the cross-assembly/cross-compiling method in making a game. Sometimes on the Ultimate 64 I like to make little things like intros or demos. However, making a new C64 game on theC64 proved to me to be pretty much a challenge. For a start, although I legally own an Action Replay cartridge. theC64 doesn’t support freeze frame yet. So an alternative solution had taken place.

On my PC I generated some blank D64’s using Style’s DIR master. Then I dug out a set of public domain utilities to compile on to an empty tool disk. The programs were as follows:

SPRITE EDITOR V1.2 by Faces
FONT EDITOR V1.3 by Faces
SCREEN EDITOR V2.0 by Small Change Software
STARTEXTER V2.0 by Starion
DEMO MUSIC CREATOR V2.0 (and separately, the music relocator) by Graffity (Although the file and intro mistakenly indicates it as V1.2)
CODE SUCKER MONITOR by Padua
TURBO ASSEMBLER by Omikron
XTC Packer V1.0 by Rockstar
FAST CRUEL V2.5 (From the Cruel Packet) by Galleon/Oneway

During each session, I did save states of some of the development, in order to reduce the risk of losing my recently made files. After each session of creating graphics, music, etc. I save the files and eject the disk, and move on to something else. I had to do some of the same things a few times because for some strange reason, although I saved the files from the program in True Drive mode (which was automatically set by a default CJM file). I ended up with the unreadable *PRG splat files. It could perhaps be something to do with my USB – or perhaps I’m not using the computer right.

Anyway, after completing all of the graphics, design, music, and other stuff. It was time for me to install the Code Suck Monitor. This was because I couldn’t use freezer cartridges as they are not yet implemented in the current firmware. Each file had to be loaded into the planned addresses for the game project. They were as follows:

GAME CHARSET: $0800-$08FF
IN GAME MUSIC: $1000 – $1FFF
SPRITE GRAPHICS: $2000-$2FFF
GAME SCREEN AND COLOUR DATA: $3000-$37FF
TITLE SCREEN AND COLOUR DATA $3800-$3FFF
SCROLL TEXT: $4000-$47FF
GAME CODE: $4800-$5FFF
TITLE MUSIC (RELOCATED): $6000-$6FFF

I chose a relevant load address to set the M/C monitor specially for loading the files to their specific addresses. The Code Suck Monitor was placed at $7000. After a few saves and resets of theC64. I loaded in the M/C monitor and typed in SYS 28672. Then loaded each file manually with the M/C monitor.

L “GAMEFONT*”,8,0800
L “GAMEMUSIC*”,8,1000
L “GAMESPRITES*”,8,2000
L “GAMESCREEN”,8,3000
L “TITLESCREEN”,8,3800
L “SCROLLTEXT”,8,4000
L “TITLEMUSIC”,8,6000

Since I didn’t want to keep loading each file individually. I saved a snapshot of the saved files, then saved a complete package of the game files to work with as a single file:

S “GAMEDATA”,8,0800,6EA0 

I exit the machine code monitor and load in the TURBO ASSEMBLER, used SYS 36864 to run the assembler. Then I worked on the code. First I mainly focused with the game’s code, where routines should control the player’s sprite, and move it around. Also the object and screen randomizer routines, which places specific objects. There was also the sprite/charset collision code. Two sets were made. The first set was, so that the snake is able eat or collide into objects as they appear, for example fruit, skulls and bombs. Fruit to give the player points, skulls and walls to kill the snake off, and bombs to clear the screen and also get points for a screen clear.

After the main body of the game code was done. I worked on the front end code. Then added the GET READY and GAME OVER sequences. I ended up with a full game. Now was the time to try and put the game together.

Putting the game together:
In order for me to put the game together. I had to assemble the finished code (saved first) to disk, and then save the target. Before I could do that, I did a save state for just in case something went horribly wrong. After saving to disk (in Turbo Assembler it is BACK ARROW and 5). To assemble and manually RUN the game without setting the target disk, is BACK ARROW and 3).

I reset the computer. Then I load in the Code Sucker Monitor. SYS28672 again and loaded the saved game data file. Then afterwards I loaded in the code object file, which was assembled to disk. Then I saved the file completely as a single file again using:

S “GAMECOMPILED”,8,0800,6EA0

The game could not be run from BASIC. So I used the XTC Packer V1.0 to charpack compress and make an executable in BASIC. I reset the computer. Loaded the saved file from BASIC and RUN it. The program unpacked and run flawlessly.

Phase 1 was complete. Now for phase 2. Linking the TND intro presentation to the game. I ripped the intro from one of my previous game creations and put it on to the work disk. Then I use the M/C monitor again to load the TND intro and then load the game to $2c00. I then saved the intro from $0800-the end address of the game. Reset the computer, used XTC Packer V1.0. Then crunched the game with the Fast Cruel V2.5.

I then reset the machine. Loaded the game, then typed in RUN. The game loaded, de-compressed and then run. Resulting with the final production:

All there was to do was to prepare the disk with the code, game and other bits together. This was done on the PC using Style’s DIR Master.

The game is currently under the final testing / bug fixing phase, but as soon as it is complete. The game will be released on to both of my pages:

The Forever Extending Hungry Snake

and

The New Dimension


Original URL: https://tnd64.blogspot.com/2020/05/thec64-challenge-3-forever-extending.html