InitGraphics
- Reg In:
- Reg Out:
- Variables read:
- Variables updated:
- all image buffers, and the palette variable
- calls:
- LoadFile, storeBMP, storePlayerImages, addPalette,
setPalette
- description:
- called to initialize the buffers, graphics mode, the
palette registers, load sprites from files into
memory,...etc.
- actually just calls other functions to perform the
initialization
- sets video mode to mode 13h
|
Draw_double_buf
- Reg In:
- Reg Out:
- Variables read:
- Variables updated:
- calls:
- findVisRect, drawTiles, drawPlayers, drawStats
- description:
- draws the double buffer according to state variables
- draws in the following order:
1. find the visible rect
2. draw the map to the screen
3. draw the players over the map
4. the stats get drawn last
|
Blit_double_buf
- Reg In:
- Reg Out:
- Variables read:
- Variables updated:
- calls:
- description:
- transfers byte from double_buffer to video memory
|
FinalizeGraphics
- Reg In:
- Reg Out:
- Variables read:
- Variables updated:
- calls:
- description:
- cleans up after the graphics engine and sets vid mode to
text mode
|
drawTiles
- Reg In:
- Reg Out:
- Variables read:
- Variables updated:
- calls:
- drawTile, findTileIndex, findTileRect
- description:
- iterates through the visibile tiles in the map and
calculates the clipping of them.
- calls drawTile to draw them after this calculation
|
drawTile
- Reg In:
- BX = x coords in screen coords as upper left
- AX = y coords in screen coords of upper left
- CX = y coords in screen coords of upper left
- DX = x coords in screen coords of upper left
- Reg Out:
- Variables read:
- Variables updated:
- calls:
- description:
- draws the tile specified in tDraw struct to the screen buffers
|
drawPlayers
- Reg In:
- Reg Out:
- Variables read:
- Variables updated:
- calls:
- description:
- steps through all the player's state and draws them if
they are in the game and on the visible screen
- also then steps through all of player's fired bullets
and draws them via a drawBuffer call
- then calls drawPlayer with settings in pDraw variable to have
him drawn to
double_buffer
|
drawPlayer
- Reg In:
- Reg Out:
- Variables read:
- pDraw, PlayerSpriteBuffer, Players
- Variables updated:
- calls:
- description:
- draws the player specified in pDraw struct
- uses the team member in the player structure to find
which color to replace masks in shirt with
|
setPalette
- Reg In:
- Reg Out:
- Variables read:
- Variables updated:
- calls:
- description:
- sets the vga palette to the one specified in the
'palette' variable
|
LoadFile
- Reg In:
- DS = segment of ASCIIZ string of filename
- DX = offset of ASCIIZ string of filename
- AX = segment of the destination buffer
- BX = offset of destination buffer
- CX = number of bytes to read
- Reg Out:
- Variables read:
- Variables updated:
- calls:
- description:
- loads a file into a buffer
|
addPalette
- Reg In:
- Reg Out:
- Variables read:
- Variables updated:
- calls:
- description:
- takes the data from bmps as RGBs and sets the values
into the palette variable
|
storeBMP
- Reg In:
- SI = starting offset into the image data of the bmp var
- ES = segment of the destination buffer
- DI = offset of the destination buffer
- AX = number of lines to read
- BX = length of each line
- Reg Out:
- Variables read:
- Variables updated:
- buffer pointed to by ES:[DI]
- calls:
- description:
- stores a rectangular region from bmp starting at SI into
a buffer
|
storePlayerImages
- Reg In:
- Reg Out:
- Variables read:
- Variables updated:
- calls:
- description:
- loads player sprites into memory from the bmp variable
to PlayerSpriteBuffer
|
findVisRect
- Reg In:
- Reg Out:
- Variables read:
- Variables updated:
- calls:
- description:
- Takes the coordinates of the local client player and
finds the rect in world coordinates that is visible on the
screen
|
storeTileImages
- Reg In:
- Reg Out:
- Variables read:
- Variables updated:
- calls:
- description:
- call after bmp has been filled with the tilemap bmp
- loads the tiles off the bmp and stores them into the
correct tile buffer locations
|
drawNumber
- Reg In:
- AL = index of number from NumSprites
- BX = x position on screen
- DX = y position on screen
- Reg Out:
- Variables read:
- Variables updated:
- calls:
- description:
- draws the number located in NumSprite from Index AL, 0
based
|
drawBuffer
- Reg In:
- BX = x position on screen
- DX = y position on screen
- DS = source buffer segment
- SI = source buffer offset
- Reg Out:
- Variables read:
- Variables updated:
- calls:
- description:
- blits the contents from the buffer into the
double_buffer variable and takes care of transparent
blitting
- only called to blit bullets at this point, but will be
used for any thing new
|
Intro
- Reg In:
- Reg Out:
- Variables read:
- Variables updated:
- calls:
- description:
- Draws the intro screens in sequence
1. the title screen
2. the instruction screen
3. choose team screen
|
drawStats
- Reg In:
- Reg Out:
- Variables read:
- Variables updated:
- calls:
- description:
- Draws the team scores in the upper right corner of the
screen
|
drawNumber
- Reg In:
- AX = y screen coordinates to put upper left corner
- BX = x screen coordinates to put upper left corder
- Reg Out:
- Variables read:
- Variables updated:
- calls:
- description:
- Draws a number to the screen
|
drawEmblem
- Reg In:
- AX = y screen coordinates to put upper left corner
- BX = x screen coordinates to put upper left corder
- CL = the team color to draw the emblem with
- Reg Out:
- Variables read:
- Variables updated:
- calls:
- description:
- Draws a team emblem with the color associated with the
team
|
drawBullet
- Reg In:
- AX = y screen coordinates to put upper left corner
- BX = x screen coordinates to put upper left corder
- CL = the team color to draw the emblem with
- Reg Out:
- Variables read:
- Variables updated:
- calls:
- description:
- Draws a team emblem with the color associated with the
team
|
drawBullets
- Reg In:
- BX = the starting position in the bullet array for a
player
- Reg Out:
- Variables read:
- Variables updated:
- calls:
- description:
- Steps through each bullet struct in the bullet array for
a player and draws them if they are active and in the
visible rectangle in game coordinates
|
drawImage
- Reg In:
- AX = y screen coordinates to put upper left corner
- BX = x screen coordinates to put upper left corner
- CX = segment that the image buffer belongs
- SI = offset of the image buffer to start from
- Reg Out:
- Variables read:
- Variables updated:
- calls:
- description:
- Reads the iDraw structure and draws an image with rectangle specified in the iDraw variable
and draws it to the screen buffer.
|
FindTileIndex
- Reg In:
- AX = x game coords
- BX = y game coords
- DX = x screen coords
- CX = y screen coords
- Reg Out:
- Variables read:
- Variables updated:
- calls:
- description:
- given the current x,y in screen coordinates and the game
coordinates and calculates the bounding rectangle for the
tile to be drawn to the screen
|
FindTileIndex
- Reg In:
- AX = y game coordinates to look up tile
- BX = x game coordinates to look up tile
- CX = segment that the image buffer belongs
- SI = offset of the image buffer to start from
- Reg Out:
- Variables read:
- Variables updated:
- calls:
- description:
- Reads the iDraw structure and draws an image with
rectangle specified in the iDraw variable
and draws it to the screen buffer.
|