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

GB: MBC30 or MBC3 with 4MB support #652

Closed
roytam1 opened this issue Apr 22, 2020 · 9 comments · Fixed by #654
Closed

GB: MBC30 or MBC3 with 4MB support #652

roytam1 opened this issue Apr 22, 2020 · 9 comments · Fixed by #654
Assignees

Comments

@roytam1
Copy link

roytam1 commented Apr 22, 2020

Please fill out this form:

Expected behavior

All blocks should have a tick.

Actual behavior

blocks starting from block 7F get a F(ail) mark.
image

Steps to reproduce the behavior

-Load ROM
-Start emulation

Crash bugs

it doesn't crash emulator.

ROM details

Which games are affected by the issue (please state if GBA or GB game):
https://github.com/EricKirschenmann/MBC3-Tester-gb

Which games, if any, are NOT affected by the issue (please state if GBA or GB game):

Include screenshots of ROM Information (File > ROM Information):
image

If you are using a BIOS file, please say which one.
Not using BIOS ROM.

Option details

Video driver (simple, opengl):
simple

Sound driver (directsound, xaudio, openal, SDL):
SDL

Build details

Operating System (Windows, Mac, Linux (state distribution), etc.):
Win7 SP1 x64

If using Linux, specify if using xorg or Wayland:
Nil.

Version of code (pre-built binary version, or commit ref, or just "master"):
2.1.4-eecde424

cross-reference:
mgba-emu/mgba#1713

@rkitover rkitover changed the title MBC30 or MBC3 with 4MB support GB: MBC30 or MBC3 with 4MB support Apr 22, 2020
@roytam1
Copy link
Author

roytam1 commented Apr 23, 2020

for hackfixing this issue, changing from 0x7f to 0xff will make mbctest.gb pass the test.
https://github.com/visualboyadvance-m/visualboyadvance-m/blob/master/src/gb/gbMemory.cpp#L365

@rkitover
Copy link
Collaborator

@roytam1 According to this informal spec I found:

https://gist.github.com/drhelius/3745961

MBC3 rom bank select actually is supposed to accept values up to 0x7f, if you are sure that this is wrong then we should fix it, but please give me a technical explanation, I am actually clueless about the hardware emulation and we need to be very careful about things like this and document everything properly.

@roytam1
Copy link
Author

roytam1 commented Apr 23, 2020

MBC3 rom bank select actually is supposed to accept values up to 0x7f

because it is actually MBC30, but with MBC3 in ROM type byte.

but please give me a technical explanation

https://gekkio.fi/files/gb-docs/gbctr.pdf (search MBC30)

@rkitover
Copy link
Collaborator

@roytam1 as I admitted, I'm clueless about these things, thank you for the info.

What in your opinion is the best way to distinguish this MBC30 variant, would rom size be sufficient?

@roytam1
Copy link
Author

roytam1 commented Apr 23, 2020

would rom size be sufficient?

yeah it should work.

@FredrIQ
Copy link

FredrIQ commented Apr 23, 2020

MBC30 cartridges should be possible to distinguish by the rom and sram sizes, yes. E.g. Japanese Crystal uses a MBC30, but (as per above) identifies as a MBC3 with added SRAM, since MBC30 don't have their own MBC identifier but uses the same as MBC3.

@rkitover
Copy link
Collaborator

Any hints where I can find the right crystal rom, the one I tried was a 2M rom size, please email me at rkitover@gmail.com.

@rkitover rkitover self-assigned this Apr 24, 2020
@rkitover rkitover added the bug label Apr 24, 2020
rkitover added a commit that referenced this issue Apr 24, 2020
MBC30 is a variant of MBC3 with a 4MiB ROM size and a larger RAM size.

https://gekkio.fi/files/gb-docs/gbctr.pdf

Allow addressing 4MiB of the ROM in MBC3 ROM bank select if the ROM size
is 4MiB.

Fix provided by roytam1.

- Fix #652.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
@roytam1
Copy link
Author

roytam1 commented Apr 24, 2020

Any hints where I can find the right crystal rom, the one I tried was a 2M rom size, please email me at rkitover@gmail.com.

retail cart of Pokemon Crystal JP is 2MB in size, and there are custom projects make use of MBC30 with 4MB ROM with success.

@roytam1
Copy link
Author

roytam1 commented Apr 24, 2020

and by the way, there is also a project make use of normal MBC3 and 4MB ROM. https://shop.insidegadgets.com/product/gameboy-4mb-32kb-fram-mbc3-with-rtc-flash-cart/

rkitover added a commit that referenced this issue Apr 24, 2020
MBC30 is a variant of MBC3 with a 4MiB ROM size and a larger RAM size.

https://gekkio.fi/files/gb-docs/gbctr.pdf

Allow addressing 4MiB of the ROM in MBC3 ROM bank select if the ROM size
is 4MiB.

Fix provided by roytam1.

- Fix #652.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
rkitover added a commit that referenced this issue Apr 27, 2020
MBC30 is a variant of MBC3 with a 4MiB ROM size and a larger RAM size.

https://gekkio.fi/files/gb-docs/gbctr.pdf

Allow addressing 4MiB of the ROM in MBC3 ROM bank select if the ROM size
is 4MiB.

Fix provided by roytam1.

- Fix #652.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants