(icnuf1) Working copy

This commit is contained in:
neauoire 2023-11-25 15:51:04 -08:00
parent da6e55e121
commit f7011bdee0
3 changed files with 20 additions and 10 deletions

BIN
cli/icnuf1/816-original.icn Normal file

Binary file not shown.

Binary file not shown.

View File

@ -1,5 +1,6 @@
( uxncli format-c.rom file.bin )
|00 @System &vector $2 &expansion $2 &wst $1 &rst $1 &metadata $2 &r $2 &g $2 &b $2 &debug $1 &state $1
|10 @Console &vector $2 &read $1 &pad $5 &write $1 &error $1
|a0 @File &vector $2 &success $2 &stat $2 &delete $1 &append $1 &name $2 &length $2 &read $2 &write $2
@ -24,28 +25,38 @@
STH2r .File/name DEO2
#0800 .File/length DEO2
;icn .File/read DEO2
( | convert )
( | write )
<convert>
;src .File/name DEO2
;uf1 .File/write DEO2
#0800 .File/length DEO2
#800f DEO
BRK
@get-addr ( a -- addr* )
STHk
( y ) #04 SFT #00 SWP #0080 MUL2
( x ) STHr #0f AND #00 SWP #0008 MUL2 ADD2 JMP2r
@<copy-tiles> ( a b -- )
OVR phex/b #2018 DEO
DUP phex/b #0a18 DEO
POP2
JMP2r
DUP phex/b #2018 DEO
( a -> a* ) OVR get-addr phex #2018 DEO
( b -> b* ) DUP get-addr phex #0a18 DEO
SWP get-addr ;icn ADD2 ,&src STR2
get-addr ;uf1 ADD2 ,&dst STR2
;&cmd .System/expansion DEO2
JMP2r
&cmd [ 01 0008 0000 &src $2 0000 &dst $2 ]
@<convert> ( -- )
#0000
&l ( -- )
( | print pos )
( y ) DUP #15 SFT OVR #01 AND ADD #40 SFT STH
( x ) DUP #01 SFT #0f AND
( merge ) STHr ORA
OVR <copy-tiles>
( merge ) STHr ORA OVR <copy-tiles>
INC DUP ?&l
POP2
JMP2r
POP2 JMP2r
@blank [ ffff ffff ffff ffff ]
@ -79,4 +90,3 @@ JMP2r
@uf1 $800