Skip to content

dmae: Implement 16bit endian swap for DMAECopyMem #1564

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

Merged
merged 1 commit into from
May 12, 2025

Conversation

Mefiresu
Copy link
Contributor

Simply adapted from the 32bit behavior above.
Needed it for an homebrew app.

// swap per uint16
uint16* srcBuffer = (uint16*)memory_getPointerFromVirtualOffset(hCPU->gpr[4]);
uint16* dstBuffer = (uint16*)memory_getPointerFromVirtualOffset(hCPU->gpr[3]);
for(uint32 i=0; i<hCPU->gpr[5]; i++)
Copy link
Member

Choose a reason for hiding this comment

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

I am unsure but it might be size * 2 here because it counts in multiple of 4 bytes. Do you know what behavior the homebrew expects?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are definitely right, I didn't take into account the size * 2 in the homebrew code and it ended up working anyway...

@Exzap Exzap merged commit 05617a3 into cemu-project:main May 12, 2025
@Exzap
Copy link
Member

Exzap commented May 12, 2025

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants