-
Notifications
You must be signed in to change notification settings - Fork 228
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
GB/GBC: Unified flashing for MBC3/MBC5 and added option to automatically flash ROM and SAVE #183
Conversation
…allow for more flexibility
(cherry picked from commit 9cf556d)
…tection, adding compatibility for many repro flash carts.
The last few commits changed how GB flashing works quite a bit. Since I now have a flashcart that behaves quite similar to the way described in the discussion (#182 (comment)) I could reproduce and fix flashing MBC5. At least for me it works, so please check if it does for you (@sanni) as well. This change also drops the device ID-based detection that was there before, in favour of using CFI (Common Flash Interface) to detect the flash chip's features. This is not perfect, since some flash chips don't quite follow the CFI standard perfectly. Also some flash carts don't wire the data pins straight to the cartridge connector, but instead switch them around. My code knows one special case of that (two LSB switched) and counters that. But it cannot detect all possible combinations. In total, this should add compatibility to a lot of different flashcarts. I coded this for one type of flashcart and verified it on two different other kinds of flashcart, and all of them worked. Also, using the new detection, I added a check if the flashcart is actually large enough to fit the ROM that should be uploaded onto it. @sanni: Please let me know if this works or if there is further work needed. |
Very nice! How do we test these commits? I have a cart I've had trouble
with in the past and would like to try it out for myself.
…On Wed, Jul 21, 2021, 5:12 PM Dakkaron ***@***.***> wrote:
The last few commits changed how GB flashing works quite a bit. Since I
now have a flashcart that behaves quite similar to the way described in the
discussion (#182 (comment)
<#182 (comment)>)
I could reproduce and fix flashing MBC5. At least for me it works, so
please check if it does for you ***@***.*** <https://github.com/sanni>) as
well.
This change also drops the device ID-based detection that was there
before, in favour of using CFI (Common Flash Interface) to detect the flash
chip's features. This is not perfect, since some flash chips don't quite
follow the CFI standard perfectly. Also some flash carts don't wire the
data pins straight to the cartridge connector, but instead switch them
around. My code knows one special case of that (two LSB switched) and
counters that. But it cannot detect all possible combinations.
In total, this should add compatibility to a lot of different flashcarts.
I coded this for one type of flashcart and verified it on two different
other kinds of flashcart, and all of them worked.
Also, using the new detection, I added a check if the flashcart is
actually large enough to fit the ROM that should be uploaded onto it.
@sanni <https://github.com/sanni>: Please let me know if this works or if
there is further work needed.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#183 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACZKM4ILNJ2V4HVPE4FRYFLTY4Z5HANCNFSM47WPI5TQ>
.
|
I get "CFI Query failed" on both my MBC3 with AMD 29F016 and MBC5 with Fuji 29F033 flashchip. I think I'll just add a new "Flash repro" menu and put the old and the new CFI way as a selection there. |
@Androxilogin Are you on the newest code version? This error message should currently not be in the code, afaik. @sanni Adding both paths is a good idea. |
I wasn't using the latest code version, I used the previous one before the
fix. Then I tried the latest and got the same error.
…On Thu, Jul 22, 2021, 9:57 AM Dakkaron ***@***.***> wrote:
@Androxilogin <https://github.com/Androxilogin> Are you on the newest
code version? This error message should currently not be in the code, afaik.
@sanni <https://github.com/sanni> Adding both paths is a good idea.
Regarding the CFI Query Failed: from what I can find, your flash chip
doesn't support CFI... All my repro carts support it, so I figured it might
be a bit more universal than identifying the chip by the Flash ID.
What about this: if CFI fails, fetch the Flash ID and operate from a
whitelist like before. That way, you'd automatically have support for all
CFI compatible flash chips, and for all others support can easily be added
manually, by putting it into the whitelist.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#183 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACZKM4PBYWTK6ISGMESKYGTTZAPVDANCNFSM47WPI5TQ>
.
|
GB/GBC: Unified flashing for MBC3/MBC5 and added option to automatically flash ROM and SAVE
Now MBC3 and MBC5 should be handled the same way.
Also there is now an option to automatically flash the latest save corresponding to the flashed ROM.
This only works if there is a save file under
/GB/SAVE/[FILENAME]/*/[FILENAME].SAV
, where[FILENAME]
is the file name of the chosen ROM minus anything after the dot (.
).So the user should backup the ROM from a cartridge or flashcart before using this option.
My use case for this is that I only have a single flashcart, but many different ROMs that I want to play on it. So I can quickly swap between different ROMs and don't have to manually select the save file. It is especially useful if you already have lots of save files from the same game and would have to page down a lot to find the newest save game.