From ec4bdd6f7f2d8aec82e114b58494c4d20effb511 Mon Sep 17 00:00:00 2001 From: "G.K.MacGregor" Date: Sun, 15 May 2022 11:22:19 +0100 Subject: [PATCH] Only check Local Object pointers --- x26triplets.cpp | 16 +++++++++------- x26triplets.h | 3 +++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/x26triplets.cpp b/x26triplets.cpp index c728562..09e9c07 100644 --- a/x26triplets.cpp +++ b/x26triplets.cpp @@ -109,13 +109,15 @@ void X26TripletList::updateInternalData() triplet->m_error = X26Triplet::OriginModifierAlone; break; case 0x11 ... 0x13: // Invoke Object - if (triplet->objectLocalTripletNumber() > 12 || - triplet->objectLocalIndex() > (m_list.size()-1) || - m_list.at(triplet->objectLocalIndex()).modeExt() < 0x15 || - m_list.at(triplet->objectLocalIndex()).modeExt() > 0x17) - triplet->m_error = X26Triplet::InvokePointerInvalid; - else if ((triplet->modeExt() | 0x04) != m_list.at(triplet->objectLocalIndex()).modeExt()) - triplet->m_error = X26Triplet::InvokeTypeMismatch; + if (triplet->objectSource() == X26Triplet::LocalObject) { + if (triplet->objectLocalTripletNumber() > 12 || + triplet->objectLocalIndex() > (m_list.size()-1) || + m_list.at(triplet->objectLocalIndex()).modeExt() < 0x15 || + m_list.at(triplet->objectLocalIndex()).modeExt() > 0x17) + triplet->m_error = X26Triplet::InvokePointerInvalid; + else if ((triplet->modeExt() | 0x04) != m_list.at(triplet->objectLocalIndex()).modeExt()) + triplet->m_error = X26Triplet::InvokeTypeMismatch; + } break; case 0x15 ... 0x17: // Define Object activePosition.reset(); diff --git a/x26triplets.h b/x26triplets.h index 951a6e9..0b0e126 100644 --- a/x26triplets.h +++ b/x26triplets.h @@ -27,6 +27,7 @@ class X26Triplet public: // x26model.h has the Plain English descriptions of these errors enum X26TripletError { NoError, ActivePositionMovedUp, ActivePositionMovedLeft, InvokePointerInvalid, InvokeTypeMismatch, OriginModifierAlone }; + enum ObjectSource { InvalidObjectSource, LocalObject, POPObject, GPOPObject }; X26Triplet() {} // X26Triplet(const X26Triplet &other); @@ -49,6 +50,8 @@ public: void setAddressRow(int); void setAddressColumn(int); + int objectSource() const { return (m_address & 0x18) >> 3; } + int objectLocalDesignationCode() const { return (((m_address & 0x01) << 3) | (m_data >> 4)); } int objectLocalTripletNumber() const { return m_data & 0x0f; } int objectLocalIndex() const { return objectLocalDesignationCode() * 13 + objectLocalTripletNumber(); }