aboutsummaryrefslogtreecommitdiff
path: root/src/main.effekt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.effekt')
-rw-r--r--src/main.effekt15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/main.effekt b/src/main.effekt
index 627ae8e..59f8f12 100644
--- a/src/main.effekt
+++ b/src/main.effekt
@@ -1,16 +1,21 @@
module main // must be named same as the file!
import src/cpu
-import src/renderer
import src/renderers/js
+import src/renderer
import bytearray
def main(): Unit = {
// Using the JS backend
- def r = JSRenderer::makeRenderer
- def test(rom: ByteArray) = {
- cpu::run(rom) {r}
+ 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)
+ ()
}
- r.init(test)
()
} \ No newline at end of file