implement apu irq handling in nes main loop thread.