~rabbits/donsol

ddf9919c12fbc0f902587c2711e4b175395bf2d6 — neauoire 1 year, 4 months ago 6ccee4e
Started implementing menus
3 files changed, 119 insertions(+), 15 deletions(-)

M src/assets.tal
M src/main.tal
M src/strings.tal
M src/assets.tal => src/assets.tal +1 -1
@@ 2,7 2,7 @@
@pointer-icn 
	80c0 e0f0 f8e0 1000

@cursors-icns
@cursor-hor-icn
	4060 381e 1e38 6040
@cursor-up-icn
	0018 183c 7e66 c300

M src/main.tal => src/main.tal +112 -11
@@ 80,11 80,6 @@
	#0120 .Screen/width DEO2
	#00e0 .Screen/height DEO2

	( vectors )
	;on-button   .Controller/vector DEO2
	;on-mouse    .Mouse/vector DEO2
	;on-frame    .Screen/vector DEO2

	( place )
	.Screen/width DEI2 2// 
	DUP2 WIDTH 2// -- .frame/x STZ2


@@ 97,11 92,98 @@
	#0a .player/sp STZ
	#0b .player/xp STZ

	;start-game JSR2
	;go-menu JSR2

BRK

( menu )

@go-menu ( -- )

	;on-button-menu   .Controller/vector DEO2
	;on-mouse-menu    .Mouse/vector DEO2
	;on-frame-menu    .Screen/vector DEO2

	;start-menu JSR2

RTN

@on-button-menu ( -> )

	.Controller/button DEI 
	[ #01 ] !~ ,&no-a JCN
		;go-game JSR2 POP BRK
		&no-a
	[ #40 ] !~ ,&no-left JCN
		( clamp ) .mode LDZ #01 < ,&no-left JCN
		.mode LDZ #01 - .mode STZ
		;draw-menu/options JSR2 POP BRK
		&no-left
	[ #80 ] !~ ,&no-right JCN
		( clamp ) .mode LDZ #01 > ,&no-right JCN
		.mode LDZ INC .mode STZ
		;draw-menu/options JSR2 POP BRK
		&no-right
	POP

BRK

@on-mouse-menu ( -> )

BRK

@on-frame-menu ( -> )

BRK

@on-frame ( -> )
@start-menu ( -- )

	;clear-screen JSR2
	;draw-menu JSR2

RTN

@draw-menu ( -- )

	&options
	( easy )
	.frame/x LDZ2 WIDTH 2// #0048 -- ++ 
	.frame/y LDZ2 #0078 ++
		#0010 ++ ;easy-txt #02 [ .mode LDZ #00 = + ] ;draw-label JSR2
	.Screen/x DEI2 #002c -- .Screen/x DEO2
	;cursor-hor-icn .Screen/addr DEO2
	#01 [ .mode LDZ #00 = * ] .Screen/sprite DEO
	
	( normal )
	.frame/x LDZ2 WIDTH 2// #0018 -- ++ 
	.frame/y LDZ2 #0078 ++
		#0010 ++ ;normal-txt #02 [ .mode LDZ #01 = + ] ;draw-label JSR2
	.Screen/x DEI2 #003c -- .Screen/x DEO2
	;cursor-hor-icn .Screen/addr DEO2
	#01 [ .mode LDZ #01 = * ] .Screen/sprite DEO
	( hard )
	.frame/x LDZ2 WIDTH 2// #0028 ++ ++ 
	.frame/y LDZ2 #0078 ++
		#0010 ++ ;hard-txt #02 [ .mode LDZ #02 = + ] ;draw-label JSR2
	.Screen/x DEI2 #002c -- .Screen/x DEO2
	;cursor-hor-icn .Screen/addr DEO2
	#01 [ .mode LDZ #02 = * ] .Screen/sprite DEO

RTN

( game )

@go-game ( -- )

	;on-button-game   .Controller/vector DEO2
	;on-mouse-game    .Mouse/vector DEO2
	;on-frame-game    .Screen/vector DEO2

	;start-game JSR2

RTN

@on-frame-game ( -> )

	( table timer )
	.table/timer LDZ #00 = ,&no-timer JCN


@@ 142,7 224,7 @@ BRK

BRK

@on-button ( -> )
@on-button-game ( -> )
	
	.Controller/button DEI 
	[ #01 ] !~ ,&no-a JCN


@@ 152,7 234,7 @@ BRK
		;run JSR2 POP BRK
		&no-b
	[ #08 ] !~ ,&no-sel JCN
		( restart key, temp ) ;start-game JSR2 POP BRK
		;go-menu JSR2 POP BRK
		&no-sel
	#04 SFT
	[ #04 ] !~ ,&no-left JCN


@@ 165,7 247,7 @@ BRK

BRK

@on-mouse ( -> )
@on-mouse-game ( -> )

	( run button )
	.Mouse/state DEI #10 ! ,&no-mouse2 JCN


@@ 200,7 282,9 @@ BRK
	( start deck )
	;init-deck JSR2
	;shuffle-deck JSR2
	;dialogs/entered ;draw-dialog JSR2

	;clear-screen JSR2
	;dialogs/modes .mode LDZ TOS 2** ++ LDA2 ;draw-dialog JSR2
	;enter-room JSR2

RTN


@@ 816,6 900,23 @@ RTN

RTN

@clear-screen ( -- )

	;blank-icn .Screen/addr DEO2
	.frame/y2 LDZ2 .frame/y LDZ2 -- 8// NIP #00
	&y
		DUP TOS 8** .frame/y LDZ2 ++ .Screen/y DEO2
		.frame/x2 LDZ2 .frame/x LDZ2 -- 8// NIP #00
		&x
			DUP TOS 8** .frame/x LDZ2 ++ .Screen/x DEO2
			#01 .Screen/sprite DEO
			INC GTHk ,&x JCN
		POP2
		INC GTHk ,&y JCN
	POP2

RTN

@print-hex ( value* -- )
	
	&short ( value* -- )

M src/strings.tal => src/strings.tal +6 -3
@@ 13,7 13,7 @@
	&blocking     2333 3900 2630 3327 2f29 2800 382c 2900 2538 3825 272f 4000 
	&breaking     2333 3936 0037 2c2d 2930 2800 2636 332f 293f 0000 0000 0000 
	&damages      2333 3900 3739 363a 2d3a 2928 0038 2c29 0026 2538 3830 2940 
	&death        2333 3900 282d 2928 4000 4100 1e36 3d00 252b 252d 3240 0000 
	&death        2333 3900 282d 2928 4000 4200 1e36 3d00 252b 252d 3240 0000 
	( run )
	&run          2333 3900 3625 3200 253b 253d 4000 0000 0000 0000 0000 0000 
	&cannot_run   2333 3900 2725 3232 3338 0036 3932 0025 3b25 3d40 0000 0000 


@@ 25,13 25,16 @@
	&victory      202d 2738 3336 3d00 4100 1629 253a 2900 2839 322b 2933 3240 
	&sound:ON     1d33 3932 2837 0019 183f 0000 0000 0000 0000 0000 0000 0000 
	&sound:OFF    1d33 3932 2837 0019 1010 3f00 0000 0000 0000 0000 0000 0000 
	&modes
		:&easy :&normal :&hard

@hp-txt "HP $1
@sp-txt "SP $1
@xp-txt "XP $1
@run-txt "RUN $1


@easy-txt "Easy $1
@normal-txt "Normal $1
@hard-txt "Hard $1

@card-types
	00 00 00 00 00 00 00 00 00 00 00 00 00 ( hearts )