X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=interpreters%2Ffrotz%2Fprocess.c;h=4d9687abc997656975e47281e0a4b77e37c95e99;hb=d9646c0bf915d1ee5d9d3601a273ff20214bfae7;hp=e79edf518eea73f7a9e752c4a2eae4fe698454b1;hpb=b1f1dc50b22b30c4d7176e1ff7c0805e80fe0724;p=projects%2Fchimara%2Fchimara.git diff --git a/interpreters/frotz/process.c b/interpreters/frotz/process.c index e79edf5..4d9687a 100644 --- a/interpreters/frotz/process.c +++ b/interpreters/frotz/process.c @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include "frotz.h" @@ -138,7 +138,7 @@ void (*var_opcodes[0x40]) (void) = { z_check_arg_count }; -void (*ext_opcodes[0x1d]) (void) = { +void (*ext_opcodes[0x1e]) (void) = { z_save, z_restore, z_log_shift, @@ -152,7 +152,7 @@ void (*ext_opcodes[0x1d]) (void) = { z_restore_undo, z_print_unicode, z_check_unicode, - __illegal__, + z_set_true_colour, /* spec 1.1 */ __illegal__, __illegal__, __illegal__, // glkify - z_move_window, @@ -168,20 +168,21 @@ void (*ext_opcodes[0x1d]) (void) = { z_print_form, z_make_menu, __illegal__, // glkify - z_picture_table + z_buffer_screen, /* spec 1.1 */ }; /* - * init_process + * init_proc * * Initialize process variables. * */ -void init_process (void) +void init_proc (void) { finished = 0; -} /* init_process */ +} /* init_proc */ /* @@ -337,7 +338,7 @@ void call (zword routine, int argc, zword *args, int ct) *--sp = (zword) (pc >> 9); *--sp = (zword) (pc & 0x1ff); *--sp = (zword) (fp - stack - 1); - *--sp = (zword) (argc | (ct << (f_setup.save_quetzal ? 12 : 8))); + *--sp = (zword) (argc | (ct << (option_save_quetzal ? 12 : 8))); fp = sp; frame_count++; @@ -350,8 +351,12 @@ void call (zword routine, int argc, zword *args, int ct) pc = (long) routine << 2; else if (h_version <= V7) pc = ((long) routine << 2) + ((long) h_functions_offset << 3); - else /* h_version == V8 */ + else if (h_version <= V8) pc = (long) routine << 3; + else /* h_version == V9 */ { + long indirect = (long) routine << 2; + HIGH_LONG(indirect, pc); + } if (pc >= story_size) runtime_error (ERR_ILL_CALL_ADDR); @@ -367,7 +372,7 @@ void call (zword routine, int argc, zword *args, int ct) if (sp - stack < count) runtime_error (ERR_STK_OVF); - if (f_setup.save_quetzal) + if (option_save_quetzal) fp[0] |= (zword) count << 8; /* Save local var count for Quetzal. */ value = 0; @@ -408,7 +413,7 @@ void ret (zword value) sp = fp; - ct = *sp++ >> (f_setup.save_quetzal ? 12 : 8); + ct = *sp++ >> (option_save_quetzal ? 12 : 8); frame_count--; fp = stack + 1 + *sp++; pc = *sp++; @@ -573,7 +578,7 @@ static void __extended__ (void) load_all_operands (specifier); - if (opcode < 0x1d) /* extended opcodes from 0x1d on */ + if (opcode < 0x1e) /* extended opcodes from 0x1e on */ ext_opcodes[opcode] (); /* are reserved for future spec' */ }/* __extended__ */ @@ -602,7 +607,7 @@ static void __illegal__ (void) void z_catch (void) { - store (f_setup.save_quetzal ? frame_count : (zword) (fp - stack)); + store (option_save_quetzal ? frame_count : (zword) (fp - stack)); }/* z_catch */ @@ -617,7 +622,7 @@ void z_catch (void) void z_throw (void) { - if (f_setup.save_quetzal) { + if (option_save_quetzal) { if (zargs[1] > frame_count) runtime_error (ERR_BAD_FRAME);