Tvùrce webu je i pro tebe! Postav tøeba web. Bez grafika. Bez kodéra. Hned.
wz

<< Back

cesky: , English:

DISP

Display driver

Litos8 supports standard BIOS videomodes BIOS, number 0 to 19. It allows to display characters in IBM or KEYBCS2 code (Kamenickych brothers; depending on language selected by Scroll Lock), scrolling, copy display area, frames. Supported video cards are MDA (or Hercules), CGA, EGA and VGA.

Color is entered in the color attribute format with functions to display a text, as it is usual in text modes - lower 4 bits present text color, upper 4 bits background color. For functions without specifying color, a default color will be used, adjustable with DispSetDefCol function.

Most videomodes allow to determine the start of display video memory, using DispSetShift function. So it is possible to switch between multiple display pages and realize fast image scrolling.


DispGetCard - get video card type

OUTPUT:
AL =
video card type (VCARD_MDA..)


DispSetMode - set videomode

INPUT:
AL = required
videomode

OUTPUT:
AL = new current
videomode


DispGetMode - get current videomode

OUTPUT:
AL =
videomode (VMODE_40x25G..)


DispGetModeDesc - get current videomode descriptor

OUTPUT:
SI = pointer to
VMODE descriptor


DispGetFontSize - get current font height

OUTPUT:
AL = number of lines per character

NOTES: Can be used when setting cursor size. All graphics modes use 8-line characters.


DispClear - clear display


SetCursor - set cursor position

INPUT:
DL = column
DH = row

NOTES: Cursor is visible only in text modes. To disable cursor, move it out of display area. It temporaly disables interrupts.


GetCursor - get cursor position

INPUT:
AL = column
AH = row


SetCursorSize - set cursor size

INPUT:
AL = bottom line of cursor, from top (0..31, AL >= AH)
AH = top line of cursor, from top (0..31, AH <= AL)

NOTES: Cursor is visible only in text modes. To disable cursor, move it out of display area. It temporaly disables interrupts.


GetCursorSize - get cursor size

OUTPUT:
AL = bottom line of cursor,from top (0..31, AL >= AH)
AH = top line of cursor, from top (0..31, AH <= AL)

NOTES: Cursor is visible only in text modes. To disable cursor, move it out of display area.


DispGetDefCol - get default color

OUTPUT:
AL = default
color


DispSetDefCol - set default color

INPUT:
AL = default
color


DispFill - fill text area

INPUT:
AL = character
AH =
color attributes
CL = width
CH = height
DL = column
DH = row


DispChar - display character

INPUT:
AL = character
AH =
color attributes
DL = column
DH = row


DispText - display text

INPUT:
AH =
color attributes
SI = pointer to text
CX = text length
DL = column
DH = row


DispMove - move text area

INPUT:
BL = source column
BH = source row
CL = width
CH = height
DL = destination column
DH = destination row


DispScroll - scroll screen by one row


DispSetShift - set shift of view window

INPUT:
AX = row (text) or Y coordinate (graphics)


DispGetShift - get shift of view window

OUTPUT:
AX = row (text) or Y coordinate (graphics)


GetCharFont - get character font (8x8 character)

INPUT:
AL = character

OUTPUT:
SI = address of 8x8 character font


SetBorder - set screen border color

INPUT:
AL = border
color 0..31 (bit 4: high intensity)

NOTES: With CGA graphics card it works only in text modes.


DispCharTable - display character table (characters 0..255)

INPUT:
AH =
color attributes
DH = column
DL = row

NOTES: Table has size 35 x 18.


SetCGAPal - set CGA palettes

INPUT:
AL = color, bit 0..3: black
color (color with index 0), bit 4: intensive foreground colors, bit 5: palettes 0 = green + brown, 1 = cyan + magenta


SetEGAPal - set one EGA palette register

INPUT:
AL = palette register 0..15
AH = color value
- bit 0: blue 2/3
- bit 1: green 2/3
- bit 2: red 2/3
- bit 4: secondary blue 1/3
- bit 5: secondary green 1/3
- bit 6: secondary blue 1/3

NOTES: Default values of palette registers:
0: 00h black
1: 01h blue
2: 02h green
3: 03h cyan
4: 04h red
5: 05h magenta
6: 14h brown
7: 07h white
8: 38h dark gray
9: 39h light blue
10: 3Ah light green
11: 3Bh light cyan
12: 3Ch light red
13: 3Dh light magenta
14: 3Eh yellow
15: 3Fh light white


SetEGAPalTab - set EGA palette registers using table

INPUT:
AX = 17-byte table of palette registers (last byte is border):
- bit 0: blue 2/3
- bit 1: green 2/3
- bit 2: red 2/3
- bit 4: secondary blue 1/3
- bit 5: secondary green 1/3
- bit 6: secondary blue 1/3


VGASetPal - set one VGA palette register

INPUT:
AL = palette register index (0..255)
AH = palette value Red (0..255)
BL = palette value Blue (0..255)
BH = palette value Green (0..255)

NOTES: Only 6 most significant bits of palettes are used (bits 2..7).


VGASetPalRGB - set VGA palettes from RGB table

INPUT:
AL = start palette register index (0..255)
CX = number of palette registers (1..256)
SI = palette table (triples: Blue, Green, Red, values 0..255)

NOTES: Only 6 most significant bits of palettes are used (bits 2..7).


VGASetPalRGBA - set VGA palettes from RGBA table

INPUT:
AL = start palette register index (0..255)
CX = number of palette registers (1..256)
SI = palette table (Blue, Green, Red, Alpha, values 0..255)

NOTES: Only 6 most significant bits of palettes are used (bits 2..7). Alpha component of table is unused and skipped.


VGASetPalDef - set default VGA palettes

NOTES: Color 0..15: standard EGA palettes. Color 16..31: gray scale 0,11h,22h,...0ffh. Color 32..39: bright colors RGB (black, blue, green,...white). Color 40..255: uniform palette (blue, green, red in 6 levels).


VGAGetPalDef - get default VGA RGB palettes

INPUT:
DI = destination 768-byte buffer (256 entries B-G-R, 0..255)

NOTES: Color 0..15: standard EGA palettes. Color 16..31: gray scale 0,11h,22h,...0ffh. Color 32..39: bright colors RGB (black, blue, green,...white). Color 40..255: uniform palette (blue, green, red in 6 levels).


ImportRGBPal - import RGB palettes

INPUT:
SI = imported RGB palettes (768 bytes: 256 entries B-G-R,0..255)
BX = reference RGB palette to import to (768 bytes: 256*B-G-R)
DI = destination 256-byte buffer, obtaining remapping indices


SetTXTBlink - set TEXT blinking mode (EGA, VGA)

INPUT:
AL = if color bit 7 is set: 1=blinking, 0=intensive background


Videocard type

VCARD_MDA: (=0) MDA (or Hercules MCG)
VCARD_CGA: (=1) CGA
VCARD_EGA: (=2) EGA
VCARD_VGA: (=3) VGA


videomode descriptor VMODE:

VMODE_FLAGS: (byte) videomode flags (see below)
VMODE_MODEL: (byte) color model (see below)
VMODE_COLBITS: (byte) number of color bits
VMODE_DEFMODE: (byte) default text videomode
VMODE_COLSROWS: (word)
VMODE_COLS: (byte) number of text columns
VMODE_ROWS: (byte) number of text rows
VMODE_SCANLINE: (word) bytes per row (text or graphics)
VMODE_WIDTH: (word) graphics width
VMODE_HEIGHT: (word) graphics height
VMODE_SEGM: (word) videomemory segment
VMODE_MAXSHIFT: (word) view window maximal shift
VMODE_PORT: (word) control port (3D4h or 3B4h)
VMODE_CLEAR: (word) function - clear display
VMODE_FILL: (word) function - fill text area (INPUT: AL = character, AH = color attributes, CL = width, CH = height, DL = column, DH = row)
VMODE_CHAR: (word) function - display character (INPUT: AL = character, AH = color attributes, DL = column, DH = row)
VMODE_MOVE: (word) function - move text area (INPUT: BL = source column, BH = source row, CL = width, CH = height, DL = destination column, DH = destination row)
VMODE_SHIFT: (word) function - shift view window (INPUT: AX = row or Y-coord.)

videomode flags:

VMODE_FLAGS_MDA: (=B0) MDA card supported
VMODE_FLAGS_CGA: (=B1) CGA card supported
VMODE_FLAGS_EGA: (=B2) EGA card supported
VMODE_FLAGS_VGA: (=B3) VGA card supported

color model:

VMODE_MODEL_NO (=0) unknown color model
VMODE_MODEL_TXT (=1) text (2 bytes per character)
VMODE_MODEL_CG1 (=2) CGA 1-bit (2 colors) graphics
VMODE_MODEL_CG2 (=3) CGA 2-bit (4 colors) graphics
VMODE_MODEL_EG1 (=4) EGA 1-bit (2 colors) graphics
VMODE_MODEL_EG4 (=5) EGA 4-bit (16 colors) graphics
VMODE_MODEL_VGA (=6) VGA 8-bit (256 colors) graphics


supported videomodes:

VMODE_40x25G: (=0) text 40 x 25 gray
VMODE_40x25: (=1) text 40 x 25 color
VMODE_80x25G: (=2) text 80 x 25 gray
VMODE_80x25: (=3) text 80 x 25 color
VMODE_320x200x4: (=4) graphics 320 x 200, 4 colors
VMODE_320x200x4G: (=5) graphics 320 x 200, 4 gray
VMODE_640x200x2: (=6) graphics 640 x 200, 2
VMODE_80x25BW: (=7) text 80 x 25, black&white
VMODE_320x200x16: (=13) graphics 320 x 200, 16 colors
VMODE_640x200x16: (=14) graphics 640 x 200, 16 colors
VMODE_640x350xBW: (=15) graphics 640 x 350, black&white
VMODE_640x350x16: (=16) graphics 640 x 350, 16 colors
VMODE_640x480x2: (=17) graphics 640 x 480, 2 colors
VMODE_640x480x16: (=18) graphics 640 x 480, 16 colors
VMODE_320x200x256: (=19) graphics 320 x 200, 256 colors

VMODE_NUM: (=20) number of supported videomodes
VMODE_INVALID: (=12) invalid videomode


standard PC colors:

COL_BLACK: (=0) black
COL_BLUE: (=1) blue
COL_GREEN: (=2) green
COL_CYAN: (=3) cyan
COL_RED: (=4) red
COL_MAGENTA: (=5) magenta
COL_YELLOW: (=6) yellow (brown)
COL_WHITE: (=7) white
COL_LBLACK: (=8) light black (gray)
COL_LBLUE: (=9) light blue
COL_LGREEN: (=10) light green
COL_LCYAN: (=11) light cyan
COL_LRED: (=12) light red
COL_LMAGENTA: (=13) light magenta
COL_LYELLOW: (=14) light yellow
COL_LWHITE: (=15) light white

COL_BROWN: (=COL_YELLOW) brown (dark yellow)
COL_GRAY: (=COL_LBLACK) gray (light black)

monochrome attributes:

COL_INVIS: (=0) invisible
COL_UNDER: (=1) underline
COL_NORMAL: (=7) normal
COL_INTENS: (=0Fh) intensity
COL_INVERSE: (=70h) inverse
COL_DARK: (=8) dark

color attributes:

COL_FGINT: (=B3) foreground intensity bit
COL_BLINK: (=B7) blinking bit


Source code DISP.ASM

<< Back