Help with Steem Debugger

A forum for anything about the Steem Engine STE emulator, comments, problems, bug reports etc. Steven Seagal regularly provides updated versions of the original STEem code. The current version is v3.9.4.

Moderators: Mug UK, Steem Authors, Moderator Team

Post Reply
User avatar
TheNameOfTheGame
Atari God
Atari God
Posts: 1409
Joined: Mon Jul 23, 2012 8:57 pm
Location: Almost Heaven, West Virginia

Help with Steem Debugger

Post by TheNameOfTheGame »

Is there a way to use the Steem debugger to trigger when a menu item is selected in a GEM application?

I would like to see the code that is run when the item is selected. Thanks for any help.

ThorstenOtto
Atari God
Atari God
Posts: 1074
Joined: Sun Aug 03, 2014 5:54 pm

Re: Help with Steem Debugger

Post by ThorstenOtto »

TheNameOfTheGame wrote:
Sun Jun 28, 2020 2:05 pm
I would like to see the code that is run when the item is selected. Thanks for any help.
Why not look at the source? ;)

Basically, that is this code. It is almost identical to the one in TOS. That code is run by the SCRENMGR, which is (from AES point of view) a separate application.

User avatar
mfro
Atari Super Hero
Atari Super Hero
Posts: 842
Joined: Thu Aug 02, 2012 10:33 am
Location: SW Germany

Re: Help with Steem Debugger

Post by mfro »

ThorstenOtto wrote:
Sun Jun 28, 2020 3:38 pm
TheNameOfTheGame wrote:
Sun Jun 28, 2020 2:05 pm
I would like to see the code that is run when the item is selected. Thanks for any help.
Why not look at the source? ;)

Basically, that is this code. It is almost identical to the one in TOS. That code is run by the SCRENMGR, which is (from AES point of view) a separate application.
I don't think that's what he's asking for. What you have shown is the menu handling code. What he want's to see (as far as I understand) is the event handling code in the application?


@TheNameOfTheGame If you click on a menu item, an event gets created. The AES will send this event to the running application which will (in its event handler) decide what to do with it.

If you manage to find where in your application the AES function evnt_multi() (this is typically at the start of the event handler/dispatcher in most GEM applications) is called, you'll probably find afterwards the code that gets executed on menu clicks.

ThorstenOtto
Atari God
Atari God
Posts: 1074
Joined: Sun Aug 03, 2014 5:54 pm

Re: Help with Steem Debugger

Post by ThorstenOtto »

Ok, might have misunderstood that ;)

If that is what you are calling for: that will largely depend on the application, so i doubt there is any way in steem to automatically set a breakpoint there. Only thing that might be possible is to catch the evnt_multi() call, and then trace and analyze whatever code is executed afterwards. but that may become quite complicated, depending on the application. Maybe that event is handled in the function that calls evnt_multi(), maybe it is handled somewhere else.

Typically, simple programs basically look like this:

Code: Select all

events = evnt_multi(...);
if (events & MU_BUTTON)
    handle_button();
if (events & MU_MESAG)
    handle_message(msg);
...

void handle_message(int *msg)
{
	switch (msg[0])
	{
	case MN_SELECTED:
		handle_menu(msg[4]);
		menu_tnormal(menu, msg[3], 1);
		break;
		...
	}
}
But that handle_message() function might not be a separate function, or inlined by gcc into the event loop.

When using ACSpro or some other library, things may get much more complicated. Typically, you will then have to register a callback function first, which is then called by the event loop somewhere.

User avatar
TheNameOfTheGame
Atari God
Atari God
Posts: 1409
Joined: Mon Jul 23, 2012 8:57 pm
Location: Almost Heaven, West Virginia

Re: Help with Steem Debugger

Post by TheNameOfTheGame »

Thank guys, I think evnt_multi is the best way to try to find the code.

ThorstenOtto
Atari God
Atari God
Posts: 1074
Joined: Sun Aug 03, 2014 5:54 pm

Re: Help with Steem Debugger

Post by ThorstenOtto »

Maybe tracking menu_tnormal() will also help.

If the program was compiled by Pure-C and is not extraordinarily large, it may also be easier to just disassemble the whole program, try to identify the evnt_multi() library function, and then check where it is called.

Post Reply

Return to “Steem”