From 8fa3ef3097005c164cb32df8e981730f44b6dd5a Mon Sep 17 00:00:00 2001 From: neauoire Date: Tue, 19 Dec 2023 10:01:49 -0800 Subject: [PATCH] Starting flipping sprites --- src/nasu.tal | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/src/nasu.tal b/src/nasu.tal index 8fd17d3..0d83a83 100644 --- a/src/nasu.tal +++ b/src/nasu.tal @@ -87,7 +87,7 @@ BRK 00 00 =file-save-mono "SaveMono $1 01 "p =save-theme "SaveTheme $1 01 "q =exit "Exit $1 - 07 "Edit $1 + 09 "Edit $1 01 "c =edit-copy-chr "Copy $1 05 "C =edit-copy-icn "CopyMono $1 01 "v =edit-paste "Paste $1 @@ -95,6 +95,8 @@ BRK 00 08 =edit-erase "Erase $1 00 "i =edit-invert "Invert $1 00 "c =edit-colorize "Colorize $1 + 00 00 =edit-flipx "Horizontal $1 + 00 00 =edit-flipy "Veritcal $1 01 "View $1 02 00 =toggle-zoom "Zoom $1 0a "Move $1 @@ -534,6 +536,18 @@ JMP2r @filter-colorize ( x* y* -- ) OVR2 OVR2 get-pixel INC #03 AND !put-pixel +@filter-flipx ( x* y* -- ) + + OVR2 + ( ) [ LIT2 00 -selection/x1 ] LDZ #30 SFT2 + ( ) [ LIT2 00 -selection/x2 ] LDZ INC #30 SFT2 OVR2 SUB2 #01 SFT2 + ( ) ADD2 LTH2 ?{ POP2 POP2 JMP2r } + #02 !put-pixel + +@filter-flipy ( x* y* -- ) + POP2 POP2 + JMP2r + ( @|map ) @@ -1371,6 +1385,19 @@ JMP2r !redraw +@edit-flipx ( -- ) + ;filter-flipx filter + #01 .state/changed STZ draw-state + +!redraw + +@edit-flipy ( -- ) + ;filter-flipy filter + #01 .state/changed STZ draw-state + +!redraw + + @ ( short* -- ) SWP /b &b ( -- )