Fix XEBRA

This commit is contained in:
Jaby 2024-07-04 19:07:07 +02:00
parent cc2d46f107
commit 3d2b409ea7
2 changed files with 11 additions and 21 deletions

View File

@ -10,7 +10,6 @@ namespace JabyEngine {
CD::BCDTimeStamp start_loc;
CD::BCDTimeStamp last_loc;
bool double_speed;
bool get_loc_functional; //< TODO: Really wanna use that?
uint8_t channel;
} setting;
@ -26,14 +25,6 @@ namespace JabyEngine {
CD::IRQ::resume_at0(setting.start_loc);
CD::Command::send(CD_IO::Command::ReadS);
}
else {
if(!setting.get_loc_functional) {
setting.last_loc.min = xa_file.header.minute;
setting.last_loc.sec = xa_file.header.second;
setting.last_loc.sector = xa_file.header.sector;
}
}
} break;
case CD_IO::Interrupt::DiskError:
@ -45,7 +36,6 @@ namespace JabyEngine {
void play(const volatile AutoLBAEntry* lba, uint8_t rel_lba_idx, uint8_t channel, bool double_speed) {
setting.start_loc = CD::BCDTimeStamp::from(lba[rel_lba_idx].get_lba());
setting.double_speed = double_speed;
setting.get_loc_functional = !CD::get_loc().is_zero();
CD::enable_CDXA(double_speed); //< Activates PortIndex0
set_channel(channel);
@ -66,9 +56,7 @@ namespace JabyEngine {
void push_play() {
stop();
if(setting.get_loc_functional) {
setting.last_loc = CD::get_loc();
}
CD::current_state = CD::State::Ready;
}

View File

@ -187,15 +187,17 @@ namespace JabyEngine {
BCDTimeStamp get_loc() {
Command::send_wait_response(CD_IO::Command::GetLocP);
const auto track = CD_IO::PortIndex0::ResponseFifo.read().raw; // track number (AAh=Lead-out area) (FFh=unknown, toc, none?)
const auto index = CD_IO::PortIndex0::ResponseFifo.read().raw; // index number (Usually 01h)
const auto mm = CD_IO::PortIndex0::ResponseFifo.read().raw; // minute number within track (00h and up)
const auto ss = CD_IO::PortIndex0::ResponseFifo.read().raw; // second number within track (00h to 59h)
const auto sect = CD_IO::PortIndex0::ResponseFifo.read().raw; // sector number within track (00h to 74h)
// XEBRA does not support the mirror register so we go for the original...
CD_IO::PortIndex1::change_to();
const auto track = CD_IO::PortIndex1::ResponseFifo.read().raw; // track number (AAh=Lead-out area) (FFh=unknown, toc, none?)
const auto index = CD_IO::PortIndex1::ResponseFifo.read().raw; // index number (Usually 01h)
const auto mm = CD_IO::PortIndex1::ResponseFifo.read().raw; // minute number within track (00h and up)
const auto ss = CD_IO::PortIndex1::ResponseFifo.read().raw; // second number within track (00h to 59h)
const auto sect = CD_IO::PortIndex1::ResponseFifo.read().raw; // sector number within track (00h to 74h)
const auto min = CD_IO::PortIndex0::ResponseFifo.read().raw; // minute number on entire disk (00h and up)
const auto sec = CD_IO::PortIndex0::ResponseFifo.read().raw; // second number on entire disk (00h to 59h)
const auto sectors = CD_IO::PortIndex0::ResponseFifo.read().raw; // sector number on entire disk (00h to 74h)
const auto min = CD_IO::PortIndex1::ResponseFifo.read().raw; // minute number on entire disk (00h and up)
const auto sec = CD_IO::PortIndex1::ResponseFifo.read().raw; // second number on entire disk (00h to 59h)
const auto sectors = CD_IO::PortIndex1::ResponseFifo.read().raw; // sector number on entire disk (00h to 74h)
return BCDTimeStamp{min, sec, sectors};
}