Announcement

Collapse
No announcement yet.

[PSX] Vigilante 8: 2nd Offense - Question

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

  • [PSX] Vigilante 8: 2nd Offense - Question

    Hey!

    I want to write a little cheat code to be able to battle Hotrod vehicles instead of normal ones and preferably be able to switch Hotrod on and off.

    I figured out joker command offset, and memory byte needed to be modified to enable Hotrods.

    The idea is pretty simple. There are 4 enemy slots. Each slot is 1 byte in memory.
    0x00-0x11 - 18 normal vehicles, 0x15-0x26 - 18 Hotrod vehicles.
    HOTROD_HEX = NORMAL_HEX + 0x15

    My original idea was to have 4 different button combos to enable Hotrod vehicles in every slot separately.
    Player choose vehicles in slots, pressed combos to swap normal vehicles to Hotrods in desired slots and presses X to start a game.

    I wanted to get code that acts somewhat like this:

    D0XXXXXX 0104 - check if buttons are pressed
    E2XXXXXX 0012 - check if value in slot is less than 12
    20XXXXXX 0015 - add 0x15 to that slot

    As far as I can tell I can't use more than 2 activator in a row (I tried it with 2 different emulators, they both crashed). The problem is that I can't just write constantly to the memory because I want to be able change vehicles in slots when cheat code is active (activate Hotrods only when certain buttons are pressed).

    How can one implement something like this? (use 2 activators in a cheat code)

  • #2
    I don't know what system you're talking about, but with those older cheat engines, an issue you'll have is the lack of a line count in conditionals. If there's no field allocated to how many lines should be skipped/executed, and no sort of "end-if" token, then nesting likely isn't possible. (And the end-if style only came along around the Wii era.) The first conditional will always skip exactly one line, so the only way the second conditional will come into play is if you're holding the buttons in the first place. Otherwise, the constant write will always be executed.

    Assuming there are no line counts, arguably the best way to do this is by modifying code, probably through the insertion of your own subroutine.

    If you don't have the know-how for that, or you just want a quick and dirty solution, you could appropriate a properly aligned 16-bit value in memory and use it as flags. Provided you only have two conditions to check anyway.
    Code:
    D0XXXXXX 0104 - check if buttons are pressed
    30FFFFFB 0001 - 8-Bit write 1 to the least significant flag byte.
    D1XXXXXX 0104 - check if buttons are not pressed
    30FFFFFB 0000 - 8-Bit write 0 to the least significant flag byte.
    E2XXXXXX 0012 - check if value in slot is less than 12
    30FFFFFA 0001 - 8-Bit write 1 to the most significant flag byte.
    E3XXXXXX 0011 - check if value in slot is greater than or equal to 12
    30FFFFFA 0000 - 8-Bit write 0 to the most significant flag byte.
    D0FFFFFB 0101 - Were both conditions simultaneously true?
    20XXXXXX 0015 - add 0x15 to that slot
    As an addendum, I'd definitely advise the assembler/subroutine approach if possible. It seems like you'd need more checks for this to really work well. For instance, you say 0 in a slot is a valid value for a vehicle. If that's true, then is no vehicle just garbage, -1, given by a count, what? If 0 is "nothing", as is typical, then I wonder if that isn't part of the problem. It's not unheard of for games in this era to only cache resources when needed, and then only at fixed times. Unlike more modern games that might be able to cope with a new type of object being inserted mysteriously, these games can crash because you have to call the proper routines to ensure everything is loaded, if the item isn't going into inventory via some anticipated route.
    Last edited by Pyriel; 09-11-2017, 10:24:21 AM.

    Comment


    • #3
      Hi, Pyriel!

      Sorry, forgot to mention that. I am talking about Vigilante 8: 2nd Offense game on PSX. On console I would use GameShark v5 disc to launch game with cheats enabled and I use emulators just for testing.

      Does the code you provided ensures that 0x15 is added to the memory byte only once? For example, if player holds buttons for too long etc. If understand it correctly the cheat code executes as a whole, so those E2/E3 check should prevent that from happening in theory.

      I definitely will try to disasseble game code and modify it in the futute, I just wanted to test the concept of the idea with a cheat code.

      Comment


      • #4
        It should more or less replicate what you were doing. It just keeps constantly setting or unsetting the flags according to your original conditions. If the button mask is right and the value in the address is less than 0x12, the 16-bit flag value would be 0x0101. If either ceases to be true, the flag is unset on the next pass through the cheats, before the flags themselves are checked prior to incrementing. Now, in PSX land there is some settle time for memory operations, and it does dirty reads rather than stalling, but the settle time is about one clock cycle, if memory serves. It shouldn't be an issue.

        Comment


        • #5
          Wouldn't be easier to set the slot values with an absolute value after the button is pressed?

          RIP MOM 6-27-52 - 12-25-10

          Comment


          • #6
            It sounded to me like he wanted the player to be able to put a vehicle in the slot, and then upgrade whatever it is to its hot-rod version.

            Comment


            • #7
              That's right. Besides there are 18 different vehicles thus 18 different values to check. Increasing slot value by 0x15 is uncoditional solution to upgrading that slot.

              Comment

              Working...
              X