Maya Grab [Day 4] – Tools & Floppies

Last couple of weeks I’m totally into writing tools in PHP; already made a few for my Laser Squad remake. Remember how I said that I will try to include as much code snippets as possible in the journal and therefore I’ve made some extra CSS? Well I’ve made a tool were you can paste your C64 BASIC code into and it returns a styled HTML with all the code syntax highlighted. It’s about 90% accurate, what’s missing is detecting variable assignments, but that can be easily resolved manually or with other CSS tricks. I didn’t want to invest more than one hour into this. The final listing will be also published styled as a HTML page for easy reading; still not sure though if I’m going to publish also all the steps while I’m making the game.

Having this done there is only one thing to do before I can write my first lines of code – setting up the floppy disk where I’m going to save my game. It’s very easy to create a empty formatted disk from the emulator, but I wanted to format it again from the C64. Just for info, one side of a C64 disk has a total of 170kb, but a little bit more then 5kb is reserved for the file allocation information (so called BAM – block availability map) and for keeping pointers to the next physical track. Meaning we have 664 blocks free for user data, and each block is 254 bytes long (a total of 168,656 bytes which is almost 165kb).

Here are some basic commands I’m using for operating the disk drive:

OPEN 1,8,15,“N:MAYA-GRAB 2016,01”: CLOSE 1
        format disk in drive 8 with name MAYA-GRAB 2016 and ID 01
LOAD “$”,8
        load the file directory from the disk in drive 8
LIST
        list the previously loaded file directory
LOAD “*”,8
        load the first file on disk from the disk in drive 8 at $0801
LOAD “MAYA-GRAB”,8
        load the file with given name from the disk in drive 8 at $0801
SAVE “MAYA-GRAB”,8
        save the file with given name to the disk in drive 8 at $0801

* * * * *