Kurt
3e8527f11a
Minor tweaks
...
Reduce allocation in a few places, delete unused stuff, more concise expressions.
2022-05-07 21:25:26 -07:00
Kurt
a57f40ae7d
Break up PKX into separate classes
...
Many years ago, PKX used to be a >4,000 line bloated file, which spun off multiple classes like CommonEdits and most of the early non-GUI PKM related logic. Now, it's just a stub to source the latest generation & personal table.
Separate files = more concise info, and more room to grow to do more advanced things.
Makes the IsPresent methods public (no longer internal).
2022-05-06 20:38:55 -07:00
Kurt
be9c947dd6
Use tuples and ComboItem, not anonymous class
...
Little more explicit
2022-05-06 15:43:51 -07:00
Kurt
75874b6b81
Show lock capsule slot in mystery gift editor
...
Closes #3487
editor getting hacky, but it works
2022-05-05 21:21:03 -07:00
Kurt
d58aed109d
Add Current Box Changed flag for sav1/2
...
Flag not set causes the game to clear all boxes (except current box) to clear garbage sram if saves never cleared. Yay deferred execution?
2022-05-02 23:47:41 -07:00
Kurt
fa76da56c9
Inline some Rand32 calls
...
No functional change
2022-04-26 20:21:26 -07:00
Kurt
1f49574be1
Fix g6 hof len
2022-04-23 22:05:51 -07:00
Kurt
f5358e0e37
Update HoF6 entity editing
...
Reusable entity struct, no more overlapping fields
Adds OT Gender, fixes some flags.
Thanks L1nk2futr3 !
https://projectpokemon.org/home/forums/topic/60977-hall-of-fame-tid-resetting-gen-6/?do=findComment&comment=275575
2022-04-23 10:42:56 -07:00
Kurt
ff2e890e69
Revise Overworld8a application of PIDIV
...
Instantiating from template now follows group seed -> spawn 1 correlation, including alpha move.
Differentiates static encounters that don't follow the ow8a correlation, scrambles EC to disassociate.
Adds rand64 to get initial seeds
Set correct level range to match slotSeed; not respecting the slot roll being valid, but whatever.
2022-04-22 21:11:11 -07:00
Kurt
e90f19c962
Add setters for spawner objects
...
UnknownSeed->CountSeed
Seed_01 -> AlphaSeed
yay, no more unknown seed functionality, all documented.
2022-04-18 22:25:34 -07:00
Kurt
515a503ee4
Update spawner models, import from permutemmo
2022-04-17 14:54:54 -07:00
Kurt
a61d8d1efc
Extract IMultiplayerSprite from SaveFile
...
only used by gen6 saves
2022-04-15 14:58:40 -07:00
Kurt
a681783f1a
Extract interface for SaveBlock, allow strict
...
External users shouldn't be using SaveBlock
2022-04-15 11:45:04 -07:00
Kurt
ac7947fd66
Misc tweaks - static namespace using
2022-04-15 09:54:12 -07:00
hp3721
f740e1dd72
Fixed rebattling BDSP trainers ( #3481 )
2022-04-14 18:36:01 -07:00
Kurt
5f4bbcf8de
Permit 0x1FF00 saves as stadium saves
...
Closes #3479
emulators are stupid
2022-04-13 10:42:35 -07:00
Kurt
f753afaae8
Minor clean
2022-04-11 11:56:56 -07:00
Kurt
a5ee845c3b
Decouple event flag/work from SaveFile
2022-04-09 18:12:57 -07:00
Kurt
0389624508
Extract unnecessary stringbuilding from pkmconvert
2022-04-09 11:58:52 -07:00
Kurt
e6cf5d0baf
Split PKMConverter into multiple classes
...
EntityFormat -> detects byte[] -> ctor() PKM
EntityConverter -> converts between pkm formats
RecentTrainerCache -> used by other classes (not within EntityConverter!)
EntityBlank -> creates blank PKM objects indirectly
2022-04-09 01:39:34 -07:00
Kurt
cc1c3e8d42
Refactor stat loading to allow spans
...
Can load stats without allocating
2022-04-08 21:08:06 -07:00
Kurt
274b613487
Change signature to set stackalloc ivs
2022-04-08 20:43:31 -07:00
Kurt
d40bfa63c7
Refactor gen2 mail data structure
...
Now reads/writes correctly in the GUI.
Closes #3470
Not going to handle slot swaps not matching the data, as this becomes problematic when cloning slots. Previous commit added the ability to manually move mail slots.
2022-04-02 23:36:56 -07:00
Kurt
55083ee02c
Fill(0) -> Clear()
2022-03-26 13:33:58 -07:00
Kurt
977e977dbf
Rewrite GeniusCrypto (XD/Batrev)
...
More clear usage of span
slightly less allocation+copying
more comments for future readers
2022-03-26 13:28:29 -07:00
Kurt
8bf618008a
Remove structconverter
...
Won't work on bigendian architecture for non-byte fields, so just do it manually.
2022-03-25 19:47:23 -07:00
Kurt
6a96ad2278
Disallow loading invalid BDSP savefile versions
...
rom hacks smh
2022-03-25 19:24:37 -07:00
Kurt
2cbdd5dbe6
Add gen4 pokedex extdata reader
2022-03-22 10:25:53 -07:00
Kurt
68e3a4430d
Handle japanese RSBOX memcards
...
First 5 blocks are reserved for file accessing info, but we should include them when checking length
Closes #3468
Capture the bool indicating Japanese for the save file, so box names are now read correctly (if changed from game's default).
2022-03-21 19:20:06 -07:00
Kurt
46c83faa0e
Refactor hall extradata to read as a separate block
2022-03-21 18:53:24 -07:00
Kurt
fadcf92dc8
Faster pokecrypto
...
net6 was 4x faster than 461 with the old implementation; now it is faster for both but not as disparate.
New implementation performance is always at least 30% better than the old implementation; even better for smaller chunks of data (40% less time).
Pretty much mimics bare metal value writes
2022-03-20 02:44:36 -07:00
Kurt
54f1e341f9
Spanify spawner object get
2022-03-20 01:46:24 -07:00
Jonathan Herbert
9222bfa919
Fix BDSP V1.3.0 Suffix ( #3465 )
2022-03-16 08:01:25 -07:00
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