The ExtGraph Library is an add-on to the TIGCC Library (TIGCCLIB). Integrating
ExtGraph into TIGCCLIB is planned, although it is unlikely that this ever happens.. It's a
compile-time library (used functions are fetched from the library during the linking stage)
and it contains various useful graphics related routines which are missing in the TIGCCLIB or
modified routines which are implemented with very high speed in mind (without stupid excessive
speed optimizations, though, except for preshifted sprites which are a brute force approach).
For example, we unrolled tight loops in the tilemap engine, which costed around 12 bytes (<
1/1000 of overall size for most programs using a tilemap engine), but increases speed by ~20%.
Note: We do not / cannot guarantee that any other compiler or cross-compiler for TI-68k
calculators than TIGCC will support ExtGraph.
The ExtGraph demos were tested on PedroM 0.80. PedroM exits demo12 and demo17 because
ROM_CALL CharNumber (not currently documented in TIGCC, but it is in my fastitoa.h package)
is not reimplemented, but all other demos work (although PedroM 0.80 seems to suffer more
from the keyboard rebounds, tested on VTI) and show that PedroM uses more efficient
algorithms than AMS (in graphical functions - vital memcpy and memset are very slow in
PedroM versions to date): ExtGraph outperforms PedroM on lines by <~10% and rectangles
by >~3x, while it usually outperforms AMS by >~5x on lines and >~7x on
rectangles.
The ExtGraph 2 series is supposed to be backwards compatible with the previous versions,
except:
The GraySprite routines are real "monsters" due to their number of parameters.
I've never planned to implement them this way, but there were too many requests.
Reducing a bit the number of parameters is planned for special GrayClipSprite16x16 (most used
sprite format), by switching to a special sprite format, but we will NOT combine the consecutive
planes into one double-sized plane. Indeed, the latter a) doesn't have any significant advantage
speed-wise or size-wise compared to the normal method and b) it forbids writing directly to
the grayscale outputscreen or using doublebuffering, because the buffers used by the TIGCCLIB
grayscale routine are not combined this way on HW1. Therefore I've decided to implement these
"monsters".
GrayClipISprite8/16_... are highly speed-optimized by using interlaced sprites and two different
loops to optimize shiftings.
A number of programs (sidescroller Venus is one of them) contain routines whose prototype is
similar to that of GrayClipISprite routines (single pointer to a sprite), but the sprite format
is different: it contains the entire data for one plane, the entire data for the other plane,
the entire mask data if any (or any permutation of these three blocks). Using this format is
nearly as efficient speed-wise and speed-wise as using interlaced sprites. Starting from Beta
4, you can find information in the readme, so that all users (even those who don't know ASM,
what a shame) can modify them to use this format without too much trouble.
As of Beta 4, the tilemap engine is still incompatible with the TIGCCLIB grayscale doublebuffering support.
Contents
Functions, Types, Globals and Macros
Library ExtGraph contains the following functions:
Sprite8_AND Sprite16_AND Sprite32_AND SpriteX8_AND Sprite8_AND_R Sprite16_AND_R Sprite32_AND_R SpriteX8_AND_R GraySprite8_AND GraySprite16_AND GraySprite32_AND GraySpriteX8_AND GraySprite8_AND_R GraySprite16_AND_R GraySprite32_AND_R ClipSprite8_AND_R ClipSprite16_AND_R ClipSprite32_AND_R GrayClipSprite8_AND_R GrayClipSprite16_AND_R GrayClipSprite32_AND_R Sprite8_BLIT Sprite16_BLIT Sprite32_BLIT SpriteX8_BLIT Sprite8_BLIT_R Sprite16_BLIT_R Sprite32_BLIT_R SpriteX8_BLIT_R GraySprite8_BLIT GraySprite16_BLIT GraySprite32_BLIT GraySpriteX8_BLIT GraySprite8_BLIT_R GraySprite16_BLIT_R GraySprite32_BLIT_R ClipSprite8_BLIT_R ClipSprite16_BLIT_R ClipSprite32_BLIT_R GrayClipSprite8_BLIT_R GrayClipSprite16_BLIT GrayClipSprite32_BLIT_R Sprite8Get Sprite16Get Sprite32Get SpriteX8Get Sprite8Get_R Sprite16Get_R Sprite32Get_R SpriteX8Get_R Sprite8_MASK Sprite16_MASK Sprite32_MASK SpriteX8_MASK Sprite8_MASK_R Sprite16_MASK_R Sprite32_MASK_R SpriteX8_MASK_R GraySprite8_MASK GraySprite16_MASK GraySprite32_MASK GraySpriteX8_MASK GraySprite8_MASK_R GraySprite16_MASK_R GraySprite32_MASK_R ClipSprite8_MASK_R ClipSprite16_MASK_R ClipSprite32_MASK_R GrayClipSprite8_MASK_R GrayClipSprite16_MASK_R GrayClipSprite32_MASK_R Sprite8_OR Sprite16_OR Sprite32_OR SpriteX8_OR Sprite8_OR_R Sprite16_OR_R Sprite32_OR_R SpriteX8_OR_R GraySprite8_OR GraySprite16_OR GraySprite32_OR GraySpriteX8_OR GraySprite8_OR_R GraySprite16_OR_R GraySprite32_OR_R ClipSprite8_OR_R ClipSprite16_OR_R ClipSprite32_OR_R GrayClipSprite8_OR_R GrayClipSprite16_OR_R GrayClipSprite32_OR_R Sprite8_XOR Sprite16_XOR Sprite32_XOR SpriteX8_XOR Sprite8_XOR_R Sprite16_XOR_R Sprite32_XOR_R SpriteX8_XOR_R GraySprite8_XOR GraySprite16_XOR GraySprite32_XOR GraySpriteX8_XOR GraySprite8_XOR_R GraySprite16_XOR_R GraySprite32_XOR_R ClipSprite8_XOR_R ClipSprite16_XOR_R ClipSprite32_XOR_R GrayClipSprite8_XOR_R GrayClipSprite16_XOR_R GrayClipSprite32_XOR_R GraySprite8_TRANB_R GraySprite16_TRANB_R GraySprite32_TRANB_R GrayClipSprite8_TRANB_R GrayClipSprite16_TRANB_R GrayClipSprite32_TRANB_R GraySprite8_TRANW_R GraySprite16_TRANW_R GraySprite32_TRANW_R GrayClipSprite8_TRANW_R GrayClipSprite16_TRANW_R GrayClipSprite32_TRANW_R SpriteX8_MIRROR_H SpriteX8_MIRROR_V SpriteX8_MIRROR_H_R SpriteX8_MIRROR_V_R SpriteX8_MIRROR_HV_R SpriteX8_ROTATE_RIGHT_R SpriteX8_ROTATE_LEFT_R SpriteX8_RR_MH_R SpriteX8_RL_MH_R ScaleSprite8_AND ScaleSprite16_AND ScaleSprite32_AND ScaleSprite64_AND ScaleSprite8_OR ScaleSprite16_OR ScaleSprite32_OR ScaleSprite64_OR ScaleSprite8_XOR ScaleSprite16_XOR ScaleSprite32_XOR ScaleSprite64_XOR ScrollLeft160 ScrollLeft160_R ScrollLeft240 ScrollLeft240_R ScrollRight160 ScrollRight160_R ScrollRight240 ScrollRight240_R ScrollUp160 ScrollUp160_R ScrollUp240 ScrollUp240_R ScrollDown160 ScrollDown160_R ScrollDown240 ScrollDown240_R FastCopyScreen FastCopyScreen_R FastDrawLine FastDrawLine_R FastDrawHLine FastDrawHLine_R FastDrawVLine FastDrawVLine_R FastLine_Draw_R FastLine_Erase_R FastLine_Invert_R FastFillRect FastFillRect_R FastFilledRect_Draw_R FastFilledRect_Erase_R FastFilledRect_Invert_R FastOutlineRect FastOutlineRect_R GrayFastOutlineRect_R FastEraseRect160_R FastEraseRect240_R GrayFastEraseRect2B160_R GrayFastEraseRect2B240_R FastFillRect160_R FastFillRect240_R GrayFastFillRect2B160_R GrayFastFillRect2B240_R FastInvertRect160_R FastInvertRect240_R GrayFastInvertRect2B160_R GrayFastInvertRect2B240_R FastEraseRectX8_R FastFillRectX8_R FastEraseRectX8_R ClearGrayScreen ClearGrayScreen2B GrayClearScreen GrayClearScreen2B ClearGrayScreen_R ClearGrayScreen2B_R GrayClearScreen_R GrayClearScreen2B_R DrawGrayRect DrawGrayRect2B GrayDrawRect GrayDrawRect2B InvertGrayRect InvertGrayRect2B GrayInvertRect GrayInvertRect2B DrawGrayLine DrawGrayLine2B GrayDrawLine GrayDrawLine2B FastDrawGrayLine FastDrawGrayLine2B GrayFastDrawLine GrayFastDrawLine2B FastDrawGrayHLine FastDrawGrayHLine2B GrayFastDrawHLine GrayFastDrawHLine2B DrawGrayChar DrawGrayChar2B GrayDrawChar GrayDrawChar2B DrawGrayStr DrawGrayStr2B GrayDrawStr GrayDrawStr2B DrawGrayStrExt DrawGrayStrExt2B GrayDrawStrExt GrayDrawStrExt2B PreshiftSprite16x16 PreshiftGrayISprite16x16 FadeOutToBlack_CWS1_R FadeOutToWhite_CWS1_R FadeOutToBlack_CCWS1_R FadeOutToWhite_CCWS1_R FadeOutToBlack_LR_R FadeOutToWhite_LR_R FadeOutToBlack_LR18_R FadeOutToWhite_LR18_R FadeOutToBlack_LR28_R FadeOutToWhite_LR28_R FadeOutToBlack_RL_R FadeOutToWhite_RL_R FadeOutToBlack_RL18_R FadeOutToWhite_RL18_R FadeOutToBlack_RL28_R FadeOutToWhite_RL28_R FadeOutToBlack_TB_R FadeOutToWhite_TB_R FadeOutToBlack_BT_R FadeOutToWhite_BT_R GrayIShadowPlanesX16_R GrayShadowPlanesX16_R GrayIShadowPlanes160_R GrayShadowPlanes160_R GrayIShadowPlanes240_R GrayShadowPlanes240_R GrayIShadowPlanesTo_R GrayShadowPlanesTo_R FloodFill FloodFill_R FloodFillMF FloodFillMF_R UnpackBuffer (or) ttunpack_decompress and ttunpack_decompress_gray TestCollide8 TestCollide8_R TestCollide16 TestCollide16_Rthe following predefined types:
GrayColors FillAttrs ExtAttrs TTUNPACK_HEADER TTARCHIVE_HEADER TTARCHIVE_ENTRYthe following global variables:
EXTGRAPH_VERSION_STR EXTGRAPH_VERSION_PWDSTR EXTGRAPH_VERSION_MAIN EXTGRAPH_VERSION_SUBand the following macros/definitions:
EXT_PIXOFFSET EXT_PIXADDR EXT_PIXMASK EXT_PIXNBIT EXT_PIXUP EXT_PIXDOWN EXT_PIXLEFT_AM EXT_PIXRIGHT_AM EXT_SETPIX_AM EXT_CLRPIX_AM EXT_XORPIX_AM EXT_GETPIX_AM EXT_SETPIX_AN EXT_CLRPIX_AN EXT_XORPIX_AN EXT_GETPIX_AN EXT_SETPIX EXT_CLRPIX EXT_XORPIX EXT_GETPIX EXT_SHORTABS EXT_LONGABS EXT_XCHG EXT_LONGSWAP ttarchive_valid ttarchive_entries ttarchive_desc ttarchive_data ttarchive_size ttarchive_info ttunpack_size ttunpack_valid TTUNPACK_OKAY TTUNPACK_NOESCFOUND TTUNPACK_ESCBITS TTUNPACK_MAXGAMMA TTUNPACK_EXTRALZP TTUNPACK_NOMAGIC TTUNPACK_OUTBUFOVERRUN TTUNPACK_LZPOSUNDERRUN BOUNDS_COLLIDE BOUNDS_COLLIDE8 BOUNDS_COLLIDE16 BOUNDS_COLLIDE32 PSprite16x16_OR_R GrayPSprite16x16_OR_R PSprite16x16_XOR_R GrayPSprite16x16_XOR_R
[Information valid until ExtGraph becomes part of the TIGCCLIB]
[Information valid for all distributions]
Copy files extgraph.a and extgraph.h (tilemap.a and tilemap.h if you use the tilemap engine,
preshift.h if you use preshifted sprites) into the directory where the rest of your sources
are. To use extgraph functions now in your project add the following line:
#include "extgraph.h"to your sourcecode.
tigcc myprog.c extgraph.aIf you are using the IDE add extgraph.a to the archive file folder of your project. That's all.
Courtesy of Jim Haskell (jimhaskell@yahoo.com) [routines slightly modified (and bugfixed) to fit the needs] New (faster) routines by Julien Richard-Foy (julien.rf@wanadoo.fr) are on the way.
GrayDrawStrExt(0,50,"Welcome!",A_REPLACE | A_CENTERED,F_4x6);will draw "Welcome!" horizontally centered at line 50 with font F_4x6.
Courtesy of Zeljko Juric (zjuric@utic.net.ba) [routine slightly modified to fit the needs]
Exepack-Compression is a compression algorithm which was initially developed to compress
executables (-pack option of TIGCC compiler) and to generate eBooks for TICT's eBookReader.
Everything (tools, sources, headerfiles etc.) which is necessary to use this compression
in your own projects can be found in the TIGCC Tools Suite which can be download from the
TiCT-HQ at http://tict.ticalc.org.
To make things easier for you I have decided to integrate support for exepack decompression
and ttarchives into library ExtGraph. It's no longer necessary nor recommended to include
files ttunpack.h and ttarchive.h into your sources. Just include extgraph.h and link
against extgraph.a. That's all. To generate the compressed data files and ttarchive files
you still need the TIGCC Tools Suite, of course (especially the tools ttpack and ttarchive).
An exepacked file is just a single data file which is compressed using tool ttpack. TTArchive files are, as the name already implies, archives which can hold many entries not just one. Each entry can be compressed using ttpack or any other program before you stuff it into the TTArchive file. Tool ttarchive won't care about the content of the entries at all.
To use the exepack decompression routine and/or the ttarchive access macros you'll need a pointer to the memory where the external variable is stored first. This can be simply done function like the following:
//------------------------------------------------------------------ // returns pointer to start of external variable which name is given // by fname. // if variable cannot be found NULL is returned // // NOTE: this routine internally locks the variable. Due to the fact // that the variable has to be unlocked again if you don't // need it anymore, it uses the given pointer to a HANDLE // to store the handle of the locked variable in it. //------------------------------------------------------------------ unsigned char* GetPointerToFile(char* fname,HANDLE* h) { SYM_ENTRY* symptr; unsigned char* src; if ((symptr = DerefSym(SymFind(SYMSTR(fname))))) { *h = symptr->handle; if (!(src = (unsigned char*)HLock(*h))) return NULL; src+=2; return src; } else { return NULL; } }
The Exepack decompression routine needs takes two pointers. A source and a destination pointer. The source pointer points to the memory which holds the exepacked destination and the destination pointer should point to a buffer which is large enough to hold the decompressed data. Suppose you have an external variable which hold the compressed data (generated with tool ttpack) and you have already implemented the above function GetPointerToFile(). Then decompressing this file can be easily done with a function like this:
//------------------------------------------------------------------ // decompresses an external variable and returns an allocated buffer // (don't forget to free the returned buffer) // // if an error occurs this function returns NULL //------------------------------------------------------------------ unsigned char* GetDecompressedData(char* fname) { HANDLE h; unsigned char* src = GetPointerToFile(fname,&h); unsigned char* dest; if (!src) return NULL; // file not found // check if data is really exepacked if (!ttunpack_valid(src)) { HeapUnlock(h); // data NOT valid - unlock locked variable again!! return NULL; } // allocate buffer for decompressed data if (!(dest = malloc(ttunpack_size(src)))) { HeapUnlock(h); // out of memory - unlock locked variable again!! return NULL; } // decompress the data if (ttunpack_decompress(src,dest) != TTUNPACK_OKAY) { free(dest); dest = NULL; } HeapUnlock(h); return dest; }
The first step to retrieve an entry of an archive is to get again a pointer to the start of the external variable which holds the ttarchive. The following code shows how to loop through all entries of an ttarchive which is stored in a variabled called "mydata". Of course, the following loop is not really useful, but it demonstrates almost everything which is necessary to now about TTArchives.
HANDLE h; unsigned char* src = GetPointerToFile("mydata",&h); if (!src) { // variable not found !!! } else { if (ttarchive_valid(src)) { unsigned short i; unsigned short nr_entries = ttarchive_entries(src); // get number of entries for (i=0;i<nr_entries;i++) { unsigned char* pointer_to_entry = ttarchive_data(src,i); unsigned short size_of_entry = ttarchive_desc(src,i)->length; unsigned char* decompressed; //----------------------------------------------------------------------- // Now we have a pointer to the entry and we know how large this entry is // If the entry is compressed we could easily decompress it like this: //----------------------------------------------------------------------- if (ttunpack_valid(pointer_to_entry)) { // this entry is compressed ... if ((decompressed = malloc(ttunpack_size(pointer_to_entry)))) { if (ttunpack_decompress(pointer_to_entry,decompressed) == TTUNPACK_OKAY) { //--------------------------------- // entry successfully decompressed. // do something with it. //--------------------------------- } free(decompressed); // free allocated memory for decompressed entry again } else { // out of memory!! } } else { // this entry is NOT compressed. Do something else with it .... } } } HeapUnlock(h); // unlock variable again .... }[The above routines are apriori tested thanks to Malcolm Smith (TRgenius). They used to contain at least one severe bug.]
We tried to do our best to provide something bug-free, but we may have failed (bugs were
already found in the early ExtGraph 2.00 betas).
If you believe a sprite function is buggy, could you please test it with the project
sprtst.tpr in \src\lib ?
If the function is buggy, the program should show its flaws (several flaws could be missed
by the program though) more valueable.
If this test doesn't show the function is buggy, well, then it's probably a problem in
your code. One of the most frequent causes of random bugs is writes past the bounds
of arrays, on the stack (often triggers Illegal Instruction or Address Error) or in
the heap (infinite loop in AMS after the program returns, often in HS_popEStack). Be sure
to check the result of dynamic memory allocations, too.
Be sure to use the latest TIGCC 0.95 Betas (>=14). Older versions had nasty bugs, newest
versions have an even more optimizing linker and a better IDE.
This could turn into gaining time for both you and us, by not generating/treating
pointless bug reports. Thanks in advance.
If you distribute ExtGraph within your projects' distributions, please include both extgraph.a and extgraph.h (and tilemap.a / tilemap.h if you use the tilemap engine, preshift.h if you use preshifted sprites). Don't get fooled by the huge size of those files: they are very redundant data, high compression ratios can therefore be achieved on them. The biggest file, extgraph.a, is more than six times smaller after compression with old ZIP format.
I'd like to thank the contributors, especially Julien Richard-Foy (jackiechan / Sasume - author of the tilemap engine and various programs, attending the TIGCC/TICT message board on a regular basis) and Geoffrey Anneheim (geogeo - author of PolySnd, Arkanoid Revenge of Doh, Nebulus) once more for their work. ExtGraph would never have been what it is if they had not helped me. My policy is of course to let the contributors work on other projects if they want to, which they do for sure. For example, Julien is now working on kernel-based dynamic graphical library GenLib, in which he took some ideas for the tilemap engine and optimizations on TRANB/W routines (also seen in Phoenix Platinum).
Type | Size of an unmasked 16x16 grayscale sprite | Additional memory usage | Best choice for | Bench (12.0 MHz clock and reset settings assumed; the accuracy of values is 5%) - see demo20 and demo21 |
Normal non-interlaced sprites | 2*32 bytes | 0 bytes | most games, including not so simple platformers and sidescrollers (Phoenix Platinum, Monster, Venus are sprite-based) | usually as fast as normal interlaced sprites (except MASK, which is slower - interlaced MASK are equivalent to non-interlaced SMASK) |
Normal interlaced sprites | 64 bytes | 0 bytes | most games, including not so simple platformers and sidescrollers (Phoenix Platinum, Monster, Venus are sprite-based) | normal 16x16 gray clipped interlaced sprite routine with 2x2 loops (special version of GrayClipISprite16, not inclued: this was done in order to make a fair comparison, given that the loops in the preshifted sprite functions are unrolled): more than 4500 sprites/sec |
Tiles (interlaced or non-interlaced) | 2*32 or 64 bytes | 0 bytes | in conjunction with Scroll... and FastCopyScreen, background of sidescrollers like Phoenix Platinum, Krypton; simple strategy games (although sprite functions are often much better since they are much more flexible) | as fast as or faster than completely preshifted sprites |
Semi-preshifted sprites | 64 bytes | 1024 bytes for each sprite (to preshift the sprite) | "always redraw everything" (can be not so smart) | semi-preshifted 16x16 gray non-clipped sprite routine: around 7500 sprites/sec |
Completely preshifted sprites | 64 bytes | 2048 bytes for each sprite (to preshift the sprite) | "always redraw everything" (can be not so smart) | completely preshifted 16x16 gray non-clipped sprite routine (not inclued since a single such sprite takes 2 KB !): at least 8500 sprites/sec |
Tilemap engine | 64 bytes | large backbuffers (5440 bytes per plane) | complex RPGs, platformers for current version; Beta 4 adds support for still tiles (simplified SimCity, Command And Conquer...). Future versions should add support for animated tiles | N/A |
Version Date Changes 2.00 Beta 4 25/12/2004 removed (I)SHADOW(2) routines: they are nearly useless thanks to Create(I)Sprite(I)Shadow and OR routines (which require a small additional amount of space) and they increase maintenance (more than one quarter of all drawing modes). added Gray(Clip)S[ame]MASK routines. added a number of hints in the readme, to help users customizing routines by themselves. added fast background save&restore routines, with the corresponding demo (demo22): faster replacement for Get + RPLC, i.e. another way to do without redrawing everything all the time. This one can outperform all other approaches under some conditions.
Thanks to the input of Julien, they are better.fixed once more pixel macros, thanks to Kevin. added missing "const" keyword to most prototypes: at last, no more warnings about discarded qualifiers. nearly all occurences of ".data" were replaced by ".text". This suits better to the latest TIGCC Betas (better code with -ffunction-sections -fdata-sections --reorder-sections). No impact on compression ratio. Reduced length of all label names in most ASM routines (unless this made the routines both unreadable and impossible to maintain). This saved dozens of kilobytes on extgraph.a (up to 500 bytes per function !) and .s sources, and improved compression ratio ! ExtGraph doesn't force global imports (from the external files added with GNU ar) anymore. This saves ~6 KB on the size of extgraph.a and won't interfere with clients anymore. Thanks to Sebastian for the report. Julien told me about speed optimizations on TRANW and TRANB sprite routines (found in programs by pad and PpHd): +15% for TRANW, + >30 % for TRANB. small optimization (2 bytes, 4 clocks) on a number of sprite routines. [A and B] is equivalent to [B and A]... small optimization on several routines: d3 or d4 can be saved to a1 instead of the stack. fixed long-hidden bugs. Most B/W Sprite32 routines were buggy, thanks to Jesse Frey for the report. I found other long-hidden bugs retesting the entire library. updated the tilemap engine. The API was reduced somewhat: Julien took out with the most useless modes to reduce maintenance. Two demos were added. However, the tilemap engine is still incompatible with the TIGCCLIB grayscale doublebuffering. brand-new pure ASM ttunpack routines by Samuel Stearley. The fast version gives a huge speed increase (now over 80 KB/sec !), interesting size decrease (while the routine is definitely optimized for speed, with code inlining, and we did not trade safety for speed and size !) compared to the C routine Greg, him and later I had optimized. The small version is 240 bytes (more than 300 bytes smaller than the other version), but it is slow (~<20 KB/sec). updated SpriteX8 functions, splitting them into normal and slower versions. several new routines related to planes (Fill, FillWithGarbage). To be fair, I want to mention that I received suggestions and code from Dave Randall, but I had already thought about implementing such routines, and I made a different implementation. added GrayFastDrawHLine_R, done by Julien. probably added bugs, forgot fixes, forgot to mention fixes... not updated the documentation much: most new functions are not described, some prototypes in this documentation may be wrong, etc... There are several annoying bugs in ExtGraph, and I'm on holiday, so I'm spending some time making a bugfix release translated and released the todo list. 2.00 Beta 3 11/06/2004 4 distributions are now available. .tar.bz2 is not the most powerful format, but it's OS-independent, and significantly reduces the size of the library.
Other large TICT software distributions (mainly TICT-Explorer, TI-Chess, FAT-Engine) will be available in both formats too in next versions.New (I)SHADOW(2)/ISHADOW/ISHADOW2 sprite, clipped sprite routines; not all 32 pixel-wide sprite routines were written. demo12 and demo17 now also show the usage of SHADOW2 and ISHADOW2 functions. New Create(I)Sprite(I)Shadow routines: these routines compute a shadowed sprite from another; this shadowed sprite can be used with OR routines, resulting in a huge speed improvement, since (I)SHADOW(2) routines are rather slow. Optimized EXT_GETPIX_AN the same way as EXT_SET/CLR/XORPIX_AN, fixed all these macros: they used to have too wide constraints for inline ASM, resulting into nonexistent instructions and therefore errors while building projects. Improved macro EXT_XCHG: since the asm exg
instruction can exchange address registers, address registers are now allowed too.Semi-preshifted sprite functions / macros are now available (8x8 are lacking). Rewritten many BLIT_R routines to take blitmask in d3, suppressing the inconsistency. Rewritten TestCollide... routines in ASM, added __regparm__ versions. Bugfixed the exepack decompression function introduced in Beta 2, thanks to maeyhem for the report. I decreased the size of the decompression routines a bit by turning two 4-byte branches into 2-byte branches. Bugfixed SpriteX8 routines (bug reported by Travis Fischer, "Fisch2"), thanks to Julien Richard-Foy and step back to older C routines. They used to trigger Address Errors when both height and bytewidth were odd. The rather quick fix (due to lack of time) turns into slightly slower routines (the larger the sprite is, the higher the difference is). This will be improved in next versions. Revamped the readme at the root of the distribution. Documentation update (nearly complete):
- fixed several problems (missing [END OF BOLD] at the beginning messed up the entire documentation, added [PARAGRAPH] and [END OF PARAGRAPH] everywhere);
- added prototypes and descriptions;
- made more compatible with that profusion of browsers (suggestions by Kevin Kofler and Sebastian Reichelt).
- now using free and native SciTE to edit this documentation (I had to fix the formatting of this changelog though).
- added tips, comparison between the different approaches.
Changed several directory names to 8.3 format. 2.00 Beta 2 28/03/2004 Tilemap engine widely updated, more functions and power (although currently incompatible with the "real" TIGCCLIB doublebuffering); documentation now in English, thanks to Malcolm Smith (TRGenius) for fixing our translation. Documentation update started, far from complete. Added a sprite function test program, see right above. Added another unpacking routine, the new one doesn't disable interrupts (slower but doesn't mess up grayscale). demo6 now uses the full 92+/V200 screen. Fixed various bugs: thanks to Jordan Krage (jmank88), Nicolas Lalevée (hibou), ? (Vertyos) for the report. Slightly optimized many (Gray)(Clip)SpriteX functions (jackiechan), other optimizations are on the way. Missing SpriteX8_MIRROR_HV_R written. New routines (GraySpriteX_SHADOW, transition effects, tile (aligned sprite) routines, (Gray)(Clip)SpriteX_RPLC, non-clipped outlined circle drawing, etc.).
Various other routines are on the way (preshifted sprites, more rectangle-drawing routines, more transition effects...). We're open to suggestions up to some extent, too.2.00 Beta 1 19/12/2003 Tilemap engine added (documentation currently in French, it will be translated into English ASAP). Small changes in the documentation. 2.00 "Beta 0" 18/12/2003 Massive update !
Credits for this version go to:
- Julien Richard-Foy (jackiechan): the vast majority of sprite routines, the upcoming tilemap engine, new scaling routines, several line routines... He's the main contributor, of course. The majority of the work for this version was done by him.
- Christophe Molon-Noblot (Ximoon): SpriteX8 routines.
- Olivier Armand (ExtendeD): generic line routine supporting the three drawing modes (optimized a bit).
- Lionel Debroux: general maintaining, reorganization of the library, tests.
- Greg Dietsche, Samuel Stearley: updated unpacking routine (safe and faster). Current hexarray taken from SuperStart.
1.02 22/05/2002 Stepped back to old version of decompression function, because the new one causes random errors to be thrown. For TIGCC versions greater than 0.93 all functions are declared with "__attribute__((__stkparm__))" in extgraph.h to work correctly with commandline switch -mregparm 1.01 08/05/2002 Bug in exepack decompression function fixed. Thanks to MastaZog from the TIGCC Programming Forum for the report. 1.00 05/04/2002 Address calculations in almost all routines changed for speedup (using 0x1e instead of 0xffffe). Thanks to Francesco Orabona (bremen79@infinito.it) for this suggestion. Macros for bounding rectangle collision testing (BOUNDS_COLLIDE,BOUNDS_COLLIDE8, BOUNDS_COLLIDE16 and BOUNDS_COLLIDE32) added Functions for Collision detection (TestCollide8() and TestCollide16()) added bug in macro EXT_PIXOFFSET (missing brackets) fixed. Thanks to Greg Dietsche (greg@gregd.org) for the report. Demo11 added which shows how to use the collision detection functions TestCollide8() and TestCollide16() 0.97 02/04/2002 Function FastDrawVLine() added (thanks Lionel, for the original code) All functions which takes a color argument optimized by using internally the fact that the color values are bit-flags Demo1 is built now separately for each calctype to reduce codesize 2 bugs in FastDrawHLine() fixed by Francesco Orabona (bremen79@infinito.it) 0.95 25/02/2002 FastDrawHLine: missing static keyword for local array added to gain speed and size reduction Local arrays in scaling function declared static to gain speed and size ClearGrayScreen2B - converted to ASM file (.s) FastCopyScreen - converted to ASM file (.s) Exepack decompression routine added (taken from TIGCC Tools Suite) ttunpack.h and ttarchive.h integrated into extgraph.h for ease of use Section about Exepack Decompression and TTArchives added to docs 0.90 22/02/2002 Demos modified by Lionel Debroux (lionel_debroux@yahoo.fr) Utilities: EXTGRAPH_VERSION_STR, EXTGRAPH_VERSION_PWDSTR, EXTGRAPH_VERSION_MAIN, EXTGRAPH_VERSION_SUB added Utilities: CheckHWMatch() and DESIRED_CALCTYPE added 0.87 05/02/2002 Adaptions to compile correctly with TIGCC 0.93 and beyond 0.86 31/07/2001 ClearGrayScreen2B and FastCopyScreen converted to pure ASM routines Function FastDrawHLine added (horizontal line drawing) Functions FastDrawGrayHLine/FastDrawGrayHLine2B added Misstyped -w option changed to -W in batch files Misstyped -w option changed to -W in batch files All problems reported by -W fixed Routines DrawGrayChar and DrawGrayChar2B added Warning added to docs of FastCopyScreen Grayscale variants of sprite drawing routines added Documentation of SpriteX_BLIT functions fixed Typo in macro EXT_PIXADDR fixed (thanks FlashZ for reporting) 0.80 31/05/2001 Routines FloodFill and FloodFillMF added Demo8 (floodfill demo) added Routines SpriteX8_MIRROR_H and SpriteX8_MIRROR_V added Demo9 (sprite x8 mirror demo) added ClearGrayScreen re-implemented as very fast ASM loop Routine FastCopyScreen added Demo10 (fastcopyscreen demo) added 0.76 22/05/2001 Format information of wide sprites added to X8 functions Mis-typed macro DrawGrayRect() fixed Second bug in treatment of x position in ALL scaling routines fixed ClearGrayScreen/ClearGrayScreen2B added SpriteX8_MASK and SpriteX8_BLIT fixed Usage info changed 0.75 17/05/2001 All TABs removed from the sources Grayscale support routines for doublebuffering added (DrawStr2B etc.) Problems with grayscale support routines fixed Demo6 and demo7 programs added Wide sprite routines (SpriteX8_OR/_AND/_XOR/_BLIT/_MASK/Get) added x position treatment in scaling routines fixed 0.70 15/05/2001 Fast Pixel Access Macros added FastDrawLine supports now A_NORMAL, too DrawGrayStrExt restores now previously active font Documentation of KronicDeth reformatted and incorporated 0.51 07/05/2001 Sprite scale routines added 0.50 06/05/2001 Sprite get routines added 0.30 14/04/2001 Grayscale routines added (taken from TI-Chess and slightly modified) 0.20 13/04/2001 Sprite routines added (formerly released as TSE) and library renamed to extgraph 0.10 12/04/2001 Project started (scroll routines and linedrawing routine)
Library ExtGraph and the documentation since 0.51 were written by Thomas
Nussbaumer and Lionel Debroux.
Credits for the documentation up to version 0.51 go to
Luke Imhoff (KronicDeth).
Additional credits for Routines and Updates go to
Jim Haskell,
Zeljko Juric,
Lionel Debroux,
Julien Richard-Foy (jackiechan / Sasume),
Christophe Molon-Noblot (Ximoon),
Olivier Armand (ExtendeD),
Geoffrey Anneheim (geogeo),
Vincent Corfdir (Orage),
Greg Dietsche (dietsche),
Samuel Stearley.
If you need help, please use the TIGCC Programming Message Board.