Commit Graph

57 Commits

Author SHA1 Message Date
YoshiRulz e226ff102b
Replace dynamic type with Object in API
Using the dynamic type here is no better than object because the values are
primitive types -- more likely to be cast/typechecked than used as a receiver
param for a method call.
2020-04-13 17:05:38 +10:00
YoshiRulz 1ee131ed78
Merge ApiHawk project into Client.Common and EmuHawk 2020-04-12 17:40:42 +10: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
campbell000 373a05dcb4
Fixes joypad.set() method in Lua Console (#1898)
* Fixed lua joypad set method to accept button inputs with "P{controller}"
designations. Also allowed joypad set method to accept 0 or 1 as per
documentation

* Added comment
2020-03-24 12:40:18 -05:00
SuuperW c59d8130bb
DS Hawk (#1884)
* Add MelonDS.cs, support opening (but not really) .nds files.

* init MelonDS

* MelonDS: Load selected ROM.

* MelonDS: FrameAdvance and frame counter.

* MelonDS: IVideoProvider

* MelonDS: Add DLL files.

* MelonDS: IInputPollable

* MelonDS: IStatable (and add forgotten file MelonDS_InputPollable.cs)

* update libmelonDS.dll

* MelonDS: ISoundProvider

* Add NDS to Global.SystemInfo, and convert screen coords when running NDS.

* set up default NDS controller

* MelonDS: ISaveRam

* MelonDS: remove romlist.bin

* MelonDS: ISettable

* Create firmware folder if it doesn't exist on Windows; otherwise, an exception is thrown.

* Add database entries for NDS bios/firmware files.

* MelonDS: Use the bios/firmware files selected in BizHawk's "Firmwares" dialog.

* MelonDS: Re-work sync settings a bit.

* NDS's firmware file contains user settings; these are over-written by sync settings, so we shouldn't allow them to impact the hash

* MelonDS: Add (currently unused) bootToFirmware sync setting, and NDSSettings dialog.

* Update NDS firmware hash; it seems I had somehow corrupted mine.

* MelonDS: Use boot to firmware sync setting.

* MelonDS: Allow user to set some firmware user settings via the NDS settings dialog.

* MelonDS: Add singleInstance attribute to core.

* MelonDS: IMemoryDomains

* update libmelonDS.dll

* MelonDS: Set up default sync settings if none are provided.

* MelonDS: Allow user to reset settings to default.

* MelonDS: bios+firmware files are recommended

* libmelonDS.dll

* MelonDS: Don't use real time.

* MelonDS: Update to reflect new way of handling RTC in MelonDS.

* MelonDS: Notify if savestate load failed.

* update MelonDS.dll

* MelonDS: Allow user to set startup date/time in settings dialog.

* MelonDS: Create melon directory if it doesn't already exist.

* Don't include Designer's "fixes" in PR (partially reverts 56b474c00)

* Don't show a broken console window; alert user of need to restart instead.
This fixes an error related to MelonDS trying to use the broken stdout stream.

* update default NDS controls to match other updated controls

* Implement a system bus, using ARM9 read/writes.

* MelonDS: Allow BizHawk to change the contents of the frame buffer.

* update libmelonDS.dll

* fix stuff that was merged incorrectly, or was broken by merge

* update libmelonDS.dll
(includes memory leak fix)

* update libmelonDS.dll
(fixes memory leak and an occasional savestate crash)

* fix stuff that broke with the merge

* cleanups, remove stuff that is no longer needed by service interaces

* simplify DS MemoryDomains

* DS - fix order of controller buttons to be consistent with other consoles.  This probably breaks any existing movies made on this core, but those would have been experiments, right?

* NDSSettings - make min value for day and month 0, whiel those aren't "valid" values they are the default values in the core for whatever reason, better to not crash on load and not show a value that isn't actually the setting.  This can easily be reverted if the core changes to default to 1

Co-authored-by: YoshiRulz <OSSYoshiRulz@gmail.com>
Co-authored-by: adelikat <adelikat@tasvideos.org>
2020-03-21 10:53:30 -05:00
adelikat 6d5c444252 Move Global controller adapters into InputManager, it's a step in the right direction 2020-03-15 17:50:48 -05:00
adelikat edd8349dde fix typo in Global property 2020-03-15 17:09:11 -05:00
adelikat 9037c82985 use switch expressions on CoreSystemEnum converters, and add some enums that haven't been there for a long time (does anyone use this?) 2020-03-14 15:24:46 -05:00
adelikat 2c007e5049 remove a few more psp references 2020-03-14 15:18:58 -05:00
adelikat 079a0a4104 HeaderKeys - CONSTANTSDONTNEEDTOBEALLCAPS 2020-03-01 16:36:47 -06:00
YoshiRulz e5da8c765a
Move IController.ToDictionary extension to BizHawk.Emulation.Common 2020-02-28 13:26:27 +10:00
adelikat 5386b8b18c Client.Common cleanups - mostly using higher language features 2020-02-22 12:29:12 -06:00
YoshiRulz 4d4496af0d
Remove WinForms dependency from BizHawk.Client.Common (used in ApiHawk) 2020-02-19 04:13:37 +10:00
YoshiRulz 3afcf416e8
Follow attribute class best practices, cleanup docs on attributes 2020-02-19 03:54:50 +10:00
adelikat 4b50ea36e1 remove MemDomain CanPoke() extension method now that all it does is check the Writable flag which is better named and more conscise 2020-02-15 12:37:39 -06: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
YoshiRulz 593e1ef97d
Refactor external tool attributes 2020-02-01 01:54:23 +10:00
YoshiRulz 1fdb7a6fe2
Allow external tools to have any namespace / class name if annotated
This change is more convenient at the cost of a little duplicate code in
ToolManager. The annotation is [ExternalToolEntryPointForm], and having no more
than one such class per assembly is enforced.
2020-01-30 23:41:52 +10:00
YoshiRulz eab44d2d94
Add hack to EmuApi, add WIP external tool AutoGenConfig 2020-01-30 22:41:50 +10: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 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
alyosha-tas 46d0818f09 MSXHawk: Core interface stuff 2020-01-10 15:51:56 -05: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
YoshiRulz 264b27475e
Fix default referring to non-nullable type 2019-12-23 04:12:02 +10:00
adelikat b80b367831 refactor IMovie to expose the movie mode, and make extension methods that do IsPlaying type logic. This way there can be direct checks, and more variety of methods without cluttering the interface 2019-12-21 16:34:29 -06:00
YoshiRulz 0fcb6cbaa7
ApiHawk refactoring and cleanup
MemApi.ReadByteRange now returns the requested number of bytes and not 1 extra,
MemApi.ReadByteRange now warns only once per call for addrs outside range,
MemApi.ReadByteRange now warns for negative addrs (once per call; previous
implementation passed negative addresses to PeekByte), MemApi.WriteByteRange now
warns only once per call for addrs outside range, MemApi.WriteByteRange now
warns for negative addrs (once per call; previous implementation passed negative
addresses to PokeByte)
2019-12-17 02:39:04 +10:00
YoshiRulz 0b43b35427
Migrate GuiLuaLibrary to ApiHawk delegation
Changed param clear of IGui.DrawNew from bool? to bool (default value remains
true), made IGui and GuiLuaLibrary inherit IDisposable, added
GetDefaultTextBackground to IGui, applied fix from 6b3071d8a to
GuiApi.DrawString, replaced background box drawn by Lua API
gui.drawString/gui.drawText with what I think is a shadow (now matches
GuiApi.DrawString)
2019-12-16 16:54:06 +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 d955c468db refactor LuaHelper into an extension method class, and some nitpick cleanups 2019-12-15 09:05:33 -06:00
YoshiRulz f8dc18c1bd
Migrate SavestateLuaLibrary to ApiHawk delegation
includes backwards-compatible API change
2019-12-15 04:39:16 +10:00
YoshiRulz 104c17e77c
Prepare for EmuHawk-tied libraries to delegate to ApiHawk
Made ApiContainer inherit from APISubsetContainer, added
DelegatingLuaLibraryEmu, and reworked init logic in EmuLuaLibrary
2019-12-15 03:52:48 +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 24c3f3a7f0 Merge MemApiBase into MemApi 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
YoshiRulz 4a84e1a8a9
Migrate MovieLuaLibrary to ApiHawk delegation 2019-11-30 23:32:00 +10:00
YoshiRulz bd7dfbd487 Migrate MemorySavestateEmuLuaLibrary to ApiHawk delegation 2019-11-30 23:31:23 +10:00
YoshiRulz 8da543b1a5
Migrate EmulatorLuaLibrary to ApiHawk delegation
`emu.setrenderplanes(bool...)` now works when using BSNES or Genplus-gx
2019-11-30 23:31:18 +10:00
YoshiRulz 8ce403dab2
Mirror cleanup from 7aa170283 onto the C# APIs
also fixed VS' stupid comma placement and added a "using" in SqlLuaLibrary
2019-11-30 23:18:26 +10:00
alyosha-tas 61038a13ae O2Hawk: Expose Core and start running code 2019-11-18 17:33:55 -05:00
YoshiRulz a7ffdd948e
Add DelegatingLuaLibrary and set up ApiHawk instantiation 2019-11-16 17:19:04 +10:00
YoshiRulz fab882b7a5 Move most API interfaces and implementations to BizHawk.Client.Common 2019-11-16 17:28:25 +11:00
J.D. Purcell fec63fb66a Spaces -> tabs, fix mixed newlines. 2019-11-03 20:58:36 -05:00
feos 0247a8f1a8
mame core wip (#1705)
* add MAME to OpenAdvanced
* make mame launch games
limited to arcades that only need rom name. other devices require machine name and rom name, and won't run. nor they are meant to be supported anyway: we have enough emulators that do the job better for particular devices.
dunno if direct disk access will be avoidable, there are quite some files it might want to load other than the rom (parent rom, bios, artwork). trapping all of these might be a future task.
it is also known that mame can load "romname.zip" file just as well as "romname" folder, which would represent an unarchived zip. I make use of it to send it zip name with extension. it's easy, and we're not obliged to recognize mere folder paths in the mame-advanced-loader logic.
* ability to run lua code inside mame
2019-10-29 18:37:27 +03:00
alyosha-tas d2fe217869 GBHawk: expose 4x core 2019-10-04 13:52:29 -04:00
alyosha-tas 79c4b1e846 GBHawkLink3x: Initial Commits 2019-09-08 16:35:39 -04:00
Asnivor f0384b7e83 ChannelF: Extreme WIP! I promise nothing... 2019-04-16 16:10:56 +01:00
alyosha-tas 9296092b84 Vectrex: Start running the cpu and fixing bugs 2019-04-08 18:57:21 -05:00