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.
Create the plain HD image
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.
Partition and format the HD image
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).
Here is a ready-to-use disk image (also including the files of the DSR v1.6): idedsr16_du.dsk. Run MAME with both the floppy and IDE image mounted, like this:
mame ti99_4a <options from above> -cart editass -flop1 idedsr16_du.dsk -hard1 mynewide.hd
In Editor/Assembler, run DU2K with option 5.
* RUN PROGRAM FILE *
FILE NAME?
DSK1.DU2K
You should see the entry screen of DU2K. First thing is to check whether the IDE hard disk is accessible.
- Press 1 to display the available devices, the 1 for IDE. You should see "IDE1 [MAME Compressed]" and no further devices.
- Press 2 to create the partition table. Select [M]aster, then [C]hange.
- Our hard disk has 0x32000 sectors. We will set up three partitions of similar capacities. Press Return each time to complete the input. Use Alt-S (FCTN-S) to step left.
- Select partition 1, enter size 10000.
- Select partition 2, enter size 10000.
- Select partition 3, enter size 11FFF.
- Do not forget to [S]ave.
- Go back (FCTN-9), select 4 for Initialize.
- Since the three partitions are accessible as IDE1, IDE2, and IDE3, repeat the initialization for each of them. Give your partitions meaningful names.
Leave DU2K by entering Q in the main menu.
Testing
Let's do a quick test. Go into TI BASIC and enter a short BASIC program.
10 PRINT "HELLO WORLD"
20 END
Save it to your new IDE harddisk.
SAVE IDE1.HELLO
Try to load it. Enter NEW (or restart the emulation) and type
OLD IDE1.HELLO
If it loaded, welcome to the world of IDE hard drives!
Be faster with TIImageTool
As I said above, you can avoid all the detail work with DU2K if you create the IDE image in TIImageTool.
Open the File menu, choose "New partitioned IDE image". There you can create all desired partitions. Save it as CHD Image, e.g. as "timtide.hd".
As above, close TIImageTool, mount the IDE image file as shown above
mame ti99_4a <options from above> -hard1 timtide.hd
Type in a short BASIC program, save it as IDE1.TEST (or IDE2 if you want to save it on the second partition), and try to load it again.