Beispiel #1
0
void CPU::RequestInterrupt(InterruptTypes type)
{
    if (!IsInterruptEnabled(type))
        return;

    // Write the interrupt to the Interrupt Request Flags, they will be processed on the next tick
    uint16_t interruptRequests = GetMemory()->ReadUInt16(InterruptRequestFlags);
    interruptRequests |= (1 << uint8_t(type));
    GetMemory()->WriteUInt16(InterruptRequestFlags, interruptRequests);
}
Beispiel #2
0
static inline void WaitForLastLineIfVGAEnabled()
{
    if(!IsInterruptEnabled(TIM2_IRQn)) return;
    while(VGALine!=0xffffffff);
}