diff options
author | Sungho Park <chywoo.park@samsung.com> | 2012-02-27 21:19:31 +0900 |
---|---|---|
committer | Sungho Park <chywoo.park@samsung.com> | 2012-02-27 21:19:31 +0900 |
commit | deaf05fbd0e3d4b53bcae8514a762cac4f971ac9 (patch) | |
tree | a8653ed627c487711a30ef763b655e79f40b0cda /vgabios.h | |
download | vgabios-deaf05fbd0e3d4b53bcae8514a762cac4f971ac9.tar.gz vgabios-deaf05fbd0e3d4b53bcae8514a762cac4f971ac9.tar.bz2 vgabios-deaf05fbd0e3d4b53bcae8514a762cac4f971ac9.zip |
Initialize
Diffstat (limited to 'vgabios.h')
-rw-r--r-- | vgabios.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/vgabios.h b/vgabios.h new file mode 100644 index 0000000..3ad4bae --- /dev/null +++ b/vgabios.h @@ -0,0 +1,47 @@ +#ifndef vgabios_h_included +#define vgabios_h_included + +/* Types */ +typedef unsigned char Bit8u; +typedef unsigned short Bit16u; +typedef unsigned long Bit32u; +typedef unsigned short Boolean; + +/* Defines */ + +#define SET_AL(val8) AX = ((AX & 0xff00) | (val8)) +#define SET_BL(val8) BX = ((BX & 0xff00) | (val8)) +#define SET_CL(val8) CX = ((CX & 0xff00) | (val8)) +#define SET_DL(val8) DX = ((DX & 0xff00) | (val8)) +#define SET_AH(val8) AX = ((AX & 0x00ff) | ((val8) << 8)) +#define SET_BH(val8) BX = ((BX & 0x00ff) | ((val8) << 8)) +#define SET_CH(val8) CX = ((CX & 0x00ff) | ((val8) << 8)) +#define SET_DH(val8) DX = ((DX & 0x00ff) | ((val8) << 8)) + +#define GET_AL() ( AX & 0x00ff ) +#define GET_BL() ( BX & 0x00ff ) +#define GET_CL() ( CX & 0x00ff ) +#define GET_DL() ( DX & 0x00ff ) +#define GET_AH() ( AX >> 8 ) +#define GET_BH() ( BX >> 8 ) +#define GET_CH() ( CX >> 8 ) +#define GET_DH() ( DX >> 8 ) + +#define SET_CF() FLAGS |= 0x0001 +#define CLEAR_CF() FLAGS &= 0xfffe +#define GET_CF() (FLAGS & 0x0001) + +#define SET_ZF() FLAGS |= 0x0040 +#define CLEAR_ZF() FLAGS &= 0xffbf +#define GET_ZF() (FLAGS & 0x0040) + +#define SCROLL_DOWN 0 +#define SCROLL_UP 1 +#define NO_ATTR 2 +#define WITH_ATTR 3 + +#define SCREEN_SIZE(x,y) (((x*y*2)|0x00ff)+1) +#define SCREEN_MEM_START(x,y,p) ((((x*y*2)|0x00ff)+1)*p) +#define SCREEN_IO_START(x,y,p) ((((x*y)|0x00ff)+1)*p) + +#endif |