The IDE card was designed by Thierry Nouspikel in 2001, later revised in 2004. The card does not have any ROM on board, so there are no ROM zip files to get the card going. However, there is a process of installation where the DSR is written on the IDE drive and a mini loader program (bootstrapper) is included to load the DSR from the drive at system startup.
Overview
The original concept from Th. Nouspikel included to load this bootstrapper into the battery-buffered real-time clock on the card (when using the RTC-65271). Other card revisions allowed for the use of BQ chips (like BQ4847, BQ4842, and BQ4852), some of them shipped with internal non-volatile SRAM or provisions to connect external SRAM.
Th. Nouspikel designed the DSR to provide a collection of floppy disk emulations. That is, by means of certain peripheral commands, the floppy image can be swapped for another one.
Fred Kaal redesigned the DSR completely to offer real hard drive access as devices "IDE1" to "IDE8", one for each partition. This allows the user to make use of up to 8 · 248 MiB of capacity. The hard drive partitions comply with the usual TI DSR conventions, in particular the HFDC and SCSI, so that nested subdirectories are possible. The maximum capacity for a partition cannot exceed 248 MiB because of the 31 sector long allocation table that can manage at most 63488 allocation units (clusters) with a maximum of 16 sectors of 256 bytes (see the description of the file system on Ninerpedia).
I recommend to use Fred's DSR, and this will also be the base for all following explanations.
The IDE support consists of two parts:
- the emulated IDE card with its DSR in the nvram subdirectory
- one or two emulated IDE hard disk drives and their respective image files
In order to set up the IDE support, we will at first prepare the IDE card, in particular including the upload of the DSR into the NVRAM. Then we will have to prepare a hard disk image to be mounted in the IDE drive.
Setting up the card and its DSR
At first we should take care that the loaded NVRAM will not get lost when you change the configuration. Therefore, I suggest to use a special nvram directory and also a special configuration directory for IDE use. We can set these directories in the command line, overriding the defaults in the mame.ini file. If you use a script (batch) file for launching your MAME emulation, this is the ideal way to set these paths:
mame ti99_4a -cfg_directory cfgide -nvram_directory nvramide -ioport peb -ioport:peb:slot2 32kmem -ioport:peb:slot7 ide -ioport:peb:slot7:ide:ata:0 hdd
The IDE card has some DIP switch settings. You find these settings in the OSD menü ("DIP switches"). Enter this submenu and verify that these settings are active:
CRU base: 1900
Map at boot time: SRAM
Card mode: TI
Also, we have to check whether the correct RTC chip is selected on the emulated card. In the OSD menu, select "Machine configuration":
Genmod decoding: off
RTC chip: BQ4847 (ext SRAM)
The BQ4847 is a good choice. Do not use the RTC-65271; it will not work with Fred's DSR, it is only useful for Thierry Nouspikel's original DSR. The Genmod decoding should remain off, unless you are configuring for the Genmod.
Now let us test whether the DSR must be installed at all. Maybe this was already done earlier, and we just forgot about it. Enter TI BASIC and try this:
TI BASIC READY
> CALL IDEST
* BAD NAME
If you get this error message (bad name), the DSR is not installed.
Installing the DSR
Fred Kaal offers the DSR on his website. Click on "Projects", and then on "Ide Dsr" on the right side (deep link). Download the file by clicking on the archive symbol at the top of the page ("Download the IDE DSR program as a ZIP file"). You should find a file "idedsr_vXX.zip" (with XX=16 or later) in your Downloads folder. Inside the ZIP archive there is a file "IDEDSRXX.dsk". Store this file in your floppy disks folder or anywhere where you can reach it easily.
Now run your emulation with the disk in the floppy drive and with the Editor/Assembler cartridge:
mame ti99_4a <options from above> -cart editass -flop1 IDEDSR16.dsk
You should store the command line in a script file for later use. Enter Editor/Assembler, select option 5:
* RUN PROGRAM FILE *
FILE NAME?
DSK1.IDELOAD
The program should now load. When it starts, it should show:
**** IDE-DSR VXX loader (xx/xx/20xx) ****
No configured IDE device found
Select:
1 for DSK1.
...
Press 1 for DSK1. In the following screen, set the CRU address to 1900 (just type 9), unless you set another address above. The program tries to detect the clock chip automatically. Sometimes this may fail, and then it assumes the BQ4847 (hence, a good choice). It then loads all DSR files and uploads them to the NVRAM. When done, you are returned to the initial menu, and you should now see
IDE device found @ CRU >1900
with RTC type BQ4847 (not set)
You can set the IDE clock with option 7, but this is not necessary, as the clock chip is automatically synchronized with the PC clock where you run MAME. When all is done, press FCTN-9 to leave the program, and enter TI BASIC to verify that the DSR was properly loaded. For that purpose, enter the CALL IDEST command as shown above. You should now see the version of the IDEDSR, and a list of IDE1...IDE8 status lines. If you do not already have a formatted hard disk image, you will see all zeros here.
Create a hard disk image
We will do this "the hard way" first. Actually, most of the following can be done more easily with TIImageTool's help.
First we have to create a hard disk image file. Use the chdman command from MAME. We will go for one 100 MiB drive that we want to have three partitions.
chdman createhd -o mynewide.hd -s 104857600 -ss 512
This should create a new file "mynewide.hd", size is 100 MiB, and the sector size is 512 bytes. Note that IDE drives always use sector sizes of 512 bytes, not 256. The DSR, however, translates this to 256-byte TI sectors.
Check that this file has been created. Now you need Fred's DU2K program to partition and format the hard drive (deep link). Download the ZIP archive and put the files DU2K, DU2L, and DU2M on a floppy disk image (e.g. with TIImageTool).
More to follow