mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
UWP: Purge Windows Mobile
This commit is contained in:
11 files changed
+21
-101
No files matched your search
@@ -293,9 +293,6 @@ D3D11DrawContext::D3D11DrawContext(ComPtr<ID3D11Device> device, ComPtr<ID3D11Dev
|
||||
swapChain_(swapChain),
|
||||
deviceList_(std::move(deviceList)) {
|
||||
|
||||
// We no longer support Windows Phone.
|
||||
_assert_(featureLevel_ >= D3D_FEATURE_LEVEL_9_3);
|
||||
|
||||
caps_.coordConvention = CoordConvention::Direct3D11;
|
||||
caps_.fragmentShaderFullPrecisionFloat = true;
|
||||
|
||||
@@ -1876,7 +1873,7 @@ bool D3D11DrawContext::CopyFramebufferToMemory(Framebuffer *src, Aspect channelB
|
||||
}
|
||||
|
||||
void D3D11DrawContext::BindFramebufferAsRenderTarget(Framebuffer *fbo, const RenderPassInfo &rp, const char *tag) {
|
||||
// TODO: deviceContext1 can actually discard. Useful on Windows Mobile.
|
||||
// TODO: deviceContext1 can actually discard.
|
||||
if (fbo) {
|
||||
D3D11Framebuffer *fb = (D3D11Framebuffer *)fbo;
|
||||
if (curRenderTargetView_ == fb->colorRTView && curDepthStencilView_ == fb->depthStencilRTView) {
|
||||
|
||||
@@ -5,7 +5,6 @@ AppPackages
|
||||
Generated Files
|
||||
packages
|
||||
x64
|
||||
ARM
|
||||
ARM64
|
||||
*.VC.db
|
||||
*.VC.VC.opendb
|
||||
|
||||
+3
-29
@@ -143,14 +143,6 @@ void App::SetWindow(const CoreWindow& window) {
|
||||
window.PointerCaptureLost({ this, &App::OnPointerCaptureLost });
|
||||
window.PointerWheelChanged({ this, &App::OnPointerWheelChanged });
|
||||
|
||||
if (winrt::Windows::Foundation::Metadata::ApiInformation::IsTypePresent(L"Windows.Phone.UI.Input.HardwareButtons")) {
|
||||
m_hardwareButtons.insert(HardwareButton::BACK);
|
||||
}
|
||||
|
||||
if (winrt::Windows::System::Profile::AnalyticsInfo::VersionInfo().DeviceFamily() == L"Windows.Mobile") {
|
||||
m_isPhone = true;
|
||||
}
|
||||
|
||||
winrt::Windows::UI::Core::SystemNavigationManager::GetForCurrentView().BackRequested(
|
||||
{ this, &App::App_BackRequested }
|
||||
);
|
||||
@@ -158,19 +150,8 @@ void App::SetWindow(const CoreWindow& window) {
|
||||
InitialPPSSPP();
|
||||
}
|
||||
|
||||
bool App::HasBackButton() {
|
||||
if (m_hardwareButtons.count(HardwareButton::BACK) != 0)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
void App::App_BackRequested(const IInspectable& sender, const BackRequestedEventArgs& e) {
|
||||
if (m_isPhone) {
|
||||
e.Handled(m_main->OnHardwareButton(HardwareButton::BACK));
|
||||
} else {
|
||||
e.Handled(true);
|
||||
}
|
||||
e.Handled(m_main ? m_main->OnBackRequested() : true);
|
||||
}
|
||||
|
||||
void App::OnKeyDown(const CoreWindow& sender, const KeyEventArgs& args) {
|
||||
@@ -210,9 +191,7 @@ void App::OnPointerPressed(const CoreWindow& sender, const PointerEventArgs& arg
|
||||
float Y = args.CurrentPoint().Position().Y;
|
||||
int64_t timestamp = args.CurrentPoint().Timestamp();
|
||||
m_main->OnTouchEvent(TouchInputFlags::DOWN | TouchInputFlags::MOVE, pointerId, X, Y, (double)timestamp);
|
||||
if (!m_isPhone) {
|
||||
sender.SetPointerCapture();
|
||||
}
|
||||
sender.SetPointerCapture();
|
||||
}
|
||||
|
||||
void App::OnPointerReleased(const CoreWindow& sender, const PointerEventArgs& args) {
|
||||
@@ -223,9 +202,7 @@ void App::OnPointerReleased(const CoreWindow& sender, const PointerEventArgs& ar
|
||||
float Y = args.CurrentPoint().Position().Y;
|
||||
int64_t timestamp = args.CurrentPoint().Timestamp();
|
||||
m_main->OnTouchEvent(TouchInputFlags::UP | TouchInputFlags::MOVE, pointerId, X, Y, (double)timestamp);
|
||||
if (!m_isPhone) {
|
||||
sender.ReleasePointerCapture();
|
||||
}
|
||||
sender.ReleasePointerCapture();
|
||||
}
|
||||
|
||||
void App::OnPointerCaptureLost(const CoreWindow& sender, const PointerEventArgs& args) {
|
||||
@@ -267,9 +244,6 @@ void App::Uninitialize() {
|
||||
void App::OnActivated(const CoreApplicationView& applicationView, const IActivatedEventArgs& args) {
|
||||
// Run() won't start until the CoreWindow is activated.
|
||||
CoreWindow::GetForCurrentThread().Activate();
|
||||
// On mobile, we force-enter fullscreen mode.
|
||||
if (m_isPhone)
|
||||
g_Config.bFullScreen = true;
|
||||
|
||||
if (g_Config.bFullScreen)
|
||||
winrt::Windows::UI::ViewManagement::ApplicationView::GetForCurrentView().TryEnterFullScreenMode();
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#include <set>
|
||||
|
||||
#include "pch.h"
|
||||
#include "Common/DeviceResources.h"
|
||||
#include "PPSSPP_UWPMain.h"
|
||||
@@ -47,10 +45,6 @@ namespace UWP {
|
||||
Touch touches[maxTouches]{};
|
||||
};
|
||||
|
||||
enum class HardwareButton {
|
||||
BACK,
|
||||
};
|
||||
|
||||
// Main entry point for our app. Connects the app with the Windows shell and handles application lifecycle events.
|
||||
struct App : winrt::implements<App, winrt::Windows::ApplicationModel::Core::IFrameworkView> {
|
||||
public:
|
||||
@@ -63,8 +57,6 @@ namespace UWP {
|
||||
void Run();
|
||||
void Uninitialize();
|
||||
|
||||
bool HasBackButton();
|
||||
|
||||
private:
|
||||
// Application lifecycle event handlers.
|
||||
void OnActivated(const winrt::Windows::ApplicationModel::Core::CoreApplicationView& applicationView, const winrt::Windows::ApplicationModel::Activation::IActivatedEventArgs& args);
|
||||
@@ -98,12 +90,10 @@ namespace UWP {
|
||||
void InitialPPSSPP();
|
||||
|
||||
std::shared_ptr<DX::DeviceResources> m_deviceResources;
|
||||
std::set<HardwareButton> m_hardwareButtons;
|
||||
std::unique_ptr<PPSSPP_UWPMain> m_main;
|
||||
bool m_windowClosed;
|
||||
bool m_windowVisible;
|
||||
|
||||
bool m_isPhone = false;
|
||||
TouchMapper touchMap_;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -16,10 +16,6 @@ using namespace winrt::Windows::UI::Core;
|
||||
namespace DisplayMetrics
|
||||
{
|
||||
// High resolution displays can require a lot of GPU and battery power to render.
|
||||
// High resolution phones, for example, may suffer from poor battery life if
|
||||
// games attempt to render at 60 frames per second at full fidelity.
|
||||
// The decision to render at full fidelity across all platforms and form factors
|
||||
// should be deliberate.
|
||||
static const bool SupportHighResolutions = true;
|
||||
|
||||
// The default thresholds that define a "high resolution" display. If the thresholds
|
||||
|
||||
+14
-43
@@ -143,19 +143,9 @@ void PPSSPP_UWPMain::UpdateScreenState() {
|
||||
g_display.pixel_xres = viewport.Width;
|
||||
g_display.pixel_yres = viewport.Height;
|
||||
|
||||
if (g_display.rotation == DisplayRotation::ROTATE_90 || g_display.rotation == DisplayRotation::ROTATE_270) {
|
||||
// We need to swap our width/height.
|
||||
// TODO: This is most likely dead code, since we no longer support Windows Phone.
|
||||
std::swap(g_display.pixel_xres, g_display.pixel_yres);
|
||||
}
|
||||
|
||||
// TODO: The below stuff is probably completely redundant since the UWP app elsewhere calls Native_UpdateScreenScale.
|
||||
|
||||
float dpi = m_deviceResources->GetActualDpi();
|
||||
if (System_GetPropertyInt(SYSPROP_DEVICE_TYPE) == DEVICE_TYPE_MOBILE) {
|
||||
// Boost DPI a bit to look better.
|
||||
dpi *= 96.0f / 136.0f;
|
||||
}
|
||||
|
||||
g_display.dpi_scale_real_x = 96.0f / dpi;
|
||||
g_display.dpi_scale_real_y = 96.0f / dpi;
|
||||
@@ -257,17 +247,18 @@ void PPSSPP_UWPMain::OnMouseWheel(float delta) {
|
||||
// KeyInputFlags::UP is now sent automatically afterwards for mouse wheel events, see NativeKey.
|
||||
}
|
||||
|
||||
bool PPSSPP_UWPMain::OnHardwareButton(HardwareButton button) {
|
||||
KeyInput keyInput{};
|
||||
keyInput.deviceId = DEVICE_ID_KEYBOARD;
|
||||
keyInput.flags = KeyInputFlags::DOWN | KeyInputFlags::UP;
|
||||
switch (button) {
|
||||
case HardwareButton::BACK:
|
||||
keyInput.keyCode = NKCODE_BACK;
|
||||
return NativeKey(keyInput);
|
||||
default:
|
||||
bool PPSSPP_UWPMain::OnBackRequested() {
|
||||
if (NativeIsAtTopLevel())
|
||||
return false;
|
||||
}
|
||||
|
||||
KeyInput key{};
|
||||
key.deviceId = DEVICE_ID_DEFAULT;
|
||||
key.keyCode = NKCODE_BACK;
|
||||
key.flags = KeyInputFlags::DOWN;
|
||||
NativeKey(key);
|
||||
key.flags = KeyInputFlags::UP;
|
||||
NativeKey(key);
|
||||
return true;
|
||||
}
|
||||
|
||||
void PPSSPP_UWPMain::OnTouchEvent(TouchInputFlags flags, int touchId, float x, float y, double timestamp) {
|
||||
@@ -323,11 +314,6 @@ bool IsXBox() {
|
||||
return deviceInfo.DeviceFamily() == L"Windows.Xbox";
|
||||
}
|
||||
|
||||
bool IsMobile() {
|
||||
auto deviceInfo = winrt::Windows::System::Profile::AnalyticsInfo::VersionInfo();
|
||||
return deviceInfo.DeviceFamily() == L"Windows.Mobile";
|
||||
}
|
||||
|
||||
void GetVersionInfo(uint32_t& major, uint32_t& minor, uint32_t& build, uint32_t& revision) {
|
||||
major = minor = build = revision = 0;
|
||||
winrt::hstring deviceFamilyVersion = winrt::Windows::System::Profile::AnalyticsInfo::VersionInfo().DeviceFamilyVersion();
|
||||
@@ -428,9 +414,7 @@ int64_t System_GetPropertyInt(SystemProperty prop) {
|
||||
|
||||
case SYSPROP_DEVICE_TYPE:
|
||||
{
|
||||
if (IsMobile()) {
|
||||
return DEVICE_TYPE_MOBILE;
|
||||
} else if (IsXBox()) {
|
||||
if (IsXBox()) {
|
||||
return DEVICE_TYPE_TV;
|
||||
} else {
|
||||
return DEVICE_TYPE_DESKTOP;
|
||||
@@ -487,9 +471,9 @@ bool System_GetPropertyBool(SystemProperty prop) {
|
||||
case SYSPROP_HAS_IMAGE_BROWSER:
|
||||
return true; // we just use the file browser
|
||||
case SYSPROP_HAS_BACK_BUTTON:
|
||||
return true;
|
||||
return false;
|
||||
case SYSPROP_HAS_ACCELEROMETER:
|
||||
return IsMobile();
|
||||
return false;
|
||||
case SYSPROP_APP_GOLD:
|
||||
#ifdef GOLD
|
||||
return true;
|
||||
@@ -686,19 +670,6 @@ std::vector<std::string> System_GetCameraDeviceList() {
|
||||
}
|
||||
|
||||
void System_Vibrate(int length_ms) {
|
||||
#if _M_ARM
|
||||
if (length_ms == -1 || length_ms == -3)
|
||||
length_ms = 50;
|
||||
else if (length_ms == -2)
|
||||
length_ms = 25;
|
||||
else
|
||||
return;
|
||||
|
||||
winrt::Windows::Foundation::TimeSpan timeSpan;
|
||||
timeSpan.count = length_ms * 10000;
|
||||
// TODO: Can't use this?
|
||||
// winrt::Windows::Phone::Devices::Notification::VibrationDevice::GetDefault().Vibrate(timeSpan);
|
||||
#endif
|
||||
}
|
||||
|
||||
void System_AskForPermission(SystemPermission permission) {
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
namespace UWP {
|
||||
|
||||
struct App;
|
||||
enum class HardwareButton;
|
||||
|
||||
class UWPGraphicsContext : public GraphicsContext {
|
||||
public:
|
||||
@@ -52,9 +51,7 @@ public:
|
||||
|
||||
void OnMouseWheel(float delta);
|
||||
|
||||
bool OnHardwareButton(HardwareButton button);
|
||||
|
||||
void RotateXYToDisplay(float &x, float &y);
|
||||
bool OnBackRequested();
|
||||
|
||||
// Save state fast if we can!
|
||||
void OnSuspend();
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" IgnorableNamespaces="uap mp rescap">
|
||||
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" IgnorableNamespaces="uap rescap">
|
||||
<Identity Name="0ad29e1a-1069-4cf5-8c97-620892505f0c" Publisher="CN=Henrik" Version="1.19.3.0" />
|
||||
<mp:PhoneIdentity PhoneProductId="0ad29e1a-1069-4cf5-8c97-620892505f0c" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
|
||||
<Properties>
|
||||
<DisplayName>PPSSPP - PSP emulator</DisplayName>
|
||||
<PublisherDisplayName>Henrik Rydgård</PublisherDisplayName>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" IgnorableNamespaces="uap mp rescap">
|
||||
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" IgnorableNamespaces="uap rescap">
|
||||
<Identity Name="32617401-c880-44d1-ba5a-c0b46feba525" Publisher="CN=Henrik" Version="1.19.3.0" />
|
||||
<mp:PhoneIdentity PhoneProductId="32617401-c880-44d1-ba5a-c0b46feba525" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
|
||||
<Properties>
|
||||
<DisplayName>PPSSPP Gold - PSP emulator</DisplayName>
|
||||
<PublisherDisplayName>Henrik Rydgård</PublisherDisplayName>
|
||||
|
||||
@@ -59,7 +59,6 @@
|
||||
</ImportGroup>
|
||||
<ImportGroup>
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`WindowsMobile, Version=$(WindowsTargetPlatformVersion)`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\WindowsMobile.props" Condition="exists('$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`WindowsMobile, Version=$(WindowsTargetPlatformVersion)`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\WindowsMobile.props')" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
|
||||
@@ -46,7 +46,6 @@ bool IsCtrlOnHold();
|
||||
// Misc
|
||||
std::string GetLangRegion();
|
||||
bool IsXBox();
|
||||
bool IsMobile();
|
||||
|
||||
// Get major, minor, build, revision
|
||||
void GetVersionInfo(uint32_t& major, uint32_t& minor, uint32_t& build, uint32_t& revision);
|
||||
|
||||
Reference in new issue
Block a user