summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bytepusher.scm11
1 files changed, 7 insertions, 4 deletions
diff --git a/bytepusher.scm b/bytepusher.scm
index e822073..54c7e28 100644
--- a/bytepusher.scm
+++ b/bytepusher.scm
@@ -173,7 +173,7 @@
(lambda () (load-instruction instruction-addr))
(lambda (a b c)
(set-byte! b (get-byte a))
- (set-pc! c))))
+ c)))
(define (load-instruction instruction-addr)
(let ((a (get-addr (+ 0 instruction-addr)))
@@ -185,9 +185,11 @@
(values a b c)))
(define (loop-frame!)
- (let loop ((count 65535))
- (execute! (get-pc))
- (unless (= count 0) (loop (- count 1)))))
+ (let loop ((count 65536)
+ (nextpc (get-pc)))
+ (unless (= count 0)
+ (loop (- count 1)
+ (execute! nextpc)))))
(define (handle-key! action! key)
(let ((index (hashq-ref key-ids key)))
@@ -240,6 +242,7 @@
(call-with-renderer (make-renderer w '(accelerated)) loop!)))
(sdl-quit))
+(main)
;; ---- main operation