From: David Griffith Date: Thu, 27 Apr 2023 23:31:29 +0000 (-0700) Subject: Moved the tandy bit option to the core. X-Git-Url: https://scope-eye.net/git/?a=commitdiff_plain;h=58b7acd5193f5e5f0df550122930b3a99f951bf5;p=liskon_frotz.git Moved the tandy bit option to the core. --- diff --git a/src/common/setup.h b/src/common/setup.h index d18a0c1..59546b6 100644 --- a/src/common/setup.h +++ b/src/common/setup.h @@ -27,6 +27,7 @@ typedef struct frotz_setup_struct { int ignore_errors; int interpreter_number; int piracy; + int tandy; int undo_slots; int expand_abbreviations; int script_cols; diff --git a/src/curses/ux_init.c b/src/curses/ux_init.c index 8044aa1..8da63b5 100644 --- a/src/curses/ux_init.c +++ b/src/curses/ux_init.c @@ -371,7 +371,7 @@ static void parse_options(int argc, char **argv) case 'R': f_setup.restricted_path = strndup(zoptarg, PATH_MAX); break; case 's': u_setup.random_seed = atoi(zoptarg); break; case 'S': f_setup.script_cols = atoi(zoptarg); break; - case 't': u_setup.tandy_bit = 1; break; + case 't': f_setup.tandy = 1; break; case 'u': f_setup.undo_slots = atoi(zoptarg); break; case 'v': print_version(); os_quit(EXIT_SUCCESS); break; case 'w': u_setup.screen_width = atoi(zoptarg); break; @@ -480,7 +480,7 @@ void os_init_screen (void) /* It's nice to know what terminal we have to work with. */ u_setup.term = strdup(getenv("TERM")); - if (z_header.version == V3 && u_setup.tandy_bit != 0) + if (z_header.version == V3 && f_setup.tandy != 0) z_header.config |= CONFIG_TANDY; if (z_header.version == V3) @@ -940,7 +940,7 @@ static int getconfig(char *configfile) f_setup.sound = getbool(value); } else if (strcmp(varname, "tandy") == 0) { - u_setup.tandy_bit = getbool(value); + f_setup.tandy = getbool(value); } else if (strcmp(varname, "expand_abb") == 0) { f_setup.expand_abbreviations = getbool(value); @@ -1169,7 +1169,6 @@ void os_init_setup(void) u_setup.screen_height = -1; u_setup.random_seed = -1; u_setup.random_seed = -1; - u_setup.tandy_bit = 0; u_setup.current_text_style = 0; /* Since I can't use attr_get, which would make things easier, I need diff --git a/src/curses/ux_setup.h b/src/curses/ux_setup.h index 8420cba..073d83d 100644 --- a/src/curses/ux_setup.h +++ b/src/curses/ux_setup.h @@ -12,7 +12,6 @@ typedef struct unix_setup_struct { int screen_width; int screen_height; int random_seed; - int tandy_bit; int current_text_style; /* also in ux_text.c and ux_screen.c */ int curses_active; int plain_ascii; diff --git a/src/dos/dosfrotz.h b/src/dos/dosfrotz.h index e1d3c4d..909fd29 100644 --- a/src/dos/dosfrotz.h +++ b/src/dos/dosfrotz.h @@ -101,7 +101,6 @@ extern int user_reverse_bg; extern int user_reverse_fg; extern int user_screen_height; extern int user_screen_width; -extern int user_tandy_bit; extern int user_bold_typing; extern int user_random_seed; extern int user_font; diff --git a/src/dos/dosinit.c b/src/dos/dosinit.c index a597c44..130c664 100644 --- a/src/dos/dosinit.c +++ b/src/dos/dosinit.c @@ -83,7 +83,6 @@ int user_reverse_bg = -1; int user_reverse_fg = -1; int user_screen_height = -1; int user_screen_width = -1; -int user_tandy_bit = -1; int user_random_seed = -1; int user_font = 1; @@ -330,7 +329,7 @@ static void parse_options(int argc, char **argv) if (c == 'S') f_setup.script_cols = num; if (c == 't') - user_tandy_bit = 1; + f_setup.tandy = 1; if (c == 'u') f_setup.undo_slots = num; if (c == 'v') { @@ -711,7 +710,7 @@ static void standard_palette(void) /* Set various bits in the configuration byte. These bits tell the game which features are supported by the interpreter. */ - if (z_header.version == V3 && user_tandy_bit != -1) + if (z_header.version == V3 && f_setup.tandy != -1) z_header.config |= CONFIG_TANDY; if (z_header.version == V3) z_header.config |= CONFIG_SPLITSCREEN; diff --git a/src/dumb/dinit.c b/src/dumb/dinit.c index a865caa..2a9cd4c 100644 --- a/src/dumb/dinit.c +++ b/src/dumb/dinit.c @@ -55,7 +55,6 @@ While running, enter \"\\help\" to list the runtime escape sequences.\n" static int user_text_width = 80; static int user_text_height = 24; static int user_random_seed = -1; -static int user_tandy_bit = 0; static bool plain_ascii = FALSE; bool quiet_mode; @@ -152,7 +151,7 @@ void os_process_arguments(int argc, char *argv[]) f_setup.script_cols = atoi(zoptarg); break; case 't': - user_tandy_bit = 1; + f_setup.tandy = 1; break; case 'u': f_setup.undo_slots = atoi(zoptarg); @@ -268,7 +267,7 @@ void os_process_arguments(int argc, char *argv[]) void os_init_screen(void) { - if (z_header.version == V3 && user_tandy_bit) + if (z_header.version == V3 && f_setup.tandy) z_header.config |= CONFIG_TANDY; if (z_header.version >= V5 && f_setup.undo_slots == 0) diff --git a/src/sdl/sf_resource.c b/src/sdl/sf_resource.c index 7dc0b02..e3309dd 100644 --- a/src/sdl/sf_resource.c +++ b/src/sdl/sf_resource.c @@ -46,7 +46,6 @@ extern FILE *blorb_fp; /* various data */ -bool m_tandy = 0; int m_v6scale_x; int m_v6scale_y; double m_gfxScale_w = 1.0; @@ -425,7 +424,7 @@ void sf_readsettings(void) sf_GetProfileInt("Interpreter", "Ignore Errors", 0); f_setup.expand_abbreviations = sf_GetProfileInt("Interpreter", "Expand Abbreviations", 0); - m_tandy = + f_setup.tandy = sf_GetProfileInt("Interpreter", "Tandy Bit", 0) ? true : false; f_setup.script_cols = sf_GetProfileInt("Interpreter", "Wrap Script Lines", 1) ? 80 : 0; @@ -671,7 +670,7 @@ void os_init_screen(void) if (z_header.version == V3) { z_header.config |= CONFIG_SPLITSCREEN; z_header.config |= CONFIG_PROPORTIONAL; - if (m_tandy) + if (f_setup.tandy) z_header.config |= CONFIG_TANDY; else z_header.config &= ~CONFIG_TANDY; diff --git a/src/sdl/sf_util.c b/src/sdl/sf_util.c index e5d7f54..ef5644e 100644 --- a/src/sdl/sf_util.c +++ b/src/sdl/sf_util.c @@ -129,7 +129,6 @@ int user_reverse_bg = -1; int user_reverse_fg = -1; int user_screen_height = -1; int user_screen_width = -1; -int user_tandy_bit = -1; int user_font = 1; int m_random_seed = -1; int m_fullscreen = -1; @@ -356,7 +355,7 @@ static void parse_options(int argc, char **argv) if (c == 'S') f_setup.script_cols = num; if (c == 't') - user_tandy_bit = 1; + f_setup.tandy = 1; if (c == 'T') sf_osdialog = NULL; if (c == 'u') @@ -520,8 +519,6 @@ void os_process_arguments(int argc, char *argv[]) m_defaultBack = sf_GetColour(user_background); if (user_foreground != -1) m_defaultFore = sf_GetColour(user_foreground); - if (user_tandy_bit != -1) - m_tandy = user_tandy_bit; sf_initfonts(); } /* os_process_arguments */ diff --git a/src/x11/x_init.c b/src/x11/x_init.c index c4b0c24..a4c3a8d 100644 --- a/src/x11/x_init.c +++ b/src/x11/x_init.c @@ -42,7 +42,6 @@ x_setup_t x_setup; static int saved_argc; static char **saved_argv; static char *user_bg, *user_fg; -static int user_tandy_bit; static int user_random_seed = -1; char *x_class; char *x_name; @@ -237,7 +236,7 @@ void os_process_arguments(int argc, char *argv[]) {".Piracy", ".piracy", parse_boolean, &f_setup.piracy}, {".Tandy", ".tandy", parse_boolean, - &x_setup.tandy_bit}, + &f_setup.tandy}, {".UndoSlots", ".undoSlots", parse_int, &f_setup.undo_slots}, {".ShowVersion", ".showVersion", parse_boolean, @@ -430,7 +429,7 @@ void os_init_screen(void) XGCValues gc_setup; /* First, configuration parameters get set up */ - if (z_header.version == V3 && user_tandy_bit != 0) + if (z_header.version == V3 && f_setup.tandy != 0) z_header.config |= CONFIG_TANDY; if (z_header.version == V3) z_header.config |= CONFIG_SPLITSCREEN | CONFIG_PROPORTIONAL; diff --git a/src/x11/x_setup.h b/src/x11/x_setup.h index 6e4a370..a4257b7 100644 --- a/src/x11/x_setup.h +++ b/src/x11/x_setup.h @@ -5,7 +5,6 @@ typedef struct x_setup_struct { int background_color; int foreground_color; int random_seed; - int tandy_bit; } x_setup_t; extern x_setup_t x_setup;