ASM Tutorial Part 2

Are you familiar with all the previous lessons yet? If so, that's great.. with all of that knowledge, you can do a lot of cool stuff - but you can always get better at ASM and make awesome stuff by learning more. So here's Part 2 of the tutorial, which for now only explains a bit of intermediate stuff. Don't worry, everything will be explained easily.

Lesson 6: Indexing

So... you know ...

Backgrounds

The SNES has 8 background modes, two of which have major variations. The modes are selected by bits 0-2 of register $2105.

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

GD Leen

GD Leen

Below is a decompressor and recompressor for GD Leen. This has been updated to compile with GCC, below that is the original unmodified file.

//------------------------------------------------//
// Decompressor and Recompressor: GDLeen ver 1.0  //
//                                                //
// Coded By:   John C. (Bongo`) ...

Game Doctor

Bung Game Doctor SF3, SF6, SF7 Headers

Version 1.0 - Copyright 2003: The Dumper

The Game Doctor SF3/SF6/SF7 backup units for the SNES use a 512 byte header.

The format is as follows (all numbers are hexadecimal):

0000-000F

47 41 4D 45 20 44 4F 43 54 4F 52 20 53 46 20 33 "GAME DOCTOR SF 3"

This is the ID string for a Game Doctor SF header.

0010

SRA ...

General Advice

The most important thing to know about 65816 optimizations is to not try to emulate other CPU architectures. A lot of games (games with a lot of slowdown) have this programming style where the programmer pretends that a couple memory locations are 68000 registers or high-level local variables, and the accumulator is only there as an operand buffer. Please avoid this style of programming. It is

Jay's ASM Tutorial

Introduction

This is a tutorial on 65816 ASM used in the SNES, made easy for dumb people to understand (sorta). In case you are wondering, I don't program in this language, so it is possible that I will write something incorrectly in this tutorial. If so, you can e-mail me at tennj@yahoo.com, to complain about how I suck at tutorials. Learning ASM language isn't easy. If ...

SA-1

The SA-1 is a coprocessor capable of running at four times the base speed of the SNES main CPU when access does not conflict with that of SNES CPU, DMA or HDMA processing. It provides additional shared RAM, visible to both the SNES CPU and the SA-1, and optionally backed up by battery referred to as BW-RAM with a maximum install RAM size of 256 KB (2 Mbit).

SPC7110

SPC7110 Decompression Chip

Satellaview AV selector

Satellaview AV Selector

The satellaview AV selector was conceived in order to prepare the decoded satellite signal for the satellaview, prevent the super famicom from monopolizing the TV's AV input, and allow for the use of a second BS decoder along with the one provided by ST. Giga. As is evident in the following diagram, the selector's internal circuit can be divided in three discrete units, ...

Satellaview Soundlink

Soundlink, also known as "Live Voice" and various other aliases, is a Satellaview function in which Streaming Satellite Radio from St.GIGA is played at the same time as software data is broadcast, downloaded and played. This is intended to give the illusion of a game being played with high-quality audio. This was a selling feature of the Satellaview and was used in a lot of it's software.

Soun ...

Sprites

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

Star Ocean

Star Ocean data offsets, values, and technical information.

Stunt Race FX

Stunt Race FX / Wild Trax

The following information is for the US version of the game.

Track Data

Locations

Offset Description
1F4A5 - 1F4F8 Track Data pointers (3 bytes per track, 28 tracks)
28000 Menu "Track" Data
28074 00- ...

Super Wild Card

Hardware Specification to SWC & SMC Programmer Only

  1. DRAM - 28 Mega Bits Maximum Available.
  2. SRAM - 256K Bits. (Battery Backup)
  3. ROM - 128K Bits. (Firmware)
  4. Floppy Drive Interface
  • Motorola MCS3201 Chip. (NEC 765a Compatible)
  • Compatible With IBM PC/at and XT Disk Drive System.
  • Supports 3.5" or 5.25" Floppy Disk Drive.
  • Db-25 Female Connector. (Non-Standar ...

Testing Code

Once you've programmed a game or other bit of data for SNES, you'll probably want to try to, well, test it.

Methods

Although for most software these choices are, mostly, about preference. Most games which require Expansion Chips other than the DSP-1 may require less than favorable methods of testing (either emulation or reproduction cartridge).

Emulators

...

Timing

This is a document intended to describe various aspects of SNES timing. It will probably not be useful unless you already know a good bit about the SNES.

Widespread Myths

Widespread Programming Myths, These are myths that frequently show up that mislead people into writing bad code based on false perception of what the system actually does.

Windows

The windows can be used to mask off a portion of any BG on the scanline.