Download Print this page

Nintendo NES-001 - Entertainment System Game Console Documentation page 24

User guide
Hide thumbs Also See for NES-001 - Entertainment System Game Console:

Advertisement

It is clear that the status bar area of the screen is not scrolled in the same way as the rest
and is fully resident on the first name table. This is typical of status information and is
handled in Super Mario Bros. by using the sprite 0 hit flag and in Super Mario Bros. 3 by
generating an IRQ.
The general picture of horizontal and vertical scrolling is shown in figure 3-12. The name
table shown here as A is specified by bits 0-1 of $2000 and B is the name table after (which
depends on the mirroring technique). This does not apply to games which allow
simultaneous horizontal and vertical scrolling [7]. The background image will span across the
name tables as shown in figure 3-13.
Figure 3-12. Horizontal and vertical scrolling. Adapted from [7].
Figure 3-13. Name tables used for background. Adapted from [7].
The way scrolling works is described in [8] and is summarised here. The system maintains a
16-bit VRAM address register, the value of which is set by $2006. The layout of this register
is as follows:
Bits 0-11 - Stores the address in the name table as an offset from $2000. Bits 0-4 are
the x-scroll and is incremented as the line is drawn. As this is incremented from 31, it
wraps to 0 and bit 10 is switched. Bits 5-9 are the y-scroll and are incremented at the
end of a line. When incremented from 29, it wraps to 0 and bit 11 is switched. If the
value is set above 29 by a write to $2007, then it will wrap to 0 when it reaches 31,
but bit 11 is not affected.
Bits 12-14 are the tile y-offset.
Since the x-scroll and the y-scroll indicate tile numbers, this allows 32 tiles across the screen
(256 pixels) and 30 tiles down the screen (240 pixels), for a total of 960 tiles.
There is a second, temporary VRAM address register which is also 16-bits long. Finally there
is a 3-bit tile x-offset. These are updated by writes to registers and as the frame is drawn.
Name Table 2
Name Table 3
($2800)
($2C00)
Name Table 0
Name Table 1
($2000)
($2400)
24

Advertisement

loading

This manual is also suitable for:

Entertainment system