+  RHDN Forum Archive
|-+  Romhacking
| |-+  ROM Hacking Discussion
| | |-+  Am I blind? - sanity check on XBand project
Pages: [1]
Author Topic: Am I blind? - sanity check on XBand project  (Read 2 times)
neviksti
Guest
« on: August 03, 2008, 06:30:19 pm »

Howdy,  I need a sanity check on a project here and hopefully someone can oblidge (or offer advice).  All this should take is a pair of good eyes, but advice from a hardware person would be appreciated as well.

I'm trying to hack the XBand rom to let me directly connect to another to play games (basically, skip the now defunct call center / server).  However, I'm having trouble figuring out how this thing even works solely looking at code.  I decided to sit down and trace out what all the main control chip connects to so I get a feel for what is possible / impossible (and also help me make educated guesses of what is going on).

I eventually figured out what every pin does except one ... it seems to control a transistor which controls ... well, nothing.

Some pictures are available here:
http://www.snescentral.com/article.php?id=0067

The chip I'm interested in at the moment is the FredIIH.  The pin in question is pin 37 (pins are labelled counter-clockwise from bottom-left corner).  If you don't feel like counting, pin 37 is connected to the middle trace of the three trace 'group' coming out of right side of the chip.

What I see is this:
I checked and there is no trace that goes under the chip from pin 37.
Following trace away from pin I see it go through board (right below R18),
then it goes and connects to base of transistor U9,
it continues on and goes through board again,
this goes through resistor R206 to Vcc (top of C15) ... since this is Vcc it goes elsewhere of course

emitter of U9 -> GND
collector of U9 -> NoWhere!?!?


Please can someone sanity check this?  Am I missing something obvious?  Any ideas?
I really don't know what is going on with this pin.
byuu
Guest
« Reply #1 on: August 04, 2008, 01:21:44 am »

You're way out of my league with hardware pin tracing ... but if you need help with disassembling and understanding the BIOS ROM itself, let me know and I'll be glad to help out.

As for the hardware itself, hopefully d4s or Nightcrawler sees this thread. They'd be your best bets around these parts.
neviksti
Guest
« Reply #2 on: August 04, 2008, 03:22:14 am »

Quote from: byuu on August 04, 2008, 01:21:44 am
if you need help with disassembling and understanding the BIOS ROM itself, let me know and I'll be glad to help out.
That would be great! 

I am not a romhacker by any means, and so therefore often get side tracked trying to understand some code that turns out not to even be useful.  Years back when I looked into this, my goal was to understand the protocals and write an XBand server for the fun of it.  That didn't get finished, and I definitely don't have time to try that again.  Sure I'd love to understand how everything works, but goals now are more along the line of:

    1) figure out how to bypass connecting to the server and jump straight to being setup to play and "waiting for opponent"  (supposedly, if the server couldn't find you anyone to play with immediately it would just hang up and tell you to wait and then have another player's modem call you directly ... so figuring out how to force this "wait for opponent" mode would be great)

    2) figure out where the patches are, and how they work

(Actually, according to this http://saturnleague.com/board/viewtopic.php?p=1032#1032 , if you get step 1, you can already play games with people for reliving the fun and awe of this amazing engineering feat.)
In case it would be useful, I made some small rom hacks to allow Sleuth to consider "Super Mario Cart" or "Weaponlord" or "nothing" is attached in the external cartridge slot.


As for looking at the code:
This is one of the rare SNES programs that was written in C.  All the stack frames and local variables take a bit getting used to.  Also, they wanted to be able to update the system as the service grew.  So there is a "dispatch system" which sends many requests through tables in the SRAM... this allows the operating system to be easily updated. (It also let us easily enumerate what they felt were common/important routines.)

The XBand also has a built in "debugger" (really just a kind of memory viewer) that I can show anyone how to activate if they'd like to play with the memory map on the real system and don't have a copier. (Actually, anyone with an XBand and working SNES can probably help out here, I can explain what to do if you have no technical experience ... it's just reading, recording, and comparing many things on the screen.) This device is like an ultra-game genie with a modem attached.  The direct modem access is obvious given the datasheet and memory map, but I haven't figured out even the base features of the "patcher" part yet, but hopefully that will come later.

Here's my current understanding of the memory map to help out a bit:
Code:
bank $E0.... 64kBytes of SRAM (battery backed)

banks $E1-$FA.... mirror of bank $E0

bank $FB
    0000-BFFF ... mirror of bank $E0
 
    C000-C1FF
        even and odd addresses are equivalent
 
        C0F8 ........unknown register
        C0FA ........unknown register
        C108 ........unknown register (deals with card register, bit0 = card insterted)
        C110 ........unknown register (changing rapidly)
        C112 ........unknown register (changing rapidly)
        C130 ........unknown register (changing rapidly)
        C138 ........unknown register (changing rapidly)
        C140 ........unknown register
        C168 ........unknown register
        C180-C1BF ...modem registers
        C1C0-C1FF ...modem registers
 
        all addresses in this range not listed return FF
        (if a register is write only, or defaults to FF, I probably
        passed it up in this test)
 
    C200-C3FF - same as C000-C100
    C400-C5FF - "
    C600-C7FF - "

    ... etc

    FA00-FBFF - "
    FC00-FDFF - this is all FF's
    FE00-FFFF - this is all FF's
 
banks $FC-$FF ... mirror of bank $E0

--------------
 
the lower banks $60-$7D mirror bank $E0
 
everything else appears as normal

For those wanting to follow the code even tighter, the modem is a  RC2424DPL, and datasheets are available online.  Be wary that, due to how everything is wired up, there probably is a FIFO for transferring data once the connection gets going... I don't know which regs these are. (Setup stuff all uses direct modem access though.)

One important thing I learned while pin mapping is that the controller chip does not use the A0 address line, and controls all other address lines to the ROM and SRAM.  So it can't "trigger" patching on an opcode (sort of like game doctor sf7), but instead probably maps in whole sections of SRAM after certain address triggers.  I was told by an employee of Catapult that they remember the device being able to handle 16 such trigger points or regions or however this thing works.  They used the word vector so I'm guessing specific addresses trigger it, but who knows for sure.

The code usually only uses banks $00, $Dx,$E0 and stuff in $FB:C000-C1FF.

I've recently ran across across it writing to stuff at $004fxx, $FFC000, and $FB:FExx ... no idea at the moment.

For the hardware curious, here's an example of controlling mapping the cartridge in, copying some data to identify the cartridge later, and then returning to the normal mapping (this is all ran from WRAM):

Code:
Leaving out all the fluff

.8bit
$fbc070 = #$00
$fbc074 = #$00
$fbc072 = #$78

$fbfe00 = #$08
$fbc0da = #$80

lda     $00f000 ; ??? not used

*I assume, Now we have cartridge mapped into $00:8000-$00:FFFF

copy 00:ffb0-00:ffdf to 7f:00b4

lda     $00ffe0 ;?? not used

*I assume, Now we've returned to bios mode??

$004f02 = #$19
$fbc0da = #$00

.16bit
lda     $00fff8
sta     $001061 ;<--- in current traces at least, it is not used

.8bit
$fbc0e0 = #$FF
$fbc0f0 = #$FF

$ffc000 = #$01

lda     $00f000  ;not used <-- maybe this returns us to normal maping?

return

Notice:
24bit pointer $fbc070 = #$007800 = #$00F000 / 2 (because no A0 line)
Of course that may just be a conincidence.


If it somehow becomes important to understand the communication protocal, I can explain what I've learned so far.  (There can be an initial identification transaction, and then everything after that uses a kind of packet system which has a couple layers... I understand the base layers okay, but it gets fuzzy after that.)  There is also a way, with a button sequence, to go to a "service mode" which waits for incoming calls for diagnostics.  That may be another means to figure out the protocal if necessary.
« Last Edit: August 04, 2008, 05:03:13 am by neviksti »
Nightcrawler
Guest
« Reply #3 on: August 04, 2008, 09:25:50 am »

Quote from: neviksti on August 03, 2008, 06:30:19 pm
Some pictures are available here:
http://www.snescentral.com/article.php?id=0067

The chip I'm interested in at the moment is the FredIIH.  The pin in question is pin 37 (pins are labelled counter-clockwise from bottom-left corner).  If you don't feel like counting, pin 37 is connected to the middle trace of the three trace 'group' coming out of right side of the chip.

What I see is this:
I checked and there is no trace that goes under the chip from pin 37.
Following trace away from pin I see it go through board (right below R18),
then it goes and connects to base of transistor U9,
it continues on and goes through board again,
this goes through resistor R206 to Vcc (top of C15) ... since this is Vcc it goes elsewhere of course

emitter of U9 -> GND
collector of U9 -> NoWhere!?!?


Please can someone sanity check this?  Am I missing something obvious?  Any ideas?
I really don't know what is going on with this pin.

I'm assuming U9 is the black through hole part on the backside of the board near the battery? I can't read the label on that part. I'm also getting eye strain trying to follow the traces from the pictures provided.

If that part is U9, please copy down everything on the face of the part. In most cases, through hole parts using the TO-92 package (the typical 3 in transistor like package we see here) will have the part number on them. They may also have a company symbol or some other identification mark.

It is unlikely this is your typical run of the mill transistor. In IEC design standards, the 'U' designator is reserved for IC's and should not be used for transistors. That's why I'd like to verify the part. Though the 'E,B,C' pin labels would lead one to believe it still may be a transistor.

Second, I can't tell well from the images, but are you certain there are no traces connected to the 'C' pin on either side of the board?
neviksti
Guest
« Reply #4 on: August 04, 2008, 10:59:46 pm »

Quote from: Nightcrawler on August 04, 2008, 09:25:50 am
I'm assuming U9 is the black through hole part on the backside of the board near the battery? I can't read the label on that part. I'm also getting eye strain trying to follow the traces from the pictures provided.
Yep, that's it.

Quote from: Nightcrawler on August 04, 2008, 09:25:50 am
It is unlikely this is your typical run of the mill transistor. In IEC design standards, the 'U' designator is reserved for IC's and should not be used for transistors. That's why I'd like to verify the part. Though the 'E,B,C' pin labels would lead one to believe it still may be a transistor.
Oh, I had no idea there was a standard.  I'm basically self taught, and thought it was just a loose convention (I've seen Q, T, and U all refer to transistors before).  Due to the package and E,B,C labels I really thought this was a transistor.

But yes, you are correct!
I was hoping I was blindly overlooking something simple! Thank you very much.
The ink appears to have worn off (or was black!?).  But if I tilt it just right, I can read some stuff on it due to a difference in reflectivity.

DS2401
This is a really neat little piece.  I never new such a thing existed (but in retrospect the demand for such a device makes sense).

"The DS2401 enhanced Silicon Serial Number is a low-cost, electronic registration number that provides an absolutely unique identity which can be determined with a minimal electronic interface (typically, a single port pin of a microcontroller). The DS2401 consists of a factory-lasered, 64-bit ROM that includes a unique 48-bit serial number, an 8-bit CRC, and an 8-bit Family Code (01h). Data is transferred serially via the 1-Wire® protocol that requires only a single data lead and a ground return. Power for reading and writing the device is derived from the data line itself with no need for an external power source."

Neat!

Quote from: Nightcrawler on August 04, 2008, 09:25:50 am
Second, I can't tell well from the images, but are you certain there are no traces connected to the 'C' pin on either side of the board?
It really appears that way.  And makes sense now that I see the datasheet of the actual part.  I wonder why they labelled it that way?  None of the transistors on the cartridge even have E,B,C labelled.
« Last Edit: August 04, 2008, 11:27:14 pm by neviksti »
Nightcrawler
Guest
« Reply #5 on: August 05, 2008, 08:17:07 am »

Good to heard. Glad I could help. +1 for Nightcrawler!

Clearly the reason nothing is connected to the 'C' labeled pin is because it's not used for this IC. The datasheet shows it's 'NC' (no connection). That's what my initial suspicions were, but we needed to know what part we were dealing with first.

That is an interesting part. I haven't seen one of those before. It's still being sold today, so I guess it's still used in some devices, though it's not a highly stocked part, so it's usage is probably limited.

As far as the silk screen label (The 'E','B','C' labels), it's most likely because that's what they used in their PCB layout program to get a TO-92 foot print on the board. The most common thing in TO-92 form is of course transistors. Rather than create and define a special part, they used something from the stock library instead. Works fine, just labeled 'wrong'.
Pages: [1]  


Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC