Mad skills? Use Nintendo PPU with Z80 CPU

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
Mad skills? Use Nintendo PPU with Z80 CPU
by on (#85018)
Just a crazy idea to build retro 8-bit computer based on Z80 and 2C0x PPU
Discuss :wink:

by on (#85019)
That's easy. NES PPU already was connected to ZX Spectrum in 1990s indirectly (complete with CPU, so it was possible to load and run simple NES games from a floppy), and one guy also connected PPU to a Soviet 8080-based computer directly.

by on (#85020)
Ewww....what a downgrade. :P

by on (#85021)
A Z80 would be able to copy one byte from an increasing source to a fixed destination address every 22 cycles, vs every 8 cycles on the 6502. So it would need to be 3x as fast to be competitive.
Plus there's no sprite DMA, that's exclusive to the 2A03.

by on (#85022)
I/O mapped - OUTI or OTIR, 16t/byte

Memory-mapped - 18t/byte with dumb code:

Code:
ld a,(hl)
inc l
ld (de),a


or 12t/byte with no so dumb code:

Code:
pop bc
ld (hl),c
ld (hl),b


Z80 is usually clocked at 3.5 Mhz, 2A03 clock frequency is twice lower. So Z80 is either as fast as 2A03, or faster, with tricky code.

by on (#85023)
I guess that beats the LDI \ DEC DE thing I was thinking of.

by on (#85025)
Shiru wrote:
That's easy. NES PPU already was connected to ZX Spectrum in 1990s indirectly (complete with CPU, so it was possible to load and run simple NES games from a floppy), and one guy also connected PPU to a Soviet 8080-based computer directly.

:shock: do you have link to this info or any photos? I guess ZX Spectrum used as "soft cart" without any mappers

Z80 have /BUSAK signal and 3.5MHz should make it equal to 2A03, but depends on code 6502 core pretty fast

by on (#85028)
No photos, all the info is in Russian. Original article was published in 1995 in a local ZX Spectrum magazine. Here is Google translated article. The device wasn't popular, very few people actually made it. The author recently gave an audio interview, he said he abandoned the idea in late 1990s, but still gets emails with questions about the device.

by on (#85029)
Looks like a hybrid of two computers :? But i thought about using PPU only with Z80 as CPU and add some RAM and ROM. Just for fun. Challenge. Not after supporting any legacy, just print "Hello, world!" maybe something else :roll:

P.S. Z80 have DMA, ZX Spectrum - not :wink:

by on (#85031)
The second thing I've mentioned, a Soviet computer, had only NES PPU directly connected, without 2A03. It was rather simple device, I think it is not a big problem to connect the PPU to any 8-bit computer, or design a new one.

There is an addon device for ZX Spectrum with Z80 DMA on-board, by the way, and also a DIY sound card with 8237 DMA. These were developed about at the same time as the NES+ZX thing.

by on (#85034)
Is there any link to article about Soviet computer? Any software or at least sample code or so?

by on (#85035)
No, it was a hobbyist project of a guy who done it in late 1990s, and posted on a forum in 2000s, text description and some schematics. It was few years ago, I can't recall where it was.

by on (#85042)
Dwedit wrote:
A Z80 would be able to copy one byte from an increasing source to a fixed destination address every 22 cycles, vs every 8 cycles on the 6502.

That depends on what kind of divider is in front. A 2A03 takes 96 cycles because of that divide-by-12 in front.

Quote:
Plus there's no sprite DMA, that's exclusive to the 2A03.

Nor audio. But just as audio can be handled by a separate chip, so can hardware accelerated memcpy.

But if you want a Z80 and something very similar in capability to an NES PPU, there's always the SMS ;-)

by on (#85048)
I want computer with keyboard :oops:

by on (#85375)
Shiru wrote:
80sFREAK wrote:
Is there any link to article about Soviet computer? Any software or at least sample code or so?
No, it was a hobbyist project of a guy who done it in late 1990s, and posted on a forum in 2000s, text description and some schematics. It was few years ago, I can't recall where it was.

It was me, LOL.
tepples wrote:
Quote:
Plus there's no sprite DMA, that's exclusive to the 2A03.
Nor audio. But just as audio can be handled by a separate chip, so can hardware accelerated memcpy.
But if you want a Z80 and something very similar in capability to an NES PPU, there's always the SMS ;-)

Z80 have OUTR/INIR. ;)

by on (#85377)
HardWareMan wrote:
tepples wrote:
Quote:
Plus there's no sprite DMA, that's exclusive to the 2A03.
Nor audio. But just as audio can be handled by a separate chip, so can hardware accelerated memcpy.
But if you want a Z80 and something very similar in capability to an NES PPU, there's always the SMS ;-)

Z80 have OUTR/INIR. ;)

You're right. One might think of the separate IN/OUT instructions on 8080-family CPUs as like address bus B on the Super NES.

by on (#85435)
tepples wrote:
HardWareMan wrote:
tepples wrote:
Quote:
Plus there's no sprite DMA, that's exclusive to the 2A03.
Nor audio. But just as audio can be handled by a separate chip, so can hardware accelerated memcpy.
But if you want a Z80 and something very similar in capability to an NES PPU, there's always the SMS ;-)

Z80 have OUTR/INIR. ;)

You're right. One might think of the separate IN/OUT instructions on 8080-family CPUs as like address bus B on the Super NES.

Z80 have /MREQ for memory access and /IORQ for IN/OUT
2 HardWareMan could you share info about that project? Thanks in advance

by on (#85448)
80sFREAK wrote:
2 HardWareMan could you share info about that project? Thanks in advance

Sorry, nothing left. But, I can help with theory if you will make similar. ;)

by on (#85472)
Well, IMO theory is "connect according to datasheet" and one more question - how big was memory for programms? And last question - did you used any keyboard?
Thanks in advance

by on (#85480)
Use this: http://nesdev.com/Ntd_8bit.jpg

First you need an oscillator. I would use a 74HC04 for that.

Feed the clock to the PPU, and use a 74HC161 to divide it by 4 if your Z80 is fast enough, or divide it by 6 by putting a NAND on the '161's Q1 and Q0 which clocks a T flip flop (half a 74HC74 with /Q connected to D) which provides the Z80 clock.

You need a 74HC373 to latch the PPU address.

Use a 62256 for both CHR-RAM and VRAM. Use some 74HC670 and a half of a 74HC139 (to select them) for bankswitching if you wish.

I'd use another 62256 for Z80 RAM, and use half a 74HC139 for memory address decoding (I'd give 32k to RAM, 32k to ROM). Connect RS0-3 to Z80 A0-3. Connect Z80 /WR to PPU R//W. Use a 74HC138 and NAND gate to decode PPU "/DBE". /DBE = !(!nIORQ && address range && !(nRD && nWR)).

by on (#85482)
kyuusaku wrote:
Use this: http://nesdev.com/Ntd_8bit.jpg

First you need an oscillator. I would use a 74HC04 for that.

Feed the clock to the PPU, and use a 74HC161 to divide it by 4 if your Z80 is fast enough, or divide it by 6 by putting a NAND on the '161's Q1 and Q0 which clocks a T flip flop (half a 74HC74 with /Q connected to D) which provides the Z80 clock.

You need a 74HC373 to latch the PPU address.

Use a 62256 for both CHR-RAM and VRAM. Use some 74HC670 and a half of a 74HC139 (to select them) for bankswitching if you wish.

I'd use another 62256 for Z80 RAM, and use half a 74HC139 for memory address decoding (I'd give 32k to RAM, 32k to ROM). Connect RS0-3 to Z80 A0-3. Connect Z80 /WR to PPU R//W. Use a 74HC138 and NAND gate to decode PPU "/DBE". /DBE = !(!nIORQ && address range && !(nRD && nWR)).

Thanks Captain :wink:

Z80A CPU - check
2C0x PPU - check
74xx04 Clock - check
74xx161 Clock divider for Z80A - check(21.477/4=5.369 a bit overclock, but if CPU will run at this frequency i can use just 74xx74)
74xx373 ummm let's say just latch - check
74xx138/139 - check

62256 for CHR-RAM and VRAM? could you please commen, as i can see 14 lines for address, but i don't mind to use only 8kB chip
As for CPU RAM/ROM i'd prefer to stay with 8kB chunks and remember about /NMI routine for output to screen.
and whatever for Z80 in/out - PIO, SIO, latches etc :roll:

by on (#85484)
80sFREAK wrote:
Well, IMO theory is "connect according to datasheet" and one more question - how big was memory for programms? And last question - did you used any keyboard?
Thanks in advance

I do not CO, so these tips will never give. :) I always give clear and detailed answers. So, let's begin.

First, I will tell about PPU circuit. PPU is required 16KiB memory. I used half of 32KiB chip. What we get? 8KiB fonts and 4 full tilemaps. I used the PAL PPU, so that my scheme is as follows (for NTSC one you must to change resonator and maybe some capasitors near it):
Image
We get the full VRAM version, without useless mirroring. Further, as this is connected to the Z80. With the majority of the signals is clear, R/W should be connected to the signal WR of Z80, but CS connect to decoder of memory map. Memory map of Z80 can be any, invent one.

Something else?

PS To be clear. Everybody knows CaH4e3? CopyFamiClone is my device, created specially for CaH4e3. It's like yours CopyNes, but much more powerfull. :3

by on (#85486)
That's pretty clear - use as much resources as PPU can provide. One question - VRAM chip static only or i can use pseudo static RAM as well?

by on (#85488)
80sFREAK wrote:
That's pretty clear - use as much resources as PPU can provide. One question - VRAM chip static only or i can use pseudo static RAM as well?

Pseudo static RAM use CS toggle for prefetch. So, it can't be used here. Use SRAM, it's cheap and widely distributed.

by on (#87070)
Your CopyFamiClone looks awesome, lovely PCB ^^