Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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.

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]
comment=Patch by Ryudo

//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.
0: Activates once 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)
Intel Core i5-4670K @ 3.40GHz | 16GB (2x8GB) DDR3-1866 G.SKILL Sniper Series
AMD Radeon R9 280 @ 3 GB | 120GB SSD | Windows 7 Ultimate x64 (SP1)
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: vwah44]
Gaming: Intel i7 3770k @ 4.2Ghz | R9 290 | 16GB RAM | 480GB(240GB+240GB RAID0) SSD | 3 TB HDD | 1 TB HDD | 500GB HDD
Server: AMD FX 6300 @ 4.4Ghz | GTX 670 | 16GB RAM | 240GB SSD | 320GB HDD
PCSX2 General Troubleshooting FAQ
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)
Intel Core i5-4670K @ 3.40GHz | 16GB (2x8GB) DDR3-1866 G.SKILL Sniper Series
AMD Radeon R9 280 @ 3 GB | 120GB SSD | Windows 7 Ultimate x64 (SP1)
Reply




Users browsing this thread: 1 Guest(s)