Prepare setup of CD drive

This commit is contained in:
2023-01-22 11:02:27 +01:00
parent 5a23249032
commit 2250be6df9
4 changed files with 52 additions and 4 deletions

View File

@@ -31,6 +31,7 @@ namespace JabyEngine {
struct InterruptEnable : public ComplexBitMap<uint8_t> {
static constexpr auto InterruptTypValue = BitRange<uint8_t>::from_to(0, 2);
static constexpr auto InterruptExtended = BitRange<uint8_t>::from_to(0, 4);
static constexpr auto UnknownIRQ = Bit<uint8_t>(3);
static constexpr auto CommandStartIRQ = Bit<uint8_t>(4);
};
@@ -57,7 +58,11 @@ namespace JabyEngine {
};
struct Interrupt {
static void enable_all(VolatileBitMapPOD<InterruptEnable>& port) {
static void enable(VolatileBitMapPOD<InterruptEnable>& port) {
port.write(InterruptEnable::InterruptTypValue.max());
}
static void enable_extended(VolatileBitMapPOD<InterruptEnable>& port) {
port.write({InterruptEnable::with(InterruptEnable::InterruptTypValue.max(), InterruptEnable::UnknownIRQ, InterruptEnable::CommandStartIRQ)});
}
@@ -68,6 +73,10 @@ namespace JabyEngine {
static void ack(VolatileBitMapPOD<InterruptFlag>& port) {
port.write(InterruptFlag::InterruptTypValue.max());
}
static void ack_extended(VolatileBitMapPOD<InterruptFlag>& port) {
port.write({InterruptFlag::with(InterruptFlag::InterruptTypValue.max(), InterruptEnable::UnknownIRQ, InterruptEnable::CommandStartIRQ)});
}
};
__declare_io_port_global(IndexStatus_t, IndexStatus, 0x1F801800);