Commit Graph

290 Commits

Author SHA1 Message Date
adelikat bee7f4f059 a2600 - remove some unused methods 2020-04-29 17:08:16 -05:00
adelikat 948a2341a2 a2600 - add aggressive inline on ReadControls methods, that were just above the 32il threshold, a noticeable speedup 2020-04-29 16:34:23 -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 1060bbc155 Atari 2600 - small speedup by checking for the eixstence of callbacks before calling them, also agressively inline the wrapper methods for read/write/execute 2020-04-21 13:39:17 -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 efb34f74e1 a2600 refactor - make mapper classes internal and sealed 2020-03-18 21:46:51 -05:00
adelikat f10b51558b Atari 2600 - make MapperBase abstract and make HardReset() abstract since we need implementations to properly reset variables (we can't get rid of hard reset so easily, since HardReset is the mechanism that multi-cart roms use 2020-03-18 15:58:53 -05:00
adelikat db6bbe22bb A2600 - expose CartRam memory domain for mCM and mFA 2020-03-18 15:48:32 -05:00
adelikat 8f860adf51 cleanup Atari2600 mapper code 2020-03-18 15:46:17 -05:00
adelikat a61230e4ab Atari2600 - refactor mapper creation logic to be a separate method with declared dependencies, remove an unused method 2020-03-18 10:52:53 -05:00
adelikat 8c10ca3e14 Atari2600 cleanup - pass Atari2600 core into constructor instead of setting after, use switch expression for mapper instantiation logic 2020-03-18 10:37:53 -05:00
adelikat c52bc603d7 Atari 2600 Mappers - remove useless HasCartRam virtual method, and simply check if CartRam.Length > 0 2020-03-18 09:23:43 -05:00
adelikat d953318160
Remove cbuffer (#1883)
* delete unused ShortBuffer

* convert IntBuffer to int[] in the Atari2600 core

* remove IntBuffer from NES mappers, and delete class

* convert ByteBuffer to byte[] in atari 2600 mappers

* remove ByteBuffer usages in NESHawk, remove ByteBuffer class

* remove Buffer.cs

* remove IDisposable from NES.NESBoardBase

* remove Dispose from Atari2600 MapperBase, note, it wasn't event being called
2020-03-18 08:55:02 -05:00
adelikat 095b22d489 refactor CoreComm usage in atari cores 2020-03-15 09:14:33 -05:00
adelikat da95c1f56f remove RomAnnotation fields on CoreComm and use the service instead 2020-03-14 22:10:57 -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
YoshiRulz 3afcf416e8
Follow attribute class best practices, cleanup docs on attributes 2020-02-19 03:54:50 +10:00
adelikat 48c9ada3e7 some misc cleanups in atari 2600 mappers 2020-02-18 07:23:21 -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 969642b6c7 add Get/SetCpuFlagsAndRegisters to MOS6502X, and have cores point to that, instead of the same boilerplate in each core 2020-02-16 17:44:52 -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
alyosha-tas 9d0f7568d4 A2600 finish keyboard controller 2020-02-07 16:18:50 -05:00
YoshiRulz 19b1578df9
Enable SA1200 and fix noncompliance
"Using directives should be placed correctly"
i.e. before and outside namespaces as per .stylecop.json
2020-01-25 19:36:49 +10:00
YoshiRulz ff2efca658
Cleanup Util 2020-01-23 14:54:34 +10:00
alyosha-tas 6ec1ce4d45 A2600: fix pitfall 2, needs a second look at some point though 2020-01-13 09:16:33 -05:00
adelikat f83261c116 misc cleanups in emulator core service logic 2020-01-11 13:19:51 -06:00
alyosha-tas f6695ad87c Atari 2600: fix audio in commando raid 2020-01-02 19:28:28 -05:00
alyosha-tas dd419e6768 Atari 2600: fix haunted house, read from invalid TIA address and expected open bus 2020-01-02 17:59:24 -05:00
alyosha-tas 8548859a67 Atari 2600: start work on keyboard controller (incomplete) 2019-12-31 18:37:10 -05:00
adelikat fef746dffa properly dispose of IDisposables in core savestate code, and a few other places 2019-12-06 17:33:17 -06:00
alyosha-tas 2750a420ef A2600: audio bug fix (Space Jockey) 2019-11-03 20:21:25 -05:00
alyosha-tas 0de16bc8b9 A2600: journey escape fixes #1614 2019-11-03 07:41:22 -05:00
alyosha-tas 520ba97caa O2Hawk start 2019-10-31 09:43:25 -04:00
James Groom 90b0574bc3
Remove unnecessary calls to ToList (e.g. in foreach)
squashed PR #1591
2019-10-13 15:50:57 +00:00
alyosha-tas 76df4758db A2600: update ball emulation
A7800: update m6532 to match 2600
2019-08-03 19:17:28 -04:00
alyosha-tas 6948b999f1 A2600: Fix ram buffer 2019-08-01 08:51:32 -04:00
alyosha-tas fca98ffe34 Various code cleanup 2019-07-21 09:05:07 -04:00
alyosha-tas 6a773ac272 Atari 2600: more bug fixes 2019-07-20 14:47:36 -04:00
alyosha-tas cf6cdf4ecc A2600: Bug fixes and Improvements 2019-07-19 20:03:30 -04:00
alyosha-tas 7df8ed1f27 A2600: Add HMCLR delay 2019-07-13 18:33:54 -04: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
alyosha-tas e60896c1b7 A2600: Refactor audio and savestate it. 2019-06-01 19:44:01 -04:00
alyosha-tas ca5585dfaa A2600: boost grip controller 2019-05-05 07:53:28 -04:00
James Groom 4e91f88af3
Use nameof in cores 2019-03-28 14:18:58 +11:00
alyosha-tas 939de46905 A2600: fix HMove 2019-02-03 10:13:51 -06:00
Brian Armstrong a8f293eec8 Call mem callbacks with addr, value 2019-01-24 03:23:21 -08:00