
Homebrew Amiga Graphics Card (FPGA, Open Source) Finished [video] - mntmn
https://www.youtube.com/watch?v=HkLu4QZPdhw
======
mntmn
Sources & Background
[https://github.com/mntmn/amiga2000-gfxcard](https://github.com/mntmn/amiga2000-gfxcard)

~~~
djsumdog
> "The Amiga is probably the last 32-bit personal computer that is fully
> understood, documented and hackable. Both its hardware and software contain
> many gems of engineering and design. I hope that one day, we can have a
> simple but powerful modern computer that is at the same time as hackable and
> friendly as the Amiga was."

Kinda sad. Our current x86 hardware is filled with closed binaries and
firmware that can't be easily replaced. That seems to be why so many _open_
laptops are using ARM.

~~~
D_Guidi
Amiga 2000 wasn't a 16bit system?

~~~
myrandomcomment
The Amiga 2000 shipped with a 7.16 (NTSC), 7.09 (PAL) Motorola 68000 CPU which
was 32 bit internally with 16 external data bus.

~~~
mikepavone
To be a bit pedantic, the 68000 was a mostly 16-bit implementation of a 32-bit
ISA. The ALU is 16-bit (though it can be ganged together with an additional
16-bit shift register for 32-bit shifts) and most of the data paths are 16-bit
as well.

It's a really smart design. Combines a forward-looking architecture with a
realistic implementation for the time. It's a shame it died out while x86
survived.

~~~
tech2
It took too long to go superscalar, pipelining was a bit of an afterthought,
they _should_ have done more with the Apple contract. Because they didn't this
meant Apple moved on to PowerPC and the bottom fell out of the 68k market.

It's sad overall really. The Amiga was a great machine with a fun and easy-to-
use/manipulate operating system. Memory protection (beyond weirdnesses like
Mungwall etc.) would have been nice.

For such a small team though they did very well. Commodore were desperate for
a slice of that DOS/Windows PC pie though and that further drained the coffers
:(

~~~
cmrdporcupine
Motorola just never learned how to sit still and continue to support and
extend their platform. They got early to market with the 68000 (late 70s! way
ahead of its time!) but it was a totally separate ISA and platform from the
(quite awesome) 6809 8-bit chip. No continuity between them. As soon as the
68k looked a bit long in the tooth they started pushing the 88k, which was a
total failure. Again with no continuity. Then they jumped to PowerPC, but they
never even fully committed to that either.

If they'd done what Intel did and continued to develop on the same platform,
maybe they'd still exist and we've have more diversity in platforms today. The
68000 was so much nicer to develop for than x86.

~~~
gpderetta
I'm not an expert, but as far as I understand, what killed 68k (and many 80s
CISCs, like VAX), was the difficulty with producing an OoO implementation
given the very complex instruction semantics, in particular the with indirect
addressing modes.

It wouldn't be a problem today as designers have transistors to spare, but it
was in the early '90s, when the high performance market was taken over by the
simpler OoO RISCs and x86 [1] of which, against expectations, Intel managed to
build a competitive OoO implementation in the form of the PentiumPro.

[1] which compared to other CISCs is much simpler.

~~~
cmrdporcupine
They ended up solving this problem eventually with ColdFire. They dropped a
few instructions and addressing modes and were able to produce something
pretty performant. But just 15 years too late :-)

And now that's dead too. And yeah I think the engineers at Motorola in the 90s
basically just saw the RISC writing on the wall and threw up their hands and
said that was the way to go, customers be damned, meanwhile Intel just had too
much invested in x86 CISC and couldn't do that and so was forced to make it
work.

------
awfgylbcxhrey
I have a basic question: what exactly is it?

As a former Amiga user, I'm familiar with the Amiga's graphics co-
processor(s). I actually forget now how many, I remember Copper and Blitter,
but don't recall if those were chips, or functions on a single chip.

So, is this a sort of video adapter that converts the native Amiga video
output to HDMI compatible signals, or is it full graphics card that brings
Amiga graphics (32/64/4096 color, with acceleration) to modern output
resolutions?

~~~
mntmn
It is a graphics card in the sense of the "ReTargetable Graphics" (RTG)
system. I ship drivers for the Picasso96 API (which also emulates the
competing CyberGraphX API). All OS friendly Workbench/Intuition GUIs can then
be used on a high resolution (up to 1280x720@60hz, 1920x1080@30hz) and color
depths of 8 (Palette), 16 or 32 bit. A bunch of open source games like Doom,
Abuse, ScummVM have been ported as system friendly applications, too, so these
run fine. Old games that bang the hardware still go through the custom chipset
of the Amiga and are output through the 15khz RGB connector, not via my card.
But I'm currently working on an expansion that scan-doubles and upscales the
classic video output, too.

(Edit:) On the hardware side, I implemented the Zorro bus protocol in the FPGA
(in Verilog) and hooked it up to a SDRAM controller/arbitrator and DVI/HDMI
encoder. There is also a simple blitter in the code.

~~~
jagger11
Are you maybe thinking about adding more things on this one card? Ethernet,
USB, memory (e.g. 1GB by default)...

Maybe even emulation of a faster CPU in FPGA (a'la the Vampire for A600)..
though, it'd probably use the CPU slot instead of Z2/Z3.

Also, is it possible to hijack the function of the OCS/ECS/AGA directly via
the Zorro slots (proxying the native output gfx output, e.g. with games), or
maybe it'd require some kind of hardware bridge between the gfx chipset and
your card?

------
ktta
There was a discussion when he first came out with a successful card:
[https://news.ycombinator.com/item?id=11511626](https://news.ycombinator.com/item?id=11511626)

------
lvoudour
Brilliant. Never owned an Amiga back in the day (constantly jealous of the
superior graphics/sound) so I'm not familiar with the architecture, but it's
impressive what you can do with even a low tier FPGA

~~~
mntmn
Thanks! Yes, this was my first real FPGA project (good for learning!), I'm
still exploring all the possibilities. For example, only around 25% of the
LUTs of the FPGA are currently used, so there is even room to put a simple CPU
in there, or simple shaders.

~~~
rosege
How did you get started learning about FPGA?

~~~
mntmn
I bought a cheap-ish "Papilio Pro" FPGA board one day and wanted to do see if
I could get it to output VGA directly (I did that with Atmel MCUs before for
fun). So I installed Xilinx WebPack ISE and looked at various docs online.
Other people's code (for example Mike Field's) was extremely helpful, too. I
still feel I'd like to read a good book on Verilog design to close the gaps,
if anyone is a pro I'm happy about recommendations.

------
eschaton
I still hope to design a NuBus equivalent. Your work is inspiring. :)

~~~
tcdent
I'm hopelessly inexperienced, but I want to do this as well. Getting USB (even
for just keyboard and mouse emulation) and networking, in addition to high
resolution video seems like it could be possible using one of the more
powerful SoC's.

~~~
eschaton
I don't see what the point of USB or networking would be; a NuBus Mac can use
an Ethernet card perfectly well, and why would you want to use a USB keyboard
or mouse with a classic Mac.

Really the big interfacing issue with a classic Mac is video, because many
modern displays can no longer handle their sync frequencies. Either you need
an older CRT (and to maintain it) or an older CFL-backed LCD (and to maintain
it) that can hopefully show an image at a non-native size without upscaling.

With a custom digital video card and DVI/HDMI output you can actually hook up
a modern display, just as with the card the OP created for Amiga. But unlike
with Amiga, the classic Mac always used a straightforward framebuffer, so
there's no software support issue.

~~~
duskwuff
> ... why would you want to use a USB keyboard or mouse with a classic Mac?

Because optical ADB mice are hard to come by? There are a few, but they're
rare.

A good USB implementation might also allow you to hook up storage devices,
which would be pretty nice.

~~~
emh68
Aye, I didn't even know they made any, so I hacked up an adapter:
[https://github.com/ehalferty/arduino-usb-to-
adb](https://github.com/ehalferty/arduino-usb-to-adb)

There are other (non-DIY) USB-to-ADB projects out there taking shape, too.

But I'm also hoping someone starts making Nubus cards for VGA, USB mass
storage, etc. It would just take an FPGA or perhaps even an overclocked
teensy.

------
pawadu
I wish he had used the open source FPGA tools [1] instead of Xilinx ISE...

\---

[1] [http://www.clifford.at/icestorm/](http://www.clifford.at/icestorm/)

~~~
mntmn
I find the open toolchains for Lattice a great development, but I don't have
any experience with the ice40 devices yet. Do the Lattice targets have SERDES
outputs, clock synthesizers?

Edit: I highly doubt that this project would be doable in an ice40 part (no
SERDES, relatively small number of LUTs), but maybe an interesting challenge
for the reader ;) Maybe with an extra transceiver IC and single bit depth,
single zorro protocol...

~~~
pawadu
No idea, but I don't think the FOSS tools would support them at this stage
anyway.

They also support Xilinx Spartan 6 which looks like what this board uses.

~~~
mntmn
Where did you find the Spartan 6 support? The page you linked is mostly about
Lattice ice40. I see a link to a Spartan 6LX9 reverse engineering project at
the end of the page though. I use an LX25.

~~~
pawadu
You are right, there is no spartan 6 support.

------
kelvin0
I just love the Amiga. Used to have a Amiga 500 and sold it a long time ago. I
think I'll try to get my hands on one again.

~~~
baldfat
I was cleaning my house and my 500 and 2000 were just dust collectors in the
basement and I got rid of them. :(

------
mntmn
BTW toolchain to build drivers [https://github.com/cahirwpz/amigaos-cross-
toolchain](https://github.com/cahirwpz/amigaos-cross-toolchain)

