Possible issue with Level 0 sound flags passed to level 1 fill
Jon Abbott (1421) 2651 posts |
When Sound0 calls the channel handler, R6 bit 31 is set if either no. of channels, period or length changed has changed since the last call. R6 seems to always have bit 31 set (the value is &B42D0100 by default), is this a bug? Will this cause Sound0 to constantly recompile the sound code? I’ve compared RO5.21 against RO3.71, the other values in R6 are consistent, its just bit 31 that seems to be incorrect. Tested with the following code:
|
Jeffrey Lee (213) 6048 posts |
Oops – that looks like it’ll be the (Sound0HAL) stereo reverse flag. Not quite sure why I decided it was a good idea to store it in the top bit of the flags, as that bit is clearly used for the update checks in both Sound0 and Sound1. Should be easy enough to fix, at least – there are a couple of redundant VIDC20 flags which can be removed to free up some space in the flags byte. |
Jon Abbott (1421) 2651 posts |
I’ll force it off before it gets to Level 1 whilst I’m testing – it’s creating havok with Channel Handlers. Let me know when the fix is in the alpha, I’ll retest. |
Jeffrey Lee (213) 6048 posts |
I’ve submitted a fix, so it should show up in tomorrow’s ROMs. There’s a slight bug in your test code, btw – you should be using MOV PC,LR to return from the channel handler (unlike the voice generators, the channel handler is entered in IRQ mode with IRQs disabled, so it just uses R14 for the return address) |
Jon Abbott (1421) 2651 posts |
Excellent, thank you.
Reckon I went into autopilot when I typed it in, as my code was using MOV PC, R14 – now corrected. EDIT: Confirmed fixed |