~rabbits/nasu

2a0ae9f54f5280ef8b0289c667fd83da3c684ed5 — neauoire 1 year, 9 months ago e0d1861
Change background-color
1 files changed, 26 insertions(+), 13 deletions(-)

M nasu.usm
M nasu.usm => nasu.usm +26 -13
@@ 14,10 14,8 @@
		Brushes
		Resize buttons
		Move focus with arrows
		Select focus
		Display tile preview view
		Hilight selected tiles
		Change background color
		Erase with right-click
)

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


@@ 66,7 64,7 @@

%BANK { #2000 }
%GET-ADDR { .settings/selection LDZ TOS #0010 ** BANK ++ }
%GET-COLOR { STHk #02 / + DEI STHr #01 #02 MOD - #04 * SFT #0f AND }
%GET-COLOR { .settings/color LDZ STHk #02 / + DEI #01 STHr #01 AND - #04 * SFT #0f AND }
%RELEASE-MOUSE { #00 .Mouse/state DEO }

( devices )


@@ 157,7 155,20 @@ BRK

@on-button ( -> )
	
	( skip ) .Controller/button DEI #00 ! #01 JCN [ BRK ]
	.Controller/key DEI .Controller/button DEI #0000 !! #01 JCN [ BRK ]

	.Controller/key DEI 
		DUP #31 ! ,&no-1 JCN
			( color ) #00 .settings/color STZ ;draw-toolview JSR2 &no-1
		DUP #32 ! ,&no-2 JCN
			( color ) #01 .settings/color STZ ;draw-toolview JSR2 &no-2
		DUP #33 ! ,&no-3 JCN
			( color ) #02 .settings/color STZ ;draw-toolview JSR2 &no-3
		DUP #34 ! ,&no-4 JCN
			( color ) #03 .settings/color STZ ;draw-toolview JSR2 &no-4
		POP

	( release ) #00 .Controller/button DEO

	.Controller/button DEI #f0 AND
		DUP #04 SFT #01 AND #01 ! ,&no-up JCN


@@ 169,6 180,7 @@ BRK
		DUP #07 SFT #01 AND #01 ! ,&no-right JCN
			( move ) .settings/selection LDZ #01 + .settings/selection STZ &no-right
		POP

	;redraw JSR2 

BRK


@@ 302,8 314,9 @@ BRK
		STHr [ .settings/color LDZ #02 / + ] DEO
		&no-b
	POP
	
	;redraw JSR2 

	;draw-colorview JSR2 

	BRK

	&set-color


@@ 607,21 620,21 @@ RTN
	
	.colorview/y2 LDZ2 #0001 ++ .Screen/y DEO2
	.colorview/x1 LDZ2 .Screen/x DEO2
	;font-hex [ .System/r .settings/color LDZ GET-COLOR ] TOS #0008 ** ++ .Screen/addr DEO2
	;font-hex [ .System/r GET-COLOR ] TOS #0008 ** ++ .Screen/addr DEO2
	#20 .settings/color LDZ + .Screen/color DEO
	.Screen/x DEI2 #0008 ++ .Screen/x DEO2
	;font-hex [ .System/g .settings/color LDZ GET-COLOR ] TOS #0008 ** ++ .Screen/addr DEO2
	;font-hex [ .System/g GET-COLOR ] TOS #0008 ** ++ .Screen/addr DEO2
	#20 .settings/color LDZ + .Screen/color DEO
	.Screen/x DEI2 #0008 ++ .Screen/x DEO2
	;font-hex [ .System/b .settings/color LDZ GET-COLOR ] TOS #0008 ** ++ .Screen/addr DEO2
	;font-hex [ .System/b GET-COLOR ] TOS #0008 ** ++ .Screen/addr DEO2
	#20 .settings/color LDZ + .Screen/color DEO

	.colorview/x1 LDZ2 .colorview/y1 LDZ2 
		[ .System/r .settings/color LDZ GET-COLOR ] ,draw-slider JSR
		[ .System/r GET-COLOR ] ,draw-slider JSR
	.colorview/x1 LDZ2 .colorview/y1 LDZ2 #0008 ++
		[ .System/g .settings/color LDZ GET-COLOR ] ,draw-slider JSR
		[ .System/g GET-COLOR ] ,draw-slider JSR
	.colorview/x1 LDZ2 .colorview/y1 LDZ2 #0010 ++
		[ .System/b .settings/color LDZ GET-COLOR ] ,draw-slider JSR
		[ .System/b GET-COLOR ] ,draw-slider JSR

RTN