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 - How to make an SMS cartridge?

Reply to topic
Author Message
  • Joined: 07 Nov 2018
  • Posts: 11
  • Location: Brazil
Reply with quote
How to make an SMS cartridge?
Post Posted: Wed Nov 07, 2018 8:08 pm
Ok, this is not exactly a development question, but I doubt that any of my good smspower friends will get offended by that. I didn't really find a better place to post anyway.
Master System cartridges are waay too simple. It's a tiny lil eprom and some pins. And I am pwetty sure that I can make a board full of traces and pins and flash an eprom.
So, is it possible to just go ahead and make a cartridge? I'm obviously not talking about the cases, I'm talking about the boards. And if it is possible, can you nice guys please link some documentation and stuff? Thanks!
  View user's profile Send private message Visit poster's website
  • Joined: 07 Aug 2007
  • Posts: 204
  • Location: Yach, Germany
Reply with quote
Post Posted: Wed Nov 07, 2018 8:19 pm
Yes. I made PCBs and cases:

http://www.smspower.org/forums/15915-CartridgeCaseIdea

Philipp
  View user's profile Send private message Visit poster's website
  • Joined: 08 Sep 2018
  • Posts: 114
Reply with quote
Post Posted: Thu Nov 08, 2018 4:12 am
Unless you're making a 32k cart it's not at all easy. I currently have an active topic up about developing larger carts that require a mapper chip.
  View user's profile Send private message
  • Joined: 07 Nov 2018
  • Posts: 11
  • Location: Brazil
Reply with quote
Post Posted: Thu Nov 08, 2018 6:15 pm
IllusionOfMana wrote
Unless you're making a 32k cart it's not at all easy. I currently have an active topic up about developing larger carts that require a mapper chip.


Ok! I guess I give up! :) haha thought it was gonna be easy
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 2400
Reply with quote
Post Posted: Fri Nov 09, 2018 8:30 am
actually you can make a 48 KB cartridge using a single (64 KB) ROM chip, no mapper required...
  View user's profile Send private message Visit poster's website
  • Joined: 07 Aug 2007
  • Posts: 204
  • Location: Yach, Germany
Reply with quote
Post Posted: Tue Nov 13, 2018 9:03 pm
The one I made is 48K. PCB designed with gEDA, cartridge case designed with wings3s.

Philipp

P.S.: The only annoying aspect about 48K is a bit of lack of tool support for the header in the middle of the ROM. Why didn't Sega just place the header at the beginning, like Coleco did?
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 2400
Reply with quote
Post Posted: Wed Nov 14, 2018 9:10 am
it's not in the middle of the ROM, it's at the very end of the second bank ;)
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 12768
  • Location: London
Reply with quote
Post Posted: Wed Nov 14, 2018 9:29 am
And they probably put it there because they already had games in existence with the code at offset (although it's easy enough to think of ways to avoid that being a problem, e.g. make the first few bytes be a jump past the header). It also meant they could add headers to existing code.
  View user's profile Send private message Visit poster's website
  • Joined: 29 Mar 2012
  • Posts: 465
  • Location: Spain
Reply with quote
Post Posted: Wed Nov 14, 2018 10:58 am
sverx wrote
actually you can make a 48 KB cartridge using a single (64 KB) ROM chip, no mapper required...


But that was not possible to do homebrew carts of more than 32kb when using a PCB without discrete mapper. Why? because of missing adress lines?
  View user's profile Send private message
  • Joined: 04 Jul 2010
  • Posts: 230
  • Location: Angers, France
Reply with quote
Post Posted: Wed Nov 14, 2018 11:20 am
You can access / use the 3 slots without any mapper (3 x 16ko)
  View user's profile Send private message
  • Joined: 29 Mar 2012
  • Posts: 465
  • Location: Spain
Reply with quote
Post Posted: Wed Nov 14, 2018 11:23 am
Yes, I know that from the homebrew perspective (software). But I remember reading here since...I don't know, maybe 2008, that reusing a game PCB to put an EPROM there was only suitable for 32kb games.
  View user's profile Send private message
  • Joined: 04 Jul 2010
  • Posts: 230
  • Location: Angers, France
Reply with quote
Post Posted: Wed Nov 14, 2018 11:31 am
Maybe just due to the pcb / chip pinout ?
As 32ko eprom are just drop in replacement (no redirections needed)
But in fact you can use a 64k eprom with a little modifications (only the 1st 48ko will be readable)
  View user's profile Send private message
  • Joined: 29 Mar 2012
  • Posts: 465
  • Location: Spain
Reply with quote
Post Posted: Wed Nov 14, 2018 11:44 am
Ok! I was supposing something like that, maybe because this single chips pcb's usually have the mapper integrated, so maybe some lines are used for the mapper or something..
  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 2400
Reply with quote
Post Posted: Wed Nov 14, 2018 12:04 pm
I believe there aren't 48 KB commercial games - but that's totally doable without any mapper, as the CPU maps addresses from $0000 to $BFFF to the cart ROM bus.
  View user's profile Send private message Visit poster's website
  • Joined: 08 Sep 2018
  • Posts: 114
Reply with quote
Post Posted: Wed Nov 14, 2018 2:58 pm
The physical pinout of the cart slot allows for up to 64k workout a mapper, it has the full 8 data and 16 address lines. However like sverx said the last slot of memory is addressed to Ram and it's mirror, this leaves 48k available for the cartridge.
  View user's profile Send private message
  • Joined: 22 Apr 2018
  • Posts: 108
Reply with quote
Post Posted: Thu Nov 15, 2018 3:30 pm
Are you aiming for a USB-reflashable homebrew/development cartridge? Or would this be somehow reflashable through the cartridge slot, e.g. by a Retrode2 or a RAM-hosted flasher running on the SMS and communicating with the SMS via 2nd controller port cable? If so, I'm interested — right now I'm not aware of any easy way to get homebrew running in the SG-1000 (EverDrives don't work there even with the adapter)
  View user's profile Send private message
  • Joined: 08 Sep 2018
  • Posts: 114
Reply with quote
Post Posted: Thu Nov 15, 2018 3:50 pm
Quote
right now I'm not aware of any easy way to get homebrew running in the SG-1000 (EverDrives don't work there even with the adapter)


How big are SG-1000 games usually? Maybe I could design a board up real quick in Eagle? Idk how to setup a menu system like everdrive has but I know a bit about single game carts.[/quote]
  View user's profile Send private message
  • Joined: 22 Apr 2018
  • Posts: 108
Reply with quote
Post Posted: Thu Nov 15, 2018 4:13 pm
I hope actual experts will follow up here, but here's my possibly-flawed belief:

I believe some SG-1000 cartridge games — especially from Taiwan and Korea — may incorporate non-Sega mappers and/or RAM (sometimes as a plug-through expander separate from the game) and grow rather large (especially the MSX ports), but the vast majority of official Japanese releases use no mapper, RAM, or other custom in-cartridge hardware and so are 48k or less.

SG-1000 card releases are all 32k or less because they lack one address line and have no custom in-card hardware.

Portrait of Loretta / Loretta no Shouzou had some kind of mapper and was larger. The Castle had additional RAM in the cartridge (but in the 32k-48k region and without a mapper IIRC.) The drawing board had custom I/O in the cartridge somehow. I'm not aware of other oversize or unusual Japanese releases but that doesn't mean there aren't any.
  View user's profile Send private message
  • Joined: 08 Sep 2018
  • Posts: 114
Reply with quote
Post Posted: Thu Nov 15, 2018 5:03 pm
Well it's pretty common to see different mappers for anything with the z80 architecture. As far as additional ram goes, unless it fits within the addressable space of the z80 it will need a mapper. I'm sure there are several simple games for the SG-1000 that could afford maybe 8k or 16k of external ram without a mapper. Even if it's not attached to the cart, if external rom or ram exceeds the 64k address space it needs an memory mapper. I don't know for sure if the SG-1000 has a ram or even port swap feature built in so I'm assuming it's similar to how the SMS handles addressing.
Obviously any cart that uses custom sound, I/O control (other than mmc), FPU, or DSP features now days would have to be FPGA emulated. If these all are common features on SG-1000 carts then naturally an everdrive won't work. Another thing to think about is the control bus, perhaps the everdrive expects a line to be pulled high or low in order to operate correctly. A line that's available through the SMS cart slot but not the SG-1000s. Or in another case a line that is needed for the everdrive to operate but isn't connected within your adapter.
  View user's profile Send private message
  • Joined: 22 Apr 2018
  • Posts: 108
Reply with quote
Post Posted: Thu Nov 15, 2018 5:22 pm
The last one at least is ruled out — the very same adapter + EverDrive work perfectly in a Mark III and in an MK-2000 (JP-SMS).

I wouldn't be surprised if the EverDrive just needs more RAM — the SG-1000 and even the more-RAM-than-SG-1000 SC-3000 have less RAM than the Mark III, SMS, etc.
  View user's profile Send private message
  • Joined: 08 Sep 2018
  • Posts: 114
Reply with quote
Post Posted: Thu Nov 15, 2018 6:04 pm
Yeah, I think you're right. I forgot the SG-1000 only has 1k of ram, I don't see that being enough to handle the boot software for the everdrive.
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 12768
  • Location: London
Reply with quote
Post Posted: Thu Nov 15, 2018 6:12 pm
The menu itself probably needs hardly any RAM at all but it may be loading in 4KB chunks from the SD card which obviously won't fit. Presumably one could debug into it with Emulicious.
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 2400
Reply with quote
Post Posted: Fri Nov 16, 2018 8:50 am
I believe the point is that the Master EverDrive was never meant to be used on a SG-1000, thus it probably doesn't save on memory.

As for the original topic, I'm in no way expert but I think one could build a custom mapper for a 64 KB ROM game using just one latch and a few logic gates, so to map the last 16 KB bank onto the $8000-$bfff (slot 2) address space. Bankswitch could be done by writing to any 0b1xxxxxxx ROM address and taking the single needed bit from the data bus...
  View user's profile Send private message Visit poster's website
  • Joined: 22 Apr 2018
  • Posts: 108
Reply with quote
Post Posted: Fri Nov 16, 2018 12:20 pm
Nice! Might want a single AND (and maybe also a NOT?) too so that most RAM writes (e.g. using the stack) won't have remapping side effects
  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 2400
Reply with quote
Post Posted: Fri Nov 16, 2018 12:27 pm
oh right, I should have written
"Bankswitch could be done by writing to any 0b10xxxxxx [...]"

edit: to save you could instead bankswitch by writing to any 0b0xxxxxxx, as that's surely a ROM address...
  View user's profile Send private message Visit poster's website
  • Joined: 22 Apr 2018
  • Posts: 108
Reply with quote
Post Posted: Fri Nov 16, 2018 10:13 pm
sverx wrote
oh right, I should have written
"Bankswitch could be done by writing to any 0b10xxxxxx [...]"

edit: to save you could instead bankswitch by writing to any 0b0xxxxxxx, as that's surely a ROM address...


The first of those looks like it supports a useful, compatible subset of the Codemasters mapper, provided the software only uses slot 2 (control register $8000) and only writes 0 or 1 to the register; if you instead write to $a000 it's a compatible subset of the so-called "Korean" mapper
  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 2400
Reply with quote
Post Posted: Mon Nov 19, 2018 9:22 am
well, I didn't mean to make any existing mapper, but if it can be done so with just minor changes - why not? ;)
  View user's profile Send private message Visit poster's website
  • Joined: 07 Nov 2018
  • Posts: 11
  • Location: Brazil
Reply with quote
Post Posted: Tue Nov 20, 2018 6:07 pm
bsittler wrote
If so, I'm interested


Well yeah I am
  View user's profile Send private message Visit poster's website
  • Joined: 22 Apr 2018
  • Posts: 108
Reply with quote
Post Posted: Tue Nov 20, 2018 8:54 pm
Great! Happy to be a tester/early customer whenever you're ready, PM if/when interested; I have done a little electronics tinkering (e.g. built a Mark III cartridge-on-export SMS adapter) and asm (e.g. SG2GG palette patches), and would love to have a way to get new homebrew on old SC-3000, SG-1000, etc. in cartridge form
  View user's profile Send private message
Reply to topic



Back to the top of this page

Back to SMS Power!