~rabbits/nasu

ee113470028647b79f2717a349f32405cdc7972f — neauoire 1 year, 8 months ago 9038109
alt-click to open as icn
1 files changed, 23 insertions(+), 2 deletions(-)

M nasu.tal
M nasu.tal => nasu.tal +23 -2
@@ 40,6 40,7 @@
%GET-ITERATORS { SWP2k POP SWP POP } 

%BANK { #2000 }
%BANK-TEMP { #4000 }
%GET-COLOR     { .settings/color LDZ STHk #02 / + DEI #01 STHr #01 AND - #04 * SFT #0f AND }
%GET-POSITION  { .settings/focus LDZ2 BANK -- DUP2 #0002 // WIDTH MOD2 SWP2 WIDTH #0002 ** // #0008 ** }
%ADD-POSITIONS { ROT2 ++ ROT2 ROT2 ++ SWP2 }


@@ 175,7 176,7 @@ BRK
	.Controller/key DEI .Controller/button DEI #0000 !! #01 JCN [ BRK ]

	.Controller/key DEI #00 ! .state/trap LDZ #0101 == ;on-button-trap JCN2
	.Controller/button DEI #0f AND #01 = ;on-control JCN2
	.Controller/button DEI #01 AND ;on-control JCN2

	.Controller/key DEI 
		DUP #31 ! ,&no-1 JCN


@@ 222,7 223,7 @@ BRK
BRK

@on-control ( -> )
	

	.Controller/key DEI
	DUP ( ctrl+o ) #6f ! ,&no-open JCN
		;load-file JSR2


@@ 1083,6 1084,8 @@ RTN

@load-file ( -- )

	( icn mode ) .Controller/button DEI #02 AND ,load-file-icn JCN

	BANK LENGTH ;op-clear JSR2
	;path/name .File/name DEO2 
	#2000 .File/length DEO2 


@@ 1091,6 1094,24 @@ RTN

RTN

@load-file-icn ( -- )
	
	BANK LENGTH ;op-clear JSR2
	;path/name .File/name DEO2 
	#2000 .File/length DEO2 
	BANK-TEMP .File/load DEO2
	RESET-STATE

	#0000 #1000
	&loop
		OVR2 BANK-TEMP ++ LDA STH
		OVR2 [ DUP2 #0008 // #0008 ** ++ ] BANK ++ STHr ROT ROT STA
		INCR2
		LTH2k ,&loop JCN
	POP2 POP2

RTN

@save-file ( -- )

	;path/name .File/name DEO2