Shredz64 – Reading Note Data

Lots of very promising progress tonight (and a few nights ago). First off, I implemented code that will read both note data for fret buttons and music data from SID files off of floppy disk. I also wrote some quick utilities on my Linux box to generate note files for testing. So all the static values are out of the program and its reading off files now. More importantly though, I implemented a good portion of the SID -> Shredz64 converter tonight – this sounds much fancier than it actually is. The issue is normal SID files are big blocks of 6502 machine code that have been ripped (or created), but they contain code for manipulating the processor, memory, etc as opposed to just being music data. Not only does this waste CPU time, but its also difficult to switch back and forth between executing Shredz64 code and executing SID code. My solution for now was to hack the libsidplay library on my Linux box, and intercept any memory writes to the virtual SID chip (0xD4XX) and dump the address and the value to a binary file, along with the relative time the memory write was made. E.g. I play a SID file on my computer, and in addition to playing it it dumps all the SID chip data to a file. Shredz64 then uses that file as its music data. Actually, I didn’t implement the timing tonight, but I did manually set the timing inside the game just to test it out, and it played the music pretty accurately! Very promising for first try. I do need to compress the files somehow, at least look for repeating sequences, since they get pretty big. Hopefully filesize won’t end up being an impossible issue. But hearing music out of the game for the first time tonight sure was awesome!

Leave a Reply

Your email address will not be published.