Alternative library and kernel for add-in development on fx-9860G and fx-CG50 under Linux.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
2.3KB

  1. //---
  2. // gint:display-fx - fx9860g drawing functions
  3. //
  4. // This module is in charge of all monochrome rendering. The gray engine
  5. // has its own functions, but often relies on this module (because the
  6. // gray effect is created through two monochrome buffers).
  7. //---
  8. #ifndef GINT_DISPLAY_FX
  9. #define GINT_DISPLAY_FX
  10. #ifdef FX9860G
  11. #include <gint/defs/types.h>
  12. /* Dimensions of the VRAM */
  13. #define DWIDTH 128
  14. #define DHEIGHT 64
  15. /* gint VRAM address. This value must always point to a 4-aligned buffer of
  16. size 1024. Any function can use it freely to:
  17. - Use another video ram area (triple buffering or more, gray engine);
  18. - Implement additional drawing functions;
  19. - Store data when not drawing. */
  20. extern uint32_t *gint_vram;
  21. /* color_t - colors available for drawing
  22. The following colors are defined by the library:
  23. OPAQUE COLORS (override existing pixels)
  24. white, black - the usual thing
  25. light, dark - intermediate colors used with the gray engine
  26. OPERATORS (combine with existing pixels)
  27. none - leaves unchanged
  28. invert - inverts white <-> black, light <-> dark
  29. lighten - shifts black -> dark -> light -> white -> white
  30. darken - shifts white -> light -> dark -> black -> black
  31. Not all colors can be used with all functions. To avoid ambiguities, all
  32. functions explicitly indicate compatible colors. */
  33. typedef enum
  34. {
  35. /* Opaque colors */
  36. C_WHITE = 0,
  37. C_LIGHT = 1,
  38. C_DARK = 2,
  39. C_BLACK = 3,
  40. /* Monochrome operators */
  41. C_NONE = 4,
  42. C_INVERT = 5,
  43. /* Gray operators */
  44. C_LIGHTEN = 6,
  45. C_DARKEN = 7,
  46. } color_t;
  47. //---
  48. // Image rendering (bopti)
  49. //---
  50. /* image_t - image files encoded for bopti
  51. This format is the result of encoding images for bopti with the fxSDK's
  52. [fxconv] tool. The bopti routines can render it extremely fast, which makes
  53. it preferable over plain bitmaps if the images are never edited. */
  54. typedef struct
  55. {
  56. /* Image can only be rendered with the gray engine */
  57. uint gray :1;
  58. /* Left for future use */
  59. uint :3;
  60. /* Image profile (uniquely identifies a rendering function) */
  61. uint profile :4;
  62. /* Full width, in pixels */
  63. uint width :12;
  64. /* Full height, in pixels */
  65. uint height :12;
  66. /* Raw layer data */
  67. uint8_t data[];
  68. } GPACKED(4) image_t;
  69. #endif /* FX9860G */
  70. #endif /* GINT_DISPLAY_FX */