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.

MonochromeLib.h 5.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. /*************************************************************/
  2. /** MonochromeLib - monochrome graphic library for fx-9860G **/
  3. /** MonochromeLib is free software **/
  4. /** **/
  5. /** @author Pierre "PierrotLL" Le Gall **/
  6. /** @contact legallpierre89@gmail.com **/
  7. /** **/
  8. /** @file MonochromeLib.h **/
  9. /** Include header for MonochromeLib **/
  10. /** **/
  11. /** @date 11-22-2011 **/
  12. /*************************************************************/
  13. #ifndef MONOCHROMELIB
  14. #define MONOCHROMELIB
  15. /****************************************************/
  16. /** uncomment #define of functions you want to use **/
  17. /****************************************************/
  18. #define ML_ALL //Auto define all functions
  19. // #define ML_CLEAR_VRAM
  20. // #define ML_CLEAR_SCREEN
  21. // #define ML_DISPLAY_VRAM
  22. // #define ML_SET_CONTRAST
  23. // #define ML_GET_CONTRAST
  24. // #define ML_PIXEL
  25. // #define ML_POINT
  26. // #define ML_PIXEL_TEST
  27. // #define ML_LINE
  28. // #define ML_HORIZONTAL_LINE
  29. // #define ML_VERTICAL_LINE
  30. // #define ML_RECTANGLE
  31. // #define ML_POLYGON
  32. // #define ML_FILLED_POLYGON
  33. // #define ML_CIRCLE
  34. // #define ML_FILLED_CIRCLE
  35. // #define ML_ELLIPSE
  36. // #define ML_ELLIPSE_IN_RECT
  37. // #define ML_FILLED_ELLIPSE
  38. // #define ML_FILLED_ELLIPSE_IN_RECT
  39. // #define ML_HORIZONTAL_SCROLL
  40. // #define ML_VERTICAL_SCROLL
  41. // #define ML_BMP_OR
  42. // #define ML_BMP_AND
  43. // #define ML_BMP_XOR
  44. // #define ML_BMP_OR_CL
  45. // #define ML_BMP_AND_CL
  46. // #define ML_BMP_XOR_CL
  47. // #define ML_BMP_8_OR
  48. // #define ML_BMP_8_AND
  49. // #define ML_BMP_8_XOR
  50. // #define ML_BMP_8_OR_CL
  51. // #define ML_BMP_8_AND_CL
  52. // #define ML_BMP_8_XOR_CL
  53. // #define ML_BMP_16_OR
  54. // #define ML_BMP_16_AND
  55. // #define ML_BMP_16_XOR
  56. // #define ML_BMP_16_OR_CL
  57. // #define ML_BMP_16_AND_CL
  58. // #define ML_BMP_16_XOR_CL
  59. // #define ML_BMP_OR_ZOOM
  60. // #define ML_BMP_AND_ZOOM
  61. // #define ML_BMP_XOR_ZOOM
  62. // #define ML_BMP_OR_ROTATE
  63. // #define ML_BMP_AND_ROTATE
  64. // #define ML_BMP_XOR_ROTATE
  65. /**************************/
  66. /** Functions prototypes **/
  67. /**************************/
  68. #ifdef __cplusplus
  69. extern "C" {
  70. #endif
  71. #define ML_SCREEN_WIDTH 128
  72. #define ML_SCREEN_HEIGHT 64
  73. #define ML_CONTRAST_MIN 130
  74. #define ML_CONTRAST_NORMAL 168
  75. #define ML_CONTRAST_MAX 190
  76. typedef enum {ML_TRANSPARENT=-1, ML_WHITE, ML_BLACK, ML_XOR, ML_CHECKER} ML_Color;
  77. char* ML_vram_adress();
  78. void ML_clear_vram();
  79. void ML_clear_screen();
  80. void ML_display_vram();
  81. void ML_set_contrast(unsigned char contrast);
  82. unsigned char ML_get_contrast();
  83. void ML_pixel(int x, int y, ML_Color color);
  84. void ML_point(int x, int y, int width, ML_Color color);
  85. ML_Color ML_pixel_test(int x, int y);
  86. void ML_line(int x1, int y1, int x2, int y2, ML_Color color);
  87. void ML_horizontal_line(int y, int x1, int x2, ML_Color color);
  88. void ML_vertical_line(int x, int y1, int y2, ML_Color color);
  89. void ML_rectangle(int x1, int y1, int x2, int y2, int border_width, ML_Color border_color, ML_Color fill_color);
  90. void ML_polygon(const int *x, const int *y, int nb_vertices, ML_Color color);
  91. void ML_filled_polygon(const int *x, const int *y, int nb_vertices, ML_Color color);
  92. void ML_circle(int x, int y, int radius, ML_Color color);
  93. void ML_filled_circle(int x, int y, int radius, ML_Color color);
  94. void ML_ellipse(int x, int y, int radius1, int radius2, ML_Color color);
  95. void ML_ellipse_in_rect(int x1, int y1, int x2, int y2, ML_Color color);
  96. void ML_filled_ellipse(int x, int y, int radius1, int radius2, ML_Color color);
  97. void ML_filled_ellipse_in_rect(int x, int y, int radius1, int radius2, ML_Color color);
  98. void ML_horizontal_scroll(int scroll);
  99. void ML_vertical_scroll(int scroll);
  100. void ML_bmp_or(const unsigned char *bmp, int x, int y, int width, int height);
  101. void ML_bmp_and(const unsigned char *bmp, int x, int y, int width, int height);
  102. void ML_bmp_xor(const unsigned char *bmp, int x, int y, int width, int height);
  103. void ML_bmp_or_cl(const unsigned char *bmp, int x, int y, int width, int height);
  104. void ML_bmp_and_cl(const unsigned char *bmp, int x, int y, int width, int height);
  105. void ML_bmp_xor_cl(const unsigned char *bmp, int x, int y, int width, int height);
  106. void ML_bmp_8_or(const unsigned char *bmp, int x, int y);
  107. void ML_bmp_8_and(const unsigned char *bmp, int x, int y);
  108. void ML_bmp_8_xor(const unsigned char *bmp, int x, int y);
  109. void ML_bmp_8_or_cl(const unsigned char *bmp, int x, int y);
  110. void ML_bmp_8_and_cl(const unsigned char *bmp, int x, int y);
  111. void ML_bmp_8_xor_cl(const unsigned char *bmp, int x, int y);
  112. void ML_bmp_16_or(const unsigned short *bmp, int x, int y);
  113. void ML_bmp_16_and(const unsigned short *bmp, int x, int y);
  114. void ML_bmp_16_xor(const unsigned short *bmp, int x, int y);
  115. void ML_bmp_16_or_cl(const unsigned short *bmp, int x, int y);
  116. void ML_bmp_16_and_cl(const unsigned short *bmp, int x, int y);
  117. void ML_bmp_16_xor_cl(const unsigned short *bmp, int x, int y);
  118. void ML_bmp_or_zoom(const unsigned char *bmp, int x, int y, int width, int height, float zoom_w, float zoom_h);
  119. void ML_bmp_and_zoom(const unsigned char *bmp, int x, int y, int width, int height, float zoom_w, float zoom_h);
  120. void ML_bmp_xor_zoom(const unsigned char *bmp, int x, int y, int width, int height, float zoom_w, float zoom_h);
  121. void ML_bmp_or_rotate(const unsigned char *bmp, int x, int y, int width, int height, int angle);
  122. void ML_bmp_and_rotate(const unsigned char *bmp, int x, int y, int width, int height, int angle);
  123. void ML_bmp_xor_rotate(const unsigned char *bmp, int x, int y, int width, int height, int angle);
  124. #ifdef __cplusplus
  125. }
  126. #endif
  127. #endif //MONOCHROMELIB