Commit Graph

363 Commits

Author SHA1 Message Date
adelikat 33a14327b7 move most logic from PathManager to extension methods in BizHawk.Common 2020-03-15 15:45:11 -05:00
adelikat 348cbd18df
Remove PathManager code that had dependencies on Globals (#1881)
* move one usage of Firwmare method into Firmware config where it is better suited

* PathManager - remove unused code

* move some PathEntry specific logic out of PathManger and into PathEntryCollection extension methods

* PathManager - detangle some exe pathing logic from Global.Config usage, clarify what a completely broken method should actuall do

* move more logic from PathManager to PathEntryCollection extension method

* move absolute path creation to PathEntryCollection, lots of refactoring and simplifying of PathEntries usage

* simplify PathEntryColleciton usage more

* simplify PathEntryCollection more

* break PathEntry classes into separate files, a bit of cleanup

* move Rom path logic out of PathManager into PathEntryCollectionExtensions

* move config UseRecentForRoms and LastRomPath into PathEntries, note that this is a breaking change for previous configs, those values will revert back to default values

* move SaveRamPath logic from PathManager to PathEntryCollections

* move cheats path logic from PathManager to PathEntryCollection

* move another method out of PathManager

* move some Retro hacks to PathEntryCollections, exposes more implicit dependencies

* move savestate logic out of PathManager to PathEntryCollection

* move more logic out of PathManager

* move some savestate logic out of PathManager, move most to MainForm where it is used, detangle some implicit dependencies from SaveSlotManager

* rename method

* move more logic from PathManager to PathCollectionEntry

* movie final Global.Config.PathEntries logic out of PathManager and into PathEnties
2020-03-15 15:12:36 -05:00
YoshiRulz bbb28525f1
Fix typo in switch expression
fixes up 18762c75e
2020-03-02 17:15:30 +10:00
adelikat 18762c75ee misc cleanups in Client.Common 2020-03-01 15:49:48 -06:00
adelikat 4bfb4ab00d
Gameshark refactor (#1867)
* first round of GameShark.cs cleanups, redundant code and stylecop cleanup

* simplify how gba readonly values are set

* a few more cleanups

* GameShark - use NESGameGenieDecoder for nes logic

* remove now unused NESGameGeneie tool

* Client.Common - move nes encode/decoder to a cheats folder

* GameShark - move genesis game genie coding logic to its own class

* remove NesGameGenieEncoder that i snow unused

* fix naming

* remove GenGameGenie in favor of using the unified Cheat Code decoder

* move Gameboy/GameGear decoding logic from GameShark to its own class, cleanup

* remove GBGameGenie, was only exposed via the toolbox, GameShark tool does all of this logic

* GameShark - move snes game genie decoding logic to its own class

* cleanup

* remove unused snes GameGenie tool

* move Gb GameShark decoding to its own class

* cleanup

* move Genesis action replay decoding logic to its own class

* cleanup

* cleanup

* cleanup

* cleanup

* move Sms ActionReplay decoding to its own class, cleanlup

* cleanup

* move snes action replay decoding to its own class

* cleanup with a helper method

* cleanup

* more cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* move Psx GameShark decoding to its own class

* Move saturn gameshark parsing to its own class

* cleanup

* cleanup

* move N64 decoder logic to its own class

* remove GBA cheat code that hasn't been ready for 5 years, easier to try to implement this in the re-architected code, so delete for now at least

* start to detangle GBA gameshark mess

* Gameshark - remove most gba cheat code functionality for now, easier to rebuild it later

* Gameshark - cleanup

* cleanup

* cleanup

* cleanup

* redesign nes decoder to simpler design

* simplify more

* convert psx and saturn decoders and simplify

* convert more decoders

* convert more decoders

* convert more decoders

* convert more decoders

* convert gba decoder

* convert more decoders

* convert and simplify N64 decoder

* GameShark - simplify more
2020-02-29 15:18:40 -06:00
YoshiRulz e5da8c765a
Move IController.ToDictionary extension to BizHawk.Emulation.Common 2020-02-28 13:26:27 +10:00
YoshiRulz 848eaabf46
Move CWD hacks to own class 2020-02-28 13:26:14 +10:00
adelikat 7e741b1200 misc cleanups in lua code 2020-02-26 17:06:04 -06:00
Devon R 0f7d292101
Fix an InvalidCastException being thrown when a double is unboxed as a float (#1863) 2020-02-25 11:33:28 -06:00
adelikat 5386b8b18c Client.Common cleanups - mostly using higher language features 2020-02-22 12:29:12 -06:00
YoshiRulz 3afcf416e8
Follow attribute class best practices, cleanup docs on attributes 2020-02-19 03:54:50 +10:00
adelikat 656f2b814e Move IEmulator extensions to the Emulation.Common namespace, the intent is that these are used and serve as built in functionality, so it's overly tedious to when most situations require both Common and an additional extensions namespace 2020-02-15 12:33:15 -06:00
adelikat d7f97b1539 actually delete things instead of removing them from the project 2020-02-08 13:09:27 -06:00
zeromus 3143c38b7d fix lua bit.arshift (fixes #1825) 2020-01-31 00:36:01 -05:00
YoshiRulz b80dd2fab7
Enable SA1113 and fix noncompliance
"Comma should be on the same line as previous parameter"
2020-01-25 18:06:50 +10:00
YoshiRulz bfde89b9f3
Enable SA1139 and fix noncompliance
"Use literal suffix notation instead of casting"
2020-01-25 07:55:48 +10:00
YoshiRulz a8170ca183
Fix mismatching namespaces 2020-01-13 07:19:06 +10:00
YoshiRulz 0f1fa1531f
Use ranges in ApiHawk and Lua 2020-01-13 06:57:24 +10:00
adelikat 038f35f45e lua - implement controller number parameter to joypad.getimmediate and movie.getinput, consolidate input getting lua code 2020-01-03 09:51:48 -06:00
YoshiRulz a8408ed3be
Improve exception docs in BizHawk.Client.Common 2020-01-02 21:51:27 +10:00
adelikat 8c0c00c2bf lua - movie.save() - fix bug that was preventing the optional filename parameter from being used 2020-01-01 17:03:01 -06:00
James Groom 78fcde9480
Merge branch 'master' into winhacksbgone 2019-12-22 17:01:10 +00:00
adelikat 1e41dbf20d LuaRegisteredFunctionsList - override Clear() so that needed clear logic can't be mistakenly not called. Fixes #1763 2019-12-21 17:16:16 -06:00
YoshiRulz 7ea8fb185a
Congregate, organise, and cleanup some Win32 imports and their usages 2019-12-21 18:21:51 +10:00
YoshiRulz 08d0f462fc
Partially migrate NesLuaLibrary to ApiHawk delegation
nes.setdispbackground and nes.setscanlines now throw when the core is neither
NesHawk or QuickNES (the latter is still silently ignored by these functions)
2019-12-16 17:47:50 +10:00
YoshiRulz 29ac251f34
Migrate SnesLuaLibrary to ApiHawk delegation 2019-12-16 17:14:10 +10:00
YoshiRulz 60daae50d5
Migrate GenesisLuaLibrary to ApiHawk delegation 2019-12-16 17:14:01 +10:00
YoshiRulz 8f93a954e1
Move Lua hacks to Lua libs
Changed parameter of IInputMovie.SetRerecordCount to ulong to match internal
2019-12-16 15:04:35 +10:00
adelikat ad8f321ea1 Add event.availableScopes(), fix LogWithSeparator, cleanup 2019-12-15 12:25:49 -06:00
YoshiRulz 05801dc2c5
Reduce LINQ usage in Lua subsystem 2019-12-16 04:08:22 +10:00
adelikat 91ef301a23 memory callbacks - log error if a scope is passed in that is not available 2019-12-15 12:02:43 -06:00
adelikat 9676fd97df cleanup 2019-12-15 11:52:55 -06:00
adelikat 1d741f3d0e memorycallbacks - rename domain param to scope to avoid confusion, otherwise it looks like any memory domain will do 2019-12-15 11:42:26 -06:00
adelikat 29e284c6f8 cleanup 2019-12-15 11:40:22 -06:00
adelikat 250bd2087e fix lua memory callback functions on cores with no system bus such as PSX 2019-12-15 11:37:45 -06:00
YoshiRulz 2f494003c7
Add param to IList.ToLuaTable extension and refactor bizstring.split
Changed behaviour when said Lua function is called with a misformatted separator
param, and updated its docs
2019-12-16 01:58:19 +10:00
adelikat d2f21f84e3 another extension method for lua table creation 2019-12-15 09:46:39 -06:00
adelikat 7ebfd42229 Simplify some lua table creation with an extension method 2019-12-15 09:22:10 -06:00
adelikat d955c468db refactor LuaHelper into an extension method class, and some nitpick cleanups 2019-12-15 09:05:33 -06:00
James Groom 3099a11a04
Merge branch 'master' into lua-via-apihawk 2019-12-14 16:17:14 +00:00
YoshiRulz 3f9b51f565
Partially revert #1754, add event.onmemoryexecuteany 2019-12-14 16:47:29 +10:00
warmCabin 201a4b85a4
remove default value for address
<adelikat> The reason we throw an error originally is my concern is that it would be easy to leave out an address in a script, and that it would have huge concequences.

<adelikat> I think address should not have a default value here and make the user explicitly add nil if they want this functionality.
2019-12-11 12:44:54 -05:00
warmCabin 715761f563
unit? 2019-12-10 23:23:40 -05:00
warmCabin e7374447f3
make onmemoryexecute address default to null 2019-12-10 22:59:35 -05:00
adelikat 5e73c7c536 lua - update memory documentation to mention it defaults to system bus, fixes #1675 2019-12-02 20:48:38 -06:00
YoshiRulz 230548cf35 Partially migrate MainMemoryLuaLibrary to ApiHawk delegation
`mainmemory.readbyterange` will now return partial data if the requested range
extends beyond the domain (invalid addresses are read as 0). Did not fix docs of
`mainmemory.readbyterange` which incorrectly claim the returned table uses the
memory addresses as keys i.e. addr..(addr+length) - it was and remains
0..length. `mainmemory.write_u8` will now check the specified domain's length
and not erroneously check the selected domain's length.
2019-11-30 23:33:54 +10:00
YoshiRulz b678e19041
Merge LuaMemoryBase into MainMemoryLuaLibrary 2019-11-30 23:33:46 +10:00
YoshiRulz 7d99071ac5 Migrate MemoryLuaLibrary to ApiHawk delegation
`memory.readbyterange` will now return partial data if the requested range
extends beyond the domain (invalid addresses are read as 0). Did not fix docs of
`memory.readbyterange` which incorrectly claim the returned table uses the
memory addresses as keys i.e. addr..(addr+length) - it was and remains
0..length. `memory.write_u8` will now check the specified domain's length and
not erroneously check the selected domain's length.
2019-11-30 23:32:09 +10:00
YoshiRulz b2676bce68 Copy LuaMemoryBase and merge copy into MemoryLuaLibrary 2019-11-30 23:32:09 +10:00
YoshiRulz 1042f746f4 Migrate JoypadLuaLibrary to ApiHawk delegation
`joypad.getimmediate()` now returns float controls as well as bools
2019-11-30 23:32:09 +10:00