-
-
Notifications
You must be signed in to change notification settings - Fork 103
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
Document address wrapping behaviour of MBC2 RAM, and note questionable source of $52-$54 ROM size tags #106
Conversation
ROM and RAM are acronyms and they should be spelled that way, not "rom" or "ram". |
Too true! I'm normally a stickler for that... |
When you merge it back, might want to flatten it... I added a couple more commits fixing formatting etc. |
Don't worry, we're gonna rebase/squash in any case |
Gonna re-review from scratch |
content/MBC2.md
Outdated
@@ -18,13 +18,18 @@ battery to save data during power-off though. As the data consists of | |||
4bit values, only the lower 4 bits of the "bytes" in this memory area | |||
are used. | |||
|
|||
### A200-BFFF - 15 "echoes" of A000-A1FF | |||
Only the bottom 9 bits of the address are used to index into the internal | |||
RAM, so RAM access repeats. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per #66, are there sources for this claim?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes - the mooneye docs for one:
https://gekkio.fi/files/gb-docs/gbctr.pdf
https://github.com/Gekkio/mooneye-gb/blob/master/tests/emulator-only/mbc2/ram.s
I also found a pin diagram of the MBC2 chip - it only has address pins for the bottom 9 bits and the top 2 - the top two are used to select between ROM 0/1 areas and the cart ram, the bottom 9 index the ram. Addresses with bits 10+ set are simply invisible to the chip as it doesn't have pins for them: https://fms.komkon.org/GameBoy/Tech/Cart2.gif
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, though I would also copy the note that the upper 4 bits of reads are undefined and should not be relied upon. That's a fairly important thing to know (if for some reason one were to use MBC2).
Ping @TheThief |
I'm waiting for the final version of the other PR to be merged before I make changes to this one relating to 2k ram etc. |
#108 has just been merged. |
…e source of $52-$54 ROM size tags Also note that 2KB RAM size tag is erroneously used by a lot of "PD" ROMs (no cart was ever made with this size).
@ISSOtm would you re-review? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just the last unresolved request to go, otherwise LGTM.
This request?
I actually added this text already: "The upper 4 bits of each byte are undefined and should not be
|
The unresolved item talks about copying that notice to the wrapping behavior of the MBC2's SRAM. |
Ah I get you now. I thought I'd only added the first notice after you made the comment, but yes it makes sense to copy it into the echo section. |
Looks good to me, thanks @TheThief for working through this! 🥳 |
Also note that 2KB RAM size tag is erroneously used by a lot of "PD" ROMs (no cart was ever made with this size).