Improved renaming

This commit is contained in:
neauoire 2023-11-27 15:08:08 -08:00
parent 552341125d
commit 40dfc6e25b
1 changed files with 24 additions and 6 deletions

View File

@ -36,11 +36,25 @@
BRK BRK
@on-ready ( -> ) @on-ready ( -> )
;src ;dst scpy ;&chr-ext ;dst scap scpy ;dst .File2/name DEO2
;src <file-open-tga> ;src <file-open-tga>
;dst <pstr>/ ;dst <pstr>/
#0a18 DEO #0a18 DEO
BRK &chr-ext ".chr $1 BRK
@hexc ( hex -- char )
#0f AND DUP #09 GTH #27 MUL ADD #30 ADD JMP2r
@write-size ( str* -- )
STH2
;image/w LDA2 #03 SFT2 NIP
( ) DUP #04 SFT hexc STH2kr STA
INC2r hexc STH2kr STA
INC2r LIT "x STH2kr STA
INC2r ;image/h LDA2 #03 SFT2 NIP
( ) DUP #04 SFT hexc STH2kr STA
INC2r hexc STH2kr STA
INC2r #00 STH2r STA
JMP2r
( (
@|tga ) @|tga )
@ -53,6 +67,11 @@
( | flip endianness ) ( | flip endianness )
;image/w STH2k LDA2 SWP STH2r STA2 ;image/w STH2k LDA2 SWP STH2r STA2
;image/h STH2k LDA2 SWP STH2r STA2 ;image/h STH2k LDA2 SWP STH2r STA2
( | output path )
;src ;dst scpy ;dst
( ) DUP2 scap/ #0004 SUB2 write-size
( ) { ".chr 00 }
STH2r SWP2 scap/ scpy ;dst .File2/name DEO2
( | resize ) ( | resize )
;image/w LDA2 #0040 ADD2 .Screen/width DEO2 ;image/w LDA2 #0040 ADD2 .Screen/width DEO2
;image/h LDA2 #0040 ADD2 .Screen/height DEO2 ;image/h LDA2 #0040 ADD2 .Screen/height DEO2
@ -147,17 +166,16 @@
POP2 #01 JMP2r POP2 #01 JMP2r
@scap ( str* -- end* ) @scap ( str* -- end* )
LDAk #00 NEQ [ JMP JMP2r ]
&w ( -- ) &w ( -- )
INC2 LDAk ?&w INC2 & LDAk ?&w
JMP2r JMP2r
@sput ( chr str* -- ) @sput ( chr str* -- )
scap STA scap/ STA
JMP2r JMP2r
@slen ( str* -- len* ) @slen ( str* -- len* )
DUP2 scap SWP2 SUB2 JMP2r DUP2 scap/ SWP2 SUB2 JMP2r
@scpy ( src* dst* -- ) @scpy ( src* dst* -- )
STH2 STH2