how can I set breakpoint?

This forum is for posting cheats for any non-arcade game in M.A.M.E. ( aka the M.E.S.S. games ) including any softwarelist game. Requests will be fulfilled here....but please keep the requests to the requests forum.
Post Reply
bshi02
Posts: 5
Joined: Wed Feb 15, 2012 4:10 pm

how can I set breakpoint?

Post by bshi02 »

I found a code address of TG16 games which seems to represent energy gage.
It is real address which contains health because it has same last 3 digit address with code results of Magic-Engine's build-in cheat, and I tried to set breakpoint on this address.
but I have typed "bpset 1F20d2" on debug windows,but It doesn't break at all whensoever character got demaged by enemy in gameplay.
I don't thinks it is wrong address because In mednafen,the address which I found out is "001f00d2" which is very similar to search results of mess's and it really break in mednafen emulator whenever got demaged.

<action>:maincpu.ppb@1F20D2=3F</action>

how can I set breakpoint on above address? (maincpu.ppb@1F20D2)
and what is difference between watchpoint and breakpoint?
and Can I distinguish write and read breakpoint like mednafen emulator when I set breakpoint on certain address?
User avatar
Pugsy
Posts: 3638
Joined: Fri Aug 17, 2001 12:59 am
Location: North Wales, UK.
Has thanked: 1 time
Been thanked: 12 times
Contact:

Re: how can I set breakpoint?

Post by Pugsy »

You place a breakpoint on memory that is executed, ie it contains code that is run. Basically when you put a breakpoint on an address you are basically saying when PC=AN_ADDRESSS break. If an address contains no code a breakpoint on it will have no affect.

You place a watchpoint on memory that is either written or read, so for example if you find a RAM infinite lives address (1F20D2) that you poke with 05 to always have 5 lives you would place a watchpoint on that address that would either break when that address is written or read.

So,

wp 1F20D2,1,w
would break after 1F20D2 has a new value written to it

wp 1F20D2,1,r
would break after 1F20D2 has been read

wp 1F20D2,1,rw
would break after 1F20D2 has a new value written to it OR after 1F20D2 has been read.

TG16/PCE Engine memory can be a bit strange regarding watchpoints though (known MAME bug), so you may need to do something like this:-

wp 0,ffffff,rw,wpaddr==1F20D2
Pugsy

Servicing your cheating needs since 1985 8)

Grab the latest cheat collection:
MAME 0.259 XML cheat collection (6 OCTOBER 2023) from http://www.mamecheat.co.uk or direct from:-
https://mega.nz/file/q4dHGZ6K#i-EUiqIjH ... KMz7hnbTfw (ZIP Archive 3.76MB)
bshi02
Posts: 5
Joined: Wed Feb 15, 2012 4:10 pm

Re: how can I set breakpoint?

Post by bshi02 »

Thanks Pugsy very much for your rapid reply.
My address result(1F20D2) is wrong although I think it is searched using mess's cheat system by right way.
I discovered right energy address from pce.xml file which was included in "MESS TG16 V1.01 Cheat File FOR MESS 0.129" and The right address is not "1F20D2" but "1F00D2".(I can't understand why mess's cheat system can not found right address..)

<cheat desc="-= JACKIE CHAN'S ACTION KUNG FU (U) [H1] =-" />
- <cheat desc="Infinite Energy">
- <script state="run">
<action>main.rb@1F00D2=3F</action>
</script>

I have placed wp on this address(1F00D2) and It really break whenever got damaged.
but I want trace back to origin address where primarily triggered this energy decrease.
Is There any command for dump "flow of code routine" whenever any break occurs? or disassembly option for dissetting code structure?
User avatar
Pugsy
Posts: 3638
Joined: Fri Aug 17, 2001 12:59 am
Location: North Wales, UK.
Has thanked: 1 time
Been thanked: 12 times
Contact:

Re: how can I set breakpoint?

Post by Pugsy »

I think you missed what I said.....as I said above:-
would break after 1F20D2 has a new value written to it
The important word is AFTER.

Pictures speak better than words, so:-

Image
Pugsy

Servicing your cheating needs since 1985 8)

Grab the latest cheat collection:
MAME 0.259 XML cheat collection (6 OCTOBER 2023) from http://www.mamecheat.co.uk or direct from:-
https://mega.nz/file/q4dHGZ6K#i-EUiqIjH ... KMz7hnbTfw (ZIP Archive 3.76MB)
bshi02
Posts: 5
Joined: Wed Feb 15, 2012 4:10 pm

Re: how can I set breakpoint?

Post by bshi02 »

thanks for your detail reply.
As English is not my native language,I have always very terribly difficult in writting in English,so I usually only have writren really necessary sentance and omitted why I need to know flow of the decrease routine which seems to cause misunderstand, I'm sorry for that..
what I really require(search for) is the way to make no flashing(and no cowering if possible.) invincibility for any PCE/PCECD games.(especially shmups ,action genre)
A half years ago, I encountered an pce/tg16 invincibility code for magic engine emulator(Jackie Chan)(INVINCIBILITY 000140:208)which made by VisitntX
It is no flash and no cowering when charactor damaged, I think if I found the way which he use to make this code,I would apply this method to any other pce games, so I have tried to anatomy this code and even to question to other forum(gamehacking) about this problem, but there is no useful answer and eventually,I failed to discover the way he make this code.
http://gamehacking.org/vb/threads/5836- ... de-anatomy
I followed Your guide,but it cannot remove flashing when charactor is damaged by enemys.
Post Reply