Unix Frotz and DOS Frotz development


#21

I have a bug : without new line, the word is not displayed ; with new line, the word is displayed.
FROTZ V2.45pre Audio output disabled.
LUbuntu 16.04.5 LTS

[ Main; print "Hello"; ];The word is not displayed.

[ Main; print "Hello^"; ];The word is displayed.


(Petter Sjölund) #22

Very late to the party, but if anyone is still wondering, Dumb Frotz builds just fine with the current GitLab code on my computer with macOS 10.12.6.

One warning: $ make dfrotz ** Generating src/common/defs.h ** Generating src/common/version.c ** Generating src/common/git_hash.h /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: frotz_common.a(missing.o) has no symbols /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: frotz_common.a(missing.o) has no symbols dumb_input.c:147:39: warning: implicit conversion from 'int' to 'char' changes value from 142 to -114 [-Wconstant-conversion] case '0': *dest++ = ZC_FKEY_MIN + 9; break;


(David Griffith) #23

Bug issue filed at gitlab.com/DavidGriffith/frotz/issues/84
It appears to affect the Frotz core. Windows Frotz behaves the same way.

[edit]
Fixed.

The problem is that the Frotz core usually won’t flush the buffer until a newline (ZC_RETURN) is encountered. When the test program that provokes bad behavior ends, there are still characters in the buffer and then Frotz happily exits without those characters being flushed out. I suspect nobody found this bug until now because the final character has usually been a newline. Once I worked out what was going wrong, the fix was simple. I recommend all maintainers of the other Frotz ports to adopt this fix.


(David Griffith) #24

What compiler are you using? I’m guessing Clang, because GCC doesn’t have a “-Wconstant-conversion” flag. If I specify Clang on Linux, I don’t get that warning, but instead this:

dumb_output.c:301:38: warning: data argument not used by format string [-Wformat-extra-args]
        printf((row == -1) ? ".." : "%02d", (row + 1) % 100);
                             ~~~~           ^
1 warning generated.

which is caused by a funky, though legal, use of the ternary operator.

Anyhow, I’ve pushed fixes for both of these complaints to the Gitlab repo.


(Petter Sjölund) #25

Yes, this is with the built-in Clang of Xcode 9.2 on macOS 10.12.6. Apple is notorious for using older versions of Clang in Xcode, so it is possible that the difference you see is due to using a more up-to-date Clang.


#26

I recompiled the latest version of Frotz and it shows me as version name: none.

And it looks like you’re using the sdl2 library, but for the images it’s sdl1.2; I don’t know if this matters?


(David Griffith) #27

How did you download and build Frotz? What happens when you type “frotz -v”? Two ways I’m aware that that “none” will show up are 1) you try to build from a Git repository without the Git binary being in your path or 2) try to make a distribution tarball the wrong way. The proper way to make a distribution tarball is to do “make dist”, which will alter the Makefile to replace those “none” strings with appropriate data provided by Git.

$ ldd sfrotz | grep -i sdl
        libSDL2_mixer-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libSDL2_mixer-2.0.so.0 (0x00007ff50e9bd000)
        libSDL2-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0 (0x00007ff50e6a1000)

My machine is just pulling in SDL2. What does “ldd sfrotz” give you?


#28

I downloaded from GitLab frotz-master.tar.gz
gitlab.com/DavidGriffith/frotz/ … ter.tar.gz
I extract frotz-master directory to my Desk
I’m going in this one and type make.

FROTZ Vnone Curses interface. Audio output enabled. Build: 20180909.62452 Git commit: none Git tag: none Git branch: none Frotz was originally written by Stefan Jokisch. It complies with standard 1.0 of Graham Nelson's specification. It was ported to Unix by Galen Hazelwood. The core and Unix port are currently maintained by David Griffith. Frotz's homepage is https://661.org/proj/if/frotz/

libSDL2_mixer-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libSDL2_mixer-2.0.so.0 (0x00007f420b7b3000) libSDL2-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0 (0x00007f420b4a0000) For SDL I must have been wrong, it seemed to me that he refused to compile without libsdl-image1.2-dev. But not!


(David Griffith) #29

You’ll need to clone the repository and build from there. The Git info is lost when you download a tarball. I’ve filed an issue with Gitlab asking if there’s some way I can have the Gitlab server run a script to take care of this prior to gathering files into a tarball.


#30

About Constant NO_SCORE:
without Constant NO_SCORE, Frotz displays Score and Moves;
with Constant NO_SCORE, Frotz displays only Moves but Windows Frotz and Gargoyle Bocfel displays nothing.
Who is right?
ReleaseNotes.html for the compiler says:


(David Griffith) #31

I can’t fathom how Windows Frotz and Bocfel do this because the printing of the score and move count is entirely up to the Inform6 Library. NO_SCORE was introduced by Graham back in version 6/11. I tried some other interpreters including Glulxe, Git (glulx terp), Fizmo, glkzip, nitfol, and jzip.

I’d say that Windows Frotz and Bocfel are misbehaving.


#32

Could something be mis-measuring the window so that it wants to print it but doesn’t think there’s space?


(Andrew Plotkin) #33

Or it’s measuring the window correctly and deliberately omitting the Moves line if the window is too narrow?


#34

As has been speculated, this appears to be a window width issue. At 66 columns, “Moves” disappears from the status bar in the program below (thanks to David Griffith for sending it to me). I’ve reproduced this both with Bocfel (Gargoyle) and Frotz (Curses). As such I suspect it to be something Inform is doing.

At the very least it probably means I should bump the default number of columns in Gargoyle up from its current value of 60.

To reproduce:

Constant NO_SCORE;
Include "parser";
Include "verblib";

Object here "Here or anywhere"
   with description "You are somewhere.",
   has light;

Object ball "ball" here
   with name 'ball';

Object rock "rock" here
   with name 'rock';

[ Initialise; location = here; ];
Include "grammar";

(David Griffith) #35

That’s exactly what’s happening. Here are the relevant lines from parser.h:

        if (width > 66) {
            #Ifndef NO_SCORE;
            MoveCursor(1, posa);
            print (string) SCORE__TX, sline1;
            #Endif;
            MoveCursor(1, posb);
            print (string) MOVES__TX, sline2;
        }
        #Ifndef NO_SCORE;
        if (width > 53 && width <= 66) {
            MoveCursor(1, posb);
            print sline1, "/", sline2;
        }
        #Endif;

Most of Infocom’s games seem to change from “Score:” and “Moves:” to “S:” and “M:” at 54 columns or fewer, so I’ll look at changing the Library to do that instead,


#36

Some Infocom games on apple 2e show Score: 0/0 instead of Score: 0 Moves: 0.
(Without Constant NO_SCORE: Score: 0/0; with Constant NO_SCORE: Moves: 0; it’s nice.)
From which Z-machine computer (Trs-80, C64, PC, etc.) Infocom games comes the design of Inform games?


(Daniel Stelzer) #37

I’m going to hazard a guess that those are the earlier games, like the Zorks?


#38

Yes, but on which computer and with which Z-machine design? There are differences in text design from one Z-machine computer to another.


(Daniel Stelzer) #39

Sorry, I’m not quite sure I understand your question?

In early Z-machine versions (3 and earlier) the status line is handled completely by the interpreter: it displays the name of the object referenced by a certain global variable on the left, and either score/moves or hours:minutes from two globals on the right (choice of format based on a header flag). The exact formatting is up to the interpreter, so it can vary widely across systems.

In version 4 and onward, the status line is handled by the game: the interpreter just provides a system to draw whatever the game wants. Which might be a classic v3-esque status line, or just the location name centered (as in Trinity), or anything else.

So my guess is, the only games whose status lines vary across interpreters are the v3 and previous ones. And for those, it’s up to the interpreter writers rather than the game writers to decide how modern terps should display them.

Apologies if this is all old information to you: just let me know if I misunderstood your question!


#40

Thank you for your answer. The answers on this forum are always interesting, even if the question is bad and in very bad English.