Commit Graph

2366 Commits

Author SHA1 Message Date
Haven1433
3b22e8a2de Allow pokemon sprite import to import normal/shiny/front/back sets
There's a lot of resources available that use a 4x wide sprite to render the pokemon normal and shiny, front and back, all as a single image. People want to be able to import this all at once. Now they can.

As a side effect, pokemon will always show their normal palette as their first palette now, with the shiny palette always being second.

This only really works with single-frame sprites for now, so Ruby/FireRed, not Emerald.
2021-12-15 08:27:47 -06:00
Haven1433
c9aaa8b4ba Improve script decompile hex logic
* Allow a value to be shown in hex if it's an out-of-range enum value
* Have values default to hex if they're >= 0x4000
2021-12-14 07:40:42 -06:00
Haven1433
2ffad1ebde initial outline for a metatile run 2021-12-13 21:26:55 -06:00
Haven1433
c1d56fdfa4 Allow register/number <<= operation in thumb
Create a command that is an alias, so the user only has to write one register if they're doing a <<=
2021-12-10 11:09:46 -06:00
Haven1433
2ac39361f1 ignore launch settings
used for choosing startup arguments when running from VS (for showing the dev menu and ignoring metadata)
2021-12-09 20:54:52 -06:00
Haven1433
6964471f77 add more fonts 2021-12-09 20:54:16 -06:00
Haven1433
0ba859ae56 Add Lv character 2021-12-09 20:48:19 -06:00
Haven1433
90c7c8cfb5 Add type items script to repo
Tutorial to follow in Wiki
2021-12-08 22:28:16 -06:00
Haven1433
c3ad9d3927 Expand a += b to a = a + b for low register instructions
The behavior of the += version of `add` is undefined if both registers are low registers. In this case, we need to patch the instruction to replace it with the more traditional 3 register version: a = a + b.
2021-12-07 20:01:12 -06:00
Haven1433
12a6a71523 thumb tool improvements
* Don't clear an anchor to the start of the code we're writing, it may be important. We may later care about keeping pointers that point one byte into the thumb code as well, since the low bit is set to 1 for branch-exchange.
* Have ldr instructions write word aligned values even when starting from a 4N+2 offset.
2021-12-07 19:59:47 -06:00
Haven1433
21e73c0ba2 Improve error message for failing to decompress data.
In the case of the decompressed data being longer than expected.
2021-12-06 22:38:42 -06:00
Haven1433
f8666a7281 Allow ! in tileset format
sprites had the ability to override length checking using ! in the format. Add the same capability to tilesets.
2021-12-06 20:44:07 -06:00
Haven1433
46278ba9c5 Show correct number of search results when multiple tabs are open. 2021-12-06 20:26:01 -06:00
Haven1433
e332290441 Improve Save-As behavior when multiple ViewPorts point to the same Model. 2021-12-06 20:21:07 -06:00
Haven1433
907a3c3b15 priority can be negative 2021-11-30 22:02:04 -06:00
Benjamin Popp
cf8da71e5b Use base 10 for scripts
base-16 values can be entered by prefixing with 0x or $.
base-16 values will be output by the script parser if the argument is suffixed with |h
All other values will now naturally decompile to base-10.
2021-11-29 07:30:32 -06:00
Benjamin Popp
1f53ef822a Use ProcessStartInfo instead of just a filename
UseShellExecute defaults to false in .Net Core. Give it an explicit value of 'true' to allow windows to run non-executable files. In this case, we want to look for whatever program is registered to run the *.gba file, which will very much not be an executable.
2021-11-29 07:30:32 -06:00
Benjamin Popp
fa231c89de Create New Data now works for Tilemaps 2021-11-29 07:30:32 -06:00
Benjamin Popp
617419b1fc Squashed commit of the following:
commit f6c725ba8a696552f4821955ea4d822d7e152b98

    cleanup

commit 35b85c2d4849671aef541013b355ca963b348fd9

    Get the application running

    Everything seems to work now. But the dll/pdb/xml files can't be placed in another directory, making the directory 11 files wider than it was before. I don't know how to fix this.

commit 6804101c94e537954fb7d81c630dfb4eda8157ed

    Remove old config files

    .net core doesn't need these

commit 6450c023b6fce109cda1c8167c87d7e20c0a9813

    Fix warnings

commit 51f6580e51b8cc40da9e3cab6c6fbe998dac4a2d

    Add WPF csproj

    * Debug.Listeners doesn't exist. Internet recommends Trace.Listeners.
    * Requires explicit main method. Adding a main method that launches the App.
    * Generating documentation files

commit 61d234d50f2d8bcb560096ad512cf160b566bc98

    Fix upgrade test path

commit d4ee80a7ef2a459c3c1bb6108fb3dfdeefbc327a

    Add missing files from test resources directory

commit 7ac8022346d24b6f4af4cd34e0a6e957cc6a8d39

    Adding custom AutoImplement for net6

    AutoImplement works in .net 4, but needs to work in .net standard. Updating the project files to use net6 assemblies, and updating AutoImplement to be a net6 project.

Date:   Mon Nov 15 21:52:35 2021 -0600

    Adding old versions of HM.Core and HM.Test for comparisons during the upgrade

commit 7c4c79c9b6f3a8e09962269a68b3515b8b39bbb6

    Initial attempt at adding test project

    This doesn't work yet: autoimplement cannot generate source from HexManiac.Core, since HexManiac.Core is now net6 and AutoImplement is net4.

Date:   Mon Nov 15 21:19:20 2021 -0600

    HexManiac.Core in net6
2021-11-29 07:13:16 -06:00
Benjamin Popp
94b8d844e2 version bump 2021-11-18 14:42:05 -06:00
Benjamin Popp
ed60df5566 fix issue with french firered 2021-11-18 14:41:33 -06:00
Benjamin Popp
8b0dc7217d Merge branch 'master' of https://github.com/haven1433/HexManiacAdvance 2021-11-17 20:36:03 -06:00
Benjamin Popp
34fb686ede Fix broken metadata upgrade test
The constants are more picky than when we first wrote this test: constants will fail to load unless all the values in the rom are correlated in the way the constants expect. Update the test to match this requirement.
2021-11-17 14:09:28 -06:00
TheDiamondMiner
f150a6e348
Fixed copy-uncompressed-image bug, added 'open recent' menu. (#80)
Fixed copy-uncompressed-image bug, added 'open recent' menu.
2021-11-17 09:07:33 -06:00
Benjamin Popp
80d377017c Use pokeball icon for Ruby/Sapphire item shortcut, rather than shopkeeper sprite. 2021-11-15 08:40:25 -06:00
Benjamin Popp
85d7494a05 handle deletion of non-leaf nodes 2021-11-15 07:22:11 -06:00
Benjamin Popp
c25f2a7c4f Add tests that explain how to deal with deeper trees.
Removing the leftmost node from a fully black subtree, the tree needs to balance itself using reds in the right subtree. The four cases are outer-red child and inner-red child for a red parent and a black parent. Each of the 4 cases results in a different balanced tree in the end, and none require further up-propagation.
2021-11-14 22:36:56 -06:00
Benjamin Popp
0c19a3380f additional delete cases 2021-11-13 20:32:09 -06:00
Benjamin Popp
fd88b9f9b2 More delete cases for RB-Trees 2021-11-13 19:52:44 -06:00
Benjamin Popp
c1a428e2fa Fix move expansion bug
Critical Hit Special Attack moves were doing more damage than they were supposed to after move expansion. After looking into it, this was because one instruction `mov   r0, #29` followed by `ldrsb r0, [r1, r0]`, was getting seen as an instruction pair that needed to be updated. But this is wrong for two reasons:
(1) A previous `mov r1` instruction should have stopped the algorithm before it reached this pair. The code has been fixed so that changes to the register from the original `add` instruction will now stop looking for this mov/ldrsb pair.
(2) The instruction we were trying to match was for moving #2 into a register, but we matched #29. Updated the code to expect the mov instruction to end with the constant, rather than just contain it.

I also updated the method documentation to explain how it handles a register source that starts with a !: in that case, it doesn't care if the target instruction contains the register, but it _does_ stop searching if the value in that register changes.

Tested in FireRed. This changes exactly one byte, which we verified through experimentation is the instruction that should not have been changed in the first place. So all is well now.
2021-11-12 22:11:54 -06:00
Benjamin Popp
a8c6682a8d start working on node removal
Refactor to simplify code: allow left/right to be accessed with an int, so we can use symmetric logical code instead of 2 copies of the code.
2021-11-05 22:10:37 -05:00
Benjamin Popp
f8e24c1964 Don't generate a token for the model if we don't plan of having the model make any changes.
Also update the Undo/Redo subsystem logic to correctly clear the redo stack when inserting a custom token.
2021-11-04 15:18:22 -05: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
dbefc5baf2 'Copy' shouldn't modify metadata
When running the Copy Command, don't modify the metadata by adding automatic names to the things being copied. We should still do that for cut, and the names should be added to the clipboard. But don't put the names in the actual rom. This should help reduce noise in the 'misc' anchor folder.
2021-11-02 16:17:48 -05:00
Benjamin Popp
8bd0edcc5c Use Assert.Same instead of Assert.Equal for node comparisons.
Now that nodes are enumerable, Assert.Equal tries to enumerate them. But since node enumerations include themselves, this causes a stack overflow.
2021-11-01 21:58:11 -05:00
Benjamin Popp
4ac28bfbfa Show the correct name for search result tabs from the table tool
This was wrong if the table that you used to search had a beginning margin. Example: move descriptions, looking for Hyper Beam
2021-11-01 21:41:47 -05:00
TheDiamondMiner
4201141f8c
Fixed Vertical Scroll problem (#79)
Click-drag on hex can now cause the data to scroll both up and down.

Before this, it would only scroll down.
2021-11-01 10:24:23 -05:00
Benjamin Popp
1a5f0420eb Raise IsMetadataOnly change when tab changes 2021-10-31 23:18:40 -05:00
Benjamin Popp
8a01ad4a4d add palettes for elite 4 before-battle mugshots
It also includes the palette for the background (boy vs girl)
Thanks to Scyrous for these.
2021-10-31 22:15:14 -05:00
Benjamin Popp
de85598197 Add tests to verify ViewModel scrolling behavior 2021-10-31 22:12:14 -05:00
Benjamin Popp
91dd8e6621 Merge branch 'master' of https://github.com/haven1433/HexManiacAdvance 2021-10-30 16:03:10 -05:00
haven1433
338dd53e9f
Merge pull request #78 from TheDiamondMiner/master
Added reset and close in theme window
2021-10-30 16:02:38 -05:00
TDMiner
6396bbd148 fixed empty space 2021-10-30 21:13:09 +05:30
TDMiner
f81998ae63 Fixed button error in ThemeWindow. changed MainWindow ( view menu ) 2021-10-30 21:11:43 +05:30
TDMiner
7a4a6603c6 Hello this is m changed. 2021-10-30 00:55:50 +05:30
Benjamin Popp
d4bec8c8fe Initial implementation of red-black tree
Includes basic node-based implementation for 'Add'
2021-10-29 09:00:50 -05:00
Benjamin Popp
a9763a9d6c Add script for expanding Emerald EVs 2021-10-26 21:51:14 -05:00
Benjamin Popp
c8254f8d66 During palette reorder, also check other palettes from this sprite for length errors.
* For testability, allow forcing a palette to be loaded even if its data has length errors.
2021-10-26 21:29:30 -05:00
Benjamin Popp
23c1d7b5ee Add support for button-escape characters 2021-10-25 20:33:11 -05:00
Benjamin Popp
ba0fedc0e3 allow right-clicking outside of data 2021-10-25 20:17:45 -05:00