NES development on the web

This page shows a proof-of-concept of teaching NES development, via 6502 assembly, in an interactive environment right in your web browser. You don't have to install any tools on your computer. Instead, you can make changes to the source code of a program on this page, and the source code will be assembled into a ROM and run in an emulator, all in your browser.

To start off, I have written a program that just displays an image. A key concept in NES development is a color palette. While I'm not showing the entire source code for the program, I am showing a snippet that loads the color palette.

Play around with the colors by modifying the values in the textboxes below. The available colors are between 0x00-0x3F, with the exception of 0x0D. Try some random values, or look up the colors you want in the NESdev Wiki. After you've changed the values, run "Reload" to see the result.

; Load the palette
  lda #$3F  ; Write the address $3F00
            ;   to PPU address port
  sta $2006 ; Write the high byte
  lda #$00
  sta $2006 ; Write the low byte

  lda #$ ; universal BG color
  sta $2007
  lda #$ ; color for 1
  sta $2007
  lda #$ ; color for 2
  sta $2007
  lda #$ ; color for 3
  sta $2007

Table of contents

NOTE: this website is very much a work in progress.

    Preface

  1. Table of contents
  2. About

    The basics

  1. Overview
  2. Backgrounds
  3. Sprites
  4. Keypad
  5. Sound
  6. Applied effects

  7. Infinite background scrolling
  8. Smooth physics with fixed point numbers
  9. Foundational concepts

  10. Bits and bytes
  11. 6502 architecture and assembly