A Link to the Past

Data Spoofing

Data spoofing is a common transition corruption effect that writes data from one supertile to another.

Layman explanation

Data for rooms is stored in memory as flags that are either on or off. Whenever the room ID changes, this data is written to save RAM. Under normal conditions, data for the next room is then loaded from save RAM and overwrites the old data from the previous room. With certain transition corruptions, the save is performed, but the load is not because it was interrupted by the transition not happening. When this occurs, the old room data is still there but with the current room ID pointing to the new room. Thus, when the room ID is changed again from any sort of transition or glitch, it will write the original room's data into save RAM.

Mechanics

This section goes into very technical detail. The information is presented with the assumption that the reader has at least basic knowledge of hexadecimal, bitwise operations, SNES memory, and/or SNES assembly.

Conflict

The main conflict arises when a transition corruption triggers the game mode change for supertile transitions. The important information to know is two-part:

  1. These game mode changes are done via incrementation
  2. The data loading routine is done immediately, from within the default submodule.

The first problem explains why we are able to perform many transition corruptions in the first place. The second problem explains why data spoofing happens when it does. Let's look at a couple of quick examples:

Example 1: YBAs

Using a red YBA on a subtile door, the game mode is corrupted to $0E / $05. Using it on a supertile door, it's corrupted to $0E / $06. The subtile YBA only corrupted the red potion game mode with a subtile transition; ditto for the supertile YBA. Only the supertile YBA will result in a data spoof.

Example 2: STCs

When we perform an STC on a subtile door, the game mode is corrupted to $07 / $03. This is by having the game run the subtile transition set up (+1) followed by the supertile transition set up (+2). When performing an STC on a supertile door, the same game mode happens but from a different order. In those cases, the supertile runs first (+1), then the subtile (+1). In both cases, the same corrupted game mode happens. A supertile setup was touched in both cases, so both STCs will result in data spoofs.

Organization of data

Room flags are stored as bit fields in 3 main addresses in work RAM. When a new room is loaded, these values are transferred to SRAM, creating a new bit field. The base SRAM address is $7EF000 and it's written to with an index determined by multiplying the room ID by 2.

Address $0401 (door flags)

BitNameDescriptionValue (as power of 2)Value in Hexadecimal
7D0Door 0 opened270x80
6D1Door 1 opened260x40
5D2Door 2 opened250x20
4D3Door 3 opened240x10
3uUnused230x08
2uUnused220x04
1uUnused210x02
0uUnused200x01

Address $0403 (item flags)

BitNameDescriptionValue (as power of 2)Value in Hexadecimal
7HHeart container obtained/Boss killed270x80
6KKey obtained260x40
5cUnused 6th chest or 2nd key250x20
4C5Chest 5 opened; Rupee tiles grabbed240x10
3C4Chest 4 opened230x08
2C3Chest 3 opened220x04
1C2Chest 2 opened210x02
0C1Chest 1 opened200x01

Address $0408 (quadrant flags)

BitNameDescriptionValue (as power of 2)Value in Hexadecimal
7uUnused270x80
6uUnused260x40
5uUnused250x20
4uUnused240x10
3Q4Northwest quadrant visited230x08
2Q3Northeast quadrant visited220x04
1Q2Southwest quadrant visited210x02
0Q1Southeast quadrant visited200x01

Address $7EF000,X (SRAM address)

BitNameDescriptionValue (as power of 2)Value in Hexadecimal
15D0Door 0 opened2150x8000
14D1Door 1 opened2140x4000
13D2Door 2 opened2130x2000
12D3Door 3 opened2120x1000
11HHeart container obtained/Boss killed2110x0800
10KKey obtained2100x0400
9cUnused 6th chest or 2nd key290x0200
8C5Chest 5 opened; Rupee tiles grabbed280x0100
7C4Chest 4 opened270x0080
6C3Chest 3 opened260x0040
5C2Chest 2 opened250x0020
4C1Chest 1 opened240x0010
3Q4Northwest quadrant visited230x0008
2Q3Northeast quadrant visited220x0004
1Q2Southwest quadrant visited210x0002
0Q1Southeast quadrant visited200x0001

Unique uses

Several rooms use the room flags slightly differently:

IDRoomBitFunction
0x37Hammer peg lever (in Swamp)C4Reuses chest 4 as a flag for whether the room has been flooded
0x35Crystal switch lever (in Swamp)C4Reuses chest 4 as a flag for whether the room has been flooded
0x66Final swamp leverC4Reuses chest 4 as a flag for whether the room has been flooded
0x65Thieves' Town atticC5Reuses chest 5 as a flag for whether or not the attic floor has been bombed
0x1BEye statue room (in PoD)C4Reuses chest 4 as a flag for whether or not the wall has been moved
0x43Desert Palace torches roomC4Reuses chest 4 as a flag for whether or not the wall has been moved
0x97Misery Mire torches roomC5Reuses chest 5 as a flag for whether or not the wall has been moved

Dungeon prizes

Crystals and pendants don't set any bit in room data when collected, but they do specifically check for the key bit before they spawn. This is likely vestigial behavior from an earlier point in development, but the consequence of it is that spoofing a collected key into a boss room will prevent its prize from being dropped.

Last updated September 25, 2026 by joshRTA