Jump to content





Meeting SID

Posted by atari2600land, in Commodore 64 08 December 2018 · 96 views

No, not Sid Caesar. No, not SID the Spellbinder, the SID, the one responsible for Commodore 64 sounds. It stands for Sound Interface Device. With help from AtariAge member carlsson, I now have sound in my game. It takes some getting used to talking to SID, but once you know what to say to it, it will reply with glorious music (well, as glorious as you can make the music.) I have to make another, longer SID file for in the game. I don't know if I can have more than one, though.
 
I probably can, but I don't know how long I could make it. I don't want to have the load time be horrendous just for the sake of having lovely music. Right now, the one song is about ten seconds long and repeats in a loop. I also want to have sound effects. And, of course, an enemy to shoot. Which I'll get to, probably tomorrow. This time, instead of milkshakes, the hamburger will shoot at different vegetables. Why the change?
 
I can only have one color per sprite. I could have more than one, but then two of the colors would have to be the same as the burger's. Since the burger has lovely leafy lettuce on it, and most other vegetables are green, I decided that. I also moved the word "SCORE" down. I need to put a number after the score. I don't know how to do that. I could probably do it if I used C. I would put "SCORE=%u" and have u be an int. But I don't know how to do that in assembly.
 
I also figured out why the burger's movement wasn't stable at the title screen, and fixed the cloud y position problem. I wanted to have four separate y positions (well, later I'd like to have it pick a number from random, but again, I don't know how). It was a matter of not having an rts added.
 
And I have 4 Commodore 64 games I am waiting for in the mail. Thankfully, that PS device I ordered from that guy came, and it works great. So now I am all ready once the games come.
Attached Image






Yes, you could have multiple songs and I think the Goat Tracker player even supports song selection which means you could use the same player routine with different sets of music data. I would have to check that more closely to determine exactly how to do it. You can also disable the music if you like, just disable the interrupt and restore the pointer to the default one ($0314 = $31, $0315 = $EA). I think you can also limit the music to just two channels, leaving the third for sound effects.

 

If you keep the score as one or two bytes, there are nifty BASIC ROM routines you can set up and call to print numbers. I can provide you with the details. Regarding random numbers, there are a bunch of ways to do it. You can set up the third voice of the SID to white noise without any envelope and read its value as a pseudo random number, or simply read the lowest byte of the CIA timer which would appear random if read seldom enough. You can also make your own PRNG either using the XOR trick or set up an own PRNG with a bit more work. Again over time I can show you some ideas.

  • Report