Masked Sprite.c 1.0 KB

123456789101112131415161718192021222324252627
  1. // Display a masked sprite over an arbitrary background
  2. #define USE_TI89 // Compile for TI-89
  3. #define USE_TI92PLUS // Compile for TI-92 Plus
  4. #define USE_V200 // Compile for V200
  5. #define OPTIMIZE_ROM_CALLS // Use ROM Call Optimization
  6. #define MIN_AMS 100 // Compile for AMS 1.00 or higher
  7. #define SAVE_SCREEN // Save/Restore LCD Contents
  8. #include <tigcclib.h> // Include All Header Files
  9. // Main Function
  10. void _main(void)
  11. {
  12. static const unsigned char sprite[] = {0xFF,0x81,0x81,0x81,0x81,0x81,0x81,0xFF};
  13. static const unsigned char imask[] = {(unsigned char)~0xFF,(unsigned char)~0xFF,
  14. (unsigned char)~0xFF,(unsigned char)~0xFF,(unsigned char)~0xFF,
  15. (unsigned char)~0xFF,(unsigned char)~0xFF,(unsigned char)~0xFF};
  16. int i;
  17. ClrScr ();
  18. for (i = 0; i <= LCD_WIDTH; i++)
  19. DrawLine (i, 0, i, LCD_HEIGHT, A_SHADE_NS); // A simple background
  20. Sprite8 (30, 30, 8, imask, LCD_MEM, SPRT_AND);
  21. Sprite8 (30, 30, 8, sprite, LCD_MEM, SPRT_OR);
  22. ngetchx ();
  23. }