31
FPGA-Based Arcade Emulation Danny Funk, Cory Mohling, Tony Milosch, David Gartner, John Alexander Advisor: Philip Jones Client: Joseph Zambreno

FPGA-Based Arcade Emulation Danny Funk, Cory Mohling, Tony Milosch, David Gartner, John Alexander Advisor: Philip Jones Client: Joseph Zambreno

Embed Size (px)

Citation preview

Page 1: FPGA-Based Arcade Emulation Danny Funk, Cory Mohling, Tony Milosch, David Gartner, John Alexander Advisor: Philip Jones Client: Joseph Zambreno

FPGA-Based Arcade

EmulationDanny Funk, Cory Mohling, Tony

Milosch, David Gartner, John Alexander

Advisor: Philip JonesClient: Joseph Zambreno

Page 2: FPGA-Based Arcade Emulation Danny Funk, Cory Mohling, Tony Milosch, David Gartner, John Alexander Advisor: Philip Jones Client: Joseph Zambreno

Overview

Project Plan and Design

Design Challenges

2nd Semester Implementation

Final Results

Page 3: FPGA-Based Arcade Emulation Danny Funk, Cory Mohling, Tony Milosch, David Gartner, John Alexander Advisor: Philip Jones Client: Joseph Zambreno

Project Objective• Goals

o Showcase the capabilities of reconfigurable computing platforms

o Have a system that can be used for demonstrations

• Problemo Demonstrating

reconfigurable computing to non-technical users

o Demonstrate capabilities in captivating way

Page 4: FPGA-Based Arcade Emulation Danny Funk, Cory Mohling, Tony Milosch, David Gartner, John Alexander Advisor: Philip Jones Client: Joseph Zambreno

Conceptual Solution• FPGA Capabilities

o Continue 09/10 Senior Design team’s NES Emulation through FPGA

o Entire NES and game selection contained on single FPGA board

• Presentationso Have wide selection of

playable gameso Create arcade machine that

can be put on display

Page 5: FPGA-Based Arcade Emulation Danny Funk, Cory Mohling, Tony Milosch, David Gartner, John Alexander Advisor: Philip Jones Client: Joseph Zambreno

Concept Diagram

Controls (I/O)

Boot loaderCompact Flash Card

Page 6: FPGA-Based Arcade Emulation Danny Funk, Cory Mohling, Tony Milosch, David Gartner, John Alexander Advisor: Philip Jones Client: Joseph Zambreno

Functional Requirements

• Emulator must support the instruction set used by the original NES System

• All NES-specific emulation must be performed entirely in hardware

• Physical interface shall support 2-player arcade style controls

Page 7: FPGA-Based Arcade Emulation Danny Funk, Cory Mohling, Tony Milosch, David Gartner, John Alexander Advisor: Philip Jones Client: Joseph Zambreno

Functional Requirements

• Graphical interface must allow for selection of all available games on compact flash card

• Boot loader must read ROM files and initialize emulator memories

• Cabinet must support 100 lb monitor, and run on standard 120 VAC power

Page 8: FPGA-Based Arcade Emulation Danny Funk, Cory Mohling, Tony Milosch, David Gartner, John Alexander Advisor: Philip Jones Client: Joseph Zambreno

Non-Functional Requirements

• All emulator components shall be implemented as individual modules

• Cabinet shall be safe for all age groups• Users’ interaction with boot loader shall be

understandable without additional help• Cabinet shall be a vintage style arcade

cabinet to house the system• Cabinet shall be durable to withstand

demonstrations

Page 9: FPGA-Based Arcade Emulation Danny Funk, Cory Mohling, Tony Milosch, David Gartner, John Alexander Advisor: Philip Jones Client: Joseph Zambreno

Considerations• Constraints

o System has to be designed around NES ROM files and NES instruction set

o Only a limited amount of logic on FPGA board

o Cabinet should be able to be moved from building to building on campus

• Technologyo Using new monitor technology with old NES

o Interfacing with arcade controls

Page 10: FPGA-Based Arcade Emulation Danny Funk, Cory Mohling, Tony Milosch, David Gartner, John Alexander Advisor: Philip Jones Client: Joseph Zambreno

Market Survey• Another project currently exists (Veri NES).

The source is not available.• Various software emulators are available

and will help with understanding the NES.• Researched how similar arcade cabinets

have been built. • Took measurements of button layouts from

original arcade cabinets.

Page 11: FPGA-Based Arcade Emulation Danny Funk, Cory Mohling, Tony Milosch, David Gartner, John Alexander Advisor: Philip Jones Client: Joseph Zambreno

Risks and Mitigations• Unfamiliarity with FPGA coding and NES

Architectureo Research with assistance of advisor

• Audio may require CPU to be rewritteno Start early on Audio

• Unforeseen extra design requiredo Start Early on FPGA work

• Little experience with woodworkingo Seek outside advice and make detailed blueprints

Page 12: FPGA-Based Arcade Emulation Danny Funk, Cory Mohling, Tony Milosch, David Gartner, John Alexander Advisor: Philip Jones Client: Joseph Zambreno

Schedule• Split team into 3 groups

o Emulator, Boot Loader, and Cabinet

Page 13: FPGA-Based Arcade Emulation Danny Funk, Cory Mohling, Tony Milosch, David Gartner, John Alexander Advisor: Philip Jones Client: Joseph Zambreno

System Decomposition• FPGA

o CPU

o PPUo Video output

o Controller Inputo Boot loader o Audio

• Cabineto Physical Controls

• Joystick• Buttons

o Monitor

Page 14: FPGA-Based Arcade Emulation Danny Funk, Cory Mohling, Tony Milosch, David Gartner, John Alexander Advisor: Philip Jones Client: Joseph Zambreno

System Design- Controls

• Develop an arcade style interface for the NES emulator

• Create wire riggings for all the joysticks and buttons

• Each button is mapped directly to the controller status register

Page 15: FPGA-Based Arcade Emulation Danny Funk, Cory Mohling, Tony Milosch, David Gartner, John Alexander Advisor: Philip Jones Client: Joseph Zambreno

System Design-Boot Loader

• Develop boot loader using Microblaze Processor provided in Xilinx tools

• Present user with easy to use game selection screen

• Read NES Rom files from Compact Flash

• Parse NES Rom file and load contents into appropriate system memory for the FPGA

• Reset back to boot loader screen when reset is pressed

Page 16: FPGA-Based Arcade Emulation Danny Funk, Cory Mohling, Tony Milosch, David Gartner, John Alexander Advisor: Philip Jones Client: Joseph Zambreno

System Design

Page 17: FPGA-Based Arcade Emulation Danny Funk, Cory Mohling, Tony Milosch, David Gartner, John Alexander Advisor: Philip Jones Client: Joseph Zambreno

System Design- Cabinet

• Use Solid Works to design detailed cabinet drawings

• Used feedback from client

• Purchase custom marquees

• Build out of ¾” plywood

• Detachable Control Box

• Hidden screw and nail holes

• Hinged control box for easy viewing of FPGA

Page 18: FPGA-Based Arcade Emulation Danny Funk, Cory Mohling, Tony Milosch, David Gartner, John Alexander Advisor: Philip Jones Client: Joseph Zambreno
Page 19: FPGA-Based Arcade Emulation Danny Funk, Cory Mohling, Tony Milosch, David Gartner, John Alexander Advisor: Philip Jones Client: Joseph Zambreno

System Design- Audio

• Write audio module that generates audio

• Connect audio module to CPU• Map all audio related instructions from

the CPU to the module• Connect audio module to AC97 to

produce sound output

Page 20: FPGA-Based Arcade Emulation Danny Funk, Cory Mohling, Tony Milosch, David Gartner, John Alexander Advisor: Philip Jones Client: Joseph Zambreno

System Design

• PPUo Map CPU memory to PPU registers to allow for game

scrollingo Implement Memory mappers to allow for more games to

be playedo PPU is implemented using a 14 stage finite state

machine to render each pixelo Each pixel is stored in a buffer that is then sent to the

VGA output

Page 21: FPGA-Based Arcade Emulation Danny Funk, Cory Mohling, Tony Milosch, David Gartner, John Alexander Advisor: Philip Jones Client: Joseph Zambreno

Emulator Implementation

• Improved functionality of past group’s design

• Tweaked PPU and CPU clocks to more closely match the original NES

• Cleaned up existing code to make it more understandable for future projects

Page 22: FPGA-Based Arcade Emulation Danny Funk, Cory Mohling, Tony Milosch, David Gartner, John Alexander Advisor: Philip Jones Client: Joseph Zambreno

Emulator Testing• Tested modified pieces of

emulator separately

• Ran tests found from NES development community in ModelSim that tested the entire system completely

• When tests passed in ModelSim, implementation was tested for robustness on the hardware

CPU Timing Failure

Sprite Test Failure

Page 23: FPGA-Based Arcade Emulation Danny Funk, Cory Mohling, Tony Milosch, David Gartner, John Alexander Advisor: Philip Jones Client: Joseph Zambreno

Emulator Design Revision

• True NES hardware emulation required more resources then initially predicted

• Adopted strategy of software emulation

• New design still met original goals of the project

• Allows for over 120 games to work

Page 24: FPGA-Based Arcade Emulation Danny Funk, Cory Mohling, Tony Milosch, David Gartner, John Alexander Advisor: Philip Jones Client: Joseph Zambreno

Boot Loader Implementation

• C code written to run on PowerPC processor

• Initializes memories for screenshots, fonts, and music

• Program displays metadata from compact flash card

• Graphical interface allows user to select desired game from list

• Loads game data from ROM files into emulator memories

Page 25: FPGA-Based Arcade Emulation Danny Funk, Cory Mohling, Tony Milosch, David Gartner, John Alexander Advisor: Philip Jones Client: Joseph Zambreno

Boot Loader Testing• Tested boot loader

with debug statements sent through UART

• Debug statements used to verify values in memory, and functionality of software

Page 26: FPGA-Based Arcade Emulation Danny Funk, Cory Mohling, Tony Milosch, David Gartner, John Alexander Advisor: Philip Jones Client: Joseph Zambreno

Cabinet Construction• ¾” cabinet grade

plywood used for economical strength and durability

• Kreg Joints hide screws without compromising strength

• Used Jim Jensen as resource while building the cabinet

Page 27: FPGA-Based Arcade Emulation Danny Funk, Cory Mohling, Tony Milosch, David Gartner, John Alexander Advisor: Philip Jones Client: Joseph Zambreno

Cabinet Construction• Control box is removable from main cabinet

assembly for demonstrations on any VGA monitor• Wheels attached for easy transportation• Construction presented interesting engineering

challenges

Page 28: FPGA-Based Arcade Emulation Danny Funk, Cory Mohling, Tony Milosch, David Gartner, John Alexander Advisor: Philip Jones Client: Joseph Zambreno

Final CostsItem Cost

Wheels $40.00

Speakers $20.00

Screws $10.00

Plywood $90.00

Marquee $20.00

Marquee Light $20.00

T-Molding $10.00

Paint/Primer $50.00

Monitor $500.00

Cabinet Total $760.00

Labor – 1130hrs $22,600.00

Page 29: FPGA-Based Arcade Emulation Danny Funk, Cory Mohling, Tony Milosch, David Gartner, John Alexander Advisor: Philip Jones Client: Joseph Zambreno

Final Results

Page 30: FPGA-Based Arcade Emulation Danny Funk, Cory Mohling, Tony Milosch, David Gartner, John Alexander Advisor: Philip Jones Client: Joseph Zambreno

Moving Forward• Lessons Learned

o “Take the time to learn the tools”o “Allow for ample time to acquire supplies”o “Don't set goals until you understand the full complexity of the

project”o “Don't be worried about asking stupid questions”o “Have a base understanding before diving in”

• Future of the projecto Cabinet can be reusedo Networked gamingo Advanced systems

Page 31: FPGA-Based Arcade Emulation Danny Funk, Cory Mohling, Tony Milosch, David Gartner, John Alexander Advisor: Philip Jones Client: Joseph Zambreno

Questions