ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ JVESA version 0.84b Copyright 1996 Jetro Lauha ----------------------------------------------------------------------- for Turbo Pascal 7.0 Last updated: 26.11.1996 (dd.mm.yyyy) This software and the data files (hereinafter referred as "this product") are owned by Jetro Lauha (hereinafter referred as "author"). By using this product you accept the terms and conditions of this agreement. You have no rights or privileges beyond those specifially spelled out under this license agreement. This material is not free. You may distribute copies of the product freely as long as no payment of any kind is be charged for this product or any combination of products or services including or using this product or derivations of it. This product and the data files contained therein may not be modified, altered, merged, adapted, reverse engineered, sublicensed, time-shared, rented, leased or subleased. You may not remove or obscure the author's copyright. You may use this product freely in fully non-commercial products which are free for the public to use. You may not use the product for any commercial transaction. You take full responsibility for the operation of this software and any consequences thereof. The author can not accept liability for damages or failures arising from the use of this product. Author's contact information: Normal mail: Jetro Lauha Hansakallionkuja 3B10 FIN-02780 Espoo, Finland Internet E-mail: tonic@mikrobitti.fi (or tonic@triplex.fipnet.fi or jjl@pcuf.fi) ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Why? The reason why I release these routines is that I personally don't have much use for these. Only a little time after I finished these routines I started to use C as my primary programming language so there routines became mostly useless. I'm sure that some bugs exist (the "b" in the version number stands for "bug" but I don't have any interests to fix and find those bugs. Most of the routines are written in pure 386 assembler. The slow ones (like jvloadpcx and jvline etc) are written in pure pascal =). Unfortunately there is no clipping in almost all of the functions. This document is very bad since it is written in a hurry. You shouldn't even believe everything what this document says (it has been a long time since I last time looked at the source). JVESA is mainly designed for 640x480x256 mode but it may work with some other 256-color VESA modes too. Generally these routines suck. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Brief descriptions of functions and variables. Refer to VESASP12.TXT for general info about VESA SVGA bios extensions. (Look in JVESATST.PAS for simple example program) ----------------------------------------------------------------------- type vgainfoblocktype=record vesasig:array[0..3]of byte; vesaver:word; oemstrptr:longint; capab:array[0..3]of byte; vmodeptr:longint; totalmem:word; reserved:array[0..235]of byte; end; type modeinfoblocktype=record modeattr:word; winaattr:byte; winbattr:byte; wingran:word; winsize:word; winaseg:word; winbseg:word; winfuncptr:longint; bytesperline:word; xres:word; yres:word; xcharsize:byte; ycharsize:byte; numofplan:byte; bitsperpix:byte; numofbanks:byte; memmodel:byte; banksize:byte; numbofimageplanes:byte; reservedpagefunction:byte; redmasksize:byte; redfieldpos:byte; greenmasksize:byte; greenfieldpos:byte; bluemasksize:byte; bluefieldpos:byte; rsvdmasksize:byte; dircolinfo:byte; reserved:array[0..215]of byte; end; var vgainfo:vgainfoblocktype; modeinfo:modeinfoblocktype; bankptr:pointer; vesaseg,vesarseg,curwbank,currbank,linewidth:word; wgran,wsize:longint; winasup,winbsup,winaread,winawrite,winbread,winbwrite:boolean; wriwin,readwin:byte; Vgainfo&modeinfo hold the vesa and mode information. Bankptr is direct pointer to window changing function. Vesaseg and vesarseg are write and read segments for screen memory. Curwbank & currbank are current write and read banks. Linewidth is current screenmode line width in pixels. Wgran and wsize are window granularity and window size in bytes. Winasup...winbwrite indicate window a & b support and possibility to write/read to them. Wriwin and readwin are write & read window used by Jvesa functions. ----------------------------------------------------------------------- procedure jvgetsvgainfo; Requests vgainfoblock and fills vgainfo with it. ----------------------------------------------------------------------- procedure jvgetmodeinfo(mode:word); Requests modeinfoblock and wills modeinfo with it. ----------------------------------------------------------------------- procedure jvsetsvgamode(mode:word); Sets VESA svga mode. ----------------------------------------------------------------------- function jvgetsvgamode:word; Returns current VESA svga mode. ----------------------------------------------------------------------- procedure jvsetbank(bank:word); assembler; Sets write bank. ----------------------------------------------------------------------- procedure jvsetreadbank(bank:word); Sets read bank. ----------------------------------------------------------------------- function jvgetbank:word; Returns current write bank. ----------------------------------------------------------------------- function jvgetreadbank:word; Returns current read bank. ----------------------------------------------------------------------- procedure jvsetdisplay(pixel,scanline:word); Sets display window pixel & scanline position. NOTE: Many videocards don't support correct pixel position changing. Also some videocards waits for vertical retrace when this function is called while some videocards doesn't. ----------------------------------------------------------------------- function jvinitsvga(mode:word):boolean; Initializes svga mode. (Requests modeinfoblock and fills wgran, wsize, linewidth, winasup...winbwrite, wriwin and readwin variables). Returns true if successfull, false if mode is not supported. ----------------------------------------------------------------------- procedure jvputpixel(x,y:longint; c:byte); Puts a pixel to the screen. (c=color) ..Rather slow. ----------------------------------------------------------------------- function jvgetpixel(x,y:longint):byte; Returns pixel color from screen. ..Rather slow. ----------------------------------------------------------------------- procedure jvline(x1,y1,x2,y2:integer; c:byte); Draws a line to screen. (c=color) ..Rather slow. ----------------------------------------------------------------------- procedure jvloadsvgapcx(filename:string; start,height:longint); Loads a standard 256-color PCX file. Start is the start offset in video memory and height is the height of the picture file in pixels. Example: When using 640x480x256 mode and loading 640x480x256 picture to the top of video memory: jvloadsvgapcx('PICTURE.PCX',0,480); ----------------------------------------------------------------------- procedure jvscanline2(x,y,wid:word; c:byte); Fills a horizontal line. (wid=width, c=color) ----------------------------------------------------------------------- procedure jvscanline(x1,x2,y:word; c:byte); Fills a horizontal line. (c=color) ----------------------------------------------------------------------- procedure jvfillbox2(x,y,wid,hei:word; c:byte); assembler; Fills a box. (wid=width, hei=height, c=color) ----------------------------------------------------------------------- procedure jvfillbox(x1,y1,x2,y2:word; c:byte); Fills a box. (c=color) ----------------------------------------------------------------------- procedure jvblock(spriteseg,spriteofs,x,y,wid,hei:word); Draws a solid bitmap to screen. Spriteseg indicates source image segment and spriteofs it's offset. (wid=width, hei=height) ----------------------------------------------------------------------- procedure jvblockpg(spriteseg,spriteofs,x,y,wid,hei,pagewidth:word); Like jvblock but whole source image's width is pagewidth while width of bitmap itself can be less. ----------------------------------------------------------------------- procedure jvgetblock(spriteseg,spriteofs,x,y,wid,hei:word); Gets a solid bitmap from screen. (wid=width, hei=height) ----------------------------------------------------------------------- procedure jvsprite(spriteseg,spriteofs,x,y,wid,hei:word); Like jvblock but 0 is transparent color. ----------------------------------------------------------------------- ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ EOF