Lots of people use CFRU. I don't really want to support it, but it's going to be a while before I have anything even slightly capable of replacing it. I should do some basic checks to detect it and include some code to handle certain things it changes.
Change the paradigm: instead of saying "final write + offset = destination", say "destination + offset = final write". This means that you can write things like <data.moves.stats.battle+4>, which will resolve in bytes to the pointer + 4, while resolving as a pointer to the move stats.
* Show "Edit" next to goto, to give people an idea for how to get back.
* Show a commit button
* Animate the blur / background to make it less jarring
* Close button
* Improve visibility of start token buttons
* Default text when empty
* Rename data.trainer.stats to data.trainers.stats for consistency
The list of tables is getting crazy, and I keep adding more.
* Don't show tables in the table list if they're 'matched length' tables. Example, level-up moves. These are already accessible because the table tool uses matched-length tokens to show multiple tables in the tool at once, to make editing data easier.
* Split the tables between two lists: a header (containing up to two tokens) and a body (containing the rest). This should allow for progressive disclosure, to help make the list more manageable.
Does Enumerable.Range(0, n) in a more compact way.
It's a thing that we need to type a lot.
Also add a new test that captures a problem parsing Overworlds in FireRed
Named bytes can provide an easy way to edit code by marking the purpose of specific bytes in the ROM. It can also help keep the values properly in sync.
The only reason we can find these is because we have a pointer to the table. So make sure that these pointers are properly recognized. They used to be, but it broke sometime when working on table expansion.
Related: When relocating a table for expansion, make sure there's enough room for all the extra elements, not just one.
Also, when checking for whether or not we need to seek for pointers, don't seek if the incoming run already has pointers attached.
moveeffects -> scripts.moves.effects
There was some special logic to deal with having a table that is the same name as a list. These are no longer the same name, but we still want the name to apply. So instead, we now have the table's length based on the length of the list.
the movement enum is different between FR/LG and R/S/E.
To support this, add default.*.toml files which include extra defaults specific to one or more games. Right now, only a single list is there. But this feature should allow for more interesting game-specific defaults in the future.
For some roms, the sprites load at the wrong length. When the proper length is later discovered, it's important to update the length of all related tables, not just the current table.
* Emerald had the wrong pointers/length for trainer sprites
Instead of keeping tables segregated from other kinds of runs that we want found automatically, just allow all types of runs in the tables file.
Combine the typechart runs into a single run, which makes the chart easier to work with.
Previously, the creating a new ViewPort loaded from 2 text files and creating a new HardcodeTablesMoel loaded from 1 text file. This is a lot of parsing!
Refactor to do the parsing once, in the EditorViewModel, using a Singleton class to hold the non-editable loaded data. Inject that data into the appropriate structers later on.
To prevent massive refactoring in the tests, not every ViewPort needs to be given a Singletons instance. Instead, allow a ViewPort to still do its own parsing. However, BaseViewModelTestClass has been updated to make this work for a majority of tests, along with changes to AutoSearchTests's fixture and several of the Setup methods that are used by multiple tests.
- Remove AutoSearchModel. We're not using it anymore. Move its constants to HardcodeTablesModel.
- Move constants from EggMoveRun to HardcodeTablesModel. Should've done this a while ago.
Other things should probably be in this reference file too, such as the headers, streams, and default lists. But this is a good start and should make it more expandable in the future.
Each of Ruby/Sapphire/FireRed/LeafGreen has a 1.1 version as well as the 1.0 version floating around online of the English GBA rom. I should be able to tell the difference between the two versions and load tables correctly.
This refactor makes it possible to tell the difference. Loading the tables correctly is coming next.
in thumb code, branch-link commands are relative. That means that the instruction for the same destination will look different depending on the source.
As a user, I want to know what thumb code calls a routine I'm looking at. That's most likely going to be via a branch-link command, although it could be through a blx. Let the user use Find -> "bl <someaddress>" to search for branch-links that jump to a given location.
* Added some default lists
* Lists are loaded/saved with the TOML file
* Tests showing that lists work right.
Lists can be used as text displays for enums/bit arrays. The difference is that lists aren't sourced from the ROM.
In FR/LG, there's a limiter built into special 397 (the move tutor special) that makes it behave differently after the element 14 (0-14 act one way, 15+ act a different way). I added a one-byte change to switch the branch condition to 'never'.
In order to do this, I needed to locate the special list, so I went ahead and added it to all the games, complete with a unit test to verify.
The specials table + Clover exposed a bug: when adding anchors from a table with an unknown pointer format, we need to clear the data of existing conflicting runs. Example: a text run that goes over the anchor isn't actually a text run.