home *** CD-ROM | disk | FTP | other *** search
/ 8bitfiles.net/archives / archives.tar / archives / genie-commodore-file-library / GEOSApps / CONVERTFORMT.TXT < prev    next >
Text File  |  2019-04-13  |  4KB  |  97 lines

  1. GEOS CONVERT UTILITY FILE STRUCTURE
  2.  
  3. The GEOS convert program is used to convert GEOS VLIR and SEQ structure files
  4. to Commodore SEQ structure files. Within the Commodore SEQ file which is
  5. created, all of the GEOS-related information about the file is contained. This
  6. includes the file's:
  7.  
  8.  - directory entry
  9.  - header block
  10.  - index table (if file is VLIR)
  11.  - data blocks
  12.  
  13. Convert also will convert these "GEOS format in Commodore SEQ" files back to
  14. their original form.
  15.  
  16. Whether Convert is processing a GEOS VLIR or SEQ file, the first two blocks of
  17. the resulting Commodore SEQ file contain the same information:
  18.  
  19. block 1: bytes 0 and 1 contain standard next track and sector pointers(NTS)
  20.          bytes 2 to 31 contain the file's directory entry, with the file's
  21.          original name and time stamp.
  22.  
  23. block 2: bytes 0 and 1: NTS pointer
  24.          bytes 2 to 255: bytes 2 to 255 of the file's header block.
  25.  
  26. When converting GEOS SEQ files, the rest of the blocks in the resulting
  27. Commodore SEQ file are the data blocks from the GEOS SEQ file.
  28.  
  29. blocks 3, 4 etc:
  30.          bytes 0 and 1: NTS pointer
  31.          bytes 2 to 255: bytes 2 to 255 of block from original GEOS SEQ
  32.          file.
  33.  
  34. last block:
  35.          byte 0 = 0
  36.          byte 1 = pointer to last byte used in this block (=$02 to $ff)
  37.  
  38. When converting GEOS VLIR files, the third block in the resulting Commodore SEQ
  39. file contains an index table for the file:
  40.  
  41. block 3:  bytes 0 and 1: NTS pointer
  42.           byte 2: number of blocks in VLIR record #0
  43.           byte 3: number of bytes in last block of record #0
  44.           bytes 4,5: # blocks/bytes in record #1
  45.           ...and so on until:
  46.           bytes 254 and 255: number of blocks/bytes for record#126
  47.  
  48.  
  49. If one of the block/byte pairs is (0,0), then the record does not exist.  If a
  50. pair is ($00,$ff) then the record is empty. The remaining blocks in the
  51. Commodore SEQ file contain all of the VLIR records, appended end-to-end,
  52. starting with the first existing record (usually record #0). Adding up all of
  53. the "number of blocks" entries in the third block will give you the total
  54. number of block which remain.
  55.  
  56. Thus if the VLIR file has two blocks in record #0, one block in record #4, and
  57. null pointers (no blocks) for all other records, then the resulting Commodore
  58. SEQ file will contain: 
  59.  
  60. Block 1:  directory entry
  61. Block 2:  file header
  62. Block 3:  blocks/bytes per record table
  63. Block 4:  block #1 of record #0
  64. Block 5:  block #2 of record #0
  65. Block 6:  block #1 of record #4
  66.  
  67. Note that the conversion process does not create a new file, it simply modifies
  68. the existing GEOS VLIR or SEQ file so that it conforms to the format of a
  69. Commodore SEQ file. Using a GEOS VLIR file as an example, this process
  70. involves:
  71.  
  72. 1) Creating a new block to contain the file's directory entry, changing the
  73. existing directory entry so that the pointer to the file's first block now
  74. points to this new block. The NTS pointer in this new block will point to the
  75. file's existing header block.
  76.  
  77. 2) Changing the NTS pointer in the block containing the file header so that it
  78. points to the file's index table block.
  79.  
  80. 3) Changing the file's index table block so that it has accurate "number of
  81. blocks/bytes" information for each record. Also, the NTS pointer in this block
  82. is altered to point to the first block of the first record which exists.
  83.  
  84. 4) Changing the NTS pointers in the first and last blocks of each record, so
  85. that the records are appended into a string of blocks.
  86.  
  87. Also, think about the reverse process. Convert will take a Commodore SEQ file
  88. which completely defines a GEOS VLIR or SEQ file and will convert it to the
  89. correct structure. Software developers may find this useful; if you are using a
  90. standard Commodore assembler which creates Commodore SEQ files, then if the
  91. data is set up right, Convert can be used to turn the Commodore SEQ file into a
  92. runnable GEOS VLIR or SEQ application! We will post a note in the future about
  93. how to do this.
  94.  
  95.  
  96.  
  97.