tentei abrir jogos code master usando esta logica mas muitos bugs pixel faltando nos jogos .
algo errado na logica ? mapper sega code master SMS.
mapper no work in altera
https://www.smspower.org/Development/Mappers=========================================================================
ROM mapping
This mapper presents three 16KB slots to the address bus as before. However, the control registers are mapped to the first byte of each bank and the first 1KB is no longer protected.
Control register Slot
$0000 0 ($0000-$3fff)
$4000 1 ($4000-$7fff)
$8000 2 ($8000-$bfff)
The mapper is initialised with banks 0, 1 and 0 in slots 0, 1 and 2 respectively.
When using slot 0, care must be taken to replace interrupt vectors appropriately. Also note that there is no RAM mirroring of mapper writes so there is no way to retrieve the last value written.
Most games seem to only use slot 2.
Due to the similarities with the Sega mapper, it is generally possible to patch Codemasters software to work with a Sega mapper.
RAM mapping
One Codemasters game, Ernie Els Golf, features 8KB of on-cart RAM. If the byte written to $4000 has the high bit set ($80) then the upper 8KB of slot 2 (from $a000 to $c000) is mapped to this on-cart RAM, while the lower 8KB will remain mapped to ROM as if the high bit were unset.