List of Header BlocksViewing diff between revisions 13 (previous) and 14 (current)(revisions: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ) http://nsmbhd.net/thread/2762-different-area-overflows-which-are-bugs/ [i]look through:[/i] nsmbe github? old jul threads? https://web.archive.org/web/20230330074105/http://treeki.rustedlogic.net/ https://github.com/MammaMiaTeam/NSMB-Code-Reference/tree/master/include/nsmb/game/stage/layout/data https://github.com/RoadrunnerWMC/nsmbpy (may .hds th h2 { margin: 0.5em; display: inline-block!important; } .hds td:first-child { width: 20%!important; } .hds th { text-align: left!important; white-space: nowrap!important; } .cell_end { width: 1.4em; } </style> <div class="hds"> <table class="outline margin"><tbody> <tr class="header0"><th colspan="3"> <h2>Block 1 - Level header (General settings)</h2> </th></tr> <tr class="cell0"><td>32 bytes</td><td colspan="2">01 02 03 ?? 05/06 07/08 FF FF FF FF 13/14 ?? ?? FF FF 19/20 FF FF FF FF ?? ?? 27/28 29/30 ?? ??</td> <tr class="cell1"><td colspan="3"></td></tr> <tr class="cell0"><td>Byte 1</td><td>Start entrance ID</td><td class="cell_end"></td></tr> <tr class="cell1"><td>Byte 2</td><td>Midway entrance ID</td><td class="cell_end"></td></tr> <tr class="cell0"><td>Byte 3</td><td>Misc parameters: <ul><li>Nybble 1: 0: None 2: Level wrap </li><li>Nybble 2: 0: None 1: Start level as Mini Mario 2: Floaty Physics 3: Both of the above </li> </ul></td><td class="cell_end"></td></tr> <tr class="cell1"><td>Bytes 5-6</td><td> Time limit: <sup>(reverse the bytes before converting to decimal)</sup> <ul><li>Expected range: 0 to 999 (E7 03)</li> <li>Glitchy values: 1000 (E8 03) to 65535 (FF FF) <li>Values of 1000 and above will work in-game, however the timer can only display up to 999, (thereby making the timer look frozen until 998 is reached). Beware, using these will prevent NSMBe from opening the level</li> <li>High values can be ed_it has something? <li>However, setting the timer too high will result in a long wait for it to tick down upon clearing a level via the flag pole (unless you break the goal flag as Mega Mario, which skips the timer delay)</li> </li> </ul></td><td class="cell_end"></td></tr> <tr class="cell0"><td>Bytes 7-8</td><td>Bottom BG ID <sup>(The BG slot "255 - None" in NSMBe sets both bytes to FF)</sup> </td><td class="cell_end"></td></tr> <tr class="cell1"><td>Byte 9</td><td>Unknown, 0xFF <sup><i>(Set to 0x03 in Unused level 3)</i></sup> </td><td class="cell_end"></td></tr> <tr class="cell0"><td>Bytes 13-14</td><td>Tileset ID <sup>(Set both to FF to make tileset 1 Disappear. Not compatible with NSMBe level editor)</sup> </td><td class="cell_end"></td></tr> <tr class="cell1"><td>Bytes 19-20</td><td>Top BG ID <sup>(The BG slot "255 - None" in NSMBe sets both to FF)</sup> </td><td class="cell_end"></td></tr> <tr class="cell0"><td>Bytes 27-28</td><td>Sound Set</td><td class="cell_end"></td></tr> <tr class="cell1"><td>Bytes 29-30</td><td>Sprite draw settings: <ul>Offset in RAM: 0235FE74 (US), 02357A64 (EU) - <i>This variable can be changed at runtime with immediate effect</i> Block 1 defines some settings general Some sprites ignore effects (e.g. Event Trigger block) and so does the Second byte: midway entrance Third byte: many things. To have more than one add their values. (in hex) * Level wrap: 20 * Mini Mario Physics: 02 * Start Together, the two bytes form an index into small lookup tables. The first byte picks the table family; the second byte picks a variant inside that family. Some indices are valid, some point to junk. Effects aren't orthogonal. For example, "Transparent or "NoTransform" may only exist as Note: The first nybble of each byte repeats in a predictable pattern, the second byte is haphazard Note2: Setting the second byte to 07 significantly stabilizes the results</li></i></sup> <sup>Sprite list: (items, goomba, koopa, paragoomba, paratroopa, event trigger block, arrows, etc //TODO: complete)</sup> 7th byte: background graphics 13th byte: tileset graphics 19th byte: foreground graphics <ul> <li>Front (default): displays in front of everything else</li> <li>Behind3D (-1 layer): displays behind 3D objects</li> <li>BehindTiles (-2 layer): displays behind tiles</li> <li>BehindTopBG (-3 layer): displays behind top background</li> <li><span style="opacity: 0.5;">BehindBottomBG (-4 layer): <i>{setting does not appear to exist}</i></span></li> </li></ul> These block has diferent lengs <ul> <li>None: No effect, default</li> <li>FlipY: Sprites are flipped on the Y axis according to the point of origin/anchor point, which is typically either at the bottom or center of the sprite</li> <li>NoFlipX: Sprites cannot flip on the X axis. Affected enemies will "moonwalk" to the right</li> <li>NoTransform: Disables non-reflective transforms. Sprites cannot squish/stretch or rotate. Items will hover weirdly and enemies cannot spin while in <li>Transparent: Sprites are semi-opaque (~70% transparency)</li> <li>Invisible/Corrupt (WhileNoAffine): Sprites display as invisible or corrupted, but only <li>Invisible/Corrupt (constant): (Might be the </ul></ul> Some values: [trh][td][td][td][td][td]<small>Layers</small>[td] [tr][td]<div style="text-align: center;"><small><small><b>Effects</b></small></small></div>[td][td]Front[td]Behind3D[td]BehindTiles[td]BehindTopBG [tr][td]No effect[td][td]00 00[td]11 07[td]3F 07[td]15 07 [tr][td]Transparent[td][td]01 07[td]07 07[td]4D 07[td]29 07 [tr][td]NoTransform[td][td]14 07[td]12 07[td]40 07[td]16 07 [tr][td]Transparent, NoTransform[td][td]02 07[td]06 07[td]4E 07[td]2A 07 [/table] [trh][td][td][td][td][td]Mirroring[td][td][td] [tr][td]NoFlipX[td]05 30[td]|[td]FlipY[td]20 30[td]|[td]FlipY, NoFlipX[td]B0 30 [tr][td]NoFlipX, Transparent[td]E0 00[td]|[td]FlipY, Transparent[td]02 30[td]|[td]FlipY, NoFlipX, Transparent[td]0A 01 [tr][td]NoFlipX, NoTransform[td]70 00[td]|[td]FlipY, NoTransform[td]04 00[td]|[td]FlipY, NoFlipX, NoTransform[td]A0 00 [tr][td]NoFlipX, Transparent, NoTransform[td]03 01[td][td][td][td][td][td] [/table] [trh][td][td]Dysfunctional [tr][td]Invisible/Corrupt (WhileNoAffine)[td]1B 07 [tr][td]Invisible/Corrupt (constant)[td]1C 07 [/table] </td><td class="cell_end"></td></tr> </tbody></table> Third byte: background tile layout Fifth byte: background palette <tr class="header0"><th colspan="3"> <h2>Block 2 - Camera (view parameters)</h2> </th></tr> <tr class="cell0"><td>24 bytes (per view)</td><td colspan="2">01/02/03/04 05/06/07/08 09/10/11/12 13/14/15/16 ?? ?? 19 20 ?? ?? ?? ??</td></tr> <tr class="cell1"><td colspan="3"></td></tr> <tr class="cell0"><td>Bytes 1-4</td><td>Camera top offset</td><td class="cell_end"></td></tr> <tr class="cell1"><td>Bytes 5-8</td><td>Camera bottom offset</td><td class="cell_end"></td></tr> <tr class="cell0"><td>Bytes 9-12</td><td>Camera top offset "special"</td><td class="cell_end"></td></tr> <tr class="cell1"><td>Bytes 13-16</td><td>Camera bottom offset "special"</td><td class="cell_end"></td></tr> <tr class="cell0"><td>Byte 19</td><td>Vertical scroll (toggle) - 0x00 disabled, 0x0F enabled</td><td class="cell_end"></td></tr> <tr class="cell1"><td>Byte 20</td><td><span style="opacity: 0.5;"><sup>Unknown. Lower byte of B19? Camera shenanigans can turn the level invisible if paired with Byte19 0x0F </sup></span></td><td class="cell_end"></td></tr> <tr class="cell0"><td>Note on 4-bytes settings</td><td> The maximum range is split in two in order to <sup> Max: 2147483647 (FF FF FF 7F) Min: -2147483648 (00 00 00 80) </sup></td><td class="cell_end"></td></tr> </tbody></table> <tr class="header0"><th colspan="3"> <h2>Block 3 - Bottom Background</h2> </th></tr> <tr class="header0"><th colspan="3"> <h2>Block 4 - Tileset</h2> </th></tr> <tr class="header0"><th colspan="3"> <h2>Block 5 - Top Background</h2> </th></tr> <tr class="cell0"><td>20 bytes</td><td colspan="2"></td></tr> <tr class="cell1"><td colspan="3"></td></tr> <tr class="cell0"><td>Bytes 3-4</td> <td> Tilemap ID (NSC) <sup><i>-carries with it the jyotyu palette type, e.g. 3 -> underground palette -carries with it the presence/absence of parallax scrolling</i></sup> </td><td class="cell_end"></td></tr> <tr class="cell1"><td>Bytes 5-6</td><td>Palette ID (NCL)</td><td class="cell_end"></td></tr> <tr class="cell0"><td>Bytes 11 and 13 (BG)</td><td>Horizontal and Vertical scrolling settings [b]Go to specific world map point (Unused)[/b] Replace Every entrance (not warps) with destination Allegedly, warps cannot be made to work with this, but Hiccup got it to work. Nag him to try it out again. This is not a glitch, Beware, any value above 0x5 freezes the <ul>0x0, 0x2, 0x3: Starts from bottom of view offset by 32px 0x1: Starts from top of view offset by 32px 0x4: Starts from bottom of view offset by 32px 0x5: Starts from top of view offset by 32px 0x4: Loops the top half 0x5: Loops the bottom half </ul> Nybble 2 sets the speed at which the BG scrolls relative to Can be used to sync up background and <ul> 0x6: 6.25% FG speed 0x7: 9.375% FG speed 0x3: 12.5% FG speed 0x8: 20.3125% FG speed 0x2: 25% FG speed 0x1: 50% FG speed 0x5: 75% FG speed 0x0, 0x9-0xC: Synced with FG speed 0x4: 120% FG speed (Unused) 0xD: 200% FG speed (Unused) 0xE: 400% FG speed (Unused) 0xF: 800% FG speed (Unused) </ul></sup></td><td class="cell_end"></td></tr> <tr class="cell1"><td><span style="opacity: 0.5;"><sup>Byte 12</sup></span></td><td> <span style="opacity: 0.5;"><sup>Unknown. Does not seem to pair with or interfere with byte 11</sup></span> </td><td class="cell_end"></td></tr> <tr class="cell0"><td><span style="opacity: 0.5;"><sup>Byte 14</sup></span></td><td> <span style="opacity: 0.5;"><sup>Unknown. Some values make the background disappear (0x02), some freeze the game (0x01), and some cause a crash (0xFF)</sup></span> </td><td class="cell_end"></td></tr> <tr class="cell1"><td><sup>Byte 16</sup></td><td> <sup>Unknown <i>Set to 0x10 to override the parallax scrolling of backgrounds (that have parallax scrolling applied to only a select few rows) to instead scroll the entire background</i></sup> <sup><i>Set byte 13 to 0x40 and byte 16 to 0x10 simultaneously in order to disable vertical scrolling instead</i></sup> </td><td class="cell_end"></td></tr> </tbody></table> <table class="outline margin"><tbody> <tr class="cell1"><td> [url]https://bookstack.nsmbcentral.net/books/new-super-mario-bros/page/background-scrolling-data-info[/url] [url]https://nsmbhd.net/thread/1583-reverse-engineering-level-header-bg-and-tileset-datablocks/[/url] [url]https://nsmbhd.net/thread/539-loading-backgrounds-from-view/[/url] [url]https://nsmbhd.net/thread/991-multibackground-experiments/[/url] [url]https://nsmbhd.net/thread/3157-multibg-ii-the-return/[/url] [url]https://nsmbhd.net/thread/6228-beta-multibg-take-three/[/url] </td></tr> </tbody></table> <tr class="header0"><th colspan="3"> <h2>Block 6 - Entrances</h2></td></tr> </th></tr> <tr class="cell0"><td>20 bytes (per entrance)</td><td colspan="2">01/02 03/04 05/06 07/08 09 10 11 12 13 ?? 15 16 ?? ?? 19 20</td></tr> <tr class="cell1"><td colspan="3"></td></tr> <tr class="cell0"><td>Bytes 1-2</td><td>X position</td><td class="cell_end"></td></tr> <tr class="cell1"><td>Bytes 3-4</td><td>Y position</td><td class="cell_end"></td></tr> <tr class="cell0"><td>Bytes 5-6</td><td>Camera X</td><td class="cell_end"></td></tr> <tr class="cell1"><td>Bytes 7-8</td><td>Camera Y</td><td class="cell_end"></td></tr> <tr class="cell0"><td>Byte 9</td><td>Entrance ID</td><td class="cell_end"></td></tr> <tr class="cell1"><td>Byte 10</td><td>Destination Area</td><td class="cell_end"></td></tr> <tr class="cell0"><td>Byte 11</td><td>Connected Pipe ID / Destination Level</td><td class="cell_end"></td></tr> <tr class="cell1"><td>Byte 12</td><td>Destination World</td><td class="cell_end"></td></tr> <tr class="cell0"><td>Byte 13</td><td>Destination Entrance</td><td class="cell_end"></td></tr> <tr class="cell1"><td>Byte 15</td><td>Entrance type</td><td class="cell_end"></td></tr> <tr class="cell0"><td>Byte 16</td><td>Misc settings: <ul><i> <li>Bit 0: Bottom screen</li> <li>Bit 3: Connected pipe</li> <li>Bit 4: Fading screen transition</li> <li>Bit 7: Exit only</li> </i></ul></td><td class="cell_end"></td></tr> <tr class="cell1"><td>Byte 19<td>View ID (exit) <sup><i>Note this parameter applies to the <b>origin</b> entrance, rather than the destination one</i></sup> </td><td class="cell_end"></td></tr> <tr class="cell0"><td>Byte 20<td> Go to World Map (toggle) <ul>0xFF ON, 0x00 OFF (apply to the DESTINATION entrance) <sup>[i]Relevant code can be seen at [url=http://tcrf.net/Notes:New_Super_Mario_Bros.]TCRF.net/Notes:New Super Mario Bros.[/url][/i]</sup> </ul></td><td class="cell_end"></td></tr> </tbody></table> <table class="outline margin"><tbody> <tr class="cell1"><td> [url]https://nsmbhd.net/thread/2762-different-area-overflows/[/url] [url]https://nsmbhd.net/thread/2517-going-to-any-level-from-any-world/[/url] [url]https://nsmbhd.net/thread/1823-going-to-any-level-of-current-world/[/url] </td></tr> </tbody></table> Block 8 controls Views. <tr class="header0"><th colspan="3"> <h2>Block 7 - Sprites/StageObjects</h2> </th></tr> <tr class="cell0"><td> 12 bytes (per sprite) <i><span style="opacity: 0.5;">+ 4 bytes (end bytes)</span></i> </td><td colspan="2">01/02 03/04 05/06 07 08 09 10 11 12 <span style="opacity: 0.5;">FF FF FF FF</span></td></tr> <tr class="cell1"><td colspan="3"></td></tr> <tr class="cell0"><td>Byte 1-2</td><td>Sprite/Stage Actor ID</td><td class="cell_end"></td></tr> <tr class="cell1"><td>Bytes 3-4</td><td>X position</td><td class="cell_end"></td></tr> <tr class="cell0"><td>Bytes 5-6</td><td>Y position</td><td class="cell_end"></td></tr> <tr class="cell1"><td>Bytes 07-12</td><td>Sprite data (ordered BB AA FF EE DD CC)</td><td class="cell_end"></td></tr> <tr class="cell0"><td>End bytes</td><td>"FF FF FF FF" is <ul><i> None / FF: Crashes FF FF / FF FF FF FF: Works as intended FF FF FF: Glitchy camera behavior </i></ul></td><td class="cell_end"></td></tr> </tbody></table> II: The ID of the View. CC: The reference to the camera settings in Block 2 M: Music. It is a value from [[Music list]] A, B, U: Unknown values LL: 3D lighting FF: Flagpole Tracker ID from Block <tr class="header0"><th colspan="3"> <h2>Block 8 - Views</h2> </th></tr> <tr class="cell0"><td>16 bytes (per view)<td colspan="2">01/02 03/04 05/06 07/08 09 10 11 12 13 14 15 16 <tr class="cell1"><td colspan="3"></td></tr> <tr class="cell0"><td>Bytes 1-2<td>X position</td><td class="cell_end"></td></tr> <tr class="cell1"><td>Bytes 3-4<td>Y position</td><td class="cell_end"></td></tr> <tr class="cell0"><td>Bytes 5-6<td>Width</td><td class="cell_end"></td></tr> <tr class="cell1"><td>Bytes 7-8<td>Height</td><td class="cell_end"></td></tr> <tr class="cell0"><td>Byte 9<td>View ID</td><td class="cell_end"></td></tr> <tr class="cell1"><td>Byte 10<td>Camera ID</td><td class="cell_end"></td></tr> <tr class="cell0"><td>Byte 11<td>Music ID</td><td class="cell_end"></td></tr> <tr class="cell1"><td><span style="opacity: 0.5;">Bytes 12, 13, 14</span></td><td><span style="opacity: 0.5;">Unknown</span> <sup><i>Presumably background/tileset IDs for a defunct 'per-view' asset switching feature [url=https://nsmbhd.net/thread/1583-reverse-engineering-level-header-bg-and-tileset-datablocks/](source)[/url]</i></sup> </td><td class="cell_end"></td></tr> <tr class="cell0"><td>Byte 15<td>3D lighting</td><td class="cell_end"></td></tr> <tr class="cell1"><td>Byte 16<td>Progress Path ID</td><td class="cell_end"></td></tr> </tbody></table> This block specifies zones where certain sprites can operate. It is made of 12-byte rows lwith this format. <tr class="header0"><th colspan="3"> <h2>Block 9 - Zones</h2> </th></tr> <tr class="cell0"><td>12 bytes (per zone)</td><td colspan="2">01 02 03 04 05 06 07 08 09 ?? ?? ??</td></tr> <tr class="cell1"><td colspan="3"></td></tr> <tr class="cell0"><td>Bytes 1-2</td><td>X position</td><td class="cell_end"></td></tr> <tr class="cell1"><td>Bytes 3-4</td><td>Y position</td><td class="cell_end"></td></tr> <tr class="cell0"><td>Bytes 5-6</td><td>Width</td><td class="cell_end"></td></tr> <tr class="cell1"><td>Bytes 7-8</td><td>Height</td><td class="cell_end"></td></tr> <tr class="cell0"><td>Byte 9</td><td>Zone ID</td><td class="cell_end"></td></tr> </tbody></table> II is the ID for the zone, that is later referenced from the sprites. <tr class="header0"><th colspan="3"> <h2>Block 10 - Progress paths</h2> </th></tr> <tr class="header0"><th colspan="3"> <h2>Block 11 - Paths</h2> </th></tr> <tr class="cell0"><td>8 bytes (per path)</td><td colspan="2">01/02 03/04 05/06 ?? ??</td></tr> <tr class="cell1"><td colspan="3"></td></tr> <tr class="cell0"><td>Bytes 1-2</td><td>Path ID</td><td class="cell_end"></td></tr> <tr class="cell1"><td>Bytes 3-4</td><td>Nth path in level (starts from 0)</td><td class="cell_end"></td></tr> <tr class="cell0"><td>Bytes 5-6</td><td>Total number of nodes</td><td class="cell_end"></td></tr> </tbody></table> <tr class="header0"><th colspan="3"> <h2>Block 12 - Progress paths nodes</h2> </th></tr> <tr class="header0"><th colspan="3"> <h2>Block 13 - Paths nodes</h2> </th></tr> <tr class="cell0"><td>16 bytes (per node)<td colspan="2">01/02 03/04 05/06 07/08 09/10 11/12 13/14 15/16</td></tr> <tr class="cell1"><td colspan="3"></td></tr> <tr class="cell0"><td>Bytes 1-2</td><td>X position</td><td class="cell_end"></td></tr> <tr class="cell1"><td>Bytes 3-4</td><td>Y position</td><td class="cell_end"></td></tr> <tr class="cell0"><td>Bytes 5-6</td><td>Node setting 1</td><td class="cell_end"></td></tr> <tr class="cell1"><td>Bytes 7-8</td><td>Node setting 2</td><td class="cell_end"></td></tr> <tr class="cell0"><td>Bytes 9-10</td><td>Node setting 3</td><td class="cell_end"></td></tr> <tr class="cell1"><td>Bytes 11-12</td><td>Node setting 4</td><td class="cell_end"></td></tr> <tr class="cell0"><td>Bytes 13-14</td><td>Node setting 5</td><td class="cell_end"></td></tr> <tr class="cell1"><td>Bytes 15-16</td><td>Node setting 6</td><td class="cell_end"></td></tr> </tbody></table> Hold Shift to lock dragging to a grid. Hold Control to add another square. Hold Alt to remove a square. (Use this for edits, use "Delete Path" to remove entire progress path.) <tr class="header0"><th colspan="3"> <h2>Block 14 - Sprite sets/Object Banks</h2> </th></tr> <tr class="cell1"><td>16 bytes</td><td>01 02 03 04 05 06 07 08 09 10 ?? ?? ?? ?? ?? 16</td><td class="cell_end"></td></tr> </tbody></table> <h1>Movement Paths [no documentation]</h1> <h1>Progress Path Nodes [no documentation]</h1> <h1>Movement Path Nodes [no documentation]</h1> <h1>Sprite Sets [no documentation]</h1> |