Compiling Doom for 68000

Jameson

Active member
AmiBayer
Blogger
Joined
Jan 19, 2015
Posts
864
Country
Australia
Region
Queensland
Hey guys. Just wondering what is involved in compiling source code to a different processor base.

For instance, all Amiga versions of Doom are compiled for 68020 minimum, however if the source code to DoomAttack or ADoom was available how difficult would it be to recompile the code to use only the instruction set of the 68000?

The reason I am asking this is because I recently came into the possession of an A2000 with a Supra Turbo 28.... clocked at 40 mhz. It strikes me that a 40mhz 68000 with 8mb fast ram should have more than enough horsepower to run Doom, albeit in low res. Of course, there are now other 68000 based systems with enough speed to also run it (in theory) such as MiniMig, MiST etc.

Think of the novelty of running Doom on a plain 68000. ;)
 
Last edited:
If they are pure C code, it's basically as simple as telling the compiler to compile for 68000. But if they have parts written in assembly language that only run on 020+, those sections will have to be manually converted. I'm not sure if that is the case with Doom, but it often is, with at least some of the most performance-critical routines.
 
Hi ajk. Yessum, I was thinking perhaps things like the C2p routine, sound handler etc would most certainly have to be written in assembler.... can someone confirm this?

With that in mind, supposedly the Gloom series was written in one of the high level BASIC flavours for the Amiga (was it Blitz Basic?) and then compiled.... I wonder if it is all C?
 
In short..... This is way more work than is being made out!

Compilers are plentiful and varied so something like sas/c or storm is the start

but the source won't just compile
firslty the makefiles need sorting out and then any OS specific features

best way to start is to get already sorted source code (such as adoom) then work with that
 
Hi Pghulme. Yessum, I did have the impression that you would require the original pre-compiled source code in order to simple compile for a different processor / instruction set, however I assumed that as the original source code works on pretty much any 020+, 4mb+, KS 3.1+ Amiga that as long as these other factors are not changed, the source could be recompiled for the 68000 instruction set without having to change anything else.

Of course, nothing could be this simple as any hand coded assembler would have to be manually rewritten, but I wonder just how much of it there is and how hard it would be to make the required code changes...

...you see, the last programming I did was in Turbo Pascal.... about 20 years ago. :)
 
IMHO I doubt it'll run at any serious pace on an Amiga less than 040
 
was playable on my 1230/50, seriously though without any serious cache ram on the cpu even a 68000 @ 100mz would struggle to play doom.
best person to contact is Novacoder this guy has done amazing things with doom, duke3d, wolfenstein, decent, rise of the triad to name a few :D working on ECS chipsets also.
 
Last edited:
?!? Runs perfectly fine on an 030/25 and in fact will run okay, on a stock A1200 with fastram if you use low res and shrink the screen. In comparison, Sysinfo reports a 40 mhz 68000 is roughly double the speed of an A1200 with Fastram. Of course, this is not real world and your mileage may vary - lack of cache would definitely impact, but it would definitely be at least possible on a 40mhz+ 68000 in low res with the screen size reduced. Remember, whilst the 040 and 060 had a decent on cpu cache, the 020 has only a tiny one.... which would only help with a few repeatedly accessed instructions...
 
Last edited:
does perfectly fine = playable and screen so small to actually see what your looking at ?

same problem back when i used to build pc for a business,

the 1st version of the Celeron (slot) to save a few coins they had 0 level 2 cache ram and boy they where slow, pentium 1 systems where outperforming them , whoever thought that cpu must have been sacked as within a few months the same celeron was released with 128k level 2 cache which gave it a 3 or 4 fold increase in performance,

so dont write off cache ram no matter the size :D


I had 2 486 pc a while back

1st was dx2 66 and ran doom badly (no level 2 cache on motherboard)
2nd was a dx33 and ran doom twice as fast as the above pc due to a small amount of cache ram on the motherboard.
 
Last edited:
Ah yes, however flooding the limited cache in the 020 - only 256 bytes mind - with a few well chosen instructions might help improve performance, I dont think the incredibly limited cache of the 020 would improve the frame rate anywhere near the order of 100%.... or most probably 30%. 256 bytes is not enough to store much more than a few instructions and some very basic c2p data.... however I have communicated with Peter McGavin and he seems to think that his code does not really make special use of the 68020.... but he is relying on "distant memory" here. :)

His email reply is below.

"Hi Steven,

It's ages since I last looked at the ADoom source code but you're
welcome to grab the source and have a go.

I don't really remember whether the assembly code made much use of 68020
features, though possibly it used the 32/64-bit multiply/divide
instructions here and there, and maybe the scaled index addressing mode.

In any case, I think nearly all the assembly code routines are just
rewrites of corresponding C routines, except maybe the c2p and audio
stuff, so in a pinch you could compile the C routine. And hopefully
you'll have a chunky display and won't need c2p...

Kind regards, Peter."

Also, bare in mind that Citadel and several other simple Amiga FPS can run on the 68000.... and this is at 7.14mhz. True, they run slow and are more akin to the simplistic Wolf3d engine, however they are texture mapped and run. Surely then the same CPU running at more than 5 times the speed, with the additional speed boost of Fastram (Citadel etc only require 1mb Chip RAM to run) could handle a similar texture mapped FPS.

If nothing else, wouldn't it be interesting to see it?
 
Wolfienstien has lower requirements than DOOM, I think that's a more realistic goal.

It also depends on if you are targeting AGA/RTG or ECS, ECS will be a lot slower because it has to do expensive color mapping from 256 colors to 64.

Apparently AmiWolf runs 'OK' on a standard A1200 with a FASTRAM board although I've never tried it.

020 ECS




060 AGA




Good luck!
 
Hi Novacoder. Thanks for the input. Would it be safe to say that the processing requirements of Wolf3d would be somewhere around 50 to 70 percent of the cpu requirements of Doom to run at the same resolution, colour depth and frame rate?

If so, there are 68000s running at more than 3 times the speed of a stock A1200 020, so factoring in the less efficient instruction set, lack of 32 bit ram bandwidth (not sure how much difference it would make in this instance though) and lack of cpu cache (only 256 bytes) would it be fair to say that a 68000 running at triple the clock speed of an 020 would still be 30% faster? I cannot remember the basic performance ratings of the 000 and 020, but I seem to recall that 020 at the same clock speed was not even double the speed of the 000.

Baring all this in mind, ADoom (especially DoomAttack which is slightly faster) can run on a stock A1200 with Fast Ram. You need to shrink the screen down, use low res and forget about the midi files.... and even then you get around 5-6 frames per second. HOWEVER, even with the less efficient ECS chipset (as Novacoder mentioned, a quantitative colour reduction procedure would be needed, however this could be done quick and dirty with a look up table - very little overhead), surely a cpu with 30% more number crunching power (from the conservative estimate above) could run a similar, if not slightly better, frame rate?

BTW - Wolf3d already runs on a stock 68000 Atari ST (with 4mb ram)...
 
Hi Novacoder. Thanks for the input. Would it be safe to say that the processing requirements of Wolf3d would be somewhere around 50 to 70 percent of the cpu requirements of Doom to run at the same resolution, colour depth and frame rate?

That's very hard to say, DOOM is definitely more demanding though.
 
Back
Top Bottom