z80 compatible PPU?

Are you new to 6502, NES, or even programming in general? Post any of your questions here. Remember - the only dumb question is the question that remains unasked.

Moderator: Moderators

DementedPurple
Posts: 318
Joined: Mon Jan 30, 2017 5:20 pm
Location: Colorado USA

z80 compatible PPU?

Post by DementedPurple »

Hey, I plan on building a z80 based game console, but of course, what's a game console without graphics!? Do people still make 8-bit graphics cards? Would a VIC-II chip from the Commodore 64 work with a z80? Another question, what's the difference between a 2C02 and a modern graphics card? How is it able to render 3D polygons? Why doesn't a modern graphics card have sprites and palettes to worry about?
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: z80 compatible PPU?

Post by lidnariq »

DementedPurple wrote:Hey, I plan on building a z80 based game console, but of course, what's a game console without graphics!?
That's called the ColecoVision or the Sega Master System.

Or any of several dozen arcade machines.
Do people still make 8-bit graphics cards?
Not really, but you can get New-Old-Stock of a bunch of them.
Would a VIC-II chip from the Commodore 64 work with a z80?
The VIC and VIC-2 require something shaped like the 6502's biphase clock; I don't think the Z80 would play nicely.
Another question, what's the difference between a 2C02 and a modern graphics card?
2C02 is:
* fixed function
* just-in-time
Modern GPUs are neither.

In the distant past, memory was so expensive that some kind of real-time decompression (like how graphics work on the NES) is required.

However, at some point RAM became cheap enough that it began to make sense to instead provide allow the graphics unit to draw things into a "framebuffer" and just replay the contents of the framebuffer to the display instead.
How is it able to render 3D polygons?
Math. Matrices, trigonometry, Bresenham's line drawing algorithm, &c.
Why doesn't a modern graphics card have sprites and palettes to worry about?
Palettes just kinda suck.
You can't interpolate them
You can't mix them
They're a great way of handling real-time decompression, but RAM's too cheap now for it to make any sense.

Sprites have been instead handled via rendering to the framebuffer, and renamed "triangles"
DementedPurple
Posts: 318
Joined: Mon Jan 30, 2017 5:20 pm
Location: Colorado USA

Re: z80 compatible PPU?

Post by DementedPurple »

Could you maybe give an example of one I could use for an arcade machine?
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: z80 compatible PPU?

Post by lidnariq »

The Pac-Man hardware is Z80 based. Quickly looking through MAME's source I think I see roughly several hundred others, of which probably half are using it as a coprocessor rather than the main CPU.
DementedPurple
Posts: 318
Joined: Mon Jan 30, 2017 5:20 pm
Location: Colorado USA

Re: z80 compatible PPU?

Post by DementedPurple »

No, I meant a graphics processor
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: z80 compatible PPU?

Post by tepples »

lidnariq wrote:In the distant past, memory was so expensive that some kind of real-time decompression (like how graphics work on the NES) is required.
It wasn't memory cost as much as the speed of updating it. The Apple II (1977) had a frame buffer in HGR mode, and it preceded the TMS9918 (1979), which made sprites over a tiled background the standard.
Palettes just kinda suck.
You can't interpolate them
You can't mix them
They're a great way of handling real-time decompression, but RAM's too cheap now for it to make any sense.
Then what do you do if you want two characters to look identical except for uniform color? Shaders?
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: z80 compatible PPU?

Post by lidnariq »

Early arcade machines mostly used arrays of discrete logic (e.g. Pac-Man)
Late 80s-early '90s machines often used custom-built silicon (e.g. Neo Geo)
Late 90s-modern arcades machines often used modified versions of existing home consoles (e.g. Triforce) or PCs.

There are a few arcade machines that explicitly used the same TMS9928 as is in the ColecoVision.
tepples wrote:It wasn't memory cost as much as the speed of updating it. The Apple II (1977) had a frame buffer in HGR mode, and it preceded the TMS9918 (1979), which made sprites over a tiled background the standard.
The Apple 2's release list price was ~4.5 times more expensive than the contemporary Intellivision, and most of that cost was RAM. The C64 came five years later and still cost dramatically more than the NES.
[after I explained what's wrong with palettes]
Then what do you do if you want two characters to look identical except for uniform color? Shaders?
You can bake in the palette swap, if you really want to. That's ok if you have a fixed set of colors.
If you want something to have a dynamically chosen color, you can use a shader to emulate palettes at blit time. Or you can build your objects out of multiple polygons and change the color of the texture.
But you probably shouldn't hem too close to palette emulation, though; palette swaps were an easy cheap way of getting more variation for negligible storage costs. But now, storage is sufficiently cheaper (in all but the most contrived of modern examples) that you're really better making more visible variations between characters than just color. Plus the more shape differences you get, the more colorblind-friendly it is.
DementedPurple
Posts: 318
Joined: Mon Jan 30, 2017 5:20 pm
Location: Colorado USA

Re: z80 compatible PPU?

Post by DementedPurple »

You know what I just realized, you could have a 6502 run 1080p polygonal FPS games! (With crappy frame-rate, of course.) Correct me if I'm wrong, but you could use a GPU that is at least 32-bit, and treat each 32-bit memory address as 4 different 8-bit ones, and use a mapper to change what 32k is visible to the CPU.
User avatar
Bregalad
Posts: 8056
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Re: z80 compatible PPU?

Post by Bregalad »

I suggest you read my considerations in this relatively recent post.
viewtopic.php?f=5&t=14766&start=75#p190292

Basically there weren't many (or should I say any ?) "general purpose PPUs" made in the late 80s. The TMS chips being the only ones who fits this criteria. Apparently every arcade machine manufacturer would create it's own ASICs for that purpose. If you want a general purpose solution, your only change is re-using chips from a specific machine or daisy chaining TMS chips, but even when daisy chaining many of them you should still expect relatively crappy graphics.
Correct me if I'm wrong, but you could use a GPU that is at least 32-bit, and treat each 32-bit memory address as 4 different 8-bit ones, and use a mapper to change what 32k is visible to the CPU.
I have no experience in interfacing GPUs, but usually merging hardware from different generations is difficult because of different expectations when it comes to bus speeds, voltages, memory sizes and data/address buses width. But yes, you could have a 6502 CPU hooked up to modern hardware with some effort, although whether this makes any sense it up to anyone's opinion.
Oziphantom
Posts: 1565
Joined: Tue Feb 07, 2017 2:03 am

Re: z80 compatible PPU?

Post by Oziphantom »

Just a note about the VIC II + Z80.

You can put a Z80 with a VIC but you need to add some buffer logic to handle the fact 6502 wants data at the falling edge and Z80 wants it at the rising edge. The Commodore 128 has the logic already worked out for you so you can just copy Bil Herds Implementation ;) I would also recommend a VIC-IIe as it has a faster clock that is timed for the Z80 CPU over the 8502 clock.
User avatar
FrankenGraphics
Formerly WheelInventor
Posts: 2064
Joined: Thu Apr 14, 2016 2:55 am
Location: Gothenburg, Sweden
Contact:

Re: z80 compatible PPU?

Post by FrankenGraphics »

Is using the z80 a price argument? I know there's a handful of 65x computer kit projects to buy and build, but new production of the CPUs are in low volumes and they are therefore not that cheap (depending on what your goal is) and graphics solutions are few.

Regardless z80/65x, Having arduino or a FPGA chip emulate a processor might be worth considering, since it ought to be cheaper. Maybe you can clone a known PPU this way?
User avatar
Fisher
Posts: 1249
Joined: Sat Jul 04, 2015 9:58 am
Location: -29.794229 -55.795374

Re: z80 compatible PPU?

Post by Fisher »

Would interface a Z80 with a cheap VGA card be too hard?
Maybe you could try some old ISA or PCI cards?
AFAIK, they cost next to nothing.
Ardruino or Raspberry Pi seems to be the easier and cheaper solution.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: z80 compatible PPU?

Post by lidnariq »

If you can dig up an ancient 8-bit ISA VGA card, that's pretty easy to interface with any 8-bit microcontroller. I had a friend in college who hooked one up to an 8051; the awkwardest part was having to disassemble the BIOS ROM to find the correct initialization commands (i.e. having to port a part of the BIOS from x86 to 8051 asm).
Charless
Posts: 1
Joined: Mon Jan 06, 2020 10:05 pm

Re: z80 compatible PPU?

Post by Charless »

I've been banned for spam.
Last edited by Charless on Tue Jan 07, 2020 10:34 pm, edited 1 time in total.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: z80 compatible PPU?

Post by tepples »

What book are you talking about?
Post Reply