Added memory helpers

This commit is contained in:
Devine Lu Linvega 2023-04-26 22:06:09 -07:00
parent ae2b25044d
commit 2c24b57a67
1 changed files with 20 additions and 10 deletions

View File

@ -8,8 +8,9 @@
( TODOs:
> Show blinker on last character
> Mouse2 select word
> Page memory mapping
> Always select end of note on change )
> Always select end of note on change
> Up and down arrows
> Display non ascii character as blocks )
|0000
@ -32,7 +33,7 @@
;on-frame .Screen/vector DEO2
;on-control .Controller/vector DEO2
( init )
;mem select-from
get-page select-from
draw-header
draw-note
@ -180,7 +181,7 @@ BRK
!select-reset
&no-block
.selection/from LDZ2 ;mem NEQ2 [ JMP JMP2r ]
.selection/from LDZ2 get-page NEQ2 [ JMP JMP2r ]
.selection/from LDZ2 #0001 SUB2
DUP2 cut-char
@ -208,7 +209,7 @@ JMP2r
@get-eof ( -- addr* )
;mem scap
get-page scap
JMP2r
@ -229,7 +230,7 @@ JMP2r
@select-from ( addr* -- )
( min ) ;mem GTH2k [ JMP SWP2 POP2 ]
( min ) get-page GTH2k [ JMP SWP2 POP2 ]
( max ) get-eof #0001 SUB2 LTH2k [ JMP SWP2 POP2 ]
DUP2 .selection/from STZ2
@ -251,8 +252,9 @@ JMP2r
@select-all ( -- )
;mem .selection/from STZ2
;mem scap .selection/to STZ2
get-page
DUP2 .selection/from STZ2
scap .selection/to STZ2
.selection/to LDZ2 .selection/from LDZ2 SUB2 .selection/length STZ2
@ -372,7 +374,7 @@ JMP2r
#0018 .Screen/y DEO2
( walk to line )
.Mouse/y DEI2 pos-to-line ,&line STR
;mem
get-page
&walk-line
.Screen/y DEI2 pos-to-line [ LIT &line $1 ] EQU ?&end-line
walk-char POP
@ -421,6 +423,12 @@ JMP2r
JMP2r
@get-page ( -- addr* )
;mem #00 .page LDZ #2000 MUL2 ADD2
JMP2r
(
@|drawing )
@ -477,7 +485,7 @@ JMP2r
#15 .Screen/auto DEO
#0008 .Screen/x DEO2
#0018 .Screen/y DEO2
;mem #00 .page LDZ #2000 MUL2 ADD2
get-page
&while
( draw char )
LDAk #20 SUB #00 SWP #50 SFT2 ;font/glyphs ADD2 .Screen/addr DEO2
@ -765,3 +773,5 @@ $1 &end
|a000 "The 20 "other 20 "page.
|c000 "The 20 "third 20 "page.