TSE Logo
author: Thomas Nussbaumer / Graz,Austria / date: 05/02/2001

TSE - TIGCC Sprite Extensions v0.50 (Preview)


Content

(1) What are the TIGCC Sprite Extensions?
(2) How to use the TSE?
(3) Function Categories and Function Name Conventions
(4) Monochrome Functions
(4.1) SpriteX_OR
(4.2) SpriteX_AND
(4.3) SpriteX_MASK
(4.3) SpriteX_BLIT
(5) Grayscale Functions
(5.1) GraySpriteX_OR
(5.2) GraySpriteX_AND
(5.3) GraySpriteX_MASK
(5.4) GraySpriteX_BLIT

(1) What are the TIGCC Sprite Extensions?

The TSE (TIGCC Sprite Extensions) extend the TIGCCLIB with fast and more flexible sprite drawing routines than the ones which are already part of the TIGCCLIB.
The Sprite8(),Sprite16() and Sprite32() routines of the TIGCCLIB are generalized functions which are coded with minimum code size in mind. And mimimum code size is normally the opposite of maximum performance. Due to the fact that highspeed games need the maximum performance they can get, the TSE routines are coded with maximum performance in mind.
Additionally the original TIGCCLIB sprite routines lack of some useful features like direct grayscale and direct masking support which needs more coding on the developer's side and which also reduces the performance by the overhead of additionally function calls. The TSE routines try to overcome this lack.
With the TSE I don't want to disparage the great work of Zeljko Juric. Without his phantastic TIGCCLIB many of the wonderful TI-89/TI-92p programs out wouldn't be possible. I want to extend his TIGCCLIB for those developers who need the maximum performance to bring us more games like "Alien Invasion".
If you have ideas how to increase the performance of the TSE routines further, please use the TICT MessageBoard at http://pub26.ezboard.com/btichessteamhq to contact me.

NOTE: This is ONLY A PREVIEW version which is still incomplete !

(2) How to use the TSE?

The TSE comes in the form of a single headerfile. Copy this headerfile into the TIGCC include directory (include\c) where all other include files are located. If you want to use the TSE now in one of your project just add the line:

#include <tse.h>
to the rest of your include statements. That's all.

Of course, when you use every function of the TSE in your code the program size may become significantly larger, but normally you will only use a small subset of them which shouldn't increase your code much.
If code size is really a matter for your program you should better use the standard routines. The routines from the TSE only fits when speed is a MUST, but than you will gain speed improvements ranging from 20% to above 100% depending on the function (above 100% for grayscale routines).

(3) Function Categories and Function Name Conventions

The TSE functions can be categorized into two groups:

The monochrome functions act only on one plane where the grayscale functions act on two planes at once. You can simulate each grayscale function by calling the corresponding monochrome functions twice, but this will have some performance drawbacks. So if you need the maximum performance for grayscales use the grayscale functions.

Monochrome functions are named really similar to the standard sprite functions of the TIGCCLIB. Their names start with SpriteX (where X is one out of 8/16/32) and have a postfix related to their special function (for example: Sprite8_OR()). Grayscale functions start with GraySpriteX (where X is one out of 8/16/32) and have a postfix related to their special function (for example: GraySprite8_OR()).

(4) Monochrome Functions

(4.1) SpriteX_OR

The SpriteX_OR functions performs exactly the same as the SpriteX() functions when you supply SPRT_OR as mode.
void Sprite8_OR(short x,short y,short height,unsigned char *sprite,unsigned char* dest);
void Sprite16_OR(short x,short y,short height,unsigned char *sprite,unsigned char* dest);
void Sprite32_OR(short x,short y,short height,unsigned char *sprite,unsigned char* dest);

(4.2) SpriteX_AND

The SpriteX_AND functions performs exactly the same as the SpriteX() functions when you supply SPRT_AND as mode.
void  Sprite8_AND(short x,short y,short height,unsigned char*  sprite,void* dest);
void Sprite16_AND(short x,short y,short height,unsigned short* sprite,void* dest);
void Sprite32_AND(short x,short y,short height,unsigned long*  sprite,void* dest);

(4.3) SpriteX_MASK

The SpriteX_MASK functions shortens the way to use a sprite with a mask. With the standard sprite functions you would first call SpriteX() once with mode SPRT_AND and using the mask as sprite and calling afterwards SpriteX() again with mode SPRT_OR and the real sprite data.
void  Sprite8_MASK(short x,short y,short height,unsigned char*  sprite,
                   unsigned char*  mask,void* dest);
void Sprite16_MASK(short x,short y,short height,unsigned short* sprite,
                   unsigned short* mask,void* dest);
void Sprite32_MASK(short x,short y,short height,unsigned long*  sprite,
                   unsigned long*  mask,void* dest);

(4.4) SpriteX_BLIT

The SpriteX_BLIT functions act similar to the SpriteX_MASK functions, but you specify only one data word which is used as mask for each line of the sprite.
void  Sprite8_BLIT(short x,short y,short height,unsigned char*  sprite,
                   unsigned char  maskval,void* dest);
void Sprite16_BLIT(short x,short y,short height,unsigned short* sprite,
                   unsigned short maskval,void* dest);
void Sprite32_BLIT(short x,short y,short height,unsigned long*  sprite,
                   unsigned long  maskval,void* dest);

(5) Grayscale Functions

(5.1) GraySpriteX_OR

... Still Missing ...

(5.2) GraySpriteX_AND

... Still Missing ...

(5.3) GraySpriteX_MASK

... Still Missing ...

(5.4) GraySpriteX_BLIT

... Still Missing ...

(6) Future Extensions



contact: thomas.nussbaumer@gmx.net