More work on graphics
Make the memory thread safe and add IRQ support