Spectrum File Tools =================== J.G.Harston - jgh@mdfs.net http//mdfs.net/Software/Spectrum/Tools The Spectrum file tools allow various different Spectrum emulator files to be built, examined and manipulated. The tools recognise standard (TAP), TZX and Speculator tapefiles, and microdrive image files (MDR). They will run on any platform capable of running BBC BASIC, such as BBC, Master, DOS, Windows, Unix, etc. Pre-built Windows binaries are available. The commands can be run with *command (parameters) on BBC/RISC OS or command (parameters) on DOS/Windows/Unix/etc or CHAIN "command (parameters)" from BASIC. TAPCat, MDRCat ============== List files in a tape file or microdrive image file. Syntax: TAPCat infile -hex -dec MDRCat infile -hex -dec Parameters: infile - source file to list files in. -dec - display file information in decimal. -hex - display file information in hex. MkTAP, MkMDR ============ Build a tape file or microdrive image file from binary files. Syntax: MkTAP outfile infile [name [load [exec [type]]]] -a -e -v -t -s MkMDR outfile infile [name [load [exec [type]]]] -a -e -v -t title Parameters: outfile - destination tape or microdrive file to create. infile - source file to add to the output file. If infile is a directory, then all files in the specified directory are added (BBC/RISC OS only). If no infile is specified, then the user is prompted for files to add. name - the Spectrum filename to use for the file in the output file. If no name is specified, then infile is used as the filename. If infile is a directory, then the names of the directory entries are used as the Spectrum filenames. load - Spectrum hex load address to use. If not specified, or adding all files in a directory, then any BBC/RISC OS load address is used. If a load address is given and no other addresses, the filetype is set to 0 (Basic) and the extra address is set to the file's length for a Basic program with no variables. exec - Spectrum hex exec/extra address to use. If not specified, or adding all files in a directory, then any BBC/RISC OS exec address is used. If a load and exec address is given, the filetype defaults to 3 (Code). type - Spectrum filetype to use. If not specified, then the filetype in any BBC/RISC OS load address is used, otherwise 3 is used (Code). Use a type of FFFF to specify a Print file for microdrive images. -append - appends to the output file, so multiple BINtoTAP or BINtoMDR commands can add multiple files to an output file. For instance, the follow sequence of commands will create the tape file 'samples' including in it the files 'mdump', 'medit' and 'mcat'. MkTAP mdump samples mdump -e MkTAP medit samples medit -e -a MkTAP mcat samples mcat -e -a -embed - sets the load/exec addresses from the last two words at the end of a binary file. This overrides any file address or any specified on the command line. The file added to the output file will be four bytes shorter than the source file, so omitting the load/exec addresses. The easiest way to specify the load/exec addresses in a assembly source file is to include the following line at the end of the assembly: DEFW LOAD,EXEC with LOAD and EXEC being labels set appropriately. -title - specifies the title to use for the microdrive image file. If no title is specified, then " " (ten spaces) is used. -tzx - creates a TZX tape file. This differs from a standard tape file in there is a ZXTape header at the start of the file, and a 'Block 10' header before each tape block. -spec - creates a Speculator tape file. This differs from a standard tape file in that there are no checksum bytes after each block, and the block header length is two bytes less. -v - verbose, will list file entries as they are copied. UnTAP, UnMDR ============ Extracts the files from the specified source file. Syntax: UnTAP infile [dest] -v UnMDR infile [dest] -v -d Parameters: infile - source file to extract files from. dest - destination directory to extract files to. If no dest is given then files are extracted to the current directory. -d - the microdrive title is used as the name of a directory that the extracted files are saved to. -v - verbose, will list file entries as they are extracted. TAPtoMDR, MDRtoTAP ================== Copies the files in the specified source file into the specified destination file. Syntax: TAPtoMDR infile outfile -v -t title MDRtoTAP infile outfile -v -t -s Parameters: infile - source file to copy to the output file. outfile - destination tape file or microdrive file to create. -title - specifies the title to use for the microdrive image file. If no title is specified, then " " (ten spaces) is used. -spec - creates a Speculator tape file. This differs from a standard tape file in that there are no checksum bytes after each block, and the block header length is two bytes less. -tzx - creates a TZX tape file. This differs from a standard tape file in there is a ZXTape header at the start of the file, and a 'Block 10' header before each tape block. -v - verbose, will list file entries as they are copied. TAPDump, MDRDump ================ Dump raw data in a tape file or microdrive image file. Syntax: TAPDump infile -s MDRDump infile -s Parameters: infile - source file to dump. -short - don't display the data within files. ZXConv ====== Converts between various Spectrum program files. Syntax: ZXConv -intype infile -outtype outfile [options] Parameters: -intype and -outtype can be: -bbc BBC BASIC -b or -zx ZX Basic -d Devpac -t Text Options: -n Output line numbers to text files. Converting program files to different formats allows them to be edited on other platforms or with other editors. ZXDisp ====== Displays a Spectrum screen from within a snapshot or memory dump file. On Windows the screen is displayed in a window, then it waits for a keypress. Syntax: ZXDisp infile Parameters: infile - source file. Recognises Speculator and .SNA snapshots and SCREEN$ memory dumps of Spectrum screen memory. SetSpec ======= RISC OS tool to set file load/exec attributes from embedded addresses. Syntax: SetSpec infile ZXSend ====== Sends a file from a BBC/Master to a Spectrum via serial port. Syntax: ZXSend filename On the Spectrum use LOAD *"b" before using *ZXSend on the BBC. SerLink ======= Sets up a Break Intercept to connect the BBC's input to the serial port, letting the BBC be controlled from the other end of the serial link, for instance with BBCtoSPEC. Filename translation ==================== Spectrum filenames can contain any character. Many of these are not valid filename characters on other filing systems. When extracting files, the tools translate characters in Spectrum filenames: Characters<' ' translated to '_' Characters>'~' translated to '_' ' ' translated to '_' BBC/RISC OS: Source character: " # $ % & : < > * . @ [ \ ] ^ { | } ~ Translated to: ' ? S ; + ; ( ) + / = ( / ) ' ( ' ) ' DOS/Windows: Source character: " : < > ? * / \ | Translated to: ' ; ( ) # + . / ' Unix/Linux: Source character: " ? * / Translated to: ' # + .