   __  __          __
  / / / /_______  / /__  __________
 / / / / ___/ _ \/ / _ \/ ___/ ___/
/ /_/ (__  )  __/ /  __(__  |__  ) _____            __
\____/____/\___/_/\___/____/____/ / ___/____  _____/ /__
                                  \__ \/ __ \/ ___/ //_/
                                 ___/ / /_/ / /__/ ,<
                                /____/\____/\___/_/|_| 0.21

Developed by Lost socK software

Useless Sock is the first, last, and only library of its kind in the existence of the PC. Seriously! This is an attempt at a full-featured "graphical library" for textmode. It was going to be merged into another library written by 1000101 but I guess he got too busy sitting on his thumb (read: coding a Final Fantasy remake in VB/DX8)...oh well, I guess I'll just keep working on this as-is. :D

This latest release only includes one change, so you may not find it too useful to download. However, it's a pretty important change for those who had problems with the last release's handling of the 640x400 mode.


REVISION HISTORY
0.21 - August 3rd, 2004
* USset640x480 was reset to its original BASIC version, as the assembly version didn't work on all video cards.

0.20 - January 20th, 2004
* Internal variables renamed to be more specific to the library rather than being general and easy to get in the way with user program variables
* Library can now work with buffers
* USgetElement was corrected to work in 40 column modes
* USdrawBoxF had a prototype change; now more intuitive
* Corrected the prototype for USplaceElement, colour is now properly documented
* All functions were changed to reflect a standard colour methodology
* USputSprite had some minor code cleanup, and its prototype has changed
* Added USputSpriteS (single colour sprite)
* USloadBMPtoScreen has become USloadBMP and its prototype is now actually in USELESS.BI
* Corrected an error in USloadBMP that was skewing images of certain widths
* Added USpcopy and COPYMEM.OBJ (thanks for this .OBJ na_th_an, very helpful stuff!)
* Added USloadFont so you can load your own fonts
* Added four new screen modes
* Added USbumpUpPalette, a quickie fix to allow BMPs to load with their native palettes (VGA only)
* Added USloadPackedBMP, which shows BMP files that have twice as many vertical lines as the screen resolution (requires VGA, KillBlink mode highly recommended)
* Added USsetPal, a routine to alter the palette (a hack job but oh well, it works)
* Added USdelay, not very useful I reckon but eh...fsckit, it's a machine-independent delay
* Added USset512charMode, the little-known text mode tweak :)
* Added a few other random tweaks
* Random documentation cleanup
* Ditched the useless HTML-based documentation
* Also ditched the massive MS Word documentation in favour of this sleek little TXT version

0.10b - January 9th, 2004
* Split the code into similar modules, library can now be trimmed lighter than ever
* Useless Sock now contains a library builder (not perfect, but...)
* The demo program was updated to show off more of Useless Sock's routines
* USdrawBox and USdrawBoxF were greatly accelerated and now contain proper colour code

0.10a - December 13th, 2003
* Added BMP functions
* Changed memory access code for all functions
* Sprite routines have been greatly accelerated
* Added USgetElement
* Added 640x400 screen mode support
* Added 16 background colour mode
* Added a text function to work with the new 16 background colour mode
* Added hardware detection
* Changed USdrawElipse to USdrawEllipse
* Converted manual to MS Word format and made many corrections

0.03 - November 9th, 1999
* Initial release


BUILDING THE LIBRARY
Obviously, if you want to customize Useless Sock, you'll need to rebuild it either from .OBJ files or from source code.
* To build from OBJ files...
* You'll find all the required .OBJ's in the OBJ subdirectory
* You will need CORE.OBJ, COPYMEM.OBJ, and INTERRUP.OBJ for most core functions, and it is highly recommended that you also include TWEAKS.OBJ.
* Use QB's library builder to construct a new .LIB. If you don't know how to do this, look up some documentation on building libraries for QB.
* To build from source code...
* You'll find all the source code in the SRC directory.
* Load QB with the included CORE.QLB, which you will also find in the SRC directory (this library contains INTERRUP.OBJ, COPYMEM.OBJ, and TWEAKS.OBJ).
* Load CORE.BAS and edit to your heart's content, then select BUILD LIBRARY from the RUN menu.
* Don't forget to edit USELESS.BI to reflect the changes you've made, if applicable.


A NOTE ABOUT SEGMENTS, OFFSETS, AND COLOURS
* The screen uses &HB800 as its Segment and 0 as its Offset. To use any function with a buffer, use the VARSEG and VARPTR functions. There's two constants, named SCREENSEG and SCREENOFF, that you can also use.
* Colours are dependant upon the status of bit 3 at &H3C0. USkillBlink modifies this bit. If USkillBlink has been called, you have 16 foreground colours and 16 background colours. You can set the colour by using this formula:

	Colour = foreColour + (backColour * 16)

If USkillBlink has not been called, you have 16 foreground colours plus blink (add 16 to the foreground colour to make it blink), and only the first 8 colours for the background. Thus, the formula for making colours this way is:

	Colour = foreColour + (backColour * 32)


INTERNAL VARIABLES, TYPES, AND CONSTANTS
Useless Sock contains a number of internal variables, types, and constants. It is recommended that you do not try to alter the values of any of these unless you absolutely know what you are doing.

Variables
* USinternalScreenX - Holds the width of the screen mode in characters (40, 80, or 132)
* USinternalScreenY - Holds the height of the screen mode in characters (25, 50, etc)
* USinternalLineOffset - Used by several functions, this holds the memory offset value for a character line

Constants
* SCREENSEG - The segment of text memory, its value is &HB800
* SCREENOFF - The offset of text memory, its value is 0

Types
* BMPheadertype - The header for BMP files
* RegType - The register type for CALL INTERRUPT
* RegTypeX - The register type for CALL INTERRUPTX


KNOWN ERRORS/BUGS IN THE LIBRARY:
* None!


DETECT ANSI DRIVER
Core routine.

Prototype:

* FUNCTION USdetectAnsi ()

Calling:

* No parameters passed.

Returns:

* 0 if no driver present, 1 if ANSI.SYS loaded.

Notes:

* This function should be called before screen modes 2 through 9 in Useless Sock are used under MSDOS. All screen modes from 0 to 9 should be available under Windows, with certain exceptions.


DETECT HARDWARE
Core routine.

Prototype:

* FUNCTION USdetectVideoHardware$ ()

Calling:

* No parameters passed.

Returns:

* A two-byte string value with the result (see Notes)

Notes:

* This detects the video configuration on your computer. Certain functions should only be called if certain configurations are present. The first byte of the return value is the video adapter, and the second is the monitor. The following lists the available values:

* M - Monochrome adapter
* C - CGA adapter
* E - EGA adapter
* P - PGA adapter
* A - MCGA adapter
* V - VGA adapter

* M - Monochrome display
* C - Color display
* D - Digital display

* There are a few special return strings as well:

* NA - No display
* RS - Reserved
* UK - Unknown configuration

* You should never see the special return strings...at all. If you do, your hardware is likely trashed or monkeyed.
* This function is called internally by other functions.


GET VERSION INFORMATION
Core routine.

Prototype:

* FUNCTION USversion$ (Info AS INTEGER)

Calling:

* Info - The type of info to retrieve
* 0 - Library name
* 1 - Version number
* 2 - Version date
* 3 - Author name(s)

Returns:

* The info you requested.

Notes:

* This is somewhat useless, like this whole library :) but it does make it a little easier to remember what this thing is...


SET MODE
Core routine.

Prototype:

* SUB USsetMode (Mode AS INTEGER)

Calling:

* Mode - the screen mode in which to use
* 0 - Standard 80X25 mode
* 1 - Standard 40X25 mode
* 2 - 80X30 mode
* 3 - 40X30 mode
* 4 - 80X43 mode
* 5 - 40X43 mode
* 6 - 80X50 mode
* 7 - 40X50 mode
* 8 - 80X60 mode
* 9 - 40X60 mode
* 10 - 132X25 extended mode
* 11 - 132X43 extended mode
* 12 - 132X50 extended mode
* 13 - 132X60 extended mode
* 14 - 80X60 extended mode

Returns:

* None

Notes:

* Modes 0 and 1 are supported on all video displays. The extra modes are only available on certain displays and/or configurations. Note that only on a graphics card will modes like 1 look proper, MDA display cards will display a half-screen display instead of a wide full-screen display. For modes 2-9, you must have the ANSI.SYS display driver loaded into memory during boot up, or be in the Windows environment.
* Modes 10 through 14 are only available on VESA compliant video cards.
* Please don't use the SCREEN and WIDTH statements. Many functions in the library rely on variables set in USsetMode.


SET 640X400 MODE
Requires TWEAKS.OBJ.

Prototype:

* SUB USset640x400 ()

Calling:

* No parameters passed.

Returns:

* None

Notes:

* This enables the 640x400 pixel mode in VGA text mode. The normal size is 720 pixels wide by 400 pixels tall, leaving the ugly 9th pixel space in many characters. 640x400 restores the neat and clean EGA-style text mode characters.
* Do not call this routine when using modes 10 through 14, as they already use 8 pixel wide characters.


KILL BLINK
Requires TWEAKS.OBJ.

Prototype:

* SUB USkillBlink ()

Calling:

* No parameters passed.

Returns:

* None

 Notes:

* This function allows you to kill the blink function, which enables all 16 background colours for PEEK and POKE, as well as the various functions of the library.


RESTORE BLINK
Requires TWEAKS.OBJ.

Prototype:

* SUB USrestoreBlink ()

Calling:

* No parameters passed.

Returns:

* None

 Notes:

* This function allows you to re-enable the blink function.


SET FONT
Core routine.

Prototype:

* SUB USloadFont (filename AS STRING)

Calling:

* filename - The name of the font file to load

Returns:

* None

 Notes:

* This function allows you to import your own 4K font files. This is a binary file, consisting of 256 entries, each character being 16 bytes. Each video mode, regardless of the pixels per character, uses this same 4K block. So, when designing a font for an 8x8 pixel character mode, only use the top 8 pixels.


SET 512 CHARACTER MODE
Core routine.

Prototype:

* SUB USset512charMode (fontfile1 AS STRING, fontfile2 AS STRING)

Calling:

* fontfile1 - The font file for the first 256 characters
* fontfile2 - The font file for the second 256 characters

Returns:

* None

 Notes:

* This function sets the special 512 character mode. You must have two fonts prepared ahead of time to use this function. Note that in this mode, only the first 8 colours are available to the foreground, because adding 8 to the colour code is what selects a character from the second set of characters.


SET 256 CHARACTER MODE
Requires TWEAKS.OBJ.

Prototype:

* SUB USset256charMode ()

Calling:

* No parameters passed.

Returns:

* None

 Notes:

* This function restores the normal 256 character mode.
* WARNING! This function is currently untested.


RESTORE VGA STATE
Requires TWEAKS.OBJ.

Prototype:

* SUB USrestoreVGA ()

Calling:

* No parameters passed.

Returns:

* None

 Notes:

* This function restores the normal VGA state.
* WARNING! This function is currently untested.


PLACE A CHARACTER
Core routine.

Prototype:

* SUB USplaceElement (X AS INTEGER, Y AS INTEGER, Element AS INTEGER, colour AS INTEGER, destSegment AS INTEGER, destOffset AS INTEGER)

Calling:

* X - The X location to place the element (depends on mode)
* Y - The Y location to place the element (depends on mode)
* Element - The ASCII code to place at X, Y
* colour - The foreground colour to use
* destSegment - The segment to write to
* destOffset - The offset to write to

Returns:

* None

Notes:

* If the X or Y is out of range, the element will not be drawn, although it will not error out. Colour is dependant upon the type of video display installed, remember that on some very old displays (MDA for example!) the colours were a little different than the colour monitors...underlining, for example.


GET A CHARACTER
Core routine.

Prototype:

* FUNCTION USgetElement& (x AS INTEGER, y AS INTEGER, sourceSegment AS INTEGER, sourceOffset AS INTEGER)

Calling:

* X - The X location to get the element (0-79 or 0-39 depending on mode)
* Y - The Y location to get the element (depends on mode)
* sourceSegment - The segment to read from
* sourceOffset - The offset to read from

Returns:

* A long integer value containing the data.

Notes:

* To use the returned information, it is necessary to break it up into its two parts. The ASCII character uses the first 8 bits, the color information uses the second 8 bits. It returns a long integer value because of QB only supporting signed integers in the IDE. To break them apart, you can do some- thing like this:

'get the data
todo& = USgetElement(bb + X1, aa + Y1)
'what's the ASCII char?
pixel = todo& AND 255
'get the color data, just be sure to not divide by 0
IF todo& > 255 THEN colour = INT(todo& - pixel) / 256 ELSE colour = 0


WRITE TEXT
Core routine.

Prototype:

* SUB USwriteText (text AS STRING, x AS INTEGER, y AS INTEGER, Colour AS INTEGER, destSegment AS INTEGER, destOffset AS INTEGER)

Calling:

* Text - The text string to write
* X - The X position to start at
* Y - The Y position to start at
* Colour - The colour code to use
* destSegment - The segment to write the text to
* destOffset - The offset to write the text to

Returns:

* None

Notes:

* Because QB seems to be rather picky about colouring, this routine was added for 16+16 text writing support under USkillBlink. The text does not wrap around to the next line if it exceeds the screen border.


PCOPY
Core routine, requires COPYMEM.OBJ.

Prototype:

* SUB USpcopy (sourceSegment AS INTEGER, sourceOffset AS INTEGER, destSegment AS INTEGER, destOffset AS INTEGER)

Calling:

* sourceSegment - The segment to copy from
* sourceOffset - The offset to copy from
* destSegment - The segment to copy to
* destOffset - The offset to copy to

Returns:

* None

Notes:

* This copies one buffer to another.


BUMP UP PALETTE
Core routine.

Prototype:

* SUB USbumpUpPal ()

Calling:

* No parameters passed.

Returns:

* None

Notes:

* This bumps the sixteen palette entries up 16 slots so they may be altered on VGA hardware. Apparently, only 0-5 and 7 can be altered normally...but all entries past 15 can be modified freely. This routine is called internally by USloadBMP, but it can serve other purposes as well. Use it with USsetPal using Colour + 16 to set your own palette (0-63 RGB rules apply).
* This routine uses intrinsic QB code, so to reverse its effect, simple call PALETTE without parameters.
* This function requires a VGA card and will exit without functioning on lesser hardware.


SET PALETTE
Core routine.

Prototype:

* SUB USsetPal (Colour AS INTEGER, red AS INTEGER, green AS INTEGER, blue AS INTEGER)

Calling:

* Colour - The colour entry to affect
* red - The red element to use (0-63)
* green - The green element to use (0-63)
* blue - The blue element to use (0-63)

Returns:

* None

Notes:

* This will affect the colour palette on VGA hardware only. Do not use on lesser hardware as it may raise errors.


TIMER DELAY
Core routine.

Prototype:

* SUB USdelay (thetime AS SINGLE)

Calling:

* thetime - the amount of time to wait in seconds

Returns:

* None

Notes:

* This routine is a machine-independent delay loop. You can specify fractions of seconds by using a decimal value, such as .1 for one-tenth of a second.


DRAW AN EMPTY BOX
Requires PRIMS.OBJ.

Prototype:

* SUB USdrawBox (X1 AS INTEGER, Y1 AS INTEGER, X2 AS INTEGER, Y2 AS INTEGER, Element AS INTEGER, Colour AS INTEGER, destSegment AS INTEGER, destOffset AS INTEGER)

Calling:

* X1 - The X location to start the box
* Y1 - The Y location to start the box
* X2 - The X location to end the box
* Y2 - The Y location to end the box
* Element - The ASCII code to draw the box in
* Colour - The colour of the box
* destSegment - The segment to draw the box to
* destOffset - The offset to draw the box to

Returns:

* None

Notes:

* This is the simplest of the box functions. The box is affected by the boundaries of the screen, so any elements outside of the valid range are not drawn. Also, remember that the colour rules still apply here! Unlike some popular graphics libs out there today (not mentioning any in specific), X1 can be bigger than X2, and the same for the Ys.


DRAW A FILLED BOX
Requires PRIMS.OBJ.

Prototype:

* SUB USdrawBoxF (X1 AS INTEGER, Y1 AS INTEGER, X2 AS INTEGER, Y2 AS INTEGER, borderElement AS INTEGER, fillElement AS INTEGER, borderColour AS INTEGER, fillColour AS INTEGER, destSegment AS INTEGER, destOffset AS INTEGER)

Calling:

* X1 - The X location to start the box
* Y1 - The Y location to start the box
* X2 - The X location to end the box
* Y2 - The Y location to end the box
* borderElement - The element of the box border
* fillElement - The element of the box fill
* borderColour - The colour of the box border
* fillColour - The colour of the box fill
* destSegment - The segment to draw the box to
* destOffset - The offset to draw the box to

Returns:

* None

Notes:

* This is like the last box routine, but it is used for neat filled boxes. This is a little more versatile than QB's LINE BF command. The box is affected by the screen borders, and all colour rules apply. Also, if the distance between each location parameter is less than three, a normal box will be called instead.


DRAW LINE
Requires PRIMS.OBJ.

Prototype:

* SUB USdrawLine (X1 AS INTEGER, Y1 AS INTEGER, X2 AS INTEGER, Y2 AS INTEGER, Element AS INTEGER, Colour AS INTEGER, destSegment AS INTEGER, destOffset AS INTEGER)

Calling:

* X1 - The X position to start the line from
* Y1 - The Y position to start the line from
* X2 - The X position to end the line at
* Y2 - The Y position to end the line at
* Element - The ASCII code to draw the line in
* Colour - The colour to draw the line in
* destSegment - The segment to draw the line to
* destOffset - The offset to draw the line to

Returns:

* None

Notes:

* This routine is affected by the screen borders. This routine uses the Bresenham's theory as its algorithm. This routine is amazingly fast for pure QuickBASIC code!


DRAW ELLIPSE
Requires PRIMS.OBJ.

Prototype:

* SUB USdrawEllipse (X1 AS INTEGER, Y1 AS INTEGER, X2 AS INTEGER, Y2 AS INTEGER, Element AS INTEGER, Colour AS INTEGER, destSegment AS INTEGER, destOffset AS INTEGER)

Calling:

* X1 - The X position to start the ellipse
* Y1 - The Y Position to start the ellipse
* X2 - The X position to end the ellipse
* Y2 - The Y position to end the ellipse
* Element - The ASCII code to draw the ellipse in
* Colour - The colour to draw the ellipse in
* destSegment - The segment to draw the ellipse to
* destOffset - The offset to draw the ellipse to

Returns:

* None

Notes:

* This routine is affected by the screen borders. This routine uses the Bresenham's theory in its algorithm. Like the line SUB, it is very fast for pure QB code.


GET SPRITE
Requires SPRITES.OBJ.

Prototype:

* SUB USgetSprite (X1 AS INTEGER, Y1 AS INTEGER, X2 AS INTEGER, Y2 AS INTEGER, destSegment AS INTEGER, destOffset AS INTEGER, sourceSegment AS INTEGER, sourceOffset AS INTEGER)

Calling:

* X1 - The X location to start the GET
* Y1 - The Y location to start the GET
* X2 - The X location to end the GET
* Y2 - The Y location to end the GET
* destSegment - The segment in memory of the sprite array
* destOffset - The offset in memory of the sprite array
* sourceSegment - The segment in memory of the elements to GET
* sourceOffset - The offset in memory of the elements to GET

Returns:

* None

Notes:

* This routine grabs a group of elements from the defined area and stores it in memory. This routine is NOT affected by the screen borders, so any outside grabs will exit the SUB. Be sure that the array is large enough to hold the sprite data. This can easily eat up memory if you're not careful. The formula is easy...Height * Width + 1


PUT SPRITE
Requires SPRITES.OBJ.

Prototype:

* SUB USputSprite (X AS INTEGER, Y AS INTEGER, sourceSegment AS INTEGER, sourceOffset AS INTEGER, destSegment AS INTEGER, destOffset AS INTEGER)

Calling:

* X - The X location to put the sprite
* Y - The Y location to put the sprite
* sourceSegment - The segment of the array in memory
* sourceOffset - The offset of the array in memory
* destSegment - The segment of the blit
* destOffset - The offset of the blit

Returns:

* None

Notes:

* This routine puts a sprite previously captured with USgetSprite. This routine is affected by the screen borders. Also, any elements of 0, 32, or 255 are not drawn, giving a standard transparent PUT effect.


PUT SINGLE-COLOUR SPRITE
Requires SPRITES.OBJ.

Prototype:

* SUB USputSpriteS (X AS INTEGER, Y AS INTEGER, sourceSegment AS INTEGER, sourceOffset AS INTEGER, Colour AS INTEGER, destSegment AS INTEGER, destOffset AS INTEGER)

Calling:

* X - The X location to put the sprite
* Y - The Y location to put the sprite
* sourceSegment - The segment of the array in memory
* sourceOffset - The offset of the array in memory
* Colour - The colour to use to blit the sprite
* destSegment - The segment of the blit
* destOffset - The offset of the blit

Returns:

* None

Notes:

* This routine puts a sprite previously captured with USgetSprite, ignoring its own colour data and instead using the colour you pass as an argument. This routine is affected by the screen borders. Also, any elements of 0, 32, or 255 are not drawn, giving a standard transparent PUT effect.


IMPORT BITMAP
Requires BMP.OBJ.

Prototype:

* FUNCTION USloadBMP% (filename AS STRING, character AS INTEGER, destSegment AS INTEGER, destOffset AS INTEGER)

Calling:

* filename - The name of the BMP file to load
* character - The ASCII character to use to display pixels
* destSegment - The segment of the draw
* destOffset - The offset of the draw

Returns:

* 0 - Successful load
* 1 - File not found
* 2 - Wrong bit depth
* 3 - RLE compression not supported (yet)

Notes:

* This function loads a 4bpp RGB BMP onto the screen. Clipping rules apply.
* This function was renamed for this new version and it can now import a BMP directly to an off-screen buffer.


IMPORT BITMAP AND PACK ITS PIXELS
Requires BMP.OBJ.

Prototype:

* FUNCTION USloadPackedBMP% (filename AS STRING, destSegment AS INTEGER, destOffset AS INTEGER)

Calling:

* filename - The name of the BMP file to load
* destSegment - The segment of the draw
* destOffset - The offset of the draw

Returns:

* 0 - Successful load
* 1 - File not found
* 2 - Wrong bit depth
* 3 - RLE compression not supported (yet)
* 4 - Insufficient hardware

Notes:

* This function loads a 4bpp RGB BMP onto the screen and packs its pixels. Clipping rules apply.
* This function requires a VGA card and the use of the standard character 223. If designing a custom font, keep the character specification in mind. Also, USkillBlink should have been called prior to using this function, or else it may not produce the desired results.
* This function works best with Useless Sock's screen mode 13 (132x60 characters) and screen mode 0 (80x25 characters).


GET ARRAY SIZE FOR BMP IMPORT TO ARRAY
Requires BMP.OBJ.

Prototype:

* FUNCTION USgetArraySizeFromBMP& (filename AS STRING)

Calling:

* filename - The name of the BMP file to calculate

Returns:

* A long integer value with the size of the array in words (integers)
* -or-
* An error message as outlined here:
* -1 - File not found
* -2 - Wrong bit depth
* -3 - RLE compression not supported (yet)

Notes:

* This function returns the size, in words, that an array requires to hold the specified BMP. Note that error codes this time are -negative- values. This function has been designed for an upcoming routine to load a BMP directly into an array but can be used for other purposes as well.


INITIALIZE MOUSE DRIVER
Requires MOUSE.OBJ.

Prototype:

* FUNCTION USmouseInit% ()

Calling:

* No parameters passed.

Returns:

* Success/failure integer (see Notes)

Notes:

* This function queries the mouse driver. This must be called and confirmed before mouse routines are used. This function returns 0 if no mouse driver is present. Under Windows, you should have no problems with this function.
* Do not use mouse functions in Useless Sock screen modes 10 through 14. They will not function.


SHOW MOUSE
Requires MOUSE.OBJ.

Prototype:

* SUB USmouseShow ()

Calling:

* No parameters passed.

Returns:

* None

Notes:

* Call this routine to show the mouse cursor. This should be called after initializing the mouse driver.
* Do not use mouse functions in Useless Sock screen modes 10 through 14. They will not function.


HIDE MOUSE
Requires MOUSE.OBJ.

Prototype:

* SUB USmouseHide ()

Calling:

* No parameters passed.

Returns:

* None

Notes:

* Call this routine to hide the mouse cursor. This should be called when your program exits.
* Do not use mouse functions in Useless Sock screen modes 10 through 14. They will not function.


SHOW MOUSE STATUS
Requires MOUSE.OBJ.

Prototype:

* SUB USmouseStatus (leftbutton AS INTEGER, rightbutton AS INTEGER, posx AS INTEGER, posy AS INTEGER)

Calling:

* No parameters passed.

Returns:

* leftbutton - The status of the left mouse button
* rightbutton - The status of the right mouse button
* posx - The X position in pixels of the mouse cursor
* posy - The Y position in pixels of the mouse cursor

Notes:

* This routine returns the current mouse status. For text mode, divide the posx and posy by 8 to get the character position (starting at 0 rather than 1).
* Do not use mouse functions in Useless Sock screen modes 10 through 14. They will not function.


FUTURE PLANS FOR USELESS SOCK:
* Advanced sprite handling (rotation, zoom [should be in the next release], explosion, etc.)
* Bezier curves
* Input/Output
* Keyboard handler
* EMS [should be in the next release] and XMS routines (as you can see, I've started on XMS routines, but I can't quite figure them out:()
* Mouse routines in the extended modes
* TUI functions (I started on these, but somehow ended up causing GPF after GPF...:()
* Additional graphics formats (thinking of PCX and GIF primarily)
* 1bpp BMP reading
* A textmode raycaster! (porting my Rise Of The Lich raycaster to textmode!)
* Whatever else I can think of adding whenever...


USELESS SOCK alpha 0.21 by Lost socK software
* Concept and most code by Nekrophidius (Necros Ihsan Nodtveidt).
* Several routines provided by na_th_an.
* Bresenham's theory provided by Jack "class" Matheson...he provided me with a C program which I converted to QB for the line routine.
* Ellipse routine provided by Jon "Logic Lord" Gilbert.
* Assistance with integer splitting provided by leroy.
* Encouragement by Danny Gump!

* Special thanks to Ralf Brown for his famous interrupt list, from which I was able to build the USdetectAnsi function, the USdetectVideoHardware function, and the mouse functions, plus the extended text modes and probably a bunch of other stuff too brainless to list here.
* More special thanks to Nexinarus for porting an older version of Useless Sock to PowerBasic DOS. :)

-nekrophidius
dave@nodtveidt.net

Visit Lost socK software on the World Wide Web at http://www.lostsocksoftware.com/