Kevin O'Connor | 0397e80 | 2016-08-04 17:53:45 -0400 | [diff] [blame] | 1 | #ifndef __VGAFB_H |
| 2 | #define __VGAFB_H |
| 3 | |
| 4 | // Graphics pixel operations. |
| 5 | struct gfx_op { |
| 6 | struct vgamode_s *vmode_g; |
| 7 | u32 linelength; |
| 8 | u32 displaystart; |
| 9 | |
| 10 | u8 op; |
| 11 | u16 x, y; |
| 12 | |
| 13 | u8 pixels[8]; |
| 14 | u16 xlen, ylen; |
| 15 | u16 srcy; |
| 16 | }; |
| 17 | |
| 18 | #define GO_READ8 1 |
| 19 | #define GO_WRITE8 2 |
| 20 | #define GO_MEMSET 3 |
| 21 | #define GO_MEMMOVE 4 |
| 22 | |
| 23 | struct cursorpos { |
| 24 | u8 x, y, page, pad; |
| 25 | }; |
| 26 | |
| 27 | struct carattr { |
| 28 | u8 car, attr, use_attr, pad; |
| 29 | }; |
| 30 | |
| 31 | // vgafb.c |
| 32 | void init_gfx_op(struct gfx_op *op, struct vgamode_s *vmode_g); |
| 33 | void handle_gfx_op(struct gfx_op *op); |
| 34 | void *text_address(struct cursorpos cp); |
| 35 | void vgafb_scroll(struct cursorpos win, struct cursorpos winsize |
| 36 | , int lines, struct carattr ca); |
| 37 | void vgafb_write_char(struct cursorpos cp, struct carattr ca); |
| 38 | struct carattr vgafb_read_char(struct cursorpos cp); |
| 39 | void vgafb_write_pixel(u8 color, u16 x, u16 y); |
| 40 | u8 vgafb_read_pixel(u16 x, u16 y); |
| 41 | |
| 42 | #endif // vgafb.h |