NESSIDPlay

A cool-looking program!
Questions & Answers. Downloads Usage History

WHAT is it?!??!

It is a program for the Commodore-64 line of computers that plays music from Nintendo Entertainment System, Gameboy and Sega Master System games.

HOW does it do that??!?

By playing files in Marat Fayzullin's PSG .SND format. His emulators like iNES, VGB, and MasterGear allowed you to save the soundtracks of games into little files, and then play them back later.

WHY are you doing this??!??

I know, I know, the C-64 already has some great music on it, and it is way more advanced than the NES' music. But I still have some great memories from playing NES games, as it was my first, most favourite, and longest lasting system. Besides, some NES games had absolutely fabulous music, like Journey to Silius, Mega Man 1-6, Castlevania I-III, Solstice, Kiwi Kraze, Metroid, Zelda... And who doesn't know the theme song to Super Mario Bros., eh?

I think you're nuts!!

Am I? Am I? Or am I the sanest person you know!!?? Really, I do enjoy game music, and NES music sounds pretty cool coming out of a SID Chip. You can even add filtering effects to it! Hey, you should never ask a programmer why he does something. I did it because it was technically possible. And I wanted to learn how to program assembly on the Commodore-64. This is my first assembly C-64 program ever.

Well, I still think you're crazy.

Ok, that's fine. You can go
here and enjoy your precious dead silence.

HOW do the NES' and C-64's (SID's) sound capabilities compare?

Well, there is very little comparison. The NES has more sound channels, but is highly primitive. The SID has synchronization, ring modulation, filtering, resonance effects, etc to its benefit. The NES has 5 sound channels: 2 square wave, with only 4 selectable duty cycles; 1 triangle wave; 1 noise channel; and 1 DMC sample channel. These assignments are fixed. Frequency is controlled through an 11-bit combination of registers, and volume is controlled through a 4-bit volume register. To its advantage, the NES can play 7-bit samples through its sample channel.
The SID has only 3 sound channels, but each can be selected to play any combination of square, triangle, sawtooth, or noise waveforms. Frequency is controlled through a 16-bit combination of registers; and pulsewidth is controlled through a 12-bit combination of registers. The SID has a sophisticated ADSR method of controlling a note's volume and shape as it is being played. Added to that is an 11-bit highpass, lowpass, or bandpass filter, which through subtractive synthesis can produce very complex and realistic sounds, like an electric guitar, string bass, techno-bleeps, you name it. Furthermore, channels can be combined to produce modulation effects such as vibrato or tremolo. The SID also has a way of producing sampled sounds, though I believe they are only 4-bit.

SO, if the NES has 5 channels, and the SID only 3, how do you cram those extra channels in?

Well, first of all, the NES' DMC channel is not saved into Marat's PSG file at all, so I can ignore that. The noise channel of the NES I map over the triangle channel pre-emptively. I chose to do this (thanks to advice from Kevin Horton) because the triangle channel of the NES is used for background melodies, and so cutting into that would be less noticeable than if I did anything to the two lead channels. Apparently, SID songs have been doing this for years.

WHERE can I get more of these PSG files? Can I make my own?

Feel free to e-mail me for more PSG files, as I have many. To make your own, you'll need iNES, VGB, or MasterGear and some games.

WHAT THE HELL? It just seems to be producing MIDI files!!??

Unfortunately, Marat decided just to have his latest emulators produce MIDI files. I think this is a rather unfortunate mistake, as MIDI files of game music simply do not sound as good as real PSG files. If you disagree with what he's done, then please e-mail him and chastise him for what he's done. Tell him you want PSG files back!!!
Top

DOWNLOADS

These files should be free of any harmful bugs or errors, but I will still take no responsibility if you try to like, run them from your Windows 98 Start bar, or something. THESE FILES ARE FOR THE COMMODORE-64 ONLY (or a suitable working emulator)!!!

NESSIDPlay V3.1 program & example music files on .D64 disks. Download this if you are using an emulator that only accepts .D64 images, or if you want to dump this to a floppy disk for use on a real C-64.
NESSIDPlay 3.1 by itself for people who want to download just the program and then use or obtain other PSG files.
NESSIDPlay 3.0 by itself for people who would prefer to use the older version of the program.
Instructions as a Commodore-64 executable, for quick reference while running on the C-64.

Top

USAGE

So, now that you have the program, how do you use it? Well, you need to find either a Commodore-64 emulator for your computer, or if you're lucky(?) enough to have a real C-64, transfer it to disk. The former shouldn't be too difficult, but the latter might be. Search the Internet or the Newsgroups for answers on how to do this, but the most common way is to build a parallel interface and find software. On my Amiga, I use an "IEC" software package and a parallel cable to do disk transfers. Of course, if you're browsing the Internet using a C-64 anyway, well, you're well ahead of the game.

Once you have the program and some example files stored in a location (I'm assuming floppy device 8) usable by the C-64, load a PSG file into the C-64's memory by typing NEW and then LOAD "filename",8. Make sure you type it this way and only this way. If you add ",1" to your load command, the sound file will be loaded into an unusable memory space. If you have the FastLoad cartridge, your job is much simpler. Simply type /filename and the file will always be loaded into the proper memory space. You don't even have to type NEW every time.

Since the Commodore-64 has a limited memory size, make sure you load files that are only about 39-40 kilobytes in size. Any size above this might not be read, and could possibly overwrite the program!

PROGRAM LOADING

Now having loaded the PSG file, load NESSIDPlay into memory by typing LOAD "NESSIDPLAY",8,1. You must type the ",1" in the load command, so that the program will be loaded into its proper memory space. Of course, feel free to use a wildstar (*) to save some typing time. After the program has finished loading, type SYS 50000 to set the program running. A display like the one at the top of the page should now appear and the music should start playing if it was a valid PSG file. The BASIC interpreter should still fill the rest of the screen, allowing you to use it (to a limited extent). You can even load new PSG files while the current one is playing; just follow the same loading steps as before. As long as NESSIDPlay is left undisturbed in memory, you should have no need to load it again. Anytime you want to restart the music, just remember to type SYS 50000.

NESSIDPlay's Display

Once a music file is playing, the display will come alive. The first thing to notice are the volume indicators for each of the SID's channels. These will move according to the volume of the music being played. Next, on the borders of the screen, you will see some multi-coloured bars moving about. What these signify are the rastertimes of the various processes occuring at an instant. The colour of the bar represents the operation: Red, Green, and Blue signify a change in the values of the representative channels; Yellow signifies that a sound from the NES' noise channel is being played; White signifies that a VBlank is occuring. New to NESSIDPlay version 3.1 are sliders indicating the pitch, or frequency, of the notes being played on the corresponding channels. The scale of this frequency display is limited to a range representing a majority of musical notes, but it doesn't show all of the possible frequency range. I did this so that small variations in pitch can still be noticeable onscreen (vibrato looks cool!). If anybody wants me to make for them a version of NESSIDPlay with a narrower or wider frequency range, then
mail me.

What's with the sound from my: a) emulator, b) C-64?

Put simply, the real SID chip is buggy. So, I had to compensate for its bugs. More technically, whenever you change certain registers (like the filter, or the Sustain register), the SID goes silent. Whenever a PSG song raises the volume of any channel, the SID would go almost completely quiet. Earlier versions of NESSIDPlay which would work fine on an emulator, would play music veeeery quietly on my real C-64. I tried several methods to solve the bug, but the most effective one remained that I toggle the SID gate every time a note changed volume. On a real SID this still sounds perfectly fine (even great, considering there's nothing I can do to solve the fundamental problem of the SID's.) On an emulator, especially one that doesn't emulate the SID exactly, the music will sound very choppy. I can release a version of my program just for emulators, but only if enough people ask me to. Besides, if you're using an emulator, chances are that you're using a computer which has programs that can play these PSG files directly. Check out Marat's homepage to find one for your computer. This program is really meant for people who use real Commodore-64s.

What's supposed to happen when NESSIDPlay reaches the end of a song??

My method for checking of an end-of-file is still rather primitive, I admit. If NESSIDPlay reads data that it considers invalid, it will restart playing at the beginning of the file. Sometimes, some PSG files will be perfectly overlapped in memory that when my program finishes playing one song, it will continue to the end of a bigger song "underneath" it. That's not a big problem. If you start NESSIDPlay with fresh memory, then you shouldn't get any undesirable sounds coming out of your C-64.
Top

HISTORY

FUTURE

In the future, I'd like to have NESSIDPlay be able to load PSG files compressed with GZip. That would enable it to load files which would be too big uncompressed. I wonder if it's feasible... Can anybody help me on this?

For this program to develop, I need your help and input. Please mail me if you have any comments, questions, criticisms, suggestions, praise, rants, ideas, money, employment, or anything pleasurable to give to me. Don't forget to inundate Marat Fayzullin with mail asking him to continue supporting the PSG audio format!

Enjoy! Enjoy!


Top Back!