~rabbits/nasu

3795d9ae22d2aa3b4d8b58c135a52ba5cf1329d0 — Devine Lu Linvega a month ago 5f5c3be
Draw menu
3 files changed, 46 insertions(+), 3 deletions(-)

M build.sh
M src/manifest.tal
M src/nasu.tal
M build.sh => build.sh +1 -1
@@ 27,4 27,4 @@ then
fi

echo "Running.."
uxn11 bin/nasu.rom ako10x10.chr
uxnemu bin/nasu.rom ako10x10.chr

M src/manifest.tal => src/manifest.tal +41 -1
@@ 41,7 41,7 @@
@print-manifest ( -- )

	;manifest/name ;print-str JSR2
	LIT '( #18 DEO ;print-str JSR2 LIT ') #18 DEO
	LIT '( #18 DEO ;print-str JSR2 POP2 LIT ') #18 DEO
	#0a18 DEOk DEO
	( menu )
	;manifest/menu


@@ 61,6 61,46 @@

JMP2r

@draw-menu ( -- )

	#0000 DUP2 .Screen/x DEO2 .Screen/y DEO2
	#01 .Screen/auto DEO

	#07 ;draw-chr/color STA
	;manifest/name ;draw-str JSR2 #00 .Screen/sprite DEO

	#02 ;draw-chr/color STA
	;manifest/menu
	&cat
		LDAk STH INC2 ;draw-str JSR2 #00 .Screen/sprite DEO
		STHr #00
		&subcat
			SWP2
			#0004 ADD2 ;skip-str JSR2
			SWP2
			INC GTHk ,&subcat JCN
		POP2
		LDAk ,&cat JCN
	POP2
	#00 .Screen/auto DEO

JMP2r

@draw-str ( str* -- str* )

	&while
		LDAk ,draw-chr JSR
		INC2 LDAk ,&while JCN

JMP2r

@draw-chr ( char -- )

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

JMP2r

@print-mod ( addr* -- addr* )

	LDAk STH

M src/nasu.tal => src/nasu.tal +4 -1
@@ 45,7 45,7 @@
	#0caf .System/b DEO2
	( size )
	#0130 .Screen/width DEO2
	#00e0 .Screen/height DEO2
	#0100 .Screen/height DEO2
	( vectors )
	;on-console  .Console/vector DEO2
	;on-button   .Controller/vector DEO2


@@ 87,6 87,7 @@
	( let's begin! )
	;file-new JSR2
	;print-manifest JSR2
	;draw-menu JSR2

BRK



@@ 602,6 603,8 @@ JMP2r
	;draw-nametable JSR2
	;draw-zoomview JSR2

	;draw-menu JSR2

	#00 .Screen/auto DEO

JMP2r