How video works with my drivers:

VGA
---

To setup the VGA mode:

invoke setgmode,13h

  Then simple alloc a block of RAM 320x200 in size and use that as the
video RAM.  Once a picture is drawn on it use v_copy to copy it to the real
video RAM.  This way the picture can be drawn on by whatever you want until
it's ready to be seen.  The video driver needs to know where this 'temp area'
is.  This is done with 'gset'.  The other functions such as put/get use
this temp area as well.

  Mouse is very easy.  It works just like in real mode.  Call mouse_init to
set it up(and see if a mouse if installed).  Then use mouse_on & mouse_off to
hide and show the mouse.  The mouse routines use the video RAM directly.
You may use v_copy even if the mouse is on.  The routines now will keep
the mouse on screen without any blinking !!! (NEW in VER 1.1 !!)
(unless you use the VRAM yourself).

  'mouse_uninit' can be used to disable the mouse driver and unload it.
But this is not necessary as it will self-unload during shutdown.
Unless you use DOS ax=4c00h directly (don't ever do that!!!).
Call 'exit' instead

VESA
----

  To setup a VESA mode:

mov eax,mode#    ;10fh=320x200x24bit  112h=640x480x24bit ...
call checkvbemode
;eax==-1 if any error
;dl=error code  (see video.asm for codes)
; ELSE
;eax==near ptr to VRAM (linear RAM)
call setvbemode   ;sets previous checked mode

  Then use 'gset' and 'v_copy' as before and all the mouse functions as before.
Make sure to set a proper windows size for the mouse driver (it defaults to
320x200) or if you switch to a different resolution before you use 'mouse_on'.

  You can change the starting scan line and starting pixel display with
'vbesetstart'.

  mov ecx,pixel_start
  mov edx,scan_line
  call [vbesetstart]

You could use that to do paging if you like.  EG: in 320x200x24bit mode page
1 would be edx=0  and page 2 would be edx=200 etc. Real easy.
NOTE: v_copy and the mouse functions use the most top part of VRAM only. (page 1)

functions available
-------------------
setgmode,mode:byte
  - sets video mode (uses a simple BIOS call)
  - you must use this method of doing the call as this sets many internal
      variables in my video driver
waitvsync
  - waits till there is a v sych (use this before palette changes etc.)
gset,temparea:dword
  - set temp area for driver to use
v_copy
  - copies temp area to VRAM
setpal,pal:dword
  - sets the entire palette (ptr to 768 bytes needed) (calls waitvsync)
setcol,color:byte,red:byte,grn:byte,blu:byte
  - set one color in palette
gcls
  - clears the VRAM  (NOT THE TEMP AREA !!)
get,buf:dword,x:word,xlen:word,y:word,yl:word
  - gets a square and places into a buffer  (no clipping on get/put/put0)
put,buf:dword,x:word,xlen:word,y:word,yl:word
  - put a square from buffer into temp area
put0,buf:dword,x:word,xlen:word,y:word,yl:word
  - same as put except does not put color #0
;mouse stuff
mouse_init
  - call once to init & detect   (returns -1 if no mouse present)
mouse_setcursor,pix:dword,xsiz:word,ysiz:word,hotspotx:word,hotspoty:word
  - use to set cursor size (x&y) and shape
mouse_setspd,xratio:byte,yratio:byte
  - set mouse speed (1-4)
mouse_setwin,x1:word,y1:word,x2:word,y2:word
  - set window size mouse is allowed to be in (for hotspot)
mouse_on
  - show mouse
mouse_off
  - hide mouse   (no longer need to hide mouse when editing temp area)
mouse_setuser,user:dword
  - set a user proc that is called each time mouse moves
  or a button is pressed.  Great to change cursor type in here if you like
  so that each part of screen can have a different cursor (like in Windoze)
  - the proc is called with
    ax=x pos
    bx=y pos
    cx=button states  (bit0=left  1=right)
  - return with a simple 'RET'
mouse_setpos,x:word,y:word
  - set current mouse pos (you don't have to mouse_off/mouse_on)
;text support
gloadfnt,fntname:dword,x:word,y:word,buffer:dword
  - loads a simple font (and sets it as the current font)
  - RAM is allocated for the font
gsetfnt,x:word,y:word,buffer:dword
  - selects current font  (if more than one was loaded by gloadfnt)
gputch,x:word,y:word,char:byte
  - print one char at x,y
gprintxy,x:word,y:word,str1:dword
  - print string at x,y
;misc stuff
hline,x:word,y:word,len:word,col:byte
  - draw a h line
vline,x:word,y:word,len:word,col:byte
  - draw a v line
gbox,x:word,xl:word,y:word,yl:word,col:byte
  - draw a box

NOTE: All functions can be used in ANY video mode except for the palette
  things in modes with bpp>8 (duh!!).

Now read compile.txt to see how all the batch files work on compiling stuff...
... and then you can start programming !!!!!

Keep in touch with my page at http://www.globalserve.on.ca/~subdeath
E-Mail : subdeath@globalserve.on.ca

