Updated
level data format with the v3.00 changes (will do overworld later). Quick rundown of what's different:
Secondary Level Header
Gained two new bytes, located in two tables at $06FC00 and $06FE00 respectively, bringing the total up to 7 bytes. Byte 5 also got modified a bit. The new format is as follows:
Code$05F000 $05F200 $05F400 $05F600 $05DE00 $06FC00 $06FE00
2222yyyy 33AAAxxx MMMMffbb NUVEEEEE IWPXXsSS OFYYYYYY RL-HHHHH
2222 Layer 2 scroll setting
(YYYYYY)yyyy Main entrance Y position2
33 Layer 3 setting
AAA Main entrance Mario action
(XX)xxx Main entrance X position2
MMMM Midway entrance screen number
ff Main entrance FG initial position, if R bit is clear
bb Main entrance BG initial position, if R bit is clear
Fffbb Main entrance FG/BG offset, if R bit is set
N Disable No-Yoshi Intro flag
U Unknown/unused vertical position flag
V Vertical positioning flag
EEEEE Main entrance screen number
I Slippery flag
W Water flag
P Flag to use X/Y position method 2
s Smart spawn flag
SS Sprite spawn range
O Set BG relative to FG
R Set main entrance FG/BG setting relative to player
L Face main entrance left
HHHHH BG height (-), or relative BG offset if O bit is set (absolute 0 = 0x0)
Noteably, the X and Y position values no longer switch in vertical levels the way they used to.
Furthermore, there's an additional eighth table at a dynamic location you can find with read3(read3($05D9A2)+70), and is used for the extended level format data.
CodeTB0MMMMM
T Indicates the level uses either Layer 2 or Layer 3
B Flag to show the bottom row of the level
0 SHOULD NOT BE SET. Currently reserved for bit 5 of the sprite header once in RAM.
MMMMM Horizontal level mode
Midway Entrances
Gained a fourth table, and both byte 1 and 3 got modified a bit. All four bytes are still in order at
read3(read3($05D9E4)+$0A)
. The new format is as follows:
CodeTable 1 Table 2 Table 3 Table 4
IWIMXAAA yyyyxxxx RLE-ffbb -FYYYYYY
I Slippery flag
W Water flag
I Flag to use seperate midway entrance (all bits except M are ignored otherwise)
M Bit 5 of midway screen number
YYYYYYyyyy Midway entrance Y position
AAA Midway entrance Mario action
Xxxxx Midway entrance X position
MMMM Midway entrance screen number
R Set main entrance FG/BG setting relative to player1
ff Midway FG initial position, if R bit is clear
bb Midway BG initial position, if R bit is clear
Fffbb Main entrance FG/BG offset, if R bit is set
L Face entrance left
E Redirect midway entrance to other level
As with the primary entrances, the X/Y positions are no longer swapped in vertical levels.
If the "E" bit is set, table 2 instead serves as bits 0-7 of the destination, and bit 0 of table 3 serves as bit 8.
Secondary Entrances
Similar to the primary and midway entrances, secondary entrances have received two new bytes. However, they are not in a fixed location, and can only be found at
read3($05DC86)
and
read3($05DC8B)
respectively. Byte 4 was also slightly modified.
Code$05F800 $05FA00 $05FC00 $05FE00 read3($05DC86) read3($05DC8B)
dddddddd bbffyyyy xxxSSSSS IPXXDAAA EFYYYYYY RLW-----
Ddddddddd Destination level
bb BG initial position, if R bit is clear
ff FG initial position, if R bit is clear
Fbbff Main entrance FG/BG offset, if R bit is set
(YYYYYY)yyyy Entrance Y position
(XX)xxx Entrance X position
SSSSS Entrance screen number
I Slippery level flag
P Uses X/Y position method 2
AAA Mario entrance action.
E "Exit to Overworld" flag; see below.
R Set main entrance FG/BG setting relative to player
L Face entrance left
W Water level flag
As with the main/midway entrances, the X and Y position no longer swap in vertical levels.
If the "E" bit (exit to overworld) is set, then a different format is used:
Code$05F800 $05FA00 $05FC00 $05FE00 read3($05DC86) read3($05DC8B)
dddddddd LLLLLLLL BBBBBBBB --ETDAAA 1------- --------
Ddddddddd Destination level. Unused, but still modified by LM.
LLLLLLLL Location index to use, if T bit is set
BBBBBBBB Base event to use, if E bit is is set
E "Use a different base event" flag
T "Teleport to location index" flag
AAA Overworld entrance action.
Object Data
Not much is actually new here. The only change is to the screen jump object, to account for vertical jumping:
Code000HHHHH 0000VVVV 00000001
HHHHH Horizontal screen number (or just screen number in vertical levels)
VVVV Vertical subscreen number, divided by 2
Additionally, as the new VVVV bits are not enough to reach screens 10-1F in horizontal mode 1C, an alternative screen jump object is added as extended object 03. This new object is identical to the original, except the H and V bits are swapped.
Sprite Data
The sprite header has changed slightly to repurpose bit 5:
CodeSBNMMMMM
S Sprite buoyancy
B Sprite buoyancy (disable sprite-Layer 2 interaction)
N New sprite system flag
MMMMM Sprite memory
If this new "N" flag is set, then the actual sprite data receives some fairly significant changes. First, FF is no longer used to terminate the data; instead, FF indicates a command value. The byte following it then specifies which command to use. Currently, the following command values are valid:
Code00-7F Sets the upper 7 bits of the Y position for all proceeding sprites to this value.
FE End of data.
FF Normal sprite for which the first byte is FF (this value acts as that byte).
For example, "FF FE" is now the terminator for sprite data.
Professional frame-by-frame time wizard.
YouTube -
Twitter -
SMW Glitch List -
SMW Randomizer