Author Archives: Toni

Shredz64 – Implementing “3D” Graphics

This entry covers the last few days, I’ve been working like crazy on this thing. All graphics related work getting the new “3D” engine in place. I’ve done more algebra and geometry in the last few days than I think I did my entire high school career.

Anyway, added another custom character set (now there is a menu set and a game set) that contains the edges of the fretboard at the correct angle, the button markers (the stationary ones at the bottom of the board), and some double sized numbers for the score. I also wrote a sprite loader to read sprite data of disk. Then I created some button sprites using the sprite editor “Sprite Pad” – it in addition to ConGo and Cuneiform have been absolute lifesavers graphics wise. I made different sized sprites for each stage of progression of the sprite down the fretboard – eg small to large. I then modified the current graphics routines to alter the X coordinate as calculated by the Y coordinate and the slope (the slope being determined by what color button we’re dealing with). Since C64 sprites aren’t large enough width wise to make it to the bottom of the board in the right proportion, I had to use the X-scaling functionality of the VIC-II chip which works great. So once it gets past 12 dots in width (actually 24 pixels, but I’m in multicolored mode so each pixel is doubled in width with the same color, so its 12 2-pixel wide dots), then I switch to 2X width scaling. That covers me up to 48 pixels wide (24 dots). Below is a quick screenshot of work in progress. You can see how the buttons are sized in proportion and positioning to what color they are and how far down the board. Also I have the score-font up with 5 zeros. A lot more to come soon, but I wanted to give a quick sneak peak at how the graphics were lining up.

Shredz64 – Added Button Hints

Fixed all the (known) bugs in the score saving code. Works slick now. Also added button hints to each screen (e.g. green = continue) with some more custom characters created in the menu character set. Also rewrote joystick scanning code for the menus into two blocking (one for active block and one for inactive) functions that poll and save the results. This freed up about 1K, which I promptly used in other sections. About 4K left in memory, it’s a balancing act from here out, but I think I can make it.

Next up – improving the graphics a bit on the main game screen.

Shredz64 – Added Score Saving

Implemented figuring out if you made it into the high scores or not, allowing you to enter name by pressing up/down to select letter, green to advance, red to erase, yellow to save. Saves to memory, then to disk. Still has some bugs though, to be squashed in the next couple days.

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…

Shredz64 – Loading Screen

I’m tired so excuse this entry if its choppy. Finished up the final loading screen (well, final for now, I like it and I’m done spending time on it right now). Here it is:

The very first thing Shredz64 does after reconfiguring RAM and copying the kernel is loading this screen. While this screen is being shown, the floppy is scanned for all sid files, the filenames are cached, each file is scanned for its title and author and scores, which are all cached. The screen is then blanked out, and custom character sets are loaded in. Allowing this is the character set loader I wrote – quick and easy. I found some nice character sets on the web and loaded in one that looks a bit better than the default C64 charrom. Then I found this great windows program called Cuniform by Kevin Schuetz. I booted it up in Wine, its basically a C64 character set editor, but its got lots of features, and most importantly imports BMP files, which is great. I did a quick “MAIN MENU” kind of thing in GIMP in a nice looking font, popped it into Cuniform, pasted it onto the edge of the character set I’m using for the menu system, and voila, great looking fonts at no cost.

Speaking of graphics, I’m loading the multicolored hires bitmap into Bank 0 in the same area that I later load SID files into. The first 16K of memory now is pretty much reserved for SIDs and graphics. However, I don’t think I’ll be using bitmaps for the main game screen, as one I would be sacrificing a lot of SID space which could keep a lot of cool songs from being played. Also, they’re just too slow to work with. But I will be implementing a more 3d-ish board using a custom character set – while the menu charset resides at the 12K mark, I still have 2K left before the end of Bank 0 at the 14K mark, where I can put a gameplay character set. All will be good.

Anyway – reiterating whats left to do – I’m done playing around with graphics until the end, I got my fix for now. Next is the Win/Fail screens and score entering/saving functionality.

Shredz64 – Bitmap Loader

This entry covers the last couple of days, I’ve been working pretty late each night on Shredz64 and was too lazy to make an entry. A few things – I cleaned up a bunch of code, moved things where they logically should go in the source. I also wanted to take a break from more tedious stuff, so I wrote a bitmap loader in case I need it anywhere (title/menu screens, etc), and here are some quick mockups I made for title screens. None are finished products (plus I’m using artwork for the rock-on one and I’m not sure who the artist is), but it demonstrates that the bitmap loader works and I can create pretty detailed bitmaps (relatively speaking). Here are two screenshots:

I also wrote the code to read score files off the disk for each song and display scores when a user is picking a song. It also caches all song info now (filenames, titles, artists, and scores) so it doesn’t have to read it off disk every time you go to the song selection screen. I still need to write the code to save scores, I just manually created the score files with a hex editor for now. Anyway, lots of good progress.

Shredz64 – Reading SID Info

Added in functionality to read in artist and track name from the SID file and display it on the song selection screen. Also added in functionality to read length of song and display that as well. Next will be saving and displaying scores for each song. The program started randomly crashing tonight for the first time, so I think I may be running out of memory (which isn’t surprising, I’ve been a bit liberal with allocating space for song information). I’ll have to pare it down and see how it goes.

Shredz64 – Scanning Disk for SIDs

Tonight I found a cc65 implementation (e.g. uses cbm.h) of the POSIX routines for reading in the directory structure on a C64 disk (need to investigate who wrote it originally to give credit, its just a quick segment of code). Hacked it a bit to fit what I was doing – now from the main menu, you can choose to play or edit a song. Once choosing either, it will present you with a song selection screen – it automatically scans the disk for any files ending in “.sid” and displays them as selections. If you edit them, it will save an according “.not” file with the same filename base. If you play it it will load the correct “.not” file. Now if people want to add their own sids, all they have to do is drop it onto the disk with a .sid ending! (And make sure the SID is one that executes in the first 10K of memory, which most do). This makes the program a lot easier to test (and more fun!).

Shredz64 – Mini Note Editor Done

The majority of the note recorder is done, properly records and writes to file, worked out some bugs from before. Changed ending the song from an empty strum to pressing the whammy bar, just in case an empty strum is accidentally hit. Also created a main menu that uses the guitar to select options. Added a credits screen. Next up is detecting all songs on disk, displaying them for selection with title and artist, showing scores, and saving scores after playing. I’m pushing development up a notch, I’d like to get this done soon.

Shredz64 – Mini Note Editor

Just a quick update – holiday season took over my life! Things have settled down now – got some code done on the note editor – looking good so far. Plays song and allows user to press buttons and strum, recording what buttons are pressed at what time when strumming. These values are saved in a buffer, and then written to a standard note file when the strum bar is pressed without any buttons.