Commit Graph

18276 Commits

Author SHA1 Message Date
YoshiRulz bcf5347823
Use C# 9 improvements to switch / "pattern matching" 2020-12-28 00:07:06 +10:00
YoshiRulz 96f9e8f6e4
Encapsulate MessageBox.Show using IDialogController and some helpers
a lot of the calls to `DialogController.ShowMessageBox` from `ToolFormBase`
inheritors could be replaced with `this.ModalMessageBox` (i.e. add self as
parent window)
2020-12-28 00:03:00 +10:00
YoshiRulz 9cafddb1e0
Minor cleanup to improve readability 2020-12-28 00:00:39 +10:00
YoshiRulz ce0ccd0cfa
Remove wget binary from assets
fixes a1253407e
2020-12-26 12:44:47 +10:00
SuuperW a928d1887f fix: Attempted to evict state 0, and attempted to modify collection while enumerating 2020-12-25 09:59:32 -06:00
YoshiRulz a1253407e7
Remove gamedb/update_gamedb.bat from assets (fixes #2529)
pulling the gamedb from master into an old version is a bad idea
2020-12-26 00:52:23 +10:00
YoshiRulz 62f90f11f2
Make anything inheriting FormBase slightly less ugly on Linux 2020-12-26 00:44:21 +10:00
alyosha-tas 515f5cf9b0 GBHawk: update RAM state for GBA mode 2020-12-24 19:45:44 -05:00
YoshiRulz 42fc895e12
Update EmuHawk project file
these files were removed in b9b1e2d23
2020-12-23 16:46:03 +10:00
YoshiRulz b9b1e2d237
Move Quantize to new external project, update upstream info 2020-12-23 16:37:47 +10:00
YoshiRulz faba9035b7
Update attribution of ported code 2020-12-23 15:55:50 +10:00
alyosha-tas 28c35a6274 GBHawk:set initial HRAM to 0, this provides consistent sync when clearing RAM on console, where as 0xFF does not 2020-12-22 20:20:00 -05:00
YoshiRulz 60d2bfa85c
Bump C# language level for ReSharper/Rider 2020-12-22 20:07:35 +10:00
YoshiRulz b9c9144358
Fix new dep not being copied to output, causing crashes
fixes 1e37350e9
I already fixed this before pushing but forgot to stage it
2020-12-22 19:57:55 +10:00
YoshiRulz 1e37350e99
Use NuGet package instead of copy-pasted code in BizwareGL/Borrowed
Our copy was equivalent to version 1.0.0 + a patch which allowed Stream instead
of requiring a filename, so I've used 1.0.2 as it has the author's
implementation of the same feature.
There are more recent versions available (note, 1.0.2 isn't for .NET Core).
NuGet: https://www.nuget.org/packages/Cyotek.Drawing.BitmapFont
Project repo: https://github.com/cyotek/Cyotek.Drawing.BitmapFont
2020-12-22 19:48:50 +10:00
YoshiRulz a5fd5f5d78
Return the tool from IToolApi.GetTool instead of its type
also affects Lua client.gettool; this has been broken for quite a while
2020-12-22 18:47:32 +10:00
YoshiRulz 5a098055d7
Fix Lua client.createinstance calling the wrong ApiHawk method
fixes e6cb74d31
2020-12-22 18:46:42 +10:00
YoshiRulz 03b4ae18e0
Move Virtual Pads schemata to Cores 2020-12-22 18:37:27 +10:00
YoshiRulz 790a09067e
Cleanup LINQ in VirtualpadTool.CreatePads 2020-12-22 18:34:27 +10:00
YoshiRulz 9124b0f3b5
Pass MessageBox.Show to Virtual Pads schemata as callback 2020-12-22 18:18:40 +10:00
YoshiRulz 0ff60220f7
Use enum to represent button images in Virtual Pads schemata 2020-12-22 15:35:26 +10:00
YoshiRulz 50b17096e1
Remove WinForms dep from Virtual Pads schemata 2020-12-22 14:07:28 +10:00
YoshiRulz 9168b59382
Add base interface for *CheckBoxEx and *RadioButtonEx controls 2020-12-21 16:58:49 +10:00
nattthebear 56b158e72a minor comment clarification 2020-12-20 21:06:22 -05:00
SuuperW b5b1e17851 Fix eviction logic for _gapFiller. (we were attempting to remove the wrong value from StateCache, and also weren't checking for reserved) 2020-12-20 18:06:50 -06:00
SuuperW 01bcf22802 Deal with this TODO. Removing from the StateCache here was removing extra frames. (frames between the old last gap frame and new last gap frame which were in another buffer) 2020-12-20 18:04:02 -06:00
nattthebear 55c08dc77f Revert "misc cleanups in neshawk boards, mostly removing redundant else's"
This reverts commit 2b5d0b6219.

A lot of these make things harder to read:

- Extra empty lines in large switch stacks mean they're more likely to go off one screen
- `if` and its condition on the same line is super hard to read, please never do that.  (Are the extra empty lines an attempt to mitigate the above)
- Removing terenaries obscures intent, and now there's more copy paste than before
- """Redundant""" else clauses on if...return kept things nice and lined up.

That was a huge churning diff with no value; let's stop it from spreading.
2020-12-20 15:26:08 -05:00
SuuperW 3d84812341
add a Lua method to get inputs from the movie (#2526) 2020-12-20 13:16:28 -06:00
adelikat 2b5d0b6219 misc cleanups in neshawk boards, mostly removing redundant else's 2020-12-20 13:12:51 -06:00
nattthebear 374f646f75 CoreInventory tweaks
When constructing a core using ConstructorInfo.Invoke, any exceptions thrown by the core are packaged inside TargetInvocationExceptions.  This has no value to us -- the fact that reflection is used is an implementation detail, and it breaks checking specific exceptions for specific information.  Accordingly, consumers have to deal with e.InnerException checks.  Fix this up so that we only expose the actual exception thrown.

In addition, undo a bad change in 6225e7854b that made the entirety of CoreInventory nonfunctional.
2020-12-20 09:15:22 -05:00
adelikat 7bb5506ba8 remove 2 deprecated nes library methods (add/remove game genie), they were marked deprecated for enough releases that I think we can go ahead and remove them 2020-12-19 20:17:26 -06:00
adelikat 6225e7854b a few cleanups in CoreInventory.cs 2020-12-19 20:07:09 -06:00
adelikat 68f9ac9730 remove unused usings in Emulation.Cores 2020-12-19 20:03:37 -06:00
adelikat aaa1c8e7a8 AutofireController - remove autofire flag that was always true 2020-12-19 18:55:22 -06:00
adelikat c730a78994 remove redundant null check before assigning null 2020-12-19 13:43:04 -06:00
SuuperW ec5e88c808 fix: loading a tasproj wouldn't set autofire (despite the gui showing it did) 2020-12-19 13:42:10 -06:00
alyosha-tas 3cc9684ebd GBHawk: better initial RAM state 2020-12-17 21:02:41 -05:00
adelikat fe5655d1e3 misc cleanups in BizHawk.Common 2020-12-15 17:54:44 -06:00
adelikat cb6ef03982 use explicit private/internal modifiers 2020-12-15 16:49:23 -06:00
adelikat b83556fc6f make fields readonly where possible 2020-12-15 16:00:55 -06:00
adelikat 213729550d remove redundant array initializers 2020-12-15 16:00:55 -06:00
nattthebear eeca40e072 libsnes: Cache region from core once at start
The region value in the comm struct is set once and then gets wiped out later.  I don't know what wipes it, but so many things have their hands on that, it's not surprising.  Someone knew about this and handled _mapper appropriately, but not _region.

Fixes #2503
2020-12-15 08:51:08 -05:00
alyosha-tas a8e2a420f0 GBHawk: cleanup 2020-12-14 19:32:22 -05:00
alyosha-tas 08f1b69197 GBHawk: prep for future audio work 2020-12-14 19:30:22 -05:00
alyosha-tas 3df6dfb350 GBHawk: update clearing screen for subgbhawk and linked modes 2020-12-14 11:41:19 -05:00
alyosha-tas b85e7cac2c O2; set released to true 2020-12-14 11:40:23 -05:00
nattthebear 1c27943707 Make SNES rom memory domain writeable
Use at your own risk
2020-12-13 20:11:58 -05:00
nattthebear fbee96c76b GPGX: Allow writing to rom memory domains
Don't let the diff fool you, a massive amount of work went into making this possible.
2020-12-13 19:49:04 -05:00
nattthebear 72ea5ce866
Waterbox: Allow SEH unwinding through guest calls. (#2519)
The goal of the separate stacks was to allow this, but I never quite finished the job.  Now, when a SEH exception (generally a Rust panic in a guest syscall handler, or a C# Exception in a callback) tries to unwind through guest code, it works.  Note that we don't actually unwind the guest stack, as there's nothing useful to be gained from that;  When an emulator core throws an exception like this, it should be considered completely hosed.  Throw it out and get a new one.

There were two bugs stopping this from working.

First of all, we had custom thunks that lacked sufficient unwind information for RtlUnwind to get through.  For the sysv <-> msabi adapter, this was fixed by making it regular Rust code instead of hand assembled junkus.  So the compiler generates valid unwind information for all of that.  Then we just JIT a small stub on top in the MsHostSysVGuest code, which needs no unwind information because it won't throw an exception itself and transparently passes execution to something with valid unwind information without invalidating that information.  (NB:  Clr JIT stubs use the same strategy.)  For the host <-> guest stack transition code, a small hand generated unwind stub was added to interop.s that is registered with `RtlAddFunctionTable`.  I've seen the unwind work successfully without this second set of unwind information, but better safe than sorry.

Secondly, our misuse of SubSystemTib caught up with us.  It's an old field, allegedly from OS/2, that we repurposed to hold TLS information needed for the waterbox stack transitions.  Most people think nothing uses it any more, but in fact if it's set to a non-NULL value, but doesn't contain valid information, `KERNELBASE!GetModuleFileNameW` will crash when it tries to get a module name from there.  The fix here was to simply tighten up our usage of SubSystemTib:  We were already nulling it out when returning from guest code, but not when calling back to host code in guest code.

Fixes #2487.  Unwinding of this sort has never worked well in waterbox; the reason why that issue is more recent is that the particular reproducing case of firmware didn't cause an exception in a callback in older code; the exception happened in pure managed code.
2020-12-13 19:12:16 -05:00
YoshiRulz fa6fd88d62
Import and use OSTailoredCode in DiscoHawk program class 2020-12-14 06:40:06 +10:00