projects
/
projects
/
chimara
/
chimara.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Port date/time functions to GDateTime
[projects/chimara/chimara.git]
/
interpreters
/
frotz
/
process.c
diff --git
a/interpreters/frotz/process.c
b/interpreters/frotz/process.c
index e79edf518eea73f7a9e752c4a2eae4fe698454b1..4d9687abc997656975e47281e0a4b77e37c95e99 100644
(file)
--- 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
*
* 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., 5
9 Temple Place - Suite 330, Boston, MA 02111-1307
, USA
+ * Foundation, Inc., 5
1 Franklin Street, Fifth Floor, Boston, MA 02110-1301
, USA
*/
#include "frotz.h"
*/
#include "frotz.h"
@@
-138,7
+138,7
@@
void (*var_opcodes[0x40]) (void) = {
z_check_arg_count
};
z_check_arg_count
};
-void (*ext_opcodes[0x1
d
]) (void) = {
+void (*ext_opcodes[0x1
e
]) (void) = {
z_save,
z_restore,
z_log_shift,
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,
z_restore_undo,
z_print_unicode,
z_check_unicode,
- __illegal__,
+ z_set_true_colour, /* spec 1.1 */
__illegal__,
__illegal__,
__illegal__, // glkify - z_move_window,
__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_print_form,
z_make_menu,
__illegal__, // glkify - z_picture_table
+ z_buffer_screen, /* spec 1.1 */
};
/*
};
/*
- * init_proc
ess
+ * init_proc
*
* Initialize process variables.
*
*/
*
* Initialize process variables.
*
*/
-void init_proc
ess
(void)
+void init_proc (void)
{
finished = 0;
{
finished = 0;
-} /* init_proc
ess
*/
+} /* 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) (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++;
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);
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;
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);
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 (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;
fp[0] |= (zword) count << 8; /* Save local var count for Quetzal. */
value = 0;
@@
-408,7
+413,7
@@
void ret (zword value)
sp = fp;
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++;
frame_count--;
fp = stack + 1 + *sp++;
pc = *sp++;
@@
-573,7
+578,7
@@
static void __extended__ (void)
load_all_operands (specifier);
load_all_operands (specifier);
- if (opcode < 0x1
d) /* extended opcodes from 0x1d
on */
+ if (opcode < 0x1
e) /* extended opcodes from 0x1e
on */
ext_opcodes[opcode] (); /* are reserved for future spec' */
}/* __extended__ */
ext_opcodes[opcode] (); /* are reserved for future spec' */
}/* __extended__ */
@@
-602,7
+607,7
@@
static void __illegal__ (void)
void z_catch (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 */
}/* z_catch */
@@
-617,7
+622,7
@@
void z_catch (void)
void z_throw (void)
{
void z_throw (void)
{
- if (
f_setup.
save_quetzal) {
+ if (
option_
save_quetzal) {
if (zargs[1] > frame_count)
runtime_error (ERR_BAD_FRAME);
if (zargs[1] > frame_count)
runtime_error (ERR_BAD_FRAME);