Kevin O'Connor | e1e000b | 2011-12-31 03:30:40 -0500 | [diff] [blame] | 1 | #ifndef __BOCHSVGA_H |
| 2 | #define __BOCHSVGA_H |
Julian Pidancet | 8bd766f | 2011-12-19 05:08:01 +0000 | [diff] [blame] | 3 | |
| 4 | #include "types.h" // u8 |
Julian Pidancet | 8bd766f | 2011-12-19 05:08:01 +0000 | [diff] [blame] | 5 | |
| 6 | #define VBE_DISPI_BANK_ADDRESS 0xA0000 |
| 7 | #define VBE_DISPI_BANK_SIZE_KB 64 |
| 8 | |
| 9 | #define VBE_DISPI_MAX_XRES 2560 |
| 10 | #define VBE_DISPI_MAX_YRES 1600 |
| 11 | |
| 12 | #define VBE_DISPI_IOPORT_INDEX 0x01CE |
| 13 | #define VBE_DISPI_IOPORT_DATA 0x01CF |
| 14 | |
| 15 | #define VBE_DISPI_INDEX_ID 0x0 |
| 16 | #define VBE_DISPI_INDEX_XRES 0x1 |
| 17 | #define VBE_DISPI_INDEX_YRES 0x2 |
| 18 | #define VBE_DISPI_INDEX_BPP 0x3 |
| 19 | #define VBE_DISPI_INDEX_ENABLE 0x4 |
| 20 | #define VBE_DISPI_INDEX_BANK 0x5 |
| 21 | #define VBE_DISPI_INDEX_VIRT_WIDTH 0x6 |
| 22 | #define VBE_DISPI_INDEX_VIRT_HEIGHT 0x7 |
| 23 | #define VBE_DISPI_INDEX_X_OFFSET 0x8 |
| 24 | #define VBE_DISPI_INDEX_Y_OFFSET 0x9 |
| 25 | #define VBE_DISPI_INDEX_VIDEO_MEMORY_64K 0xa |
| 26 | |
| 27 | #define VBE_DISPI_ID0 0xB0C0 |
| 28 | #define VBE_DISPI_ID1 0xB0C1 |
| 29 | #define VBE_DISPI_ID2 0xB0C2 |
| 30 | #define VBE_DISPI_ID3 0xB0C3 |
| 31 | #define VBE_DISPI_ID4 0xB0C4 |
| 32 | #define VBE_DISPI_ID5 0xB0C5 |
| 33 | |
| 34 | #define VBE_DISPI_DISABLED 0x00 |
| 35 | #define VBE_DISPI_ENABLED 0x01 |
| 36 | #define VBE_DISPI_GETCAPS 0x02 |
| 37 | #define VBE_DISPI_8BIT_DAC 0x20 |
| 38 | #define VBE_DISPI_LFB_ENABLED 0x40 |
| 39 | #define VBE_DISPI_NOCLEARMEM 0x80 |
| 40 | |
| 41 | #define VBE_DISPI_LFB_PHYSICAL_ADDRESS 0xE0000000 |
| 42 | |
Kevin O'Connor | c4a0b97 | 2012-01-09 20:21:31 -0500 | [diff] [blame] | 43 | struct vgamode_s *bochsvga_find_mode(int mode); |
Kevin O'Connor | 933bb76 | 2012-02-01 21:54:55 -0500 | [diff] [blame] | 44 | void bochsvga_list_modes(u16 seg, u16 *dest, u16 *last); |
Kevin O'Connor | 9961f99 | 2012-01-21 11:53:44 -0500 | [diff] [blame] | 45 | int bochsvga_get_window(struct vgamode_s *vmode_g, int window); |
| 46 | int bochsvga_set_window(struct vgamode_s *vmode_g, int window, int val); |
Kevin O'Connor | 3876b53 | 2012-01-24 00:07:44 -0500 | [diff] [blame] | 47 | int bochsvga_get_linelength(struct vgamode_s *vmode_g); |
| 48 | int bochsvga_set_linelength(struct vgamode_s *vmode_g, int val); |
Kevin O'Connor | d61fc53 | 2012-01-27 20:37:45 -0500 | [diff] [blame] | 49 | int bochsvga_get_displaystart(struct vgamode_s *vmode_g); |
| 50 | int bochsvga_set_displaystart(struct vgamode_s *vmode_g, int val); |
Kevin O'Connor | e737b17 | 2012-02-04 11:08:39 -0500 | [diff] [blame] | 51 | int bochsvga_get_dacformat(struct vgamode_s *vmode_g); |
| 52 | int bochsvga_set_dacformat(struct vgamode_s *vmode_g, int val); |
Kevin O'Connor | 20dc419 | 2014-02-05 20:52:25 -0500 | [diff] [blame] | 53 | int bochsvga_save_restore(int cmd, u16 seg, void *data); |
Kevin O'Connor | e6bc4c1 | 2012-01-21 11:26:37 -0500 | [diff] [blame] | 54 | int bochsvga_set_mode(struct vgamode_s *vmode_g, int flags); |
Kevin O'Connor | d83c87b | 2013-01-21 01:14:12 -0500 | [diff] [blame] | 55 | int bochsvga_setup(void); |
Kevin O'Connor | f1e217d | 2011-12-31 03:18:18 -0500 | [diff] [blame] | 56 | |
Kevin O'Connor | e1e000b | 2011-12-31 03:30:40 -0500 | [diff] [blame] | 57 | #endif // bochsvga.h |