add support for callbacks

everything will run on the main timer interrupt (CPU synchronization, graphics rendering and sound rendering)