From b4a93cfddecdb939562e56d7609657d2f14b6702 Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Sun, 30 Apr 2017 21:36:00 -0700 Subject: DSP: Create backing memory for entire DSP RAM Also move address space mapping out of video_core. --- src/audio_core/hle/dsp.h | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'src/audio_core/hle/dsp.h') diff --git a/src/audio_core/hle/dsp.h b/src/audio_core/hle/dsp.h index 0a0f60ac1..94ce48863 100644 --- a/src/audio_core/hle/dsp.h +++ b/src/audio_core/hle/dsp.h @@ -31,8 +31,8 @@ namespace HLE { // double-buffer. The frame counter is located as the very last u16 of each region and is // incremented each audio tick. -constexpr VAddr region0_base = 0x1FF50000; -constexpr VAddr region1_base = 0x1FF70000; +constexpr u32 region0_offset = 0x50000; +constexpr u32 region1_offset = 0x70000; /** * The DSP is native 16-bit. The DSP also appears to be big-endian. When reading 32-bit numbers from @@ -512,7 +512,22 @@ struct SharedMemory { }; ASSERT_DSP_STRUCT(SharedMemory, 0x8000); -extern std::array g_regions; +union DspMemory { + std::array raw_memory; + struct { + u8 unused_0[0x50000]; + SharedMemory region_0; + u8 unused_1[0x18000]; + SharedMemory region_1; + u8 unused_2[0x8000]; + }; +}; +static_assert(offsetof(DspMemory, region_0) == region0_offset, + "DSP region 0 is at the wrong offset"); +static_assert(offsetof(DspMemory, region_1) == region1_offset, + "DSP region 1 is at the wrong offset"); + +extern DspMemory g_dsp_memory; // Structures must have an offset that is a multiple of two. static_assert(offsetof(SharedMemory, frame_counter) % 2 == 0, -- cgit v1.2.3