Skip to content

v0.3 - runs on an 030, and the freezes are gone

Choose a tag to compare

@angree angree released this 20 Jul 21:35

Runs on a 68030 with an FPU now, not just an 040. The two bugs that made longer
games impossible are gone.

Fixed

Closing a rail line into a loop froze the machine. SmallSet::Remove() in
signal.cpp was miscompiled at -O1 — it read a struct field four bytes past
where it lived, so it never found anything to remove. That is harmless on open
track, where there is nothing to cancel; the moment a line was closed into a
loop, the two ends of the signal-propagation walk could no longer cancel each
other and it circled forever.

Generating a map froze the machine. libgcc's __floatsidf /
__floatunsidf return their result in FPU register fp0, which is the
hard-float convention, while every -msoft-float call site reads d0/d1.
Unsigned-to-double conversion therefore returned register garbage, which reached
max_x in the coastline pass, whose fill loop then never terminated and wrote
far outside the height map. native/openttd/fp_conv.c replaces those routines
with integer-only versions that build the IEEE-754 pattern directly. The
coastline loops are now bounded too, so a recurrence would cost you an ugly
coastline rather than the game.

The screen-resolution dropdown did nothing (settings_gui.cpp at -O1),
and the choice is now written to openttd.cfg immediately, so it survives a
reset rather than only a clean exit.

DELETE closes windows in the intro menu, not just in-game.

The game was briefly unplayable because an internal compiler error had
quietly caused the whole per-frame video driver to be rebuilt unoptimised. Only
the one function that trips the compiler is unoptimised now.

New

  • A splash screen at startup. It is loaded from splash.dat, not linked into
    the executable, so the binary does not grow; it converts once and fades
    through the palette.
  • Resolutions are labelled AGA, ahead of Picasso96/RTG modes joining the same
    list later.
  • On lores screens the menu and the OpenTTD logo no longer overlap.
  • Arrow keys scroll the map, and right-drag scrolling no longer dead-ends when
    the pointer reaches the edge of the screen.

Requirements

68030 with an FPU minimum. 68040/40 recommended, 68060/50 for full speed.
AGA, 16 MB Fast RAM, AmigaOS 3.0/3.1.

An FPU really is required, despite the binary being built -msoft-float: the
remaining double-precision routines are stubs into mathieeedoubbas.library,
and the stubs themselves execute FPU instructions. No 68LC040, no 68EC030. A
bare 68020 starts and reaches the menu but fails during map generation.

If it runs too slowly, switch to a lores mode in Game Options — a quarter of the
pixels to convert, and no interlace. On an 030 that is the only configuration
with a chance, and generate a small map.

Still missing: sound (there is no AHI driver yet), networking, and any RTG path.

Installing

Unpack anywhere and run openttd from a Shell, keeping splash.dat beside it.
Nothing from the original Transport Tycoon Deluxe is needed or included —
OpenGFX and OpenSFX are bundled, so it runs as unpacked. See LICENCES.txt for
what is in the archive and under what terms.