Commit graph

1145 commits

Author SHA1 Message Date
Kurt
9aa5bbea2d BDSP v1.3 2022-03-15 19:24:17 -07:00
Kurt
70ea1f7048 Move some files around 2022-03-15 19:23:03 -07:00
Kurt
b45ce123da Show rainbow bean index
14 -> 15
Clean up some API functions
2022-03-08 21:02:06 -08:00
Kurt
bb8dee1e6c Return block value
oops, refactoring forgot to add return
Closes #3458
2022-03-08 08:36:17 -08:00
Kurt
4e1276a954 -8 bytes from each encounter template
saves about ~1MB RAM savings (>=179,142 objects)
2022-03-06 23:25:47 -08:00
Kurt
ba9d3c95af Fix bean get/set 2022-03-06 15:33:33 -08:00
Kurt
9049ef99fd Minor allocation reduction 2022-03-06 13:03:39 -08:00
Kurt
7911cd6d5c Seal some classes 2022-03-06 12:16:36 -08:00
Kurt
47f7efab2c Update SCBlockAccessor.cs 2022-03-06 00:46:10 -08:00
Kurt
e17483fe46 some linq reduction 2022-03-05 20:03:52 -08:00
Kurt
1c0f842173 Remove unnecessary Clone method for Items
Remove linq using by doing things slightly more efficiently
2022-03-05 19:51:16 -08:00
Kurt
9696da2eb3 Minor clean
Seal ComboItem
Reorder methods for easier reading
Fix BulkGenerator living dex setting CurrentLevel -- needs to be after species,form as EXPGrowth can vary for forms.
2022-03-05 18:13:31 -08:00
Kurt
3c567c0c97 Rearrange some scblock logic
No functional change. just increasing robustness
Decouples exportable state from get/set values
2022-03-05 17:46:03 -08:00
Kurt
1370d9ab0f Merge SAV8 into SAV8SWSH
Was originally expected that gen8 was going to be a pair+revision generation, but with BDSP and PLA being totally different games, there's no need to have inheritance complicating a single SWSH class.
2022-03-05 17:34:09 -08:00
Kurt
90b075947d Move some get/set operations into Accessor class
Adds exception-free get/set for revised saves.
2022-03-05 17:33:08 -08:00
Kurt
8f0035a577 Deduplicate savefile constructors
No longer necessary as we don't keep BAK reference anymore.
2022-03-05 17:15:38 -08:00
Kurt
8fdd96209c Deduplicate some logic
No need to length check in the SwishCrypto hash check, as the methods pre-check length as well.
Extract checksum footer check for Gen5 saves
2022-03-05 17:14:25 -08:00
Kurt
1f07685921 Update MyStatus8b.cs 2022-03-05 15:17:13 -08:00
Kurt
7cfdb8a466 Move hashing to SCBlockAccessor, fix #3455
Fixes #3455 by adding bool for insular sea, and adjusting overall progress values as listed.
Closes #3456 (supersedes)

Updates SCBlockAccessor to eliminate bounds check (integer overflow, which isn't possible with our array size), adds some overloads, and xmldoc.

Co-Authored-By: Jonathan Herbert <3344332+foohyfooh@users.noreply.github.com>
2022-03-02 18:05:13 -08:00
CanoeHope
e507d4ab91
Update SaveBlockAccessor8LA.cs (#3453) 2022-03-01 21:34:37 -08:00
Kurt
e5296fc51a Add IoA diglett button in Trainer editor
Closes #3454
Use ahtb sourced (hash,string) correlation from pkNX to dynamically generate block keys.

Co-Authored-By: Jonathan Herbert <3344332+foohyfooh@users.noreply.github.com>
2022-03-01 21:34:16 -08:00
Kurt
415c5f5560 Update SCTypeCode.cs 2022-03-01 19:09:42 -08:00
CanoeHope
e792c038b8
Label a new L:A update block (#3452) 2022-02-28 22:47:30 -08:00
Kurt
d1e62fb6d1 Add dex solitude complete mark checkbox 2022-02-28 00:03:38 -08:00
Kurt
e5e2a3427f Rename Silver SV->SI
SV will likely be the lump for SCarlet and VIolet
2022-02-27 11:16:12 -08:00
Kurt
b3cd4dea25 Initial support for PLA-v1.1 2022-02-27 07:56:47 -08:00
Kurt
044dfe46ae Reduce allocation on encrypt/decrypt
Xor no longer allocates
Encrypt no longer allocates byte[0x60]
temp now allocated on stack instead of heap
Pre-size memorystream (prevents 0xF0 allocation)
2022-02-27 01:05:11 -08:00
Kurt
fd07456ee1 Fix boolean value copy changes
a5710ee374
2022-02-25 16:10:49 -08:00
Kurt
a5710ee374 Fix PLA box flag setter
nice boo boo matt
2022-02-25 13:29:43 -08:00
Kurt
5a71ecc8bb Minor clean 2022-02-24 23:17:16 -08:00
Kurt
a276975847 Don't throw exception in safe block search
Just duplicate the method to return fake default instead of trycatch overhead.
2022-02-24 21:02:08 -08:00
Kurt
0404b94f86 Add support for BDSP 1.2.0 save files 2022-02-21 18:11:35 -08:00
Kurt
48742da4ae Ignore BDSP backup paths
"Backup.bin"
2022-02-21 17:45:23 -08:00
Kurt
f1264a1a97 Handle struct default ctor 17.1 handling
Closes #3445
2022-02-21 16:11:58 -08:00
CanoeHope
61821c7986
Add L:A blocks and BDSP event constants (#3444)
* Update SaveBlockAccessor8LA.cs

* Update work_bdsp_en.txt
2022-02-20 22:46:20 -08:00
Kurt
d5be6254f3
Add logic for PLA wild RNG correlation (#3443)
Adds structures to read/write saved spawner data such as seeds, counts.
Adds generator and validator to emulate the FixInitSpec builder used by the game logic

Similar to SW/SH raids, validating these in-process is not feasible due to the number crunching required.

This does not handle the encounter slot call or the follow-up level range call. Just the inner FixInitSpec ctor & fill.

level is calc'd:
randFloat(sum) -> slot float
rand.Next() -> gen_seed (for all the details)
rand.NextInt(delta) +min -> level

Co-Authored-By: Lusamine <30205550+Lusamine@users.noreply.github.com>
2022-02-20 17:59:48 -08:00
Kurt
f2637168ab Fix kor string writes
Was writing kor string, then writing en after (all terminators).
Make method signature match other SetString, with write buffer as first arg

Closes #3440
2022-02-17 23:11:13 -08:00
Kurt
dc3d8e7cec Minor clean 2022-02-14 21:32:52 -08:00
Kurt
2267e1a879 Minor tweaks for api consumers
Indicate Shiny.Random on home shiny-possible gifts
More detailed exception message for GetLearnset/GetPersonal
2022-02-12 23:40:28 -08:00
Kurt
574a7f43a0 BDSP: Handle uninitialized box names
span refactoring didn't catch this
also apply same change for gen4 battle revolution string reads
2022-02-11 10:43:27 -08:00
Kurt
bb2b8e74c3 Update SCBlock xmldoc 2022-02-10 11:08:30 -08:00
Kurt
a5d1bf7900 Fix cxd pouch write, bk4 pid reads
Closes #3429
2022-02-10 10:57:59 -08:00
Kurt
bc2549b24e
Minimize BAK file allocations (#3426)
Stop allocating an entire shadow copy of the save file whenever we create a new savefile object from file.

Prior commits added the clear SaveFileMetadata class to cleanly track the file path. Backups are copied from the original path.
2022-02-09 16:48:55 -08:00
Kurt
16da1deadc Revise battle subway flag handling
Retain all flag bits; expose the other 5 flag bits as some saves do have them.

Undocumented.

Closes #3422
2022-02-09 15:41:00 -08:00
Kurt
f5344452cf Fix last funfest mission record r/w
Closes #3423
2022-02-09 10:36:46 -08:00
CanoeHope
08f8b6e3d4
Add Legends: Arceus blocks (#3403)
* Update SaveBlockAccessor8LA.cs
2022-02-08 18:50:52 -08:00
Kurt
5cdfe18b8e Add 7b Starter choice
Closes #3420

Co-Authored-By: GiftedK <99304781+GiftedK@users.noreply.github.com>
2022-02-08 18:49:44 -08:00
Kurt
105e6a31f8 Fix Colo checksum refresh
https://projectpokemon.org/home/forums/topic/60614-error-when-opening-a-clean-pok%C3%A9mon-colosseum-save-and-exporting-it-as-is-using-220204/
2022-02-06 19:17:46 -08:00
sora10pls
9023b302c8 Label individual clothing item unlock save blocks 2022-02-05 13:38:39 -05:00
Kurt
cd19d1d700 Fix folder list backup fetch
Introduces an option to disable reading .bak / "backup" files; trickle the changes up to all surface users so that SAV_FolderList can correctly load all .bak saves into its Backup tab.

The "ignore backups" was added in the latest feature push to ignore "backup" from being detected as the latest save.
2022-02-05 09:49:47 -08:00