Import / Export Current Active Disassembly State

Official support forum for the Exodus Emulation Platform

Moderator: Nemesis

Post Reply
User avatar
ryanfaescotland
Interested
Posts: 22
Joined: Mon Feb 09, 2015 10:46 pm
Contact:

Import / Export Current Active Disassembly State

Post by ryanfaescotland » Wed Nov 09, 2016 7:30 pm

I've just returned to Exodus after having it recommended to me by someone who has created 10+ Megadrive disassemblies. I'm really liking the active disassembly feature and am getting great results with it. I'm finding 2 issues though:

1) It occasionally crashes during analysis, losing all recorded items.
2) For best results you should execute all code in the game. This can be pretty time consuming and can't always be done in 1 sitting if you have Real Life (tm) to attend to.

So I was thinking it would be pretty handy to be able to export and import the current state, perhaps creating a savestate at the same time so you can pick up where you left off. Once in an auto save feature would also be pretty good for those times it does crash (however if the crash is caused by the data this might not be so handy since you'd end up loading it in again!)

So I'm going to go try add these things in but I thought I'd post up about it first to see if it is something already planned / implemented for the next version or if there is any reason this isn't possible?

User avatar
Nemesis
Very interested
Posts: 670
Joined: Wed Nov 07, 2007 1:09 am
Location: Sydney, Australia

Re: Import / Export Current Active Disassembly State

Post by Nemesis » Tue Nov 15, 2016 8:25 am

I'm glad you're finding the active disassembly feature useful, it's something I'm particularly proud of. Back in the mid 2000's I created the first clean disassembly of Sonic 2 using a quick and dirty hack of Gens, followed by a solid month of clean-up work in IDA Pro defining pointers and relative offsets, disassembling unexplored areas, filling out unused entries in "jump tables", and so on. I built this feature to do in an hour what took me a month, and in the end I achieved that, using Sonic 2 as a primary test case (with plenty of other games tested along the way). I was able to do a thorough playthrough and capture enough data to get a disassembly which was as good as the one I spent so long working on.

You'll be happy to know, because I built this feature with experience, I've also already implemented the very feature you're asking about! :) Under the "File" menu, you'll see "Load Debug State" and "Save Debug State" options. These features are there to support a totally different kind of savestate, one which instead of doing a snapshot of the current program state, does a snapshot of all debug settings, such as watchpoints, breakpoints, and even active disassembly state. If you use this feature, you can snapshot your active disassembly progress. I'd suggest pausing emulation first and creating both a regular savestate and a debug savestate together, and if you need to load, load them both together. That'll allow you to continue from exactly where you were up to in the disassembly process. You can use the hotkeys to make this take only a few seconds. Oh, and a protip: turn off throttling (F9), so the game runs as fast as it can. The faster you can race through the game, the quicker you can build your capture log. Also, use any "level select" features the game might have. You can load a savestate without loading the debug state as well, meaning you can play bits of levels and keep on quickly jumping back to the level select once you think you've captured enough data, folding all that information together into one capture session.

In terms of the crashing you mentioned, could you check if any crash reports got generated under the "Crash Reports" folder in the Exodus directory? If you've got a crash report, I should be able to use it to determine why the crash occurred, and hopefully correct the issue.

User avatar
ryanfaescotland
Interested
Posts: 22
Joined: Mon Feb 09, 2015 10:46 pm
Contact:

Re: Import / Export Current Active Disassembly State

Post by ryanfaescotland » Sun Nov 20, 2016 5:23 pm

That's great to know Nemesis, thanks for taking the time to reply.

I'm now using my own build of Exodus rather than the pre-built one you supply. My aim was to find what was causing the crash and attempt to fix it however it hasn't happened again since so perhaps it was a fluke or perhaps I just haven't pushed the emu hard enough again. I'll see if I can find where the crash report would have ended up and send it across soon.

I'm really keen to have this autosave feature before I start playing through checking if it crashes again, that way if it does I won't lose the progress made. Thankfully with what you have told me it doesn't sound like it would take too long to implement. I've already added some buttons onto the active disassembly screen to manually complete the process:

Image

So I've moved some things around a little and added a Save and Load button. These aren't coded up yet but will go through the steps you have described:
  • Pause the emu (if it isn't already)
  • Create the debug state save
  • Create the normal save state
  • Unpause the emu (if it was unpaused previously)
Once this is in place I can add functionality to do this automatically every N minutes or so (will need to see what the delay is like when doing it, maybe add some warning that it is about to happen).

What do you think, a welcome addition or unnecessary clutter? (Keeping in mind this is just me getting my teeth cut with the code as well ;) )

ehw
Newbie
Posts: 3
Joined: Fri Nov 06, 2015 2:13 am

Re: Import / Export Current Active Disassembly State

Post by ehw » Mon Dec 12, 2016 7:32 pm

I experience crashes with the active disassembly upon analysis as well. I find that if you disable ""Detect Offset arrays"" it seems to solve the problem.

I hope you pick up Exodus again soon, Nemesis. The active disassembler is my favorite feature, so I hope you spend more time to flesh it out in the future (like support for data that's parsed by the Z80, since games like Quackshot and Castle of Illusion use it for the sound data). :)

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests