Commit Graph

459 Commits

Author SHA1 Message Date
adelikat e9cde4d93b GPGX - keep a savestate buffer for SaveStateBinary, yeah maybe it shoudln't be every cores responsibility, but until it doesn't, this greatly improves rewind and tastudio performance 2020-05-16 10:24:31 -05:00
zeromus 10bceeb0dc Nope, I think it's a good idea now.
Revert "This reverts commit c878c85daeaaf0cae3e28f24bc1a8b511293d7b6."
This reverts commit 1d1f2a18c6.
2020-04-23 21:20:59 -04:00
zeromus 1d1f2a18c6 This reverts commit c878c85dae. 2020-04-23 21:06:12 -04:00
zeromus c878c85dae for your consideration: sync settings return flags instead of a bool, so we can have more granularity in what needs resetting than just "reboot core". for instance, we would like to minimize the number of times the window layout is redone by not doing it when the screen settings havent changed. HOWEVER, while I was writing this commit message, I realized, I should probably do it just by being more cautious in kicking off the layout (unless the data coming from the core has changed, a layout shouldnt happen). So I am going to make this commit, in case it inspires anyone, and then revert it. 2020-04-23 21:05:56 -04:00
adelikat 325551ecd0 consistently check if callbacks exist before calling memory callbacks, across all cores 2020-04-21 16:42:57 -05:00
adelikat ce4037fad8 cleanup PopulateWithDefaultHeaderValues() 2020-04-14 17:15:46 -05:00
adelikat 2b281116ed misc cleanups 2020-04-08 16:03:35 -05:00
YoshiRulz 0ba7a5a7df
Rename axis-related types, members, and locals
I left a few methods where they had an equivalent *Bool*() for buttons, and also
left some in TAStudio that get serialised.
2020-03-31 17:29:55 +10:00
adelikat d3f37a5beb remove CoreComm.Clone(), it is now safe to pass around into subcores 2020-03-15 10:12:20 -05:00
adelikat 79aec475a9 refactor CoreComm usage in sega cores 2020-03-15 09:42:48 -05:00
adelikat 211883889b simplify CoreCom copying by implementing a Clone method, simplifies all the cores that have cores in them, this copies a lot more things than the original code had but it seems that's either fine or fixing broken stuff 2020-03-14 15:08:24 -05:00
YoshiRulz e12b5d8137
Refactor FloatRange creation and usage
effectively resolves #1200
* Replaced floats in FloatRange with ints (would have used shorts but
SubGBHawk/SubNesHawk use an axis to hack in cycle count or something), added
both Range<int> and Range<float> auto-properties
* Added bool field IsReversed to FloatRange
* Added enum AxisPairOrientation and factory method using it
* Cleaned up usages of FloatRange fields and properties
* Added new properties to PadSchema.ButtonSchema for type
PadInputType.AnalogStick (to hold the two FloatRanges) and used
ControllerDefinitions from cores to dedup these ranges in the schemata
* Made VirtualPadAnalogStick work properly: both the direction and bounds are
correctly set from the controller schemata, the polar conversion measures angles
consistently (though I think it might not work outside -128..127 e.g. for PSX),
and I didn't break the sensitivity override, plus negative percentages might
work now but I didn't allow those
* Renamed FloatRange to AxisRange, but did not rename related symbols
2020-03-14 20:47:45 +10:00
adelikat 46d05de51f nothing to see here 2020-02-28 12:52:48 -06:00
adelikat 185dbda19a misc redundant code removal, empty argument in object intiializer, redundant elses 2020-02-25 15:14:13 -06:00
adelikat cdcc1eabde use inline out variables in Emulation.Cores 2020-02-18 15:10:29 -06:00
YoshiRulz 3afcf416e8
Follow attribute class best practices, cleanup docs on attributes 2020-02-19 03:54:50 +10:00
adelikat 54ba1e12eb set get only properties in Emulation.Cores, and a few other simplfiications 2020-02-18 11:11:59 -06:00
adelikat 606c3bf1c2
use more advanced language features in Emulation.Cores (#1852)
* Use expression bodies in Emulation.Cores, and a few other misc cleanups

* remove unused usings in Emulation.Common

* cleanups in Tables_Direct.cs

* some cleanups in nes boards - redundant code

* remove some redundant array initializers in Emulation.Cores

* cleanup AmstradCPC.Controllers

* use object initializers in a lot of places

* nes mappers - remove disch's notes comments in favor of the nesdev wiki link

* cleanup CdtConverter.cs, mostly use of object initializers

* remove redundant .ToString() calls in Emulation.Cores

* using var in Emulation.Cores

* AmstradCPC/ZXSpectrum - simplify some linq, tabs instead of spaces, a few other misc cleanups

* Use null-propagation in Emulation.Cores
2020-02-17 16:54:51 -06:00
adelikat 27352a6f8e add Get/SetCpuFlagsAndRegisters to Z80, and remove all the boilerplate from related cores 2020-02-16 17:55:40 -06:00
adelikat da8199160d GGHawkLink - opt out of custom text states 2020-02-16 13:21:28 -06:00
adelikat 06d92f9824 if sms text states 2020-02-16 13:15:59 -06:00
adelikat 027dc01c8b
create StateSerializer as a base implementation of IStatable (#1850)
* create StateSerializer, an ITextStatable implementation using the Serializer class, and wire it up to the TI83 core

* wire StateSerializer to A2600 core

* wire up StateSerializer to AmstradCPC, C64, and ZXS

* wire up StateSerializer to MSX, A27800, and Coleco

* wire up state serializer to ChannelF, Vectrex, Intellivision

* fix GambatteLink to implement ITextStatable, implement TextSerializer in O2

* StateSerializer - wire up a loadstate callback and implement StateSerializer for NesHawk, a bit of rework to subNesHawk as a result

* fix subneshawk text savestates

* StateSerializer - implement byte[] buffer storing (optionally), wire up to PCE

* implement StateSerializer to SMS, tweak GGLink accordingly

* implement StateSerializer in GBHawk, fix link cores accordingly

* StateSerializer - use Serializer static methods to create serializers
2020-02-16 12:05:57 -06:00
adelikat 4b7a7dd293
Make Binary states default and Textstates opt-in for cores (#1848)
* Rewind & State config - remove the default option

* remove the savestate type of default, not that this is a breaking config change for anyone that had specifically set savestates to text

* remove BinaryStatesPreferred from IStatable and use config setting when starting movies from "Now" in record movie dialog

* remove BinaryStatesPreferred from cores

* make text savestates an extension method off of IStatable and an inteface ITextStatable it uses if the core implements it. This will allow cores to opt in to text states if desired

* make cores with actual text savestate impleemntations get ITextStatable, remove text state logic from cores that just have a binary as as text implementation
2020-02-15 10:22:26 -06:00
adelikat e6e1962b54
Convert SMS settings to use GenericCoreConfig (#1816)
* refactor Sms settings including naming conventions and fix a typo, breaks configs with SMS settings already saved

* convert SMS controller type setting to an enum

* convert SMS Region setting to an enum

* Move SMS display type setting to an enum

* convert sms settings to properties

* SMS - wire up generic core config to a settings menu item

* remove some SMS menu items that are redundant to generic settings config

* remove more SMS menu items that are now redundant to generic core config

* remove more redundant SMS settinsg including SMSGraphicsConfig dialog, add descriptions and display names to SMS settings objects
2020-01-26 12:56:54 -06:00
YoshiRulz 24e6cc14f0
Enable SA1206 and fix noncompliance
"Declaration keywords should follow order"
2020-01-25 19:37:28 +10:00
YoshiRulz b1e02fbdce
Enable SA1106 and fix noncompliance
"Code should not contain empty statements"
i.e. don't put a semicolon there
2020-01-25 18:06:34 +10:00
YoshiRulz 6f3f01125c
Enable SA1504 and fix noncompliance
"All accessors should be single-line or multi-line"
i.e. no block form on one line
2020-01-25 14:56:56 +10:00
YoshiRulz c7801b8ce2
Move BizHawk.Common.BizInvoke namespace to separate project 2020-01-23 14:54:23 +10:00
YoshiRulz a8170ca183
Fix mismatching namespaces 2020-01-13 07:19:06 +10:00
adelikat 6cb2ac635d GGHawkLink - fix bug in Saveram creation 2020-01-11 13:19:51 -06:00
adelikat f83261c116 misc cleanups in emulator core service logic 2020-01-11 13:19:51 -06:00
YoshiRulz 580aa2eaf9
Refactoring and cleanup of dynamic lib loading
Also fixed error reporting in WindowsLLManager, and fixed bug in
MednaDisc.CheckLibrary
2019-12-21 18:22:58 +10:00
adelikat 71aaf349b5 Fix GPGX one off hack to fix trace logger, and instead do a less bad hack in CallbackBasedTraceBuffer 2019-12-15 12:13:10 -06:00
adelikat a5d7c98daf some gpgx code cleanups 2019-12-15 11:50:21 -06:00
adelikat fef746dffa properly dispose of IDisposables in core savestate code, and a few other places 2019-12-06 17:33:17 -06:00
feos 5ca08b6c29
Camhack support (#1725)
for the camhack to work we have to save a state, hack memory, advance twice to see the changes, then load the state to prevent desync. since we can omit the framebuffer in savestates, loading them can happen without updating the screen, so the hacked camera remains visible.

advancing 2 frames automatically is done like tastudio does it when it seeks to a frame, only from lua now.

and the most questionable part is "invisible emulation", which is how Gens calls this IIRC, when everything that can distract or slow us down is skipped: sound, video, tools updates.

new lua functions:
- client.invisibleemulation()
- client.seekframe()

* for a test, mGBA core uses fake video and audio buffers and renders to them when we want to "skip" rendering. proper setup would involve actually skipping rendering those inside the core.
* allow disabling video and audio updates for gpgx too (proper approach, no fake buffers involved)
* add the script for Sonic Advance
2019-11-23 12:27:14 +03:00
J.D. Purcell fec63fb66a Spaces -> tabs, fix mixed newlines. 2019-11-03 20:58:36 -05:00
alyosha-tas fca98ffe34 Various code cleanup 2019-07-21 09:05:07 -04:00
YoshiRulz 4dd40305bc
Merge branch 'master' into interp_cores 2019-06-15 02:11:24 +10:00
James Groom 067477ce18
Merge branch 'master' into clean_docs 2019-06-14 13:28:39 +00:00
Brian Armstrong a21297f16a more flags 2019-06-06 02:14:09 -07:00
Brian Armstrong 2c6ecb68bd Merge branch 'master' into brian/mem_callback_addr_value 2019-06-06 02:11:04 -07:00
Brian Armstrong d41bd867b8 flags 2019-06-06 02:04:47 -07:00
YoshiRulz 2642ef4049
Remove empty docs 2019-06-06 16:41:10 +10:00
alyosha-tas be0f5f81cc GG: Link support initial capability 2019-05-08 17:39:15 -04:00
YoshiRulz 9af93be0d3
Use string interpolation 2019-04-04 02:41:18 +10:00
YoshiRulz 7fb8051426
Use string.Concat/string.Join 2019-04-04 02:17:00 +10:00
James Groom 4e91f88af3
Use nameof in cores 2019-03-28 14:18:58 +11:00
alyosha-tas 6d0973ca7e
Merge pull request #1429 from YoshiRulz/master
Inconsequential changes (no whitespace)

looks good to me
2019-03-09 17:32:10 -06:00
James Groom bf423747a5
Fix typo 2019-03-09 00:07:30 +10:00