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

Document address wrapping behaviour of MBC2 RAM, and note questionable source of $52-$54 ROM size tags #106

Merged
merged 2 commits into from
Mar 7, 2021

Conversation

TheThief
Copy link
Contributor

@TheThief TheThief commented Jan 26, 2021

Also note that 2KB RAM size tag is erroneously used by a lot of "PD" ROMs (no cart was ever made with this size).

@aaaaaa123456789
Copy link
Member

ROM and RAM are acronyms and they should be spelled that way, not "rom" or "ram".

@TheThief
Copy link
Contributor Author

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...

@avivace
Copy link
Member

avivace commented Jan 29, 2021

Given #108 , this looks good to me. @ISSOtm can you mark the conversations you opened as resolved if you're okay with the clarifications?

@TheThief
Copy link
Contributor Author

When you merge it back, might want to flatten it... I added a couple more commits fixing formatting etc.

@TheThief TheThief changed the title Update The_Cartridge_Header.md Document address wrapping behaviour of MBC2 RAM, and note questionable source of $52-$54 ROM size tags Jan 29, 2021
@avivace
Copy link
Member

avivace commented Jan 29, 2021

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

@ISSOtm
Copy link
Member

ISSOtm commented Jan 30, 2021

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.
Copy link
Member

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?

Copy link
Contributor Author

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

Copy link
Member

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).

@ISSOtm
Copy link
Member

ISSOtm commented Feb 10, 2021

Ping @TheThief

@TheThief
Copy link
Contributor Author

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.

@ISSOtm
Copy link
Member

ISSOtm commented Feb 22, 2021

#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).
@TheThief
Copy link
Contributor Author

@ISSOtm would you re-review?

@avivace avivace requested review from ISSOtm and avivace February 23, 2021 20:30
Copy link
Member

@ISSOtm ISSOtm left a 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.

@TheThief
Copy link
Contributor Author

TheThief commented Feb 25, 2021

Just the last unresolved request to go, otherwise LGTM.

This request?

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).

I actually added this text already: "The upper 4 bits of each byte are undefined and should not be
relied upon.":

As the data consists of 4bit values, only the lower 4 bits of the "bytes" in this memory area are used. The upper 4 bits of each byte are undefined and should not be relied upon.

@ISSOtm
Copy link
Member

ISSOtm commented Feb 28, 2021

The unresolved item talks about copying that notice to the wrapping behavior of the MBC2's SRAM.

@TheThief
Copy link
Contributor Author

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.

@avivace avivace requested a review from ISSOtm March 2, 2021 10:17
@avivace
Copy link
Member

avivace commented Mar 7, 2021

Looks good to me, thanks @TheThief for working through this! 🥳

@avivace avivace merged commit be5f7f5 into gbdev:develop Mar 7, 2021
@TheThief TheThief deleted the patch-1 branch June 25, 2021 14:45
@GPHemsley GPHemsley mentioned this pull request Jul 1, 2024
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

Successfully merging this pull request may close these issues.

6 participants