00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00050 #ifndef BX_IODEV_VGA_H
00051 #define BX_IODEV_VGA_H
00052
00053
00054 #define MAKE_COLOUR \
00055 ( \
00056 red, red_shiftfrom, red_shiftto, red_mask, green, green_shiftfrom, \
00057 green_shiftto, green_mask, blue, blue_shiftfrom, blue_shiftto, blue_mask \
00058 ) \
00059 ( \
00060 ( \
00061 ( \
00062 ((red_shiftto) > (red_shiftfrom)) ? (red) << \
00063 ((red_shiftto) - (red_shiftfrom)) : (red) >> \
00064 ((red_shiftfrom) - (red_shiftto)) \
00065 ) & (red_mask) \
00066 ) | \
00067 ( \
00068 ( \
00069 ((green_shiftto) > (green_shiftfrom)) ? (green) << \
00070 ((green_shiftto) - (green_shiftfrom)) : (green) >> \
00071 ((green_shiftfrom) - (green_shiftto)) \
00072 ) & (green_mask) \
00073 ) | \
00074 ( \
00075 ( \
00076 ((blue_shiftto) > (blue_shiftfrom)) ? (blue) << \
00077 ((blue_shiftto) - (blue_shiftfrom)) : (blue) >> \
00078 ((blue_shiftfrom) - (blue_shiftto)) \
00079 ) & (blue_mask) \
00080 ) \
00081 )
00082 #if BX_SUPPORT_VBE
00083 #define VBE_DISPI_TOTAL_VIDEO_MEMORY_MB 8
00084 #define VBE_DISPI_4BPP_PLANE_SHIFT 21
00085
00086 #define VBE_DISPI_BANK_ADDRESS 0xA0000
00087 #define VBE_DISPI_BANK_SIZE_KB 64
00088
00089 #define VBE_DISPI_MAX_XRES 1600
00090 #define VBE_DISPI_MAX_YRES 1200
00091 #define VBE_DISPI_MAX_BPP 32
00092
00093 #define VBE_DISPI_IOPORT_INDEX 0x01CE
00094 #define VBE_DISPI_IOPORT_DATA 0x01CF
00095
00096 #define VBE_DISPI_IOPORT_INDEX_OLD 0xFF80
00097 #define VBE_DISPI_IOPORT_DATA_OLD 0xFF81
00098
00099 #define VBE_DISPI_INDEX_ID 0x0
00100 #define VBE_DISPI_INDEX_XRES 0x1
00101 #define VBE_DISPI_INDEX_YRES 0x2
00102 #define VBE_DISPI_INDEX_BPP 0x3
00103 #define VBE_DISPI_INDEX_ENABLE 0x4
00104 #define VBE_DISPI_INDEX_BANK 0x5
00105 #define VBE_DISPI_INDEX_VIRT_WIDTH 0x6
00106 #define VBE_DISPI_INDEX_VIRT_HEIGHT 0x7
00107 #define VBE_DISPI_INDEX_X_OFFSET 0x8
00108 #define VBE_DISPI_INDEX_Y_OFFSET 0x9
00109
00110 #define VBE_DISPI_ID0 0xB0C0
00111 #define VBE_DISPI_ID1 0xB0C1
00112 #define VBE_DISPI_ID2 0xB0C2
00113 #define VBE_DISPI_ID3 0xB0C3
00114 #define VBE_DISPI_ID4 0xB0C4
00115
00116 #define VBE_DISPI_BPP_4 0x04
00117 #define VBE_DISPI_BPP_8 0x08
00118 #define VBE_DISPI_BPP_15 0x0F
00119 #define VBE_DISPI_BPP_16 0x10
00120 #define VBE_DISPI_BPP_24 0x18
00121 #define VBE_DISPI_BPP_32 0x20
00122
00123 #define VBE_DISPI_DISABLED 0x00
00124 #define VBE_DISPI_ENABLED 0x01
00125 #define VBE_DISPI_GETCAPS 0x02
00126 #define VBE_DISPI_8BIT_DAC 0x20
00127 #define VBE_DISPI_LFB_ENABLED 0x40
00128 #define VBE_DISPI_NOCLEARMEM 0x80
00129
00130 #define VBE_DISPI_LFB_PHYSICAL_ADDRESS 0xE0000000
00131
00132 #define VBE_DISPI_TOTAL_VIDEO_MEMORY_KB (VBE_DISPI_TOTAL_VIDEO_MEMORY_MB * 1024)
00133 #define VBE_DISPI_TOTAL_VIDEO_MEMORY_BYTES (VBE_DISPI_TOTAL_VIDEO_MEMORY_KB * 1024)
00134 #define BX_MAX_XRES VBE_DISPI_MAX_XRES
00135 #define BX_MAX_YRES VBE_DISPI_MAX_YRES
00136
00137 #elif BX_SUPPORT_CLGD54XX
00138 #define BX_MAX_XRES 1280
00139 #define BX_MAX_YRES 1024
00140
00141 #else
00142 #define BX_MAX_XRES 800
00143 #define BX_MAX_YRES 600
00144 #endif //BX_SUPPORT_VBE
00145 #define X_TILESIZE 16
00146 #define Y_TILESIZE 24
00147 #define BX_NUM_X_TILES (BX_MAX_XRES / X_TILESIZE)
00148 #define BX_NUM_Y_TILES (BX_MAX_YRES / Y_TILESIZE)
00149
00150
00151
00152 #define BX_MAX_TEXT_LINES 100
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176 #endif