Background Scrolling Data Info
TODO:
- Verify info for BG start position nybble — 0x2 and 0x3 in particular.
- How specifically do "Disable vertical scrolling" and "Automatic horizontal scrolling" work? What all do bytes 13 and 16 do?
- Might be nice to list which BG speeds and such are all used.
Foregrounds and backgrounds scroll differently in many levels — sometimes they have a fast speed ratio and sometimes they can be completely static. This can be adjusted by hex editing your level.
- Top background --> Change block 3.
- Bottom background --> Change block 5.
- Byte 11: Control BG horizontal scrolling.
- Byte 13: Control BG vertical scrolling.
And for each byte:
- First Nybble: Controls where the background starts relative to the view and how it loops. This seemingly does nothing for horizontal looping or start position.
- Second Nybble: Controls scroll speed relative to stage foreground speed.
(Image source: MarioSunshine)
Start position and loop data
- 0x0: Starts from bottom of view offset by 32px; loops entire background.
- 0x1: Starts from top of view offset by 32px; loops entire background.
- 0x2: Duplicate of 0x0?
- 0x3: Duplicate of 0x1?
- 0x4: Starts from bottom of view offset by 32px; loops top half of background.
- 0x5: Starts from top of view offset by 32px; loops bottom half of background.
Any value higher than 0x5 freezes the game.
Scroll speed data
Table address in overlay 0: 0x0002F468
Table address in memory: 0x020C7B48
- 0x0: Same as FG speed. Used in w2-3 (sewer level) for example.
- 0x1: 50% FG speed.
- 0x2: 25% FG speed. Common for top backgrounds.
- 0x3: 12.5% FG speed. Common for bottom backgrounds.
- 0x4: 120% FG speed. Unused.
- 0x5: 75% FG speed.
- 0x6: 6.25% FG speed.
- 0x7: 9.375% FG speed.
- 0x8: 20.3125% FG speed.
- 0x9: Same as FG speed.
- 0xA: Same as FG speed.
- 0xB: Same as FG speed.
- 0xC: Same as FG speed.
- 0xD: 200% FG speed. Unused.
- 0xE: 400% FG speed. Unused.
- 0xF: 800% FG speed. Unused.
(Source: RoadrunnerWMC)
Disabling vertical scrolling
- Top background --> Change both bytes 13 and 16 of block 3.
- Bottom background --> Change both bytes 13 and 16 of block 5.
- Byte 13: set to 0x40.
- Byte 16: set to 0x10.
(Source: MeroMero)
Automatic horizontal scrolling
Works for any background that already has parallax scrolling. This can be achieved by putting a value of 0x10 for byte 16 and it will scroll the whole background instead of only some of it.
(Note: if byte 13 value is somewhere between 0x40 and 0x4F, this effect will be overridden and instead the vertical scrolling will be disabled).
(Note: if byte 13 value is somewhere between 0x40 and 0x4F, this effect will be overridden and instead the vertical scrolling will be disabled).
(Source: MeroMero)