Cassie Huang and Michael D’Ambrosio 6.111 – Introductory Digital Systems Laboratory December 14, 2005 For our final project, we developed Pac-Man on the FPGA. The game contains modules to handle both the display of the Pac-Man world and logic to control all of the characters and define the rules of the game. Cassie predominantly worked on the display portion of the game and Mike mostly worked on the game logic portion of the game. Essentially, all display modules revolve around drawing objects from memory. The map, the dots, the ghosts and Pac-Man all had separate ROMs which dictated how to draw each corresponding sprite on the VGA display. The lone exception was the dots, which involved a RAM, as we wished to eat them at some point and make them disappear from the screen. We made it such that Pac-Man runs around a maze while avoiding the ghosts, all of which were controlled by separate AI modules. Pac-Man would die if he touched a ghost. However, he could eat an Energizer and temporarily eat the ghosts. A game over occurred if the player died three times but if the player ate all of the dots on the screen, they would win and be treated to a humorous animation. As a result of creating this project, we were able to faithfully recreate a classic arcade game. We also learned how to work as a team in order to build a complex digital system from the ground up.Table of Contents 1. Introduction......................................................................................................................... 4 2. Cassie’s Modules and Implementation ................................................................................... 7 2.1 Video Displays................................................................................................................ 7 2.1.1 Map Display............................................................................................................ 8 2.1.2 Dots Display............................................................................................................ 8 2.1.3 Pac Man Sprite Display .......................................................................................... 9 2.1.4 Ghost Sprite Displays ........................................................................................... 10 2.1.5 Lives Display ........................................................................................................ 10 2.2 Power Pills .................................................................................................................... 10 2.2.1 Power Pill Display ................................................................................................ 11 2.2.2 Power up Counter and Dead Ghost Counter......................................................... 11 2.2.3 Changes in Other Modules to Handle Ghost Death.............................................. 12 2.3 Scoring .......................................................................................................................... 13 2.4 Victory Animation ........................................................................................................ 13 3. Mike’s Modules and Implementation ............................................................................... 14 3.1 Char_move.v................................................................................................................. 14 3.2 Cdetect.v ....................................................................................................................... 18 3.3 Pac_game.v ................................................................................................................... 18 3.4 Ghost AI........................................................................................................................ 20 3.4.1 Ghost_ai_wander.v ............................................................................................... 20 3.4.2 Ghost_ai_precmove.v ........................................................................................... 21 3.4.3 Clyde_ai.v ............................................................................................................. 22 3.4.4 Blinky_ai.v and Pinky_ai.v................................................................................... 23 3.4.5 Inky_ai.v ............................................................................................................... 25 3.5 Keyboard Interface........................................................................................................ 26 3.6 Soundboard.v and play_sound.v ................................................................................... 26 3.7 Title Screen ................................................................................................................... 27 4. Testing and Debugging............................................................................................................. 28 4.1 Cassie’s Testing and Debugging................................................................................... 28 4.1.1 MAP DISPLAY .................................................................................................... 28 4.1.2 DOTS DISPLAY .................................................................................................. 28 4.1.3 PAC MAN SPRITE .............................................................................................. 29 4.1.4 GHOST SPRITE................................................................................................... 29 4.1.5 LIVES DISPLAY ................................................................................................. 29 4.1.6 POWER PILLS..................................................................................................... 29 4.1.7 SCORING ............................................................................................................. 30 4.1.8 VICTORY ANIMATION..................................................................................... 30 4.2 Mike’s Testing and Debugging..................................................................................... 31 4.2.1 Char_move.v......................................................................................................... 31 4.2.2 Cdetect.v
View Full Document