# HG changeset patch # User Steve Losh # Date 1481849103 18000 # Node ID 9f22ed821ddd1d3b1dda34d66422cc48fffdd7e1 # Parent 92440a7b350baa81d057268b115761d9195127ea Fix the stupid tetris input bug Apparently ADD Reg, Imm doesn't set the carry flag like all the other ADD/SUB instructions. diff -r 92440a7b350b -r 9f22ed821ddd src/emulator.lisp --- a/src/emulator.lisp Thu Dec 15 19:44:28 2016 -0500 +++ b/src/emulator.lisp Thu Dec 15 19:45:03 2016 -0500 @@ -2,6 +2,7 @@ (setf *print-length* 16) (setf *print-base* 10) + (declaim (optimize (speed 1) (safety 3) (debug 3))) (declaim (optimize (speed 3) (safety 1) (debug 3))) @@ -13,7 +14,7 @@ ;;;; Constants ---------------------------------------------------------------- -(defconstant +cycles-per-second+ 500) +(defconstant +cycles-per-second+ 1000) (defconstant +cycles-before-sleep+ 10) (defconstant +screen-width+ 64) (defconstant +screen-height+ 32) @@ -445,10 +446,13 @@ (define-opcode op-ret () ;; RET (setf program-counter (vector-pop stack))) +(define-opcode op-add-reg