Skip to content

Commit 3543419

Browse files
Add a page on the M161 mapper (#419)
Co-authored-by: Eldred Habert <[email protected]>
1 parent c18bb36 commit 3543419

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

src/M161.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# M161
2+
3+
The M161 is a simple multi-cart mapper by Mani (Nintendo's official Chinese distributor).
4+
This mapper only allows for 8 separate 32 KiB banks, with a limit of 1 bankswitch, preventing any bankswitches afterward.
5+
This gives 1 bank for the main menu, and a maximum of 7 different 32 KiB games.
6+
This mapper does not support SRAM, so only purely MBC-less titles can be used.
7+
8+
This mapper is only known to be used in a single cartridge: Mani's 4 in 1 cartridge, which contains Tetris, Tennis, Alleyway, and Yakuman.
9+
All later Mani 4 in 1 cartridges use [the MMM01 mapper](<#MMM01>), so the M161 mapper could be considered the predecessor to the MMM01.
10+
11+
The mapper is really just a simple off-the-shelf 74HC161A used a flip-flop.
12+
The 74HC161A contains 4 input pins and 4 output pins, and another pin for latching the input pins to the output pins.
13+
The first 3 of the input pins are connected to the lower 3 bits of incoming write data, with the 4th pin kept high.
14+
The first 3 of the output pins are connected to the ROM addressing pins (RA15-RA17).
15+
The 4th output pin (which corresponds to the always high input pin) is connected to the latching pin.
16+
Bit 15 of the write address is also connected to (OR'd with) the latching pin.
17+
The latching pin latches the input pins to the output pins on a transition from high to low, so when a ROM write comes through (bit 15 = 0), the input pins will be latched to the output pins.
18+
Since 4th output pin will be high, the signal cannot become low anymore, thus preventing further bankswitches.
19+
20+
## Memory
21+
22+
### 0000-7FFF - ROM Bank $00-$07 (Read Only)
23+
24+
This area contains a 32 KiB bank of ROM.
25+
On startup, this will contain the first 32 KiB of ROM (bank 0).
26+
27+
## Registers
28+
29+
### 0000-7FFF - ROM Bank Number (Write Only)
30+
31+
This 3-bit register (range $00-$07) selects the ROM bank number for the $0000-$7FFF region.
32+
Like other mappers, the high bits are discarded.
33+
34+
Only 1 bankswitch is allowed per session, once any write to this register occurs (even if set to 0), all future writes will be ignored until the mapper is powered down.
35+
36+
## Operation Notes
37+
38+
Because the full 32 KiB range is switched over, caution should be taken, as the entire ROM range will change.
39+
It may be best to have the bankswitch code placed right before $0100, so as to fall through to [the game's init sequence](<#0100-0103 - Entry Point>).
40+
41+
### References
42+
43+
- Source: [M161 Schematic](https://pics.tauwasser.eu/image/schematic-dmg-m161-m01-v10.pdDz) on tauwasser pics

src/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
- [MBC6](./MBC6.md)
6767
- [MBC7](./MBC7.md)
6868
- [MMM01](./MMM01.md)
69+
- [M161](./M161.md)
6970
- [HuC1](./HuC1.md)
7071
- [Other MBCs](./othermbc.md)
7172

0 commit comments

Comments
 (0)