WonderWitch .fx files: Difference between revisions

From WSdev Wiki
Jump to navigationJump to search
(Created page with "FreyaOS uses XMODEM transfers to send and receive files through the serial port. These transfers do not include any file metadata by default - such as the file's name, size, permissions or creation date. As such, .fx files are used - binary files with a special 128-byte header<ref>XMODEM transfers are performed in 128-byte blocks; this allows fetching the file's metadata as the first block</ref>. == Format == {| class="wikitable" |+ Header contents |- ! Offset...")
 
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[FreyaOS]] uses [[XMODEM]] transfers to send and receive files through the serial port. These transfers do not include any file metadata by default - such as the file's name, size, permissions or creation date. As such, .fx files are used - binary files with a special 128-byte header<ref>XMODEM transfers are performed in 128-byte blocks; this allows fetching the file's metadata as the first block</ref>.
[[WonderWitch/FreyaOS|FreyaOS]] uses [[XMODEM]] transfers to send and receive files through the serial port. These transfers do not include any file metadata by default - such as the file's name, size, permissions or creation date. As such, .fx files are used - binary files with a special 128-byte header<ref>XMODEM transfers are performed in 128-byte blocks; this allows fetching the file's metadata as the first block</ref>.


== Format ==
== Format ==
Line 10: Line 10:
| $00 || 4 || Magic string: <code>#!ws</code>
| $00 || 4 || Magic string: <code>#!ws</code>
|-
|-
| $04 || 60 || Padding; unused.
| $04 || 60 || Padding; typically 0xFF.
|-
|-
| $40 || 16 || File name; zero-terminated Shift-JIS string.
| $40 || 16 || File name; zero-terminated Shift-JIS string.
Line 36: Line 36:
----
----
<pre>
<pre>
 
15 bit  8  7  bit 0
15     bit       0
---- ---- ---- ----
---- ---- ---- ----
???? ???? ??i? ?rwx
???? ???? ??i? ?rwx
              |  |||
            |  ||+- Execute
              |  ||+- Execute
            |  |+-- Write
              |  |+-- Write
            |  +--- Read
              |  +--- Read
            +------- Intermediate library
              +------- Intermediate library
</pre>
</pre>

Latest revision as of 05:59, 17 March 2024

FreyaOS uses XMODEM transfers to send and receive files through the serial port. These transfers do not include any file metadata by default - such as the file's name, size, permissions or creation date. As such, .fx files are used - binary files with a special 128-byte header[1].

Format

Header contents
Offset Length Contents
$00 4 Magic string: #!ws
$04 60 Padding; typically 0xFF.
$40 16 File name; zero-terminated Shift-JIS string.
$50 24 User-friendly file name; zero-terminated Shift-JIS string.

FreyaOS displays the first 12 characters in its file selector.

$68 4 ?
$6C 4 Total file size, in bytes, excluding the header.
$70 2 XMODEM chunk count - above file size divided by 128, then rounded up.
$72 2 File mode
$74 4 Modification time - seconds since January 1st, 2000.
$78 4 ?
$7C 4 Offset to resource data, bytes excluding header; -1 if not present.

File mode


15  bit  8  7  bit  0
 ---- ----  ---- ----
 ???? ????  ??i? ?rwx
              |   |||
              |   ||+- Execute
              |   |+-- Write
              |   +--- Read
              +------- Intermediate library
  1. XMODEM transfers are performed in 128-byte blocks; this allows fetching the file's metadata as the first block