It is currently Thu Nov 23, 2017 2:44 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: Boards with 2 PPUs?
PostPosted: Sun Sep 10, 2017 6:24 pm 
Offline

Joined: Thu Jun 09, 2016 4:46 pm
Posts: 14
I have been reading documents on the PPU and its EXT pins. I gather that a second PPU can be connected to the master one to make an image instead of a plain background color. I have some questions:

What does the master PPU "do" with the 4-bit value it gets from the EXT pins?
What does the slave PPU output to its own EXT pins?
Did any commercial games actually use 2 PPUs, either to create parallax scrolling or otherwise?

Any help would be appreciated.


Top
 Profile  
 
 Post subject: Re: Boards with 2 PPUs?
PostPosted: Sun Sep 10, 2017 6:55 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6448
Location: UK (temporarily)
When the register at $2000 is written with bit 6 clear:

EXT0 through EXT3 are inputs, and specify an extra 4bpp layer, chosen from the first 16 colors in the PPU palette. This layer only shows in places where both the sprite and background layers are transparent.

When that bit is instead set:

EXT0 through EXT3 are outputs, specifying the lower 4 bits of the 5 bit palette index. (bits 0,1 : color within palette entry; bits 2,3 : palette # ; missing bit 4: sprite vs tiles)


We know of no hardware that used this feature.


Top
 Profile  
 
 Post subject: Re: Boards with 2 PPUs?
PostPosted: Sun Sep 10, 2017 7:04 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19251
Location: NE Indiana, USA (NTSC)
The backdrop is any pixel where the background is transparent and no opaque sprite pixel is drawn. A PPU with $2000 bit 6 = 0 enters "receive EXTBG" (aka "master") mode. This replaces any backdrop color with the 4-bit color index received on the EXT pins. This can display any color in CGRAM $3F00-$3F0F and is the only way to display the colors in $3F04, $3F08, and $3F0C while rendering is enabled. The sprite colors ($3F11-$3F13, $3F15-$3F17, $3F19-$3F1B, $3F1D-$3F1F) cannot be reached through EXTBG. On the Famicom and NES, this value is fixed at 0, causing $3F00 to appear in all backdrop pixels.

A PPU with $2000 bit 6 = 1 enters "send EXTBG" (aka "slave") mode. This always draws the backdrop from $3F00 but sends the low 4 bits of the CGRAM address on the EXT pins. If these are connected to a PPU set to receive EXTBG, the receiving PPU cannot tell whether, say, $0A means background color $3F0A or sprite color $3F1A. But mods acting as an external color encoder, such as the NESRGB and Hi-Def NES, intercept PPU communication to make the PPU send EXTBG and set the palette to black background and white sprites. This way, the mod can read bit 4 from composite output and bits 3-0 from EXT.

If you're trying to wire two NTSC PPUs into one system, you have to ensure that writes to $2001 go to both PPUs at once. Otherwise, if rendering is enabled on one and not the other, they will fall out of sync by one pixel every two fields, or 30 pixels per second, because the NTSC PPU skips the resting dot between the pre-render line and line 0 in every other field if rendering is enabled but doesn't skip it if rendering is disabled.

There are two practical ways to wire them up.

  1. PPU1 sends, PPU2 receives: PPU2 generates the composite output based on its 25-color palette. PPU1 sprites appear with background palettes. If EXT0 and EXT1 are swapped with EXT2 and EXT3 between the two chips, displaying $3F04, $3F08, and $3F0C is possible for a total of 28 colors.
  2. PPU1 sends, PPU2 sends, external encoder chip: You essentially have the functionality of a PC Engine SuperGrafx. Both PPUs are set up as for NESRGB or Hi-Def NES (black background, white sprites), and the encoder receives the EXT and composite output signals from both PPUs, multiplexes them using configurable layer priority, and encodes the output as a composite, S-Video, or component (YPbPr or RGB) signal. Up to 49 colors are possible. Super NES-style color math is possible, treating PPU1 and PPU2 as sub and main screens. Color math can even be limited to specific color indexes, as in Genesis highlight/shadow mode.

You can't have both PPUs send and then mix the composite output directly because their color subcarriers may not be aligned.


Top
 Profile  
 
 Post subject: Re: Boards with 2 PPUs?
PostPosted: Mon Sep 11, 2017 2:01 am 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10118
Location: Rio de Janeiro - Brazil
Having some extra hardware mix the signals sounds pretty cool, because at that point you could implement other cool enhancements, such as 8x8 attributes, more palettes, a bigger (RGB?) master palette...

The main issue then would be finding the time to update twice the amount of VRAM each frame. Things are already pretty tight with games only having to do 1 sprite DMA and scroll a single background layer, doing twice the work is completely out of question. A dual PPU setup would require some sort of generic DMA functionality in order to be usable.


Top
 Profile  
 
 Post subject: Re: Boards with 2 PPUs?
PostPosted: Mon Sep 11, 2017 10:16 am 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6448
Location: UK (temporarily)
Once you'd added all the remainder, you'd probably call it the SuperGrafx. :)


Top
 Profile  
 
 Post subject: Re: Boards with 2 PPUs?
PostPosted: Mon Sep 11, 2017 10:34 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7272
Location: Chexbres, VD, Switzerland
tokumaru wrote:
Having some extra hardware mix the signals sounds pretty cool, because at that point you could implement other cool enhancements, such as 8x8 attributes, more palettes, a bigger (RGB?) master palette...

The main issue then would be finding the time to update twice the amount of VRAM each frame. Things are already pretty tight with games only having to do 1 sprite DMA and scroll a single background layer, doing twice the work is completely out of question. A dual PPU setup would require some sort of generic DMA functionality in order to be usable.

Assuming a motherboard with one CPU and 2 PPUs were made, it would be hard to use sprites on the 2nd PPU, because the CPU is hardwired to write sprite-DMA to $2004. Unless another chip/register swaps between both PPUs at $2000-$3fff, in this case it'd be possible to do sprite DMA for both chips, but mapping the second chip elsewhere in the address map sounds more natural. In that natural case, the only way to get sprites on the 2nd chip is to write each sprite to its register, which is horrifying slow and won't even work properly anyway.

I don't think scrolling is much of a problem because typically only one playfield would scroll with actual level data in it. The other layer could be used for backdrop and/or text.


Top
 Profile  
 
 Post subject: Re: Boards with 2 PPUs?
PostPosted: Mon Sep 11, 2017 10:57 am 
Offline

Joined: Thu Jun 09, 2016 4:46 pm
Posts: 14
Thank you for the interesting answers. I take it then that there were no actual applications of dual PPU systems back in the day? It's a shame since it might have meant that emulators today would have supported this setup, giving programmers an extra layer to play with :lol:


Top
 Profile  
 
 Post subject: Re: Boards with 2 PPUs?
PostPosted: Mon Sep 11, 2017 6:50 pm 
Offline
User avatar

Joined: Fri Nov 19, 2004 7:35 pm
Posts: 3951
The two PPU setup has a major problem, the single cycle skip at the prerender line that happens depending on whether the PPU is on or not. It is not guaranteed to sync up on the two PPUs.

_________________
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!


Top
 Profile  
 
 Post subject: Re: Boards with 2 PPUs?
PostPosted: Mon Sep 11, 2017 9:03 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19251
Location: NE Indiana, USA (NTSC)
That's what I meant by "ensure that writes to $2001 go to both PPUs at once." Or can the PPUs boot in opposite phases?


Top
 Profile  
 
 Post subject: Re: Boards with 2 PPUs?
PostPosted: Tue Sep 12, 2017 5:05 am 
Offline

Joined: Tue May 28, 2013 5:49 am
Posts: 875
Location: Sweden
The VS DualSystem uses two sets of CPU and PPU boards, but I don't know if the slave mode on the PPU is used or if they works independently in master mode.


Top
 Profile  
 
 Post subject: Re: Boards with 2 PPUs?
PostPosted: Tue Sep 12, 2017 5:54 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19251
Location: NE Indiana, USA (NTSC)
As far as I'm aware, RGB PPUs (2C03, 2C04, 2C05) don't have EXTBG functionality because they use the EXT pin for their RGB output. Besides, they operate independently, displaying to two different screens.


Top
 Profile  
 
 Post subject: Re: Boards with 2 PPUs?
PostPosted: Tue Sep 12, 2017 8:21 am 
Offline

Joined: Tue May 28, 2013 5:49 am
Posts: 875
Location: Sweden
I see, I don't know anything else that's using Nintendo's PPU (besides PC-10 which are also using RGB PPU). I guess the pins were designed for mixing in external video or something, but ended up never being used on any hardware.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 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