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
Copy file name to clipboardExpand all lines: src/othermbc.md
+62-57Lines changed: 62 additions & 57 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,29 +9,27 @@ four games is switched in. In theory, a MBC1M board could be made for 1
9
9
Mbit or 512 kbit games by additionally not connecting A17 and A16
10
10
outputs, but this appears not to have been done in licensed games.
11
11
12
-
**MMM01** is a more complex that allows for games of different sizes.
13
-
[Docs on Tauwasser.eu](https://wiki.tauwasser.eu/view/MMM01)
14
-
15
12
**Bung** and **EMS** MBCs are reported to exist.
16
13
17
14
### EMS
18
15
19
-
PinoBatch learned the game selection protocol for EMS flash carts from
20
-
beware, who in turn learned it from nitro2k01. Take this with a grain of
21
-
salt, as it hasn't been verified on the authentic EMS hardware.
16
+
::: warning To be verified
17
+
18
+
Take the following with a grain of salt, as it hasn't been verified on authentic EMS hardware.
19
+
20
+
:::
22
21
23
-
A [header](<#The Cartridge Header>) matching any of the
24
-
following is detected as EMS mapper:
22
+
A [header](<#The Cartridge Header>) matching any of the following is detected as EMS mapper:
25
23
26
-
-Header name is "EMSMENU", NUL-padded
27
-
-Header name is "GB16M", NUL-padded
28
-
-Cartridge type ($0147) = $1B and region ($014A) = $E1
24
+
- Header name is "EMSMENU", NUL-padded
25
+
- Header name is "GB16M", NUL-padded
26
+
- Cartridge type ($0147) = $1B and region ($014A) = $E1
29
27
30
28
Registers:
31
29
32
-
$2000 write: Normal behavior, plus save written value in $2000 latch
33
-
$1000 write: $A5 enables configure mode, $98 disables, and other values have no known effect
34
-
$7000 write while configure mode is on: Copy $2000 latch to OR mask
30
+
-$2000 write: Normal behavior, plus save written value in $2000 latch
31
+
-$1000 write: $A5 enables configure mode, $98 disables it, and other values have no known effect
32
+
-$7000 write while configure mode is on: Copy $2000 latch to OR mask
35
33
36
34
After the OR mask has been set, all reads from ROM will OR A21-A14 (the
37
35
bank number) with the OR mask. This chooses which game is visible to the
@@ -40,70 +38,77 @@ nonsensical.
40
38
41
39
The mapper does not support an outer bank for battery SRAM.
42
40
43
-
To start a game, do the following in code run from RAM: Write $A5 to
44
-
$1000, write game starting bank number to $2000, write any value to
45
-
$7000, write $98 to $1000, write $01 to $2000 (so that 32K games
46
-
work), jump to $0100.
41
+
To start a game, perform the following steps with code running from RAM:
42
+
43
+
1. Write $A5 to $1000
44
+
2. Write game's first bank number to $2000
45
+
3. Write any value to $7000
46
+
4. Write $98 to $1000
47
+
5. Write $01 to $2000 (so that 32K games work)
48
+
6. Jump to $0100
47
49
48
50
## Wisdom Tree
49
51
50
-
The Wisdom Tree mapper is a simple, cost-optimized onechip design
51
-
consisting of a 74LS377 octal latch, aside from the ROM chip. Because
52
+
The Wisdom Tree mapper is a simple, cost-optimized one-chip design
53
+
consisting of a 74LS377 octal latch in addition to the ROM chip. Because
52
54
the mapper consists of a single standard 74 series logic chip, it has
53
55
two unusual properties:
54
56
55
-
First, unlike a usual MBC, it switches the whole 32 kiB ROM area instead
56
-
of just the $4000-$7FFF area. If you want to use the interrupt vectors
57
+
First, unlike a usual MBC, it switches the whole 32 KiB ROM area instead
58
+
of just the $4000-$7FFF area. Therefore, if you want to use [the interrupt vectors](<#Interrupt Handling>)
57
59
with this cart, you should duplicate them across all banks.
58
-
Additionally, since the initial state of the '377 can't be guaranteed,
60
+
Additionally, since the 74LS377's contents can't be guaranteed when powering on,
59
61
the ROM header and some code for switching to a known bank should also
60
62
be included in every bank. This also means that the Wisdom Tree mapper
61
-
could be used as a multicart mapper for 32 kiB ROMs, assuming there was
63
+
could be used as a multicart mapper for 32 KiB ROMs, assuming there is
62
64
enough ROM space in each bank for some small initialization code, and
63
65
none of the ROMs wrote to the $0000-$7FFF area. For example, if the
64
66
last 5 bytes of all banks are unused, games can be patched as follows:
65
67
66
-
; At $0100 in all banks but the first
67
-
nop
68
-
jp $7FFB
69
-
70
-
; At $7FFB in all banks
71
-
ld hl, $0100
72
-
ld [hl], a
73
-
jp hl
74
-
75
-
Second, because the '377 latches data on the *positive* edge, and the
76
-
value on the Game Boy data bus is no longer valid when the positive edge
77
-
of the write pulse arrives, the designer of this mapper chose to use the
68
+
```rgbasm
69
+
; At $0100 in all banks but the first
70
+
nop
71
+
jp $7FFB
72
+
```
73
+
```rgbasm
74
+
; At $7FFB in all banks
75
+
ld hl, $0100
76
+
ld [hl], a
77
+
jp hl
78
+
```
79
+
80
+
Second, because the 74LS377 latches data on the [*positive* write pulse edge](https://www.allaboutcircuits.com/textbook/digital/chpt-10/edge-triggered-latches-flip-flops/),
81
+
and the value on the Game Boy data bus is no longer valid when the
82
+
positive edge arrives, the designer of this mapper chose to use the
78
83
A7-A0 address lines for selecting a bank instead of the data lines.
79
84
Thus, the value you write is ignored, and the lower 8 bits of the
80
85
address is used. For example, to select bank $XX, you would write any
81
86
value to address $YYXX, where $YY is in the range $00-$7F.
82
87
83
-
An emulator can detect a ROM designed for Wisdom Tree mapper in one of
84
-
two ways:
85
88
86
-
- ROM contains "WISDOM TREE" or "WISDOM\\x00TREE" (the space can
87
-
be $20 or $00), $0147 = $00, $0148 = $00, size \> 32k. This
88
-
method works for the games released by Wisdom Tree, Inc.
89
-
- $0147 = $C0, $014A = $D1. These are the values recommended by
90
-
beware for 3rd party developers to indicate that the ROM is
91
-
targeting Wisdom Tree mapper hardware. (See below.)
92
89
93
90
## Magic values for detection of multicarts in emulators
94
91
92
+
::: info proposal
93
+
94
+
The following information should not be considered a universally adopted
95
+
standard, but it's instead just a proposed solution. Actual adoption may vary.
96
+
97
+
:::
98
+
95
99
Sometimes it may be useful to allow a ROM to be detected as a multicart
96
100
in emulator, for example for development of a menu for physical
97
-
multicart hardware. These are values suggested by beware, and supported
98
-
in BGB, for signaling that your ROM is supposed to interface a multicart
99
-
mapper. Emulator authors who are interested in supporting multicart
100
-
mappers are encouraged to support detection of these values in addition
101
-
to the values described in each section, which are heuristics based on
102
-
ROMs in the wild, which may not always be suitable for newly produced
103
-
software. The values are deliberately chosen to be high entropy
104
-
("random") such that the risk of an accidental false positive is
105
-
unlikely.
106
-
107
-
- $0147 = $c0, $014a = $d1 -\> Detect as Wisdom Tree
0 commit comments