Emulating the Nintendo Entertainment System
description
Transcript of Emulating the Nintendo Entertainment System
![Page 1: Emulating the Nintendo Entertainment System](https://reader031.fdocuments.us/reader031/viewer/2022013012/56816625550346895dd981ba/html5/thumbnails/1.jpg)
Emulating the Nintendo Entertainment System
By Danny Matthews
Supervised by Dr Des Watson
![Page 2: Emulating the Nintendo Entertainment System](https://reader031.fdocuments.us/reader031/viewer/2022013012/56816625550346895dd981ba/html5/thumbnails/2.jpg)
“A very precise form of simulation which enables one type of computer to operate as if
it were a different type of computer.” - BCS
Emulation
NES Software
NESEmulator
Executes on
Executed on
Executed on
Executed onExecuted on
![Page 3: Emulating the Nintendo Entertainment System](https://reader031.fdocuments.us/reader031/viewer/2022013012/56816625550346895dd981ba/html5/thumbnails/3.jpg)
8 Bit Video Games Console Released in 1983
Hugely Successful: 60 Million Units Sold Over 1000 Released Titles
Finally Discontinued in 1995: Super Nintendo - 1990 Sony Playstation – 1994
Major Player in Revitalising the Market After the Crash of 1983
NES Overview
![Page 4: Emulating the Nintendo Entertainment System](https://reader031.fdocuments.us/reader031/viewer/2022013012/56816625550346895dd981ba/html5/thumbnails/4.jpg)
NESFour Main Units
Central Processing Unit (CPU)Picture Processing Unit (PPU)Audio Processing Unit (APU)Input
Development ToolsDebuggerName Table ViewerPattern Table ViewerImplemented using Java 1.5
Project Overview
![Page 5: Emulating the Nintendo Entertainment System](https://reader031.fdocuments.us/reader031/viewer/2022013012/56816625550346895dd981ba/html5/thumbnails/5.jpg)
Long Time interest in Computer EmulationThe NES in particular, for reasons of
nostalgia
Interest in the logic behind the Hardware
Respect for the developers forced to work with such a constrained environment
Great Extension Possibilities
Motivations
![Page 6: Emulating the Nintendo Entertainment System](https://reader031.fdocuments.us/reader031/viewer/2022013012/56816625550346895dd981ba/html5/thumbnails/6.jpg)
Central Processing Unit (CPU)• 151 Official Op-codes• 13 Addressing Modes• 7 Registers•7 Regions of Memory
![Page 7: Emulating the Nintendo Entertainment System](https://reader031.fdocuments.us/reader031/viewer/2022013012/56816625550346895dd981ba/html5/thumbnails/7.jpg)
Memory MappingUses Memory Mapping to Interact With External Hardware.Reading/Writing to Certain Locations in Memory Actually reads/writes to external memory and registers.
Memory MirroringCertain Locations in Memory "mirror" the Contents of Other Locations.Writing to a Mirrored Location Will Change the Content in All Mirroring Locations Also.
Central Processing Unit (CPU)
![Page 8: Emulating the Nintendo Entertainment System](https://reader031.fdocuments.us/reader031/viewer/2022013012/56816625550346895dd981ba/html5/thumbnails/8.jpg)
Central Processing Unit (CPU)
Reads From The NES Cartridge
Reads/writes to the PPU,APU and I/O Registers
Writing to $0800-$2000Behaves identically to writing to $0000-$07FF
![Page 9: Emulating the Nintendo Entertainment System](https://reader031.fdocuments.us/reader031/viewer/2022013012/56816625550346895dd981ba/html5/thumbnails/9.jpg)
Renders the Generated Images to the Television
Four Main IssuesColour PalettesPattern TablesName TablesSprites
Picture Processing Unit (PPU)
![Page 10: Emulating the Nintendo Entertainment System](https://reader031.fdocuments.us/reader031/viewer/2022013012/56816625550346895dd981ba/html5/thumbnails/10.jpg)
Colour Palettes 52 Possible Colours (Master Palette) Two Useable Palettes:
Image Palette Sprite Palette
25 Colours on Screen at Any One Time
Picture Processing Unit (PPU)
Master Palette
![Page 11: Emulating the Nintendo Entertainment System](https://reader031.fdocuments.us/reader031/viewer/2022013012/56816625550346895dd981ba/html5/thumbnails/11.jpg)
Pattern Tables Store 8x8 Tiles
256 Tiles Per Table
Picture Processing Unit (PPU)
![Page 12: Emulating the Nintendo Entertainment System](https://reader031.fdocuments.us/reader031/viewer/2022013012/56816625550346895dd981ba/html5/thumbnails/12.jpg)
Picture Processing Unit (PPU)
Spr i te Tab le Image Tab le
![Page 13: Emulating the Nintendo Entertainment System](https://reader031.fdocuments.us/reader031/viewer/2022013012/56816625550346895dd981ba/html5/thumbnails/13.jpg)
Sprites
Images Capable of Independent Movement Around the Screen
Sometimes Controllable by the User Made up of tiles from the Pattern Tables
Picture Processing Unit (PPU)
Made up of 8 Tiles
Made up of 4 Tiles
![Page 14: Emulating the Nintendo Entertainment System](https://reader031.fdocuments.us/reader031/viewer/2022013012/56816625550346895dd981ba/html5/thumbnails/14.jpg)
Name Tables 32 x 30 Table Each Element Stores a Reference to a Tile in one of the
Pattern Tables
These Tables are Used to Form the Backgrounds
Picture Processing Unit (PPU)
Name Table
Contains References to Interpreted by the PPU as
![Page 15: Emulating the Nintendo Entertainment System](https://reader031.fdocuments.us/reader031/viewer/2022013012/56816625550346895dd981ba/html5/thumbnails/15.jpg)
Picture Processing Unit (PPU)
Spr i tes
Images
Pattern Tables
Sprites
Name Tables
![Page 16: Emulating the Nintendo Entertainment System](https://reader031.fdocuments.us/reader031/viewer/2022013012/56816625550346895dd981ba/html5/thumbnails/16.jpg)
5 Sound Channels2 Pulse ChannelsTriangle ChannelNoise ChannelDelta Modulation Channel (DMC)
Mixer
Audio Processing Unit (APU)
![Page 17: Emulating the Nintendo Entertainment System](https://reader031.fdocuments.us/reader031/viewer/2022013012/56816625550346895dd981ba/html5/thumbnails/17.jpg)
Waveform Channels Each contain a sequence of values to be output. This sequence is stepped through at a user-defined rate
(period) Until the sequence is progressed, the current sequence
value is output periodically
e.g. given the sequence {0,1} and a period of 5:
[0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0…]
Audio Processing Unit (APU)
![Page 18: Emulating the Nintendo Entertainment System](https://reader031.fdocuments.us/reader031/viewer/2022013012/56816625550346895dd981ba/html5/thumbnails/18.jpg)
Pulse Channel Two Possible Voltages (0 or 1)
Four Possible Duty Cycles
16 Level Volume
Pitch Bending Capabilities
Audio Processing Unit (APU)
![Page 19: Emulating the Nintendo Entertainment System](https://reader031.fdocuments.us/reader031/viewer/2022013012/56816625550346895dd981ba/html5/thumbnails/19.jpg)
Triangle Channel
16 Possible Voltages (0-15)
Fixed Volume
Capable of Longer play duration than the other channels
Audio Processing Unit (APU)
![Page 20: Emulating the Nintendo Entertainment System](https://reader031.fdocuments.us/reader031/viewer/2022013012/56816625550346895dd981ba/html5/thumbnails/20.jpg)
Noise Channel
Outputs a Pseudo-Random sequence of bits
Two Modes: 93 Possible Voltages 32767 Possible Voltages
16 Level Volume
Audio Processing Unit (APU)
![Page 21: Emulating the Nintendo Entertainment System](https://reader031.fdocuments.us/reader031/viewer/2022013012/56816625550346895dd981ba/html5/thumbnails/21.jpg)
Delta Modulation Channel (DMC)
Allows the Playback of Audio Samples From Memory Achieved Through the Use of Three Units:
Memory Reader Sample Buffer Output Unit
Audio Processing Unit (APU)
![Page 22: Emulating the Nintendo Entertainment System](https://reader031.fdocuments.us/reader031/viewer/2022013012/56816625550346895dd981ba/html5/thumbnails/22.jpg)
Mixer
Input: The Output of all 5 Sound Channels Output: An Analogue Audio Signal
Audio Processing Unit (APU)
Pulse 1Pulse 2
Triangle
Noise
DMC
Mixer Analogue Signal
![Page 23: Emulating the Nintendo Entertainment System](https://reader031.fdocuments.us/reader031/viewer/2022013012/56816625550346895dd981ba/html5/thumbnails/23.jpg)
InputStandard Controller• Movement in Four Directions• Two “Action” buttons• Two “Control” Buttons
Movement
“Control”“Action”
![Page 24: Emulating the Nintendo Entertainment System](https://reader031.fdocuments.us/reader031/viewer/2022013012/56816625550346895dd981ba/html5/thumbnails/24.jpg)
Debugger
Development 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 25: Emulating the Nintendo Entertainment System](https://reader031.fdocuments.us/reader031/viewer/2022013012/56816625550346895dd981ba/html5/thumbnails/25.jpg)
Name Table Viewer
Development ToolsName Tables
Scroll Lines
Attribute Table Information
Name Table Data Display
Display Options
![Page 26: Emulating the Nintendo Entertainment System](https://reader031.fdocuments.us/reader031/viewer/2022013012/56816625550346895dd981ba/html5/thumbnails/26.jpg)
Development ToolsPattern Table Viewer
Pattern TablesTile and Palette
Information
Display Options
Palettes
![Page 27: Emulating the Nintendo Entertainment System](https://reader031.fdocuments.us/reader031/viewer/2022013012/56816625550346895dd981ba/html5/thumbnails/27.jpg)
The Software in Action
Graphical Auditory