(notepad) Abstracted change page

This commit is contained in:
Devine Lu Linvega 2023-04-27 10:32:29 -07:00
parent b461404bbf
commit 04e474c01d
1 changed files with 30 additions and 8 deletions

View File

@ -31,15 +31,15 @@
;on-mouse-body .Mouse/vector DEO2 ;on-mouse-body .Mouse/vector DEO2
;on-frame .Screen/vector DEO2 ;on-frame .Screen/vector DEO2
;on-control .Controller/vector DEO2 ;on-control .Controller/vector DEO2
( initialize memory ) ( initialize memory )
#0801 #0801
&l &l
#00 OVR #d0 SFT2 ;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
draw-header draw-header
draw-note #00 change-page
BRK BRK
@ -51,6 +51,9 @@ BRK
01 01
( icon ) 83 =appicon ( icon ) 83 =appicon
(
@|vectors )
@on-control ( -> ) @on-control ( -> )
.Controller/key DEI .Controller/button DEI .Controller/key DEI .Controller/button DEI
@ -327,6 +330,20 @@ JMP2r
( (
@|file ) @|file )
@file-new ( -- )
JMP2r
@file-save ( -- )
JMP2r
@file-load ( -- )
JMP2r
@notepad-txt ".notepad $1
@file-size ( path* -- size* ) @file-size ( path* -- size* )
.File/name DEO2 .File/name DEO2
@ -386,7 +403,7 @@ JMP2r
!file-inject !file-inject
@snarf-txt ".snarf $1 @snarf-txt ".snarf $1
( (
@|core ) @|core )
@ -405,19 +422,24 @@ JMP2r
JMP2r JMP2r
@prev-page ( -- ) @change-page ( id -- )
.page LDZ #01 SUB #07 AND .page STZ .page STZ
get-page scap #0001 SUB2 get-page scap #0001 SUB2
!select-from !select-from
@prev-page ( -- )
.page LDZ #01 SUB #07 AND
!change-page
@next-page ( -- ) @next-page ( -- )
.page LDZ INC #07 AND .page STZ .page LDZ INC #07 AND
get-page scap #0001 SUB2
!select-from !change-page
@pos-to-line ( y* -- line ) @pos-to-line ( y* -- line )