Add header during saving

This commit is contained in:
Travis Shears 2026-01-11 09:40:54 +01:00
parent 1c6a263523
commit 762be17704
Signed by: travisshears
GPG key ID: CB9BF1910F3F7469
4 changed files with 26 additions and 7 deletions

View file

@ -19,3 +19,20 @@ rom_filename="${filename}.rom"
../uxn/bin/uxnasm $1 $rom_filename && ../uxn/bin/uxnemu $rom_filename ../uxn/bin/uxnasm $1 $rom_filename && ../uxn/bin/uxnemu $rom_filename
``` ```
### Inspect drawing file
To check the data of the drawing manually you can hexdump it. Here you can see the header is correct `58 0a 1f 0a ff 0a`.
```shell
$ hexdump -C drawing.1line
00000000 58 0a 1f 0a ff 0a 58 23 59 23 59 24 5a 24 5b 24 |X.....X#Y#Y$Z$[$|
00000010 5c 24 5d 24 5d 25 5e 25 5e 26 5f 26 5f 27 60 27 |\$]$]%^%^&_&_'`'|
00000020 60 28 60 29 61 29 61 2a 61 2b 60 2b 60 2c 60 2d |`(`)a)a*a+`+`,`-|
00000030 5f 2d 5f 2e 5f 2f 5e 2f 5e 30 5d 30 5d 31 5c 31 |_-_._/^/^0]0]1\1|
00000040 5b 31 5b 32 5a 32 59 32 58 32 00 00 00 00 00 00 |[1[2Z2Y2X2......|
00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00001550 00 00 00 00 00 00 |......|
00001556
```

View file

@ -89,8 +89,8 @@
@write-drawing-file-to-disk @write-drawing-file-to-disk
;/filename .File/name DEO2 ;/filename .File/name DEO2
#1550 .File/length DEO2 #1556 .File/length DEO2
;pxs .File/write DEO2 ;file-start .File/write DEO2
JMP2r JMP2r
&filename "drawing.1line $1 &filename "drawing.1line $1
@ -172,7 +172,6 @@
#f0b2 .System/b DEO2 #f0b2 .System/b DEO2
JMP2r JMP2r
@cursor-sprite @cursor-sprite
20 20 d8 20 20 00 00 00 20 20 d8 20 20 00 00 00
( (
@ -187,6 +186,8 @@
) )
@pxs-pt $2 @pxs-pt $2
@file-start
58 0a 1f 0a ff 0a (88 31 255)
@pxs $1550 ( 5456 ) @pxs $1550 ( 5456 )
( (
pxs are the pixels of the drawing in order they are drawn pxs are the pixels of the drawing in order they are drawn

View file

@ -29,15 +29,13 @@ An example file converted from binary to text would looks something like this. C
are only there to show the different numbers and would not be in the data. are only there to show the different numbers and would not be in the data.
``` ```
88 88
34 31
255 255
0,0,1,0,2,0,3,0,4,0,5,255 0,0,1,0,2,0,3,0,4,0,5,255
``` ```
Or in hexadecimal: Or in hexadecimal:
``` ```
58 58 0A 1F 0A FF 0A
22
FF
0000010002000300040005FF 0000010002000300040005FF
``` ```

3
tasks.txt Normal file
View file

@ -0,0 +1,3 @@
task: include header in generated .1line file as spec in ./one_line_file_type_spec.ms
task: shift pixel x,y to be zero based
task: set terminal byte