Announcement

Collapse
No announcement yet.

[PSX] How to ignore the 2 last digit of the value from 0700?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [PSX] How to ignore the 2 last digit of the value from 0700?

    Hi, i'm new to make gameshark cheat. I was able to make some PSX cheat successfully, but there's a problem i have with a cheat, and i would appreciate if someone could help me to find something to fix it. The game is Dragonheart on PSX.

    My cheat is 800858AC 0700 (it's an infinite life cheat that freeze the number of remaining life to 7)
    Basically, 0858AC is the address that point to what i want to change, but the problem is with the value 0700.
    07 makes me have always 7 lifes, but the last 00 makes me unable to switch to my other arrows type at value 01, 02, 03, and 04. I'm stuck with the regular arrows for my bow at the value 00, or if i change it to 01 i'm stuck with another arrow type at the value 01 etc...
    So the problem is that 0858AC is seemingly linked to 2 differents things in the game;;; the number of remaining life, and the arrow type i'm using with my bow.

    After searching on internet, i found that if i change the 80 at the beggining of the cheat to 30, it would ignore the 07, but i didn't tried it because i want the opposite, i would like to ignore the 00 at the end.

    My goal is to have 7 infinite lifes, and still be able to switch between all my arrows type. Is there a way i can make it? Maybe something different than 80 or 30 at the beginning of the cheat would do it, or something else i don't know at the moment cause i'm still a beginner.

  • #2
    I think what you're looking for is 300858AC 0007. That should write 0x07 to AC, and leave AD (your arrows type) alone. with the 0x30 type, you are only writing 8 bits instead of 16.

    800858AC 0700 = write 0x0700 to 800858AC
    300858AC 0007 = write 0x07 to 800858AC
    Please put all complaints in writing and submit them here.

    Above link not working? Try here.

    Comment


    • #3
      Well, here's what you're missing. The address 0x800858AC, because of how it's aligned, can be used to access integer variables 1 byte (8-bits), 2 bytes (16-bits) or 4 bytes (32-bits) in size. An integer just being the same as you heard in math class, i.e. a whole number).

      It's down to the command used to determine how much is written where. You've elected to overwrite a value that's only 8-bits with a 16-bit write command, and it causes side effects by overwriting an adjacent variable. What you should be doing is only writing the byte you need, and you won't need to "ignore" the right-most (least significant) positions of the value, because the cheat engine only uses those two positions on a one-byte write.

      The PS is little-endian—meaning that values occupying more than one byte have their bytes stored from least to most significant in ascending memory locations. So for your code the memory looks like this:
      800858AC 00 - Arrow type
      800858AD 07 - Lives

      Let's just hypothetically say that:
      800858AE 0F - Number of arrows
      800858AF 09 - Number of bombs

      If I accessed 0x800858AC as a fullword (4 bytes), the value retrieved would be 0x090F0700. Cheat engines for the original PS don't do 32-bit values, so this is just an example. Retrieving that address as a halfword (2 bytes) is the 0x0700 you're already working with, and referencing it as a byte gets 0x00. If we moved up, you could get 0x800858AE as a halfword, and that would be pulled as 0x090F. Put simply the bytes in memory are in the opposite order to how they're presented.

      You can't reference 0x800858AE as a fullword because it's not fullword aligned. The address must end in 0, 4, 8, or C for fullwords; 0 or any even value for halfwords; and the address can be anything for a byte.

      Anyway, a bit of a long trip, but what you're looking for is 300858AD 0007. It'll overwrite the single byte that represents lives with 7.

      Comment


      • #4
        Originally posted by Pyriel View Post
        The PS is little-endian—meaning that values occupying more than one byte have their bytes stored from least to most significant in ascending memory locations. So for your code the memory looks like this:
        800858AC 00 - Arrow type
        800858AD 07 - Lives
        Forgot about that tidbit for psx, as I often do. Thanks, Pyriel.
        Please put all complaints in writing and submit them here.

        Above link not working? Try here.

        Comment

        Working...
        X