(notepad) Catch non-ascii

This commit is contained in:
Devine Lu Linvega 2023-04-27 08:52:51 -07:00
parent d308a85c89
commit 2b0f747b02
1 changed files with 11 additions and 5 deletions

View File

@ -8,9 +8,9 @@
( TODOs: ( TODOs:
> Show blinker on last character > Show blinker on last character
> Mouse2 select word > Mouse2 select word
> Select last character in file
> Always select end of note on change > Always select end of note on change
> Up and down arrows > Up and down arrows )
> Display non ascii character as blocks )
|0000 |0000
@ -418,17 +418,21 @@ JMP2r
JMP2r JMP2r
@get-glyph ( char -- addr* ) @char-addr ( char -- addr* )
DUP #7e GTH ?&missing
#20 SUB #00 SWP #50 SFT2 ;font/glyphs ADD2 #20 SUB #00 SWP #50 SFT2 ;font/glyphs ADD2
JMP2r JMP2r
&missing POP ;error-icn JMP2r
@char-width ( char -- width* ) @char-width ( char -- width* )
DUP #7e GTH ?&missing
#20 SUB #00 SWP ;font ADD2 LDA #00 SWP #20 SUB #00 SWP ;font ADD2 LDA #00 SWP
JMP2r JMP2r
&missing POP #0008 JMP2r
@word-width ( str* -- length* ) @word-width ( str* -- length* )
@ -500,7 +504,7 @@ JMP2r
get-page get-page
&while &while
( draw char ) ( draw char )
LDAk get-glyph .Screen/addr DEO2 LDAk char-addr .Screen/addr DEO2
DUP2 is-selected STH #0701 STHr [ JMP SWP POP ] .Screen/sprite DEOk DEO DUP2 is-selected STH #0701 STHr [ JMP SWP POP ] .Screen/sprite DEOk DEO
.Screen/x DEI2k #0010 SUB2 ROT DEO2 .Screen/x DEI2k #0010 SUB2 ROT DEO2
( draw selector ) ( draw selector )
@ -600,6 +604,8 @@ JMP2r
( (
@|assets ) @|assets )
@error-icn [
aa55 aa55 aa55 aa55 aa55 aa55 aa55 aa55 ]
@blink-icn [ @blink-icn [
8080 8080 8080 8080 8080 8080 8080 8080 ] 8080 8080 8080 8080 8080 8080 8080 8080 ]
@caret-icn [ @caret-icn [
@ -783,7 +789,7 @@ JMP2r
"Click 20 "in 20 "the 20 "lower 20 "left 20 "corner 20 "to 20 "turn 20 "to 20 "the 20 "next 20 "previous 20 "page. "Click 20 "in 20 "the 20 "lower 20 "left 20 "corner 20 "to 20 "turn 20 "to 20 "the 20 "next 20 "previous 20 "page.
$1 &end $1 &end
|a000 "The 20 "other 20 "page. |a000 "An 20 "unknown 20 "character: 20 f8 0a 09 "> 20 "Tabbed. 0a 09 "> 20 "Tabbed. $1
|c000 "The 20 "third 20 "page. |c000 "The 20 "third 20 "page.