Jump to content


Posted by atari2600land, 06 December 2018 · 119 views

So I can't do hamburgers. I tried and tried but could not get multicolored sprites to work. It kept giving me the sprite as if it was not multicolored. So I decided to instead put lettuce in the game. I put in a lettuce sprite. And I have it moving back and forth. I don't really know how to define variables yet, so I had to guess. I am guessing this is ok? Because it works. It's right after org $1000.

I also had to reacquaint myself with using assembly. It had been awhile since I last used it. Well, I was using it in Pokemon Mini programming, but not like this. It's different. I also need to figure out how to make the Commodore 64 read joystick movement. I want it so if the player presses fire, the game would start. Then it would switch to a blue screen with cloud sprites moving to simulate speed, and some radish enemies and you shoot peas at them. It'd be all kinds of veggie fun.
Attached Image

Yes, it will work but the C64 unlike the Atari 2600 uses a large part of the zeropage for the OS. If you don't need to access any ROM routines and no need to exit the game back to BASIC, you can use most of the zeropage as you wish.


On the other hand, you have the full 64K of RAM to work with, so if you place your variables in high memory at the expense of longer instructions, you have fewer restrictions. One good idea is to allocate bytes at the end of the program:


movetimer: .byte 0

movetimer2: .byte 0

direction: .byte 0


which then will be automatically resolved by the assembler and you don't need to know the exact memory location.


Regarding the multicoloured sprites, I'm sure I can help you. It is a matter of setting bits here and there, and of course set up the patterns properly. You know that with multicoloured sprites the resolution drops from 24x21 thin to 12x21 fat pixels? Alternatively you'd define several sprites on top of eachother.

  • Report

To design the sprites, I found this nifty program called SpritePad. It works for the most part, except if you see in the picture that one pixel at the top of the lettuce, I can't get rid of it. What bits do I need to set in order to get a multicolored sprite to work?

  • Report

Not sure about the pixel. Sprite data needs to begin at an even boundary of 64, i.e. $xx00, $xx40, $xx80, $xxc0. Check so you have aligned it right.


In order to get multcoloured sprites, you need to set the following:


$D01C : enable multicoloured mode, one bit per sprite so sprite #0 would equal putting 1 here.

$D025 : multicolour #0, which is the same for all sprites (bitmask 01)

$D026 : multicolour #1, which is the same for all sprites (bitmask 11)

$D027 - $D02E : individual foreground colours for sprites 0-7 (bitmask 10)

  • Report

As it turns out, I have to make the sprite info be 2 bits lower. So now even though it should say $2000, this works:

  org $1ffe
    INCBIN "hamburger1.prg"  


  • Report
Yes, that is because the PRG file contains a two byte load address. If SpritePad can generate .bin files that have no load address attached to it, you can include a such file at $2000 instead. I haven't looked into that program so I don't know which options it has, but as it is meant as a dev tool I would suppose it has a such setting.
  • Report