aboutsummaryrefslogtreecommitdiff
path: root/engines/glk/advsys
diff options
context:
space:
mode:
Diffstat (limited to 'engines/glk/advsys')
-rw-r--r--engines/glk/advsys/glk_interface.cpp2
-rw-r--r--engines/glk/advsys/vm.cpp3
-rw-r--r--engines/glk/advsys/vm.h2
3 files changed, 3 insertions, 4 deletions
diff --git a/engines/glk/advsys/glk_interface.cpp b/engines/glk/advsys/glk_interface.cpp
index 3e1ccb6a3b..be164f21cd 100644
--- a/engines/glk/advsys/glk_interface.cpp
+++ b/engines/glk/advsys/glk_interface.cpp
@@ -27,7 +27,7 @@ namespace AdvSys {
bool GlkInterface::initialize() {
_window = glk_window_open(0, 0, 0, wintype_TextBuffer, 1);
- return !_window;
+ return _window != nullptr;
}
void GlkInterface::print(const Common::String &msg) {
diff --git a/engines/glk/advsys/vm.cpp b/engines/glk/advsys/vm.cpp
index 17db9ab743..e21c5ac2d6 100644
--- a/engines/glk/advsys/vm.cpp
+++ b/engines/glk/advsys/vm.cpp
@@ -104,8 +104,7 @@ ExecutionResult VM::execute(int offset) {
void VM::executeOpcode() {
// Get next opcode
- uint opcode = getCodeByte(_pc);
- ++_pc;
+ uint opcode = readCodeByte();
if (opcode >= OP_BRT && opcode <= OP_VOWEL) {
(this->*_METHODS[(int)opcode - 1])();
diff --git a/engines/glk/advsys/vm.h b/engines/glk/advsys/vm.h
index 6a877c9ef0..76f05de691 100644
--- a/engines/glk/advsys/vm.h
+++ b/engines/glk/advsys/vm.h
@@ -165,7 +165,7 @@ public:
/**
* Constructor
*/
- FunctionPointer(FixedStack &s) : _stack(s), _index(-1) {}
+ FunctionPointer(FixedStack &s) : _stack(s), _index(0) {}
/**
* Array indexing