1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
module main import src/cpu import src/renderers/js import src/renderer import bytearray def main(): Unit = { // Using the JS backend def renderer: Renderer = JSRenderer::makeRenderer def cpu_ = makeCPU() {renderer} def plsRender(rom: ByteArray): Unit = { cpu_.initCPU(rom) renderer.update(box {() => cpu_.cycleCPU()}) } renderer.init(plsRender) () () }