Announcement

Collapse
No announcement yet.

How do you EA / No Operation a ram address on snes

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

  • How do you EA / No Operation a ram address on snes

    I have this code I'm trying to make for Secret of Mana but not sure how to Nop ram address

    00940322 JSL
    009404B0
    009405A7
    009406DF
    DFA7B04A LSR
    DFA7B14A
    DFA7B24A puts back what was changed
    DFA7B34A
    DFA7B448 PHA
    DFA7B5C2 REP
    DFA7B620
    DFA7B7A9 LDA
    DFA7B800 ZERO not sure about this part
    DFA7B9EA NOP
    DFA7BAAA TAX
    DFA7BBE2 SEP
    DFA7BCA9 LDA
    DFA7BD00 ZERO
    DFA7BE8F Store Register A 7EE1F1
    DFA7BFF1
    DFA7C0E1
    DFA7C17E
    DFA7C28A TXA
    DFA7C368 Restore Original Value from stack
    DFA7C46B RTL

    I want to Nop / No Operation 7ee1f1 Please help if you can.

    take care

  • #2
    I doubt you can do that to ram unless you nop every ASM instruction writing to it.
    Spoiler Alert! Click to view...

    THE BAD GUY!!!!!!

    Comment


    • #3
      Thanks for your reply Helder

      Comment


      • #4
        If this instruction that you found was in a stack function and you want do a nop on the value of that instruction then just nop it and use the jump instruction to write the previous instruction that you nop because I'm guessing their were values being pass in that instruction then jump back into the stack.

        Comment


        • #5
          Thanks for your reply Professor-X but I'm new to 65816 and don't fully understand what you mean could you please explain again with
          some ASM code. It doesn't have to be real rom addresses for Secret of Mana. take care

          Comment


          • #6
            I'm not sure what kind of instructions they use for that game but if you can google "mips assembly" which is like ASM then you will know what I'm talking about. I'm sure that most games have similar instructions. I'm going to try to make this as simple as possible.

            When I say stack... I mean in mips its a function that calls on another function but in this case we're not going to get in depth with it but most stacks routines allocate data which normally looks something like this...
            addiu sp, sp, -20
            lui a0, $0880
            or a1, $0, a2
            andi a3, $0, $0 // the area you want to nop (to nop an address is all zeros) // 0x00000000
            lw a1, $4000, (a0)
            addiu sp, sp, +20
            Let's say that "andi a3, $0, $0" is what you want to "nop" because you found something that interferes with the game or a change in something. To "nop" an address it's all zero's... But to return the flow of the function we use this "jump" command "j"

            addiu sp, sp, -20
            lui a0, $0880
            or a1, $0, a2
            nop //this is not the best example but lets pretend that you will nop this address
            j $08804008 // use this instruction to jump the new location in memory
            lw a1, $4000, (a0)
            addiu sp, sp, +20
            New Area that "j" is pointing to address $08804008
            andi a3, $0, $0
            j $back to addiu sp, sp, +20
            The jump command will jump to any location you choose it to (memory address) but you will need to pick an area with nops so that you can write your instruction. You will rewrite the same instruction that was "andi a3, $0, $0" into the new area then use the jump instruction in the new location to jump back into the stack to finish the routine because MIPS or ASM works on by reading each instruction at a time. So you will have the jump command to point back to addiu sp, sp, +20 so that it will end the code. If you dont understand I dont mind explaining it in a different way. But I think the biggest help for you will to be to understand the language command instructions for that game. But if its like ASM then you will understand what I'm talking about. Sorry for the late reply. I don't think people read my post on here lol
            Last edited by Professor-X; 06-19-2014, 07:47:10 PM.

            Comment


            • #7
              What you are trying to do is freeze the RAM address. This ASM code looks way too long and wrong.

              This is what you should have done:

              Code:
              $00/9403 22 B0 A7 DF JSL $DFA7B0[$DF:A7B0]   A:0000 X:0000 Y:0000 P:envMXdIZc
              $DF/A7B0 4A          LSR A                   A:0000 X:0000 Y:0000 P:envMXdIZc
              $DF/A7B1 4A          LSR A                   A:0000 X:0000 Y:0000 P:envMXdIZc
              $DF/A7B2 4A          LSR A                   A:0000 X:0000 Y:0000 P:envMXdIZc
              $DF/A7B3 4A          LSR A                   A:0000 X:0000 Y:0000 P:envMXdIZc
              $DF/A7B4 48          PHA                     A:0000 X:0000 Y:0000 P:envMXdIZc
              $DF/A7B5 A9 00       LDA #$00                A:0000 X:0000 Y:0000 P:envMXdIZc
              $DF/A7B7 8F F1 E1 7E STA $7EE1F1[$7E:E1F1]   A:0000 X:0000 Y:0000 P:envMXdIZc
              $DF/A7BB 68          PLA                     A:0000 X:0000 Y:0000 P:envMXdIZc
              $DF/A7BC 6B          RTL                     A:0000 X:0000 Y:0000 P:envMXdIZc
              In this case there is no need to use REP and SEP. The accumulator is in 8 bit mode because bit 5 is set in the status register aka P:envMXdIZc.
              Last edited by nolberto82; 06-19-2014, 08:53:43 PM.

              Comment


              • #8
                Thanks for your reply nolberto82 but this code will Load 00 to ram address 7ee1f1 but not EA / No Operation. take care

                Comment


                • #9
                  Originally posted by xxphillips View Post
                  Thanks for your reply nolberto82 but this code will Load 00 to ram address 7ee1f1 but not EA / No Operation. take care
                  Yes that's what it does. You can't NOP a RAM address unless the game is executing from RAM. To make the game stop manipulating the address you need a break on write.

                  Comment


                  • #10
                    nolberto82 what do you mean by break on write?

                    Comment

                    Working...
                    X