AmigaActive (556/2061)

From:Nick Lamburn
Date:7 Jun 2000 at 17:51:05
Subject:Re: AGA Emulation (was UFO AGA / RTG = Zero)

Hi Gary,

> I'd be curious to see what class of processor could actually handle all
> this emulation in software. Perhaps an 040 would be too slow, maybe even
> an 060. However, the main use of such emulation (for me at any rate)
> would be 2D sprite based games, so it wouldn't be a particular problem
> if the processor took such a hit that it eventually ended up running as
> fast as a 14 mHZ 68020. As a purely technical exercise it would be
> extremely interesting (sadly I don't have the skills this sort of task
> would require).

Well, AGA depends on a 68020 I should imagine. This is because of 32BIT
access, now I believe (I may well be incorrect) but the 680EC20 in a A1200
by standard is a 24BIT addressing device with a 32BIT data bus. This means
the A1200's 'EC020 can access 16MB of memory and can 'get' 32bits of data
from that memory in one go. Now, the 16MB memory is known as finely carved
up for various bits and bobs allowing for different things like RAM, ROM,
Custom Chips etc. However the important thing is that the A1200 'EC020 has
a 32BIT data line, where as a 68000 Amiga has a 16BIT data bus, though 32BIT
internals. (It can process the data in 32BITs, but to get 32BITs of data it
takes two fetch cycles, for both 16BITs iyswim). Now a 68020 in its full
config as 32BIT addressing as well as 32BIT data lines. Meaning access up
to 4.3GB memory.

Now that aside, I'm thinking that it isn't so much an impossibility, but it
would sure as hell require a massive amount of CPU power. I'd say that an
040 is not up to this at all, and a 68060 would be too little to get a full
A1200 speed. Now of course, some chips need emulating in an AGA system,
some won't. For starters, Paula, the two 8520 CIAs won't need emulating
since they are of 1985 vintage. However Agnus and Denise are no where to be
seen, but Alice, Lisa, Budgie and Gayle are there. Gayle is not drastically
needed and neither is it a component of AGA since I guess a really early Gayle
exists in the CDTV (for PCMCIA) and indeed in the ECS Amiga 600. So Gayle
can be forgotten - that leaves Budgie and Lisa. Now I don't have any
official Commodore AGA info (not sure many do actually!) but I have got the
old Hardware RKRM up to and including the Amiga 3000 which is a ECS Amiga.

Now - the ECS Blitter can 'shift' quite a lot ofm info about, but not that
much, I cannot recall so take these figures with a boulder of salt :), I
think OCS/ECS blitter/bimmer can do 8MB a sec most, and the AGA
blitter/bimmer (some called it a Bimmer :) about 32MB max. This is just raw
bitshifting. Now, for full AGA speed, the CPU must be able to shift 32MB/s
around the place. A 68040 can't do this i don't think (maybe on its own but
the Blitter is only one part of the Amiga) and a 68060 may be able to.
Remember you need some fast fast memory as well. :) Now, then you have the
Copper, that needs to be able to handle the higher resolutions (the ECS
copper is quite similar since ECS can handle most AGA modes, except in a
dramatic limit on colour depth). So the CPU has to handle the blitter and
copper.

The main problem is DMA, Direct Memory Access and I think this is the
spanner in the works. What this means is that to access a memory location
(say a custom chip register) the Amiga OCS/ECS/AGA writes directly to that
memory location, not via the 68K CPU. This means it is very difficult if
impossible to trap accesses to non existant chips if you are only going to
emulate AGA extensions (the aforemrntioned chip). I don't think the MMU can
help since the CPU is bypassed.

My guess is that in theory it works for a while, I believe it's DMA that
screws it up :)

Now I think about it, maybe even more about Amigas than I though, mind I
have been using and abusing ;) then since 1989, and i'm sixteen. I wonder
if the new Amiga will have lots of cool hardware like the old Amigas. Okay
so the custom chips are slow (nowadays), but they're dead fun to play with!
:)

Now see if you have have a simarly interesting discussion about PC hardware,
or maybe not..... :)

I think it boils down to limitations, not speed. You could put the grunt of
a fast 68060 or PPC behind this, but there are fundimental problems in a
partial emulation to aid speed. However, a full emulation of an AGA Amiga
is entirely possible since it's all software based. Anyone fancy writing a
Java Amiga emulator for the new Amigas? ;) Even UAE doesn't support proper
AGA emulation; it just adds a couple more bitplanes and that's it. And
remember OCS and ECS have all the register space for AGA extensions, just
that they are too slow.... :)

> I guess that there must be some fundamental obstacle to performing such
> emulation along the lines you've argued otherwise I'm sure that some
> programmer out there would have already written the thing. Remember
> though that nothing seems to be impossible on the Amiga, we were told by
> "reliable" sources that Amigas could never handle games like Doom or
> Quake but we have them now.

Well it is possible to write a software AGA emulator as far as I'm concerned
so long as the whole of the AGA computer is emulated. However this would
require a massive amount of horsepower. Yes you could run it on your 040,
but I'd say, be prepared for disappointment. However a fast PPC should be
able to do 'it' - though access to the 68K may be a BIG problem (since it's
largely tied to the custom chips, in your case the OCS/ECS ones) - so it may
even need to take over the Amiga. I'm not sure.

As far as it goes with me, yes, it can be done with sufficient power and
brains and if you're looking for someone to do it, I'm just not your man -
the theory is fine, the practice is way over me for now. Ask me in 20 years
time and maybe I'll have learnt PPC assembler then! :)))

Actually, make that 30 years! :)

However, is AGA emulation needed apart from old games? Why not get an A1200
for about £40? It's cheap, it'll run the games 100%! As far as I am
concerned, for the new Amiga OS, is something like AROS, a Amiga OS
compatible layer - which means all OS friendly apps will work, but old games
and some apps which bash the metal will break.

Food for thought... :)

Regards

Nick.



:+ ooO :O-
=- -=- OO8.:8 --------------------------------------.
= ..: oOO8::88 |
+ . -O88=.-8 Trogladite Software |
=-. .-==+ ...888= |
.=- ..-==o ..:888=: http://www.trogsoft.org |
.+== :-==+o..::888== |
O ===-- ..8888:--88 ································ |
OO o++++ .....8888:--8: NB: Currently Pending License |
.8. OOo8.....:8888--o8 ································· |
-:O8 88888=::-888= |
==88...88888::-o88= Nick Lamburn - Deputy Manager |
| oOOo+=oooO+OOOO= nick@trogsoft.org |
| -Oo8O==88=8 Boing Ball is a ® of Amiga Inc. |
`----------------------------------------------------------'

------------------------------------------------------------------------
Take your development to new heights. Work with clients like Dell and
pcOrder. Submit your resume to jobs@liaison.com. Visit us at
http://click.egroups.com/1/4358/3/_/468125/_/960393292/
------------------------------------------------------------------------

Quote carefully and read all ADMIN:README mails