UNKNOWN
};
+/*** 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;
+
+
#include "setup.h"
typedef unsigned char zchar;
void storeb (zword, zbyte);
void storew (zword, zword);
+
+ /*** returns the current window ***/
+Zwindow * curwinrec( void);
+
+
/*** Interface functions ***/
void os_beep (int);
static int input_window = 0;
-static 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;
-} wp[8], *cwp;
+static Zwindow wp[8], *cwp = wp;
+
+Zwindow * curwinrec() { return cwp;}
/*
update_attributes ();
}/* z_window_style */
+
+/*
+ * get_window_colours
+ *
+ * Get the colours for a given window.
+ *
+ */
+
+void get_window_colours (zword win, zbyte* fore, zbyte* back)
+{
+
+ *fore = lo (wp[win].colour);
+ *back = hi (wp[win].colour);
+
+}/* get_window_colours */
+
+/*
+ * get_window_font
+ *
+ * Get the font for a given window.
+ *
+ */
+
+zword get_window_font (zword win)
+{
+ zword font = wp[win].font;
+
+ if (font == TEXT_FONT)
+
+ if (h_version != V6) {
+
+ if (win != 0 || h_flags & FIXED_FONT_FLAG)
+
+ font = FIXED_WIDTH_FONT;
+
+ } else {
+
+ if (wp[win].style & FIXED_WIDTH_STYLE)
+
+ font = FIXED_WIDTH_FONT;
+
+ }
+
+ return font;
+
+}/* get_window_font */
+
+/*
+ * colour_in_use
+ *
+ * Check if a colour is set in any window.
+ *
+ */
+
+int colour_in_use (zword colour)
+{
+ int max = (h_version == V6) ? 8 : 2;
+ int i;
+
+ for (i = 0; i < max; i++) {
+
+ zword bg = hi (wp[i].colour);
+ zword fg = lo (wp[i].colour);
+
+ if (colour == fg || colour == bg)
+ return 1;
+
+
+ }
+
+ return 0;
+
+}/* colour_in_use */
+
+/*
+ * get_current_window
+ *
+ * Get the currently active window.
+ *
+ */
+
+zword get_current_window (void)
+{
+
+ return cwp - wp;
+
+}/* get_current_window */
+
#include <stdarg.h>
#include "sf_frotz.h"
-
#include "../blorb/blorb.h"
#include "../blorb/blorblow.h"
+zword hx_flags;
+zword hx_fore_colour;
+zword hx_back_colour;
+
// various data
bool m_tandy = 0;
return f;
}
+void os_init_setup(void)
+{
+ f_setup.attribute_assignment = 0;
+ f_setup.attribute_testing = 0;
+ f_setup.context_lines = 0;
+ f_setup.object_locating = 0;
+ f_setup.object_movement = 0;
+ f_setup.left_margin = 0;
+ f_setup.right_margin = 0;
+ f_setup.ignore_errors = 0;
+ f_setup.piracy = 0; /* enable the piracy opcode */
+ f_setup.undo_slots = MAX_UNDO_SLOTS;
+ f_setup.expand_abbreviations = 0;
+ f_setup.script_cols = 80;
+ f_setup.save_quetzal = 1;
+ f_setup.sound = 1;
+ f_setup.err_report_mode = ERR_DEFAULT_REPORT_MODE;
+
+}