Cen64 NTSC/PAL support.
- Ambient_Malice
- Posts: 21
- Joined: Mon Aug 25, 2014 9:04 am
Cen64 NTSC/PAL support.
The N64 PIF has PAL/NTSC hardcoded. US/JAP N64s can run each other's games, but PAL has a different PIF.
This presents a bit of a problem. Currently, if you want to run Cen64, you dump the PIF from an N64 or "acquire" the PIF. It just so happens that all the not-so-legal PIFs floating around seem to be NTSC.
There is some info floating around on what part of the PIF controls NTSC/PAL, but it doesn't seem as though anyone has actually made any serious attempt to modify the PIF to be region free. I guess it was never a concern until someone tried to make an accurate N64 emulator.
I see a number of solutions.
1: Find the PAL/NTSC flag and then create a tool to switch it. Perhaps even impliment this as a nice button in the corner of front ends. Press it and the symbol goes from PAL to NTSC, the pif being edited in the background. Or you could simply make the PIF region free. (This is apparently possible.) That is a SMIDGE dirty, though. Something goes wrong and you've got a borked PIF.
2 Same as 1, but feed the game PAL/NTSC/Region free flag some other way.
3: Reverse engineer the PIF because suffering is joy.
4: Ignore the problem because nobody cares about PAL plebs, the so-called "bug fixes" in their games, and their non-English language options. :b
This presents a bit of a problem. Currently, if you want to run Cen64, you dump the PIF from an N64 or "acquire" the PIF. It just so happens that all the not-so-legal PIFs floating around seem to be NTSC.
There is some info floating around on what part of the PIF controls NTSC/PAL, but it doesn't seem as though anyone has actually made any serious attempt to modify the PIF to be region free. I guess it was never a concern until someone tried to make an accurate N64 emulator.
I see a number of solutions.
1: Find the PAL/NTSC flag and then create a tool to switch it. Perhaps even impliment this as a nice button in the corner of front ends. Press it and the symbol goes from PAL to NTSC, the pif being edited in the background. Or you could simply make the PIF region free. (This is apparently possible.) That is a SMIDGE dirty, though. Something goes wrong and you've got a borked PIF.
2 Same as 1, but feed the game PAL/NTSC/Region free flag some other way.
3: Reverse engineer the PIF because suffering is joy.
4: Ignore the problem because nobody cares about PAL plebs, the so-called "bug fixes" in their games, and their non-English language options. :b
- MarathonMan
- Site Admin
- Posts: 692
- Joined: Fri Oct 04, 2013 4:49 pm
Re: Cen64 NTSC/PAL support.
I documented a safe routine that Hacktarux posted about, here:
http://forums.cen64.com/viewtopic.php?f ... ARUX#p1416
It requires a bit of programming knowledge, though, and access to an actual PAL console/cart.
http://forums.cen64.com/viewtopic.php?f ... ARUX#p1416
It requires a bit of programming knowledge, though, and access to an actual PAL console/cart.
- Ambient_Malice
- Posts: 21
- Joined: Mon Aug 25, 2014 9:04 am
Re: Cen64 NTSC/PAL support.
If someone dumped a PAL PIF, that would certainly allow people to check how much it differs to an NTSC one. But AFAIK, the only difference is the region setting. I could be very wrong, though.MarathonMan wrote:I documented a safe routine that Hacktarux posted about, here:
http://forums.cen64.com/viewtopic.php?f ... ARUX#p1416
It requires a bit of programming knowledge, though, and access to an actual PAL console/cart.
https://code.google.com/p/mupen64plus/w ... ResetNotes
I guess from a pure accuracy standpoint, using clean PAL and NTSC PIF to boot games is ideal, but it has certain practical limits. I can't imagine most people have an N64 from a different region sitting about. Being able to switch PIF region would be ideal, but I suppose a PAL dump might be needed first.
edit:
I am probably completely wrong and the PAL PIF-ROM is probably significantly different. Hopefully somebody dumps it soon.
- Snowstorm64
- Posts: 303
- Joined: Sun Oct 20, 2013 8:22 pm
Re: Cen64 NTSC/PAL support.
I would like to dump the PIF ROM by myself (I own a PAL N64), but +200 $ for a flash cartridge is a big no for me
I don't even do programming stuff... However, I think the PAL PIF is already dumped by someone, because I remember someone that had done a list of tested PAL ROMs on CEN64, in an other board.
EDIT: Ok, this is weird, some PAL ROMs indeed boot on CEN64 with the NTSC PIF, like Mario Party or Iggy's Reckin' Balls, but some other games refuse to do so like Super Smash Bros, with the infamous warning. I'm sure those ROMs are PAL, because they come with three languages (English, French and German) on the screen.

EDIT: Ok, this is weird, some PAL ROMs indeed boot on CEN64 with the NTSC PIF, like Mario Party or Iggy's Reckin' Balls, but some other games refuse to do so like Super Smash Bros, with the infamous warning. I'm sure those ROMs are PAL, because they come with three languages (English, French and German) on the screen.
OS: Debian GNU/Linux Jessie (8.0)
CPU: Intel i7 4770K @ 3.5 GHz
Build: AVX (compiled from git)
CPU: Intel i7 4770K @ 3.5 GHz
Build: AVX (compiled from git)
Re: Cen64 NTSC/PAL support.
Is there a ready-to-go rom available to dump the PIF? I wouldn't mind taking a shot at this, and have NTSC(-J, not that that matters) and PAL N64s (so there wouldn't be any legal issues with me comparing both PIFs) as well as a Z64 to run stuff off of.
- MarathonMan
- Site Admin
- Posts: 692
- Joined: Fri Oct 04, 2013 4:49 pm
Re: Cen64 NTSC/PAL support.
I haven't used the Z64 system; how do you dump data from Z64 to the PC (or externally)?teres wrote:Is there a ready-to-go rom available to dump the PIF? I wouldn't mind taking a shot at this, and have NTSC(-J, not that that matters) and PAL N64s (so there wouldn't be any legal issues with me comparing both PIFs) as well as a Z64 to run stuff off of.
Re: Cen64 NTSC/PAL support.
If you're about to whip up some code, just pretend you have an EEPROM or SRAM and copy whatever's interesting there; and/or print to screen. Actually, maybe do both just to be on the safe side, I'll make sure to also take some photos then.
The Z64 uses a boot/host cart, which it reads the save data from afterwards and then writes that to a file on a CF card (used to be a Zip drive, but those suck, so... yeah.). Games using Flash don't work on this unit, at least without patches, so don't go that route. I could also do mempack dumps if necessary.
The Z64 uses a boot/host cart, which it reads the save data from afterwards and then writes that to a file on a CF card (used to be a Zip drive, but those suck, so... yeah.). Games using Flash don't work on this unit, at least without patches, so don't go that route. I could also do mempack dumps if necessary.
- MarathonMan
- Site Admin
- Posts: 692
- Joined: Fri Oct 04, 2013 4:49 pm
Re: Cen64 NTSC/PAL support.
Ok, that's easy enough. I'll port my PIF dumper for 64drive to use SRAM for storage and let you know.teres wrote:If you're about to whip up some code, just pretend you have an EEPROM or SRAM and copy whatever's interesting there; and/or print to screen. Actually, maybe do both just to be on the safe side, I'll make sure to also take some photos then.
The Z64 uses a boot/host cart, which it reads the save data from afterwards and then writes that to a file on a CF card (used to be a Zip drive, but those suck, so... yeah.). Games using Flash don't work on this unit, at least without patches, so don't go that route. I could also do mempack dumps if necessary.
EDIT: Can Z64 boot a cart directly, or does it have to go through some menu first?
Re: Cen64 NTSC/PAL support.
Both, but I guess the menu mode is of no interest - probably even counterproductive - in this case.MarathonMan wrote:Can Z64 boot a cart directly, or does it have to go through some menu first?
- Snowstorm64
- Posts: 303
- Joined: Sun Oct 20, 2013 8:22 pm
Re: Cen64 NTSC/PAL support.
When you're done with it, please share your results with us. Thanks 

OS: Debian GNU/Linux Jessie (8.0)
CPU: Intel i7 4770K @ 3.5 GHz
Build: AVX (compiled from git)
CPU: Intel i7 4770K @ 3.5 GHz
Build: AVX (compiled from git)
- MarathonMan
- Site Admin
- Posts: 692
- Joined: Fri Oct 04, 2013 4:49 pm
Re: Cen64 NTSC/PAL support.
Yes, that's why I asked. Basically, the dumper runs in two phases. In the first phase, it sets up an exploit to capture the PIF ROM. After the exploit is setup, you need to send a NMI (reset console) to "unlock" the PIF. The exploit stops the PIF at the very beginning of it's execution, copies the PIF ROM to temporary storage, and then silently steps out of way and makes it look like it was never present. When the ROM is re-loaded, it then copies the PIF from the temporary storage location to SRAM or something exportable. If you have menus or other doodads that happen before the game loads, you have to be more careful about what you use for temporary storage so the menu doesn't blow it out.teres wrote:Both, but I guess the menu mode is of no interest - probably even counterproductive - in this case.MarathonMan wrote:Can Z64 boot a cart directly, or does it have to go through some menu first?
Re: Cen64 NTSC/PAL support.
Oh I see, so you'd just have to take care where to put things? I'd have though that the menu running first, then soft-resetting the CPU to switch to the game would've maybe left everything in an inconvenient state (PIF already inaccessible). Either way, not a problem - I'll keep in mind not to use the GUI.
Re: Cen64 NTSC/PAL support.
Been a month, so let's give this a little bump... I hope you'll eventually find a bit of time to cook something up, MM.
Re: Cen64 NTSC/PAL support.
The PAL PIFram dump differs in three ways:
One I haven't seen is an MPAL dump.
You don't have to use an official pifram. You can also use the one LaC created for his bootloader, provided you set the correct variables in it. This shouldn't cause a problem; it's not as though actual PIF emulation is possible at this point.
- The order in which things are done, but not what is done.
- osVersion is OR'd with 6; this is kept in S7 and eventually set to 80000314.
- osTVType will be set to 0; this is kept in S4 and eventually set to 80000300.
One I haven't seen is an MPAL dump.
You don't have to use an official pifram. You can also use the one LaC created for his bootloader, provided you set the correct variables in it. This shouldn't cause a problem; it's not as though actual PIF emulation is possible at this point.
Who is online
Users browsing this forum: No registered users and 1 guest