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); }
static inline void WaitForLastLineIfVGAEnabled() { if(!IsInterruptEnabled(TIM2_IRQn)) return; while(VGALine!=0xffffffff); }