From c907eaac39cde83abe0a8c64118d0eaf82f56af0 Mon Sep 17 00:00:00 2001 From: wixette Date: Sat, 7 Mar 2020 01:40:17 +0800 Subject: [PATCH] complete the readport code --- js/sim8800.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js/sim8800.js b/js/sim8800.js index b21ba23..d3b7103 100644 --- a/js/sim8800.js +++ b/js/sim8800.js @@ -248,8 +248,10 @@ class Sim8800 { var self = this; return function(address) { var value = 0; - if (address == 0xff) { - // We only care about port 0xff. + // We only care about the port 0xff. + if (address == 0xff && this.getInputAddressCallback) { + var word = this.getInputAddressCallback(); + return word >> 8; } return value; };