@@ 33,8 33,10 @@
%STEP8 { #0033 SFT2 }
%SFL { #40 SFT SFT }
+
%MOD { DUP2 / * - }
%MOD2 { OVR2 OVR2 // ** -- }
+%MOD8 { #07 AND }
%TOB { SWP POP } %TOS { #00 SWP }
@@ 99,6 101,7 @@
@dataview [ &x1 $2 &y1 $2 &x2 $2 &y2 $2 ]
@preview [ &x1 $2 &y1 $2 &x2 $2 &y2 $2 ]
@tileview [ &x1 $2 &y1 $2 &x2 $2 &y2 $2 ]
+@zoomview [ &x1 $2 &y1 $2 &x2 $2 &y2 $2 ]
@pointer [ &x $2 &y $2 ]
( program )
@@ 138,7 141,8 @@
.frame/x1 LDZ2 .frame/y1 LDZ2 #0020 #0020 SIZE-TO-RECT ;blendview SET-RECT
.frame/x1 LDZ2 #0030 ++ .frame/y1 LDZ2 #0020 #0020 SIZE-TO-RECT ;preview SET-RECT
.frame/x1 LDZ2 #0060 ++ .frame/y1 LDZ2 #0020 #0020 SIZE-TO-RECT ;colorview SET-RECT
- .frame/x1 LDZ2 #0090 ++ .frame/y1 LDZ2 #0048 #0020 SIZE-TO-RECT ;dataview SET-RECT
+ .frame/x1 LDZ2 #0090 ++ .frame/y1 LDZ2 #0020 #0028 SIZE-TO-RECT ;zoomview SET-RECT
+ .frame/x1 LDZ2 #00c0 ++ .frame/y1 LDZ2 #0048 #0020 SIZE-TO-RECT ;dataview SET-RECT
;filepath1 .File/name DEO2 #2000 .File/length DEO2 BANK .File/load DEO2
@@ 206,6 210,8 @@ BRK
;on-touch-colorview JCN2
.Mouse/x DEI2 .Mouse/y DEI2 .preview ;within-rect JSR2
;on-touch-preview JCN2
+ .Mouse/x DEI2 .Mouse/y DEI2 .zoomview ;within-rect JSR2
+ ;on-touch-zoomview JCN2
BRK
@@ 288,6 294,18 @@ BRK
BRK
+@on-touch-zoomview ( -> )
+
+ .settings/focus LDZ2
+ DUP2 ;op-shiftup JSR2
+ #0008 ++ ;op-shiftup JSR2
+
+ ;redraw JSR2
+
+ RELEASE-MOUSE
+
+BRK
+
@on-touch-blendview ( -> )
.Mouse/x DEI2 .blendview/x1 LDZ2 -- #0008 // TOB
@@ 347,13 365,6 @@ BRK
BRK
-@toggle-depth ( -- )
-
- .settings/selection LDZ
- .settings/depth LDZ #00 = .settings/depth STZ
-
-RTN
-
@shift-memory-left ( addr* -- )
DUP2 LENGTH ++
@@ 416,6 427,7 @@ RTN
;draw-dataview JSR2
;draw-preview JSR2
;draw-tileview JSR2
+ ;draw-zoomview JSR2
RTN
@@ 448,7 460,7 @@ RTN
( channel 1 )
OVR2 SWP2 ,get-addr JSR [ STH2k ] LDA
- ROT ROT TOB #08 MOD [ STHk ]
+ ROT ROT TOB MOD8 [ STHk ]
#07 SWP - SFT #01 AND
( channel 2 )
[ STHr ] [ STH2r ] #0008 ++ LDA SWP
@@ 489,11 501,11 @@ RTN
STH SWP2 TOB
STHr SWP
STH2r SFT #01 AND ,&do-set JCN
- ( mask ) #01 #07 ROT #08 MOD - SFL #ff EOR AND
+ ( mask ) #01 #07 ROT MOD8 - SFL #ff EOR AND
( save ) ROT ROT STA
RTN
&do-set
- ( mask ) #01 #07 ROT #08 MOD - SFL ORA
+ ( mask ) #01 #07 ROT MOD8 - SFL ORA
( save ) ROT ROT STA
RTN
@@ 671,7 683,7 @@ RTN
.dataview/x1 LDZ2 .Screen/x DEO2
OVR #08 * TOS .dataview/y1 LDZ2 ++ .Screen/y DEO2
OVR #02 * TOS .settings/focus LDZ2 ++ LDA2 #23 ;draw-short JSR2
- .dataview/x1 LDZ2 #0028 ++ .Screen/x DEO2
+ .dataview/x1 LDZ2 #0020 ++ .Screen/x DEO2
OVR #02 * TOS .settings/focus LDZ2 ++ #0008 ++ LDA2 #23 ;draw-short JSR2
INCR
LTHk ,&loop JCN
@@ 679,6 691,44 @@ RTN
RTN
+@draw-zoomview ( -- )
+
+ ;bigpixel-icn .Screen/addr DEO2
+ #00 #08
+ &ver
+ OVR #04 * TOS .zoomview/y1 LDZ2 ++ .Screen/y DEO2
+ #00 #08
+ &hor
+ OVR #04 * TOS .zoomview/x1 LDZ2 ++ .Screen/x DEO2
+ ( get pixel )
+ GET-ITERATORS
+ ( ch 1 )
+ TOS .settings/focus LDZ2 ++ [ STH2k ] LDA
+ SWP [ STHk ] #07 SWP - SFT #01 AND
+ ( ch2 )
+ [ STHr ] [ STH2r ] #0008 ++ LDA SWP
+ #07 SWP - SFT #01 AND
+ #02 * +
+ #20 + .Screen/color DEO
+ INCR
+ LTHk ,&hor JCN
+ POP2
+ INCR
+ LTHk ,&ver JCN
+ POP2
+
+ ( effects )
+ .zoomview/y1 LDZ2 #0021 ++ .Screen/y DEO2
+ .zoomview/x1 LDZ2 .Screen/x DEO2
+ ;opshift-icn .Screen/addr DEO2
+ #21 .Screen/color DEO
+
+ .Screen/x DEI2 #0008 ++ .Screen/x DEO2
+ ;oproll-icn .Screen/addr DEO2
+ #21 .Screen/color DEO
+
+RTN
+
@draw-cursor ( -- )
( clear last cursor )
@@ 750,6 800,10 @@ RTN
@moveup_icn 0010 387c fe10 1000
@movedown_icn 0010 1010 fe7c 3810
@halftone_icn aa55 aa55 aa55 aa55
+@bigpixel-icn f0f0 f0f0 0000 0000
+
+@opshift-icn 0010 387c fe10 1000
+@oproll-icn 0008 0c0e 7f0e 0c08
@name-icn 1054 28c6 2854 1000
@save-icn fe82 8282 848a f400