Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash when using DSP LLE with CPU interpreter (or fastmem off) #8731

Merged
merged 2 commits into from Aug 1, 2020

Conversation

Pokechu22
Copy link
Contributor

@Pokechu22 Pokechu22 commented Apr 8, 2020

Fixes #11980. Memory::physical_base does not exist when fastmem is disabled.

Note that I remove some SSSE3 code (originally added 9 years ago in 559fb74). My machine is too old to support SSSE3, so I haven't tested the performance impact, but I don't think it's likely to make a difference in this one case (since it's not used by DSP HLE). If it actually does matter, then CopyFromEmuSwapped and CopyToEmuSwapped should be changed to use it instead.

@Pokechu22 Pokechu22 force-pushed the dsp-lle-cpu-int-crash branch 3 times, most recently from f2d1d7b to 8dd397a Compare April 11, 2020 22:08
@Pokechu22 Pokechu22 changed the title [WIP] Fix crash when using DSP LLE with CPU interpreter (or fastmem off) Fix crash when using DSP LLE with CPU interpreter (or fastmem off) Apr 11, 2020
@Pokechu22 Pokechu22 marked this pull request as ready for review April 11, 2020 22:15
@Pokechu22 Pokechu22 force-pushed the dsp-lle-cpu-int-crash branch 2 times, most recently from c27d2f5 to 7a03bd8 Compare April 28, 2020 21:44
memcpy(dst, code, size);
for (size_t i = 0; i < size / 2; i++)
dst[i] = Common::swap16(dst[i]);
Host::DMAToDSP(g_dsp.iram + dsp_addr / 2, addr, size);
Copy link
Member

@leoetlino leoetlino May 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the mask not needed anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming you're referring to g_dsp.cpu_ram[addr & 0x0fffffff], I don't think it is; CopyFromEmuSwapped uses Memory::GetPointer and it does its own masking (though with a different mask).

Perhaps Memory::GetPointerForRange would be better, but it's not public.

@Tilka Tilka merged commit dbacffd into dolphin-emu:master Aug 1, 2020
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants