From 553f3b6d8bf2782e51446ad29433ccc629721d31 Mon Sep 17 00:00:00 2001
From: Thomas Harte <thomas.harte@gmail.com>
Date: Mon, 28 Oct 2019 22:37:11 -0400
Subject: [PATCH] Properly conforms to GPIP input/output blending.

---
 Components/68901/MFP68901.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Components/68901/MFP68901.cpp b/Components/68901/MFP68901.cpp
index 3326458d8..31a468a2b 100644
--- a/Components/68901/MFP68901.cpp
+++ b/Components/68901/MFP68901.cpp
@@ -20,8 +20,8 @@ uint8_t MFP68901::read(int address) {
 	address &= 0x1f;
 	switch(address) {
 		case 0x00:
-			LOG("Read: general purpose IO " << PADHEX(2) << int(gpip_input_ | gpip_direction_));
-		return gpip_input_ | gpip_direction_;
+			LOG("Read: general purpose IO " << PADHEX(2) << ((gpip_input_ & ~gpip_direction_) | (gpip_output_ & gpip_direction_)));
+		return (gpip_input_ & ~gpip_direction_) | (gpip_output_ & gpip_direction_);
 		case 0x01:
 			LOG("Read: active edge " << PADHEX(2) << int(gpip_active_edge_));
 		return gpip_active_edge_;