Commit Graph

108 Commits

Author SHA1 Message Date
Smig0l
cc7b67fff2
Create default.bpei0.toml (#104)
* Create default.bpei.toml

Added the toml file with addresses valid for BPEI (Pokemon Emerald Italian Version).
Some are sourced from https://github.com/Gamer2020/PokemonGameEditor/blob/master/roms.ini

* Update default.bpei.toml

added maps addresses

* Update default.bpei.toml

updated and reordered

* Update HardcodeTablesModel.cs

* Rename default.bpei.toml to default.bpei0.toml

* Update default.bpei0.toml

fixed exception error in 0.5.0.2

* Update default.bpei0.toml

deleted commented lines

* Update HexManiac.Core.csproj

* Update HexManiac.Core.csproj

Indented correctly
2023-01-15 12:12:48 -06:00
haven1433
4c2089196b usability feedback
label stuff
center new connections
berry shortcuts
fix goto shortcuts
2022-11-24 11:24:56 -06:00
haven1433
7d0022d6a3 template progress 2022-11-08 22:29:37 -06:00
haven1433
953fe52fb6 improve tuple model
* add fly spots to event list
* allow moving/deleting fly spots
* remove Elevation from base event interface
* improve header UI
2022-10-20 21:48:29 -05:00
haven1433
b8108e7638 Improve upgrade logic
When updating to a new version, don't upgrade tables that have been edited by the user.
2022-09-20 22:49:04 -05:00
haven1433
65b409e3bf bugfix
MaxLevel / MaxPokedex can be set now
Also make OWs appear in WrapPanel to see more at once.
Also show a trainer sprite if we have one.
2022-09-18 22:31:55 -05:00
Haven1433
29092415a6 multi-select
and some flag-based utilities
and hide layoutID
2022-09-16 21:27:55 -05:00
Haven1433
1ac960a477 support Goto 2022-09-15 08:03:04 -05:00
Haven1433
10938577aa make constantRef work for games outside the primary 9 2022-09-11 13:08:15 -05:00
Haven1433
ddf14d3837 Code cleanup 2022-09-03 00:07:36 -05:00
Haven1433
84c729308c load default metadata for non-pokemon gba games 2022-07-09 21:10:43 -05:00
Haven1433
8918c508c6 fix table adding logic
Don't add the table if the pointer to it isn't valid (because it's actually in the middle of some other run)
2022-05-19 07:08:02 -05:00
Haven1433
9953a939ff add name text lists to the decap tool 2022-05-10 07:46:19 -05:00
Haven1433
f76c2c4736 Hand-Modified Lists shouldn't update during version upgrade
If the user modified a list or added new elements to it, don't modify the list during version upgrades. If the list has never been modified, go ahead and update the list based on the new default metadata.

This is implementing by storing a 'Default Hash' for lists. The user that modifies the list will leave the default hash alone, and the program can notice the mismatch and avoid updating the modified list.
2022-04-27 22:04:19 -05:00
Haven1433
7956529220 loading an existing file should update goto/metadata after load completes 2022-03-13 15:48:53 -05:00
Haven1433
859253385f improve CFRU ability names detection 2022-03-07 20:57:45 -06:00
Haven1433
c0f518bcd8 Replace Model.AfterInitialized with InitializationWorkload
Tasks already do what I was wanting to do (manage work timing), and do it better with more features, and do it in a way that other developers will more easily understand. Stop being weird, just use a Task.
2022-03-03 20:42:00 -06:00
Benjamin Popp
37f7b3ade6 Parameterize FormatRunFactory
This allows us to have parameters from toml metadata passed in to the process of how we create formatted runs. In this change, we add the ability for trainer teams to _not_ scale the IV value from a number 0-255 to a number 0-31. This is important since some patches depend on using the entire byte, rather than just the top 5 bits.

Since the model is now in charge of the FormatRunFactory. the model can decide to use different types of factories for different roms. This lets us turn different features on/off between the pokemon games and other games. We may use this capability later.
2021-11-02 21:10:06 -05:00
Benjamin Popp
e99f6f0a04 Get goto shortcuts from toml 2021-10-10 20:51:55 -05:00
Benjamin Popp
c68f8019b5 Add support for BPRF0 (by Kbueno) 2021-04-29 21:28:26 -05:00
Benjamin Popp
6bacb02c85 Update the CanRun method for move expansion 2021-04-28 21:09:19 -05:00
Benjamin Popp
8409aa199c Introduce Unmapped Constants
Unmapped Constants are much like Unmapped Pointers: they're tracked by the Model, the metadata, and undo, but they don't have a spot in the file. This allows us to create constants using the existing syntax `@constant=value` which can then be referenced in thumb code using `.word`s.
* New test to show that we can save unmapped constants from the ViewModel to Metadata
* New test to show that we can load unmapped constants from Metadata to the Model
* New test to show that we can undo the adding of unmapped constants
* New test to show that unmapped constants can be used in thumb words
2021-03-21 16:23:55 -05:00
Benjamin Popp
92a5196240 Hardcode length of male/female name tables in Emerald
they were dynamic, but that causes issues when upgrading. Since the tables are back to back, loading the female table with a dynamic length sees all the male names and tries to incorporate them, so the male names get deleted.
2021-03-05 20:19:49 -06:00
Benjamin Popp
0283c372e3 CFRU improvements
Make the resize-clear smarter. When clearing out a format to add other formats at the end, clear the format at the beginning to preserve pointer information.

Also, CFRU defaults to 17 bytes per ability name.
2021-02-28 22:08:04 -06:00
Benjamin Popp
462bb28b47 Introduced Upgrade tests
A new set of 6 tests prove that upgrading from old versions to new versions works correctly. It currently tests 0.3, 0.3.5, and 0.4 with FireRed and Emerald.

... and man, it found a ton of issues. I lost track of how many issues it found, but I'm glad I wrote those tests.

* RomName needed to update to data.header.romname
* Several tables didn't load the correct length because they were dependent on things that hadn't been loaded yet.
* One table broke during an update, and no longer loaded correctly in Ruby or Emerald.
* Several tables didn't update their formats correctly during upgrade.
*
2021-02-28 20:48:56 -06:00
Benjamin Popp
a9318c00ea Bugfix: load tables based on constants correctly
Since tables are loaded from metadata before constants, loading metadata made the types load as a single-element table. This is wrong. Make it change the length of the type name table when it later loads the constants.

This should be true in the general case too, not just the startup case. When a new constant is loaded, if a table is known to have that length, update the table accordingly.

Add additional testing to verify that the constant is correct before adding it. This matters for a new TOML being created for an existing rom, where some of the values may've been changed.

Add additional verification that all the constants / table lengths actually match up after loading is complete.
2021-02-27 22:44:51 -06:00
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