~rabbits/donsol

cdddd43579b8adbe4c32f64929eab003cec6a519 — neauoire 1 year, 4 months ago 3f7656c
Added progress labels
3 files changed, 236 insertions(+), 6 deletions(-)

M bin/donsol.rom
M src/assets.tal
M src/main.tal
M bin/donsol.rom => bin/donsol.rom +0 -0
M src/assets.tal => src/assets.tal +108 -0
@@ 14,6 14,114 @@
@progress-fg-icn
	0000 183c 3c18 0000

@star-icn
	082a 1c7f 1c2a 0800

@letters-uc-icns
	781c 3c36 3e66 66c3
	ee73 636e 6363 63de
	3c66 ccc0 c0c0 e67c
	ee73 6363 6363 63de
	fe66 6078 6063 667c
	fe66 6078 6060 6060
	3c66 c6c0 dec6 663c
	c6c6 c6ce fee6 c6c6
	3018 1818 1818 180c
	1e0c 0c0c 0c1c 3860
	c66c 6c78 786c 6cc6
	e060 6060 6066 7e78
	c6ee fed6 c6c6 c6c6
	c6c6 e6f6 dece c6c6
	7cce c6c6 c6c6 e67c
	fc66 6666 6c60 60c0
	7ce6 c6c6 c6c6 ce7f
	ee73 666c 6666 63c3
	3a66 603c 0606 665c
	fe30 60c0 c0c2 c67c
	e666 6666 6666 6e3f
	c366 6666 6666 3c18
	c3c3 c3d3 cbdf 7762
	c3c3 663c 3c66 c3c3
	c366 663c 1818 1818
	7ec6 0c18 fe60 c3fe

@numbers-icns
	38c6 c6c6 c6c6 c638
	8c78 1818 1818 187e
	3c4e 860e 1c38 72fe
	807e 0c10 7c0e 8e7c
	0e1c 1c3c 6cff 0c1e
	c6f8 40c0 fc0e ce7c
	3ac4 c0c0 fcce ce7c
	807e 3e0c 1830 60c0
	807c cece 7cce ce7c
	807c cece 7c18 3060

@alphabet-icns
	0000 0000 0000 0000
	38c6 c6c6 c6c6 c638
	8c78 1818 1818 187e
	3c4e 860e 1c38 72fe
	807e 0c10 7c0e 8e7c
	0e1c 1c3c 6cff 0c1e
	c6f8 40c0 fc0e ce7c
	3ac4 c0c0 fcce ce7c
	807e 3e0c 1830 60c0
	807c cece 7cce ce7c
	807c cece 7c18 3060
	781c 3c36 3e66 66c3
	ee73 636e 6363 63de
	3c66 ccc0 c0c0 e67c
	ee73 6363 6363 63de
	fe66 6078 6063 667c
	fe66 6078 6060 6060
	3c66 c6c0 dec6 663c
	c6c6 c6ce fee6 c6c6
	3018 1818 1818 180c
	1e0c 0c0c 0c1c 3860
	c66c 6c78 786c 6cc6
	e060 6060 6066 7e78
	c6ee fed6 c6c6 c6c6
	c6c6 e6f6 dece c6c6
	7cce c6c6 c6c6 e67c
	fc66 6666 6c60 60c0
	7ce6 c6c6 c6c6 ce7f
	ee73 666c 6666 63c3
	3a66 603c 0606 665c
	fe30 60c0 c0c2 c67c
	e666 6666 6666 6e3f
	c366 6666 6666 3c18
	c3c3 c3d3 cbdf 7762
	c3c3 663c 3c66 c3c3
	c366 663c 1818 1818
	7ec6 0c18 fe60 c3fe
	0000 3e66 6666 3b00
	e060 607c 6666 7c00
	0000 3c66 6066 3c00
	0c06 063e 6666 3b00
	0000 3c66 7e60 3e00
	0e18 1818 3e18 1800
	0006 7ccc cc78 c27c
	c060 606c 7666 6600
	3000 180c 0c0c 0c00
	0c00 0c0c 0c0c 0c38
	c060 666c 786c e600
	3018 1818 1818 0c00
	00c0 667e 7e6b 6300
	00c0 7c66 6666 6300
	0000 3c6e 6676 3c00
	00c0 7c66 667c 60e0
	0000 3b66 663e 0607
	00c0 7c76 6060 6000
	0000 3e60 3c06 7c00
	0030 7e30 3030 361c
	0000 e666 666e 3b00
	0000 e666 663c 1800
	0000 e36b 7f3e 3600
	0003 663c 183c 66c0
	0000 e666 663e cc78
	0000 7e0c 7e31 7e00

@spritesheet
	0000 0000 0000 0000 0000 0000 0000 0000
	0000 0000 0000 0000 38c6 c6c6 c6c6 c638

M src/main.tal => src/main.tal +128 -6
@@ 25,8 25,12 @@

%RTN { JMP2r }
%TOS  { #00 SWP }
%MOD  { DIVk MUL SUB }
%BRK? { #01 JCN BRK }
%SWP? { #01 JCN SWP }
%SWP? { #01 JCN SWP } %SWP2? { #01 JCN SWP2 }

%WIDTH { #00e0 }
%HEIGHT { #00a0 }

( devices )



@@ 41,8 45,13 @@

|0000

@player
	&hp $1 &sp $1 &sp-max $1 &xp $1 
	&run $1 &sick $1
@cursor
	&x $2 &y $2 &last $1
@frame
	&x $2 &y $2 &x2 $2 &y2 $2

( program )



@@ 58,6 67,18 @@
	;on-mouse    .Mouse/vector DEO2
	;on-frame    .Screen/vector DEO2

	( place )
	.Screen/width DEI2 2// 
	DUP2 WIDTH 2// -- .frame/x STZ2
		WIDTH 2// ++ .frame/x2 STZ2
	.Screen/height DEI2 2// 
	DUP2 HEIGHT 2// -- .frame/y STZ2
		HEIGHT 2// ++ .frame/y2 STZ2

	#09 .player/hp STZ
	#0a .player/sp STZ
	#0b .player/xp STZ

	;redraw JSR2

BRK


@@ 79,8 100,6 @@ BRK
		POP BRK &no-right
	POP

	;redraw JSR2 

BRK

@on-mouse ( -> )


@@ 94,14 113,32 @@ BRK
@redraw ( -- )

	;draw-ui JSR2
	( .frame #01 ;line-rect JSR2 )

RTN

@draw-ui ( -- )

	#0020 #0020 #02 #0a ;draw-ui-progress JSR2
	#0040 #0030 #12 #05 ;draw-ui-progress JSR2
	#0048 #0050 #20 #0f ;draw-ui-progress JSR2
	( HP )
	.frame/x LDZ2 
	.frame/y LDZ2 
		OVR2 OVR2 #0010 ++ ;hp-txt #03 ;draw-label JSR2
		OVR2 #0020 ++ OVR2 #0010 ++ .player/hp LDZ #02 ;draw-value JSR2
		#02 #0a ;draw-ui-progress JSR2

	( SP )
	.frame/x LDZ2 #0038 ++ 
	.frame/y LDZ2 
		OVR2 OVR2 #0010 ++ ;sp-txt #03 ;draw-label JSR2
		OVR2 #0020 ++ OVR2 #0010 ++ .player/sp LDZ #01 ;draw-value JSR2
		#12 #05 ;draw-ui-progress JSR2

	( XP )	
	.frame/x LDZ2 #0070 ++ 
	.frame/y LDZ2 
		OVR2 OVR2 #0010 ++ ;xp-txt #03 ;draw-label JSR2
		OVR2 #0020 ++ OVR2 #0010 ++ .player/xp LDZ #03 ;draw-value JSR2
		#20 #0f ;draw-ui-progress JSR2

RTN



@@ 148,6 185,86 @@ RTN

RTN

@draw-label ( x* y* text* color -- )

	STH
	SWP2 .Screen/y DEO2
	SWP2 .Screen/x DEO2
	( auto x ) #01 .Screen/auto DEO
	&loop
		LDAk ;get-char JSR2 .Screen/addr DEO2
		STHkr .Screen/sprite DEO
		INC2 LDAk ,&loop JCN
	POP2
	POPr
	( auto none ) #00 .Screen/auto DEO

RTN

@draw-value ( x* y* value color -- )

	STH STH
	.Screen/y DEO2
	.Screen/x DEO2

	STHkr #0a DIV TOS 8** ;numbers-icns ++ .Screen/addr DEO2
	OVRr STHr .Screen/sprite DEO
	.Screen/x DEI2 #0008 ++ .Screen/x DEO2
	STHr #0a MOD TOS 8** ;numbers-icns ++ .Screen/addr DEO2
	STHr .Screen/sprite DEO

RTN

@get-char ( char -- addr* )

	DUP #40 > OVR #5b < #0101 !! ,&no-uc JCN
		#41 - TOS 8** ;letters-uc-icns ++ RTN
		&no-uc
	POP ;star-icn

RTN

@line-rect ( rect color -- )

	STH STH

	( not empty )
	STHkr LDZ2 STHkr #04 + LDZ2 !! ,&has-width JCN
		POP2r RTN
		&has-width
	STHkr #02 + LDZ2 STHkr #06 + LDZ2 !! ,&has-height JCN
		POP2r RTN
		&has-height

	( y2 ) STHkr #06 + LDZ2
	( y1 ) STHkr #02 + LDZ2 #0001 -- ( flip sign ) GTH2k SWP2?
	&ver
		( save ) DUP2 .Screen/y DEO2
		( x1 ) STHkr LDZ2 #0001 -- .Screen/x DEO2 
		OVRr STHr .Screen/pixel DEO
		( x2 ) STHkr #04 + LDZ2 .Screen/x DEO2 
		OVRr STHr .Screen/pixel DEO
		( incr )
		INC2 GTH2k ,&ver JCN
	POP2
	( x2 ) STHkr #04 + LDZ2
	( x1 ) STHkr LDZ2 #0001 -- ( flip sign ) GTH2k SWP2?
	&hor
		( save ) DUP2 .Screen/x DEO2
		( y1 ) STHkr #02 + LDZ2 #0001 -- .Screen/y DEO2 
		OVRr STHr .Screen/pixel DEO
		( y2 ) STHkr #06 + LDZ2 .Screen/y DEO2 
		OVRr STHr .Screen/pixel DEO
		( incr )
		INC2 GTH2k ,&hor JCN
	POP2
	POPr 
	.Screen/x DEO2
	.Screen/y DEO2 
	STHr .Screen/pixel DEO

RTN

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


@@ 165,6 282,11 @@ RTN

RTN

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


@pointer-icn 80c0 e0f0 f8e0 1000

include src/assets.tal
\ No newline at end of file