Page 1 of 1

[ssf2t] how to make a Breakpoint debug cheat work with xml?

Posted: Fri Aug 14, 2020 11:21 am
by rabbyzero
I have following breakpoint code.

Code: Select all

bp 470e,,{b@ff84b6=2;b@ff84b8=1;g}
Which means I will change 0xFF84B6 and 0xFF84B8 value when code at 0x470E (PC = 0x470E) will be excuted.

If it is made as a regular "run" cheat.

Code: Select all

<cheat desc="P1 Infinite throw range"><comment>bp 470e,,{b@ff84b6=2;b@ff84b8=1;g}</comment>
    <script state="run">
      <action>maincpu.pb@FF84b6=2</action>
      <action>maincpu.pb@FF84b8=1</action>
    </script>
  </cheat>
It will not work. because mame cheat engine will update the data every frame and the data is reloaded and evaluated before frame update.

I know I can modify the code near 0x470E to achieve this. But are there any easier way to go?

Re: [ssf2t] how to make a Breakpoint debug cheat work with xml?

Posted: Fri Aug 14, 2020 11:24 am
by rabbyzero
To make the question more general, is there any way to make a cheat work if the data will be modified and used in same frame? Or how to prevent data change?

Re: [ssf2t] how to make a Breakpoint debug cheat work with xml?

Posted: Sat Aug 15, 2020 12:48 am
by crazyc
The lua cheat engine supports breakpoints (https://github.com/mamedev/mame/blob/b2 ... it.lua#L63 https://github.com/mamedev/mame/blob/b2 ... t.lua#L295) with 2 caveats 1. the debugger must be enabled, even "-debug -debugger none" good enough 2. it's mostly unused so far so I can't guarantee it'll work in your case (bug reports and code fixes welcome).

Re: [ssf2t] how to make a Breakpoint debug cheat work with xml?

Posted: Tue Aug 18, 2020 6:29 pm
by rabbyzero
This is insane. Do you have an example? What is the syntax?
For example. How to set "bp 470e,,{b@ff84b6=2;b@ff84b8=1;g}" ?

Re: [ssf2t] how to make a Breakpoint debug cheat work with xml?

Posted: Wed Aug 19, 2020 2:00 am
by crazyc

Code: Select all

[{
    "script":{
      "on":"maincpu.bpset(0x470e, function() cpup:write_u8(0xff84b6, 2) cpup:write_u8(0xff84b8, 1) end)"
      "off":""
    },
    "desc":"P1 Infinite throw range",
    "space":{
      "cpup":{
        "type":"program",
        "tag":":maincpu"
      }
    },
    "cpu":{
      "maincpu":":maincpu"
    }
}]

Re: [ssf2t] how to make a Breakpoint debug cheat work with xml?

Posted: Wed Aug 19, 2020 10:51 am
by rabbyzero
wooo!
It is crazy. Thanks. I will make good use of it. It is much easier than asm code modification.