Integrate all the progress into master #6

Merged
jaby merged 595 commits from ToolBox into main 2025-01-01 13:17:44 +00:00
3 changed files with 21 additions and 10 deletions
Showing only changes of commit aaf3b7b814 - Show all commits

View File

@ -38,6 +38,9 @@ namespace JabyEngine {
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);
CD_IO::Interrupt::ack_extended(CD_IO::PortIndex1::InterruptFlag);
cmd_interrupt_bit = bit::set(cmd_interrupt_bit, cur_irq);
@ -57,8 +60,7 @@ namespace JabyEngine {
cmd_interrupt_bit = 0;
CD_IO::PortIndex0::change_to();
((parameter_fifo.write(CD_IO::ParameterFifo{args})),...);
cmd_fifo.write(CD_IO::CommandFifo{cmd.id});
//printf(">>> 0x%X send @%i\n", cmd.id, CD_IO::IndexStatus.read().raw&0b111);
cmd_fifo.write(CD_IO::CommandFifo{cmd.id});
rel_last_send_cmd = cmd.id;
last_send_cmd = cmd.id;

View File

@ -14,7 +14,7 @@ namespace JabyEngine {
} setting;
CD::State interrupt_handler(uint8_t irq) {
switch(irq) {
/* switch(irq) {
case CD_IO::Interrupt::DataReady: {
// The IRQ stack is 0x1000 bytes large so this should fit
CD::RawXADataSector xa_file;
@ -29,7 +29,7 @@ namespace JabyEngine {
case CD_IO::Interrupt::DiskError:
return CD::State::Error;
};
};*/
return CD::State::XAMode;
}
@ -37,11 +37,11 @@ namespace JabyEngine {
setting.start_loc = CD::BCDTimeStamp::from(lba[rel_lba_idx].get_lba());
setting.double_speed = double_speed;
CD::current_state = CD::State::XAMode;
CD::enable_CDXA(double_speed); //< Activates PortIndex0
set_channel(channel);
CD::Command::send_wait(CD_IO::Command::SetLoc, setting.start_loc.min, setting.start_loc.sec, setting.start_loc.sector);
CD::Command::send_wait(CD_IO::Command::ReadS);
//CD::current_state = CD::State::XAMode;
}
void stop() {
@ -59,15 +59,16 @@ namespace JabyEngine {
void push_play() {
stop();
setting.last_loc = CD::get_loc();
CD::current_state = CD::State::Ready;
}
void pop_play() {
CD::current_state = CD::State::XAMode;
CD::enable_CDXA(setting.double_speed); //< Activates PortIndex0
set_channel(setting.channel);
CD::Command::send_wait(CD_IO::Command::SetLoc, setting.last_loc.min, setting.last_loc.sec, setting.last_loc.sector);
CD::Command::send_wait(CD_IO::Command::ReadS);
//CD::current_state = CD::State::XAMode;
}
}
}

View File

@ -116,17 +116,25 @@ namespace JabyEngine {
read_sector_to0(sector->data, CD_IO::DataSector::SizeBytes);
if(cur_file.done_processing()) {
printf("Pause1\n");
current_state = State::Done;
Command::send_wait_irq(CD_IO::Command::Pause);
printf("Pause done!\n");
}
}
else {
current_state = State::BufferFull;
printf("Pause2\n");
Command::send_wait_irq(CD_IO::Command::Pause);
printf("Pause done!\n");
}
} break;
case CD_IO::Interrupt::Complete: {
printf("Complete for 0x%X\n", rel_last_send_cmd);
} break;
case CD_IO::Interrupt::Acknowledge: {
if(last_send_cmd != 0x0) {
printf("ACK 0x%X\n", last_send_cmd);
@ -169,12 +177,12 @@ namespace JabyEngine {
}
void read_file(AutoLBAEntry file_info, const SectorBufferAllocator& buffer_allocator) {
cur_file.set_from(file_info);
sector_allocator = buffer_allocator;
cur_file.set_from(file_info);
sector_allocator = buffer_allocator;
CD_IO::PortIndex0::change_to();
CD_IO::PortIndex0::change_to();
Command::send_wait(CD_IO::Command::SetMode, DataSectorMode);
send_read_n0(cur_file.cur_lba);
send_read_n0(cur_file.cur_lba);
}
void continue_reading() {