mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Assorted Windows-on-ARM fixes
This commit is contained in:
parent
9d116505cf
commit
f2ccd1d648
3 changed files with 25 additions and 2 deletions
|
@ -208,6 +208,13 @@ void CPUInfo::Detect()
|
|||
#endif
|
||||
strcpy(brand_string, "Apple A");
|
||||
num_cores = 2;
|
||||
#elif PPSSPP_PLATFORM(UWP)
|
||||
strcpy(brand_string, "Unknown");
|
||||
isVFP3 = true;
|
||||
isVFP4 = false;
|
||||
SYSTEM_INFO sysInfo;
|
||||
GetSystemInfo(&sysInfo);
|
||||
num_cores = sysInfo.dwNumberOfProcessors;
|
||||
#else // !PPSSPP_PLATFORM(IOS)
|
||||
strcpy(brand_string, "Unknown");
|
||||
num_cores = 1;
|
||||
|
|
|
@ -120,10 +120,10 @@ void *AllocateExecutableMemory(size_t size) {
|
|||
DWORD prot = PAGE_EXECUTE_READWRITE;
|
||||
if (PlatformIsWXExclusive())
|
||||
prot = PAGE_READWRITE;
|
||||
if (sys_info.dwPageSize == 0)
|
||||
GetSystemInfo(&sys_info);
|
||||
#if defined(_M_X64)
|
||||
if ((uintptr_t)&hint_location > 0xFFFFFFFFULL) {
|
||||
if (sys_info.dwPageSize == 0)
|
||||
GetSystemInfo(&sys_info);
|
||||
|
||||
size_t aligned_size = round_page(size);
|
||||
ptr = SearchForFreeMem(aligned_size);
|
||||
|
@ -142,7 +142,11 @@ void *AllocateExecutableMemory(size_t size) {
|
|||
else
|
||||
#endif
|
||||
{
|
||||
#if PPSSPP_PLATFORM(UWP)
|
||||
ptr = VirtualAllocFromApp(0, size, MEM_RESERVE | MEM_COMMIT, prot);
|
||||
#else
|
||||
ptr = VirtualAlloc(0, size, MEM_RESERVE | MEM_COMMIT, prot);
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
static char *map_hint = 0;
|
||||
|
@ -202,9 +206,15 @@ void *AllocateExecutableMemory(size_t size) {
|
|||
|
||||
void *AllocateMemoryPages(size_t size, uint32_t memProtFlags) {
|
||||
size = round_page(size);
|
||||
if (sys_info.dwPageSize == 0)
|
||||
GetSystemInfo(&sys_info);
|
||||
#ifdef _WIN32
|
||||
uint32_t protect = ConvertProtFlagsWin32(memProtFlags);
|
||||
#if PPSSPP_PLATFORM(UWP)
|
||||
void* ptr = VirtualAllocFromApp(0, size, MEM_COMMIT, protect);
|
||||
#else
|
||||
void* ptr = VirtualAlloc(0, size, MEM_COMMIT, protect);
|
||||
#endif
|
||||
if (!ptr)
|
||||
PanicAlert("Failed to allocate raw memory");
|
||||
#else
|
||||
|
|
|
@ -15,8 +15,11 @@
|
|||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#include "ppsspp_config.h"
|
||||
|
||||
#include "Common.h" // Local
|
||||
#include "StringUtils.h"
|
||||
#include "base/logging.h"
|
||||
#include "util/text/utf8.h"
|
||||
#include <string>
|
||||
|
||||
|
@ -76,6 +79,9 @@ bool MsgHandler(const char* caption, const char* text, bool yes_no, int Style)
|
|||
std::wstring wcaption = ConvertUTF8ToWString(caption);
|
||||
|
||||
return IDYES == MessageBox(0, wtext.c_str(), wcaption.c_str(), STYLE | (yes_no ? MB_YESNO : MB_OK));
|
||||
#elif PPSSPP_PLATFORM(UWP)
|
||||
OutputDebugStringUTF8(text);
|
||||
return true;
|
||||
#else
|
||||
printf("%s\n", text);
|
||||
return true;
|
||||
|
|
Loading…
Add table
Reference in a new issue