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