diff options
| author | MaranBr <maranbr@outlook.com> | 2025-12-31 01:16:44 +0100 |
|---|---|---|
| committer | crueter <crueter@eden-emu.dev> | 2025-12-31 01:16:44 +0100 |
| commit | 8ad1d0c31789c9f7d8805ec264c93d89fefb5ed6 (patch) | |
| tree | 8d87ca9b6dc536404eefd4837b894df76b749c4d /src | |
| parent | fb1600b7d13b777f0a801df2d68807e9c903d2f9 (diff) | |
[maxwell_dma] Fix CONST_A for different component sizes in MaxwellDMA Launch (#3211)
This implements 1 byte and 2 bytes component sizes, required by Marvel: Cosmic Invasion.
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3211
Reviewed-by: Lizzie <lizzie@eden-emu.dev>
Co-authored-by: MaranBr <maranbr@outlook.com>
Co-committed-by: MaranBr <maranbr@outlook.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/engines/maxwell_dma.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/video_core/engines/maxwell_dma.cpp b/src/video_core/engines/maxwell_dma.cpp index e2aa6c7e49..747759bf41 100644 --- a/src/video_core/engines/maxwell_dma.cpp +++ b/src/video_core/engines/maxwell_dma.cpp @@ -96,15 +96,14 @@ void MaxwellDMA::Launch() { auto& accelerate = rasterizer->AccessAccelerateDMA(); const bool is_const_a_dst = regs.remap_const.dst_x == RemapConst::Swizzle::CONST_A; if (regs.launch_dma.remap_enable != 0 && is_const_a_dst) { - ASSERT(regs.remap_const.component_size_minus_one == 3); - accelerate.BufferClear(regs.offset_out, regs.line_length_in, - regs.remap_const.remap_consta_value); + const u32 component_size = regs.remap_const.component_size_minus_one + 1; + ASSERT(component_size == 1 || component_size == 2 || component_size == 4); + if (component_size == 4) { + accelerate.BufferClear(regs.offset_out, regs.line_length_in, regs.remap_const.remap_consta_value); + } read_buffer.resize_destructive(regs.line_length_in * sizeof(u32)); - std::span<u32> span(reinterpret_cast<u32*>(read_buffer.data()), regs.line_length_in); - std::ranges::fill(span, regs.remap_const.remap_consta_value); - memory_manager.WriteBlockUnsafe(regs.offset_out, - reinterpret_cast<u8*>(read_buffer.data()), - regs.line_length_in * sizeof(u32)); + std::ranges::fill(std::span<u32>(reinterpret_cast<u32*>(read_buffer.data()), regs.line_length_in), regs.remap_const.remap_consta_value); + memory_manager.WriteBlockUnsafe(regs.offset_out, reinterpret_cast<u8*>(read_buffer.data()), static_cast<size_t>(regs.line_length_in) * component_size); } else { memory_manager.FlushCaching(); const auto convert_linear_2_blocklinear_addr = [](u64 address) { |
