The graphics routines were written for the final project based on the need for graphics in the user interaction in the game. These pocedures, variables, and data structures were written and designed by John Brumbaugh, unless otherwise stated.
; ----------------------------------------------
; StoreBackground
;
; Inputs: None.
;
; Outputs: The contents of the image are stored directly in the ImageArray
;
; Input/Output: Nothing.
;
; Purpose: This routine is used instead of DOS Interrupts to place the
; background image into the ImageArray without having to load it from
; a file.
;
; Written by: John Brumbaugh
; -----------------------------------------------
; ------------------------------------------------------
; StorePlayer1
;
; Inputs:None.
;
; Outputs: The contents of the image are stored directly to the ImageArray.
;
; Input/Output: Nothing.
;
; Purpose: This routine is used instead of DOS Interrupts to place the image
; of the first player into the ImageArray without having to load the image from a
; file
;
; Written by: John Brumbaugh
; -----------------------------------------------------
; ------------------------------------------------------
; StorePlayer2
;
; Inputs:None.
;
; Outputs: The contents of the image are stored directly to the ImageArray.
;
; Input/Output: Nothing.
;
; Purpose: This routine is used instead of DOS Interrupts to place the image
; of the first player into the ImageArray without having to load the image from a
; file
;
; Written by: John Brumbaugh
; -----------------------------------------------------
; ------------------------------------------------------------
; DrawBackground
;
; Inputs: None.
;
; Outputs: None.
;
; Input/Output: Nothing.
;
; Purpose: This routine draws the background image directly to the BufferSeg.
;
; Written by: John Brumbaugh
; -----------------------------------------------------------
; ------------------------------------------------------------
; DrawUnit
;
; Inputs: None.
;
; Outputs: None.
;
; Input/Output: UnitArray -- The array that will store the different units
; in memory.
;
; Purpose: This routine will use the unit array and traverse through
; it and test to see if the unit is still alive, and if he is draw it at its
; current position. If the unit is DYING, draw the exploding BMP, and
; change is status to INACTIVE
;
; Written by: John Brumbaugh
; -----------------------------------------------------------
; ------------------------------------------------------------
; SwapScreen
;
; Inputs: None.
;
; Outputs: Writes directly to the screen.
;
; Input/Output: Nothing.
;
; Purpose: This routine is used for double buffering. This routine takes
; the BufferSeg and places all of its data directly to the Video Memory.
;
; Written by: John Brumbaugh
; -----------------------------------------------------------
; ------------------------------------------------------------
; ClearBuffer
;
; Inputs: None.
;
; Outputs: None.
;
; Input/Output: Nothing.
;
; Purpose: This routine clears the BufferSeg. It draws all Black to
; the entire BufferSeg
;
; Written by: John Brumbaugh
; -----------------------------------------------------------
; ------------------------------------------------------------
; StoreAsteroid
;
; Inputs: None.
;
; Outputs: None.
;
; Input/Output: Nothing.
;
; Purpose: This function places the Asteroid into the
; ImageArray using palette values and StringOps.
;
; Written by: John Brumbaugh
; -----------------------------------------------------------
; ------------------------------------------------------------
; StoreEnemy1
;
; Inputs: None.
;
; Outputs: None.
;
; Input/Output: Nothing.
;
; Purpose: This function places the First Enemy into the
; ImageArray using palette values and StringOps.
;
; Written by: John Brumbaugh
; -----------------------------------------------------------
; ------------------------------------------------------------
; StoreEnemy2
;
; Inputs: None.
;
; Outputs: None.
;
; Input/Output: Nothing.
;
; Purpose: This function places the Second Enemy into the
; ImageArray using palette values and StringOps.
;
; Written by: John Brumbaugh
; -----------------------------------------------------------
; ------------------------------------------------------------
; StoreEnemy2
;
; Inputs: None.
;
; Outputs: None.
;
; Input/Output: Nothing.
;
; Purpose: This function places the Second Enemy into the
; ImageArray using palette values and StringOps.
;
; Written by: John Brumbaugh
; -----------------------------------------------------------
; ------------------------------------------------------------
; StorePCX
;
; Inputs: DX has the offset of the PCX filename to show; the
; PCX file is 320x200x256.
;
; Outputs: PCX file is displayed and all registers are
; restored to their original value.
;
; Input/Output: Nothing.
;
; Purpose: This function takes a PCX image and draws it to
; the screen.
;
; This function was originally written by Brandon Long, it
; was later modified by Eric Meidel and Nathan Jachimec.
; Their version of the code can be seen in the ECE 291 Lab
; Manual on pg. 117. For this project, this function was
; modified by John Brumbaugh -- brumbaug@uiuc.edu
; -----------------------------------------------------------
Below all the constants that are used by the grpahics routines are going to be described. Those descriptions will include the constants names, how they are used, and what they are equal to.
Below all the data structures that are used in the graphics routines are going to be described. In the descriptions, they will say what routines the structures are used in (graphics or others), what their format is, and what information will be a part of the structure.
|
PCX_HEADER STRUC MANUFACTURER DB 10 VERSION DB ? ENCODING DB 1 BITS_PER_PIXEL DB ? XMIN DW ? YMIN DW ? XMAX DW ? YMAX DW ? PALETTE DB 48 DUP (?) RESERVED DB ? COLOR_PLANES DB ? BYTES_PER_PLANE DW ? PALETTE_TYPE DW ? FILLER DB 58 DUP (?) PCX_HEADER ENDS |
There will be two segments used by the graphics routines, one for double buffering and the other will be used to store the images after they have been loaded from the BMP files.
| BufferSeg SEGMENT PUBLIC | |
| db 65535 dup (?) | |
| BufferSeg ENDS |
| ImageSeg SEGMENT PUBLIC | |
| DB 64 DUP (2048 DUP (0)) | |
| ImageSeg ENDS |
| ScratchSeg SEGMENT PUBLIC | |
| ScratchPad DB 65535 DUP(?) | |
| ScratchSeg ENDS |