emulating the nintendo entertainment system

13
Emulating the Nintendo Entertainment System By Danny Matthews Supervised by Dr Des Watson

Upload: lorie

Post on 16-Feb-2016

36 views

Category:

Documents


0 download

DESCRIPTION

Emulating the Nintendo Entertainment System. By Danny Matthews Supervised by Dr Des Watson. Background. Emulation. Executed on. Executed on. 8 Bit console released in 1983 60 Million Units Sold Over 1000 Released Titles Major Player in Revitalising the Market After the Crash of 1983. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Emulating the Nintendo Entertainment System

Emulating the Nintendo Entertainment System

By Danny Matthews

Supervised by Dr Des Watson

Page 2: Emulating the Nintendo Entertainment System

8 Bit console released in 1983

60 Million Units Sold Over 1000 Released Titles

Major Player in Revitalising the Market After the Crash of 1983

Background

NES

Emulation

“A very precise form of simulation which enables one type of computer to operate as if it were a

different type of computer.” - BCS

NES Software

NESEmulator

Executes on

Executed on

Executed on

Executed on

Executed on

Page 3: Emulating the Nintendo Entertainment System

NESFour Main Units

Central Processing Unit (CPU)Picture Processing Unit (PPU)Audio Processing Unit (APU)Input

Development ToolsDebuggerName Table ViewerPattern Table Viewer

Implemented using Java 1.5

Project Overview

Page 4: Emulating the Nintendo Entertainment System

Central Processing Unit (CPU)• 2A0X – A Modified 6502 Processor• Minus Binary Coded Decimal (BCD) mode • Plus 22 Memory Mapped Registers

CPU Implementation• Implemented as a large switch/case construct

• Memory divided into several objects to reflect the varied read/write behaviour.

Page 5: Emulating the Nintendo Entertainment System

Picture Processing Unit (PPU)

Spr i tes

Images

Pattern Tables

Sprites

Name Tables

Page 6: Emulating the Nintendo Entertainment System

Picture Processing Unit (PPU)PPU Implementation

• In contrast to the CPU, Memory stored as primitive integer arrays • Additional structure unnecessary as read/write

behaviour largely identical for all memory.

• Colour Palette handled within its own class.• Provides extremely accurate NES colours through

use of a mathematical algorithm.

• Provides alterable hue and tint to emulate TV colour adjustment

• Algorithm devised by Kevin Horton, implemented by David de Niese

Page 7: Emulating the Nintendo Entertainment System

Audio Processing Unit (APU)• Voltages – Two (0 or 1)

• Volume – 16 Levels

• Pitch Bending Capabilities

• Voltages – Sixteen (0-15)

• Volume – Fixed

• Capable of Longer Play Duration

• Voltages – Two (0 or 1)

• Volume – 16 Levels

• Pseudo Random Bit Sequence

• Allows the Playback of samples from memory

Pulse (x2)

Noise

Triangle

DMC

Page 8: Emulating the Nintendo Entertainment System

MixerAudio Processing Unit (APU)

Pulse 1Pulse 2

Triangle

Noise

DMC

Mixer Analogue Signal

Sound Implementation• Designed to mirror the NES APU structure.

• Down-sampling required to output sound at 44100 hz as NES outputs samples at ~1789772 hz.

• Volume Control

Page 9: Emulating the Nintendo Entertainment System

InputStandard Controller• Movement in Four Directions• Two “Action” buttons• Two “Control” Buttons Movement

“Control”“Action”

Input Implementation• Button states stored within an 8 bit register• Listeners used to detect button presses and releases• Program reads the button states from the pads periodically

• User definable button mapping

Page 10: Emulating the Nintendo Entertainment System

DebuggerDevelopment Tools

System State CPU Registers

PPU Registers

PPU State

Breakpoint System Interrupt Points Register Value Points

Step/Resume Functionality

DisassemblerMemory Viewer

CPU Memory

PPU Memory

Page 11: Emulating the Nintendo Entertainment System

Development ToolsDebugger Implementation

• System State and Memory Viewer implemented via the manipulation of data obtained using accessor methods in the CPU and PPU.

• Disassembler implemented via use of an opcode information lookup table.

• Index into the table via opcode number• Retrieve pertinent information for opcode.• Advance forward in file by length of opcode in

bytes.

• Breakpoints added to and removed from a handler. Handler checks all breakpoint conditions each instruction.

Page 12: Emulating the Nintendo Entertainment System

Name Table ViewerDevelopment Tools

Pattern Table Viewer

Name Tables

Scroll Lines

Attribute Table Information

Display Options

Pattern TablesTile and Palette

Information

Display Options

Palettes

Page 13: Emulating the Nintendo Entertainment System

The Software in Action

Graphical Auditory