home *** CD-ROM | disk | FTP | other *** search
/ ftp.whtech.com / ftp.whtech.com.tar / ftp.whtech.com / Geneve / 9640news / CAT36 / 51TIEMUL.ZIP / FILES.TXT < prev    next >
File List  |  1994-04-15  |  5KB  |  97 lines

  1. ════════════════════════════════════════════════════════════════════════
  2. TI Emulator!                                                   4/15/1994
  3. v 5.0
  4.  
  5. written by Edward Swartz
  6. ════════════════════════════════════════════════════════════════════════
  7.  
  8.      This file describes the format of the emulated TI files used in TI
  9. Emulator! v5.0.
  10.  
  11.      First, the filename of a TI file is practically the same as on the
  12. TI, but it has changes to accomodate MS-DOS restrictions.  Of the ten
  13. characters, the last two will be put into the extension if necessary.
  14. Also, several illegal DOS characters -- <>=,;:*?[]()/\!~ -- will be
  15. changed by adding 80h to their ASCII values.  This may make it difficult
  16. to type the filename from DOS... but these ARE TI files.
  17.      For your convenience, the most common TI filename characters that
  18. are illegal in DOS, '-' and '/', will be changed into '¡' and '»'.  The
  19. '¡' character is IBM ASCII 173 and '»' is code 175.  Just type the code
  20. on the numeric keypad with the Alt key held down to get these
  21. characters.
  22.  
  23.      The actual format of the file tries to follow the sectorized format
  24. used on the TI.  All sectors are 256 bytes long.  All files, though,
  25. start with a 128-byte record describing the file attributes.  These
  26. first 128 bytes of a TI Emulator! file are copied directly from the TI's
  27. File Descriptor Record (FDR) for that file.  Those bytes are, if you
  28. want to know:
  29.  
  30. byte 00-09 : Filename.  Unused chars are spaces.
  31.      10-11 : unused
  32.      12    : File Status Flags (the file type)
  33.           
  34.                Bits:
  35.                0 = program (1) / data (0)         (1h)
  36.                1 = internal (1) / display (0)     (2h)
  37.                2 = unused                         (4h)
  38.                3 = write protected                (8h)
  39.                   In the TI DSR, this bit write-protects the file.         
  40.                   Under TI Emulator!, this is implemented using the DOS    
  41.                   write-protect bit.  If the bit happens to be set, it     
  42.                   will be ignored.
  43.                4 = unused                         (10h)
  44.                5 = unused                         (20h)
  45.                6 = unused                         (40h)
  46.                7 = variable (1) / fixed (0)       (80h)
  47.  
  48.                Putting these together gives these types:
  49.                >00 = DIS/FIX       >01 = PROGRAM
  50.                >02 = INT/FIX       >80 = DIS/VAR
  51.                >82 = INT/VAR       
  52.  
  53.                On newer systems, the 10h bit is used in combination        
  54.                with backups. (Like the archive bit in DOS files.)  TI      
  55.                Emulator! doesn't use this bit.
  56.  
  57.      13    : Number of records per sector.  = 256/Record Length,
  58.              even for variable files.
  59.      14-15 : Number of Sectors Used.  In TI byte order.
  60.      16    : EOF marker for variable and program files.
  61.      17    : Record length (0 in program files)
  62.      18-19 : Number of fixed records OR number of sectors used by          
  63.              variable files.  In Intel byte-order.
  64.      20-27 : unused (date/time in newer systems)
  65.      28-255: unused in TI Emulator! v5.0 but really encoded pointers to
  66.              the sectors used by the file.
  67.      
  68.      Then, the sectors in the file follow directly afterward in one
  69. contiguous block.  A TI Emulator! file should always be (n*256)+128
  70. bytes long, where n is the value in bytes 14-15.
  71.  
  72.      Under the TI Device Service Routine (DSR), no records are ever
  73. broken over a sector boundary.  So, a fixed file with record length of
  74. 129 bytes will waste 127 bytes a sector.  TI Emulator! follows this
  75. standard.  (It's wasteful, but it's compatible!)
  76.  
  77.      In variable length record files, each record consists of a length
  78. byte and the data.  A length of zero is legal, and the record is only
  79. the zero byte.  Up to 255 records may be stored in one sector (all
  80. length 0, of course).  In a sector, all records directly follow each
  81. other except when a record cannot fit in the remaining space in a
  82. sector.  The byte where the new record would have gone is set to >FF to
  83. signify end-of-sector.  (It is called the end-of-file marker, but this
  84. really only signifies the end of the sector.)  To detect end-of-file, a
  85. combination of the end-of-sector marker and the <Number of Sectors Used>
  86. record are used.  An EOF marker must appear in a sector, so the maximum
  87. number of bytes in a sector that can be used in a non-program file is
  88. 255.
  89.      In fixed length record files, only <Number of Records Per Sector>
  90. records will be stored in one sector.  Less than this number of records
  91. may only appear in the last sector.  When a new sector is allocated, the
  92. first record always starts at byte 0, and others follow contiguously.
  93. The longest record length is 255 bytes; however, this doesn't mean that
  94. all the bytes in a sector can't be used:  a fixed file with a length of
  95. 64 characters can have exactly four records in each sector.
  96.  
  97. ════════════════════════════════════════════════════════════════════════