From 04e474c01d7f4b5d6dab7912ba35bb3e10facaad Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Thu, 27 Apr 2023 10:32:29 -0700 Subject: [PATCH] (notepad) Abstracted change page --- gui/notepad/notepad.tal | 38 ++++++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/gui/notepad/notepad.tal b/gui/notepad/notepad.tal index be8bea9..b4f1eca 100644 --- a/gui/notepad/notepad.tal +++ b/gui/notepad/notepad.tal @@ -31,15 +31,15 @@ ;on-mouse-body .Mouse/vector DEO2 ;on-frame .Screen/vector DEO2 ;on-control .Controller/vector DEO2 + ( initialize memory ) #0801 &l #00 OVR #d0 SFT2 ;mem ADD2 STH2 #20 STH2r STA INC GTHk ?&l POP2 - get-page select-from draw-header - draw-note + #00 change-page BRK @@ -51,6 +51,9 @@ BRK 01 ( icon ) 83 =appicon +( +@|vectors ) + @on-control ( -> ) .Controller/key DEI .Controller/button DEI @@ -327,6 +330,20 @@ JMP2r ( @|file ) +@file-new ( -- ) + +JMP2r + +@file-save ( -- ) + +JMP2r + +@file-load ( -- ) + +JMP2r + + @notepad-txt ".notepad $1 + @file-size ( path* -- size* ) .File/name DEO2 @@ -386,7 +403,7 @@ JMP2r !file-inject -@snarf-txt ".snarf $1 + @snarf-txt ".snarf $1 ( @|core ) @@ -405,19 +422,24 @@ JMP2r JMP2r -@prev-page ( -- ) +@change-page ( id -- ) - .page LDZ #01 SUB #07 AND .page STZ + .page STZ get-page scap #0001 SUB2 !select-from +@prev-page ( -- ) + + .page LDZ #01 SUB #07 AND + +!change-page + @next-page ( -- ) - .page LDZ INC #07 AND .page STZ - get-page scap #0001 SUB2 + .page LDZ INC #07 AND -!select-from +!change-page @pos-to-line ( y* -- line )