Chris Denamur
- loadBMP
- Purpose: To load a BMP file from disk to memory
- Input:
- DX: pointer to null terminated string containing filename to load
- CX: Size of file to read in
- Output:Writes image data to variable bmp. BMP must be defined and have a segment
- Notes: This procedure will switch to text mode and output a file error message if the file cannot be opened or if there are invalid parameters for the image in the file header. It uses DOS INT 21h services to access the file - Derived from my solution to MP
- loadPalette
- Purpose: To load data into palette from file in BMP variable
- Input: DS:SI : pointer to BMP data (Segment:Offset)
- Output: Programs palette to video card
- Notes: The BMP file must be loaded as it was in the file into the BMP segment. This function uses INT 10h to program the palette on the video card. Only needed to load palette when it changes.
- storeBMP
- Purpose: To convert the image data from bmpseg to image data in the image array specified
- Input:
- AX: image number in PlayerImageArray
- CX: Height and Width of BMP
- DS:SI : pointer to BMP data (Segment:Offset)
- ES:DI : pointer to array to store data to
- Output: Writes data to array specified
- Notes: The routine converts a 16-color, 32x32 pixel BMP image to a VGA mode-13h formatted array of bytes. This procedure outputs directly to the appropriate location in ImageArray - Derived from my MP solution
- drawPlayer
- Purpose: To draw players with clipping technique including those players which are partially on screen
- Input:
- DI - Screen position to start drawing tile
- CH - Number of pixels from the top that are clipped off the screen
- CL - Number of pixels from the bottom that are clipped off the screen
- DH - Number of pixels from the left that are clipped off the screen
- DL - Number of pixels from the right that are clipped off the screen
- AL - Index of player to draw from PlayerArray
- AH - Player Color to draw into whitespace
- Output: Draws player directly to ScreenBuff
- drawPlayers
- Purpose: To draw all the players thar are on your screen and active.
- Input: MyXpos, MyYPos, MyPlayerArray
- Output: rites player directly to screenbuff
- Notes: Calls drawplayer which draws a single player. Sets up all clipping information and screen location of player to pass to drawplayer
- drawObject
- Purpose: To draw Objects with clipping technique including those Objects which are partials on the screen
- Input:
- DI - Screen position to start drawing tile
- CH - Number of pixels from the top that are clipped off the screen
- CL - Number of pixels from the bottom that are clipped off the screen
- DH - Number of pixels from the left that are clipped off the screen
- DL - Number of pixels from the right that are clipped off the screen
- AL - Index of Object to draw from ObjectArray
- Output: Draws tile to ScreenBuff
- Notes: Called by drawObjects, uses clippings to correctly draw object.
- drawObject
- Purpose: To draw all the objects that are on your screen and active
- Input:MyXpos, MyYPos, MyObjectArray
- Output: Writes object directly to screenbuff
- Notes: Calls drawobject which draws a single object. Sets up all clipping information and screen location of object to pass to drawobject.
- drawBullet
- Purpose: To draw Bullets with clipping technique including those Bullets which are partials on the screen
- Input:
- DI - Screen position to start drawing tile
- CH - Number of pixels from the top that are clipped off the screen
- CL - Number of pixels from the bottom that are clipped off the screen
- DH - Number of pixels from the left that are clipped off the screen
- DL - Number of pixels from the right that are clipped off the screen
- AL - Index of Bullet to draw from BulletArray
- Output: Draws tile to ScreenBuff
- Notes: Called by drawBullets, uses clippings to correctly draw Bullet.
- drawBullet
- Purpose: To draw all the bullets that are on your screen and active
- Input:MyXpos, MyYPos, MyBulletArray
- Output: Writes bullet directly to screenbuff
- Notes: Calls drawbullet which draws a single bullet. Sets up all clipping information and screen location of object to pass to drawbullet.
- dispSplash
- Purpose: To display the splash screen
- Input:
- DX is offset of splashscreen filename to display
- AX = 1:load palette 0:don't load palette
- Output: Writes bullet directly to screenbuff
- Notes: If palette is changing load palette again, otherwise don't to make the function faster!
- dumpBuffer
- Purpose: To write the screen buffer out to the screendisplay the splash screen
- Input: Uses data from screenbuff
- Output: Writes directly to screen
- Notes: Function is optimized for video performance
- initImageArrays
- Purpose: To init all of the image arrays by opening files and loading the array
- Input: none
- Output: PlayerImageArray, ObjectImageArray, BulletImageArray, thrustImageArray, LifeImageArray, SonarImageArray
- Notes: These images must be loaded before they are used
- drawTile
- Purpose: To draw a tile on the game map using the tiling technique including those tiles which are partials
- Input:
- DI - Screen position to start drawing tile
- CH - Number of pixels from the top that are clipped off the screen
- CL - Number of pixels from the bottom that are clipped off the screen
- DH - Number of pixels from the left that are clipped off the screen
- DL - Number of pixels from the right that are clipped off the screen
- AL - Index of tile to draw from BulletArray
- Output: Draws tile to ScreenBuff
- Notes: This function will be called by drawBackground to draw the entire game screen.
- drawBackground
- Purpose: To draw all tiles of background to ScreenBuff to be double buffered to the screen later
- Input: MyXPos, MyYPos, TileArray, TileMap
- Output: Draws all of background to ScreenBuff
- Notes: This function calls drawTile for each tile on the map that is within view. It calculates each tiles location on the screen and clipping on the edge.
- drawHUD
- Purpose: To draw HUD
- Input: MyThrust, MyLife
- Output: Draws directly to Screen Buffer
- Notes: Draws vertical bar for thrust, and horizontal bar for life. Also draws background for sonar, positions on sonar calculated by calcSonar