It's definitely possible, just that the interpreter doesn't run often enough...

This commit is contained in:
2026-04-14 11:41:59 +02:00
parent e48f37fca1
commit 2f01416d21
9 changed files with 113 additions and 80 deletions
+7 -5
View File
@@ -18,15 +18,15 @@ u64 Scheduler::Remove(const EventType eventType) const {
return 0;
}
void Scheduler::Tick(const u64 t) {
void Scheduler::Tick(const u64 t, float volumeL, float volumeR) {
n64::Mem& mem = n64::Core::GetMem();
ticks += t;
n64::MI &mi = mem.mmio.mi;
n64::SI &si = mem.mmio.si;
n64::PI &pi = mem.mmio.pi;
while (ticks >= events.top().time) {
switch (const auto type = events.top().type) {
for (auto event = events.top(); ticks >= event.time; events.pop()) {
switch (event.type) {
case SI_DMA:
si.DMA();
break;
@@ -37,15 +37,17 @@ void Scheduler::Tick(const u64 t) {
case PI_BUS_WRITE_COMPLETE:
pi.ioBusy = false;
break;
case VI_HALFLINE:
n64::Core::GetInstance().VIHalflineComplete(ticks, volumeL, volumeR);
break;
case NONE:
break;
case IMPOSSIBLE:
Util::Error::GetInstance().Throw({Util::Error::Severity::UNRECOVERABLE}, {Util::Error::Type::ROM_LOAD_ERROR}, {}, {}, "Unrecognized rom endianness");
return;
default:
Util::Error::GetInstance().Throw({Util::Error::Severity::UNRECOVERABLE}, {Util::Error::Type::ROM_LOAD_ERROR}, {}, {}, "Unknown scheduler event type {}", static_cast<int>(type));
Util::Error::GetInstance().Throw({Util::Error::Severity::UNRECOVERABLE}, {Util::Error::Type::ROM_LOAD_ERROR}, {}, {}, "Unknown scheduler event type {}", static_cast<int>(event.type));
return;
}
events.pop();
}
}