Data Structures:
GameRate Speed at which
the game will run
VideoSel Selector to the
video memory.
ScrSel Selector for the
Screen Buffer.
ScrHnd Handle for the screen
buffer.
FileSel Buffer for the file
input.
FileHnd Handle to a file
buffer.
PCX_Sel Selector to PCX
buffer.
PCX_Hnd Handle to PCX buffer.
FireBuffer Buffer for the
fire modeler
Player Structure
X, Y, Gas, Score,
Damage, Lives, Level, Direction, NDir (next direction)
PlayField Array PlayFieldObj
PlayFieldObj
Floor, Gas, Wall, Fuse, Tank, and Stairs
Use for realmode callbacks.
Purpose: Allocate memory and returns a selector.KillSelector
Input: DX size in 64k segments of selector
Output: AX is a selector
EBX is the memory handler
Purpose: Deallocate memory and selector.
Input: AX is the selector, EBX is the memory handler.
Output: None
Purpose: Clips a section of the playfield and renders it on to the screen.DrawBuffer
Inputs: PlayerX, PlayerY, Playfield
Output: ScrSel
Purpose: Dumps the buffer to the video memory.LoadPCX
Input: AX selector to a buffer.
Purpose: Loads a 640x480 file into memory along with the VGA palette.DrawPCX
Input: EDX offset to ASCIIZ filename
Output: Fills PCX_sel with image data
Purpose: Dumps PCX_sel to the scr_sel.InitFire
Purpose: Clear the fire bufferUpdateFire
Purpose: Render a new fire in the fire bufferDrawFire
Purpose: Draws a fire to the screen buffer.DrawWall
Input: EBX=x, EAX=y
Purpose: Renders a 3D wall onto the screen.
Inputs: EBX=x, EAX=y
Purpose: Play a sound
Input: SoundSeg segment of sound
Purpose: read in sounds into a buffer
Purpose load files into dos low memory areaPlayFM
Inputs filename 0 terminated ascii string
Output Sound_Sel selector to data
Sound_Seg real mode segment of data
Bsize size of data
Purpose: Sets up the sound card and plays the song.StopFM
Input: EDI is a selector to the song
Purpose: Stops the songPlayDSP
Purpose: If nothing is currently playing then it load the sound file into the DMA buffer and initializes the transfer and turns on the speaker.StopDSP
Input: EDI selector to sample
Purpose: Turns off DMA transfer and turns off the speaker.
UpdateGasFire
Purpose: Advance Gasoline and Fire by one tile. Explode Gasoline tanks.Explosion
Input: Playfield Array
Purpose: Sets fire to a whole buch of stuff (Our favorite procedure).Main
Purpose: Allocates all of the selectors.LoadLevel
Calls: Game intro, and Menu
Purpose: Load a playfield from a level.CopyPF
Output: Playfield Array
Purpose: Copies the playfield for use by UpdateGasFire.GameIntro
Purpose: Introduction to the game.GameMain
Purpose: Setup the Graphics Card and sound. Initializes the game structure. Handles the game engine.
Purpose: Setup game environment (Timer and Keyboard INT).
Calls: Game Main.
Purpose: Increments timer counts.Init_Timer
Input: TimerCount
Output: TimerCount is incremented.
Purpose: Grabs the interrupt handler.Hook_kyb
Purpose: Grabs the keyboard interrupt handler.MyKeyHandler
Purpose: Check for the esckey, spacebar, and other control keys.
Purpose: Uses DPMI calls to point protected mode int vector to our code
Input: x the interrupt number edx offset of interrupt handler
DrawStatusScr:
Purpose: update screen with status information (health, lives, score)DisplayDamage:
Purpose: draw damage bar
Input: PlayerDmgDisplayLives:
Purpose: draw lives info to screen
Input: PlayerLvsDisplayScore:
Purpose: draw score to screen
Input: PlayerScrExternal Routines (Borrowed from Lectures and MPs)
DSPWRITE
DSPREAD
ConvertSeg
Dsp_irqdone
LoadPCX (reimplemented see above)
deinit_timer
init_timer