Make EXI use CoreTiming events like everything else instead of having its own slow special check.

Microphone is probably wrong/mistimed because it doesn't take into
account cycles late, but that's not a new issue here.
This commit is contained in:
comex committed 2014-11-03 00:28:46 -05:00
1 parent 204598a082
commit 9f683f353b
9 files changed
+36 -28

No files matched your search

+20 -6
View File
@@ -23,6 +23,10 @@ static int changeDevice;
static int updateInterrupts;
static CEXIChannel *g_Channels[MAX_EXI_CHANNELS];
static void ChangeDeviceCallback(u64 userdata, int cyclesLate);
static void UpdateInterruptsCallback(u64 userdata, int cycles_late);
void Init()
{
InitSRAM();
@@ -82,7 +86,7 @@ void RegisterMMIO(MMIO::Mapping* mmio, u32 base)
}
}
void ChangeDeviceCallback(u64 userdata, int cyclesLate)
static void ChangeDeviceCallback(u64 userdata, int cyclesLate)
{
u8 channel = (u8)(userdata >> 32);
u8 type = (u8)(userdata >> 16);
@@ -116,11 +120,6 @@ IEXIDevice* FindDevice(TEXIDevices device_type, int customIndex)
}
void UpdateInterrupts()
{
CoreTiming::ScheduleEvent_Threadsafe(0, updateInterrupts, 0);
}
void UpdateInterruptsCallback(u64 userdata, int cyclesLate)
{
// Interrupts are mapped a bit strangely:
// Channel 0 Device 0 generates interrupt on channel 0
@@ -135,4 +134,19 @@ void UpdateInterruptsCallback(u64 userdata, int cyclesLate)
ProcessorInterface::SetInterrupt(ProcessorInterface::INT_CAUSE_EXI, causeInt);
}
static void UpdateInterruptsCallback(u64 userdata, int cycles_late)
{
UpdateInterrupts();
}
void ScheduleUpdateInterrupts_Threadsafe(int cycles_late)
{
CoreTiming::ScheduleEvent_Threadsafe(cycles_late, updateInterrupts, 0);
}
void ScheduleUpdateInterrupts(int cycles_late)
{
CoreTiming::ScheduleEvent(cycles_late, updateInterrupts, 0);
}
} // end of namespace ExpansionInterface