DOC PREVIEW
Columbia CSEE 4840 - All Invaders Are Belong To Us

This preview shows page 1-2-3-4-5-6-7-50-51-52-53-54-55-56-100-101-102-103-104-105-106 out of 106 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 106 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 106 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 106 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 106 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 106 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 106 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 106 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 106 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 106 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 106 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 106 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 106 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 106 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 106 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 106 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 106 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 106 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 106 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 106 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 106 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 106 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 106 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

All Invaders Are Belong To Us CSEE 4840 Spring 2011 Project Report Sanat Apte*, Mashooq Muhaimen†, Rahul Parikh* , Yibin Sun* *Department of Electrical Engineering †Department of Computer Science School of Engineering and Applied Science, Columbia University in the City of New York { sa2832, mm3858, rtp2119, ys2522}@columbia.edu Abstract What follows is the design and implementation of an embedded system that mimics the classic arcade game Space Invaders. This project utilizes both hardware and software capabilities of the Altera DE2 board. The implementation involves a combination of C and VHDL. We use a PS/2 keyboard, a VGA monitor and a Wolfson WM8371 audio codec as peripheral devices. 1 Game Overview: All Invaders Are Belong to Us! is a two-dimensional fixed shooter game in which the player controls a home-ship by moving it horizontally across the bottom of the screen and firing at descending aliens. The aim is to defeat five rows of twelve aliens that move horizontally back and forth across the screen as they advance towards the bottom of the screen. The player defeats an alien, and earns points, by shooting it with laser missiles. Defeating the aliens brings another wave that is more difficult, a loop which can continue indefinitely. The aliens attempt to destroy the home-ship by shooting at it while they approach the bottom of the screen. If they reach the bottom, the alien invasion is successful and the game ends. The home-ship is partially protected by four stationary defense barricades that can be destroyed by the aliens and the home-ship. Our rendition of the game is divided into 3 phases:The Game Start Phase: This phase contains the introductory screen which asks the player whether he/she is ready to “Save the Planet”. The Game Play Phase: This is the main phase of the game. The player plays the game by shooting at the alien waves and hence sequentially clearing levels. Each player begins with 3 lives. He/ She can lose the game in two ways: if he/she gets shot by alien missiles 3 times, or if the alien wave proceeds so far down that they reach the barricade level (this indicates a successful alien invasion!).The Game Over Phase: On losing the game, the game-state is shifted to the game-over screen. The user can restart the game by pressing the ‘enter’ key and resume saving the planet. 2 System Overview Figure 1 gives an overview of the hardware components of the system. The system is implemented on an Altera DE2 board. We use the NIOSII processor as our CPU. The CPU uses the on-board SRAM as its memory device. We use a PS/2 keyboard as our game controller and the on-board Wolfson WM8371 audio codec to play game sound. A VGA monitor is used as the display. The CPU is setup as an Avalon master. It communicates to other hardware components of the system through the Avalon bus. The system contains the following Avalon slave peripherals: an SRAM controller, a PS/2 controller, an audio peripheral and a VGA controller. The SRAM controller facilitates communication between the CPU and the SRAM by translating the protocol spoken by the Avalon bus to that for the SRAM [1]. The PS/2 controller reads data from the PS/2 keyboard and passes the information to the software. The audio controller talks to the audio codec and tells it what frequency to produce and controls the on/off state interfaces with audio codec. The VGA controller, in addition to interfacing with the VGA display, contains the bulk of hardware logic for displaying game sprites. Majority of the game flow logic (i.e. collision detection, keeping track of score, level changes etc.) are in the software. The software sends periodic updates to the hardware to change the video display and play sound. Two events cause the software to change game state: a time tick (implemented using a software counter delay) and keyboard inputs coming from the PS/2 controller. Figure 1. System Components3 Hardware Description Description of the main hardware components that we worked on follows: 3.1 VGA Raster (includes VGA controller logic) Most of the VGA Raster modules listed below operate at approximately 25 MHz, which is half the frequency of our main system clock. An exception is the module that listens for SW updates coming through Avalon. 3.1.1 Core VGA Raster Modules The heart of the video display hardware is a raster scanner [2]. Fortunately, we had access to a fully functional raster scanner that was provided to us as part of one of our labs. We used it almost without modification. 3.1.2 Sprite Display Modules We use several sprite modules to display the sprite images (e.g. home ship sprite, alien sprites etc.) Each sprite module has a corresponding display bit. The role of each sprite module is to decide whether or not the display bit should be set to 1. The hardware finds the starting location of the sprite image in signal variables that are updated through the software (we will talk about the updating mechanism shortly). Figure 2 shows how a sprite drawing module’s display bit is set using a small 4x4 sprite example. This display bit is decoded into a color (depending on what sprite module the bit belongs to) and the raster sets the VGA pixel to that color. It is possible however for a display bit for a particular sprite display module to be overridden by the display bit by a higher priority sprite module. Table 1 shows the priorities of different sprite modules. Priority in descending order Sprite Home_bit Home Ship Wave_bit The aliens and their phalanx Home_missile Home missile Aliemissile_bits Aliens’ missiles Score_bit Score number Intro_bit Welcoming screen Game_over_bit Game over screen Lives_bit_1 and 2 and 3 Display life image Barricade1_bit 2 (x4) Barricade sprite Star#_bit (x18) Blinking stars Vga_hblank; vga_vblank; other Blank Table 1. Priorities (in order of decreasing priority) for various Sprites.TimeGen DemoTimeGen Demo 1 2 3 4 5 6 7 8 9 10 T i meGen Demo TimeGen Demo TimeGen Demo T im e G e n D e m o TimeGen Demo TimeGen Demo TimeGen Demo TimeGen Demo TimeGen Demo T im e G e n D e m o TimeGen Demo TimeGen DemoTimeGenClockdisp_bit when v_count = start_v_ccorddisp_bit when v_count = start_v_coord+1disp_bit when v_count = start_v_coord +2disp_bit when vcount = start_v_coord + 3 Figure 2. Example of how a 4x4 sprite image is drawn. The hardware module responsible


View Full Document

Columbia CSEE 4840 - All Invaders Are Belong To Us

Documents in this Course
SPYCAM

SPYCAM

91 pages

PAC-XON

PAC-XON

105 pages

lab 1

lab 1

6 pages

memory

memory

3 pages

Structure

Structure

12 pages

Video

Video

3 pages

pacman

pacman

4 pages

Lab 1

Lab 1

6 pages

Scorched

Scorched

64 pages

lab 1

lab 1

3 pages

Video

Video

22 pages

Memory

Memory

23 pages

DVoiceR

DVoiceR

29 pages

MAZE

MAZE

56 pages

PAC XON

PAC XON

13 pages

PACXON

PACXON

13 pages

MP3 Player

MP3 Player

133 pages

Load more
Download All Invaders Are Belong To Us
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view All Invaders Are Belong To Us and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view All Invaders Are Belong To Us 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?