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