Commit Graph

97 Commits

Author SHA1 Message Date
YoshiRulz 86829751aa
Scale VirtualPadAnalogStick correctly when the range isn't ~256 values 2020-07-20 03:18:49 +10:00
YoshiRulz ca646f87cf
Fix style problems, mainly docs 2020-07-08 02:17:31 +10:00
YoshiRulz 33d8f4a62c
Add RigidMultiPredicateSort to replace some .ThenBy() boilerplate
As documented, the class "Sorts using a single primary predicate, with subsorts
using the remaining predicates in order." So only the most recent
column-header-click is taken into account. I've got a WIP class in #if false for
providing the "remember which column headers I clicked and in which order"
behaviour, but it doesn't look like that behaviour actually exists in the
codebase?
2020-07-08 02:17:24 +10:00
nattthebear fa5885d7a1
Rewrite WaterboxHost in rust. (#2190)
This replaces the old managed one.  The only direct effect of this is to fix some hard to reproduce crashes in bsnes.

In the long run, we'll use this new code to help build more waterbox features.
2020-07-03 11:45:59 -04:00
YoshiRulz dddeab8e12
Refactor UndoHistory 2020-06-30 14:25:02 +10:00
YoshiRulz cba0eada69
More nullability 2020-06-30 12:57:57 +10:00
YoshiRulz 69146b04b2
Add and use DEBUG-conditional WriteLine methods 2020-06-26 14:37:36 +10:00
YoshiRulz 14e0c96fd8 Enable SA1121 and fix noncompliance
"Use built-in type alias"
2020-06-20 21:31:16 -04:00
YoshiRulz 135490c740 Enable CS1572, CS1574, and CS1734, and fix noncompliance
malformed references or wrong XML tag
2020-06-20 21:31:15 -04:00
YoshiRulz abcf91f7d6 A bit of Range cleanup 2020-06-20 21:31:15 -04:00
YoshiRulz f37b74c4ba Enable CS1570 and fix noncompliance
malformed XML
2020-06-20 21:31:15 -04:00
adelikat 249259d7b3 move QuickCollections to the PCEHawk core where it is used, since we don't expect to use it elsewhere, and one of it's advantages was speculating that being in the same assembly would give it good inlining, so being in a common library was negating this 2020-06-20 14:54:21 -05:00
adelikat dc656ccb23 remove unused extension method 2020-06-20 14:36:57 -05:00
nattthebear 1f966a4cc1 Fix potential crash on exit if certain native resources weren't disposed
Finalizers in SpeexResampler and QuickNes assume that the underlying native dll still exists when they run, as they have to in order to successfully clean up leaked memory.  This is not true if those resolvers, which were stored as static fields themselves, had been finalized, which can only happen on app exit (because the static fields were readonly and always kept their value).  If a SpeexResampler or QuickNes was never disposed and itself lasted all the way to app exit, then the order of these two finalizers would be unspecified and a crash could happen.

In normal circumstances, this was only observable in DS core because apparently Suuper couldn't copy paste properly and missed the dispose part, but that was already fixed in 129d454a67.
2020-06-19 23:10:56 -04:00
YoshiRulz 620e54580d
Enable CA1052 and fix noncompliance
"Static holder types should be Static or NotInheritable" (classes with only
static members should be static classes)
2020-06-18 09:43:57 +10:00
nattthebear fa4a95f1b1 Looks like this existed solely to support the old bsnes interop, which everyone agrees was awful and something we only did because we had to 2020-06-16 07:45:34 -04:00
adelikat 0c300cf5bf Remove our home-grown ReadonlyDictionary in favor of the built in .net one (as of 4.5 we have one of these built in), Gameinfo.GetOptionsDict() - return IReadonlyDictionary instead of Dictionary 2020-06-12 12:18:50 -05:00
YoshiRulz fefdf0d60a
More misc. cleanups in RomLoader 2020-06-08 02:06:52 +10:00
YoshiRulz b88f20faed
Rename Verison to BizHawk.Version, fixes #2101 2020-06-06 00:20:48 +10:00
YoshiRulz b56e229a45
Target .NET Standard where possible, restore Virtu TFM
fixes 5a0992c2b
2020-05-30 15:53:20 +10:00
zeromus 5a0992c2b7 make projects build only once (for net48). this will probably displease anyone working on targeting one of the other 50 frameworks, but they need to do that in another branch until they can figure out how to make it peacefully coexist; maybe by an alternate solution+project configuration (done in common props, ideally) 2020-05-29 17:45:07 -05:00
adelikat 22a2bb7dc8 see true for more info, but is anything really true? 2020-05-28 08:15:49 -05:00
nattthebear d13a1b54a2 code cleanup
Remove three Stream.CopyTo(Stream) variants that all did the exact same thing as the framework method Stream.CopyTo(Stream).  None of them were used anywhere.
2020-05-28 07:40:20 -04:00
nattthebear 04f86c2843 code cleanup
address a comment on a method called "ascii" that actually used utf8
2020-05-28 07:38:09 -04:00
YoshiRulz 3e5aa1a65f
Add Menees.Analyzers and update FxCop 2020-05-26 17:22:20 +10:00
YoshiRulz 7ae94c4300
Fix nullability of return type 2020-05-26 13:46:54 +10:00
nattthebear 8c9f4e24d8 settings infra 2020-05-25 12:49:34 -04:00
nattthebear 69d3dbc35f pce: basic rom loading and playing works 2020-05-25 12:49:33 -04:00
YoshiRulz 6e0148d921
Cleanup references 2020-05-21 17:25:35 +10:00
YoshiRulz ab1dca3e41
Fix NRE on passing empty string to LoadRom, simplify HawkFile creation
HawkFile now correctly sets FullPathWithoutMember to "" and Exists to false,
meaning RomLoader will return false instead of crashing.
2020-05-21 17:00:43 +10:00
adelikat 21e4d30f98 remove another string extension method that was unused, and consolidate classes 2020-05-19 19:37:52 -05:00
adelikat 6d7d36c1d0 delete HowMany() extension method and just use .Count() instead, the one value add of null/empty checking was never utilized anyway 2020-05-19 19:30:24 -05:00
adelikat 96b0b37673 consolidate and rename tests project into a single project, delete commented out tests, add a unit tests that tests a thing 2020-05-19 19:24:53 -05:00
YoshiRulz d91c477e5a Add test projects and solution using MSTest, add scripts, upgrade CI 2020-05-19 23:54:14 +00:00
adelikat 45fd7ee81e nuke most of SubstringExtensions, and make it where i can at least read it 2020-05-17 10:39:24 -05:00
YoshiRulz 0632560899
Split StringExtensions, fix and add to substring extensions 2020-05-17 23:02:30 +10:00
YoshiRulz e4563570f9
Cleanup RomLoader
splitting methods from LoadRom makes it ~150 LoC instead of ~850
2020-05-17 19:41:30 +10:00
YoshiRulz c248ee495a Replace ILinkedLibManager.LoadOrNull w/ LoadOrZero
see aa8fe56ef and 4baefd874
2020-05-16 11:41:58 +00:00
YoshiRulz 7afa4a2f98 Replace GetProcAddrOrNull with GetProcAddrOrZero
both in ILinkedLibManager and its inheritors, and in IImportResolver and its
inheritors; see aa8fe56ef
2020-05-16 11:41:58 +00:00
YoshiRulz 3e51bbe5c2 Revert "Fix up Nullable<IntPtr> brain damage"
This reverts commit aa8fe56ef9.
2020-05-16 11:41:58 +00:00
nattthebear aa8fe56ef9 Fix up Nullable<IntPtr> brain damage
It'd be one thing if we needed a sentinel value distinct from IntPtr.Zero but we don't.  It's a pointer, and 0 is globally understood to be The Bad Value.

Some brain damage remains:
* LoadLibrary abstraction also returns Nullable<IntPtr>
* I named it `Resolve` and not `GetProcAddr` because I didn't want to see win32 everywhere I went :(
2020-05-15 18:56:34 -04:00
YoshiRulz 7725d59636
Enable SA1124 "Do not use regions" and fix compliance 2020-05-15 17:00:53 +10:00
YoshiRulz 87ec2618a1
Revert "delete all regions"
This reverts commit e566d8e258.
2020-05-15 17:00:49 +10:00
nattthebear e566d8e258 delete all regions 2020-05-14 17:33:40 -04:00
YoshiRulz 1bded467b3
Replace $(SolutionDir) with $(ProjectDir) in src/ 2020-05-03 11:05:26 +10:00
YoshiRulz 5a8349b5a5
Update paths in projects (fixes build) 2020-05-03 10:58:35 +10:00
YoshiRulz 3a3b22c03b
Move projects to src subdir (breaks build) 2020-05-03 10:57:38 +10:00