Oh feel free. That off the cuff "two Ataris" comment, might have some merit. It's not like most of us don't have a coupla machines and a spare game port, right? One running the Williams style sound while another one runs a game might be totally cool. Or, sound events could be added to real games. Like say, the 8 bit Defender? lol
I just got a nice little Propeller board setup with 8 bit DACS. I think I'm going to go find the Williams sound board ROM and have a play. That code above contains a few reference parameters we all can recognize, so we can know it's right. What I don't know is if the Williams board downsampled, or just stuffed the 800Khz sample right straight into the DAC. I think it did, and they just didn't care, or it made something easy. But I don't know.
What I do know is the author ran that C code with some of the Williams sound parameters he found and when he downsampled it to 44.1, he got the correct sounds in a wave file.
I freaking love those sounds, BTW. And that's true of the whole classic era, save for the Apple 2, which had the least interesting sounds generally. One bit is enough to have fun, but not while slugging things around on the screen. But that aside, most of the other machines all had some distinct sounds all defined by their hardware approach. It's as vivid and cool to me as the graphics are.
Over the weekend I returned to playing with the disassembly, and decided to understand how the sound works. Sound is created by a second CPU on what is called the Williams sound board; you can find schematics online. This board is used in the Williams games for Defender, Stargate, Robotron, Joust, Bubbles, Blaster, Sinistar (with added speech components). The board uses a Motorola 6808 (or 6802) CPU, has 128 bytes of RAM (addressed 0-127), 2K of ROM at addresses 0xF000-0xFFFF (more ROM in later games), and a simple 256 level D/A converter that runs the speaker output, written to by writing to address $400. The CPU runs at 894750 cycles per second, so sound is produced at this many samples per second.
So they just blasted right into the DAC at full speed. Nice!
https://www.jameco.com/Jameco/Products/ProdDS/43502.pdf (that's the CPU, and it's a lot like a 6502. Two 8 bit accumulators, one 16 bit index register, similar instructions)
I've attached a text file with a disassembly I found somewhere I can't recall off hand.
(Ok, Pop. I promise. Shuts up now. Great work so far, BTW. Don't take my Bb comments personally. I didn't see what you were going for.)
Attach didn't take, it's in my blog. Can't seem to make a post. I'll dump it in the classic gaming forum.
Edited by potatohead, Sat Nov 14, 2015 2:11 PM.