Ignore:
Timestamp:
07/24/09 18:55:32 (3 years ago)
Author:
debrouxl
Message:

library: add ClipSprite8/16/32 routines (with explicit register parameters) and some documentation.
These routines are based on an implementation by Joey Adams, contributed to TIGCC in 2005 (at the same time as the Sprite* merged in GCC4TI several weeks ago).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tigcc/doc/System/Include/sprites.h/Sprite8.hsf

    r1360 r1361  
    55Header Files=sprites.h 
    66Definition=void Sprite8 (short x, short y, short height, const unsigned char *sprite, void *vm_addr, short mode); 
     7See Also=sprites.h/ClipSprite8 
    78 
    89[Library Call] 
     
    2122 
    2223[Explanation] 
    23 Sprite8 draws a sprite with a width of 8 pixels or less on the screen. 
    24 Use <A HREF="$$LINK(sprites.h/Sprite16)">Sprite16</A> or <A HREF="$$LINK(sprites.h/Sprite32)">Sprite32</A> for wider sprites. 
    25 This routine is many times faster than TIOS routines like 
    26 <A HREF="$$LINK(graph.h/DrawIcon)">DrawIcon</A>, <A HREF="$$LINK(graph.h/BitmapPut)">BitmapPut</A>, etc. 
     24Sprite8 draws a sprite with a width of 8 pixels or less on the screen. See <A HREF="$$LINK(sprites.h/ClipSprite8)">ClipSprite8</A> 
     25for a version that handles out-of-screen sprites gracefully, and <A HREF="$$LINK(sprites.h/Sprite16)">Sprite16</A>, <A HREF="$$LINK(sprites.h/ClipSprite16)">ClipSprite16</A>, 
     26<A HREF="$$LINK(sprites.h/Sprite32)">Sprite32</A> or <A HREF="$$LINK(sprites.h/ClipSprite32)">ClipSprite32</A> for wider sprites. 
     27This routine is much faster than TIOS routines such as <A HREF="$$LINK(graph.h/DrawIcon)">DrawIcon</A>, 
     28<A HREF="$$LINK(graph.h/BitmapPut)">BitmapPut</A>, etc. 
    2729<I>x</I> and <I>y</I> are the coordinates of the upper left corner of the sprite. 
    2830<I>height</I> is the height of the sprite. <I>sprite</I> is a pointer to the array of 
     
    8486very useful. Note that '~' is "bitwise NOT". Of course, ~0xFF is the same as 0x00, but this notation 
    8587makes the program more clear (and it does not increase the code size, because the inverting will 
    86 be performed at compilation time). And if you want to use <A HREF="$$LINK(sprites.h/Sprite16)">Sprite16</A> or 
    87 <A HREF="$$LINK(sprites.h/Sprite32)">Sprite32</A>, the notation ~0xFF will still be valid in a short int array, or in a long int array 
    88 if you add the <B>'L'</B> suffix (see the respective info about <A HREF="$$LINK(sprites.h/Sprite32)">Sprite32</A>). 
    89 Without this notation, you must use 0x00 in Sprite8, but 0xFF00 in <A HREF="$$LINK(sprites.h/Sprite16)">Sprite16</A>, and 
    90 0xFFFFFF00 in <A HREF="$$LINK(sprites.h/Sprite32)">Sprite32</A>. This is why a notation like ~0xFF is more universal. 
     88be performed at compilation time). And if you want to use <A HREF="$$LINK(sprites.h/Sprite16)">Sprite16</A>, 
     89<A HREF="$$LINK(sprites.h/ClipSprite16)">ClipSprite16</A>, <A HREF="$$LINK(sprites.h/Sprite32)">Sprite32</A> or 
     90<A HREF="$$LINK(sprites.h/ClipSprite32)">ClipSprite32</A>, the notation ~0xFF will still be valid in a short int 
     91array, or in a long int array if you add the <B>'L'</B> suffix (see the respective info about 
     92<A HREF="$$LINK(sprites.h/Sprite32)">Sprite32</A> and <A HREF="$$LINK(sprites.h/ClipSprite32)">ClipSprite32</A>). 
     93Without this notation, you must use 0x00 in Sprite8, but 0xFF00 in 
     94<A HREF="$$LINK(sprites.h/Sprite16)">Sprite16</A>/<A HREF="$$LINK(sprites.h/ClipSprite16)">ClipSprite16</A>, and 
     950xFFFFFF00 in <A HREF="$$LINK(sprites.h/Sprite32)">Sprite32</A>/<A HREF="$$LINK(sprites.h/ClipSprite32)">ClipSprite32</A>. 
     96This is why a notation like ~0xFF is more universal. 
    9197<BR><BR> 
    9298Starting from TIGCC v0.91, you can use binary numbers to define your sprites. On the one hand, 
Note: See TracChangeset for help on using the changeset viewer.