From 98eb9cf1f7dc196c93acf340dd24ea517bc9f170 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Tue, 28 May 2024 08:30:44 -0700 Subject: [PATCH] Road toward uxnfor --- gui/notepad/src/notepad.tal | 62 ++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/gui/notepad/src/notepad.tal b/gui/notepad/src/notepad.tal index 485491f..cf5aae5 100644 --- a/gui/notepad/src/notepad.tal +++ b/gui/notepad/src/notepad.tal @@ -28,7 +28,7 @@ ;on-mouse-body .Mouse/vector DEO2 ;on-frame .Screen/vector DEO2 ;on-control .Controller/vector DEO2 - ( let's go! ) + ( | let's go! ) file-init draw-header #00 change-page @@ -159,9 +159,9 @@ BRK @insert ( char -- ) - get-from scap/ get-page #1000 ADD2 LTH2 ?&has-space + get-from scap/ get-page #1000 ADD2 LTH2 ?{ POP JMP2r - &has-space + } ( | convert linebreaks ) DUP #0d EQU #03 MUL SUB @@ -340,9 +340,9 @@ JMP2r @file-new ( -- ) #0801 - &l + &>l ( -- ) #00 OVR #c0 SFT2 ;mem ADD2 STH2 #20 STH2r STA - INC GTHk ?&l + INC GTHk ?&>l POP2 JMP2r @@ -361,10 +361,10 @@ JMP2r .File/name DEO2 #0001 .File/length DEO2 [ LIT2r 0000 ] - &s + &>s ( -- ) ;&b .File/read DEO2 [ LIT2 00 -File/success-lb ] DEI EQU ?&eof - INC2r !&s &eof + INC2r !&>s &eof STH2r JMP2r @@ -373,9 +373,9 @@ JMP2r @file-inject ( name* -- ) DUP2 file-size - ORAk ?&exists + ORAk ?{ POP2 POP2 JMP2r - &exists + } STH2 .File/name DEO2 STH2kr .File/length DEO2 @@ -466,17 +466,17 @@ JMP2r ( | walk to line ) .Mouse/y DEI2 pos-to-line ,&line STR get-page - &walk-line + &>walk-line .Screen/y DEI2 pos-to-line [ LIT &line $1 ] EQU ?&end-line walk-char POP - INC2 LDAk ?&walk-line + INC2 LDAk ?&>walk-line &end-line ( | walk to char ) .Mouse/x DEI2 #0001 SUB2 ,&x STR2 - &walk-char + &>walk-char .Screen/x DEI2 [ LIT2 &x $2 ] GTH2 ?&end-char walk-char ?&end-char - INC2 LDAk ?&walk-char + INC2 LDAk ?&>walk-char &end-char JMP2r @@ -543,9 +543,9 @@ JMP2r @word-width ( str* -- length* ) [ LIT2r 0000 ] - &while + &>w ( -- ) LDAk char-width STH2 ADD2r - INC2 LDAk #20 GTH ?&while + INC2 LDAk #20 GTH ?&>w POP2 STH2r @@ -554,10 +554,10 @@ JMP2r @find-line-start ( addr* -- addr* ) ;mem SWP2 - &l + &>l ( -- ) #0001 SUB2 LDAk DUP #0a EQU SWP #00 EQU ORA ?&end - LTH2k ?&l + LTH2k ?&>l &end NIP2 INC2 @@ -566,10 +566,10 @@ JMP2r @find-line-end ( addr* -- addr* ) get-eof SWP2 - &l + &>l ( -- ) LDAk #0a EQU ?&end LDAk #00 EQU ?&end - INC2 GTH2k ?&l + INC2 GTH2k ?&>l &end NIP2 @@ -578,9 +578,9 @@ JMP2r @find-word-start ( addr* -- addr* ) ;mem SWP2 - &l + &>l ( -- ) #0001 SUB2 LDAk #21 LTH ?&end - LTH2k ?&l + LTH2k ?&>l &end NIP2 INC2 @@ -589,9 +589,9 @@ JMP2r @find-word-end ( addr* -- addr* ) get-eof SWP2 - &l + &>l ( -- ) LDAk #21 LTH ?&end - INC2 GTH2k ?&l + INC2 GTH2k ?&>l &end NIP2 @@ -615,10 +615,10 @@ JMP2r #50 SFT2 ADD2 .Screen/addr DEO2 [ LIT2 01 -Screen/sprite ] DEOk DEO ( | lead ) - #e9 &l + #e9 &>l ( -- ) ;bar-icn/b .Screen/addr DEO2 [ LIT2 01 -Screen/sprite ] DEO - INC DUP ?&l + INC DUP ?&>l POP ;bar-icn/b .Screen/addr DEO2 [ LIT2 01 -Screen/sprite ] DEOk DEO @@ -652,7 +652,7 @@ JMP2r #0008 .Screen/x DEO2 #0018 .Screen/y DEO2 get-page - &while + &>w ( -- ) ( | draw char ) DUP2 #0001 SUB2 LDA2 char-addr .Screen/addr DEO2 is-selected STH #0701 STHr [ JMP SWP POP ] .Screen/sprite DEOk DEO @@ -666,14 +666,14 @@ JMP2r .Screen/x DEI2k #0008 SUB2 ROT DEO2 &block walk-char POP - INC2 LDAk ?&while + INC2 LDAk ?&>w POP2 @draw-footer ( -- ) - .Screen/height DEI2 #0020 GTH2 ?&visible + .Screen/height DEI2 #0020 GTH2 ?{ JMP2r - &visible + } [ LIT2 26 -Screen/auto ] DEO #0000 .Screen/x DEO2 .Screen/height DEI2 #0020 SUB2 .Screen/y DEO2 @@ -684,9 +684,9 @@ JMP2r #0018 .Screen/x DEO2 .Screen/height DEI2 #0008 SUB2 .Screen/y DEO2 ;page-icn/bottom .Screen/addr DEO2 - #e7 &l + #e7 &>l ( -- ) [ LIT2 01 -Screen/sprite ] DEO - INC DUP ?&l + INC DUP ?&>l POP ( | page number ) [ LIT2 15 -Screen/auto ] DEO