Commit Graph

82 Commits

Author SHA1 Message Date
Benjamin Popp
ad8d2b4d6b Change the way initialization works / add pokemon icons to trainer team streams.
Initialization happens on a background thread. We want to be able to run commands when initialization is complete. The way this was done before wasn't very thread safe. The new version will always run the command.
* If initialization is complete, it runs the command right away.
* If initialization is not complete, it defers execution until initialization is done.
* Initialization is measured in scopes. An inner scope will not run initialization work when it's done, since there's still more initialization work that needs to be completed.
* Things like "goto" will now defer execution until initialization is complete. For most users, this won't matter. For speed users, it means that goto will now work the way they expect.

Streams now have the ability to express a "visualization" of the stream, which is a list of PixelViewModels. The table tool will display those in the background of the textbox, over to the right.
2021-02-26 09:14:19 -06:00
Benjamin Popp
05487290c4 Add FreeSpaceBuffer to TOML file
Users have requested the ability to control how much space is skipped between runs. Right now, the default in 0x100 bytes. But this means that data ends up getting rather spaced out, in a way that may be undesirable.

Users can now adjust the spacing used when data auto-moves.
2021-02-12 23:09:45 -06:00
Benjamin Popp
784339cb3d Plumbing for constantReference file
As I add more constants, it becomes apparent that I need a more condensed format for adding these. This won't make it much easier to add, but it will make it easier to see.
2020-12-29 10:34:00 -06:00
Benjamin Popp
ec03525442 Fix a debug only crash. In the case it found, it shouldn't crash, but should instead assert. 2020-12-26 22:58:19 -06:00
Benjamin Popp
f511d979f7 Improve initial loading logic
HardCodeTablesModel can make a table too long, and then fix it later by making it shorter. If this happens, any 'inner pointers' need to be converted to individual runs.
* Clear the format before adding the new NoInfoRun, because otherwise we have a temporary run conflict.
* Grab the array name before doing the negative append, since the array name might be cleared during that step.
* Improve Debug Asserts to give better messages.
2020-12-26 20:35:14 -06:00
Benjamin Popp
02a2bc1958 bugfix: avoid multithreading
If we're a subclass of pokemon model, expect the subclass to call Initialize when it's ready.
2020-12-21 17:06:46 -06:00
Benjamin Popp
c8cf03f1b5 Limit pointer validation to applied anchors
Only check that an anchor has pointers if that anchor was applied with no error.
2020-12-18 23:19:20 -06:00
Benjamin Popp
98a498b939 CFRU has jambo hack by default 2020-12-15 21:22:17 -06:00
Benjamin Popp
7cb0017ed8 Add special case for CFRU
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.
2020-12-15 20:43:26 -06:00
Benjamin Popp
1ade3ab61f Update table name constants in code 2020-11-12 09:52:10 -06:00
Benjamin Popp
2bf3792b2f Implement multi-page sprite import
Import now works for wide/tall images, where all the pages of an image are stored in the same image.
2020-11-07 22:29:39 -06:00
Benjamin Popp
e1669fed1a Improve Offset Pointers
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.
2020-10-09 21:27:58 -05:00
Benjamin Popp
07a05b5537 Minor UI improvements
* 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
2020-10-01 07:35:13 -05:00
Benjamin Popp
b25f3d97a2 Improve table tool table list
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.
2020-09-29 21:02:58 -05:00
Benjamin Popp
acdff5146f Introduce new utility method: Range()
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
2020-09-16 09:54:04 -05:00
Benjamin Popp
1221b110df Add support for named bytes
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.
2020-08-31 19:47:05 -05:00
Benjamin Popp
885ad7b248 When updating versions, update Model Lists too
This matters for any new tables that use those new lists.
2020-08-24 20:47:16 -05:00
Benjamin Popp
8e93144532 Add particle sprite/palette tables
Requires adding the capability to load offset-pointers from the table references file.
2020-08-11 17:48:55 -05:00
Benjamin Popp
50e7341041 add namespace to header elements 2020-07-22 21:56:23 -05:00
Benjamin Popp
cd611950ec When adding reference anchors, make sure stuff points to them
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.
2020-07-22 21:47:00 -05:00
Benjamin Popp
c36cc76fc8 Update remaining table names 2020-07-19 16:34:04 -05:00
Benjamin Popp
f85f0d9b1e Update pokedex and type table names 2020-07-18 23:39:01 -05:00
Benjamin Popp
a03963d37c Auto-Generated Sprite/Palette names should have namespaces. 2020-07-17 16:52:09 -05:00
Benjamin Popp
3cb8d5f159 Add contest type names / stats
only exist in R/S/E.
Change names of moves.sts to moves.stats.battle, to clarify compared to stats.contest
2020-07-17 11:07:47 -05:00
Benjamin Popp
1fef1133e9 Rename more tables
trainermoney
itemimages
trainerdata
trainer vsseeker
decorations
wild
specials
2020-07-16 22:12:22 -05:00
Benjamin Popp
ebac4d0c7a Rename tm/tutor tables
* Allow typing '.' into pointers and matched words
* Increases maximum cell size to accomidate for longer names.
2020-07-14 10:41:41 -05:00
Benjamin Popp
c9d76e2170 Rename moveeffects table
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.
2020-07-14 08:55:00 -05:00
Benjamin Popp
cd34638396 Rename pokestats, evolutions, items, and movedata 2020-07-13 22:32:09 -05:00
Benjamin Popp
0daafe27f6 update graphics table names 2020-07-13 22:12:58 -05:00
Benjamin Popp
91882c1311 Rename pokemon sprite tables
frontsprites -> graphics.pokemon.sprites.front
backsprites -> graphics.pokemon.sprites.back
pokepalettes -> graphics.pokemon.palettes.normal
shinypalettes -> graphics.pokemon.palettes.shiny
pokeicons -> graphics.pokemon.icons.sprites
pokeiconpalindex -> graphics.pokemon.icons.index
pokeiconpalettes -> graphics.pokemon.icons.palettes
2020-07-13 14:57:25 -05:00
Benjamin Popp
0ca6549a7a rename multichoice and natures tables
multichoice -> misc.text.multichoice
natures -> data.pokemon.natures.names
2020-07-13 08:55:50 -05:00
Benjamin Popp
02332dab86 rename types, abilitydescriptions, and movedescriptions
types -> data.pokemon.type.names
abilitydescriptions -> data.abilities.descriptions
movedescriptions -> data.moves.descriptions
2020-07-13 08:33:08 -05:00
Benjamin Popp
0969aa11f4 Update table names abilitynames and trainerclassnames
abilitynames -> data.abilities.names
trainerclassnames -> data.trainers.classes.names
2020-07-13 08:11:09 -05:00
Benjamin Popp
2c65d4743d rename movenames -> data.moves.names 2020-07-13 08:01:14 -05:00
Benjamin Popp
23bfa77890 rename pokenames -> data.pokemon.names 2020-07-13 07:47:10 -05:00
Benjamin Popp
ffe37fa9f4 Fix failing test
Also use automated code review
2020-05-27 23:28:39 -05:00
Benjamin Popp
9995e60fa4 Add filter-by-type criteria 2020-05-07 11:18:44 -05:00
Benjamin Popp
2f79e0252d Decode movement data correctly for FR/LG
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.
2020-04-21 21:38:42 -05:00
Benjamin Popp
b79d7a6ea1 Allow inline script editing 2020-04-20 11:18:42 -05:00
Benjamin Popp
cf0c73691f Auto Format 2020-04-06 22:58:51 -05:00
Benjamin Popp
cac1c8f9bb Bugfixing
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
2020-04-04 15:08:53 -05:00
Benjamin Popp
9a14a78f82 Allow more types of runs in tableReference.txt
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.
2020-03-31 15:21:54 -05:00
Benjamin Popp
a6bbbe48ee Auto Format
also remove a redundant cast
2020-02-17 21:59:24 -06:00
Benjamin Popp
3e8fd018a1 Refactor Singletons
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.
2020-02-08 21:25:48 -06:00
Benjamin Popp
bfe24f6dcb Enable loading weird files that look like the actual roms 2020-02-04 21:10:20 -06:00
Benjamin Popp
ee24e401d0 Refactor
- 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.
2020-01-18 22:31:01 -06:00
Benjamin Popp
0fe3b3d7c0 Bugfix: load default.toml correctly 2020-01-13 22:03:44 -06:00
Benjamin Popp
dc28c0890f Offload standard anchors / lists to a default toml file
Once again, make things more data-driven to reduce the code. Having a default.toml file makes it easier to add to or change the defaults.
2020-01-13 21:47:14 -06:00
Benjamin Popp
7258ddaf8e Condense known tables into a reference file
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.
2020-01-12 21:13:22 -06:00
Benjamin Popp
6cc97c2288 Support Ruby / Sapphire 1.1 2020-01-11 22:50:47 -06:00