I have a long-going project to use the DMC IRQ to stream PCM data at 8.2kHz while still having enough time to run a game (with the tasks spread out across two frames for 30FPS). However, this is done by sitting around in the IRQ handler so that I can land another $4011 write right in between two IRQs, wasting a lot of time throughout the frame.
I have attached a terrible timeline made in paint to illustrate what's happening in my system.
IRQ.png [ 7.22 KiB | Viewed 4423 times ]
What I wonder is what a good way is to cram in processing of the game logic into that waiting time, essentially doing something like interleaving or "multithreading". What game tasks are generally less likely to be full of branches, and therefore easier to break up into 100-150 cycle segments to be executed in?
I have attached a terrible timeline made in paint to illustrate what's happening in my system.
Attachment:
IRQ.png [ 7.22 KiB | Viewed 4423 times ]
What I wonder is what a good way is to cram in processing of the game logic into that waiting time, essentially doing something like interleaving or "multithreading". What game tasks are generally less likely to be full of branches, and therefore easier to break up into 100-150 cycle segments to be executed in?