PPU Rendering Pipeline

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

Post Reply
User avatar
zeroone
Posts: 939
Joined: Mon Dec 29, 2014 1:46 pm
Location: New York, NY
Contact:

PPU Rendering Pipeline

Post by zeroone »

In attempt to improve the accuracy of my PPU implementation, I have been studying the source code of Nintendulator (PPU.cpp). I noticed that VRAM reads and writes are delayed by 3 PPU cycles:

Code: Select all

unsigned char IOVal;
unsigned char IOMode;	// Start at 6 for writes, 5 for reads - counts down and eventually hits zero

...

IOMode -= 2;
Is the delay related to the PPU rendering pipeline?
User avatar
Drew Sebastino
Formerly Espozo
Posts: 3496
Joined: Mon Sep 15, 2014 4:35 pm
Location: Richmond, Virginia

Re: PPU Rendering Pipeline

Post by Drew Sebastino »

I'm sorry if I'm derailing this thread when it just started, but what is a "pipeline" in electronics? I've been itching to ask this.
User avatar
rainwarrior
Posts: 8759
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: PPU Rendering Pipeline

Post by rainwarrior »

A pipeline is a series of operations done in sequence. This usually implies that they are done independently as well, so you can have multiple items proceeding along the pipeline at the same time, each one in a different stage.

This may help: http://en.wikipedia.org/wiki/Pipeline_(computing)
Drag
Posts: 1645
Joined: Mon Sep 27, 2004 2:57 pm
Contact:

Re: PPU Rendering Pipeline

Post by Drag »

It takes the PPU 2 cycles to output a full 14-bit address, so that's why accesses are delayed like that. I think the third cycle in that delay is because the CPU can initiate a fetch while the PPU is on the second of its two-cycle procedure for outputting an address, which would mean the fetch would take 3 PPU cycles to complete, instead of 2. Someone may need to fact check me on that though.
Post Reply