You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add description for out of bounds MBC ram access (#594)
* Add description for out of bounds MBC ram access
This is based on:
- Source code of the SameBoy emulator
- Dissassembling Pokemon Pinball which depends on this behavior
- Mbc1 schematics - https://www.devrs.com/gb/files/mbc1.gif
* Change mbc ram access formula
* Rephrased explanation to be oriented to the CPU memory bus (instead the MBC)
* Fix internal address formula
* Update src/MBCs.md
Co-authored-by: Eldred Habert <me@eldred.fr>
* Update src/MBCs.md
---------
Co-authored-by: Antonio Vivace <avivace4@gmail.com>
Co-authored-by: Eldred Habert <me@eldred.fr>
Copy file name to clipboardExpand all lines: src/MBCs.md
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -20,3 +20,10 @@ so, it might be nevertheless possible to use Double Speed during periods
20
20
which use only code and data which is located in internal RAM. Despite the
21
21
above, a self-made MBC1-EPROM card appears to work stable and fine even in
22
22
Double Speed Mode.
23
+
24
+
## MBC Unmapped RAM Bank Access
25
+
26
+
In most MBCs, if an unmapped RAM bank is selected (which would be translate to an out of bounds RAM address by the MBC controller),
27
+
the MBC will simply wrap around the internal ram address and would access a valid RAM address.
28
+
29
+
The MBC internal address being accessed can be calculated using this formula: `((address - external_ram_start_address) + (active_ram_bank * ram_bank_size)) % max_external_ram_size`.
0 commit comments