* Copy the contents of the text buffer to the output streams.
*
*/
-
void flush_buffer (void)
{
static bool locked = FALSE;
* High level output function.
*
*/
-
void print_char (zchar c)
{
static bool flag = FALSE;
/* Flush the buffer before a whitespace or after a hyphen */
if (c == ' ' || c == ZC_INDENT || c == ZC_GAP || (prev_c == '-' && c != '-'))
-
-
flush_buffer ();
/* Set the flag if this is part one of a style or font change */
}/* print_char */
+
/*
* new_line
*
* High level newline function.
*
*/
-
void new_line (void)
{
-
flush_buffer (); stream_new_line ();
}/* new_line */
* Initialize buffer variables.
*
*/
-
void init_buffer(void)
{
memset(buffer, 0, sizeof (zchar) * TEXT_BUFFER_SIZE);
bufpos = 0;
prev_c = 0;
}
-
* Initialise error reporting.
*
*/
-
void init_err (void)
{
int i;
error_count[i] = 0;
}
+
/*
* runtime_error
*
* errnum : Numeric code for error (1 to ERR_NUM_ERRORS)
*
*/
-
void runtime_error (int errnum)
{
int wasfirst;
}
new_line ();
}
-
} /* report_error */
+
/*
* print_long
*
* Print an unsigned 32bit number in decimal or hex.
*
*/
-
static void print_long (unsigned long value, int base)
{
unsigned long i;
static int undo_count = 0;
+
/*
* get_header_extension
*
* Read a value from the header extension (former mouse table).
*
*/
-
zword get_header_extension (int entry)
{
zword addr;
}/* get_header_extension */
+
/*
* set_header_extension
*
* Set an entry in the header extension (former mouse table).
*
*/
-
void set_header_extension (int entry, zword val)
{
zword addr;
}/* set_header_extension */
+
/*
* restart_header
*
* Set all header fields which hold information about the interpreter.
*
*/
-
void restart_header (void)
{
zword screen_x_size;
}/* restart_header */
+
/*
* init_memory
*
* Allocate memory and load the story file.
*
*/
-
void init_memory (void)
{
long size;
/* Open story file */
-/*
- if ((story_fp = os_path_open(f_setup.story_file, "rb")) == NULL)
- os_fatal ("Cannot open story file");
-*/
if ((story_fp = os_load_story()) == NULL)
os_fatal ("Cannot open story file");
}/* init_memory */
+
/*
* init_undo
*
* during the game, e.g. for loading sounds or pictures.
*
*/
-
void init_undo (void)
{
void far *reserved;
}/* init_undo */
+
/*
* free_undo
*
* Free count undo blocks from the beginning of the undo list.
*
*/
-
static void free_undo (int count)
{
undo_t *p;
last_undo = NULL;
}/* free_undo */
+
/*
* reset_memory
*
* Close the story file and deallocate memory.
*
*/
-
void reset_memory (void)
{
if (story_fp)
zmp = NULL;
}/* reset_memory */
+
/*
* storeb
*
* Write a byte value to the dynamic Z-machine memory.
*
*/
-
void storeb (zword addr, zbyte value)
{
-
if (addr >= h_dynamic_size)
runtime_error (ERR_STORE_RANGE);
}/* storeb */
+
/*
* storew
*
* Write a word value to the dynamic Z-machine memory.
*
*/
-
void storew (zword addr, zword value)
{
-
storeb ((zword) (addr + 0), hi (value));
storeb ((zword) (addr + 1), lo (value));
}/* storew */
+
/*
* z_restart, re-load dynamic area, clear the stack and set the PC.
*
* no zargs used
*
*/
-
void z_restart (void)
{
static bool first_restart = TRUE;
}/* z_restart */
+
/*
* get_default_name
*
* copy it to a string.
*
*/
-
static void get_default_name (char *default_name, zword addr)
{
-
if (addr != 0) {
zbyte len;
}/* get_default_name */
+
/*
* z_restore, restore [a part of] a Z-machine state from disk
*
* zargs[2] = address of suggested file name
*
*/
-
void z_restore (void)
{
char new_name[MAX_FILE_NAME + 1];
}/* z_restore */
+
/*
* mem_diff
*
* Returns the number of bytes copied to diff.
*
*/
-
static long mem_diff (zbyte *a, zbyte *b, zword mem_size, zbyte *diff)
{
unsigned size = mem_size;
return p - diff;
}/* mem_diff */
+
/*
* mem_undiff
*
* Applies a quetzal-like diff to dest
*
*/
-
static void mem_undiff (zbyte *diff, long diff_length, zbyte *dest)
{
zbyte c;
}
}/* mem_undiff */
+
/*
* restore_undo
*
* This function does the dirty work for z_restore_undo.
*
*/
-
int restore_undo (void)
{
long pc = curr_undo->pc;
}/* restore_undo */
+
/*
* z_restore_undo, restore a Z-machine state from memory.
*
* no zargs used
*
*/
-
void z_restore_undo (void)
{
-
store ((zword) restore_undo ());
}/* z_restore_undo */
+
/*
* z_save, save [a part of] the Z-machine state to disk.
*
* zargs[2] = address of suggested file name
*
*/
-
void z_save (void)
{
char new_name[MAX_FILE_NAME + 1];
/* Success */
success = 1;
-
}
finished:
}/* z_save */
+
/*
* save_undo
*
* This function does the dirty work for z_save_undo.
*
*/
-
int save_undo (void)
{
long diff_size;
}/* save_undo */
+
/*
* z_save_undo, save the current Z-machine state for a future undo.
*
* no zargs used
*
*/
-
void z_save_undo (void)
{
-
store ((zword) save_undo ());
}/* z_save_undo */
+
/*
* z_verify, check the story file integrity.
*
* no zargs used
*
*/
-
void z_verify (void)
{
zword checksum = 0;
* ...allows user to toggle cheating options on/off.
*
*/
-
static bool hot_key_debugging (void)
{
}/* hot_key_debugging */
+
/*
* hot_key_help
*
* ...displays a list of all hot keys.
*
*/
-
static bool hot_key_help (void) {
print_string ("Help\n");
}/* hot_key_help */
+
/*
* hot_key_playback
*
* ...allows user to turn playback on.
*
*/
-
static bool hot_key_playback (void)
{
-
print_string ("Playback on\n");
if (!istream_replay)
}/* hot_key_playback */
+
/*
* hot_key_recording
*
* ...allows user to turn recording on/off.
*
*/
-
static bool hot_key_recording (void)
{
}/* hot_key_recording */
+
/*
* hot_key_seed
*
* ...allows user to seed the random number seed.
*
*/
-
static bool hot_key_seed (void)
{
}/* hot_key_seed */
+
/*
* hot_key_undo
*
* ...allows user to undo the previous turn.
*
*/
-
static bool hot_key_undo (void)
{
}/* hot_key_undo */
+
/*
* hot_key_restart
*
* ...allows user to start a new game.
*
*/
-
static bool hot_key_restart (void)
{
-
print_string ("New game\n");
if (read_yes_or_no ("Do you wish to restart")) {
}/* hot_key_restart */
+
/*
* hot_key_quit
*
* ...allows user to exit the game.
*
*/
-
static bool hot_key_quit (void)
{
}/* hot_key_quit */
+
/*
* handle_hot_key
*
* true to abort the current input action.
*
*/
-
bool handle_hot_key (zchar key)
{
-
if (cwin == 0) {
bool aborting;
/*
* This is an interpreter for Infocom V1 to V6 games. It also supports
- * the recently defined V7 and V8 games. Please report bugs to
- *
- * s.jokisch@avu.de
+ * the recently defined V7 and V8 games.
*
*/
bool enable_scrolling = FALSE;
bool enable_buffering = FALSE;
-/* User options */
-
-/*
-int option_attribute_assignment = 0;
-int option_attribute_testing = 0;
-int option_context_lines = 0;
-int option_object_locating = 0;
-int option_object_movement = 0;
-int option_left_margin = 0;
-int option_right_margin = 0;
-int option_ignore_errors = 0;
-int option_piracy = 0;
-int option_undo_slots = MAX_UNDO_SLOTS;
-int option_expand_abbreviations = 0;
-int option_script_cols = 80;
-*/
-
int option_sound = 1;
char *option_zcode_path;
long reserve_mem = 0;
+
/*
* z_piracy, branch if the story file is a legal copy.
*
* no zargs used
*
*/
-
void z_piracy (void)
{
-
branch (!f_setup.piracy);
}/* z_piracy */
+
/*
* main
*
* Prepare and run the game.
*
*/
-
int cdecl main (int argc, char *argv[])
{
-
os_init_setup ();
os_process_arguments (argc, argv);
* zargs[1] = second value
*
*/
-
void z_add (void)
{
-
store ((zword) ((short) zargs[0] + (short) zargs[1]));
}/* z_add */
+
/*
* z_and, bitwise AND operation.
*
* zargs[1] = second value
*
*/
-
void z_and (void)
{
-
store ((zword) (zargs[0] & zargs[1]));
}/* z_and */
+
/*
* z_art_shift, arithmetic SHIFT operation.
*
* zargs[1] = #positions to shift left (positive) or right
*
*/
-
void z_art_shift (void)
{
-
if ((short) zargs[1] > 0)
store ((zword) ((short) zargs[0] << (short) zargs[1]));
else
}/* z_art_shift */
+
/*
* z_div, signed 16bit division.
*
* zargs[1] = second value
*
*/
-
void z_div (void)
{
-
if (zargs[1] == 0)
runtime_error (ERR_DIV_ZERO);
}/* z_div */
+
/*
* z_je, branch if the first value equals any of the following.
*
* zargs[3] = fourth value (optional)
*
*/
-
void z_je (void)
{
-
branch (
zargc > 1 && (zargs[0] == zargs[1] || (
zargc > 2 && (zargs[0] == zargs[2] || (
}/* z_je */
+
/*
* z_jg, branch if the first value is greater than the second.
*
* zargs[1] = second value
*
*/
-
void z_jg (void)
{
-
branch ((short) zargs[0] > (short) zargs[1]);
}/* z_jg */
+
/*
* z_jl, branch if the first value is less than the second.
*
* zargs[1] = second value
*
*/
-
void z_jl (void)
{
-
branch ((short) zargs[0] < (short) zargs[1]);
}/* z_jl */
+
/*
* z_jz, branch if value is zero.
*
* zargs[0] = value
*
*/
-
void z_jz (void)
{
-
branch ((short) zargs[0] == 0);
}/* z_jz */
+
/*
* z_log_shift, logical SHIFT operation.
*
* zargs[1] = #positions to shift left (positive) or right (negative)
*
*/
-
void z_log_shift (void)
{
-
if ((short) zargs[1] > 0)
store ((zword) (zargs[0] << (short) zargs[1]));
else
}/* z_log_shift */
+
/*
* z_mod, remainder after signed 16bit division.
*
* zargs[1] = second value
*
*/
-
void z_mod (void)
{
-
if (zargs[1] == 0)
runtime_error (ERR_DIV_ZERO);
}/* z_mod */
+
/*
* z_mul, 16bit multiplication.
*
* zargs[1] = second value
*
*/
-
void z_mul (void)
{
-
store ((zword) ((short) zargs[0] * (short) zargs[1]));
}/* z_mul */
+
/*
* z_not, bitwise NOT operation.
*
* zargs[0] = value
*
*/
-
void z_not (void)
{
-
store ((zword) ~zargs[0]);
}/* z_not */
+
/*
* z_or, bitwise OR operation.
*
* zargs[1] = second value
*
*/
-
void z_or (void)
{
-
store ((zword) (zargs[0] | zargs[1]));
}/* z_or */
+
/*
* z_sub, 16bit substraction.
*
* zargs[1] = second value
*
*/
-
void z_sub (void)
{
-
store ((zword) ((short) zargs[0] - (short) zargs[1]));
}/* z_sub */
+
/*
* z_test, branch if all the flags of a bit mask are set in a value.
*
* zargs[1] = bit mask
*
*/
-
void z_test (void)
{
-
branch ((zargs[0] & zargs[1]) == zargs[1]);
}/* z_test */
#define O4_PROPERTY_OFFSET 12
#define O4_SIZE 14
+
/*
* object_address
*
* Calculate the address of an object.
*
*/
-
static zword object_address (zword obj)
{
/* zchar obj_num[10]; */
}/* object_address */
+
/*
* object_name
*
* Return the address of the given object's name.
*
*/
-
zword object_name (zword object)
{
zword obj_addr;
}/* object_name */
+
/*
* first_property
*
* an object.
*
*/
-
static zword first_property (zword obj)
{
zword prop_addr;
}/* first_property */
+
/*
* next_property
*
* Calculate the address of the next property in a property list.
*
*/
-
static zword next_property (zword prop_addr)
{
zbyte value;
}/* next_property */
+
/*
* unlink_object
*
* Unlink an object from its parent and siblings.
*
*/
-
static void unlink_object (zword object)
{
zword obj_addr;
}/* unlink_object */
+
/*
* z_clear_attr, clear an object attribute.
*
* zargs[1] = number of attribute to be cleared
*
*/
-
void z_clear_attr (void)
{
zword obj_addr;
}/* z_clear_attr */
+
/*
* z_jin, branch if the first object is inside the second.
*
* zargs[1] = second object
*
*/
-
void z_jin (void)
{
zword obj_addr;
}/* z_jin */
+
/*
* z_get_child, store the child of an object.
*
* zargs[0] = object
*
*/
-
void z_get_child (void)
{
zword obj_addr;
}/* z_get_child */
+
/*
* z_get_next_prop, store the number of the first or next property.
*
* zargs[1] = address of current property (0 gets the first property)
*
*/
-
void z_get_next_prop (void)
{
zword prop_addr;
}/* z_get_next_prop */
+
/*
* z_get_parent, store the parent of an object.
*
* zargs[0] = object
*
*/
-
void z_get_parent (void)
{
zword obj_addr;
}/* z_get_parent */
+
/*
* z_get_prop, store the value of an object property.
*
* zargs[1] = number of property to be examined
*
*/
-
void z_get_prop (void)
{
zword prop_addr;
}/* z_get_prop */
+
/*
* z_get_prop_addr, store the address of an object property.
*
* zargs[1] = number of property to be examined
*
*/
-
void z_get_prop_addr (void)
{
zword prop_addr;
}/* z_get_prop_addr */
+
/*
* z_get_prop_len, store the length of an object property.
*
* zargs[0] = address of property to be examined
*
*/
-
void z_get_prop_len (void)
{
zword addr;
}/* z_get_prop_len */
+
/*
* z_get_sibling, store the sibling of an object.
*
* zargs[0] = object
*
*/
-
void z_get_sibling (void)
{
zword obj_addr;
}/* z_get_sibling */
+
/*
* z_insert_obj, make an object the first child of another object.
*
* zargs[1] = destination object
*
*/
-
void z_insert_obj (void)
{
zword obj1 = zargs[0];
}/* z_insert_obj */
+
/*
* z_put_prop, set the value of an object property.
*
* zargs[2] = value to set property to
*
*/
-
void z_put_prop (void)
{
zword prop_addr;
}/* z_put_prop */
+
/*
* z_remove_obj, unlink an object from its parent and siblings.
*
* zargs[0] = object
*
*/
-
void z_remove_obj (void)
{
-
/* If we are monitoring object movements display a short note */
if (f_setup.object_movement) {
}/* z_remove_obj */
+
/*
* z_set_attr, set an object attribute.
*
* zargs[1] = number of attribute to set
*
*/
-
void z_set_attr (void)
{
zword obj_addr;
}/* z_set_attr */
+
/*
* z_test_attr, branch if an object attribute is set.
*
* zargs[1] = number of attribute to test
*
*/
-
void z_test_attr (void)
{
zword obj_addr;
* Initialize process variables.
*
*/
-
void init_process (void)
{
finished = 0;
* Load an operand, either a variable or a constant.
*
*/
-
static void load_operand (zbyte type)
{
zword value;
}/* load_operand */
+
/*
* load_all_operands
*
* for a VAR or EXT opcode.
*
*/
-
static void load_all_operands (zbyte specifier)
{
int i;
}/* load_all_operands */
+
/*
* interpret
*
* Z-code interpreter main loop
*
*/
-
void interpret (void)
{
}/* interpret */
+
/*
* call
*
* can be 0 (z_call_s), 1 (z_call_n) or 2 (direct call).
*
*/
-
void call (zword routine, int argc, zword *args, int ct)
{
long pc;
}/* call */
+
/*
* ret
*
* and we must exit the interpreter loop.
*
*/
-
void ret (zword value)
{
long pc;
}/* ret */
+
/*
* branch
*
* return true.
*
*/
-
void branch (bool flag)
{
long pc;
}/* branch */
+
/*
* store
*
* Store an operand, either as a variable or pushed on the stack.
*
*/
-
void store (zword value)
{
zbyte variable;
}/* store */
+
/*
* direct_call
*
* The interpreter returns the result value on the stack.
*
*/
-
int direct_call (zword addr)
{
zword saved_zargs[8];
}/* direct_call */
+
/*
* __extended__
*
* Load and execute an extended opcode.
*
*/
-
static void __extended__ (void)
{
zbyte opcode;
}/* __extended__ */
+
/*
* __illegal__
*
* Exit game because an unknown opcode has been hit.
*
*/
-
static void __illegal__ (void)
{
-
runtime_error (ERR_ILL_OPCODE);
}/* __illegal__ */
+
/*
* z_catch, store the current stack frame for later use with z_throw.
*
* no zargs used
*
*/
-
void z_catch (void)
{
-
store (frame_count);
}/* z_catch */
+
/*
* z_throw, go back to the given stack frame and return the given value.
*
* zargs[1] = stack frame
*
*/
-
void z_throw (void)
{
-
if (zargs[1] > frame_count)
runtime_error (ERR_BAD_FRAME);
}/* z_throw */
+
/*
* z_call_n, call a subroutine and discard its result.
*
* zargs[7] = seventh argument (optional)
*
*/
-
void z_call_n (void)
{
-
if (zargs[0] != 0)
call (zargs[0], zargc - 1, zargs + 1, 1);
}/* z_call_n */
+
/*
* z_call_s, call a subroutine and store its result.
*
* zargs[7] = seventh argument (optional)
*
*/
-
void z_call_s (void)
{
-
if (zargs[0] != 0)
call (zargs[0], zargc - 1, zargs + 1, 0);
else
}/* z_call_s */
+
/*
* z_check_arg_count, branch if subroutine was called with >= n arg's.
*
* zargs[0] = number of arguments
*
*/
-
void z_check_arg_count (void)
{
-
if (fp == stack + STACK_SIZE)
branch (zargs[0] == 0);
else
}/* z_check_arg_count */
+
/*
* z_jump, jump unconditionally to the given address.
*
* zargs[0] = PC relative address
*
*/
-
void z_jump (void)
{
long pc;
}/* z_jump */
+
/*
* z_nop, no operation.
*
* no zargs used
*
*/
-
void z_nop (void)
{
-
/* Do nothing */
}/* z_nop */
+
/*
* z_quit, stop game and exit interpreter.
*
* no zargs used
*
*/
-
void z_quit (void)
{
-
finished = 9999;
}/* z_quit */
+
/*
* z_ret, return from a subroutine with the given value.
*
* zargs[0] = value to return
*
*/
-
void z_ret (void)
{
-
ret (zargs[0]);
}/* z_ret */
+
/*
* z_ret_popped, return from a subroutine with a value popped off the stack.
*
* no zargs used
*
*/
-
void z_ret_popped (void)
{
-
ret (*sp++);
}/* z_ret_popped */
+
/*
* z_rfalse, return from a subroutine with false (0).
*
* no zargs used
*
*/
-
void z_rfalse (void)
{
-
ret (0);
}/* z_rfalse */
+
/*
* z_rtrue, return from a subroutine with true (1).
*
* no zargs used
*
*/
-
void z_rtrue (void)
{
-
ret (1);
}/* z_rtrue */
return TRUE;
}
+
/*
* Restore a saved game using Quetzal format. Return 2 if OK, 0 if an error
* occurred before any damage was done, -1 on a fatal error.
*/
-
zword restore_quetzal (FILE *svf, FILE *stf)
{
zlong ifzslen, currlen, tmpl;
return (progress == GOT_ALL ? 2 : fatal);
}
+
/*
* Save a game using Quetzal format. Return 1 if OK, 0 if failed.
*/
-
zword save_quetzal (FILE *svf, FILE *stf)
{
zlong ifzslen = 0, cmemlen = 0, stkslen = 0;
static int interval = 0;
static int counter = 0;
+
/*
* seed_random
*
* Set the seed value for the random number generator.
*
*/
-
void seed_random (int value)
{
}/* seed_random */
+
/*
* z_random, store a random number or set the random number seed.
*
* zargs[0] = range (positive) or seed value (negative)
*
*/
-
void z_random ()
{
-
if ((short) zargs[0] <= 0) { /* set random seed */
seed_random (- (short) zargs[0]);
}
store ((zword) (result % zargs[0] + 1));
-
}
}/* z_random */
zword total;
} redirect[MAX_NESTING];
+
/*
* memory_open
*
* Begin output redirection to the memory of the Z-machine.
*
*/
-
void memory_open (zword table, zword xsize, bool buffering)
{
-
if (++depth < MAX_NESTING) {
if (!buffering)
}/* memory_open */
+
/*
* memory_new_line
*
* Redirect a newline to the memory of the Z-machine.
*
*/
-
void memory_new_line (void)
{
zword size;
}/* memory_new_line */
+
/*
* memory_word
*
* Redirect a string of characters to the memory of the Z-machine.
*
*/
-
void memory_word (const zchar *s)
{
zword size;
}/* memory_word */
+
/*
* memory_close
*
* End of output redirection.
*
*/
-
void memory_close (void)
{
-
if (depth >= 0) {
if (redirect[depth].xsize != 0xffff)
* current window.
*
*/
-
static zword winarg0 (void)
{
-
if (h_version == V6 && (short) zargs[0] == -3)
return cwin;
}/* winarg0 */
+
/*
* winarg2
*
* V6 opcodes: set_cursor, set_margins, set_colour.
*
*/
-
static zword winarg2 (void)
{
-
if (zargc < 3 || (short) zargs[2] == -3)
return cwin;
}/* winarg2 */
+
/*
* update_cursor
*
* Move the hardware cursor to make it match the window properties.
*
*/
-
static void update_cursor (void)
{
-
os_set_cursor (
cwp->y_pos + cwp->y_cursor - 1,
cwp->x_pos + cwp->x_cursor - 1);
}/* update_cursor */
+
/*
* reset_cursor
*
* Reset the cursor of a given window to its initial position.
*
*/
-
static void reset_cursor (zword win)
{
int lines = 0;
}/* reset_cursor */
+
/*
* set_more_prompts
*
* Turn more prompts on/off.
*
*/
-
void set_more_prompts (bool flag)
{
-
if (flag && !more_prompts)
cwp->line_count = 0;
}/* set_more_prompts */
+
/*
* units_left
*
* Return the #screen units from the cursor to the end of the line.
*
*/
-
static int units_left (void)
{
-
return cwp->x_size - cwp->right - cwp->x_cursor + 1;
}/* units_left */
+
/*
* get_max_width
*
* connection with the extended output stream #3 call in V6.
*
*/
-
zword get_max_width (zword win)
{
-
if (h_version == V6) {
if (win >= 8)
}/* get_max_width */
+
/*
* countdown
*
* counter hits zero. This is a helper function for screen_new_line.
*
*/
-
static void countdown (void)
{
-
if (cwp->nl_countdown != 0)
if (--cwp->nl_countdown == 0)
direct_call (cwp->nl_routine);
}/* countdown */
+
/*
* screen_new_line
*
void screen_new_line (void)
{
-
if (discarding) return;
/* Handle newline interrupts at the start (for most cases) */
}/* screen_new_line */
+
/*
* screen_char
*
}/* screen_char */
+
/*
* screen_word
*
* enable_wrapping flag.
*
*/
-
void screen_word (const zchar *s)
{
int width;
}/* screen_word */
+
/*
* screen_write_input
*
* Display an input line on the screen. This is required during playback.
*
*/
-
void screen_write_input (const zchar *buf, zchar key)
{
int width;
}/* screen_write_input */
+
/*
* screen_erase_input
*
* playback.
*
*/
-
void screen_erase_input (const zchar *buf)
{
-
if (buf[0] != 0) {
int width = os_string_width (buf);
}/* screen_erase_input */
+
/*
* console_read_input
*
* Read an input line from the keyboard and return the terminating key.
*
*/
-
zchar console_read_input (int max, zchar *buf, zword timeout, bool continued)
{
zchar key;
}/* console_read_input */
+
/*
* console_read_key
*
* Read a single keystroke and return it.
*
*/
-
zchar console_read_key (zword timeout)
{
zchar key;
}/* console_read_key */
+
/*
* update_attributes
*
* of the current window.
*
*/
-
static void update_attributes (void)
{
zword attr = cwp->attribute;
}/* update_attributes */
+
/*
* refresh_text_style
*
* uses the set_text_style opcode.
*
*/
-
void refresh_text_style (void)
{
zword style;
}/* refresh_text_style */
+
/*
* set_window
*
* properties such as colours, text style, cursor position and size.
*
*/
-
static void set_window (zword win)
{
-
flush_buffer ();
cwin = win; cwp = wp + win;
}/* set_window */
+
/*
* erase_window
*
* Erase a window to background colour.
*
*/
-
void erase_window (zword win)
{
zword y = wp[win].y_pos;
}/* erase_window */
+
/*
* split_window
*
* window appears below the status line.
*
*/
-
void split_window (zword height)
{
zword stat_height = 0;
}/* split_window */
+
/*
* erase_screen
*
* Erase the entire screen to background colour.
*
*/
-
static void erase_screen (zword win)
{
int i;
/* #ifdef AMIGA */
+
/*
* resize_screen
*
* Try to adapt the window properties to a new screen size.
*
*/
-
void resize_screen (void)
{
/* #endif */
+
/*
* restart_screen
*
* Prepare the screen for a new game.
*
*/
-
void restart_screen (void)
{
-
/* Use default settings */
os_set_colour (h_default_foreground, h_default_background);
}/* restart_screen */
+
/*
* validate_click
*
* memory of the header extension table and return true.
*
*/
-
bool validate_click (void)
{
}/* validate_click */
+
/*
* screen_mssg_on
*
* stream with maximum priority.
*
*/
-
void screen_mssg_on (void)
{
-
if (cwin == 0) { /* messages in window 0 only */
os_set_text_style (0);
}/* screen_mssg_on */
+
/*
* screen_mssg_off
*
* Stop printing a "debugging" message.
*
*/
-
void screen_mssg_off (void)
{
-
if (cwin == 0) { /* messages in window 0 only */
screen_new_line ();
}/* screen_mssg_off */
+
/*
* z_buffer_mode, turn text buffering on/off.
*
* zargs[0] = new text buffering flag (0 or 1)
*
*/
-
void z_buffer_mode (void)
{
-
/* Infocom's V6 games rarely use the buffer_mode opcode. If they do
then only to print text immediately, without any delay. This was
used to give the player some sign of life while the game was
}/* z_buffer_mode */
+
/*
* z_draw_picture, draw a picture.
*
* zargs[2] = x-coordinate of top left corner
*
*/
-
void z_draw_picture (void)
{
zword pic = zargs[0];
}/* z_draw_picture */
+
/*
* z_erase_line, erase the line starting at the cursor position.
*
* zargs[0] = 1 + #units to erase (1 clears to the end of the line)
*
*/
-
void z_erase_line (void)
{
zword pixels = zargs[0];
}/* z_erase_line */
+
/*
* z_erase_picture, erase a picture with background colour.
*
* zargs[2] = x-coordinate of top left corner (optional)
*
*/
-
void z_erase_picture (void)
{
int height, width;
}/* z_erase_picture */
+
/*
* z_erase_window, erase a window or the screen to background colour.
*
* zargs[0] = window (-3 current, -2 screen, -1 screen & unsplit)
*
*/
-
void z_erase_window (void)
{
-
flush_buffer ();
if ((short) zargs[0] == -1 || (short) zargs[0] == -2)
}/* z_erase_window */
+
/*
* z_get_cursor, write the cursor coordinates into a table.
*
* zargs[0] = address to write information to
*
*/
-
void z_get_cursor (void)
{
zword y, x;
}/* z_get_cursor */
+
/*
* z_get_wind_prop, store the value of a window property.
*
* zargs[1] = number of window property to be stored
*
*/
-
void z_get_wind_prop (void)
{
-
flush_buffer ();
if (zargs[1] >= 16)
}/* z_get_wind_prop */
+
/*
* z_mouse_window, select a window as mouse window.
*
* zargs[0] = window number (-3 is the current) or -1 for the screen
*
*/
-
void z_mouse_window (void)
{
-
mwin = ((short) zargs[0] == -1) ? -1 : winarg0 ();
}/* z_mouse_window */
+
/*
* z_move_window, place a window on the screen.
*
* zargs[2] = x-coordinate
*
*/
-
void z_move_window (void)
{
zword win = winarg0 ();
}/* z_move_window */
+
/*
* z_picture_data, get information on a picture or the graphics file.
*
* zargs[1] = address to write information to
*
*/
-
void z_picture_data (void)
{
zword pic = zargs[0];
}/* z_picture_data */
+
/*
* z_picture_table, prepare a group of pictures for faster display.
*
* zargs[0] = address of table holding the picture numbers
*
*/
-
void z_picture_table (void)
{
-
/* This opcode is used by Shogun and Zork Zero when the player
encounters built-in games such as Peggleboz. Nowadays it is
not very helpful to hold the picture data in memory because
}/* z_picture_table */
+
/*
* z_print_table, print ASCII text in a rectangular area.
*
* zargs[3] = number of char's to skip between lines (optional)
*
*/
-
void z_print_table (void)
{
zword addr = zargs[0];
}/* z_print_table */
+
/*
* z_put_wind_prop, set the value of a window property.
*
* zargs[2] = value to set window property to
*
*/
-
void z_put_wind_prop (void)
{
-
flush_buffer ();
if (zargs[1] >= 16)
}/* z_put_wind_prop */
+
/*
* z_scroll_window, scroll a window up or down.
*
* zargs[1] = #screen units to scroll up (positive) or down (negative)
*
*/
-
void z_scroll_window (void)
{
zword win = winarg0 ();
}/* z_scroll_window */
+
/*
* z_set_colour, set the foreground and background colours.
*
* zargs[2] = window (-3 is the current one, optional)
*
*/
-
void z_set_colour (void)
{
zword win = (h_version == V6) ? winarg2 () : 0;
}/* z_set_colour */
+
/*
* z_set_font, set the font for text output and store the previous font.
*
* zargs[0] = number of font or 0 to keep current font
*
*/
-
void z_set_font (void)
{
zword win = (h_version == V6) ? cwin : 0;
}/* z_set_font */
+
/*
* z_set_cursor, set the cursor position or turn the cursor on/off.
*
* zargs[2] = window (-3 is the current one, optional)
*
*/
-
void z_set_cursor (void)
{
zword win = (h_version == V6) ? winarg2 () : 1;
}/* z_set_cursor */
+
/*
* z_set_margins, set the left and right margins of a window.
*
* zargs[2] = window (-3 is the current one, optional)
*
*/
-
void z_set_margins (void)
{
zword win = winarg2 ();
}/* z_set_margins */
+
/*
* z_set_text_style, set the style for text output.
*
* zargs[0] = style flags to set or 0 to reset text style
*
*/
-
void z_set_text_style (void)
{
zword win = (h_version == V6) ? cwin : 0;
}/* z_set_text_style */
+
/*
* z_set_window, select the current window.
*
* zargs[0] = window to be selected (-3 is the current one)
*
*/
-
void z_set_window (void)
{
-
set_window (winarg0 ());
}/* z_set_window */
+
/*
* pad_status_line
*
* Pad the status line with spaces up to the given position.
*
*/
-
static void pad_status_line (int column)
{
int spaces;
}/* pad_status_line */
+
/*
* z_show_status, display the status line for V1 to V3 games.
*
* no zargs used
*
*/
-
void z_show_status (void)
{
zword global0;
}/* z_show_status */
+
/*
* z_split_window, split the screen into an upper (1) and lower (0) window.
*
* zargs[0] = height of upper window in screen units (V6) or #lines
*
*/
-
void z_split_window (void)
{
-
split_window (zargs[0]);
}/* z_split_window */
+
/*
* z_window_size, change the width and height of a window.
*
* zargs[2] = new width in screen units
*
*/
-
void z_window_size (void)
{
zword win = winarg0 ();
}/* z_window_size */
+
/*
* z_window_style, set / clear / toggle window attributes.
*
* zargs[2] = operation to perform (optional, defaults to 0)
*
*/
-
void z_window_style (void)
{
zword win = winarg0 ();
}/* 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 (font == TEXT_FONT) {
if (h_version != V6) {
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 */
-
static bool locked = FALSE;
static bool playing = FALSE;
+
/*
* init_sound
*
* Initialize sound variables.
*
*/
-
void init_sound (void)
{
locked = FALSE;
* Call the IO interface to play a sample.
*
*/
-
static void start_sample (int number, int volume, int repeats, zword eos)
{
-
static zbyte lh_repeats[] = {
0x00, 0x00, 0x00, 0x01, 0xff,
0x00, 0x01, 0x01, 0x01, 0x01,
}/* start_sample */
+
/*
* start_next_sample
*
* immediately follow other samples.
*
*/
-
static void start_next_sample (void)
{
-
if (next_sample != 0)
start_sample (next_sample, next_volume, 0, 0);
}/* start_next_sample */
+
/*
* end_of_sound
*
* interrupt (which requires extremely careful programming).
*
*/
-
void end_of_sound (void)
{
-
#if defined(DJGPP) && defined(SOUND_SUPPORT)
end_of_sound_flag = 0;
#endif
}/* end_of_sound */
+
/*
* z_sound_effect, load / play / stop / discard a sound effect.
*
* Repeats are stored in the high byte, 255 is infinite loop.
*
*/
-
void z_sound_effect (void)
{
zword number = zargs[0];
extern int direct_call (zword);
+
/*
* stream_mssg_on
*
* Start printing a "debugging" message.
*
*/
-
void stream_mssg_on (void)
{
-
flush_buffer ();
if (ostream_screen)
}/* stream_mssg_on */
+
/*
* stream_mssg_off
*
* Stop printing a "debugging" message.
*
*/
-
void stream_mssg_off (void)
{
-
flush_buffer ();
if (ostream_screen)
}/* stream_mssg_off */
+
/*
* z_output_stream, open or close an output stream.
*
* zargs[2] = width of redirected output (stream 3 only, optional)
*
*/
-
void z_output_stream (void)
{
-
flush_buffer ();
switch ((short) zargs[0]) {
}/* z_output_stream */
+
/*
* stream_char
*
* Send a single character to the output stream.
*
*/
-
void stream_char (zchar c)
{
-
if (ostream_screen)
screen_char (c);
if (ostream_script && enable_scripting)
}/* stream_char */
+
/*
* stream_word
*
* Send a string of characters to the output streams.
*
*/
-
void stream_word (const zchar *s)
{
-
if (ostream_memory && !message)
memory_word (s);
}/* stream_word */
+
/*
* stream_new_line
*
* Send a newline to the output streams.
*
*/
-
void stream_new_line (void)
{
-
if (ostream_memory && !message)
-
memory_new_line ();
else {
}/* stream_new_line */
+
/*
* z_input_stream, select an input stream.
*
* zargs[0] = input stream to be selected
*
*/
-
void z_input_stream (void)
{
-
flush_buffer ();
if (zargs[0] == 0 && istream_replay)
}/* z_input_stream */
+
/*
* stream_read_key
*
* Read a single keystroke from the current input stream.
*
*/
-
-zchar stream_read_key ( zword timeout, zword routine,
- bool hot_keys )
+zchar stream_read_key ( zword timeout, zword routine, bool hot_keys )
{
zchar key = ZC_BAD;
}/* stream_read_key */
+
/*
* stream_read_input
*
* Read a line of input from the current input stream.
*
*/
-
zchar stream_read_input ( int max, zchar *buf,
zword timeout, zword routine,
bool hot_keys,
#include "frotz.h"
+
/*
* z_copy_table, copy a table or fill it with zeroes.
*
* if zargs[1] is negative the table _must_ be copied forwards.
*
*/
-
void z_copy_table (void)
{
zword addr;
}/* z_copy_table */
+
/*
* z_loadb, store a value from a table of bytes.
*
* zargs[1] = index of table entry to store
*
*/
-
void z_loadb (void)
{
zword addr = zargs[0] + zargs[1];
}/* z_loadb */
+
/*
* z_loadw, store a value from a table of words.
*
* zargs[1] = index of table entry to store
*
*/
-
void z_loadw (void)
{
zword addr = zargs[0] + 2 * zargs[1];
}/* z_loadw */
+
/*
* z_scan_table, find and store the address of a target within a table.
*
* it's a byte array. The lower bits hold the address step.
*
*/
-
void z_scan_table (void)
{
zword addr = zargs[1];
}/* z_scan_table */
+
/*
* z_storeb, write a byte into a table of bytes.
*
* zargs[2] = value to be written
*
*/
-
void z_storeb (void)
{
-
storeb ((zword) (zargs[0] + zargs[1]), zargs[2]);
}/* z_storeb */
+
/*
* z_storew, write a word into a table of words.
*
* zargs[2] = value to be written
*
*/
-
void z_storew (void)
{
-
storew ((zword) (zargs[0] + 2 * zargs[1]), zargs[2]);
}/* z_storew */
0xa3, 0x00, 0x00, 0xa1, 0xbf
};
+
/*
* translate_from_zscii
*
* Map a ZSCII character onto the ISO Latin-1 alphabet.
*
*/
-
zchar translate_from_zscii (zbyte c)
{
-
if (c == 0xfc)
return ZC_MENU_CLICK;
if (c == 0xfd)
}/* translate_from_zscii */
+
/*
* translate_to_zscii
*
* Map an ISO Latin-1 character onto the ZSCII alphabet.
*
*/
-
zbyte translate_to_zscii (zchar c)
{
int i;
}/* translate_to_zscii */
+
/*
* alphabet
*
* Return a character from one of the three character sets.
*
*/
-
static zchar alphabet (int set, int index)
{
-
if (h_alphabet != 0) { /* game uses its own alphabet */
zbyte c;
}/* alphabet */
+
/*
* load_string
*
* Copy a ZSCII string from the memory to the global "decoded" string.
*
*/
-
static void load_string (zword addr, zword length)
{
int resolution = (h_version <= V3) ? 2 : 3;
}/* load_string */
+
/*
* encode_text
*
* the minimum and maximum Z-characters.
*
*/
-
static void encode_text (int padding)
{
static zchar again[] = { 'a', 'g', 'a', 'i', 'n', 0 };
}/* encode_text */
+
/*
* z_check_unicode, test if a unicode character can be read and printed.
*
* zargs[0] = Unicode
*
*/
-
void z_check_unicode (void)
{
zword c = zargs[0];
}/* z_check_unicode */
+
/*
* z_encode_text, encode a ZSCII string for use in a dictionary.
*
* three 16bit words.
*
*/
-
void z_encode_text (void)
{
int i;
}/* z_encode_text */
+
/*
* decode_text
*
* The last type is only used for word completion.
*
*/
-
#define outchar(c) if (st==VOCABULARY) *ptr++=c; else print_char(c)
-
static void decode_text (enum string_type st, zword addr)
{
zchar *ptr;
*ptr = 0;
}/* decode_text */
-
#undef outchar
+
/*
* z_new_line, print a new line.
*
* no zargs used
*
*/
-
void z_new_line (void)
{
-
new_line ();
}/* z_new_line */
+
/*
* z_print, print a string embedded in the instruction stream.
*
* no zargs used
*
*/
-
void z_print (void)
{
-
decode_text (EMBEDDED_STRING, 0);
}/* z_print */
+
/*
* z_print_addr, print a string from the lower 64KB.
*
* zargs[0] = address of string to print
*
*/
-
void z_print_addr (void)
{
-
decode_text (LOW_STRING, zargs[0]);
}/* z_print_addr */
+
/*
* z_print_char print a single ZSCII character.
*
* zargs[0] = ZSCII character to be printed
*
*/
-
void z_print_char (void)
{
-
print_char (translate_from_zscii (zargs[0]));
}/* z_print_char */
+
/*
* z_print_form, print a formatted table.
*
* zargs[0] = address of formatted table to be printed
*
*/
-
void z_print_form (void)
{
zword count;
}/* z_print_form */
+
/*
* print_num
*
* Print a signed 16bit number.
*
*/
-
void print_num (zword value)
{
int i;
}/* print_num */
+
/*
* z_print_num, print a signed number.
*
* zargs[0] = number to print
*
*/
-
void z_print_num (void)
{
-
print_num (zargs[0]);
}/* z_print_num */
+
/*
* print_object
*
* Print an object description.
*
*/
-
void print_object (zword object)
{
zword addr = object_name (object);
}/* print_object */
+
/*
* z_print_obj, print an object description.
*
* zargs[0] = number of object to be printed
*
*/
-
void z_print_obj (void)
{
-
print_object (zargs[0]);
}/* z_print_obj */
+
/*
* z_print_paddr, print the string at the given packed address.
*
* zargs[0] = packed address of string to be printed
*
*/
-
void z_print_paddr (void)
{
-
decode_text (HIGH_STRING, zargs[0]);
}/* z_print_paddr */
+
/*
* z_print_ret, print the string at PC, print newline then return true.
*
* no zargs used
*
*/
-
void z_print_ret (void)
{
-
decode_text (EMBEDDED_STRING, 0);
new_line ();
ret (1);
}/* z_print_ret */
+
/*
* print_string
*
* Print a string of ASCII characters.
*
*/
-
void print_string (const char *s)
{
char c;
}/* print_string */
+
/*
* z_print_unicode
*
* zargs[0] = Unicode
*
*/
-
void z_print_unicode (void)
{
-
print_char ((zargs[0] <= 0xff) ? zargs[0] : '?');
}/* z_print_unicode */
+
/*
* lookup_text
*
* The return value is 0 if the search fails.
*
*/
-
static zword lookup_text (int padding, zword dct)
{
zword entry_addr;
}/* lookup_text */
+
/*
* tokenise_text
*
* times with different dictionaries); otherwise they are zero.
*
*/
-
static void tokenise_text (zword text, zword length, zword from, zword parse, zword dct, bool flag)
{
zword addr;
}/* tokenise_text */
+
/*
* tokenise_line
*
* Split an input line into words and translate the words to tokens.
*
*/
-
void tokenise_line (zword text, zword token, zword dct, bool flag)
{
zword addr1;
}/* tokenise_line */
+
/*
* z_tokenise, make a lexical analysis of a ZSCII string.
*
* zargs[3] = set when unknown words cause empty slots (optional)
*
*/
-
void z_tokenise (void)
{
-
/* Supply default arguments */
if (zargc < 3)
}/* z_tokenise */
+
/*
* completion
*
* to the last word that results in the only possible completion.
*
*/
-
int completion (const zchar *buffer, zchar *result)
{
zword minaddr;
#include "frotz.h"
+
/*
* z_dec, decrement a variable.
*
* zargs[0] = variable to decrement
*
*/
-
void z_dec (void)
{
zword value;
}/* z_dec */
+
/*
* z_dec_chk, decrement a variable and branch if now less than value.
*
* zargs[1] = value to check variable against
*
*/
-
void z_dec_chk (void)
{
zword value;
}/* z_dec_chk */
+
/*
* z_inc, increment a variable.
*
* zargs[0] = variable to increment
*
*/
-
void z_inc (void)
{
zword value;
}/* z_inc */
+
/*
* z_inc_chk, increment a variable and branch if now greater than value.
*
* zargs[1] = value to check variable against
*
*/
-
void z_inc_chk (void)
{
zword value;
}/* z_inc_chk */
+
/*
* z_load, store the value of a variable.
*
* zargs[0] = variable to store
*
*/
-
void z_load (void)
{
zword value;
}/* z_load */
+
/*
* z_pop, pop a value off the game stack and discard it.
*
* no zargs used
*
*/
-
void z_pop (void)
{
-
sp++;
}/* z_pop */
+
/*
* z_pop_stack, pop n values off the game or user stack and discard them.
*
* zargs[1] = address of user stack (optional)
*
*/
-
void z_pop_stack (void)
{
-
if (zargc == 2) { /* it's a user stack */
zword size;
}/* z_pop_stack */
+
/*
* z_pull, pop a value off...
*
* zargs[0] = variable to write value to
*
*/
-
void z_pull (void)
{
zword value;
}/* z_pull */
+
/*
* z_push, push a value onto the game stack.
*
* zargs[0] = value to push onto the stack
*
*/
-
void z_push (void)
{
-
*--sp = zargs[0];
}/* z_push */
+
/*
* z_push_stack, push a value onto a user stack then branch if successful.
*
* zargs[1] = address of user stack
*
*/
-
void z_push_stack (void)
{
zword size;
}/* z_push_stack */
+
/*
* z_store, write a value to a variable.
*
* zargs[1] = value to write
*
*/
-
void z_store (void)
{
zword value = zargs[1];
return -f;
return f;
}
-
-
-/* /home/dave/zcode/mystory.z5 */
-/* /home/dave/zcode/mystory.blb */
* v
*/
-
-
-
-
-
if ((height == 1) && (width == 1))
safe_mvaddch(row, col, plus);
else if (height == 1) {
#include "ux_frotz.h"
+
/*
* os_erase_area
*
* being erased. This is not relevant for the curses interface.
*
*/
-
void os_erase_area (int top, int left, int bottom, int right, int win)
{
int y, x, i, j;
}
}/* os_erase_area */
+
/*
* os_scroll_area
*
* colour. Top left coordinates are (1,1). The cursor stays put.
*
*/
-
void os_scroll_area (int top, int left, int bottom, int right, int units)
{
top--; left--; bottom--; right--;
* be changed.
*
*/
-
int os_font_data (int font, int *height, int *width)
{
-
if (font == TEXT_FONT) {
*height = 1; *width = 1; return 1; /* Truth in advertising */
}
return 0;
-
}/* os_font_data */
+
#ifdef COLOR_SUPPORT
/*
* unix_convert
* Converts frotz's (and Infocom's) color values to ncurses color values.
*
*/
-
static int unix_convert(int color)
{
switch(color) {
}
#endif
+
/*
* os_set_colour
*
* remarks on os_peek_colour.
*
*/
-
void os_set_colour (int new_foreground, int new_background)
{
if (new_foreground == 1) new_foreground = h_default_foreground;
os_set_text_style(u_setup.current_text_style);
}/* os_set_colour */
+
/*
* os_set_text_style
*
* FIXED_WIDTH_STYLE
*
*/
-
void os_set_text_style (int new_style)
{
int temp = 0;
attrset(temp ^ u_setup.current_color);
}/* os_set_text_style */
+
/*
* os_set_font
*
* choose fonts which aren't supported by the interface.
*
*/
-
void os_set_font (int new_font)
{
-
/* Not implemented */
}/* os_set_font */
+
/*
* os_display_char
*
* bottom right corner.
*
*/
-
void os_display_char (zchar c)
{
addch(' '); addch(' ');
return;
}
-
}/* os_display_char */
+
/*
* os_display_string
*
* Pass a string of characters to os_display_char.
*
*/
-
void os_display_string (const zchar *s)
{
-
zchar c;
- while ((c = (unsigned char) *s++) != 0)
+ while ((c = (unsigned char) *s++) != 0) {
if (c == ZC_NEW_FONT || c == ZC_NEW_STYLE) {
if (c == ZC_NEW_STYLE)
os_set_text_style (arg);
- } else os_display_char (c);
+ } else
+ os_display_char (c);
+ }
}/* os_display_string */
+
/*
* os_char_width
*
* Return the width of the character in screen units.
*
*/
-
int os_char_width (zchar c)
{
-
if (c >= ZC_LATIN1_MIN && c <= ZC_LATIN1_MAX && u_setup.plain_ascii) {
int width = 0;
return width;
}
return 1;
-
}/* os_char_width*/
+
/*
* os_string_width
*
* NEW_FONT - next character is a new font
*
*/
-
int os_string_width (const zchar *s)
{
int width = 0;
zchar c;
- while ((c = *s++) != 0)
-
- if (c == ZC_NEW_STYLE || c == ZC_NEW_FONT) {
-
- s++;
- /* No effect */
-
- } else width += os_char_width(c);
+ while ((c = *s++) != 0) {
+ if (c == ZC_NEW_STYLE || c == ZC_NEW_FONT) {
+ s++;
+ /* No effect */
+ } else
+ width += os_char_width(c);
+ }
return width;
-
}/* os_string_width */
+
/*
* os_set_cursor
*
* Place the text cursor at the given coordinates. Top left is (1,1).
*
*/
-
void os_set_cursor (int y, int x)
{
-
/* Curses thinks the top left is (0,0) */
move(--y, --x);
-
}/* os_set_cursor */
+
/*
* os_more_prompt
*
* prompt from the screen.
*
*/
-
void os_more_prompt (void)
{
int saved_style, saved_x, saved_y;
addstr(" ");
move(saved_y, saved_x);
os_set_text_style(saved_style);
-
}/* os_more_prompt */