If I intend to add more TMs, then I need to be able to add more items. Not only does this require updating the number of items, but I also have to update the number of item images (still never found the item images in Ruby/Sapphire...). But that's not all! We also need to update the code that refers to the number of items that we have. So here's a quick-edit aciton that updates code referring to the number of items.
There is now a quick-edit item for allowing the tm compatibility code to expand correctly with the tm compatibility table. Emerald still needs more updates, but before that we should test the current implementation with FireRed.
* require more space between runs when moving data. The number before was short enough to give false positives: areas that look free but are not.
* fix the calculation error that was causing bit-array extension to not get moved when it should.
* Notify QuickEdits when the tab changes
* `MakeTutorsExpandable` correctly identifies when it's already been run on a file.
* QuickEdits notify when their runnability changes
* dependent tables were not being moved when they should be.
* PLMRuns were not being deserialized correctly.
* Adding a brand-new pointer location into a table with nested formats didn't work.
Introduce the concept of quick-edits in the editor. These are often-wanted mini-patches that HexManiac has built-in. An example of a use case: decapitalization.
Since I expect that many users will want to expand tutors, and I'm focusing on pokemon moves right now, making tutors expandable is the first quick-edit I've implemented. This change shows includes AutoSearchTests.ExpandableTutorsWorks, which roughly shows how the UI will use this quick edit.
WordRuns, like PointerRuns, can live anywhere in the file and don't require anchors to them. Instead of needing an anchor to them, they specify the name of a table that they are matched to. Whenever that table's length changes, the WordRun's value is automatically updated to match the table length.
Since runs can live forever in the undo/redo stack, having caches owned by runs mean that the caches can live for forever too.
Now that I have a better method of creating scope-limited caches, go ahead and switch to using those for EggMoveRuns and ArrayRuns, runs that had previously owned their own caches.
Looking through Gaia, found some interactions that didn't quite work as expected. Fixed them.
I've decided that supporting Gaia's method of doing move tutors would be overstepping my bounds. You can totally support them with some manual format inclusions, but doing that automatically would be outside the scope of the purpose of the search algorithm, since Gaia does something rather custom that I don't currently see being done anywhere else, and I don't know what tool did it. It might be custom work specific for Gaia.
Search Results headers were getting truncated because of the new logic to draw most data formats extremely quickly. Switching it to use a different data format that doesn't get the fast-draw treatment, so that it still looks correct.
almost all thumb instructions are 2 bytes wide. But bl is 4 bytes wide. The first two bytes include the high half of where to jump, and the next two bytes contain the low half of where to jump. But when loading all 4 bytes at once, this gets reversed. bl allows you to jump to functions 22-bits away. (x*2+4 from current address, where x is a 22 bit signed int).
* push lists are the opposite order from pop lists
* if there's a 'push lr' command, that's an interesting address
* bl and blx commands have interesting stuff after them, so don't count those as range-enders
* show code even if the selection is backwards (end-to-start)
Not everything should be disassembled as code. If something tells me that it's loading a word from a given address (ldr), I know that the stuff there is data instead of code. So I should show it as such.
Not everything should be disassembled as code. If I read the code "b", "bx", "bl", or "pop pc", then I know that the bytes after it aren't code until something jumps to it. Go ahead and use this knowledge to stop showing code at that point.
Make it possible to scroll / copy from the code tool.