VDP Scrolling

From MegaDrive Development Wiki
Jump to: navigation, search

Horizontal Scrolling

Each Scrolls can be scrolled horizontally on different basis :

  • Overall
  • One CELL unit
  • One line unit

This is selected via the vdp register 0xB.

Table format

The HScroll table is in the VRAM and its address is setup via the vdp register 0xD.

ScrollA and ScrollB both use this table alternately.

Address Data Affect
0
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Def Free Quantity of ScrollA
Overall, CELL 0, Line 0
2
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Def Free Quantity of ScrollB
Overall, CELL 0, Line 0
4
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Def Free Quantity of ScrollA
Line 1
6
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Def Free Quantity of ScrollB
Line 1
... ... ...
0x10
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Def Free Quantity of ScrollA
CELL 1, Line 8
0x12
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Def Free Quantity of ScrollB
CELL 1, Line 8
... ... ...
0x3FC
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Def Free Quantity of ScrollA
Line 511
0x3FE
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Def Free Quantity of ScrollB
Line 511
... ... ...

Vertical Scrolling

Each Scrolls can be scrolled vertically on two different basis :

  • Overall
  • 2-CELL unit

The VScroll table is located in the VSRAM.

ScrollA and ScrollB both use this table alternately.

Address Data Affect
0
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Def Free Quantity of ScrollA
Overall, CELL 0-1
2
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Def Free Quantity of ScrollB
Overall, CELL 0-1
4
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Def Free Quantity of ScrollA
CELL 2-3
6
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Def Free Quantity of ScrollB
CELL 2-3
... ... ...
0x4C
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Def Free Quantity of ScrollA
CELL 38-39
0x4E
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Def Free Quantity of ScrollB
CELL 38-39