Make music loop
This commit is contained in:
parent
c10218d311
commit
6a68500896
|
@ -210,15 +210,12 @@ int changeThread(int threadId) { return SysCall::changeThreadSubFunction((uint32
|
|||
printf("EPC: 0x%p; SR: 0x%p\n", get_current_tcb().reg[31], get_current_tcb().sr); while(true);*/
|
||||
//SysCall::ReturnFromException();
|
||||
|
||||
CD_IO::PortIndex0::change_to();
|
||||
Command::send<CD_IO::PortIndex0>(CD_IO::Command::SetLoc, static_cast<uint8_t>(0x0), static_cast<uint8_t>(0x09), static_cast<uint8_t>(0x0));
|
||||
|
||||
CD_IO::PortIndex1::change_to();
|
||||
while(CD_IO::Interrupt::get_type(CD_IO::PortIndex1::InterruptFlag) != CD_IO::Interrupt::Acknowledge);
|
||||
CD_IO::Interrupt::ack_extended(CD_IO::PortIndex1::InterruptFlag);
|
||||
|
||||
CD_IO::PortIndex0::change_to();
|
||||
Command::send<CD_IO::PortIndex0>(CD_IO::Command::Play);
|
||||
if(thread != 0) {
|
||||
//changeThread(thread);
|
||||
printf("About to change...\n");
|
||||
exec_TCB->entry = reinterpret_cast<TCB*>(&__globals->threads[thread & 0xffff]);
|
||||
printf("Changed!\n");
|
||||
}
|
||||
} break;
|
||||
|
||||
case CD_IO::Interrupt::DiskError: {
|
||||
|
@ -229,11 +226,8 @@ int changeThread(int threadId) { return SysCall::changeThreadSubFunction((uint32
|
|||
// No masking required because we can only write bit 0 - 2
|
||||
CD_IO::IndexStatus.write(old_status);
|
||||
Interrupt::ack_irq(Interrupt::CDROM);
|
||||
|
||||
if(thread != 0) {
|
||||
//changeThread(thread);
|
||||
exec_TCB->entry = reinterpret_cast<TCB*>(&__globals->threads[thread & 0xffff]);
|
||||
}
|
||||
Interrupt::enable_irq(Interrupt::CDROM);
|
||||
printf("RET-E\n");
|
||||
SysCall::ReturnFromException();
|
||||
__builtin_unreachable();
|
||||
}
|
||||
|
@ -257,8 +251,6 @@ int changeThread(int threadId) { return SysCall::changeThreadSubFunction((uint32
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void enable_CDDA() {
|
||||
if(thread == 0) {
|
||||
__globals = reinterpret_cast<Globals*>(0x100);
|
||||
|
@ -271,6 +263,14 @@ int changeThread(int threadId) { return SysCall::changeThreadSubFunction((uint32
|
|||
printf("Hallo!\n");
|
||||
printf("Me: 0x%p - 0x%p\n", get_tcb_of_th(thread), &get_current_tcb());
|
||||
|
||||
printf("Blubb!\n");
|
||||
CD_IO::PortIndex0::change_to();
|
||||
printf("Schwupp!\n");
|
||||
Command::send<CD_IO::PortIndex0>(CD_IO::Command::SetLoc, static_cast<uint8_t>(0x0), static_cast<uint8_t>(0x09), static_cast<uint8_t>(0x0));
|
||||
printf("Mupp\n");
|
||||
Command::send<CD_IO::PortIndex0>(CD_IO::Command::Play);
|
||||
printf("Done!!\n");
|
||||
|
||||
exec_TCB->entry = mainFlow;
|
||||
SysCall::ReturnFromException();
|
||||
//changeThread(0);
|
||||
|
|
Loading…
Reference in New Issue