Jump to content

Recommended Posts

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 by intvnut
clarification
  • Like 3

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

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)

 

  • Like 1

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.

Guest
Reply to this topic...

×   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...