skywaffle Posted October 2, 2019 Share Posted October 2, 2019 Hello, I was just curious if there any way to pause and resume music playback in IntyBASIC? I was thinking there must be a way to peek / poke the tracker location, just not sure if that is possible or not. Thanks, Matthew Quote Link to comment https://forums.atariage.com/topic/296741-intybasic-music-pause-resume-function/ Share on other sites More sharing options...
intvnut Posted October 2, 2019 Share Posted October 2, 2019 (edited) I think you could write a short assembly function to grab the music pointer and zero it. Based on what I see in IntyBASIC 1.4.1's intybasic_epilogue.asm, I think the following IntyBASIC code should work, using a touch of inline-assembly and the USR / CALL functionality. ASM PAUSE_MUSIC: ASM DIS ASM MVI _music_p, R0 ASM CLRR R1 ASM MVO R1, _music_p ASM EIS ASM JR R5 ASM UNPAUSE_MUSIC: ASM MVO R0, _music_p ASM JR R5 ' To pause music: #OldMusicP = USR PAUSE_MUSIC ' To unpause music: CALL UNPAUSE_MUSIC(#OldMusicP) The PAUSE_MUSIC function will zero out the currently active music, and return the previous music pointer. You'll need this to be able to unpause the music. The UNPAUSE_MUSIC function will take the previously-saved music pointer and restore it. Looking at the code, it looks like pausing and unpausing music will cut the current note short, and will start music at the next full note. That seems reasonable, IMHO, if you're just pausing the music in response to pausing the game, for example. I haven't had a chance to test this code—I haven't even tried to compile it. Give it a try. Edited October 2, 2019 by intvnut clarification 3 Quote Link to comment https://forums.atariage.com/topic/296741-intybasic-music-pause-resume-function/#findComment-4362487 Share on other sites More sharing options...
carlsson Posted October 3, 2019 Share Posted October 3, 2019 On a similar note, I previously experimented with adding labels to the music data and combine with graphic *cough* effects. The location of _music_p might be compile time specific so intvnut's approach above would be more dynamic, but I simply peeked the memory position ($0339 for me - check your LST file) to determine where in the music the player is. And no, I am not working on a port of Cauldron, it was only a test music in time for Halloween last year. cauldron.bas cauldron.bin Quote Link to comment https://forums.atariage.com/topic/296741-intybasic-music-pause-resume-function/#findComment-4362889 Share on other sites More sharing options...
+nanochess Posted October 3, 2019 Share Posted October 3, 2019 You can pause the music using this: PLAY NONE SOUND 0,,0 SOUND 1,,0 SOUND 2,,0 SOUND 4,,$38 And to re-enable it you only need to do this: PLAY SIMPLE (or the same PLAY mode you were using) 1 Quote Link to comment https://forums.atariage.com/topic/296741-intybasic-music-pause-resume-function/#findComment-4363097 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.