Fix XEBRA
This commit is contained in:
parent
cc2d46f107
commit
3d2b409ea7
|
@ -10,7 +10,6 @@ namespace JabyEngine {
|
||||||
CD::BCDTimeStamp start_loc;
|
CD::BCDTimeStamp start_loc;
|
||||||
CD::BCDTimeStamp last_loc;
|
CD::BCDTimeStamp last_loc;
|
||||||
bool double_speed;
|
bool double_speed;
|
||||||
bool get_loc_functional; //< TODO: Really wanna use that?
|
|
||||||
uint8_t channel;
|
uint8_t channel;
|
||||||
} setting;
|
} setting;
|
||||||
|
|
||||||
|
@ -26,14 +25,6 @@ namespace JabyEngine {
|
||||||
CD::IRQ::resume_at0(setting.start_loc);
|
CD::IRQ::resume_at0(setting.start_loc);
|
||||||
CD::Command::send(CD_IO::Command::ReadS);
|
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;
|
} break;
|
||||||
|
|
||||||
case CD_IO::Interrupt::DiskError:
|
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) {
|
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.start_loc = CD::BCDTimeStamp::from(lba[rel_lba_idx].get_lba());
|
||||||
setting.double_speed = double_speed;
|
setting.double_speed = double_speed;
|
||||||
setting.get_loc_functional = !CD::get_loc().is_zero();
|
|
||||||
|
|
||||||
CD::enable_CDXA(double_speed); //< Activates PortIndex0
|
CD::enable_CDXA(double_speed); //< Activates PortIndex0
|
||||||
set_channel(channel);
|
set_channel(channel);
|
||||||
|
@ -66,9 +56,7 @@ namespace JabyEngine {
|
||||||
|
|
||||||
void push_play() {
|
void push_play() {
|
||||||
stop();
|
stop();
|
||||||
if(setting.get_loc_functional) {
|
setting.last_loc = CD::get_loc();
|
||||||
setting.last_loc = CD::get_loc();
|
|
||||||
}
|
|
||||||
CD::current_state = CD::State::Ready;
|
CD::current_state = CD::State::Ready;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -187,15 +187,17 @@ namespace JabyEngine {
|
||||||
BCDTimeStamp get_loc() {
|
BCDTimeStamp get_loc() {
|
||||||
Command::send_wait_response(CD_IO::Command::GetLocP);
|
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?)
|
// XEBRA does not support the mirror register so we go for the original...
|
||||||
const auto index = CD_IO::PortIndex0::ResponseFifo.read().raw; // index number (Usually 01h)
|
CD_IO::PortIndex1::change_to();
|
||||||
const auto mm = CD_IO::PortIndex0::ResponseFifo.read().raw; // minute number within track (00h and up)
|
const auto track = CD_IO::PortIndex1::ResponseFifo.read().raw; // track number (AAh=Lead-out area) (FFh=unknown, toc, none?)
|
||||||
const auto ss = CD_IO::PortIndex0::ResponseFifo.read().raw; // second number within track (00h to 59h)
|
const auto index = CD_IO::PortIndex1::ResponseFifo.read().raw; // index number (Usually 01h)
|
||||||
const auto sect = CD_IO::PortIndex0::ResponseFifo.read().raw; // sector number within track (00h to 74h)
|
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 min = CD_IO::PortIndex1::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 sec = CD_IO::PortIndex1::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 sectors = CD_IO::PortIndex1::ResponseFifo.read().raw; // sector number on entire disk (00h to 74h)
|
||||||
|
|
||||||
return BCDTimeStamp{min, sec, sectors};
|
return BCDTimeStamp{min, sec, sectors};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue