~rabbits/nasu

4ecc33e98d0868312d306900caaa197b937f54bc — Devine Lu Linvega 3 months ago cacc4ce
Progress on menu mouse picking
1 files changed, 27 insertions(+), 5 deletions(-)

M src/manifest.tal
M src/manifest.tal => src/manifest.tal +27 -5
@@ 54,16 54,35 @@ BRK
	( record mouse positions )
	.Mouse/x DEI2 DUP2 .cursor/x STZ2 .Screen/x DEO2
	.Mouse/y DEI2 DUP2 .cursor/y STZ2 .Screen/y DEO2

	.Mouse/x DEI2 ;menu-picking JSR2 ;draw-menu/cat-sel STA
	.Mouse/y DEI2 #0008 SUB2 #03 SFT2 NIP ;draw-menu/sub-sel STA
	;draw-menu JSR2

	.cursor/x LDZ2 .Screen/x DEO2
	.cursor/y LDZ2 .Screen/y DEO2
	( draw new cursor )
	;hand-icn .Screen/addr DEO2
	#42 .Mouse/state DEI #00 NEQ ADD .Screen/sprite DEO
	#4f .Mouse/state DEI #00 NEQ ADD .Screen/sprite DEO

	(
	.Mouse/y DEI2 #0008 LTH2 ,&no-exit JCN
		;untrap JSR2
		&no-exit
		&no-exit )

BRK

@on-menu-touch ( -> )

	( release ) #00 .Mouse/state DEO

BRK

@menu-picking ( x* -- cat )

	#0006 #30 SFT2 DIV2 NIP

JMP2r

@on-control-menu ( -> )



@@ 96,16 115,18 @@ JMP2r

	#0000 DUP2 .Screen/x DEO2 .Screen/y DEO2
	#01 .Screen/auto DEO
	#00 ,&cat-id STR
	;manifest/menu
	&cat
		#02 ;draw-chr/color STA
		[ LIT &cat-sel $1 ] [ LIT &cat-id $1 ] EQU #02 ADD ;draw-chr/color STA
		#0000 .Screen/y DEO2
		.Screen/x DEI2 ,&col STR2
		LDAk STH INC2 ;draw-str JSR2 #00 .Screen/sprite DEOk DEO
		.Screen/x DEI2 ,&anchor STR2
		#03 ;draw-chr/color STA
		STHr #00
		&subcat
			DUP [ LIT &sub-sel $1 ] EQU #04 MUL #07 ADD 
			,&cat-sel LDR ,&cat-id LDR EQU MUL ;draw-chr/color STA
			#00 OVR INC #30 SFT2 .Screen/y DEO2
			[ LIT2 &col $2 ] .Screen/x DEO2
			SWP2


@@ 114,6 135,7 @@ JMP2r
			INC GTHk ,&subcat JCN
		POP2
		( restore-x ) [ LIT2 &anchor $2 ] .Screen/x DEO2
		,&cat-id LDR INC ,&cat-id STR
		LDAk ,&cat JCN
	POP2
	#00 .Screen/auto DEO


@@ 132,7 154,7 @@ JMP2r
@draw-chr ( char -- )

	#20 SUB #00 SWP #30 SFT2 ;font ADD2 .Screen/addr DEO2
	[ LIT &color 01 ] .Screen/sprite DEO
	[ LIT &color 01 ] #40 ADD .Screen/sprite DEO

JMP2r