Friday, 22 May 2020

theC64 Challenge 3 - The Forever Extending Snake

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. For many years, I written games using C64Studio, or ACME cross assembler. Sometimes on the Ultimate 64 I like to make little things like intros or demos. Some of my entries for the Intro Creation Compo 2019 were made on the Ultimate 64.

However, making a new C64 game on theC64 proved to me to be pretty much challenging. 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. I had fun writing Storm Chase during the winter of 2020 on the full size theC64. I fancied a challenge in making something slightly more advanced and different. I was going to do another of those typical pew, pew space shoot 'em ups, but at the end of the day. I decided to do something I had not attempted to do before. A Snake game, but with a twist.

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

All of the tools above can be found at CSDB. 



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. I'm not sure, but I'm still on to the challenge.



Update: 23/05/2020: I can confirm there is a bug in true drive mode (accurate disk). It does write 0 "unreadable " *PRG on my computer. However if I disable that feature, it saves successfully. Good thing is, the programs I used had no software fast loader. So accurate disk wasn't really needed for this project.


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

Here's a video of the game in action:





1 comment:

Richard_of_TND said...

Additional note:

The game did get finished and released in 2020.

The latest firmware V1.5.2 was released in January 2021. Which means that the freezer cartridge support is fully functional and working.

An alternative solution to the true drive save bug has been found this year (2021). It looks as if to avoid the 0 block splat file. (0 NAMEOFFILE *PRG), you should "load" the file in after "saving" it to "verify" the filename to the digital D64. A strange issue, but it worked.

2023 at a glance

2024 is here, and 2023 has been a really quiet year on the production front due to everything that had gone back to normality. The year has ...