Language…
22 users online:  AmperSam,  Anorakun, apache, caioskii, Dennsen86, Ekimnoid, GRIMMKIN, Heitor Porfirio, JudithPrietht, krizeth, LightAligns, mario90, mtheordinarygamer, Rykon-V73, Sweetdude,  Tahixham,  Teyla, The_Uber_Camper,  Thomas, VSmario90, Yuvi, Zandro - Guests: 289 - Bots: 357
Users: 64,795 (2,373 active)
Latest user: mathew

Updated Level and Overworld Data Format

  • Pages:
  • 1
  • 2


Updated the overworld data format with information on LM's new overworld level expansion (ctrl+alt+shift+F8). Overall, not a lot changes as far as I can tell; only the following tables were moved around a bit:
Code
$03BE80 -> read3($03BBD9)    ; 16-bit message box indices are now direct 24-bit pointers.
                             ;  The table at read3($03BC0B) is scrapped.
$05DDA0 -> $03BE80           ; Initial level flags (for $1EA2). Expanded for new levels.
$04E359 -> read3($04E471)    ; Indices to event data. Expanded for new events.

Not sure if anything else was moved, that's all I could find (and think of).

Additionally, it's worth noting that LM also changes number of levels/events whenver they're referenced (e.g. $04D858). However, it does not move $1EA2 or similar tables to account for the additional levels, so those would have to be manually done. (which may be somewhat annoying with LM's hijacks involving $1EA2)
The other tables that would need to be moved would be at least $1F02, $1F2F, $1F3C, and $1FEE.

Professional frame-by-frame time wizard. YouTube - Twitter - SMW Glitch List - SMW Randomizer


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.
Code
TB0MMMMM

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:
Code
Table 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:
Code
000HHHHH    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:
Code
SBNMMMMM

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:
Code
00-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
  • Pages:
  • 1
  • 2