~rabbits/nasu

a99f21200502233eb9c0f784a330a134260e7002 — Devine Lu Linvega 3 months ago 0a7ec23
Improved routing of sub manu
1 files changed, 17 insertions(+), 12 deletions(-)

M src/manifest.tal
M src/manifest.tal => src/manifest.tal +17 -12
@@ 145,7 145,7 @@ JMP2r
@draw-sub ( -- )

	#01 .Screen/auto DEO
	;manifest/menu
	;draw-cat/sel LDA ;get-sub JSR2
	LDAk STH INC2 ;skip-str JSR2
	STHr #00
	&subcat


@@ 154,29 154,34 @@ JMP2r
		SWP2 #0004 ADD2 ;draw-str JSR2 SWP2
		INC GTHk ,&subcat JCN
	POP2 POP2
	#00 .Screen/auto DEO

JMP2r

@get-sub ( cat -- )

	( STH
	STH
	#00 ,&id STR
	;manifest/menu
	&cat
		LDAk STH INC2 ;draw-str JSR2 #00 .Screen/sprite DEOk DEO
		STHr #00
		&subcat
			SWP2 #0004 ADD2 ;skip-str JSR2 SWP2
			INC GTHk ,&subcat JCN
		POP2
		,&cat-id LDR INC ,&cat-id STR
		[ LIT &id 00 ] STHkr EQU ,&end JCN
		;skip-sub JSR2
		,&id LDR INC ,&id STR
		LDAk ,&cat JCN
	POP2 )
	POP2
	&end
	POPr

JMP2r

@next-sub ( sub* -- sub* )
@skip-sub ( sub* -- sub* )

	
	LDAk STH INC2 ;skip-str JSR2
	STHr #00
	&subcat
		SWP2 #0004 ADD2 ;skip-str JSR2 SWP2
		INC GTHk ,&subcat JCN
	POP2

JMP2r