EECS 373 Final Project: The Guitar Hero

Objective | High Level | Hardware | Software | Results 

 

Software Design

Interrupts and timers were the basis for the core of our design; most of which were triggered by our timers.  We used general purpose timers to simulate the beat of the song, generating an interrupt at increments of the quickest note of the song (the timers' registers were set based on which song were selected).  On each beat, the game software also checks to see which frets are being pressed, and if they are, compare them against what is being shown on the LCD and increment or decrement the score accordingly.  Since this goes on for the duration of the game, it would have been impractical to not use timers to provide the song's beat. 

Interrupts were additionally generated on the strumming of a guitar string, however that functionality was disabled for the final demonstration since the reliability of the sensors that triggered the interrupts went downhill fairly rapidly.  Had this been reliable, the frets would have been checked each time the string was strummed instead, and it would have been compared to what was shown on the LCD at that point.

Our software was written predominantly in C.  Controlling the timers and storing the NES Controller and were written in assembly, but the assembly immediately calls a C function, and the C functions later call on a few assembly function sporadically.  All control of the LCD is done through C, and all of the menu system that is navigated -- the opening screen, selecting a song, selecting a difficulty -- is controlled through C and the suite of LCD control functions.  The general rule is that if it is just interacting with a register or device at an address, it is done through C; if it is interacting with MPC823-related items (such as setting timers and interrupts), it is done through assembly.

The following diagram illustrates the high-level interaction between the software and other elements of Guitar Hero: