arnaud-carre / LSPlayer

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

Minor documentation error #4

Closed chrisly42 closed 2 years ago

chrisly42 commented 2 years ago

Hi Leonard,

I just switched from P61 to LSP for my framework and noticed a minor error. According to the comments, register a5 is not modified by the LSP player tick routine (LSP_MusicDriver+4), but it seems like it is. (note that the offsets in the comments of the rs data structure are not quite right after insertion of the escape codes, but this is nothing I would care about).

Also, there is no means to directly modify the DMA patch address during runtime (let's say you have multiple parts and the copper list with the dmacon command moves to another location, or fully double buffered copper lists).

Other than that, the results are excellent. Thank you for your awesome work!

arnaud-carre commented 2 years ago

hi! glad you're using LSP in your framework! thanks for report, I'll fix that. Good catch for DMA patch address I think I'll add a function for that

arnaud-carre commented 2 years ago

I just updated some changes as v1.05. the broken register lists comments were a real issue because the movem.l in the CIA player was wrong ( so could do crashs ). Thanks! Btw I didn't added a function to set DMA address. My though is if someone really need to have several DMA patch address (as you mention maybe multiple copper lists, anything), then I think it's up to the user to use a "move.w" to patch its own current DMA set. Like you init LSP like that:

lea mainDmaConValue(pc),a2 bsr LSP_Init

mainDmaConValue: dc.w $8000

; and then anywhere in the code right after calling the player tick: move.l myCurrentCopperListPatchAddr(pc),a0 move.w mainDmaConValue(pc), (a0)

chrisly42 commented 2 years ago

Thanks for the fixes! I've already modified a lot of the register allocation (a5=$dff000, using a1 instead in the voice-loop and a6=global framework variables pointer, where I moved your variables to (losing a few cycles)). (Pro tip: don't use textual replace when switching registers, especially when you have $a6 in the source, took a while to find my mistake :/ ).

You're quite right about the DMA patch address trick being a suitable route (however, in the example above it should be lea mainDmaConValue+1(pc),a2). And you might want to document that the init-code will actually try to write $8000 to the byte before the address given (maybe you have, not sure). Code will not crash on 68020 if the address is even, but will do so on 68000. As I made all variables global to my framework, I now have direct access to the patch address, so this works for me ;)

Cheers and keep up the good work,

Chris