CS 0447 – Project 2: Breakout
Due: Tuesday, July 9, 2013
Many video games of the past were programmed directly in assembly language. In this project, we’ll be taking an early Atari video game, Breakout, and making a version in MIPS under MARS.
If you are unfamiliar with the game, you might want to look at the Wikipedia article, http://en.wikipedia.org/wiki/Breakout_%28arcade_game%29 or find a modern adaptation (or emulated old version) to try it.
The basic idea is that a large rectangle of bricks is at the top of the screen and you must break it by bouncing a ball with a paddle into the bricks which disappear when the ball hits it. Your paddle is at the bottom of the screen.
If you miss the ball, the ball resets, you lose a life, and you continue on. If you run out of lives before destroying the rectangle, the game is lost. If the rectangle is entirely removed, you win.
After your first project, you might be wondering how to get MARS to make something as awesome as a video game. For this, we can thank several graduate students and Dr. Childers for a modified version of MARS that contains a LED display which we can control. The display is an array of pixels (64 x 64) and each LED can be one of 4 colors: off (black), red, green, or yellow/orange.
In later courses, we’ll discuss two strategies for talking to I/O devices from machine instructions. In this case, the pixel display is memory-mapped. This means that a byte in our address space is reserved for each pixel, and that the content of that array is reflected in the output of our display. Learning about the memory-mapped I/O is not the core of the project and so we provide get and set methods for manipulating a pixel at a specified location.
Additionally, the LED display has support for a key pad. It can handle either button presses on the dialog box or you can use the keys on your keyboard (WASD).
You will need to download this special modified version of MARS from the class webpage in order to do this project.
When you wish to use it, go into the tools menu and select “Keypad and LED Display Simulator”. In the window that appears, click “Connect to MIPS”. Then run the program in MARS using the green play button.
i. 1st and 3rd rows will be green
ii. 2nd and 4th rows will be red
Create a zip file of your source code and a README.txt text file that has your name, your Pitt username and any notes for the TA to help with grading.
Name the file USERNAME-project2.zip
Use the lab submission policies to upload your project.