Support XEBRA; Slightly
This commit is contained in:
parent
ab6caf77b3
commit
3295a04f07
|
@ -165,6 +165,7 @@ namespace JabyEngine {
|
||||||
static constexpr Desc Demute{0x0C, Interrupt::Type::Acknowledge};
|
static constexpr Desc Demute{0x0C, Interrupt::Type::Acknowledge};
|
||||||
static constexpr Desc Filter{0x0D, Interrupt::Type::Acknowledge};
|
static constexpr Desc Filter{0x0D, Interrupt::Type::Acknowledge};
|
||||||
static constexpr Desc SetMode{0x0E, Interrupt::Type::Acknowledge};
|
static constexpr Desc SetMode{0x0E, Interrupt::Type::Acknowledge};
|
||||||
|
static constexpr Desc GetLocL{0x10, Interrupt::Type::Acknowledge};
|
||||||
static constexpr Desc GetLocP{0x11, Interrupt::Type::Acknowledge};
|
static constexpr Desc GetLocP{0x11, Interrupt::Type::Acknowledge};
|
||||||
static constexpr Desc GetTN{0x13, Interrupt::Type::Acknowledge};
|
static constexpr Desc GetTN{0x13, Interrupt::Type::Acknowledge};
|
||||||
static constexpr Desc GetTD{0x14, Interrupt::Type::Acknowledge};
|
static constexpr Desc GetTD{0x14, Interrupt::Type::Acknowledge};
|
||||||
|
|
|
@ -83,6 +83,10 @@ namespace JabyEngine {
|
||||||
|
|
||||||
return BCDTimeStamp::from_time(min, sec, sectors);
|
return BCDTimeStamp::from_time(min, sec, sectors);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
constexpr bool is_zero() const {
|
||||||
|
return this->min == 0 && this->sec == 0 && this->sector == 0;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@ 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;
|
||||||
|
|
||||||
|
@ -25,6 +26,14 @@ namespace JabyEngine {
|
||||||
CD::IRQ::resume_at0(setting.start_loc);
|
CD::IRQ::resume_at0(setting.start_loc);
|
||||||
CD::NewCommand::send(CD_IO::Command::ReadS);
|
CD::NewCommand::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:
|
||||||
|
@ -34,8 +43,9 @@ 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);
|
||||||
|
@ -56,7 +66,9 @@ namespace JabyEngine {
|
||||||
|
|
||||||
void push_play() {
|
void push_play() {
|
||||||
stop();
|
stop();
|
||||||
setting.last_loc = CD::get_loc();
|
if(setting.get_loc_functional) {
|
||||||
|
setting.last_loc = CD::get_loc();
|
||||||
|
}
|
||||||
CD::current_state = CD::State::Ready;
|
CD::current_state = CD::State::Ready;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue