module main // must be named same as the file! import src/cpu import src/renderers/js import src/renderer import bytearray def main(): Unit = { // Using the JS backend region global { 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) () } () }