Prepare CD Callback handler

This commit is contained in:
2024-06-13 22:28:37 +02:00
parent d628375a18
commit d8aee97397
7 changed files with 39 additions and 59 deletions

View File

@@ -60,7 +60,7 @@ namespace JabyEngine {
Internal::send(cmd, true, args...);
}
template<typename...ARGS>
template<typename...ARGS>
static void sendX(CD_IO::Command::Desc cmd, ARGS...args) {
Internal::send(cmd, false, args...);
}
@@ -76,6 +76,7 @@ template<typename...ARGS>
};
namespace IRQ {
void data_ready_handler(uint32_t data);
void read_sector_to0(uint32_t* dst, size_t bytes);
void resume_at0(const BCDTimeStamp& cd_time);
}

View File

@@ -4,6 +4,11 @@
namespace JabyEngine {
namespace Callback {
namespace internal {
static void execute_thread(SysCall::ThreadHandle thread_handle) {
MainThread::prepare_if_main(thread_handle);
Thread::execute_next();
}
namespace VSync {
static constexpr size_t StackSize = 64;
@@ -11,22 +16,19 @@ namespace JabyEngine {
extern uint32_t stack[StackSize];
void routine();
static void execute() {
MainThread::prepare_if_main(VSync::thread_handle);
Thread::execute_next();
static void [[deprecated("Currently not in use")]] execute() {
execute_thread(VSync::thread_handle);
}
}
namespace DataReady {
namespace CD {
static constexpr size_t StackSize = 256;
extern SysCall::ThreadHandle thread_handle;
extern uint32_t stack[StackSize];
void routine();
static void execute() {
MainThread::prepare_if_main(DataReady::thread_handle);
Thread::execute_next();
execute_thread(CD::thread_handle);
}
}
}