initial fce ultra 0.81 import
[fceu.git] / Documentation / tech / ppu / loopy1.txt
CommitLineData
c62d2810 1Subject: [nesdev] the skinny on nes scrolling\r
2Date: Tue, 13 Apr 1999 16:42:00 -0600\r
3From: loopy <zxcvzxcv@netzero.net>\r
4Reply-To: nesdev@onelist.com\r
5To: nesdev@onelist.com\r
6\r
7From: loopy <zxcvzxcv@netzero.net>\r
8\r
9---------\r
10the current information on background scrolling is sufficient for most games;\r
11however, there are a few that require a more complete understanding.\r
12\r
13here are the related registers:\r
14 (v) vram address, a.k.a. 2006 which we all know and love. (16 bits)\r
15 (t) another temp vram address (16 bits)\r
16 (you can really call them 15 bits, the last isn't used)\r
17 (x) tile X offset (3 bits)\r
18\r
19the ppu uses the vram address for both reading/writing to vram thru 2007,\r
20and for fetching nametable data to draw the background. as it's drawing the\r
21background, it updates the address to point to the nametable data currently\r
22being drawn. bits 0-11 hold the nametable address (-$2000). bits 12-14 are\r
23the tile Y offset.\r
24\r
25---------\r
26stuff that affects register contents:\r
27(sorry for the shorthand logic but i think it's easier to see this way)\r
28\r
292000 write:\r
30 t:0000110000000000=d:00000011\r
312005 first write:\r
32 t:0000000000011111=d:11111000\r
33 x=d:00000111\r
342005 second write:\r
35 t:0000001111100000=d:11111000\r
36 t:0111000000000000=d:00000111\r
372006 first write:\r
38 t:0011111100000000=d:00111111\r
39 t:1100000000000000=0\r
402006 second write:\r
41 t:0000000011111111=d:11111111\r
42 v=t\r
43scanline start (if background and sprites are enabled):\r
44 v:0000010000011111=t:0000010000011111\r
45frame start (line 0) (if background and sprites are enabled):\r
46 v=t\r
47\r
48note! 2005 and 2006 share the toggle that selects between first/second\r
49writes. reading 2002 will clear it.\r
50\r
51note! all of this info agrees with the tests i've run on a real nes. BUT\r
52if there's something you don't agree with, please let me know so i can verify\r
53it.\r
54\r
55________________________________________________________\r
56NetZero - We believe in a FREE Internet. Shouldn't you?\r
57Get your FREE Internet Access and Email at\r
58http://www.netzero.net/download.html\r
59\r
60------------------------------------------------------------------------\r
61New hobbies? New curiosities? New enthusiasms?\r
62http://www.ONElist.com\r
63Sign up for a new e-mail list today!\r