mirror of
https://github.com/StrikerX3/StrikeBox.git
synced 2024-06-21 13:52:36 -04:00
26 lines
395 B
C++
26 lines
395 B
C++
#pragma once
|
|
|
|
#include <cstdint>
|
|
|
|
namespace vixen {
|
|
|
|
class IRQHandler {
|
|
public:
|
|
virtual void HandleIRQ(uint8_t irqNum, bool level) = 0;
|
|
};
|
|
|
|
struct IRQ {
|
|
IRQHandler *handler;
|
|
uint8_t num;
|
|
|
|
inline void Handle(bool level) {
|
|
if (handler != nullptr) {
|
|
handler->HandleIRQ(num, level);
|
|
}
|
|
}
|
|
};
|
|
|
|
IRQ *AllocateIRQs(IRQHandler *handler, uint8_t numIRQs);
|
|
|
|
}
|