Commit Graph

278 Commits

Author SHA1 Message Date
nattthebear 25bdeb7f69 Use alloc_plain to allocate the md_cart space so it will be writable if needed
This lets us support mapper32k_w without needing extra hacks.  Because of lazystates, this doesn't hurt us on state size either (lazystates did not exists when we did 722358c1b1
2020-08-07 07:17:14 -04:00
Sappharad db0f2a65a1 Migrate to latest GPGX MD Cart mapper support 2020-08-06 21:40:43 -05:00
zeromus eee7d52c80 add waterbox readme notes concerning autocrlf and submodules 2020-08-06 15:56:05 -04:00
nattthebear 9600bc2ce0 ps2 - add fenv support and recompile dobie with it
This isn't so great, and could lead to nondeterminism or abi violations depending on how things use fenv.  For now it's just a dobie experiment
2020-08-06 07:28:24 -04:00
nattthebear 3db2818eb2 Rework a waterbox script slightly 2020-08-05 22:33:23 -04:00
nattthebear 96bee60cda nyma -- only ask the frontend for firmwares the core actually requests
Fixes #2240
2020-08-01 09:16:01 -04:00
nattthebear 78bf2285fc
Waterbox: Add pseudo-thread implementation and experimental DobieStation (PS2) core (#2263)
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.
2020-08-01 07:03:29 -04:00
zeromus fd30826655 experimental ffmpeg downloading: in place of the ffmpeg encode settings is a download form. This downloads it to the prescribed local location. It then checks to make sure it is the EXACT required version -- the only version we support 2020-07-24 22:25:00 -04:00
nattthebear 1c606c1eb6 waterbox - expose read-only information about the guest memory page table 2020-07-23 16:08:24 -04:00
nattthebear 356abf6c43 Really, actually, truly fix the waterbox savestate snafu, probably
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.
2020-07-23 15:20:04 -04:00
nattthebear e343f6bd26 Fix a complete savestate snafu in waterbox
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.
2020-07-23 13:30:58 -04:00
nattthebear 07c7c329d3
Experiment to speed up libco and hence libsnes (#2248)
The compiler now can fully inline the co_switch, and with most registers being specified as clobbers and not saved explicitly, the compiler can choose to save only what it needs to (we don't have to defensively save everything).

Practically speaking, the co_switch calls are usually inlined, but the functions they're in don't seem to be that big and don't make direct use of r12..r15 too much anyway, so (push r12..r15, switch, pop r12..r15) is a common emit.  But I see a miniscule FPS increase.
2020-07-22 16:13:19 -04:00
nattthebear c7e8744664 Add an extra exclamation point to indicate that code is VERY IMPORTANT
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
2020-07-18 11:54:05 -04:00
nattthebear 175556529e waterboxhost refactor
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).
2020-07-13 19:38:29 -04:00
nattthebear beb51ab286 Fix a linux waterbox-releated crash
Repro steps:
1) Load any waterbox core
2) Do anything that would trigger a NullReferenceException on C# side that you'd normally expect to be caught
2020-07-12 11:03:12 -04:00
nattthebear d354faeec1 probably fix linux waterbox issue 2020-07-12 07:49:18 -04:00
nattthebear 4639c1f2ca minor cleanup of calling convention adapters
sync the generator code with the generated code, remove useless endbr64 shit
2020-07-11 11:09:48 -04:00
nattthebear b0e6174467 minor cleanup 2020-07-08 13:54:47 -04:00
nattthebear a67fa70632 waterbox linux - rework to avoid possible memory leak
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
2020-07-08 07:22:15 -04:00
nattthebear c8985e3007
Waterbox: Stack Marshalling (#2209)
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.
2020-07-07 17:48:12 -04:00
nattthebear 3a18f6356d Rebuild all of waterbox as sysvabi, not msabi
This helps linux at the expense of windows, except it seems like windows gets a nice little speed up as well
2020-07-03 18:21:48 -04:00
nattthebear 2ee3125724 Refactor gpgx init method to use fewer arguments
Upcoming waterbox changes will likely limit the number of arguments a function can take to 6, which should be enough for anybody
2020-07-03 13:24:54 -04:00
nattthebear fa5885d7a1
Rewrite WaterboxHost in rust. (#2190)
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.
2020-07-03 11:45:59 -04:00
nattthebear c1caa3e346 More crusty progress 2020-06-28 10:21:36 -04:00
nattthebear 6ff2d801e6 memoryblock experiments continue 2020-06-23 15:01:49 -04:00
nattthebear 92525576cc more krusty krab 2020-06-22 18:15:11 -04:00
nattthebear b0007c83f4 more musings 2020-06-21 14:09:38 -04:00
zeromus 687704dc3c updated waterbox docs 2020-06-20 20:13:00 -04:00
zeromus 316aafed40 ss and pcfx dirs can be whacked (they belong to numa now) 2020-06-20 20:13:00 -04:00
zeromus 2fc8b91e45 rename pce and pce-fast to turbo and hyper 2020-06-20 20:12:46 -04:00
zeromus 27f9a70085 clean nyma zlib building stuff 2020-06-20 20:12:45 -04:00
nattthebear 3f6ffeb573 krusty 2020-06-20 18:07:17 -04:00
nattthebear 440a340cb5 remove what should have been ignored 2020-06-20 13:49:58 -04:00
nattthebear be81bc12c2 more wip 2020-06-20 10:30:41 -04:00
nattthebear 4f09ffcda9 doc cleanup 2020-06-20 05:59:43 -04:00
zeromus b842f3ed16 remove cgc (step 1) 2020-06-20 00:48:42 -04:00
nattthebear ffcb7cefb1 Move llvm to submodule 2020-06-19 20:56:17 -04:00
nattthebear ee6c2ba679 Watch babby's first rust program... one commit at a time
Working on some ideas to potentially replace WaterboxHost
2020-06-19 20:56:16 -04:00
nattthebear 23f8c2bbe6 waterbox: move location of llvm-project 2020-06-18 14:06:23 -04:00
nattthebear ecdfc66617 nyma big setting update
Moves a lot of settings around, hopefully addressing some concerns
2020-06-14 16:02:33 -04:00
nattthebear a28f2b2a45 waterbox buildscript changes 2020-06-14 12:35:18 -04:00
nattthebear 7ba3f6db03 saturn - fix crash in dead or alive
It does look pretty awful with interlacing, but that's not something bizhawk is equipped to solve at present
2020-06-14 10:15:05 -04:00
nattthebear f2b461bed1 nyma - overhaul some input stuff to support some more things
saturn guns and keyboards now work
2020-06-13 18:19:41 -04:00
nattthebear f2b79bb0c1 Fix saturn compilation issue
fixes #2124
2020-06-12 13:20:04 -04:00
nattthebear 8c06de56c2 saturn - support lag flag again 2020-06-11 14:47:26 -04:00
nattthebear f14dace4a0 Move saturn over to nyma, get latest version. 2020-06-11 12:17:10 -04:00
nattthebear 69e30ee33f Decrease state size in pcfx, pce, pce-fast 2020-06-09 10:09:17 -04:00
nattthebear 9bb56f0b5c move pcfx to nymacore 2020-06-09 08:15:06 -04:00
nattthebear 11e1019590 nyma -- support cd switching
motorcycle shifter, but neutral is before 1st instead of between 1st and second
Yes, I had to rebuild the non cd cores here, and I am sorry
2020-06-08 20:24:30 -04:00
nattthebear b11b50a950 all nyma cores: support constant size framebuffer
this will do lossless integer scaling using mednafen provided screen geometry data
2020-06-08 13:05:31 -04:00