Commit graph

1526 commits

Author SHA1 Message Date
Kurt
f35a8d8496 cxd blank sav: set default region for encoding 2024-07-21 01:50:08 -05:00
Kurt
36d5e771b7 Update BoxLayout6.cs
Closes #4322
2024-07-14 17:17:10 -05:00
Ibis Liven
fc509200b7
Update SaveHandlerFooterRTC.cs (#4321)
add edge case for FlashGBX
2024-07-14 10:25:33 -05:00
Kurt
99ebc47866 Extract TrainerName const to static class
Central location for where these values are defined.
2024-07-06 01:35:50 -05:00
Kurt
1dcda6d2e8 Fix sav clone metadata inclusion
Need to not include it when cloning saves into the sav constructor, need to mirror it in metadata instead.
2024-07-04 22:27:53 -05:00
Arley Pádua
6de68ac626
feat: allow external consumers to specify AES implementation (#4311)
Allow external consumers to specify AES/MD5 implementation

HOME: Replace direct usage of transforms with built-in wrapper methods for easier API replacement.
BDSP: Replace incremental hash with one-liner for easier API replacement. Handle dirtying manually.
2024-07-02 09:12:03 -05:00
Kurt
3824c2e9f7 SAV3: interact with other extdata sectors
Uninitialized sectors are now no longer updated for checksums
Checksums will be updated if not uninitialized (replacing battle video)
Not that the game really checks the checksum (lol)
2024-06-29 23:59:11 -05:00
Kurt
baac00c130 Invert export flags, fix footer inclusion gen1-3
Closes #4307
2024-06-29 12:55:13 -05:00
Kurt
496c66bd46 Rename box storage slot flag fetch
`IsSlotX` is a little ambiguous; `IsBoxSlotX` much better.
2024-06-29 10:39:59 -05:00
BlackShark
9ca0a46715
Fixed some SecretBase3 issues (#4305)
* Fixed some SecretBase3 issues

* Allow settings SpriteItems, use ushort for TID16
2024-06-21 21:27:33 -05:00
Kurt
6b51250f88 Misc tweaks
PK5-PKMEditor no longer sets Hidden Ability flag for Rotom under HaX -- only set if unique hidden ability.
Differentiate move source tagging for HOME, DexNav, and GB-Evolution
fix some comma spacing
2024-06-15 18:38:05 -05:00
Kurt
f6bcc8a216 Minor clean
StringBuilder.Append has some fancy interpolation handling in the latest NET8 so it's more clean than multiple append calls.
2024-06-15 00:57:44 -05:00
abcboy101
9817b29483
Add Berry Powder, Pokéblock3, Decoration3, and Record4 editors (#4298)
* Add Berry Powder to Misc3 editor

* Add Pokéblock Case editor for Gen3

* Pokéblock/Poffin localization

* Add Decoration editor for Gen3

* Localization

* Add Record editor for Gen4
2024-06-13 00:01:49 -05:00
Kurt
4f23efd939 Minor tweaks
Rival_Trash -> RivalTrash
BinaryCodedDecimal better method names
Gift dupe checker differentiate by species
2024-06-10 21:43:27 -05:00
Kurt
992deea183 Fix B2W2 key unlocked get/set
Closes #4295
2024-06-09 08:54:02 -05:00
Kurt
67fc0d0885 Misc tweaks
Add Cap Pikachu const value updating for USUM, also set Magearna const for USUM (not only SM)
Remove `NotDistributed` property from WC3 as only CXD events used it, no longer WC3 type.
Delete ArrayUtil; move remaining methods into the StorageUtil class that used them for compressing/inserting bulk into boxes.
Add shiny wormhole flag
Extract byte array strings into spans, faster tests and less overhead.
2024-06-09 08:52:32 -05:00
Kurt
06b8ec03ae Allow startup to detect memory card single-sav
Closes #4296
2024-06-07 09:42:52 -05:00
Kurt
de6c1baaf2 Minor tweaks
PK9: Fix writing box bin of self-owned SV eggs clearing nickname trash, also clear any hint of trading completely
SAV1: ensure current box is index:0 if uninitialized
2024-06-05 23:46:03 -05:00
Kurt
093fca37ec Add enum to GUI translatable list
Improve perf of GUI scrape by only making forms once, don't fully set up Main
Add method to get a list of translated Enum names
Adds translatability for size markings
Closes #4266
2024-06-03 19:37:57 -05:00
Kurt
2d0d0236e3 Handle more RTC footer types
BizHawk Gambatte stores a 0x16 byte footer, but the correlation previously used isn't always true.
Just implement a generic detector that allows for a reasonably sized footer for the Gen1-3 formats.
2024-06-02 12:22:27 -05:00
abcboy101
5014b0c891
Add country/region editor to Geonet editor (#4286)
Adds individual country/region-level editing to the Geonet/Unity Tower editors
2024-06-01 17:56:20 -05:00
Kurt
7d05e12c7f Misc tweaks
Fix pk6/7 pkmeditor export, now retaining status condition instead of wiping it
Abstract b2w2 key system to a save block; better documentation on its odd mechanics
Allow gen1-3 filename language/ver detect to work if the filename is ` `->`_` (discord attachments changing spaces to underscores); also revise canadian French emerald filename pattern
others: negligible perf/using standard library functions
2024-06-01 17:44:32 -05:00
abcboy101
e6cf61330a
Add Seal, Accessory, and Backdrop editors (#4284)
- Adds editors for the Seal, Accessory, and Backdrop inventories in Gen4
- Adds a line in the Gen4 Mystery Gift editor to display which Goods, Seal, Accessory, Backdrop, Pokétch app, or Route Map is contained in a gift
- Changes the HG/SS Apricorn editor to display localized item names instead of hard-coded English strings
2024-05-30 23:42:03 -05:00
Kurt
b7298a7361 Auto-clean save file names of duplicate suffixes
`main (17)` now backs up as `main [...].bak` instead of `main (17) [...]`
Adds a debug-callable method to clean the main backup folder via:
`CleanBackups(Main.BackupPath, true);`
2024-05-27 19:23:56 -05:00
Kurt
c10c2a0dc2
Add Trash Byte verification for Switch formats (#4283)
* Extract logic, finish impl for switch era
* Extract trash checks to static class
* Reduce some allocations in OT name compares
2024-05-27 18:21:11 -05:00
Kurt
ca2bd3baf4 Minor clean
No functional change
2024-05-27 10:33:25 -05:00
abcboy101
a7421a7ceb
Localization (#4281)
* Display Medal type in SAV_Misc5
* Add CHT localization for Medal names
* Add localization for Medal type names
* Update Chinese localization for DPPt Underground
* Add additional G1/G2/G3 item name localizations
* Fix some typos in the Japanese names
* Add Korean names for G3 items
* Correct e-Reader Berry name format localizations
* Italian games use the format `BACCAENIGMA` (capitalized normally as `Baccaenigma`), so the entire item name needs to be titlecased, not just the Berry name.
* Add missing Gen2/3 location name localizations
* Minor corrections to existing languages to match in-game
* Minor tweaks
2024-05-24 18:51:05 -05:00
BlackShark
68ea86cc72
Fixed SecretBase3Team (#4280)
* Fixed SecretBase3Team

* Fixed more offsets

* Fixed Species
2024-05-23 21:00:11 -05:00
Kurt
cd6eadcd8d Fix daycare slot read
Closes #4279
adds writeback for daycare in gen2 as well
2024-05-23 13:31:23 -05:00
Kurt
93ae048246 Fix sav1 daycare write
was copying wrong data in, clean things up.
#4279
2024-05-23 03:54:06 -05:00
abcboy101
4cb1048139
Implement GBA/GC string conversion (#4278)
* Swap GC nickname fields

The first nickname field is used for the displayed nickname, such as for EFIGS PKM whose names get truncated in Japanese games.
The second nickname field stores the actual nickname, which is restored when a PKM is traded back to the GBA games.

* Add StringFont3GC

* Add GC/GBA string conversion tables/logic

* Refactor GC region conversion

* Minor tweaks

Skip copying nickname/OT on generic conversion method; derived impl will remap the trash for us.
Extract the DisplayNickname truncation function and deduplicate. Use buffers directly when updating
Make CurrentRegion/OriginalRegion properties GCRegion instead of int/byte

Extract local func for font check skip for clarity
2024-05-22 12:22:41 -05:00
Kurt
96bf5a6891 Misc tweaks 2024-05-19 23:29:27 -05:00
Kurt
3811f8d114 Misc tweaks 2024-05-18 00:40:29 -05:00
Kurt
99857540ae Add version hints to filter name checks
Extract result valid check to less-wide style, add extra sanity checks for Gen3 typed saves.
2024-05-15 23:29:27 -05:00
Kurt
ca85fba061 Force writeback on addition to uninitialized data
Adding an entity to an uninitialized save's box data will force all data to be flushed unless the final destination was (initially zeroed and has no slots to set).
2024-05-13 19:40:55 -05:00
Kurt
215f892f11 SAV1: Don't reference prior-save boxdata
If the boxes are not initialized, skip reading of box data
If the boxes are empty when saving, don't write if {dest 0} or {boxes uninitialized} to retain old data.
If the boxes have any slots when saving, set the flag that boxdata is good.

Remove flag from SAV2, game is different from SAV1. Only use the boxdata, just mirror to CurrentBox data as Stadium only looks at boxdata.
2024-05-13 17:41:23 -05:00
Kurt
8b68a07dbd SAV1: Use current box span for source of boxdata
Maybe only a GSC thing where Stadium 2 doesn't know better?
2024-05-13 00:16:29 -05:00
Kurt
7b6abc0520 Reduce alloc for ot/nick by raw trash reads
Legality check now catches buffer overflow mons.
Now that I have each type exposing a trash length & charcount, should be easy to have some reusable trash byte measuring methods (see the old branch)
2024-05-12 14:46:58 -05:00
Kurt
08ed482555 Revise gender symbol remapping
Handles Nidoran's shenanigans as well as more clear method names
- Add normalization for PK7->PK8 (no more 0xE... usage for the gender symbols... maybe more chars?)
- Not sure if Gen3 gamecube encoding needs sanitizing. Who is transferring Nidoran to CXD? :)

Requires some silly usage of Language passing as arguments. Future improvements can be made to revise the half/full encoding determination when setting a string. Probably has issues since we're just doing a naive check without considering nicknames w/ special chars.

Closes #4174
2024-05-12 10:47:55 -05:00
Kurt
bd4ea9656d Misc tweaks
Fix block editor GUI not showing named blocks (`Equals` is easily repointed...)
No functional change for the others, just reusing/cleaning irks.
2024-05-10 01:22:26 -05:00
Kurt
5af6678784 Update 24.05.05
Fix devutil text update
swap tox & poison icons, move picturebox to the right
add some Legality settings util functions
2024-05-05 23:24:32 -05:00
Kurt
e72ff1a899 Misc tweaks
No noticeable change besides correctly indicating N's Pokemon in hover text (instead of Dream Radar)
2024-05-05 15:33:30 -05:00
Kurt
ad0c9b147d SAV6AO: Fix dexnav get/set
Was looking in the wrong segment of save data. Now points to the correct span (pokedex).

Extract a few more save blocks and interactions.
Basically try to get rid of any remaining `SAV.Data` references. Still a few left, but aren't broken.

Closes #4259
2024-05-01 22:58:47 -05:00
Kurt
0f4024952e Minor clean
indexof -> contains
trailing space
some variable reuse
pcdata/boxdata less janky handling
2024-05-01 00:49:43 -05:00
Kurt
e9de611735 Fix sav2 clone
Regression from the version-detect enhancement where we weren't expecting specific versions to be passed, only the lumped ones.
2024-04-28 11:25:46 -05:00
Kurt
e7f79be41d Minor clean 2024-04-28 00:35:26 -05:00
Kurt
bb6e45db60 Refactor out legality settings, add more settings
Extract PP verifier
Add disabling of wordfilter for formats < 6
Add context-specific bypasses for nickname/handler checks
2024-04-26 14:33:03 -05:00
Kurt
2296d34df3 Gen1/2: Fix party read
Oopsie false->true ez
Closes #4253
2024-04-24 19:24:49 -05:00
Kurt
093264bc24 Add IStringConverter, impl on PKM & SaveFile
use in trash editor to translate strings, from PKM instead of SAV.
Closes #4222
2024-04-23 00:57:17 -05:00
Kurt
1b294f7c97
Refactor: Split Gen1/2 string & pokelist conversion methods (#4251)
* Split Gen1/2 string & pokelist conversion methods

* Refactor pokelist to direct read/write, skip on save if blanked

* Add settings editor for SaveLanguage overrides
2024-04-22 14:42:22 -06:00