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 - Definitive guide to address decoding logic?

Reply to topic
Author Message
  • Joined: 06 Mar 2022
  • Posts: 594
  • Location: London, UK
Reply with quote
Definitive guide to address decoding logic?
Post Posted: Fri Apr 07, 2023 12:03 pm
I've been struck a few times in different forum posts that there doesn't appear to be a single place where all the known equations of address decoding logic of the SMS are conveniently summarised in one place, so often there is a little confusion, discussion or time taken trawling forum posts to remind ourselves.

Unless anyone can point to an existing wiki article or very prominent documentation file, I would propose that I create an article at some point as a handy reference point.
  View user's profile Send private message Visit poster's website
  • Joined: 24 Mar 2023
  • Posts: 15
Reply with quote
Post Posted: Fri Apr 07, 2023 12:30 pm
I posted this in dogarasu's thread but it wasn't of much use to him, but

https://www.smspower.org/forums/9821-CPLDPagingICMapper

Don't the schematic captures in this thread show the pure logic you're after? Assuming it's accurate.
  View user's profile Send private message
  • Joined: 06 Mar 2022
  • Posts: 594
  • Location: London, UK
Reply with quote
Post Posted: Fri Apr 07, 2023 12:54 pm
I don't think so... this appears to be designs for a mapper, but I'm really talking about the signals coming out of the SMS to the cart slot - something mapper designers should be interested in having to hand.

It should be a really simple set of equations, something like (DISCLAIMER - PROVISIONAL, MIGHT HAVE MISTAKES):


Address logic:

#MC-F = #MREQ + !A15 + !A14
#M0-7 = #MREQ + A15
#M8-B = #MREQ + !A15 + A14
#CE = #MREQ + PORT$3E[6]

+ possibly a little bit of extra stuff about when base system RAM is enabled wrt address lines and port3e

---

IO logic:

#KBSEL = #IOREQ + !A7 + !A6

+ a little bit of extra stuff about how KILLGA & cont works would be useful


There's potentially some variation for GG / MKIII, etc. to summarise too although I think it's just about missing signals vs. non-jp SMS.
  View user's profile Send private message Visit poster's website
  • Joined: 24 Mar 2023
  • Posts: 15
Reply with quote
Post Posted: Fri Apr 07, 2023 2:43 pm
Ah I see what you mean, yes.

As an aside, what is # for? I keep trying to read it as NOT, but that's what ! is.
  View user's profile Send private message
  • Joined: 04 Jul 2010
  • Posts: 539
  • Location: Angers, France
Reply with quote
Post Posted: Fri Apr 07, 2023 2:59 pm
MossDragoon wrote
Ah I see what you mean, yes.

As an aside, what is # for? I keep trying to read it as NOT, but that's what ! is.


# or / or ! Is for Logic active low
  View user's profile Send private message
  • Joined: 06 Mar 2022
  • Posts: 594
  • Location: London, UK
Reply with quote
Post Posted: Fri Apr 07, 2023 3:06 pm
MossDragoon wrote
As an aside, what is # for? I keep trying to read it as NOT, but that's what ! is.

Well, it's kind of like NOT - it's actually one of a number of conventions for indicating signals which are active-low, others being e.g.

~MREQ
or
/MREQ

Meaning that the memory request signal is "active" when 0, not when it's 1.

In hand-written / print notation it's common to write active low signals with a line (bar) over the top, but obviously plain ASCII doesn't support that.

Personally I am used to using tilde ~ rather than hash # but I do think hash # is a little more readable which is why I used it above.

An exclamation mark usually does mean an actual NOT operation, so for example !#MREQ would signify the result of feeding the active low #MREQ signal through an invertor - i.e. it would be 1 when memory is being requested and 0 when it isn't. Since inverting an active-low signal is logically equivalent to the same signal but active-high, you might be tempted to simplify that into simply MREQ but that could be misleading as the original signal is still active low. For the same reason it's not so common to write active-low signals as e.g. !MREQ as the "bar" is really part of the signal name, not an operator, and if it's confused with a NOT operator then it is easy to accidentally cancel them out and get tangled up. That said, you do sometimes see people use ! to indicate active-low signals.

Hope that helps!

EDIT: @ichigo sorry just spotted your reply - I shouldn't take so long to write mine ;)
  View user's profile Send private message Visit poster's website
  • Joined: 24 Mar 2023
  • Posts: 15
Reply with quote
Post Posted: Fri Apr 07, 2023 3:57 pm
Thank you both! That clarifies a lot of things for me.
  View user's profile Send private message
  • Joined: 14 Aug 2000
  • Posts: 740
  • Location: Adelaide, Australia
Reply with quote
Post Posted: Sat Apr 08, 2023 6:15 am
@willbritton you are correct for /CE, /EXM1 and /EXM2.

I think /CSRAM at the cart connector includes port 3E but I'm not certain because it's been a while since I've checked.

CONT on the cart connector is just an input that's read in Port DD.

All the info is in forum posts, as well as old documents that have been deprecated by Admin.
  View user's profile Send private message
  • Joined: 06 Mar 2022
  • Posts: 594
  • Location: London, UK
Reply with quote
Post Posted: Sat Apr 08, 2023 8:28 am
Cool, thanks @async! I think that somewhat proves my point that a pithy summary article in Development might be useful.

I'll start putting one together and will scour the forum for all sources I can find that confirm the logic. I think I'll also reference those sources as footnotes when I compile the article.

asynchronous wrote
...as well as old documents that have been deprecated by Admin.

Assume that means some docs that are no longer accessible? If you happen to know of any docs which are accessible and cover the subject, do let me know so I can reference those too.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14685
  • Location: London
Reply with quote
Post Posted: Sun Apr 09, 2023 1:13 am
The wiki categorises older text file documents as less preferable to wiki pages that can have richer formatting and can be updated. However it’s also the case that the wiki pages don’t cover everything in the docs. We don’t have active wiki editors tweaking things continuously.
  View user's profile Send private message Visit poster's website
  • Joined: 06 Mar 2022
  • Posts: 594
  • Location: London, UK
Reply with quote
Post Posted: Sun Apr 09, 2023 10:43 am
Initial draft here:
https://www.smspower.org/Development/BusSignals

I have made it relatively comprehensive, the idea being to explain the effect that each custom signal present at the SMS cartridge port has on the system.

Some of it feels like a little bit of a stretch, particularly where it presupposes how the console internals actually work, but I feel like it serves its intended purpose of providing a good working guide to cart slot tinkerers in this format.

I still need to go through and:

* Double check all the logic with references on this site
* Add links and sources
* General tidy up
* Link it to some existing category - I think maybe Memory System makes most sense.

All comments much appreciated!

EDIT: I also realised while putting this together that I know next to nothing about the MKIII / SG-1000 / SC-3000 / Japanese / Korean SMS cartridge slot and it seems very different from the rest of world slot. I wonder if this article should either be restricted just to rest of world SMS or perhaps needs some attention from someone who is more of an expert in those systems.
  View user's profile Send private message Visit poster's website
  • Joined: 24 Mar 2023
  • Posts: 15
Reply with quote
Post Posted: Sun Apr 09, 2023 2:45 pm
I feel like you wrote that for me. Totally idiot proof! :D
  View user's profile Send private message
Reply to topic



Back to the top of this page

Back to SMS Power!