Sprinter DOS Library

ZXNet echo conference «real.speccy»

From Ivan Mak To All 29 September 1999


Greetings, All!

;********************************************************************************
;
; Shared Library Concept
; for working with TR-DOS/IS-DOS/MS-DOS/CD-ROM/OTHER (TIMCO.LIB)
;
;*****************************************************************
;
; Completely your own memory. Including your stack, recovery
; interrupts, etc. etc.
; Call inside TR-DOS, the library is loaded into the zero bank of RAM
; and can switch this jar to others if necessary.
; There is also a direct entrance, bypassing TR-DOS - RST 18 in
; EXPANSION program cannot connect the zero jar with the library
; Actually, she doesn’t even know about it, but uses all the functions like
; advanced BIOS features
; Initially, a program
is written into the ROM in place of this library; search for the TIMCO.LIB file on disk, load it into RAM and run
; the desired function. Thus, the library is initialized
; transparent to the user
;
; Full error handling. Includes queries like:
; "Retry,Abort,Ignore", "Overwrite? Y/N", "Insert Disk!"
; "Read Only!", "File System not correct!" etc. etc.
; Requests are displayed in the system window, which
; has no right to touch data in video work areas
; screen (Spectrum-Mode, system Video-RAM)
; Processingmismatch between disk types and operations, etc.
; for example, you cannot work with FAT on a TR-DOS disk
; It is also possible to support partial compatibility, for example,
; FAT emulation on TR-DOS disk
; When processing errors, either the Spectrum screen is used
; or the system window of the Spectrum screen, with the corresponding
; storing data
;
; When working with windows, the program dynamically allocates memory for itself, and
; in case of memory shortage, part of the data can be downloaded to
; hard drive in TIMCO.SWP file
;
; The functions have different levels of working with disks
; Levels:
; L0 - physical level. there is no disk system
; sector and multi-sector read/write
; low-level formatting
; L1 - Logical disk level, the program must know
; file systems work correctly with them
; L2 - Logical disk-file-directory level
; The program is untied from the file system and can change
; disks, directories, work with files, but do not interfere
; into disk structures
; L3 - Text level (command processor)
;
; When working with high-level L3 commands, use a special % icon instead of
; on the file name should cause the file panel to appear.
; The %\ icon instead of a directory should cause a tree
to appear on the screen; directories with open or closedpaths and cursor position on
; current directory. %\% should cause a tree to appear and then
; file panel. %: causes the disk selection panel to appear.
; The disk selection panel may be present in a different form on the file
; panels and directory tree panels. The file panel should also
; be able to call the directory tree
; The %*.trd icon should automatically exclude all
s from the file panel; not .trd files. On the file panel, depending on the option, it can also
; present or button to select other file names
;
; To work with the tree, file panels and disk selection panel they can
; text video pages should be used, but information will be released
; they must be restored. The directory tree should have
; ability to name (!) a new directory. The named directory is given to the program
; The file panel should be able to create a new directory and
; name (!) file, The created directory is opened, and the named file
; given to the program. The named files or directories may already exist.
; The appearance and disappearance of panels can be different: Simple
; emergence, descent from below, appearance from the side, arrival from somewhere.
; Expanding from a small window is not supported!
;
; On the panels it is possible to use a mouse, which must “sit in the window”
; Exit may happenonly when this window is closed or when
; jumping over windows opened with this command.
;
; Work with FAT is carried out in a 32-bit format, which is converted internally
; to the desired view. When working, a special algorithm for working with
is used; FAT backup. A backup copy is recorded only after
; carrying out all operations on creating/deleting files and directories
; When reading FAT, the backup copy matches the main one
; for the case if changes were not made during the operation
; When writing, only the first FAT is written, and the copy is written only
; at the end of the operation. In this case, information about the changed
is used; FAT sectors and, if some sector has disappeared from the cache, it is read
; again to carry out the duplication operation
; The FAT cache is 8 kilobytes. For floppy disks, it contains the entire FAT
; for HDD the working part is 15 sectors 512, the cache byte is used
; to control the operation of the cache
; For normal operation during dual-disk operations, there are two FAT caches
;
; Directory and data cache.
; The data cache is used when working with direct access files.
; Memory for this cache is used as needed, both for data and
; and for FAT file chain
;
; When working with TR-DOS, it is possible to create backup copies of a directory in a hidden
; file on disk, the file can be either at the beginning or at the enddisk
; TR-DOS files in .trd are designated as follows: disk.trd:"File1"B
; For example, the command COPY disk.trd:"Text1"C A: will copy
; file from inside the TRD image to disk A, while disk A can be like
; TR-DOS and MS-DOS
; When copying from MS-DOS to TR-DOS, additional
may be specified; file options. HOBETA files have their own special feature -
; extension .$xx copying such files from TR-DOS to TR-DOS results in
; accordingly, to the acquisition and disposal of files
;
; (Task switching is another matter)
;
;********************************************************************************
;
;*****************************************************************
;
; 0. work with disks
; L0 a. Opening a physical disk
; L0 b. Write/read physical disk sectors by absolute number
; sectors
; L0 c. high-level disk formatting. Creation of a boot sector,
; root directory and FAT
; For TR-DOS - corresponding entries
; L0 d. Physical track formatting
; L0 e. Checking disk sectors
; L0 f. Write/read physical disk sectors by physical
; sectors, heads, tracks
; L1 g. Opening work with drives A:, B:, C:, D:, E:,...
; The opening is performed according to the disk description and the disk is assigned
; per letter. Set typedisk. Including R/O, type
; systems - TR-DOS, MS-DOS, (IS-DOS), CDFS,...
; jumping through partitions, etc. etc. occupying memory for data
; disks, FAT caches, etc. etc.
; Including opening RAM-Disks!
; L1 h. closing disk work, closing all files, writing data
; caches, etc. etc.
; L1 i. Unwriting all changes made to the disk without closing
; disk
; L1 j. fixing the disk. After this operation, the disk cannot be closed
; used to work with system disks
; The first system drive is always C:
;
; 1. working with FAT
; L1 a. Get the cluster number from the previous
; L1 b. Track a sequential chain of clusters
; for fast reading/writing to disk
; The chain of file clusters is written to the cache in a special format
; for programs for working with files.
; L1 c. find the first free cluster
; (there is a variable where the last used
; or the first free cluster on the disk is recorded)
; L1 d. find the required number of free clusters
; Returns the found number of free clusters
; L1 e. occupy the required number of free clusters starting from a specific
; cluster - create a new chain and write it to disk
; If the specified first cluster is busy, then the subsequent ones
are busy; The function is not required to check forrequired number of clusters
; and when returning, indicates how many clusters were able to be occupied
; L1 f. divide the chain of clusters into two parts and write to disk
; L1 g. connect two chains of clusters and write to disk
; L1 h. release the chain of clusters and write to disk
; L1 i. enter the required cluster number in the required place
; L1 j. write all changes to disk (ALWAYS USING CASH FAT!)
; L1 k. duplicate changes in FAT
backup copy; L1 l. restore disk using FAT backup copy
;
; 2. working with directory and file records
; L2 a. change the current drive by letter (the drive must be open)
; L2 b. setting to directory (CD)
; L2 c. create directory (MD)
; L2 d. delete directory (DEL)
; L2 e. delete tree (DELTREE) ???
; L1 f. find file in directory
; L1 g. create a file entry without writing to disk
; L1 h. find next file
; L1 i. delete file entry together
; with a chain of clusters (DEL)
; L1 j. enter a file entry into a directory at a specific location
; L1 k. write all changes to FAT
to disk; L1 l. compact the directory (kill all entries about deleted files)
; for TR-DOS - physical disk compaction
;
; 3. working with files
; L2 a. read the file into the memory block (without opening/closing)
; L2 b. write file frommemory block (without opening/closing)
; L2 c. create a file of the required length (including zero)
; L2 d. open file for direct access
; L2 e. close direct access file
; L2 f. read part of the file (direct access files)
; L2 g. write part of the file (direct access files)
; L2 h. Increase file length (add clusters if necessary)
; L2 i. trim the file (delete clusters, including to zero length)
; L2 j. create and write a file from a memory block (without opening/closing)
; L2 k. write to disk all changes in file data
; L2 l. Cache management, enabling/disabling recording of changes in files
; when working with a specific file
;
; 4. Error handling when working with disk and additional operations.
; L2 a. setting error handling type
; default - return with the error flag
set; L2 b. system requests for error handling with polling of keys and
; displaying system messages on the screen
; L2 c. setting the message type for high-level operations
; For example, copy processing, etc.
;
; 5. High-level commands (set on the command line)
; Actually small COMAND.COM. Must be able to understand BASIC
; commands LOAD, SAVE, etc. with MS-DOS system
; L3 a. Installation of the current disk, with the option to install TR-DOS/MS-DOS
; default. How TR-DOS disk can be installed file
; with the .trd extension using the command disk.trd:
; L3 b. Opening/reassigning drive to letter
; L3 c. Copying files, including copying directories
; COPY file1.trd A:
; If drive A: is a TR-DOS drive, then the file is copied to
; the entire disk. Otherwise, you must directly specify the name of the TR-DOS file.
; When copying back, if only the drive is specified, then
is created; *.trd disk image
; Single disk copying! Including MS-DOS<=>TR-DOS
; L3 d. Creating a directory
; L3 e. Delete file/directory
; L3 f. Delete tree
; L3 g. Creating a file of a given length
; L3 h. Recording a file with direct indication of data addresses,
; including the pages in which the recording is made
; L3 i. Reading a file with direct indication of addresses, including
; number of pages where reading is performed. Pages are indicated
; either the first number or a list of numbers
; L3 j. Creating a RAM-Disk of a given length inblocks with formatting
; TR-DOS/MS-DOS/IS-DOS, etc.
; L3 k. Removing RAM-Disk
; L3 l. Reading/writing ramdisks to HDD/FDD
files; L3 m. Issuing a directory of disks
; L3 n. Setting default responses, window sizes and positions.
; L3 o. Display file windows to select a program to run.
; By selecting two windows, the user can jump from window to window.
; pressing the Fi keys leads to exit from the window with a message
; which keys are pressed and in which window.
; Pressing Enter on an executable file runs that file.
; Windows are first removed from the screen.
; L3 p. Call to execute .Bat file
; L3 q. Call the command line and execute using the ENTER key or exit
; by ESC.
; The up/down arrows control searching for commands in HISTORY
; L3 r. Setting WIN or DOS mode. In the latter, the windows do not open
; and all results are displayed on a text screen. Options %:%\% in
; in this case are processed as errors.
; L3 s. Using variables %1 %2 %3 etc. as in MS-DOS bat files
; those. %1: will select the drive specified on the command line
; bat file
; L3 t. HELP command with description of other commands !!!
; A message about an invalid command also displays a message
; about the HELP command, in windowed mode among the error response buttons
; should beHELP button.
;
; 6. High Level Commands (perhaps this is another library)
; L3 a. High-level language, support for BASIC commands,
; L3 b. Window management
; L3 c. HTML browser
; L3 d. Image viewer, WAV player
; L3 e. Interactive user menu
;

Wow! The Protoss are attacking my Zerlings! It's time to get going. Ivan... data-saferedirecturl="https://www.google.com/url?hl=ru&q=http://www.atlant.ru/peters&source=gmail&ust=1785433335719000&usg=AOvVaw3vwtcyZnXQuSCJYbLSFDvy">www.atlant.ru/peters *