Sega Mega Drive/Scrolling
From Sega Retro
The Sega Mega Drive is able to scroll the background and foreground (planes B & A) independently, both horizontally and vertically.
Horizontal scrolling
Horizontal scrolling is controlled by a table located in VRAM. The address for the table is set by VDP register $0D, while the format is set by register $0B. There are three possible settings for this register:
Type | Space in VRAM | Format | Code |
---|---|---|---|
Whole screen | 4 bytes | FFFF BBBB
|
move.w #$8B00,($c00004).l |
8 pixel strips | 112 ($70) bytes (NTSC) 120 ($78) bytes (PAL) |
FFFF BBBB FFFF BBBB FFFF BBBB...
|
move.w #$8B02,($c00004).l |
Per scanline | 896 ($380) bytes (NTSC) 960 ($3C0) bytes (PAL) |
FFFF BBBB FFFF BBBB FFFF BBBB...
|
move.w #$8B03,($c00004).l |