Cody fixes

This commit is contained in:
2024-06-09 21:59:43 +02:00
parent 336e877aa6
commit c789deb800
9 changed files with 79 additions and 97 deletions

View File

@@ -20,8 +20,6 @@ namespace JabyEngine {
extern State current_state;
extern volatile uint8_t cmd_interrupt_bit;
extern uint8_t rel_last_send_cmd;
extern uint8_t last_send_cmd;
struct Command {
struct Internal {
@@ -35,16 +33,11 @@ namespace JabyEngine {
do {
cur_irq = CD_IO::Interrupt::get_type(CD_IO::PortIndex1::InterruptFlag);
if(cur_irq == CD_IO::Interrupt::Acknowledge) {
printf("Rand ACK for 0x%X\n", last_send_cmd);
}
if(cur_irq == CD_IO::Interrupt::Complete) {
printf("Rand Comp for 0x%X\n", last_send_cmd);
}
} while(cur_irq == CD_IO::Interrupt::None);
cur_irq = CD_IO::Interrupt::get_type(CD_IO::PortIndex1::InterruptFlag);
CD_IO::Interrupt::ack_extended(CD_IO::PortIndex1::InterruptFlag);
cmd_interrupt_bit = bit::set(cmd_interrupt_bit, cur_irq);
return cur_irq;
};
CD_IO::PortIndex1::change_to();
@@ -61,9 +54,6 @@ namespace JabyEngine {
CD_IO::PortIndex0::change_to();
((parameter_fifo.write(CD_IO::ParameterFifo{args})),...);
cmd_fifo.write(CD_IO::CommandFifo{cmd.id});
rel_last_send_cmd = cmd.id;
last_send_cmd = cmd.id;
SysCall::ExitCriticalSection();
}
@@ -74,9 +64,6 @@ namespace JabyEngine {
CD_IO::PortIndex0::change_to();
((parameter_fifo.write(CD_IO::ParameterFifo{args})),...);
cmd_fifo.write(CD_IO::CommandFifo{cmd.id});
rel_last_send_cmd = cmd.id;
last_send_cmd = cmd.id;
}
};
@@ -105,6 +92,7 @@ namespace JabyEngine {
}
void read_file(AutoLBAEntry file_info, const SectorBufferAllocator& buffer_allocator);
void end_read_file();
void continue_reading();
BCDTimeStamp get_loc();

View File

@@ -58,7 +58,10 @@ namespace JabyEngine {
}
inline CD_IO::DataSector* allocate_sector() const {
return this->allocate(this->ctx);
if(this->allocate) {
return this->allocate(this->ctx);
}
return nullptr;
}
};