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

Incorrect emulation of SLOT-2 GPIO #2264

Open
edo9300 opened this issue Jan 21, 2025 · 0 comments · May be fixed by #2266
Open

Incorrect emulation of SLOT-2 GPIO #2264

edo9300 opened this issue Jan 21, 2025 · 0 comments · May be fixed by #2266

Comments

@edo9300
Copy link

edo9300 commented Jan 21, 2025

Currently melon handles the SLOT-2 GPIO by returning 0 whenever the 3 mapped addresses are attempted to be read if GPIO is disabled,

melonDS/src/GBACart.cpp

Lines 234 to 247 in 15c3faa

if (addr >= 0xC4 && addr < 0xCA)
{
if (GPIO.control & 0x1)
{
switch (addr)
{
case 0xC4: return GPIO.data;
case 0xC6: return GPIO.direction;
case 0xC8: return GPIO.control;
}
}
else
return 0;
}

This doesn't match hardware where reads to those addresses correctly return the value stored in the card's rom if the specific card doesn't have the addresses matched to a gpio interface (for example a generic flashable cart or a supercard flashed with a custom firmware running in ds mode).
It should be investigated if the behaviour is entirely on the game pack itself or there's something else being done by the ds itself

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