disp.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. #ifndef _WONX_SYS_DISP_H_
  2. #define _WONX_SYS_DISP_H_
  3. #include "service.h"
  4. /*****************************************************************************/
  5. /* 定数の定義 */
  6. /*****************************************************************************/
  7. #define SCREEN1 0
  8. #define SCREEN2 1
  9. #define LCD_PIXEL_WIDTH 224
  10. #define LCD_PIXEL_HEIGHT 144
  11. #define SCREEN_PIXEL_WIDTH 256
  12. #define SCREEN_PIXEL_HEIGHT 256
  13. #define SCREEN_CHAR_WIDTH 32
  14. #define SCREEN_CHAR_HEIGHT 32
  15. #define DCM_SCR1 (1 << 0)
  16. #define DCM_SCR2 (1 << 1)
  17. #define DCM_SPR (1 << 2)
  18. #define DCM_SPR_WIN (1 << 3)
  19. #define DCM_SCR2_WIN_INSIDE (1 << 5)
  20. #define DCM_SCR2_WIN_OUTSIDE ((1 << 4) | (1 << 5))
  21. #define DCM_BORDER_COLOR ((1 << 8) | (1 << 9) | (1 << 10))
  22. /* SPRITE_SET_CHAR, SCREEN_SET_CHAR で使用 */
  23. #define CFM_FLIP_V (1 << 15)
  24. #define CFM_FLIP_H (1 << 14)
  25. #define CFM_FONT 0x01FF /* 0~8ビット目 */
  26. /* SPRITE_SET_CHAR で使用 */
  27. #define CFM_SPR_UPPER (1 << 13)
  28. #define CFM_SPRWIN_CLIP (1 << 12)
  29. #define CFM_SPR_PALETTE ((1 << 9) | (1 << 10) | (1 << 11))
  30. /* SCREEN_SET_CHAR で使用 */
  31. #define CFM_SCR_PALETTE ((1 << 9) | (1 << 10) | (1 << 11) | (1 << 12))
  32. #define CFSFT_PALETTE 9
  33. /* LCD_SET_SEGMENTS で使用 */
  34. #define LCDSEG_AUX3 (1 << 5) /* 予備マーク3 */
  35. #define LCDSEG_AUX2 (1 << 4) /* 予備マーク2 */
  36. #define LCDSEG_AUX1 (1 << 3) /* 予備マーク1 */
  37. #define LCDSEG_HORIZONTAL (1 << 2) /* 縦モードマーク */
  38. #define LCDSEG_VERTICAL (1 << 1) /* 横モードマーク */
  39. #define LCDSEG_SLEEP (1 << 0) /* 省電力マーク */
  40. /* LCD_SET_SLEEP で使用 */
  41. #define LCD_SLEEP_ON 0
  42. #define LCD_SLEEP_OFF 1
  43. #define lcd_on() lcd_set_sleep(LCD_SLEEP_OFF)
  44. #define lcd_off() lcd_set_sleep(LCD_SLEEP_ON)
  45. /* 未実装 */
  46. void lcd_set_interrupt_line(unsigned char line);
  47. unsigned char lcd_get_display_line();
  48. /*****************************************************************************/
  49. /* 互換関数の宣言 */
  50. /*****************************************************************************/
  51. void display_control(unsigned int flags);
  52. unsigned int display_status(void);
  53. void font_set_monodata(unsigned int number, unsigned int count,
  54. unsigned char * data);
  55. void font_set_colordata(unsigned int number, unsigned int count,
  56. unsigned char * data);
  57. void font_get_data(unsigned int number, unsigned int count,
  58. unsigned char * data);
  59. void font_set_color(unsigned int colors);
  60. unsigned int font_get_color(void);
  61. void screen_set_char(int screen, int x, int y, int w, int h,
  62. unsigned short int * data);
  63. void screen_get_char(int screen, int x, int y, int w, int h,
  64. unsigned short int * data);
  65. unsigned int screen_get_char1(int screen, int x, int y);
  66. void screen_fill_char(int screen, int x, int y, int w, int h,
  67. unsigned int data);
  68. void screen_fill_attr(int screen, int x, int y, int w, int h,
  69. unsigned int data, unsigned int mask);
  70. void sprite_set_range(unsigned int start, unsigned int number);
  71. void sprite_set_char(unsigned int sprite_num, unsigned int data);
  72. unsigned int sprite_get_char(unsigned int sprite_num);
  73. void sprite_set_location(unsigned int sprite_num, int x, int y);
  74. unsigned int sprite_get_location(unsigned int sprite_num);
  75. void sprite_set_char_location(unsigned int sprite_num,
  76. unsigned int data, int x, int y);
  77. unsigned long int sprite_get_char_location(unsigned int sprite_num);
  78. void sprite_set_data(unsigned int sprite_num, unsigned int count,
  79. unsigned long int * data);
  80. void screen_set_scroll(int screen, int x, int y);
  81. unsigned int screen_get_scroll(int screen);
  82. void screen2_set_window(int x, int y, int w, int h);
  83. unsigned long int screen2_get_window(void);
  84. void sprite_set_window(int x, int y, int w, int h);
  85. unsigned long int sprite_get_window(void);
  86. void palette_set_color(unsigned int palette_num, unsigned int colors);
  87. unsigned int palette_get_color(unsigned int palette_num);
  88. void lcd_set_color(unsigned int colors0, unsigned int colors1);
  89. unsigned long int lcd_get_color(void);
  90. void lcd_set_segments(unsigned int segments);
  91. unsigned int lcd_get_segments(void);
  92. void lcd_set_sleep(unsigned int slp);
  93. unsigned int lcd_get_sleep(void);
  94. void screen_set_vram(int screen, int location_id);
  95. void sprite_set_vram(int location_id);
  96. #endif