aboutsummaryrefslogtreecommitdiff
path: root/engines/glk/frotz/processor_windows.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/glk/frotz/processor_windows.cpp')
-rw-r--r--engines/glk/frotz/processor_windows.cpp24
1 files changed, 22 insertions, 2 deletions
diff --git a/engines/glk/frotz/processor_windows.cpp b/engines/glk/frotz/processor_windows.cpp
index 34c3be1fdb..5e24ac818a 100644
--- a/engines/glk/frotz/processor_windows.cpp
+++ b/engines/glk/frotz/processor_windows.cpp
@@ -255,7 +255,7 @@ void Processor::z_get_wind_prop() {
}
else
- runtime_error(ERR_ILL_WIN_PROP);
+ runtimeError(ERR_ILL_WIN_PROP);
#endif
}
@@ -264,7 +264,7 @@ void Processor::z_put_wind_prop() {
flush_buffer();
if (zargs[1] >= 16)
- runtime_error(ERR_ILL_WIN_PROP);
+ runtimeError(ERR_ILL_WIN_PROP);
((zword *)(wp + winarg0()))[zargs[1]] = zargs[2];
#endif
@@ -309,5 +309,25 @@ void Processor::z_picture_table() {
*/
}
+zword Processor::winarg0() {
+ if (h_version == V6 && (short)zargs[0] == -3)
+ return cwin;
+
+ if (zargs[0] >= ((h_version == V6) ? 8 : 2))
+ runtimeError(ERR_ILL_WIN);
+
+ return zargs[0];
+}
+
+zword Processor::winarg2() {
+ if (zargc < 3 || (short)zargs[2] == -3)
+ return cwin;
+
+ if (zargs[2] >= 8)
+ runtimeError(ERR_ILL_WIN);
+
+ return zargs[2];
+}
+
} // End of namespace Scott
} // End of namespace Glk