* update melon
* frontend work
* make this work (i think?)
* fucking merge conflicts
* bleh
* hack up DSi support, very hardcoded atm, but at least states are reasonable
* add IS_DSI load flag
* frontend work bleh
* oops forgot to push
* ok fine apparently that doesnt display right
* oops
* prevent zealous release screen calls, DSi firmware seems to not like it?
* support for loading DSiWare title
* dsiware
* oh right this bullshit
* oops
* will this work
* why the fuck was this signed
* 0 out these hashes, these are also unique per console, no hope verifying these
* testing...
* more testing...
* this is probably a bad idea
* well this probably fixes state size issues
* time to debug this
* oh derp it's just not enough memory in invis heap
* let's see if this works?
* apparently this breaks slow ppu?
* testing...
* testing...
* testing...
* sanity checking
* let's try again
* i do not know what the fuck is up with this emulator nor do i care enough, state size is still under a mb anyways with slow ppu
* oops forgot to commit this
* resolve some issues
* tweak memory allocation sizes
* dont save more cache stuff
* wtf was i even thinking here
* move comment back to original pos, comment on double loading
* nymashock wbx
* shit
* lagflag stuff
* saveram stuff
* debugging how this works
* lets see if this works better
* fuck strings
* ok let's do this right i think
* probably have this all working
* get repo in
* add nymashock to build scripts
* also update this readme
* get rid of this default, seems to break internally anyways?
* ""fix"" dualshock (wtf to do with rumble???), make override defaults actually default, add hack to allow for overriding default controllers
* hide useless rtc settings
* hack fix override defaults for controllers, get something going for nyma psx schema
* oops dont forget this
* make fucking default controllers hack work (what the fuck is this code???) also complete schema and mnemonics
* FUCKING FIX THIS BULLSHIT DEFAULT
* let's make this a little nicer
* add mnemonics for □/△/○, fixes weirdness with input display
* fix weird overscan issues when multiwidth + no-interlacing happens at the same time
* do this "properly"
* analog mnemonics
* default controls for dualshock/gamepad filled
* set nymashock as preferred core
* apparently this didnt get committed?
* update README too
* control name fix
* Revert "control name fix"
This reverts commit a3cae89b18.
Co-authored-by: YoshiRulz <OSSYoshiRulz@gmail.com>
* emu83
* builds and get rid of wtf this thing is
* multidisk bundler for ti83
* release
* link src
* also put in the commit hash why not
* Nitpicks
* update ""rom"" extensions for ti83
* don't forget to set a preferred core
Co-authored-by: YoshiRulz <OSSYoshiRulz@gmail.com>
* basics for sameboy
* lol
* bleh
* lol
* push this in
* push this in
* settings, and also update sameboy bootroms
* bleh
* build linux
* remove some debugging shiz
* fix the order of this
* debug stuff also do gpu palettes right
* use new key mask API
* push shit in
* bleh
* add in replacement impl for joypad, use until opposing directions are allowed upstream
* update
* finally get this working without needing GB_INTERNAL
* hook up acc controls
* oops
* oops x2
* oh right this doesn't use this
* finish this up
* also mark this as released
* cleanups
* Nitpicks
Co-authored-by: YoshiRulz <OSSYoshiRulz@gmail.com>
* BSNESv115+: get rid of input_state + input_poll; just poll
* call `snes_controller_latch` on latches done in the core,
- this now also actually calls the InputCallbackSystem
- needed some edits in the core to support executing the callback even when no controller is connected in port 1
* Fix and somewhat normalize the SnesCallbacks order
- saveram was not working at all on certain roms, as the "CARTRIDGE_RAM" memory domain was returning a null pointer (similar thing for "CARTRIDGE_ROM"; changed it to correctly return the current rom)
- add sa1_bwram domain for clarity and an SGB_ROM domain
* Actually working callbacks
now actually work after natt's changes
* Set whether memory hooks exist every frame to prevent unnecessary function calls if not
* Maze/Hangman mappers working (SRAM2102)
* Fixed console buttons ones-compliment bug
* LagFrame detection
* NTSC/PAL SyncSetting
* Started adding mappers for all games
commit af7cadfce4b750f8b1b23476c281bd2dfe027225
Author: CasualPokePlayer <50538166+CasualPokePlayer@users.noreply.github.com>
Date: Tue Nov 2 22:43:21 2021 -0700
right, rename these too
commit e27197d18ad33af53729b1a57ee4a048189c41c4
Author: CasualPokePlayer <50538166+CasualPokePlayer@users.noreply.github.com>
Date: Tue Nov 2 22:40:42 2021 -0700
build
commit 1af068f11f553ade70999fb2c640ee98e054aa36
Author: CasualPokePlayer <50538166+CasualPokePlayer@users.noreply.github.com>
Date: Tue Nov 2 22:37:28 2021 -0700
new way to do mic input for melonds
* sgb meme
* various sgb fixes, add hard reset support for spc, make frontend provide spc file
* sgb border support, mostly copied from sameboy
* add support for disabling sgb border, also fix dumb when disabling border
* state work, states seem to be broken tho
* fix dumb state issue
* multiplayer
* fix dumb in spc stating
* misc
* pass SGB tests
* oh right I have to fix this too
* and this dumb too
* attempt to fix weird crashes
* or maybe this will fix it?
* wtf is spc doing?
* rebase
* misc state + debugging stuff
* finally fix weird assertion failure
* factor out loading in spc file, also factor out the ipl
* oops
* init special sgb colors for certain games
* slight sgb audio refactor
* this should work better?
* oops
* switch back to master
* super penguin
* [Gambatte] Port setregs from upstream, implement SetCpuRegister, misc cleanup/fixes elsewhere
* [Gambatte] Add more proper uninitalized AGB WRAM, based of a GBP dump
* cleanup Gambatte's CpuSetRegister (credits to stringflow)
* additional Gambatte code cleanup
* [Gambatte] cleanup tracelogger code readability
* fix
* Initalize VideoBuffer with a white screen instead of a black screen, misc video fixes
* misc cleanup
* [Gambatte] hdma work
* [Gambatte] add warning for recording a movie without a bios enabled. doing this as I am annoyed enough from disabled bios being the default and you cannot say anything about the profile system since recent submissions have shown that ineffective
* misc cleanup
* [Gambatte] init state tweaks
* [Gambatte] add setting for patching similar bioses
* fix this
Co-authored-by: TiKevin83 <travismcgeehan@gmail.com>
Co-authored-by: alyosha-tas <alexei.f.k@gmail.com>
* Wire up host haptics, but only for OpenTK which doesn't support it
and I'm hijacking the Fast Forward hotkey too
* Fix Mupen 64 Vibration DLL
* Enable Mupen 64 Vibration for DirectInput
* Remove unused SDL dep from Mupen input-bkm plugin
this allows it to be built without checking out the deps submodule, I guess
* Fix <OutDir/> in Mupen lib projects
* Remove "Debug" haptic channel and debug hotkey, prepare Mupen
* Fix remaining merge conflicts
* ...with the correct channel name
and hopefully no dangling whitespace changes
* Fix typo from resolving merge conflict, and off-by-one error
Co-authored-by: YoshiRulz <OSSYoshiRulz@gmail.com>
* Support null (any) address for N64 breakpoints.
Fixes#2808
* Move null check for better readability.
* Replace debugger mutex with semaphore that counts debug steps.
This is taken directly from upstream m64p. If breakpoints are being hit fast enough and in large enough quantity, m64p always ends up getting into a deadlock. The semaphore seems to resist this problem.
* Remove tabs
* add support for more SGB firmware
* replace illegally provided bootroms with legal homebrew bootroms
* let's swap these with homebrew bootroms too
* add builds
* this should probably be preferred
* Fix incorrect assignment
* Fix whitespace changes to Designer files
Co-authored-by: Morilli <35152647+Morilli@users.noreply.github.com>
Co-authored-by: YoshiRulz <OSSYoshiRulz@gmail.com>
- also patched out the left/right and up/down handling in the core, where it didn't belong
- also fixed the existing payloadcontroller because it wasn't working at all lol
* slightly fix gambatte peeking
* fix gambatte layer masking, move layer masking to sync settings (these settings affect sync, they shouldn't be normal settings)
* block toggle layer hotkeys when movie recording
* refactor Gambatte's RTC
* add a way to set an inital RTC state during a movie recording
* prevent Gambatte from saving RTC data when recording a movie, needed to create save-anchored movies
The goal of the separate stacks was to allow this, but I never quite finished the job. Now, when a SEH exception (generally a Rust panic in a guest syscall handler, or a C# Exception in a callback) tries to unwind through guest code, it works. Note that we don't actually unwind the guest stack, as there's nothing useful to be gained from that; When an emulator core throws an exception like this, it should be considered completely hosed. Throw it out and get a new one.
There were two bugs stopping this from working.
First of all, we had custom thunks that lacked sufficient unwind information for RtlUnwind to get through. For the sysv <-> msabi adapter, this was fixed by making it regular Rust code instead of hand assembled junkus. So the compiler generates valid unwind information for all of that. Then we just JIT a small stub on top in the MsHostSysVGuest code, which needs no unwind information because it won't throw an exception itself and transparently passes execution to something with valid unwind information without invalidating that information. (NB: Clr JIT stubs use the same strategy.) For the host <-> guest stack transition code, a small hand generated unwind stub was added to interop.s that is registered with `RtlAddFunctionTable`. I've seen the unwind work successfully without this second set of unwind information, but better safe than sorry.
Secondly, our misuse of SubSystemTib caught up with us. It's an old field, allegedly from OS/2, that we repurposed to hold TLS information needed for the waterbox stack transitions. Most people think nothing uses it any more, but in fact if it's set to a non-NULL value, but doesn't contain valid information, `KERNELBASE!GetModuleFileNameW` will crash when it tries to get a module name from there. The fix here was to simply tighten up our usage of SubSystemTib: We were already nulling it out when returning from guest code, but not when calling back to host code in guest code.
Fixes#2487. Unwinding of this sort has never worked well in waterbox; the reason why that issue is more recent is that the particular reproducing case of firmware didn't cause an exception in a callback in older code; the exception happened in pure managed code.
* post-build step moves .exes up a level, to output
* also fixed OpenTK.dll.config location
* also removed redundant step from packaging scripts
* future executables need to be capable of resolving assemblies in dll
* Move .so libraries to dll dir, update some build scripts
* Move OpenTK.dll.config with OpenTK.dll
* Keep EmuHawkMono.sh in Windows-built artifacts
* Add Package.sh to match QuickTestBuildAndPackage.bat
used as `Dist/BuildRelease.sh && Dist/Package.sh`
* Update GitLab CI to use Package.sh
A2600 standard controller and A7800 standard controller were using the same
keybinds, now only Atari2600Hawk uses those and A7800Hawk's are blank unless
configured manually or configured on config regen
Waterbox supports threads now, but they're not real threads on the host side because that's complicated and can be nondeterministic. Instead, everything is scheduled to share one host thread. This means that scheduling is actually cooperative and certain patterns of spinlocks and other nonsense can fail to work at all, but "regular" code probably will.
With this, add DobieStation PS2 core. This core was selected because it has threads and is otherwise simple to port; easy to build and a good core/frontend separation. It's not a wonderful core however, with low speed (made abysmally lower by our lack of real threads) and low compatibility, so it remains a curiosity for now.
The description in the previous commit is accurate, but the problem runs deeper and was on the whole a complete failure for me to appreciate the difference between active and swapped in on memoryblocks. Bleeecch.
This was broken by 175556529e, with two related issues: When we allowed for some operations to happen even when the block is inactive, we didn't account for the fact that in swapin, the block technically is not active yet (the lock is not on the self), and similarly in swapout, the lock has already been moved out of self. The former caused all memory areas to revert to RWX at the host OS level after a swap, so no dirty detection was done. After the former was fixed, the latter caused saved costacks to still get missed.
At the same time we ran into a perfect storm with costacks on Windows; if a stack page is not yet dirty, but we hit a fault for something else, Windows will not call our VEH handler unless the TIB stack extents are satisfactory, since it needs userspace to fix up the TIB extents via VEH or SEH handler, but there's already an exception pending.
This broke any waterbox core that called in to native code in the same EnterExit() right after sealing. All nyma cores were broken, 32x was not, didn't check the rest. Regressed in 175556529e.
It worked fine in release mode, theoretically
Set up a second mirror of guest memory; easily accomplished because we were already using memfd_create / CreateFileMappingW.
This lets us simplify a lot of host code that has to access guest memory that may not be active right now, or might have been mprotect()ed to something weird. Activate is only needed now to run guest code, or when the C# side wants to peer into guest memory for memory domains and such (waterboxhost does not share the mirror address with the C# side).
Bizhawk never would hit this because it only ever runs waterboxes in one host thread, but an application that spun up many threads and ran waterboxes in each would leak 32 bytes of heap for each native thread destroyed, which is super duper not really meaningful at all
Waterbox guest code now runs on a stack inside the guest memory space. This removes some potential opportunities for nondeterminism and makes future porting of libco-enabled cores easier.
This replaces the old managed one. The only direct effect of this is to fix some hard to reproduce crashes in bsnes.
In the long run, we'll use this new code to help build more waterbox features.
gpgx upstream automatically gives 64KiB sram to every game of size 2MB or lower, unless specifically overrided. That sucks and we don't do it. But some games do need it; there's not enough information to autodetect otherwise. So add a flag that we can set in gameDB for it, and set it true for two known games that have problems otherwise.
* 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>
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
This doesn't compile because of Input.cs, didn't know what to do. Also search for Merge TODO for some commenting things that probably need to be deleted
# Conflicts:
# BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj
# BizHawk.Client.EmuHawk/CustomControls/InputRoll.Drawing.cs
# BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs
# BizHawk.Client.EmuHawk/Program.cs
# BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs
# BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs
# BizHawk.Client.EmuHawk/tools/ToolHelpers.cs
# BizHawk.Client.EmuHawk/tools/ToolManager.cs
# BizHawk.Client.EmuHawk/tools/TraceLogger.Designer.cs
# BizHawk.Client.EmuHawk/tools/TraceLogger.cs
# BizHawk.Client.EmuHawk/tools/Watch/RamSearch.Designer.cs
# BizHawk.Client.EmuHawk/tools/Watch/RamSearch.cs
# BizHawk.Common/BizInvoke/DynamicLibraryImportResolver.cs
* Move PlatformSpecificLinkedLibs and implementations to common and rename
* Specify file ext. at LoadPlatformSpecific call site
* Move Client.Common.Global.RunningOnUnix to PlatformLinkedLibSingleton
* Inline var Resolver
* Use PlatformLinkedLibManager internally
* Move plugin load check to LinkedLibManager, use LinkedLibManager
* Interpolate
* Return exit code from dlclose/FreeLibrary
* Skip all calls to externs in BlipBufDll when using mono
* Use PlatformLinkedLibManager in SevenZipLibraryManager
* Add expected return value to workaround (from testing on Win32)
* Remove ".dll" from DllImport attr, remove temporary workaround, see desc.
The library can be built by changing the output file name in
`.../blip_buf/Makefile` to `libblip_buf.so`, and running `make`. It will be
loaded if placed in the `.../output` folder.
* Remove unused code, add TODO (this class is req. for Waterbox.PeWrapper)
The TODO is to [rewrite with
C#](https://docs.microsoft.com/en-us/dotnet/standard/io/memory-mapped-files)
instead of importing from `kernel32.dll`.
* Update OpenTK again but better (for #1384)
* Add Mono run script
* Add libblip_buf.so (temporary)
Temporary because it should be a separate package which BizHawk depends on.
* Add distro detection, add "already running" and "unknown distro" messages
* Gray-out Lua Console on Unix
* Extract superclass from EmuLuaLibrary, add shell implementation for Unix
* Specify libdl version, Fedora doesn't have the versionless symlink
* Remove empty `ToolStripMenuItem`, null `Text` caused crash on Unix
* Transform OpenTK keyboard input into a `List<KeyEvent>` and read that
Also fixes crash on rebind
* Remove debug `using ...;`
Adds a small script which, when run, only allows input to P1's controller if both P1 and P2 holds down the specific button simultaneously. Also useful since it demonstrates joypad manipulation.