TASEmulators / BizHawk

BizHawk is a multi-system emulator written in C#. BizHawk provides nice features for casual gamers such as full screen, and joypad support in addition to full rerecording and debugging tools for all system cores.
http://tasvideos.org/BizHawk.html
Other
2.14k stars 380 forks source link

Integrate GPGX SSF Mapper header from upstream #1968

Closed Sappharad closed 4 years ago

Sappharad commented 4 years ago

Summary

BizHawk is missing the upstream GPGX changes to support the "SEGA SSF" mapper allowing bankswitching on Megadrive / Genesis games other than Super Street Fighter 2. The code you're using now just has a hard-coded check for Street Fighter 2, but in 2014 there was a commit allowing other games to use it.

https://github.com/ekeeke/Genesis-Plus-GX/commit/200f9a73499cff619677f109c6fd9c19e5d494fc

I fixed this with a slightly modified version of that commit, because for some reason I couldn't get the code to build as-is with that change due to other missing commits from upstream. gpgx_crappy.patch.zip (Patch inside of a zip, because Github's issue tracker doesn't let you upload .patch files)

Repro

Grab the Sonic Delta 40mb romhack to use for testing: https://www.neto-games.com.br/rom_hack/sonic_delta_40_mb.php

Output

Game is unplayable without the mapper, will display this exception on startup in version v0.38:

image

Older versions of the hack will go to title screen and save select, but starting a new game will crash.

Result

Should see this when starting a new game. Without the mapper the game will crash when you start a new game.

image
Sappharad commented 4 years ago

Tagging @nattthebear since you said you might be building a new version this weekend.

(Screenshots above were from my local copies, before & after fixing)

Note that I don't expect SRAM to work, despite the linked hack using it. That problem was discussed in a previous issue for a different romhack here: https://github.com/TASVideos/BizHawk/issues/695

nattthebear commented 4 years ago

Branch is ready for testing a743984

Sappharad commented 4 years ago

@nattthebear Any chance you could try to integrate parts of this patch? gpgx.patch.zip

It's the 'correct' fix for this issue and resolves the problems with later versions of the romhack in the opening post.

It's not exactly cleanly tracked, I cherry picked files from the current (as of 3 months ago) codebase and manually 'fixed' them to build against the version of GPGX that I had in 1.x branch.

nattthebear commented 4 years ago

@nattthebear Any chance you could try to integrate parts of this patch?

No.

nattthebear commented 4 years ago

I was busy last night and didn't have much time to chat about it, but the gist is this: we made a decision a long time ago to hack up the GPGX core all over the place, and that decision is done and past. We now have a core that does a lot of things well, including having some features that upstream does not, but has difficulty integrating upstream changes. I'm not against that changing, but the core would need a real champion maintainer within the BizHawk team to do that, and I have other things to work on.

Sappharad commented 4 years ago

we made a decision a long time ago to hack up the GPGX core all over the place, and that decision is done and past. We now have a core that does a lot of things well, including having some features that upstream does not, but has difficulty integrating upstream changes. My intention with the patch (which I committed to the mono-portable 1.x branch yesterday if you want an easier method of looking at the changes) was not to blow away any of the custom BizHawk stuff. It's not clear to me if I did or not, since the core still runs. Nor do I know how much it changed for 2.x to realize yet if that makes things harder.

I'm not suggesting that we try and integrate the full latest upstream either. There's stuff in there, like an entirely new supported console variant that I did not include at all. I wanted to make sure I had the SSF mapper stuff and the associated changes so SRAM worked correctly. I was having problems with my initial attempt which is why I ended up pulling entire files worth of changes then restoring the BizHawk additions that were obvious.

I will make a PR some time this week with just the SSF changes - if they work. If I have trouble, I may want to do the same thing I did for 1.x, which was basically grabbing the entire current md_cart.c then any changed files it had new dependencies on, then cleaning up the differences.