Shredz64 – Added CIA Timer Interrupts

I realized while rocking out at 1AM this morning to a Ghostbusters SID theme, playing along on a plastic Playstation guitar hooked up to a Commodore 64 that I could be considered, by some, to be a nerd. 😉 But I don’t care, it was awesome.

Lots of progress tonight. I started adding a few more SIDs in yesterday, and realized some of them weren’t playing at the correct speed. After investigating more, I realized that these SIDs were setup to use custom controlled CIA timer interrupts as opposed to fixed raster interrupts. While the PSID file does specify whether the song uses rasters or timer interrupts, I wasn’t reading that, I was making every sid use rasters. Well, I ran into a particularly awesome song that I definitely wanted in the game that used Timer interrupts, and it was playing at 1/5th the normal speed. So I wrote timer interrupt code as well as the code to detect what kind of interrupt the SID uses when it loads it in. Now it will play both kinds of SIDs at the correct speed (well, there’s still the PAL SID playing too fast on NTSC and vice versa, more on that someother time).

Anyway, got the timer interrupts working, also implemented code that allows me to slow the song down for when recording notes onto a new SID file. I need to make the editor more robust though, its just too difficult to do any major note editing with right now. But for now it serves its purpose.

Also added a “YOU LOSE”/”YOU WIN” screen. A lose condition is where your crowd meter falls to 0 before the end of the song. A win condition is when you hit the end of the song without your crowd meter hitting 0. Pretty simple, just like Guitar Hero/Rock band. The Lose screen allows you to play the song again or return to the main menu. The win screen WILL allow you to record your name into the scores table, but I haven’t done that yet. I did however insert default names into the code if there is no score file found. Before it was just printing blanks with 0 for a score. I added a few more characters to the menu set to spruce things up as well, though nothing major. I also fixed up a really dumb mistake that was causing a certain portion of memory from getting overwritten.

So, I currently have 6.8K of memory left (on the heap) for the game, which I think in itself will be enough, but I also think I can free up about a K as well. I already have memory reserved for the better graphics on the game play screen, so no worries there, this 6.8K is pretty much for just code, and there honestly isn’t a lot left to code. Save scores, alter shredocity meter (and activate ‘star power’ or whatever it will be called), a few extra lines of code for the better graphics, and then really additions to the editor screen. Past that, we’re good to go I think. More to come…

Leave a Reply

Your email address will not be published.