Jump to content
  • entries
    7
  • comments
    13
  • views
    14,194

I did the Sound Effect Queue MY WAAAY....


Gemintronic

812 views

So, my morning efforts to queue up sound effects failed. I was afraid that I'd practically have to write a mini database system just for the sound queue. I tried just that and only sorta got things working. I decided to skip all that noise and do it my way.

 

Basically, each sound gets its own request flag. If it wasn't the last request it gets to request attention. A delay timer awakens the sound engine after just about the time it takes to play back an effect. The sound effect engine goes down the list of sound effects to see if any have active requests and deals with them. I "waste" a variable and a constant for each sound effect (sound_request_foo and #snd_foo). For the sound effect engine itself two variables are used: sound_delay and sound_request_last. This means the sound effects are hard coded but this is a game all in ROM. Not going to be mixing anything except a drink.

 

Using a keyboard sucks for testing, by the way. Usually you cannot have simultaneous keys being pressed. I had to turn off sticky keys in Windows and map the SHIFT and CTRL keys to buttons. Those two keys can be read at the same time so I could test simultaneous sound effect requests.

0 Comments


Recommended Comments

There are no comments to display.

Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

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