From afcf8b45c6bc87433f7c0bc2f664f7126e93b17d Mon Sep 17 00:00:00 2001 From: David Griffith Date: Sun, 15 Jan 2012 19:25:54 -0800 Subject: [PATCH] First batch of sdl-frotz changes --- Makefile | 35 +++- src/common/frotz.h | 14 +- src/common/main.c | 1 + src/common/screen.c | 11 +- src/curses/ux_init.c | 4 +- src/curses/ux_screen.c | 10 +- src/dumb/dumb_init.c | 2 +- src/dumb/dumb_output.c | 10 +- src/sdl/sf_font3.c | 1 + src/sdl/sf_fonts.c | 8 +- src/sdl/sf_frotz.h | 26 +++ src/sdl/sf_images.c | 2 +- src/sdl/sf_resource.c | 14 +- src/sdl/sf_sound.c | 2 +- src/sdl/sf_util.c | 28 +-- src/sdl/sf_video.c | 4 +- src/sdl/sfrotzmanual.html | 376 -------------------------------------- 17 files changed, 118 insertions(+), 430 deletions(-) delete mode 100644 src/sdl/sfrotzmanual.html diff --git a/Makefile b/Makefile index 28e871c..9abd506 100644 --- a/Makefile +++ b/Makefile @@ -94,6 +94,12 @@ CURSES = -lcurses # #EXTENSION = .exe +SDLINC = `sdl-config --cflags` +FTCFLAGS = `freetype-config --cflags` +FTLIBS = `freetype-config --libs` + +SDL_DEFS = $(SDLINC) $(FTCFLAGS) $(FTLIBS) +SDL_LIBS = -ljpeg -lpng -lz -lSDL -lSDL_mixer ##################################################### # Nothing under this line should need to be changed. @@ -184,13 +190,12 @@ CURSES_DEFS = $(OPT_DEFS) $(COLOR_DEFS) $(SOUND_DEFS) $(SOUNDCARD) \ FLAGS = $(OPTS) $(CURSES_DEFS) $(INCL) + $(NAME): $(NAME)-curses curses: $(NAME)-curses -$(NAME)-curses: soundcard.h $(COMMON_TARGET) $(CURSES_TARGET) $(BLORB_TARGET) +$(NAME)-curses: $(COMMON_TARGET) $(CURSES_TARGET) $(BLORB_TARGET) $(CC) -o $(BINNAME)$(EXTENSION) $(TARGETS) $(LIB) $(CURSES) $(SOUND_LIB) -all: $(NAME) d$(NAME) - dumb: $(NAME)-dumb d$(NAME): $(NAME)-dumb $(NAME)-dumb: $(COMMON_TARGET) $(DUMB_TARGET) @@ -198,14 +203,30 @@ $(NAME)-dumb: $(COMMON_TARGET) $(DUMB_TARGET) sdl: $(NAME)-sdl s$(NAME): $(NAME)-sdl -$(NAME)-sdl: $(COMMON_TARGET) $(SDL_TARGET) - $(CC) -o s$(BINNAME) $(COMMON_TARGET) $(SDL_TARGET) $(SDL_LIBS) +$(NAME)-sdl: $(COMMON_TARGET) $(SDL_TARGET) $(BLORB_TARGET) + $(CC) -o s$(BINNAME) $(COMMON_TARGET) $(SDL_TARGET) $(BLORB_TARGET) $(SDL_LIBS) + +all: $(NAME) d$(NAME) + .SUFFIXES: .SUFFIXES: .c .o .h -.c.o: - $(CC) $(FLAGS) $(CFLAGS) -o $@ -c $< +$(COMMON_OBJECT): %.o: %.c + $(CC) $(COMMON_DEFS) -o $@ -c $< + +$(BLORB_OBJECT): %.o: %.c + $(CC) -o $@ -c $< + +$(DUMB_OBJECT): %.o: %.c + $(CC) -o $@ -c $< + +$(CURSES_OBJECT): %.o: %.c + $(CC) $(CURSES_DEFS) -o $@ -c $< + +$(SDL_OBJECT): %.o: %.c + $(CC) $(SDL_DEFS) -o $@ -c $< + # If you're going to make this target manually, you'd better know which # config target to make first. diff --git a/src/common/frotz.h b/src/common/frotz.h index a1c1a41..1d078b4 100644 --- a/src/common/frotz.h +++ b/src/common/frotz.h @@ -45,6 +45,8 @@ enum story { UNKNOWN }; +#include "setup.h" + typedef unsigned char zchar; /*** Constants that may be set at compile time ***/ @@ -169,6 +171,8 @@ typedef unsigned char zchar; #define SOUND_FLAG 0x0080 /* Game wants to use sound effects - V5+ */ #define MENU_FLAG 0x0100 /* Game wants to use menus - V6 */ +#define TRANSPARENT_FLAG 0x0001 /* Game wants to use transparency - V6 */ + #define INTERP_DEFAULT 0 #define INTERP_DEC_20 1 #define INTERP_APPLE_IIE 2 @@ -417,6 +421,9 @@ extern zword hx_table_size; extern zword hx_mouse_x; extern zword hx_mouse_y; extern zword hx_unicode_table; +extern zword hx_flags; +extern zword hx_fore_colour; +extern zword hx_back_colour; /*** Various data ***/ @@ -445,6 +452,8 @@ extern int mwin; extern int mouse_x; extern int mouse_y; +extern int menu_selected; +extern int mouse_button; extern bool enable_wrapping; extern bool enable_scripting; @@ -672,8 +681,8 @@ int os_char_width (zchar); void os_display_char (zchar); void os_display_string (const zchar *); void os_draw_picture (int, int, int); -void os_erase_area (int, int, int, int); -void os_fatal (const char *); +void os_erase_area (int, int, int, int, int); +void os_fatal (const char *, ...); void os_finish_with_sample (); int os_font_data (int, int *, int *); void os_init_screen (void); @@ -699,4 +708,3 @@ int os_string_width (const zchar *); void os_init_setup (void); int os_speech_output(const zchar *); -#include "setup.h" diff --git a/src/common/main.c b/src/common/main.c index f9486b0..84abdb0 100644 --- a/src/common/main.c +++ b/src/common/main.c @@ -37,6 +37,7 @@ extern void init_memory (void); extern void init_undo (void); extern void reset_memory (void); + /* Story file name, id number and size */ char *story_name = 0; diff --git a/src/common/screen.c b/src/common/screen.c index 713ec29..d12ab3a 100644 --- a/src/common/screen.c +++ b/src/common/screen.c @@ -425,7 +425,7 @@ void screen_erase_input (const zchar *buf) y = cwp->y_pos + cwp->y_cursor - 1; x = cwp->x_pos + cwp->x_cursor - 1; - os_erase_area (y, x, y + font_height - 1, x + width - 1); + os_erase_area (y, x, y + font_height - 1, x + width - 1, -1); os_set_cursor (y, x); } @@ -612,7 +612,8 @@ void erase_window (zword win) os_erase_area (y, x, y + wp[win].y_size - 1, - x + wp[win].x_size - 1); + x + wp[win].x_size - 1, + win); if (h_version == V6 && win != cwin && h_interpreter_number != INTERP_AMIGA) os_set_colour (lo (cwp->colour), hi (cwp->colour)); @@ -683,7 +684,7 @@ static void erase_screen (zword win) { int i; - os_erase_area (1, 1, h_screen_height, h_screen_width); + os_erase_area (1, 1, h_screen_height, h_screen_width, -2); if ((short) win == -1) { split_window (0); @@ -1002,7 +1003,7 @@ void z_erase_line (void) y = cwp->y_pos + cwp->y_cursor - 1; x = cwp->x_pos + cwp->x_cursor - 1; - os_erase_area (y, x, y + font_height - 1, x + pixels - 1); + os_erase_area (y, x, y + font_height - 1, x + pixels - 1, -1); }/* z_erase_line */ @@ -1034,7 +1035,7 @@ void z_erase_picture (void) y += cwp->y_pos - 1; x += cwp->x_pos - 1; - os_erase_area (y, x, y + height - 1, x + width - 1); + os_erase_area (y, x, y + height - 1, x + width - 1, -1); }/* z_erase_picture */ diff --git a/src/curses/ux_init.c b/src/curses/ux_init.c index 95cd6f7..e57c1a0 100644 --- a/src/curses/ux_init.c +++ b/src/curses/ux_init.c @@ -77,7 +77,7 @@ char semi_stripped_story_name[FILENAME_MAX+1]; * */ -void os_fatal (const char *s) +void os_fatal (const char *s, ...) { if (u_setup.curses_active) { @@ -440,7 +440,7 @@ void os_init_screen (void) if (h_flags & COLOUR_FLAG) h_flags &= ~COLOUR_FLAG; } os_set_colour(h_default_foreground, h_default_background); - os_erase_area(1, 1, h_screen_rows, h_screen_cols); + os_erase_area(1, 1, h_screen_rows, h_screen_cols, 0); }/* os_init_screen */ /* diff --git a/src/curses/ux_screen.c b/src/curses/ux_screen.c index 1b90379..c736e13 100644 --- a/src/curses/ux_screen.c +++ b/src/curses/ux_screen.c @@ -38,9 +38,13 @@ * Fill a rectangular area of the screen with the current background * colour. Top left coordinates are (1,1). The cursor does not move. * + * The final argument gives the window being changed, -1 if only a + * portion of a window is being erased, or -2 if the whole screen is + * being erased. This is not relevant for the curses interface. + * */ -void os_erase_area (int top, int left, int bottom, int right) +void os_erase_area (int top, int left, int bottom, int right, int win) { int y, x, i, j; @@ -122,7 +126,7 @@ void os_scroll_area (int top, int left, int bottom, int right, int units) move(y, x); } if (units > 0) - os_erase_area(bottom - units + 2, left + 1, bottom + 1, right + 1); + os_erase_area(bottom - units + 2, left + 1, bottom + 1, right + 1, 0); else if (units < 0) - os_erase_area(top + 1, left + 1, top - units, right + 1); + os_erase_area(top + 1, left + 1, top - units, right + 1, 0); }/* os_scroll_area */ diff --git a/src/dumb/dumb_init.c b/src/dumb/dumb_init.c index b2221a4..81f6e4d 100644 --- a/src/dumb/dumb_init.c +++ b/src/dumb/dumb_init.c @@ -192,7 +192,7 @@ int os_random_seed (void) void os_restart_game (int stage) {} -void os_fatal (const char *s) +void os_fatal (const char *s, ...) { fprintf(stderr, "\nFatal error: %s\n", s); exit(1); diff --git a/src/dumb/dumb_output.c b/src/dumb/dumb_output.c index d349db4..2460e2c 100644 --- a/src/dumb/dumb_output.c +++ b/src/dumb/dumb_output.c @@ -157,7 +157,7 @@ void dumb_discard_old_input(int num_chars) if (cursor_col < 0) cursor_col = 0; os_erase_area(cursor_row + 1, cursor_col + 1, - cursor_row + 1, cursor_col + num_chars); + cursor_row + 1, cursor_col + num_chars, -1); } void os_display_char (zchar c) @@ -196,7 +196,7 @@ void os_display_string (const zchar *s) } } -void os_erase_area (int top, int left, int bottom, int right) +void os_erase_area (int top, int left, int bottom, int right, int win) { int row, col; top--; left--; bottom--; right--; @@ -213,12 +213,12 @@ void os_scroll_area (int top, int left, int bottom, int right, int units) for (row = top; row <= bottom - units; row++) for (col = left; col <= right; col++) dumb_copy_cell(row, col, row + units, col); - os_erase_area(bottom - units + 2, left + 1, bottom + 1, right + 1); + os_erase_area(bottom - units + 2, left + 1, bottom + 1, right + 1, -1 ); } else if (units < 0) { for (row = bottom; row >= top - units; row--) for (col = left; col <= right; col++) dumb_copy_cell(row, col, row + units, col); - os_erase_area(top + 1, left + 1, top - units, right + 1); + os_erase_area(top + 1, left + 1, top - units, right + 1 , -1); } } @@ -530,6 +530,6 @@ void dumb_init_output(void) screen_data = malloc(screen_cells * sizeof(cell)); screen_changes = malloc(screen_cells); - os_erase_area(1, 1, h_screen_rows, h_screen_cols); + os_erase_area(1, 1, h_screen_rows, h_screen_cols, -2); memset(screen_changes, 0, screen_cells); } diff --git a/src/sdl/sf_font3.c b/src/sdl/sf_font3.c index 4113b2b..ac857e3 100644 --- a/src/sdl/sf_font3.c +++ b/src/sdl/sf_font3.c @@ -1,4 +1,5 @@ #include "sf_frotz.h" +#include static byte Zfont3[] = { /* 32*/ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, diff --git a/src/sdl/sf_fonts.c b/src/sdl/sf_fonts.c index 139059d..f7bda1e 100644 --- a/src/sdl/sf_fonts.c +++ b/src/sdl/sf_fonts.c @@ -461,7 +461,7 @@ static int charwidth( zword c, int *oh) * Return the length of the character in screen units. * */ -int os_char_width(zword c) +int os_char_width(zchar c) { int w, oh; w = charwidth( c, &oh); @@ -561,7 +561,7 @@ void os_set_text_style( int new_style) * ZC_NEW_FONT - next character is a new font * */ -int os_string_width(const zword *s) +int os_string_width(const zchar *s) { int width = 0, wacc = 0, oh = 0; zword c; @@ -594,7 +594,7 @@ int os_string_width(const zword *s) * Pass a string of characters to os_display_char. * */ -void os_display_string(const zword *s) +void os_display_string(const zchar *s) { zword c; while ((c = *s++) != 0) @@ -619,7 +619,7 @@ void os_display_string(const zword *s) * be scrolled after printing to the bottom right corner. * */ -void os_display_char(zword c) +void os_display_char(zchar c) { if (c == ZC_INDENT) { diff --git a/src/sdl/sf_frotz.h b/src/sdl/sf_frotz.h index 393d697..d0dbc77 100644 --- a/src/sdl/sf_frotz.h +++ b/src/sdl/sf_frotz.h @@ -245,3 +245,29 @@ struct CONVstruct { #endif + + + +/*** screen window ***/ + +typedef struct { + zword y_pos; + zword x_pos; + zword y_size; + zword x_size; + zword y_cursor; + zword x_cursor; + zword left; + zword right; + zword nl_routine; + zword nl_countdown; + zword style; + zword colour; + zword font; + zword font_size; + zword attribute; + zword line_count; + zword true_fore; + zword true_back; +} Zwindow; + diff --git a/src/sdl/sf_images.c b/src/sdl/sf_images.c index 745a547..18b0827 100644 --- a/src/sdl/sf_images.c +++ b/src/sdl/sf_images.c @@ -11,7 +11,7 @@ #include "png.h" #include -#include "blorblow.h" +#include "../blorb/blorblow.h" // static double m_gamma = DEFAULT_GAMMA; static byte toLinear[256]; diff --git a/src/sdl/sf_resource.c b/src/sdl/sf_resource.c index 712a4ff..46debc2 100644 --- a/src/sdl/sf_resource.c +++ b/src/sdl/sf_resource.c @@ -5,10 +5,12 @@ // for access() #include +#include + #include "sf_frotz.h" -#include "blorb.h" -#include "blorblow.h" +#include "../blorb/blorb.h" +#include "../blorb/blorblow.h" // various data @@ -444,12 +446,12 @@ void sf_readsettings(void) //printf("sf_readsettings\n"); h_interpreter_number = sf_GetProfileInt("Interpreter","Number",INTERP_AMIGA); - err_report_mode = sf_GetProfileInt("Interpreter","Error Reporting",ERR_REPORT_ONCE); - option_ignore_errors = sf_GetProfileInt("Interpreter","Ignore Errors",0); - option_expand_abbreviations = sf_GetProfileInt("Interpreter","Expand Abbreviations",0); + f_setup.err_report_mode = sf_GetProfileInt("Interpreter","Error Reporting",ERR_REPORT_ONCE); + f_setup.ignore_errors = sf_GetProfileInt("Interpreter","Ignore Errors",0); + f_setup.expand_abbreviations = sf_GetProfileInt("Interpreter","Expand Abbreviations",0); m_tandy = sf_GetProfileInt("Interpreter","Tandy Bit",0) ? true : false; m_quetzal = sf_GetProfileInt("Interpreter","Quetzal Format",1) ? true : false; - option_script_cols = sf_GetProfileInt("Interpreter","Wrap Script Lines",1) ? 80 : 0; + f_setup.script_cols = sf_GetProfileInt("Interpreter","Wrap Script Lines",1) ? 80 : 0; if ((p = sf_GetProfileString("Interpreter","SaveNames",NULL))) m_names_format = p[0]; diff --git a/src/sdl/sf_sound.c b/src/sdl/sf_sound.c index 29a8788..63d19df 100644 --- a/src/sdl/sf_sound.c +++ b/src/sdl/sf_sound.c @@ -5,7 +5,7 @@ #include #include "sf_frotz.h" -#include "blorblow.h" +#include "../blorb/blorblow.h" #include #include diff --git a/src/sdl/sf_util.c b/src/sdl/sf_util.c index f65f629..383b6a3 100644 --- a/src/sdl/sf_util.c +++ b/src/sdl/sf_util.c @@ -212,15 +212,15 @@ static void parse_options (int argc, char **argv) } if (c == 'a') - option_attribute_assignment = 1; + f_setup.attribute_assignment = 1; if (c == 'A') - option_attribute_testing = 1; + f_setup.attribute_testing = 1; if (c == 'b') user_background = num; if (c == 'B') option_scrollback_buffer = num; if (c == 'c') - option_context_lines = num; + f_setup.context_lines = num; if (c == 'D') { if (copt == 'k') m_reqW = -1; @@ -242,42 +242,42 @@ static void parse_options (int argc, char **argv) if (c == 'h') user_screen_height = num; if (c == 'i') - option_ignore_errors = 1; + f_setup.ignore_errors = 1; if (c == 'l') - option_left_margin = num; + f_setup.left_margin = num; if (c == 'L') m_localfiles = true; if (c == 'q') m_no_sound = 1; if (c == 'o') - option_object_movement = 1; + f_setup.object_movement = 1; if (c == 'O') - option_object_locating = 1; + f_setup.object_locating = 1; if (c == 'p') - option_piracy = 1; + f_setup.piracy = 1; if (c == 'r') - option_right_margin = num; + f_setup.right_margin = num; if (c == 'R') - option_save_quetzal = 0; + f_setup.save_quetzal = 0; if (c == 's') m_random_seed = num; if (c == 'S') - option_script_cols = num; + f_setup.script_cols = num; if (c == 't') user_tandy_bit = 1; if (c == 'T') sf_osdialog = NULL; if (c == 'u') - option_undo_slots = num; + f_setup.undo_slots = num; if (c == 'V') m_vga_fonts = 1; if (c == 'w') user_screen_width = num; if (c == 'x') - option_expand_abbreviations = 1; + f_setup.expand_abbreviations = 1; if (c == 'Z') if (num >= ERR_REPORT_NEVER && num <= ERR_REPORT_FATAL) - err_report_mode = num; + f_setup.err_report_mode = num; if (c == '?') optind = argc; } while (c != EOF && c != '?'); diff --git a/src/sdl/sf_video.c b/src/sdl/sf_video.c index 3fb86d9..4305eeb 100644 --- a/src/sdl/sf_video.c +++ b/src/sdl/sf_video.c @@ -707,7 +707,7 @@ zword sf_read_key( int timeout, int cursor, int allowed) * return it. Input aborts after timeout/10 seconds. * */ -zword os_read_key(int timeout, int cursor) +zchar os_read_key(int timeout, int cursor) { return sf_read_key(timeout,cursor,0); } @@ -779,7 +779,7 @@ static void addtoHistory( zword *buf) * to implement word completion (similar to tcsh under Unix). * */ -zword os_read_line(int max, zword *buf, int timeout, int width, int continued) +zchar os_read_line(int max, zchar *buf, int timeout, int width, int continued) { static int prev_pos = 0; static int prev_history = -1; diff --git a/src/sdl/sfrotzmanual.html b/src/sdl/sfrotzmanual.html deleted file mode 100644 index f7afd76..0000000 --- a/src/sdl/sfrotzmanual.html +++ /dev/null @@ -1,376 +0,0 @@ - - - - -Sfrotz manual (sort of...) -Copyright © 2011 Aldo Cumani
-Comments and bug reports to <sfrotz .at. writeme .dot. com> (apologies for the anti-spam-munging.)

- -This is just a preliminary draft of a manual. It refers to sfrotz v0.02
-This document is relased under the terms of the GNU Free Documentation License. - - -

1. Introduction

-Sfrotz is a Linux (though potentially cross-platform) port of the well-known z-code interpreter Frotz 2.40. Sfrotz uses SDL for video rendering and either SDL-mixer or MikMod for audio. While in principle Sfrotz should run on any platform supporting SDL, in practice it has only been extensively tested on Linux (Debian 5 lenny x86 and Debian 6 squeeze x64). - -

1.1 Installation

-Sfrotz is distributed in source form. Compiling the sources requires gcc (Mingw32 on Windows also works, more or less) and GNU make. The distribution does not currently include any configuration script, so the Makefile must be adapted by hand to the target system. - - -

2. Features

- - -

2.1 Blorb resources

-Sfrotz can render graphics (for V6 games) and sound effects packaged in a Blorb file (but see also the next section). As concerns pictures, Sfrotz supports both PNG and JPEG images. Regarding sound, AIFF sound effects, MOD songs and OGG music are currently supported, while SONG songs won't probably be ever supported. - - -

2.2 Non-Blorb resources

-Besides Blorb-packaged resources, Sfrotz can also render graphics and sound from individual files, provided the latter are either suitably named (e.g a common root with a numeric field specifying the resource number), or listed in a suitably formatted text file.
- -Note that this feature is not automatic, but must be enabled by the -L or -@ command line options. When the feature is enabled, resources found this way override those in the Blorb file, if present.
- -This feature can be useful to game designers, as it eases changing and adding resources without having to re-compile the Blorb file each time. The format of the list file used with the -@ option (see the Appendix) is identical to that of the BLC control file used by L. Ross Raszewski's iblorb package, so one can use the same list for compiling the final Blorb file for distribution. - - -

2.3 Truetype fonts

-Sfrotz can display text with Truetype or Type1 fonts, -using the FreeType2 rendering library. -The location of the -necessary font files must be specified in the setup file. Also, -antialiased rendering of Truetype fonts can be -specified. -Please note that this feature in Sfrotz is still experimental, -so don't expect -too much (e.g., kerning is not supported). - - -

2.4 Default fonts

-Sfrotz needs not Truetype fonts for working; in fact it has a default -monospaced font, based on an 8x16 VGA font, which can be used for both -the TEXT_FONT and the FIXED_FONT of the z-machine, with suitable -(though not very nice) modifications for the various styles. Even if -Truetype fonts are specified in the setup file, Sfrotz can be -forced to use the VGA font by the -V command -line switch. - -

3. Command line options

- -

3.1 Standard Frotz options

- -
-aFor game debugging: watch attribute setting.
- - -
-AFor game debugging: watch attribute testing.
- - -
-b colourSet the background colour. The colour argument -is the number of a z-machine colour, in the range 2..9:
- - - -
-c linesSet the number of context lines.
- - -
-f colourSet the foreground colour.
- - -
-h sizeSet the z-machine screen height (see the NOTE).
- - -
-iIgnore non-fatal runtime errors.
- - -
-l marginSet the left margin.
- - -
-oFor game debugging: watch object movement.
- - -
-OFor game debugging: watch object locating.
- - -
-pAlter the piracy opcode.
- - -
-r marginSet the right margin.
- - -
-RSave/restore in the old Frotz format.
- - -
-s seedSet the random number seed value.
- - -
-S widthSet the transcript width (in columns, default = 80).
- - -
-tSet the Tandy bit.
- - -
-u numberSet the number of slots for multiple undo (default: 500).
- - -
-w sizeSet the width of the z-machine screen to size (see the NOTE).
- - -
-xExpand abbreviations (g/x/z).
- - -
-Z levelSet the z-code error reporting level. Level can be: - - - - - -
0don't report errors
1report only the first error
2report all errors
3exit after any error
-
- - - -

3.2 Extended options

- -
-@listfileUse resource files listed in listfile.
- - -
-FRun in fullscreen mode (see NOTE).
- - -
-LUse local resource files.
- - -
-m msecsSet the timer interrupt cycle to msecs milliseconds, -instead of the default 100 (1/10 sec).
- - -
-N modeSet the mode for creating default file names for save/script etc.
- - -
-TUse traditional in-game requests for file names, intead of on-screen -dialogs.
- - -
-VForce the use of default monospaced VGA font.
- - - -

4. Hot keys

-Sfrotz supports the same hot keys as standard Frotz, plus the Ctl-Alt-X combination for immediate -exit, which may be used in case of emergency.
-Note that these hot keys are enabled only when the z-machine is waiting for line input (for z-machine experts: @read opcode), whith the exception of Ctl-Alt-X which also works in single character input mode (@read_char opcode).
- - -
Alt-Dset debugging options
- - -
Alt-Hhelp (print the list of hot keys)
- - -
Alt-Nnew game (restart)
- - -
Alt-Pplayback on
- - -
Alt-Rrecording on/off
- - -
Alt-Sset random number seed
- - -
Alt-Uundo one turn
- - -
Alt-Xexit game (after confirmation)
- - - -
Ctl-Alt-Xexit game immediately (no confirmation)
- - - -

5. The setup file

- -

5.1 Section [Interpreter]

- -
Number = numberSet the interpreter number (default is 4, i.e. Amiga Interpreter)
- - -
Error Reporting = levelSet the error reporting level (same as the -Z option)
- - -
Ignore Errors = 0/1Ignore (1) or not (0) non-fatal runtime errors.
- - -
Expand Abbreviations = 0/1Set/reset expansion of g/x/z abbreviations. Expansion is useful for old v1 -games which do not understand such abbreviations. Default: 0 (the -x option can set this switch.)
- - -
Tandy Bit = 0/1Set/reset the Tandy bit. Default: 0 (the -t option can set this switch.)
- - -
Quetzal Format = 0/1Save/restore in Quetzal format when set, in old Frotz format when reset. -Default: 1 (the -R option can only reset this switch.)
- - -
Wrap Script Lines = ncSet the width (number of columns) of the transcript to nc. Same -as -S option.
- - -
SaveNames = mode
- - -

5.2 Section [Window]

- -Sfrotz has a hardwired default screen size of 640x400. The screen size can be changed by the values in this section, by the values found in the Reso chunck of a Blorb file, and finally by the -w and -h command line options (in that order). Note however that Sfrotz shall refuse to set a screen width less than 640 and/or a height less than 400.
-NOTE: for normal (windowed) usage, the screen size should obviously be less than the PC screen resolution (taking into account also window decorations, taskbars etc.) For fullscreen usage, the size should preferably be one of those supported by the PC video driver; otherwise, SDL shall try to use the next higher available resolution, with black borders around the z-machine screen. In fullscreen mode, however, it may happen that for some strange resolutions SDL accepts the request, but the screen goes blank... In such a case, you may shut down the program by pressing Ctrl-Alt-X.

- -
AcWidth = widthSet the screen width (default: 640)
- - -
AcHeight = heightSet the screen height (default: 400)
- - -

5.3 Section [Display]

-This section is for future developments. - -

5.4 Section [Fonts]

- -
antialias = 0/1Set antialiased rendering -of Truetype fonts off (0) or on (nonzero). Note that this option cannot -be overridden by a command line switch.
- - -
fontdir = folderSpecify the directory containing the Truetype fonts.
- -

The following eight statements specify the eight font faces used by the z-machine (not counting the -so-called graphics font used in Beyond Zork, which is hardwired in the program), that is the normal TEXT_FONT and the monospaced FIXED_FONT, each in four styles (roman, bold, italic and bold+italic). A single face is specified by the file name (with its suffix!), optionally followed by an @ sign and a number, indicating the font size in pixels (default is 14). Multiple face files can be specified, separated by pipe (|) characters; Sfrotz shall use the first one it finds (see the example in the Appendix). This feature allows e.g. to use the same setup file on different systems.

- -
textroman = fontspecSet the font file for TEXT_FONT, -roman style
- - -
textbold = fontspecSet the font file for TEXT_FONT, bold style
- - -
textitalic = fontspecSet the font file for TEXT_FONT, italic style
- - -
textbolditalic = fontspecSet the font file for TEXT_FONT, bold and italic -style
- - -
fixedroman = fontspecSet the font file for FIXED_FONT, roman style
- - -
fixedbold = fontspecSet the font file for FIXED_FONT, bold style
- - -
fixeditalic = fontspecSet the font file for FIXED_FONT, italic style
- - -
fixedbolditalic = fontspecSet the font file for FIXED_FONT, bold and -italic style
- - -

5.5 Section [Resources]

- -
Dir = folderSpecify the folder for individual graphics/sound resource files.
- -

-The following two statements specify the templates for the names of individual picture/sound files. -Each template must contain exactly one C-style decimal format specifier (e.g. Pict%d) to be substituted by the resource number. -

- -
Pict = templateTemplate for picture resource files.
- - -
Snd = templateTemplate for sound resource files.
- - - -

6. Credits

-The original Frotz code was designed by Stefan Jokisch.
-This port is heavily based on the Windows port by David Kinder.
-The Blorb resource format and related software are by Andrew Plotkin.
-The Simple DirectMedia Layer library is the work of Sam Lantinga.
-TrueType font rendering relies on the freetype2 library.
-Sound and music are rendered by the MikMod library.
-PNG format images are decoded using libpng and zlib.
-JPEG format images are decoded using the IJG software, whose authors kindly request us to state that
-"This software is based in part on the work of the Independent JPEG Group." - -

Apologies to all those people and/or organisations who should have been mentioned, and were not :( -
- - -

7. Appendix

- -

7.1 Example setup file

-

-# The # denotes the start of a comment
-# Everything after the # is ignored, up to the end of the line
-
-[Interpreter]
-SaveNames=date
-
-[Window]
-# The following entries are commented out
-# but they are the same as the hardwired defaults, anyway
-#AcWidth = 640
-#AcHeight = 400
-
-[Display]
-
-[Fonts]
-antialias=1
-fontdir=/usr/share/fonts/truetype/freefont
-textroman=arial.ttf@16|FreeSans.ttf@16
-textbold=arialbd.ttf@16|FreeSansBold.ttf@16
-textitalic=ariali.ttf@16|FreeSansOblique.ttf@16
-textbolditalic=arialbi.ttf@16|FreeSansBoldOblique.ttf@16
-fixedroman=cour.ttf@16|FreeMono.ttf@16
-fixedbold=courbd.ttf@16|FreeMonoBold.ttf@16
-fixeditalic=couri.ttf@16|FreeMonoOblique.ttf@16
-fixedbolditalic=courbi.ttf@16|FreeMonoBoldOblique.ttf@16
-
-[Resources]
-Dir=./        # the current dir
-Pict=PIC%d    # i.e. PIC1, PIC2, ...
-Snd=SND%d     # i.e. SND3, SND4, ...
-
-
- -

7.2 Example BLC file

-

-Exec 0 ZCOD ani.z6
-
-Snd 13 FORM busyalone.au.aiff
-Snd 12 FORM s0020.au.aiff
-Snd 11 FORM s0154.au.aiff
-Snd 10 FORM s1484.au.aiff
-
-Pict 10 PNG edleft.png0.png
-Pict 11 PNG edleft.png1.png
-Pict 12 PNG edleft.png2.png
-Pict 13 PNG edleft.png3.png
-Pict 14 PNG edleft.png4.png
-Pict 15 PNG edleft.png5.png
-
-Pict 16 PNG lauhoh.png0.png
-Pict 17 PNG lauhoh.png1.png
-Pict 18 PNG lauhoh.png2.png
-
-Pict 19 PNG edfront.png0.png
-Pict 20 PNG edfront.png1.png
-Pict 21 PNG edfront.png2.png
-Pict 22 PNG edfront.png3.png
-Pict 23 PNG edfront.png4.png
-Pict 24 PNG edfront.png5.png
-
-Pict 25 PNG hoagie.png0.png
-Pict 26 PNG hoagie.png1.png
-
-Pict 30 PNG dott0.png
-
- - -- 2.34.1