74
« on: July 17, 2018, 07:47:35 pm »
Memcpy l uses long words (32 bits) while memcpy w uses word access (16 bits). You must use word access when writing to anything else than high ram since the only 32 bits things are related to the sh2 AFAIK.
Also, if you have a buffer in main ram, use the high ram as low ram is also 16 bits access and, if I'm not mistaken, you can't scu dma directly from low ram, so it will copy to a high buffer, then scu dma to sound ram, which is obviously slow (again, if I'm not mistaken).
The faster transfers are during vblank with indirect access (dma) since it's at that point where SGL will put the audio cpu in "listening mode".
I haven't looked at your code, but did you try to transfer during vblank?
Scu dma channel 0 should be free during that point, so just look at my model convert code for the "myvblank" function to transfer data.
While SGL documentation says otherwise, the slDMAcopy function seems to look at the destination and then switches to either cpu or scu dma depending on the destination.
Edit : Seems like you do it during vblank. Also, don't use dma wait as it will just cause useless delays. There is also a sbl function to transfer data to the audio ram, I had the code last time I shared with you, use that instead of slDMAcopy if you still have issues.