Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - DIY Codemasters mapper

Reply to topic
Author Message
  • Joined: 28 Sep 1999
  • Posts: 1197
Reply with quote
DIY Codemasters mapper
Post Posted: Wed Nov 15, 2006 12:07 am
Just as an experiment, I wanted to try and duplicate a subset of the Codemasters mapper logic in a GAL22V10 to see if it could be done - knowing Codemasters used a PAL of some variety in their cartridges meant it should be suitable. Here's the CUPL source code for my design:

http://cgfm2.emuviews.com/zip/sms-map.zip

256K of ROM is supported (16 banks) with banking in $8000-$BFFF and the bank number assigned by writing anywhere within that range. $0000-$7FFF is fixed.

For my test setup I had a bunch of wires going from a socketed MB831001-based cartridge to a breadboard that had 512K flash (only half used) and the 22V10. I set things up so the 22V10 has the exact same inputs and connection to ROM the MB831001 would have.

Fantastic Dizzy worked fine, as did the checksum screen (hold 1+2 while powering up). For some reason I'd get random bad data when reading it with my cartridge dumper, but given the length of the wires I'm surprised it worked at all.

Using a PLD with more macrocells, you could easily support 512K or larger ROMs, and add more banking registers - this sort of maxed out the 22V10 resources. A small CPLD might be perfect, I think something like that was used for the mapper chip in later Majesco GG re-releases. Hopefully this might make a good starting point for people who want to design their own mappers.
  View user's profile Send private message Visit poster's website
  • Joined: 01 Jan 2005
  • Posts: 360
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Wed Nov 15, 2006 4:50 am
I have a GG pirate cart which uses two PALs for mapping, probably for the above reasons.
  View user's profile Send private message Visit poster's website
  • Joined: 28 Sep 1999
  • Posts: 1197
Reply with quote
Post Posted: Wed Nov 15, 2006 5:22 pm
idrougge wrote
I have a GG pirate cart which uses two PALs for mapping, probably for the above reasons.


Very interesting, I don't suppose you have any pictures of the PCB? I'm curious to see which PALs it used.

Though often pirate carts have the part numbers scratched off of the chips.
  View user's profile Send private message Visit poster's website
  • Joined: 01 Jan 2005
  • Posts: 360
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Sun Nov 19, 2006 9:46 am

I believe PALs can be fused so that they cannot be copied, I wonder if the pirates have done so with this one.
Super8in1GG.jpeg (174.89 KB)
[Admin: attached a copy of the image]
Super8in1GG.jpeg

  View user's profile Send private message Visit poster's website
  • Joined: 28 Sep 1999
  • Posts: 1197
Reply with quote
Post Posted: Sun Nov 19, 2006 6:25 pm
idrougge wrote
I believe PALs can be fused so that they cannot be copied, I wonder if the pirates have done so with this one.


Thanks for the nice scan! Is the pushbutton for breaking into the game menu, or does it work like a pause function? (looks like the games are mostly SG-1000/SMS titles)

PALs can be dumped in a roundabout way, you can feed every possible value to the inputs and save the outputs, then figure out the product terms used for each output pin by examining the results. In most situations this works well.
  View user's profile Send private message Visit poster's website
  • Joined: 20 Sep 2007
  • Posts: 5
  • Location: USA, California
Reply with quote
Post Posted: Fri Sep 21, 2007 5:47 am
I know a simple mapper can be made using a Pal or Gal. However, I own neither of these chips but really want to make a Sega mapper. I'm willing to do so with the Nand gates, R-S flip-flops, ect. that I have.

I would try to figure it out myself, using the documents I've seen on how they work, and post for all to see, but unfortenetly, I don't understand memory addressing and data accessing on address locations, and timing.

So, does anyone know how to make a mapper using gates or whichever logic chips, other than Pals? Schematics and it made to access 512KBs of memory or more, would be great. :)

And I'm curious, can a Ni****do Gameboy MBC (Memory Bank Controller) from inside a game cart, be used as a Sega mapper?
  View user's profile Send private message
  • Joined: 28 Sep 1999
  • Posts: 1197
Reply with quote
Post Posted: Fri Sep 21, 2007 9:58 pm
Aristotle wrote
I know a simple mapper can be made using a Pal or Gal. However, I own neither of these chips but really want to make a Sega mapper. I'm willing to do so with the Nand gates, R-S flip-flops, ect. that I have.


I've attached a schematic for a mapper circuit that supports 256K of ROM in $8000-$BFFF, with $0000-$7FFF fixed to the first 32K of ROM. You can set a 4-bit bank value by writing to any offset within $8000-$BFFF. The bank value is reset to zero after power-up.

It uses a 74HC02, 74HC157, 74HC174 which are simple and cheap TTL parts. The Z80 reset pin doesn't have to be hooked up, you could pull the /RES input on the 74HC174 up to +5V to disable it.

More than 256K can be supported by adding a wider latch, another multiplexer and larger EPROM. As shown only 4 of the six bits of the '175 are used, the remaining ones (if connected to the data bus) could be used for flashing LEDs or whatever else. I went for the simplest possible arrangement. Also three of the four NOR gates are unused, so they could be used for something too.

Untested, but it's essentially the same thing my GAL22V10 implementation did and that did work.

Quote
And I'm curious, can a Ni****do Gameboy MBC (Memory Bank Controller) from inside a game cart, be used as a Sega mapper?


Going by the pinouts I don't see why not, but I think it's geared for the GameBoy memory map and I'm not sure how that would fit in the the SMS; in particular the MBC shouldn't respond to access within $C000-$FFFF. Both being Z80 (sort of) based, I can't imagine any significant incompatibility between the CPUs which would prevent the MBC from working.
smsmap.png (4.46 KB)
256K mapper schematic
smsmap.png

  View user's profile Send private message Visit poster's website
  • Joined: 20 Sep 2007
  • Posts: 5
  • Location: USA, California
Reply with quote
Post Posted: Sat Sep 22, 2007 8:36 pm
I just realized I posted in the topic for building a Codemaster's mapper. What I had in mind was the standered Sega mapper that works with the majority of games. But thank you. Is there a way to change it some to work like the Sega mapper?

Quote
Going by the pinouts I don't see why not, but I think it's geared for the GameBoy memory map and I'm not sure how that would fit in the the SMS; in particular the MBC shouldn't respond to access within $C000-$FFFF. Both being Z80 (sort of) based, I can't imagine any significant incompatibility between the CPUs which would prevent the MBC from working.


I can glue the chip onto the PCB inside the cart and completely re-wire it to the correct pins, I've done so before with a few different devices. I say this, because I have a Ni****do cart I'm willing to give up, if it could work for a dev cart for my Sega unit, since I never play it. Just wanted to know if it could work as a Sega mapper or even Codemaster's mapper, and if so, how to wire it to work.
  View user's profile Send private message
  • Joined: 24 Sep 2006
  • Posts: 191
  • Location: Sydney, Australia
Reply with quote
Post Posted: Sun Sep 23, 2007 1:47 am
Aristotle,

I've recreated a SEGA/Codemasters paging IC in a CPLD + 74LS30. See the thread here: http://www.smspower.org/forums/viewtopic.php?t=9821.

Quote
I can glue the chip onto the PCB inside the cart and completely re-wire it to the correct pins, I've done so before with a few different devices. I say this, because I have a Ni****do cart I'm willing to give up, if it could work for a dev cart for my Sega unit, since I never play it. Just wanted to know if it could work as a Sega mapper or even Codemaster's mapper, and if so, how to wire it to work.


A Ni****do mapper will only work with software desined to work with it. I doubt it's directly compatible with the standard Sega paging scheme.

If you just want to build a dev cart then why not use a standard Sega paging IC found in many commercial SMS games? Building a 512k paging circuit from 74 series logic is going to require a lot of parts...
  View user's profile Send private message
  • Joined: 20 Sep 2007
  • Posts: 5
  • Location: USA, California
Reply with quote
Post Posted: Sun Sep 23, 2007 2:22 am
viletim wrote
Aristotle,

I've recreated a SEGA/Codemasters paging IC in a CPLD + 74LS30. See the thread here: http://www.smspower.org/forums/viewtopic.php?t=9821.

Quote
I can glue the chip onto the PCB inside the cart and completely re-wire it to the correct pins, I've done so before with a few different devices. I say this, because I have a Ni****do cart I'm willing to give up, if it could work for a dev cart for my Sega unit, since I never play it. Just wanted to know if it could work as a Sega mapper or even Codemaster's mapper, and if so, how to wire it to work.


A Ni****do mapper will only work with software desined to work with it. I doubt it's directly compatible with the standard Sega paging scheme.

If you just want to build a dev cart then why not use a standard Sega paging IC found in many commercial SMS games? Building a 512k paging circuit from 74 series logic is going to require a lot of parts...


I can't do that because I don't own any SMS carts. I only own two GG carts, which is why I want to make a dev cart. I know that unless I use surface mount chips, it won't fit into the cart..I also don't have another Game Gear that I could use, to get the edge connector from. So I plan to build the SMS Reader and put it inside the Game Gear, and most likely the flash chips with a custom built Sega Mapper.

I discovered I have a few pals and two gals from a 486 board, however I've seen how complicated a programmer would be to build to program these chips. So, I can't do that.

I've been looking up the Ni****do MBC1 chips, which I have since I own NBA Jam for Gameboy. I also found documents on how to build a simple one, without SRAM support. The only thing is, your right, it wouldn't be compatible, since the addressing and registers are different to access it. (?) http://www.work.de/nocash/pandocs.htm#mbc1max2mbyteromandor32kbyteram

Unless I can build a Sega mapper or use this MBC1 mapper, I'll be limited to only 32KBs for games and programs. I don't see much worth in doing all this if that is so..

However, I know it's possible to disassemble the games and change the way it addresses the mapper, for it to like work with the Codemaster's mapper.

Edit: I just realized the 2 counter chips i have, are 4 bit counters..And I only have 3 surface mount Nand gates..Overall, I can't build the SMS Reader or the MBC..I do have over 5 flash chips and many EPROMs though. :P

I greatly thank everyone for helping me with this.
  View user's profile Send private message
Reply to topic



Back to the top of this page

Back to SMS Power!