Really fixed...?
This commit is contained in:
@@ -21,7 +21,6 @@ namespace JabyEngine {
|
||||
|
||||
extern State current_state;
|
||||
extern uint8_t irq_bit_pending;
|
||||
extern uint8_t last_cmd;
|
||||
|
||||
struct Command {
|
||||
static void wait_completed() {
|
||||
@@ -35,7 +34,6 @@ namespace JabyEngine {
|
||||
while(CD_IO::IndexStatus.read().is_set(CD_IO::IndexStatus::IsTransmissionBusy));
|
||||
|
||||
irq_bit_pending = bit::set(irq_bit_pending, cmd.complete_irq);
|
||||
last_cmd = cmd.id;
|
||||
CD_IO::PortIndex0::change_to();
|
||||
((CD_IO::PortIndex0::ParameterFifo.write(CD_IO::ParameterFifo{args})),...);
|
||||
CD_IO::PortIndex0::CommandFifo.write(CD_IO::CommandFifo{cmd.id});
|
||||
@@ -48,54 +46,6 @@ namespace JabyEngine {
|
||||
}
|
||||
};
|
||||
|
||||
/*struct NewCommand {
|
||||
struct Internal {
|
||||
static void wait_completed(CD_IO::Interrupt::Type irq) {
|
||||
static const auto get_next_irq = []() -> CD_IO::Interrupt::Type {
|
||||
CD_IO::Interrupt::Type cur_irq = CD_IO::Interrupt::None;
|
||||
|
||||
do {
|
||||
cur_irq = CD_IO::Interrupt::get_type(CD_IO::PortIndex1::InterruptFlag);
|
||||
} while(cur_irq == CD_IO::Interrupt::None);
|
||||
cur_irq = CD_IO::Interrupt::get_type(CD_IO::PortIndex1::InterruptFlag);
|
||||
// ^ Stabilize interrupt
|
||||
|
||||
CD_IO::Interrupt::ack_extended(CD_IO::PortIndex1::InterruptFlag);
|
||||
return cur_irq;
|
||||
};
|
||||
CD_IO::PortIndex1::change_to();
|
||||
while(get_next_irq() != irq);
|
||||
CD_IO::PortIndex0::change_to();
|
||||
}
|
||||
|
||||
template<typename...ARGS>
|
||||
static void send(CD_IO::Command::Desc cmd, ARGS...args) {
|
||||
while(CD_IO::IndexStatus.read().is_set(CD_IO::IndexStatus::IsTransmissionBusy));
|
||||
|
||||
CD_IO::PortIndex0::change_to();
|
||||
((CD_IO::PortIndex0::ParameterFifo.write(CD_IO::ParameterFifo{args})),...);
|
||||
CD_IO::PortIndex0::CommandFifo.write(CD_IO::CommandFifo{cmd.id});
|
||||
|
||||
while(CD_IO::IndexStatus.read().is_set(CD_IO::IndexStatus::IsTransmissionBusy));
|
||||
}
|
||||
};
|
||||
|
||||
// Requires Index 0
|
||||
template<typename...ARGS>
|
||||
static void send(CD_IO::Command::Desc cmd, ARGS...args) {
|
||||
Internal::send(cmd, args...);
|
||||
}
|
||||
|
||||
// Requires Index 0
|
||||
template<typename...ARGS>
|
||||
static void send_wait_response(CD_IO::Command::Desc cmd, ARGS...args) {
|
||||
Interrupt::disable_irq(Interrupt::CDROM);
|
||||
Internal::send(cmd, args...);
|
||||
Internal::wait_completed(cmd.complete_irq);
|
||||
Interrupt::enable_irq(Interrupt::CDROM);
|
||||
}
|
||||
};*/
|
||||
|
||||
namespace IRQ {
|
||||
void process(uint32_t irq);
|
||||
void read_sector_to0(uint32_t* dst, size_t bytes);
|
||||
|
||||
Reference in New Issue
Block a user