~rabbits/nasu

c0f5f964af3204e4dd4d61f88842967103ae734d — neauoire 1 year, 4 months ago b5da019
Implemented console vector
1 files changed, 29 insertions(+), 6 deletions(-)

M src/main.tal
M src/main.tal => src/main.tal +29 -6
@@ 41,6 41,7 @@
%100** { #80 SFT2 }
%200** { #90 SFT2 }

%2INC2 { INC2 INC2 }
%2MOD { #01 AND }
%4MOD { #03 AND }
%8MOD { #07 AND }


@@ 131,7 132,6 @@
	&width $2 &height $2
@cursor
	&x $2 &y $2 &last $1
@color $1

@rect  [ &x1 $2 &y1 $2 &x2 $2 &y2 $2 ]
( interface ) 


@@ 162,6 162,7 @@
	#00e0 .Screen/height DEO2

	( vectors )
	;on-console  .Console/vector DEO2
	;on-button   .Controller/vector DEO2
	;on-mouse    .Mouse/vector DEO2
	;on-transfer .File/vector DEO2


@@ 209,6 210,27 @@

BRK

@on-console ( -- )

	#00 ;draw-filepath JSR2
	.Console/read DEI DUP 
	#0a = ,&counter LDR #20 = #0000 == ,&no-end JCN
		( set length ) ,&counter LDR .path/length STZ
		( null char ) #00 .path ,&counter LDR INC + STZ
		( reset counter ) #00 ,&counter STR 
		( load ) ;load-file JSR2
		POP BRK
		&no-end
	,&counter LDR 
		( length ) DUP .path/length STZ
		INC 
			( inc counter ) DUP ,&counter STR 
			( write ) .path + STZ
	#01 ;draw-filepath JSR2

BRK
	&counter $1

@on-frame ( -> )
	( inactive )
BRK


@@ 319,7 341,7 @@ BRK
		;redraw JSR2 POP BRK &no-new
	DUP [ LIT 'o ] ! ,&no-open JCN
		;load-file JSR2
		;redraw JSR2 POP BRK &no-open
		POP BRK &no-open
	DUP [ LIT 's ] ! ,&no-save JCN
		;save-file JSR2 
		;save-theme JSR2


@@ 473,7 495,6 @@ BRK
		&no-save
	DUP HOR SWP - #03 ! ,&no-load JCN
		;load-file JSR2
		;redraw JSR22
		&no-load
	DUP HOR SWP - #04 ! ,&no-name JCN
		#00 ;draw-filepath JSR2


@@ 1077,7 1098,7 @@ RTN
		&loop
			DUP STHkr > 8* TOS ;slider-icns ++ .Screen/addr DEO2
			#02 .Screen/sprite DEO
			.Screen/x DEI2 #0002 ++ .Screen/x DEO2
			.Screen/x DEI2 2INC2 .Screen/x DEO2
			INC GTHk ,&loop JCN
		POP2
		POPr


@@ 1234,6 1255,7 @@ RTN
	#2000 .File/length DEO2 
	BANK .File/load DEO2
	RESET-STATE
	;redraw JSR2

RTN



@@ 1251,6 1273,7 @@ RTN
		DUP2k [ 8// 8** ++ ] BANK ++ STHr ROT ROT STA
		INC2 GTH2k ,&loop JCN
	POP2 POP2
	;redraw JSR2

RTN



@@ 1396,7 1419,7 @@ RTN
	&loop
		( save ) DUP2 .Screen/x DEO2
		( draw ) STHkr .Screen/pixel DEO
		#0002 ++ GTH2k ,&loop JCN
		2INC2 GTH2k ,&loop JCN
	POP2 POP2 POPr

RTN


@@ 1407,7 1430,7 @@ RTN
	&loop
		( save ) DUP2 .Screen/y DEO2
		( draw ) STHkr .Screen/pixel DEO
		#0002 ++ GTH2k ,&loop JCN
		2INC2 GTH2k ,&loop JCN
	POP2 POP2 POPr

RTN