How to write a C64 game in several steps
  • Welcome!
    Today I'll start with a sort of tutorial on how to write a C64 game. I have prepared 19 steps for now, planned are a few more. Given the previous speed that should work out nicely. The plan is to release the next step every saturday.

    I'll start out very small but there will be bigger steps later on. The code is supposed to be heavily commented but is probably not clear for everyone. I'll be happy to answer questions regarding the code.

    The actual state of the game on 19.02.2011 at step 19 is this:

    image
    Attachments
    2011-02-19 - WIP - Step 19.png 3K
  • Step #1

    Step #1 is a simple base for a game. It provides a Basic start (10 SYS 2064), sets up the VIC relocation and shows a simple synchronized game loop.

    To show the loop running the border color is flashed and the top left char is rotating throughout all characters.

    The not too eye-popping result looks like this:
    image

    Find attached the source and .prg file for your favourite emulator.
    Attachments
    step1.png 1K
    step1.zip 2K
  • Woohoo! Nice one.
  • Cool. I must admit that I'm a Speccy person and always get a lot of amusement from making fun of the C64, but I'd still love to make a C64 game in assembler - if nothing else then to show people how it can be done. :-D
    ...I'll probably never get to it, but I'll still follow this tutorial anyway. ;-)
  • Neat :)
  • sweeeeeeeeeeeeeeeeeeet
  • Very cool. I'll be watching this thread =D>
  • Hope the game gets somewhat fun. I'm basically designing as I go along.
    I just saw, editing is only allowed up to 24 hours. So I'll try to keep it in this thread.
  • I am pretty good at reverse engineering 6502/C64 disassemblies but I've never written anything. I am very excited about following this thread.

    I notice the source in this thread so far uses labels for some standard C64 memory locations but not others. I attached a file containing all of the address labels that are presented in the book "Mapping the C64". It might be overkill in some regards, feel free to edit as you like. The book strangely does not have labels for what I'd think are pretty important and commonly used addresses like the interrupt vectors @ $FFFA-$FFFF; so, in that regard, this list may be incomplete.

    Throw the c64_label.asm file in your ACME_Lib/Own/ directory and add this comment to the top of your source file:

    !source <Own/c64_label.asm>

    In this way, your code will be much more readable and standardized (as "Mapping the C64" is a quintessential book and is easily found online for download).

    Perhaps a better list of labels could be made to match those used in the VICE emulator's machine code monitor. I have not looked into finding where those are located yet.
    Attachments
    c64_labels_asm.zip 3K
  • Intriguing! And VERY interesting... Back then, I never understood how link a BASIC linecode to my internal assembly. Had the assembly all in "DATA" lines, haha... Pfff... I was only 10 years old, though, so I can forgive myself.

    Following this thread with INTEREST. Thanks!
  • Ah, interesting. Thanks for the label list. I tried to map some of the later kernal calls but I'll see to put the interesting ones in the existing steps. The kernal jump pointers seem to be missing (GETIN at $ffe4, etc.)

    Currently I'm at step 25. The game is feeling like getting fun with a bit more design on the enemy behaviour. They're still moving back/forth quite dumb right now.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Twitter

In this Discussion