Frotz 2.50 beta ready

I’ve fixed and/or addressed all the things I want to for this long-awaited and long-delayed update to Unix Frotz. It’s now ready for beta testing, so please take a look at it and try your best to break it.

I’ve also updated the DOS port, but it lags a bit behind in that it still uses the old Infocom formats for audio and graphics. The problem is sufficiently hairy that I’ve pushed it back for a later update. There are/were two problems with the DOS port that I’m not entirely sure are gone. These are a tendency for Frotz to lock up the machine hard upon quitting a game and another where it crashes after a few moves in certain games.

You can get both the source and a DOS executable at the IF Archive (http://ifarchive.org/indexes/if-archive/infocom/interpreters/frotz/) once the curators have found them. As always, there’s also https://gitlab.com/DavidGriffith/frotz/

Here’s what’s new:

NEW FEATURES

  • Added UTF-8 input and output. Plain ASCII is still available.
  • Added -L option for restoring save file directly from the command line.
  • Added -R option for restricted read/write path.
  • Sound effects in AIFF, MOD, and OGG formats supported per the Blorb specs.
  • Sound driver selection is automated through the use of libao.
  • Allow for an alternative Blorb file to be specified on the command line.

BUG FIXES

  • Overhauled MacOS compilation.
  • Corrected problems with error handling.
  • Fixed a lot of unsafe strcpy() and strcat() calls.
  • Fixed adaptive palette rendering for SDL.
  • Fixed scaling with manually specified window dimensions.
  • Fixed problem with unnecessary newlines with input timeouts.
8 Likes

Hey Dave,
Happy to give the 2.5 Beta a try on my MacBook (10.15 Catalina).
But I couldn’t find the file. Could you point me in the right direction?

Thanks

Rhetro

The tarball can be downloaded directly from Gitlab by clicking “Project” then “Release”. You’ll see a drop-down to select a format. Download that, open it up, and read README.1st and INSTALL.

Hey Dave,
My apologies, but I’m having trouble with this. I suppose I have to register with Gitlab first (I’m new to this whole thing and don’t have a problem doing this).

I’ll register with them, and then as you said:
Project
Release
find the file and download it.

Thanks for your patience.

You don’t have to register.

It does look like only the source code is available though? So you’d have to build it yourself. Are there MacOS binaries somewhere? Or detailed instructions for building from a stock MacOS machine?

I was able to build on my Mac but I had to tweak the Makefile a bit.

Add this line at the top of the Makefile:

MACOS = yes

Delete these two lines:

@echo "** ERROR UTF-8 support only works with ncursesw!"
exit 2

Then type make nosound.

(Oh, if you have a truly stock Mac, you’ll have to install Apple’s developer tools first.)

I haven’t tried building with sound. It’s possible but you have to install additional libraries first using homebrew (https://brew.sh/).

Ouch! Way above my pay grade…lol
I’ll wait…

Thanks and
See ya soon!

Oh dear! I thought I kept things such that no Makefile editing would be necessary for MacOS. I don’t have regular access to a MacOS machine, but I should this weekend. I’ll fix that and go over the docs to make sure a source install is quick and easy.

Beta 2 is now available from the Frotz repository at Gitlab. This fixes the problems in MacOS compilation noticed by Zarf as well as finally fixing a longstanding problem with DOS Frotz crashing after a few moves. I’m working on some Brew formulae for easy installation on MacOS to install Frotz using all three Unix interfaces: curses, SDL, and dumb.

1 Like

Confirming that the Mac build fixes work. Thanks.

Good!

I’ve crafted a Brew formula that seems to work well for building Frotz without sound support. Ignore the SHA256 lines in bottle do. I understand that the Brew people will fix those after my pull is accepted and processed. Doing brew install --build-from-source frotz should do it. Formulae for sound, SDL, and dumb are still pending.

class Frotz < Formula
  desc "Infocom-style interactive fiction player"
  homepage "https://gitlab.com/DavidGriffith/frotz"
  url "https://gitlab.com/DavidGriffith/frotz/-/archive/2.50b2/frotz-2.50b2.tar.gz"
  sha256 "228046edeca45867af312ebffd2e6a83ed8df69dd161fbaf4ea818f789328cba"
  head "https://gitlab.com/DavidGriffith/frotz.git"

  bottle do
    sha256 "a47f879a4475b7ca3b35e481ae220a672023178536a8453b0a27cc34a705919b" => :catalina
    sha256 "bd7d173c661883a5ad370c4f2437dfcda10e2852988e4a1b0b681ee19335ed97" => :mojave
    sha256 "f1be9afe41e33396475d99511760690d3a46f9362fb2229e42ba48146d92f8f0" => :high_sierra
    sha256 "e190264a540f03ec98b7be45d1edfc73c0bd4946b4d2c4aacdf98521354e4ca0" => :sierra
    sha256 "6506ec53859a859eb71ab33511a11e9c957e0749cb25efa06d63d6c80d000b4a" => :el_capitan
    sha256 "887efd67a050038ffb15df8c713eaa40fcbfcc69d36f58373981dba3ccae422b" => :yosemite
  end

  def install
    inreplace "Makefile" do |s|
      s.remove_make_var! "CC"
      s.change_make_var! "PREFIX", prefix
      s.change_make_var! "SYSCONFDIR", etc
      s.change_make_var! "MANDIR", share
    end

    system "make", "nosound"
    system "make", "install"
  end
end

Beta 3 is now available. This one addresses optimization problems and complaints for both Unix and DOS. Problems with save files under DOS are finally fixed. The build process for DOS is also much improved. You no longer have to do “make hash” to get things ready. All you need to do is “make dos” and you’ll get a zip file containing source code just for DOS Frotz. It’ll easily fit on a single 5.25" double-sided double-density floppy disk. You will, however, need a hard drive for running Turbo C. Compilation under DOSBOX or some other emulation will also work.

Blorb support for DOS is still unfinished. That’s planned for version 2.51.

1 Like

I tried compiling frotz-2.51 today on macOS Catalina 10.15.4 with Xcode 10.15.4 installed via the Mac App Store. When I ran make, it printed this error:

cc -Wall -std=c99 -O3  -g -D_XOPEN_SOURCE_EXTENDED -DMACOS -I/opt/local/include -D_DARWIN_C_SOURCE -D_XOPEN_SOURCE=600 -pthread   -fPIC -fpic -o ux_audio.o -c ux_audio.c
ux_audio.c:55:10: fatal error: 'ao/ao.h' file not found
#include <ao/ao.h>
         ^~~~~~~~~
1 error generated.
make[1]: *** [ux_audio.o] Error 1
make: *** [src/curses/frotz_curses.a] Error 2

Reading the INSTALL guide, I see that it says that libao is “necessary,” but the guide doesn’t say anything explicit about how one would install it and use it on macOS.

Taking zarf’s suggestion, I used Homebrew to brew install libao libmodplug libsamplerate libsndfile libvorbis. With that done, make on macOS worked just fine.

I’ve filed a merge request on Gitlab to recommend using Homebrew to install dependencies on macOS.

But, when it comes to that, macOS users might as well just brew install frotz with the Frotz formula, which someone has been dutifully maintaining.

Unfortunately, whoever created the Frotz formula for 2.50 disabled sound support.

So I’ve filed a Homebrew PR to re-enable sound support.

For my next trick, I tried compiling sfrotz.

make all failed with an SDL error, even though I have run brew install sdl2

/Applications/Xcode.app/Contents/Developer/usr/bin/make -C src/sdl
make[1]: pkg-config: Command not found
gcc -Wall -std=c99 -O3  -g  -D_XOPEN_SOURCE -fPIC -fpic -o sf_fonts.o -c sf_fonts.c
make[1]: pkg-config: Command not found
make[1]: pkg-config: Command not found
gcc -Wall -std=c99 -O3  -g  -D_XOPEN_SOURCE -fPIC -fpic -o sf_msg_en.o -c sf_msg_en.c
make[1]: pkg-config: Command not found
make[1]: pkg-config: Command not found
gcc -Wall -std=c99 -O3  -g  -D_XOPEN_SOURCE -fPIC -fpic -o sf_resource.o -c sf_resource.c
make[1]: pkg-config: Command not found
sf_resource.c:33:10: fatal error: 'SDL.h' file not found
#include <SDL.h>
         ^~~~~~~
1 error generated.
make[1]: *** [sf_resource.o] Error 1
make: *** [src/sdl/frotz_sdl.a] Error 2

Seems like SDL Frotz doesn’t/can’t compile on macOS?

I see the “pkg-config: command not found” in your output. I seem to remember that you may need to install pkg-config using brew. I’m not completely sure about that. I installed a frankenmac virtual machine when I was trying to help with getting frotz to compile everywhere, and I’m pretty sure the sdl version can be built, but I remember it wasn’t trivial.

Are you using the 2.51 tarball? There have been quite a bit of MacOS fixes since then. I suppose there are enough fixes here and there to warrant releasing 2.52.

Thanks! That did the trick. I’ve filed another merge request to suggest which Homebrew libraries to install to build SDL frotz.

I’ve also updated my Homebrew PR to include steps to build the SDL version.

Just dropping in a note to say that I was able to build SDL Frotz on macOS High Sierra 10.13.6 with the latest code (most recent commit on 2020/04/24). I had been having trouble building due to an include problem with SDL.h – similar to Dan’s error above. The instructions in the INSTALL file indicating which brew packages need to be installed did the trick. I had sdl2 installed, but one of the other packages filled in the right gaps.

Locking this because Frotz 2.50 beta is history.