DOC PREVIEW
MIT 6 111 - Study Notes

This preview shows page 1-2-3-4 out of 13 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 13 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 13 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 13 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 13 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 13 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

FPGA HuntSyed Ahmed, Pete Kruskall, Yuetian XuDecember 15, 20071 IntroductionFPGA Hunt is a throwback to the games of yore. Much like the seminal gameDuck Hunt, FPGA Hunt is a light gun controlled reflex-testing game where onemust shoot objects that fly through the air. FPGA Hunt, however, introducesa modern twist onto the old game. In addition to a wide array of potentialtargets, each with their own personality and game effects, FPGA Hunt takesthe 2D Duck Hunt engine and evolves it into a 2.5D engine, allowing whatare typically static elements on the screen to become dynamic 3D elements,immersing the user in a semi-realistic environment. Furthermore, allow users toshoot the dog that used to mock them when they missed the duck. In the nextfew sections, we will explore how the zapper, game logic, and graphics modulesworked together to make this gaming experience possible.2 Zapper Overview - Syed AhmedThe zapper we obtained for this project was the EMS TopGun. This zapperuses LED lights placed around the screen to determine the orientation of thedevice. A tiny camera at the end of the zapper is able to detect the LEDsand with some calibration, determine which portion of the screen the zapperis pointed at. The software that comes with the zapper allows for the userto control the PC’s mouse with the device. When the trigger is pressed, thesoftware interprets this as a mouse click. From there, a java program determinesthe mouse’s coordinates and sends the information to the labkit via the serialport. The zapper module then interprets the data from the serial port and sendsinformation related to the zapper’s x and y position to the game logic module.2.1 Zapper Logic: PC OutputThe process of interpreting the PC’s mouse coordinates and sending the infor-mation to the labkit via the serial port is completed entirely with java program-ming. The program first analyzes the computer’s hardware to determine whichcommunication ports are available. Depending upon the ports that are avail-able, java displays a window to the user to allow him or her to select the port1they wish to use. After the user has selected their desired port, the programinitializes the port and prepares for output. It then creates a blank 800 × 600pixels window that encompasses the entire screen (when the screen resolutionis 800 × 600). This window detects the coordinates for the mouse whenever itdetects a mouse click. The software then sends a six digit number through theserial port. The first three digits relate to the x position, while the last threerelate to the y position. This can be done indefinitely or until the window isclosed by pressed Alt + F4.2.2 Zapper Logic: Labkit OverviewThe labkit receives the output from the PC through the RS-232 or serial port.The zapper module is responsible for interpreting this data and determining theinformation that it is carrying. The serial port sends a constant datastream ofones until it receives an output from the PC. At this point, the stream becomeszeroes for a period of time related to the baud speed of the port. This speed isset through the java software on the PC and for the purposes of this project,has been set to 115200. This means that every bit sent from the PC via theserial port lasts for approximately 235 clock cycles when using a 27 MHz clockon the labkit. After the initial start bit, the serial port then sends 8 bits relatedto the first digit in the x position. This is followed by a transition phase thatconsists of a ’1’ and a ’0’. The stream then moves on to the second digit in thex position value, and proceeds in this manner until it reaches the final digit forthe y position value. Upon completing this final digit, it immediately returnsto a stream of ones until the next position signal is sent.Figure 1: Sample Two Digit Serial Transmission Signal2.3 Zapper Logic: Labkit: StatesIn order to facilitate the interpretation of the changing properties of the datas-tream, the zapper module has various states that relate to the informationthat it is currently analyzing. When the datastream is sending a continuousstream of ones, the zapper remains in a “no communication” state. In this stateit only seeks to ensure that all the timers and expiration signals are reset orturned off. When the zapper module detects the start bit, it transitions to the“start sequence” state. In this state, the module simply counts the number ofclock cycles it takes a 27 MHz clock to count one bit from the serial port (which2happens to be approximately 235 with a baud speed of 115200). Instead ofcounting to this number, the module counts to a number slightly below it (ap-proximately 220) to insure that all subsequent recordings are from the correctvalue, and then transitions to the next state, “x digit 1”. In this state, and allother states referring to a digit, the module has two timers, a macroscopic timerand a microscopic timer. The macroscopic timer is responsible for determiningwhen the module has finished reading the 8 bits concerning the digit. This timeris responsible for triggering the expiration signal that transitions the module tothe next state. The microscopic timer is responsible for determining which bitin the 8-bit sequence the module is currently reading. This will be discussedfurther later in the report.The next state that the module goes to is the transition state. Once again,in this state the module only counts the number of clock cycles it takes fortwo bits to pass before transitioning the system to a state related to the nextdigit. In this manner, the state transitions continue, from a digit state to atransition state, until the module reaches the final y digit. When it has finishedreading this final digit, the module enters its “transmit data” state. In thisstate, the module sets the x and y position outputs to their new values andturns the “zapped” signal on. The output for the x and y position will remainconstant until the value is changed, but the “zapped” signal will only last foras long as the module remains in the “transmit data” state. Since the gaminglogic works every 1/60th of a second, the zapper module is set to remain in the“transmit data” state for that long.Figure 2: State Transition Diagram32.4 Zapper Logic: Macroscopic TimingsThere are four macroscopic timers running within the zapper module. The firsttimer, “counter1” is responsible for measuring the length of time for which thezapper module will be


View Full Document

MIT 6 111 - Study Notes

Documents in this Course
Verilog

Verilog

21 pages

Video

Video

28 pages

Bass Hero

Bass Hero

17 pages

Deep 3D

Deep 3D

12 pages

SERPENT

SERPENT

8 pages

Vertex

Vertex

92 pages

Vertex

Vertex

4 pages

Snapshot

Snapshot

15 pages

Memories

Memories

42 pages

Deep3D

Deep3D

60 pages

Design

Design

2 pages

Frogger

Frogger

11 pages

SkiFree

SkiFree

81 pages

Vertex

Vertex

10 pages

EXPRESS

EXPRESS

2 pages

Labyrinth

Labyrinth

81 pages

Load more
Download Study Notes
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 Study Notes 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 Study Notes 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?