For VirtuaSoft Dash library release v1.50+0.28 by 1998-2000 VirtuaSoft
DISCLAIMER VirtuaSoft is not responsible for any damages, permanent or COLOR CODE red = code
KNOWN BUGS VSTexture: The image can't go too far out of the screen.
MakeDash allows you to mix-and-match your own Dash subs, functions, and libraries. Its easy interface has you choose the modules to put in your version of Dash, including QB.LIB and other libraries by CONTACT E-mail: gump@gnt.net GENERAL INFO COMMAND LINE QuickBASIC must be loaded with the Dash library using the following command line: QB /L DASH.
To get the library to work, you must include this at the beginning of your program, after the sub and function declarations and before the variable declarations: '$INCLUDE: 'Dash.bi'
Throughout this document, you will come across the term "buffer." This simply refers to the screen where the graphics are being placed. With Dash, you can use arrays to make invisible screens where you can draw your graphics before transferring them to the screen. (This eliminates flickery graphics.) A buffer can also refer to the normal screen. To use an array as a buffer, you must use this as your address: VARSEG(buffer(0)), VARPTR(buffer(0)). The screen is &HA000, 0.
A sprite is any 2D image that can be placed on the screen and moved around independently from the background. Many of Dash's subs give a programmer the ability to use sprites in their programs. QuickBASIC's equivalent of the sprite is drawing an array to the screen using PUT.
Texture-mapping subs are available in Dash for making skewed sprite images. A texture (sprite) is placed on a polygon and can be reshaped with the polygon.
Segments and offsets tell the locations in memory of anything you access. When you see some values of memory like this FFFFh:FFFFh, the value before the colon is the segment, and the value after the colon is the offset. (For more info on the specifics of segments and offsets, refer to VirtuaSoft's newsletter.)
Dash also includes QB.LIB, so CALL INTERRUPT and CALL ABSOLUTE can be used. This allows the use of QMIDI, BWSB, or any other library that needs QB.QLB to run. THE SUBS PALETTE
Rules for palette subs: FADE BLACK/WHITEThese fade the screen to black or white. A value must be given to tell how much the fade is. FADE TO PALETTE/COLORThese fade from the current palette to another palette or a color defined by its RGB values. NEGATIVEThis negatives the current palette. LOAD/SAVE PALETTEThese load a 256-color palette and save the current palette to a file. If the file name is given as "" for VSPalette , it will load a black palette. ROTATE PALETTEThese cycle the palette either forward of backward between two given colors. GRAYSCALEMEMORY ADDRESSINGThis grays the palette. DEFINE SEGMENTSets the default segment for VSPoke and VSPeek. The default value is A000h. WRITE MEMORYThese write 16- or 32-bits to a defined place in memory. The segment is defined by VSDefSeg.
TRANSFER MEMORYEXTENDED MEMORYThis transfers a chunk of memory between two locations of RAM. It can be used to copy arrays, etc. The sub truncates to the nearest 4 bytes for speed. Rules for XM subs: DETECTThis sub tells if XMS exists on the computer. (Warning: This sub MUST be run before any other XMS subs!) ALLOCATEThis sub allocates memory and assigns it to a handle for use. DEALLOCATEThis sub frees the memory that was allocated. RESIZEThis sub resizes an XM handle. MOVEThis sub transfers a memory chunk one of the folowing ways:Conv mem->XMIf you're addressing low memory, you give the segment and the offset, and the handle is 0; for XM, you give the handle and the 32-bit offset from the start of the handle. CHECK FREEThis sub tells how much free XM (in KB) there is. CHECK TOTALSCREENThis sub tells how much XM (in KB) there is. SET SCREENSThis sets screen 13h (graphics mode) or screen 3 (text mode). SCREEN FILLThis fills a buffer with a color. This can be used to either fill the entire screen (segment%=&HA000, offset%=0) or a 64Kb buffer (segment%=VARSEG(buffer(0)), offset=VARPTR(buffer(0))) defined as an array in QB. Filling with the color 0 is the equivalent of QuickBASIC's CLS. SCROLL SCREENThese scrolls the screen a defined # of pixels upward, downward, left, or right. (Note: the subs will not fill in what has been scrolled away.) PCOPYThis transfers a 64Kb image between two 64Kb chunks of RAM. This can be used to transfer an image from a buffer to the screen or vice versa. If the flag is set to 0, the copy is solid. The value of 1 will make a transparent copy (ignores color 0). DELAYThis delays the program in 1/60s increments and puts the graphics in sync with the monitor's vertical retrace.
PSETThis places a pixel on the screen. It's the same as QB's PSET except it can draw a pixel to a buffer. POINTThis gets a pixel's color. It's the same as QB's POINT except it can read a pixel from a buffer.
Rules for sprites: TRANSPARENT/TRANSLUCENTThis draws a sprite to a buffer, ignoring color 0. The flag value tells if the polygon is translucent (1) or not (0). SOLIDThis draws a sprite to a buffer. This draws a translucent sprite to a buffer, ignoring color 0. (Note: The translucency will only work with a gradient palette of 32 shades per color.) SCALED (TRANSPARENT)This draws a scaled sprite to a buffer, ignoring color 0. The X and Y can be scaled independently with the default value of 64. The scaled-size can range from 0 to 255 (0x size to 4x size). The coordinates are centered in the sprite. ROTATED (TRANSPARENT)This draws a sprite to a buffer, ignoring color 0. The sprite can be rotated at any degree angle. The coords are centered in the sprite. (It's recommended that VSCosine and VSSine be used for the angles.) SINGLE COLORED (TRANSPARENT)This draws a sprite to a buffer, ignoring color 0, as a given color. GET A SPRITETEXTURE-MAPPINGThis saves an image to a sprite array. It works basically the same way as QB's GET except that it can also get from SCREEN buffers and off the screen (fills with 0s). Rules for texturing: TRANSPARENT/TRANSLUCENTThis draws a sprite to a buffer as a skewed 4-sided polygon. The flag value tells if the polygon is translucent (1) or not (0) POLYGON FILLThis draws a color into a buffer as a skewed 4-sided polygon. The coordinates start at the top-left of the sprite and work clockwise. WALLSPRITE COLLISIONThis draws sprite to a buffer as a skewed 4-sided polygon with vertical sided (Doom style).TRIANGLE GIVEN COLORThis checks for a collision between a sprite and a given color on the screen. (Note: You use this sub like you are placing a sprite, but this sub does not actually draw it.) NON-0 COLORTEXTThis checks for a collision between a sprite and a non-0 color on the screen. (Note: You use this sub like you are placing a sprite, but this sub does not actually draw it.) GRADIENTThis prints a message on the screen at given pixel coordinates without destroying the background. You can also add an 8-color horizontal gradient to the text. This gradient is set by defining 2 colors: a top color and a bottom color. SHADOW GRADIENTLINEThis prints a message on the screen similar to the way VSFont does but also places an additional layer of text behind the foreground one. A separate 8-color horizontal gradient can be set for the background text. LINESThis draws a horizontal line on the screen or to a buffer. BOXThis draws a filled box on the screen or to a buffer.
Rules for file subs: LOAD DATAThis grabs a given number of bytes from a file and places the data in a section of memory. PUT FROM FILEThis draws a solid sprite directly to a buffer from a file, saving the memory that would have otherwise been used for the sprite's array. DIRECTORY LISTINGThis lists all the files in a directory that match a given input string (wildcards are accepted). Two subs must be called to get this to work. VSFileMatchInit finds the first match in the directory, and VSFileMatch finds all the following matches. This array has to be defined in QB to store the name of the file returned on each match: MISCTYPE dta MENU BORDERThis draws a border that can be used for a menu. segment% and offset% follow the rules described in "Fill". x1% and y1% are the coordinates for the top-left of the menu. x2% and y2% are the coordinates for the bottom-right of the menu. col1% it the light-color; col2% is the medium-color; and col3% is the shadow-color. PARALLAX STARSThis draws a set of 101 pixels on the screen. It was originally intended to be a sub to draw a layer of stars for the parallax background of Space-a-roo 2, but it can be used for other purposes as well. For this sub to work, a two dimensional INTEGER array (100, 1) must be declared. This will be the array from which the star coordinates are read. (0-100, 0) is the X; (0-100, 1) is the Y. CLEAR KB BUFFERThis clears the keyboard buffer. MATH POLYGON VISIBILITYThis uses the vector cross-product to test if a polygon is facing toward the screen. If the polygon TRIG FUNCTIONSMOUSEThese return values of trig functions based on a degree angle that is passed to the functions. All values returned are integers 256x the actual trig value. Be sure the angles passed fit the interval [0, 359]. If you are not sure what the angles are, used angle% MOD 360 to bring the angle into the interval. MOUSE DRIVERTells if the mouse driver is present. MOUSE ON/OFFThese Show and hide the mouse cursor. MOUSE INFOThese return mouse cursor positions:SET X AND Y This sets x and y mouse cursor positions. SET BOUNDSSets maximum and minimum mouse cursor positions. The default range for the x-coords is 0-632; the default for y is 0-192. BOX TESTSGAMEPADChecks for a left click inside a box. BUTTON PRESSReturns is a certain button is pressed. STICK/ROCKER PRESSThese return the time it took for the capacitor sensors to flood. It can be used to test for a change in the X or Y. (Note: this will not directly work to tell the state of the X and Y axis. Some calibration may need to be done to test how long it takes for the capacitor to flood at the default location.)
CREDITS Dash programming: Danny Gump
|