It is currently Sat Dec 16, 2017 11:28 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Phase 161 through 168
PostPosted: Sun Jun 12, 2005 8:23 pm 
Offline
User avatar

Joined: Tue Dec 21, 2004 8:35 pm
Posts: 600
Location: Argentina
My question is about when the ppu fetches the first 2 tiles to be rendered
at the beggining of the scanline, cos i have been having problems with it in my emulator.

First i want to know if what i "know" is right:

- The ppu fetches two NT bytes (1 tile) every 8 clock cycles
- The first tile fetched is the 3rd to be drawn on screen
- cycles that correspond to phase 161 - 168, repeats 2 times a tile fetch, so it fetch 2 tiles and those tiles will be drawn at the *next * scanline, prior the scanline that they were fetched.

But, if assumming that those 2 tiles fetched goes in the 1st and 2nd Tile it means that the ppu start to fectch tiles for the actual scanline from cc 16??? this is the point a dont understand, if we fetched two tiles at the begginning of the prior scanline it means it has to pass 16 cycles so it can start drawing tile 3rd.

Some help witch my confusion?

_________________
ANes


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 12, 2005 9:27 pm 
Offline
User avatar

Joined: Sun Sep 19, 2004 10:59 pm
Posts: 1393
The tile fetched at "cycles 0-3" of scanline N is the 3rd one to be drawn on scanline N.
The tiles fetched at "cycles 160-167" of scanline N-1 are the 1st and 2nd ones drawn on scanline N.

The reason the first two tiles are fetched in advance is to prefill the shift register used by the renderer itself; 1 tile is not enough, since it needs 15 pixels ready if fine X scroll is equal to 7. The fact that the PPU ends up fetching 34 tiles per scanline (instead of only 33 as required) is just a side effect of simplifying the logic.

_________________
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 13, 2005 10:04 am 
Offline
User avatar

Joined: Tue Dec 21, 2004 8:35 pm
Posts: 600
Location: Argentina
so every "tile fetch" is every 4 clock cycles?

_________________
ANes


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 13, 2005 7:26 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19353
Location: NE Indiana, USA (NTSC)
Correct, provided that your timing is based on PPU memory cycles. Most of the PPU logic actually runs at one cycle per pixel, but the address and data buses are multiplexed onto one set of pins, so one PPU memory cycle happens every two pixels. There are eight pixels in a tile. Therefore, the PPU reads VRAM or VROM four times to draw one tile:
  1. Nametable
  2. Attribute table
  3. Pattern table low order bits
  4. Pattern table high order bits


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group