#ifndef _DEV_VT_HW_VGA_VGA_REG_H_
#define _DEV_VT_HW_VGA_VGA_REG_H_
#define VGA_MEM_BASE 0xA0000
#define VGA_MEM_SIZE 0x10000
#define VGA_TXT_BASE 0xB8000
#define VGA_TXT_SIZE 0x08000
#define VGA_REG_BASE 0x3c0
#define VGA_REG_SIZE 0x10+0x0c
#define VGA_AC_WRITE 0x00
#define VGA_AC_READ 0x01
#define VGA_AC_PALETTE(x) (x)
#define VGA_AC_PAL_SR 0x20
#define VGA_AC_PAL_SG 0x10
#define VGA_AC_PAL_SB 0x08
#define VGA_AC_PAL_R 0x04
#define VGA_AC_PAL_G 0x02
#define VGA_AC_PAL_B 0x01
#define VGA_AC_MODE_CONTROL (32+16)
#define VGA_AC_MC_IPS 0x80
#define VGA_AC_MC_PCS 0x40
#define VGA_AC_MC_PPC 0x20
#define VGA_AC_MC_BI 0x08
#define VGA_AC_MC_ELG 0x04
#define VGA_AC_MC_DT 0x02
#define VGA_AC_MC_GA 0x01
#define VGA_AC_OVERSCAN_COLOR (32+17)
#define VGA_AC_COLOR_PLANE_ENABLE (32+18)
#define VGA_AC_HORIZ_PIXEL_PANNING (32+19)
#define VGA_AC_COLOR_SELECT (32+20)
#define VGA_AC_CS_C67 0x0C
#define VGA_AC_CS_C45 0x03
#define VGA_GEN_MISC_OUTPUT_W 0x02
#define VGA_GEN_MISC_OUTPUT_R 0x0c
#define VGA_GEN_MO_VSP 0x80
#define VGA_GEN_MO_HSP 0x40
#define VGA_GEN_MO_PB 0x20
#define VGA_GEN_MO_CS 0x0C
#define VGA_GEN_MO_ER 0x02
#define VGA_GEN_MO_IOA 0x01
#define VGA_GEN_INPUT_STAT_0 0x02
#define VGA_GEN_FEATURE_CTRL_W 0x1a
#define VGA_GEN_FEATURE_CTRL_R 0x0a
#define VGA_GEN_INPUT_STAT_1 0x1a
#define VGA_GEN_IS1_VR 0x08
#define VGA_GEN_IS1_DE 0x01
#define VGA_SEQ_ADDRESS 0x04
#define VGA_SEQ_RESET 0
#define VGA_SEQ_RST_SR 0x02
#define VGA_SEQ_RST_NAR 0x01
#define VGA_SEQ_CLOCKING_MODE 1
#define VGA_SEQ_CM_SO 0x20
#define VGA_SEQ_CM_S4 0x10
#define VGA_SEQ_CM_DC 0x08
#define VGA_SEQ_CM_SL 0x04
#define VGA_SEQ_CM_89 0x01
#define VGA_SEQ_MAP_MASK 2
#define VGA_SEQ_MM_EM3 0x08
#define VGA_SEQ_MM_EM2 0x04
#define VGA_SEQ_MM_EM1 0x02
#define VGA_SEQ_MM_EM0 0x01
#define VGA_SEQ_CHAR_MAP_SELECT 3
#define VGA_SEQ_CMS_SAH 0x20
#define VGA_SEQ_CMS_SBH 0x10
#define VGA_SEQ_CMS_SA 0x0C
#define VGA_SEQ_CMS_SB 0x03
#define VGA_SEQ_MEMORY_MODE 4
#define VGA_SEQ_MM_C4 0x08
#define VGA_SEQ_MM_OE 0x04
#define VGA_SEQ_MM_EM 0x02
#define VGA_SEQ_DATA 0x05
#define VGA_PEL_MASK 0x06
#define VGA_PEL_ADDR_RD_MODE 0x07
#define VGA_DAC_STATE 0x07
#define VGA_PEL_ADDR_WR_MODE 0x08
#define VGA_PEL_DATA 0x09
#define VGA_GC_ADDRESS 0x0e
#define VGA_GC_SET_RESET 0
#define VGA_GC_ENABLE_SET_RESET 1
#define VGA_GC_COLOR_COMPARE 2
#define VGA_GC_DATA_ROTATE 3
#define VGA_GC_DR_FS_XOR 0x18
#define VGA_GC_DR_FS_OR 0x10
#define VGA_GC_DR_FS_AND 0x08
#define VGA_GC_DR_RC 0x07
#define VGA_GC_READ_MAP_SELECT 4
#define VGA_GC_MODE 5
#define VGA_GC_MODE_SR 0x60
#define VGA_GC_MODE_OE 0x10
#define VGA_GC_MODE_RM 0x08
#define VGA_GC_MODE_WM 0x03
#define VGA_GC_MISCELLANEOUS 6
#define VGA_GC_MISC_MM 0x0C
#define VGA_GC_MISC_COE 0x02
#define VGA_GC_MISC_GA 0x01
#define VGA_GC_COLOR_DONT_CARE 7
#define VGA_GC_BIT_MASK 8
#define VGA_GC_DATA 0x0f
#define VGA_CRTC_ADDRESS 0x14
#define VGA_CRTC_HORIZ_TOTAL 0
#define VGA_CRTC_HORIZ_DISP_END 1
#define VGA_CRTC_START_HORIZ_BLANK 2
#define VGA_CRTC_END_HORIZ_BLANK 3
#define VGA_CRTC_EHB_CR 0x80
#define VGA_CRTC_EHB_DES 0x60
#define VGA_CRTC_EHB_EHB 0x1F
#define VGA_CRTC_START_HORIZ_RETRACE 4
#define VGA_CRTC_END_HORIZ_RETRACE 5
#define VGA_CRTC_EHR_EHB 0x80
#define VGA_CRTC_EHR_HRD 0x60
#define VGA_CRTC_EHR_EHR 0x1F
#define VGA_CRTC_VERT_TOTAL 6
#define VGA_CRTC_OVERFLOW 7
#define VGA_CRTC_OF_VRS9 0x80
#define VGA_CRTC_OF_VDE9 0x40
#define VGA_CRTC_OF_VT9 0x20
#define VGA_CRTC_OF_LC8 0x10
#define VGA_CRTC_OF_VBS8 0x08
#define VGA_CRTC_OF_VRS8 0x04
#define VGA_CRTC_OF_VDE8 0x02
#define VGA_CRTC_OF_VT8 0x01
#define VGA_CRTC_PRESET_ROW_SCAN 8
#define VGA_CRTC_PRS_BP 0x60
#define VGA_CRTC_PRS_PRS 0x1F
#define VGA_CRTC_MAX_SCAN_LINE 9
#define VGA_CRTC_MSL_2T4 0x80
#define VGA_CRTC_MSL_LC9 0x40
#define VGA_CRTC_MSL_VBS9 0x20
#define VGA_CRTC_MSL_MSL 0x1F
#define VGA_CRTC_CURSOR_START 10
#define VGA_CRTC_CS_COO 0x20
#define VGA_CRTC_CS_CS 0x1F
#define VGA_CRTC_CURSOR_END 11
#define VGA_CRTC_CE_CSK 0x60
#define VGA_CRTC_CE_CE 0x1F
#define VGA_CRTC_START_ADDR_HIGH 12
#define VGA_CRTC_START_ADDR_LOW 13
#define VGA_CRTC_CURSOR_LOC_HIGH 14
#define VGA_CRTC_CURSOR_LOC_LOW 15
#define VGA_CRTC_VERT_RETRACE_START 16
#define VGA_CRTC_VERT_RETRACE_END 17
#define VGA_CRTC_VRE_PR 0x80
#define VGA_CRTC_VRE_BW 0x40
#define VGA_CRTC_VRE_VRE 0x1F
#define VGA_CRTC_VERT_DISPLAY_END 18
#define VGA_CRTC_OFFSET 19
#define VGA_CRTC_UNDERLINE_LOC 20
#define VGA_CRTC_UL_DW 0x40
#define VGA_CRTC_UL_CB4 0x20
#define VGA_CRTC_UL_UL 0x1F
#define VGA_CRTC_START_VERT_BLANK 21
#define VGA_CRTC_END_VERT_BLANK 22
#define VGA_CRTC_MODE_CONTROL 23
#define VGA_CRTC_MC_HR 0x80
#define VGA_CRTC_MC_WB 0x40
#define VGA_CRTC_MC_AW 0x20
#define VGA_CRTC_MC_CBT 0x08
#define VGA_CRTC_MC_HRS 0x04
#define VGA_CRTC_MC_SRS 0x02
#define VGA_CRTC_MC_CMS 0x01
#define VGA_CRTC_LINE_COMPARE 24
#define VGA_CRTC_DATA 0x15
#endif