----- re: Use of Widescreen cheat patches on real PS2 consoles
(08-31-2012, 07:59 PM)No.47 Wrote: Yes, we're already doing this for months at psx-scene ( http://psx-scene.com/forums/official-ps2...cks-forum/ ) - thanks anyway!
I guess I should start visiting there again, but my free time is limited...
Quote:That's strange, I used the format 'word' for all my patches ( http://forums.pcsx2.net/Thread-PCSX2-Wid...#pid221642 ) and it worked as well.
I inspected some of them and noted that you used the address form 20xxxxxx, which I think is incorrect, though it may have worked anyway. It is only in the 'extended' format that the first two digits of the address denote normal PS2 cheat code operations (like 8-bit store, 16-bit store, 32-bit store, etc).
For the other pnach formats the first digit of the address denotes an addressing range, not the storage size, with the format specifier word denoting the storage size (or so I think anyway). This usage has nothing to do with normal cheat codes, and I'm not at all well informed on this subject. I'm not even sure if it is 100% PCSX2 specific, or some standard adopted from other PC-based projects.
Quote:Of course you need a working mastercode as you said.
For most cases that is not needed with PCSX2, since the patches are not applied until after the main ELF has been loaded. But there are cases where a game switches between different ELFs during gameplay (often for internal mini-games of some kind). For these cases some form of mastercode usage might be needed, though I'm not sure how such are implemented for pnach use.
Quote:I don't know much about the PNACH code formats (did a quick search back then and didn't find anything useful, so I went with what worked ). When should we use 'word' and when 'extended', and are there other formats we need to consider?
You should definitely use 'extended' if/when importing 'raw' cheat codes as used on a PS2. You can then use both address and data values exactly as-is, with the same result as in a PS2 cheat engine. (At least for cheat code operations supported by PCSX2)
Quote:Did I understand you correctly that what PS2 cheat engines use always complies with the 'extended' format?
Assuming you refer only to the 'raw' cheat code format then yes, those hex values are directly usable in pnach 'extended' format patches, except for such cheat code operations that PCSX2 doesn't support.
Another important consideration is that a PS2 cheat engine repeats its patching in an endless cycle, which allows 'joker' codes to modify patches at run-time without interrupting the game session, and that is apparently not possible with PCSX2, which applies its pnach patches only when starting a game or when resuming it after breaking with 'Escape' key.
Quote:Another question: Some of the games I patched store their FOV values in the dynamic memory range (3xxxxxxx). That makes PNACH patches / CB cheats impossible, doesn't it?
Not completely impossible, as any address that the PS2 program can reach with a storage operation can also be addressed by a cheat code. But this 3xxxxxxx address range is to my knowledge NOT a normal PS2 address at all, but a PCSX2-specific address, and I'm not sure how to associate between this address form, and the PS2 address you would need to use in a cheat code.
Also, even if we stay completely within the PS2 'universe', it is always a problem to determine the run-time location of a variable defined not for a static address, but through an offset from some base address derived at run-time by some malloc operation. Even on a PS2 it is possible for such an address to vary between game sessions, depending on what buffer RAM was already allocated at the time of the relevant malloc (hence it can depend on timing relative to I/O buffering etc).
For such cases it may not be possible to patch the variable itself reliably, and then it is better to search for the opcodes that use this variable, and modify those, as they will normally reside at static ELF addresses.
Quote:(As you can see I provided ELF/ISO edits in those cases, but I would prefer cheat codes.)
And that is an ideal case for using ps2dis, where you can search for the hex sequences in the ELF file, identify the values that need to be patched (often 16-bit argument constants to 'lui' or 'li' opcodes), and manually generate the cheat codes needed.
That is in fact exactly how I started for most of the pnach files I've posted, though I also followed up with additional ELF analysis to find more patch alternatives.
Quote:Sorry for all those questions
The main purpose of a thread like this is to share knowledge on the given topic, so there's no need for excuses.
I'm just happy if I can help!
Best regards: dlanor