2. High Level Design


2.1 Background Math


Besides simple arithmetic, Missile Command requires cosine and sine tables to determine the trajectories of inbound missiles and interceptors.  The game makes no attempt to model the physics of real missiles by tracking variable acceleration due to variations in fuel consumption, distance from Earth, atmospheric resistance, etc.  In fact, the inbound missiles ‘fall’ at a constant y-velocity that is only changed according to difficulty level.  Despite these simplifications, the need for cosine and sine calculations throughout video generation frames complicates the design of our software.  These issues and the associated solutions are discussed in detail in the Software section.


2.2 Logical Structure


The design of Missile Command is separated into two segments – mouse control and video generation.  The mouse MCU is connected to the video MCU through wires soldered directly onto both prototype boards.  The video MCU reads the relevant mouse MCU pins when it needs to determine the location and status of the mouse.  The video MCU executes all video generation code and interfaces with the B/W television through the prototype board.  The video MCU code structure utilizes state-machine coding techniques. There are clearly delimited areas of the code that are responsible for functions such as drawing and updating cities, drawing and updating missiles, drawing and updating interceptors, and checking for the end of the game.


2.3 Hardware/Software Tradeoffs


The NTSC video generation requirements and the speed of the Amega32 are the main constraints on our design.  The necessity to update the video signal within a fixed time frame limits the amount and complexity of instructions executed in any one frame.  Therefore, the software is written to facilitate this time constraint by breaking-up the various tasks that must be accomplished into executable chunks for each frame.


2.4 Standards Compliance


Our hardware complies with the PS/2 standard 6-pin interface as detailed below.  Missile Command complies with NTSC RS-170 monochrome standard for television interface using 525 stacked horizontal lines and a 60Hz refresh rate.  This standard specifies a horizontal sync pulse of 5 ms and a vertical sync pulse of 63.55 ms.  We implement a 63.625 ms vertical sync pulse because it is easily generated using a 16MHz clock.  We follow the RS-170 monochrome video standard by implementing a black and white scheme for our game.


2.5 Intellectual Property Concerns


Although this game is a recreation of the original Missile Command, a proprietary game, we have not infringed upon any intellectual property rights.  According to Richard Lawrence's 1999 article “Legalities of Emulators,” copying the premise behind a game is not illegal.  For the mouse microcontroller, we used code developed by Chee Ming Chaw and Elaine Siu for a Minesweeper Program for 476 in 2003.