diff --git a/.gitignore b/.gitignore index b80a777..f31ac0d 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ /bin *.chr *snarf -*theme \ No newline at end of file +*theme +*nametable \ No newline at end of file diff --git a/src/main.tal b/src/main.tal index a23d67a..4aa26b9 100644 --- a/src/main.tal +++ b/src/main.tal @@ -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