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 6 additions and 6 deletions
Showing only changes of commit d36876b17c - Show all commits

View File

@ -31,7 +31,7 @@ struct XAPlayer {
} }
void change_channel(int8_t step) { void change_channel(int8_t step) {
this->channel = (this->channel + step)%MaxChannels; this->channel = static_cast<uint8_t>((this->channel + step))%MaxChannels;
CDXA::set_channel(this->channel); CDXA::set_channel(this->channel);
} }

View File

@ -16,20 +16,20 @@ namespace JabyEngine {
}; };
extern State current_state; extern State current_state;
extern uint8_t cmd_interrupt_bit; extern volatile uint8_t cmd_interrupt_bit;
struct Command { struct Command {
static void wait_completed() { static void wait_completed() {
while(const_cast<volatile uint8_t&>(cmd_interrupt_bit) > 0); while(cmd_interrupt_bit > 0);
} }
template<typename...ARGS> template<typename...ARGS>
static void send(IOPort<CD_IO::CommandFifo>& cmd_fifo, IOPort<CD_IO::ParameterFifo>& parameter_fifo, CD_IO::Command::Desc cmd, ARGS...args) { static void send(IOPort<CD_IO::CommandFifo>& cmd_fifo, IOPort<CD_IO::ParameterFifo>& parameter_fifo, CD_IO::Command::Desc cmd, ARGS...args) {
while(CD_IO::IndexStatus.read().is_set(CD_IO::IndexStatus::IsTransmissionBusy)); while(CD_IO::IndexStatus.read().is_set(CD_IO::IndexStatus::IsTransmissionBusy));
cmd_interrupt_bit = bit::set(0, cmd.complete_irq);
((parameter_fifo.write(CD_IO::ParameterFifo{args})),...); ((parameter_fifo.write(CD_IO::ParameterFifo{args})),...);
cmd_fifo.write(CD_IO::CommandFifo {cmd.id}); cmd_fifo.write(CD_IO::CommandFifo {cmd.id});
cmd_interrupt_bit = bit::set(0, cmd.complete_irq);
} }
template<typename T, typename...ARGS> template<typename T, typename...ARGS>

View File

@ -38,7 +38,7 @@ namespace JabyEngine {
static SectorBufferAllocator sector_allocator; static SectorBufferAllocator sector_allocator;
static File cur_file; static File cur_file;
uint8_t cmd_interrupt_bit = 0; volatile uint8_t cmd_interrupt_bit = 0;
State current_state = State::Ready; State current_state = State::Ready;
SysCall::InterrupCallback callback = { SysCall::InterrupCallback callback = {
.next = nullptr, .next = nullptr,