mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-20 03:24:59 +00:00
Merge db8b3ec30e
into 056b0339be
This commit is contained in:
commit
2baeb234d9
3 changed files with 22 additions and 4 deletions
|
@ -51,6 +51,7 @@ public:
|
|||
void SwapUCode(u32 crc);
|
||||
|
||||
Core::System& GetSystem() const { return m_system; }
|
||||
UCodeInterface& GetUCode() const { return *m_ucode; }
|
||||
|
||||
private:
|
||||
void SendMailToDSP(u32 mail);
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include "Common/Logging/Log.h"
|
||||
#include "Common/Swap.h"
|
||||
#include "Core/Core.h"
|
||||
#include "Core/CoreTiming.h"
|
||||
#include "Core/DolphinAnalytics.h"
|
||||
#include "Core/HW/DSP.h"
|
||||
#include "Core/HW/DSPHLE/DSPHLE.h"
|
||||
|
@ -48,10 +49,22 @@ void AXUCode::Initialize()
|
|||
void AXUCode::InitializeShared()
|
||||
{
|
||||
m_mail_handler.PushMail(DSP_INIT, true);
|
||||
auto& core_timing = m_dsphle->GetSystem().GetCoreTiming();
|
||||
m_event_type_handle_command_list =
|
||||
core_timing.RegisterEvent("HandleCommandList", HandleCommandListEvent);
|
||||
|
||||
LoadResamplingCoefficients(false, 0);
|
||||
}
|
||||
|
||||
void AXUCode::HandleCommandListEvent(Core::System& system, u64 /*userdata*/, s64 cyclesLate)
|
||||
{
|
||||
const auto dsphle = static_cast<DSPHLE*>(system.GetDSP().GetDSPEmulator());
|
||||
auto& self = static_cast<AXUCode&>(dsphle->GetUCode());
|
||||
self.HandleCommandList();
|
||||
self.m_cmdlist_size = 0;
|
||||
self.SignalWorkEnd();
|
||||
}
|
||||
|
||||
bool AXUCode::LoadResamplingCoefficients(bool require_same_checksum, u32 desired_checksum)
|
||||
{
|
||||
constexpr size_t raw_coeffs_size = 0x800 * 2;
|
||||
|
@ -741,13 +754,15 @@ void AXUCode::HandleMail(u32 mail)
|
|||
break;
|
||||
|
||||
case MailState::WaitingForCmdListAddress:
|
||||
{
|
||||
CopyCmdList(mail, m_cmdlist_size);
|
||||
HandleCommandList();
|
||||
m_cmdlist_size = 0;
|
||||
SignalWorkEnd();
|
||||
auto& core_timing = m_dsphle->GetSystem().GetCoreTiming();
|
||||
// Cycle count determined by ear for Donkey Kong Barrel Blast.
|
||||
core_timing.ScheduleEvent(10'000, m_event_type_handle_command_list);
|
||||
|
||||
m_mail_state = MailState::WaitingForNextTask;
|
||||
break;
|
||||
|
||||
}
|
||||
case MailState::WaitingForNextTask:
|
||||
if ((mail & TASK_MAIL_MASK) != TASK_MAIL_TO_DSP)
|
||||
{
|
||||
|
|
|
@ -110,6 +110,7 @@ protected:
|
|||
u16 m_compressor_pos = 0;
|
||||
|
||||
std::unique_ptr<Accelerator> m_accelerator;
|
||||
CoreTiming::EventType* m_event_type_handle_command_list;
|
||||
|
||||
// Constructs without any GC-specific state, so it can be used by the deriving AXWii.
|
||||
AXUCode(DSPHLE* dsphle, u32 crc, bool dummy);
|
||||
|
@ -126,6 +127,7 @@ protected:
|
|||
// versions of AX.
|
||||
AXMixControl ConvertMixerControl(u32 mixer_control);
|
||||
|
||||
static void HandleCommandListEvent(Core::System& system, u64 userdata, s64 cyclesLate);
|
||||
virtual void HandleCommandList();
|
||||
void SignalWorkEnd();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue