Multi Region N64

Inside my multi region n64. Automatically detects cart region when inserted
I replied on the other thread you answered to, but for the sake of everyone here, this is a bulk copy and paste :)
Now that is high-resolution gold! It's also pretty self-explanatory as to what's going on, but I find it odd that there are four analogue switches there when three would suffice. I'd love to see the underside of the board (if possible) as it'd allow us to start piecing together where the traces go.

What I also found unusual with that mod is that pin 25 has been cut and joined to the EEPROM dat. The mod I was working on survived fine until I started messing with that wire in particular. Long story short: I did succeed in making a simple PCB for a multi-region unit and even started working on a V2 of the design, but the the unit that was was experimenting with has died and I'm out of money to pursue this project any further.

Too add to this pool of knowledge, I got an email from a friend pertaining to what that microprocessor in the middle there could be doing:
=========================================================================================================
Right at boot, either the first or second thing the PIF does is send a signal for the region it is. If the CIC doesn't respond with the corresponding signal it should lock before anything else happens (for instance, before IPL2 is loaded to PIFRAM) Pretty sure NTSC is 110 and PAL is 100, but that info is second-hand. An MPAL PIF has never been examined as far as I know, but since they're compatible with NTSC carts fairly safe to say they report the same.

IPL2 sets S4 to the region used by software, independent of the initial check. That's how bootloaders are able to change the detected region around. That doesn't guarantee the software is going to appreciate you doing that, of course.

Also, the main CIC<->PIF runtime algo alters nibbles in reverse order. Pretty sure the 7xxx series does high nibble to low nibble, and the other series all do low to high. Might want to double-check that too, but should be the case. The results have to match between the two or the system will lock.

Ideally, you'd just want to program a new PIF that avoids region checks altogether. It's an SM5-based chip--just like the CICs are--and there's an assembler online. Seems like an awful lot of work though for something that can be solved easier software-side.
Thank you for your hard work. I was wondering if we can provide any help (financial or technical) to get an open source solution for a switchless n64 ?
You talked about a german forum earlier but did someone get an otaku-store's n64 in their hands to understand how exactly it works?
I don't think that's necessary - it's pretty obvious how it works. They have both PIFs on the board, and switch between them with a bunch of analog multiplexers. When you plug a cart in, it tries one of the PIF chips and sees if it can handshake with the CIC inside the cartridge - if not, it switches to the other one. The main problem with this approach is that you need both a PAL and and NTSC PIF for it, and the only place you can get them is from an N64, which immediately raises the question of why you just don't use both consoles.
True, but there's usually a fairly sizeable price difference between a loose N64 and a complete one. There's also the element of doing it just because, otherwise we'd all just be playing emulators on our PCs, like every other Youtube comment suggests on a retro hardware video.
I certainly wasn't decrying the idea of using real hardware. I just think it would be a lot better to do this by simulating the PIF rather than killing a N64 to get one of the correct region.
Is there a way to clone a PIF or make one that integrate the PAL and NTSC one on a single chip ? I'm not an expert at all but the "open source solution" i was talking about earlier was more something in this direction.
My understanding is that the PIF has been decapped but that it would be a ton of work to reimplement for not that great of a reward for the most part. Would love to see an 'UltraPIF' though at some point.
Been a while since I've posted here. I've so happened to have a N64 with a multi-region mod (from you know who) show up on my repair list and was wondering: Suppose we wanted to read the programme on the chip how would one go about doing it?
Not sure if this helps any but I stumbled upon these....
It would just be a case of having the correct programer - and knowing what the chip is that you wish to read....
So long as the code is unprotected you can then just read it straight out.... If the code is protected then you'd need it decapped...
It's a bit more complicated than that - the PIF is a custom chip that contains a MCU similar to the one in the CIC chips, the boot ROM for the MIPS CPU and some glue logic. I'm pretty sure that both the SM5 code and the MIPS boot ROM have been dumped, but that doesn't help that much since there isn't a "blank PIF" you could flash them into.
Ah - yes that is a bit of a problem....
But for them to have been dumped - someone out there must know how to do it...

So how do the clone CIC chips work? Do they just clone the "logic" without being a 1:1 direct clone of the original?
Yeah, pretty much - someone extracted the code from the SM5 MCU that was in the CIC, reverse engineered it and then it was rewritten to work on readily available flash MCUs. What the code does in the PIF is fairly well understood and the MIPS boot code is just binary, so it should be fairly easy to implement - but just not as a single chip.
So then, in a simular method to creating the IBM PC "clones" (100% IBM PC compatible) i.e. What Compaq did in the early PC days without creating a 1:1 clone of the copyrighted IBM BIOS... Reverse engineer the logic and create a system that behaves in an identical fashion.
Does it matter if it is not all on a single chip? So long as it works, and is of a reasonable physical size and cost to produce I suppose the logic could be "split" and run off several chips to ensure it all behaves as expected...
It's all theoretically possible, but it's quite a bit of work and as far as I know nobody has actually done it yet. I did start to play with the idea, but honestly never got very far.

The PIF contains a number of subsystems:

The Sharp SM5 CPU that talks to CIC, with local ROM and RAM
Serial interface used to communicate with the RCP
A small boot ROM that gets sent to the R4300i at boot time
An interface for the serial EEPROM in the cart
An interface for the controller sockets
Various GPIOs connected to things like the reset switch and the NMI/ line on the CPU

As I said, I never got very far - I basically moved the PIF out onto a breakout board with jumpers so I could isolate individual pins - but on a practical level pretty much everything has to be connected for the system to boot.
Yikes!
While theory is always well and good...
Perhaps its time to dig up all the unwanted/broken/dmaged/cheap N64s and steal the PIFs from them... much like we did with CICs to make the everdrives work....
Afterall I'm reasonably sure they produced millions of them anyway.....

Original thread: https://assemblergames.com/threads/multi-region-n64.64278/