All right, let’s get started!
The first thing I want to do is setup a repository on github so all my progress will be saved and it is easier to control my changes to the code. Initially I will set the repository as private because I am still experimenting a lot and I don’t think it will be of much use to anybody but me. But once I get to a somewhat playable alpha version I am going to make it available to anybody who is interested.
Now I only need to clone it to somewhere on my harddrive and the setup is complete.
Next I want to get my development environment set up. I am going to use Visual Studio Code for writing my code as I use that as my standard code editor at work and have the most experience with it. Then I need the assembler extension Kick Assembler (C64) for Visual Studio Code to integrate the Kick Assembler functionality into vscode. Of course I also need Kick Assembler itself to actually compile my code and the Java Runtime. Now I have to get VICE to test and the great C64 debugger by Samar Productions.
Configure Kick Assembler
For Kick Assembler to work I need to make some adjustments to the extensions configuration. I need to provide the paths to the Kick Assembler Jar file, the debugger runtime, the emulator runtime, the java runtime, and the default path in which the code gets compiled.
Folders and .gitignore
Now let’s set up the folder structure and setup my .gitignore file (very important). In the gitignore I add all the file types that get created in the build process, as well as the entire /compiled/ folder. This way I don’t have to worry about any of those files getting pushed to my repository and creating unnecessary clutter.
Next I get a constant file containing usefull shorthands for important addresses by cityXen Studios. Believe me something like that really can speed along development.
Down to Business
Finally everything is in place so let’s get coding.
To make sure everything works properly we simply start off with the basics. So “Hello World!” it is.
First off I import the constants file to have access to all its shorthands. Then I implement a init routine that simply clears the screen and sets the border and background color to blue.
Then I write the main routine which takes a string and iterates over its chars to put them out at a specific position in screen ram.
Compiling the Code
Now let’s test it in VICE and it indeed shows the desired output.
And Just for fun I transfer the compiled prg to TheC64 and run it there. It’s completly pointless as basically it also just runs a version of vice, but it simply feels amazing seeing it run on a machine that on the outside looks like an old breadbin :)
Here is the complete code for anyone that is interested:
Leave A Comment