From 683d2d10afcee0d728794cc179f640e8a777b3c1 Mon Sep 17 00:00:00 2001 From: Julian Blake Kongslie Date: Mon, 31 Oct 2022 19:26:15 -0700 Subject: Unify TT_INPUT_INT_ENABLE and TT_OUTPUT_INT_ENABLE --- io/model.cpp | 4 ++-- isa/ctlreg.def | 3 +-- isa/decode.cpp | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/io/model.cpp b/io/model.cpp index e9caba0..3bea59e 100644 --- a/io/model.cpp +++ b/io/model.cpp @@ -24,11 +24,11 @@ bool iomodel::interact(std::array &ctlregs) { } bool interrupt = false; - if (ctlregs[TT_INPUT_INT_ENABLE]) { + if (ctlregs[TT_INT_ENABLE]) { if (ctlregs[TT_BITS] & TTI_FLAG) interrupt = true; } - if (ctlregs[TT_OUTPUT_INT_ENABLE]) { + if (ctlregs[TT_INT_ENABLE]) { if ((ctlregs[TT_BITS] & (TTO_FLAG|TTO_FLAG_OLD)) == TTO_FLAG) interrupt = true; } diff --git a/isa/ctlreg.def b/isa/ctlreg.def index c9eab05..d490073 100644 --- a/isa/ctlreg.def +++ b/isa/ctlreg.def @@ -4,5 +4,4 @@ REG(HALTED) REG(INT_ENABLE) // (int_enable_delay << 1) | int_enable REG(INT_PENDING) // only meaningful if interrupts disabled REG(TT_BITS) // see TT[IO]_* consts in isa/isa.h -REG(TT_INPUT_INT_ENABLE) // (status_enable << 1) | (int_enable) -REG(TT_OUTPUT_INT_ENABLE) +REG(TT_INT_ENABLE) // (status_enable << 1) | (int_enable) diff --git a/isa/decode.cpp b/isa/decode.cpp index f183c1f..c11679c 100644 --- a/isa/decode.cpp +++ b/isa/decode.cpp @@ -153,9 +153,9 @@ instruction_context decode(unsigned int dfifb, unsigned int pc, unsigned int bit }; break; case 5: - // KIE set TT_INPUT_INT_ENABLE to the low bit of the accumulator + // KIE set TT_INT_ENABLE to the low bit of the accumulator inst.need_read_acc = true; - inst.write_ctlreg = TT_INPUT_INT_ENABLE; + inst.write_ctlreg = TT_INT_ENABLE; inst.ef = [](auto &ctx) { ctx.ctlval = ctx.acc.value() & 3; }; -- cgit v1.2.3