From b7fbde31a72d936d05c7a266d666691179fb3864 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Fri, 8 Jul 2022 22:43:38 +1000 Subject: [PATCH] Move utility classes from common to own static lib --- duckstation.sln | 47 ++++++++++++++- src/CMakeLists.txt | 1 + src/common/CMakeLists.txt | 39 ------------- src/common/common.props | 4 +- src/common/common.vcxproj | 38 ------------ src/common/common.vcxproj.filters | 38 ------------ src/core/CMakeLists.txt | 2 +- src/core/analog_controller.cpp | 2 +- src/core/analog_joystick.cpp | 2 +- src/core/bus.cpp | 2 +- src/core/bus.h | 2 +- src/core/cdrom.cpp | 4 +- src/core/cdrom.h | 4 +- src/core/cdrom_async_reader.h | 2 +- src/core/cheevos.cpp | 4 +- src/core/controller.cpp | 2 +- src/core/core.props | 4 +- src/core/cpu_code_cache.h | 11 ++-- src/core/cpu_core.cpp | 2 +- src/core/cpu_recompiler_code_generator.h | 2 +- src/core/digital_controller.cpp | 2 +- src/core/dma.cpp | 2 +- src/core/gpu.cpp | 2 +- src/core/gpu_backend.cpp | 2 +- src/core/gpu_hw.cpp | 2 +- src/core/gpu_hw_d3d11.cpp | 2 +- src/core/gpu_hw_opengl.cpp | 2 +- src/core/gpu_hw_vulkan.cpp | 2 +- src/core/gte.cpp | 2 +- src/core/host_interface.cpp | 2 +- src/core/interrupt_controller.cpp | 2 +- src/core/mdec.cpp | 2 +- src/core/memory_card.cpp | 2 +- src/core/memory_card_image.cpp | 4 +- src/core/multitap.cpp | 2 +- src/core/multitap.h | 2 +- src/core/namco_guncon.cpp | 2 +- src/core/negcon.cpp | 2 +- src/core/pad.cpp | 2 +- src/core/playstation_mouse.cpp | 2 +- src/core/sio.cpp | 2 +- src/core/spu.cpp | 6 +- src/core/system.cpp | 6 +- src/core/timers.cpp | 2 +- src/core/timing_event.cpp | 2 +- src/duckstation-qt/audiosettingswidget.cpp | 2 +- src/duckstation-qt/consolesettingswidget.cpp | 5 +- src/duckstation-qt/gamepropertiesdialog.cpp | 4 +- src/duckstation-qt/mainwindow.cpp | 2 +- src/duckstation-qt/qthostinterface.cpp | 2 +- .../regtest_host_interface.cpp | 2 +- src/frontend-common/common_host_interface.cpp | 2 +- src/frontend-common/cubeb_audio_stream.h | 2 +- src/frontend-common/game_database.h | 2 +- src/frontend-common/game_list.cpp | 3 +- src/frontend-common/game_list.h | 2 +- src/frontend-common/sdl_audio_stream.h | 2 +- src/frontend-common/xaudio2_audio_stream.h | 2 +- src/util/CMakeLists.txt | 45 ++++++++++++++ src/{common => util}/audio_stream.cpp | 2 +- src/{common => util}/audio_stream.h | 4 +- src/{common => util}/cd_image.cpp | 10 ++-- src/{common => util}/cd_image.h | 6 +- src/{common => util}/cd_image_bin.cpp | 6 +- src/{common => util}/cd_image_chd.cpp | 12 ++-- src/{common => util}/cd_image_cue.cpp | 10 ++-- src/{common => util}/cd_image_device.cpp | 8 +-- src/{common => util}/cd_image_ecm.cpp | 8 +-- src/{common => util}/cd_image_hasher.cpp | 4 +- src/{common => util}/cd_image_hasher.h | 4 +- src/{common => util}/cd_image_m3u.cpp | 10 ++-- src/{common => util}/cd_image_mds.cpp | 8 +-- src/{common => util}/cd_image_memory.cpp | 8 +-- src/{common => util}/cd_image_pbp.cpp | 12 ++-- src/{common => util}/cd_image_ppf.cpp | 6 +- .../cd_subchannel_replacement.cpp | 6 +- .../cd_subchannel_replacement.h | 2 +- src/{common => util}/cd_xa.cpp | 0 src/{common => util}/cd_xa.h | 4 +- src/{common => util}/cue_parser.cpp | 6 +- src/{common => util}/cue_parser.h | 2 +- src/{common => util}/iso_reader.cpp | 2 +- src/{common => util}/iso_reader.h | 2 +- src/{common => util}/jit_code_buffer.cpp | 10 ++-- src/{common => util}/jit_code_buffer.h | 2 +- src/{common => util}/memory_arena.cpp | 0 src/{common => util}/memory_arena.h | 2 +- src/{common => util}/null_audio_stream.cpp | 0 src/{common => util}/null_audio_stream.h | 0 src/{common => util}/page_fault_handler.cpp | 6 +- src/{common => util}/page_fault_handler.h | 2 +- src/{common => util}/pbp_types.h | 2 +- src/{common => util}/shiftjis.cpp | 0 src/{common => util}/shiftjis.h | 0 src/{common => util}/state_wrapper.cpp | 4 +- src/{common => util}/state_wrapper.h | 8 +-- src/util/util.props | 16 +++++ src/util/util.vcxproj | 58 +++++++++++++++++++ src/util/util.vcxproj.filters | 46 +++++++++++++++ src/{common => util}/wav_writer.cpp | 4 +- src/{common => util}/wav_writer.h | 2 +- 101 files changed, 371 insertions(+), 282 deletions(-) create mode 100644 src/util/CMakeLists.txt rename src/{common => util}/audio_stream.cpp (99%) rename src/{common => util}/audio_stream.h (98%) rename src/{common => util}/cd_image.cpp (99%) rename src/{common => util}/cd_image.h (99%) rename src/{common => util}/cd_image_bin.cpp (97%) rename src/{common => util}/cd_image_chd.cpp (98%) rename src/{common => util}/cd_image_cue.cpp (98%) rename src/{common => util}/cd_image_device.cpp (99%) rename src/{common => util}/cd_image_ecm.cpp (99%) rename src/{common => util}/cd_image_hasher.cpp (98%) rename src/{common => util}/cd_image_hasher.h (90%) rename src/{common => util}/cd_image_m3u.cpp (97%) rename src/{common => util}/cd_image_mds.cpp (98%) rename src/{common => util}/cd_image_memory.cpp (97%) rename src/{common => util}/cd_image_pbp.cpp (99%) rename src/{common => util}/cd_image_ppf.cpp (99%) rename src/{common => util}/cd_subchannel_replacement.cpp (97%) rename src/{common => util}/cd_subchannel_replacement.h (97%) rename src/{common => util}/cd_xa.cpp (100%) rename src/{common => util}/cd_xa.h (97%) rename src/{common => util}/cue_parser.cpp (99%) rename src/{common => util}/cue_parser.h (98%) rename src/{common => util}/iso_reader.cpp (99%) rename src/{common => util}/iso_reader.h (99%) rename src/{common => util}/jit_code_buffer.cpp (98%) rename src/{common => util}/jit_code_buffer.h (98%) rename src/{common => util}/memory_arena.cpp (100%) rename src/{common => util}/memory_arena.h (98%) rename src/{common => util}/null_audio_stream.cpp (100%) rename src/{common => util}/null_audio_stream.h (100%) rename src/{common => util}/page_fault_handler.cpp (99%) rename src/{common => util}/page_fault_handler.h (94%) rename src/{common => util}/pbp_types.h (98%) rename src/{common => util}/shiftjis.cpp (100%) rename src/{common => util}/shiftjis.h (100%) rename src/{common => util}/state_wrapper.cpp (97%) rename src/{common => util}/state_wrapper.h (97%) create mode 100644 src/util/util.props create mode 100644 src/util/util.vcxproj create mode 100644 src/util/util.vcxproj.filters rename src/{common => util}/wav_writer.cpp (98%) rename src/{common => util}/wav_writer.h (96%) diff --git a/duckstation.sln b/duckstation.sln index dad40ac49..85630632f 100644 --- a/duckstation.sln +++ b/duckstation.sln @@ -14,16 +14,14 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "common", "src\common\common {7F909E29-4808-4BD9-A60C-56C51A3AAEC2} = {7F909E29-4808-4BD9-A60C-56C51A3AAEC2} {43540154-9E1E-409C-834F-B84BE5621388} = {43540154-9E1E-409C-834F-B84BE5621388} {ED601289-AC1A-46B8-A8ED-17DB9EB73423} = {ED601289-AC1A-46B8-A8ED-17DB9EB73423} - {425D6C99-D1C8-43C2-B8AC-4D7B1D941017} = {425D6C99-D1C8-43C2-B8AC-4D7B1D941017} {8BDA439C-6358-45FB-9994-2FF083BABE06} = {8BDA439C-6358-45FB-9994-2FF083BABE06} {7FF9FDB9-D504-47DB-A16A-B08071999620} = {7FF9FDB9-D504-47DB-A16A-B08071999620} - {39F0ADFF-3A84-470D-9CF0-CA49E164F2F3} = {39F0ADFF-3A84-470D-9CF0-CA49E164F2F3} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core", "src\core\core.vcxproj", "{868B98C8-65A1-494B-8346-250A73A48C0A}" ProjectSection(ProjectDependencies) = postProject - {EE054E08-3799-4A59-A422-18259C105FFD} = {EE054E08-3799-4A59-A422-18259C105FFD} {BB08260F-6FBC-46AF-8924-090EE71360C6} = {BB08260F-6FBC-46AF-8924-090EE71360C6} + {57F6206D-F264-4B07-BAF8-11B9BBE1F455} = {57F6206D-F264-4B07-BAF8-11B9BBE1F455} {8906836E-F06E-46E8-B11A-74E5E8C7B8FB} = {8906836E-F06E-46E8-B11A-74E5E8C7B8FB} {E4357877-D459-45C7-B8F6-DCBB587BB528} = {E4357877-D459-45C7-B8F6-DCBB587BB528} {ED601289-AC1A-46B8-A8ED-17DB9EB73423} = {ED601289-AC1A-46B8-A8ED-17DB9EB73423} @@ -101,6 +99,13 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rainterface", "dep\rainterf EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fmt", "dep\fmt\fmt.vcxproj", "{8BE398E6-B882-4248-9065-FECC8728E038}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "util", "src\util\util.vcxproj", "{57F6206D-F264-4B07-BAF8-11B9BBE1F455}" + ProjectSection(ProjectDependencies) = postProject + {EE054E08-3799-4A59-A422-18259C105FFD} = {EE054E08-3799-4A59-A422-18259C105FFD} + {425D6C99-D1C8-43C2-B8AC-4D7B1D941017} = {425D6C99-D1C8-43C2-B8AC-4D7B1D941017} + {39F0ADFF-3A84-470D-9CF0-CA49E164F2F3} = {39F0ADFF-3A84-470D-9CF0-CA49E164F2F3} + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|ARM64 = Debug|ARM64 @@ -955,6 +960,42 @@ Global {8BE398E6-B882-4248-9065-FECC8728E038}.ReleaseUWP|x64.Build.0 = ReleaseUWP|x64 {8BE398E6-B882-4248-9065-FECC8728E038}.ReleaseUWP|x86.ActiveCfg = ReleaseUWP|Win32 {8BE398E6-B882-4248-9065-FECC8728E038}.ReleaseUWP|x86.Build.0 = ReleaseUWP|Win32 + {57F6206D-F264-4B07-BAF8-11B9BBE1F455}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {57F6206D-F264-4B07-BAF8-11B9BBE1F455}.Debug|ARM64.Build.0 = Debug|ARM64 + {57F6206D-F264-4B07-BAF8-11B9BBE1F455}.Debug|x64.ActiveCfg = Debug|x64 + {57F6206D-F264-4B07-BAF8-11B9BBE1F455}.Debug|x64.Build.0 = Debug|x64 + {57F6206D-F264-4B07-BAF8-11B9BBE1F455}.Debug|x86.ActiveCfg = Debug|Win32 + {57F6206D-F264-4B07-BAF8-11B9BBE1F455}.Debug|x86.Build.0 = Debug|Win32 + {57F6206D-F264-4B07-BAF8-11B9BBE1F455}.DebugFast|ARM64.ActiveCfg = DebugFast|ARM64 + {57F6206D-F264-4B07-BAF8-11B9BBE1F455}.DebugFast|ARM64.Build.0 = DebugFast|ARM64 + {57F6206D-F264-4B07-BAF8-11B9BBE1F455}.DebugFast|x64.ActiveCfg = DebugFast|x64 + {57F6206D-F264-4B07-BAF8-11B9BBE1F455}.DebugFast|x64.Build.0 = DebugFast|x64 + {57F6206D-F264-4B07-BAF8-11B9BBE1F455}.DebugFast|x86.ActiveCfg = DebugFast|Win32 + {57F6206D-F264-4B07-BAF8-11B9BBE1F455}.DebugFast|x86.Build.0 = DebugFast|Win32 + {57F6206D-F264-4B07-BAF8-11B9BBE1F455}.DebugUWP|ARM64.ActiveCfg = DebugUWP|ARM64 + {57F6206D-F264-4B07-BAF8-11B9BBE1F455}.DebugUWP|ARM64.Build.0 = DebugUWP|ARM64 + {57F6206D-F264-4B07-BAF8-11B9BBE1F455}.DebugUWP|x64.ActiveCfg = DebugUWP|x64 + {57F6206D-F264-4B07-BAF8-11B9BBE1F455}.DebugUWP|x64.Build.0 = DebugUWP|x64 + {57F6206D-F264-4B07-BAF8-11B9BBE1F455}.DebugUWP|x86.ActiveCfg = DebugUWP|Win32 + {57F6206D-F264-4B07-BAF8-11B9BBE1F455}.DebugUWP|x86.Build.0 = DebugUWP|Win32 + {57F6206D-F264-4B07-BAF8-11B9BBE1F455}.Release|ARM64.ActiveCfg = Release|ARM64 + {57F6206D-F264-4B07-BAF8-11B9BBE1F455}.Release|ARM64.Build.0 = Release|ARM64 + {57F6206D-F264-4B07-BAF8-11B9BBE1F455}.Release|x64.ActiveCfg = Release|x64 + {57F6206D-F264-4B07-BAF8-11B9BBE1F455}.Release|x64.Build.0 = Release|x64 + {57F6206D-F264-4B07-BAF8-11B9BBE1F455}.Release|x86.ActiveCfg = Release|Win32 + {57F6206D-F264-4B07-BAF8-11B9BBE1F455}.Release|x86.Build.0 = Release|Win32 + {57F6206D-F264-4B07-BAF8-11B9BBE1F455}.ReleaseLTCG|ARM64.ActiveCfg = ReleaseLTCG|ARM64 + {57F6206D-F264-4B07-BAF8-11B9BBE1F455}.ReleaseLTCG|ARM64.Build.0 = ReleaseLTCG|ARM64 + {57F6206D-F264-4B07-BAF8-11B9BBE1F455}.ReleaseLTCG|x64.ActiveCfg = ReleaseLTCG|x64 + {57F6206D-F264-4B07-BAF8-11B9BBE1F455}.ReleaseLTCG|x64.Build.0 = ReleaseLTCG|x64 + {57F6206D-F264-4B07-BAF8-11B9BBE1F455}.ReleaseLTCG|x86.ActiveCfg = ReleaseLTCG|Win32 + {57F6206D-F264-4B07-BAF8-11B9BBE1F455}.ReleaseLTCG|x86.Build.0 = ReleaseLTCG|Win32 + {57F6206D-F264-4B07-BAF8-11B9BBE1F455}.ReleaseUWP|ARM64.ActiveCfg = ReleaseUWP|ARM64 + {57F6206D-F264-4B07-BAF8-11B9BBE1F455}.ReleaseUWP|ARM64.Build.0 = ReleaseUWP|ARM64 + {57F6206D-F264-4B07-BAF8-11B9BBE1F455}.ReleaseUWP|x64.ActiveCfg = ReleaseUWP|x64 + {57F6206D-F264-4B07-BAF8-11B9BBE1F455}.ReleaseUWP|x64.Build.0 = ReleaseUWP|x64 + {57F6206D-F264-4B07-BAF8-11B9BBE1F455}.ReleaseUWP|x86.ActiveCfg = ReleaseUWP|Win32 + {57F6206D-F264-4B07-BAF8-11B9BBE1F455}.ReleaseUWP|x86.Build.0 = ReleaseUWP|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 61fd8f533..dd24bec1a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,4 +1,5 @@ add_subdirectory(common) +add_subdirectory(util) add_subdirectory(core) add_subdirectory(scmversion) add_subdirectory(frontend-common) diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index e98cf1be2..a68e453ec 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -2,34 +2,12 @@ add_library(common align.h assert.cpp assert.h - audio_stream.cpp - audio_stream.h bitfield.h bitutils.h byte_stream.cpp byte_stream.h - cd_image.cpp - cd_image.h - cd_image_bin.cpp - cd_image_cue.cpp - cd_image_chd.cpp - cd_image_device.cpp - cd_image_ecm.cpp - cd_image_hasher.cpp - cd_image_hasher.h - cd_image_m3u.cpp - cd_image_memory.cpp - cd_image_mds.cpp - cd_image_pbp.cpp - cd_image_ppf.cpp - cd_subchannel_replacement.cpp - cd_subchannel_replacement.h - cd_xa.cpp - cd_xa.h crash_handler.cpp crash_handler.h - cue_parser.cpp - cue_parser.h dimensional_array.h error.cpp error.h @@ -52,10 +30,6 @@ add_library(common gl/texture.h hash_combine.h heap_array.h - iso_reader.cpp - iso_reader.h - jit_code_buffer.cpp - jit_code_buffer.h log.cpp log.h make_array.h @@ -63,23 +37,12 @@ add_library(common md5_digest.h minizip_helpers.cpp minizip_helpers.h - null_audio_stream.cpp - null_audio_stream.h - memory_arena.cpp - memory_arena.h - page_fault_handler.cpp - page_fault_handler.h path.h platform.h - pbp_types.h progress_callback.cpp progress_callback.h rectangle.h scope_guard.h - shiftjis.cpp - shiftjis.h - state_wrapper.cpp - state_wrapper.h string.cpp string.h string_util.cpp @@ -111,8 +74,6 @@ add_library(common vulkan/texture.h vulkan/util.cpp vulkan/util.h - wav_writer.cpp - wav_writer.h window_info.cpp window_info.h ) diff --git a/src/common/common.props b/src/common/common.props index c2bf639de..2c7caeb1c 100644 --- a/src/common/common.props +++ b/src/common/common.props @@ -2,13 +2,13 @@ - $(SolutionDir)dep\fmt\include;$(SolutionDir)dep\libsamplerate\include;$(SolutionDir)dep\glad\include;$(SolutionDir)dep\vulkan\include;$(SolutionDir)dep\libcue\include;$(SolutionDir)dep\libchdr\include;$(SolutionDir)dep\stb\include;$(SolutionDir)dep\glslang;$(SolutionDir)dep\zlib\include;$(SolutionDir)dep\minizip\include;$(SolutionDir)src;%(AdditionalIncludeDirectories) + $(SolutionDir)dep\fmt\include;$(SolutionDir)dep\glad\include;$(SolutionDir)dep\vulkan\include;$(SolutionDir)dep\stb\include;$(SolutionDir)dep\glslang;$(SolutionDir)dep\zlib\include;$(SolutionDir)dep\minizip\include;$(SolutionDir)src;%(AdditionalIncludeDirectories) - $(RootBuildDir)fmt\fmt.lib;$(RootBuildDir)glad\glad.lib;$(RootBuildDir)glslang\glslang.lib;$(RootBuildDir)libchdr\libchdr.lib;$(RootBuildDir)zlib\zlib.lib;$(RootBuildDir)minizip\minizip.lib;$(RootBuildDir)lzma\lzma.lib;$(RootBuildDir)libsamplerate\libsamplerate.lib;d3dcompiler.lib;d3d11.lib;%(AdditionalDependencies) + $(RootBuildDir)fmt\fmt.lib;$(RootBuildDir)glad\glad.lib;$(RootBuildDir)glslang\glslang.lib;$(RootBuildDir)zlib\zlib.lib;$(RootBuildDir)minizip\minizip.lib;$(RootBuildDir)lzma\lzma.lib;d3dcompiler.lib;d3d11.lib;%(AdditionalDependencies) diff --git a/src/common/common.vcxproj b/src/common/common.vcxproj index 4a0115102..f26b94d5e 100644 --- a/src/common/common.vcxproj +++ b/src/common/common.vcxproj @@ -4,14 +4,10 @@ - - - - @@ -49,24 +45,16 @@ true - - - - - - - - @@ -74,7 +62,6 @@ - @@ -88,7 +75,6 @@ - true @@ -97,22 +83,8 @@ - - - - - - - - - - - - - - @@ -144,19 +116,10 @@ true - - - - - - - - - @@ -174,7 +137,6 @@ - true diff --git a/src/common/common.vcxproj.filters b/src/common/common.vcxproj.filters index f3f9f4099..08727e67b 100644 --- a/src/common/common.vcxproj.filters +++ b/src/common/common.vcxproj.filters @@ -3,11 +3,7 @@ - - - - gl @@ -31,10 +27,6 @@ d3d11 - - - - @@ -49,7 +41,6 @@ - gl @@ -62,7 +53,6 @@ gl - vulkan @@ -99,9 +89,6 @@ - - - thirdparty @@ -111,7 +98,6 @@ - d3d12 @@ -149,13 +135,6 @@ - - - - - - - gl @@ -177,9 +156,6 @@ d3d11 - - - @@ -191,9 +167,7 @@ d3d11 - - gl @@ -204,7 +178,6 @@ gl - vulkan @@ -236,24 +209,14 @@ vulkan - - - - thirdparty - - - - - - d3d12 @@ -275,7 +238,6 @@ d3d12 - diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 0702e882c..689d2c9da 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -120,7 +120,7 @@ set(RECOMPILER_SRCS target_include_directories(core PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/..") target_include_directories(core PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/..") -target_link_libraries(core PUBLIC Threads::Threads common zlib) +target_link_libraries(core PUBLIC Threads::Threads common util zlib) target_link_libraries(core PRIVATE glad stb xxhash imgui) if(WIN32) diff --git a/src/core/analog_controller.cpp b/src/core/analog_controller.cpp index 5bc212247..ab5455c4a 100644 --- a/src/core/analog_controller.cpp +++ b/src/core/analog_controller.cpp @@ -1,10 +1,10 @@ #include "analog_controller.h" #include "common/log.h" -#include "common/state_wrapper.h" #include "common/string_util.h" #include "host_interface.h" #include "settings.h" #include "system.h" +#include "util/state_wrapper.h" #include Log_SetChannel(AnalogController); diff --git a/src/core/analog_joystick.cpp b/src/core/analog_joystick.cpp index e9feb6cc1..8245d5131 100644 --- a/src/core/analog_joystick.cpp +++ b/src/core/analog_joystick.cpp @@ -1,9 +1,9 @@ #include "analog_joystick.h" #include "common/log.h" -#include "common/state_wrapper.h" #include "common/string_util.h" #include "host_interface.h" #include "system.h" +#include "util/state_wrapper.h" #include Log_SetChannel(AnalogJoystick); diff --git a/src/core/bus.cpp b/src/core/bus.cpp index 0d443d7e3..638f6214a 100644 --- a/src/core/bus.cpp +++ b/src/core/bus.cpp @@ -4,7 +4,6 @@ #include "common/assert.h" #include "common/log.h" #include "common/make_array.h" -#include "common/state_wrapper.h" #include "cpu_code_cache.h" #include "cpu_core.h" #include "cpu_core_private.h" @@ -18,6 +17,7 @@ #include "sio.h" #include "spu.h" #include "timers.h" +#include "util/state_wrapper.h" #include #include #include diff --git a/src/core/bus.h b/src/core/bus.h index 90762450c..636c09d81 100644 --- a/src/core/bus.h +++ b/src/core/bus.h @@ -1,6 +1,6 @@ #pragma once #include "common/bitfield.h" -#include "common/memory_arena.h" +#include "util/memory_arena.h" #include "types.h" #include #include diff --git a/src/core/cdrom.cpp b/src/core/cdrom.cpp index ac2506252..b7b7a03ac 100644 --- a/src/core/cdrom.cpp +++ b/src/core/cdrom.cpp @@ -1,15 +1,15 @@ #include "cdrom.h" #include "common/align.h" -#include "common/cd_image.h" #include "common/log.h" #include "common/platform.h" -#include "common/state_wrapper.h" #include "dma.h" #include "imgui.h" #include "interrupt_controller.h" #include "settings.h" #include "spu.h" #include "system.h" +#include "util/cd_image.h" +#include "util/state_wrapper.h" #include Log_SetChannel(CDROM); diff --git a/src/core/cdrom.h b/src/core/cdrom.h index ea3786c2b..7d4f08ba1 100644 --- a/src/core/cdrom.h +++ b/src/core/cdrom.h @@ -1,11 +1,11 @@ #pragma once #include "cdrom_async_reader.h" #include "common/bitfield.h" -#include "common/cd_image.h" -#include "common/cd_xa.h" #include "common/fifo_queue.h" #include "common/heap_array.h" #include "types.h" +#include "util/cd_image.h" +#include "util/cd_xa.h" #include #include #include diff --git a/src/core/cdrom_async_reader.h b/src/core/cdrom_async_reader.h index 2664821cc..2e9320ff1 100644 --- a/src/core/cdrom_async_reader.h +++ b/src/core/cdrom_async_reader.h @@ -1,5 +1,5 @@ #pragma once -#include "common/cd_image.h" +#include "util/cd_image.h" #include "types.h" #include #include diff --git a/src/core/cheevos.cpp b/src/core/cheevos.cpp index 333fcbb86..30d0b473a 100644 --- a/src/core/cheevos.cpp +++ b/src/core/cheevos.cpp @@ -1,13 +1,11 @@ #include "cheevos.h" #include "common/assert.h" -#include "common/cd_image.h" #include "common/file_system.h" #include "common/http_downloader.h" #include "common/log.h" #include "common/md5_digest.h" #include "common/path.h" #include "common/platform.h" -#include "common/state_wrapper.h" #include "common/string_util.h" #include "core/bios.h" #include "core/bus.h" @@ -20,6 +18,8 @@ #include "rc_url.h" #include "rcheevos.h" #include "scmversion/scmversion.h" +#include "util/cd_image.h" +#include "util/state_wrapper.h" #include #include #include diff --git a/src/core/controller.cpp b/src/core/controller.cpp index e4fd7b223..a6ddee9b6 100644 --- a/src/core/controller.cpp +++ b/src/core/controller.cpp @@ -1,11 +1,11 @@ #include "controller.h" #include "analog_controller.h" #include "analog_joystick.h" -#include "common/state_wrapper.h" #include "digital_controller.h" #include "namco_guncon.h" #include "negcon.h" #include "playstation_mouse.h" +#include "util/state_wrapper.h" Controller::Controller() = default; diff --git a/src/core/core.props b/src/core/core.props index d917e83c8..01d10ce26 100644 --- a/src/core/core.props +++ b/src/core/core.props @@ -1,6 +1,6 @@  - + @@ -19,7 +19,7 @@ - $(RootBuildDir)rcheevos\rcheevos.lib;$(RootBuildDir)imgui\imgui.lib;$(RootBuildDir)stb\stb.lib;$(RootBuildDir)xxhash\xxhash.lib;$(RootBuildDir)zlib\zlib.lib;$(RootBuildDir)common\common.lib;%(AdditionalDependencies) + $(RootBuildDir)rcheevos\rcheevos.lib;$(RootBuildDir)imgui\imgui.lib;$(RootBuildDir)stb\stb.lib;$(RootBuildDir)xxhash\xxhash.lib;$(RootBuildDir)zlib\zlib.lib;$(RootBuildDir)util\util.lib;$(RootBuildDir)common\common.lib;%(AdditionalDependencies) $(RootBuildDir)rainterface\rainterface.lib;%(AdditionalDependencies) $(RootBuildDir)vixl\vixl.lib;%(AdditionalDependencies) diff --git a/src/core/cpu_code_cache.h b/src/core/cpu_code_cache.h index 161c78d89..b2a8b2820 100644 --- a/src/core/cpu_code_cache.h +++ b/src/core/cpu_code_cache.h @@ -1,9 +1,9 @@ #pragma once #include "bus.h" #include "common/bitfield.h" -#include "common/jit_code_buffer.h" -#include "common/page_fault_handler.h" #include "cpu_types.h" +#include "util/jit_code_buffer.h" +#include "util/page_fault_handler.h" #include #include #include @@ -97,10 +97,7 @@ struct CodeBlock const u32 GetPC() const { return key.GetPC(); } const u32 GetSizeInBytes() const { return static_cast(instructions.size()) * sizeof(Instruction); } const u32 GetStartPageIndex() const { return (key.GetPCPhysicalAddress() / HOST_PAGE_SIZE); } - const u32 GetEndPageIndex() const - { - return ((key.GetPCPhysicalAddress() + GetSizeInBytes()) / HOST_PAGE_SIZE); - } + const u32 GetEndPageIndex() const { return ((key.GetPCPhysicalAddress() + GetSizeInBytes()) / HOST_PAGE_SIZE); } bool IsInRAM() const { // TODO: Constant @@ -125,7 +122,7 @@ void Execute(); #ifdef WITH_RECOMPILER using DispatcherFunction = void (*)(); -using SingleBlockDispatcherFunction = void(*)(const CodeBlock::HostCodePointer); +using SingleBlockDispatcherFunction = void (*)(const CodeBlock::HostCodePointer); FastMapTable* GetFastMapPointer(); void ExecuteRecompiler(); diff --git a/src/core/cpu_core.cpp b/src/core/cpu_core.cpp index 8389955a7..92665d89b 100644 --- a/src/core/cpu_core.cpp +++ b/src/core/cpu_core.cpp @@ -3,7 +3,6 @@ #include "common/align.h" #include "common/file_system.h" #include "common/log.h" -#include "common/state_wrapper.h" #include "cpu_core_private.h" #include "cpu_disasm.h" #include "cpu_recompiler_thunks.h" @@ -13,6 +12,7 @@ #include "settings.h" #include "system.h" #include "timing_event.h" +#include "util/state_wrapper.h" #include Log_SetChannel(CPU::Core); diff --git a/src/core/cpu_recompiler_code_generator.h b/src/core/cpu_recompiler_code_generator.h index 49cc452c8..99fd507d4 100644 --- a/src/core/cpu_recompiler_code_generator.h +++ b/src/core/cpu_recompiler_code_generator.h @@ -4,7 +4,7 @@ #include #include -#include "common/jit_code_buffer.h" +#include "util/jit_code_buffer.h" #include "cpu_code_cache.h" #include "cpu_recompiler_register_cache.h" diff --git a/src/core/digital_controller.cpp b/src/core/digital_controller.cpp index 8b4af20c9..ad5bdd980 100644 --- a/src/core/digital_controller.cpp +++ b/src/core/digital_controller.cpp @@ -1,8 +1,8 @@ #include "digital_controller.h" #include "common/assert.h" -#include "common/state_wrapper.h" #include "host_interface.h" #include "system.h" +#include "util/state_wrapper.h" DigitalController::DigitalController() = default; diff --git a/src/core/dma.cpp b/src/core/dma.cpp index c43966a95..6ba873367 100644 --- a/src/core/dma.cpp +++ b/src/core/dma.cpp @@ -2,7 +2,6 @@ #include "bus.h" #include "cdrom.h" #include "common/log.h" -#include "common/state_wrapper.h" #include "common/string_util.h" #include "cpu_code_cache.h" #include "cpu_core.h" @@ -13,6 +12,7 @@ #include "pad.h" #include "spu.h" #include "system.h" +#include "util/state_wrapper.h" Log_SetChannel(DMA); static u32 GetAddressMask() diff --git a/src/core/gpu.cpp b/src/core/gpu.cpp index a99d076a7..202bddaf9 100644 --- a/src/core/gpu.cpp +++ b/src/core/gpu.cpp @@ -2,7 +2,6 @@ #include "common/file_system.h" #include "common/heap_array.h" #include "common/log.h" -#include "common/state_wrapper.h" #include "common/string_util.h" #include "dma.h" #include "host_display.h" @@ -13,6 +12,7 @@ #include "stb_image_write.h" #include "system.h" #include "timers.h" +#include "util/state_wrapper.h" #include Log_SetChannel(GPU); diff --git a/src/core/gpu_backend.cpp b/src/core/gpu_backend.cpp index 42673e317..e9e441ac6 100644 --- a/src/core/gpu_backend.cpp +++ b/src/core/gpu_backend.cpp @@ -1,9 +1,9 @@ #include "gpu_backend.h" #include "common/align.h" #include "common/log.h" -#include "common/state_wrapper.h" #include "common/timer.h" #include "settings.h" +#include "util/state_wrapper.h" Log_SetChannel(GPUBackend); std::unique_ptr g_gpu_backend; diff --git a/src/core/gpu_hw.cpp b/src/core/gpu_hw.cpp index cbe56fc85..08be657c9 100644 --- a/src/core/gpu_hw.cpp +++ b/src/core/gpu_hw.cpp @@ -2,13 +2,13 @@ #include "common/align.h" #include "common/assert.h" #include "common/log.h" -#include "common/state_wrapper.h" #include "cpu_core.h" #include "gpu_sw_backend.h" #include "imgui.h" #include "pgxp.h" #include "settings.h" #include "system.h" +#include "util/state_wrapper.h" #include #include #include diff --git a/src/core/gpu_hw_d3d11.cpp b/src/core/gpu_hw_d3d11.cpp index 584ea2530..e23a3cd24 100644 --- a/src/core/gpu_hw_d3d11.cpp +++ b/src/core/gpu_hw_d3d11.cpp @@ -2,7 +2,6 @@ #include "common/assert.h" #include "common/d3d11/shader_compiler.h" #include "common/log.h" -#include "common/state_wrapper.h" #include "common/timer.h" #include "gpu_hw_shadergen.h" #include "gpu_sw_backend.h" @@ -10,6 +9,7 @@ #include "host_interface.h" #include "shader_cache_version.h" #include "system.h" +#include "util/state_wrapper.h" Log_SetChannel(GPU_HW_D3D11); GPU_HW_D3D11::GPU_HW_D3D11() = default; diff --git a/src/core/gpu_hw_opengl.cpp b/src/core/gpu_hw_opengl.cpp index 64daba8c8..e2d7b3e9a 100644 --- a/src/core/gpu_hw_opengl.cpp +++ b/src/core/gpu_hw_opengl.cpp @@ -1,13 +1,13 @@ #include "gpu_hw_opengl.h" #include "common/assert.h" #include "common/log.h" -#include "common/state_wrapper.h" #include "common/timer.h" #include "gpu_hw_shadergen.h" #include "host_display.h" #include "shader_cache_version.h" #include "system.h" #include "texture_replacements.h" +#include "util/state_wrapper.h" Log_SetChannel(GPU_HW_OpenGL); GPU_HW_OpenGL::GPU_HW_OpenGL() : GPU_HW() {} diff --git a/src/core/gpu_hw_vulkan.cpp b/src/core/gpu_hw_vulkan.cpp index 5dd48a4b2..d683d3e8e 100644 --- a/src/core/gpu_hw_vulkan.cpp +++ b/src/core/gpu_hw_vulkan.cpp @@ -2,7 +2,6 @@ #include "common/assert.h" #include "common/log.h" #include "common/scope_guard.h" -#include "common/state_wrapper.h" #include "common/timer.h" #include "common/vulkan/builders.h" #include "common/vulkan/context.h" @@ -12,6 +11,7 @@ #include "host_display.h" #include "host_interface.h" #include "system.h" +#include "util/state_wrapper.h" Log_SetChannel(GPU_HW_Vulkan); GPU_HW_Vulkan::GPU_HW_Vulkan() = default; diff --git a/src/core/gte.cpp b/src/core/gte.cpp index 809f604d8..aad5db186 100644 --- a/src/core/gte.cpp +++ b/src/core/gte.cpp @@ -1,7 +1,7 @@ #include "gte.h" #include "common/assert.h" #include "common/bitutils.h" -#include "common/state_wrapper.h" +#include "util/state_wrapper.h" #include "cpu_core.h" #include "cpu_core_private.h" #include "host_display.h" diff --git a/src/core/host_interface.cpp b/src/core/host_interface.cpp index 045f47b39..031cb805d 100644 --- a/src/core/host_interface.cpp +++ b/src/core/host_interface.cpp @@ -1,7 +1,6 @@ #include "host_interface.h" #include "bios.h" #include "cdrom.h" -#include "common/audio_stream.h" #include "common/byte_stream.h" #include "common/file_system.h" #include "common/image.h" @@ -21,6 +20,7 @@ #include "spu.h" #include "system.h" #include "texture_replacements.h" +#include "util/audio_stream.h" #include #include #include diff --git a/src/core/interrupt_controller.cpp b/src/core/interrupt_controller.cpp index 91747a4b0..164a66519 100644 --- a/src/core/interrupt_controller.cpp +++ b/src/core/interrupt_controller.cpp @@ -1,7 +1,7 @@ #include "interrupt_controller.h" #include "common/log.h" -#include "common/state_wrapper.h" #include "cpu_core.h" +#include "util/state_wrapper.h" Log_SetChannel(InterruptController); InterruptController g_interrupt_controller; diff --git a/src/core/mdec.cpp b/src/core/mdec.cpp index 3bbb50726..d5332eca2 100644 --- a/src/core/mdec.cpp +++ b/src/core/mdec.cpp @@ -1,11 +1,11 @@ #include "mdec.h" #include "common/log.h" -#include "common/state_wrapper.h" #include "cpu_core.h" #include "dma.h" #include "imgui.h" #include "interrupt_controller.h" #include "system.h" +#include "util/state_wrapper.h" Log_SetChannel(MDEC); MDEC g_mdec; diff --git a/src/core/memory_card.cpp b/src/core/memory_card.cpp index 9a6217479..d306bf4d7 100644 --- a/src/core/memory_card.cpp +++ b/src/core/memory_card.cpp @@ -2,10 +2,10 @@ #include "common/byte_stream.h" #include "common/file_system.h" #include "common/log.h" -#include "common/state_wrapper.h" #include "common/string_util.h" #include "host_interface.h" #include "system.h" +#include "util/state_wrapper.h" #include Log_SetChannel(MemoryCard); diff --git a/src/core/memory_card_image.cpp b/src/core/memory_card_image.cpp index ca03e9810..868d214f8 100644 --- a/src/core/memory_card_image.cpp +++ b/src/core/memory_card_image.cpp @@ -3,11 +3,11 @@ #include "common/file_system.h" #include "common/log.h" #include "common/path.h" -#include "common/shiftjis.h" -#include "common/state_wrapper.h" #include "common/string_util.h" #include "host_interface.h" #include "system.h" +#include "util/shiftjis.h" +#include "util/state_wrapper.h" #include #include #include diff --git a/src/core/multitap.cpp b/src/core/multitap.cpp index 2f9501463..b0dd54d95 100644 --- a/src/core/multitap.cpp +++ b/src/core/multitap.cpp @@ -1,10 +1,10 @@ #include "multitap.h" #include "common/log.h" -#include "common/state_wrapper.h" #include "common/types.h" #include "controller.h" #include "memory_card.h" #include "pad.h" +#include "util/state_wrapper.h" Log_SetChannel(Multitap); Multitap::Multitap() diff --git a/src/core/multitap.h b/src/core/multitap.h index 701a696f4..d201651b0 100644 --- a/src/core/multitap.h +++ b/src/core/multitap.h @@ -1,8 +1,8 @@ #pragma once -#include "common/state_wrapper.h" #include "common/types.h" #include "controller.h" #include "memory_card.h" +#include "util/state_wrapper.h" #include class Multitap final diff --git a/src/core/namco_guncon.cpp b/src/core/namco_guncon.cpp index c0c6ecf63..9c88a79d7 100644 --- a/src/core/namco_guncon.cpp +++ b/src/core/namco_guncon.cpp @@ -1,12 +1,12 @@ #include "namco_guncon.h" #include "common/assert.h" #include "common/log.h" -#include "common/state_wrapper.h" #include "gpu.h" #include "host_display.h" #include "host_interface.h" #include "resources.h" #include "system.h" +#include "util/state_wrapper.h" #include Log_SetChannel(NamcoGunCon); diff --git a/src/core/negcon.cpp b/src/core/negcon.cpp index 8069e20dc..d07cdd66b 100644 --- a/src/core/negcon.cpp +++ b/src/core/negcon.cpp @@ -1,8 +1,8 @@ #include "negcon.h" #include "common/assert.h" #include "common/log.h" -#include "common/state_wrapper.h" #include "host_interface.h" +#include "util/state_wrapper.h" #include #include diff --git a/src/core/pad.cpp b/src/core/pad.cpp index 8f9e09847..f1c04245e 100644 --- a/src/core/pad.cpp +++ b/src/core/pad.cpp @@ -1,12 +1,12 @@ #include "pad.h" #include "common/log.h" -#include "common/state_wrapper.h" #include "controller.h" #include "host_interface.h" #include "interrupt_controller.h" #include "memory_card.h" #include "multitap.h" #include "system.h" +#include "util/state_wrapper.h" Log_SetChannel(Pad); Pad g_pad; diff --git a/src/core/playstation_mouse.cpp b/src/core/playstation_mouse.cpp index ab57fe49f..c55aab7b0 100644 --- a/src/core/playstation_mouse.cpp +++ b/src/core/playstation_mouse.cpp @@ -1,11 +1,11 @@ #include "playstation_mouse.h" #include "common/assert.h" #include "common/log.h" -#include "common/state_wrapper.h" #include "gpu.h" #include "host_display.h" #include "host_interface.h" #include "system.h" +#include "util/state_wrapper.h" #include Log_SetChannel(PlayStationMouse); diff --git a/src/core/sio.cpp b/src/core/sio.cpp index cf7b0f35b..8515da3d4 100644 --- a/src/core/sio.cpp +++ b/src/core/sio.cpp @@ -1,10 +1,10 @@ #include "sio.h" #include "common/log.h" -#include "common/state_wrapper.h" #include "controller.h" #include "host_interface.h" #include "interrupt_controller.h" #include "memory_card.h" +#include "util/state_wrapper.h" Log_SetChannel(SIO); SIO g_sio; diff --git a/src/core/spu.cpp b/src/core/spu.cpp index aab05bc53..4918c20d7 100644 --- a/src/core/spu.cpp +++ b/src/core/spu.cpp @@ -1,15 +1,15 @@ #include "spu.h" #include "cdrom.h" -#include "common/audio_stream.h" #include "common/file_system.h" #include "common/log.h" -#include "common/state_wrapper.h" -#include "common/wav_writer.h" #include "dma.h" #include "host_interface.h" #include "imgui.h" #include "interrupt_controller.h" #include "system.h" +#include "util/audio_stream.h" +#include "util/state_wrapper.h" +#include "util/wav_writer.h" Log_SetChannel(SPU); SPU g_spu; diff --git a/src/core/system.cpp b/src/core/system.cpp index 59d216711..38f193eff 100644 --- a/src/core/system.cpp +++ b/src/core/system.cpp @@ -3,14 +3,11 @@ #include "bus.h" #include "cdrom.h" #include "cheats.h" -#include "common/audio_stream.h" #include "common/error.h" #include "common/file_system.h" -#include "common/iso_reader.h" #include "common/log.h" #include "common/make_array.h" #include "common/path.h" -#include "common/state_wrapper.h" #include "common/string_util.h" #include "controller.h" #include "cpu_code_cache.h" @@ -34,6 +31,9 @@ #include "spu.h" #include "texture_replacements.h" #include "timers.h" +#include "util/audio_stream.h" +#include "util/iso_reader.h" +#include "util/state_wrapper.h" #include "xxhash.h" #include #include diff --git a/src/core/timers.cpp b/src/core/timers.cpp index 6c86caea3..e9080bf29 100644 --- a/src/core/timers.cpp +++ b/src/core/timers.cpp @@ -1,10 +1,10 @@ #include "timers.h" #include "common/log.h" -#include "common/state_wrapper.h" #include "gpu.h" #include "imgui.h" #include "interrupt_controller.h" #include "system.h" +#include "util/state_wrapper.h" Log_SetChannel(Timers); Timers g_timers; diff --git a/src/core/timing_event.cpp b/src/core/timing_event.cpp index b83e82839..7c4e1de68 100644 --- a/src/core/timing_event.cpp +++ b/src/core/timing_event.cpp @@ -1,10 +1,10 @@ #include "timing_event.h" #include "common/assert.h" #include "common/log.h" -#include "common/state_wrapper.h" #include "cpu_core.h" #include "cpu_core_private.h" #include "system.h" +#include "util/state_wrapper.h" Log_SetChannel(TimingEvents); namespace TimingEvents { diff --git a/src/duckstation-qt/audiosettingswidget.cpp b/src/duckstation-qt/audiosettingswidget.cpp index da64c3f59..b82074b67 100644 --- a/src/duckstation-qt/audiosettingswidget.cpp +++ b/src/duckstation-qt/audiosettingswidget.cpp @@ -1,7 +1,7 @@ #include "audiosettingswidget.h" -#include "common/audio_stream.h" #include "settingsdialog.h" #include "settingwidgetbinder.h" +#include "util/audio_stream.h" #include AudioSettingsWidget::AudioSettingsWidget(QtHostInterface* host_interface, QWidget* parent, SettingsDialog* dialog) diff --git a/src/duckstation-qt/consolesettingswidget.cpp b/src/duckstation-qt/consolesettingswidget.cpp index 212b995b2..92bcd294a 100644 --- a/src/duckstation-qt/consolesettingswidget.cpp +++ b/src/duckstation-qt/consolesettingswidget.cpp @@ -1,9 +1,9 @@ #include "consolesettingswidget.h" -#include "common/cd_image.h" #include "core/system.h" #include "qtutils.h" #include "settingsdialog.h" #include "settingwidgetbinder.h" +#include "util/cd_image.h" #include ConsoleSettingsWidget::ConsoleSettingsWidget(QtHostInterface* host_interface, QWidget* parent, SettingsDialog* dialog) @@ -72,7 +72,8 @@ ConsoleSettingsWidget::ConsoleSettingsWidget(QtHostInterface* host_interface, QW tr("Selects the percentage of the normal clock speed the emulated hardware will run at.")); dialog->registerWidgetHelp( m_ui.enable8MBRAM, tr("Enable 8MB RAM (Dev Console)"), tr("Unchecked"), - tr("Enables an additional 6MB of RAM to obtain a total of 2+6 = 8MB, usually present on dev consoles. Games have to use a larger heap size for " + tr("Enables an additional 6MB of RAM to obtain a total of 2+6 = 8MB, usually present on dev consoles. Games have " + "to use a larger heap size for " "this additional RAM to be usable. Titles which rely on memory mirrors may break, so it should only be used " "with compatible mods.")); dialog->registerWidgetHelp( diff --git a/src/duckstation-qt/gamepropertiesdialog.cpp b/src/duckstation-qt/gamepropertiesdialog.cpp index bdb6df412..c2b050529 100644 --- a/src/duckstation-qt/gamepropertiesdialog.cpp +++ b/src/duckstation-qt/gamepropertiesdialog.cpp @@ -1,6 +1,4 @@ #include "gamepropertiesdialog.h" -#include "common/cd_image.h" -#include "common/cd_image_hasher.h" #include "common/string_util.h" #include "core/settings.h" #include "core/system.h" @@ -11,6 +9,8 @@ #include "qtutils.h" #include "rapidjson/document.h" #include "scmversion/scmversion.h" +#include "util/cd_image.h" +#include "util/cd_image_hasher.h" #include #include #include diff --git a/src/duckstation-qt/mainwindow.cpp b/src/duckstation-qt/mainwindow.cpp index f9c7893fb..0e73715e0 100644 --- a/src/duckstation-qt/mainwindow.cpp +++ b/src/duckstation-qt/mainwindow.cpp @@ -3,7 +3,6 @@ #include "autoupdaterdialog.h" #include "cheatmanagerdialog.h" #include "common/assert.h" -#include "common/cd_image.h" #include "core/host_display.h" #include "core/settings.h" #include "core/system.h" @@ -20,6 +19,7 @@ #include "scmversion/scmversion.h" #include "settingsdialog.h" #include "settingwidgetbinder.h" +#include "util/cd_image.h" #ifdef WITH_CHEEVOS #include "core/cheevos.h" diff --git a/src/duckstation-qt/qthostinterface.cpp b/src/duckstation-qt/qthostinterface.cpp index 691dd9818..a46303c43 100644 --- a/src/duckstation-qt/qthostinterface.cpp +++ b/src/duckstation-qt/qthostinterface.cpp @@ -1,6 +1,5 @@ #include "qthostinterface.h" #include "common/assert.h" -#include "common/audio_stream.h" #include "common/byte_stream.h" #include "common/file_system.h" #include "common/log.h" @@ -25,6 +24,7 @@ #include "qtdisplaywidget.h" #include "qtprogresscallback.h" #include "qtutils.h" +#include "util/audio_stream.h" #include #include #include diff --git a/src/duckstation-regtest/regtest_host_interface.cpp b/src/duckstation-regtest/regtest_host_interface.cpp index 62c1273b5..7149b7c39 100644 --- a/src/duckstation-regtest/regtest_host_interface.cpp +++ b/src/duckstation-regtest/regtest_host_interface.cpp @@ -1,6 +1,5 @@ #include "regtest_host_interface.h" #include "common/assert.h" -#include "common/audio_stream.h" #include "common/byte_stream.h" #include "common/file_system.h" #include "common/log.h" @@ -11,6 +10,7 @@ #include "frontend-common/game_settings.h" #include "regtest_host_display.h" #include "scmversion/scmversion.h" +#include "util/audio_stream.h" #include Log_SetChannel(RegTestHostInterface); diff --git a/src/frontend-common/common_host_interface.cpp b/src/frontend-common/common_host_interface.cpp index 582ad20d9..81408490f 100644 --- a/src/frontend-common/common_host_interface.cpp +++ b/src/frontend-common/common_host_interface.cpp @@ -1,7 +1,6 @@ #include "common_host_interface.h" #include "IconsFontAwesome5.h" #include "common/assert.h" -#include "common/audio_stream.h" #include "common/byte_stream.h" #include "common/crash_handler.h" #include "common/file_system.h" @@ -35,6 +34,7 @@ #include "input_overlay_ui.h" #include "save_state_selector_ui.h" #include "scmversion/scmversion.h" +#include "util/audio_stream.h" #include #include #include diff --git a/src/frontend-common/cubeb_audio_stream.h b/src/frontend-common/cubeb_audio_stream.h index f9bb7025d..5a526b3a7 100644 --- a/src/frontend-common/cubeb_audio_stream.h +++ b/src/frontend-common/cubeb_audio_stream.h @@ -1,6 +1,6 @@ #pragma once -#include "common/audio_stream.h" #include "cubeb/cubeb.h" +#include "util/audio_stream.h" #include class CubebAudioStream final : public AudioStream diff --git a/src/frontend-common/game_database.h b/src/frontend-common/game_database.h index ea2057aae..823c6013a 100644 --- a/src/frontend-common/game_database.h +++ b/src/frontend-common/game_database.h @@ -1,6 +1,6 @@ #pragma once -#include "common/cd_image_hasher.h" #include "core/types.h" +#include "util/cd_image_hasher.h" #include #include #include diff --git a/src/frontend-common/game_list.cpp b/src/frontend-common/game_list.cpp index dd4667d6a..9d6e5c88d 100644 --- a/src/frontend-common/game_list.cpp +++ b/src/frontend-common/game_list.cpp @@ -1,9 +1,7 @@ #include "game_list.h" #include "common/assert.h" #include "common/byte_stream.h" -#include "common/cd_image.h" #include "common/file_system.h" -#include "common/iso_reader.h" #include "common/log.h" #include "common/make_array.h" #include "common/path.h" @@ -14,6 +12,7 @@ #include "core/psf_loader.h" #include "core/settings.h" #include "core/system.h" +#include "util/cd_image.h" #include #include #include diff --git a/src/frontend-common/game_list.h b/src/frontend-common/game_list.h index 67512a92f..81a0497dc 100644 --- a/src/frontend-common/game_list.h +++ b/src/frontend-common/game_list.h @@ -1,8 +1,8 @@ #pragma once -#include "common/cd_image.h" #include "core/types.h" #include "game_database.h" #include "game_settings.h" +#include "util/cd_image.h" #include #include #include diff --git a/src/frontend-common/sdl_audio_stream.h b/src/frontend-common/sdl_audio_stream.h index 184b942fe..bd950b64a 100644 --- a/src/frontend-common/sdl_audio_stream.h +++ b/src/frontend-common/sdl_audio_stream.h @@ -1,5 +1,5 @@ #pragma once -#include "common/audio_stream.h" +#include "util/audio_stream.h" #include class SDLAudioStream final : public AudioStream diff --git a/src/frontend-common/xaudio2_audio_stream.h b/src/frontend-common/xaudio2_audio_stream.h index ca8696ba8..ea99127a6 100644 --- a/src/frontend-common/xaudio2_audio_stream.h +++ b/src/frontend-common/xaudio2_audio_stream.h @@ -1,6 +1,6 @@ #pragma once -#include "common/audio_stream.h" #include "common/windows_headers.h" +#include "util/audio_stream.h" #include #include #include diff --git a/src/util/CMakeLists.txt b/src/util/CMakeLists.txt new file mode 100644 index 000000000..6e92ceafb --- /dev/null +++ b/src/util/CMakeLists.txt @@ -0,0 +1,45 @@ +add_library(util + audio_stream.cpp + audio_stream.h + cd_image.cpp + cd_image.h + cd_image_bin.cpp + cd_image_cue.cpp + cd_image_chd.cpp + cd_image_device.cpp + cd_image_ecm.cpp + cd_image_hasher.cpp + cd_image_hasher.h + cd_image_m3u.cpp + cd_image_memory.cpp + cd_image_mds.cpp + cd_image_pbp.cpp + cd_image_ppf.cpp + cd_subchannel_replacement.cpp + cd_subchannel_replacement.h + cd_xa.cpp + cd_xa.h + cue_parser.cpp + cue_parser.h + iso_reader.cpp + iso_reader.h + jit_code_buffer.cpp + jit_code_buffer.h + null_audio_stream.cpp + null_audio_stream.h + memory_arena.cpp + memory_arena.h + page_fault_handler.cpp + page_fault_handler.h + shiftjis.cpp + shiftjis.h + state_wrapper.cpp + state_wrapper.h + wav_writer.cpp + wav_writer.h +) + +target_include_directories(util PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/..") +target_include_directories(util PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/..") +target_link_libraries(util PUBLIC common) +target_link_libraries(util PRIVATE libchdr samplerate zlib) diff --git a/src/common/audio_stream.cpp b/src/util/audio_stream.cpp similarity index 99% rename from src/common/audio_stream.cpp rename to src/util/audio_stream.cpp index 66a94cb57..057eac1e8 100644 --- a/src/common/audio_stream.cpp +++ b/src/util/audio_stream.cpp @@ -1,6 +1,6 @@ #include "audio_stream.h" #include "assert.h" -#include "log.h" +#include "common/log.h" #include "samplerate.h" #include #include diff --git a/src/common/audio_stream.h b/src/util/audio_stream.h similarity index 98% rename from src/common/audio_stream.h rename to src/util/audio_stream.h index 157429f8b..c5cb8a22d 100644 --- a/src/common/audio_stream.h +++ b/src/util/audio_stream.h @@ -1,6 +1,6 @@ #pragma once -#include "fifo_queue.h" -#include "types.h" +#include "common/fifo_queue.h" +#include "common/types.h" #include #include #include diff --git a/src/common/cd_image.cpp b/src/util/cd_image.cpp similarity index 99% rename from src/common/cd_image.cpp rename to src/util/cd_image.cpp index e3376e8cc..3ddf995c0 100644 --- a/src/common/cd_image.cpp +++ b/src/util/cd_image.cpp @@ -1,9 +1,9 @@ #include "cd_image.h" -#include "assert.h" -#include "file_system.h" -#include "log.h" -#include "path.h" -#include "string_util.h" +#include "common/assert.h" +#include "common/file_system.h" +#include "common/log.h" +#include "common/path.h" +#include "common/string_util.h" #include Log_SetChannel(CDImage); diff --git a/src/common/cd_image.h b/src/util/cd_image.h similarity index 99% rename from src/common/cd_image.h rename to src/util/cd_image.h index 33e221cff..abd8c0cd0 100644 --- a/src/common/cd_image.h +++ b/src/util/cd_image.h @@ -1,7 +1,7 @@ #pragma once -#include "bitfield.h" -#include "progress_callback.h" -#include "types.h" +#include "common/bitfield.h" +#include "common/progress_callback.h" +#include "common/types.h" #include #include #include diff --git a/src/common/cd_image_bin.cpp b/src/util/cd_image_bin.cpp similarity index 97% rename from src/common/cd_image_bin.cpp rename to src/util/cd_image_bin.cpp index b364348cb..a909ad091 100644 --- a/src/common/cd_image_bin.cpp +++ b/src/util/cd_image_bin.cpp @@ -1,8 +1,8 @@ #include "cd_image.h" #include "cd_subchannel_replacement.h" -#include "error.h" -#include "file_system.h" -#include "log.h" +#include "common/error.h" +#include "common/file_system.h" +#include "common/log.h" #include Log_SetChannel(CDImageBin); diff --git a/src/common/cd_image_chd.cpp b/src/util/cd_image_chd.cpp similarity index 98% rename from src/common/cd_image_chd.cpp rename to src/util/cd_image_chd.cpp index 5cd39d36c..547a21e0f 100644 --- a/src/common/cd_image_chd.cpp +++ b/src/util/cd_image_chd.cpp @@ -2,15 +2,15 @@ #define _CRT_SECURE_NO_WARNINGS #endif -#include "align.h" -#include "assert.h" #include "cd_image.h" #include "cd_subchannel_replacement.h" -#include "error.h" -#include "file_system.h" +#include "common/align.h" +#include "common/assert.h" +#include "common/error.h" +#include "common/file_system.h" +#include "common/log.h" +#include "common/platform.h" #include "libchdr/chd.h" -#include "log.h" -#include "platform.h" #include #include #include diff --git a/src/common/cd_image_cue.cpp b/src/util/cd_image_cue.cpp similarity index 98% rename from src/common/cd_image_cue.cpp rename to src/util/cd_image_cue.cpp index f72cc2ef8..9d4c14b2f 100644 --- a/src/common/cd_image_cue.cpp +++ b/src/util/cd_image_cue.cpp @@ -1,11 +1,11 @@ -#include "assert.h" #include "cd_image.h" #include "cd_subchannel_replacement.h" +#include "common/assert.h" +#include "common/error.h" +#include "common/file_system.h" +#include "common/log.h" +#include "common/path.h" #include "cue_parser.h" -#include "error.h" -#include "file_system.h" -#include "log.h" -#include "path.h" #include #include #include diff --git a/src/common/cd_image_device.cpp b/src/util/cd_image_device.cpp similarity index 99% rename from src/common/cd_image_device.cpp rename to src/util/cd_image_device.cpp index f41f57d98..f9013c1ec 100644 --- a/src/common/cd_image_device.cpp +++ b/src/util/cd_image_device.cpp @@ -1,8 +1,8 @@ #include "assert.h" #include "cd_image.h" -#include "error.h" -#include "log.h" -#include "string_util.h" +#include "common/error.h" +#include "common/log.h" +#include "common/string_util.h" #include #include #include @@ -57,7 +57,7 @@ static void DeinterleaveSubcode(const u8* subcode_in, u8* subcode_out) // The include order here is critical. // clang-format off -#include "windows_headers.h" +#include "common/windows_headers.h" #include #include #include diff --git a/src/common/cd_image_ecm.cpp b/src/util/cd_image_ecm.cpp similarity index 99% rename from src/common/cd_image_ecm.cpp rename to src/util/cd_image_ecm.cpp index 378f0fdf2..6b6e79967 100644 --- a/src/common/cd_image_ecm.cpp +++ b/src/util/cd_image_ecm.cpp @@ -1,9 +1,9 @@ -#include "assert.h" #include "cd_image.h" #include "cd_subchannel_replacement.h" -#include "error.h" -#include "file_system.h" -#include "log.h" +#include "common/assert.h" +#include "common/error.h" +#include "common/file_system.h" +#include "common/log.h" #include #include #include diff --git a/src/common/cd_image_hasher.cpp b/src/util/cd_image_hasher.cpp similarity index 98% rename from src/common/cd_image_hasher.cpp rename to src/util/cd_image_hasher.cpp index 1de478546..ca6e7e837 100644 --- a/src/common/cd_image_hasher.cpp +++ b/src/util/cd_image_hasher.cpp @@ -1,7 +1,7 @@ #include "cd_image_hasher.h" #include "cd_image.h" -#include "md5_digest.h" -#include "string_util.h" +#include "common/md5_digest.h" +#include "common/string_util.h" namespace CDImageHasher { diff --git a/src/common/cd_image_hasher.h b/src/util/cd_image_hasher.h similarity index 90% rename from src/common/cd_image_hasher.h rename to src/util/cd_image_hasher.h index c08d3a640..73cd02acf 100644 --- a/src/common/cd_image_hasher.h +++ b/src/util/cd_image_hasher.h @@ -1,6 +1,6 @@ #pragma once -#include "progress_callback.h" -#include "types.h" +#include "common/progress_callback.h" +#include "common/types.h" #include #include #include diff --git a/src/common/cd_image_m3u.cpp b/src/util/cd_image_m3u.cpp similarity index 97% rename from src/common/cd_image_m3u.cpp rename to src/util/cd_image_m3u.cpp index 900f758b5..ccdcec34c 100644 --- a/src/common/cd_image_m3u.cpp +++ b/src/util/cd_image_m3u.cpp @@ -1,10 +1,10 @@ -#include "assert.h" #include "cd_image.h" #include "cd_subchannel_replacement.h" -#include "error.h" -#include "file_system.h" -#include "log.h" -#include "path.h" +#include "common/assert.h" +#include "common/error.h" +#include "common/file_system.h" +#include "common/log.h" +#include "common/path.h" #include #include #include diff --git a/src/common/cd_image_mds.cpp b/src/util/cd_image_mds.cpp similarity index 98% rename from src/common/cd_image_mds.cpp rename to src/util/cd_image_mds.cpp index 22652bf3c..0112ac0bc 100644 --- a/src/common/cd_image_mds.cpp +++ b/src/util/cd_image_mds.cpp @@ -1,10 +1,10 @@ #include "assert.h" #include "cd_image.h" #include "cd_subchannel_replacement.h" -#include "error.h" -#include "file_system.h" -#include "log.h" -#include "path.h" +#include "common/error.h" +#include "common/file_system.h" +#include "common/log.h" +#include "common/path.h" #include #include #include diff --git a/src/common/cd_image_memory.cpp b/src/util/cd_image_memory.cpp similarity index 97% rename from src/common/cd_image_memory.cpp rename to src/util/cd_image_memory.cpp index 9bc409004..590282c26 100644 --- a/src/common/cd_image_memory.cpp +++ b/src/util/cd_image_memory.cpp @@ -1,9 +1,9 @@ -#include "assert.h" #include "cd_image.h" #include "cd_subchannel_replacement.h" -#include "file_system.h" -#include "log.h" -#include "path.h" +#include "common/assert.h" +#include "common/file_system.h" +#include "common/log.h" +#include "common/path.h" #include #include Log_SetChannel(CDImageMemory); diff --git a/src/common/cd_image_pbp.cpp b/src/util/cd_image_pbp.cpp similarity index 99% rename from src/common/cd_image_pbp.cpp rename to src/util/cd_image_pbp.cpp index 9733bf285..c481d7224 100644 --- a/src/common/cd_image_pbp.cpp +++ b/src/util/cd_image_pbp.cpp @@ -1,13 +1,13 @@ -#include "assert.h" #include "cd_image.h" #include "cd_subchannel_replacement.h" -#include "error.h" -#include "file_system.h" -#include "log.h" -#include "path.h" +#include "common/assert.h" +#include "common/error.h" +#include "common/file_system.h" +#include "common/log.h" +#include "common/path.h" +#include "common/string_util.h" #include "pbp_types.h" #include "string.h" -#include "string_util.h" #include "zlib.h" #include #include diff --git a/src/common/cd_image_ppf.cpp b/src/util/cd_image_ppf.cpp similarity index 99% rename from src/common/cd_image_ppf.cpp rename to src/util/cd_image_ppf.cpp index 50936c0f0..1f7850bee 100644 --- a/src/common/cd_image_ppf.cpp +++ b/src/util/cd_image_ppf.cpp @@ -1,8 +1,8 @@ -#include "assert.h" #include "cd_image.h" #include "cd_subchannel_replacement.h" -#include "file_system.h" -#include "log.h" +#include "common/assert.h" +#include "common/file_system.h" +#include "common/log.h" #include #include #include diff --git a/src/common/cd_subchannel_replacement.cpp b/src/util/cd_subchannel_replacement.cpp similarity index 97% rename from src/common/cd_subchannel_replacement.cpp rename to src/util/cd_subchannel_replacement.cpp index da21dcb6d..ebab5a5d4 100644 --- a/src/common/cd_subchannel_replacement.cpp +++ b/src/util/cd_subchannel_replacement.cpp @@ -1,7 +1,7 @@ #include "cd_subchannel_replacement.h" -#include "file_system.h" -#include "log.h" -#include "path.h" +#include "common/file_system.h" +#include "common/log.h" +#include "common/path.h" #include #include Log_SetChannel(CDSubChannelReplacement); diff --git a/src/common/cd_subchannel_replacement.h b/src/util/cd_subchannel_replacement.h similarity index 97% rename from src/common/cd_subchannel_replacement.h rename to src/util/cd_subchannel_replacement.h index 6bdda6e1a..0a53431f4 100644 --- a/src/common/cd_subchannel_replacement.h +++ b/src/util/cd_subchannel_replacement.h @@ -1,6 +1,6 @@ #pragma once #include "cd_image.h" -#include "types.h" +#include "common/types.h" #include #include #include diff --git a/src/common/cd_xa.cpp b/src/util/cd_xa.cpp similarity index 100% rename from src/common/cd_xa.cpp rename to src/util/cd_xa.cpp diff --git a/src/common/cd_xa.h b/src/util/cd_xa.h similarity index 97% rename from src/common/cd_xa.h rename to src/util/cd_xa.h index 3e996d16c..49d53903a 100644 --- a/src/common/cd_xa.h +++ b/src/util/cd_xa.h @@ -1,6 +1,6 @@ #pragma once -#include "bitfield.h" -#include "types.h" +#include "common/bitfield.h" +#include "common/types.h" namespace CDXA { enum diff --git a/src/common/cue_parser.cpp b/src/util/cue_parser.cpp similarity index 99% rename from src/common/cue_parser.cpp rename to src/util/cue_parser.cpp index d9d2826c2..b9e568f51 100644 --- a/src/common/cue_parser.cpp +++ b/src/util/cue_parser.cpp @@ -1,7 +1,7 @@ #include "cue_parser.h" -#include "error.h" -#include "log.h" -#include "string_util.h" +#include "common/error.h" +#include "common/log.h" +#include "common/string_util.h" #include Log_SetChannel(CueParser); diff --git a/src/common/cue_parser.h b/src/util/cue_parser.h similarity index 98% rename from src/common/cue_parser.h rename to src/util/cue_parser.h index ef5e12e85..e18699f12 100644 --- a/src/common/cue_parser.h +++ b/src/util/cue_parser.h @@ -1,6 +1,6 @@ #pragma once -#include "types.h" #include "cd_image.h" +#include "common/types.h" #include #include #include diff --git a/src/common/iso_reader.cpp b/src/util/iso_reader.cpp similarity index 99% rename from src/common/iso_reader.cpp rename to src/util/iso_reader.cpp index b3cef5e8c..3374c3d7c 100644 --- a/src/common/iso_reader.cpp +++ b/src/util/iso_reader.cpp @@ -1,6 +1,6 @@ #include "iso_reader.h" #include "cd_image.h" -#include "log.h" +#include "common/log.h" #include Log_SetChannel(ISOReader); diff --git a/src/common/iso_reader.h b/src/util/iso_reader.h similarity index 99% rename from src/common/iso_reader.h rename to src/util/iso_reader.h index 21ac0f08e..2ed7ce486 100644 --- a/src/common/iso_reader.h +++ b/src/util/iso_reader.h @@ -1,5 +1,5 @@ #pragma once -#include "types.h" +#include "common/types.h" #include #include #include diff --git a/src/common/jit_code_buffer.cpp b/src/util/jit_code_buffer.cpp similarity index 98% rename from src/common/jit_code_buffer.cpp rename to src/util/jit_code_buffer.cpp index 15a6dc835..28e4f86e6 100644 --- a/src/common/jit_code_buffer.cpp +++ b/src/util/jit_code_buffer.cpp @@ -1,13 +1,13 @@ #include "jit_code_buffer.h" -#include "align.h" -#include "assert.h" -#include "log.h" -#include "platform.h" +#include "common/align.h" +#include "common/assert.h" +#include "common/log.h" +#include "common/platform.h" #include Log_SetChannel(JitCodeBuffer); #if defined(_WIN32) -#include "windows_headers.h" +#include "common/windows_headers.h" #else #include #include diff --git a/src/common/jit_code_buffer.h b/src/util/jit_code_buffer.h similarity index 98% rename from src/common/jit_code_buffer.h rename to src/util/jit_code_buffer.h index 72d2b88b4..81b56b081 100644 --- a/src/common/jit_code_buffer.h +++ b/src/util/jit_code_buffer.h @@ -1,5 +1,5 @@ #pragma once -#include "types.h" +#include "common/types.h" class JitCodeBuffer { diff --git a/src/common/memory_arena.cpp b/src/util/memory_arena.cpp similarity index 100% rename from src/common/memory_arena.cpp rename to src/util/memory_arena.cpp diff --git a/src/common/memory_arena.h b/src/util/memory_arena.h similarity index 98% rename from src/common/memory_arena.h rename to src/util/memory_arena.h index ce5ecfa39..19b1da607 100644 --- a/src/common/memory_arena.h +++ b/src/util/memory_arena.h @@ -1,5 +1,5 @@ #pragma once -#include "types.h" +#include "common/types.h" #include #include diff --git a/src/common/null_audio_stream.cpp b/src/util/null_audio_stream.cpp similarity index 100% rename from src/common/null_audio_stream.cpp rename to src/util/null_audio_stream.cpp diff --git a/src/common/null_audio_stream.h b/src/util/null_audio_stream.h similarity index 100% rename from src/common/null_audio_stream.h rename to src/util/null_audio_stream.h diff --git a/src/common/page_fault_handler.cpp b/src/util/page_fault_handler.cpp similarity index 99% rename from src/common/page_fault_handler.cpp rename to src/util/page_fault_handler.cpp index e3a1fda3c..ce806bfbb 100644 --- a/src/common/page_fault_handler.cpp +++ b/src/util/page_fault_handler.cpp @@ -1,6 +1,6 @@ #include "page_fault_handler.h" -#include "log.h" -#include "platform.h" +#include "common/log.h" +#include "common/platform.h" #include #include #include @@ -8,7 +8,7 @@ Log_SetChannel(Common::PageFaultHandler); #if defined(_WIN32) -#include "windows_headers.h" +#include "common/windows_headers.h" #elif defined(__linux__) || defined(__ANDROID__) #include #include diff --git a/src/common/page_fault_handler.h b/src/util/page_fault_handler.h similarity index 94% rename from src/common/page_fault_handler.h rename to src/util/page_fault_handler.h index f4b57b231..695b39fb7 100644 --- a/src/common/page_fault_handler.h +++ b/src/util/page_fault_handler.h @@ -1,5 +1,5 @@ #pragma once -#include "types.h" +#include "common/types.h" namespace Common::PageFaultHandler { enum class HandlerResult diff --git a/src/common/pbp_types.h b/src/util/pbp_types.h similarity index 98% rename from src/common/pbp_types.h rename to src/util/pbp_types.h index 7ab01e039..bb69b7db9 100644 --- a/src/common/pbp_types.h +++ b/src/util/pbp_types.h @@ -1,5 +1,5 @@ #pragma once -#include "types.h" +#include "common/types.h" #include #include #include diff --git a/src/common/shiftjis.cpp b/src/util/shiftjis.cpp similarity index 100% rename from src/common/shiftjis.cpp rename to src/util/shiftjis.cpp diff --git a/src/common/shiftjis.h b/src/util/shiftjis.h similarity index 100% rename from src/common/shiftjis.h rename to src/util/shiftjis.h diff --git a/src/common/state_wrapper.cpp b/src/util/state_wrapper.cpp similarity index 97% rename from src/common/state_wrapper.cpp rename to src/util/state_wrapper.cpp index ef9439e83..9916b6f82 100644 --- a/src/common/state_wrapper.cpp +++ b/src/util/state_wrapper.cpp @@ -1,6 +1,6 @@ #include "state_wrapper.h" -#include "log.h" -#include "string.h" +#include "common/log.h" +#include "common/string.h" #include #include Log_SetChannel(StateWrapper); diff --git a/src/common/state_wrapper.h b/src/util/state_wrapper.h similarity index 97% rename from src/common/state_wrapper.h rename to src/util/state_wrapper.h index 9b264615f..67a949e33 100644 --- a/src/common/state_wrapper.h +++ b/src/util/state_wrapper.h @@ -1,8 +1,8 @@ #pragma once -#include "byte_stream.h" -#include "fifo_queue.h" -#include "heap_array.h" -#include "types.h" +#include "common/byte_stream.h" +#include "common/fifo_queue.h" +#include "common/heap_array.h" +#include "common/types.h" #include #include #include diff --git a/src/util/util.props b/src/util/util.props new file mode 100644 index 000000000..6784be997 --- /dev/null +++ b/src/util/util.props @@ -0,0 +1,16 @@ + + + + + + + $(SolutionDir)dep\libsamplerate\include;$(SolutionDir)dep\libchdr\include;%(AdditionalIncludeDirectories) + + + + + + $(RootBuildDir)libchdr\libchdr.lib;$(RootBuildDir)libsamplerate\libsamplerate.lib;%(AdditionalDependencies) + + + diff --git a/src/util/util.vcxproj b/src/util/util.vcxproj new file mode 100644 index 000000000..d8a455f4e --- /dev/null +++ b/src/util/util.vcxproj @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {57F6206D-F264-4B07-BAF8-11B9BBE1F455} + + + + + + $(IntDir)/%(RelativeDir)/ + + + + \ No newline at end of file diff --git a/src/util/util.vcxproj.filters b/src/util/util.vcxproj.filters new file mode 100644 index 000000000..86e36285e --- /dev/null +++ b/src/util/util.vcxproj.filters @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/common/wav_writer.cpp b/src/util/wav_writer.cpp similarity index 98% rename from src/common/wav_writer.cpp rename to src/util/wav_writer.cpp index 124a186c7..a369912d7 100644 --- a/src/common/wav_writer.cpp +++ b/src/util/wav_writer.cpp @@ -1,6 +1,6 @@ #include "wav_writer.h" -#include "file_system.h" -#include "log.h" +#include "common/file_system.h" +#include "common/log.h" Log_SetChannel(WAVWriter); #pragma pack(push, 1) diff --git a/src/common/wav_writer.h b/src/util/wav_writer.h similarity index 96% rename from src/common/wav_writer.h rename to src/util/wav_writer.h index d81c030e3..1b8ec73ec 100644 --- a/src/common/wav_writer.h +++ b/src/util/wav_writer.h @@ -1,5 +1,5 @@ #pragma once -#include "types.h" +#include "common/types.h" #include namespace Common {