Devilution: Functions currently marked as bin exact which are not actually binexact

Created on 5 May 2019  路  10Comments  路  Source: diasurgical/devilution

I've skimmed with comparer through files which are marked as bin exact or almost bin exact. These functions happen to be not bin exact:

  • [x] SetAutomapView
  • [x] SpawnUnique
  • [x] GetItemStr
  • [x] AddTorturedBody
  • [x] Obj_Circle
  • [x] ActivateTrapLine
  • [x] OperateL1Door
  • [x] OperateL2Door
  • [x] OperateL3Door
  • [x] ResyncQuests
  • [x] PM_DoDeath
  • [x] mainmenu_create_hero

All 10 comments

keep in mind some functions were only binexact when compiled as C++ and some as C

I doubt that it happened in any of those to be honest.

Nice work going through things and making this list. Did you mention that you created a tool to help with it?

Yeah, but it's rather basic for now and I had to check from file to file which is not super convenient. Basic idea is the following:

  • I go through list in toml
  • Search function is in certain header
  • If it is then run dev. comparer and launch text diff
  • Cut all not needed lines from diff + lines ending with large addresses. Also I skip if there is no deletions in function as a hack to avoid getting diffs for every jump table.
  • If nothing left I print OK otherwise diff

So the straightforawd improvements would be also cut relatively big jumps. Properly cut everything after ret instruction to avoid diffs on jump tables.
And the great improvement would be to parse actual Github issues and check functions which checked in them.

I could share current version but it's a bit of mess with hardcoded windows paths and all 馃槃

DrawSpellList was marked as bin exact, but it's not even cleaned up, I have simply unmarked it (I did give cleaning it a shot but only got 90%).

13 fns is quite a small number given how much changes were accumulated during almost a year!

I do think SpawnHealer and functions behaving in similar manner (if there's any) should have separate issue if they being optimized depending on offsets like described in #957
In current form I wasn't able to get it bin exact to be honest. There's always a chance for it being written slightly differently making it more stable but it may not be easy to figure out.

I think we should wait with it until everything else is cleaned up. For now it can be left as min-diff with a reference to #957

Ok so I'm closing this issue for now. Don't forget to mark SpawnHealer please.
Main purpose was to find bugs, not sure if I found any tbh 馃槄
Hope to make a more complete tool for rechecking in near future.

done

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AJenbo picture AJenbo  路  7Comments

ghost picture ghost  路  7Comments

AJenbo picture AJenbo  路  7Comments

AJenbo picture AJenbo  路  4Comments

AJenbo picture AJenbo  路  8Comments