Skip to content

v0.7.0 - no FPU required, 68020 minimum

Choose a tag to compare

@angree angree released this 21 Jul 18:58

The FPU requirement is gone. 68020 is now the minimum.

Tested working on a bare 68020 and on a 68030 with no coprocessor. A 68LC040
should be fine too. 68040/40 is still what you want for comfort, 68060/50 for
full speed.

What it actually was

Not the maths. printf.

libnix routes the whole printf family through a single function,
__vfprintf_total_size, and in the 68881 build of that library GCC hoists two
double constants and the FPU register save into its prologue:

lea      sp@(-92),sp
fmovemx  %fp2/%fp4/%fp6,sp@-
fmoved   #1e-10,%fp4
fmoved   #-0.1,%fp2

All three execute on every call, whatever the format string. OpenTTD formats
strings while building its search paths, before logging exists, so an FPU-less
machine took a Line-F trap (Software Failure #8000000B) at startup with a
zero-byte log.

That empty log is exactly why this took so long to find. Terrain generation is
where the floating point actually lives, so that is where the search kept
going — and it is never reached.

Why "soft-float" builds had not helped

Because -msoft-float never reached the libraries. This toolchain maps
-m68040 onto the 68020+68881 multilib, because a 68040 has an FPU built
in, and -msoft-float does not undo it:

flags multilib linked FPU instructions
-m68040 libm020/libm881 60
-m68040 -msoft-float libm020/libm881 60
-mcpu=68020 -msoft-float libm020 0

The old builds were a hybrid — our code on the soft-float ABI, the C library
from the hard-FPU multilib. That same mismatch is the origin of the
__floatunsidf-returns-in-fp0 bug and of the miscompiled pow() that the
build notes had blamed on soft-float itself. Forcing everything hard-float made
the halves agree, which is why it looked like a fix — and made an FPU
mandatory.

A trap for anyone else on this toolchain: -print-multi-directory reports .
for all three of the above and is useless for telling them apart. The only
honest check is the link trace, m68k-amigaos-g++ <flags> -Wl,-t | grep libm881.

How it was proven

A standalone probe that logs through dos.library Write() only — never
through printf, so the log survives even when printf traps. Same source, same
68030/no-FPU config, one flag difference:

build log ends at result
-m68040 about to call snprintf Software Failure #8000000B
-mcpu=68020 -msoft-float done - no FPU trap anywhere correct output

It ships as build/probe/t_printf.c.

Everything else

Unchanged from 0.6.0 — AGA, OCS/EHB and RTG screen modes, Paula sound, and the
same known rough edges: window chrome comes out pink and brown in the OCS
modes, the minimap shows wrong colours there, and memory use is still high
because sprite size has not been reduced yet. Half-size graphics remain the
next step.

Still no music, still no networking.

Requirements

68020 minimum, no FPU. 68040/40 recommended, 68060/50 for full speed. AGA,
OCS/ECS, or a Picasso96 / CyberGraphX card. 24 MB. AmigaOS 3.0/3.1.

Installing

Unpack anywhere and run openttd from a Shell, keeping splash.dat beside it.
OpenGFX and OpenSFX are bundled — nothing from the original TTD is needed.

If it runs slowly, switch to a lores mode in Game Options. That is the single
biggest lever you have.