General: Recover Prometheus project from harddrive failure

This commit: Implements CPU Interrupts, Replaces Cycle Timing for Host 
Timing, Reworks the Kernel's Scheduler, Introduce Idle State and 
Suspended State, Recreates the bootmanager, Initializes Multicore 
system.
This commit is contained in:
Fernando Sahmkow 2020-02-24 22:04:12 -04:00
parent a83f0b607e
commit 7ee76003ad
57 changed files with 1349 additions and 824 deletions

View file

@ -52,6 +52,8 @@ void EmuThread::run() {
emit LoadProgress(VideoCore::LoadCallbackStage::Prepare, 0, 0);
Core::System::GetInstance().RegisterHostThread();
Core::System::GetInstance().Renderer().Rasterizer().LoadDiskResources(
stop_run, [this](VideoCore::LoadCallbackStage stage, std::size_t value, std::size_t total) {
emit LoadProgress(stage, value, total);
@ -65,28 +67,30 @@ void EmuThread::run() {
bool was_active = false;
while (!stop_run) {
if (running) {
if (!was_active)
if (was_active) {
emit DebugModeLeft();
}
Core::System::ResultStatus result = Core::System::GetInstance().RunLoop();
running_guard = true;
Core::System::ResultStatus result = Core::System::GetInstance().Run();
if (result != Core::System::ResultStatus::Success) {
running_guard = false;
this->SetRunning(false);
emit ErrorThrown(result, Core::System::GetInstance().GetStatusDetails());
}
running_wait.Wait();
result = Core::System::GetInstance().Pause();
if (result != Core::System::ResultStatus::Success) {
running_guard = false;
this->SetRunning(false);
emit ErrorThrown(result, Core::System::GetInstance().GetStatusDetails());
}
running_guard = false;
was_active = running || exec_step;
if (!was_active && !stop_run)
emit DebugModeEntered();
} else if (exec_step) {
if (!was_active)
emit DebugModeLeft();
exec_step = false;
Core::System::GetInstance().SingleStep();
was_active = true;
emit DebugModeEntered();
yieldCurrentThread();
was_active = false;
} else if (exec_step) {
UNIMPLEMENTED();
} else {
std::unique_lock lock{running_mutex};
running_cv.wait(lock, [this] { return IsRunning() || exec_step || stop_run; });