(calc.rom) Add keyboard controls

This commit is contained in:
Devine Lu Linvega 2021-11-12 15:45:06 -05:00
parent 7a49c5527f
commit 2d53e60fff
1 changed files with 17 additions and 6 deletions

View File

@ -90,21 +90,21 @@
#0040 ++ .keypad-frame/x2 STZ2 #0040 ++ .keypad-frame/x2 STZ2
.center/y LDZ2 #0018 -- .center/y LDZ2 #0018 --
DUP2 .keypad-frame/y STZ2 DUP2 .keypad-frame/y STZ2
#0040 ++ .keypad-frame/y2 STZ2 #003f ++ .keypad-frame/y2 STZ2
.keypad-frame/x LDZ2 .keypad-frame/x LDZ2
DUP2 .modpad-frame/x STZ2 DUP2 .modpad-frame/x STZ2
#0040 ++ .modpad-frame/x2 STZ2 #0040 ++ .modpad-frame/x2 STZ2
.keypad-frame/y LDZ2 #0040 ++ .keypad-frame/y LDZ2 #0040 ++
DUP2 .modpad-frame/y STZ2 DUP2 .modpad-frame/y STZ2
#0020 ++ .modpad-frame/y2 STZ2 #001f ++ .modpad-frame/y2 STZ2
.keypad-frame/x LDZ2 .keypad-frame/x LDZ2
DUP2 .bitpad-frame/x STZ2 DUP2 .bitpad-frame/x STZ2
#0040 ++ .bitpad-frame/x2 STZ2 #0040 ++ .bitpad-frame/x2 STZ2
.modpad-frame/y2 LDZ2 #0008 ++ .modpad-frame/y2 LDZ2 #0008 ++
DUP2 .bitpad-frame/y STZ2 DUP2 .bitpad-frame/y STZ2
#0010 ++ .bitpad-frame/y2 STZ2 #000f ++ .bitpad-frame/y2 STZ2
.center/x LDZ2 #0020 -- .center/x LDZ2 #0020 --
DUP2 .input-frame/x STZ2 DUP2 .input-frame/x STZ2
@ -128,6 +128,7 @@ BRK
DUP #0d ! ,&no-enter JCN DUP #0d ! ,&no-enter JCN
;do-push JSR2 POP BRK ;do-push JSR2 POP BRK
&no-enter &no-enter
( arithmetic )
DUP LIT '+ ! ,&no-add JCN DUP LIT '+ ! ,&no-add JCN
;do-add JSR2 POP BRK &no-add ;do-add JSR2 POP BRK &no-add
DUP LIT '- ! ,&no-sub JCN DUP LIT '- ! ,&no-sub JCN
@ -136,6 +137,16 @@ BRK
;do-mul JSR2 POP BRK &no-mul ;do-mul JSR2 POP BRK &no-mul
DUP LIT '/ ! ,&no-div JCN DUP LIT '/ ! ,&no-div JCN
;do-div JSR2 POP BRK &no-div ;do-div JSR2 POP BRK &no-div
( bitwise )
DUP LIT '& ! ,&no-and JCN
;do-and JSR2 POP BRK &no-and
DUP LIT '| ! ,&no-ora JCN
;do-ora JSR2 POP BRK &no-ora
DUP LIT '^ ! ,&no-eor JCN
;do-eor JSR2 POP BRK &no-eor
DUP LIT '~ ! ,&no-not JCN
;do-not JSR2 POP BRK &no-not
( clear )
DUP #1b ! ,&no-esc JCN DUP #1b ! ,&no-esc JCN
;do-pop JSR2 POP BRK &no-esc ;do-pop JSR2 POP BRK &no-esc
DUP #08 ! ,&no-backspace JCN DUP #08 ! ,&no-backspace JCN
@ -287,7 +298,7 @@ RTN
@do-push ( -- ) @do-push ( -- )
.input/value LDZ2 #0000 >> ,&not-empty JCN .input/value LDZ2 ADD ,&not-empty JCN
RTN RTN
&not-empty &not-empty
.stack/length LDZ #07 < ,&not-full JCN .stack/length LDZ #07 < ,&not-full JCN