diff --git a/src/core/host_interface.cpp b/src/core/host_interface.cpp index 0a7fab73..d707233d 100644 --- a/src/core/host_interface.cpp +++ b/src/core/host_interface.cpp @@ -621,19 +621,6 @@ void HostInterface::CheckForSettingsChanges(const Settings& old_settings) } } -void HostInterface::SetUserDirectoryToProgramDirectory() -{ - std::string program_path(FileSystem::GetProgramPath()); - if (program_path.empty()) - Panic("Failed to get program path."); - - std::string program_directory(FileSystem::GetPathDirectory(program_path)); - if (program_directory.empty()) - Panic("Program path is not valid"); - - m_user_directory = std::move(program_directory); -} - void HostInterface::OnHostDisplayResized() { if (System::IsValid()) diff --git a/src/core/host_interface.h b/src/core/host_interface.h index cd06a089..6b0f179d 100644 --- a/src/core/host_interface.h +++ b/src/core/host_interface.h @@ -176,9 +176,6 @@ protected: /// Call when host display size changes, use with "match display" aspect ratio setting. virtual void OnHostDisplayResized(); - /// Sets the user directory to the program directory, i.e. "portable mode". - void SetUserDirectoryToProgramDirectory(); - /// Quick switch between software and hardware rendering. void ToggleSoftwareRendering(); diff --git a/src/core/system.cpp b/src/core/system.cpp index 007ff30b..5e6d0b43 100644 --- a/src/core/system.cpp +++ b/src/core/system.cpp @@ -184,12 +184,12 @@ bool IsPALRegion() return s_region == ConsoleRegion::PAL; } -TickCount GetMaxSliceTicks() +TickCount GetMaxSliceTicks(void) { return s_max_slice_ticks; } -void UpdateOverclock() +void UpdateOverclock(void) { g_ticks_per_second = ScaleTicksToOverclock(MASTER_CLOCK); s_max_slice_ticks = ScaleTicksToOverclock(MASTER_CLOCK / 10); @@ -199,16 +199,11 @@ void UpdateOverclock() g_timers.CPUClocksChanged(); } -u32 GetFrameNumber() +u32 GetFrameNumber(void) { return s_frame_number; } -u32 GetInternalFrameNumber() -{ - return s_internal_frame_number; -} - void FrameDone() { s_frame_number++; @@ -221,10 +216,6 @@ void IncrementInternalFrameNumber() s_internal_frame_number++; } -const std::string& GetRunningPath() -{ - return s_running_game_path; -} const std::string& GetRunningCode() { return s_running_game_code; @@ -240,40 +231,22 @@ float GetThrottleFrequency() return s_throttle_frequency; } -bool IsExeFileName(const char* path) +/// Returns true if the filename is a PlayStation executable we can inject. +static bool IsExeFileName(const char* path) { const char* extension = std::strrchr(path, '.'); return (extension && (StringUtil::Strcasecmp(extension, ".exe") == 0 || StringUtil::Strcasecmp(extension, ".psexe") == 0)); } -bool IsPsfFileName(const char* path) +/// Returns true if the filename is a Portable Sound Format file we can uncompress/load. +static bool IsPsfFileName(const char* path) { const char* extension = std::strrchr(path, '.'); return (extension && (StringUtil::Strcasecmp(extension, ".psf") == 0 || StringUtil::Strcasecmp(extension, ".minipsf") == 0)); } -bool IsLoadableFilename(const char* path) -{ - static constexpr auto extensions = make_array(".bin", ".cue", ".img", ".iso", ".chd", ".ecm", ".mds", // discs - ".exe", ".psexe", // exes - ".psf", ".minipsf", // psf - ".m3u", // playlists - ".pbp"); - const char* extension = std::strrchr(path, '.'); - if (!extension) - return false; - - for (const char* test_extension : extensions) - { - if (StringUtil::Strcasecmp(extension, test_extension) == 0) - return true; - } - - return false; -} - ConsoleRegion GetConsoleRegionForDiscRegion(DiscRegion region) { switch (region) @@ -1333,22 +1306,6 @@ bool SaveState(ByteStream* state, u32 screenshot_size /* = 256 */) return true; } -void SingleStepCPU() -{ - const u32 old_frame_number = s_frame_number; - - g_gpu->RestoreGraphicsAPIState(); - - CPU::SingleStep(); - - g_spu.GeneratePendingSamples(); - - if (s_frame_number != old_frame_number && s_cheat_list) - s_cheat_list->Apply(); - - g_gpu->ResetGraphicsAPIState(); -} - void DoRunFrame() { g_gpu->RestoreGraphicsAPIState(); @@ -1406,16 +1363,6 @@ void RunFrame() DoMemorySaveStates(); } -float GetTargetSpeed() -{ - return s_target_speed; -} - -void SetTargetSpeed(float speed) -{ - s_target_speed = speed; -} - void SetThrottleFrequency(float frequency) { s_throttle_frequency = frequency; @@ -1590,7 +1537,7 @@ Controller* GetController(u32 slot) return g_pad.GetController(slot); } -void UpdateControllers() +void UpdateControllers(void) { for (u32 i = 0; i < NUM_CONTROLLER_AND_CARD_PORTS; i++) { @@ -1609,7 +1556,7 @@ void UpdateControllers() } } -void UpdateControllerSettings() +void UpdateControllerSettings(void) { for (u32 i = 0; i < NUM_CONTROLLER_AND_CARD_PORTS; i++) { @@ -1742,20 +1689,7 @@ void UpdatePerGameMemoryCards() } } -bool HasMemoryCard(u32 slot) -{ - return (g_pad.GetMemoryCard(slot) != nullptr); -} - -void SwapMemoryCards() -{ - std::unique_ptr first = g_pad.RemoveMemoryCard(0); - std::unique_ptr second = g_pad.RemoveMemoryCard(1); - g_pad.SetMemoryCard(0, std::move(second)); - g_pad.SetMemoryCard(1, std::move(first)); -} - -void UpdateMultitaps() +void UpdateMultitaps(void) { switch (g_settings.multitap_mode) { @@ -2216,8 +2150,6 @@ void DoRunahead() s32 frames_to_run = static_cast(s_runahead_frames) - static_cast(s_runahead_states.size()); if (frames_to_run > 0) { - Common::Timer timer2; - g_spu.SetAudioStream(s_runahead_audio_stream.get()); while (frames_to_run > 0) diff --git a/src/core/system.h b/src/core/system.h index 92e197b3..a078c759 100644 --- a/src/core/system.h +++ b/src/core/system.h @@ -26,7 +26,6 @@ struct SystemBootParameters std::string filename; std::optional override_fast_boot; - std::optional override_fullscreen; std::optional override_start_paused; std::unique_ptr state_stream; u32 media_playlist_index = 0; @@ -57,15 +56,6 @@ enum class State extern TickCount g_ticks_per_second; -/// Returns true if the filename is a PlayStation executable we can inject. -bool IsExeFileName(const char* path); - -/// Returns true if the filename is a Portable Sound Format file we can uncompress/load. -bool IsPsfFileName(const char* path); - -/// Returns true if the filename is one we can load. -bool IsLoadableFilename(const char* path); - /// Returns the preferred console type for a disc. ConsoleRegion GetConsoleRegionForDiscRegion(DiscRegion region); @@ -129,19 +119,11 @@ void UpdateOverclock(); bool InjectEXEFromBuffer(const void* buffer, u32 buffer_size, bool patch_loader = true); u32 GetFrameNumber(); -u32 GetInternalFrameNumber(); void FrameDone(); void IncrementInternalFrameNumber(); -const std::string& GetRunningPath(); const std::string& GetRunningCode(); const std::string& GetRunningTitle(); - -float GetFPS(); -float GetVPS(); -float GetEmulationSpeed(); -float GetAverageFrameTime(); -float GetWorstFrameTime(); float GetThrottleFrequency(); bool Boot(const SystemBootParameters& params); @@ -154,13 +136,8 @@ bool SaveState(ByteStream* state, u32 screenshot_size = 256); /// Recreates the GPU component, saving/loading the state so it is preserved. Call when the GPU renderer changes. bool RecreateGPU(GPURenderer renderer, bool update_display = true); -void SingleStepCPU(); void RunFrame(); -/// Sets target emulation speed. -float GetTargetSpeed(); -void SetTargetSpeed(float speed); - /// Adjusts the throttle frequency, i.e. how many times we should sleep per second. void SetThrottleFrequency(float frequency); @@ -171,9 +148,7 @@ void UpdateControllerSettings(); void ResetControllers(); void UpdateMemoryCardTypes(); void UpdatePerGameMemoryCards(); -bool HasMemoryCard(u32 slot); -void SwapMemoryCards(); -void UpdateMultitaps(); +void UpdateMultitaps(void); bool HasMedia(); std::string GetMediaFileName();