Palettes

15-Bit BGR Format

The Super Nintendo / Super Famicom stores it's palette in 512 bytes in a 15-bit BGR format. Each BGR word is 2 bytes, thus it is 512 bytes for 256 colors (256 x 2). The format for each BGR word looks like this:

0BBBBBGG GGGRRRRR

Bit 15 is unused and should be set to 0. Each color value can range from 0 - 31. So a R, G, B value of 31, 31, 31 represents white. As ...

Working with VRAM - Loading the Palette

I'm getting right down to business in this tutorial, because this is a BIG topic to cover. Seriously, get ready for a ton of new registers to be introduced to, and a lot of theory. Ok, no more time for chatter, let's get started.

What We're Covering

Today we'll make a tile, write that tile to VRAM, and display the tile on a BGMAP. You'll really need to read Qwertie's doc on some areas. Oh, ...

Writing Your First SNES Program

Writing Your First SNES Program

Now it is time to get your hands dirty. You will be making your first SNES ASM program today. It's about time, huh. So let's get on with it!

What this program will do:

Well it will basically fill then entire screen with one color. MAN is that EXciting OR WHAT! Now, before we begin, I want you to know what you are writing. So some very Quick (actuall ...

Transparency

The transparency on the SNES, while documented properly, made me have some headaches understanding how it works. Now that I've figured the truth (or at least I'm pretty damn close to), I'm writing a small document to spare someone else the headaches I've had if if could be useful to someone wanting to do a homebrew program for the SNES or to just understand how their favorite games works internall ...

Using the NMI-VBLANK

Earlier we made an interrupt table which assigned addresses for the SNES interrupts. We assigned the address to an empty handler that just returned for every interrupt except the NMI (VBLANK) interrupt. This interrupt occurs whenever the T.V.'s tracer is not tracing to the screen, making it safe to edit data in VRAM and update the screen. Not waiting for VBLANK can create awful results on the scre ...

Backgrounds

BG Modes

The SNES has 7 background modes, two of which have major variations. The modes are selected by bits 0-2 of register $2105. The variation of Mode 1 is selected by bit 3 of $2105, and the variation of Mode 7 is selected by bit 6 of $2133.

Mode    # Colors for BG
         1   2   3   4
======---=---=---=---=
0        4   4   4   4
1       16  16   4   -

...

Sprites

The SNES has 128 independent sprites. The sprite definitions are stored in Object Attribute Memory, or OAM.

OAM

OAM consists of 544 bytes, organized into a low table of 512 bytes and a high table of 32 bytes. Both tables are made up of 128 records. OAM is accessed by setting the word address in register $2102, the "table select" in bit 0 of $2103, then writing to &#36 ...

Final Fantasy - Mystic Quest

Final Fantasy - Mystic Quest

ROM Map

The ROM Map describes various offsets, some could be broken down further and just haven't been expanded up on, but data structures are provided for those linked to.

| Offset | Category | Description | |-------------------| ...

SNES Sprites

This was very large and I had to write more sections in different parts of the tutorial, so please tell me if anything is confusing. I have not proofread any of this.

Sprites are important to every game. They are coined after the objects that move in a game, and there are ALOT of moving objects in a game! So... sprites are very important to any demo or game, capiche?

I want you to read the S ...