arnaud-carre / LSPlayer

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

CIA interrupt flag cleared in wrong order #6

Closed chrisly42 closed 2 years ago

chrisly42 commented 2 years ago

I can't take credit for this, it was mentioned in this EAB thread.

.LSP_MainIrq:
            move.w  #$2000,$dff09c
            btst.b  #0,$bfdd00
            beq.s   .skipa

.LSP_DmaconIrq:
            move.w  #$2000,$dff09c
            btst.b  #1,$bfdd00
            beq.s   .skipb

Apparently, this order can retrigger the CIA interrupt a second time because the CIA edge interrupt has not been cleared by the btst and thus the intreq might be set again (maybe this doesn't happen on all CPU configurations due to internal race conditions). I haven't come across this as I haven't been using the CIA timer one, but I wanted to mention it here.

arnaud-carre commented 2 years ago

interesting thread! I asked question in amiga forum, i'm curious. Thank you for the heads-up

arnaud-carre commented 2 years ago

fixed in recent LSP version, thanks!