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

Do something about the 4MiB limit #17

Open
Clownacy opened this issue Jun 12, 2024 · 4 comments
Open

Do something about the 4MiB limit #17

Clownacy opened this issue Jun 12, 2024 · 4 comments

Comments

@Clownacy
Copy link
Owner

Vladikcomper and at least one other ROM-hacker have bumped into the issue of loading >4MIB ROMS - they fail to load properly due to exceeding the size of the cartridge mapping space. Attempts to read beyond this space instead cause data to be read from the Mega CD mapping space.

The most immediate thing to do is present the user with an error message, letting them know that their ROM is too big. Additionally, I should double-check what actually happens on a real console, because I swear that I once heard that large cartridges actually override the Mega CD mapping space, rather than the other way around.

@Brainulator9
Copy link

Would it not be an option to perhaps disable the Mega CD as needed?

Funnily enough, Sonic VR, which also is 6 MB, works fine in general, but the music reads from the wrong places. I'm worried about how Super Street Fighter II: The New Challengers or Sonic Delta respond, though...

@devon-artmeier
Copy link
Contributor

devon-artmeier commented Aug 5, 2024

A possible solution if you want to avoid hardcoding ROM identifiers is to maybe start off with just the first 4 MiB mapped to memory, and then track the behavior in which the ROM access is handled. You can detect bankswitching via writes to 0xA130F3-0xA130FF, and just simply swap out parts of the ROM appropriately. As for linear ROMs, the best solution is actually to disable the MCD, because that's the solution on hardware as well, and then check if ROM addresses above 0x3FFFFF are accessed while the MCD is disabled (the MCD (and 32X) WILL conflict), and if there exists ROM data on that address, expand the memory mapping of the ROM accordingly.

More info:
Going beyond 4MB (with the Sega Mapper)
Advanced Address Decoding

@devon-artmeier
Copy link
Contributor

devon-artmeier commented Aug 5, 2024

Actually, on second thought with the linear ROM thing, for simplicity, you can add an option to disable the MCD, and throw an error message depending on the circumstances (i.e. > 4 MiB if MCD enabled, > 10 MiB if MCD disabled), and then just have it all loaded into the memory mapping as a whole. It'd be more accurate to real hardware that way :P

And of course, if you, for some reason, decide to add 32X support, you'd have to account for that, too.

@ProximalElk6186
Copy link

It appears that the Mega-CD only starts working and doing smtn after the Sega Genesis initialises it, before that, it's inactive, so on a real hardware it shouldn't be a problem. Just disable the Mega-CD until it's initialised.

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

4 participants