How PNACH files work 2.0
#1
This is an updated version of the guide explaining how PNACH files work.

PNACH files are used for the following things:
  • Storing game names
  • Storing game comments
  • Storing ZeroGS configurations for a game
  • Storing game patches (widescreen patches for example, or fixes for games) and cheats

When you're using regular cheats the PNACH file is saved in the cheats folder located under My Documents/PCSX2/ by default.
Widescreen patches are stored under a different folder called cheats_ws. Note: If you're using the portable versions then the folders will be located in the root PCSX2 directory. Check the console window to see where PCSX2 is trying to load the file from if you're having issues finding the correct folder.

The filenames are always labeled via the CRC of a game. Each game has a unique CRC number which can be found in the Console Log window when you run the game.

Quote:ELF (cdrom0:\SLUS_213.86;1) Game CRC = 0x14FE77F7, EntryPoint = 0x00100008

In the above line is the game Tales of The Abyss, when looking for the CRC of the game it is the one you want after the '0x' part.

Now let's take a look at the structure of a PNACH file. Usually it will look like something like this:

Code:
gametitle=Tales of The Abyss [SLUS 20963] (U) [14FE77F7]

//Max Gald
patch=1,EE,206D2C10,extended,0098967F

//Max Grade (In-game and Grade Shop)
patch=1,EE,2070F91C,extended,0098967F


A rundown of what's inside:
patch 1 EE 206D2C10 ,extended, 0098967F
Defining that it's a patch. 1: Always active (Freeze value).
0: Writes value one time only at the start of a game.

If you want to turn a code completely off, simply comment it out with // in front of the patch=1.
That it affects the EE memory. This is the address of a code. (This is where something gets stored by the game, like money values for example) These codes generally almost always start with either 0, 1, or 2. (There are some exceptions though!) The data size/type. In the past, PCSX2 used to make use of byte, short, and word for this. While it can still be used now; it's much easier to just use ,extended, as it works for each data size. The first number of the address is what matters when using ,extended, this determines where it will write to. (More info into that further in the guide). This is the 'value' that gets written on the address. In this case it's the max. amount of money you can have in the game Tales of The Abyss. These values are always in HEX format. The DEC format would be 9999999 Gald.

Different kinds of codes
As mentioned previously in the guide, almost all the addresses of a code usually start with either 0, 1, or 2.

0 means it will write to one byte only.
1 means it will write to two bytes.
2 means it will write to four bytes.

A simple example here would be the following fake money code.

Code:
00005000 000000FF =        255 Gold
10005000 0000FFFF =      65535 Gold
20005000 00FFFFFF =   16777215 Gold
20005000 FFFFFFFF = 4294967295 Gold

If you were to go by the above example, it basically means that when you use a code starting with 0 it will only write to the last byte and it will completely ignore the other bytes. So if you want to have more than 255 Gold in the game, you would have to go for the code starting with 1, or 2. Remember to always check what the maximum values are inside each game, because you don't want to end up breaking your game by setting values way too high.

Sometimes you'll also find codes starting with 4. These are so called 'condensed' codes or alternatively for lack of a better word; multi-address write codes. What this means is that it's basically a type of code that allows for multiple values to be written at once through a condensed version of the original code. An example scenario: If you plan to add items to your inventory in a game.. there are usually well over 100 items in any given game, so you'd get 100 lines of code for each item. This can all be made more compact into a simpler version of that code, because items are usually almost always near each other in the memory region.

On a lot of sites you'll also find the so called 'Master' or 'Enable' codes. These are not necessary for PCSX2 and you don't have to add these to your PNACH file. You can recognize these codes by the fact that they commonly start with 9 or F. But it's generally always there in the code description as well.

There's also codes starting with D or E. These types of codes used to not work with PCSX2, but nowadays they work fine. The D-type codes are usually a 'what if' code and are combined with exactly the same code but as a regular code instead, rather than constantly writing a value to an address.

(Example: If my gun only has 1 bullet remaining, go to the next code and use that code, otherwise do nothing.)

Code:
D0005000 0000001
00005000 000000A

So what does this do exactly? As mentioned earlier, this code looks for whether or not you have 1 bullet remaining. If you reach the point where you only have 1 bullet remaining in your gun, it will go to the next code, which is basically where it will write 'A' (10) to the address. This automatically refills your gun to 10 bullets again, essentially causing you to never run out of ammo, nor will you ever have to reload the gun, because it never reaches 0.

These type of codes (as well as the E-Type) codes are also commonly found in Joker codes. Joker codes are basically codes where you have to press a certain button combination to enable/disable the code.


Now most of the time when you're browsing the Internet for cheat codes, you may find some weird looking codes. Common types of codes you'll find are either AR-MAX codes, or Codebreaker (v1 or v7+) codes.

Here's what an AR-MAX code looks like:

Tales of the Abyss - Max Gald
3ZMY-2K0X-XFDBU
U10C-2QXA-AEBRN

The code in that format will NOT work on PCSX2. You will first have to convert it using a tool such as Omniconvert.
This is a tool designed to convert any type of code to a 'standard unencrypted' format that PCSX2 requires.

So when you get a standard unencrypted code (or simply put- raw code) you will have this:
Code:
206D2C10 0098967F

Which then in turn can be used in a PNACH file like this:
patch=1,EE,206D2C10,extended,0098967F

You can find various guides on the forums for further info on converting codes, and some users even made handy tools to do it all for you automatically.


Useful Links:
CodeTwink (NTSC, Codebreaker)
CodeJunkies (NTSC, AR-MAX)
CodeJunkies (PAL, AR-MAX)
PCSX2 Cheat Converter - by fuzzymillipede
Multi Converter / Decrypter / Editor - by vsub (Highly recommended for beginners to PNACH files)
AMD Ryzen 5 3600 @ 3.60~4.20 GHz | Corsair Vengeance LPX 32 GB (2x16GB) DDR4-3200
MSI GeForce GTX 1660 Super @ 6 GB | Samsung 980 1TB | Windows 10 Pro x64 (22H2)
Reply

Sponsored links

#2
This one is also good for beginners if they already have the pnach codes(copy them from here for example)
http://forums.pcsx2.net/Thread-Quick-pnach-tool

You just start the game and the program,paste the pnach codes and the program will create the file with the correct name and extension and in the correct place(depending on which pcsx2 version you are using,portable or installer)

You can also enable/disable all selected codes at once rather than typing // infront of every one you don't want enabled
Reply
#3
Nice one, good job Ryudo.
[Image: XTe1j6J.png]
Gaming Rig: Intel i7 6700k @ 4.8Ghz | GTX 1070 TI | 32GB RAM | 960GB(480GB+480GB RAID0) SSD | 2x 1TB HDD
Reply
#4
Holy ***** Ryudo. +1
[Image: gmYzFII.png]
[Image: dvedn3-5.png]
Reply
#5
(03-09-2016, 05:11 PM)Ryudo Wrote: As mentioned previously in the guide, almost all the codes usually start with either 0, 1, or 2.
It would probably be better to make a clearer distinction between address and code/value, to prevent confusion.
Reply
#6
Good point. Changed that line a bit. Tongue

I tend to use 'codes' most of the time for the entire picture, but it could be mixed up yeah. (Hell sometimes even I myself mix it up when explaining it despite knowing the difference lol)
AMD Ryzen 5 3600 @ 3.60~4.20 GHz | Corsair Vengeance LPX 32 GB (2x16GB) DDR4-3200
MSI GeForce GTX 1660 Super @ 6 GB | Samsung 980 1TB | Windows 10 Pro x64 (22H2)
Reply
#7
So news about PNACH handling.
Since recent PCSX2 v1.5.0(Build 3023) added support of Author line.
so you can add your name like...

Code:
[patch]
author=by Chromaryu
comment=Rearrange EE Instruction
patch=1,EE,0010003A,extended,ff604902
[/patch]

 
This will show Author name to log screen.
Reply
#8
This is a really great tutorial for beginners who needs help with using the widescreen patch/cheats function. I have a question though; since the recent dev builds can now emulate PS1 games, how do I use cheats for these games?
PC Specs:
PC: HP Omen 15 dc-0051nr laptop
CPU: Intel i7-8750H (2.2 GHz up to 4.1 GHz)
RAM: 16 GB
GPU: Nvidia GeForce GTX 1060 Notebook (6 GB)
OS: Windows 10 Pro (64 bit)/Windows 8.1 Pro (64 bit)
Storage: 256 SSD PCi NV M.2+1 TB HDD
Need the latest GIT/development build? Click here!
Reply
#9
I think aside from the address space being different (PS1 games use the IOP as the main CPU, rather than the EE, which becomes a pseudo PS1 GPU emulator), it's still the same basic idea as your typical pnach file.
Reply
#10
Could you give an example of the formatting of the cheats? I would really appreciate it. Also, does PS1 games uses a CRC like the PS2 games does?
PC Specs:
PC: HP Omen 15 dc-0051nr laptop
CPU: Intel i7-8750H (2.2 GHz up to 4.1 GHz)
RAM: 16 GB
GPU: Nvidia GeForce GTX 1060 Notebook (6 GB)
OS: Windows 10 Pro (64 bit)/Windows 8.1 Pro (64 bit)
Storage: 256 SSD PCi NV M.2+1 TB HDD
Need the latest GIT/development build? Click here!
Reply




Users browsing this thread: 1 Guest(s)