From d308a85c89d8b065298d03d273fe16413ab4f6bc Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Thu, 27 Apr 2023 08:46:03 -0700 Subject: [PATCH] (notepad) Starting catching non hex values --- gui/notepad/notepad.tal | 40 ++++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/gui/notepad/notepad.tal b/gui/notepad/notepad.tal index 01e6dc1..228bc25 100644 --- a/gui/notepad/notepad.tal +++ b/gui/notepad/notepad.tal @@ -394,11 +394,11 @@ JMP2r ( wrap ) LDAk #20 GTH ?&no-wrap - DUP2 word-length .Screen/x DEI2 ADD2 #00d0 LTH2 ?&no-wrap + DUP2 word-width .Screen/x DEI2 ADD2 #00d0 LTH2 ?&no-wrap #01 !draw-linebreak &no-wrap ( char ) - LDAk #20 SUB #00 SWP ;font ADD2 LDA #00 SWP .Screen/x DEI2 ADD2 + LDAk char-width .Screen/x DEI2 ADD2 .Screen/x DEO2 ( tab ) LDAk #09 NEQ ?&no-tab @@ -412,23 +412,35 @@ JMP2r JMP2r -@word-length ( str* -- length* ) - - [ LIT2r 0000 ] - &while - LDAk #20 SUB #00 SWP ;font ADD2 LDA #00 SWP STH2 ADD2r - INC2 LDAk #20 GTH ?&while - POP2 - STH2r - -JMP2r - @get-page ( -- addr* ) ;mem #00 .page LDZ #2000 MUL2 ADD2 JMP2r +@get-glyph ( char -- addr* ) + + #20 SUB #00 SWP #50 SFT2 ;font/glyphs ADD2 + +JMP2r + +@char-width ( char -- width* ) + + #20 SUB #00 SWP ;font ADD2 LDA #00 SWP + +JMP2r + +@word-width ( str* -- length* ) + + [ LIT2r 0000 ] + &while + LDAk char-width STH2 ADD2r + INC2 LDAk #20 GTH ?&while + POP2 + STH2r + +JMP2r + ( @|drawing ) @@ -488,7 +500,7 @@ JMP2r get-page &while ( draw char ) - LDAk #20 SUB #00 SWP #50 SFT2 ;font/glyphs ADD2 .Screen/addr DEO2 + LDAk get-glyph .Screen/addr DEO2 DUP2 is-selected STH #0701 STHr [ JMP SWP POP ] .Screen/sprite DEOk DEO .Screen/x DEI2k #0010 SUB2 ROT DEO2 ( draw selector )