Adjust Grayscale.c 922 B

12345678910111213141516171819202122232425262728293031
  1. // Adjust grayscale quality using + and - keys.
  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. int key, value = 0;
  13. if (!GrayOn ())
  14. return;
  15. GrayAdjust (value);
  16. memset (GetPlane (DARK_PLANE), 255, LCD_SIZE); // Fill the dark plane and
  17. memset (GetPlane (LIGHT_PLANE), 0, LCD_SIZE); // clear the light plane
  18. while ((key=ngetchx ()) != KEY_ESC)
  19. {
  20. if (key== '+' && value < 127)
  21. value++;
  22. if (key== '-' && value > (TI89 ? -28 : 0))
  23. value--;
  24. GrayAdjust(value);
  25. }
  26. GrayOff ();
  27. }