Implement event-based scheduler instead of lock-step components

This commit is contained in:
Connor McLaughlin
2020-01-24 14:53:40 +10:00
parent 624888e131
commit 1b9609ef61
26 changed files with 1089 additions and 520 deletions

View File

@ -8,6 +8,7 @@
class StateWrapper;
class System;
class TimingEvent;
class InterruptController;
class Controller;
class MemoryCard;
@ -31,8 +32,6 @@ public:
u32 ReadRegister(u32 offset);
void WriteRegister(u32 offset, u32 value);
void Execute(TickCount ticks);
private:
static constexpr u32 NUM_SLOTS = 2;
@ -97,8 +96,9 @@ private:
void SoftReset();
void UpdateJoyStat();
void TransferEvent(TickCount ticks_late);
void BeginTransfer();
void DoTransfer();
void DoTransfer(TickCount ticks_late);
void DoACK();
void EndTransfer();
void ResetDeviceTransferState();
@ -109,8 +109,8 @@ private:
std::array<std::unique_ptr<Controller>, NUM_SLOTS> m_controllers;
std::array<std::unique_ptr<MemoryCard>, NUM_SLOTS> m_memory_cards;
std::unique_ptr<TimingEvent> m_transfer_event;
State m_state = State::Idle;
TickCount m_ticks_remaining = 0;
JOY_CTRL m_JOY_CTRL = {};
JOY_STAT m_JOY_STAT = {};