Naveen Viswanatha
Variables
- PadLeftPress EQU 75
- PadRightPress EQU 77
- PadUpPress EQU 72
- PadLeftRelease EQU 203
- PadRightRelease EQU 205
- PadUpRelease EQU 200
- ESCape EQU 1
- SpaceBar EQU 57
- PadDown EQU 80
- EnterKeyDown EQU 28
- ObjectArraySize dw 700
- BulletArraySize dw 320
- PlayerArraySize dw 28
- TempNum dw 28
- count DW 0
- scount DW 0
- mcount DW 0
- twosec dw 0
Procedures
- kbdInstall
- Purpose: To install Interrupt 9's (IRQ1's) vector to the address of KbdHandler and save far pointer to default keyboard handler in oldKbdV
- Input: none
- Output: oldKbdV variable
- kbdUnInstall
- Purpose: To restore default keyboard handler
- Input: OldKbdV; interrupt vector for original keyboard handler
- Output: none
- kbdHandler
- Purpose: To process keypresses on the keyboard
- Input: scan code generated by keyboard port
- Output: LeftKey, RightKey, LeftKeyCtr, RightKeyCtr, UpKey, EscKey
- Notes: If left arrow key is pressed, the LeftKey flag will be set to
1, and the LeftKeyCtr reset to 0. When the left arrow key is released,
the LeftKey flag is reset. This is similarly done for the right arrow key
and up arrow keyas well. If the space bar is pressed, the Fire procedure
will be called, and if the escape key is pressed, the EscKey flag will be
set to denote exiting.
- PICInstall
- Purpose: To install Interrupt 8's vector to the address of PICHandler and save far pointer to default PIC handler in oldPICV
- Input: none
- Output: OldPICV; the interrupt to the default PIC handler
- Notes: The new PIC Handler will be called at 30 Hz to aid in timing.
- PICUnInstall
- Purpose: To restore default PIC handler
- Input: OldPICV; interrupt vector for original PIC handler
- Output: none
- PICHandler
- Purpose: To call all other major procedures
- Input: none
- Output: ThirtyHzCtr, TwelveHzCtr, TwoSecCtr
- Notes: This is the most important routine. It calls all of the
other major procedures as needed and runs through its loop at a rate
of 30 Hz. Also, this routine sends Update packets at a rate of 10
Hz as well as sends Hello packets are sent at a rate of .5 Hz.
- Calls:
- calcThrustTurn
- calcPlayerPos
- calcObjects
- calcBullets
- calcPlayerCollision
- calcBulletCollision
- drawPlayers
- drawBackground
- drawObjects
- drawBullets
- drawHUD
- calcSonar
- dumpBuffer
- sendObjectUpdate
- sendHello
- repeatMidi
- sendPlayerUpdate
- Purpose: To output NetBIOS packets with local player information
- Input: MyXPos, MyYPos, MyOrientation, MyNum
- Output: none
- sendBulletUpdate
- Purpose: To output NetBIOS packets with information on recently fired bullet
- Input: AX (Xposition of bullet), CX (Yposition of bullet), DL (Speed of bullet), MyWeapon, MyOrientation, MyNum
- Output: none
- sendBulletKill
- Purpose: Outputs NetBIOS packets with information about a bullet which hit the local player. Will tell other players to remove bullets form their screen
- Input: DI (Index into MyBulletArray), MyNum
- Output: none
- sendObjectUpdate
- Purpose: To outputs NetBIOS packets with information on every object in the local players MyObjectArray. Keeps objects across the network in synchronization with local player
- Input: MyObjectArray, MyNum
- Output: none
- sendHello
- Purpose: To output NetBIOS packets to inform other players that you have netwred a network game. Also allows entering players to make active existing players.
- Input: MyXPos, MyYPos, MyNum
- Output: none
- sendGoodBye
- Purpose: To output NetBIOS packets to inform other players that local player is leaving the netowrk game
- Input: MyNum
- Output: none
- netPost
- Purpose: To process incoming datagrams
- Input: Incoming datagrams
- Output: dependant
- Notes: This function is called by Netlib whenever a datagram arrives, and actions are taken depending on the message type.
- HELLO: Marke player ACTIVE in MyPlayerArray
- GOODBYE: Mark player INACTIVE in MyPlayerArray
- PUPDATE: Update player information in MyPlayerArray
- OUPDATE: Update object information in MyObjectArray
- BULLETUPDATE: Update bullet information in MyBulletArray
- BULLETKILL: Mark a bullet that nas colided with an object, wall, or player as INACTIVE in MyBulletArray