Amulets & Armor  v1.02
Open Source Game
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Data Structures | Macros | Functions | Variables
GRAPHICS

Graphics Drawing System. More...

Data Structures

struct  T_compressEntry
 

Macros

#define MAX_PAGES   4
 
#define PIC2   0xA0
 
#define RETRACE_INTERRUPT_NUMBER   0x71
 
#define RETRACE_VERTICAL_CLEAR_BIT   0x10
 
#define RETRACE_VERTICAL_INTERRUPT_BIT   0x02
 

Functions

T_sword32 ColorChangeFastAsm (T_word16 port, T_byte8 *p_source, T_word32 number)
 
T_void DrawAndShadeRaster (T_byte8 *p_source, T_byte8 *p_destination, T_word32 count, T_byte8 shade)
 
T_void GrActivateColumn (T_word16 x)
 
T_void GrActualScreenPop (T_void)
 
T_void GrActualScreenPush (T_void)
 
T_void GraphicsMode13X (T_void)
 
T_void GrDisplayScreen (T_void)
 
T_void GrDoubleSizeTransfer (T_screen destination, T_word16 x_left, T_word16 y_top, T_word16 x_right, T_word16 y_bottom, T_word16 dest_x, T_word16 dest_y)
 
T_void GrDrawBitmap (T_bitmap *p_bitmap, T_word16 x_left, T_word16 y_top)
 
T_void GrDrawBitmapMasked (T_bitmap *p_bitmap, T_word16 x_left, T_word16 y_top)
 
T_void GrDrawCharacter (T_byte8 character, T_color color)
 
T_void GrDrawCompressedBitmap (T_bitmap *p_bitmap, T_word16 x_left, T_word16 y_top)
 
T_void GrDrawCompressedBitmapAndClip (T_bitmap *p_bitmap, T_sword16 x_left, T_sword16 y_top)
 
T_void GrDrawCompressedBitmapAndClipAndColor (T_bitmap *p_bitmap, T_sword16 x_left, T_sword16 y_top, E_colorizeTable colorTable)
 
T_void GrDrawCompressedBitmapAndClipAndColorAndCenterAndResize (T_bitmap *p_bitmap, T_sword16 x_left, T_sword16 y_top, E_colorizeTable colorTable, T_word16 width, T_word16 height)
 
T_void GrDrawCompressedBitmapAndColor (T_bitmap *p_bitmap, T_word16 x_left, T_word16 y_top, E_colorizeTable colorTable)
 
T_void GrDrawFrame (T_word16 x_left, T_word16 y_top, T_word16 x_right, T_word16 y_bottom, T_color color)
 
T_void GrDrawHorizontalLine (T_word16 x_left, T_word16 y, T_word16 x_right, T_color color)
 
T_void GrDrawLine (T_sword16 x1, T_sword16 y1, T_sword16 x2, T_sword16 y2, T_color color)
 
T_void GrDrawPixel (T_word16 x, T_word16 y, T_color color)
 
T_void GrDrawRectangle (T_word16 x_left, T_word16 y_top, T_word16 x_right, T_word16 y_bottom, T_color color)
 
T_void GrDrawShadedAndMaskedBitmap (T_bitmap *p_bitmap, T_word16 x_left, T_word16 y_top, T_byte8 shade)
 
T_void GrDrawShadedBitmap (T_bitmap *p_bitmap, T_word16 x_left, T_word16 y_top, T_byte8 shade)
 
T_void GrDrawShadedFrame (T_word16 x_left, T_word16 y_top, T_word16 x_right, T_word16 y_bottom, T_color color1, T_color color2)
 
T_void GrDrawShadowedText (T_byte8 *text, T_color color, T_color shadow)
 
T_void GrDrawText (T_byte8 *text, T_color color)
 
T_void GrDrawTranslucentPixel (T_word16 x, T_word16 y, T_color color)
 
T_void GrDrawVerticalLine (T_word16 x, T_word16 y_top, T_word16 y_bottom, T_color color)
 
T_word16 GrGetCharacterWidth (T_byte8 character)
 
T_void GrGetPalette (T_color start_color, T_word16 number_colors, T_palette p_palette)
 
T_byte8GrGetWorkingPage (T_void)
 
T_void GrGraphicsOff (T_void)
 
T_void GrGraphicsOn (T_void)
 
T_void GrInvalidateRect (T_sword16 x_left, T_sword16 y_top, T_sword16 x_right, T_sword16 y_bottom)
 
T_void GrInvalidateRectClipped (T_sword16 x_left, T_sword16 y_top, T_sword16 x_right, T_sword16 y_bottom)
 
T_void GrInvertFrame (T_word16 x1, T_word16 y1, T_word16 x2, T_word16 y2)
 
T_void GrInvertHorizontalLine (T_word16 x1, T_word16 y1, T_word16 x2)
 
T_void GrInvertVerticalLine (T_word16 x1, T_word16 y1, T_word16 y2)
 
T_screen GrScreenAlloc (T_void)
 
T_screen GrScreenAllocPartial (T_word16 ySize)
 
T_void GrScreenFree (T_screen screen)
 
T_screen GrScreenGet (T_void)
 
T_void GrScreenSet (T_screen screen)
 
T_void GrSelectPlanes (T_word16 planes)
 
T_void GrSetBitFont (T_bitfont *p_bitfont)
 
T_void GrSetCursorPosition (T_word16 x_position, T_word16 y_position)
 
T_void GrSetPalette (T_color start_color, T_word16 number_colors, T_palette *p_palette)
 
T_void GrSetVisualPage (T_word16 page)
 
T_void GrSetWorkingPage (T_word16 page)
 
T_void GrShadeRectangle (T_word16 x_left, T_word16 y_top, T_word16 x_right, T_word16 y_bottom, T_byte8 shade)
 
T_void GrTransferRasterFrom (T_byte8 *whereFrom, T_word16 x, T_word16 y, T_word16 length)
 
T_void GrTransferRasterTo (T_byte8 *whereTo, T_word16 x, T_word16 y, T_word16 length)
 
T_void GrTransferRectangle (T_screen destination, T_word16 x_left, T_word16 y_top, T_word16 x_right, T_word16 y_bottom, T_word16 dest_x, T_word16 dest_y)
 
T_void ShadeMemAsm (T_byte8 *p_source, T_byte8 *p_destination, T_word32 count, T_byte8 *p_transTable)
 

Variables

T_word16 G_workingPage = 0
 
T_byte8G_workingStart = ((T_byte8 *)(0xA0000))
 
T_screen GRAPHICS_ACTUAL_SCREEN
 
T_byte8 P_shadeIndex [16384]
 

Detailed Description

Graphics Drawing System.

Routines for drawing 2D graphics.

See Also
http://www.amuletsandarmor.com/AALicense.txt

Macro Definition Documentation

#define MAX_PAGES   4
#define PIC2   0xA0
#define RETRACE_INTERRUPT_NUMBER   0x71
#define RETRACE_VERTICAL_CLEAR_BIT   0x10
#define RETRACE_VERTICAL_INTERRUPT_BIT   0x02

Function Documentation

T_sword32 ColorChangeFastAsm ( T_word16  port,
T_byte8 p_source,
T_word32  number 
)
T_void DrawAndShadeRaster ( T_byte8 p_source,
T_byte8 p_destination,
T_word32  count,
T_byte8  shade 
)

DrawAndShadeRaster copies a section of memory from one place to another and shades it in the process.

NOTE: Warning! Since this routine returns a handle to a partial screen, you have to check that you do not draw out of bounds.

Parameters
p_source– Where to copy from
p_destination– Where to copy to
count– How many bytes to copy and shade
shade– Shading value (0-255, 0=black, 255=normal)
T_void GrActivateColumn ( T_word16  x)
T_void GrActualScreenPop ( T_void  )

GrActualScreenPop restores the last screen on the screen stack.

T_void GrActualScreenPush ( T_void  )

GrActualScreenPush saves the current screen onto the screen stack.

T_void GraphicsMode13X ( T_void  )
T_void GrDisplayScreen ( T_void  )

None of the graphics commands take effect until this command is called. When that happens, the active screen is copied over the actual screen.

NOTE: Make sure the active screen is not the actual screen, or else this routine is made to bomb.

T_void GrDoubleSizeTransfer ( T_screen  destination,
T_word16  x_left,
T_word16  y_top,
T_word16  x_right,
T_word16  y_bottom,
T_word16  dest_x,
T_word16  dest_y 
)

GrDoubleSizeTransfer draws a to the screen at double size.

NOTE: No clipping is done. Therefore, the region being copied must fit entirely on the destination screen. If it doesn't you get a debug error. Also, the destination cannot equal the active source.

Parameters
destination– Screen to transfer to
x_left– Left of transfer rectangle
y_top– Top of transfer rectangle
x_right– Right of transfer rectangle
y_bottom– Bottom of tranfer rectangle
dest_x– Left of destination rectangle
dest_y– Top of destination rectangle
T_void GrDrawBitmap ( T_bitmap p_bitmap,
T_word16  x_left,
T_word16  y_top 
)

When you need to draw a bitmap, call this routine. It uses the standard (raw) format of bitmaps. It will blip it on the active screen with NO masking. (Sorry, black is black)

NOTE: No matter how much you want it to, this routine does NOT clip the bitmap at the edge on the screen and trying to will cause it to bomb.

Parameters
p_bitmap– Pointer to a bitmap picture
x_left– Position of the left
y_top– Position of the top
T_void GrDrawBitmapMasked ( T_bitmap p_bitmap,
T_word16  x_left,
T_word16  y_top 
)

Other bitmaps may wish the background to show through. To accompany this, pictures should use the color 0 (0x00) to denote a clear pixel color (usually black). All other pixels are drawn.

NOTE: None, other than no clipping like GrDrawBitmap

Parameters
p_bitmap– Pointer to a bitmap picture
x_left– Position of the left
y_top– Position of the top
T_void GrDrawCharacter ( T_byte8  character,
T_color  color 
)

GrDrawCharacter is the low level routine to draw a single character on the screen in the active font. Just pass to it a character and it will be drawn at the current cursor position. The cursor position will then be updated.

NOTE: None. Just make sure you used GrSetBitFont earlier.

Parameters
character– character to draw
color– color to draw character in
T_void GrDrawCompressedBitmap ( T_bitmap p_bitmap,
T_word16  x_left,
T_word16  y_top 
)
T_void GrDrawCompressedBitmapAndClip ( T_bitmap p_bitmap,
T_sword16  x_left,
T_sword16  y_top 
)

GrDrawCompressedBitmapAndClip is just like GrDrawCompressedBitmap, but it clips to any coordinates on the screen.

NOTE: No matter how much you want it to, this routine does NOT clip the bitmap at the edge on the screen and trying to will cause it to bomb.

Parameters
p_bitmap– Pointer to a compressed bitmap picture
x_left– Position of the left
y_top– Position of the top
T_void GrDrawCompressedBitmapAndClipAndColor ( T_bitmap p_bitmap,
T_sword16  x_left,
T_sword16  y_top,
E_colorizeTable  colorTable 
)

GrDrawCompressedBitmapAndClipAndColor is just like GrDrawCompressedBitmapAndClip, but it also includes a colorization.

NOTE: No matter how much you want it to, this routine does NOT clip the bitmap at the edge on the screen and trying to will cause it to bomb.

Parameters
p_bitmap– Pointer to a compressed bitmap picture
x_left– Position of the left
y_top– Position of the top
colorTable– Color to transform into
T_void GrDrawCompressedBitmapAndClipAndColorAndCenterAndResize ( T_bitmap p_bitmap,
T_sword16  x_left,
T_sword16  y_top,
E_colorizeTable  colorTable,
T_word16  width,
T_word16  height 
)

GrDrawCompressedBitmapAndClipAndColor is just like GrDrawCompressedBitmapAndClip, but it also includes a colorization.

NOTE: No matter how much you want it to, this routine does NOT clip the bitmap at the edge on the screen and trying to will cause it to bomb.

Parameters
p_bitmap– Pointer to a compressed bitmap picture
x_left– Position of the left
y_top– Position of the top
colorTable– Color to transform into
width– Width of area to fill if too big, or center if too small.
height– Height of area to fill if too big, or center if too small.
T_void GrDrawCompressedBitmapAndColor ( T_bitmap p_bitmap,
T_word16  x_left,
T_word16  y_top,
E_colorizeTable  colorTable 
)

GrDrawCompressedBitmapAndColor is just like GrDrawCompressedBitmap except that you can also colorize the compressed bitmap with the given colorization table.

NOTE: No matter how much you want it to, this routine does NOT clip the bitmap at the edge on the screen and trying to will cause it to bomb.

Parameters
p_bitmap– Pointer to a compressed bitmap picture
x_left– Position of the left
y_top– Position of the top
colorTable– colorization table to use.
T_void GrDrawFrame ( T_word16  x_left,
T_word16  y_top,
T_word16  x_right,
T_word16  y_bottom,
T_color  color 
)

GrDrawFrame will draw an empty frame in a choice color. Just give the upper-left and lower-right corner of the frame.

NOTE: All coordinates must be on the screen and the upper-left coordinate must be located to the left and above the lower-right corner.

Parameters
x_left– Left of frame
y_top– Top of frame
x_right– Right of frame
y_bottom– Bottom of frame
color– Color of the frame
T_void GrDrawHorizontalLine ( T_word16  x_left,
T_word16  y,
T_word16  x_right,
T_color  color 
)

Drawing a horizontal line is useful in making boxes or underlines. In fact, some graphics are all done just by using this command. But anyways, just pass the left and right position along with the line to which to draw it on. Oh yeah, tell what color too.

NOTE: None really. Just keep the left on the left and the right on the right.

Parameters
x_left– Left position of line
y– Line position from the top
x_right– Right position of line (can equal the left position)
color– Index of color to use
T_void GrDrawLine ( T_sword16  x1,
T_sword16  y1,
T_sword16  x2,
T_sword16  y2,
T_color  color 
)

Draw a vertical line from a given (x, y) to a second (x, y) in your choice color.

Parameters
x1– X first point
y1– Y first point
x2– X second point.
y2– Y second point.
color– Color index to draw with
T_void GrDrawPixel ( T_word16  x,
T_word16  y,
T_color  color 
)

Perhaps the lowest level graphics command, this draws one dot on the screen of a specified color.

Parameters
x– position from left to right
y– position from top to bottom (top = 0)
color– color index into palette
T_void GrDrawRectangle ( T_word16  x_left,
T_word16  y_top,
T_word16  x_right,
T_word16  y_bottom,
T_color  color 
)

To draw a solid rectangle of one color, use the GrDrawRectangle routine. Pass to it the upper-left coordinate and the lower-right coordinate and the color.

NOTE: All coordinates must be on the screen and the upper-left coordinate must be located to the left and above the lower-right corner.

Parameters
x_left– Left of rectangle
y_top– Top of rectangle
x_right– Right of rectangle
y_bottom– Bottom of rectangle
color– Color of the rectangle
T_void GrDrawShadedAndMaskedBitmap ( T_bitmap p_bitmap,
T_word16  x_left,
T_word16  y_top,
T_byte8  shade 
)
T_void GrDrawShadedBitmap ( T_bitmap p_bitmap,
T_word16  x_left,
T_word16  y_top,
T_byte8  shade 
)
T_void GrDrawShadedFrame ( T_word16  x_left,
T_word16  y_top,
T_word16  x_right,
T_word16  y_bottom,
T_color  color1,
T_color  color2 
)

GrDrawShadedFrame will draw a frame that looks shaded. The upper left corner is one color and the lower right corner is a different color.

NOTE: All coordinates must be on the screen and the upper-left coordinate must be located to the left and above the lower-right corner.

Parameters
x_left– Left of frame
y_top– Top of frame
x_right– Right of frame
y_bottom– Bottom of frame
color1– Color of the upper left corner
color2– Color of the lower right corner
T_void GrDrawShadowedText ( T_byte8 text,
T_color  color,
T_color  shadow 
)

GrDrawShadowed text is just like GrDrawText except that it draws a shadowed color of the text first and then places the normal characters on top.

Parameters
text– Pointer to string to draw
color– Color to draw text in
shadow– Color to draw shadow in
T_void GrDrawText ( T_byte8 text,
T_color  color 
)

GrDrawText draws a whole group of characters on the screen at once. It does NOT do any character filtering (such as newline characters).

Parameters
text– Pointer to string to draw
color– Color to draw text in
T_void GrDrawTranslucentPixel ( T_word16  x,
T_word16  y,
T_color  color 
)
T_void GrDrawVerticalLine ( T_word16  x,
T_word16  y_top,
T_word16  y_bottom,
T_color  color 
)

Draw a vertical line from a given (x, y) to a second y in, of course, your choice color.

NOTE: The value of y_top MUST be a smaller value than y_bottom.

Parameters
x– column to draw line down
y_top– Top line to start drawing (inclusive)
y_bottom– Bottom line to end drawing (inclusive)
color– Color index to draw with
T_word16 GrGetCharacterWidth ( T_byte8  character)

Sometimes it is useful to know how wide a character is before you draw it (say for centering text). To get this information, pass GrGetCharacterWidth the character you need info on.

NOTE: None. Just make sure a valid font is in memory.

Parameters
character– Character to get width of
Returns
Width of character
T_void GrGetPalette ( T_color  start_color,
T_word16  number_colors,
T_palette  p_palette 
)

GrGetPalette is used to retrieve the color pallette list or a sub- part of it. Works just like GrSetPalette.

NOTE: If the index of the start color plus the number of colors is >255 The program will bomb.

Parameters
start_color– Index to start of colors to change
number_colors– Number of colors to change
p_palette– Pointer to palette list
T_byte8* GrGetWorkingPage ( T_void  )
T_void GrGraphicsOff ( T_void  )

Turn off graphics mode, and turn on text mode. We will drop back to standard 80x25 color text.

T_void GrGraphicsOn ( T_void  )

Turn on the graphics screen and turn off the text screen.

NOTE: None really. Just the usually – hey, no more text! Actually I just thought of one, this routine doesn't check to see if the computer can handle mode 0x13 graphics.

GraphicsMode13X() ;

T_void GrInvalidateRect ( T_sword16  x_left,
T_sword16  y_top,
T_sword16  x_right,
T_sword16  y_bottom 
)
T_void GrInvalidateRectClipped ( T_sword16  x_left,
T_sword16  y_top,
T_sword16  x_right,
T_sword16  y_bottom 
)
T_void GrInvertFrame ( T_word16  x_left,
T_word16  y_top,
T_word16  x_right,
T_word16  y_bottom 
)

GrInvertFrame will invert an empty frame on the screen. Just give the upper-left and lower-right corner of the frame.

NOTE: All coordinates must be on the screen and the upper-left coordinate must be located to the left and above the lower-right corner.

Parameters
x_left– Left of frame
y_top– Top of frame
x_right– Right of frame
y_bottom– Bottom of frame
T_void GrInvertHorizontalLine ( T_word16  x_left,
T_word16  y,
T_word16  x_right 
)

Invert a horizontal line from a given (x, y) to a second x.

NOTE: None really. Just keep the left on the left and the right on the right.

Parameters
x_left– Left position of line
y– Line position from the top
x_right– Right position of line (can equal the left position)
T_void GrInvertVerticalLine ( T_word16  x,
T_word16  y_top,
T_word16  y_bottom 
)

Invert a vertical line from a given (x, y) to a second y.

NOTE: The value of y_top MUST be a smaller value than y_bottom.

Parameters
x– column to draw line down
y_top– Top line to start drawing (inclusive)
y_bottom– Bottom line to end drawing (inclusive)
T_screen GrScreenAlloc ( T_void  )

This routine is needed to allocate enough space for a screen. Although this current implementation only allocates a 320x200 region, future versions may wish to provide different size screens. To actually use this screen, you need to use GrScreenSet(). It will then make that screen the active screen.

Returns
Handle to a screen.
T_screen GrScreenAllocPartial ( T_word16  ySize)

This routine is needed to allocate enough space for a partial screen. To actually use this screen, you need to use GrScreenSet(). It will then make that screen the active screen.

NOTE: Warning! Since this routine returns a handle to a partial screen, you have to check that you do not draw out of bounds.

Returns
Handle to a partial screen.
T_void GrScreenFree ( T_screen  screen)

When you are done with a screen, you can free it from memory. This routine removes the screen from memory.

NOTE: A screen cannot be freed if it is the active screen. You must either declare another screen as the active (or GRAPHICS_ACTUAL_SCREEN).

Parameters
screen– Screen to free.
T_screen GrScreenGet ( T_void  )

Use GrScreenGet to get the handle to the active screen.

Returns
Active screen
T_void GrScreenSet ( T_screen  screen)

Once you have a screen in allocated, in order to use it, you must declare it as the active screen. To do so, use GrScreenSet and pass the screen handle.

NOTE: None really. Just need to make sure the screen is legal. Of course, I can't tell if what is passed is actually a screen or just junk.

Parameters
screen– Screen to make the active screen
T_void GrSelectPlanes ( T_word16  planes)
T_void GrSetBitFont ( T_bitfont p_bitfont)

GrSetBitFont declares the bit font that the graphics module will use for all consecutive drawing of text. Just pass a pointer to a bit font that has already been loaded into memory.

NOTE: Note that if the font is removed from memory while in use, these routines have no way of knowing that the font is gone and will output garbage. Hopefully this will not cause an error.

Parameters
p_bitfont– Pointer to loaded bit font
T_void GrSetCursorPosition ( T_word16  x_position,
T_word16  y_position 
)

GrSetCursorPosition moves the cursor to a new location on the screen. All subsequent character drawing will occur at that new location.

NOTE: x_position and y_position must be inside the screen area for this command to work correctly.

Parameters
x_position– left side of where character is drawn
y_position– top side of where character is drawn
T_void GrSetPalette ( T_color  start_color,
T_word16  number_colors,
T_palette p_palette 
)
T_void GrSetVisualPage ( T_word16  page)
T_void GrSetWorkingPage ( T_word16  page)
T_void GrShadeRectangle ( T_word16  x_left,
T_word16  y_top,
T_word16  x_right,
T_word16  y_bottom,
T_byte8  shade 
)

GrShadeRectangle darkens a given rectangular area.

NOTE: All coordinates must be on the screen and the upper-left coordinate must be located to the left and above the lower-right corner.

Parameters
x_left– Left of rectangle
y_top– Top of rectangle
x_right– Right of rectangle
y_bottom– Bottom of rectangle
shade– Amount to shade
T_void GrTransferRasterFrom ( T_byte8 whereFrom,
T_word16  x,
T_word16  y,
T_word16  length 
)

To help with high speed parts of the game, a transfer from memory to video routine has been provided. Technically, this routine is only for one raster, but one raster can extend onto multiple lines. Just pass a pointer to where in memory you want to get an array of bytes, and x & y coordinate of where to put it, and the number of bytes (length) of the raster.

Parameters
whereFrom– Pointer to memory to transfer
x– Screen x coordinate
y– Screen y coordinate
length– Number of bytes to transfer
T_void GrTransferRasterTo ( T_byte8 whereTo,
T_word16  x,
T_word16  y,
T_word16  length 
)

To help with high speed parts of the game, a transfer from video to memory routine has been provided. Technically, this routine is only for one raster, but one raster can extend onto multiple lines. Just pass a pointer to where in memory you want to put an array of bytes, and x & y coordinate of where to get it, and the number of bytes (length) of the raster.

Parameters
whereTo– Pointer to memory
x– Screen x coordinate
y– Screen y coordinate
length– Number of bytes to transfer
T_void GrTransferRectangle ( T_screen  destination,
T_word16  x_left,
T_word16  y_top,
T_word16  x_right,
T_word16  y_bottom,
T_word16  dest_x,
T_word16  dest_y 
)

GrTransferRectangle is used to transfer only a section of the active screen to some other destination screen. This routine requires the upper-left and lower-right corners of the region you wish copied and what coordinates you wish to copy too. Note that no masking is performed in this transfer.

NOTE: No clipping is done. Therefore, the region being copied must fit entirely on the destination screen. If it doesn't you get a debug error. Also, the destination cannot equal the active source.

Parameters
destination– Screen to transfer to
x_left– Left of transfer rectangle
y_top– Top of transfer rectangle
x_right– Right of transfer rectangle
y_bottom– Bottom of tranfer rectangle
dest_x– Left of destination rectangle
dest_y– Top of destination rectangle
T_void ShadeMemAsm ( T_byte8 p_source,
T_byte8 p_destination,
T_word32  count,
T_byte8 p_transTable 
)

Variable Documentation

T_word16 G_workingPage = 0
T_byte8* G_workingStart = ((T_byte8 *)(0xA0000))
T_screen GRAPHICS_ACTUAL_SCREEN
T_byte8 P_shadeIndex[16384]

When you need to draw a shaded bitmap, call this routine. It uses the standard (raw) format of bitmaps. It will blip it on the active screen with NO masking. (Sorry, black is black)

NOTE: No matter how much you want it to, this routine does NOT clip the bitmap at the edge on the screen and trying to will cause it to bomb.

Parameters
p_bitmap– Pointer to a bitmap picture
x_left– Position of the left
y_top– Position of the top
shade– Shading value (0-255, 0=black, 255=normal)