From e9e0396b6ddf86a32d14db65d9d25400b9754226 Mon Sep 17 00:00:00 2001 From: neauoire Date: Thu, 1 Dec 2022 20:01:51 -0800 Subject: [PATCH] Added step key --- src/bligen.tal | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/src/bligen.tal b/src/bligen.tal index 6633784..2b7f2a5 100644 --- a/src/bligen.tal +++ b/src/bligen.tal @@ -14,6 +14,7 @@ @time $2 @sleep $1 + @lock $1 @rate $1 @pc $2 @@ -94,7 +95,8 @@ BRK .Mouse/x DEI2 #00e0 SUB2 #03 SFT2 NIP STHr ORAk #00 EQU ,&toggle-sleep JCN - + DUP2 #0100 EQU2 ,&toggle-lock JCN + DUP2 #0200 EQU2 ,&toggle-reset JCN DUP #f7 EQU ,&incr-speed JCN POP2 @@ -118,6 +120,26 @@ BRK BRK +&toggle-lock ( xy* -- ) + + POP2 + #01 .sleep STZ + .lock LDZk #00 EQU SWP STZ + ;step JSR2 POP + #00 .Mouse/state DEO + ;redraw-all JSR2 + +BRK + +&toggle-reset ( xy* -- ) + + POP2 + ;reset JSR2 + #00 .Mouse/state DEO + ;redraw-all JSR2 + +BRK + @on-frame ( -> ) .sleep LDZ ,&ignore JCN @@ -138,7 +160,7 @@ BRK @|core ) @reset ( -- ) - ( run ) + #0100 .pc STZ2 #0000 ;wst/ptr STA2 #0000 ;rst/ptr STA2 @@ -175,6 +197,7 @@ JMP2r JMP2r &halt POP + #00 .lock STZ #01 .sleep STZ ;reset JSR2 ;draw-state JSR2 @@ -519,6 +542,8 @@ JMP2r #00e0 .Screen/x DEO2 #00a0 .Screen/y DEO2 #01 .sleep LDZ ;draw-button JSR2 + #02 .lock LDZ ;draw-button JSR2 + #03 .pc LDZ2 #0100 EQU2 ;draw-button JSR2 JMP2r @@ -604,7 +629,7 @@ JMP2r @draw-chr ( char -- ) #20 SUB #00 SWP #30 SFT2 ;font ADD2 .Screen/addr DEO2 - [ LIT &color 03 ] .Screen/sprite DEO + [ LIT &color 01 ] .Screen/sprite DEO JMP2r @@ -676,7 +701,7 @@ JMP2r &out "OUT 20 $1 &pc "PC 20 $1 &lit "LIT $1 - &flags "RUN $1 + &flags "SR $1 ( @|utils ) -- 2.45.2