Commit Graph

797 Commits

Author SHA1 Message Date
zeromus 5f25525a80 neshawk - fix poking wram (fixes ancillary unrelated issue in #1994) 2020-05-13 10:58:27 -05:00
alyosha-tas 2ef2f8f119 NESHawk: various loop optimizations, 5-10 fps improvement 2020-04-29 09:38:27 -04:00
adelikat d4c8615e95 remove unused usings and other redundancies 2020-04-23 20:33:18 -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 217f03f66d remove AggressiveInlining on Read_bgdata, still doesn't inline due to switch statement, so this attribute is doing nothing here 2020-04-21 10:30:10 -05:00
adelikat 26a68c0cbc NesHawk - aggressively inline Apu.EmitSample() also simplify it to reduce IL 2020-04-21 10:28:31 -05:00
adelikat 4386509f01 NesHawk - about a 5-10% speedp by using AggressiveInlining. Performance sensitive methods were analyzed, and I only added it to methods that failed inlining only due to the 32 IL byte limit but still reasonably sized. This attribute only lifts the 32 byte limit, it's important to do this analysis and not just apply this attribute with research. 2020-04-21 09:18:09 -05:00
adelikat b736d48911 use constants for core string names and simplify core core name getting logic 2020-04-18 09:55:57 -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 5c84c94a12 fix compile error in debug mode, oops 2020-03-20 21:05:44 -05:00
adelikat 7fb89aed18 NesHawk - move BootGodDb to its own file 2020-03-19 21:35:36 -05:00
adelikat 01584431c4 NesHawk - cleanup Unif.cs 2020-03-19 21:28:32 -05:00
adelikat 22f6df3a70 NesHawk - CartInfo - turn into properties 2020-03-19 21:20:53 -05:00
adelikat daab35fc39 NesHawk- move CartInfo into its own file 2020-03-19 21:15:07 -05:00
adelikat dc56dd87e8 simplify MapperPropAttribute 2020-03-19 21:12:23 -05:00
adelikat 291275fe8c NesHawk - move MapperPropAttribute to its own file 2020-03-19 21:11:01 -05:00
adelikat f8acb61136 NesHawk - make boards and related classes internal, and sealed where possible 2020-03-19 21:06:54 -05:00
adelikat 620c38af73 NesHawk - move some enums out of NesBoardBase, simplifies a lot of usages 2020-03-19 20:29:15 -05:00
adelikat 720a2dce02 NesHawk - move NesBoardImpl attributes to their own file 2020-03-19 20:21:29 -05:00
adelikat 0d4dd3855b NesHawk - more missing variables in savestates 2020-03-19 20:02:22 -05:00
adelikat 659831c534 fix missing savestate data in some NESHawk mappers, note this is a breaking savestate change for these boards, but they were broken anyway, these were critical fields to savestate 2020-03-19 19:51:59 -05:00
adelikat 8bcab5af79 NESHawk - break off INesBoard and NesBoardBase into separate files 2020-03-19 19:06:03 -05:00
adelikat d60a00d682 NES mappers - remove documentation comments in favor of the nesdev wiki link 2020-03-19 08:24:05 -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 c532b96245 refactor CoreComm usage in nes cores 2020-03-15 09:35:12 -05:00
adelikat da95c1f56f remove RomAnnotation fields on CoreComm and use the service instead 2020-03-14 22:10:57 -05:00
adelikat dd062b3ca7 replace CoreComm screenofsets with an emulator service 2020-03-14 16:35:54 -05:00
adelikat 6958ade3a8 nes ppu - have Reg_2000 depend on PPUREGS instead of PPU since that's all it's using 2020-03-14 10:32:59 -05:00
adelikat 4ababf383a NESHawk - PPUREGS - don't depend on PPU, move the one method that was using it out to PPU 2020-03-14 10:30:53 -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 cdcc1eabde use inline out variables in Emulation.Cores 2020-02-18 15:10:29 -06:00
adelikat dedd618db4 subneshawk - delete a bunch of code by using the underlying core for services, cleanup, and implement some services that were missing 2020-02-18 13:19:17 -06:00
YoshiRulz 3afcf416e8
Follow attribute class best practices, cleanup docs on attributes 2020-02-19 03:54:50 +10:00
adelikat 0ff2539da7 subneshawk - support DatachBarcode service 2020-02-18 11:52:24 -06: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 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
adelikat 8d662fcee3 more nitpicks in nes savestate code 2020-02-14 10:20:27 -06:00
adelikat e57be44fd0 nes savestates - dispose of IDisposables, simplify a bit 2020-02-14 10:12:52 -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 4ed402fc59
Cleanup some more files 2020-01-24 09:37:15 +10:00