M .gitignore => .gitignore +1 -2
@@ 3,6 3,5 @@
*png
*bmp
/bin
-untitled.chr
-nasu
+*snarf
*.chr=
\ No newline at end of file
M src/nasu.tal => src/nasu.tal +36 -0
@@ 149,6 149,7 @@
.frame/x1 LDZ2 #00c0 ++ .frame/y1 LDZ2 #0048 #0020 SIZE-TO-RECT ;dataview SET-RECT
;untitled-txt ;new-file JSR2
+ ;load-theme JSR2
;redraw JSR2
BRK
@@ 227,6 228,9 @@ BRK
@on-control ( -> )
.Controller/key DEI
+ DUP ( ctrl+p ) #70 ! ,&no-print JCN
+ ;save-theme JSR2
+ POP BRK &no-print
DUP ( ctrl+o ) #6f ! ,&no-open JCN
;load-file JSR2
;redraw JSR2 POP BRK &no-open
@@ 1108,6 1112,38 @@ RTN
RTN
+( theme )
+
+@theme-txt ".theme $1
+
+@load-theme ( -- )
+
+ ;theme-txt .File/name DEO2
+ #0006 .File/length DEO2
+ #fffa .File/load DEO2
+
+ .File/success DEI2 #0006 !! ,&ignore JCN
+ #fffa LDA2 .System/r DEO2
+ #fffc LDA2 .System/g DEO2
+ #fffe LDA2 .System/b DEO2
+ ;redraw JSR2
+ &ignore
+
+RTN
+
+@save-theme ( -- )
+
+ .System/r DEI2 #fffa STA2
+ .System/g DEI2 #fffc STA2
+ .System/b DEI2 #fffe STA2
+ ;theme-txt .File/name DEO2
+ #0006 .File/length DEO2
+ #fffa .File/save DEO2
+
+RTN
+
+( generics )
+
@within-rect ( x* y* rect -- flag )
STH