Slightly OT: an impressive video subsystem on an 8 bit micro

Let's talk about anything related to the 6502 microprocessor.
Post Reply
User avatar
BigEd
Posts: 11463
Joined: 11 Dec 2008
Location: England
Contact:

Slightly OT: an impressive video subsystem on an 8 bit micro

Post by BigEd »

People might find this build by Sérgio Vieira interesting - it's a Z80 machine, with one extra microcontroller performing video output and another performing video drawing, using a pair of frame buffers. (It's a detailed blog post but I think there are no public sources or documentation.)

The result is a machine with sprites and tile-based graphics, capable of the usual kind of 8 bit games but maybe also a bit more. There's a Basic too.

Image

Short demo videos:
User avatar
drogon
Posts: 1671
Joined: 14 Feb 2018
Location: Scotland
Contact:

Re: Slightly OT: an impressive video subsystem on an 8 bit m

Post by drogon »

BigEd wrote:
People might find this build by Sérgio Vieira interesting - it's a Z80 machine, with one extra microcontroller performing video output and another performing video drawing, using a pair of frame buffers. (It's a detailed blog post but I think there are no public sources or documentation.)

The result is a machine with sprites and tile-based graphics, capable of the usual kind of 8 bit games but maybe also a bit more. There's a Basic too.
I saw that recently too. It's fascinating. It actually has 2 microcontrollers making up the video generator.

From what I've gathered - it's a composite video output in RGB format suitable for a normal TV SCART input. (Much easier than generating PAL) There is some fine-tuned AVR assembler reading data from an external RAM chip, throwing it into a simple 3-chanel R,2R "DAC", then out. This is enhanced though in that there are 2 video RAM banks and a 2nd ATmega which is the one doing the "pixel poking".

So the video generator ATmega (VPU) reads from one Video RAM chip, sends it to the display, and at the same time, the Picture Processing Unit (the 2nd ATmega) updates the other video RAM chip, then at the end of the frame, the 2 video memorys are swapped over, the VPU ATmega caries on generating the video and the PPU ATmega pokes the video RAM with a new frame of data.

I think the sprites and tiles are all done in software.

The resolution is relatively low - 224x192, but not that different from some colour composite video output devices on the early 80's.

The entire video unit connects to the processor via a dual-port shared RAM buffer memory mapped into the Z80's address space, although I couldn't work out how (video ram needs about 44KB)

Anyway, it's quite a nice little system - and a very novel approach to get 8-bit colour sprites & tiles at a resolution an 8-bit micro can handle.

-Gordon
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/
JimDrew
Posts: 107
Joined: 14 Oct 2012

Re: Slightly OT: an impressive video subsystem on an 8 bit m

Post by JimDrew »

I am more impressed that it generates a good video signal with that rats nest of wires! It's difficult enough to get a clean NTSC composite video signal with a dedicated PCB circuit! :)
User avatar
BigEd
Posts: 11463
Joined: 11 Dec 2008
Location: England
Contact:

Re: Slightly OT: an impressive video subsystem on an 8 bit m

Post by BigEd »

Here are some bits from the blog post. I hadn't realised there are as many as four microcontrollers - but that seems fine to me, as each is a subsystem which could back in the day have been a custom or semicustom chip.
Quote:
After all the modules were developed, some were put into protoboards.
As for the CPU module, I’ve managed to design and order a custom PCB, don’t know if I’ll do the same for the other modules, I think I was pretty lucky to get a working PCB on the first try.
Only the sound module remains as a breadboard (for now).
Image

Image

Quote:
CPU: Zilog Z80 operating at 10Mhz
CPU-ROM: 8KB EEPROM, holds the bootloader code
CPU-RAM: 128KB RAM (56KB usable), holds the code and data of the programs/games
IO MCU: Atmega324, serves as an interface between the CPU and the RS232, PS/2 Keyboard, Controllers and SD Card filesystem
PPU-RAM: 4KB Dual-port RAM, it’s the interface RAM between the CPU and the PPU
CHRRAM: 128KB RAM, holds the custom background tiles and sprites graphics (in 8x8 pixel characters).
VRAM1, VRAM2: 128KB RAM (43008 bytes used), they are used to store the framebuffer and are written to by the PPU and read by the VPU.
PPU (Picture Processing Unit): Atmega1284, draws the frame to the framebuffers.
VPU (Video Processing Unit): Atmega324, reads the framebuffers and generates an RGB and PAL Sync signal.
SPU-RAM: 2KB Dual-port RAM, serves as an interface between the CPU and the SPU.
SNDRAM: 128KB RAM, holds PWM Patchs, PCM samples and FM Synthesis instruction blocks.
YM3438: YM3438, FM Synthesis chip.
SPU (Sound Processing Unit): Atmega644, generates PWM-based sound and controls the YM3438.
Post Reply