# unit vbxe

### Video Board XE unit

author: Tomasz Biela (Tebe), Daniel Koźmiński

VGA: text mode 80x24 in 2 colors per character. This is like GR.0 in 80 columns and color.
VGALo: pixel mode 160x192/256 colors (lowres). This is like GR.15 in 256 colors.
VGAMed: pixel mode 320x192/256 colors (stdres). This is like GR.8 in 256 colors.
VGAHi: pixel mode 640x192/16 colors (hires)
The mode 0 is reserved for text console.

## Constants:

name: | value: | description:
--- | --- | ---
VC_XDL | 1 |
VC_XCOLOR | 2 |
VC_NO_TRANS | 4 |
VC_TRANS15 | 8 |

## Types:

name: | type: | description:
--- | --- | ---
TUInt24 | record byte0: byte; byte1: byte; byte2: byte; end; |
TXDL | record xdlc_: word; // blank rptl_: byte; xdlc: word; rptl: byte; ov_adr: TUInt24; ov_step: word; ov_chbase: byte; mp_adr: TUInt24; mp_step: word; mp_hscrol: byte; mp_vscrol: byte; mp_width: byte; mp_height: byte; ov_width: byte; ov_prior: byte; end; |
TBCB | record src_adr: TUInt24; src_step_y: smallint; src_step_x: shortint; dst_adr: TUInt24; dst_step_y: smallint; dst_step_x: shortint; blt_width: word; blt_height: byte; blt_and_mask: byte; blt_xor_mask: byte; blt_collision_mask: byte; blt_zoom: byte; pattern_feature: byte; blt_control: byte; end; |
TVBXEMemoryStream | Object Position: cardinal; Size: cardinal; // 0..Size-1 procedure Create; procedure Clear; procedure SetBank; procedure ReadBuffer(var Buffer; Count: word); procedure WriteBuffer(var Buffer; Count: word); function ReadByte: Byte; function ReadWord: Word; function ReadDWord: Cardinal; procedure WriteByte(b: Byte); procedure WriteWord(w: Word); procedure WriteDWord(d: Cardinal); end; |

## Register Variables:

name: | address: | type: | description:
--- | --- | --- | ---
fildat | $2fd | byte |
rowcrs | $54 | byte | pionowa pozycja kursora
colcrs | $55 | byte | (2) pozioma pozycja kursora

## Interface:

name: | description:
--- | ---
VBXEMemoryBank | #### procedure VBXEMemoryBank(b: byte); assembler;
ReadVBXEMemoryByte | #### function ReadVBXEMemoryByte(var Position: cardinal): byte;
WriteVBXEMemoryByte | #### procedure WriteVBXEMemoryByte(var Position: cardinal; a: byte);
TVBXEMemoryStream.Create | #### procedure TVBXEMemoryStream.Create;
TVBXEMemoryStream.SetBank | #### procedure TVBXEMemoryStream.SetBank;
TVBXEMemoryStream.ReadBuffer | #### procedure TVBXEMemoryStream.ReadBuffer(var Buffer; Count: word);
TVBXEMemoryStream.WriteBuffer | #### procedure TVBXEMemoryStream.WriteBuffer(var Buffer; Count: word);
TVBXEMemoryStream.ReadByte | #### function TVBXEMemoryStream.ReadByte: Byte;
TVBXEMemoryStream.ReadWord | #### function TVBXEMemoryStream.ReadWord: Word;
TVBXEMemoryStream.ReadDWord | #### function TVBXEMemoryStream.ReadDWord: Cardinal;
TVBXEMemoryStream.WriteByte | #### procedure TVBXEMemoryStream.WriteByte(b: Byte);
TVBXEMemoryStream.WriteWord | #### procedure TVBXEMemoryStream.WriteWord(w: Word);
TVBXEMemoryStream.WriteDWord | #### procedure TVBXEMemoryStream.WriteDWord(d: Cardinal);
TVBXEMemoryStream.Clear | #### procedure TVBXEMemoryStream.Clear;
SetColor | #### procedure SetColor(a: byte);
PutPixel | #### procedure PutPixel(x: word; y: byte);
HLine | #### procedure HLine(x1, x2: word; y1: byte);
VLine | #### procedure VLine(x1: word; y1, y2: byte);
Line | #### procedure Line(x1: word; y1: byte; x2: word; y2: byte);
Position | #### procedure Position(x,y: byte); Set cursor position on screen. Positions the cursor at (X,Y), X in horizontal, Y in vertical direction. ##### parameters: x - horizontal positions y - vertical positions
TextOut | #### procedure TextOut(a: char; c: byte); overload;
TextOut | #### procedure TextOut(s: PByte; c: byte); overload;
OverlayOff | #### procedure OverlayOff; assembler;
ColorMapOn | #### procedure ColorMapOn; assembler;
ColorMapOff | #### procedure ColorMapOff; assembler;
SetHorizontalRes | #### procedure SetHorizontalRes(a: byte; s: word); overload;
SetHorizontalRes | #### procedure SetHorizontalRes(a: byte); overload;
SetHRes | #### procedure SetHRes(a: byte); overload;
SetHRes | #### procedure SetHRes(a: byte; s: word); overload;
IniBCB | #### procedure IniBCB(var a: TBCB; src,dst: cardinal; w0, w1: smallint; w: word; h: byte; ctrl: byte);
SrcBCB | #### procedure SrcBCB(var a: TBCB; src: cardinal);
DstBCB | #### procedure DstBCB(var a: TBCB; dst: cardinal);
BlitterBusy | #### function BlitterBusy: Boolean; assembler;
RunBCB | #### procedure RunBCB(var a: TBCB); assembler;
GetXDL | #### procedure GetXDL(var a: txdl); register; assembler;
SetXDL | #### procedure SetXDL(var a: txdl); register; assembler;
VBXEControl | #### procedure VBXEControl(a: byte); assembler;
VBXEOff | #### procedure VBXEOff; assembler;