(notepad) Housekeeping

This commit is contained in:
Devine Lu Linvega 2023-04-27 09:38:51 -07:00
parent 3bfbcb4570
commit 84519b1111
1 changed files with 46 additions and 30 deletions

View File

@ -10,7 +10,10 @@
> Mouse2 select word > Mouse2 select word
> Select last character in file > 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
> Add meta details
> Save/Load
> do not move selection on block selection move, deselect )
|0000 |0000
@ -35,7 +38,7 @@
( initialize memory ) ( initialize memory )
#0801 #0801
&l &l
#00 OVR #2000 MUL2 ;mem ADD2 STH2 #20 STH2r STA #00 OVR #d0 SFT2 ;mem ADD2 STH2 #20 STH2r STA
INC GTHk ?&l INC GTHk ?&l
POP2 POP2
get-page select-from get-page select-from
@ -53,8 +56,8 @@ BRK
DUP2 [ LIT2 "c 01 ] NEQ2 ?&no-cc POP2 edit-copy BRK &no-cc DUP2 [ LIT2 "c 01 ] NEQ2 ?&no-cc POP2 edit-copy BRK &no-cc
DUP2 [ LIT2 "v 01 ] NEQ2 ?&no-cv POP2 edit-paste BRK &no-cv DUP2 [ LIT2 "v 01 ] NEQ2 ?&no-cv POP2 edit-paste BRK &no-cv
( arrows ) ( arrows )
DUP #40 NEQ ?&no-l .selection/from LDZ2 #0001 SUB2 select-from &no-l DUP #40 NEQ ?&no-l select-left &no-l
DUP #80 NEQ ?&no-r .selection/from LDZ2 INC2 select-from &no-r DUP #80 NEQ ?&no-r select-right &no-r
DUP #44 NEQ ?&no-sl .selection/to LDZ2 #0001 SUB2 select-to &no-sl DUP #44 NEQ ?&no-sl .selection/to LDZ2 #0001 SUB2 select-to &no-sl
DUP #84 NEQ ?&no-sr .selection/to LDZ2 INC2 select-to &no-sr DUP #84 NEQ ?&no-sr .selection/to LDZ2 INC2 select-to &no-sr
POP POP
@ -195,9 +198,9 @@ BRK
@erase-selection ( -- ) @erase-selection ( -- )
.selection/from LDZ2 get-eof .selection/length LDZ2 msfl .selection/from LDZ2 get-eof .selection/length LDZ2
JMP2r !msfl
@delete ( -- ) @delete ( -- )
@ -214,15 +217,15 @@ JMP2r
@get-eof ( -- addr* ) @get-eof ( -- addr* )
get-page scap get-page
JMP2r !scap
@cut-char ( addr* -- ) @cut-char ( addr* -- )
get-eof #0001 msfl get-eof #0001
JMP2r !msfl
( (
@|selection ) @|selection )
@ -265,6 +268,24 @@ JMP2r
!redraw !redraw
@select-left ( -- )
.selection/length LDZ2 #0000 EQU2 ?&no-block
.selection/from LDZ2 !select-from
&no-block
.selection/from LDZ2 #0001 SUB2
!select-from
@select-right ( -- )
.selection/length LDZ2 #0000 EQU2 ?&no-block
.selection/to LDZ2 !select-from
&no-block
.selection/from LDZ2 INC2
!select-from
@is-selected ( addr* -- f ) @is-selected ( addr* -- f )
DUP2 .selection/from LDZ2 LTH2 ?&false DUP2 .selection/from LDZ2 LTH2 ?&false
@ -421,7 +442,7 @@ JMP2r
@get-page ( -- addr* ) @get-page ( -- addr* )
;mem #00 .page LDZ #2000 MUL2 ADD2 ;mem #00 .page LDZ #d0 SFT2 ADD2
JMP2r JMP2r
@ -455,22 +476,13 @@ JMP2r
( (
@|drawing ) @|drawing )
@redraw ( -- )
#0000 .Screen/x DEO2
#0018 .Screen/y DEO2
#80 .Screen/pixel DEO
draw-note
JMP2r
@draw-header ( -- ) @draw-header ( -- )
( a ) ( a )
#0000 #0000
DUP2 .Screen/x DEO2 DUP2 .Screen/x DEO2
.Screen/y DEO2 .Screen/y DEO2
#15 .Screen/auto DEO [ LIT2 15 -Screen/auto ] DEO
;bar-icn/a .Screen/addr DEO2 ;bar-icn/a .Screen/addr DEO2
[ LIT2 01 -Screen/sprite ] DEO [ LIT2 01 -Screen/sprite ] DEO
( close ) ( close )
@ -488,11 +500,11 @@ JMP2r
[ LIT2 01 -Screen/sprite ] DEOk DEO [ LIT2 01 -Screen/sprite ] DEOk DEO
( title ) ( title )
#004b .Screen/x DEO2 #004b .Screen/x DEO2
#86 .Screen/auto DEO [ LIT2 86 -Screen/auto ] DEO
;title-icn .Screen/addr DEO2 ;title-icn .Screen/addr DEO2
[ LIT2 01 -Screen/sprite ] DEOk DEO [ LIT2 01 -Screen/sprite ] DEOk DEO
( line ) ( line )
#d2 .Screen/auto DEO [ LIT2 d2 -Screen/auto ] DEO
#0000 .Screen/x DEO2 #0000 .Screen/x DEO2
#0010 .Screen/y DEO2 #0010 .Screen/y DEO2
;line-icn .Screen/addr DEO2 ;line-icn .Screen/addr DEO2
@ -503,9 +515,15 @@ JMP2r
JMP2r JMP2r
@redraw ( -- )
#0000 .Screen/x DEO2
#0018 .Screen/y DEO2
[ LIT2 80 -Screen/pixel ] DEO
@draw-note ( -- ) @draw-note ( -- )
#15 .Screen/auto DEO [ LIT2 15 -Screen/auto ] DEO
#0008 .Screen/x DEO2 #0008 .Screen/x DEO2
#0018 .Screen/y DEO2 #0018 .Screen/y DEO2
get-page get-page
@ -531,13 +549,13 @@ JMP2r
.Screen/height DEI2 #0020 GTH2 ?&visible .Screen/height DEI2 #0020 GTH2 ?&visible
JMP2r JMP2r
&visible &visible
#26 .Screen/auto DEO [ LIT2 26 -Screen/auto ] DEO
#0000 .Screen/x DEO2 #0000 .Screen/x DEO2
.Screen/height DEI2 #0020 SUB2 .Screen/y DEO2 .Screen/height DEI2 #0020 SUB2 .Screen/y DEO2
;page-icn .Screen/addr DEO2 ;page-icn .Screen/addr DEO2
[ LIT2 01 -Screen/sprite ] DEOk DEOk DEOk DEO [ LIT2 01 -Screen/sprite ] DEOk DEOk DEOk DEO
( across ) ( across )
#01 .Screen/auto DEO [ LIT2 01 -Screen/auto ] DEO
#0018 .Screen/x DEO2 #0018 .Screen/x DEO2
.Screen/height DEI2 #0008 SUB2 .Screen/y DEO2 .Screen/height DEI2 #0008 SUB2 .Screen/y DEO2
;page-icn/bottom .Screen/addr DEO2 ;page-icn/bottom .Screen/addr DEO2
@ -546,7 +564,7 @@ JMP2r
INC DUP ?&l INC DUP ?&l
POP POP
( page number ) ( page number )
#15 .Screen/auto DEO [ LIT2 15 -Screen/auto ] DEO
.Screen/width DEI2 #01 SFT2 #0003 SUB2 .Screen/x DEO2 .Screen/width DEI2 #01 SFT2 #0003 SUB2 .Screen/x DEO2
.Screen/height DEI2 #0020 SUB2 .Screen/y DEO2 .Screen/height DEI2 #0020 SUB2 .Screen/y DEO2
#0011 .page LDZ ADD #50 SFT2 ;font/glyphs ADD2 .Screen/addr DEO2 #0011 .page LDZ ADD #50 SFT2 ;font/glyphs ADD2 .Screen/addr DEO2
@ -788,9 +806,7 @@ JMP2r
0040 4040 4040 4040 4040 4040 4040 0000 0000 0000 0000 0000 0000 0000 0000 0000 0040 4040 4040 4040 4040 4040 4040 0000 0000 0000 0000 0000 0000 0000 0000 0000
0040 2020 2020 2010 2020 2020 2040 0000 0000 0000 0000 0000 0000 0000 0000 0000 0040 2020 2020 2010 2020 2020 2040 0000 0000 0000 0000 0000 0000 0000 0000 0000
0000 0068 b000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0068 b000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 00ff 0000 0000 0000 0000 ffff ffff ffff ffff ] 0000 0000 0000 0000 0000 0000 0000 00ff 0000 0000 0000 0000 ffff ffff ffff ffff ] $1
$1
@mem ( placeholder ) @mem ( placeholder )
"Keep 20 "up 20 "to 20 "eight 20 "pages 20 "of 20 "notes 20 "in 20 "the 20 "Note 20 "Pad. 20 "Keep 20 "up 20 "to 20 "eight 20 "pages 20 "of 20 "notes 20 "in 20 "the 20 "Note 20 "Pad. 20