How pnach files work
#1
Edit by Blyss Sarania: An updated version of this guide can be found here.



Pnach files are used to:
1.- Store game names
2.- Store game comments
3.- Store Zerogs configuration for that game
4.- Store games patches
4.- Store games cheats
5.- Other things (that "should" not be used)


You could find them in directory /patches/.
They have a name like XXXXXXXX.pnach where XXXXXXXX is the crc.

The pnach file's structure is something like
Code:
gametitle= Game name  [SLXS XXXX] (R)
comment=
// comment line
zerogs=00000400
patch=1,EE,003E531E,word,00004370
.....

Patch description:
Code:
patch=1,EE,003E531E,word,00004370

patch    -> it is a patch (:P)
1        -> it is active (1 on - 0 off)
EE       -> affects EE memory ( the other option is IOP don't mess with that)
003E531E -> it is the address affected by the patch
word     -> it is the data's size that will be written starting in the address position (it could be byte,short,word)
00004370 -> it is the data that will be written. NOTE: if the data's size (byte,short,word) is smaller than data written here it will get truncated.
Notes:
all adresses need to start by 0 or 2 (it is the same, 0xxxxxxx and 2xxxxxxx points to the same data)

Raw cheats coul be translated to patches, but only ones starting by 0,1,2. Like this
Code:
003FE82C 00000002    patch=1,EE,003FE82C,byte,00000002
103FE830 00000202    patch=1,EE,003FE82C,short,00000202
203FE834 02020202    patch=1,EE,003FE82C,word,02020202
This codes could be translated because the codes that start by 0,1,2 only writes to memory, the rest do more things and can't be translated directly, if you do, you are doing it wrong, maybe it doesn't broke anything but probably it would do

Not so long ago it was added support to raw cheats in the pnach files.

It was nerver written how to use it, so here it is
Code:
RAW code
D056BADC 0000F7FB
1025C7E8 0000424B

patch=1,EE,D056BADC,extended,0000F7FB
patch=1,EE,1025C7E8,extended,0000424B
NOTES:
Master codes are almost never needed
There is a bug with codes like
Code:
Dxxxxxxx 0010yyyy
Dxxxxxxx 0020yyyy
Dxxxxxxx 0030yyyy
Exxxxxxx 1yyyyyyy
Exxxxxxx 2yyyyyyy
Exxxxxxx 3yyyyyyy

At the moment have been implemented almost any code type but ones starting by 8,9,B,F (that don't have sense in pcsx2 or are very hard to program).
Reply

Sponsored links

#2
its a pity the Exxxxx codes are bugged , since a "few" raw from codebreaker do have the Exxxx ones :/ or you mean just those 6 examples are bugged ?
CPU - [PHENOM 9950 BE 3.0 GHZ | GFX - [Evga 260GTX]
OS - [Vista 64 Business] | RAM - [4GB Gskill 1066Mhz]
Reply
#3
(03-14-2009, 02:20 AM)Akaruz Wrote: its a pity the Exxxxx codes are bugged , since a "few" raw from codebreaker do have the Exxxx ones :/ or you mean just those 6 examples are bugged ?
only that ones

Dxxxxxxx 0000yyyy
Exxxxxxx 0000yyyy
are ok.

the others have been fixed, but for now the fix is not even in SVN
Reply
#4
Nice post Pontifice, I'll go ahead and add it in the useful links on the FAQ
[Image: newsig.jpg]
Reply
#5
This is something I was curious about as well. Thanks.
Intel C2D E8400 4.5Ghz|EVGA nForce 680i|BFG Tech 8800GTX 675Mhz\2160Mhz|4GB Team Group PC2-9600 1200Mhz|Creative X-Fi|Vista 64 Bit
Reply
#6
With extended does that mean we can do joker codes like?

//Disable Vsync L3 R3
patch=0,EE,D1CAA102,extended,0000FFFD
patch=0,EE,0023d610,word,03E00008
patch=0,EE,D1CAA102,extended,0000FFFB
patch=0,EE,0023d610,word,27BDFFE0
Reply
#7
Yes, it should work, but all with extended, if you uses a extended used it in all the code you translate, like:

//Disable Vsync L3 R3
patch=0,EE,D1CAA102,extended,0000FFFD
patch=0,EE,0023d610,extended,03E00008
patch=0,EE,D1CAA102,extended,0000FFFB
patch=0,EE,0023d610,extended,27BDFFE0

You can mixed normal codes with extended but with different cheats.
Reply
#8
Do you need to turn analog on? when using L3 or R3 "Use analog mode whenever possible" in LilyPad does pcsx2 automatically start your controller in analog mode or do you have to press the analog button? as I tried the above and it didn't work.
PC Specs
OS: Windows XP Professional SP2 32bit
CPU: Intel Pentium 4 2.00GHz
Memory: 768MB DDR2
GPU: SiS 650
SPU: Philips PSC605
Reply
#9
Try this one instead i didn't restore the "2" and the code was wrong
//Disable Vsync L3 R3
patch=0,EE,D1CAA102,extended,0000FFFD
patch=0,EE,2023d610,extended,03E00008
patch=0,EE,D1CAA102,extended,0000FFFB
patch=0,EE,2023d610,extended,27BDFFE0
Reply
#10
It worked :-) but it slowed the game down to about 2-4fps does this have anything to do with the frame limiter?
I know the code works cos i've used it on my real ps2 with codebreaker and it makes the game run about 4-6 times quicker with scanlines rushing past the screen as well as stopping the videos from playing.
PC Specs
OS: Windows XP Professional SP2 32bit
CPU: Intel Pentium 4 2.00GHz
Memory: 768MB DDR2
GPU: SiS 650
SPU: Philips PSC605
Reply




Users browsing this thread: 2 Guest(s)