diff --git a/src/nasu.tal b/src/nasu.tal index ac0b22b..6828b32 100644 --- a/src/nasu.tal +++ b/src/nasu.tal @@ -24,20 +24,20 @@ @tileview &x1 $2 &y1 $2 &x2 $2 &y2 $2 @nametableview &x $2 &y $2 &x2 $2 &y2 $2 -|100 ( -> ) +|100 @on-reset ( -> ) - ( meta ) + ( | meta ) ;meta #06 DEO2 - ( theme ) + ( | theme ) #970f .System/r DEO2 #7d0f .System/g DEO2 #dc0f .System/b DEO2 - ( size ) + ( | size ) #012e .Screen/width DEO2 #00f0 .Screen/height DEO2 - ( vectors ) + ( | vectors ) ;on-console .Console/vector DEO2 - ( set defaults ) + ( | set defaults ) #0108 .frame/width STZ2 #00c8 .frame/height STZ2 #01 .settings/depth STZ @@ -47,7 +47,7 @@ #01 .settings/tool STZ #00 .settings/brush STZ set-focus - ( place ) + ( | place ) .Screen/width DEI2 #01 SFT2 .frame/width LDZ2 #01 SFT2 SUB2 #001b .frame/width LDZ2 .frame/height LDZ2 ;frame .frame/x1 LDZ2 #0001 SUB2 .frame/y1 LDZ2 #0038 ADD2 #007f DUP2 ;tileview .frame/x1 LDZ2 #0089 ADD2 .frame/y1 LDZ2 #0038 ADD2 #007f DUP2 ;nametableview @@ -57,10 +57,10 @@ .frame/x1 LDZ2 #008f ADD2 .frame/y1 LDZ2 #001f #002f ;blendview .frame/x1 LDZ2 #00bf ADD2 .frame/y1 LDZ2 #0048 #002f ;dataview .tileview/x1 LDZ2 .tileview/y2 LDZ2 #0008 ADD2 .frame/width LDZ2 #0008 ;toolview - ( static drawings ) + ( | static drawings ) load-theme draw-once - ( begin ) + ( | begin ) file-new draw-menu untrap @@ -71,7 +71,7 @@ BRK ( name ) "Nasu 0a ( details ) "A 20 "Sprite 20 "Editor 0a ( author ) "By 20 "Hundred 20 "Rabbits 0a - ( date ) "30 20 "Jun 20 "2024 00 + ( date ) "16 20 "Jul 20 "2024 00 01 ( icon ) 83 =appicon @@ -138,7 +138,7 @@ JMP2r ;on-frame-trap .Screen/vector DEO2 ;on-button-trap .Controller/vector DEO2 ;on-mouse-trap .Mouse/vector DEO2 - ( clear cursor ) + ( | clear cursor ) #40 draw-cursor ( release mouse ) [ LIT2 00 -Mouse/state ] DEO @@ -147,17 +147,17 @@ JMP2r @on-console ( -> ) #00 draw-filepath - ( start ) + ( | start ) [ LIT &listening $1 ] ?&no-start #01 ,&listening STR ;filepath #0040 mclr &no-start - ( end ) + ( | end ) .Console/read DEI DUPk #1f GTH SWP #7f LTH AND ?&no-end #00 ,&listening STR &no-end - ( capture ) + ( | capture ) capture-trap #01 draw-filepath @@ -187,7 +187,7 @@ JMP2r @on-mouse-trap ( -> ) - ( release trap on touch ) + ( | release trap on touch ) .Mouse/state DEI ?&release BRK &release untrap @@ -232,7 +232,7 @@ BRK .Mouse/x DEI2 .Mouse/y DEI2 .preview within-rect ?on-touch-preview .Mouse/x DEI2 .Mouse/y DEI2 .zoomview within-rect ?on-touch-zoomview &no-touch - ( release-record ) + ( | release-record ) #0000 .Mouse/state DEO .cursor/last STZ BRK @@ -241,11 +241,11 @@ BRK .Mouse/x DEI2 .tileview/x1 LDZ2 SUB2 .Mouse/y DEI2 .tileview/y1 LDZ2 SUB2 - ( test ) + ( | test ) .settings/tool LDZ #02 EQU ?&zoom .settings/zoom LDZ #01 EQU ?&zoomed .settings/tool LDZ #01 EQU ?&select - ( paint ) + ( | paint ) .settings/color LDZ .Mouse/state DEI #01 EQU MUL put-pixel #01 .state/changed STZ draw-state @@ -290,7 +290,7 @@ BRK @on-touch-nametable ( -> ) - ( id ) + ( | id ) .Mouse/y DEI2 .nametableview/y LDZ2 SUB2 #43 SFT2 .Mouse/x DEI2 .nametableview/x LDZ2 SUB2 #03 SFT2 ADD2 #0003 MUL2 ;nametable ADD2 STH2 @@ -379,7 +379,7 @@ BRK .Mouse/x DEI2 .blendview/x1 LDZ2 SUB2 #03 SFT2 NIP .Mouse/y DEI2 .blendview/y1 LDZ2 SUB2 #03 SFT2 NIP #20 SFT ADD [ #0f GTHk NIP ] ?&no-set DUP .settings/blend STHk LDZ #b0 AND ADD STHr STZ !&end &no-set - ( buttons ) + ( | buttons ) #03 AND [ #02 NEQk NIP ] ?&no-ver .settings/blend STHk LDZ #20 EOR STHr STZ &no-ver [ #03 NEQk NIP ] ?&no-hor .settings/blend STHk LDZ #10 EOR STHr STZ &no-hor @@ -387,7 +387,7 @@ BRK POP draw-blendview draw-preview - ( release mouse ) [ LIT2 00 -Mouse/state ] DEO + ( | release mouse ) [ LIT2 00 -Mouse/state ] DEO BRK @@ -420,7 +420,7 @@ BRK .selection/y1 LDZ #0f STHk LTH ?&ok-limity1 STHkr .selection/y1 STZ &ok-limity1 POPr .selection/x2 LDZ #0f STHk LTH ?&ok-limitx2 STHkr .selection/x2 STZ &ok-limitx2 POPr .selection/y2 LDZ #0f STHk LTH ?&ok-limity2 STHkr .selection/y2 STZ &ok-limity2 POPr - ( invert ) + ( | invert ) .selection/x2 LDZ .selection/x1 LDZ STHk GTH ?&ok-flipx STHkr .selection/x2 STZ &ok-flipx POPr .selection/y2 LDZ .selection/y1 LDZ STHk GTH ?&ok-flipy STHkr .selection/y2 STZ &ok-flipy POPr @@ -469,7 +469,7 @@ JMP2r DUP .selection/x2 LDZ ADD #0f AND .selection/x2 STZ .selection/x1 LDZ ADD #0f AND .selection/x1 STZ - ( clamp ) + ( | clamp ) .selection/x2 LDZ .selection/x1 LDZ GTH ?&no-x .selection/x1 LDZ .selection/x2 STZ &no-x @@ -479,18 +479,18 @@ JMP2r .selection/x1 LDZ #30 SFT .selection/y1 LDZ #30 SFT set-selection-zoom - ( focus ) + ( | focus ) set-focus !redraw @mod-selection-zoom ( x y -- ) - ( set zoom ) + ( | set zoom ) .selection/zy LDZ ADD SWP .selection/zx LDZ ADD SWP set-selection-zoom - ( set from ) + ( | set from ) .selection/zx LDZ #03 SFT .selection/zy LDZ #03 SFT set-selection-from @@ -502,14 +502,14 @@ JMP2r .selection/y2 LDZ ADD #0f AND .selection/y2 STZ .selection/x2 LDZ ADD #0f AND .selection/x2 STZ - ( clamp ) + ( | clamp ) .selection/x2 LDZ .selection/x1 LDZ GTH ?&no-x .selection/x1 LDZ .selection/x2 STZ &no-x .selection/y2 LDZ .selection/y1 LDZ GTH ?&no-y .selection/y1 LDZ .selection/y2 STZ &no-y - ( focus ) + ( | focus ) set-focus !redraw @@ -544,7 +544,7 @@ JMP2r OVR2 OVR2 get-pixel INC #03 AND !put-pixel @filter-flipx ( x* y* -- ) - ( ignore second half ) + ( | ignore second half ) OVR2 ( ) [ LIT2 00 -selection/x1 ] LDZ #30 SFT2 ( ) [ LIT2 00 -selection/x2 ] LDZ INC #30 SFT2 OVR2 SUB2 #01 SFT2 @@ -559,12 +559,12 @@ JMP2r ,&x1 LDR2 STH2r [ LIT &c2 $1 ] !put-pixel @filter-flipy ( x* y* -- ) - ( ignore second half ) + ( | ignore second half ) DUP2 ( ) [ LIT2 00 -selection/y1 ] LDZ #30 SFT2 ( ) [ LIT2 00 -selection/y2 ] LDZ INC #30 SFT2 OVR2 SUB2 #01 SFT2 ( ) ADD2 LTH2 ?{ POP2 POP2 JMP2r } - ( write ) + ( | write ) DUP2 ,&y1 STR2 [ LIT2 00 -selection/y2 ] LDZ INC #30 SFT2 #0001 SUB2 SWP2 SUB2 [ LIT2 00 -selection/y1 ] LDZ #30 SFT2 ADD2 ,&y2 STR2 @@ -652,10 +652,10 @@ JMP2r STH2 #0800 &loop - ( ch1 ) + ( | ch1 ) #00 OVR STH2kr ADD2 LDAk rol ROT ROT STA - ( ch2 ) + ( | ch2 ) #00 OVR STH2kr #0008 ADD2 ADD2 LDAk rol ROT ROT STA INC GTHk ?&loop @@ -669,10 +669,10 @@ JMP2r STH2 #0800 &loop - ( ch1 ) + ( | ch1 ) #00 OVR STH2kr ADD2 LDAk ror ROT ROT STA - ( ch2 ) + ( | ch2 ) #00 OVR STH2kr #0008 ADD2 ADD2 LDAk ror ROT ROT STA INC GTHk ?&loop @@ -721,7 +721,7 @@ JMP2r .settings/zoom LDZ ?draw-tileview-zoom .tileview/x1 LDZ2 .Screen/x DEO2 .tileview/y1 LDZ2 .Screen/y DEO2 - ( draw tiles ) + ( | draw tiles ) ;spritesheet .Screen/addr DEO2 #f6 .Screen/auto DEO #1000 @@ -729,7 +729,7 @@ JMP2r #81 .Screen/sprite DEO INC GTHk ?&loop POP2 - ( draw selection ) + ( | draw selection ) #06 .selection/x2 LDZ .selection/x1 LDZ SUB #40 SFT ADD .Screen/auto DEO #00 .selection/x1 LDZ #30 SFT2 .tileview/x1 LDZ2 ADD2 .Screen/x DEO2 #00 .selection/y1 LDZ #30 SFT2 .tileview/y1 LDZ2 ADD2 .Screen/y DEO2 @@ -741,7 +741,7 @@ JMP2r INC GTHk ?&loop-sel POP2 #01 .Screen/auto DEO - ( draw selection size ) + ( | draw selection size ) .selection/x2 LDZ .selection/x1 LDZ SUB #02 LTH ?&no-label .selection/y2 LDZ #0f EQU ?&no-label #00 .selection/x1 LDZ #30 SFT2 .tileview/x1 LDZ2 ADD2 .Screen/x DEO2 @@ -782,14 +782,14 @@ JMP2r POP2 INC GTHk ?&ver POP2 - ( guide hor ) + ( | guide hor ) #0007 .selection/zy LDZ SUB #0007 AND2 #30 SFT2 #0001 SUB2 #0008 ADD2 STH2 .tileview/x1 LDZ2 .tileview/y1 LDZ2 STH2kr ADD2 #0a line-hor-dashed .selection/zy LDZ #07 AND #00 EQU ?&skip-hor .tileview/x1 LDZ2 .tileview/y1 LDZ2 STH2kr ADD2 #0040 ADD2 #0a line-hor-dashed &skip-hor POP2r - ( guide ver ) + ( | guide ver ) #0007 .selection/zx LDZ SUB #0007 AND2 #30 SFT2 #0001 SUB2 #0008 ADD2 STH2 .tileview/x1 LDZ2 STH2kr ADD2 .tileview/y1 LDZ2 #0a line-ver-dashed .selection/zx LDZ #07 AND #00 EQU ?&skip-ver @@ -834,11 +834,11 @@ JMP2r @get-pixel ( x* y* -- color ) - ( channel 1 ) + ( | channel 1 ) OVR2 SWP2 get-pixel-addr [ STH2k ] LDA ROT ROT NIP #07 AND [ STHk ] #07 SWP SUB SFT #01 AND - ( channel 2 ) + ( | channel 2 ) [ STHr ] [ STH2r ] #0008 ADD2 LDA SWP #07 SWP SUB SFT #01 AND DUP ADD @@ -848,11 +848,11 @@ JMP2r @get-pixel-addr ( x* y* -- addr* ) - ( clamp ) + ( | clamp ) #007f AND2 SWP2 #007f AND2 SWP2 - ( get row ) + ( | get row ) DUP2 #0007 AND2 - ( get tile ) + ( | get tile ) SWP2 #83 SFT2 ADD2 SWP2 #43 SFT2 ADD2 ;spritesheet ADD2 @@ -916,12 +916,12 @@ JMP2r INC GTHk ?&ver POP2 - ( frame ) + ( | frame ) .zoomview/x1 LDZ2 .Screen/x DEO2 .zoomview/y1 LDZ2 .Screen/y DEO2 #0404 ;frame2-chr draw-frame - ( label ) + ( | label ) #01 .Screen/auto DEO .zoomview/y2 LDZ2 #0008 SUB2 .Screen/y DEO2 .zoomview/x1 LDZ2 .Screen/x DEO2 @@ -934,7 +934,7 @@ JMP2r @draw-preview ( -- ) - ( stash address ) + ( | stash address ) .settings/focus LDZ2 STH2k .Screen/addr DEO2 #0400 &ver @@ -942,9 +942,9 @@ JMP2r #0400 &hor #00 OVR #30 SFT .preview/x1 LDZ2 ADD2 .Screen/x DEO2 - ( get x,y ) + ( | get x,y ) OVR2 NIP OVR SWP - ( check if within ratio ) + ( | check if within ratio ) .settings/ratio LDZ #0f AND LTH STH .settings/ratio LDZ #04 SFT LTH STHr #0101 NEQ2 ?&outside @@ -962,7 +962,7 @@ JMP2r POP2 POP2r - ( label ) + ( | label ) .preview/x1 LDZ2 .Screen/x DEO2 .preview/y2 LDZ2 #0008 SUB2 .Screen/y DEO2 #03 ;draw-chr/color STA @@ -1020,19 +1020,19 @@ JMP2r POP2 #01 .Screen/auto DEO - ( label ) + ( | label ) .blendview/x1 LDZ2 .Screen/x DEO2 .blendview/y2 LDZ2 #0008 SUB2 .Screen/y DEO2 #03 ;draw-chr/color STA ( get blending ) .settings/blend LDZ draw-byte - ( y ) + ( | y ) .blendview/x1 LDZ2 #0010 ADD2 .Screen/x DEO2 .settings/blend LDZ #20 AND #00 NEQ STH ;arrow-ver-icns #00 STHkr #30 SFT2 ADD2 .Screen/addr DEO2 #02 STHr SUB .Screen/sprite DEO - ( x ) + ( | x ) .blendview/x1 LDZ2 #0018 ADD2 .Screen/x DEO2 .settings/blend LDZ #10 AND #00 NEQ STH ;arrow-hor-icns #00 STHkr #30 SFT2 ADD2 .Screen/addr DEO2 @@ -1042,7 +1042,7 @@ JMP2r @draw-dataview ( -- ) - ( position ) + ( | position ) .dataview/x1 LDZ2 .Screen/x DEO2 .dataview/y2 LDZ2 #0008 SUB2 .Screen/y DEO2 #03 ;draw-chr/color STA @@ -1057,7 +1057,7 @@ JMP2r .Screen/x DEI2k #000c ADD2 ROT DEO2 #02 ;draw-chr/color STA ( ch2 ) #0008 ADD2 LDA2 draw-short - ( skip line ) + ( | skip line ) .dataview/x1 LDZ2 .Screen/x DEO2 draw-lb INC GTHk ?&loop @@ -1068,7 +1068,7 @@ JMP2r @draw-toolview ( -- ) .toolview/y1 LDZ2 .Screen/y DEO2 - ( colors ) + ( | colors ) .toolview/x1 LDZ2 .Screen/x DEO2 ;circle-icns #00 .settings/color LDZ #01 EQU #30 SFT2 ADD2 .Screen/addr DEO2 #01 .Screen/sprite DEO @@ -1076,7 +1076,7 @@ JMP2r #02 .Screen/sprite DEO ;circle-icns #00 .settings/color LDZ #03 EQU #30 SFT2 ADD2 .Screen/addr DEO2 #03 .Screen/sprite DEO - ( tools ) + ( | tools ) .Screen/x DEI2k #0008 ADD2 ROT DEO2 ;brush-icn .Screen/addr DEO2 #01 .settings/tool LDZ #00 EQU ADD .Screen/sprite DEO @@ -1084,7 +1084,7 @@ JMP2r #01 .settings/tool LDZ #01 EQU ADD .Screen/sprite DEO ;zoom-icns [ #00 .settings/zoom LDZ #30 SFT2 ADD2 ] .Screen/addr DEO2 #01 .settings/tool LDZ #02 EQU ADD .Screen/sprite DEO - ( file i/o ) + ( | file i/o ) draw-state .toolview/x2 LDZ2 STH2k #0018 SUB2 .Screen/x DEO2 ;load-icn .Screen/addr DEO2 @@ -1092,7 +1092,7 @@ JMP2r STH2r #0020 SUB2 .Screen/x DEO2 ;make-icn .Screen/addr DEO2 #01 .Screen/sprite DEO - ( filepath ) + ( | filepath ) #01 !draw-filepath @@ -1110,12 +1110,12 @@ JMP2r .toolview/x1 LDZ2 #0040 ADD2 .Screen/x DEO2 .toolview/y1 LDZ2 INC2 .Screen/y DEO2 - ( clear ) + ( | clear ) DUP #00 EQU ?clear-filepath ;draw-chr/color STA ;filepath - ( scroll ) + ( | scroll ) DUP2 slen #0013 GTH2 #00 SWP ;filepath slen #0013 SUB2 MUL2 ADD2 draw-str POP2 @@ -1266,9 +1266,9 @@ JMP2r @file-new ( -- ) #00 draw-filepath - ( clear ) + ( | clear ) ;spritesheet #1300 mclr - ( rename to untitled.txt ) + ( | rename to untitled.txt ) ;filepath #0040 mclr ;untitled-txt ;filepath scpy #00 .state/changed STZ draw-state @@ -1277,14 +1277,14 @@ JMP2r @file-open ( -- ) ;filepath is-mono ?file-open-mono - ( clear ) + ( | clear ) ;spritesheet #1300 mclr load-theme - ( spritesheet ) + ( | spritesheet ) ;filepath .File/name DEO2 #1000 .File/length DEO2 ;spritesheet .File/read DEO2 - ( nametable ) + ( | nametable ) ;nametable-ext ;filepath scap #0004 mcpy ;filepath .File/name DEO2 #0300 .File/length DEO2 @@ -1297,9 +1297,9 @@ JMP2r @file-open-mono ( -- ) - ( clear ) + ( | clear ) ;spritesheet #1300 mclr - ( spritesheet ) + ( | spritesheet ) ;filepath .File/name DEO2 #0008 .File/length DEO2 #0000 @@ -1314,12 +1314,12 @@ JMP2r @file-save ( -- ) ;filepath is-mono ?file-save-mono - ( spritesheet ) + ( | spritesheet ) ;filepath .File/name DEO2 #1000 .File/length DEO2 ;spritesheet .File/write DEO2 - ( nametable ) + ( | nametable ) has-nametable #00 EQU ?&no-nametable ;nametable-ext ;filepath scap #0004 mcpy ;filepath .File/name DEO2 @@ -1334,7 +1334,7 @@ JMP2r @file-save-mono ( -- ) - ( spritesheet ) + ( | spritesheet ) ;filepath .File/name DEO2 #0008 .File/length DEO2 #0000 @@ -1467,7 +1467,7 @@ JMP2r @ ( x1 y1 w* h* rect* -- ) STH2 - ( size to rect ) + ( | size to rect ) STH2 STH2 OVR2 STH2r ADD2 OVR2 STH2r ADD2 STH2r DUP2 ROT2 SWP2 #0006 ADD2 STA2