diff --git a/src/common/crash_handler.cpp b/src/common/crash_handler.cpp index 4e4407a8a..724427446 100644 --- a/src/common/crash_handler.cpp +++ b/src/common/crash_handler.cpp @@ -184,7 +184,7 @@ void CrashHandler::WriteDumpForCaller() WriteMinidumpAndCallstack(nullptr); } -#elif !defined(__APPLE__) +#elif !defined(__APPLE__) && !defined(__ANDROID__) #include #include diff --git a/src/common/memmap.cpp b/src/common/memmap.cpp index 0583b6592..999b55cf3 100644 --- a/src/common/memmap.cpp +++ b/src/common/memmap.cpp @@ -27,7 +27,7 @@ #include #include #include -#elif !defined(__ANDROID__) +#else #include #include #include @@ -598,7 +598,7 @@ void MemMap::EndCodeWrite() #endif -#elif !defined(__ANDROID__) +#else bool MemMap::MemProtect(void* baseaddr, size_t size, PageProtect mode) { @@ -625,6 +625,8 @@ std::string MemMap::GetFileMappingName(const char* prefix) #endif } +#ifndef __ANDROID__ + void* MemMap::CreateSharedMemory(const char* name, size_t size, Error* error) { const bool is_anonymous = (!name || *name == 0); @@ -683,6 +685,8 @@ void MemMap::DeleteSharedMemory(const char* name) shm_unlink(name); } +#endif + void* MemMap::MapSharedMemory(void* handle, size_t offset, void* baseaddr, size_t size, PageProtect mode) { const int flags = (baseaddr != nullptr) ? (MAP_SHARED | MAP_FIXED) : MAP_SHARED; diff --git a/src/core/bios.cpp b/src/core/bios.cpp index fed9491b8..0e7365939 100644 --- a/src/core/bios.cpp +++ b/src/core/bios.cpp @@ -18,7 +18,6 @@ LOG_CHANNEL(BIOS); namespace BIOS { -static const ImageInfo* GetInfoForHash(const std::span image, const ImageInfo::Hash& hash); static constexpr ImageInfo::Hash MakeHashFromString(const char str[]) { @@ -206,7 +205,7 @@ std::optional BIOS::LoadImageFromFile(const char* filename, Error* return ret; } -const BIOS::ImageInfo* BIOS::GetInfoForHash(const std::span image, const ImageInfo::Hash& hash) +const BIOS::ImageInfo* BIOS::GetInfoForHash(const std::span image, const ImageInfo::Hash& hash) { // check for openbios if (image.size() >= (s_openbios_signature_offset + std::size(s_openbios_signature)) && diff --git a/src/core/bios.h b/src/core/bios.h index 3a17c0b34..119cb368e 100644 --- a/src/core/bios.h +++ b/src/core/bios.h @@ -79,6 +79,8 @@ static_assert(sizeof(PSEXEHeader) == 0x800); std::optional LoadImageFromFile(const char* filename, Error* error); +const ImageInfo* GetInfoForHash(const std::span image, const ImageInfo::Hash& hash); + bool IsValidBIOSForRegion(ConsoleRegion console_region, ConsoleRegion bios_region); bool PatchBIOSFastBoot(u8* image, u32 image_size, ImageInfo::FastBootPatch type); diff --git a/src/core/controller.h b/src/core/controller.h index 23561499d..ee6f8c250 100644 --- a/src/core/controller.h +++ b/src/core/controller.h @@ -140,9 +140,9 @@ public: /// List of controller indices in the order that they should be displayed. static const std::array PortDisplayOrder; -protected: /// Returns true if automatic analog mode can be used. static bool CanStartInAnalogMode(ControllerType ctype); +protected: u32 m_index; }; diff --git a/src/core/settings.cpp b/src/core/settings.cpp index fef18e32f..e372b9bbd 100644 --- a/src/core/settings.cpp +++ b/src/core/settings.cpp @@ -89,6 +89,8 @@ float SettingInfo::FloatStepValue() const const MediaCaptureBackend Settings::DEFAULT_MEDIA_CAPTURE_BACKEND = MediaCaptureBackend::MediaFoundation; #elif !defined(__ANDROID__) const MediaCaptureBackend Settings::DEFAULT_MEDIA_CAPTURE_BACKEND = MediaCaptureBackend::FFmpeg; +#else +const MediaCaptureBackend Settings::DEFAULT_MEDIA_CAPTURE_BACKEND = MediaCaptureBackend::MaxCount; #endif Settings::Settings() diff --git a/src/core/settings.h b/src/core/settings.h index c333e9eba..19b4b82a7 100644 --- a/src/core/settings.h +++ b/src/core/settings.h @@ -542,14 +542,12 @@ struct Settings static constexpr SaveStateCompressionMode DEFAULT_SAVE_STATE_COMPRESSION_MODE = SaveStateCompressionMode::ZstDefault; -#ifndef __ANDROID__ static const MediaCaptureBackend DEFAULT_MEDIA_CAPTURE_BACKEND; static constexpr const char* DEFAULT_MEDIA_CAPTURE_CONTAINER = "mp4"; static constexpr u32 DEFAULT_MEDIA_CAPTURE_VIDEO_WIDTH = 640; static constexpr u32 DEFAULT_MEDIA_CAPTURE_VIDEO_HEIGHT = 480; static constexpr u32 DEFAULT_MEDIA_CAPTURE_VIDEO_BITRATE = 6000; static constexpr u32 DEFAULT_MEDIA_CAPTURE_AUDIO_BITRATE = 128; -#endif // Android doesn't create settings until they're first opened, so we have to override the defaults here. #ifndef __ANDROID__ diff --git a/src/core/system.cpp b/src/core/system.cpp index 64276cccc..3131bddf2 100644 --- a/src/core/system.cpp +++ b/src/core/system.cpp @@ -160,9 +160,6 @@ static bool CreateGPU(GPURenderer renderer, bool is_switching, Error* error); static bool RecreateGPU(GPURenderer renderer, bool force_recreate_device = false, bool update_display = true); static void HandleHostGPUDeviceLost(); -/// Returns true if fast forwarding or slow motion is currently active. -static bool IsRunningAtNonStandardSpeed(); - /// Returns true if boot is being fast forwarded. static bool IsFastForwardingBoot(); @@ -4136,7 +4133,7 @@ bool System::CheckForSBIFile(CDImage* image, Error* error) s_running_game_serial, s_running_game_title); #else // Shorter because no confirm messages. - Error::SetStringView(error, "Missing SBI file.", "The selected game requires a SBI file to run properly."); + Error::SetStringView(error, "The selected game requires a SBI file to run properly."); #endif return false; diff --git a/src/core/system.h b/src/core/system.h index fed3eaaa1..179301b65 100644 --- a/src/core/system.h +++ b/src/core/system.h @@ -268,6 +268,9 @@ void SingleStepCPU(); float GetTargetSpeed(); float GetAudioNominalRate(); +/// Returns true if fast forwarding or slow motion is currently active. +bool IsRunningAtNonStandardSpeed(); + /// Adjusts the throttle frequency, i.e. how many times we should sleep per second. void SetThrottleFrequency(float frequency); @@ -391,8 +394,6 @@ bool SaveScreenshot(const char* filename = nullptr, DisplayScreenshotMode mode = DisplayScreenshotFormat format = g_settings.display_screenshot_format, u8 quality = g_settings.display_screenshot_quality, bool compress_on_thread = true); -#ifndef __ANDROID__ - /// Returns the path that a new media capture would be saved to by default. Safe to call from any thread. std::string GetNewMediaCapturePath(const std::string_view title, const std::string_view container); @@ -404,8 +405,6 @@ bool StartMediaCapture(std::string path = {}); bool StartMediaCapture(std::string path, bool capture_video, bool capture_audio); void StopMediaCapture(); -#endif - /// Loads the cheat list for the current game title from the user directory. bool LoadCheatList(); diff --git a/src/util/media_capture.cpp b/src/util/media_capture.cpp index 0a2686482..48d6f6833 100644 --- a/src/util/media_capture.cpp +++ b/src/util/media_capture.cpp @@ -2875,7 +2875,7 @@ MediaCapture::CodecList MediaCaptureFFmpeg::GetAudioCodecList(const char* contai } // namespace -static constexpr const std::array s_backend_names = { +static constexpr const std::array(MediaCaptureBackend::MaxCount)> s_backend_names = { #ifdef _WIN32 "MediaFoundation", #endif @@ -2883,7 +2883,7 @@ static constexpr const std::array s_backend_names = { "FFmpeg", #endif }; -static constexpr const std::array s_backend_display_names = { +static constexpr const std::array(MediaCaptureBackend::MaxCount)> s_backend_display_names = { #ifdef _WIN32 TRANSLATE_DISAMBIG_NOOP("Settings", "Media Foundation", "MediaCaptureBackend"), #endif diff --git a/src/util/opengl_context.cpp b/src/util/opengl_context.cpp index cc7240a0e..8a796d0dd 100644 --- a/src/util/opengl_context.cpp +++ b/src/util/opengl_context.cpp @@ -153,7 +153,7 @@ std::unique_ptr OpenGLContext::Create(const WindowInfo& wi, Error #elif defined(__APPLE__) context = OpenGLContextAGL::Create(wi, versions_to_try, error); #elif defined(__ANDROID__) - context = ContextEGLAndroid::Create(wi, versions_to_try, error); + context = OpenGLContextEGLAndroid::Create(wi, versions_to_try, error); #else #if defined(ENABLE_X11) if (wi.type == WindowInfo::Type::X11)