Back to Index
[Input and timer Functions]
dword _InstallTmr( )
- Author: Ki Chung
- Inputs: -
- Outputs: -
- Returns: 1 if error; 0 otherwise
- Calls: _LockArea, _Install_Int
- Installs Timer ISR
void _RemoveTmr( )
- Author: Ki Chung
- Inputs: -
- Outputs: -
- Returns: -
- Calls: -
- Uninstalls Timer ISR
void _TmrISR( )
- Author: Ki Chung
- Inputs: -
- Outputs:
- [_TimeTick] - interrupt counter for controlling phase duration
- [_AnimateTick] - counter for animation
- [_CBallTick] - counter for updating cannon ball array
- Returns: -
- Calls: -
- Increments [_TickCount]
dword _InstallKbd( )
- Author: Hyun Jeong
- Inputs: -
- Outputs: -
- Returns: 1 if error; 0 otherwise
- Calls: _LockArea, Install_Int
- Locks the appropriate memeory using LockArea library function and installs the ISR with Install_Int. This is almost entirely from MP4.
void _RemoveKbd( )
- Author: Hyun Jeong
- Inputs: -
- Outputs: -
- Returns: -
- Calls: _Remove_Int
- Removes the keyboard interrupt handler using the library function, _Remove_Int. Also from MP4.
void _KbdISR( )
- Author: Hyun Jeong
- Inputs: key presses waiting at port [_kbPort], [_kbIRQ]
- Outputs: [_P1InputFlags], [_P2InputFlags], [_Flags]
- Returns: -
- Calls: -
- Handles keyboard input, Very long and tedious function.
Takes the scancode from the [kbPort] and compares the scancode with every possible key in this game. There are total of 12 keys, and each press and releases are handled. With presses, sets the appropriate flag to 1. With releases, sets the appropriate flags to 0. The P1 and P2 input flags are updated, along with the general game [_Flag] so it can be used in the game. At the end, it sends acknowledges to the PIC, which was taken from the lab manual.