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

add devtools options to break on data errors with GDB connected + flag to access full 8mb main memory in DS mode #2200

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

joshua-smith-12
Copy link

I found these useful when I was debugging issues with a ROM which uses more than 4mb memory under specific optimization levels (at higher optimization levels it fits fine, but with optimizations disabled it needs more than 4mb total).

  • the GDB BreakOnError flag can help to track down errors related to memory access/allocation
  • the Debug.ExtendedMemory flag allows access to the full 8mb main memory range, instead of mirroring the lower 4mb to the upper 4mb

no retail DS provides access to the upper 4mb, but per gbatek there were hardware debugger machines which can use the full 8mb. this PR does not implement everything covered by the debugger machine, only allows access to more memory for debugging purposes. this does mean that the behaviour of the emulator with the 8mb flag enabled is a bit far from retail.

@@ -469,6 +469,8 @@ class NDS
virtual void ARM7IOWrite16(u32 addr, u16 val);
virtual void ARM7IOWrite32(u32 addr, u32 val);

void SetMemoryExtension(bool enabled);
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this flag be extended to also work on TWL/DSi? Its debug units have 32MB of RAM as opposed to 16MB of RAM; it's available at 0xC000000 ~ 0xDFFFFFF.

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