SI: Collapse interrupt generation check in UpdateInterrupts()

We can simplify this by storing the result of the test into a variable
instead.
This commit is contained in:
Lioncash 2021-08-31 16:12:13 -04:00
parent ca24c32cbf
commit d00e7d5a75
1 changed files with 4 additions and 8 deletions

View File

@ -247,14 +247,10 @@ static void UpdateInterrupts()
s_com_csr.RDSTINT = 0;
// check if we have to generate an interrupt
if ((s_com_csr.RDSTINT & s_com_csr.RDSTINTMSK) || (s_com_csr.TCINT & s_com_csr.TCINTMSK))
{
ProcessorInterface::SetInterrupt(ProcessorInterface::INT_CAUSE_SI, true);
}
else
{
ProcessorInterface::SetInterrupt(ProcessorInterface::INT_CAUSE_SI, false);
}
const bool generate_interrupt = (s_com_csr.RDSTINT & s_com_csr.RDSTINTMSK) != 0 ||
(s_com_csr.TCINT & s_com_csr.TCINTMSK) != 0;
ProcessorInterface::SetInterrupt(ProcessorInterface::INT_CAUSE_SI, generate_interrupt);
}
static void GenerateSIInterrupt(SIInterruptType type)