Moved the tandy bit option to the core.
authorDavid Griffith <dave@661.org>
Thu, 27 Apr 2023 23:31:29 +0000 (16:31 -0700)
committerDavid Griffith <dave@661.org>
Thu, 27 Apr 2023 23:31:29 +0000 (16:31 -0700)
src/common/setup.h
src/curses/ux_init.c
src/curses/ux_setup.h
src/dos/dosfrotz.h
src/dos/dosinit.c
src/dumb/dinit.c
src/sdl/sf_resource.c
src/sdl/sf_util.c
src/x11/x_init.c
src/x11/x_setup.h

index d18a0c1f6ffcec562bfdc970eae65b952807cc9f..59546b6f1091aa137b2defa1a96923868ac301dd 100644 (file)
@@ -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;
index 8044aa16531d176556aa9dad477fd9d2019ce2ae..8da63b535909db40a611a8a56e870f0db6e168c8 100644 (file)
@@ -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
index 8420cbaca7fe21a4c7a49522e4b216c4c549228f..073d83db3d2aa86186052aff9680287e011a25a6 100644 (file)
@@ -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;
index e1d3c4d8a5b6a8ed2de2e2d631fb03a1b0ae8631..909fd29663768a5b9b52f93da3faecd5881a352e 100644 (file)
@@ -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;
index a597c44879c792d8e0c0a41ba1dae18785a0b742..130c66400032447d56e3689e06198707eb3d091d 100644 (file)
@@ -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;
index a865caa97c48953d8bdca9be7d77a4e0824f4777..2a9cd4c603775eb59f2c5c78e0b9374e637a36f6 100644 (file)
@@ -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)
index 7dc0b024284c5afd4e03153090dc051b38caa5ac..e3309dd188068b3f139baab69729bd8d9dcf9a75 100644 (file)
@@ -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;
index e5d7f547b38474b8063295e0de60f210f08977d6..ef5644e4c9b121392ce814d3c30c83bb10199c1e 100644 (file)
@@ -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 */
index c4b0c246c08e7e452410a70d9676088e64be4033..a4c3a8d6a974aa9aad8959d7ba444f230ae89a55 100644 (file)
@@ -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;
index 6e4a370226787dde3ae2e1210143a58898aeb22e..a4257b7c51ab262acb4dccbc257c945b4119c287 100644 (file)
@@ -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;