SNES reverse engineering through schematics

Strictly for discussing ZSNES development and for submitting code. You can also join us on IRC at irc.libera.chat in #zsnes.
Please, no requests here.

Moderator: ZSNES Mods

Post Reply
Vigo
New Member
Posts: 6
Joined: Mon Jul 21, 2008 11:14 pm

SNES reverse engineering through schematics

Post by Vigo »

Continuing from this thread:

http://board.zsnes.com/phpBB2/viewtopic.php?t=11230

The schematics reveal some interesting facts, which could be used to find out how the SNES works in detail.

Both PPU's and the CPU are communicating via an 18bit data bus with each other. Why 18bit, and not 16? Since there is no address bus labeled between PPU and the CPU, and the CPU HAS to have access to the register locations of both PPU's, the 18bit Data bus is probably a mistake, and more likely data AND address lines.

Quite unusual is the fact that PPU1 has 2 address buses going to each 32k SRAM, they probably did this so that in Mode 7, you could fetch 2 8bit pixels from seperate locations in 1 clock cycle . It also seems that PPU1 does all the adressing, while PPU2 can only access the data from the SRAMS and outputs all sync and colour signals. My guess is that PPU2 holds all the colour registers and at least 2 line buffers for the main and sub screen and does all colour calculations. It probably also contains the window logic. They most probably used line buffers, because it faciliates the following features:

- main / sub screen colour arithmetic
- mosaic effect (just update every nth pixel / line in the buffer).
- sprite display (a line buffer for everything is less complex than having 34 shift registers for each sprite, you just need 1 shift register and write sprite data into the line buffer at the right x address)

Both PPU's and the CPU have access to the 21Mhz master clock, but PPU2 also has 2 seperate signals (X & Y) going to the CPU, which is probably switching the CPU speed (4 states could be decoded).

Now the most mysterious question is: why has PPU2 a 24bit Data bus??? If you look at the schematics, you see that the left SRAM data bits are connected to 2 pins each on PPU2! What did Nintendo have in mind doing this? Does the SNES Chipset provide more features that were actually being used due to cost reductions? I wouldn't wonder if a lot of ground/vcc pins being shown actually have a function.
creaothceann
Seen it all
Posts: 2302
Joined: Mon Jan 03, 2005 5:04 pm
Location: Germany
Contact:

Re: SNES reverse engineering through schematics

Post by creaothceann »

Vigo wrote:I wouldn't wonder if a lot of ground/vcc pins being shown actually have a function.
From anomie's register doc:

Code: Select all

2133  wb+++- SETINI - Screen Mode/Video Select
        se--poIi

        s    = "External Sync". Used for superimposing "sfx" graphics, whatever
            that means. Usually 0. Not much is known about this bit.
            Interestingly, the SPPU1 chip has a pin named "EXTSYNC" (or
            not-EXTSYNC, since it has a bar over it) which is tied to Vcc.
vSNES | Delphi 10 BPLs
bsnes launcher with recent files list
Vigo
New Member
Posts: 6
Joined: Mon Jul 21, 2008 11:14 pm

Re: SNES reverse engineering through schematics

Post by Vigo »

creaothceann wrote:
Vigo wrote:I wouldn't wonder if a lot of ground/vcc pins being shown actually have a function.
From anomie's register doc:

Code: Select all

2133  wb+++- SETINI - Screen Mode/Video Select
        se--poIi

        s    = "External Sync". Used for superimposing "sfx" graphics, whatever
            that means. Usually 0. Not much is known about this bit.
            Interestingly, the SPPU1 chip has a pin named "EXTSYNC" (or
            not-EXTSYNC, since it has a bar over it) which is tied to Vcc.
Would be cool to know from what schematics this information came from.
neviksti
Lurker
Posts: 122
Joined: Thu Jul 29, 2004 6:15 am

Re: SNES reverse engineering through schematics

Post by neviksti »

Vigo wrote:Both PPU's and the CPU are communicating via an 18bit data bus with each other. Why 18bit, and not 16?
Those are from schematics I bought (they were sold for repair purposes). They are not official nintendo schematics. I was not expecting them to be, but was very disappointed with the quality of both the print (the bleeding together of many numbers and such is real, and not a scan artifact) and the labelling (they labelled everything they didn't know as D*, basically just saying it is a data or digital line).

It was still helpful to see how everything was connected though. I learned a lot from it at the time.
Vigo wrote:Would be cool to know from what schematics this information came from.
There are much better schematics (official, or at least very good) ones being passed around now. Maybe they even ended up at romhacking.net by now.

If not, I can email them to you.
EDIT: I take that back. I can't find the files on my current computers. This means its on my old computer, in which case I won't be able to get those files any time soon. Sorry. Hopefully you can find them, or someone else here can share them.
creaothceann
Seen it all
Posts: 2302
Joined: Mon Jan 03, 2005 5:04 pm
Location: Germany
Contact:

Post by creaothceann »

I got some, but forgot from where...

page1.gif
page2.gif
page3.gif
page4.gif
page5.gif


EDIT: Probably from here.
vSNES | Delphi 10 BPLs
bsnes launcher with recent files list
whicker
Trooper
Posts: 479
Joined: Sat Nov 27, 2004 4:33 am

Post by whicker »

creaothceann wrote:I got some, but forgot from where...

page1.gif
page2.gif
page3.gif
page4.gif
page5.gif


EDIT: Probably from here.
Again, the old crappy ones with the "18-bit" data bus.
which isn't true.
badinsults
"Your thread will be crushed."
Posts: 1236
Joined: Wed Jul 28, 2004 1:49 am
Location: Not in Winnipeg
Contact:

Post by badinsults »

creaothceann wrote:I got some, but forgot from where...

page1.gif
page2.gif
page3.gif
page4.gif
page5.gif


EDIT: Probably from here.
I scanned those years ago. If anyone needs them to be rescanned for some reason, I can dig up document next week.
neviksti
Lurker
Posts: 122
Joined: Thu Jul 29, 2004 6:15 am

Post by neviksti »

I thought those were from my scans. Oh well. I guess we both bought the same thing. Regardless though, we don't need more copies of the MCM schematics.

I know other people have the good schematics. Anomie or Overload for sure.

If someone doesn't show up soon that can share, maybe I'll take time to get access to my old computer later. I really thought others here had it though.
bobthebuilder
Hazed
Posts: 76
Joined: Sat Jan 28, 2006 7:21 am

Post by bobthebuilder »

Plz do I am curious to see these "good" schematics :P
Lord Nightmare
Rookie
Posts: 14
Joined: Fri Nov 26, 2004 7:50 pm
Location: PA, USA
Contact:

Post by Lord Nightmare »

Yeah, I'd like to see the 'good' schematics too.

LN
"When life gives you zombies... *CHA-CHIK* ...you make zombie-ade!"
neviksti
Lurker
Posts: 122
Joined: Thu Jul 29, 2004 6:15 am

Post by neviksti »

I found someone who had them again, and put them here:
http://www.neviksti.com/wiki/Schematics

They seem editted a bit from what I remember, but these are definitely the same ones I had on my old computer. In particular, it is hard to read many of the labels.

If someone could clean these up, that would be great!
I tried rotating and stretching the images to get them all lined up, thinking I would then go over them redrawing and relabelling everything until I got a pristine copy ... but it didn't line up nicely (as you can see, there are little fold and curls even in the single images). Does anyone have good schematic software? Maybe it would be easier to just re-enter it.
d4s
Rookie
Posts: 28
Joined: Wed Sep 08, 2004 12:05 pm

Post by d4s »

neviksti wrote:I found someone who had them again, and put them here:
http://www.neviksti.com/wiki/Schematics

They seem editted a bit from what I remember, but these are definitely the same ones I had on my old computer. In particular, it is hard to read many of the labels.

If someone could clean these up, that would be great!
I tried rotating and stretching the images to get them all lined up, thinking I would then go over them redrawing and relabelling everything until I got a pristine copy ... but it didn't line up nicely (as you can see, there are little fold and curls even in the single images). Does anyone have good schematic software? Maybe it would be easier to just re-enter it.
Wow, thanks for sharing!
I just had a quick look and the first thing that caught my eye was the HVCMODE pin. I'm _SO_ curious if it's actually possible to switch the SNES PPUs to a fully NES/Famicom compatible mode! Gonna have to try that tonight.
whicker
Trooper
Posts: 479
Joined: Sat Nov 27, 2004 4:33 am

Post by whicker »

I am just saying that I am going to start entering it into WinQCad, if after all these years the editor for PCB123 doesn't suck. The only reason I picked either of these is that it is so easy to get and license legally. If you think I am lying, try to purchase the latest software package formally known as Protel, for "hobbyist" use. Or the same with OrCad. I think they'd find it funny.

With something like Visio or a vector drawing package, it's just lines on a page. If I take the time to do it this way, at least somebody could, for whatever reason, with the part library, desolder a chip and make a custom printed circuit board for it.

What I'm choosing to do shouldn't stop anyone else from cleaning this drawing up.

edit: lucky 666th post.
Nightcrawler
Romhacking God
Posts: 922
Joined: Wed Jul 28, 2004 11:27 pm
Contact:

Post by Nightcrawler »

I agree. If you're going to take the time to do it, it makes sense to do it in a schematic entry program for a variety of reasons such as the one you mentioned amongst others.

OrCAD and Protel are ridiculously priced, even for small businesses, let alone the hobbyist. Our penny pinching company was using a less expensive Ivex suite (WinDraft/WinBoard). Though in the end, we got what we paid for. The software was buggy and the company went out of business 2 years ago. Now we're looking toward biting the bullet for some decent industry standard software.

Anyway, I've never used WinQcad, but a quick trip to their website shows it's compatible with OrCAD which is good. :)
[url=http://transcorp.romhacking.net]TransCorp[/url] - Home of the Dual Orb 2, Cho Mahou Tairyku Wozz, and Emerald Dragon SFC/SNES translations.
[url=http://www.romhacking.net]ROMhacking.net[/url] - The central hub of the ROM hacking community.
neviksti
Lurker
Posts: 122
Joined: Thu Jul 29, 2004 6:15 am

Post by neviksti »

whicker wrote:I am just saying that I am going to start entering it into WinQCad, if after all these years the editor for PCB123 doesn't suck.
...
With something like Visio or a vector drawing package, it's just lines on a page. If I take the time to do it this way, at least somebody could, for whatever reason, with the part library, desolder a chip and make a custom printed circuit board for it.
How's the circuit drawing going?

I'd really like a copy when you are done if you don't mind.
whicker
Trooper
Posts: 479
Joined: Sat Nov 27, 2004 4:33 am

Post by whicker »

Utter failure due to automatic component renumbering.
Please ask again sometime again in April ;_;

On my printout, I was able to figure out the majority of what the component numbers were (8's 5's and 6's especially annoying). At least I hope.

IC pin numbers are still a little bit of a challenge, along with the abbreviated names. All taken as my best guess.

What would help would be a hires photo of the top and bottom of the exact SNES board these schematics refer to. (still 2 PPU chips, but audio on board, not as the module).

I still don't know why the schematic shows "+8" of the RF modulator going to Vcc.

Thank you for caring. I'll get off my ass and work on it again.
Post Reply