arnaud-carre / LSPlayer

Fastest Amiga Module player ever
MIT License
97 stars 8 forks source link

Switching Mods #3

Closed blitmaps closed 5 months ago

blitmaps commented 3 years ago

This player is performing very well, but I'm having trouble switching mods...

I am just removing the interrupt and restarting the configuration, as I change mods two or three times. When I build, and one of the mods that I play first plays fine, and then the second seems to play the track but the instruments are just random noise.

Am I doing something stupid?

xdef    _play_voyage_music
_play_voyage_music:
            ; Stop the playing routine
            jsr LSP_MusicDriver_CIA_Stop

        ; Init LSP and start replay using easy CIA toolbox
            lea     incbin_VoyageMusic_start,a0
            lea     incbin_VoyageBank_start,a1
            suba.l  a2,a2           ; suppose VBR=0 ( A500 )
            moveq   #0,d0           ; suppose PAL machine
            bsr     LSP_MusicDriver_CIA_Start

            move.w  #$e000,$dff09a
            rts
arnaud-carre commented 3 years ago

it's because of a bug in the relocation "is done". I'm about to fix that in next version. Before that, as a work around you could comment the lines "tst.b m_relocDone(a3)" and "bne.s .skip"

blitmaps commented 3 years ago

That is fantastic - fixes the issue perfectly!

blitmaps commented 3 years ago

Hey, is there a workaround for changing back to the same mod? The workaround above works perfectly for A->B. If you go A->A or A->B->A , the second A does not play correctly. (sorry, I am not super skilled at assembly at this is highly optimised, but it looks like allocation is happening based on the mod input).

arnaud-carre commented 1 year ago

the reloc flag has been changed recently in v1.10. the A->B->A pattern should work now