I can quickly describe it :TmEE co.(TM) wrote:I looked at your 2ch mixer code, and I looked at it again, and I must say, that I didn't get it
CB = WAV 0 length arranged (0-15 bits)
DE = WAV 0 address (0-15 bits)
IXL = WAV 0 address (15-23 bits)
IYL = WAV 0 last data value (used for mixing)
CB' = WAV 1 length arranged (0-15 bits)
DE' = WAV 1 address (0-15 bits)
IXH = WAV 1 address (15-23 bits)
IYL = WAV 1 last data value (used for mixing)
As you can see, i tried to maximize registers usage

Beside that, (STATUS) keep info of "playing" for both channel 0 and channel 1, if we're not playing, i'm using silent data for mixing.
I tried to minimize "jump" which made stuff a bit more complexe... i do not use DJNZ but "DEC B and JR carry" which is faster in "no carry" case (which happen almost everytime).
I don't have the code here so i can't really remember perfectly, but that should give you some tips... what part you don't understand ?