Closed gamelaster closed 7 years ago
AFAIK, this is still "desktop apps only": https://msdn.microsoft.com/en-us/library/windows/desktop/aa366898%28v=vs.85%29.aspx
I read about them porting Node.js to use Chakra to take advantage of jit on Windows 10, which implies that v8 still won't work due to the lack of the necessary functions.
Is there any documentation indicating exactly how native ARM code can be written to, and executed from, memory on a device at runtime?
-[Unknown]
"VirtualAlloc and related APIs are available in Windows 10 Universal apps. Creating executable memory requires a capability, but there are no restrictions on who can get that capability."
When it is available in Windows 10 UNIVERSAL apps, then its must go at Windows 10 mobile (windows phone). Actually, i can look that, cause i running under Windows 10 and my WP too, i just need install a Visual Studio 2015, but maybe i wait to final version, i dont want RC :-D
And some other sources about its in Windows 10: http://forums.windowscentral.com/microsoft-news-rumors/223858-gaining-access-full-windows-apis-virtualprotect-metro-apps.html#post_3078907
A screen from Visual Studio 2015 Universal App. Yes, i know its in a C#, but anyway, the DllImport works, so its maybe it will be functionaly. (Friend taked a screenshot and he dont want to try it at C++ :D )
@GAMELASTER try it on the Windows 10 Mobile simulator or on an actual phone.
What Peter Torr says there seems a little hopeful, at least. Should be looked into at some point..
Bigpet: i must install our Visual Studio 2015 for debbuging, so its take some time. I will test it on phone ^^.
Well, i got funny results...
Universal C# App (Windows 10 desktop): Couse of wrong installed Visual Studio 2015 i cannot run a app :D Buut! I see the application has been installed! And its workz... (app dont crash) Soo its working :D
Universal C# App (Windows 10 Mobile): Well, this is good, deployed to my phone, but actually the system32.dll is not in ARM version haha :D well i go test a systemarm.dll :D (i maybe can found a good library for hook, i will see)
Universal C++ App (Windows 10 Mobile):
Well, here is unsuccessful build, but definitions exists, so its will be already just broken.. Need take time maybe :-)
Universal C++ App (Windows 10 Desktop):
Here is same trouble..
Well, after linking a system32.lib (its interesting its not linked by default) i successfuly runned a Windows 10 Universal C++ App with VirtualAlloc function with any crash so its working.
About a phone, application successfully builds, deploys into a device, but application crash. Maybe system32.lib (or .dll) dont exists on Windows Phone, but i didnt already found any replacement, so next waiting..
Happened to come across this issue while searching google for the status of JITs on Windows 10 ... so I'll leave my findings in case it's useful to you.
VirtualAllocFromApp and VirtualProtectFromApp say there is a "codeGeneration" capability which must be set for the app. In this video they say (around minute 17:50) that creating executable code pages is now allowed for store apps but its not clear if that also applies for windows phone.
So maybe it would "just work" if that capability is set for the process; the question is if this capability is allowed on phones.
@weltkante It sounds like it should work, but it's really very poorly documented. Last I looked I couldn't even find how to request the required capability.
But yes, this is probably our best hope of getting the JIT running on WinPhone.
I assume they mean the capabilities listed in the appxmanifest file.
Well, some time ago i writed question to MSDN: https://social.msdn.microsoft.com/Forums/windowsapps/en-US/bac37a70-c3b5-453e-a27c-a47a4e18df15/uwpwindows-10-mobile-system32lib-replacement?forum=wpdevelop#bac37a70-c3b5-453e-a27c-a47a4e18df15 But at that time, VirtualAllocFromApp for Windows 10 Mobile dont work! But now, when i tested it in real device, its works! Windows 10 Mobile 10536 Build + maked Jailbreak (i dont know if its needed, but maybe not).
Anyway, i tryied to run a PPSSPP Android version on Project Astoria (Windows 10 Mobile Built in Android Emulator), but its only change screen orientation and shut down.
Anyway, just copy a Visual Studio Project, change it to Windows Universal Projects, made some tweaks, force using of DX11 its will be usageable on Windows Universal Platform.
@GAMELASTER I am going to port it to UWP on Windows 10(including Mobile). It's not simply wrapping up the project into Windows Universal Projects then it'll work.
@MobWiMetro for item 1, can you swap the memory without damaging it? Basically, in ArmJit::Compile()
and possibly Arm64Jit::Compile
, etc., you'd mark the region as writable (but not executable), and then swap it back before completing.
You'd also need it initially writable, and then swap it after generating the fixed code. Note that we sometimes "patch" old code and invalidate cache (for example, block linking.) This will all be done inside Compile()
- we don't currently ever modify jit anywhere else, afaik.
For item 2, some effort has already been made (I think for Intel cards) in integrating ANGLE. I recommend looking at the forum and asking @Bigpet. It's probably ultimately better long-term to make a DirectX 12 or similar backend, but ANGLE is probably the quickest approach.
For item 3, it should not really be very different, except the input processing. All you need to do is tell PPSSPP about the touches and it will handle the rest already. It's not really different from any platform - here's SDL, and here's iOS.
There are also a few other platform pieces - opening the keyboard, launching the browser, haptic feedback, etc. Here's Blackberry. An important one can be audio - not sure if WASAPI will work as-is from the Windows code.
-[Unknown]
@unknownbrackets I will try before I can confirm that. Is the machine code generated from the JIT any ARM or Thumb-2 instructions? Windows on ARM only supports Thumb-2. https://msdn.microsoft.com/en-ca/library/dn736986.aspx#Anchor_3
We don't generate any Thumb instructions in our jits, only ARM. If that documentation still applies to Windows 10, which it probably does, expect problems. We expect the non-compact ARM instruction set to be fully usable on ARM processors right now.
We also of course use the improved ARM instruction set on armv8 (64-bit) CPUs too. This is the first time I've read anything claiming that ARM was "legacy" and Thumb was "the new order."
The vertex jit and texture hashing also use arm code. Some of the fast matrix math also. There may be other places, including some of ffmpeg.
-[Unknown]
@unknownbrackets FFmpeg has already been ported to Windows 10. https://blogs.windows.com/buildingapps/2015/06/05/using-ffmpeg-in-windows-applications/
Microsoft sets many obstacles for developers. The emitted opcode has to be changed from ARM to Thumb-2.
Ugh, that doesn't sound like a fun project. What a ridiculous decision by MS. ARM is just as fast as THUMB2 on pretty much all modern ARM cpus.
Well, this pushes the prospects of PPSSPP on Windows back even further. I'd almost rather wait for Windows ARM to move over to ARM64.
ARM mode is supported since Windows 10 Mobile, because of the modifications made to make Astoria possible
@kika123 Where can you find the evidence? Did MS mentioned this anywhere?
@MobWiMetro did you still porting this on WP?
@MobWiMetro the save/restore context routines were modified specifically for this case ;) Astoria is completly based on that capability
@kika123 Hasn't Astoria been abandoned?
@MobWiMetro the changes has been kept because of the Linux subsystem in Windows Server 2016, which also runs on ARM
@kika123 Do you mean the x86-to-ARM just-in-time (JIT) emulator? https://www.petri.com/windows-10-desktop-for-arm-is-in-development
@MobWiMetro no, that "Bash on Windows" stuff, which is Astoria rebranded AFAIK. x86-on-ARM was there in early Windows 8 on ARM builds
So it isn't astonishing that it will make a comeback
Hey,
I know, its has been more times before me asked.. But, now, Windows 10 coming.. Is still not possible to port PPSSPP for Windows 10 or Windows Runtime (cross..)??? I though by come of Runtime or W10 is must be allowed to use JIT.. :-)
Is possible to port that?
Thanks :-)