TIGA programming

After we talked about the basics of the TIGA standard in the previous post, we’re now Ā trying to do some TIGA programming… (mind the absence of the word “useful”Ā  šŸ˜‰ )

I can’t stress this enough: Compared to even the earliest 3D accelerators TIGA wasn’t fast. Actually it’s not meant to be a 3D accelerator at all, it’s a 2D accelerator which tried to cope with the slow ISA bus speed. With the arrival of VL-bus and then PCI, TIGA hadn’t had a chance – even with a TMS34082 FPU it reached a max ofĀ  160,000 polygons/sec and 25,000 shaded polygons/sec – and there’s no real support for textures. Fun fact: An original PlayStation (1, that is) did 180,000 textured and lighted polygons/sec…
Ah, and before you ask: No, there was no native Linux X11 support ever. There were two X11 servers: MetroLink offered a “stub” which translated X-call on the host to TIGA which ran on the card. And there was a DOS(!) X11 server from AGE Logic. That one ran solely insideĀ the cards RAM, ignored TIGA completely and its speed was comparable to a Sparc 1 or Personal IrisĀ  šŸ˜• The upside was, that was also the case on a slow i386/25 which was still usable running several tasks. So a lot of work was offloaded to the TMS340… OTOH you could invest that money in a i486 and a simple ET4000 to get the same responsiveness and got more CPU-Ooomp on top.

Demos

Anyhow, to have a quick start in TIGA programming, let’s do some demos… but before we start, make sure you can tick every point on this list:

  • You’ll need a running DOS (>= v3.2) system
  • Obviously a TIGA graphics card in an (E)ISA slot – VMs won’t take you far here.
  • A successfully loaded CD and GM (what’s that? Read the 1st TIGA post over here!)
  • A decent C compiler – I use Borland C (Turbo C v2 is fine, too) for that
  • The API documentationĀ PDF from TIĀ (aka “Interface Users Guide”)

…and the libraries. Those came in the so-called DDK (Drive Development Kit, download it here), which was meant to develop drivers on the DOS side of things but can also be used to write some code making use of the insane TMS340 powers šŸ˜‰
This DDK contains some (thin) documentation of how to set-up your compiler and the important libraries as well as the include files.
Just unzip the archive to some place you can remember – I used C:\TIGA on my box.

Setup

There are some things to be done in the Borland/Turbo C IDE before you can compile code with the DDK.

1. Add the directory path-name of where the TIGA include files are located in the Options/Directory menu. e.g.:

Include directories: C:\TURBOC\INCLUDE; C:\TIGA\INCLUDE

2. Add the directory path-name of where the TIGA Application Interface Library files are located in the Options/Directory menu, e.g.:

Library directories: C:\TURBOC\LIB; C:\TIGA\LIBS

3. Specify the TIGA Application Interface library in the Project-Make
file. Simply add a line “AI.LIB” into your Project-Make file. No
directory needs to be specified since the path name was added to theĀ Options/Directory menu as described above.

If you prefer to use the command-line it’s most convenient to add the paths in the call. E.g. building demo.c would result in this call:

tcc -Ic:\tiga\include -Lc:\tiga\libs -ms demo.c ai.lib

The code

Ok, so your dev-system is all set. The TI documentation is pretty good and, well, the only one you can still find these days. So make sure you gave it at least a quick glance-through. By the way, we’re only doing TIGA v2.x stuff… the DDK is not v1.0 compatible.

Have a look at Chapter 3.4. (PDF page 45), it gives a good intro how a basic TIGA application setup looks like. Basically that’s:

  • First check forĀ a Communication Driver (CD) and then open a connection to it
  • Do your thing
  • Properly close the CD
  • exit(0);

The opening and closing of the CD are wrapped into theĀ init_tiga() and term_tiga() functions, so I’ll use those in my samples, too. So here’s a rudimentary example without the aiding functions and #includes needed. It’s drawing a blue, solid filled rectangle, half the size of the screen, centered in the screen:

init_tiga(1);                       /* initialize TIGA*/

get_config(&config);                /* Get info on current mode */
width = config.mode.disp_hres >> 1; /* Width 1/2 screen width */
height = config.mode.disp_vres >> 1; /* Height 1/2 screen height */
xleft = width >> 1;                  /* Center rect in middle */
ytop = height >> 1;                 /* of screen */
set_fcolor(BLUE);                   /* Set foreground color */
fill_rect(width,height,xleft,ytop); /* Fill the rectangle */

term_tiga();                        /* Properly terminate TIGA */

Pretty straightforward, huh?

So without further ado, just do something more impressive: Animation!
Well, don’t wet your pants, it’s just a spinning wire-frame cube, but hey! That was quite something back in 1990 šŸ˜‰ It also shows the usage of extended primitives, i.e. drawing functions which might needed to be loaded onto your TIGA board first (depending on model)
The code is a bit longer, so here’s the ZIP archive, which includes a TurboC project file for your convenience, too.

As soon as I figured out, how to do decent screenshots from the TIGA frambuffer, I’ll post a piccy here.

BGI Driver

Sounds like a strange thing, but might be handy at times if you want to port your brilliant BGI application fast. And well, that’s what the BGI was meant for, right?
The driver was written in 1990 by ‘TSS Rolf Bartz’ and is most likely abandonware…

So this BGI ‘driver’ or better called a wrapper will translate BGI calls into TIGA… of course there are some limitations in speed.
Also out-of-the-box all functions use the BGI maximum of 256 colors but up to the max. resolution your TIGA card provides (well,16384×16384 is the limit ;-)).

That said, there’s a very good readme included (read it!) which not only explains how to use the driver but also tells you more about the enhancements Rolf ingeniously added:

  • There are calls for circles/ellipsoids to bypass the emulation of some calls and use genuine TIGA calls – that should speed up things quite well.
  • FillPoly uses the native TIGA call if there’s enough RAM for a workspace
  • He patched SetWriteMode so that you can use the full 24-bit TIGA color palette.

Again: This is a work-around and should not used for new projects.
If you successfully coded some demos, please let me know!

An odd end…

Finally, I’d like to share some heavy stuff: The Digital Micronics Vivid 24.

Yes, it’s an AMIGA Zorro III card, but at heart it’s TIGA… to the max!Ā TMS34020 40MHz, two (2!) 34082 FPUs can be added, max. 8MB RAM and 16MB(!) VRAM… that’s some serious TI-o-rama. In 1992 this beast costs nearly 3000US$ Ā  šŸ˜Æ

13 thoughts on “TIGA programming”

  1. Looking for a way to convert old TIGA format bitmap fonts (dumped from ROM) back into something a more modern PC can use. thoughts?

    1. I just found a TMS34010 Font Library Userā€™s Guide showing many TI fonts such as Houston, Dallas, and Luckenbach. Are these preserved somewhere? I looked in the zip files on bitsavers.org and in the drive kit here.

      Iā€™d like to work with the font files and convert them to various formats (including TI Artist for the TI-99/4A)

      1. I don’t have anything more than what’s available on this post, sorry.
        TIGA stuff disappeared very fast. Much faster than most other vintage hard/software.

        1. Thatā€™s too bad.

          I spent two days in the Texas Instruments archive at SMU this week. This is a massive, official corporate archive of all kinds of material.

          There are perhaps 50 boxes of data books, among them two boxes of TMS320 up to the C20, and 340C10. Many are not on Bitsaversā€”Iā€™ll compile a list.

          I read a lot of the 34010 programmers book and 34070 book. I do not remember seeing any 34076, or a selection guide for graphics chips, alas.

          I discovered the 34010 Font Library Users Guide and now I am obsessed with finding those fonts. (Bitmap, sizes 9 to 56 points variously).

          In the SDK from Bitsavers, I see the Roman fonts of many sizes, and the Corpus Christi in one size for 80 col text. Thatā€™s all.

          I do not know of any software in the archive, but I forgot to ask if it would be stored separately.

          I did not search marketing or sales material for the 340, but it is likely there.

          Itā€™s possible there are engineering folders for the 340 but Iā€™m not hopeful. I only saw complete engineering documents (by the designer) for speech chips.

    2. Hi Mike,

      I would like to work with the TIGA fonts. I decided this week to write a converter and test it on Roman and Corpus Christi fonts. Thatā€™s all Iā€™ve been able to find. Would you be willing to share your ROM dump?

    3. Mike, See my utility fnt2bmp. I think you can extract the FNT files from the ROM. Each font begins with hex $9000 or $8040. If you send me a whole ROM dump, I’ll automate that process.

  2. Great webpages, I loved working with TIGA. The remark ā€šJust to make that clear: TIGA was not primarily meant to be a 3D acceleratorā€˜ is correct, but it was possible to add the TMS34082 to perform hardware matrix multiplications needed for 3-D transformation. I used various TIGA cards for prototype ā€š3-Dā€˜ Avionics displays, this is document on https://tms34020.uav.nl
    The TMS34020 board from Primary Image with the add-on board for hardware shaded polygon filling is also a very rare card. Quite costly at the time (1993)

    1. Hey Erik!
      That’s some cool info and the page you’ve linked to is very interesting… great work back then! šŸ‘
      As for the 34082 FPU… you’ve seen my mention of the The Digital Micronics Vivid 24 at the bottom of this page, have you?
      That supportstwo of these suckers (even 4 with add-ons) and thus made it one of the ultimate TIGA dream boards (IIRC there was a NuBus board also featureing 2 34082).

  3. Axel, yes the Vivid24 is impressive too. I remember that on the Primary Image TIGA card you could also add a second 34082, and they offered a system with 4 of those cards in a single PC. Regarding requirement #2 of Real Menā€™s hardware: I looked up the 1994 invoice for the Primary Image TIGA board with the daughterboard that had the 4 Hitachi hi-speed shading processors (and the VRAM for the 24-bit frame-buffer behind the 8-bit TIGA overlay). It was Hfl 31.689,- for a single card! With the 1994 exchange rate of about 1.9 Hfl/U.S. $ that amounts to about 16.700,- U.S. $. In 1994 you could have bought a reasonable car for that amount.
    I still have one working setup, I need to check whether I also have demoā€™s that work on a card that does not use the extended primitives for the shaded polygons.

    1. Found your website recently, wanted to find more information about the Hitachi processors, and it doesn’t surprise me to find you here šŸ˜‰ Is there any documentation about the Hitachi processors? I would really read more about them, but searching “Hitachi hi-speed shading” finds information about the Sega VDP1 at best.

  4. I can verify that the Vivid 24 supported up to four (4) TMS 34082 coprocessors. You can see the Mandelbrot test I wrote to demonstrate parallel processing for the SDK at http://aminet.net/package/gfx/misc/VividCompare. (I’ve never located a copy of the SDK.)

    “If you do not own a Vivid 24, you can still run the program to check the speed of your Amiga and the program will compare it’s speed to the three co-processor-equipped versions of the Vivid 24.”

    That’s a bit more confusing than I meant it to be all those years ago. The “three co-processor-equipped versions” were the
    * single TMS 34082
    * double TMS 34082
    * quad TMS 34082

    I guess I didn’t write a version to run on the TMS 34020 by itself, or along with the TMS 34082 renderings.

    Rick

    P.S. I also wrote the original version of the Digital Broadcaster editing software (shown in this bad scan of the original user manual: drive.google.com/file/d/1u6QLHye7GfKkJP8g_jN8V00K4C02EozN/view). I doubt that version of the software survives, but if you have any better screenshots of this, I would appreciate a copy. I know there was also a color foldout brochure, but I lost the one I had over the years in one of my moves.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.