Jump to content
IGNORED

TheHoboInYourRoom's Blog - Let there be sound


RSS Bot

Recommended Posts

It's fair to say I've neglected this blog. But now I'm using it, so that's cool. You probably shouldn't expect updates to be regular.

I'm finally taking the first steps in writing an actual game for the VCS, and I'm doing it from the inside out, more or less. Making sure the individual effects and modules work, and that I thoroughly understand them, before integrating them.
This first module is rather generic and could be used in any number of games: a sound driver and its associated data format. It's pretty simple, with only three message types: sound updates, sustain times, and end-of-sound. Sound updates are 3 bytes that map directly to the AUDx registers. The sustain and end-of-sound messages are control messages, and I set the high bit to mark them. End-of-sound is $FF, so that leaves the other 127 values for sustain times of 0-126 frames. A zero-frame sustain sounds a little weird, but only one message per channel is processed per frame, which means every message has an inherent length of one frame, so a zero-sustain just leads to a sound fragment that lasts for two frames. I'll also write a macro for making the sustain messages more readable. End-of-sound sets everything to zero. But really I'm just repeating the comments I wrote in the source code. The driver will be elaborated on eventually; I plan to reserve a special sound effect ID that will cause the driver to bypass normal processing, in order to allow for randomly generated music and effects. By the way, if you read the source code, I apologize for the cycle-count spaghetti. I just had to make utterly sure the code would run within the VSYNC period in all cases. It so happens I have plenty of time left over, and the code so far is only about half a page long, so there's room to expand in both dimensions.

For the actual numbering of sound effects, I already have a format worked out:

 
In the meantime, have a noise burst and a bwoop sound, in the attached binary. Press fire on the left joystick for the noise and push the stick to the right for the bwoop.
Comments and critique welcome. Cheers!

Attached File(s)


http://atariage.com/forums/blog/584/entry-13348-let-there-be-sound/
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...