Welcome Guest, you are in: Login

Starflight Wiki


RSS
RSS

Navigation






Search the wiki

»

PoweredBy

Starflight filesystem


Despite the ".COM" ending, the files STARA.COM and STARB.COM are not DOS executables. They are used to simulate a standard FORTH Block I/O system, in which 1024-byte blocks can be read from/written to the disk:

STARA.COM: 256000 bytes, or 250 blocks.

STARB.COM: 362496 bytes, or 354 blocks.



The first four blocks of each file contain a directory structure that describes the rest of the blocks. The directory is the same on both files: no matter which file is "mounted", the global directory is always available in the first four blocks.

Each directory record has 21 bytes, so there are 48 records in each directory block (48*21 = 1008).

The last 16 bytes of a directory block contains a signature.

Since there are four directory blocks, there are at most 48*4 = 192 directory records.

Each directory record describes an object "class".

In Starflight everything is an object: the starmap, star systems, crew members, life forms, etc.
A class can have one or more species, and species can have instances.
This three level hierarchy (class-species-instance) is used to describe everything in the game, in an advanced object system similar to nowdays object oriented programming.

A directory record has the following fields:


  • NAME: 12 bytes.
  • TYPE: 1 byte.
  • START: 2 bytes.
  • END: 2 bytes.
  • NRECS: 2 bytes.
  • RLEN: 1 byte.
  • SLEN: 1 byte.



NAME is a 12-character string (not null terminated). TYPE range from 0 to 4:


  • 0: dummy entry, no physical file associated with it.
  • 1: file is allocated on STARA.COM.
  • 2: file is allocated on STARB.COM.
  • 3: unknown.
  • 4: unknown.

START and END are 16-bit values known as a "VSA".
A VSA is an index to 16-byte chunk inside STARA.COM or STARB.COM. For example, a VSA value of 0x40 points to the begining of the second directory sector of STARA.COM (64*16 = 1024).

This system can address up to 1MB of data (65536*16 bytes), although Starflight uses only 604KB. The VSA address space works like this:


  • 0x0000: start of the first copy of the directory (block 0 of STARA.COM).
  • 0x0100: start of the STARA.COM data (block 3 of STARA.COM).
  • 0x3E7F: last VSA of STARA.COM.
  • 0x3E80: start of the second copy of the directory (block 0 of STARB.COM).
  • 0x3F80: start of the STARB.COM data (block 3 of STARB.COM).
  • 0x96FF: last VSA of STARB.COM.


A VSA value of 0x9700 or greater is invalid.
NRECS is the number or records in each file and RLEN is the record length.
SLEN is used to allocate addtional space for an instance.

The directory listing is available at
http://meusite.uai.com.br/~mmand/starflight/dir.txt
, showing all used records.

As an example, consider the directory entry number 6, named "ELO-CPIC":





INameTypeStartEndNRecsRlenSlen
6ELO-CPIC10x01000x022c0x012d0x100x00

It is of type 1, so it is allocated in STARA.COM.
The START VSA is 0x100, which means it is the first block of data after the directory on STARA.COM.
The END VSA is 0x22C.
There are 301 (0x12D) records of length 16 (0x10), giving a total size of 301*16=4816 bytes. This file contains the picture of the Elowan race shown during an encounter.




Your Ad Here

ScrewTurn Wiki version 3.0.5.600. Some of the icons created by FamFamFam.