NES Development 🎮

Why?

NES Architecture

Credits to Nerdy Nights

CPU

MOS Technology 6502

8-bit microprocessor

6502 Assembly

CPU Overview

Credits to Nerdy Nights

Fun Fact

Super Mario Bros was 31KB big

PPU

Pattern Tables

64KB Memory

8px by 8px Tiles

Palettes

64 colors available

4 palettes for sprites

4 palettes for BG

A tile can only display 4 colors

A palette has 4 colors

Credits to nesdoug

Name tables

Background graphics

32x30 tiles

OAM - Object Attribute Memory

Independent foreground sprites

64 sprites at a given time in this section of memory

8 sprites max per scanline

APU

Audio channels

2 square

1 triangle

1 noise

1 DMC

Credits to @pikuma

Example

Credits to Orj

6502 Assembly

vs

NESFab

NESFab

NESFab is a new programming language for creating NES games. Designed with 8-bit limitations in mind, the language is more ergonomic to use than C, while also producing faster assembly code.

http://pubby.games/nesfab

Comparison

Simple audio rom (beep)

6502 Assembly

NESFab

Explanation

Simple audio rom (beep)

Register 4015: audio channels activation (square 1 is the first bit)

Register 4000: Duty cycle (tone, volume, etc)

Register 4002 and 4003: Wave period control

Comparison

Sprite painting (mario)

Comparison

Sprite painting (mario)

Comparison

Sprite painting (mario)

Takeaways

NES Development

By John Fontalvo

NES Development

  • 20