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 - SMS I/O mirrors

Reply to topic
Author Message
Leonard Silva de Oliveira
  • Guest
Reply with quote
SMS I/O mirrors
Post Posted: Mon Aug 28, 2000 3:55 am
Tonight I were looking at the SMS schematics and I figured out how the SMS I/O mirrors behave.

The dedicated chips inside the V1.0 poverbase are : 315-5216 (I/O, SLOT selects) and 315-5124 (VDP, PSG and Z80
memory mapping.) Both 5216 and 5124 only decodes A7, A6 and A0 plus /IORQ during a Z80 I/O access. This means that
only 8 individual I/O ports are possible inside these chips. Here goes a ASCII art explanation :

AAAAAAAA
76543210 ----------Minor address number possible
XX X || -----Actual known address
|| ||
|| ||
|| ||
00xxxxx0 00 (3E) SLOT Control
00xxxxx1 01 (3F)
01xxxxx0 40 (7E)
01xxxxx1 41 (7F)
10xxxxx0 80 (BD) VDP Control port
10xxxxx1 81 (BE) VDP Data port
11xxxxx0 C0 (DE) Input 0 (joyport 0)
11xxxxx1 C1 (DF) Input 1 (Joyport 1, light pen, etc)

The bits from A1 to A5 are IGNORATED, then it means I can write data to PSG in a real SMS
thuru port 7Fh as well thuru port 41h. I hope you guys understand what I mean ... ( And I tested it with a copy of
the hangon game I mofified for this test.)

Cya ...
 
  • Site Admin
  • Joined: 25 Oct 1999
  • Posts: 2029
  • Location: Monterey, California
Reply with quote
Good job, Private!
Post Posted: Mon Aug 28, 2000 8:38 pm
Quote
> Tonight I were looking at the SMS schematics and I figured out how the SMS I/O mirrors behave.

> The dedicated chips inside the V1.0 poverbase are : 315-5216 (I/O, SLOT selects) and 315-5124 (VDP, PSG and Z80
> memory mapping.) Both 5216 and 5124 only decodes A7, A6 and A0 plus /IORQ during a Z80 I/O access. This means that
> only 8 individual I/O ports are possible inside these chips. Here goes a ASCII art explanation :

> AAAAAAAA
> 76543210 ----------Minor address number possible
> XX X || -----Actual known address
> || ||
> || ||
> || ||
> 00xxxxx0 00 (3E) SLOT Control
> 00xxxxx1 01 (3F)
> 01xxxxx0 40 (7E)
> 01xxxxx1 41 (7F)
> 10xxxxx0 80 (BD) VDP Control port
> 10xxxxx1 81 (BE) VDP Data port
> 11xxxxx0 C0 (DE) Input 0 (joyport 0)
> 11xxxxx1 C1 (DF) Input 1 (Joyport 1, light pen, etc)

> The bits from A1 to A5 are IGNORATED, then it means I can write data to PSG in a real SMS
> thuru port 7Fh as well thuru port 41h. I hope you guys understand what I mean ... ( And I tested it with a copy of
> the hangon game I mofified for this test.)


Finally a rational explaination for port mirroring, and now we know how an emulator should handle 'undefined' ports (of course they've all just been 'defined' in one way or another, for the SMS at least, each port having 32 mirrors if my logic is correct).

Does this mean a1-a5 are completely unconnected to the 315-5124?

It occurs to me that the game gear would not mirror the same way, since port 6 is the game gear stereo toggle. Pins a1 and a2 would have to be connected to differenciate between it and port $0 (==$3e).

Some very interesting findings, thank you for sharing your work with us. And welcome to s8-dev.



PS are you testing with eproms? If so, are you using the ZWS burner design or do you have something else?
  View user's profile Send private message Visit poster's website
Leonard Silva de Oliveira
  • Guest
Reply with quote
Re: Good job, Private!
Post Posted: Tue Aug 29, 2000 2:23 am
Quote
> Finally a rational explaination for port mirroring, and now we know how an emulator should handle 'undefined' ports (of course they've all just been 'defined' in one way or another, for the SMS at least, each port having 32 mirrors if my logic is correct).

> Does this mean a1-a5 are completely unconnected to the 315-5124?

Yes. These lines are not connected to both 315-5124 and 315-5216.

Quote
> It occurs to me that the game gear would not mirror the same way, since port 6 is the game gear stereo toggle. Pins a1 and a2 would have to be connected to differenciate between it and port $0 (==$3e).

It's possible. The GG hardware adds new ports to the system. To ensure it, I have to get the GG schematics or at least a GG machine
for doing some reverse engineering. (The older models, which are compatible with the TV tunner does have a generic
Z80 CPU, in SMD sdip package, making it possible to analyse it.)

Quote
> Some very interesting findings, thank you for sharing your work with us. And welcome to s8-dev.

Thanks.

Quote
> PS are you testing with eproms? If so, are you using the ZWS burner design or do you have something else?

Yes. Actually I'm using eproms and flash memories. I have a INTRONICS pocket programmer. It's a bad old programmer,
but it does it's job ... =)
 
Reply to topic



Back to the top of this page

Back to SMS Power!