main Module
Files:
Pseudo-Code
main(Takes and returns nothing)
initialize the timers
initialize the atari module
initialize the IR sensors module
initialize the cheat module
set player_ready to FALSE
repeat forever:
while player_ready is FALSE:
store CheckMotionEvents() in variable event
call HandleMotionEvents(NO_EVENTS) to turn off all controls
if event is not DOWN, NO_EVENT, or POWER_OFF:
set player_ready to TRUE
endwhile
store CheckMotionEvents() in variable event
if the event is POWER_OFF:
set player_ready to FALSE
turn off the fans
else:
call HandleMotionEvents(event)
call HandleCheatEvents(event)
endif
endrepeat