~rabbits/nasu

c0b9067f05a03c6e0d2e43a821a6a2029614f155 — neauoire 1 year, 3 months ago 39fcc09
Added save/load nametable
2 files changed, 19 insertions(+), 20 deletions(-)

M .gitignore
M src/main.tal
M .gitignore => .gitignore +2 -1
@@ 5,4 5,5 @@
/bin
*.chr
*snarf
*theme
\ No newline at end of file
*theme
*nametable
\ No newline at end of file

M src/main.tal => src/main.tal +17 -19
@@ 80,7 80,6 @@

( todo )
%DATA-CLIP { #6000 }
%BANK-TEMP { #4000 }

%GET-HEX-ADDR  { TOS 8** ;font-hex ++ .Screen/addr DEO2 }
%GET-COLOR     { .settings/color LDZ STHk 2/ + DEI #01 STHr #01 AND - 4* SFT #0f AND }


@@ 1302,6 1301,8 @@ RTN
@new-file ( default* -- )
	
	BANK-SPRITESHEET LENGTH ;clear JSR2
	BANK-NAMETABLE #0200 ;clear JSR2
	
	STH2
	#0c #00
	&loop


@@ 1317,40 1318,36 @@ RTN

@load-file ( -- )

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

	BANK-SPRITESHEET LENGTH ;clear JSR2
	BANK-NAMETABLE #0200 ;clear JSR2

	( spritesheet )
	;path/name .File/name DEO2 
	LENGTH .File/length DEO2 
	BANK-SPRITESHEET .File/load DEO2
	RESET-STATE
	;redraw JSR2

RTN
	( nametable )
	;nametable-txt .File/name DEO2 
	#0200 .File/length DEO2 
	BANK-NAMETABLE .File/load DEO2

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

	#1000 #0000
	&loop
		DUP2 BANK-TEMP ++ LDA STH
		DUP2k [ 8// 8** ++ ] BANK-SPRITESHEET ++ STHr ROT ROT STA
		INC2 GTH2k ,&loop JCN
	POP2 POP2
	;redraw JSR2

RTN

@save-file ( -- )

	( spritesheet )
	;path/name .File/name DEO2 
	LENGTH .File/length DEO2 
	BANK-SPRITESHEET .File/save DEO2

	( nametable )
	;nametable-txt .File/name DEO2 
	#0200 .File/length DEO2 
	BANK-NAMETABLE .File/save DEO2

	RESET-STATE

	;save-theme JSR2


@@ 1516,6 1513,7 @@ RTN

RTN

@nametable-txt "nametable $1
@untitled-txt  "untitled.chr $1

@tool-brush    e0d0 8844 2212 0c00