aboutsummaryrefslogtreecommitdiff
path: root/src/main.effekt
blob: fd9f7c08749b66f1e99c3bec090ca6806e897caf (plain) (blame)
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)
    ()
  ()
}