~rabbits/nasu

b0c2a7ac6d536fb96fd543b7cee37a0bf25ee4c7 — neauoire 1 year, 8 months ago fadeaa6
Added ctrl shortcuts
1 files changed, 29 insertions(+), 5 deletions(-)

M nasu.tal
M nasu.tal => nasu.tal +29 -5
@@ 8,6 8,10 @@
	right-click - remove pixel, clone tile
	1 2 3 - select color
	q w - select tool
	ctrl+n - clear
	ctrl+r - rename
	ctrl+o - load
	ctrl+s - save
)

%+  { ADD } %-   { SUB }  %*  { MUL } %/   { DIV }


@@ 35,9 39,6 @@
%TOGGLE { DUP LDZ #00 = SWP STZ }
%GET-ITERATORS { SWP2k POP SWP POP } 

%DEBUG  { .Console/byte DEO #0a .Console/char DEO }
%DEBUG2 { .Console/short DEO2 #0a .Console/char DEO }

%BANK { #2000 }
%GET-COLOR     { .settings/color LDZ STHk #02 / + DEI #01 STHr #01 AND - #04 * SFT #0f AND }
%GET-POSITION  { .settings/focus LDZ2 BANK -- DUP2 #0002 // WIDTH MOD2 SWP2 WIDTH #0002 ** // #0008 ** }


@@ 62,7 63,7 @@
( devices )

|00 @System     [ &vector $2 &pad     $6 &r      $2 &g     $2 &b     $2 ]
|10 @Console    [ &vector $2 &pad     $6 &char   $1 &byte  $1 &short $2 &string $2 ]
|10 @Console    [ &vector $2 &read    $1 &pad    $5 &write $1 ]
|20 @Screen     [ &vector $2 &width   $2 &height $2 &pad   $2 &x     $2 &y $2 &addr $2 &color $1 ]
|80 @Controller [ &vector $2 &button  $1 &key    $1 ]
|90 @Mouse      [ &vector $2 &x       $2 &y      $2 &state $1 &chord $1 ]


@@ 174,6 175,7 @@ BRK
	.Controller/key DEI .Controller/button DEI #0000 !! #01 JCN [ BRK ]

	.Controller/key DEI #00 ! .state/trap LDZ #0101 == ;on-button-trap JCN2
	.Controller/button DEI #0f AND #01 = ;on-control JCN2

	.Controller/key DEI 
		DUP #31 ! ,&no-1 JCN


@@ 219,6 221,27 @@ BRK

BRK

@on-control ( -> )
	
	.Controller/key DEI
	DUP ( ctrl+o ) #6f ! ,&no-open JCN
		;load-file JSR2
		;redraw JSR2 POP BRK &no-open
	DUP ( ctrl+r ) #72 ! ,&no-name JCN
		.state/trap TOGGLE
		#00 .state/blink STZ 
		#23 ;draw-filepath JSR2 POP BRK &no-name
	DUP ( ctrl+s ) #73 ! ,&no-save JCN
		;save-file JSR2 
		;draw-state JSR2 POP BRK  &no-save
	DUP ( ctrl+n ) #6e ! ,&no-make JCN
		#25 ;draw-filepath JSR2
		;untitled-txt ;new-file JSR2
		;redraw JSR2 POP BRK &no-make
	POP 

BRK

@on-button-trap ( -> )

	( enter )


@@ 1051,7 1074,8 @@ RTN
		SWP .path/name + STZ
		INCR
		LTHk ,&loop JCN
	.path/length STZ POP 
	( end ) #00 SWP .path/name + STZ 
	.path/length STZ 
	POP2r
	RESET-STATE