Rybags Posted November 30, 2010 Share Posted November 30, 2010 Just adding some RMT music to my game. For stuff like lost life, level end, it will play some short pieces. Is there a way of working out when the end of a track or song is reached? Or the progress of a piece being played, ie some RAM variable/s that correspond to progress through the song like you'd see if playing it back in the Win version. Note during the course of gameplay itself, RMT isn't being used - it's likely I'll only use it in a single-stream fashion during menu or specific parts of the game where no other sounds are occurring. Quote Link to comment Share on other sites More sharing options...
analmux Posted November 30, 2010 Share Posted November 30, 2010 Yes, there are ways... F.e. I did it in the instrumentarium tune long ago. I did an insert-/bypass-hack in the playing routine, checking whether songline 23 (or so) was reached, to turn on the 2-tone-filter. Then turn it off again at line 25. I don't quite remember how I did it exactly, but the insert routine was checking a zero-page reg. The method I used, it's still tricky however, because the values to be checked actually depend on the location of the song itself. At least, that's how I remember it. (maybe I'd need to recheck this all) Quote Link to comment Share on other sites More sharing options...
analmux Posted November 30, 2010 Share Posted November 30, 2010 OK, I did a quick check. Zeropage reg $D1 keeps the value of song progress, however, it's only the songline#. Not sure how to find the exact position, within the songline. Quote Link to comment Share on other sites More sharing options...
Rybags Posted November 30, 2010 Author Share Posted November 30, 2010 That should be sufficient... I think. Thanks. If not, I'll just have to resort to using a timer which in itself isn't too much work but easy/quick beats fiddling about. Quote Link to comment Share on other sites More sharing options...
analmux Posted November 30, 2010 Share Posted November 30, 2010 Of course, if you're only doing some intermezzos and jingles, then you can programm the length of your songlines. When the songline passes, then the value in $D1 increases. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.