I haven't tested it yet but I think it's sure to sound wonky, interrupts have to be disabled for around 15% of the time during screen PUSH.AndyC wrote: ↑Tue Nov 14, 2017 6:34 pmIf you need the AY routine to be called at 50fps but don't want to wait for HALTs, why not just call it from within the interrupt handler itself? Your music might go iffy I suppose if you DI for too long, but that's probably as true for any other strategy. Alternatively count frames in the interrupt handler, call a music handler whenever you can and only have that actually call the real AY routine if the frame count has increased.
I've tried this with an AY tune* and (you'll be horrified I'm even considering it!) and I think it sounded okay. The main loop looks something like this:
a bit of stuff
xor stuff ON
push buffer to screen
xor stuff OFF
most other stuff
The distance between the two CALL AYs can be placed as close as possible to a frame apart, a lot of the routines have been written so they don't vary that much, e.g. if a sprite is off still draw it but elsewhere.
It's icky, but if it works I'll be happy.
When everything's in place I'll need to see how well I can refine it, barring a complete redesign or calling it a AY free first attempt.
*not the Edge Grinder track, which I still need to commission or get my hands on the CPC version.