(12-23-2013, 12:17 PM)makotech222 Wrote:(12-23-2013, 04:45 AM)Alicecbw Wrote: New to cwcheats. Still unsure about alot of things, and could use some help
I have this code from TLOH: Trails in the Sky which gives 200 septith
_C0 Orbs [200] (Fixed)
_L 0x003EA4E0 0x000000C8
_L 0x003EA4E4 0x000000C8
_L 0x003EA4E8 0x000000C8
_L 0x003EA4EC 0x000000C8
_L 0x003EA4F0 0x000000C8
_L 0x003EA4F4 0x000000C8
_L 0x003EA4F8 0x000000C8
Now I know the "c8" part of the code makes it 200, but when trying to change it to 300, using "12c", it only uses the "2c" part which sets it to 44. Could anyone advise me how to change it to 300 or higher?
Not possible with that code. The prefix on the address part, 0x00 means its a 8-byte address ( i think) which holds a maximum of 255, or FF
That max value is correct for an 8-bit == 1-byte variable address (not 8-byte), which is what the code prefix 0x0 stands for. Higher values require different code prefixes, and also require that the game really reserves more bytes for those variable addresses.
Here are some useful descriptions of the basic codes used for simple patching of a constant into a variable address. In these examples I'll use the lowercase letters 'a' and 'v' to signify digits of the address and the constant value respectively. These should of course be replaced by hex digits in real usage.
Patch for 1 byte == 8 bits:
_L 0x0aaaaaaa 0x000000vv
Patch for 2 bytes == 16 bits:
_L 0x1aaaaaaa 0x0000vvvv
Patch for 4 bytes == 32 bits:
_L 0x2aaaaaaa 0xvvvvvvvv
So if we apply this knowledge to the first patch line of the original codes:
_L 0x003EA4E0 0x000000C8
This is clearly a 1-byte patch with the decimal value 200.
And for a similar 2-byte patch with the decimal value 300 we then use:
_L 0x103EA4E0 0x0000012C
However, if the game program only has reserved a single byte for that variable, then the high byte of this patch value will not be used for it, and may instead affect another variable using the byte after the variable you intended to patch. So if you increase the affected size of patches this way, then you must be prepared to revert those changes if a test shows that they haven't had the intended effect. Otherwise you may get unexpected errors due to unrelated variables being affected by the high part of those patch values.
Best regards: dlanor

