summaryrefslogtreecommitdiff
path: root/6502/test/test.fnl
diff options
context:
space:
mode:
Diffstat (limited to '6502/test/test.fnl')
-rw-r--r--6502/test/test.fnl20
1 files changed, 20 insertions, 0 deletions
diff --git a/6502/test/test.fnl b/6502/test/test.fnl
new file mode 100644
index 0000000..11c4f9a
--- /dev/null
+++ b/6502/test/test.fnl
@@ -0,0 +1,20 @@
+(local json (require :json))
+(local inspect (require :inspect))
+(local l6502 (require :l6502-lua))
+
+(fn slurp [path]
+ (let [f (io.open path)]
+ (f:read "*all")))
+
+(local emu (l6502.new))
+(print (emu:set-pc 42))
+(print (emu:set-reg l6502.reg.SP 10))
+(print (emu:set-reg l6502.reg.A 255))
+(emu:emulate)
+(print (inspect (emu:summary)))
+
+;; (local testcases (json.decode (slurp "testcases/6502/v1/00.json")))
+;; (each [_ test (ipairs testcases)]
+;; (l6502.run test.name))
+
+;; (print (inspect ))