@@ 44,6 44,7 @@
%HOR { #20 } %VER { #10 }
%WIDTH { HOR TOS #0008 ** }
%LENGTH { HOR TOS VER TOS ** #0010 ** }
+%DATA-CLIP { #f000 } ( copy/paste )
%BANK { #2000 }
%BANK-TEMP { #4000 }
@@ 52,6 53,7 @@
%ADD-POSITIONS { ROT2 ++ ROT2 ROT2 ++ SWP2 }
%RELEASE-MOUSE { #00 .Mouse/state DEO }
%RESET-SELECTION { .selection/x1 LDZ2 .selection/x2 STZ2 }
+%GET-ADDR { TOS HOR TOS ** ROT TOS ++ #0010 ** BANK ++ }
%SET-STATE { #01 .state/changed STZ ;draw-state JSR2 }
%RESET-STATE { #00 .state/changed STZ ;draw-state JSR2 }
@@ 386,7 388,7 @@ BRK
BRK &no-select-mouse1
DUP2 #0110 !! ,&no-select-mouse2 JCN ( select copy )
POP2
- ;get-tile-addr JSR2 .settings/focus LDZ2 SWP2 ;op-copy-tile JSR2
+ ;get-tile-addr JSR2 .settings/focus LDZ2 SWP2 ;copy-tile JSR2
SET-STATE
;redraw JSR2
BRK &no-select-mouse2
@@ 687,21 689,6 @@ RTN
RTN
-@op-copy-tile ( from* to* -- )
-
- STH2 STH2
- #00 #10
- &loop
- ( get )
- OVR TOS DUP2 STH2kr ++ LDA
- ( put )
- ROT ROT SWP2r STH2kr SWP2r ++ STA
- INCR LTHk ,&loop JCN
- POP2
- POP2r POP2r
-
-RTN
-
@redraw ( -- )
;draw-toolview JSR2
@@ 1139,6 1126,21 @@ RTN
( etc )
+@copy-tile ( src* dst* -- )
+
+ STH2 STH2
+ #10 #00
+ &loop
+ ( get )
+ DUP TOS DUP2 STH2kr ++ LDA
+ ( put )
+ ROT ROT SWP2r STH2kr SWP2r ++ STA
+ #01 + GTHk ,&loop JCN
+ POP2
+ POP2r POP2r
+
+RTN
+
@erase-selection ( -- )
RTN
@@ 1252,6 1254,23 @@ RTN
@copy-snarf ( -- )
+ ( open ) DATA-CLIP STH2
+ .selection/y2 LDZ #01 + .selection/y1 LDZ
+ &ver
+ .selection/x2 LDZ #01 + .selection/x1 LDZ
+ &hor
+ ( write char ) GET-ITER GET-ADDR STH2kr ;copy-tile JSR2
+ ( incr index ) LIT2r 0010 ADD2r
+ #01 + GTHk ,&hor JCN
+ POP2
+ #01 + GTHk ,&ver JCN
+ POP2
+ ( close ) #00 STH2kr STA
+
+ ;snarf-txt .File/name DEO2
+ STH2r DATA-CLIP -- .File/length DEO2
+ DATA-CLIP .File/save DEO2
+
RTN
@paste-snarf ( -- )