------------- B - T A P E ------------- Version 1.0 for BW-DOS and SpartaDOS 3.2 By Jiri Bernasek (BEWESOFT) INTRODUCTION In the Czech republic (the country where I live) most Atari XL/XE users have no disk drive. At the begin, the disk drives wasn't available here, and when they later appeared on the market, they was pretty expensive. Because of this, the tape recorder XC12 is the only data-storage device not only for game-freaks, but also for many "serious" users. Unfortunately, the original tape-system (the "C:" device) is not good for daily use. It is slow, and also not safe. Because of this, several tape recorder upgrades were built in the eastern part of Europe during the previous years. All these systems are working with a little hardware modification inside the tape recorder. The most popular one is called "Turbo", and it was built in the Atari user club of Prague. The hardware isn't bad, but the first software was really awful, and - unfortunately - became very popular. It was just a little game-loader, with the file-format copied from poor Sinclair ZX Spectrum. Many programs were then modified (cracked) for this "system" - it was even necessary to add a quite long new tape handler to every "serious" program, because no CIO-handler was available. In fact, the original "Turbo" gave only high speed, without of compatibility. Later, the software was improved. After a few experiments with linking the new tape-system under CIO, finally TT-DOS appeared. It is a DOS 2.5 clone with a high-speed tape handler "B:" included. In my opinion, this is the first version of "Turbo", that goes behind the original "C:" handler, and gives something more. Not only high speed, but also a DOS-alike operation. And comfort - for example when the reading fails, no problem: Simply rewind the tape, and read the bad block again (no need to repeat reading of the whole file). A few months ago, they asked me to link this tape-system to my BW-DOS. So, now I'm releasing "B-TAPE". It is an even more improved version of this popular tape-system, compatible with BW-DOS and also SpartaDOS 3.2. It was made especially for czech users, but I decided to release also an English version. I don't think that a system like this can become popular in countries, where almost everyone have a disk drive, but may be that someone will be interested... Well, you may wonder why I'm writting all this. It is for you, "western" users, to understand why the "B-TAPE" was made, where it came from, and what is it good for. Now, a real "introduction" to the program follows... B-TAPE is an advanced high-speed tape system for use with BW-DOS or SpartaDOS 3.2d, 3.2e, or 3.2f. The data-transmission is 5-10 times faster than the standard "C:" handler (depending on selected mode), and is safe (sometimes even more than "C:"). The file-format is compatible with TT-DOS (an older czech DOS for both disk and tape). B-TAPE works only with a tape-recorder modified for "Turbo". It's a pretty simple modification, and it doesn't affect the original function. Look at chapter "Hardware" for more info. The B-TAPE package contains also a kind of Micro-DOS compatible loader for starting games etc. It can load almost every file-based games, demos etc. - also these ones with intros, depacking routines, and other things between loading. With B-TAPE, it's also possible to use BW-DOS with no disk drive. But it's clear that such a configuration is quite hard to use. For using BW-DOS with no disk drive, Ramdisk is strongly recommended. HARDWARE B-TAPE needs a simple hardware-modification inside the tape recorder. This modification is called "Turbo", and is available from: JRC, Chaloupeckeho 1913, 169 00 Praha 6, Czech republic, tel./fax +42 2 354979, fax +42 2 521258. They also sell modified new recorders. For the Atari users who live too far, the documentation of the upgrade is included. I simply examined my (modified) recorder, and wrote the following info. Proceed at your own risk! The basic idea is to add a second operation-mode to the recorder. It is only for reading, the recording section is almost unchanged. The new mode is selected by the COMMAND line "Low" at the same time with MOTOR line "High" (tape recorder on). (This occurs only while reading from tape, so the COMMAND line "Low" may not cause any troubles with other SIO devices - the DATA OUT line is off.) The signal from tape then goes (after amplification of course) directly do the DATA IN line (not via the decoding circuit). The tape recorder Atari XC12 with upgrade is shown on picture "XCTURBO.PIC" - use any painter software for hi-res graphics (Basic mode 8+16) to view. The modification is following: Remove C4, C6, C13, D3, D4, and R23. Add a 68kohm resistor between U1c inputs as shown on picture. Replace R24, R38, and R6 to match the values shown on picture. Add a transistor (for example BC546, almost any universal NPN type is OK) with a 47kohm resistor and two diodes - as shown. You can use the diodes that you just removed from the positions D3 and D4. Open the I/O connector at the end of cable. Remove the wire from pin 11 (orange or red), and place it to pin 7. Add a 10nF capacitor between these pins (7 and 11). After the modification, the recorder must work in the same way as before. And of course, B-TAPE should work also. If it doesn't work, and you didn't find any mistake, try to check the values of components inside the recorder (and replace to match the values shown on picture). If you experience noises on the data-line, try to place a small capacitor (22pF or so...) at the position C6 (the original capacitor is removed to increase frequency-range, and so allow high-speed transmission). This simple upgrade decreases the volume of audio signal that goes from tape to TV-speaker. If you don't like this, leave the line from pin 11 of I/O connector to C12 unchanged (add no capacitor into connector, and don't link it to the added transistor), and connect the emitter of new (added) transistor directly to pin 7 of I/O connector using a special wire. Unfortunately, this wire must be placed at the outside of the original I/O cable. INSTALLATION The high-speed tape system is supported by a new resident command "BTAPE". This software doesn't affect the original "C:" handler. BTAPE [mode][speed][/memory] (Resident command) mode ..... SS, SD, LS, LD speed .... 0-20 memory ... B[bank][,address] O[address] or OX This command installs a new tape handler "B:" that allows the high speed operation. All parameters excepting "memory" may be changed by starting this command again; in this case it isn't necessary to repeat the unchanged parameters. The function of the parameters is following: "mode" may be "SS", "SD", "LS", or "LD". The first letter controls the length of gaps between blocks - "S" is for short gaps, and "L" means long gaps. The second letter controls the function of double blocks - "S" means single blocks, "D" is for double blocks. Default is "SS". The parameter "speed" allows you to select one of the 21 possible transmission speeds. Default is 12. Both the parameters "mode" and "speed" are important only while recording data to tape. While reading from tape, the B-TAPE software recognizes the used mode and speed automatically. More info about these parameters will come later. The last parameter "memory" allows you to select, where will be the main part of BTAPE program in memory. This resident is quite long (3kB), so installing it into low memory may cause troubles with too high MEMLO value. Because of this, the resident code of BTAPE may be also installed under OS-ROM, or into a Ramdisk bank. This reduces the size of resident code in low memory to minimum (110 bytes). Default setting (with no "memory" parameter) is to install the whole program into low memory. This increases the MEMLO value a lot, so many programs may not work in this mode. The DOS commands and Atari Basic are OK. The parameter "/O" causes the resident code of BTAPE to be installed under OS-ROM. In this mode, the compatibility is like with SpartaDOS. MEMLO is OK, but programs like Turbo Basic or XLRDISK may not work. Advanced users may add a hexadecimal address after "/O" (BTAPE will be then installed at the specified address (the length of the code is $BFC - for version 1.0), and so it may work with programs that are using just a part of memory under OS-ROM). Under SpartaDOS 3.2, you must use parameter "/OX" while installing BTAPE under OS-ROM. The "AINIT" function then doesn't work, and the errors in CP are shown only as numbers (both the functions are removed to provide space for BTAPE). The parameter "/OX" may be used only under Sparta. With the parameter "/B", the BTAPE resident code will be placed into a Ramdisk bank. (Advanced users may add a bank number (value for $D301) and address when necessary.) This is the most universal mode (but you must have min. 128kB RAM). The "RAMDISK" command must be then installed with a configuration file, to reserve a bank for BTAPE (see later). The default bank used by BTAPE is $E3. You can also use the "E" parameter, but in this case the capacity of Ramdisk will be reduced much more (64kB instead of 16). RAMDISK configuration To reserve a bank of Ramdisk memory for another use (in this case BTAPE), you must use a configuration file every time when you call the "RAMDISK" command. In the B-TAPE package, there are four configuration files included. These files are reserving the bank $E3 (that is used by BTAPE), and they are designed for the following memory-expansions: "B_130XE.RD" is for Atari 130XE (64kB), "B_COMPY.RD" is for a "Compy Shop" type expansion (256kB), "B_RAMBO.RD" is for a "Rambo" type (256kB), and "B_NEWELL.RD" should work with a "Newell" 1MB expansion. Advanced users may create another Ramdisk-configuration files using for example the command "HEXEDIT". The file contains a list of banks available for RAMDISK use, each byte for one bank (values for $D301). USING B-TAPE The access to tape in high-speed mode is provided by device handler "B:". This handler uses filenames, so the full specification should be "B:name.ext". The syntax of a filename is the same as for disk-files under BW-DOS (including wildcards). You can select the "B:" device as working drive in the CP (by typing "B:"). The length of tape-files under BTAPE is limited to 257040 bytes. Using the recorder under B-TAPE B-TAPE routines are using simple sound signals for communication with the user during the I/O operations. Recording a file on tape starts with the well known "double beep" sound (known also from "C:"). It's necessary to find the correct place on tape, press and on the recorder, and then on computer. BTAPE will then record a sound signal "start of file" (a short melody going up and down again) followed by the file itself. Reading a file starts with a single "beep" (also known from "C:"). You needn't to press any keys on computer - the program waits for data immediately after the "beep", so just press on recorder. BTAPE will search for a file and check its name. When the name don't match the file-specification, a sound signal "bad file" appears (exchanging two tones) - it's of course necessary to move the tape to correct file. If you don't know where it is, abort the operation with , and use the "DIR" command for orientation. When no readable block is found for 4 minutes, the operation is terminated (Error 138). The program may ask you also for moving the tape to the correct block in the file - mostly the first block. A simple melody that is going up indicates that you should use the button (or wait - if the correct block is not too far), and a melody going down asks you to use the button. While searching for the correct file and block, the program accepts any file that match the file-specification. But once a block with correct name and serial number is found, the program goes to reading mode. Then, no blocks from other files are accepted - even if the filename is identical. The sound signals "F.FWD", "REWIND", and "bad file" may also occur during the reading process. One of the possible reasons is that reading of some block failed, and so the program asks you to rewind tape for retry. This may be also caused by bad length of the gaps between blocks (more info will come later). Another possible reason is a request from the application software to read from an other position in the file (the POINT function - it occurs for example with the command "OFFLOAD"). When the tape stops for a longer time (the reading is finished, or interrupted - for example some kind of intro is working while loading a game), it's good to press on the recorder to avoid damage of the tape. During the high-speed tape operations, the TV screen is off. While recording to tape, the screen is simply black, and while reading, it shows the signal from tape. Disabling the TV screen is necessary to allow exact timing of the I/O routines (no hardware support is available for the used format). BTAPE installed under OS-ROM may also sometimes affect displaying of text modes (because of switching the ROM off for executing some of BTAPE routines). The problem is only on the screen; it may not cause any damage. The first operation executed on a disk drive after a tape-oriented operation will allways begin with a short pause (1 sec). This is necessary to avoid crashing the first disk I/O by the tape recorder, that is unfortunately "active" also a while after turning off (because of its capacitors). This function is very important while copying files from tape to disk. When the "XFSIO" command is used, it must be installed before BTAPE. Otherwise it may override the mentioned function (the pause). Selecting mode and speed While recording a file to tape, the parameters "mode" and "speed" are important. The speed depends on the quality of used recorder and tape. Mostly you'll be able to use even the highest speeds, but when there was problems with the hardware-expansion, or you'll access the same tape with more recorders, it's good to select a lower speed. The default speed 12 should be OK in most cases. The function of "double blocks" means that every block will be recorded twice. In this mode, the file may survive small drop-outs on the tape, but the effective speed of transmission is decreased of course. This mode is good especially for very important files. The first block of every file is allways doubled. This allows programs like "COPY" to find the file with the "DIR" function, and then start reading immediately, and it also helps in the case that recording overruns into next file on tape a little. The length of gaps between blocks depends on the software, that will read the file later. In most cases, the mode of short gaps is good - this mode is for programs that read the whole file at once, without of pause. In this mode, the tape recorder don't stop between the blocks, and the reduced length of gaps is saving time. When the application software needs too long time for interpretation of the received data, the recorder will stop after a while automatically. While recording to tape, it is no problem (you'll only get a bit longer gap), but while reading from tape, the recorder will overrun the begin of next block. In this case you'll need to use the button - this indicates that the mode of long gaps would be better. In this mode, the recorder stops after each block, and the gaps are long enough for the recorder to stop/start while reading from tape. It decreases the transmission-speed of course, but the application software have now unlimited time to interpret the data. This mode is good for example while doing I/O operations using Basic-commands. The binary program-files are a special case. Mostly the short gaps are OK, but there are programs (especially games and demos) that execute pretty long actions between loding - different intros, depacking etc. Because this occurs only on a few places in the (mostly quite long) file, the mode of long gaps would mean a big loss of time. In this case, you should copy the file to tape with the command "BINCOPY", that incerases the length of certain gaps in the file. (More info later.) DOS COMMANDS ON TAPE The CP-commands of BW-DOS are mostly working on tape. The commands that doesn't work are these ones that use special disk-oriented functions: MENU, UNERASE, BACKUP, MOVE, MSDOS, BOOT, CHVOL, XFSIO, FORMAT, PROTECT, UNPROTECT, RENAME, ERASE, CREDIR, DELDIR, CWD, DIRMAST, CHKDSK, HEXEDIT, and AUTOCWD. Use of such commands on tape is a nonsense anyway... But these commands may become useful also while working with no disk drive - when you'll use a Ramdisk. The batch files and HardCopy function works with tape, but without of a Ramdisk or a disk drive, it's almost senseless. Because the tape handler can't open more files at the same time, the working batch file will block reading of commands and other files. Some commands have different functions for disk and tape: DIR [B:][filename] DIRS [B:][filename] (Internal commands) These commands are useful for the orientation on tape. Both the commands have the same function for tape: It'll read one block (any block that match the file-specification), and display name of the found file followed by serial number of the block in the file. When the file was recorded with double blocks, a little star will appear in front of the name. Because of compatibility, the listing keeps the syntax of a disk-directory - including the "FREE SECTORS" counter (it's senseless on tape, but there are programs that needs it while interpreting such a listing). COPY source destination (External command) The "COPY" command works for tape-files too, of course. But it's important to use the new version, found on BW-DOS 1.30 master disk or in the "Update 2" package. The older version can't carry the original filename from tape (so you must allways type both the filenames - source and destination), and it also can't copy directly from tape to tape. This is also true for the internal "COPY" in SpartaDOS. While copying directly from tape to tape, you can only work with files that fit into the free memory at once. The maximum length depends on the version of DOS, installed resident commands, and also the status of internal Atari-Basic (or other cartridge installed). To get an approximate number, you can subtract MEMHI - MEMLO - length of the "COPY" program. (First two numbers are shown by the "MEM" command, the last one comes from a disk-directory.) TAPE BOOT BOOT is loading of the DOS after power-on. With B-TAPE, the boot may be also executed from tape. Boot loader The first file on a boot-tape must be the Boot loader. It is a little program that loads the DOS itself and allows also loading of necessary residents, such as "BTAPE", "RAMDISK" etc. The Boot loader is stored in the same format as common tape-games to allow easy booting of the tape. TAPEBOOT (C|T) (External command) This command records the Boot loader to tape. With the "C" parameter, you'll get a common boot-file in the "C:" format - such a file may be easily booted by holding down the key during power-on. The length of this loader is 14 blocks. The "T" parameter was included especially for czech users. With this parameter, the "TAPEBOOT" command records the same loader in the format "TURBO 2000" - the very first version of the "Turbo" system. This is useful for the users, who own a cartridge with Turbo 2000 loader (such cartridges was sold here in the czech republic for several years). The Boot loader is allways the same, so you can transfer it also with different tape-copiers. Every files after the Boot loader will be in the B-TAPE format. The first of them must be a DOS file (a file that match the specification "X*.DOS"). It may be any version of BW-DOS, or SpartaDOS 3.2d, 3.2e, or 3.2f. The file is stored on tape without of any changes - you can copy the DOS from disk to tape and backwards without of problems. Configuration file The next file (after the DOS) must be a configuration file. This file must be named "CONFIG.B", and it is a text-file that contains the commands for initializing the system after boot. (Like the "STARTUP.BAT" file on disk.) This file should be shorter than 500 bytes - otherwise an "Out of memory" error may occur with the internal Atari-Basic active. You can create the configuration file simply by copying it from the "E:" device - use the command "COPY E: B:CONFIG.B", and then type the contents of the file (use +<3> to finish). The configuration file is interpreted by the Boot loader. This is necessary to allow reading of high-speed tape files also before installing the "BTAPE" command, but there are also some limits: The configuration file may contain only resident commands, and the commands "COPY", "DATE", and "TIME". No commands in the configuration file may be started from other devices than the high-speed tape system (but parameters may work with other devices too). The used commands may not use memory above the address $9000 (MEMHI), because the Boot loader itself uses this memory. It may occur, that a tape-file must be used as a parameter of some command before installing the "BTAPE" driver. In this case, you should call the tape-files as "Q:filename" - the request will be then executed by internal routines of the Boot loader. The device handler "Q:" exists only while the configuration file is executed, and it can only read tape files. When the configuration file is finished, the "Q:" handler disappears together with the Boot loader. The wildcards are supported by "Q:", but you can't use it with the "COPY" command (in this case, COPY will try to get the actual filename using the "DIR" function - not supported by "Q:"). When the last line of configuration file begins with a "+" character, the rest of the line will be executed in the CP. In this way, you can automatically start any program after boot, or run a batch file (previously copied to a Ramdisk) to continue with the initialization of the system. After the configuration file, you should record all the files necessary for executing the configuration. (That is for each line the program-file, and also any files used as parameters.) Example: To simply boot a DOS and BTAPE, the configuration file "CONFIG.B" will look like this: BTAPE /O In this case, you should record the following files to the boot-tape: The Boot loader (see "TAPEBOOT") XBW130.DOS (or other compatible DOS) CONFIG.B (see above) BTAPE.COM Another example: Boot a DOS, install RAMDISK (on the Atari 130XE computer) and then BTAPE. Place the "BTAPE.COM" file into the Ramdisk to allow free installing/removing of BTAPE depending on memory usage of application programs. The configuration file will be following: RAMDISK 1F Q:B_130XE.RD COPY Q:BTAPE.COM D1: +D1:BTAPE /B You should record the following files: The Boot loader (see "TAPEBOOT") XBW130.DOS (or other compatible DOS) CONFIG.B (see above) RAMDISK.COM B_130XE.RD COPY.COM BTAPE.COM LOADING GAMES Under B-TAPE, you can load almost any games (and other programs like demos etc.) as long as they are stored in a binary file. Every programs started under a DOS or Micro-DOS are compatible, and also many tape-versions uses this format (the games with a short loader, mostly displaying a "!" in the bottom-right corner of the screen - you should copy only the main file without of the loader). The MICRO-B command Some games may be started under BW-DOS, but mostly the DOS is too long to fit into memory together with the game. With a disk drive, we are using different "Micro-DOS" programs in this case - the same tool for tape is called "MICRO-B" MICROB (C|T|S) (External command) This command records the MICRO-B loader to tape. With the parameter "C" it creates a common boot-file (in the "C:" format), that may be loaded simply by holding down the key during power-on. The "T" parameter gives the same loader in the format "TURBO 2000" - a format that is popular here in czech republic. With the parameter "S", this command will directly start the MICRO-B loader. Using the MICRO-B loader The MICRO-B loader can only start a game or another program of the same type. No more support (like access to tape-files) is provided. The loader is easy to use. After starting it, any file in the B-TAPE format is excepted from tape. When any block is found, the program displays the filename, and asks you if you wish to load that file. When you answer "N", another block will be searched, otherwise the file will load. When started, the MICRO-B loader executes a few actions to provide the best compatibility with game-programs. (Most of these actions are the same as under "Micro-SpartaDOS".) First, any DOS will be removed, and the Atari-Basic will be switched off (no need to hold down