MonochromeLib.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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 06-17-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_POLYGONE
  32. #define ML_FILLED_POLYGONE
  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. /**************************/
  60. /** Functions prototypes **/
  61. /**************************/
  62. #ifdef __cplusplus
  63. extern "C" {
  64. #endif
  65. #define CONTRAST_MIN 130
  66. #define CONTRAST_NORMAL 168
  67. #define CONTRAST_MAX 190
  68. typedef enum {TRANSPARENT=-1, WHITE, BLACK, XOR, CHECKER} ML_Color;
  69. //#define ML_vram_adress (*(sc_cpv)sc0135)
  70. char* ML_cram_adress();
  71. void ML_clear_vram();
  72. void ML_clear_screen();
  73. void ML_display_vram();
  74. void ML_set_contrast(unsigned char contrast);
  75. unsigned char ML_get_contrast();
  76. void ML_pixel(int x, int y, ML_Color color);
  77. void ML_point(int x, int y, int width, ML_Color color);
  78. ML_Color ML_pixel_test(int x, int y);
  79. void ML_line(int x1, int y1, int x2, int y2, ML_Color color);
  80. void ML_horizontal_line(int y, int x1, int x2, ML_Color color);
  81. void ML_vertical_line(int x, int y1, int y2, ML_Color color);
  82. void ML_rectangle(int x1, int y1, int x2, int y2, int border_width, ML_Color border_color, ML_Color fill_color);
  83. void ML_polygone(int *x, int *y, int nb_vertices, ML_Color color);
  84. void ML_filled_polygone(int *x, int *y, int nb_vertices, ML_Color color);
  85. void ML_circle(int x, int y, int radius, ML_Color color);
  86. void ML_filled_circle(int x, int y, int radius, ML_Color color);
  87. void ML_ellipse(int x, int y, int radius1, int radius2, ML_Color color);
  88. void ML_ellipse_in_rect(int x1, int y1, int x2, int y2, ML_Color color);
  89. void ML_filled_ellipse(int x, int y, int radius1, int radius2, ML_Color color);
  90. void ML_filled_ellipse_in_rect(int x, int y, int radius1, int radius2, ML_Color color);
  91. void ML_horizontal_scroll(int scroll);
  92. void ML_vertical_scroll(int scroll);
  93. void ML_bmp_or(unsigned char *bmp, int x, int y, int width, int height);
  94. void ML_bmp_and(unsigned char *bmp, int x, int y, int width, int height);
  95. void ML_bmp_xor(unsigned char *bmp, int x, int y, int width, int height);
  96. void ML_bmp_or_cl(unsigned char *bmp, int x, int y, int width, int height);
  97. void ML_bmp_and_cl(unsigned char *bmp, int x, int y, int width, int height);
  98. void ML_bmp_xor_cl(unsigned char *bmp, int x, int y, int width, int height);
  99. void ML_bmp_8_or(unsigned char *bmp, int x, int y);
  100. void ML_bmp_8_and(unsigned char *bmp, int x, int y);
  101. void ML_bmp_8_xor(unsigned char *bmp, int x, int y);
  102. void ML_bmp_8_or_cl(unsigned char *bmp, int x, int y);
  103. void ML_bmp_8_and_cl(unsigned char *bmp, int x, int y);
  104. void ML_bmp_8_xor_cl(unsigned char *bmp, int x, int y);
  105. void ML_bmp_16_or(unsigned short *bmp, int x, int y);
  106. void ML_bmp_16_and(unsigned short *bmp, int x, int y);
  107. void ML_bmp_16_xor(unsigned short *bmp, int x, int y);
  108. void ML_bmp_16_or_cl(unsigned short *bmp, int x, int y);
  109. void ML_bmp_16_and_cl(unsigned short *bmp, int x, int y);
  110. void ML_bmp_16_xor_cl(unsigned short *bmp, int x, int y);
  111. #ifdef __cplusplus
  112. }
  113. #endif
  114. #endif //MONOCHROMELIB