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

Bugged u16 reads of DMA control registers #868

Open
lifehackerhansol opened this issue Nov 15, 2024 · 1 comment
Open

Bugged u16 reads of DMA control registers #868

lifehackerhansol opened this issue Nov 15, 2024 · 1 comment

Comments

@lifehackerhansol
Copy link
Contributor

lifehackerhansol commented Nov 15, 2024

State your operating system:

Windows 10

DesMuME version

commit b022181 (latest commit as of writing)

Issue

Starting with libnds v2.0.0, the DMA utility functions are using u16 to read and write from the DMA control registers. This behaves really weirdly; there seems to be some race condition when reading via u16 to check whether DMA is currently running. After looping through several DMA copies, it randomly crashes with YOUR GAME IS BOGARTED!!! PLEASE REPORT!!!, but I don't see any particular issue in https://github.com/devkitPro/libnds or https://github.com/devkitPro/calico.

Testing the same build below with DMA controls being accessed as u32 doesn't seem to exhibit the crash.

It should also be noted that all of this works on real hardware as well, tested using an original R4.

You may find an example below:

  1. Set Slot-1 to R4
  2. Extract provided zip (the root of the zip is the root of the "SD card")
  3. Run akmenu4.nds, enjoy crashing in less than 10 seconds

dma16_example.zip

@lifehackerhansol
Copy link
Contributor Author

I've also attached a different version of akmenu4.nds using u32 DMA control access. Previous files in the initial zip is required on the SD still.
akmenu4.zip

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

No branches or pull requests

1 participant