What you'll learn

NES programming assembly

This course is a complete immersion into the world of the Nintendo Entertainment System. We will learn how to program games for the NES using 6502 assembly while exploring the building blocks of computer architecture. The rudimentary hardware of the NES is a perfect sandbox for us to learn important concepts of low-level programming.

mos 6502 cpu

At the end of the course, you'll have a working knowledge of 6502 assembly language, a comprehensive understanding of the NES hardware, and a toy homebrew game project that we'll code together from scratch. We'll start with small examples and proceed to glue everything together in a final project that demonstrates how a simple NES game works.

The tools you'll need

We'll use a simple code editor, an assembler called CA65, and a NES emulator called FCEUX. All these tools are cross-platform, so you'll be able to follow along on either Windows, macOS, or Linux!

operating system

Is this course for you?

nes game development

This is a self-contained course with no formal prerequisites. However, you will probably get the most out of it if you already know the basics of coding (if-else, loops, functions).

If you like retro game development and want to learn more about computer architecture and low-level programming, then this course is definitely for you!

About the instructor

gustavo pezzi

Gustavo Pezzi is a university lecturer in London, UK. He has won multiple education awards as a teacher and is also the founder of pikuma.com.

Gustavo teaches fundamentals of computer science and mathematics; his academic path includes institutions such as Pittsburg State University, City University of London, and University of Oxford.

teaching certification
higher education academy
pgclt teaching certification
bpp university award

Course content

25 hours total length 23 Chapters Last updated July 2023
  • Motivations & Learning Outcomes
  • How to Take This Course
  • The NES in the History of Game Consoles
  • The Early Years of Nintendo
  • NES Hardware (Console)
  • NES Hardware (Cartridge)
  • Opening the NES Cabinet
  • Quiz: NES Hardware
  • Binary Numbers
  • Hexadecimal Numbers
  • Quiz: Binary & Hexadecimal
  • 6502 Pinout
  • 6502 Registers
  • 6502 Status Flags
  • Quiz: 6502 CPU
  • The Assembler Flow
  • Popular 6502 Instructions
  • The CA65 Assembler
  • Installing CA65 on Windows
  • Installing CA65 on macOS
  • Installing CA65 on Linux
  • Quiz: Assembler
  • iNES Header
  • Our First Assembly Code
  • Assembler & Linker
  • The FCEUX Emulator
  • Exercise: Our First Assembly Bug
  • Addressing Modes
  • Instruction Set
  • Exercise: 6502 Warmup Exercises
  • CPU Memory Map
  • Clearing RAM Addresses
  • NES Graphics & the PPU
  • NTSC, PAL, & VBlank
  • PPU Memory Map
  • Color Palette
  • NES Initialization Code
  • Include Files
  • PPU Address Latch
  • Unnamed Labels & Subroutines
  • Quiz: Picture Frame & VBlank
  • CHR-ROM Tiles
  • Loading Nametable Tiles
  • Loading Attributes
  • Dynamic CA65 Macros
  • RAM Variables
  • Pointers
  • Loading Full Nametables
  • Quiz: Pattern Tables & Nametables
  • Displaying Text
  • NES Sprites
  • Hello Mario
  • OAM Decay
  • Hiding Sprites
  • Sprite Flickering
  • Exercise: Hello Goomba
  • NES Controller Architecture
  • Joypad Input Routine
  • Checking Button Presses
  • Moving Sprites using the Joypad
  • Quiz: Controller Input
  • Integer & Fractional Position
  • Velocity & Acceleration
  • Signed Velocity
  • Animation Frames
  • Quiz: Subpixel Movement
  • Generating Random Values
  • Bitshift Operations
  • Random Enemy Position
  • Exercise: Random Values
  • Nametable Mirroring
  • Horizontal & Vertical Scrolling
  • Swapping Nametables
  • Loading Background Dynamically
  • Dynamic Scrolling
  • Drawing Column of Tiles Off-Screen
  • Loading Attributes Off-Screen
  • Quiz: Background Scrolling
  • Scroll Split Screen
  • Different Split Screen Techniques
  • Sprite-0 Hit
  • Separating Game Logic & NMI
  • Saving Registers in the Stack
  • Buffering
  • Quiz: Split Screen
  • Array of Actors
  • Adding & Removing Actors
  • A Routine to Add Actors
  • Looping Array of Actors
  • Rendering Actors
  • Updating Actor Position
  • One Missile Per Button Press
  • Removing Actors
  • Relative vs. Absolute Jumps
  • Spawning Submarines
  • Spawning Airplanes
  • Quiz: Managing Game Objects
  • Random Numbers & LFSR
  • 8-bit LFSR Example
  • Random Airplane Position
  • Random Submarine Position
  • Quiz: Random Numbers
  • Sprite Collision Check
  • Missile-Airplane Collision
  • Point Inside Bounding Box
  • Simulating BCD Increment
  • A Routine to Increment Score
  • Buffering Background Changes
  • Incrementing Score on Enemy Hit
  • CHR Bank Switching
  • Game State Enumeration
  • Adding a Title Screen
  • Displaying Menu Items
  • Quiz: CHR Bank Switching
  • Encoding & Compression
  • LRE Compression
  • Block Encoding
  • Quiz: Data Encoding & Compression
  • The APU
  • NES Audio
  • FamiStudio Tracker
  • NES Sound Engines
  • FamiStudio Sound Engine
  • Writing a Custom Sound Engine
  • Evolution of Famicom Audio
  • Quiz: NES Audio & the APU
  • Polishing our Game Code
  • Developing NES Games in C
  • Conclusion & Next Steps

How is this course different?

The 6502 processor is an extremely important part of computing history, powering many popular game consoles and microcomputers of the past, like the NES, the Commodore 64, the Apple II, and even the Tamagotchi.

nes programming tutorial

Differently than other online resources about retro game programming, this course is not simply a documentation of assembly mnemonics that only experienced developers can digest. This course tries to be as beginner-friendly as possible, giving you the chance to learn assembly in a fun way.

nes programming tutorial

Trying to understand how modern computers work under the hood can be overwhelming. The small architecture of the NES is our chance to take a step back and look at the fundamental building blocks of computing. So, if you want to really learn how digital machines work and finally lose your fear of the expression "assembly programming", then get ready and buckle up! We are about to go on a super cool nerd trip together.

73% of our students come back for another course

We don't offer discounts on our courses. Ever.

What students are saying

5 star
4 star
3 star
2 star
1 star
David Sowsy
David Sowsy
"Another great course! This one is a lot more technically dense than Atari course that I took (and for good reason). It requires a lot more thought and patience, but it is a great introduction to the NES as a 6502 based architecture. The only minor nits I've got with it is that there were not quizzes on it, which could help reinforce some of the topics a little bit better, and some time could have been spent up front on aspects of game structure and best practices for 6502 code. The course reflects the nature of the machine and getting into the thick of the thorny details and offers a great entry point into game development for this system. As someone with a programming background the topics on LFSR, for randomization and touching on the encoding/decoding of music were also very well thought out."
02 Jun 2023
"Well worth the price! I am really impressed with this course so far. Giving a 5-star review even if I haven't made that much progress in the course yet."
10 May 2023
Joel Rivera
Joel Rivera
"Incredible course! Complete and comprehensive. Master teacher Gustavo is here to help us go thru very technical stuff that would be otherwise inaccessible to most people. You can feel the passion in this project."
07 May 2023
"Absolute great introductory to NES Assembly 6502! Like some members of this course I came from using NESMaker which let's you create games without needing any programming knowledge. But - in order to create more advanced games it is absolutely necessary to learn about the architecture of the NES and at least have some basic understandings of Assembly 6502 code. And this course here is a gold mine. Everything is well explained and constantly updated. I hope there will be an advanced course in the future. But I can't recommend this course enough. If you have ever be interested in the NES and creating games, do yourself a favor and enroll. You won't be disappointed. And take your time - it took me 3 - 3 1/2 months to digest everything and I probably will need to rewatch a couple of lectures later during designing my own game! Thanks Gustavo!"
19 Apr 2023
Martin Grahn
C Embedded / VHDL developer
"Wonderful. Thanks for a great course. I enjoyed almost everything. I specially liked the sidesteps eg talking about number base 12 and origin from the eqyptians, very interesting. The layout of the course was easy to follow. It game me a lot of confidence to go forward creating a game myself as well as showing my 9year daughter doing it together with her."
11 Apr 2023

Other similar courses

C++ 2D Game Engine Development

30 hours
  • Learn to make a simple 2D game engine using modern C++, SDL, ECS, and Lua.
raycasting texture c

Raycasting Engine Programming with C

18 hours
  • Write a raycasting engine with textures and sprites using the C programming language.

Game Physics Engine Programming

35 hours
  • Learn how to create a 2D rigid-body game physics engine from scratch with C++.