video.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * (C) Copyright 2001
  3. * Denis Peter, MPL AG Switzerland
  4. *
  5. * See file CREDITS for list of people who contributed to this
  6. * project.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21. * MA 02111-1307 USA
  22. *
  23. */
  24. #ifdef CONFIG_VIDEO
  25. #ifndef _VIDEO_H
  26. #define _VIDEO_H
  27. int video_init(int busdevfunc);
  28. void video_clear(void);
  29. void video_putc(char ch);
  30. void video_puts(const char *s);
  31. void video_puts_a(const char *s, char attr);
  32. unsigned char video_set_attr(unsigned char attr);
  33. void video_box_area(int x, int y, int w, int h);
  34. void video_dbox_area(int x, int y, int w, int h);
  35. void video_wipe_c_area(unsigned char ch, int x, int y, int w, int h);
  36. void video_wipe_a_area(unsigned char attr, int x, int y, int w, int h);
  37. void video_wipe_ca_area(unsigned char ch, char attr, int x, int y, int w, int h);
  38. void video_puts_axy(const char *s, char attr, int x, int y);
  39. void video_putc_rxy(char ch, int x, int y);
  40. void video_putc_xy(char ch, int x, int y);
  41. unsigned char video_set_attr_xy(unsigned char attr, int x, int y);
  42. void video_copy(unsigned short *buffer);
  43. void video_write(unsigned short *buffer);
  44. #define VGA_ATTR_CLR_RED 0x4
  45. #define VGA_ATTR_CLR_GRN 0x2
  46. #define VGA_ATTR_CLR_BLU 0x1
  47. #define VGA_ATTR_CLR_YEL (VGA_ATTR_CLR_RED | VGA_ATTR_CLR_GRN)
  48. #define VGA_ATTR_CLR_CYN (VGA_ATTR_CLR_GRN | VGA_ATTR_CLR_BLU)
  49. #define VGA_ATTR_CLR_MAG (VGA_ATTR_CLR_BLU | VGA_ATTR_CLR_RED)
  50. #define VGA_ATTR_CLR_BLK 0
  51. #define VGA_ATTR_CLR_WHT (VGA_ATTR_CLR_RED | VGA_ATTR_CLR_GRN | VGA_ATTR_CLR_BLU)
  52. #define VGA_ATTR_BNK 0x80
  53. #define VGA_ATTR_ITN 0x08
  54. #define VGA_ATTR_BG_MSK 0x70
  55. #define VGA_ATTR_FG_MSK 0x07
  56. #define VGA_ATTR_BG_GET(v) (((v) & VGA_ATTR_BG_MSK)>>4)
  57. #define VGA_ATTR_BG_SET(v, c) (((c) & VGA_ATTR_FG_MSK)<<4) | (v & ~VGA_ATTR_BG_MSK))
  58. #define VGA_ATTR_FG_GET(v) ((v) & VGA_ATTR_FG_MSK)
  59. #define VGA_ATTR_FG_SET(v, c) ((c) & VGA_ATTR_FG_MSK) | (v & ~VGA_ATTR_FG_MSK))
  60. #define VGA_ATTR_FG_BG_SET(v, b, f) (VGA_ATTR_BG_SET(v, b) | VGA_ATTR_FG_SET(v, cf))
  61. #define VGA_ATTR_INVERT(A) ((((A)&0x7)<<4)|(((A)&0x70)>>4) |((A)&0x88))
  62. #endif /* _VIDEO_H */
  63. #endif /* CONFIG_VIDEO */