wdenk | 858b1a6 | 2002-09-30 16:12:23 +0000 | [diff] [blame] | 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 | |
| 25 | #ifdef CONFIG_VIDEO |
| 26 | #ifndef _VIDEO_H |
| 27 | #define _VIDEO_H |
| 28 | |
| 29 | int video_init(int busdevfunc); |
| 30 | void video_clear(void); |
| 31 | void video_putc(char ch); |
| 32 | void video_puts(const char *s); |
| 33 | void video_puts_a(const char *s, char attr); |
| 34 | unsigned char video_set_attr(unsigned char attr); |
| 35 | |
| 36 | void video_box_area(int x, int y, int w, int h); |
| 37 | void video_dbox_area(int x, int y, int w, int h); |
| 38 | void video_wipe_c_area(unsigned char ch, int x, int y, int w, int h); |
| 39 | |
| 40 | void video_wipe_a_area(unsigned char attr, int x, int y, int w, int h); |
| 41 | void video_wipe_ca_area(unsigned char ch, char attr, int x, int y, int w, int h); |
| 42 | void video_puts_axy(const char *s, char attr, int x, int y); |
| 43 | void video_putc_rxy(char ch, int x, int y); |
| 44 | void video_putc_xy(char ch, int x, int y); |
| 45 | unsigned char video_set_attr_xy(unsigned char attr, int x, int y); |
| 46 | void video_copy(unsigned short *buffer); |
| 47 | void video_write(unsigned short *buffer); |
| 48 | |
| 49 | #define VGA_ATTR_CLR_RED 0x4 |
| 50 | #define VGA_ATTR_CLR_GRN 0x2 |
| 51 | #define VGA_ATTR_CLR_BLU 0x1 |
| 52 | #define VGA_ATTR_CLR_YEL (VGA_ATTR_CLR_RED | VGA_ATTR_CLR_GRN) |
| 53 | #define VGA_ATTR_CLR_CYN (VGA_ATTR_CLR_GRN | VGA_ATTR_CLR_BLU) |
| 54 | #define VGA_ATTR_CLR_MAG (VGA_ATTR_CLR_BLU | VGA_ATTR_CLR_RED) |
| 55 | #define VGA_ATTR_CLR_BLK 0 |
| 56 | #define VGA_ATTR_CLR_WHT (VGA_ATTR_CLR_RED | VGA_ATTR_CLR_GRN | VGA_ATTR_CLR_BLU) |
| 57 | |
| 58 | #define VGA_ATTR_BNK 0x80 |
| 59 | #define VGA_ATTR_ITN 0x08 |
| 60 | |
| 61 | #define VGA_ATTR_BG_MSK 0x70 |
| 62 | #define VGA_ATTR_FG_MSK 0x07 |
| 63 | |
| 64 | #define VGA_ATTR_BG_GET(v) (((v) & VGA_ATTR_BG_MSK)>>4) |
| 65 | #define VGA_ATTR_BG_SET(v, c) (((c) & VGA_ATTR_FG_MSK)<<4) | (v & ~VGA_ATTR_BG_MSK)) |
| 66 | |
| 67 | #define VGA_ATTR_FG_GET(v) ((v) & VGA_ATTR_FG_MSK) |
| 68 | #define VGA_ATTR_FG_SET(v, c) ((c) & VGA_ATTR_FG_MSK) | (v & ~VGA_ATTR_FG_MSK)) |
| 69 | |
| 70 | #define VGA_ATTR_FG_BG_SET(v, b, f) (VGA_ATTR_BG_SET(v, b) | VGA_ATTR_FG_SET(v, cf)) |
| 71 | |
| 72 | #define VGA_ATTR_INVERT(A) ((((A)&0x7)<<4)|(((A)&0x70)>>4) |((A)&0x88)) |
| 73 | |
| 74 | #endif /* _VIDEO_H */ |
| 75 | #endif /* CONFIG_VIDEO */ |