CODE
Signaling Module: [Header File] [Pseudocode] [C Code] Timing Module: [Header File] [Pseudocode] [C Code] Pinout: [Pinout Diagram] |
Game Play Module: [Header File] [Pseudocode] [C Code] Main Module: [Header File] [Pseudocode] [C Code] |
Timing Header
/* Timing header for Railroad Handcar arcade game */ /**************************************************/ /* Defines */ /**************************************************/ /* Specify which timer tracks which timing events */ #define GAME_TIMER 0 #define COLLIDE_TIMER 1 #define RECOVER_TIMER 2 #define STEP_TIMER 3 #define WAIT_TIMER 4 /* Duration (in msec) of game, obstacle collision */ /* Recovery time begins at the START of collision */ #define GAME_TIME 40000 #define COLLIDE_TIME 1000 #define RECOVER_TIME 1250 #define STEP_TIME 10 /**************************************************/ /* Prototypes */ /**************************************************/ /* Initialize timer and set 1ms 'tick' increments */ void InitializeTimer(void); /* Wait for specified delay time (provided in ms) */ void Wait(unsigned int Delay); /* Return whether the specified timer is counting */ char Active(char Timer); /* Return whether the specified timer has expired */ char Expired(char Timer);