diff --git a/.ci/deploy-linux.sh b/.ci/deploy-linux.sh index 51a5b90a9..38a1d3e05 100755 --- a/.ci/deploy-linux.sh +++ b/.ci/deploy-linux.sh @@ -37,7 +37,7 @@ if [ "$DEPLOY_APPIMAGE" = "true" ]; then APPIMAGE_SUFFIX="linux64" fi - COMM_TAG=$(awk '/version{.*}/ { printf("%d.%d.%d", $5, $6, $7) }' ../rpcs3/rpcs3/rpcs3_version.cpp) + COMM_TAG=$(awk '/version{.*}/ { printf("%d.%d.%d", $5, $6, $7) }' ../rpcs3/rpcs3_version.cpp) COMM_COUNT="$(git rev-list --count HEAD)" COMM_HASH="$(git rev-parse --short=8 HEAD)" RPCS3_APPIMAGE="rpcs3-v${COMM_TAG}-${COMM_COUNT}-${COMM_HASH}_${APPIMAGE_SUFFIX}.AppImage" diff --git a/.ci/setup-windows.sh b/.ci/setup-windows.sh index 9c60332e7..d06a078ab 100755 --- a/.ci/setup-windows.sh +++ b/.ci/setup-windows.sh @@ -104,7 +104,7 @@ mv "$CCACHE_SH_DIR"/ccache-*/* "$CCACHE_SH_DIR" cp "$CCACHE_SH_DIR"/ccache.exe "$CCACHE_SH_DIR"/cl.exe # Gather explicit version number and number of commits -COMM_TAG=$(awk '/version{.*}/ { printf("%d.%d.%d", $5, $6, $7) }' ./rpcs3/rpcs3/rpcs3_version.cpp) +COMM_TAG=$(awk '/version{.*}/ { printf("%d.%d.%d", $5, $6, $7) }' ./rpcs3/rpcs3_version.cpp) COMM_COUNT=$(git rev-list --count HEAD) COMM_HASH=$(git rev-parse --short=8 HEAD) diff --git a/.gitignore b/.gitignore index 3e87a53af..4149b4c1a 100644 --- a/.gitignore +++ b/.gitignore @@ -59,3 +59,4 @@ compile_commands.json build*/ .cache/ +rpcs3/git-version.h diff --git a/CMakeLists.txt b/CMakeLists.txt index d57995cbd..8aab56d36 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -178,6 +178,7 @@ endif() if (WITH_RPCS3) add_subdirectory(rpcs3) + add_subdirectory(ps3fw) endif() if (NOT ANDROID AND WITH_RPCS3_QT_UI AND WITH_RPCS3) diff --git a/cmake/ConfigureCompiler.cmake b/cmake/ConfigureCompiler.cmake index e7a9fb3ab..159789ee0 100644 --- a/cmake/ConfigureCompiler.cmake +++ b/cmake/ConfigureCompiler.cmake @@ -30,7 +30,7 @@ else() endif() add_compile_options(-Wall) - add_compile_options(-fno-exceptions) + # add_compile_options(-fno-exceptions) add_compile_options(-fstack-protector) if(USE_NATIVE_INSTRUCTIONS AND COMPILER_SUPPORTS_MARCH_NATIVE) diff --git a/ps3fw/.clang-format b/ps3fw/.clang-format new file mode 100644 index 000000000..08b2119b3 --- /dev/null +++ b/ps3fw/.clang-format @@ -0,0 +1,32 @@ +Standard: c++20 +UseTab: AlignWithSpaces +TabWidth: 4 +IndentWidth: 4 +AccessModifierOffset: -4 +PointerAlignment: Left +NamespaceIndentation: All +ColumnLimit: 0 +BreakBeforeBraces: Allman +BreakConstructorInitializers: BeforeColon +BreakBeforeBinaryOperators: None +BreakBeforeTernaryOperators: false +AlwaysBreakTemplateDeclarations: Yes +AllowShortIfStatementsOnASingleLine: Never +AllowShortBlocksOnASingleLine: Never +AllowShortCaseLabelsOnASingleLine: true +AllowShortFunctionsOnASingleLine: Empty +AllowShortLoopsOnASingleLine: false +AllowShortLambdasOnASingleLine: Empty +Cpp11BracedListStyle: true +IndentCaseLabels: false +SortIncludes: false +ReflowComments: true +AlignConsecutiveAssignments: false +AlignTrailingComments: true +AlignAfterOpenBracket: DontAlign +ConstructorInitializerAllOnOneLineOrOnePerLine: false +BinPackArguments: true +BinPackParameters: true +AlwaysBreakAfterReturnType: None +KeepEmptyLinesAtTheStartOfBlocks: true +IndentWrappedFunctionNames: false diff --git a/ps3fw/CMakeLists.txt b/ps3fw/CMakeLists.txt new file mode 100644 index 000000000..0fa1687c5 --- /dev/null +++ b/ps3fw/CMakeLists.txt @@ -0,0 +1,149 @@ + +add_library(rpcsx_fw_ps3_api INTERFACE) + +target_include_directories(rpcsx_fw_ps3_api INTERFACE include) + +add_library(rpcsx_fw_ps3 OBJECT + cellAdec.cpp + cellAtrac.cpp + cellAtracMulti.cpp + cellAtracXdec.cpp + cellAudio.cpp + cellAudioOut.cpp + cellAuthDialog.cpp + cellAvconfExt.cpp + cellBgdl.cpp + cellCamera.cpp + cellCelp8Enc.cpp + cellCelpEnc.cpp + cellCrossController.cpp + cellDaisy.cpp + cellDmux.cpp + cellDmuxPamf.cpp + cellDtcpIpUtility.cpp + cellFiber.cpp + cellFont.cpp + cellFontFT.cpp + cell_FreeType2.cpp + cellFs.cpp + cellGame.cpp + cellGameExec.cpp + cellGcmSys.cpp + cellGem.cpp + cellGifDec.cpp + cellHttp.cpp + cellHttpUtil.cpp + cellImeJp.cpp + cellJpgDec.cpp + cellJpgEnc.cpp + cellKb.cpp + cellKey2char.cpp + cellL10n.cpp + cellLibprof.cpp + cellMic.cpp + cellMouse.cpp + cellMsgDialog.cpp + cellMusic.cpp + cellMusicDecode.cpp + cellMusicSelectionContext.cpp + cellMusicExport.cpp + cellNetAoi.cpp + cellNetCtl.cpp + cellOskDialog.cpp + cellOvis.cpp + cellPad.cpp + cellPamf.cpp + cellPesmUtility.cpp + cellPhotoDecode.cpp + cellPhotoExport.cpp + cellPhotoImport.cpp + cellPngDec.cpp + cellPngEnc.cpp + cellPrint.cpp + cellRec.cpp + cellRemotePlay.cpp + cellResc.cpp + cellRtcAlarm.cpp + cellRtc.cpp + cellRudp.cpp + cellSail.cpp + cellSailRec.cpp + cellSaveData.cpp + cellScreenshot.cpp + cellSearch.cpp + cellSheap.cpp + cellSpudll.cpp + cellSpurs.cpp + cellSpursJq.cpp + cellSpursSpu.cpp + cellSsl.cpp + cellStorage.cpp + cellSubDisplay.cpp + cellSync2.cpp + cellSync.cpp + cellSysconf.cpp + cellSysCache.cpp + cellSysmodule.cpp + cellSysutilAp.cpp + cellSysutilAvc2.cpp + cellSysutilAvc.cpp + cellSysutilAvcExt.cpp + cellSysutil.cpp + cellSysutilMisc.cpp + cellSysutilNpEula.cpp + cellUsbd.cpp + cellUsbpspcm.cpp + cellUserInfo.cpp + cellVdec.cpp + cellVideoExport.cpp + cellVideoOut.cpp + cellVideoPlayerUtility.cpp + cellVideoUpload.cpp + cellVoice.cpp + cellVpost.cpp + cellWebBrowser.cpp + HLE_PATCHES.cpp + libad_async.cpp + libad_core.cpp + libmedi.cpp + libmixer.cpp + libsnd3.cpp + libsynth2.cpp + sceNp2.cpp + sceNpClans.cpp + sceNpCommerce2.cpp + sceNp.cpp + sceNpMatchingInt.cpp + sceNpPlus.cpp + sceNpSns.cpp + sceNpTrophy.cpp + sceNpTus.cpp + sceNpUtil.cpp + StaticHLE.cpp + sys_crashdump.cpp + sys_game_.cpp + sys_heap.cpp + sys_io_.cpp + sys_libc_.cpp + sys_libc.cpp + sys_lv2dbg.cpp + sys_lwcond_.cpp + sys_lwmutex_.cpp + sys_mempool.cpp + sys_mmapper_.cpp + sys_net_.cpp + sys_ppu_thread_.cpp + sys_prx_.cpp + sysPrxForUser.cpp + sys_rsxaudio_.cpp + sys_spinlock.cpp + sys_spu_.cpp + libfs_utility_init.cpp +) + +target_link_libraries(rpcsx_fw_ps3 PUBLIC rpcs3 rpcsx_fw_ps3_api 3rdparty::stblib) +target_compile_definitions(rpcsx_fw_ps3 PRIVATE WIN32_LEAN_AND_MEAN NOMINMAX) +target_include_directories(rpcsx_fw_ps3 PRIVATE include/rpcsx/fw/ps3) + +add_library(rpcsx::fw::ps3 ALIAS rpcsx_fw_ps3) +add_library(rpcsx::fw::ps3::api ALIAS rpcsx_fw_ps3_api) diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/HLE_PATCHES.cpp b/ps3fw/HLE_PATCHES.cpp similarity index 85% rename from rpcs3/rpcs3/Emu/Cell/Modules/HLE_PATCHES.cpp rename to ps3fw/HLE_PATCHES.cpp index cf2536ea9..c80d993ba 100644 --- a/rpcs3/rpcs3/Emu/Cell/Modules/HLE_PATCHES.cpp +++ b/ps3fw/HLE_PATCHES.cpp @@ -1,13 +1,14 @@ -#include "stdafx.h" -#include "Emu/IdManager.h" #include "Emu/Cell/PPUModule.h" -#include "Utilities/Thread.h" +#include "Emu/IdManager.h" +#include "stdafx.h" +#include "util/Thread.h" #include "Emu/Cell/lv2/sys_spu.h" #include -// SONIC THE HEDGEDOG: a fix for a race condition between SPUs and PPUs causing missing graphics (SNR is overriden when non-empty) +// SONIC THE HEDGEDOG: a fix for a race condition between SPUs and PPUs causing +// missing graphics (SNR is overriden when non-empty) void WaitForSPUsToEmptySNRs(ppu_thread& ppu, u32 spu_id, u32 snr_mask) { ppu.state += cpu_flag::wait; @@ -20,7 +21,8 @@ void WaitForSPUsToEmptySNRs(ppu_thread& ppu, u32 spu_id, u32 snr_mask) } // Wait until specified SNRs are reported empty at least once - for (bool has_busy = true; has_busy && !ppu.is_stopped(); std::this_thread::yield()) + for (bool has_busy = true; has_busy && !ppu.is_stopped(); + std::this_thread::yield()) { has_busy = false; diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/StaticHLE.cpp b/ps3fw/StaticHLE.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/StaticHLE.cpp rename to ps3fw/StaticHLE.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellAdec.cpp b/ps3fw/cellAdec.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellAdec.cpp rename to ps3fw/cellAdec.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellAtrac.cpp b/ps3fw/cellAtrac.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellAtrac.cpp rename to ps3fw/cellAtrac.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellAtracMulti.cpp b/ps3fw/cellAtracMulti.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellAtracMulti.cpp rename to ps3fw/cellAtracMulti.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellAtracXdec.cpp b/ps3fw/cellAtracXdec.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellAtracXdec.cpp rename to ps3fw/cellAtracXdec.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellAudio.cpp b/ps3fw/cellAudio.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellAudio.cpp rename to ps3fw/cellAudio.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellAudioOut.cpp b/ps3fw/cellAudioOut.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellAudioOut.cpp rename to ps3fw/cellAudioOut.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellAuthDialog.cpp b/ps3fw/cellAuthDialog.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellAuthDialog.cpp rename to ps3fw/cellAuthDialog.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellAvconfExt.cpp b/ps3fw/cellAvconfExt.cpp similarity index 76% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellAvconfExt.cpp rename to ps3fw/cellAvconfExt.cpp index b35b14bad..071d29848 100644 --- a/rpcs3/rpcs3/Emu/Cell/Modules/cellAvconfExt.cpp +++ b/ps3fw/cellAvconfExt.cpp @@ -1,13 +1,13 @@ -#include "stdafx.h" -#include "Emu/system_config.h" #include "Emu/Cell/PPUModule.h" #include "Emu/IdManager.h" #include "Emu/RSX/rsx_utils.h" -#include "Utilities/StrUtil.h" +#include "Emu/system_config.h" +#include "stdafx.h" +#include "util/StrUtil.h" -#include "cellMic.h" #include "cellAudioIn.h" #include "cellAudioOut.h" +#include "cellMic.h" #include "cellVideoOut.h" #include @@ -39,10 +39,12 @@ struct avconf_manager { shared_mutex mutex; std::vector devices; - CellAudioInDeviceMode inDeviceMode = CELL_AUDIO_IN_SINGLE_DEVICE_MODE; // TODO: use somewhere + CellAudioInDeviceMode inDeviceMode = + CELL_AUDIO_IN_SINGLE_DEVICE_MODE; // TODO: use somewhere void copy_device_info(u32 num, vm::ptr info) const; - std::optional get_device_info(vm::cptr name) const; + std::optional + get_device_info(vm::cptr name) const; avconf_manager(); @@ -55,7 +57,8 @@ avconf_manager::avconf_manager() { u32 curindex = 0; - const std::vector mic_list = fmt::split(g_cfg.audio.microphone_devices.to_string(), {"@@@"}); + const std::vector mic_list = + fmt::split(g_cfg.audio.microphone_devices.to_string(), {"@@@"}); if (!mic_list.empty()) { @@ -71,9 +74,13 @@ avconf_manager::avconf_manager() devices[curindex].state = CELL_AUDIO_IN_DEVICE_STATE_AVAILABLE; devices[curindex].deviceId = 0xE11CC0DE + curindex; devices[curindex].type = 0xC0DEE11C; - devices[curindex].availableModes[0].type = CELL_AUDIO_IN_CODING_TYPE_LPCM; + devices[curindex].availableModes[0].type = + CELL_AUDIO_IN_CODING_TYPE_LPCM; devices[curindex].availableModes[0].channel = CELL_AUDIO_IN_CHNUM_2; - devices[curindex].availableModes[0].fs = CELL_AUDIO_IN_FS_8KHZ | CELL_AUDIO_IN_FS_12KHZ | CELL_AUDIO_IN_FS_16KHZ | CELL_AUDIO_IN_FS_24KHZ | CELL_AUDIO_IN_FS_32KHZ | CELL_AUDIO_IN_FS_48KHZ; + devices[curindex].availableModes[0].fs = + CELL_AUDIO_IN_FS_8KHZ | CELL_AUDIO_IN_FS_12KHZ | + CELL_AUDIO_IN_FS_16KHZ | CELL_AUDIO_IN_FS_24KHZ | + CELL_AUDIO_IN_FS_32KHZ | CELL_AUDIO_IN_FS_48KHZ; devices[curindex].deviceNumber = curindex; strcpy_trunc(devices[curindex].name, mic_list[index]); @@ -92,7 +99,10 @@ avconf_manager::avconf_manager() devices[curindex].type = 0x14150000; devices[curindex].availableModes[0].type = CELL_AUDIO_IN_CODING_TYPE_LPCM; devices[curindex].availableModes[0].channel = CELL_AUDIO_IN_CHNUM_2; - devices[curindex].availableModes[0].fs = CELL_AUDIO_IN_FS_8KHZ | CELL_AUDIO_IN_FS_12KHZ | CELL_AUDIO_IN_FS_16KHZ | CELL_AUDIO_IN_FS_24KHZ | CELL_AUDIO_IN_FS_32KHZ | CELL_AUDIO_IN_FS_48KHZ; + devices[curindex].availableModes[0].fs = + CELL_AUDIO_IN_FS_8KHZ | CELL_AUDIO_IN_FS_12KHZ | + CELL_AUDIO_IN_FS_16KHZ | CELL_AUDIO_IN_FS_24KHZ | + CELL_AUDIO_IN_FS_32KHZ | CELL_AUDIO_IN_FS_48KHZ; devices[curindex].deviceNumber = curindex; strcpy_trunc(devices[curindex].name, mic_list[0]); @@ -104,18 +114,23 @@ avconf_manager::avconf_manager() devices[curindex].portType = CELL_AUDIO_IN_PORT_USB; devices[curindex].availableModeCount = 1; devices[curindex].state = CELL_AUDIO_IN_DEVICE_STATE_AVAILABLE; - devices[curindex].deviceId = 0x12BA00FF; // Specific to rocksmith usb input + devices[curindex].deviceId = + 0x12BA00FF; // Specific to rocksmith usb input devices[curindex].type = 0xC0DE73C4; devices[curindex].availableModes[0].type = CELL_AUDIO_IN_CODING_TYPE_LPCM; devices[curindex].availableModes[0].channel = CELL_AUDIO_IN_CHNUM_1; - devices[curindex].availableModes[0].fs = CELL_AUDIO_IN_FS_8KHZ | CELL_AUDIO_IN_FS_12KHZ | CELL_AUDIO_IN_FS_16KHZ | CELL_AUDIO_IN_FS_24KHZ | CELL_AUDIO_IN_FS_32KHZ | CELL_AUDIO_IN_FS_48KHZ; + devices[curindex].availableModes[0].fs = + CELL_AUDIO_IN_FS_8KHZ | CELL_AUDIO_IN_FS_12KHZ | + CELL_AUDIO_IN_FS_16KHZ | CELL_AUDIO_IN_FS_24KHZ | + CELL_AUDIO_IN_FS_32KHZ | CELL_AUDIO_IN_FS_48KHZ; devices[curindex].deviceNumber = curindex; strcpy_trunc(devices[curindex].name, mic_list[0]); curindex++; break; case microphone_handler::null: - default: break; + default: + break; } } @@ -130,7 +145,10 @@ avconf_manager::avconf_manager() devices[curindex].type = 0xBEEFDEAD; devices[curindex].availableModes[0].type = CELL_AUDIO_IN_CODING_TYPE_LPCM; devices[curindex].availableModes[0].channel = CELL_AUDIO_IN_CHNUM_NONE; - devices[curindex].availableModes[0].fs = CELL_AUDIO_IN_FS_8KHZ | CELL_AUDIO_IN_FS_12KHZ | CELL_AUDIO_IN_FS_16KHZ | CELL_AUDIO_IN_FS_24KHZ | CELL_AUDIO_IN_FS_32KHZ | CELL_AUDIO_IN_FS_48KHZ; + devices[curindex].availableModes[0].fs = + CELL_AUDIO_IN_FS_8KHZ | CELL_AUDIO_IN_FS_12KHZ | + CELL_AUDIO_IN_FS_16KHZ | CELL_AUDIO_IN_FS_24KHZ | + CELL_AUDIO_IN_FS_32KHZ | CELL_AUDIO_IN_FS_48KHZ; devices[curindex].deviceNumber = curindex; strcpy_trunc(devices[curindex].name, "USB Camera"); @@ -138,14 +156,16 @@ avconf_manager::avconf_manager() } } -void avconf_manager::copy_device_info(u32 num, vm::ptr info) const +void avconf_manager::copy_device_info( + u32 num, vm::ptr info) const { memset(info.get_ptr(), 0, sizeof(CellAudioInDeviceInfo)); ensure(num < devices.size()); *info = devices[num]; } -std::optional avconf_manager::get_device_info(vm::cptr name) const +std::optional +avconf_manager::get_device_info(vm::cptr name) const { for (const CellAudioInDeviceInfo& device : devices) { @@ -160,13 +180,17 @@ std::optional avconf_manager::get_device_info(vm::cptr info) +error_code cellAudioOutGetDeviceInfo2(u32 deviceNumber, u32 deviceIndex, + vm::ptr info) { - cellAvconfExt.todo("cellAudioOutGetDeviceInfo2(deviceNumber=0x%x, deviceIndex=0x%x, info=*0x%x)", deviceNumber, deviceIndex, info); + cellAvconfExt.todo("cellAudioOutGetDeviceInfo2(deviceNumber=0x%x, " + "deviceIndex=0x%x, info=*0x%x)", + deviceNumber, deviceIndex, info); if (deviceIndex != 0 || !info) { @@ -178,7 +202,8 @@ error_code cellAudioOutGetDeviceInfo2(u32 deviceNumber, u32 deviceIndex, vm::ptr error_code cellVideoOutSetXVColor(u32 unk1, u32 unk2, u32 unk3) { - cellAvconfExt.todo("cellVideoOutSetXVColor(unk1=0x%x, unk2=0x%x, unk3=0x%x)", unk1, unk2, unk3); + cellAvconfExt.todo("cellVideoOutSetXVColor(unk1=0x%x, unk2=0x%x, unk3=0x%x)", + unk1, unk2, unk3); if (unk1 != 0) { @@ -200,9 +225,12 @@ error_code cellVideoOutSetupDisplay(u32 videoOut) return CELL_OK; } -error_code cellAudioInGetDeviceInfo(u32 deviceNumber, u32 deviceIndex, vm::ptr info) +error_code cellAudioInGetDeviceInfo(u32 deviceNumber, u32 deviceIndex, + vm::ptr info) { - cellAvconfExt.trace("cellAudioInGetDeviceInfo(deviceNumber=0x%x, deviceIndex=0x%x, info=*0x%x)", deviceNumber, deviceIndex, info); + cellAvconfExt.trace("cellAudioInGetDeviceInfo(deviceNumber=0x%x, " + "deviceIndex=0x%x, info=*0x%x)", + deviceNumber, deviceIndex, info); if (deviceIndex != 0 || !info) { @@ -220,22 +248,33 @@ error_code cellAudioInGetDeviceInfo(u32 deviceNumber, u32 deviceIndex, vm::ptr src_addr, vm::ptr dest_addr, s32 num) +error_code cellVideoOutConvertCursorColor(u32 videoOut, + s32 displaybuffer_format, f32 gamma, + s32 source_buffer_format, + vm::ptr src_addr, + vm::ptr dest_addr, s32 num) { - cellAvconfExt.todo("cellVideoOutConvertCursorColor(videoOut=%d, displaybuffer_format=0x%x, gamma=0x%x, source_buffer_format=0x%x, src_addr=*0x%x, dest_addr=*0x%x, num=0x%x)", videoOut, - displaybuffer_format, gamma, source_buffer_format, src_addr, dest_addr, num); + cellAvconfExt.todo( + "cellVideoOutConvertCursorColor(videoOut=%d, displaybuffer_format=0x%x, " + "gamma=0x%x, source_buffer_format=0x%x, src_addr=*0x%x, dest_addr=*0x%x, " + "num=0x%x)", + videoOut, displaybuffer_format, gamma, source_buffer_format, src_addr, + dest_addr, num); if (!dest_addr || num == 0) { return CELL_VIDEO_OUT_ERROR_ILLEGAL_PARAMETER; } - if (displaybuffer_format > CELL_VIDEO_OUT_BUFFER_COLOR_FORMAT_R16G16B16X16_FLOAT || src_addr) + if (displaybuffer_format > + CELL_VIDEO_OUT_BUFFER_COLOR_FORMAT_R16G16B16X16_FLOAT || + src_addr) { return CELL_VIDEO_OUT_ERROR_PARAMETER_OUT_OF_RANGE; } - if (displaybuffer_format < CELL_VIDEO_OUT_BUFFER_COLOR_FORMAT_R16G16B16X16_FLOAT) + if (displaybuffer_format < + CELL_VIDEO_OUT_BUFFER_COLOR_FORMAT_R16G16B16X16_FLOAT) { if (gamma < 0.8f || gamma > 1.2f) { @@ -243,10 +282,12 @@ error_code cellVideoOutConvertCursorColor(u32 videoOut, s32 displaybuffer_format } } - error_code cellVideoOutGetConvertCursorColorInfo(vm::ptr rgbOutputRange); // Forward declaration + error_code cellVideoOutGetConvertCursorColorInfo( + vm::ptr rgbOutputRange); // Forward declaration vm::var rgbOutputRange; - if (error_code error = cellVideoOutGetConvertCursorColorInfo(rgbOutputRange)) + if (error_code error = + cellVideoOutGetConvertCursorColorInfo(rgbOutputRange)) { return error; } @@ -256,7 +297,8 @@ error_code cellVideoOutConvertCursorColor(u32 videoOut, s32 displaybuffer_format error_code cellVideoOutGetGamma(u32 videoOut, vm::ptr gamma) { - cellAvconfExt.warning("cellVideoOutGetGamma(videoOut=%d, gamma=*0x%x)", videoOut, gamma); + cellAvconfExt.warning("cellVideoOutGetGamma(videoOut=%d, gamma=*0x%x)", + videoOut, gamma); if (!gamma) { @@ -275,9 +317,12 @@ error_code cellVideoOutGetGamma(u32 videoOut, vm::ptr gamma) return CELL_OK; } -error_code cellAudioInGetAvailableDeviceInfo(u32 count, vm::ptr device_info) +error_code +cellAudioInGetAvailableDeviceInfo(u32 count, + vm::ptr device_info) { - cellAvconfExt.trace("cellAudioInGetAvailableDeviceInfo(count=%d, info=*0x%x)", count, device_info); + cellAvconfExt.trace("cellAudioInGetAvailableDeviceInfo(count=%d, info=*0x%x)", + count, device_info); if (count > 16 || !device_info) { @@ -306,9 +351,13 @@ error_code cellAudioInGetAvailableDeviceInfo(u32 count, vm::ptr info) +error_code +cellAudioOutGetAvailableDeviceInfo(u32 count, + vm::ptr info) { - cellAvconfExt.todo("cellAudioOutGetAvailableDeviceInfo(count=0x%x, info=*0x%x)", count, info); + cellAvconfExt.todo( + "cellAudioOutGetAvailableDeviceInfo(count=0x%x, info=*0x%x)", count, + info); if (count > 16 || !info) { @@ -320,7 +369,8 @@ error_code cellAudioOutGetAvailableDeviceInfo(u32 count, vm::ptr 1.2f) { @@ -338,9 +388,14 @@ error_code cellVideoOutSetGamma(u32 videoOut, f32 gamma) return CELL_OK; } -error_code cellAudioOutRegisterDevice(u64 deviceType, vm::cptr name, vm::ptr option, vm::ptr config) +error_code +cellAudioOutRegisterDevice(u64 deviceType, vm::cptr name, + vm::ptr option, + vm::ptr config) { - cellAvconfExt.todo("cellAudioOutRegisterDevice(deviceType=0x%llx, name=%s, option=*0x%x, config=*0x%x)", deviceType, name, option, config); + cellAvconfExt.todo("cellAudioOutRegisterDevice(deviceType=0x%llx, name=%s, " + "option=*0x%x, config=*0x%x)", + deviceType, name, option, config); if (option || !name) { @@ -385,11 +440,17 @@ error_code cellAudioInSetDeviceMode(u32 deviceMode) return CELL_OK; } -error_code cellAudioInRegisterDevice(u64 deviceType, vm::cptr name, vm::ptr option, vm::ptr config) +error_code +cellAudioInRegisterDevice(u64 deviceType, vm::cptr name, + vm::ptr option, + vm::ptr config) { - cellAvconfExt.todo("cellAudioInRegisterDevice(deviceType=0x%llx, name=%s, option=*0x%x, config=*0x%x)", deviceType, name, option, config); + cellAvconfExt.todo("cellAudioInRegisterDevice(deviceType=0x%llx, name=%s, " + "option=*0x%x, config=*0x%x)", + deviceType, name, option, config); - // option must be null, volume can be 1 (soft) to 5 (loud) (raises question about check for volume = 0) + // option must be null, volume can be 1 (soft) to 5 (loud) (raises question + // about check for volume = 0) if (option || !config || !name || config->volume > 5) { return CELL_AUDIO_IN_ERROR_ILLEGAL_PARAMETER; @@ -414,7 +475,8 @@ error_code cellAudioInRegisterDevice(u64 deviceType, vm::cptr name, vm::pt error_code cellAudioInUnregisterDevice(u32 deviceNumber) { - cellAvconfExt.todo("cellAudioInUnregisterDevice(deviceNumber=0x%x)", deviceNumber); + cellAvconfExt.todo("cellAudioInUnregisterDevice(deviceNumber=0x%x)", + deviceNumber); auto& mic_thr = g_fxo->get(); const std::lock_guard lock(mic_thr.mutex); @@ -425,7 +487,9 @@ error_code cellAudioInUnregisterDevice(u32 deviceNumber) error_code cellVideoOutGetScreenSize(u32 videoOut, vm::ptr screenSize) { - cellAvconfExt.warning("cellVideoOutGetScreenSize(videoOut=%d, screenSize=*0x%x)", videoOut, screenSize); + cellAvconfExt.warning( + "cellVideoOutGetScreenSize(videoOut=%d, screenSize=*0x%x)", videoOut, + screenSize); if (!screenSize) { @@ -448,10 +512,13 @@ error_code cellVideoOutGetScreenSize(u32 videoOut, vm::ptr screenSize) // TODO: Use virtual screen size #ifdef _WIN32 // HDC screen = GetDC(NULL); - // float diagonal = roundf(sqrtf((powf(float(GetDeviceCaps(screen, HORZSIZE)), 2) + powf(float(GetDeviceCaps(screen, VERTSIZE)), 2))) * 0.0393f); + // float diagonal = roundf(sqrtf((powf(float(GetDeviceCaps(screen, + // HORZSIZE)), 2) + powf(float(GetDeviceCaps(screen, VERTSIZE)), 2))) * + // 0.0393f); #else // TODO: Linux implementation, without using wx - // float diagonal = roundf(sqrtf((powf(wxGetDisplaySizeMM().GetWidth(), 2) + powf(wxGetDisplaySizeMM().GetHeight(), 2))) * 0.0393f); + // float diagonal = roundf(sqrtf((powf(wxGetDisplaySizeMM().GetWidth(), 2) + + // powf(wxGetDisplaySizeMM().GetHeight(), 2))) * 0.0393f); #endif return CELL_VIDEO_OUT_ERROR_VALUE_IS_NOT_SET; @@ -459,7 +526,8 @@ error_code cellVideoOutGetScreenSize(u32 videoOut, vm::ptr screenSize) error_code cellVideoOutSetCopyControl(u32 videoOut, u32 control) { - cellAvconfExt.todo("cellVideoOutSetCopyControl(videoOut=%d, control=0x%x)", videoOut, control); + cellAvconfExt.todo("cellVideoOutSetCopyControl(videoOut=%d, control=0x%x)", + videoOut, control); if (control > CELL_VIDEO_OUT_COPY_CONTROL_COPY_NEVER) { diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellBgdl.cpp b/ps3fw/cellBgdl.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellBgdl.cpp rename to ps3fw/cellBgdl.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellCamera.cpp b/ps3fw/cellCamera.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellCamera.cpp rename to ps3fw/cellCamera.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellCelp8Enc.cpp b/ps3fw/cellCelp8Enc.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellCelp8Enc.cpp rename to ps3fw/cellCelp8Enc.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellCelpEnc.cpp b/ps3fw/cellCelpEnc.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellCelpEnc.cpp rename to ps3fw/cellCelpEnc.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellCrossController.cpp b/ps3fw/cellCrossController.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellCrossController.cpp rename to ps3fw/cellCrossController.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellDaisy.cpp b/ps3fw/cellDaisy.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellDaisy.cpp rename to ps3fw/cellDaisy.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellDmux.cpp b/ps3fw/cellDmux.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellDmux.cpp rename to ps3fw/cellDmux.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellDmuxPamf.cpp b/ps3fw/cellDmuxPamf.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellDmuxPamf.cpp rename to ps3fw/cellDmuxPamf.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellDtcpIpUtility.cpp b/ps3fw/cellDtcpIpUtility.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellDtcpIpUtility.cpp rename to ps3fw/cellDtcpIpUtility.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellFiber.cpp b/ps3fw/cellFiber.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellFiber.cpp rename to ps3fw/cellFiber.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellFont.cpp b/ps3fw/cellFont.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellFont.cpp rename to ps3fw/cellFont.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellFontFT.cpp b/ps3fw/cellFontFT.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellFontFT.cpp rename to ps3fw/cellFontFT.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellFs.cpp b/ps3fw/cellFs.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellFs.cpp rename to ps3fw/cellFs.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellGame.cpp b/ps3fw/cellGame.cpp similarity index 65% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellGame.cpp rename to ps3fw/cellGame.cpp index 35df14e82..edbd31561 100644 --- a/rpcs3/rpcs3/Emu/Cell/Modules/cellGame.cpp +++ b/ps3fw/cellGame.cpp @@ -1,24 +1,25 @@ #include "stdafx.h" -#include "Emu/localized_string.h" -#include "Emu/System.h" -#include "Emu/system_utils.hpp" -#include "Emu/VFS.h" -#include "Emu/IdManager.h" + #include "Emu/Cell/ErrorCodes.h" #include "Emu/Cell/PPUModule.h" -#include "Emu/Cell/timers.hpp" #include "Emu/Cell/lv2/sys_fs.h" #include "Emu/Cell/lv2/sys_sync.h" +#include "Emu/Cell/timers.hpp" +#include "Emu/IdManager.h" +#include "Emu/System.h" +#include "Emu/VFS.h" +#include "Emu/localized_string.h" +#include "Emu/system_utils.hpp" -#include "cellSysutil.h" -#include "cellMsgDialog.h" #include "cellGame.h" +#include "cellMsgDialog.h" +#include "cellSysutil.h" -#include "Loader/PSF.h" -#include "Utilities/StrUtil.h" -#include "util/init_mutex.hpp" -#include "util/asm.hpp" #include "Crypto/utils.h" +#include "Loader/PSF.h" +#include "util/StrUtil.h" +#include "util/asm.hpp" +#include "util/init_mutex.hpp" #include @@ -30,8 +31,10 @@ vm::gvar g_file_param; vm::gvar g_cb_result; stx::init_lock acquire_lock(stx::init_mutex& mtx, ppu_thread* ppu = nullptr); -stx::access_lock acquire_access_lock(stx::init_mutex& mtx, ppu_thread* ppu = nullptr); -stx::reset_lock acquire_reset_lock(stx::init_mutex& mtx, ppu_thread* ppu = nullptr); +stx::access_lock acquire_access_lock(stx::init_mutex& mtx, + ppu_thread* ppu = nullptr); +stx::reset_lock acquire_reset_lock(stx::init_mutex& mtx, + ppu_thread* ppu = nullptr); template <> void fmt_class_string::format(std::string& out, u64 arg) @@ -181,13 +184,15 @@ struct content_permission final if (!success) { - cellGame.fatal("Failed to clean directory '%s' (%s)", temp, fs::g_tls_error); + cellGame.fatal("Failed to clean directory '%s' (%s)", temp, + fs::g_tls_error); } } }; template <> -void fmt_class_string::format(std::string& out, u64 arg) +void fmt_class_string::format(std::string& out, + u64 arg) { format_enum(out, arg, [](auto error) { @@ -205,7 +210,8 @@ void fmt_class_string::format(std::string& out, } template <> -void fmt_class_string::format(std::string& out, u64 arg) +void fmt_class_string::format( + std::string& out, u64 arg) { format_enum(out, arg, [](auto error) { @@ -224,17 +230,13 @@ void fmt_class_string::format(std::string& out static bool check_system_ver(vm::cptr systemVersion) { // Only allow something like "04.8300". - // The disassembly shows that "04.83" would also be considered valid, but the initial strlen check makes this void. - return ( - systemVersion && - std::strlen(systemVersion.get_ptr()) == 7 && - std::isdigit(systemVersion[0]) && - std::isdigit(systemVersion[1]) && - systemVersion[2] == '.' && - std::isdigit(systemVersion[3]) && - std::isdigit(systemVersion[4]) && - std::isdigit(systemVersion[5]) && - std::isdigit(systemVersion[6])); + // The disassembly shows that "04.83" would also be considered valid, but the + // initial strlen check makes this void. + return (systemVersion && std::strlen(systemVersion.get_ptr()) == 7 && + std::isdigit(systemVersion[0]) && std::isdigit(systemVersion[1]) && + systemVersion[2] == '.' && std::isdigit(systemVersion[3]) && + std::isdigit(systemVersion[4]) && std::isdigit(systemVersion[5]) && + std::isdigit(systemVersion[6])); } disc_change_manager::disc_change_manager() @@ -249,7 +251,9 @@ disc_change_manager::~disc_change_manager() Emu.GetCallbacks().enable_disc_insert(false); } -error_code disc_change_manager::register_callbacks(vm::ptr func_eject, vm::ptr func_insert) +error_code disc_change_manager::register_callbacks( + vm::ptr func_eject, + vm::ptr func_insert) { std::lock_guard lock(mtx); @@ -282,8 +286,9 @@ error_code disc_change_manager::unregister_callbacks() if (is_inserting) { - // NOTE: The insert_callback is known to call cellGameUnregisterDiscChangeCallback. - // So we keep it out of the mutex lock until it proves to be an issue. + // NOTE: The insert_callback is known to call + // cellGameUnregisterDiscChangeCallback. So we keep it out of the mutex lock + // until it proves to be an issue. unregister(); } else @@ -303,7 +308,8 @@ void disc_change_manager::eject_disc() if (state != eject_state::inserted) { - cellGame.fatal("Can not eject disc in the current state. (state=%s)", state.load()); + cellGame.fatal("Can not eject disc in the current state. (state=%s)", + state.load()); return; } @@ -339,7 +345,8 @@ void disc_change_manager::insert_disc(u32 disc_type, std::string title_id) if (state != eject_state::ejected) { - cellGame.fatal("Can not insert disc in the current state. (state=%s)", state.load()); + cellGame.fatal("Can not insert disc in the current state. (state=%s)", + state.load()); return; } @@ -350,7 +357,8 @@ void disc_change_manager::insert_disc(u32 disc_type, std::string title_id) is_inserting = true; - sysutil_register_cb([disc_type, title_id = std::move(title_id)](ppu_thread& cb_ppu) -> s32 + sysutil_register_cb( + [disc_type, title_id = std::move(title_id)](ppu_thread& cb_ppu) -> s32 { auto& dcm = g_fxo->get(); std::lock_guard lock(dcm.mtx); @@ -358,12 +366,15 @@ void disc_change_manager::insert_disc(u32 disc_type, std::string title_id) if (disc_type == CELL_GAME_DISCTYPE_PS3) { vm::var _title_id = vm::make_str(title_id); - cellGame.notice("Executing insert_callback for title '%s' with disc_type %d...", _title_id.get_ptr(), disc_type); + cellGame.notice( + "Executing insert_callback for title '%s' with disc_type %d...", + _title_id.get_ptr(), disc_type); dcm.insert_callback(cb_ppu, disc_type, _title_id); } else { - cellGame.notice("Executing insert_callback with disc_type %d...", disc_type); + cellGame.notice("Executing insert_callback with disc_type %d...", + disc_type); dcm.insert_callback(cb_ppu, disc_type, vm::null); } @@ -402,11 +413,18 @@ extern void lv2_sleep(u64 timeout, ppu_thread* ppu = nullptr) } } -error_code cellHddGameCheck(ppu_thread& ppu, u32 version, vm::cptr dirName, u32 errDialog, vm::ptr funcStat, u32 container) +error_code cellHddGameCheck(ppu_thread& ppu, u32 version, + vm::cptr dirName, u32 errDialog, + vm::ptr funcStat, + u32 container) { - cellGame.warning("cellHddGameCheck(version=%d, dirName=%s, errDialog=%d, funcStat=*0x%x, container=%d)", version, dirName, errDialog, funcStat, container); + cellGame.warning("cellHddGameCheck(version=%d, dirName=%s, errDialog=%d, " + "funcStat=*0x%x, container=%d)", + version, dirName, errDialog, funcStat, container); - if (version != CELL_GAMEDATA_VERSION_CURRENT || !dirName || !funcStat || sysutil_check_name_string(dirName.get_ptr(), 1, CELL_GAME_DIRNAME_SIZE) != 0) + if (version != CELL_GAMEDATA_VERSION_CURRENT || !dirName || !funcStat || + sysutil_check_name_string(dirName.get_ptr(), 1, CELL_GAME_DIRNAME_SIZE) != + 0) { return CELL_HDDGAME_ERROR_PARAM; } @@ -443,9 +461,12 @@ error_code cellHddGameCheck(ppu_thread& ppu, u32 version, vm::cptr dirName const std::string local_dir = vfs::get(dir); - // 40 GB - 256 kilobytes. The reasoning is that many games take this number and multiply it by 1024, to get the amount of bytes. With 40GB exactly, - // this will result in an overflow, and the size would be 0, preventing the game from running. By reducing 256 kilobytes, we make sure that even - // after said overflow, the number would still be high enough to contain the game's data. + // 40 GB - 256 kilobytes. The reasoning is that many games take this number + // and multiply it by 1024, to get the amount of bytes. With 40GB exactly, + // this will result in an overflow, and the size would be 0, preventing the + // game from running. By reducing 256 kilobytes, we make sure that even after + // said overflow, the number would still be high enough to contain the game's + // data. get->hddFreeSizeKB = 40 * 1024 * 1024 - 256; get->isNewData = CELL_HDDGAME_ISNEWDATA_EXIST; get->sysSizeKB = 0; // TODO @@ -466,7 +487,8 @@ error_code cellHddGameCheck(ppu_thread& ppu, u32 version, vm::cptr dirName } else { - // TODO: Is cellHddGameCheck really responsible for writing the information in get->getParam ? (If not, delete this else) + // TODO: Is cellHddGameCheck really responsible for writing the information + // in get->getParam ? (If not, delete this else) const psf::registry psf = psf::load_object(local_dir + "/PARAM.SFO"); // Some following fields may be zero in old FW 1.00 version PARAM.SFO @@ -481,13 +503,15 @@ error_code cellHddGameCheck(ppu_thread& ppu, u32 version, vm::cptr dirName if (psf.contains("TITLE")) strcpy_trunc(get->getParam.title, ::at32(psf, "TITLE").as_string()); if (psf.contains("APP_VER")) - strcpy_trunc(get->getParam.dataVersion, ::at32(psf, "APP_VER").as_string()); + strcpy_trunc(get->getParam.dataVersion, + ::at32(psf, "APP_VER").as_string()); if (psf.contains("TITLE_ID")) strcpy_trunc(get->getParam.titleId, ::at32(psf, "TITLE_ID").as_string()); for (u32 i = 0; i < CELL_HDDGAME_SYSP_LANGUAGE_NUM; i++) { - strcpy_trunc(get->getParam.titleLang[i], psf::get_string(psf, fmt::format("TITLE_%02d", i))); + strcpy_trunc(get->getParam.titleLang[i], + psf::get_string(psf, fmt::format("TITLE_%02d", i))); } } @@ -529,12 +553,14 @@ error_code cellHddGameCheck(ppu_thread& ppu, u32 version, vm::cptr dirName // psf::assign(sfo, "CATEGORY", psf::string(3, "HG")); // } - // psf::assign(sfo, "TITLE_ID", psf::string(TITLEID_SFO_ENTRY_SIZE, setParam->titleId)); - // psf::assign(sfo, "TITLE", psf::string(CELL_GAME_SYSP_TITLE_SIZE, setParam->title)); - // psf::assign(sfo, "VERSION", psf::string(CELL_GAME_SYSP_VERSION_SIZE, setParam->dataVersion)); - // psf::assign(sfo, "PARENTAL_LEVEL", +setParam->parentalLevel); - // psf::assign(sfo, "RESOLUTION", +setParam->resolution); - // psf::assign(sfo, "SOUND_FORMAT", +setParam->soundFormat); + // psf::assign(sfo, "TITLE_ID", psf::string(TITLEID_SFO_ENTRY_SIZE, + // setParam->titleId)); psf::assign(sfo, "TITLE", + // psf::string(CELL_GAME_SYSP_TITLE_SIZE, setParam->title)); + // psf::assign(sfo, "VERSION", psf::string(CELL_GAME_SYSP_VERSION_SIZE, + // setParam->dataVersion)); psf::assign(sfo, "PARENTAL_LEVEL", + // +setParam->parentalLevel); psf::assign(sfo, "RESOLUTION", + // +setParam->resolution); psf::assign(sfo, "SOUND_FORMAT", + // +setParam->soundFormat); // for (u32 i = 0; i < CELL_HDDGAME_SYSP_LANGUAGE_NUM; i++) // { @@ -543,50 +569,74 @@ error_code cellHddGameCheck(ppu_thread& ppu, u32 version, vm::cptr dirName // continue; // } - // psf::assign(sfo, fmt::format("TITLE_%02d", i), psf::string(CELL_GAME_SYSP_TITLE_SIZE, setParam->titleLang[i])); + // psf::assign(sfo, fmt::format("TITLE_%02d", i), + // psf::string(CELL_GAME_SYSP_TITLE_SIZE, setParam->titleLang[i])); // } - // psf::save_object(fs::file(vfs::get(dir + "/PARAM.SFO"), fs::rewrite), sfo); + // psf::save_object(fs::file(vfs::get(dir + "/PARAM.SFO"), fs::rewrite), + // sfo); // } return CELL_OK; } case CELL_HDDGAME_CBRESULT_OK_CANCEL: - cellGame.warning("cellHddGameCheck(): callback returned CELL_HDDGAME_CBRESULT_OK_CANCEL"); + cellGame.warning("cellHddGameCheck(): callback returned " + "CELL_HDDGAME_CBRESULT_OK_CANCEL"); return CELL_OK; case CELL_HDDGAME_CBRESULT_ERR_NOSPACE: - cellGame.error("cellHddGameCheck(): callback returned CELL_HDDGAME_CBRESULT_ERR_NOSPACE. Space Needed: %d KB", result->errNeedSizeKB); - error_msg = get_localized_string(localized_string_id::CELL_HDD_GAME_CHECK_NOSPACE, fmt::format("%d", result->errNeedSizeKB).c_str()); + cellGame.error("cellHddGameCheck(): callback returned " + "CELL_HDDGAME_CBRESULT_ERR_NOSPACE. Space Needed: %d KB", + result->errNeedSizeKB); + error_msg = + get_localized_string(localized_string_id::CELL_HDD_GAME_CHECK_NOSPACE, + fmt::format("%d", result->errNeedSizeKB).c_str()); break; case CELL_HDDGAME_CBRESULT_ERR_BROKEN: - cellGame.error("cellHddGameCheck(): callback returned CELL_HDDGAME_CBRESULT_ERR_BROKEN"); - error_msg = get_localized_string(localized_string_id::CELL_HDD_GAME_CHECK_BROKEN, game_dir.c_str()); + cellGame.error("cellHddGameCheck(): callback returned " + "CELL_HDDGAME_CBRESULT_ERR_BROKEN"); + error_msg = get_localized_string( + localized_string_id::CELL_HDD_GAME_CHECK_BROKEN, game_dir.c_str()); break; case CELL_HDDGAME_CBRESULT_ERR_NODATA: - cellGame.error("cellHddGameCheck(): callback returned CELL_HDDGAME_CBRESULT_ERR_NODATA"); - error_msg = get_localized_string(localized_string_id::CELL_HDD_GAME_CHECK_NODATA, game_dir.c_str()); + cellGame.error("cellHddGameCheck(): callback returned " + "CELL_HDDGAME_CBRESULT_ERR_NODATA"); + error_msg = get_localized_string( + localized_string_id::CELL_HDD_GAME_CHECK_NODATA, game_dir.c_str()); break; case CELL_HDDGAME_CBRESULT_ERR_INVALID: - cellGame.error("cellHddGameCheck(): callback returned CELL_HDDGAME_CBRESULT_ERR_INVALID. Error message: %s", result->invalidMsg); - error_msg = get_localized_string(localized_string_id::CELL_HDD_GAME_CHECK_INVALID, fmt::format("%s", result->invalidMsg).c_str()); + cellGame.error("cellHddGameCheck(): callback returned " + "CELL_HDDGAME_CBRESULT_ERR_INVALID. Error message: %s", + result->invalidMsg); + error_msg = + get_localized_string(localized_string_id::CELL_HDD_GAME_CHECK_INVALID, + fmt::format("%s", result->invalidMsg).c_str()); break; default: - cellGame.error("cellHddGameCheck(): callback returned unknown error (code=0x%x). Error message: %s", result->invalidMsg); - error_msg = get_localized_string(localized_string_id::CELL_HDD_GAME_CHECK_INVALID, fmt::format("%s", result->invalidMsg).c_str()); + cellGame.error("cellHddGameCheck(): callback returned unknown error " + "(code=0x%x). Error message: %s", + result->invalidMsg); + error_msg = + get_localized_string(localized_string_id::CELL_HDD_GAME_CHECK_INVALID, + fmt::format("%s", result->invalidMsg).c_str()); break; } - if (errDialog == CELL_GAMEDATA_ERRDIALOG_ALWAYS) // Maybe != CELL_GAMEDATA_ERRDIALOG_NONE + if (errDialog == + CELL_GAMEDATA_ERRDIALOG_ALWAYS) // Maybe != CELL_GAMEDATA_ERRDIALOG_NONE { // Yield before a blocking dialog is being spawned lv2_obj::sleep(ppu); // Get user confirmation by opening a blocking dialog - error_code res = open_msg_dialog(true, CELL_MSGDIALOG_TYPE_SE_TYPE_ERROR | CELL_MSGDIALOG_TYPE_BUTTON_TYPE_OK | CELL_MSGDIALOG_TYPE_DISABLE_CANCEL_ON, vm::make_str(error_msg), msg_dialog_source::_cellGame); + error_code res = open_msg_dialog( + true, + CELL_MSGDIALOG_TYPE_SE_TYPE_ERROR | CELL_MSGDIALOG_TYPE_BUTTON_TYPE_OK | + CELL_MSGDIALOG_TYPE_DISABLE_CANCEL_ON, + vm::make_str(error_msg), msg_dialog_source::_cellGame); // Reschedule after a blocking dialog returns if (ppu.check_state()) @@ -607,12 +657,16 @@ error_code cellHddGameCheck(ppu_thread& ppu, u32 version, vm::cptr dirName return CELL_HDDGAME_ERROR_CBRESULT; } -error_code cellHddGameCheck2(ppu_thread& ppu, u32 version, vm::cptr dirName, u32 errDialog, vm::ptr funcStat, u32 container) +error_code cellHddGameCheck2(ppu_thread& ppu, u32 version, + vm::cptr dirName, u32 errDialog, + vm::ptr funcStat, + u32 container) { cellGame.trace("cellHddGameCheck2()"); // Identical function - return cellHddGameCheck(ppu, version, dirName, errDialog, funcStat, container); + return cellHddGameCheck(ppu, version, dirName, errDialog, funcStat, + container); } error_code cellHddGameGetSizeKB(ppu_thread& ppu, vm::ptr size) @@ -635,8 +689,11 @@ error_code cellHddGameGetSizeKB(ppu_thread& ppu, vm::ptr size) const auto dirsz = fs::get_dir_size(local_dir, 1024); // This function is very slow by nature - // TODO: Check if after first use the result is being cached so the sleep can be reduced in this case - lv2_sleep(utils::sub_saturate(dirsz == umax ? 2000 : 200000, get_guest_system_time() - start_sleep), &ppu); + // TODO: Check if after first use the result is being cached so the sleep can + // be reduced in this case + lv2_sleep(utils::sub_saturate(dirsz == umax ? 2000 : 200000, + get_guest_system_time() - start_sleep), + &ppu); if (dirsz == umax) { @@ -644,7 +701,9 @@ error_code cellHddGameGetSizeKB(ppu_thread& ppu, vm::ptr size) if (fs::exists(local_dir)) { - cellGame.error("cellHddGameGetSizeKB(): Unknown failure on calculating directory '%s' size (%s)", local_dir, error); + cellGame.error("cellHddGameGetSizeKB(): Unknown failure on calculating " + "directory '%s' size (%s)", + local_dir, error); } return CELL_HDDGAME_ERROR_FAILURE; @@ -671,7 +730,9 @@ error_code cellHddGameSetSystemVer(vm::cptr systemVersion) error_code cellHddGameExitBroken() { cellGame.warning("cellHddGameExitBroken()"); - return open_exit_dialog(get_localized_string(localized_string_id::CELL_HDD_GAME_EXIT_BROKEN), true, msg_dialog_source::_cellGame); + return open_exit_dialog( + get_localized_string(localized_string_id::CELL_HDD_GAME_EXIT_BROKEN), + true, msg_dialog_source::_cellGame); } error_code cellGameDataGetSizeKB(ppu_thread& ppu, vm::ptr size) @@ -694,8 +755,11 @@ error_code cellGameDataGetSizeKB(ppu_thread& ppu, vm::ptr size) const auto dirsz = fs::get_dir_size(local_dir, 1024); // This function is very slow by nature - // TODO: Check if after first use the result is being cached so the sleep can be reduced in this case - lv2_sleep(utils::sub_saturate(dirsz == umax ? 2000 : 200000, get_guest_system_time() - start_sleep), &ppu); + // TODO: Check if after first use the result is being cached so the sleep can + // be reduced in this case + lv2_sleep(utils::sub_saturate(dirsz == umax ? 2000 : 200000, + get_guest_system_time() - start_sleep), + &ppu); if (dirsz == umax) { @@ -703,7 +767,9 @@ error_code cellGameDataGetSizeKB(ppu_thread& ppu, vm::ptr size) if (fs::exists(local_dir)) { - cellGame.error("cellGameDataGetSizeKB(): Unknown failure on calculating directory '%s' size (%s)", local_dir, error); + cellGame.error("cellGameDataGetSizeKB(): Unknown failure on calculating " + "directory '%s' size (%s)", + local_dir, error); } return CELL_GAMEDATA_ERROR_FAILURE; @@ -730,12 +796,18 @@ error_code cellGameDataSetSystemVer(vm::cptr systemVersion) error_code cellGameDataExitBroken() { cellGame.warning("cellGameDataExitBroken()"); - return open_exit_dialog(get_localized_string(localized_string_id::CELL_GAME_DATA_EXIT_BROKEN), true, msg_dialog_source::_cellGame); + return open_exit_dialog( + get_localized_string(localized_string_id::CELL_GAME_DATA_EXIT_BROKEN), + true, msg_dialog_source::_cellGame); } -error_code cellGameBootCheck(vm::ptr type, vm::ptr attributes, vm::ptr size, vm::ptr dirName) +error_code cellGameBootCheck(vm::ptr type, vm::ptr attributes, + vm::ptr size, + vm::ptr dirName) { - cellGame.warning("cellGameBootCheck(type=*0x%x, attributes=*0x%x, size=*0x%x, dirName=*0x%x)", type, attributes, size, dirName); + cellGame.warning("cellGameBootCheck(type=*0x%x, attributes=*0x%x, " + "size=*0x%x, dirName=*0x%x)", + type, attributes, size, dirName); if (!type || !attributes) { @@ -766,7 +838,8 @@ error_code cellGameBootCheck(vm::ptr type, vm::ptr attributes, vm::ptr _type = CELL_GAME_GAMETYPE_DISC; *attributes = 0; // TODO - // TODO: dirName might be a read only string when BootCheck is called on a disc game. (e.g. Ben 10 Ultimate Alien: Cosmic Destruction) + // TODO: dirName might be a read only string when BootCheck is called on a + // disc game. (e.g. Ben 10 Ultimate Alien: Cosmic Destruction) sfo = psf::load_object(vfs::get("/dev_bdvd/PS3_GAME/PARAM.SFO")); } @@ -787,7 +860,9 @@ error_code cellGameBootCheck(vm::ptr type, vm::ptr attributes, vm::ptr *attributes = 0; // TODO sfo = psf::load_object(vfs::get(Emu.GetDir() + "PARAM.SFO")); - dir = fmt::trim(Emu.GetDir().substr(fs::get_parent_dir_view(Emu.GetDir()).size() + 1), fs::delim); + dir = fmt::trim( + Emu.GetDir().substr(fs::get_parent_dir_view(Emu.GetDir()).size() + 1), + fs::delim); } *type = _type; @@ -795,7 +870,8 @@ error_code cellGameBootCheck(vm::ptr type, vm::ptr attributes, vm::ptr if (size) { // TODO: Use the free space of the computer's HDD where RPCS3 is being run. - size->hddFreeSizeKB = 40 * 1024 * 1024 - 256; // Read explanation in cellHddGameCheck + size->hddFreeSizeKB = + 40 * 1024 * 1024 - 256; // Read explanation in cellHddGameCheck // TODO: Calculate data size for HG and DG games, if necessary. size->sizeKB = CELL_GAME_SIZEKB_NOTCALC; @@ -815,9 +891,11 @@ error_code cellGameBootCheck(vm::ptr type, vm::ptr attributes, vm::ptr return CELL_OK; } -error_code cellGamePatchCheck(vm::ptr size, vm::ptr reserved) +error_code cellGamePatchCheck(vm::ptr size, + vm::ptr reserved) { - cellGame.warning("cellGamePatchCheck(size=*0x%x, reserved=*0x%x)", size, reserved); + cellGame.warning("cellGamePatchCheck(size=*0x%x, reserved=*0x%x)", size, + reserved); lv2_sleep(5000); @@ -840,7 +918,8 @@ error_code cellGamePatchCheck(vm::ptr size, vm::ptr r if (size) { // TODO: Use the free space of the computer's HDD where RPCS3 is being run. - size->hddFreeSizeKB = 40 * 1024 * 1024 - 256; // Read explanation in cellHddGameCheck + size->hddFreeSizeKB = + 40 * 1024 * 1024 - 256; // Read explanation in cellHddGameCheck // TODO: Calculate data size for patch data, if necessary. size->sizeKB = CELL_GAME_SIZEKB_NOTCALC; @@ -855,9 +934,11 @@ error_code cellGamePatchCheck(vm::ptr size, vm::ptr r return CELL_OK; } -error_code cellGameDataCheck(u32 type, vm::cptr dirName, vm::ptr size) +error_code cellGameDataCheck(u32 type, vm::cptr dirName, + vm::ptr size) { - cellGame.warning("cellGameDataCheck(type=%d, dirName=%s, size=*0x%x)", type, dirName, size); + cellGame.warning("cellGameDataCheck(type=%d, dirName=%s, size=*0x%x)", type, + dirName, size); if ((type - 1) >= 3 || (type != CELL_GAME_GAMETYPE_DISC && !dirName)) { @@ -885,8 +966,8 @@ error_code cellGameDataCheck(u32 type, vm::cptr dirName, vm::ptr dirName, vm::ptrhddFreeSizeKB = 40 * 1024 * 1024 - 256; // Read explanation in cellHddGameCheck + size->hddFreeSizeKB = + 40 * 1024 * 1024 - 256; // Read explanation in cellHddGameCheck // TODO: Calculate data size for game data, if necessary. size->sizeKB = sfo.empty() ? 0 : CELL_GAME_SIZEKB_NOTCALC; @@ -934,9 +1021,14 @@ error_code cellGameDataCheck(u32 type, vm::cptr dirName, vm::ptr contentInfoPath, vm::ptr usrdirPath) +error_code +cellGameContentPermit(ppu_thread& ppu, + vm::ptr contentInfoPath, + vm::ptr usrdirPath) { - cellGame.warning("cellGameContentPermit(contentInfoPath=*0x%x, usrdirPath=*0x%x)", contentInfoPath, usrdirPath); + cellGame.warning( + "cellGameContentPermit(contentInfoPath=*0x%x, usrdirPath=*0x%x)", + contentInfoPath, usrdirPath); if (!contentInfoPath || !usrdirPath) { @@ -952,7 +1044,8 @@ error_code cellGameContentPermit(ppu_thread& ppu, vm::ptr(id))); + lv2_files.emplace_back( + ensure(idm::get_unlocked(id))); } } }); @@ -1008,16 +1102,20 @@ error_code cellGameContentPermit(ppu_thread& ppu, vm::ptr(!perm.temp.empty() || perm.can_create ? 200000 : 2000, get_guest_system_time() - start_sleep), &ppu); + lv2_sleep(utils::sub_saturate( + !perm.temp.empty() || perm.can_create ? 200000 : 2000, + get_guest_system_time() - start_sleep), + &ppu); // Cleanup perm.reset(); @@ -1039,13 +1140,20 @@ error_code cellGameContentPermit(ppu_thread& ppu, vm::ptr dirName, u32 errDialog, vm::ptr funcStat, u32 container) +error_code cellGameDataCheckCreate2(ppu_thread& ppu, u32 version, + vm::cptr dirName, u32 errDialog, + vm::ptr funcStat, + u32 container) { - cellGame.success("cellGameDataCheckCreate2(version=0x%x, dirName=%s, errDialog=0x%x, funcStat=*0x%x, container=%d)", version, dirName, errDialog, funcStat, container); + cellGame.success("cellGameDataCheckCreate2(version=0x%x, dirName=%s, " + "errDialog=0x%x, funcStat=*0x%x, container=%d)", + version, dirName, errDialog, funcStat, container); // older sdk. it might not care about game type. - if (version != CELL_GAMEDATA_VERSION_CURRENT || !funcStat || !dirName || sysutil_check_name_string(dirName.get_ptr(), 1, CELL_GAME_DIRNAME_SIZE) != 0) + if (version != CELL_GAMEDATA_VERSION_CURRENT || !funcStat || !dirName || + sysutil_check_name_string(dirName.get_ptr(), 1, CELL_GAME_DIRNAME_SIZE) != + 0) { return CELL_GAMEDATA_ERROR_PARAM; } @@ -1079,7 +1187,8 @@ error_code cellGameDataCheckCreate2(ppu_thread& ppu, u32 version, vm::cptr cbGet->isNewData = new_data; // TODO: Use the free space of the computer's HDD where RPCS3 is being run. - cbGet->hddFreeSizeKB = 40 * 1024 * 1024 - 256; // Read explanation in cellHddGameCheck + cbGet->hddFreeSizeKB = + 40 * 1024 * 1024 - 256; // Read explanation in cellHddGameCheck strcpy_trunc(cbGet->contentInfoPath, dir); strcpy_trunc(cbGet->gameDataPath, usrdir); @@ -1095,12 +1204,17 @@ error_code cellGameDataCheckCreate2(ppu_thread& ppu, u32 version, vm::cptr cbGet->getParam.attribute = CELL_GAMEDATA_ATTR_NORMAL; cbGet->getParam.parentalLevel = psf::get_integer(sfo, "PARENTAL_LEVEL", 0); - strcpy_trunc(cbGet->getParam.dataVersion, psf::get_string(sfo, "APP_VER", psf::get_string(sfo, "VERSION", ""))); // Old games do not have APP_VER key + strcpy_trunc(cbGet->getParam.dataVersion, + psf::get_string( + sfo, "APP_VER", + psf::get_string(sfo, "VERSION", + ""))); // Old games do not have APP_VER key strcpy_trunc(cbGet->getParam.titleId, psf::get_string(sfo, "TITLE_ID", "")); strcpy_trunc(cbGet->getParam.title, psf::get_string(sfo, "TITLE", "")); for (u32 i = 0; i < CELL_HDDGAME_SYSP_LANGUAGE_NUM; i++) { - strcpy_trunc(cbGet->getParam.titleLang[i], psf::get_string(sfo, fmt::format("TITLE_%02d", i))); + strcpy_trunc(cbGet->getParam.titleLang[i], + psf::get_string(sfo, fmt::format("TITLE_%02d", i))); } lv2_sleep(5000, &ppu); @@ -1113,7 +1227,8 @@ error_code cellGameDataCheckCreate2(ppu_thread& ppu, u32 version, vm::cptr { case CELL_GAMEDATA_CBRESULT_OK_CANCEL: { - cellGame.warning("cellGameDataCheckCreate2(): callback returned CELL_GAMEDATA_CBRESULT_OK_CANCEL"); + cellGame.warning("cellGameDataCheckCreate2(): callback returned " + "CELL_GAMEDATA_CBRESULT_OK_CANCEL"); return CELL_OK; } case CELL_GAMEDATA_CBRESULT_OK: @@ -1143,9 +1258,13 @@ error_code cellGameDataCheckCreate2(ppu_thread& ppu, u32 version, vm::cptr psf::assign(sfo, "CATEGORY", psf::string(3, "GD")); } - psf::assign(sfo, "TITLE_ID", psf::string(TITLEID_SFO_ENTRY_SIZE, setParam->titleId, true)); - psf::assign(sfo, "TITLE", psf::string(CELL_GAME_SYSP_TITLE_SIZE, setParam->title)); - psf::assign(sfo, "VERSION", psf::string(CELL_GAME_SYSP_VERSION_SIZE, setParam->dataVersion)); + psf::assign(sfo, "TITLE_ID", + psf::string(TITLEID_SFO_ENTRY_SIZE, setParam->titleId, true)); + psf::assign(sfo, "TITLE", + psf::string(CELL_GAME_SYSP_TITLE_SIZE, setParam->title)); + psf::assign( + sfo, "VERSION", + psf::string(CELL_GAME_SYSP_VERSION_SIZE, setParam->dataVersion)); psf::assign(sfo, "PARENTAL_LEVEL", +setParam->parentalLevel); for (u32 i = 0; i < CELL_HDDGAME_SYSP_LANGUAGE_NUM; i++) @@ -1155,13 +1274,15 @@ error_code cellGameDataCheckCreate2(ppu_thread& ppu, u32 version, vm::cptr continue; } - psf::assign(sfo, fmt::format("TITLE_%02d", i), psf::string(CELL_GAME_SYSP_TITLE_SIZE, setParam->titleLang[i])); + psf::assign( + sfo, fmt::format("TITLE_%02d", i), + psf::string(CELL_GAME_SYSP_TITLE_SIZE, setParam->titleLang[i])); } if (!psf::check_registry(sfo)) { - // This results in CELL_OK, broken SFO and CELL_GAMEDATA_ERROR_BROKEN on the next load - // Avoid creation for now + // This results in CELL_OK, broken SFO and CELL_GAMEDATA_ERROR_BROKEN on + // the next load Avoid creation for now cellGame.error("Broken SFO paramters: %s", sfo); return CELL_OK; } @@ -1174,28 +1295,44 @@ error_code cellGameDataCheckCreate2(ppu_thread& ppu, u32 version, vm::cptr return CELL_OK; } case CELL_GAMEDATA_CBRESULT_ERR_NOSPACE: - cellGame.error("cellGameDataCheckCreate2(): callback returned CELL_GAMEDATA_CBRESULT_ERR_NOSPACE. Space Needed: %d KB", cbResult->errNeedSizeKB); - error_msg = get_localized_string(localized_string_id::CELL_GAMEDATA_CHECK_NOSPACE, fmt::format("%d", cbResult->errNeedSizeKB).c_str()); + cellGame.error("cellGameDataCheckCreate2(): callback returned " + "CELL_GAMEDATA_CBRESULT_ERR_NOSPACE. Space Needed: %d KB", + cbResult->errNeedSizeKB); + error_msg = get_localized_string( + localized_string_id::CELL_GAMEDATA_CHECK_NOSPACE, + fmt::format("%d", cbResult->errNeedSizeKB).c_str()); break; case CELL_GAMEDATA_CBRESULT_ERR_BROKEN: - cellGame.error("cellGameDataCheckCreate2(): callback returned CELL_GAMEDATA_CBRESULT_ERR_BROKEN"); - error_msg = get_localized_string(localized_string_id::CELL_GAMEDATA_CHECK_BROKEN, game_dir.c_str()); + cellGame.error("cellGameDataCheckCreate2(): callback returned " + "CELL_GAMEDATA_CBRESULT_ERR_BROKEN"); + error_msg = get_localized_string( + localized_string_id::CELL_GAMEDATA_CHECK_BROKEN, game_dir.c_str()); break; case CELL_GAMEDATA_CBRESULT_ERR_NODATA: - cellGame.error("cellGameDataCheckCreate2(): callback returned CELL_GAMEDATA_CBRESULT_ERR_NODATA"); - error_msg = get_localized_string(localized_string_id::CELL_GAMEDATA_CHECK_NODATA, game_dir.c_str()); + cellGame.error("cellGameDataCheckCreate2(): callback returned " + "CELL_GAMEDATA_CBRESULT_ERR_NODATA"); + error_msg = get_localized_string( + localized_string_id::CELL_GAMEDATA_CHECK_NODATA, game_dir.c_str()); break; case CELL_GAMEDATA_CBRESULT_ERR_INVALID: - cellGame.error("cellGameDataCheckCreate2(): callback returned CELL_GAMEDATA_CBRESULT_ERR_INVALID. Error message: %s", cbResult->invalidMsg); - error_msg = get_localized_string(localized_string_id::CELL_GAMEDATA_CHECK_INVALID, fmt::format("%s", cbResult->invalidMsg).c_str()); + cellGame.error("cellGameDataCheckCreate2(): callback returned " + "CELL_GAMEDATA_CBRESULT_ERR_INVALID. Error message: %s", + cbResult->invalidMsg); + error_msg = + get_localized_string(localized_string_id::CELL_GAMEDATA_CHECK_INVALID, + fmt::format("%s", cbResult->invalidMsg).c_str()); break; default: - cellGame.error("cellGameDataCheckCreate2(): callback returned unknown error (code=0x%x). Error message: %s", cbResult->invalidMsg); - error_msg = get_localized_string(localized_string_id::CELL_GAMEDATA_CHECK_INVALID, fmt::format("%s", cbResult->invalidMsg).c_str()); + cellGame.error("cellGameDataCheckCreate2(): callback returned unknown " + "error (code=0x%x). Error message: %s", + cbResult->invalidMsg); + error_msg = + get_localized_string(localized_string_id::CELL_GAMEDATA_CHECK_INVALID, + fmt::format("%s", cbResult->invalidMsg).c_str()); break; } @@ -1205,7 +1342,11 @@ error_code cellGameDataCheckCreate2(ppu_thread& ppu, u32 version, vm::cptr lv2_obj::sleep(ppu); // Get user confirmation by opening a blocking dialog - error_code res = open_msg_dialog(true, CELL_MSGDIALOG_TYPE_SE_TYPE_ERROR | CELL_MSGDIALOG_TYPE_BUTTON_TYPE_OK | CELL_MSGDIALOG_TYPE_DISABLE_CANCEL_ON, vm::make_str(error_msg), msg_dialog_source::_cellGame); + error_code res = open_msg_dialog( + true, + CELL_MSGDIALOG_TYPE_SE_TYPE_ERROR | CELL_MSGDIALOG_TYPE_BUTTON_TYPE_OK | + CELL_MSGDIALOG_TYPE_DISABLE_CANCEL_ON, + vm::make_str(error_msg), msg_dialog_source::_cellGame); // Reschedule after a blocking dialog returns if (ppu.check_state()) @@ -1226,17 +1367,29 @@ error_code cellGameDataCheckCreate2(ppu_thread& ppu, u32 version, vm::cptr return CELL_GAMEDATA_ERROR_CBRESULT; } -error_code cellGameDataCheckCreate(ppu_thread& ppu, u32 version, vm::cptr dirName, u32 errDialog, vm::ptr funcStat, u32 container) +error_code cellGameDataCheckCreate(ppu_thread& ppu, u32 version, + vm::cptr dirName, u32 errDialog, + vm::ptr funcStat, + u32 container) { - cellGame.warning("cellGameDataCheckCreate(version=0x%x, dirName=%s, errDialog=0x%x, funcStat=*0x%x, container=%d)", version, dirName, errDialog, funcStat, container); + cellGame.warning("cellGameDataCheckCreate(version=0x%x, dirName=%s, " + "errDialog=0x%x, funcStat=*0x%x, container=%d)", + version, dirName, errDialog, funcStat, container); - // TODO: almost identical, the only difference is that this function will always calculate the size of game data - return cellGameDataCheckCreate2(ppu, version, dirName, errDialog, funcStat, container); + // TODO: almost identical, the only difference is that this function will + // always calculate the size of game data + return cellGameDataCheckCreate2(ppu, version, dirName, errDialog, funcStat, + container); } -error_code cellGameCreateGameData(vm::ptr init, vm::ptr tmp_contentInfoPath, vm::ptr tmp_usrdirPath) +error_code +cellGameCreateGameData(vm::ptr init, + vm::ptr tmp_contentInfoPath, + vm::ptr tmp_usrdirPath) { - cellGame.success("cellGameCreateGameData(init=*0x%x, tmp_contentInfoPath=*0x%x, tmp_usrdirPath=*0x%x)", init, tmp_contentInfoPath, tmp_usrdirPath); + cellGame.success("cellGameCreateGameData(init=*0x%x, " + "tmp_contentInfoPath=*0x%x, tmp_usrdirPath=*0x%x)", + init, tmp_contentInfoPath, tmp_usrdirPath); if (!init) { @@ -1267,23 +1420,30 @@ error_code cellGameCreateGameData(vm::ptr init, vm::ptr init, vm::ptrtitleId)}, - {"TITLE", psf::string(CELL_GAME_SYSP_TITLE_SIZE, init->title)}, - {"VERSION", psf::string(CELL_GAME_SYSP_VERSION_SIZE, init->version)}, - }; + perm.sfo = { + {"CATEGORY", psf::string(3, "GD")}, + {"TITLE_ID", psf::string(TITLEID_SFO_ENTRY_SIZE, init->titleId)}, + {"TITLE", psf::string(CELL_GAME_SYSP_TITLE_SIZE, init->title)}, + {"VERSION", psf::string(CELL_GAME_SYSP_VERSION_SIZE, init->version)}, + }; return CELL_OK; } @@ -1321,7 +1482,9 @@ error_code cellGameDeleteGameData(vm::cptr dirName) auto remove_gd = [&]() -> error_code { - if (Emu.GetCat() == "GD" && Emu.GetDir().substr(Emu.GetDir().find_last_of('/') + 1) == vfs::escape(name)) + if (Emu.GetCat() == "GD" && + Emu.GetDir().substr(Emu.GetDir().find_last_of('/') + 1) == + vfs::escape(name)) { // Boot patch cannot delete its own directory return CELL_GAME_ERROR_NOTSUPPORTED; @@ -1329,7 +1492,8 @@ error_code cellGameDeleteGameData(vm::cptr dirName) const auto [sfo, psf_error] = psf::load(dir + "/PARAM.SFO"); - if (psf::get_string(sfo, "CATEGORY") != "GD" && psf_error != psf::error::stream) + if (psf::get_string(sfo, "CATEGORY") != "GD" && + psf_error != psf::error::stream) { return {CELL_GAME_ERROR_NOTSUPPORTED, psf_error}; } @@ -1340,13 +1504,17 @@ error_code cellGameDeleteGameData(vm::cptr dirName) return CELL_GAME_ERROR_NOTFOUND; } - if (auto id = psf::get_string(sfo, "TITLE_ID"); !id.empty() && id != Emu.GetTitleID()) + if (auto id = psf::get_string(sfo, "TITLE_ID"); + !id.empty() && id != Emu.GetTitleID()) { - cellGame.error("cellGameDeleteGameData(%s): Attempts to delete GameData with TITLE ID which does not match the program's (%s)", id, Emu.GetTitleID()); + cellGame.error("cellGameDeleteGameData(%s): Attempts to delete GameData " + "with TITLE ID which does not match the program's (%s)", + id, Emu.GetTitleID()); } // Actually remove game data - if (!vfs::host::remove_all(dir, rpcs3::utils::get_hdd0_dir(), &g_mp_sys_dev_hdd0, true)) + if (!vfs::host::remove_all(dir, rpcs3::utils::get_hdd0_dir(), + &g_mp_sys_dev_hdd0, true)) { return {CELL_GAME_ERROR_ACCESS_ERROR, dir}; } @@ -1410,9 +1578,15 @@ error_code cellGameGetParamInt(s32 id, vm::ptr value) switch (id) { - case CELL_GAME_PARAMID_PARENTAL_LEVEL: key = "PARENTAL_LEVEL"; break; - case CELL_GAME_PARAMID_RESOLUTION: key = "RESOLUTION"; break; - case CELL_GAME_PARAMID_SOUND_FORMAT: key = "SOUND_FORMAT"; break; + case CELL_GAME_PARAMID_PARENTAL_LEVEL: + key = "PARENTAL_LEVEL"; + break; + case CELL_GAME_PARAMID_RESOLUTION: + key = "RESOLUTION"; + break; + case CELL_GAME_PARAMID_SOUND_FORMAT: + key = "SOUND_FORMAT"; + break; default: { return CELL_GAME_ERROR_INVALID_ID; @@ -1435,7 +1609,8 @@ enum class strkey_flag : u32 get_game_data, // reading is allowed for game data PARAM.SFO set_game_data, // writing is allowed for game data PARAM.SFO get_other, // reading is allowed for other types of PARAM.SFO - // set_other, // writing is allowed for other types of PARAM.SFO (not possible) + // set_other, // writing is allowed for other types of PARAM.SFO (not + // possible) __bitset_enum_max }; @@ -1444,20 +1619,22 @@ struct string_key_info { public: string_key_info() = default; - string_key_info(std::string_view _name, u32 _max_size, bs_t _flags) - : name(_name), max_size(_max_size), flags(_flags) - { - } + string_key_info(std::string_view _name, u32 _max_size, + bs_t _flags) + : name(_name), max_size(_max_size), flags(_flags) {} std::string_view name; u32 max_size = 0; - inline bool is_supported(bool is_setter, content_permission::check_mode mode) const + inline bool is_supported(bool is_setter, + content_permission::check_mode mode) const { switch (mode) { case content_permission::check_mode::game_data: - case content_permission::check_mode::patch: // TODO: it's unclear if patch mode should also support these flags + case content_permission::check_mode::patch: // TODO: it's unclear if patch + // mode should also support + // these flags { return !!(flags & (is_setter ? strkey_flag::set_game_data : strkey_flag::get_game_data)); } @@ -1483,33 +1660,107 @@ static string_key_info get_param_string_key(s32 id) { switch (id) { - case CELL_GAME_PARAMID_TITLE: return string_key_info("TITLE", CELL_GAME_SYSP_TITLE_SIZE, strkey_flag::get_game_data + strkey_flag::get_other + strkey_flag::set_game_data); - case CELL_GAME_PARAMID_TITLE_DEFAULT: return string_key_info("TITLE", CELL_GAME_SYSP_TITLE_SIZE, strkey_flag::get_game_data + strkey_flag::get_other + strkey_flag::set_game_data); - case CELL_GAME_PARAMID_TITLE_JAPANESE: return string_key_info("TITLE_00", CELL_GAME_SYSP_TITLE_SIZE, strkey_flag::get_game_data + strkey_flag::set_game_data); - case CELL_GAME_PARAMID_TITLE_ENGLISH: return string_key_info("TITLE_01", CELL_GAME_SYSP_TITLE_SIZE, strkey_flag::get_game_data + strkey_flag::set_game_data); - case CELL_GAME_PARAMID_TITLE_FRENCH: return string_key_info("TITLE_02", CELL_GAME_SYSP_TITLE_SIZE, strkey_flag::get_game_data + strkey_flag::set_game_data); - case CELL_GAME_PARAMID_TITLE_SPANISH: return string_key_info("TITLE_03", CELL_GAME_SYSP_TITLE_SIZE, strkey_flag::get_game_data + strkey_flag::set_game_data); - case CELL_GAME_PARAMID_TITLE_GERMAN: return string_key_info("TITLE_04", CELL_GAME_SYSP_TITLE_SIZE, strkey_flag::get_game_data + strkey_flag::set_game_data); - case CELL_GAME_PARAMID_TITLE_ITALIAN: return string_key_info("TITLE_05", CELL_GAME_SYSP_TITLE_SIZE, strkey_flag::get_game_data + strkey_flag::set_game_data); - case CELL_GAME_PARAMID_TITLE_DUTCH: return string_key_info("TITLE_06", CELL_GAME_SYSP_TITLE_SIZE, strkey_flag::get_game_data + strkey_flag::set_game_data); - case CELL_GAME_PARAMID_TITLE_PORTUGUESE: return string_key_info("TITLE_07", CELL_GAME_SYSP_TITLE_SIZE, strkey_flag::get_game_data + strkey_flag::set_game_data); - case CELL_GAME_PARAMID_TITLE_RUSSIAN: return string_key_info("TITLE_08", CELL_GAME_SYSP_TITLE_SIZE, strkey_flag::get_game_data + strkey_flag::set_game_data); - case CELL_GAME_PARAMID_TITLE_KOREAN: return string_key_info("TITLE_09", CELL_GAME_SYSP_TITLE_SIZE, strkey_flag::get_game_data + strkey_flag::set_game_data); - case CELL_GAME_PARAMID_TITLE_CHINESE_T: return string_key_info("TITLE_10", CELL_GAME_SYSP_TITLE_SIZE, strkey_flag::get_game_data + strkey_flag::set_game_data); - case CELL_GAME_PARAMID_TITLE_CHINESE_S: return string_key_info("TITLE_11", CELL_GAME_SYSP_TITLE_SIZE, strkey_flag::get_game_data + strkey_flag::set_game_data); - case CELL_GAME_PARAMID_TITLE_FINNISH: return string_key_info("TITLE_12", CELL_GAME_SYSP_TITLE_SIZE, strkey_flag::get_game_data + strkey_flag::set_game_data); - case CELL_GAME_PARAMID_TITLE_SWEDISH: return string_key_info("TITLE_13", CELL_GAME_SYSP_TITLE_SIZE, strkey_flag::get_game_data + strkey_flag::set_game_data); - case CELL_GAME_PARAMID_TITLE_DANISH: return string_key_info("TITLE_14", CELL_GAME_SYSP_TITLE_SIZE, strkey_flag::get_game_data + strkey_flag::set_game_data); - case CELL_GAME_PARAMID_TITLE_NORWEGIAN: return string_key_info("TITLE_15", CELL_GAME_SYSP_TITLE_SIZE, strkey_flag::get_game_data + strkey_flag::set_game_data); - case CELL_GAME_PARAMID_TITLE_POLISH: return string_key_info("TITLE_16", CELL_GAME_SYSP_TITLE_SIZE, strkey_flag::get_game_data + strkey_flag::set_game_data); - case CELL_GAME_PARAMID_TITLE_PORTUGUESE_BRAZIL: return string_key_info("TITLE_17", CELL_GAME_SYSP_TITLE_SIZE, strkey_flag::get_game_data + strkey_flag::set_game_data); - case CELL_GAME_PARAMID_TITLE_ENGLISH_UK: return string_key_info("TITLE_18", CELL_GAME_SYSP_TITLE_SIZE, strkey_flag::get_game_data + strkey_flag::set_game_data); - case CELL_GAME_PARAMID_TITLE_TURKISH: return string_key_info("TITLE_19", CELL_GAME_SYSP_TITLE_SIZE, strkey_flag::get_game_data + strkey_flag::set_game_data); + case CELL_GAME_PARAMID_TITLE: + return string_key_info("TITLE", CELL_GAME_SYSP_TITLE_SIZE, + strkey_flag::get_game_data + strkey_flag::get_other + + strkey_flag::set_game_data); + case CELL_GAME_PARAMID_TITLE_DEFAULT: + return string_key_info("TITLE", CELL_GAME_SYSP_TITLE_SIZE, + strkey_flag::get_game_data + strkey_flag::get_other + + strkey_flag::set_game_data); + case CELL_GAME_PARAMID_TITLE_JAPANESE: + return string_key_info("TITLE_00", CELL_GAME_SYSP_TITLE_SIZE, + strkey_flag::get_game_data + + strkey_flag::set_game_data); + case CELL_GAME_PARAMID_TITLE_ENGLISH: + return string_key_info("TITLE_01", CELL_GAME_SYSP_TITLE_SIZE, + strkey_flag::get_game_data + + strkey_flag::set_game_data); + case CELL_GAME_PARAMID_TITLE_FRENCH: + return string_key_info("TITLE_02", CELL_GAME_SYSP_TITLE_SIZE, + strkey_flag::get_game_data + + strkey_flag::set_game_data); + case CELL_GAME_PARAMID_TITLE_SPANISH: + return string_key_info("TITLE_03", CELL_GAME_SYSP_TITLE_SIZE, + strkey_flag::get_game_data + + strkey_flag::set_game_data); + case CELL_GAME_PARAMID_TITLE_GERMAN: + return string_key_info("TITLE_04", CELL_GAME_SYSP_TITLE_SIZE, + strkey_flag::get_game_data + + strkey_flag::set_game_data); + case CELL_GAME_PARAMID_TITLE_ITALIAN: + return string_key_info("TITLE_05", CELL_GAME_SYSP_TITLE_SIZE, + strkey_flag::get_game_data + + strkey_flag::set_game_data); + case CELL_GAME_PARAMID_TITLE_DUTCH: + return string_key_info("TITLE_06", CELL_GAME_SYSP_TITLE_SIZE, + strkey_flag::get_game_data + + strkey_flag::set_game_data); + case CELL_GAME_PARAMID_TITLE_PORTUGUESE: + return string_key_info("TITLE_07", CELL_GAME_SYSP_TITLE_SIZE, + strkey_flag::get_game_data + + strkey_flag::set_game_data); + case CELL_GAME_PARAMID_TITLE_RUSSIAN: + return string_key_info("TITLE_08", CELL_GAME_SYSP_TITLE_SIZE, + strkey_flag::get_game_data + + strkey_flag::set_game_data); + case CELL_GAME_PARAMID_TITLE_KOREAN: + return string_key_info("TITLE_09", CELL_GAME_SYSP_TITLE_SIZE, + strkey_flag::get_game_data + + strkey_flag::set_game_data); + case CELL_GAME_PARAMID_TITLE_CHINESE_T: + return string_key_info("TITLE_10", CELL_GAME_SYSP_TITLE_SIZE, + strkey_flag::get_game_data + + strkey_flag::set_game_data); + case CELL_GAME_PARAMID_TITLE_CHINESE_S: + return string_key_info("TITLE_11", CELL_GAME_SYSP_TITLE_SIZE, + strkey_flag::get_game_data + + strkey_flag::set_game_data); + case CELL_GAME_PARAMID_TITLE_FINNISH: + return string_key_info("TITLE_12", CELL_GAME_SYSP_TITLE_SIZE, + strkey_flag::get_game_data + + strkey_flag::set_game_data); + case CELL_GAME_PARAMID_TITLE_SWEDISH: + return string_key_info("TITLE_13", CELL_GAME_SYSP_TITLE_SIZE, + strkey_flag::get_game_data + + strkey_flag::set_game_data); + case CELL_GAME_PARAMID_TITLE_DANISH: + return string_key_info("TITLE_14", CELL_GAME_SYSP_TITLE_SIZE, + strkey_flag::get_game_data + + strkey_flag::set_game_data); + case CELL_GAME_PARAMID_TITLE_NORWEGIAN: + return string_key_info("TITLE_15", CELL_GAME_SYSP_TITLE_SIZE, + strkey_flag::get_game_data + + strkey_flag::set_game_data); + case CELL_GAME_PARAMID_TITLE_POLISH: + return string_key_info("TITLE_16", CELL_GAME_SYSP_TITLE_SIZE, + strkey_flag::get_game_data + + strkey_flag::set_game_data); + case CELL_GAME_PARAMID_TITLE_PORTUGUESE_BRAZIL: + return string_key_info("TITLE_17", CELL_GAME_SYSP_TITLE_SIZE, + strkey_flag::get_game_data + + strkey_flag::set_game_data); + case CELL_GAME_PARAMID_TITLE_ENGLISH_UK: + return string_key_info("TITLE_18", CELL_GAME_SYSP_TITLE_SIZE, + strkey_flag::get_game_data + + strkey_flag::set_game_data); + case CELL_GAME_PARAMID_TITLE_TURKISH: + return string_key_info("TITLE_19", CELL_GAME_SYSP_TITLE_SIZE, + strkey_flag::get_game_data + + strkey_flag::set_game_data); - case CELL_GAME_PARAMID_TITLE_ID: return string_key_info("TITLE_ID", CELL_GAME_SYSP_TITLEID_SIZE, strkey_flag::get_game_data + strkey_flag::get_other); - case CELL_GAME_PARAMID_VERSION: return string_key_info("VERSION", CELL_GAME_SYSP_VERSION_SIZE, strkey_flag::get_game_data); - case CELL_GAME_PARAMID_PS3_SYSTEM_VER: return string_key_info("PS3_SYSTEM_VER", CELL_GAME_SYSP_PS3_SYSTEM_VER_SIZE, {}); // TODO - case CELL_GAME_PARAMID_APP_VER: return string_key_info("APP_VER", CELL_GAME_SYSP_APP_VER_SIZE, strkey_flag::get_game_data + strkey_flag::get_other); + case CELL_GAME_PARAMID_TITLE_ID: + return string_key_info("TITLE_ID", CELL_GAME_SYSP_TITLEID_SIZE, + strkey_flag::get_game_data + strkey_flag::get_other); + case CELL_GAME_PARAMID_VERSION: + return string_key_info("VERSION", CELL_GAME_SYSP_VERSION_SIZE, + strkey_flag::get_game_data); + case CELL_GAME_PARAMID_PS3_SYSTEM_VER: + return string_key_info("PS3_SYSTEM_VER", CELL_GAME_SYSP_PS3_SYSTEM_VER_SIZE, + {}); // TODO + case CELL_GAME_PARAMID_APP_VER: + return string_key_info("APP_VER", CELL_GAME_SYSP_APP_VER_SIZE, + strkey_flag::get_game_data + strkey_flag::get_other); } return {}; @@ -1517,7 +1768,8 @@ static string_key_info get_param_string_key(s32 id) error_code cellGameGetParamString(s32 id, vm::ptr buf, u32 bufsize) { - cellGame.warning("cellGameGetParamString(id=%d, buf=*0x%x, bufsize=%d)", id, buf, bufsize); + cellGame.warning("cellGameGetParamString(id=%d, buf=*0x%x, bufsize=%d)", id, + buf, bufsize); if (!buf || bufsize == 0) { @@ -1545,7 +1797,9 @@ error_code cellGameGetParamString(s32 id, vm::ptr buf, u32 bufsize) if (!key.is_supported(false, perm.mode)) { // TODO: this error is possibly only returned during debug mode - return {CELL_GAME_ERROR_NOTSUPPORTED, "id %d is not supported in the current check mode: %s", id, perm.mode.load()}; + return {CELL_GAME_ERROR_NOTSUPPORTED, + "id %d is not supported in the current check mode: %s", id, + perm.mode.load()}; } const auto value = psf::get_string(perm.sfo, key.name); @@ -1624,13 +1878,17 @@ error_code cellGameGetSizeKB(ppu_thread& ppu, vm::ptr size) const u64 start_sleep = ppu.start_time; - const std::string local_dir = !perm.temp.empty() ? perm.temp : vfs::get("/dev_hdd0/game/" + perm.dir); + const std::string local_dir = + !perm.temp.empty() ? perm.temp : vfs::get("/dev_hdd0/game/" + perm.dir); const auto dirsz = fs::get_dir_size(local_dir, 1024); // This function is very slow by nature - // TODO: Check if after first use the result is being cached so the sleep can be reduced in this case - lv2_sleep(utils::sub_saturate(dirsz == umax ? 1000 : 200000, get_guest_system_time() - start_sleep), &ppu); + // TODO: Check if after first use the result is being cached so the sleep can + // be reduced in this case + lv2_sleep(utils::sub_saturate(dirsz == umax ? 1000 : 200000, + get_guest_system_time() - start_sleep), + &ppu); if (dirsz == umax) { @@ -1642,7 +1900,9 @@ error_code cellGameGetSizeKB(ppu_thread& ppu, vm::ptr size) } else { - cellGame.error("cellGameGetSizeKb(): Unknown failure on calculating directory size '%s' (%s)", local_dir, error); + cellGame.error("cellGameGetSizeKb(): Unknown failure on calculating " + "directory size '%s' (%s)", + local_dir, error); return CELL_GAME_ERROR_ACCESS_ERROR; } } @@ -1655,7 +1915,8 @@ error_code cellGameGetSizeKB(ppu_thread& ppu, vm::ptr size) error_code cellGameGetDiscContentInfoUpdatePath(vm::ptr updatePath) { - cellGame.todo("cellGameGetDiscContentInfoUpdatePath(updatePath=*0x%x)", updatePath); + cellGame.todo("cellGameGetDiscContentInfoUpdatePath(updatePath=*0x%x)", + updatePath); if (!updatePath) { @@ -1667,7 +1928,8 @@ error_code cellGameGetDiscContentInfoUpdatePath(vm::ptr updatePath) error_code cellGameGetLocalWebContentPath(vm::ptr contentPath) { - cellGame.todo("cellGameGetLocalWebContentPath(contentPath=*0x%x)", contentPath); + cellGame.todo("cellGameGetLocalWebContentPath(contentPath=*0x%x)", + contentPath); if (!contentPath) { @@ -1677,9 +1939,12 @@ error_code cellGameGetLocalWebContentPath(vm::ptr contentPath) return CELL_OK; } -error_code cellGameContentErrorDialog(s32 type, s32 errNeedSizeKB, vm::cptr dirName) +error_code cellGameContentErrorDialog(s32 type, s32 errNeedSizeKB, + vm::cptr dirName) { - cellGame.warning("cellGameContentErrorDialog(type=%d, errNeedSizeKB=%d, dirName=%s)", type, errNeedSizeKB, dirName); + cellGame.warning( + "cellGameContentErrorDialog(type=%d, errNeedSizeKB=%d, dirName=%s)", type, + errNeedSizeKB, dirName); std::string error_msg; @@ -1687,27 +1952,35 @@ error_code cellGameContentErrorDialog(s32 type, s32 errNeedSizeKB, vm::cptr CELL_GAME_ERRDIALOG_NOSPACE, msg_dialog_source::_cellGame); + return open_exit_dialog(error_msg, type > CELL_GAME_ERRDIALOG_NOSPACE, + msg_dialog_source::_cellGame); } -error_code cellGameThemeInstall(vm::cptr usrdirPath, vm::cptr fileName, u32 option) +error_code cellGameThemeInstall(vm::cptr usrdirPath, + vm::cptr fileName, u32 option) { - cellGame.todo("cellGameThemeInstall(usrdirPath=%s, fileName=%s, option=0x%x)", usrdirPath, fileName, option); + cellGame.todo("cellGameThemeInstall(usrdirPath=%s, fileName=%s, option=0x%x)", + usrdirPath, fileName, option); - if (!usrdirPath || !fileName || !memchr(usrdirPath.get_ptr(), '\0', CELL_GAME_PATH_MAX) || option > CELL_GAME_THEME_OPTION_APPLY) + if (!usrdirPath || !fileName || + !memchr(usrdirPath.get_ptr(), '\0', CELL_GAME_PATH_MAX) || + option > CELL_GAME_THEME_OPTION_APPLY) { return CELL_GAME_ERROR_PARAM; } - const std::string src_path = vfs::get(fmt::format("%s/%s", usrdirPath, fileName)); + const std::string src_path = + vfs::get(fmt::format("%s/%s", usrdirPath, fileName)); // Use hash to get a hopefully unique filename std::string hash; @@ -1745,7 +2026,8 @@ error_code cellGameThemeInstall(vm::cptr usrdirPath, vm::cptr fileNa { u32 magic{}; - if (src_path.ends_with(".p3t") || !theme.read(magic) || magic != "P3TF"_u32) + if (src_path.ends_with(".p3t") || !theme.read(magic) || + magic != "P3TF"_u32) { return CELL_GAME_ERROR_INVALID_THEME_FILE; } @@ -1757,26 +2039,35 @@ error_code cellGameThemeInstall(vm::cptr usrdirPath, vm::cptr fileNa return CELL_GAME_ERROR_NOTFOUND; } - const std::string dst_path = vfs::get(fmt::format("/dev_hdd0/theme/%s_%s.p3t", Emu.GetTitleID(), hash)); // TODO: this is renamed with some other scheme + const std::string dst_path = vfs::get( + fmt::format("/dev_hdd0/theme/%s_%s.p3t", Emu.GetTitleID(), + hash)); // TODO: this is renamed with some other scheme if (fs::is_file(dst_path)) { - cellGame.notice("cellGameThemeInstall: theme already installed: '%s'", dst_path); + cellGame.notice("cellGameThemeInstall: theme already installed: '%s'", + dst_path); } else { - cellGame.notice("cellGameThemeInstall: copying theme from '%s' to '%s'", src_path, dst_path); + cellGame.notice("cellGameThemeInstall: copying theme from '%s' to '%s'", + src_path, dst_path); - if (!fs::copy_file(src_path, dst_path, false)) // TODO: new file is write protected + if (!fs::copy_file(src_path, dst_path, + false)) // TODO: new file is write protected { - cellGame.error("cellGameThemeInstall: failed to copy theme from '%s' to '%s' (error=%s)", src_path, dst_path, fs::g_tls_error); + cellGame.error("cellGameThemeInstall: failed to copy theme from '%s' to " + "'%s' (error=%s)", + src_path, dst_path, fs::g_tls_error); return CELL_GAME_ERROR_ACCESS_ERROR; } } if (false && !fs::remove_file(src_path)) // TODO: disabled for now { - cellGame.error("cellGameThemeInstall: failed to remove source theme from '%s' (error=%s)", src_path, fs::g_tls_error); + cellGame.error("cellGameThemeInstall: failed to remove source theme from " + "'%s' (error=%s)", + src_path, fs::g_tls_error); } if (option == CELL_GAME_THEME_OPTION_APPLY) @@ -1787,19 +2078,30 @@ error_code cellGameThemeInstall(vm::cptr usrdirPath, vm::cptr fileNa return CELL_OK; } -error_code cellGameThemeInstallFromBuffer(ppu_thread& ppu, u32 fileSize, u32 bufSize, vm::ptr buf, vm::ptr func, u32 option) +error_code cellGameThemeInstallFromBuffer( + ppu_thread& ppu, u32 fileSize, u32 bufSize, vm::ptr buf, + vm::ptr func, u32 option) { - cellGame.todo("cellGameThemeInstallFromBuffer(fileSize=%d, bufSize=%d, buf=*0x%x, func=*0x%x, option=0x%x)", fileSize, bufSize, buf, func, option); + cellGame.todo("cellGameThemeInstallFromBuffer(fileSize=%d, bufSize=%d, " + "buf=*0x%x, func=*0x%x, option=0x%x)", + fileSize, bufSize, buf, func, option); - if (!buf || !fileSize || (fileSize > bufSize && !func) || bufSize < CELL_GAME_THEMEINSTALL_BUFSIZE_MIN || option > CELL_GAME_THEME_OPTION_APPLY) + if (!buf || !fileSize || (fileSize > bufSize && !func) || + bufSize < CELL_GAME_THEMEINSTALL_BUFSIZE_MIN || + option > CELL_GAME_THEME_OPTION_APPLY) { return CELL_GAME_ERROR_PARAM; } - const std::string hash = sha256_get_hash(reinterpret_cast(buf.get_ptr()), fileSize, true); - const std::string dst_path = vfs::get(fmt::format("/dev_hdd0/theme/%s_%s.p3t", Emu.GetTitleID(), hash)); // TODO: this is renamed with some scheme + const std::string hash = + sha256_get_hash(reinterpret_cast(buf.get_ptr()), fileSize, true); + const std::string dst_path = + vfs::get(fmt::format("/dev_hdd0/theme/%s_%s.p3t", Emu.GetTitleID(), + hash)); // TODO: this is renamed with some scheme - if (fs::file theme = fs::file(dst_path, fs::write_new + fs::isfile)) // TODO: new file is write protected + if (fs::file theme = fs::file( + dst_path, + fs::write_new + fs::isfile)) // TODO: new file is write protected { const u32 magic = *reinterpret_cast(buf.get_ptr()); @@ -1810,16 +2112,23 @@ error_code cellGameThemeInstallFromBuffer(ppu_thread& ppu, u32 fileSize, u32 buf if (func && bufSize < fileSize) { - cellGame.notice("cellGameThemeInstallFromBuffer: writing theme with func callback to '%s'", dst_path); + cellGame.notice("cellGameThemeInstallFromBuffer: writing theme with func " + "callback to '%s'", + dst_path); for (u32 file_offset = 0; file_offset < fileSize;) { const u32 read_size = std::min(bufSize, fileSize - file_offset); - cellGame.notice("cellGameThemeInstallFromBuffer: writing %d bytes at pos %d", read_size, file_offset); + cellGame.notice( + "cellGameThemeInstallFromBuffer: writing %d bytes at pos %d", + read_size, file_offset); - if (theme.write(reinterpret_cast(buf.get_ptr()) + file_offset, read_size) != read_size) + if (theme.write(reinterpret_cast(buf.get_ptr()) + file_offset, + read_size) != read_size) { - cellGame.error("cellGameThemeInstallFromBuffer: failed to write to destination file '%s' (error=%s)", dst_path, fs::g_tls_error); + cellGame.error("cellGameThemeInstallFromBuffer: failed to write to " + "destination file '%s' (error=%s)", + dst_path, fs::g_tls_error); if (fs::g_tls_error == fs::error::nospace) { @@ -1832,23 +2141,29 @@ error_code cellGameThemeInstallFromBuffer(ppu_thread& ppu, u32 fileSize, u32 buf file_offset += read_size; // Report status with callback - cellGame.notice("cellGameThemeInstallFromBuffer: func(fileOffset=%d, readSize=%d, buf=0x%x)", file_offset, read_size, buf); + cellGame.notice("cellGameThemeInstallFromBuffer: func(fileOffset=%d, " + "readSize=%d, buf=0x%x)", + file_offset, read_size, buf); const s32 result = func(ppu, file_offset, read_size, buf); if (result == CELL_GAME_RET_CANCEL) // same as CELL_GAME_CBRESULT_CANCEL { - cellGame.notice("cellGameThemeInstallFromBuffer: theme installation was cancelled"); + cellGame.notice("cellGameThemeInstallFromBuffer: theme installation " + "was cancelled"); return not_an_error(CELL_GAME_RET_CANCEL); } } } else { - cellGame.notice("cellGameThemeInstallFromBuffer: writing theme to '%s'", dst_path); + cellGame.notice("cellGameThemeInstallFromBuffer: writing theme to '%s'", + dst_path); if (theme.write(buf.get_ptr(), fileSize) != fileSize) { - cellGame.error("cellGameThemeInstallFromBuffer: failed to write to destination file '%s' (error=%s)", dst_path, fs::g_tls_error); + cellGame.error("cellGameThemeInstallFromBuffer: failed to write to " + "destination file '%s' (error=%s)", + dst_path, fs::g_tls_error); if (fs::g_tls_error == fs::error::nospace) { @@ -1859,13 +2174,18 @@ error_code cellGameThemeInstallFromBuffer(ppu_thread& ppu, u32 fileSize, u32 buf } } } - else if (fs::g_tls_error == fs::error::exist) // Do not overwrite files, but continue. + else if (fs::g_tls_error == + fs::error::exist) // Do not overwrite files, but continue. { - cellGame.notice("cellGameThemeInstallFromBuffer: theme already installed: '%s'", dst_path); + cellGame.notice( + "cellGameThemeInstallFromBuffer: theme already installed: '%s'", + dst_path); } else { - cellGame.error("cellGameThemeInstallFromBuffer: failed to open destination file '%s' (error=%s)", dst_path, fs::g_tls_error); + cellGame.error("cellGameThemeInstallFromBuffer: failed to open destination " + "file '%s' (error=%s)", + dst_path, fs::g_tls_error); return CELL_GAME_ERROR_ACCESS_ERROR; } @@ -1877,7 +2197,8 @@ error_code cellGameThemeInstallFromBuffer(ppu_thread& ppu, u32 fileSize, u32 buf return CELL_OK; } -error_code cellDiscGameGetBootDiscInfo(vm::ptr getParam) +error_code +cellDiscGameGetBootDiscInfo(vm::ptr getParam) { cellGame.warning("cellDiscGameGetBootDiscInfo(getParam=*0x%x)", getParam); @@ -1909,11 +2230,16 @@ error_code cellDiscGameGetBootDiscInfo(vm::ptr getP return CELL_OK; } -error_code cellDiscGameRegisterDiscChangeCallback(vm::ptr funcEject, vm::ptr funcInsert) +error_code cellDiscGameRegisterDiscChangeCallback( + vm::ptr funcEject, + vm::ptr funcInsert) { - cellGame.warning("cellDiscGameRegisterDiscChangeCallback(funcEject=*0x%x, funcInsert=*0x%x)", funcEject, funcInsert); + cellGame.warning("cellDiscGameRegisterDiscChangeCallback(funcEject=*0x%x, " + "funcInsert=*0x%x)", + funcEject, funcInsert); - return g_fxo->get().register_callbacks(funcEject, funcInsert); + return g_fxo->get().register_callbacks(funcEject, + funcInsert); } error_code cellDiscGameUnregisterDiscChangeCallback() @@ -1923,11 +2249,16 @@ error_code cellDiscGameUnregisterDiscChangeCallback() return g_fxo->get().unregister_callbacks(); } -error_code cellGameRegisterDiscChangeCallback(vm::ptr funcEject, vm::ptr funcInsert) +error_code cellGameRegisterDiscChangeCallback( + vm::ptr funcEject, + vm::ptr funcInsert) { - cellGame.warning("cellGameRegisterDiscChangeCallback(funcEject=*0x%x, funcInsert=*0x%x)", funcEject, funcInsert); + cellGame.warning( + "cellGameRegisterDiscChangeCallback(funcEject=*0x%x, funcInsert=*0x%x)", + funcEject, funcInsert); - return g_fxo->get().register_callbacks(funcEject, funcInsert); + return g_fxo->get().register_callbacks(funcEject, + funcInsert); } error_code cellGameUnregisterDiscChangeCallback() diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellGameExec.cpp b/ps3fw/cellGameExec.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellGameExec.cpp rename to ps3fw/cellGameExec.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellGcmSys.cpp b/ps3fw/cellGcmSys.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellGcmSys.cpp rename to ps3fw/cellGcmSys.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellGem.cpp b/ps3fw/cellGem.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellGem.cpp rename to ps3fw/cellGem.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellGifDec.cpp b/ps3fw/cellGifDec.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellGifDec.cpp rename to ps3fw/cellGifDec.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellHttp.cpp b/ps3fw/cellHttp.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellHttp.cpp rename to ps3fw/cellHttp.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellHttpUtil.cpp b/ps3fw/cellHttpUtil.cpp similarity index 78% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellHttpUtil.cpp rename to ps3fw/cellHttpUtil.cpp index 196b5b6f6..3f9be6958 100644 --- a/rpcs3/rpcs3/Emu/Cell/Modules/cellHttpUtil.cpp +++ b/ps3fw/cellHttpUtil.cpp @@ -1,12 +1,12 @@ -#include "stdafx.h" #include "Emu/Cell/PPUModule.h" -#include "Utilities/LUrlParser.h" +#include "stdafx.h" +#include "util/LUrlParser.h" #include "cellHttpUtil.h" #ifdef _WIN32 -#include #include +#include #ifdef _MSC_VER #pragma comment(lib, "Winhttp.lib") #endif @@ -37,9 +37,13 @@ void fmt_class_string::format(std::string& out, u64 arg) }); } -error_code cellHttpUtilParseUri(vm::ptr uri, vm::cptr str, vm::ptr pool, u32 size, vm::ptr required) +error_code cellHttpUtilParseUri(vm::ptr uri, vm::cptr str, + vm::ptr pool, u32 size, + vm::ptr required) { - cellHttpUtil.trace("cellHttpUtilParseUri(uri=*0x%x, str=%s, pool=*0x%x, size=%d, required=*0x%x)", uri, str, pool, size, required); + cellHttpUtil.trace("cellHttpUtilParseUri(uri=*0x%x, str=%s, pool=*0x%x, " + "size=%d, required=*0x%x)", + uri, str, pool, size, required); if (!str) { @@ -78,11 +82,16 @@ error_code cellHttpUtilParseUri(vm::ptr uri, vm::cptr str, vm } else { - std::memcpy(vm::base(pool.addr() + schemeOffset), scheme.c_str(), scheme.length() + 1); - std::memcpy(vm::base(pool.addr() + hostOffset), host.c_str(), host.length() + 1); - std::memcpy(vm::base(pool.addr() + pathOffset), path.c_str(), path.length() + 1); - std::memcpy(vm::base(pool.addr() + usernameOffset), username.c_str(), username.length() + 1); - std::memcpy(vm::base(pool.addr() + passwordOffset), password.c_str(), password.length() + 1); + std::memcpy(vm::base(pool.addr() + schemeOffset), scheme.c_str(), + scheme.length() + 1); + std::memcpy(vm::base(pool.addr() + hostOffset), host.c_str(), + host.length() + 1); + std::memcpy(vm::base(pool.addr() + pathOffset), path.c_str(), + path.length() + 1); + std::memcpy(vm::base(pool.addr() + usernameOffset), username.c_str(), + username.length() + 1); + std::memcpy(vm::base(pool.addr() + passwordOffset), password.c_str(), + password.length() + 1); uri->scheme.set(pool.addr() + schemeOffset); uri->hostname.set(pool.addr() + hostOffset); @@ -132,7 +141,8 @@ error_code cellHttpUtilParseUri(vm::ptr uri, vm::cptr str, vm parseError = "Error, URI didn't contain a slash"; break; default: - parseError = "Error, unknown error #" + std::to_string(static_cast(URL.m_ErrorCode)); + parseError = "Error, unknown error #" + + std::to_string(static_cast(URL.m_ErrorCode)); break; } cellHttpUtil.error("%s, while parsing URI, %s.", parseError, str.get_ptr()); @@ -140,9 +150,13 @@ error_code cellHttpUtilParseUri(vm::ptr uri, vm::cptr str, vm } } -error_code cellHttpUtilParseUriPath(vm::ptr path, vm::cptr str, vm::ptr pool, u32 size, vm::ptr required) +error_code cellHttpUtilParseUriPath(vm::ptr path, + vm::cptr str, vm::ptr pool, + u32 size, vm::ptr required) { - cellHttpUtil.todo("cellHttpUtilParseUriPath(path=*0x%x, str=%s, pool=*0x%x, size=%d, required=*0x%x)", path, str, pool, size, required); + cellHttpUtil.todo("cellHttpUtilParseUriPath(path=*0x%x, str=%s, pool=*0x%x, " + "size=%d, required=*0x%x)", + path, str, pool, size, required); if (!str) { @@ -160,9 +174,13 @@ error_code cellHttpUtilParseUriPath(vm::ptr path, vm::cptr uri, vm::cptr str, vm::ptr pool, u32 size, vm::ptr required) +error_code cellHttpUtilParseProxy(vm::ptr uri, vm::cptr str, + vm::ptr pool, u32 size, + vm::ptr required) { - cellHttpUtil.todo("cellHttpUtilParseProxy(uri=*0x%x, str=%s, pool=*0x%x, size=%d, required=*0x%x)", uri, str, pool, size, required); + cellHttpUtil.todo("cellHttpUtilParseProxy(uri=*0x%x, str=%s, pool=*0x%x, " + "size=%d, required=*0x%x)", + uri, str, pool, size, required); if (!str) { @@ -180,9 +198,15 @@ error_code cellHttpUtilParseProxy(vm::ptr uri, vm::cptr str, return CELL_OK; } -error_code cellHttpUtilParseStatusLine(vm::ptr resp, vm::cptr str, u32 len, vm::ptr pool, u32 size, vm::ptr required, vm::ptr parsedLength) +error_code cellHttpUtilParseStatusLine(vm::ptr resp, + vm::cptr str, u32 len, + vm::ptr pool, u32 size, + vm::ptr required, + vm::ptr parsedLength) { - cellHttpUtil.todo("cellHttpUtilParseStatusLine(resp=*0x%x, str=%s, len=%d, pool=*0x%x, size=%d, required=*0x%x, parsedLength=*0x%x)", resp, str, len, pool, size, required, parsedLength); + cellHttpUtil.todo("cellHttpUtilParseStatusLine(resp=*0x%x, str=%s, len=%d, " + "pool=*0x%x, size=%d, required=*0x%x, parsedLength=*0x%x)", + resp, str, len, pool, size, required, parsedLength); if (!str) { @@ -200,9 +224,15 @@ error_code cellHttpUtilParseStatusLine(vm::ptr resp, vm::cpt return CELL_OK; } -error_code cellHttpUtilParseHeader(vm::ptr header, vm::cptr str, u32 len, vm::ptr pool, u32 size, vm::ptr required, vm::ptr parsedLength) +error_code cellHttpUtilParseHeader(vm::ptr header, + vm::cptr str, u32 len, + vm::ptr pool, u32 size, + vm::ptr required, + vm::ptr parsedLength) { - cellHttpUtil.todo("cellHttpUtilParseHeader(header=*0x%x, str=%s, len=%d, pool=*0x%x, size=%d, required=*0x%x, parsedLength=*0x%x)", header, str, len, pool, size, required, parsedLength); + cellHttpUtil.todo("cellHttpUtilParseHeader(header=*0x%x, str=%s, len=%d, " + "pool=*0x%x, size=%d, required=*0x%x, parsedLength=*0x%x)", + header, str, len, pool, size, required, parsedLength); if (!str) { @@ -220,9 +250,13 @@ error_code cellHttpUtilParseHeader(vm::ptr header, vm::cptr req, vm::ptr buf, u32 len, vm::ptr required) +error_code cellHttpUtilBuildRequestLine(vm::cptr req, + vm::ptr buf, u32 len, + vm::ptr required) { - cellHttpUtil.notice("cellHttpUtilBuildRequestLine(req=*0x%x, buf=*0x%x, len=%d, required=*0x%x)", req, buf, len, required); + cellHttpUtil.notice("cellHttpUtilBuildRequestLine(req=*0x%x, buf=*0x%x, " + "len=%d, required=*0x%x)", + req, buf, len, required); if (!req || !req->method || !req->path || !req->protocol) { @@ -236,7 +270,9 @@ error_code cellHttpUtilBuildRequestLine(vm::cptr req, vm::p } // TODO: are the numbers properly formatted ? - const std::string result = fmt::format("%s %s %s/%d.%d\r\n", req->method, path, req->protocol, req->majorVersion, req->minorVersion); + const std::string result = + fmt::format("%s %s %s/%d.%d\r\n", req->method, path, req->protocol, + req->majorVersion, req->minorVersion); if (buf) { @@ -256,16 +292,21 @@ error_code cellHttpUtilBuildRequestLine(vm::cptr req, vm::p return CELL_OK; } -error_code cellHttpUtilBuildHeader(vm::cptr header, vm::ptr buf, u32 len, vm::ptr required) +error_code cellHttpUtilBuildHeader(vm::cptr header, + vm::ptr buf, u32 len, + vm::ptr required) { - cellHttpUtil.notice("cellHttpUtilBuildHeader(header=*0x%x, buf=*0x%x, len=%d, required=*0x%x)", header, buf, len, required); + cellHttpUtil.notice("cellHttpUtilBuildHeader(header=*0x%x, buf=*0x%x, " + "len=%d, required=*0x%x)", + header, buf, len, required); if (!header || !header->name) { return CELL_HTTP_UTIL_ERROR_INVALID_HEADER; } - const std::string result = fmt::format("%s: %s\r\n", header->name, header->value); + const std::string result = + fmt::format("%s: %s\r\n", header->name, header->value); if (buf) { @@ -285,9 +326,12 @@ error_code cellHttpUtilBuildHeader(vm::cptr header, vm::ptr uri, vm::ptr buf, u32 len, vm::ptr required, s32 flags) +error_code cellHttpUtilBuildUri(vm::cptr uri, vm::ptr buf, + u32 len, vm::ptr required, s32 flags) { - cellHttpUtil.todo("cellHttpUtilBuildUri(uri=*0x%x, buf=*0x%x, len=%d, required=*0x%x, flags=%d)", uri, buf, len, required, flags); + cellHttpUtil.todo("cellHttpUtilBuildUri(uri=*0x%x, buf=*0x%x, len=%d, " + "required=*0x%x, flags=%d)", + uri, buf, len, required, flags); if (!uri || !uri->hostname) { @@ -314,11 +358,13 @@ error_code cellHttpUtilBuildUri(vm::cptr uri, vm::ptr buf, u3 fmt::append(result, "://"); } - if (!(flags & CELL_HTTP_UTIL_URI_FLAG_NO_CREDENTIALS) && uri->username && uri->username[0]) + if (!(flags & CELL_HTTP_UTIL_URI_FLAG_NO_CREDENTIALS) && uri->username && + uri->username[0]) { fmt::append(result, "%s", uri->username); - if (!(flags & CELL_HTTP_UTIL_URI_FLAG_NO_PASSWORD) && uri->password && uri->password[0]) + if (!(flags & CELL_HTTP_UTIL_URI_FLAG_NO_PASSWORD) && uri->password && + uri->password[0]) { fmt::append(result, ":%s", uri->password); } @@ -358,9 +404,13 @@ error_code cellHttpUtilBuildUri(vm::cptr uri, vm::ptr buf, u3 return CELL_OK; } -error_code cellHttpUtilCopyUri(vm::ptr dest, vm::cptr src, vm::ptr pool, u32 poolSize, vm::ptr required) +error_code cellHttpUtilCopyUri(vm::ptr dest, + vm::cptr src, vm::ptr pool, + u32 poolSize, vm::ptr required) { - cellHttpUtil.todo("cellHttpUtilCopyUri(dest=*0x%x, src=*0x%x, pool=*0x%x, poolSize=%d, required=*0x%x)", dest, src, pool, poolSize, required); + cellHttpUtil.todo("cellHttpUtilCopyUri(dest=*0x%x, src=*0x%x, pool=*0x%x, " + "poolSize=%d, required=*0x%x)", + dest, src, pool, poolSize, required); if (!src) { @@ -378,9 +428,14 @@ error_code cellHttpUtilCopyUri(vm::ptr dest, vm::cptr return CELL_OK; } -error_code cellHttpUtilMergeUriPath(vm::ptr uri, vm::cptr src, vm::cptr path, vm::ptr pool, u32 poolSize, vm::ptr required) +error_code cellHttpUtilMergeUriPath(vm::ptr uri, + vm::cptr src, + vm::cptr path, vm::ptr pool, + u32 poolSize, vm::ptr required) { - cellHttpUtil.todo("cellHttpUtilMergeUriPath(uri=*0x%x, src=*0x%x, path=%s, pool=*0x%x, poolSize=%d, required=*0x%x)", uri, src, path, pool, poolSize, required); + cellHttpUtil.todo("cellHttpUtilMergeUriPath(uri=*0x%x, src=*0x%x, path=%s, " + "pool=*0x%x, poolSize=%d, required=*0x%x)", + uri, src, path, pool, poolSize, required); if (!path) { @@ -403,9 +458,11 @@ error_code cellHttpUtilMergeUriPath(vm::ptr uri, vm::cptr dst, vm::cptr src, u32 srcSize) +error_code cellHttpUtilSweepPath(vm::ptr dst, vm::cptr src, + u32 srcSize) { - cellHttpUtil.todo("cellHttpUtilSweepPath(dst=*0x%x, src=%s, srcSize=%d)", dst, src, srcSize); + cellHttpUtil.todo("cellHttpUtilSweepPath(dst=*0x%x, src=%s, srcSize=%d)", dst, + src, srcSize); if (!dst || !src) { @@ -431,9 +488,14 @@ error_code cellHttpUtilSweepPath(vm::ptr dst, vm::cptr src, u32 srcS return CELL_OK; } -error_code cellHttpUtilCopyStatusLine(vm::ptr dest, vm::cptr src, vm::ptr pool, u32 poolSize, vm::ptr required) +error_code cellHttpUtilCopyStatusLine(vm::ptr dest, + vm::cptr src, + vm::ptr pool, u32 poolSize, + vm::ptr required) { - cellHttpUtil.todo("cellHttpUtilCopyStatusLine(dest=*0x%x, src=*0x%x, pool=*0x%x, poolSize=%d, required=*0x%x)", dest, src, pool, poolSize, required); + cellHttpUtil.todo("cellHttpUtilCopyStatusLine(dest=*0x%x, src=*0x%x, " + "pool=*0x%x, poolSize=%d, required=*0x%x)", + dest, src, pool, poolSize, required); if (!src) { @@ -451,9 +513,14 @@ error_code cellHttpUtilCopyStatusLine(vm::ptr dest, vm::cptr return CELL_OK; } -error_code cellHttpUtilCopyHeader(vm::ptr dest, vm::cptr src, vm::ptr pool, u32 poolSize, vm::ptr required) +error_code cellHttpUtilCopyHeader(vm::ptr dest, + vm::cptr src, + vm::ptr pool, u32 poolSize, + vm::ptr required) { - cellHttpUtil.todo("cellHttpUtilCopyHeader(dest=*0x%x, src=*0x%x, pool=*0x%x, poolSize=%d, required=*0x%x)", dest, src, pool, poolSize, required); + cellHttpUtil.todo("cellHttpUtilCopyHeader(dest=*0x%x, src=*0x%x, pool=*0x%x, " + "poolSize=%d, required=*0x%x)", + dest, src, pool, poolSize, required); if (!src) { @@ -471,9 +538,15 @@ error_code cellHttpUtilCopyHeader(vm::ptr dest, vm::cptr dest, vm::cptr src, vm::cptr value, vm::ptr pool, u32 poolSize, vm::ptr required) +error_code cellHttpUtilAppendHeaderValue(vm::ptr dest, + vm::cptr src, + vm::cptr value, + vm::ptr pool, u32 poolSize, + vm::ptr required) { - cellHttpUtil.todo("cellHttpUtilAppendHeaderValue(dest=*0x%x, src=*0x%x, value=%s, pool=*0x%x, poolSize=%d, required=*0x%x)", dest, src, value, pool, poolSize, required); + cellHttpUtil.todo("cellHttpUtilAppendHeaderValue(dest=*0x%x, src=*0x%x, " + "value=%s, pool=*0x%x, poolSize=%d, required=*0x%x)", + dest, src, value, pool, poolSize, required); if (!src) { @@ -491,9 +564,13 @@ error_code cellHttpUtilAppendHeaderValue(vm::ptr dest, vm::cptr< return CELL_OK; } -error_code cellHttpUtilEscapeUri(vm::ptr out, u32 outSize, vm::cptr in, u32 inSize, vm::ptr required) +error_code cellHttpUtilEscapeUri(vm::ptr out, u32 outSize, + vm::cptr in, u32 inSize, + vm::ptr required) { - cellHttpUtil.todo("cellHttpUtilEscapeUri(out=*0x%x, outSize=%d, in=*0x%x, inSize=%d, required=*0x%x)", out, outSize, in, inSize, required); + cellHttpUtil.todo("cellHttpUtilEscapeUri(out=*0x%x, outSize=%d, in=*0x%x, " + "inSize=%d, required=*0x%x)", + out, outSize, in, inSize, required); if (!in || !inSize) { @@ -571,9 +648,12 @@ error_code cellHttpUtilEscapeUri(vm::ptr out, u32 outSize, vm::cptr in return CELL_OK; } -error_code cellHttpUtilUnescapeUri(vm::ptr out, u32 size, vm::cptr in, vm::ptr required) +error_code cellHttpUtilUnescapeUri(vm::ptr out, u32 size, vm::cptr in, + vm::ptr required) { - cellHttpUtil.todo("cellHttpUtilUnescapeUri(out=*0x%x, size=%d, in=*0x%x, required=*0x%x)", out, size, in, required); + cellHttpUtil.todo( + "cellHttpUtilUnescapeUri(out=*0x%x, size=%d, in=*0x%x, required=*0x%x)", + out, size, in, required); if (!in) { @@ -593,9 +673,13 @@ error_code cellHttpUtilUnescapeUri(vm::ptr out, u32 size, vm::cptr in, return CELL_OK; } -error_code cellHttpUtilFormUrlEncode(vm::ptr out, u32 outSize, vm::cptr in, u32 inSize, vm::ptr required) +error_code cellHttpUtilFormUrlEncode(vm::ptr out, u32 outSize, + vm::cptr in, u32 inSize, + vm::ptr required) { - cellHttpUtil.todo("cellHttpUtilFormUrlEncode(out=*0x%x, outSize=%d, in=*0x%x, inSize=%d, required=*0x%x)", out, outSize, in, inSize, required); + cellHttpUtil.todo("cellHttpUtilFormUrlEncode(out=*0x%x, outSize=%d, " + "in=*0x%x, inSize=%d, required=*0x%x)", + out, outSize, in, inSize, required); if (!in || !inSize) { @@ -687,9 +771,12 @@ error_code cellHttpUtilFormUrlEncode(vm::ptr out, u32 outSize, vm::cptr out, u32 size, vm::cptr in, vm::ptr required) +error_code cellHttpUtilFormUrlDecode(vm::ptr out, u32 size, + vm::cptr in, vm::ptr required) { - cellHttpUtil.todo("cellHttpUtilFormUrlDecode(out=*0x%x, size=%d, in=%s, required=*0x%x)", out, size, in, required); + cellHttpUtil.todo( + "cellHttpUtilFormUrlDecode(out=*0x%x, size=%d, in=%s, required=*0x%x)", + out, size, in, required); if (!in) { @@ -758,7 +845,8 @@ error_code cellHttpUtilFormUrlDecode(vm::ptr out, u32 size, vm::cptr i if (out) { - out[out_pos++] = static_cast((tmp1 & 0xffffffff) << 4) + static_cast(tmp2); + out[out_pos++] = static_cast((tmp1 & 0xffffffff) << 4) + + static_cast(tmp2); } } else @@ -788,9 +876,11 @@ error_code cellHttpUtilFormUrlDecode(vm::ptr out, u32 size, vm::cptr i return CELL_OK; } -error_code cellHttpUtilBase64Encoder(vm::ptr out, vm::cptr input, u32 len) +error_code cellHttpUtilBase64Encoder(vm::ptr out, vm::cptr input, + u32 len) { - cellHttpUtil.todo("cellHttpUtilBase64Encoder(out=*0x%x, input=*0x%x, len=%d)", out, input, len); + cellHttpUtil.todo("cellHttpUtilBase64Encoder(out=*0x%x, input=*0x%x, len=%d)", + out, input, len); if (!input || !len) { @@ -805,9 +895,11 @@ error_code cellHttpUtilBase64Encoder(vm::ptr out, vm::cptr input, u3 return CELL_OK; } -error_code cellHttpUtilBase64Decoder(vm::ptr output, vm::cptr in, u32 len) +error_code cellHttpUtilBase64Decoder(vm::ptr output, vm::cptr in, + u32 len) { - cellHttpUtil.todo("cellHttpUtilBase64Decoder(output=*0x%x, in=*0x%x, len=%d)", output, in, len); + cellHttpUtil.todo("cellHttpUtilBase64Decoder(output=*0x%x, in=*0x%x, len=%d)", + output, in, len); if (!in) { diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellImeJp.cpp b/ps3fw/cellImeJp.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellImeJp.cpp rename to ps3fw/cellImeJp.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellJpgDec.cpp b/ps3fw/cellJpgDec.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellJpgDec.cpp rename to ps3fw/cellJpgDec.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellJpgEnc.cpp b/ps3fw/cellJpgEnc.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellJpgEnc.cpp rename to ps3fw/cellJpgEnc.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellKb.cpp b/ps3fw/cellKb.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellKb.cpp rename to ps3fw/cellKb.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellKey2char.cpp b/ps3fw/cellKey2char.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellKey2char.cpp rename to ps3fw/cellKey2char.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellL10n.cpp b/ps3fw/cellL10n.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellL10n.cpp rename to ps3fw/cellL10n.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellLibprof.cpp b/ps3fw/cellLibprof.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellLibprof.cpp rename to ps3fw/cellLibprof.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellMic.cpp b/ps3fw/cellMic.cpp similarity index 86% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellMic.cpp rename to ps3fw/cellMic.cpp index 2f1064261..c1bdf6b05 100644 --- a/rpcs3/rpcs3/Emu/Cell/Modules/cellMic.cpp +++ b/ps3fw/cellMic.cpp @@ -1,14 +1,14 @@ -#include "stdafx.h" -#include "Emu/system_config.h" #include "Emu/Cell/PPUModule.h" -#include "Utilities/StrUtil.h" +#include "Emu/system_config.h" +#include "stdafx.h" +#include "util/StrUtil.h" #include "cellMic.h" -#include #include +#include -#include #include +#include #ifndef WITHOUT_OPENAL #include "3rdparty/OpenAL/openal-soft/include/AL/alext.h" @@ -110,7 +110,9 @@ void mic_context::operator()() std::lock_guard lock(mutex); - if (std::none_of(mic_list.begin(), mic_list.end(), [](const microphone_device& dev) + if (std::none_of( + mic_list.begin(), mic_list.end(), + [](const microphone_device& dev) { return dev.is_registered(); })) @@ -120,7 +122,11 @@ void mic_context::operator()() } else { - timeout = TIMESTEP - (std::chrono::duration_cast(steady_clock::now().time_since_epoch()).count() % TIMESTEP); + timeout = + TIMESTEP - (std::chrono::duration_cast( + steady_clock::now().time_since_epoch()) + .count() % + TIMESTEP); } for (auto& mic_entry : mic_list) @@ -160,11 +166,13 @@ void mic_context::load_config_and_init() { mic_list = {}; - const std::vector device_list = fmt::split(g_cfg.audio.microphone_devices.to_string(), {"@@@"}); + const std::vector device_list = + fmt::split(g_cfg.audio.microphone_devices.to_string(), {"@@@"}); if (!device_list.empty()) { - // We only register the first device. The rest is registered with cellAudioInRegisterDevice. + // We only register the first device. The rest is registered with + // cellAudioInRegisterDevice. if (g_cfg.audio.microphone_type == microphone_handler::singstar) { microphone_device& device = ::at32(mic_list, 0); @@ -208,7 +216,8 @@ u32 mic_context::register_device(const std::string& device_name) } // TODO: Check max mics properly - ensure(index < mic_list.size(), "cellMic max mics exceeded during registration"); + ensure(index < mic_list.size(), + "cellMic max mics exceeded during registration"); switch (g_cfg.audio.microphone_type) { @@ -280,16 +289,20 @@ inline void microphone_device::variable_byteswap(const void* src, void* dst) } else { - fmt::throw_exception("variable_byteswap with bytesize %d unimplemented", bytesize); + fmt::throw_exception("variable_byteswap with bytesize %d unimplemented", + bytesize); } } -inline u32 microphone_device::convert_16_bit_pcm_to_float(const std::vector& buffer, u32 num_bytes) +inline u32 +microphone_device::convert_16_bit_pcm_to_float(const std::vector& buffer, + u32 num_bytes) { static_assert((float_buf_size % sizeof(f32)) == 0); float_buf.resize(float_buf_size, 0); - const u32 bytes_to_write = static_cast(num_bytes * (sizeof(f32) / sizeof(s16))); + const u32 bytes_to_write = + static_cast(num_bytes * (sizeof(f32) / sizeof(s16))); ensure(bytes_to_write <= float_buf.size()); const be_t* src = utils::bless>(buffer.data()); @@ -299,7 +312,9 @@ inline u32 microphone_device::convert_16_bit_pcm_to_float(const std::vector& { const be_t sample = *src++; - const be_t normalized_sample_be = std::clamp(static_cast(sample) / std::numeric_limits::max(), -1.0f, 1.0f); + const be_t normalized_sample_be = + std::clamp(static_cast(sample) / std::numeric_limits::max(), + -1.0f, 1.0f); *dst++ = normalized_sample_be; } @@ -316,11 +331,12 @@ microphone_device::microphone_device(microphone_handler type) void microphone_device::add_device(const std::string& name) { - devices.push_back(mic_device{ - .name = name}); + devices.push_back(mic_device{.name = name}); } -error_code microphone_device::open_microphone(const u8 type, const u32 dsp_r, const u32 raw_r, const u8 channels) +error_code microphone_device::open_microphone(const u8 type, const u32 dsp_r, + const u32 raw_r, + const u8 channels) { signal_types = type; dsp_samplingrate = dsp_r; @@ -335,11 +351,14 @@ error_code microphone_device::open_microphone(const u8 type, const u32 dsp_r, co break; case microphone_handler::singstar: case microphone_handler::real_singstar: - // SingStar mic has always 2 channels, each channel represent a physical microphone + // SingStar mic has always 2 channels, each channel represent a physical + // microphone ensure(num_channels >= 2); if (num_channels > 2) { - cellMic.error("Tried to open a SingStar-type device with num_channels = %d", num_channels); + cellMic.error( + "Tried to open a SingStar-type device with num_channels = %d", + num_channels); num_channels = 2; } break; @@ -369,13 +388,16 @@ error_code microphone_device::open_microphone(const u8 type, const u32 dsp_r, co num_al_channels = AL_FORMAT_QUAD16; break; default: - cellMic.warning("Requested an invalid number of %d channels. Defaulting to 4 channels instead.", num_channels); + cellMic.warning("Requested an invalid number of %d channels. Defaulting to " + "4 channels instead.", + num_channels); num_al_channels = AL_FORMAT_QUAD16; num_channels = 4; break; } - // Real firmware tries 4, 2 and then 1 channels if the channel count is not supported + // Real firmware tries 4, 2 and then 1 channels if the channel count is not + // supported // TODO: The used channel count may vary for Sony's camera devices for (bool found_valid_channels = false; !found_valid_channels;) { @@ -388,7 +410,8 @@ error_code microphone_device::open_microphone(const u8 type, const u32 dsp_r, co break; } - cellMic.warning("Requested 4 channels but AL_EXT_MCFORMATS not available, trying 2 channels next"); + cellMic.warning("Requested 4 channels but AL_EXT_MCFORMATS not " + "available, trying 2 channels next"); num_al_channels = AL_FORMAT_STEREO16; num_channels = 2; break; @@ -399,7 +422,8 @@ error_code microphone_device::open_microphone(const u8 type, const u32 dsp_r, co break; } - cellMic.warning("Requested 2 channels but extension is not available, trying 1 channel next"); + cellMic.warning("Requested 2 channels but extension is not available, " + "trying 1 channel next"); num_al_channels = AL_FORMAT_MONO16; num_channels = 1; break; @@ -416,13 +440,15 @@ error_code microphone_device::open_microphone(const u8 type, const u32 dsp_r, co switch (num_al_channels) { case AL_FORMAT_QUAD16: - ensure(num_channels == 4 && device_type != microphone_handler::singstar && device_type != microphone_handler::real_singstar); + ensure(num_channels == 4 && device_type != microphone_handler::singstar && + device_type != microphone_handler::real_singstar); break; case AL_FORMAT_STEREO16: ensure(num_channels == 2 && device_type != microphone_handler::singstar); break; case AL_FORMAT_MONO16: - ensure(num_channels == 1 || (num_channels == 2 && device_type == microphone_handler::singstar)); + ensure(num_channels == 1 || + (num_channels == 2 && device_type == microphone_handler::singstar)); break; default: ensure(false); @@ -433,12 +459,14 @@ error_code microphone_device::open_microphone(const u8 type, const u32 dsp_r, co const auto fixup_samplingrate = [this](u32& rate) -> bool { // TODO: The used sample rate may vary for Sony's camera devices - const std::array samplingrates = {rate, 48000u, 32000u, 24000u, 16000u, 12000u, 8000u}; + const std::array samplingrates = {rate, 48000u, 32000u, 24000u, + 16000u, 12000u, 8000u}; const auto test_samplingrate = [&samplingrates](const u32& rate) { // TODO: actually check if device supports sampling rates - return std::any_of(samplingrates.cbegin() + 1, samplingrates.cend(), [&rate](const u32& r) + return std::any_of(samplingrates.cbegin() + 1, samplingrates.cend(), + [&rate](const u32& r) { return r == rate; }); @@ -454,7 +482,9 @@ error_code microphone_device::open_microphone(const u8 type, const u32 dsp_r, co return true; } - cellMic.warning("Requested sampling rate %d, but we do not support it. Trying next sampling rate...", samplingrate); + cellMic.warning("Requested sampling rate %d, but we do not support it. " + "Trying next sampling rate...", + samplingrate); } return false; @@ -469,13 +499,16 @@ error_code microphone_device::open_microphone(const u8 type, const u32 dsp_r, co ensure(!devices.empty()); - ALCdevice* device = alcCaptureOpenDevice(devices[0].name.c_str(), raw_samplingrate, num_al_channels, inbuf_size); + ALCdevice* device = alcCaptureOpenDevice( + devices[0].name.c_str(), raw_samplingrate, num_al_channels, inbuf_size); if (ALCenum err = alcGetError(device); err != ALC_NO_ERROR || !device) { - cellMic.error("Error opening capture device %s (error=%s, device=*0x%x)", devices[0].name, fmt::alc_error{device, err}, device); + cellMic.error("Error opening capture device %s (error=%s, device=*0x%x)", + devices[0].name, fmt::alc_error{device, err}, device); #ifdef _WIN32 - cellMic.error("Make sure microphone use is authorized under \"Microphone privacy settings\" in windows configuration"); + cellMic.error("Make sure microphone use is authorized under \"Microphone " + "privacy settings\" in windows configuration"); #endif return CELL_MICIN_ERROR_DEVICE_NOT_SUPPORT; } @@ -486,12 +519,15 @@ error_code microphone_device::open_microphone(const u8 type, const u32 dsp_r, co if (device_type == microphone_handler::singstar && devices.size() >= 2) { // Open a 2nd microphone into the same device - device = alcCaptureOpenDevice(devices[1].name.c_str(), raw_samplingrate, AL_FORMAT_MONO16, inbuf_size); + device = alcCaptureOpenDevice(devices[1].name.c_str(), raw_samplingrate, + AL_FORMAT_MONO16, inbuf_size); if (ALCenum err = alcGetError(device); err != ALC_NO_ERROR || !device) { // Ignore it and move on - cellMic.error("Error opening 2nd SingStar capture device %s (error=%s, device=*0x%x)", devices[1].name, fmt::alc_error{device, err}, device); + cellMic.error("Error opening 2nd SingStar capture device %s (error=%s, " + "device=*0x%x)", + devices[1].name, fmt::alc_error{device, err}, device); } else { @@ -548,7 +584,8 @@ error_code microphone_device::start_microphone() alcCaptureStart(micdevice.device); if (ALCenum err = alcGetError(micdevice.device); err != ALC_NO_ERROR) { - cellMic.error("Error starting capture of device %s (error=%s)", micdevice.name, fmt::alc_error{micdevice.device, err}); + cellMic.error("Error starting capture of device %s (error=%s)", + micdevice.name, fmt::alc_error{micdevice.device, err}); stop_microphone(); return CELL_MICIN_ERROR_FATAL; } @@ -567,7 +604,8 @@ error_code microphone_device::stop_microphone() alcCaptureStop(micdevice.device); if (ALCenum err = alcGetError(micdevice.device); err != ALC_NO_ERROR) { - cellMic.error("Error stopping capture of device %s (error=%s)", micdevice.name, fmt::alc_error{micdevice.device, err}); + cellMic.error("Error stopping capture of device %s (error=%s)", + micdevice.name, fmt::alc_error{micdevice.device, err}); } } #endif @@ -607,7 +645,8 @@ void microphone_device::update_audio() bool microphone_device::has_data() const { - return mic_registered && mic_opened && mic_started && (rbuf_raw.has_data() || rbuf_dsp.has_data()); + return mic_registered && mic_opened && mic_started && + (rbuf_raw.has_data() || rbuf_dsp.has_data()); } f32 microphone_device::calculate_energy_level() @@ -620,7 +659,8 @@ f32 microphone_device::calculate_energy_level() for (usz i = 0; i < num_samples; i++) { const be_t sample = read_from_ptr>(buffer, i * sizeof(s16)); - const f64 normalized_sample = static_cast(sample) / -std::numeric_limits::min(); + const f64 normalized_sample = + static_cast(sample) / -std::numeric_limits::min(); sum_squares += normalized_sample * normalized_sample; } @@ -646,7 +686,9 @@ u32 microphone_device::capture_audio() if (ALCenum err = alcGetError(micdevice.device); err != ALC_NO_ERROR) { - cellMic.error("Error getting number of captured samples of device %s (error=%s)", micdevice.name, fmt::alc_error{micdevice.device, err}); + cellMic.error( + "Error getting number of captured samples of device %s (error=%s)", + micdevice.name, fmt::alc_error{micdevice.device, err}); return CELL_MICIN_ERROR_FATAL; } @@ -664,7 +706,8 @@ u32 microphone_device::capture_audio() if (ALCenum err = alcGetError(micdevice.device); err != ALC_NO_ERROR) { - cellMic.error("Error capturing samples of device %s (error=%s)", micdevice.name, fmt::alc_error{micdevice.device, err}); + cellMic.error("Error capturing samples of device %s (error=%s)", + micdevice.name, fmt::alc_error{micdevice.device, err}); } } @@ -704,7 +747,8 @@ void microphone_device::get_data(const u32 num_samples) // BE Translation for (u32 index = 0; index < bufsize; index += channel_size) { - microphone_device::variable_byteswap(buf.data() + index, tmp_ptr + index); + microphone_device::variable_byteswap(buf.data() + index, + tmp_ptr + index); } break; } @@ -789,7 +833,8 @@ void microphone_device::get_dsp(const u32 num_samples) } else { - // The same as device RAW stream format, except that the data byte is always big-endian + // The same as device RAW stream format, except that the data byte is always + // big-endian rbuf_dsp.write_bytes(buf.data(), bufsize); } } @@ -830,10 +875,13 @@ error_code cellMicEnd() /// Open/Close Microphone Functions -error_code cellMicOpenEx(s32 dev_num, s32 rawSampleRate, s32 rawChannel, s32 DSPSampleRate, s32 bufferSizeMS, u8 signalType) +error_code cellMicOpenEx(s32 dev_num, s32 rawSampleRate, s32 rawChannel, + s32 DSPSampleRate, s32 bufferSizeMS, u8 signalType) { - cellMic.notice("cellMicOpenEx(dev_num=%d, rawSampleRate=%d, rawChannel=%d, DSPSampleRate=%d, bufferSizeMS=%d, signalType=0x%x)", - dev_num, rawSampleRate, rawChannel, DSPSampleRate, bufferSizeMS, signalType); + cellMic.notice("cellMicOpenEx(dev_num=%d, rawSampleRate=%d, rawChannel=%d, " + "DSPSampleRate=%d, bufferSizeMS=%d, signalType=0x%x)", + dev_num, rawSampleRate, rawChannel, DSPSampleRate, + bufferSizeMS, signalType); auto& mic_thr = g_fxo->get(); const std::lock_guard lock(mic_thr.mutex); @@ -850,21 +898,25 @@ error_code cellMicOpenEx(s32 dev_num, s32 rawSampleRate, s32 rawChannel, s32 DSP // TODO: bufferSizeMS - return device.open_microphone(signalType, DSPSampleRate, rawSampleRate, rawChannel); + return device.open_microphone(signalType, DSPSampleRate, rawSampleRate, + rawChannel); } error_code cellMicOpen(s32 dev_num, s32 sampleRate) { cellMic.trace("cellMicOpen(dev_num=%d sampleRate=%d)", dev_num, sampleRate); - return cellMicOpenEx(dev_num, sampleRate, 1, sampleRate, 0x80, CELLMIC_SIGTYPE_DSP); + return cellMicOpenEx(dev_num, sampleRate, 1, sampleRate, 0x80, + CELLMIC_SIGTYPE_DSP); } error_code cellMicOpenRaw(s32 dev_num, s32 sampleRate, s32 maxChannels) { - cellMic.trace("cellMicOpenRaw(dev_num=%d, sampleRate=%d, maxChannels=%d)", dev_num, sampleRate, maxChannels); + cellMic.trace("cellMicOpenRaw(dev_num=%d, sampleRate=%d, maxChannels=%d)", + dev_num, sampleRate, maxChannels); - return cellMicOpenEx(dev_num, sampleRate, maxChannels, sampleRate, 0x80, CELLMIC_SIGTYPE_RAW); + return cellMicOpenEx(dev_num, sampleRate, maxChannels, sampleRate, 0x80, + CELLMIC_SIGTYPE_RAW); } s32 cellMicIsOpen(s32 dev_num) @@ -973,9 +1025,12 @@ error_code cellMicStop(s32 dev_num) /// Microphone Attributes/States Functions -error_code cellMicGetDeviceAttr(s32 dev_num, CellMicDeviceAttr deviceAttributes, vm::ptr arg1, vm::ptr arg2) +error_code cellMicGetDeviceAttr(s32 dev_num, CellMicDeviceAttr deviceAttributes, + vm::ptr arg1, vm::ptr arg2) { - cellMic.trace("cellMicGetDeviceAttr(dev_num=%d, deviceAttribute=%d, arg1=*0x%x, arg2=*0x%x)", dev_num, +deviceAttributes, arg1, arg2); + cellMic.trace("cellMicGetDeviceAttr(dev_num=%d, deviceAttribute=%d, " + "arg1=*0x%x, arg2=*0x%x)", + dev_num, +deviceAttributes, arg1, arg2); auto& mic_thr = g_fxo->get(); const std::lock_guard lock(mic_thr.mutex); @@ -1001,7 +1056,9 @@ error_code cellMicGetDeviceAttr(s32 dev_num, CellMicDeviceAttr deviceAttributes, if (*arg1 == 0) { // Calculate average volume of the channels - *arg2 = std::accumulate(device.attr_chanvol.begin(), device.attr_chanvol.end(), 0u) / ::size32(device.attr_chanvol); + *arg2 = std::accumulate(device.attr_chanvol.begin(), + device.attr_chanvol.end(), 0u) / + ::size32(device.attr_chanvol); } else { @@ -1009,21 +1066,35 @@ error_code cellMicGetDeviceAttr(s32 dev_num, CellMicDeviceAttr deviceAttributes, } break; - case CELLMIC_DEVATTR_LED: *arg1 = device.attr_led; break; - case CELLMIC_DEVATTR_GAIN: *arg1 = device.attr_gain; break; - case CELLMIC_DEVATTR_VOLUME: *arg1 = device.attr_volume; break; - case CELLMIC_DEVATTR_AGC: *arg1 = device.attr_agc; break; - case CELLMIC_DEVATTR_DSPTYPE: *arg1 = device.attr_dsptype; break; - default: return CELL_MICIN_ERROR_PARAM; + case CELLMIC_DEVATTR_LED: + *arg1 = device.attr_led; + break; + case CELLMIC_DEVATTR_GAIN: + *arg1 = device.attr_gain; + break; + case CELLMIC_DEVATTR_VOLUME: + *arg1 = device.attr_volume; + break; + case CELLMIC_DEVATTR_AGC: + *arg1 = device.attr_agc; + break; + case CELLMIC_DEVATTR_DSPTYPE: + *arg1 = device.attr_dsptype; + break; + default: + return CELL_MICIN_ERROR_PARAM; } } return CELL_OK; } -error_code cellMicSetDeviceAttr(s32 dev_num, CellMicDeviceAttr deviceAttributes, u32 arg1, u32 arg2) +error_code cellMicSetDeviceAttr(s32 dev_num, CellMicDeviceAttr deviceAttributes, + u32 arg1, u32 arg2) { - cellMic.trace("cellMicSetDeviceAttr(dev_num=%d, deviceAttributes=%d, arg1=%d, arg2=%d)", dev_num, +deviceAttributes, arg1, arg2); + cellMic.trace( + "cellMicSetDeviceAttr(dev_num=%d, deviceAttributes=%d, arg1=%d, arg2=%d)", + dev_num, +deviceAttributes, arg1, arg2); auto& mic_thr = g_fxo->get(); const std::lock_guard lock(mic_thr.mutex); @@ -1052,20 +1123,33 @@ error_code cellMicSetDeviceAttr(s32 dev_num, CellMicDeviceAttr deviceAttributes, } break; - case CELLMIC_DEVATTR_LED: device.attr_led = arg1; break; - case CELLMIC_DEVATTR_GAIN: device.attr_gain = arg1; break; - case CELLMIC_DEVATTR_VOLUME: device.attr_volume = arg1; break; - case CELLMIC_DEVATTR_AGC: device.attr_agc = arg1; break; - case CELLMIC_DEVATTR_DSPTYPE: device.attr_dsptype = arg1; break; - default: return CELL_MICIN_ERROR_PARAM; + case CELLMIC_DEVATTR_LED: + device.attr_led = arg1; + break; + case CELLMIC_DEVATTR_GAIN: + device.attr_gain = arg1; + break; + case CELLMIC_DEVATTR_VOLUME: + device.attr_volume = arg1; + break; + case CELLMIC_DEVATTR_AGC: + device.attr_agc = arg1; + break; + case CELLMIC_DEVATTR_DSPTYPE: + device.attr_dsptype = arg1; + break; + default: + return CELL_MICIN_ERROR_PARAM; } return CELL_OK; } -error_code cellMicGetSignalAttr(s32 dev_num, CellMicSignalAttr sig_attrib, vm::ptr value) +error_code cellMicGetSignalAttr(s32 dev_num, CellMicSignalAttr sig_attrib, + vm::ptr value) { - cellMic.todo("cellMicGetSignalAttr(dev_num=%d, sig_attrib=%d, value=*0x%x)", dev_num, +sig_attrib, value); + cellMic.todo("cellMicGetSignalAttr(dev_num=%d, sig_attrib=%d, value=*0x%x)", + dev_num, +sig_attrib, value); if (!value) return CELL_MICIN_ERROR_PARAM; @@ -1087,9 +1171,11 @@ error_code cellMicGetSignalAttr(s32 dev_num, CellMicSignalAttr sig_attrib, vm::p return CELL_OK; } -error_code cellMicSetSignalAttr(s32 dev_num, CellMicSignalAttr sig_attrib, vm::ptr value) +error_code cellMicSetSignalAttr(s32 dev_num, CellMicSignalAttr sig_attrib, + vm::ptr value) { - cellMic.todo("cellMicSetSignalAttr(dev_num=%d, sig_attrib=%d, value=*0x%x)", dev_num, +sig_attrib, value); + cellMic.todo("cellMicSetSignalAttr(dev_num=%d, sig_attrib=%d, value=*0x%x)", + dev_num, +sig_attrib, value); if (!value) return CELL_MICIN_ERROR_PARAM; @@ -1111,9 +1197,11 @@ error_code cellMicSetSignalAttr(s32 dev_num, CellMicSignalAttr sig_attrib, vm::p return CELL_OK; } -error_code cellMicGetSignalState(s32 dev_num, CellMicSignalState sig_state, vm::ptr value) +error_code cellMicGetSignalState(s32 dev_num, CellMicSignalState sig_state, + vm::ptr value) { - cellMic.trace("cellMicGetSignalState(dev_num=%d, sig_state=%d, value=*0x%x)", dev_num, +sig_state, value); + cellMic.trace("cellMicGetSignalState(dev_num=%d, sig_state=%d, value=*0x%x)", + dev_num, +sig_state, value); if (!value) return CELL_MICIN_ERROR_PARAM; @@ -1162,9 +1250,11 @@ error_code cellMicGetSignalState(s32 dev_num, CellMicSignalState sig_state, vm:: return CELL_OK; } -error_code cellMicGetFormatEx(s32 dev_num, vm::ptr format, /*CellMicSignalType*/ u32 type) +error_code cellMicGetFormatEx(s32 dev_num, vm::ptr format, + /*CellMicSignalType*/ u32 type) { - cellMic.trace("cellMicGetFormatEx(dev_num=%d, format=*0x%x, type=0x%x)", dev_num, format, type); + cellMic.trace("cellMicGetFormatEx(dev_num=%d, format=*0x%x, type=0x%x)", + dev_num, format, type); if (!format) return CELL_MICIN_ERROR_PARAM; @@ -1198,19 +1288,23 @@ error_code cellMicGetFormat(s32 dev_num, vm::ptr format) return cellMicGetFormatEx(dev_num, format, CELLMIC_SIGTYPE_DSP); } -error_code cellMicGetFormatRaw(s32 dev_num, vm::ptr format) +error_code cellMicGetFormatRaw(s32 dev_num, + vm::ptr format) { - cellMic.trace("cellMicGetFormatRaw(dev_num=%d, format=0x%x)", dev_num, format); + cellMic.trace("cellMicGetFormatRaw(dev_num=%d, format=0x%x)", dev_num, + format); return cellMicGetFormatEx(dev_num, format, CELLMIC_SIGTYPE_RAW); } -error_code cellMicGetFormatAux(s32 dev_num, vm::ptr format) +error_code cellMicGetFormatAux(s32 dev_num, + vm::ptr format) { cellMic.todo("cellMicGetFormatAux(dev_num=%d, format=0x%x)", dev_num, format); return cellMicGetFormatEx(dev_num, format, CELLMIC_SIGTYPE_AUX); } -error_code cellMicGetFormatDsp(s32 dev_num, vm::ptr format) +error_code cellMicGetFormatDsp(s32 dev_num, + vm::ptr format) { cellMic.todo("cellMicGetFormatDsp(dev_num=%d, format=0x%x)", dev_num, format); return cellMicGetFormatEx(dev_num, format, CELLMIC_SIGTYPE_DSP); @@ -1249,7 +1343,9 @@ error_code cellMicSetNotifyEventQueue(u64 key) error_code cellMicSetNotifyEventQueue2(u64 key, u64 source, u64 flag) { - cellMic.todo("cellMicSetNotifyEventQueue2(key=0x%llx, source=0x%llx, flag=0x%llx", key, source, flag); + cellMic.todo( + "cellMicSetNotifyEventQueue2(key=0x%llx, source=0x%llx, flag=0x%llx", key, + source, flag); auto& mic_thr = g_fxo->get(); const std::lock_guard lock(mic_thr.mutex); @@ -1294,7 +1390,8 @@ error_code cellMicRemoveNotifyEventQueue(u64 key) /// Reading Functions -error_code cell_mic_read(s32 dev_num, vm::ptr data, s32 max_bytes, /*CellMicSignalType*/ u32 type) +error_code cell_mic_read(s32 dev_num, vm::ptr data, s32 max_bytes, + /*CellMicSignalType*/ u32 type) { auto& mic_thr = g_fxo->get(); const std::lock_guard lock(mic_thr.mutex); @@ -1314,9 +1411,12 @@ error_code cell_mic_read(s32 dev_num, vm::ptr data, s32 max_bytes, /*CellM switch (type) { - case CELLMIC_SIGTYPE_DSP: return not_an_error(device.read_dsp(vm::_ptr(data.addr()), max_bytes)); - case CELLMIC_SIGTYPE_AUX: return not_an_error(0); // TODO - case CELLMIC_SIGTYPE_RAW: return not_an_error(device.read_raw(vm::_ptr(data.addr()), max_bytes)); + case CELLMIC_SIGTYPE_DSP: + return not_an_error(device.read_dsp(vm::_ptr(data.addr()), max_bytes)); + case CELLMIC_SIGTYPE_AUX: + return not_an_error(0); // TODO + case CELLMIC_SIGTYPE_RAW: + return not_an_error(device.read_raw(vm::_ptr(data.addr()), max_bytes)); default: fmt::throw_exception("Invalid CELLMIC_SIGTYPE %d", type); } @@ -1326,25 +1426,29 @@ error_code cell_mic_read(s32 dev_num, vm::ptr data, s32 max_bytes, /*CellM error_code cellMicReadRaw(s32 dev_num, vm::ptr data, s32 max_bytes) { - cellMic.trace("cellMicReadRaw(dev_num=%d, data=0x%x, maxBytes=%d)", dev_num, data, max_bytes); + cellMic.trace("cellMicReadRaw(dev_num=%d, data=0x%x, maxBytes=%d)", dev_num, + data, max_bytes); return cell_mic_read(dev_num, data, max_bytes, CELLMIC_SIGTYPE_RAW); } error_code cellMicRead(s32 dev_num, vm::ptr data, u32 max_bytes) { - cellMic.warning("cellMicRead(dev_num=%d, data=0x%x, maxBytes=0x%x)", dev_num, data, max_bytes); + cellMic.warning("cellMicRead(dev_num=%d, data=0x%x, maxBytes=0x%x)", dev_num, + data, max_bytes); return cell_mic_read(dev_num, data, max_bytes, CELLMIC_SIGTYPE_DSP); } error_code cellMicReadAux(s32 dev_num, vm::ptr data, s32 max_bytes) { - cellMic.todo("cellMicReadAux(dev_num=%d, data=0x%x, max_bytes=0x%x)", dev_num, data, max_bytes); + cellMic.todo("cellMicReadAux(dev_num=%d, data=0x%x, max_bytes=0x%x)", dev_num, + data, max_bytes); return cell_mic_read(dev_num, data, max_bytes, CELLMIC_SIGTYPE_AUX); } error_code cellMicReadDsp(s32 dev_num, vm::ptr data, s32 max_bytes) { - cellMic.warning("cellMicReadDsp(dev_num=%d, data=0x%x, max_bytes=0x%x)", dev_num, data, max_bytes); + cellMic.warning("cellMicReadDsp(dev_num=%d, data=0x%x, max_bytes=0x%x)", + dev_num, data, max_bytes); return cell_mic_read(dev_num, data, max_bytes, CELLMIC_SIGTYPE_DSP); } @@ -1374,7 +1478,8 @@ error_code cellMicReset(s32 dev_num) error_code cellMicGetDeviceGUID(s32 dev_num, vm::ptr ptr_guid) { - cellMic.todo("cellMicGetDeviceGUID(dev_num=%d ptr_guid=*0x%x)", dev_num, ptr_guid); + cellMic.todo("cellMicGetDeviceGUID(dev_num=%d ptr_guid=*0x%x)", dev_num, + ptr_guid); if (!ptr_guid) return CELL_MICIN_ERROR_PARAM; @@ -1393,7 +1498,8 @@ error_code cellMicGetDeviceGUID(s32 dev_num, vm::ptr ptr_guid) error_code cellMicGetDeviceIdentifier(s32 dev_num, vm::ptr ptr_id) { - cellMic.todo("cellMicGetDeviceIdentifier(dev_num=%d, ptr_id=*0x%x)", dev_num, ptr_id); + cellMic.todo("cellMicGetDeviceIdentifier(dev_num=%d, ptr_id=*0x%x)", dev_num, + ptr_id); if (ptr_id) *ptr_id = 0x0; @@ -1410,7 +1516,8 @@ error_code cellMicGetDeviceIdentifier(s32 dev_num, vm::ptr ptr_id) error_code cellMicGetType(s32 dev_num, vm::ptr ptr_type) { - cellMic.trace("cellMicGetType(dev_num=%d, ptr_type=*0x%x)", dev_num, ptr_type); + cellMic.trace("cellMicGetType(dev_num=%d, ptr_type=*0x%x)", dev_num, + ptr_type); if (!ptr_type) return CELL_MICIN_ERROR_PARAM; @@ -1421,7 +1528,8 @@ error_code cellMicGetType(s32 dev_num, vm::ptr ptr_type) return CELL_MICIN_ERROR_NOT_INIT; // TODO: get proper type (log message is trace because of massive spam) - *ptr_type = CELLMIC_TYPE_USBAUDIO; // Needed for Guitar Hero: Warriors of Rock (BLUS30487) + *ptr_type = CELLMIC_TYPE_USBAUDIO; // Needed for Guitar Hero: Warriors of Rock + // (BLUS30487) return CELL_OK; } diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellMouse.cpp b/ps3fw/cellMouse.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellMouse.cpp rename to ps3fw/cellMouse.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellMsgDialog.cpp b/ps3fw/cellMsgDialog.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellMsgDialog.cpp rename to ps3fw/cellMsgDialog.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellMusic.cpp b/ps3fw/cellMusic.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellMusic.cpp rename to ps3fw/cellMusic.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellMusicDecode.cpp b/ps3fw/cellMusicDecode.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellMusicDecode.cpp rename to ps3fw/cellMusicDecode.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellMusicExport.cpp b/ps3fw/cellMusicExport.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellMusicExport.cpp rename to ps3fw/cellMusicExport.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellMusicSelectionContext.cpp b/ps3fw/cellMusicSelectionContext.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellMusicSelectionContext.cpp rename to ps3fw/cellMusicSelectionContext.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellNetAoi.cpp b/ps3fw/cellNetAoi.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellNetAoi.cpp rename to ps3fw/cellNetAoi.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellNetCtl.cpp b/ps3fw/cellNetCtl.cpp similarity index 74% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellNetCtl.cpp rename to ps3fw/cellNetCtl.cpp index e3cf43ac6..64bb9b535 100644 --- a/rpcs3/rpcs3/Emu/Cell/Modules/cellNetCtl.cpp +++ b/ps3fw/cellNetCtl.cpp @@ -1,13 +1,13 @@ -#include "stdafx.h" -#include "Emu/system_config.h" #include "Emu/Cell/PPUModule.h" #include "Emu/IdManager.h" +#include "Emu/system_config.h" +#include "stdafx.h" #include "cellGame.h" -#include "cellSysutil.h" #include "cellNetCtl.h" +#include "cellSysutil.h" -#include "Utilities/StrUtil.h" +#include "util/StrUtil.h" #include "Emu/NP/np_handler.h" #include "Emu/NP/np_helpers.h" @@ -79,10 +79,14 @@ void fmt_class_string::format(std::string& out, u64 arg) { switch (value) { - case CELL_NET_CTL_STATE_Disconnected: return "Disconnected"; - case CELL_NET_CTL_STATE_Connecting: return "Connecting"; - case CELL_NET_CTL_STATE_IPObtaining: return "Obtaining IP"; - case CELL_NET_CTL_STATE_IPObtained: return "IP Obtained"; + case CELL_NET_CTL_STATE_Disconnected: + return "Disconnected"; + case CELL_NET_CTL_STATE_Connecting: + return "Connecting"; + case CELL_NET_CTL_STATE_IPObtaining: + return "Obtaining IP"; + case CELL_NET_CTL_STATE_IPObtained: + return "IP Obtained"; } return unknown; @@ -103,8 +107,10 @@ struct CellGameUpdateParam be_t cid; }; -using CellGameUpdateCallback = void(s32 status, s32 error_code, vm::ptr userdata); -using CellGameUpdateCallbackEx = void(vm::ptr result, vm::ptr userdata); +using CellGameUpdateCallback = void(s32 status, s32 error_code, + vm::ptr userdata); +using CellGameUpdateCallbackEx = void(vm::ptr result, + vm::ptr userdata); error_code cellNetCtlInit() { @@ -152,9 +158,11 @@ error_code cellNetCtlGetState(vm::ptr state) return CELL_OK; } -error_code cellNetCtlAddHandler(vm::ptr handler, vm::ptr arg, vm::ptr hid) +error_code cellNetCtlAddHandler(vm::ptr handler, + vm::ptr arg, vm::ptr hid) { - cellNetCtl.todo("cellNetCtlAddHandler(handler=*0x%x, arg=*0x%x, hid=*0x%x)", handler, arg, hid); + cellNetCtl.todo("cellNetCtlAddHandler(handler=*0x%x, arg=*0x%x, hid=*0x%x)", + handler, arg, hid); auto& nph = g_fxo->get>(); @@ -192,7 +200,8 @@ error_code cellNetCtlDelHandler(s32 hid) error_code cellNetCtlGetInfo(s32 code, vm::ptr info) { - cellNetCtl.warning("cellNetCtlGetInfo(code=0x%x (%s), info=*0x%x)", code, InfoCodeToName(code), info); + cellNetCtl.warning("cellNetCtlGetInfo(code=0x%x (%s), info=*0x%x)", code, + InfoCodeToName(code), info); auto& nph = g_fxo->get>(); @@ -219,32 +228,66 @@ error_code cellNetCtlGetInfo(s32 code, vm::ptr info) switch (code) { - case CELL_NET_CTL_INFO_DEVICE: info->device = CELL_NET_CTL_DEVICE_WIRED; break; - case CELL_NET_CTL_INFO_MTU: info->mtu = 1500; break; - case CELL_NET_CTL_INFO_LINK: info->link = CELL_NET_CTL_LINK_CONNECTED; break; - case CELL_NET_CTL_INFO_LINK_TYPE: info->link_type = CELL_NET_CTL_LINK_TYPE_100BASE_FULL; break; + case CELL_NET_CTL_INFO_DEVICE: + info->device = CELL_NET_CTL_DEVICE_WIRED; + break; + case CELL_NET_CTL_INFO_MTU: + info->mtu = 1500; + break; + case CELL_NET_CTL_INFO_LINK: + info->link = CELL_NET_CTL_LINK_CONNECTED; + break; + case CELL_NET_CTL_INFO_LINK_TYPE: + info->link_type = CELL_NET_CTL_LINK_TYPE_100BASE_FULL; + break; // case CELL_NET_CTL_INFO_BSSID: break; // case CELL_NET_CTL_INFO_SSID: break; // case CELL_NET_CTL_INFO_WLAN_SECURITY: break; // case CELL_NET_CTL_INFO_8021X_TYPE: break; // case CELL_NET_CTL_INFO_8021X_AUTH_NAME: break; - case CELL_NET_CTL_INFO_RSSI: info->rssi = 100; break; // wireless: value ranges from 0-100 indicating wireless connection strength - case CELL_NET_CTL_INFO_CHANNEL: info->channel = 1; break; // wireless: channel used to connect to the AP? - case CELL_NET_CTL_INFO_IP_CONFIG: info->ip_config = CELL_NET_CTL_IP_STATIC; break; - case CELL_NET_CTL_INFO_DHCP_HOSTNAME: strcpy_trunc(info->dhcp_hostname, nph.get_hostname()); break; + case CELL_NET_CTL_INFO_RSSI: + info->rssi = 100; + break; // wireless: value ranges from 0-100 indicating wireless connection + // strength + case CELL_NET_CTL_INFO_CHANNEL: + info->channel = 1; + break; // wireless: channel used to connect to the AP? + case CELL_NET_CTL_INFO_IP_CONFIG: + info->ip_config = CELL_NET_CTL_IP_STATIC; + break; + case CELL_NET_CTL_INFO_DHCP_HOSTNAME: + strcpy_trunc(info->dhcp_hostname, nph.get_hostname()); + break; // case CELL_NET_CTL_INFO_PPPOE_AUTH_NAME: break; - case CELL_NET_CTL_INFO_IP_ADDRESS: strcpy_trunc(info->ip_address, np::ip_to_string(nph.get_local_ip_addr())); break; // verified on HW - case CELL_NET_CTL_INFO_NETMASK: strcpy_trunc(info->netmask, "255.255.255.0"); break; - case CELL_NET_CTL_INFO_DEFAULT_ROUTE: strcpy_trunc(info->default_route, "192.168.1.1"); break; - case CELL_NET_CTL_INFO_PRIMARY_DNS: strcpy_trunc(info->primary_dns, np::ip_to_string(nph.get_dns_ip())); break; - case CELL_NET_CTL_INFO_SECONDARY_DNS: strcpy_trunc(info->secondary_dns, np::ip_to_string(nph.get_dns_ip())); break; - case CELL_NET_CTL_INFO_HTTP_PROXY_CONFIG: info->http_proxy_config = 0; break; + case CELL_NET_CTL_INFO_IP_ADDRESS: + strcpy_trunc(info->ip_address, np::ip_to_string(nph.get_local_ip_addr())); + break; // verified on HW + case CELL_NET_CTL_INFO_NETMASK: + strcpy_trunc(info->netmask, "255.255.255.0"); + break; + case CELL_NET_CTL_INFO_DEFAULT_ROUTE: + strcpy_trunc(info->default_route, "192.168.1.1"); + break; + case CELL_NET_CTL_INFO_PRIMARY_DNS: + strcpy_trunc(info->primary_dns, np::ip_to_string(nph.get_dns_ip())); + break; + case CELL_NET_CTL_INFO_SECONDARY_DNS: + strcpy_trunc(info->secondary_dns, np::ip_to_string(nph.get_dns_ip())); + break; + case CELL_NET_CTL_INFO_HTTP_PROXY_CONFIG: + info->http_proxy_config = 0; + break; // case CELL_NET_CTL_INFO_HTTP_PROXY_SERVER: break; // case CELL_NET_CTL_INFO_HTTP_PROXY_PORT: break; - case CELL_NET_CTL_INFO_UPNP_CONFIG: info->upnp_config = (nph.get_upnp_status() == SCE_NP_SIGNALING_NETINFO_UPNP_STATUS_VALID) ? CELL_NET_CTL_UPNP_ON : CELL_NET_CTL_UPNP_OFF; break; + case CELL_NET_CTL_INFO_UPNP_CONFIG: + info->upnp_config = + (nph.get_upnp_status() == SCE_NP_SIGNALING_NETINFO_UPNP_STATUS_VALID) ? CELL_NET_CTL_UPNP_ON : CELL_NET_CTL_UPNP_OFF; + break; // case CELL_NET_CTL_INFO_RESERVED1: break; // case CELL_NET_CTL_INFO_RESERVED2: break; - default: cellNetCtl.error("Unsupported request: %s", InfoCodeToName(code)); break; + default: + cellNetCtl.error("Unsupported request: %s", InfoCodeToName(code)); + break; } return CELL_OK; @@ -263,7 +306,8 @@ struct netstart_hack } }; -error_code cellNetCtlNetStartDialogLoadAsync(vm::cptr param) +error_code cellNetCtlNetStartDialogLoadAsync( + vm::cptr param) { cellNetCtl.warning("cellNetCtlNetStartDialogLoadAsync(param=*0x%x)", param); @@ -289,7 +333,8 @@ error_code cellNetCtlNetStartDialogLoadAsync(vm::cptrget>()(0); return CELL_OK; @@ -309,9 +354,11 @@ error_code cellNetCtlNetStartDialogAbortAsync() return CELL_OK; } -error_code cellNetCtlNetStartDialogUnloadAsync(vm::ptr result) +error_code cellNetCtlNetStartDialogUnloadAsync( + vm::ptr result) { - cellNetCtl.warning("cellNetCtlNetStartDialogUnloadAsync(result=*0x%x)", result); + cellNetCtl.warning("cellNetCtlNetStartDialogUnloadAsync(result=*0x%x)", + result); auto& nph = g_fxo->get>(); @@ -424,9 +471,14 @@ error_code cellGameUpdateTerm() return CELL_OK; } -error_code cellGameUpdateCheckStartAsync(vm::cptr param, vm::ptr cb_func, vm::ptr userdata) +error_code +cellGameUpdateCheckStartAsync(vm::cptr param, + vm::ptr cb_func, + vm::ptr userdata) { - cellNetCtl.todo("cellGameUpdateCheckStartAsync(param=*0x%x, cb_func=*0x%x, userdata=*0x%x)", param, cb_func, userdata); + cellNetCtl.todo("cellGameUpdateCheckStartAsync(param=*0x%x, cb_func=*0x%x, " + "userdata=*0x%x)", + param, cb_func, userdata); sysutil_register_cb([=](ppu_thread& ppu) -> s32 { cb_func(ppu, CELL_GAMEUPDATE_RESULT_STATUS_NO_UPDATE, CELL_OK, userdata); @@ -435,9 +487,13 @@ error_code cellGameUpdateCheckStartAsync(vm::cptr param, vm return CELL_OK; } -error_code cellGameUpdateCheckFinishAsync(vm::ptr cb_func, vm::ptr userdata) +error_code +cellGameUpdateCheckFinishAsync(vm::ptr cb_func, + vm::ptr userdata) { - cellNetCtl.todo("cellGameUpdateCheckFinishAsync(cb_func=*0x%x, userdata=*0x%x)", cb_func, userdata); + cellNetCtl.todo( + "cellGameUpdateCheckFinishAsync(cb_func=*0x%x, userdata=*0x%x)", cb_func, + userdata); sysutil_register_cb([=](ppu_thread& ppu) -> s32 { cb_func(ppu, CELL_GAMEUPDATE_RESULT_STATUS_FINISHED, CELL_OK, userdata); @@ -446,9 +502,12 @@ error_code cellGameUpdateCheckFinishAsync(vm::ptr cb_fun return CELL_OK; } -error_code cellGameUpdateCheckStartWithoutDialogAsync(vm::ptr cb_func, vm::ptr userdata) +error_code cellGameUpdateCheckStartWithoutDialogAsync( + vm::ptr cb_func, vm::ptr userdata) { - cellNetCtl.todo("cellGameUpdateCheckStartWithoutDialogAsync(cb_func=*0x%x, userdata=*0x%x)", cb_func, userdata); + cellNetCtl.todo("cellGameUpdateCheckStartWithoutDialogAsync(cb_func=*0x%x, " + "userdata=*0x%x)", + cb_func, userdata); sysutil_register_cb([=](ppu_thread& ppu) -> s32 { cb_func(ppu, CELL_GAMEUPDATE_RESULT_STATUS_NO_UPDATE, CELL_OK, userdata); @@ -463,34 +522,55 @@ error_code cellGameUpdateCheckAbort() return CELL_OK; } -error_code cellGameUpdateCheckStartAsyncEx(vm::cptr param, vm::ptr cb_func, vm::ptr userdata) +error_code +cellGameUpdateCheckStartAsyncEx(vm::cptr param, + vm::ptr cb_func, + vm::ptr userdata) { - cellNetCtl.todo("cellGameUpdateCheckStartAsyncEx(param=*0x%x, cb_func=*0x%x, userdata=*0x%x)", param, cb_func, userdata); + cellNetCtl.todo("cellGameUpdateCheckStartAsyncEx(param=*0x%x, cb_func=*0x%x, " + "userdata=*0x%x)", + param, cb_func, userdata); sysutil_register_cb([=](ppu_thread& ppu) -> s32 { - cb_func(ppu, vm::make_var(CellGameUpdateResult{CELL_GAMEUPDATE_RESULT_STATUS_NO_UPDATE, CELL_OK}), userdata); + cb_func(ppu, + vm::make_var(CellGameUpdateResult{ + CELL_GAMEUPDATE_RESULT_STATUS_NO_UPDATE, CELL_OK}), + userdata); return CELL_OK; }); return CELL_OK; } -error_code cellGameUpdateCheckFinishAsyncEx(vm::ptr cb_func, vm::ptr userdata) +error_code +cellGameUpdateCheckFinishAsyncEx(vm::ptr cb_func, + vm::ptr userdata) { - cellNetCtl.todo("cellGameUpdateCheckFinishAsyncEx(cb_func=*0x%x, userdata=*0x%x)", cb_func, userdata); + cellNetCtl.todo( + "cellGameUpdateCheckFinishAsyncEx(cb_func=*0x%x, userdata=*0x%x)", + cb_func, userdata); sysutil_register_cb([=](ppu_thread& ppu) -> s32 { - cb_func(ppu, vm::make_var(CellGameUpdateResult{CELL_GAMEUPDATE_RESULT_STATUS_FINISHED, CELL_OK}), userdata); + cb_func(ppu, + vm::make_var(CellGameUpdateResult{ + CELL_GAMEUPDATE_RESULT_STATUS_FINISHED, CELL_OK}), + userdata); return CELL_OK; }); return CELL_OK; } -error_code cellGameUpdateCheckStartWithoutDialogAsyncEx(vm::ptr cb_func, vm::ptr userdata) +error_code cellGameUpdateCheckStartWithoutDialogAsyncEx( + vm::ptr cb_func, vm::ptr userdata) { - cellNetCtl.todo("cellGameUpdateCheckStartWithoutDialogAsyncEx(cb_func=*0x%x, userdata=*0x%x)", cb_func, userdata); + cellNetCtl.todo("cellGameUpdateCheckStartWithoutDialogAsyncEx(cb_func=*0x%x, " + "userdata=*0x%x)", + cb_func, userdata); sysutil_register_cb([=](ppu_thread& ppu) -> s32 { - cb_func(ppu, vm::make_var(CellGameUpdateResult{CELL_GAMEUPDATE_RESULT_STATUS_NO_UPDATE, CELL_OK}), userdata); + cb_func(ppu, + vm::make_var(CellGameUpdateResult{ + CELL_GAMEUPDATE_RESULT_STATUS_NO_UPDATE, CELL_OK}), + userdata); return CELL_OK; }); return CELL_OK; diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellOskDialog.cpp b/ps3fw/cellOskDialog.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellOskDialog.cpp rename to ps3fw/cellOskDialog.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellOvis.cpp b/ps3fw/cellOvis.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellOvis.cpp rename to ps3fw/cellOvis.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellPad.cpp b/ps3fw/cellPad.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellPad.cpp rename to ps3fw/cellPad.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellPamf.cpp b/ps3fw/cellPamf.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellPamf.cpp rename to ps3fw/cellPamf.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellPesmUtility.cpp b/ps3fw/cellPesmUtility.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellPesmUtility.cpp rename to ps3fw/cellPesmUtility.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellPhotoDecode.cpp b/ps3fw/cellPhotoDecode.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellPhotoDecode.cpp rename to ps3fw/cellPhotoDecode.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellPhotoExport.cpp b/ps3fw/cellPhotoExport.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellPhotoExport.cpp rename to ps3fw/cellPhotoExport.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellPhotoImport.cpp b/ps3fw/cellPhotoImport.cpp similarity index 73% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellPhotoImport.cpp rename to ps3fw/cellPhotoImport.cpp index c6329e0f6..a8a634632 100644 --- a/rpcs3/rpcs3/Emu/Cell/Modules/cellPhotoImport.cpp +++ b/ps3fw/cellPhotoImport.cpp @@ -1,12 +1,12 @@ -#include "stdafx.h" #include "Emu/Cell/PPUModule.h" -#include "Emu/IdManager.h" #include "Emu/Cell/lv2/sys_fs.h" +#include "Emu/IdManager.h" #include "Emu/RSX/Overlays/overlay_media_list_dialog.h" -#include "Emu/VFS.h" #include "Emu/System.h" -#include "Utilities/StrUtil.h" +#include "Emu/VFS.h" #include "cellSysutil.h" +#include "stdafx.h" +#include "util/StrUtil.h" LOG_CHANNEL(cellPhotoImportUtil, "cellPhotoImport"); @@ -98,7 +98,9 @@ struct CellPhotoImportSetParam vm::bptr reserved2; }; -using CellPhotoImportFinishCallback = void(s32 result, vm::ptr filedata, vm::ptr userdata); +using CellPhotoImportFinishCallback = + void(s32 result, vm::ptr filedata, + vm::ptr userdata); struct photo_import { @@ -122,9 +124,11 @@ error_code select_photo(std::string dst_dir) return CELL_PHOTO_IMPORT_ERROR_PARAM; } - if (!dst_dir.starts_with("/dev_hdd0"sv) && !dst_dir.starts_with("/dev_hdd1"sv)) + if (!dst_dir.starts_with("/dev_hdd0"sv) && + !dst_dir.starts_with("/dev_hdd1"sv)) { - cellPhotoImportUtil.error("Destination '%s' is not inside dev_hdd0 or dev_hdd1", dst_dir); + cellPhotoImportUtil.error( + "Destination '%s' is not inside dev_hdd0 or dev_hdd1", dst_dir); return CELL_PHOTO_IMPORT_ERROR_ACCESS_ERROR; // TODO: is this correct? } @@ -140,12 +144,15 @@ error_code select_photo(std::string dst_dir) pi_manager.is_busy = true; const std::string vfs_dir_path = vfs::get("/dev_hdd0/photo"); - const std::string title = get_localized_string(localized_string_id::RSX_OVERLAYS_MEDIA_DIALOG_TITLE_PHOTO_IMPORT); + const std::string title = get_localized_string( + localized_string_id::RSX_OVERLAYS_MEDIA_DIALOG_TITLE_PHOTO_IMPORT); - error_code error = rsx::overlays::show_media_list_dialog(rsx::overlays::media_list_dialog::media_type::photo, vfs_dir_path, title, + error_code error = rsx::overlays::show_media_list_dialog( + rsx::overlays::media_list_dialog::media_type::photo, vfs_dir_path, title, [&pi_manager, dst_dir](s32 status, utils::media_info info) { - sysutil_register_cb([&pi_manager, dst_dir, info, status](ppu_thread& ppu) -> s32 + sysutil_register_cb([&pi_manager, dst_dir, info, + status](ppu_thread& ppu) -> s32 { *g_filedata_sub = {}; *g_filedata = {}; @@ -158,23 +165,30 @@ error_code select_photo(std::string dst_dir) if (!fs::get_stat(info.path, f_info) || f_info.is_directory) { - cellPhotoImportUtil.error("Path does not belong to a valid file: '%s'", info.path); - result = CELL_PHOTO_IMPORT_ERROR_ACCESS_ERROR; // TODO: is this correct ? + cellPhotoImportUtil.error( + "Path does not belong to a valid file: '%s'", info.path); + result = CELL_PHOTO_IMPORT_ERROR_ACCESS_ERROR; // TODO: is this + // correct ? pi_manager.is_busy = false; - pi_manager.func_finish(ppu, result, g_filedata, pi_manager.userdata); + pi_manager.func_finish(ppu, result, g_filedata, + pi_manager.userdata); return CELL_OK; } if (f_info.size > pi_manager.param.fileSizeMax) { - cellPhotoImportUtil.error("File size is too large: %d (fileSizeMax=%d)", f_info.size, pi_manager.param.fileSizeMax); + cellPhotoImportUtil.error( + "File size is too large: %d (fileSizeMax=%d)", f_info.size, + pi_manager.param.fileSizeMax); result = CELL_PHOTO_IMPORT_ERROR_COPY; // TODO: is this correct ? pi_manager.is_busy = false; - pi_manager.func_finish(ppu, result, g_filedata, pi_manager.userdata); + pi_manager.func_finish(ppu, result, g_filedata, + pi_manager.userdata); return CELL_OK; } - const std::string filename = info.path.substr(info.path.find_last_of(fs::delim) + 1); + const std::string filename = + info.path.substr(info.path.find_last_of(fs::delim) + 1); const std::string title = info.get_metadata("title", filename); const std::string dst_path = dst_dir + "/" + filename; std::string sub_type = info.sub_type; @@ -188,8 +202,11 @@ error_code select_photo(std::string dst_dir) g_filedata->data_sub->width = info.width; g_filedata->data_sub->height = info.height; - cellPhotoImportUtil.notice("Raw image data: filename='%s', title='%s', game='%s', sub_type='%s', width=%d, height=%d, orientation=%d ", - filename, title, Emu.GetTitle(), sub_type, info.width, info.height, info.orientation); + cellPhotoImportUtil.notice( + "Raw image data: filename='%s', title='%s', game='%s', " + "sub_type='%s', width=%d, height=%d, orientation=%d ", + filename, title, Emu.GetTitle(), sub_type, info.width, + info.height, info.orientation); // Fallback to extension if necessary if (sub_type.empty()) @@ -249,16 +266,26 @@ error_code select_photo(std::string dst_dir) break; } - cellPhotoImportUtil.notice("Media list dialog: Copying '%s' to '%s'...", info.path, dst_path); + cellPhotoImportUtil.notice( + "Media list dialog: Copying '%s' to '%s'...", info.path, + dst_path); if (!fs::copy_file(info.path, dst_path, false)) { - cellPhotoImportUtil.error("Failed to copy '%s' to '%s'. Error = '%s'", info.path, dst_path, fs::g_tls_error); + cellPhotoImportUtil.error( + "Failed to copy '%s' to '%s'. Error = '%s'", info.path, + dst_path, fs::g_tls_error); result = CELL_PHOTO_IMPORT_ERROR_COPY; } - cellPhotoImportUtil.notice("Cell image data: dstFileName='%s', photo_title='%s', game_title='%s', format=%d, width=%d, height=%d, rotate=%d ", - g_filedata->dstFileName, g_filedata->photo_title, g_filedata->game_title, static_cast(g_filedata->data_sub->format), g_filedata->data_sub->width, g_filedata->data_sub->height, static_cast(g_filedata->data_sub->rotate)); + cellPhotoImportUtil.notice( + "Cell image data: dstFileName='%s', photo_title='%s', " + "game_title='%s', format=%d, width=%d, height=%d, rotate=%d ", + g_filedata->dstFileName, g_filedata->photo_title, + g_filedata->game_title, + static_cast(g_filedata->data_sub->format), + g_filedata->data_sub->width, g_filedata->data_sub->height, + static_cast(g_filedata->data_sub->rotate)); } else { @@ -279,11 +306,19 @@ error_code select_photo(std::string dst_dir) return error; } -error_code cellPhotoImport(u32 version, vm::cptr dstHddPath, vm::ptr param, u32 container, vm::ptr funcFinish, vm::ptr userdata) +error_code cellPhotoImport(u32 version, vm::cptr dstHddPath, + vm::ptr param, + u32 container, + vm::ptr funcFinish, + vm::ptr userdata) { - cellPhotoImportUtil.todo("cellPhotoImport(version=0x%x, dstHddPath=%s, param=*0x%x, container=0x%x, funcFinish=*0x%x, userdata=*0x%x)", version, dstHddPath, param, container, funcFinish, userdata); + cellPhotoImportUtil.todo( + "cellPhotoImport(version=0x%x, dstHddPath=%s, param=*0x%x, " + "container=0x%x, funcFinish=*0x%x, userdata=*0x%x)", + version, dstHddPath, param, container, funcFinish, userdata); - if (version != CELL_PHOTO_IMPORT_VERSION_CURRENT || !funcFinish || !param || !dstHddPath) + if (version != CELL_PHOTO_IMPORT_VERSION_CURRENT || !funcFinish || !param || + !dstHddPath) { return CELL_PHOTO_IMPORT_ERROR_PARAM; } @@ -308,11 +343,17 @@ error_code cellPhotoImport(u32 version, vm::cptr dstHddPath, vm::ptr dstHddPath, vm::ptr param, vm::ptr funcFinish, vm::ptr userdata) +error_code cellPhotoImport2(u32 version, vm::cptr dstHddPath, + vm::ptr param, + vm::ptr funcFinish, + vm::ptr userdata) { - cellPhotoImportUtil.todo("cellPhotoImport2(version=0x%x, dstHddPath=%s, param=*0x%x, funcFinish=*0x%x, userdata=*0x%x)", version, dstHddPath, param, funcFinish, userdata); + cellPhotoImportUtil.todo("cellPhotoImport2(version=0x%x, dstHddPath=%s, " + "param=*0x%x, funcFinish=*0x%x, userdata=*0x%x)", + version, dstHddPath, param, funcFinish, userdata); - if (version != CELL_PHOTO_IMPORT_VERSION_CURRENT || !funcFinish || !param || !dstHddPath) + if (version != CELL_PHOTO_IMPORT_VERSION_CURRENT || !funcFinish || !param || + !dstHddPath) { return CELL_PHOTO_IMPORT_ERROR_PARAM; } diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellPngDec.cpp b/ps3fw/cellPngDec.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellPngDec.cpp rename to ps3fw/cellPngDec.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellPngEnc.cpp b/ps3fw/cellPngEnc.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellPngEnc.cpp rename to ps3fw/cellPngEnc.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellPrint.cpp b/ps3fw/cellPrint.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellPrint.cpp rename to ps3fw/cellPrint.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellRec.cpp b/ps3fw/cellRec.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellRec.cpp rename to ps3fw/cellRec.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellRemotePlay.cpp b/ps3fw/cellRemotePlay.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellRemotePlay.cpp rename to ps3fw/cellRemotePlay.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellResc.cpp b/ps3fw/cellResc.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellResc.cpp rename to ps3fw/cellResc.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellRtc.cpp b/ps3fw/cellRtc.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellRtc.cpp rename to ps3fw/cellRtc.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellRtcAlarm.cpp b/ps3fw/cellRtcAlarm.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellRtcAlarm.cpp rename to ps3fw/cellRtcAlarm.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellRudp.cpp b/ps3fw/cellRudp.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellRudp.cpp rename to ps3fw/cellRudp.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellSail.cpp b/ps3fw/cellSail.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellSail.cpp rename to ps3fw/cellSail.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellSailRec.cpp b/ps3fw/cellSailRec.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellSailRec.cpp rename to ps3fw/cellSailRec.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellSaveData.cpp b/ps3fw/cellSaveData.cpp similarity index 61% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellSaveData.cpp rename to ps3fw/cellSaveData.cpp index 40e5fe060..1937f84bc 100644 --- a/rpcs3/rpcs3/Emu/Cell/Modules/cellSaveData.cpp +++ b/ps3fw/cellSaveData.cpp @@ -1,29 +1,29 @@ -#include "stdafx.h" +#include "cellSysutil.h" +#include "cellUserInfo.h" +#include "Emu/Cell/PPUModule.h" +#include "Emu/Cell/lv2/sys_fs.h" +#include "Emu/Cell/lv2/sys_process.h" +#include "Emu/Cell/lv2/sys_sync.h" +#include "Emu/Cell/timers.hpp" +#include "Emu/IdManager.h" +#include "Emu/RSX/Overlays/overlay_message.h" #include "Emu/System.h" #include "Emu/VFS.h" -#include "Emu/IdManager.h" #include "Emu/localized_string.h" #include "Emu/savestate_utils.hpp" -#include "Emu/Cell/lv2/sys_fs.h" -#include "Emu/Cell/lv2/sys_sync.h" -#include "Emu/Cell/lv2/sys_process.h" -#include "Emu/Cell/PPUModule.h" -#include "Emu/Cell/timers.hpp" -#include "Emu/Cell/Modules/cellSysutil.h" -#include "Emu/Cell/Modules/cellUserInfo.h" -#include "Emu/RSX/Overlays/overlay_message.h" #include "Emu/system_config.h" +#include "stdafx.h" -#include "cellSaveData.h" #include "cellMsgDialog.h" +#include "cellSaveData.h" #include "Loader/PSF.h" -#include "Utilities/StrUtil.h" -#include "Utilities/date_time.h" -#include "Utilities/sema.h" +#include "util/StrUtil.h" +#include "util/date_time.h" +#include "util/sema.h" -#include #include +#include #include #include "util/asm.hpp" @@ -55,9 +55,7 @@ void fmt_class_string::format(std::string& out, u64 arg) }); } -SaveDialogBase::~SaveDialogBase() -{ -} +SaveDialogBase::~SaveDialogBase() {} std::string SaveDataEntry::date() const { @@ -129,7 +127,8 @@ struct savedata_manager atomic_t last_cbresult_error_dialog{0}; // CBRESULT errors are negative }; -int check_filename(std::string_view file_path, bool disallow_system_files, bool account_sfo_pfd) +int check_filename(std::string_view file_path, bool disallow_system_files, + bool account_sfo_pfd) { if (file_path.size() >= CELL_SAVEDATA_FILENAME_SIZE) { @@ -151,7 +150,9 @@ int check_filename(std::string_view file_path, bool disallow_system_files, bool return 70; } - if (file_path == "."sv || (!account_sfo_pfd && (file_path == "PARAM.SFO"sv || file_path == "PARAM.PFD"sv))) + if (file_path == "."sv || + (!account_sfo_pfd && + (file_path == "PARAM.SFO"sv || file_path == "PARAM.PFD"sv))) { // ****** sysutil savedata parameter error : 70 ****** return 70; @@ -174,10 +175,11 @@ int check_filename(std::string_view file_path, bool disallow_system_files, bool name[0] = '-'; } - if (disallow_system_files && ((dotpos >= 5u && std::memcmp(name, "PARAM", 5) == 0) || - (dotpos >= 4u && std::memcmp(name, "ICON", 4) == 0) || - (dotpos >= 3u && std::memcmp(name, "PIC", 3) == 0) || - (dotpos >= 3u && std::memcmp(name, "SND", 3) == 0))) + if (disallow_system_files && + ((dotpos >= 5u && std::memcmp(name, "PARAM", 5) == 0) || + (dotpos >= 4u && std::memcmp(name, "ICON", 4) == 0) || + (dotpos >= 3u && std::memcmp(name, "PIC", 3) == 0) || + (dotpos >= 3u && std::memcmp(name, "SND", 3) == 0))) { // ****** sysutil savedata parameter error : 70 ****** return 70; @@ -214,7 +216,8 @@ int check_filename(std::string_view file_path, bool disallow_system_files, bool return 0; } -static std::vector get_save_entries(const std::string& base_dir, const std::string& prefix) +static std::vector get_save_entries(const std::string& base_dir, + const std::string& prefix) { std::vector save_entries; @@ -226,7 +229,9 @@ static std::vector get_save_entries(const std::string& base_dir, // get the saves matching the supplied prefix for (auto&& entry : fs::dir(base_dir)) { - if (!entry.is_directory || sysutil_check_name_string(entry.name.c_str(), 1, CELL_SAVEDATA_DIRNAME_SIZE) != 0) + if (!entry.is_directory || + sysutil_check_name_string(entry.name.c_str(), 1, + CELL_SAVEDATA_DIRNAME_SIZE) != 0) { continue; } @@ -237,7 +242,8 @@ static std::vector get_save_entries(const std::string& base_dir, } // PSF parameters - const psf::registry psf = psf::load_object(base_dir + entry.name + "/PARAM.SFO"); + const psf::registry psf = + psf::load_object(base_dir + entry.name + "/PARAM.SFO"); if (psf.empty()) { @@ -253,7 +259,8 @@ static std::vector get_save_entries(const std::string& base_dir, for (const auto& entry2 : fs::dir(base_dir + entry.name)) { - if (entry2.is_directory || check_filename(vfs::unescape(entry2.name), false, true)) + if (entry2.is_directory || + check_filename(vfs::unescape(entry2.name), false, true)) { continue; } @@ -292,7 +299,8 @@ static error_code select_and_delete(ppu_thread& ppu) return CELL_SAVEDATA_ERROR_BUSY; } - const std::string base_dir = vfs::get(fmt::format("/dev_hdd0/home/%08u/savedata/", Emu.GetUsrId())); + const std::string base_dir = + vfs::get(fmt::format("/dev_hdd0/home/%08u/savedata/", Emu.GetUsrId())); auto save_entries = get_save_entries(base_dir, Emu.GetTitleID()); @@ -307,7 +315,9 @@ static error_code select_and_delete(ppu_thread& ppu) // Display a blocking Save Data List asynchronously in the GUI thread. if (auto save_dialog = Emu.GetCallbacks().get_save_dialog()) { - selected = save_dialog->ShowSaveDataList(base_dir, save_entries, focused, SAVEDATA_OP_LIST_DELETE, vm::null, g_fxo->get().enable_overlay); + selected = save_dialog->ShowSaveDataList( + base_dir, save_entries, focused, SAVEDATA_OP_LIST_DELETE, vm::null, + g_fxo->get().enable_overlay); } // Reschedule after a blocking dialog returns @@ -327,17 +337,24 @@ static error_code select_and_delete(ppu_thread& ppu) // Get information from the selected entry const SaveDataEntry& entry = ::at32(save_entries, selected); - const std::string info = entry.title + "\n" + entry.subtitle + "\n" + entry.details; + const std::string info = + entry.title + "\n" + entry.subtitle + "\n" + entry.details; // Reusable display message string - std::string msg = get_localized_string(localized_string_id::CELL_SAVEDATA_DELETE_CONFIRMATION, info.c_str()); + std::string msg = get_localized_string( + localized_string_id::CELL_SAVEDATA_DELETE_CONFIRMATION, info.c_str()); // Yield before a blocking dialog is being spawned lv2_obj::sleep(ppu); // Get user confirmation by opening a blocking dialog s32 return_code = CELL_MSGDIALOG_BUTTON_NONE; - error_code res = open_msg_dialog(true, CELL_MSGDIALOG_TYPE_SE_TYPE_NORMAL | CELL_MSGDIALOG_TYPE_BUTTON_TYPE_YESNO, vm::make_str(msg), msg_dialog_source::_cellSaveData, vm::null, vm::null, vm::null, &return_code); + error_code res = + open_msg_dialog(true, + CELL_MSGDIALOG_TYPE_SE_TYPE_NORMAL | + CELL_MSGDIALOG_TYPE_BUTTON_TYPE_YESNO, + vm::make_str(msg), msg_dialog_source::_cellSaveData, + vm::null, vm::null, vm::null, &return_code); // Reschedule after a blocking dialog returns if (ppu.check_state()) @@ -367,14 +384,20 @@ static error_code select_and_delete(ppu_thread& ppu) } // Update display message - msg = get_localized_string(localized_string_id::CELL_SAVEDATA_DELETE_SUCCESS, info.c_str()); + msg = get_localized_string( + localized_string_id::CELL_SAVEDATA_DELETE_SUCCESS, info.c_str()); cellSaveData.success("%s", msg); // Yield before blocking dialog is being spawned lv2_obj::sleep(ppu); - // Display success message by opening a blocking dialog (return value should be irrelevant here) - res = open_msg_dialog(true, CELL_MSGDIALOG_TYPE_SE_TYPE_NORMAL | CELL_MSGDIALOG_TYPE_BUTTON_TYPE_OK, vm::make_str(msg), msg_dialog_source::_cellSaveData); + // Display success message by opening a blocking dialog (return value + // should be irrelevant here) + res = + open_msg_dialog(true, + CELL_MSGDIALOG_TYPE_SE_TYPE_NORMAL | + CELL_MSGDIALOG_TYPE_BUTTON_TYPE_OK, + vm::make_str(msg), msg_dialog_source::_cellSaveData); // Reschedule after blocking dialog returns if (ppu.check_state()) @@ -388,7 +411,8 @@ static error_code select_and_delete(ppu_thread& ppu) } // Displays a CellSaveDataCBResult error message. -static error_code display_callback_result_error_message(ppu_thread& ppu, const CellSaveDataCBResult& result, u32 errDialog) +static error_code display_callback_result_error_message( + ppu_thread& ppu, const CellSaveDataCBResult& result, u32 errDialog) { std::string msg; bool use_invalid_message = false; @@ -396,7 +420,8 @@ static error_code display_callback_result_error_message(ppu_thread& ppu, const C switch (result.result) { case CELL_SAVEDATA_CBRESULT_ERR_NOSPACE: - msg = get_localized_string(localized_string_id::CELL_SAVEDATA_CB_NO_SPACE, fmt::format("%d", result.errNeedSizeKB).c_str()); + msg = get_localized_string(localized_string_id::CELL_SAVEDATA_CB_NO_SPACE, + fmt::format("%d", result.errNeedSizeKB).c_str()); break; case CELL_SAVEDATA_CBRESULT_ERR_FAILURE: msg = get_localized_string(localized_string_id::CELL_SAVEDATA_CB_FAILURE); @@ -417,17 +442,26 @@ static error_code display_callback_result_error_message(ppu_thread& ppu, const C } if (errDialog == CELL_SAVEDATA_ERRDIALOG_NONE || - (errDialog == CELL_SAVEDATA_ERRDIALOG_NOREPEAT && result.result == g_fxo->get().last_cbresult_error_dialog.exchange(result.result))) + (errDialog == CELL_SAVEDATA_ERRDIALOG_NOREPEAT && + result.result == + g_fxo->get().last_cbresult_error_dialog.exchange( + result.result))) { - // TODO: Find out if the "last error" is always tracked or only when NOREPEAT is set + // TODO: Find out if the "last error" is always tracked or only when + // NOREPEAT is set return CELL_SAVEDATA_ERROR_CBRESULT; } // Yield before a blocking dialog is being spawned lv2_obj::sleep(ppu); - // Get user confirmation by opening a blocking dialog (return value should be irrelevant here) - [[maybe_unused]] error_code res = open_msg_dialog(true, CELL_MSGDIALOG_TYPE_SE_TYPE_NORMAL | CELL_MSGDIALOG_TYPE_BUTTON_TYPE_OK, use_invalid_message ? result.invalidMsg : vm::make_str(msg), msg_dialog_source::_cellSaveData); + // Get user confirmation by opening a blocking dialog (return value should be + // irrelevant here) + [[maybe_unused]] error_code res = open_msg_dialog( + true, + CELL_MSGDIALOG_TYPE_SE_TYPE_NORMAL | CELL_MSGDIALOG_TYPE_BUTTON_TYPE_OK, + use_invalid_message ? result.invalidMsg : vm::make_str(msg), + msg_dialog_source::_cellSaveData); // Reschedule after a blocking dialog returns if (ppu.check_state()) @@ -438,29 +472,40 @@ static error_code display_callback_result_error_message(ppu_thread& ppu, const C return CELL_SAVEDATA_ERROR_CBRESULT; } -static std::string get_confirmation_message(u32 operation, const SaveDataEntry& entry) +static std::string get_confirmation_message(u32 operation, + const SaveDataEntry& entry) { - const std::string info = fmt::format("%s\n%s\n%s\n%s\n\n%s", entry.title, entry.subtitle, entry.date(), entry.data_size(), entry.details); + const std::string info = + fmt::format("%s\n%s\n%s\n%s\n\n%s", entry.title, entry.subtitle, + entry.date(), entry.data_size(), entry.details); - if (operation == SAVEDATA_OP_LIST_DELETE || operation == SAVEDATA_OP_FIXED_DELETE) + if (operation == SAVEDATA_OP_LIST_DELETE || + operation == SAVEDATA_OP_FIXED_DELETE) { - return get_localized_string(localized_string_id::CELL_SAVEDATA_DELETE, info.c_str()); + return get_localized_string(localized_string_id::CELL_SAVEDATA_DELETE, + info.c_str()); } - else if (operation == SAVEDATA_OP_LIST_LOAD || operation == SAVEDATA_OP_FIXED_LOAD) + else if (operation == SAVEDATA_OP_LIST_LOAD || + operation == SAVEDATA_OP_FIXED_LOAD) { - return get_localized_string(localized_string_id::CELL_SAVEDATA_LOAD, info.c_str()); + return get_localized_string(localized_string_id::CELL_SAVEDATA_LOAD, + info.c_str()); } - else if (operation == SAVEDATA_OP_LIST_SAVE || operation == SAVEDATA_OP_FIXED_SAVE) + else if (operation == SAVEDATA_OP_LIST_SAVE || + operation == SAVEDATA_OP_FIXED_SAVE) { - return get_localized_string(localized_string_id::CELL_SAVEDATA_OVERWRITE, info.c_str()); + return get_localized_string(localized_string_id::CELL_SAVEDATA_OVERWRITE, + info.c_str()); } return ""; } -static s32 savedata_check_args(u32 operation, u32 version, vm::cptr dirName, - u32 errDialog, PSetList setList, PSetBuf setBuf, PFuncList funcList, PFuncFixed funcFixed, PFuncStat funcStat, - PFuncFile funcFile, u32 /*container*/, u32 unk_op_flags, vm::ptr /*userdata*/, u32 userId, PFuncDone funcDone) +static s32 savedata_check_args( + u32 operation, u32 version, vm::cptr dirName, u32 errDialog, + PSetList setList, PSetBuf setBuf, PFuncList funcList, PFuncFixed funcFixed, + PFuncStat funcStat, PFuncFile funcFile, u32 /*container*/, u32 unk_op_flags, + vm::ptr /*userdata*/, u32 userId, PFuncDone funcDone) { if (version > CELL_SAVEDATA_VERSION_420) { @@ -474,7 +519,9 @@ static s32 savedata_check_args(u32 operation, u32 version, vm::cptr dirNam return 5; } - if (operation <= SAVEDATA_OP_AUTO_LOAD || operation == SAVEDATA_OP_FIXED_IMPORT || operation == SAVEDATA_OP_FIXED_EXPORT) + if (operation <= SAVEDATA_OP_AUTO_LOAD || + operation == SAVEDATA_OP_FIXED_IMPORT || + operation == SAVEDATA_OP_FIXED_EXPORT) { if (!dirName) { @@ -482,7 +529,8 @@ static s32 savedata_check_args(u32 operation, u32 version, vm::cptr dirNam return 2; } - switch (sysutil_check_name_string(dirName.get_ptr(), 1, CELL_SAVEDATA_DIRNAME_SIZE)) + switch (sysutil_check_name_string(dirName.get_ptr(), 1, + CELL_SAVEDATA_DIRNAME_SIZE)) { case -1: { @@ -494,14 +542,19 @@ static s32 savedata_check_args(u32 operation, u32 version, vm::cptr dirNam // ****** sysutil savedata parameter error : 4 ****** return 4; } - case 0: break; - default: fmt::throw_exception("Unreachable"); + case 0: + break; + default: + fmt::throw_exception("Unreachable"); } } - if ((operation >= SAVEDATA_OP_LIST_AUTO_SAVE && operation <= SAVEDATA_OP_FIXED_LOAD) || - operation == SAVEDATA_OP_LIST_IMPORT || operation == SAVEDATA_OP_LIST_EXPORT || - operation == SAVEDATA_OP_LIST_DELETE || operation == SAVEDATA_OP_FIXED_DELETE) + if ((operation >= SAVEDATA_OP_LIST_AUTO_SAVE && + operation <= SAVEDATA_OP_FIXED_LOAD) || + operation == SAVEDATA_OP_LIST_IMPORT || + operation == SAVEDATA_OP_LIST_EXPORT || + operation == SAVEDATA_OP_LIST_DELETE || + operation == SAVEDATA_OP_FIXED_DELETE) { if (!setList) { @@ -527,26 +580,33 @@ static s32 savedata_check_args(u32 operation, u32 version, vm::cptr dirNam return 15; } - if (!memchr(setList->dirNamePrefix.get_ptr(), '\0', CELL_SAVEDATA_PREFIX_SIZE) || (g_ps3_process_info.sdk_ver > 0x3FFFFF && !setList->dirNamePrefix[0])) + if (!memchr(setList->dirNamePrefix.get_ptr(), '\0', + CELL_SAVEDATA_PREFIX_SIZE) || + (g_ps3_process_info.sdk_ver > 0x3FFFFF && !setList->dirNamePrefix[0])) { // ****** sysutil savedata parameter error : 17 ****** return 17; } - const bool allow_asterisk = (operation == SAVEDATA_OP_LIST_DELETE); // TODO: SAVEDATA_OP_FIXED_DELETE ? + const bool allow_asterisk = + (operation == + SAVEDATA_OP_LIST_DELETE); // TODO: SAVEDATA_OP_FIXED_DELETE ? - if (!allow_asterisk || !(setList->dirNamePrefix[0] == '*' && setList->dirNamePrefix[1] == '\0')) + if (!allow_asterisk || !(setList->dirNamePrefix[0] == '*' && + setList->dirNamePrefix[1] == '\0')) { char cur, buf[CELL_SAVEDATA_DIRNAME_SIZE + 1]{}; - for (s32 pos = 0, posprefix = 0; cur = setList->dirNamePrefix[pos++], true;) + for (s32 pos = 0, posprefix = 0; + cur = setList->dirNamePrefix[pos++], true;) { if (cur == '\0' || cur == '|') { // Check prefix if not empty if (posprefix) { - switch (sysutil_check_name_string(buf, 1, CELL_SAVEDATA_DIRNAME_SIZE)) + switch ( + sysutil_check_name_string(buf, 1, CELL_SAVEDATA_DIRNAME_SIZE)) { case -1: { @@ -558,8 +618,10 @@ static s32 savedata_check_args(u32 operation, u32 version, vm::cptr dirNam // ****** sysutil savedata parameter error : 17 ****** return 17; } - case 0: break; - default: fmt::throw_exception("Unreachable"); + case 0: + break; + default: + fmt::throw_exception("Unreachable"); } } @@ -590,7 +652,8 @@ static s32 savedata_check_args(u32 operation, u32 version, vm::cptr dirNam } } - if (operation >= SAVEDATA_OP_LIST_IMPORT && operation <= SAVEDATA_OP_FIXED_EXPORT) + if (operation >= SAVEDATA_OP_LIST_IMPORT && + operation <= SAVEDATA_OP_FIXED_EXPORT) { if (!funcDone || userId > CELL_SYSUTIL_USERID_MAX) { @@ -598,7 +661,8 @@ static s32 savedata_check_args(u32 operation, u32 version, vm::cptr dirNam return 137; } - // There are no more parameters to check for the import and export functions. + // There are no more parameters to check for the import and export + // functions. return CELL_OK; } @@ -608,7 +672,10 @@ static s32 savedata_check_args(u32 operation, u32 version, vm::cptr dirNam return 74; } - if ((operation >= SAVEDATA_OP_LIST_AUTO_SAVE && operation <= SAVEDATA_OP_FIXED_LOAD) || operation == SAVEDATA_OP_LIST_DELETE || operation == SAVEDATA_OP_FIXED_DELETE) + if ((operation >= SAVEDATA_OP_LIST_AUTO_SAVE && + operation <= SAVEDATA_OP_FIXED_LOAD) || + operation == SAVEDATA_OP_LIST_DELETE || + operation == SAVEDATA_OP_FIXED_DELETE) { if (setBuf->dirListMax > CELL_SAVEDATA_DIRLIST_MAX) { @@ -627,7 +694,8 @@ static s32 savedata_check_args(u32 operation, u32 version, vm::cptr dirNam CHECK_SIZE(CellSaveDataFileStat, 56); - if (operation == SAVEDATA_OP_LIST_DELETE || operation == SAVEDATA_OP_FIXED_DELETE) + if (operation == SAVEDATA_OP_LIST_DELETE || + operation == SAVEDATA_OP_FIXED_DELETE) { if (setBuf->fileListMax != 0u) { @@ -635,7 +703,8 @@ static s32 savedata_check_args(u32 operation, u32 version, vm::cptr dirNam return 9; } } - else if (setBuf->fileListMax * sizeof(CellSaveDataFileStat) > setBuf->bufSize) + else if (setBuf->fileListMax * sizeof(CellSaveDataFileStat) > + setBuf->bufSize) { // ****** sysutil savedata parameter error : 7 ****** return 7; @@ -656,23 +725,33 @@ static s32 savedata_check_args(u32 operation, u32 version, vm::cptr dirNam } } - if ((operation == SAVEDATA_OP_LIST_SAVE || operation == SAVEDATA_OP_LIST_LOAD || operation == SAVEDATA_OP_LIST_DELETE) && !funcList) + if ((operation == SAVEDATA_OP_LIST_SAVE || + operation == SAVEDATA_OP_LIST_LOAD || + operation == SAVEDATA_OP_LIST_DELETE) && + !funcList) { // ****** sysutil savedata parameter error : 18 ****** return 18; } - if ((operation == SAVEDATA_OP_FIXED_SAVE || operation == SAVEDATA_OP_FIXED_LOAD || - operation == SAVEDATA_OP_LIST_AUTO_LOAD || operation == SAVEDATA_OP_LIST_AUTO_SAVE || operation == SAVEDATA_OP_FIXED_DELETE) && + if ((operation == SAVEDATA_OP_FIXED_SAVE || + operation == SAVEDATA_OP_FIXED_LOAD || + operation == SAVEDATA_OP_LIST_AUTO_LOAD || + operation == SAVEDATA_OP_LIST_AUTO_SAVE || + operation == SAVEDATA_OP_FIXED_DELETE) && !funcFixed) { // ****** sysutil savedata parameter error : 19 ****** return 19; } - // NOTE: funcStat and funcFile are not present in the delete functions. unk_op_flags is 0x2 for SAVEDATA_OP_FIXED_DELETE, but I added the redundant check anyway for clarity. - if (operation != SAVEDATA_OP_LIST_DELETE && operation != SAVEDATA_OP_FIXED_DELETE && - (!(unk_op_flags & 0x2) || operation == SAVEDATA_OP_AUTO_SAVE || operation == SAVEDATA_OP_AUTO_LOAD)) + // NOTE: funcStat and funcFile are not present in the delete functions. + // unk_op_flags is 0x2 for SAVEDATA_OP_FIXED_DELETE, but I added the redundant + // check anyway for clarity. + if (operation != SAVEDATA_OP_LIST_DELETE && + operation != SAVEDATA_OP_FIXED_DELETE && + (!(unk_op_flags & 0x2) || operation == SAVEDATA_OP_AUTO_SAVE || + operation == SAVEDATA_OP_AUTO_LOAD)) { if (!funcStat) { @@ -696,18 +775,27 @@ static s32 savedata_check_args(u32 operation, u32 version, vm::cptr dirNam return CELL_OK; } -static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 version, vm::cptr dirName, - u32 errDialog, PSetList setList, PSetBuf setBuf, PFuncList funcList, PFuncFixed funcFixed, PFuncStat funcStat, - PFuncFile funcFile, u32 container, u32 unk_op_flags /*TODO*/, vm::ptr userdata, u32 userId, PFuncDone funcDone) +static NEVER_INLINE error_code +savedata_op(ppu_thread& ppu, u32 operation, u32 version, vm::cptr dirName, + u32 errDialog, PSetList setList, PSetBuf setBuf, PFuncList funcList, + PFuncFixed funcFixed, PFuncStat funcStat, PFuncFile funcFile, + u32 container, u32 unk_op_flags /*TODO*/, vm::ptr userdata, + u32 userId, PFuncDone funcDone) { if (const auto& [ok, list] = setList.try_read(); ok) - cellSaveData.notice("savedata_op(): setList = { .sortType=%d, .sortOrder=%d, .dirNamePrefix='%s' }", list.sortType, list.sortOrder, list.dirNamePrefix); + cellSaveData.notice("savedata_op(): setList = { .sortType=%d, " + ".sortOrder=%d, .dirNamePrefix='%s' }", + list.sortType, list.sortOrder, list.dirNamePrefix); if (const auto& [ok, buf] = setBuf.try_read(); ok) - cellSaveData.notice("savedata_op(): setBuf = { .dirListMax=%d, .fileListMax=%d, .bufSize=%d }", buf.dirListMax, buf.fileListMax, buf.bufSize); + cellSaveData.notice("savedata_op(): setBuf = { .dirListMax=%d, " + ".fileListMax=%d, .bufSize=%d }", + buf.dirListMax, buf.fileListMax, buf.bufSize); - if (const auto ecode = savedata_check_args(operation, version, dirName, errDialog, setList, setBuf, funcList, funcFixed, funcStat, - funcFile, container, unk_op_flags, userdata, userId, funcDone)) + if (const auto ecode = savedata_check_args( + operation, version, dirName, errDialog, setList, setBuf, funcList, + funcFixed, funcStat, funcFile, container, unk_op_flags, userdata, + userId, funcDone)) { return {CELL_SAVEDATA_ERROR_PARAM, " (error %d)", ecode}; } @@ -739,26 +827,37 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v std::memset(g_savedata_context.get_ptr(), 0, g_savedata_context.size()); - vm::ptr result = g_savedata_context.ptr(&savedata_context::result); - vm::ptr listGet = g_savedata_context.ptr(&savedata_context::listGet); - vm::ptr listSet = g_savedata_context.ptr(&savedata_context::listSet); - vm::ptr fixedSet = g_savedata_context.ptr(&savedata_context::fixedSet); - vm::ptr statGet = g_savedata_context.ptr(&savedata_context::statGet); - vm::ptr statSet = g_savedata_context.ptr(&savedata_context::statSet); - vm::ptr fileGet = g_savedata_context.ptr(&savedata_context::fileGet); - vm::ptr fileSet = g_savedata_context.ptr(&savedata_context::fileSet); - vm::ptr doneGet = g_savedata_context.ptr(&savedata_context::doneGet); + vm::ptr result = + g_savedata_context.ptr(&savedata_context::result); + vm::ptr listGet = + g_savedata_context.ptr(&savedata_context::listGet); + vm::ptr listSet = + g_savedata_context.ptr(&savedata_context::listSet); + vm::ptr fixedSet = + g_savedata_context.ptr(&savedata_context::fixedSet); + vm::ptr statGet = + g_savedata_context.ptr(&savedata_context::statGet); + vm::ptr statSet = + g_savedata_context.ptr(&savedata_context::statSet); + vm::ptr fileGet = + g_savedata_context.ptr(&savedata_context::fileGet); + vm::ptr fileSet = + g_savedata_context.ptr(&savedata_context::fileSet); + vm::ptr doneGet = + g_savedata_context.ptr(&savedata_context::doneGet); // userId(0) = CELL_SYSUTIL_USERID_CURRENT; // path of the specified user (00000001 by default) - const std::string base_dir = vfs::get(fmt::format("/dev_hdd0/home/%08u/savedata/", userId ? userId : Emu.GetUsrId())); + const std::string base_dir = vfs::get(fmt::format( + "/dev_hdd0/home/%08u/savedata/", userId ? userId : Emu.GetUsrId())); if (userId && !fs::is_dir(base_dir)) { return CELL_SAVEDATA_ERROR_NOUSER; } - result->userdata = userdata; // probably should be assigned only once (allows the callback to change it) + result->userdata = userdata; // probably should be assigned only once (allows + // the callback to change it) SaveDataEntry save_entry{}; @@ -771,29 +870,44 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v listGet->dirList.set(setBuf->buf.addr()); std::memset(listGet->reserved, 0, sizeof(listGet->reserved)); - std::vector prefix_list = fmt::split(setList->dirNamePrefix.get_ptr(), {"|"}); + std::vector prefix_list = + fmt::split(setList->dirNamePrefix.get_ptr(), {"|"}); // if prefix_list is empty game wants to check all savedata - if (prefix_list.empty() && (operation == SAVEDATA_OP_LIST_LOAD || operation == SAVEDATA_OP_FIXED_LOAD)) + if (prefix_list.empty() && (operation == SAVEDATA_OP_LIST_LOAD || + operation == SAVEDATA_OP_FIXED_LOAD)) { - cellSaveData.notice("savedata_op(): dirNamePrefix is empty. Listing all entries. operation=%d", operation); + cellSaveData.notice("savedata_op(): dirNamePrefix is empty. Listing all " + "entries. operation=%d", + operation); prefix_list = {""}; } - // if prefix_list only contains an asterisk the game wants to check all savedata - const bool allow_asterisk = (operation == SAVEDATA_OP_LIST_DELETE); // TODO: SAVEDATA_OP_FIXED_DELETE ? - if (allow_asterisk && prefix_list.size() == 1 && prefix_list.front() == "*") + // if prefix_list only contains an asterisk the game wants to check all + // savedata + const bool allow_asterisk = + (operation == + SAVEDATA_OP_LIST_DELETE); // TODO: SAVEDATA_OP_FIXED_DELETE ? + if (allow_asterisk && prefix_list.size() == 1 && + prefix_list.front() == "*") { - cellSaveData.notice("savedata_op(): dirNamePrefix is '*'. Listing all entries starting with '%s'. operation=%d", Emu.GetTitleID(), operation); - prefix_list.front() = Emu.GetTitleID(); // TODO: Let's be cautious for now and only list savedata starting with this game's ID + cellSaveData.notice("savedata_op(): dirNamePrefix is '*'. Listing all " + "entries starting with '%s'. operation=%d", + Emu.GetTitleID(), operation); + prefix_list.front() = + Emu.GetTitleID(); // TODO: Let's be cautious for now and only list + // savedata starting with this game's ID - // prefix_list.front().clear(); // List savedata of all the games of this user + // prefix_list.front().clear(); // List savedata of all the games of this + // user } // get the saves matching the supplied prefix for (auto&& entry : fs::dir(base_dir)) { - if (!entry.is_directory || sysutil_check_name_string(entry.name.c_str(), 1, CELL_SAVEDATA_DIRNAME_SIZE) != 0) + if (!entry.is_directory || + sysutil_check_name_string(entry.name.c_str(), 1, + CELL_SAVEDATA_DIRNAME_SIZE) != 0) { continue; } @@ -805,7 +919,8 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v // Count the amount of matches and the amount of listed directories if (!listGet->dirNum++) // total number of directories { - // Clear buf exactly to bufSize only if dirNum becomes non-zero (regardless of dirListNum) + // Clear buf exactly to bufSize only if dirNum becomes non-zero + // (regardless of dirListNum) std::memset(setBuf->buf.get_ptr(), 0, setBuf->bufSize); } @@ -814,7 +929,8 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v listGet->dirListNum++; // number of directories in list // PSF parameters - const psf::registry psf = psf::load_object(base_dir + entry.name + "/PARAM.SFO"); + const psf::registry psf = + psf::load_object(base_dir + entry.name + "/PARAM.SFO"); if (psf.empty()) { @@ -830,7 +946,8 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v for (const auto& entry2 : fs::dir(base_dir + entry.name)) { - if (entry2.is_directory || check_filename(vfs::unescape(entry2.name), false, true)) + if (entry2.is_directory || + check_filename(vfs::unescape(entry2.name), false, true)) { continue; } @@ -859,21 +976,26 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v const u32 order = setList->sortOrder; const u32 type = setList->sortType; - std::sort(save_entries.begin(), save_entries.end(), [=](const SaveDataEntry& entry1, const SaveDataEntry& entry2) + std::sort(save_entries.begin(), save_entries.end(), + [=](const SaveDataEntry& entry1, const SaveDataEntry& entry2) { - if (order == CELL_SAVEDATA_SORTORDER_DESCENT && type == CELL_SAVEDATA_SORTTYPE_MODIFIEDTIME) + if (order == CELL_SAVEDATA_SORTORDER_DESCENT && + type == CELL_SAVEDATA_SORTTYPE_MODIFIEDTIME) { return entry1.mtime >= entry2.mtime; } - if (order == CELL_SAVEDATA_SORTORDER_DESCENT && type == CELL_SAVEDATA_SORTTYPE_SUBTITLE) + if (order == CELL_SAVEDATA_SORTORDER_DESCENT && + type == CELL_SAVEDATA_SORTTYPE_SUBTITLE) { return entry1.subtitle >= entry2.subtitle; } - if (order == CELL_SAVEDATA_SORTORDER_ASCENT && type == CELL_SAVEDATA_SORTTYPE_MODIFIEDTIME) + if (order == CELL_SAVEDATA_SORTORDER_ASCENT && + type == CELL_SAVEDATA_SORTTYPE_MODIFIEDTIME) { return entry1.mtime < entry2.mtime; } - if (order == CELL_SAVEDATA_SORTORDER_ASCENT && type == CELL_SAVEDATA_SORTTYPE_SUBTITLE) + if (order == CELL_SAVEDATA_SORTORDER_ASCENT && + type == CELL_SAVEDATA_SORTTYPE_SUBTITLE) { return entry1.subtitle < entry2.subtitle; } @@ -899,19 +1021,24 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v { listSet->focusPosition = CELL_SAVEDATA_FOCUSPOS_LISTHEAD; - std::memset(result.get_ptr(), 0, ::offset32(&CellSaveDataCBResult::userdata)); + std::memset(result.get_ptr(), 0, + ::offset32(&CellSaveDataCBResult::userdata)); // List Callback funcList(ppu, result, listGet, listSet); - if (const s32 res = result->result; res != CELL_SAVEDATA_CBRESULT_OK_NEXT) + if (const s32 res = result->result; + res != CELL_SAVEDATA_CBRESULT_OK_NEXT) { - cellSaveData.warning("savedata_op(): funcList returned result=%d.", result->result); + cellSaveData.warning("savedata_op(): funcList returned result=%d.", + result->result); // if the callback has returned ok, lets return OK. // typically used at game launch when no list is actually required. - // CELL_SAVEDATA_CBRESULT_OK_LAST_NOCONFIRM is only valid for funcFile and funcDone - if (result->result == CELL_SAVEDATA_CBRESULT_OK_LAST || result->result == CELL_SAVEDATA_CBRESULT_OK_LAST_NOCONFIRM) + // CELL_SAVEDATA_CBRESULT_OK_LAST_NOCONFIRM is only valid for funcFile + // and funcDone + if (result->result == CELL_SAVEDATA_CBRESULT_OK_LAST || + result->result == CELL_SAVEDATA_CBRESULT_OK_LAST_NOCONFIRM) { return CELL_OK; } @@ -922,7 +1049,8 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v if (listSet->fixedListNum > CELL_SAVEDATA_LISTITEM_MAX) { // ****** sysutil savedata parameter error : 38 ****** - return {CELL_SAVEDATA_ERROR_PARAM, "38 (fixedListNum=%d)", listSet->fixedListNum}; + return {CELL_SAVEDATA_ERROR_PARAM, "38 (fixedListNum=%d)", + listSet->fixedListNum}; } if (listSet->fixedListNum && !listSet->fixedList) @@ -939,7 +1067,8 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v for (u32 i = 0; i < listSet->fixedListNum; i++) { - switch (sysutil_check_name_string(listSet->fixedList[i].dirName, 1, CELL_SAVEDATA_DIRNAME_SIZE)) + switch (sysutil_check_name_string(listSet->fixedList[i].dirName, 1, + CELL_SAVEDATA_DIRNAME_SIZE)) { case -1: { @@ -956,18 +1085,22 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v break; } - case 0: break; - default: fmt::throw_exception("Unreachable"); + case 0: + break; + default: + fmt::throw_exception("Unreachable"); } selected_list.emplace(listSet->fixedList[i].dirName); } // Clean save data list - save_entries.erase(std::remove_if(save_entries.begin(), save_entries.end(), [&selected_list](const SaveDataEntry& entry) -> bool - { - return selected_list.count(entry.dirName) == 0; - }), + save_entries.erase( + std::remove_if(save_entries.begin(), save_entries.end(), + [&selected_list](const SaveDataEntry& entry) -> bool + { + return selected_list.count(entry.dirName) == 0; + }), save_entries.end()); if (listSet->newData) @@ -980,7 +1113,8 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v default: { // ****** sysutil savedata parameter error : 43 ****** - return {CELL_SAVEDATA_ERROR_PARAM, "43 (iconPosition=0x%x)", listSet->newData->iconPosition}; + return {CELL_SAVEDATA_ERROR_PARAM, "43 (iconPosition=0x%x)", + listSet->newData->iconPosition}; } } @@ -990,7 +1124,8 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v return {CELL_SAVEDATA_ERROR_PARAM, "44"}; } - switch (sysutil_check_name_string(listSet->newData->dirName.get_ptr(), 1, CELL_SAVEDATA_DIRNAME_SIZE)) + switch (sysutil_check_name_string(listSet->newData->dirName.get_ptr(), + 1, CELL_SAVEDATA_DIRNAME_SIZE)) { case -1: { @@ -1007,8 +1142,10 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v break; } - case 0: break; - default: fmt::throw_exception("Unreachable"); + case 0: + break; + default: + fmt::throw_exception("Unreachable"); } } @@ -1022,7 +1159,8 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v return {CELL_SAVEDATA_ERROR_PARAM, "35"}; } - switch (sysutil_check_name_string(listSet->focusDirName.get_ptr(), 1, CELL_SAVEDATA_DIRNAME_SIZE)) + switch (sysutil_check_name_string(listSet->focusDirName.get_ptr(), 1, + CELL_SAVEDATA_DIRNAME_SIZE)) { case -1: { @@ -1039,8 +1177,10 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v break; } - case 0: break; - default: fmt::throw_exception("Unreachable"); + case 0: + break; + default: + fmt::throw_exception("Unreachable"); } const std::string dirStr = listSet->focusDirName.get_ptr(); @@ -1101,7 +1241,8 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v if (!listSet->newData) { // ****** sysutil savedata parameter error : 34 ****** - cellSaveData.error("savedata_op(): listSet->newData is null while listSet->focusPosition is NEWDATA"); + cellSaveData.error("savedata_op(): listSet->newData is null while " + "listSet->focusPosition is NEWDATA"); return {CELL_SAVEDATA_ERROR_PARAM, "34"}; } @@ -1118,7 +1259,8 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v default: { // ****** sysutil savedata parameter error : 34 ****** - cellSaveData.error("savedata_op(): unknown listSet->focusPosition (0x%x)", pos_type); + cellSaveData.error( + "savedata_op(): unknown listSet->focusPosition (0x%x)", pos_type); return {CELL_SAVEDATA_ERROR_PARAM, "34"}; } } @@ -1127,12 +1269,15 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v auto delete_save = [&]() { strcpy_trunc(doneGet->dirName, save_entries[selected].dirName); - doneGet->hddFreeSizeKB = 40 * 1024 * 1024 - 256; // Read explanation in cellHddGameCheck + doneGet->hddFreeSizeKB = + 40 * 1024 * 1024 - 256; // Read explanation in cellHddGameCheck doneGet->excResult = CELL_OK; std::memset(doneGet->reserved, 0, sizeof(doneGet->reserved)); - const std::string old_path = base_dir + ".backup_" + save_entries[selected].escaped + "/"; - const std::string del_path = base_dir + save_entries[selected].escaped + "/"; + const std::string old_path = + base_dir + ".backup_" + save_entries[selected].escaped + "/"; + const std::string del_path = + base_dir + save_entries[selected].escaped + "/"; const fs::dir _dir(del_path); u64 size_bytes = 0; @@ -1155,7 +1300,8 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v // Remove savedata by renaming if (!vfs::host::rename(del_path, old_path, &g_mp_sys_dev_hdd0, false)) { - fmt::throw_exception("Failed to move directory %s (%s)", del_path, fs::g_tls_error); + fmt::throw_exception("Failed to move directory %s (%s)", del_path, + fs::g_tls_error); } // Cleanup @@ -1166,12 +1312,14 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v doneGet->excResult = CELL_SAVEDATA_ERROR_NODATA; } - std::memset(result.get_ptr(), 0, ::offset32(&CellSaveDataCBResult::userdata)); + std::memset(result.get_ptr(), 0, + ::offset32(&CellSaveDataCBResult::userdata)); if (!funcDone) { // TODO: return CELL_SAVEDATA_ERROR_PARAM at the correct location - fmt::throw_exception("cellSaveData: funcDone is nullptr. operation=%d", operation); + fmt::throw_exception("cellSaveData: funcDone is nullptr. operation=%d", + operation); } funcDone(ppu, result, doneGet); @@ -1185,7 +1333,9 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v // Display a blocking Save Data List asynchronously in the GUI thread. if (auto save_dialog = Emu.GetCallbacks().get_save_dialog()) { - selected = save_dialog->ShowSaveDataList(base_dir, save_entries, focused, operation, listSet, g_fxo->get().enable_overlay); + selected = save_dialog->ShowSaveDataList( + base_dir, save_entries, focused, operation, listSet, + g_fxo->get().enable_overlay); } else { @@ -1209,14 +1359,16 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v // UI returns -1 for new save games if (selected == -1) { - message = get_localized_string(localized_string_id::CELL_SAVEDATA_SAVE_CONFIRMATION); + message = get_localized_string( + localized_string_id::CELL_SAVEDATA_SAVE_CONFIRMATION); save_entry.dirName = listSet->newData->dirName.get_ptr(); save_entry.escaped = vfs::escape(save_entry.dirName); } else { // Get information from the selected entry - message = get_confirmation_message(operation, ::at32(save_entries, selected)); + message = + get_confirmation_message(operation, ::at32(save_entries, selected)); } // Yield before a blocking dialog is being spawned @@ -1224,7 +1376,12 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v // Get user confirmation by opening a blocking dialog s32 return_code = CELL_MSGDIALOG_BUTTON_NONE; - error_code res = open_msg_dialog(true, CELL_MSGDIALOG_TYPE_SE_TYPE_NORMAL | CELL_MSGDIALOG_TYPE_BUTTON_TYPE_YESNO, vm::make_str(message), msg_dialog_source::_cellSaveData, vm::null, vm::null, vm::null, &return_code); + error_code res = open_msg_dialog( + true, + CELL_MSGDIALOG_TYPE_SE_TYPE_NORMAL | + CELL_MSGDIALOG_TYPE_BUTTON_TYPE_YESNO, + vm::make_str(message), msg_dialog_source::_cellSaveData, vm::null, + vm::null, vm::null, &return_code); // Reschedule after a blocking dialog returns if (ppu.check_state()) @@ -1250,11 +1407,14 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v { delete_save(); - if (const s32 res = result->result; res != CELL_SAVEDATA_CBRESULT_OK_NEXT) + if (const s32 res = result->result; + res != CELL_SAVEDATA_CBRESULT_OK_NEXT) { - cellSaveData.warning("savedata_op(): funcDone returned result=%d.", res); + cellSaveData.warning("savedata_op(): funcDone returned result=%d.", + res); - if (res == CELL_SAVEDATA_CBRESULT_OK_LAST || res == CELL_SAVEDATA_CBRESULT_OK_LAST_NOCONFIRM) + if (res == CELL_SAVEDATA_CBRESULT_OK_LAST || + res == CELL_SAVEDATA_CBRESULT_OK_LAST_NOCONFIRM) { return CELL_OK; } @@ -1276,14 +1436,17 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v { lv2_sleep(ppu, 250); - std::memset(result.get_ptr(), 0, ::offset32(&CellSaveDataCBResult::userdata)); + std::memset(result.get_ptr(), 0, + ::offset32(&CellSaveDataCBResult::userdata)); // Fixed Callback funcFixed(ppu, result, listGet, fixedSet); - if (const s32 res = result->result; res != CELL_SAVEDATA_CBRESULT_OK_NEXT) + if (const s32 res = result->result; + res != CELL_SAVEDATA_CBRESULT_OK_NEXT) { - cellSaveData.warning("savedata_op(): funcFixed returned result=%d.", res); + cellSaveData.warning("savedata_op(): funcFixed returned result=%d.", + res); // skip all following steps if OK_LAST (NOCONFIRM is not allowed) if (res == CELL_SAVEDATA_CBRESULT_OK_LAST) @@ -1300,7 +1463,8 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v return {CELL_SAVEDATA_ERROR_PARAM, "26"}; } - switch (sysutil_check_name_string(fixedSet->dirName.get_ptr(), 1, CELL_SAVEDATA_DIRNAME_SIZE)) + switch (sysutil_check_name_string(fixedSet->dirName.get_ptr(), 1, + CELL_SAVEDATA_DIRNAME_SIZE)) { case -1: { @@ -1312,8 +1476,10 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v // ****** sysutil savedata parameter error : 28 ****** return {CELL_SAVEDATA_ERROR_PARAM, "28"}; } - case 0: break; - default: fmt::throw_exception("Unreachable"); + case 0: + break; + default: + fmt::throw_exception("Unreachable"); } const std::string dirStr = fixedSet->dirName.get_ptr(); @@ -1331,7 +1497,9 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v { case CELL_SAVEDATA_OPTION_NONE: { - if (operation != SAVEDATA_OP_FIXED_SAVE && operation != SAVEDATA_OP_FIXED_LOAD && operation != SAVEDATA_OP_FIXED_DELETE) + if (operation != SAVEDATA_OP_FIXED_SAVE && + operation != SAVEDATA_OP_FIXED_LOAD && + operation != SAVEDATA_OP_FIXED_DELETE) { lv2_sleep(ppu, 30000); break; @@ -1341,12 +1509,14 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v if (selected == -1) { - message = get_localized_string(localized_string_id::CELL_SAVEDATA_SAVE_CONFIRMATION); + message = get_localized_string( + localized_string_id::CELL_SAVEDATA_SAVE_CONFIRMATION); } else { // Get information from the selected entry - message = get_confirmation_message(operation, ::at32(save_entries, selected)); + message = get_confirmation_message(operation, + ::at32(save_entries, selected)); } // Yield before a blocking dialog is being spawned @@ -1355,7 +1525,12 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v // Get user confirmation by opening a blocking dialog // TODO: show fixedSet->newIcon s32 return_code = CELL_MSGDIALOG_BUTTON_NONE; - error_code res = open_msg_dialog(true, CELL_MSGDIALOG_TYPE_SE_TYPE_NORMAL | CELL_MSGDIALOG_TYPE_BUTTON_TYPE_YESNO, vm::make_str(message), msg_dialog_source::_cellSaveData, vm::null, vm::null, vm::null, &return_code); + error_code res = open_msg_dialog( + true, + CELL_MSGDIALOG_TYPE_SE_TYPE_NORMAL | + CELL_MSGDIALOG_TYPE_BUTTON_TYPE_YESNO, + vm::make_str(message), msg_dialog_source::_cellSaveData, vm::null, + vm::null, vm::null, &return_code); // Reschedule after a blocking dialog returns if (ppu.check_state()) @@ -1381,7 +1556,8 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v default: // ****** sysutil savedata parameter error : 81 ****** - return {CELL_SAVEDATA_ERROR_PARAM, "81 (option=0x%x)", fixedSet->option}; + return {CELL_SAVEDATA_ERROR_PARAM, "81 (option=0x%x)", + fixedSet->option}; } if (selected == -1) @@ -1394,11 +1570,14 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v { delete_save(); - if (const s32 res = result->result; res != CELL_SAVEDATA_CBRESULT_OK_NEXT) + if (const s32 res = result->result; + res != CELL_SAVEDATA_CBRESULT_OK_NEXT) { - cellSaveData.warning("savedata_op(): funcDone returned result=%d.", res); + cellSaveData.warning("savedata_op(): funcDone returned result=%d.", + res); - if (res == CELL_SAVEDATA_CBRESULT_OK_LAST || res == CELL_SAVEDATA_CBRESULT_OK_LAST_NOCONFIRM) + if (res == CELL_SAVEDATA_CBRESULT_OK_LAST || + res == CELL_SAVEDATA_CBRESULT_OK_LAST_NOCONFIRM) { return CELL_OK; } @@ -1438,7 +1617,8 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v const std::string dir_path = base_dir + save_entry.escaped + "/"; const std::string old_path = base_dir + ".backup_" + save_entry.escaped + "/"; - const std::string new_path = base_dir + ".working_" + save_entry.escaped + "/"; + const std::string new_path = + base_dir + ".working_" + save_entry.escaped + "/"; psf::registry psf = psf::load_object(dir_path + "PARAM.SFO"); bool has_modified = false; @@ -1448,7 +1628,8 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v ppu.state += cpu_flag::wait; // Check if RPCS3_BLIST section exist in PARAM.SFO - // This section contains the list of files in the save ordered as they would be in BSD filesystem + // This section contains the list of files in the save ordered as they would + // be in BSD filesystem std::vector blist; if (const auto it = psf.find("RPCS3_BLIST"); it != psf.cend()) @@ -1468,7 +1649,8 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v // funcStat is called even if the directory doesn't exist. } - statGet->hddFreeSizeKB = 40 * 1024 * 1024 - 256; // Read explanation in cellHddGameCheck + statGet->hddFreeSizeKB = + 40 * 1024 * 1024 - 256; // Read explanation in cellHddGameCheck statGet->isNewData = save_entry.isNew = psf.empty(); statGet->dir.atime = save_entry.atime = dir_info.atime; @@ -1478,12 +1660,18 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v if (!psf.empty()) { - statGet->getParam.parental_level = psf::get_integer(psf, "PARENTAL_LEVEL"); + statGet->getParam.parental_level = + psf::get_integer(psf, "PARENTAL_LEVEL"); statGet->getParam.attribute = psf::get_integer(psf, "ATTRIBUTE"); // ??? - strcpy_trunc(statGet->getParam.title, save_entry.title = psf::get_string(psf, "TITLE")); - strcpy_trunc(statGet->getParam.subTitle, save_entry.subtitle = psf::get_string(psf, "SUB_TITLE")); - strcpy_trunc(statGet->getParam.detail, save_entry.details = psf::get_string(psf, "DETAIL")); - strcpy_trunc(statGet->getParam.listParam, save_entry.listParam = psf::get_string(psf, "SAVEDATA_LIST_PARAM")); + strcpy_trunc(statGet->getParam.title, + save_entry.title = psf::get_string(psf, "TITLE")); + strcpy_trunc(statGet->getParam.subTitle, + save_entry.subtitle = psf::get_string(psf, "SUB_TITLE")); + strcpy_trunc(statGet->getParam.detail, + save_entry.details = psf::get_string(psf, "DETAIL")); + strcpy_trunc(statGet->getParam.listParam, + save_entry.listParam = + psf::get_string(psf, "SAVEDATA_LIST_PARAM")); } statGet->bind = 0; @@ -1540,7 +1728,8 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v { statGet->fileNum++; - size_bytes += utils::align(entry.size, 1024); // firmware rounds this value up + size_bytes += + utils::align(entry.size, 1024); // firmware rounds this value up if (statGet->fileListNum >= setBuf->fileListMax) continue; @@ -1571,7 +1760,10 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v { file.fileType = CELL_SAVEDATA_FILETYPE_CONTENT_SND0; } - else if (psf::get_integer(psf, "*" + entry.name)) // let's put the list of protected files in PARAM.SFO (int param = 1 if protected) + else if (psf::get_integer( + psf, "*" + entry.name)) // let's put the list of + // protected files in PARAM.SFO + // (int param = 1 if protected) { file.fileType = CELL_SAVEDATA_FILETYPE_SECUREFILE; } @@ -1582,10 +1774,13 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v } } - statGet->sysSizeKB = 35; // always reported as 35 regardless of actual file sizes - statGet->sizeKB = !save_entry.isNew ? ::narrow((size_bytes / 1024) + statGet->sysSizeKB) : 0; + statGet->sysSizeKB = + 35; // always reported as 35 regardless of actual file sizes + statGet->sizeKB = + !save_entry.isNew ? ::narrow((size_bytes / 1024) + statGet->sysSizeKB) : 0; - std::memset(result.get_ptr(), 0, ::offset32(&CellSaveDataCBResult::userdata)); + std::memset(result.get_ptr(), 0, + ::offset32(&CellSaveDataCBResult::userdata)); // Stat Callback funcStat(ppu, result, statGet, statSet); @@ -1609,37 +1804,45 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v if (statSet->setParam->attribute > CELL_SAVEDATA_ATTR_NODUPLICATE) { // ****** sysutil savedata parameter error : 57 ****** - return {CELL_SAVEDATA_ERROR_PARAM, "57 (attribute=0x%x)", statSet->setParam->attribute}; + return {CELL_SAVEDATA_ERROR_PARAM, "57 (attribute=0x%x)", + statSet->setParam->attribute}; } if (statSet->setParam->parental_level > 11) { // ****** sysutil savedata parameter error : 58 ****** - return {CELL_SAVEDATA_ERROR_PARAM, "58 (sdk_ver=0x%x, parental_level=%d)", g_ps3_process_info.sdk_ver, statSet->setParam->parental_level}; + return {CELL_SAVEDATA_ERROR_PARAM, + "58 (sdk_ver=0x%x, parental_level=%d)", + g_ps3_process_info.sdk_ver, statSet->setParam->parental_level}; } - // Note: in firmware 3.70 or higher parental_level was changed to reserved2 + // Note: in firmware 3.70 or higher parental_level was changed to + // reserved2 for (usz index = 0;; index++) { // Convert to pointer to avoid UB when accessing out of range const u8 c = (+statSet->setParam->listParam)[index]; - if (c == 0 || index >= (g_ps3_process_info.sdk_ver > 0x36FFFF ? std::size(statSet->setParam->listParam) - 1 : std::size(statSet->setParam->listParam))) + if (c == 0 || + index >= (g_ps3_process_info.sdk_ver > 0x36FFFF ? std::size(statSet->setParam->listParam) - 1 : std::size(statSet->setParam->listParam))) { if (c) { // ****** sysutil savedata parameter error : 76 ****** - return {CELL_SAVEDATA_ERROR_PARAM, "76 (listParam=0x%016x)", std::bit_cast>(statSet->setParam->listParam)}; + return {CELL_SAVEDATA_ERROR_PARAM, "76 (listParam=0x%016x)", + std::bit_cast>(statSet->setParam->listParam)}; } break; } - if ((c < 'A' || c > 'Z') && (c < '0' || c > '9') && c != '-' && c != '_') + if ((c < 'A' || c > 'Z') && (c < '0' || c > '9') && c != '-' && + c != '_') { // ****** sysutil savedata parameter error : 77 ****** - return {CELL_SAVEDATA_ERROR_PARAM, "77 (listParam=0x%016x)", std::bit_cast>(statSet->setParam->listParam)}; + return {CELL_SAVEDATA_ERROR_PARAM, "77 (listParam=0x%016x)", + std::bit_cast>(statSet->setParam->listParam)}; } } @@ -1658,12 +1861,22 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v psf::assign(psf, "CATEGORY", psf::string(4, "SD")); // ??? psf::assign(psf, "PARAMS", psf::string(1024, {})); // ??? psf::assign(psf, "PARAMS2", psf::string(12, {})); // ??? - psf::assign(psf, "PARENTAL_LEVEL", statSet->setParam->parental_level.value()); - psf::assign(psf, "DETAIL", psf::string(CELL_SAVEDATA_SYSP_DETAIL_SIZE, statSet->setParam->detail)); - psf::assign(psf, "SAVEDATA_DIRECTORY", psf::string(CELL_SAVEDATA_DIRNAME_SIZE, save_entry.dirName)); - psf::assign(psf, "SAVEDATA_LIST_PARAM", psf::string(CELL_SAVEDATA_SYSP_LPARAM_SIZE, statSet->setParam->listParam)); - psf::assign(psf, "SUB_TITLE", psf::string(CELL_SAVEDATA_SYSP_SUBTITLE_SIZE, statSet->setParam->subTitle)); - psf::assign(psf, "TITLE", psf::string(CELL_SAVEDATA_SYSP_TITLE_SIZE, statSet->setParam->title)); + psf::assign(psf, "PARENTAL_LEVEL", + statSet->setParam->parental_level.value()); + psf::assign(psf, "DETAIL", + psf::string(CELL_SAVEDATA_SYSP_DETAIL_SIZE, + statSet->setParam->detail)); + psf::assign(psf, "SAVEDATA_DIRECTORY", + psf::string(CELL_SAVEDATA_DIRNAME_SIZE, save_entry.dirName)); + psf::assign(psf, "SAVEDATA_LIST_PARAM", + psf::string(CELL_SAVEDATA_SYSP_LPARAM_SIZE, + statSet->setParam->listParam)); + psf::assign(psf, "SUB_TITLE", + psf::string(CELL_SAVEDATA_SYSP_SUBTITLE_SIZE, + statSet->setParam->subTitle)); + psf::assign( + psf, "TITLE", + psf::string(CELL_SAVEDATA_SYSP_TITLE_SIZE, statSet->setParam->title)); has_modified = true; } else if (save_entry.isNew) @@ -1676,8 +1889,9 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v { case CELL_SAVEDATA_RECREATE_NO: { - // CELL_SAVEDATA_RECREATE_NO = overwrite and let the user know, not data is corrupt. - // cellSaveData.error("Savedata %s considered broken", save_entry.dirName); + // CELL_SAVEDATA_RECREATE_NO = overwrite and let the user know, not data + // is corrupt. cellSaveData.error("Savedata %s considered broken", + // save_entry.dirName); // TODO: if this is a save, and it's not auto, then show a dialog [[fallthrough]]; } @@ -1695,7 +1909,8 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v return {CELL_SAVEDATA_ERROR_PARAM, "50"}; } - cellSaveData.warning("savedata_op(): Recreating savedata. (mode=%d)", statSet->reCreateMode); + cellSaveData.warning("savedata_op(): Recreating savedata. (mode=%d)", + statSet->reCreateMode); // Clear secure file info for (auto it = psf.cbegin(), end = psf.cend(); it != end;) @@ -1718,16 +1933,19 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v default: { // ****** sysutil savedata parameter error : 48 ****** - cellSaveData.error("savedata_op(): unknown statSet->reCreateMode (0x%x)", statSet->reCreateMode); + cellSaveData.error("savedata_op(): unknown statSet->reCreateMode (0x%x)", + statSet->reCreateMode); return {CELL_SAVEDATA_ERROR_PARAM, "48"}; } } } // Create save directory if necessary - if (!psf.empty() && save_entry.isNew && !fs::create_dir(dir_path) && fs::g_tls_error != fs::error::exist) + if (!psf.empty() && save_entry.isNew && !fs::create_dir(dir_path) && + fs::g_tls_error != fs::error::exist) { - cellSaveData.warning("savedata_op(): failed to create %s (%s)", dir_path, fs::g_tls_error); + cellSaveData.warning("savedata_op(): failed to create %s (%s)", dir_path, + fs::g_tls_error); return CELL_SAVEDATA_ERROR_ACCESS_ERROR; } @@ -1735,7 +1953,8 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v std::map> all_times; std::map all_files; - // First, preload all files (TODO: beware of possible lag, although it should be insignificant) + // First, preload all files (TODO: beware of possible lag, although it should + // be insignificant) for (auto&& entry : fs::dir(dir_path)) { if (!recreated && !entry.is_directory) @@ -1749,24 +1968,31 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v } all_times.emplace(entry.name, std::make_pair(entry.atime, entry.mtime)); - all_files.emplace(std::move(entry.name), fs::make_stream(fs::file(dir_path + entry.name).to_vector())); + all_files.emplace( + std::move(entry.name), + fs::make_stream(fs::file(dir_path + entry.name).to_vector())); } } fileGet->excSize = 0; - // show indicator for automatic save or auto load interactions if the game requests it (statSet->indicator) - const bool show_auto_indicator = operation <= SAVEDATA_OP_LIST_AUTO_LOAD && statSet && statSet->indicator && g_cfg.misc.show_autosave_autoload_hint; + // show indicator for automatic save or auto load interactions if the game + // requests it (statSet->indicator) + const bool show_auto_indicator = operation <= SAVEDATA_OP_LIST_AUTO_LOAD && + statSet && statSet->indicator && + g_cfg.misc.show_autosave_autoload_hint; if (show_auto_indicator) { auto msg_text = localized_string_id::INVALID; - if (operation == SAVEDATA_OP_AUTO_SAVE || operation == SAVEDATA_OP_LIST_AUTO_SAVE) + if (operation == SAVEDATA_OP_AUTO_SAVE || + operation == SAVEDATA_OP_LIST_AUTO_SAVE) { msg_text = localized_string_id::CELL_SAVEDATA_AUTOSAVE; } - else if (operation == SAVEDATA_OP_AUTO_LOAD || operation == SAVEDATA_OP_LIST_AUTO_LOAD) + else if (operation == SAVEDATA_OP_AUTO_LOAD || + operation == SAVEDATA_OP_LIST_AUTO_LOAD) { msg_text = localized_string_id::CELL_SAVEDATA_AUTOLOAD; } @@ -1793,9 +2019,9 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v // TODO: Blinking variants - // RPCS3 saves basically instantaneously so there's not much point in showing auto indicator - // WHILE saving is in progress. Instead we show the indicator for 3 seconds to let the user - // know when the game autosaves. + // RPCS3 saves basically instantaneously so there's not much point in + // showing auto indicator WHILE saving is in progress. Instead we show the + // indicator for 3 seconds to let the user know when the game autosaves. rsx::overlays::queue_message(msg_text, 3'000'000, {}, msg_location); } @@ -1809,26 +2035,30 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v std::memset(fileSet.get_ptr(), 0, fileSet.size()); std::memset(fileGet->reserved, 0, sizeof(fileGet->reserved)); - std::memset(result.get_ptr(), 0, ::offset32(&CellSaveDataCBResult::userdata)); + std::memset(result.get_ptr(), 0, + ::offset32(&CellSaveDataCBResult::userdata)); funcFile(ppu, result, fileGet, fileSet); ppu.state += cpu_flag::wait; if (const s32 res = result->result; res != CELL_SAVEDATA_CBRESULT_OK_NEXT) { - if (res == CELL_SAVEDATA_CBRESULT_OK_LAST || res == CELL_SAVEDATA_CBRESULT_OK_LAST_NOCONFIRM) + if (res == CELL_SAVEDATA_CBRESULT_OK_LAST || + res == CELL_SAVEDATA_CBRESULT_OK_LAST_NOCONFIRM) { // TODO: display user prompt // Some games (Jak II [NPUA80707]) rely on this delay lv2_obj::sleep(ppu); - delay_save_until = get_guest_system_time() + (has_modified ? 500'000 : 100'000); + delay_save_until = + get_guest_system_time() + (has_modified ? 500'000 : 100'000); break; } cellSaveData.warning("savedata_op(): funcFile returned result=%d.", res); - if (res < CELL_SAVEDATA_CBRESULT_ERR_INVALID || res > CELL_SAVEDATA_CBRESULT_OK_LAST_NOCONFIRM) + if (res < CELL_SAVEDATA_CBRESULT_ERR_INVALID || + res > CELL_SAVEDATA_CBRESULT_OK_LAST_NOCONFIRM) { // ****** sysutil savedata parameter error : 22 ****** savedata_result = {CELL_SAVEDATA_ERROR_PARAM, "22"}; @@ -1857,7 +2087,8 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v const char* fileName = fileSet->fileName.get_ptr(); - if (const auto termpos = std::memchr(fileName, '\0', CELL_SAVEDATA_FILENAME_SIZE)) + if (const auto termpos = + std::memchr(fileName, '\0', CELL_SAVEDATA_FILENAME_SIZE)) { file_path.assign(fileName, static_cast(termpos)); } @@ -1876,7 +2107,8 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v if (type == CELL_SAVEDATA_FILETYPE_SECUREFILE) { - cellSaveData.notice("SECUREFILE: %s -> %s", file_path, fileSet->secureFileId); + cellSaveData.notice("SECUREFILE: %s -> %s", file_path, + fileSet->secureFileId); } break; @@ -1904,7 +2136,8 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v default: { // ****** sysutil savedata parameter error : 61 ****** - cellSaveData.error("savedata_op(): unknown fileSet->fileType (0x%x)", type); + cellSaveData.error("savedata_op(): unknown fileSet->fileType (0x%x)", + type); savedata_result = {CELL_SAVEDATA_ERROR_PARAM, "61"}; break; } @@ -1934,10 +2167,14 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v }; // clang-format on - cellSaveData.warning("savedata_op(): Fileop: file='%s', type=%d, op=%d, bufSize=%d, fileSize=%d, offset=%d", - file_path, fileSet->fileType, fileSet->fileOperation, fileSet->fileBufSize, fileSet->fileSize, fileSet->fileOffset); + cellSaveData.warning("savedata_op(): Fileop: file='%s', type=%d, op=%d, " + "bufSize=%d, fileSize=%d, offset=%d", + file_path, fileSet->fileType, fileSet->fileOperation, + fileSet->fileBufSize, fileSet->fileSize, + fileSet->fileOffset); - if ((file_path == "." || file_path == "..") && fileSet->fileOperation <= CELL_SAVEDATA_FILEOP_WRITE_NOTRUNC) + if ((file_path == "." || file_path == "..") && + fileSet->fileOperation <= CELL_SAVEDATA_FILEOP_WRITE_NOTRUNC) { savedata_result = CELL_SAVEDATA_ERROR_BROKEN; break; @@ -1966,13 +2203,17 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v if (file == all_files.cend() || file->second.size() <= pos) { - cellSaveData.error("Failed to open file %s%s (size=%d, fileOffset=%d)", dir_path, file_path, file == all_files.cend() ? -1 : file->second.size(), fileSet->fileOffset); + cellSaveData.error("Failed to open file %s%s (size=%d, fileOffset=%d)", + dir_path, file_path, + file == all_files.cend() ? -1 : file->second.size(), + fileSet->fileOffset); savedata_result = CELL_SAVEDATA_ERROR_FAILURE; break; } // Read from memory file to vm - const u64 rr = lv2_file::op_read(file->second, fileSet->fileBuf, fileSet->fileSize, pos); + const u64 rr = lv2_file::op_read(file->second, fileSet->fileBuf, + fileSet->fileSize, pos); fileGet->excSize = ::narrow(rr); break; } @@ -2002,7 +2243,8 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v // Write to memory file and truncate const u64 sr = file.seek(fileSet->fileOffset); - const u64 wr = lv2_file::op_write(file, fileSet->fileBuf, fileSet->fileSize); + const u64 wr = + lv2_file::op_write(file, fileSet->fileBuf, fileSet->fileSize); file.trunc(sr + wr); fileGet->excSize = ::narrow(wr); all_times.erase(file_path); @@ -2054,7 +2296,8 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v // Write to memory file normally file.seek(fileSet->fileOffset); - const u64 wr = lv2_file::op_write(file, fileSet->fileBuf, fileSet->fileSize); + const u64 wr = + lv2_file::op_write(file, fileSet->fileBuf, fileSet->fileSize); fileGet->excSize = ::narrow(wr); all_times.erase(file_path); add_to_blist(file_path); @@ -2065,7 +2308,8 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v default: { // ****** sysutil savedata parameter error : 60 ****** - cellSaveData.error("savedata_op(): unknown fileSet->fileOperation (0x%x)", op); + cellSaveData.error("savedata_op(): unknown fileSet->fileOperation (0x%x)", + op); savedata_result = {CELL_SAVEDATA_ERROR_PARAM, "60"}; break; } @@ -2078,7 +2322,8 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v if (fileSet->fileOperation != CELL_SAVEDATA_FILEOP_DELETE) { - psf.emplace("*" + file_path, fileSet->fileType == CELL_SAVEDATA_FILETYPE_SECUREFILE); + psf.emplace("*" + file_path, + fileSet->fileType == CELL_SAVEDATA_FILETYPE_SECUREFILE); } } @@ -2092,13 +2337,16 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v } else { - fmt::throw_exception("Failed to create directory %s (%s)", new_path, fs::g_tls_error); + fmt::throw_exception("Failed to create directory %s (%s)", new_path, + fs::g_tls_error); } // add file list per FS order to PARAM.SFO std::string final_blist; final_blist = fmt::merge(blist, "/"); - psf::assign(psf, "RPCS3_BLIST", psf::string(utils::align(::size32(final_blist) + 1, 4), final_blist)); + psf::assign( + psf, "RPCS3_BLIST", + psf::string(utils::align(::size32(final_blist) + 1, 4), final_blist)); // Write all files in temporary directory auto& fsfo = all_files["PARAM.SFO"]; @@ -2109,13 +2357,15 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v { if (auto file = pair.second.release()) { - auto&& fvec = static_cast>&>(*file); + auto&& fvec = + static_cast>&>(*file); #ifdef _WIN32 fs::pending_file f(new_path + vfs::escape(pair.first)); f.file.write(fvec.obj); ensure(f.commit()); #else - ensure(fs::write_file(new_path + vfs::escape(pair.first), fs::rewrite, fvec.obj)); + ensure(fs::write_file(new_path + vfs::escape(pair.first), fs::rewrite, + fvec.obj)); #endif } } @@ -2123,7 +2373,8 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v for (auto&& pair : all_times) { // Restore atime/mtime for files which have not been modified - fs::utime(new_path + vfs::escape(pair.first), pair.second.first, pair.second.second); + fs::utime(new_path + vfs::escape(pair.first), pair.second.first, + pair.second.second); } // Remove old backup @@ -2133,17 +2384,20 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v // Backup old savedata if (!vfs::host::rename(dir_path, old_path, &g_mp_sys_dev_hdd0, false)) { - fmt::throw_exception("Failed to move directory %s (%s)", dir_path, fs::g_tls_error); + fmt::throw_exception("Failed to move directory %s (%s)", dir_path, + fs::g_tls_error); } // Commit new savedata if (!vfs::host::rename(new_path, dir_path, &g_mp_sys_dev_hdd0, false)) { // TODO: handle the case when only commit failed at the next save load - fmt::throw_exception("Failed to move directory %s (%s)", new_path, fs::g_tls_error); + fmt::throw_exception("Failed to move directory %s (%s)", new_path, + fs::g_tls_error); } - // Remove backup again (TODO: may be changed to persistent backup implementation) + // Remove backup again (TODO: may be changed to persistent backup + // implementation) fs::remove_all(old_path); } @@ -2157,7 +2411,8 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v return display_callback_result_error_message(ppu, *result, errDialog); } - if (u64 current_time = get_guest_system_time(); current_time < delay_save_until) + if (u64 current_time = get_guest_system_time(); + current_time < delay_save_until) { lv2_sleep(ppu, delay_save_until - current_time); } @@ -2165,7 +2420,10 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v return savedata_result; } -static NEVER_INLINE error_code savedata_get_list_item(vm::cptr dirName, vm::ptr dir, vm::ptr sysFileParam, vm::ptr bind, vm::ptr sizeKB, u32 userId) +static NEVER_INLINE error_code +savedata_get_list_item(vm::cptr dirName, vm::ptr dir, + vm::ptr sysFileParam, + vm::ptr bind, vm::ptr sizeKB, u32 userId) { if (userId == CELL_SYSUTIL_USERID_CURRENT) { @@ -2183,7 +2441,8 @@ static NEVER_INLINE error_code savedata_get_list_item(vm::cptr dirName, vm return {CELL_SAVEDATA_ERROR_PARAM, "107"}; } - switch (sysutil_check_name_string(dirName.get_ptr(), 1, CELL_SAVEDATA_DIRLIST_MAX)) + switch (sysutil_check_name_string(dirName.get_ptr(), 1, + CELL_SAVEDATA_DIRLIST_MAX)) { case -1: { @@ -2195,11 +2454,14 @@ static NEVER_INLINE error_code savedata_get_list_item(vm::cptr dirName, vm // ****** sysutil savedata parameter error : 109 ****** return {CELL_SAVEDATA_ERROR_PARAM, "109"}; } - case 0: break; - default: fmt::throw_exception("Unreachable"); + case 0: + break; + default: + fmt::throw_exception("Unreachable"); } - const std::string base_dir = fmt::format("/dev_hdd0/home/%08u/savedata/", userId); + const std::string base_dir = + fmt::format("/dev_hdd0/home/%08u/savedata/", userId); if (!fs::is_dir(vfs::get(base_dir))) { @@ -2211,7 +2473,8 @@ static NEVER_INLINE error_code savedata_get_list_item(vm::cptr dirName, vm if (!fs::is_dir(save_path) && !fs::is_file(sfo)) { - cellSaveData.error("cellSaveDataGetListItem(): Savedata at %s does not exist", dirName); + cellSaveData.error( + "cellSaveDataGetListItem(): Savedata at %s does not exist", dirName); return CELL_SAVEDATA_ERROR_NODATA; } @@ -2219,7 +2482,8 @@ static NEVER_INLINE error_code savedata_get_list_item(vm::cptr dirName, vm if (sysFileParam) { - strcpy_trunc(sysFileParam->listParam, psf::get_string(psf, "SAVEDATA_LIST_PARAM")); + strcpy_trunc(sysFileParam->listParam, + psf::get_string(psf, "SAVEDATA_LIST_PARAM")); strcpy_trunc(sysFileParam->title, psf::get_string(psf, "TITLE")); strcpy_trunc(sysFileParam->subTitle, psf::get_string(psf, "SUB_TITLE")); strcpy_trunc(sysFileParam->detail, psf::get_string(psf, "DETAIL")); @@ -2246,12 +2510,14 @@ static NEVER_INLINE error_code savedata_get_list_item(vm::cptr dirName, vm for (const auto& entry : fs::dir(save_path)) { - if (entry.is_directory || check_filename(vfs::unescape(entry.name), false, false)) + if (entry.is_directory || + check_filename(vfs::unescape(entry.name), false, false)) { continue; } - size_kbytes += ::narrow((entry.size + 1023) / 1024); // firmware rounds this value up + size_kbytes += ::narrow((entry.size + 1023) / + 1024); // firmware rounds this value up } // Add a seemingly constant allocation disk space of PARAM.SFO + PARAM.PFD @@ -2268,128 +2534,238 @@ static NEVER_INLINE error_code savedata_get_list_item(vm::cptr dirName, vm } // Functions -error_code cellSaveDataListSave2(ppu_thread& ppu, u32 version, PSetList setList, PSetBuf setBuf, PFuncList funcList, - PFuncStat funcStat, PFuncFile funcFile, u32 container, vm::ptr userdata) +error_code cellSaveDataListSave2(ppu_thread& ppu, u32 version, PSetList setList, + PSetBuf setBuf, PFuncList funcList, + PFuncStat funcStat, PFuncFile funcFile, + u32 container, vm::ptr userdata) { - cellSaveData.warning("cellSaveDataListSave2(version=%d, setList=*0x%x, setBuf=*0x%x, funcList=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x, userdata=*0x%x)", - version, setList, setBuf, funcList, funcStat, funcFile, container, userdata); + cellSaveData.warning("cellSaveDataListSave2(version=%d, setList=*0x%x, " + "setBuf=*0x%x, funcList=*0x%x, funcStat=*0x%x, " + "funcFile=*0x%x, container=0x%x, userdata=*0x%x)", + version, setList, setBuf, funcList, funcStat, funcFile, + container, userdata); - return savedata_op(ppu, SAVEDATA_OP_LIST_SAVE, version, vm::null, CELL_SAVEDATA_ERRDIALOG_ALWAYS, setList, setBuf, funcList, vm::null, funcStat, funcFile, container, 2, userdata, 0, vm::null); + return savedata_op(ppu, SAVEDATA_OP_LIST_SAVE, version, vm::null, + CELL_SAVEDATA_ERRDIALOG_ALWAYS, setList, setBuf, funcList, + vm::null, funcStat, funcFile, container, 2, userdata, 0, + vm::null); } -error_code cellSaveDataListLoad2(ppu_thread& ppu, u32 version, PSetList setList, PSetBuf setBuf, PFuncList funcList, - PFuncStat funcStat, PFuncFile funcFile, u32 container, vm::ptr userdata) +error_code cellSaveDataListLoad2(ppu_thread& ppu, u32 version, PSetList setList, + PSetBuf setBuf, PFuncList funcList, + PFuncStat funcStat, PFuncFile funcFile, + u32 container, vm::ptr userdata) { - cellSaveData.warning("cellSaveDataListLoad2(version=%d, setList=*0x%x, setBuf=*0x%x, funcList=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x, userdata=*0x%x)", - version, setList, setBuf, funcList, funcStat, funcFile, container, userdata); + cellSaveData.warning("cellSaveDataListLoad2(version=%d, setList=*0x%x, " + "setBuf=*0x%x, funcList=*0x%x, funcStat=*0x%x, " + "funcFile=*0x%x, container=0x%x, userdata=*0x%x)", + version, setList, setBuf, funcList, funcStat, funcFile, + container, userdata); - return savedata_op(ppu, SAVEDATA_OP_LIST_LOAD, version, vm::null, CELL_SAVEDATA_ERRDIALOG_ALWAYS, setList, setBuf, funcList, vm::null, funcStat, funcFile, container, 2, userdata, 0, vm::null); + return savedata_op(ppu, SAVEDATA_OP_LIST_LOAD, version, vm::null, + CELL_SAVEDATA_ERRDIALOG_ALWAYS, setList, setBuf, funcList, + vm::null, funcStat, funcFile, container, 2, userdata, 0, + vm::null); } -error_code cellSaveDataListSave(ppu_thread& ppu, u32 version, PSetList setList, PSetBuf setBuf, PFuncList funcList, - PFuncStat funcStat, PFuncFile funcFile, u32 container) +error_code cellSaveDataListSave(ppu_thread& ppu, u32 version, PSetList setList, + PSetBuf setBuf, PFuncList funcList, + PFuncStat funcStat, PFuncFile funcFile, + u32 container) { - cellSaveData.warning("cellSaveDataListSave(version=%d, setList=*0x%x, setBuf=*0x%x, funcList=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x)", + cellSaveData.warning( + "cellSaveDataListSave(version=%d, setList=*0x%x, setBuf=*0x%x, " + "funcList=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x)", version, setList, setBuf, funcList, funcStat, funcFile, container); - return savedata_op(ppu, SAVEDATA_OP_LIST_SAVE, version, vm::null, CELL_SAVEDATA_ERRDIALOG_ALWAYS, setList, setBuf, funcList, vm::null, funcStat, funcFile, container, 2, vm::null, 0, vm::null); + return savedata_op(ppu, SAVEDATA_OP_LIST_SAVE, version, vm::null, + CELL_SAVEDATA_ERRDIALOG_ALWAYS, setList, setBuf, funcList, + vm::null, funcStat, funcFile, container, 2, vm::null, 0, + vm::null); } -error_code cellSaveDataListLoad(ppu_thread& ppu, u32 version, PSetList setList, PSetBuf setBuf, PFuncList funcList, - PFuncStat funcStat, PFuncFile funcFile, u32 container) +error_code cellSaveDataListLoad(ppu_thread& ppu, u32 version, PSetList setList, + PSetBuf setBuf, PFuncList funcList, + PFuncStat funcStat, PFuncFile funcFile, + u32 container) { - cellSaveData.warning("cellSaveDataListLoad(version=%d, setList=*0x%x, setBuf=*0x%x, funcList=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x)", + cellSaveData.warning( + "cellSaveDataListLoad(version=%d, setList=*0x%x, setBuf=*0x%x, " + "funcList=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x)", version, setList, setBuf, funcList, funcStat, funcFile, container); - return savedata_op(ppu, SAVEDATA_OP_LIST_LOAD, version, vm::null, CELL_SAVEDATA_ERRDIALOG_ALWAYS, setList, setBuf, funcList, vm::null, funcStat, funcFile, container, 2, vm::null, 0, vm::null); + return savedata_op(ppu, SAVEDATA_OP_LIST_LOAD, version, vm::null, + CELL_SAVEDATA_ERRDIALOG_ALWAYS, setList, setBuf, funcList, + vm::null, funcStat, funcFile, container, 2, vm::null, 0, + vm::null); } -error_code cellSaveDataFixedSave2(ppu_thread& ppu, u32 version, PSetList setList, PSetBuf setBuf, PFuncFixed funcFixed, - PFuncStat funcStat, PFuncFile funcFile, u32 container, vm::ptr userdata) +error_code cellSaveDataFixedSave2(ppu_thread& ppu, u32 version, + PSetList setList, PSetBuf setBuf, + PFuncFixed funcFixed, PFuncStat funcStat, + PFuncFile funcFile, u32 container, + vm::ptr userdata) { - cellSaveData.warning("cellSaveDataFixedSave2(version=%d, setList=*0x%x, setBuf=*0x%x, funcFixed=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x, userdata=*0x%x)", - version, setList, setBuf, funcFixed, funcStat, funcFile, container, userdata); + cellSaveData.warning("cellSaveDataFixedSave2(version=%d, setList=*0x%x, " + "setBuf=*0x%x, funcFixed=*0x%x, funcStat=*0x%x, " + "funcFile=*0x%x, container=0x%x, userdata=*0x%x)", + version, setList, setBuf, funcFixed, funcStat, funcFile, + container, userdata); - return savedata_op(ppu, SAVEDATA_OP_FIXED_SAVE, version, vm::null, CELL_SAVEDATA_ERRDIALOG_ALWAYS, setList, setBuf, vm::null, funcFixed, funcStat, funcFile, container, 2, userdata, 0, vm::null); + return savedata_op(ppu, SAVEDATA_OP_FIXED_SAVE, version, vm::null, + CELL_SAVEDATA_ERRDIALOG_ALWAYS, setList, setBuf, vm::null, + funcFixed, funcStat, funcFile, container, 2, userdata, 0, + vm::null); } -error_code cellSaveDataFixedLoad2(ppu_thread& ppu, u32 version, PSetList setList, PSetBuf setBuf, PFuncFixed funcFixed, - PFuncStat funcStat, PFuncFile funcFile, u32 container, vm::ptr userdata) +error_code cellSaveDataFixedLoad2(ppu_thread& ppu, u32 version, + PSetList setList, PSetBuf setBuf, + PFuncFixed funcFixed, PFuncStat funcStat, + PFuncFile funcFile, u32 container, + vm::ptr userdata) { - cellSaveData.warning("cellSaveDataFixedLoad2(version=%d, setList=*0x%x, setBuf=*0x%x, funcFixed=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x, userdata=*0x%x)", - version, setList, setBuf, funcFixed, funcStat, funcFile, container, userdata); + cellSaveData.warning("cellSaveDataFixedLoad2(version=%d, setList=*0x%x, " + "setBuf=*0x%x, funcFixed=*0x%x, funcStat=*0x%x, " + "funcFile=*0x%x, container=0x%x, userdata=*0x%x)", + version, setList, setBuf, funcFixed, funcStat, funcFile, + container, userdata); - return savedata_op(ppu, SAVEDATA_OP_FIXED_LOAD, version, vm::null, CELL_SAVEDATA_ERRDIALOG_ALWAYS, setList, setBuf, vm::null, funcFixed, funcStat, funcFile, container, 2, userdata, 0, vm::null); + return savedata_op(ppu, SAVEDATA_OP_FIXED_LOAD, version, vm::null, + CELL_SAVEDATA_ERRDIALOG_ALWAYS, setList, setBuf, vm::null, + funcFixed, funcStat, funcFile, container, 2, userdata, 0, + vm::null); } -error_code cellSaveDataFixedSave(ppu_thread& ppu, u32 version, PSetList setList, PSetBuf setBuf, PFuncFixed funcFixed, - PFuncStat funcStat, PFuncFile funcFile, u32 container) +error_code cellSaveDataFixedSave(ppu_thread& ppu, u32 version, PSetList setList, + PSetBuf setBuf, PFuncFixed funcFixed, + PFuncStat funcStat, PFuncFile funcFile, + u32 container) { - cellSaveData.warning("cellSaveDataFixedSave(version=%d, setList=*0x%x, setBuf=*0x%x, funcFixed=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x)", + cellSaveData.warning( + "cellSaveDataFixedSave(version=%d, setList=*0x%x, setBuf=*0x%x, " + "funcFixed=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x)", version, setList, setBuf, funcFixed, funcStat, funcFile, container); - return savedata_op(ppu, SAVEDATA_OP_FIXED_SAVE, version, vm::null, CELL_SAVEDATA_ERRDIALOG_ALWAYS, setList, setBuf, vm::null, funcFixed, funcStat, funcFile, container, 2, vm::null, 0, vm::null); + return savedata_op(ppu, SAVEDATA_OP_FIXED_SAVE, version, vm::null, + CELL_SAVEDATA_ERRDIALOG_ALWAYS, setList, setBuf, vm::null, + funcFixed, funcStat, funcFile, container, 2, vm::null, 0, + vm::null); } -error_code cellSaveDataFixedLoad(ppu_thread& ppu, u32 version, PSetList setList, PSetBuf setBuf, PFuncFixed funcFixed, - PFuncStat funcStat, PFuncFile funcFile, u32 container) +error_code cellSaveDataFixedLoad(ppu_thread& ppu, u32 version, PSetList setList, + PSetBuf setBuf, PFuncFixed funcFixed, + PFuncStat funcStat, PFuncFile funcFile, + u32 container) { - cellSaveData.warning("cellSaveDataFixedLoad(version=%d, setList=*0x%x, setBuf=*0x%x, funcFixed=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x)", + cellSaveData.warning( + "cellSaveDataFixedLoad(version=%d, setList=*0x%x, setBuf=*0x%x, " + "funcFixed=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x)", version, setList, setBuf, funcFixed, funcStat, funcFile, container); - return savedata_op(ppu, SAVEDATA_OP_FIXED_LOAD, version, vm::null, CELL_SAVEDATA_ERRDIALOG_ALWAYS, setList, setBuf, vm::null, funcFixed, funcStat, funcFile, container, 2, vm::null, 0, vm::null); + return savedata_op(ppu, SAVEDATA_OP_FIXED_LOAD, version, vm::null, + CELL_SAVEDATA_ERRDIALOG_ALWAYS, setList, setBuf, vm::null, + funcFixed, funcStat, funcFile, container, 2, vm::null, 0, + vm::null); } -error_code cellSaveDataAutoSave2(ppu_thread& ppu, u32 version, vm::cptr dirName, u32 errDialog, PSetBuf setBuf, - PFuncStat funcStat, PFuncFile funcFile, u32 container, vm::ptr userdata) +error_code cellSaveDataAutoSave2(ppu_thread& ppu, u32 version, + vm::cptr dirName, u32 errDialog, + PSetBuf setBuf, PFuncStat funcStat, + PFuncFile funcFile, u32 container, + vm::ptr userdata) { - cellSaveData.warning("cellSaveDataAutoSave2(version=%d, dirName=%s, errDialog=%d, setBuf=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x, userdata=*0x%x)", - version, dirName, errDialog, setBuf, funcStat, funcFile, container, userdata); + cellSaveData.warning("cellSaveDataAutoSave2(version=%d, dirName=%s, " + "errDialog=%d, setBuf=*0x%x, funcStat=*0x%x, " + "funcFile=*0x%x, container=0x%x, userdata=*0x%x)", + version, dirName, errDialog, setBuf, funcStat, funcFile, + container, userdata); - return savedata_op(ppu, SAVEDATA_OP_AUTO_SAVE, version, dirName, errDialog, vm::null, setBuf, vm::null, vm::null, funcStat, funcFile, container, 2, userdata, 0, vm::null); + return savedata_op(ppu, SAVEDATA_OP_AUTO_SAVE, version, dirName, errDialog, + vm::null, setBuf, vm::null, vm::null, funcStat, funcFile, + container, 2, userdata, 0, vm::null); } -error_code cellSaveDataAutoLoad2(ppu_thread& ppu, u32 version, vm::cptr dirName, u32 errDialog, PSetBuf setBuf, - PFuncStat funcStat, PFuncFile funcFile, u32 container, vm::ptr userdata) +error_code cellSaveDataAutoLoad2(ppu_thread& ppu, u32 version, + vm::cptr dirName, u32 errDialog, + PSetBuf setBuf, PFuncStat funcStat, + PFuncFile funcFile, u32 container, + vm::ptr userdata) { - cellSaveData.warning("cellSaveDataAutoLoad2(version=%d, dirName=%s, errDialog=%d, setBuf=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x, userdata=*0x%x)", - version, dirName, errDialog, setBuf, funcStat, funcFile, container, userdata); + cellSaveData.warning("cellSaveDataAutoLoad2(version=%d, dirName=%s, " + "errDialog=%d, setBuf=*0x%x, funcStat=*0x%x, " + "funcFile=*0x%x, container=0x%x, userdata=*0x%x)", + version, dirName, errDialog, setBuf, funcStat, funcFile, + container, userdata); - return savedata_op(ppu, SAVEDATA_OP_AUTO_LOAD, version, dirName, errDialog, vm::null, setBuf, vm::null, vm::null, funcStat, funcFile, container, 2, userdata, 0, vm::null); + return savedata_op(ppu, SAVEDATA_OP_AUTO_LOAD, version, dirName, errDialog, + vm::null, setBuf, vm::null, vm::null, funcStat, funcFile, + container, 2, userdata, 0, vm::null); } -error_code cellSaveDataAutoSave(ppu_thread& ppu, u32 version, vm::cptr dirName, u32 errDialog, PSetBuf setBuf, - PFuncStat funcStat, PFuncFile funcFile, u32 container) +error_code cellSaveDataAutoSave(ppu_thread& ppu, u32 version, + vm::cptr dirName, u32 errDialog, + PSetBuf setBuf, PFuncStat funcStat, + PFuncFile funcFile, u32 container) { - cellSaveData.warning("cellSaveDataAutoSave(version=%d, dirName=%s, errDialog=%d, setBuf=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x)", + cellSaveData.warning( + "cellSaveDataAutoSave(version=%d, dirName=%s, errDialog=%d, " + "setBuf=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x)", version, dirName, errDialog, setBuf, funcStat, funcFile, container); - return savedata_op(ppu, SAVEDATA_OP_AUTO_SAVE, version, dirName, errDialog, vm::null, setBuf, vm::null, vm::null, funcStat, funcFile, container, 2, vm::null, 0, vm::null); + return savedata_op(ppu, SAVEDATA_OP_AUTO_SAVE, version, dirName, errDialog, + vm::null, setBuf, vm::null, vm::null, funcStat, funcFile, + container, 2, vm::null, 0, vm::null); } -error_code cellSaveDataAutoLoad(ppu_thread& ppu, u32 version, vm::cptr dirName, u32 errDialog, PSetBuf setBuf, - PFuncStat funcStat, PFuncFile funcFile, u32 container) +error_code cellSaveDataAutoLoad(ppu_thread& ppu, u32 version, + vm::cptr dirName, u32 errDialog, + PSetBuf setBuf, PFuncStat funcStat, + PFuncFile funcFile, u32 container) { - cellSaveData.warning("cellSaveDataAutoLoad(version=%d, dirName=%s, errDialog=%d, setBuf=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x)", + cellSaveData.warning( + "cellSaveDataAutoLoad(version=%d, dirName=%s, errDialog=%d, " + "setBuf=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x)", version, dirName, errDialog, setBuf, funcStat, funcFile, container); - return savedata_op(ppu, SAVEDATA_OP_AUTO_LOAD, version, dirName, errDialog, vm::null, setBuf, vm::null, vm::null, funcStat, funcFile, container, 2, vm::null, 0, vm::null); + return savedata_op(ppu, SAVEDATA_OP_AUTO_LOAD, version, dirName, errDialog, + vm::null, setBuf, vm::null, vm::null, funcStat, funcFile, + container, 2, vm::null, 0, vm::null); } -error_code cellSaveDataListAutoSave(ppu_thread& ppu, u32 version, u32 errDialog, PSetList setList, PSetBuf setBuf, PFuncFixed funcFixed, PFuncStat funcStat, PFuncFile funcFile, u32 container, vm::ptr userdata) +error_code cellSaveDataListAutoSave(ppu_thread& ppu, u32 version, u32 errDialog, + PSetList setList, PSetBuf setBuf, + PFuncFixed funcFixed, PFuncStat funcStat, + PFuncFile funcFile, u32 container, + vm::ptr userdata) { - cellSaveData.warning("cellSaveDataListAutoSave(version=%d, errDialog=%d, setList=*0x%x, setBuf=*0x%x, funcFixed=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x, userdata=*0x%x)", - version, errDialog, setList, setBuf, funcFixed, funcStat, funcFile, container, userdata); + cellSaveData.warning( + "cellSaveDataListAutoSave(version=%d, errDialog=%d, setList=*0x%x, " + "setBuf=*0x%x, funcFixed=*0x%x, funcStat=*0x%x, funcFile=*0x%x, " + "container=0x%x, userdata=*0x%x)", + version, errDialog, setList, setBuf, funcFixed, funcStat, funcFile, + container, userdata); - return savedata_op(ppu, SAVEDATA_OP_LIST_AUTO_SAVE, version, vm::null, errDialog, setList, setBuf, vm::null, funcFixed, funcStat, funcFile, container, 2, userdata, 0, vm::null); + return savedata_op(ppu, SAVEDATA_OP_LIST_AUTO_SAVE, version, vm::null, + errDialog, setList, setBuf, vm::null, funcFixed, funcStat, + funcFile, container, 2, userdata, 0, vm::null); } -error_code cellSaveDataListAutoLoad(ppu_thread& ppu, u32 version, u32 errDialog, PSetList setList, PSetBuf setBuf, PFuncFixed funcFixed, PFuncStat funcStat, PFuncFile funcFile, u32 container, vm::ptr userdata) +error_code cellSaveDataListAutoLoad(ppu_thread& ppu, u32 version, u32 errDialog, + PSetList setList, PSetBuf setBuf, + PFuncFixed funcFixed, PFuncStat funcStat, + PFuncFile funcFile, u32 container, + vm::ptr userdata) { - cellSaveData.warning("cellSaveDataListAutoLoad(version=%d, errDialog=%d, setList=*0x%x, setBuf=*0x%x, funcFixed=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x, userdata=*0x%x)", - version, errDialog, setList, setBuf, funcFixed, funcStat, funcFile, container, userdata); + cellSaveData.warning( + "cellSaveDataListAutoLoad(version=%d, errDialog=%d, setList=*0x%x, " + "setBuf=*0x%x, funcFixed=*0x%x, funcStat=*0x%x, funcFile=*0x%x, " + "container=0x%x, userdata=*0x%x)", + version, errDialog, setList, setBuf, funcFixed, funcStat, funcFile, + container, userdata); - return savedata_op(ppu, SAVEDATA_OP_LIST_AUTO_LOAD, version, vm::null, errDialog, setList, setBuf, vm::null, funcFixed, funcStat, funcFile, container, 2, userdata, 0, vm::null); + return savedata_op(ppu, SAVEDATA_OP_LIST_AUTO_LOAD, version, vm::null, + errDialog, setList, setBuf, vm::null, funcFixed, funcStat, + funcFile, container, 2, userdata, 0, vm::null); } error_code cellSaveDataDelete(ppu_thread& ppu, u32 container) @@ -2406,84 +2782,178 @@ error_code cellSaveDataDelete2(ppu_thread& ppu, u32 container) return select_and_delete(ppu); } -error_code cellSaveDataFixedDelete(ppu_thread& ppu, PSetList setList, PSetBuf setBuf, PFuncFixed funcFixed, PFuncDone funcDone, u32 container, vm::ptr userdata) +error_code cellSaveDataFixedDelete(ppu_thread& ppu, PSetList setList, + PSetBuf setBuf, PFuncFixed funcFixed, + PFuncDone funcDone, u32 container, + vm::ptr userdata) { - cellSaveData.warning("cellSaveDataFixedDelete(setList=*0x%x, setBuf=*0x%x, funcFixed=*0x%x, funcDone=*0x%x, container=0x%x, userdata=*0x%x)", + cellSaveData.warning( + "cellSaveDataFixedDelete(setList=*0x%x, setBuf=*0x%x, funcFixed=*0x%x, " + "funcDone=*0x%x, container=0x%x, userdata=*0x%x)", setList, setBuf, funcFixed, funcDone, container, userdata); - return savedata_op(ppu, SAVEDATA_OP_FIXED_DELETE, 0, vm::null, 1, setList, setBuf, vm::null, funcFixed, vm::null, vm::null, container, 2, userdata, 0, funcDone); + return savedata_op(ppu, SAVEDATA_OP_FIXED_DELETE, 0, vm::null, 1, setList, + setBuf, vm::null, funcFixed, vm::null, vm::null, container, + 2, userdata, 0, funcDone); } -error_code cellSaveDataUserListSave(ppu_thread& ppu, u32 version, u32 userId, PSetList setList, PSetBuf setBuf, PFuncList funcList, PFuncStat funcStat, PFuncFile funcFile, u32 container, vm::ptr userdata) +error_code cellSaveDataUserListSave(ppu_thread& ppu, u32 version, u32 userId, + PSetList setList, PSetBuf setBuf, + PFuncList funcList, PFuncStat funcStat, + PFuncFile funcFile, u32 container, + vm::ptr userdata) { - cellSaveData.error("cellSaveDataUserListSave(version=%d, userId=%d, setList=*0x%x, setBuf=*0x%x, funcList=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x, userdata=*0x%x)", - version, userId, setList, setBuf, funcList, funcStat, funcFile, container, userdata); + cellSaveData.error( + "cellSaveDataUserListSave(version=%d, userId=%d, setList=*0x%x, " + "setBuf=*0x%x, funcList=*0x%x, funcStat=*0x%x, funcFile=*0x%x, " + "container=0x%x, userdata=*0x%x)", + version, userId, setList, setBuf, funcList, funcStat, funcFile, container, + userdata); - return savedata_op(ppu, SAVEDATA_OP_LIST_SAVE, version, vm::null, 0, setList, setBuf, funcList, vm::null, funcStat, funcFile, container, 6, userdata, userId, vm::null); + return savedata_op(ppu, SAVEDATA_OP_LIST_SAVE, version, vm::null, 0, setList, + setBuf, funcList, vm::null, funcStat, funcFile, container, + 6, userdata, userId, vm::null); } -error_code cellSaveDataUserListLoad(ppu_thread& ppu, u32 version, u32 userId, PSetList setList, PSetBuf setBuf, PFuncList funcList, PFuncStat funcStat, PFuncFile funcFile, u32 container, vm::ptr userdata) +error_code cellSaveDataUserListLoad(ppu_thread& ppu, u32 version, u32 userId, + PSetList setList, PSetBuf setBuf, + PFuncList funcList, PFuncStat funcStat, + PFuncFile funcFile, u32 container, + vm::ptr userdata) { - cellSaveData.error("cellSaveDataUserListLoad(version=%d, userId=%d, setList=*0x%x, setBuf=*0x%x, funcList=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x, userdata=*0x%x)", - version, userId, setList, setBuf, funcList, funcStat, funcFile, container, userdata); + cellSaveData.error( + "cellSaveDataUserListLoad(version=%d, userId=%d, setList=*0x%x, " + "setBuf=*0x%x, funcList=*0x%x, funcStat=*0x%x, funcFile=*0x%x, " + "container=0x%x, userdata=*0x%x)", + version, userId, setList, setBuf, funcList, funcStat, funcFile, container, + userdata); - return savedata_op(ppu, SAVEDATA_OP_LIST_LOAD, version, vm::null, 0, setList, setBuf, funcList, vm::null, funcStat, funcFile, container, 6, userdata, userId, vm::null); + return savedata_op(ppu, SAVEDATA_OP_LIST_LOAD, version, vm::null, 0, setList, + setBuf, funcList, vm::null, funcStat, funcFile, container, + 6, userdata, userId, vm::null); } -error_code cellSaveDataUserFixedSave(ppu_thread& ppu, u32 version, u32 userId, PSetList setList, PSetBuf setBuf, PFuncFixed funcFixed, PFuncStat funcStat, PFuncFile funcFile, u32 container, vm::ptr userdata) +error_code cellSaveDataUserFixedSave(ppu_thread& ppu, u32 version, u32 userId, + PSetList setList, PSetBuf setBuf, + PFuncFixed funcFixed, PFuncStat funcStat, + PFuncFile funcFile, u32 container, + vm::ptr userdata) { - cellSaveData.error("cellSaveDataUserFixedSave(version=%d, userId=%d, setList=*0x%x, setBuf=*0x%x, funcFixed=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x, userdata=*0x%x)", - version, userId, setList, setBuf, funcFixed, funcStat, funcFile, container, userdata); + cellSaveData.error( + "cellSaveDataUserFixedSave(version=%d, userId=%d, setList=*0x%x, " + "setBuf=*0x%x, funcFixed=*0x%x, funcStat=*0x%x, funcFile=*0x%x, " + "container=0x%x, userdata=*0x%x)", + version, userId, setList, setBuf, funcFixed, funcStat, funcFile, + container, userdata); - return savedata_op(ppu, SAVEDATA_OP_FIXED_SAVE, version, vm::null, 0, setList, setBuf, vm::null, funcFixed, funcStat, funcFile, container, 6, userdata, userId, vm::null); + return savedata_op(ppu, SAVEDATA_OP_FIXED_SAVE, version, vm::null, 0, setList, + setBuf, vm::null, funcFixed, funcStat, funcFile, container, + 6, userdata, userId, vm::null); } -error_code cellSaveDataUserFixedLoad(ppu_thread& ppu, u32 version, u32 userId, PSetList setList, PSetBuf setBuf, PFuncFixed funcFixed, PFuncStat funcStat, PFuncFile funcFile, u32 container, vm::ptr userdata) +error_code cellSaveDataUserFixedLoad(ppu_thread& ppu, u32 version, u32 userId, + PSetList setList, PSetBuf setBuf, + PFuncFixed funcFixed, PFuncStat funcStat, + PFuncFile funcFile, u32 container, + vm::ptr userdata) { - cellSaveData.error("cellSaveDataUserFixedLoad(version=%d, userId=%d, setList=*0x%x, setBuf=*0x%x, funcFixed=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x, userdata=*0x%x)", - version, userId, setList, setBuf, funcFixed, funcStat, funcFile, container, userdata); + cellSaveData.error( + "cellSaveDataUserFixedLoad(version=%d, userId=%d, setList=*0x%x, " + "setBuf=*0x%x, funcFixed=*0x%x, funcStat=*0x%x, funcFile=*0x%x, " + "container=0x%x, userdata=*0x%x)", + version, userId, setList, setBuf, funcFixed, funcStat, funcFile, + container, userdata); - return savedata_op(ppu, SAVEDATA_OP_FIXED_LOAD, version, vm::null, 0, setList, setBuf, vm::null, funcFixed, funcStat, funcFile, container, 6, userdata, userId, vm::null); + return savedata_op(ppu, SAVEDATA_OP_FIXED_LOAD, version, vm::null, 0, setList, + setBuf, vm::null, funcFixed, funcStat, funcFile, container, + 6, userdata, userId, vm::null); } -error_code cellSaveDataUserAutoSave(ppu_thread& ppu, u32 version, u32 userId, vm::cptr dirName, u32 errDialog, PSetBuf setBuf, PFuncStat funcStat, PFuncFile funcFile, u32 container, vm::ptr userdata) +error_code cellSaveDataUserAutoSave(ppu_thread& ppu, u32 version, u32 userId, + vm::cptr dirName, u32 errDialog, + PSetBuf setBuf, PFuncStat funcStat, + PFuncFile funcFile, u32 container, + vm::ptr userdata) { - cellSaveData.error("cellSaveDataUserAutoSave(version=%d, userId=%d, dirName=%s, errDialog=%d, setBuf=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x, userdata=*0x%x)", - version, userId, dirName, errDialog, setBuf, funcStat, funcFile, container, userdata); + cellSaveData.error("cellSaveDataUserAutoSave(version=%d, userId=%d, " + "dirName=%s, errDialog=%d, setBuf=*0x%x, funcStat=*0x%x, " + "funcFile=*0x%x, container=0x%x, userdata=*0x%x)", + version, userId, dirName, errDialog, setBuf, funcStat, + funcFile, container, userdata); - return savedata_op(ppu, SAVEDATA_OP_AUTO_SAVE, version, dirName, errDialog, vm::null, setBuf, vm::null, vm::null, funcStat, funcFile, container, 6, userdata, userId, vm::null); + return savedata_op(ppu, SAVEDATA_OP_AUTO_SAVE, version, dirName, errDialog, + vm::null, setBuf, vm::null, vm::null, funcStat, funcFile, + container, 6, userdata, userId, vm::null); } -error_code cellSaveDataUserAutoLoad(ppu_thread& ppu, u32 version, u32 userId, vm::cptr dirName, u32 errDialog, PSetBuf setBuf, PFuncStat funcStat, PFuncFile funcFile, u32 container, vm::ptr userdata) +error_code cellSaveDataUserAutoLoad(ppu_thread& ppu, u32 version, u32 userId, + vm::cptr dirName, u32 errDialog, + PSetBuf setBuf, PFuncStat funcStat, + PFuncFile funcFile, u32 container, + vm::ptr userdata) { - cellSaveData.error("cellSaveDataUserAutoLoad(version=%d, userId=%d, dirName=%s, errDialog=%d, setBuf=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x, userdata=*0x%x)", - version, userId, dirName, errDialog, setBuf, funcStat, funcFile, container, userdata); + cellSaveData.error("cellSaveDataUserAutoLoad(version=%d, userId=%d, " + "dirName=%s, errDialog=%d, setBuf=*0x%x, funcStat=*0x%x, " + "funcFile=*0x%x, container=0x%x, userdata=*0x%x)", + version, userId, dirName, errDialog, setBuf, funcStat, + funcFile, container, userdata); - return savedata_op(ppu, SAVEDATA_OP_AUTO_LOAD, version, dirName, errDialog, vm::null, setBuf, vm::null, vm::null, funcStat, funcFile, container, 6, userdata, userId, vm::null); + return savedata_op(ppu, SAVEDATA_OP_AUTO_LOAD, version, dirName, errDialog, + vm::null, setBuf, vm::null, vm::null, funcStat, funcFile, + container, 6, userdata, userId, vm::null); } -error_code cellSaveDataUserListAutoSave(ppu_thread& ppu, u32 version, u32 userId, u32 errDialog, PSetList setList, PSetBuf setBuf, PFuncFixed funcFixed, PFuncStat funcStat, PFuncFile funcFile, u32 container, vm::ptr userdata) +error_code cellSaveDataUserListAutoSave(ppu_thread& ppu, u32 version, + u32 userId, u32 errDialog, + PSetList setList, PSetBuf setBuf, + PFuncFixed funcFixed, + PFuncStat funcStat, PFuncFile funcFile, + u32 container, vm::ptr userdata) { - cellSaveData.error("cellSaveDataUserListAutoSave(version=%d, userId=%d, errDialog=%d, setList=*0x%x, setBuf=*0x%x, funcFixed=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x, userdata=*0x%x)", - version, userId, errDialog, setList, setBuf, funcFixed, funcStat, funcFile, container, userdata); + cellSaveData.error( + "cellSaveDataUserListAutoSave(version=%d, userId=%d, errDialog=%d, " + "setList=*0x%x, setBuf=*0x%x, funcFixed=*0x%x, funcStat=*0x%x, " + "funcFile=*0x%x, container=0x%x, userdata=*0x%x)", + version, userId, errDialog, setList, setBuf, funcFixed, funcStat, + funcFile, container, userdata); - return savedata_op(ppu, SAVEDATA_OP_LIST_AUTO_SAVE, version, vm::null, errDialog, setList, setBuf, vm::null, funcFixed, funcStat, funcFile, container, 6, userdata, userId, vm::null); + return savedata_op(ppu, SAVEDATA_OP_LIST_AUTO_SAVE, version, vm::null, + errDialog, setList, setBuf, vm::null, funcFixed, funcStat, + funcFile, container, 6, userdata, userId, vm::null); } -error_code cellSaveDataUserListAutoLoad(ppu_thread& ppu, u32 version, u32 userId, u32 errDialog, PSetList setList, PSetBuf setBuf, PFuncFixed funcFixed, PFuncStat funcStat, PFuncFile funcFile, u32 container, vm::ptr userdata) +error_code cellSaveDataUserListAutoLoad(ppu_thread& ppu, u32 version, + u32 userId, u32 errDialog, + PSetList setList, PSetBuf setBuf, + PFuncFixed funcFixed, + PFuncStat funcStat, PFuncFile funcFile, + u32 container, vm::ptr userdata) { - cellSaveData.error("cellSaveDataUserListAutoLoad(version=%d, userId=%d, errDialog=%d, setList=*0x%x, setBuf=*0x%x, funcFixed=*0x%x, funcStat=*0x%x, funcFile=*0x%x, container=0x%x, userdata=*0x%x)", - version, userId, errDialog, setList, setBuf, funcFixed, funcStat, funcFile, container, userdata); + cellSaveData.error( + "cellSaveDataUserListAutoLoad(version=%d, userId=%d, errDialog=%d, " + "setList=*0x%x, setBuf=*0x%x, funcFixed=*0x%x, funcStat=*0x%x, " + "funcFile=*0x%x, container=0x%x, userdata=*0x%x)", + version, userId, errDialog, setList, setBuf, funcFixed, funcStat, + funcFile, container, userdata); - return savedata_op(ppu, SAVEDATA_OP_LIST_AUTO_LOAD, version, vm::null, errDialog, setList, setBuf, vm::null, funcFixed, funcStat, funcFile, container, 6, userdata, userId, vm::null); + return savedata_op(ppu, SAVEDATA_OP_LIST_AUTO_LOAD, version, vm::null, + errDialog, setList, setBuf, vm::null, funcFixed, funcStat, + funcFile, container, 6, userdata, userId, vm::null); } -error_code cellSaveDataUserFixedDelete(ppu_thread& ppu, u32 userId, PSetList setList, PSetBuf setBuf, PFuncFixed funcFixed, PFuncDone funcDone, u32 container, vm::ptr userdata) +error_code cellSaveDataUserFixedDelete(ppu_thread& ppu, u32 userId, + PSetList setList, PSetBuf setBuf, + PFuncFixed funcFixed, PFuncDone funcDone, + u32 container, vm::ptr userdata) { - cellSaveData.error("cellSaveDataUserFixedDelete(userId=%d, setList=*0x%x, setBuf=*0x%x, funcFixed=*0x%x, funcDone=*0x%x, container=0x%x, userdata=*0x%x)", + cellSaveData.error( + "cellSaveDataUserFixedDelete(userId=%d, setList=*0x%x, setBuf=*0x%x, " + "funcFixed=*0x%x, funcDone=*0x%x, container=0x%x, userdata=*0x%x)", userId, setList, setBuf, funcFixed, funcDone, container, userdata); - return savedata_op(ppu, SAVEDATA_OP_FIXED_DELETE, 0, vm::null, 1, setList, setBuf, vm::null, funcFixed, vm::null, vm::null, container, 6, userdata, userId, funcDone); + return savedata_op(ppu, SAVEDATA_OP_FIXED_DELETE, 0, vm::null, 1, setList, + setBuf, vm::null, funcFixed, vm::null, vm::null, container, + 6, userdata, userId, funcDone); } void cellSaveDataEnableOverlay(s32 enable) @@ -2494,11 +2964,19 @@ void cellSaveDataEnableOverlay(s32 enable) } // Functions (Extensions) -error_code cellSaveDataListDelete(ppu_thread& ppu, PSetList setList, PSetBuf setBuf, PFuncList funcList, PFuncDone funcDone, u32 container, vm::ptr userdata) +error_code cellSaveDataListDelete(ppu_thread& ppu, PSetList setList, + PSetBuf setBuf, PFuncList funcList, + PFuncDone funcDone, u32 container, + vm::ptr userdata) { - cellSaveData.warning("cellSaveDataListDelete(setList=*0x%x, setBuf=*0x%x, funcList=*0x%x, funcDone=*0x%x, container=0x%x, userdata=*0x%x)", setList, setBuf, funcList, funcDone, container, userdata); + cellSaveData.warning( + "cellSaveDataListDelete(setList=*0x%x, setBuf=*0x%x, funcList=*0x%x, " + "funcDone=*0x%x, container=0x%x, userdata=*0x%x)", + setList, setBuf, funcList, funcDone, container, userdata); - return savedata_op(ppu, SAVEDATA_OP_LIST_DELETE, 0, vm::null, 0, setList, setBuf, funcList, vm::null, vm::null, vm::null, container, 0x40, userdata, 0, funcDone); + return savedata_op(ppu, SAVEDATA_OP_LIST_DELETE, 0, vm::null, 0, setList, + setBuf, funcList, vm::null, vm::null, vm::null, container, + 0x40, userdata, 0, funcDone); } // Temporarily @@ -2506,12 +2984,18 @@ error_code cellSaveDataListDelete(ppu_thread& ppu, PSetList setList, PSetBuf set #pragma GCC diagnostic ignored "-Wunused-parameter" #endif -error_code cellSaveDataListImport(ppu_thread& ppu, PSetList setList, u32 maxSizeKB, PFuncDone funcDone, u32 container, vm::ptr userdata) +error_code cellSaveDataListImport(ppu_thread& ppu, PSetList setList, + u32 maxSizeKB, PFuncDone funcDone, + u32 container, vm::ptr userdata) { - cellSaveData.todo("cellSaveDataListImport(setList=*0x%x, maxSizeKB=%d, funcDone=*0x%x, container=0x%x, userdata=*0x%x)", setList, maxSizeKB, funcDone, container, userdata); + cellSaveData.todo("cellSaveDataListImport(setList=*0x%x, maxSizeKB=%d, " + "funcDone=*0x%x, container=0x%x, userdata=*0x%x)", + setList, maxSizeKB, funcDone, container, userdata); - if (const auto ecode = savedata_check_args(SAVEDATA_OP_LIST_IMPORT, CELL_SAVEDATA_VERSION_OLD, vm::null, CELL_SAVEDATA_ERRDIALOG_NONE, - setList, vm::null, vm::null, vm::null, vm::null, vm::null, container, 0x40, userdata, 0, funcDone)) + if (const auto ecode = savedata_check_args( + SAVEDATA_OP_LIST_IMPORT, CELL_SAVEDATA_VERSION_OLD, vm::null, + CELL_SAVEDATA_ERRDIALOG_NONE, setList, vm::null, vm::null, vm::null, + vm::null, vm::null, container, 0x40, userdata, 0, funcDone)) { return {CELL_SAVEDATA_ERROR_PARAM, " (error %d)", ecode}; } @@ -2521,12 +3005,18 @@ error_code cellSaveDataListImport(ppu_thread& ppu, PSetList setList, u32 maxSize return CELL_OK; } -error_code cellSaveDataListExport(ppu_thread& ppu, PSetList setList, u32 maxSizeKB, PFuncDone funcDone, u32 container, vm::ptr userdata) +error_code cellSaveDataListExport(ppu_thread& ppu, PSetList setList, + u32 maxSizeKB, PFuncDone funcDone, + u32 container, vm::ptr userdata) { - cellSaveData.todo("cellSaveDataListExport(setList=*0x%x, maxSizeKB=%d, funcDone=*0x%x, container=0x%x, userdata=*0x%x)", setList, maxSizeKB, funcDone, container, userdata); + cellSaveData.todo("cellSaveDataListExport(setList=*0x%x, maxSizeKB=%d, " + "funcDone=*0x%x, container=0x%x, userdata=*0x%x)", + setList, maxSizeKB, funcDone, container, userdata); - if (const auto ecode = savedata_check_args(SAVEDATA_OP_LIST_EXPORT, CELL_SAVEDATA_VERSION_OLD, vm::null, CELL_SAVEDATA_ERRDIALOG_NONE, - setList, vm::null, vm::null, vm::null, vm::null, vm::null, container, 0x40, userdata, 0, funcDone)) + if (const auto ecode = savedata_check_args( + SAVEDATA_OP_LIST_EXPORT, CELL_SAVEDATA_VERSION_OLD, vm::null, + CELL_SAVEDATA_ERRDIALOG_NONE, setList, vm::null, vm::null, vm::null, + vm::null, vm::null, container, 0x40, userdata, 0, funcDone)) { return {CELL_SAVEDATA_ERROR_PARAM, " (error %d)", ecode}; } @@ -2536,12 +3026,18 @@ error_code cellSaveDataListExport(ppu_thread& ppu, PSetList setList, u32 maxSize return CELL_OK; } -error_code cellSaveDataFixedImport(ppu_thread& ppu, vm::cptr dirName, u32 maxSizeKB, PFuncDone funcDone, u32 container, vm::ptr userdata) +error_code cellSaveDataFixedImport(ppu_thread& ppu, vm::cptr dirName, + u32 maxSizeKB, PFuncDone funcDone, + u32 container, vm::ptr userdata) { - cellSaveData.todo("cellSaveDataFixedImport(dirName=%s, maxSizeKB=%d, funcDone=*0x%x, container=0x%x, userdata=*0x%x)", dirName, maxSizeKB, funcDone, container, userdata); + cellSaveData.todo("cellSaveDataFixedImport(dirName=%s, maxSizeKB=%d, " + "funcDone=*0x%x, container=0x%x, userdata=*0x%x)", + dirName, maxSizeKB, funcDone, container, userdata); - if (const auto ecode = savedata_check_args(SAVEDATA_OP_FIXED_IMPORT, CELL_SAVEDATA_VERSION_OLD, dirName, CELL_SAVEDATA_ERRDIALOG_NONE, - vm::null, vm::null, vm::null, vm::null, vm::null, vm::null, container, 0x44, userdata, 0, funcDone)) + if (const auto ecode = savedata_check_args( + SAVEDATA_OP_FIXED_IMPORT, CELL_SAVEDATA_VERSION_OLD, dirName, + CELL_SAVEDATA_ERRDIALOG_NONE, vm::null, vm::null, vm::null, vm::null, + vm::null, vm::null, container, 0x44, userdata, 0, funcDone)) { return {CELL_SAVEDATA_ERROR_PARAM, " (error %d)", ecode}; } @@ -2551,12 +3047,18 @@ error_code cellSaveDataFixedImport(ppu_thread& ppu, vm::cptr dirName, u32 return CELL_OK; } -error_code cellSaveDataFixedExport(ppu_thread& ppu, vm::cptr dirName, u32 maxSizeKB, PFuncDone funcDone, u32 container, vm::ptr userdata) +error_code cellSaveDataFixedExport(ppu_thread& ppu, vm::cptr dirName, + u32 maxSizeKB, PFuncDone funcDone, + u32 container, vm::ptr userdata) { - cellSaveData.todo("cellSaveDataFixedExport(dirName=%s, maxSizeKB=%d, funcDone=*0x%x, container=0x%x, userdata=*0x%x)", dirName, maxSizeKB, funcDone, container, userdata); + cellSaveData.todo("cellSaveDataFixedExport(dirName=%s, maxSizeKB=%d, " + "funcDone=*0x%x, container=0x%x, userdata=*0x%x)", + dirName, maxSizeKB, funcDone, container, userdata); - if (const auto ecode = savedata_check_args(SAVEDATA_OP_FIXED_EXPORT, CELL_SAVEDATA_VERSION_OLD, dirName, CELL_SAVEDATA_ERRDIALOG_NONE, - vm::null, vm::null, vm::null, vm::null, vm::null, vm::null, container, 0x44, userdata, 0, funcDone)) + if (const auto ecode = savedata_check_args( + SAVEDATA_OP_FIXED_EXPORT, CELL_SAVEDATA_VERSION_OLD, dirName, + CELL_SAVEDATA_ERRDIALOG_NONE, vm::null, vm::null, vm::null, vm::null, + vm::null, vm::null, container, 0x44, userdata, 0, funcDone)) { return {CELL_SAVEDATA_ERROR_PARAM, " (error %d)", ecode}; } @@ -2566,28 +3068,50 @@ error_code cellSaveDataFixedExport(ppu_thread& ppu, vm::cptr dirName, u32 return CELL_OK; } -error_code cellSaveDataGetListItem(ppu_thread& ppu, vm::cptr dirName, vm::ptr dir, vm::ptr sysFileParam, vm::ptr bind, vm::ptr sizeKB) +error_code +cellSaveDataGetListItem(ppu_thread& ppu, vm::cptr dirName, + vm::ptr dir, + vm::ptr sysFileParam, + vm::ptr bind, vm::ptr sizeKB) { ppu.state += cpu_flag::wait; - cellSaveData.warning("cellSaveDataGetListItem(dirName=%s, dir=*0x%x, sysFileParam=*0x%x, bind=*0x%x, sizeKB=*0x%x)", dirName, dir, sysFileParam, bind, sizeKB); + cellSaveData.warning("cellSaveDataGetListItem(dirName=%s, dir=*0x%x, " + "sysFileParam=*0x%x, bind=*0x%x, sizeKB=*0x%x)", + dirName, dir, sysFileParam, bind, sizeKB); return savedata_get_list_item(dirName, dir, sysFileParam, bind, sizeKB, 0); } -error_code cellSaveDataUserListDelete(ppu_thread& ppu, u32 userId, PSetList setList, PSetBuf setBuf, PFuncList funcList, PFuncDone funcDone, u32 container, vm::ptr userdata) +error_code cellSaveDataUserListDelete(ppu_thread& ppu, u32 userId, + PSetList setList, PSetBuf setBuf, + PFuncList funcList, PFuncDone funcDone, + u32 container, vm::ptr userdata) { - cellSaveData.error("cellSaveDataUserListDelete(userId=%d, setList=*0x%x, setBuf=*0x%x, funcList=*0x%x, funcDone=*0x%x, container=0x%x, userdata=*0x%x)", userId, setList, setBuf, funcList, funcDone, container, userdata); + cellSaveData.error( + "cellSaveDataUserListDelete(userId=%d, setList=*0x%x, setBuf=*0x%x, " + "funcList=*0x%x, funcDone=*0x%x, container=0x%x, userdata=*0x%x)", + userId, setList, setBuf, funcList, funcDone, container, userdata); - return savedata_op(ppu, SAVEDATA_OP_LIST_DELETE, 0, vm::null, 0, setList, setBuf, funcList, vm::null, vm::null, vm::null, container, 0x40, userdata, userId, funcDone); + return savedata_op(ppu, SAVEDATA_OP_LIST_DELETE, 0, vm::null, 0, setList, + setBuf, funcList, vm::null, vm::null, vm::null, container, + 0x40, userdata, userId, funcDone); } -error_code cellSaveDataUserListImport(ppu_thread& ppu, u32 userId, PSetList setList, u32 maxSizeKB, PFuncDone funcDone, u32 container, vm::ptr userdata) +error_code cellSaveDataUserListImport(ppu_thread& ppu, u32 userId, + PSetList setList, u32 maxSizeKB, + PFuncDone funcDone, u32 container, + vm::ptr userdata) { - cellSaveData.todo("cellSaveDataUserListImport(userId=%d, setList=*0x%x, maxSizeKB=%d, funcDone=*0x%x, container=0x%x, userdata=*0x%x)", userId, setList, maxSizeKB, funcDone, container, userdata); + cellSaveData.todo( + "cellSaveDataUserListImport(userId=%d, setList=*0x%x, maxSizeKB=%d, " + "funcDone=*0x%x, container=0x%x, userdata=*0x%x)", + userId, setList, maxSizeKB, funcDone, container, userdata); - if (const auto ecode = savedata_check_args(SAVEDATA_OP_LIST_IMPORT, CELL_SAVEDATA_VERSION_OLD, vm::null, CELL_SAVEDATA_ERRDIALOG_NONE, - setList, vm::null, vm::null, vm::null, vm::null, vm::null, container, 0x44, userdata, userId, funcDone)) + if (const auto ecode = savedata_check_args( + SAVEDATA_OP_LIST_IMPORT, CELL_SAVEDATA_VERSION_OLD, vm::null, + CELL_SAVEDATA_ERRDIALOG_NONE, setList, vm::null, vm::null, vm::null, + vm::null, vm::null, container, 0x44, userdata, userId, funcDone)) { return {CELL_SAVEDATA_ERROR_PARAM, " (error %d)", ecode}; } @@ -2597,12 +3121,20 @@ error_code cellSaveDataUserListImport(ppu_thread& ppu, u32 userId, PSetList setL return CELL_OK; } -error_code cellSaveDataUserListExport(ppu_thread& ppu, u32 userId, PSetList setList, u32 maxSizeKB, PFuncDone funcDone, u32 container, vm::ptr userdata) +error_code cellSaveDataUserListExport(ppu_thread& ppu, u32 userId, + PSetList setList, u32 maxSizeKB, + PFuncDone funcDone, u32 container, + vm::ptr userdata) { - cellSaveData.todo("cellSaveDataUserListExport(userId=%d, setList=*0x%x, maxSizeKB=%d, funcDone=*0x%x, container=0x%x, userdata=*0x%x)", userId, setList, maxSizeKB, funcDone, container, userdata); + cellSaveData.todo( + "cellSaveDataUserListExport(userId=%d, setList=*0x%x, maxSizeKB=%d, " + "funcDone=*0x%x, container=0x%x, userdata=*0x%x)", + userId, setList, maxSizeKB, funcDone, container, userdata); - if (const auto ecode = savedata_check_args(SAVEDATA_OP_LIST_EXPORT, CELL_SAVEDATA_VERSION_OLD, vm::null, CELL_SAVEDATA_ERRDIALOG_NONE, - setList, vm::null, vm::null, vm::null, vm::null, vm::null, container, 0x44, userdata, userId, funcDone)) + if (const auto ecode = savedata_check_args( + SAVEDATA_OP_LIST_EXPORT, CELL_SAVEDATA_VERSION_OLD, vm::null, + CELL_SAVEDATA_ERRDIALOG_NONE, setList, vm::null, vm::null, vm::null, + vm::null, vm::null, container, 0x44, userdata, userId, funcDone)) { return {CELL_SAVEDATA_ERROR_PARAM, " (error %d)", ecode}; } @@ -2612,12 +3144,20 @@ error_code cellSaveDataUserListExport(ppu_thread& ppu, u32 userId, PSetList setL return CELL_OK; } -error_code cellSaveDataUserFixedImport(ppu_thread& ppu, u32 userId, vm::cptr dirName, u32 maxSizeKB, PFuncDone funcDone, u32 container, vm::ptr userdata) +error_code cellSaveDataUserFixedImport(ppu_thread& ppu, u32 userId, + vm::cptr dirName, u32 maxSizeKB, + PFuncDone funcDone, u32 container, + vm::ptr userdata) { - cellSaveData.todo("cellSaveDataUserFixedImport(userId=%d, dirName=%s, maxSizeKB=%d, funcDone=*0x%x, container=0x%x, userdata=*0x%x)", userId, dirName, maxSizeKB, funcDone, container, userdata); + cellSaveData.todo( + "cellSaveDataUserFixedImport(userId=%d, dirName=%s, maxSizeKB=%d, " + "funcDone=*0x%x, container=0x%x, userdata=*0x%x)", + userId, dirName, maxSizeKB, funcDone, container, userdata); - if (const auto ecode = savedata_check_args(SAVEDATA_OP_FIXED_IMPORT, CELL_SAVEDATA_VERSION_OLD, dirName, CELL_SAVEDATA_ERRDIALOG_NONE, - vm::null, vm::null, vm::null, vm::null, vm::null, vm::null, container, 0x44, userdata, userId, funcDone)) + if (const auto ecode = savedata_check_args( + SAVEDATA_OP_FIXED_IMPORT, CELL_SAVEDATA_VERSION_OLD, dirName, + CELL_SAVEDATA_ERRDIALOG_NONE, vm::null, vm::null, vm::null, vm::null, + vm::null, vm::null, container, 0x44, userdata, userId, funcDone)) { return {CELL_SAVEDATA_ERROR_PARAM, " (error %d)", ecode}; } @@ -2627,12 +3167,20 @@ error_code cellSaveDataUserFixedImport(ppu_thread& ppu, u32 userId, vm::cptr dirName, u32 maxSizeKB, PFuncDone funcDone, u32 container, vm::ptr userdata) +error_code cellSaveDataUserFixedExport(ppu_thread& ppu, u32 userId, + vm::cptr dirName, u32 maxSizeKB, + PFuncDone funcDone, u32 container, + vm::ptr userdata) { - cellSaveData.todo("cellSaveDataUserFixedExport(userId=%d, dirName=%s, maxSizeKB=%d, funcDone=*0x%x, container=0x%x, userdata=*0x%x)", userId, dirName, maxSizeKB, funcDone, container, userdata); + cellSaveData.todo( + "cellSaveDataUserFixedExport(userId=%d, dirName=%s, maxSizeKB=%d, " + "funcDone=*0x%x, container=0x%x, userdata=*0x%x)", + userId, dirName, maxSizeKB, funcDone, container, userdata); - if (const auto ecode = savedata_check_args(SAVEDATA_OP_FIXED_EXPORT, CELL_SAVEDATA_VERSION_OLD, dirName, CELL_SAVEDATA_ERRDIALOG_NONE, - vm::null, vm::null, vm::null, vm::null, vm::null, vm::null, container, 0x44, userdata, userId, funcDone)) + if (const auto ecode = savedata_check_args( + SAVEDATA_OP_FIXED_EXPORT, CELL_SAVEDATA_VERSION_OLD, dirName, + CELL_SAVEDATA_ERRDIALOG_NONE, vm::null, vm::null, vm::null, vm::null, + vm::null, vm::null, container, 0x44, userdata, userId, funcDone)) { return {CELL_SAVEDATA_ERROR_PARAM, " (error %d)", ecode}; } @@ -2642,11 +3190,19 @@ error_code cellSaveDataUserFixedExport(ppu_thread& ppu, u32 userId, vm::cptr dirName, vm::ptr dir, vm::ptr sysFileParam, vm::ptr bind, vm::ptr sizeKB) +error_code +cellSaveDataUserGetListItem(u32 userId, vm::cptr dirName, + vm::ptr dir, + vm::ptr sysFileParam, + vm::ptr bind, vm::ptr sizeKB) { - cellSaveData.warning("cellSaveDataUserGetListItem(dirName=%s, dir=*0x%x, sysFileParam=*0x%x, bind=*0x%x, sizeKB=*0x%x, userID=*0x%x)", dirName, dir, sysFileParam, bind, sizeKB, userId); + cellSaveData.warning( + "cellSaveDataUserGetListItem(dirName=%s, dir=*0x%x, sysFileParam=*0x%x, " + "bind=*0x%x, sizeKB=*0x%x, userID=*0x%x)", + dirName, dir, sysFileParam, bind, sizeKB, userId); - return savedata_get_list_item(dirName, dir, sysFileParam, bind, sizeKB, userId); + return savedata_get_list_item(dirName, dir, sysFileParam, bind, sizeKB, + userId); } void cellSysutil_SaveData_init() diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellScreenshot.cpp b/ps3fw/cellScreenshot.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellScreenshot.cpp rename to ps3fw/cellScreenshot.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellSearch.cpp b/ps3fw/cellSearch.cpp similarity index 68% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellSearch.cpp rename to ps3fw/cellSearch.cpp index 57f888e44..4e62b863c 100644 --- a/rpcs3/rpcs3/Emu/Cell/Modules/cellSearch.cpp +++ b/ps3fw/cellSearch.cpp @@ -1,13 +1,13 @@ -#include "stdafx.h" -#include "Emu/VFS.h" -#include "Emu/IdManager.h" #include "Emu/Cell/PPUModule.h" +#include "Emu/IdManager.h" +#include "Emu/VFS.h" #include "cellMusic.h" #include "cellSysutil.h" +#include "stdafx.h" #include #include "cellSearch.h" -#include "Utilities/StrUtil.h" +#include "util/StrUtil.h" #include "util/media_utils.h" #include @@ -116,7 +116,9 @@ struct search_object_t std::vector content_ids; }; -static const std::string link_base = "/dev_hdd0/.tmp/"; // WipEout HD does not like it if we return a path starting with "/.tmp", so let's use "/dev_hdd0" +static const std::string link_base = + "/dev_hdd0/.tmp/"; // WipEout HD does not like it if we return a path + // starting with "/.tmp", so let's use "/dev_hdd0" error_code check_search_state(search_state state, search_state action) { @@ -193,18 +195,26 @@ error_code check_search_state(search_state state, search_state action) return CELL_OK; } -void populate_music_info(CellSearchMusicInfo& info, const utils::media_info& mi, const fs::dir_entry& item) +void populate_music_info(CellSearchMusicInfo& info, const utils::media_info& mi, + const fs::dir_entry& item) { - parse_metadata(info.artistName, mi, "artist", "Unknown Artist", CELL_SEARCH_TITLE_LEN_MAX); - parse_metadata(info.albumTitle, mi, "album", "Unknown Album", CELL_SEARCH_TITLE_LEN_MAX); - parse_metadata(info.genreName, mi, "genre", "Unknown Genre", CELL_SEARCH_TITLE_LEN_MAX); - parse_metadata(info.title, mi, "title", item.name.substr(0, item.name.find_last_of('.')), CELL_SEARCH_TITLE_LEN_MAX); - parse_metadata(info.diskNumber, mi, "disc", "1/1", sizeof(info.diskNumber) - 1); + parse_metadata(info.artistName, mi, "artist", "Unknown Artist", + CELL_SEARCH_TITLE_LEN_MAX); + parse_metadata(info.albumTitle, mi, "album", "Unknown Album", + CELL_SEARCH_TITLE_LEN_MAX); + parse_metadata(info.genreName, mi, "genre", "Unknown Genre", + CELL_SEARCH_TITLE_LEN_MAX); + parse_metadata(info.title, mi, "title", + item.name.substr(0, item.name.find_last_of('.')), + CELL_SEARCH_TITLE_LEN_MAX); + parse_metadata(info.diskNumber, mi, "disc", "1/1", + sizeof(info.diskNumber) - 1); // Special case: track is usually stored as e.g. 2/11 const std::string tmp = mi.get_metadata("track", ""s); s64 value{}; - if (tmp.empty() || !try_to_int64(&value, tmp.substr(0, tmp.find('/')).c_str(), s32{smin}, s32{smax})) + if (tmp.empty() || !try_to_int64(&value, tmp.substr(0, tmp.find('/')).c_str(), + s32{smin}, s32{smax})) { value = -1; } @@ -215,11 +225,12 @@ void populate_music_info(CellSearchMusicInfo& info, const utils::media_info& mi, info.duration = mi.duration_us / 1000; // we need microseconds info.samplingRate = mi.sample_rate; info.bitrate = mi.audio_bitrate_bps; - info.quantizationBitrate = mi.audio_bitrate_bps; // TODO: Assumption, verify value - info.playCount = 0; // we do not track this for now - info.lastPlayedDate = -1; // we do not track this for now - info.importedDate = -1; // we do not track this for now - info.drmEncrypted = 0; // TODO: Needs to be 1 if it's encrypted + info.quantizationBitrate = + mi.audio_bitrate_bps; // TODO: Assumption, verify value + info.playCount = 0; // we do not track this for now + info.lastPlayedDate = -1; // we do not track this for now + info.importedDate = -1; // we do not track this for now + info.drmEncrypted = 0; // TODO: Needs to be 1 if it's encrypted info.status = CELL_SEARCH_CONTENTSTATUS_AVAILABLE; // Convert AVCodecID to CellSearchCodec @@ -265,18 +276,28 @@ void populate_music_info(CellSearchMusicInfo& info, const utils::media_info& mi, break; } - cellSearch.notice("CellSearchMusicInfo:, title=%s, albumTitle=%s, artistName=%s, genreName=%s, diskNumber=%s, " - "trackNumber=%d, duration=%d, size=%d, importedDate=%d, lastPlayedDate=%d, releasedYear=%d, bitrate=%d, " - "samplingRate=%d, quantizationBitrate=%d, playCount=%d, drmEncrypted=%d, codec=%d, status=%d", - info.title, info.albumTitle, info.artistName, info.genreName, info.diskNumber, - info.trackNumber, info.duration, info.size, info.importedDate, info.lastPlayedDate, info.releasedYear, info.bitrate, - info.samplingRate, info.quantizationBitrate, info.playCount, info.drmEncrypted, info.codec, info.status); + cellSearch.notice("CellSearchMusicInfo:, title=%s, albumTitle=%s, " + "artistName=%s, genreName=%s, diskNumber=%s, " + "trackNumber=%d, duration=%d, size=%d, importedDate=%d, " + "lastPlayedDate=%d, releasedYear=%d, bitrate=%d, " + "samplingRate=%d, quantizationBitrate=%d, playCount=%d, " + "drmEncrypted=%d, codec=%d, status=%d", + info.title, info.albumTitle, info.artistName, + info.genreName, info.diskNumber, info.trackNumber, + info.duration, info.size, info.importedDate, + info.lastPlayedDate, info.releasedYear, info.bitrate, + info.samplingRate, info.quantizationBitrate, info.playCount, + info.drmEncrypted, info.codec, info.status); } -void populate_video_info(CellSearchVideoInfo& info, const utils::media_info& mi, const fs::dir_entry& item) +void populate_video_info(CellSearchVideoInfo& info, const utils::media_info& mi, + const fs::dir_entry& item) { - parse_metadata(info.albumTitle, mi, "album", "Unknown Album", CELL_SEARCH_TITLE_LEN_MAX); - parse_metadata(info.title, mi, "title", item.name.substr(0, item.name.find_last_of('.')), CELL_SEARCH_TITLE_LEN_MAX); + parse_metadata(info.albumTitle, mi, "album", "Unknown Album", + CELL_SEARCH_TITLE_LEN_MAX); + parse_metadata(info.title, mi, "title", + item.name.substr(0, item.name.find_last_of('.')), + CELL_SEARCH_TITLE_LEN_MAX); info.size = item.size; info.duration = mi.duration_us / 1000; // we need microseconds @@ -371,13 +392,18 @@ void populate_video_info(CellSearchVideoInfo& info, const utils::media_info& mi, break; } - cellSearch.notice("CellSearchVideoInfo: title='%s', albumTitle='%s', duration=%d, size=%d, importedDate=%d, takenDate=%d, " - "videoBitrate=%d, audioBitrate=%d, playCount=%d, drmEncrypted=%d, videoCodec=%d, audioCodec=%d, status=%d", - info.title, info.albumTitle, info.duration, info.size, info.importedDate, info.takenDate, - info.videoBitrate, info.audioBitrate, info.playCount, info.drmEncrypted, info.videoCodec, info.audioCodec, info.status); + cellSearch.notice("CellSearchVideoInfo: title='%s', albumTitle='%s', " + "duration=%d, size=%d, importedDate=%d, takenDate=%d, " + "videoBitrate=%d, audioBitrate=%d, playCount=%d, " + "drmEncrypted=%d, videoCodec=%d, audioCodec=%d, status=%d", + info.title, info.albumTitle, info.duration, info.size, + info.importedDate, info.takenDate, info.videoBitrate, + info.audioBitrate, info.playCount, info.drmEncrypted, + info.videoCodec, info.audioCodec, info.status); } -void populate_photo_info(CellSearchPhotoInfo& info, const utils::media_info& mi, const fs::dir_entry& item) +void populate_photo_info(CellSearchPhotoInfo& info, const utils::media_info& mi, + const fs::dir_entry& item) { // TODO - Some kinda file photo analysis and assign the values as such info.size = item.size; @@ -421,13 +447,21 @@ void populate_photo_info(CellSearchPhotoInfo& info, const utils::media_info& mi, info.codec = CELL_SEARCH_CODEC_UNKNOWN; } - cellSearch.notice("CellSearchPhotoInfo: title='%s', albumTitle='%s', size=%d, width=%d, height=%d, orientation=%d, codec=%d, status=%d, importedDate=%d, takenDate=%d", - info.title, info.albumTitle, info.size, info.width, info.height, info.orientation, info.codec, info.status, info.importedDate, info.takenDate); + cellSearch.notice("CellSearchPhotoInfo: title='%s', albumTitle='%s', " + "size=%d, width=%d, height=%d, orientation=%d, codec=%d, " + "status=%d, importedDate=%d, takenDate=%d", + info.title, info.albumTitle, info.size, info.width, + info.height, info.orientation, info.codec, info.status, + info.importedDate, info.takenDate); } -error_code cellSearchInitialize(CellSearchMode mode, u32 container, vm::ptr func, vm::ptr userData) +error_code cellSearchInitialize(CellSearchMode mode, u32 container, + vm::ptr func, + vm::ptr userData) { - cellSearch.warning("cellSearchInitialize(mode=0x%x, container=0x%x, func=*0x%x, userData=*0x%x)", +mode, container, func, userData); + cellSearch.warning("cellSearchInitialize(mode=0x%x, container=0x%x, " + "func=*0x%x, userData=*0x%x)", + +mode, container, func, userData); if (mode != CELL_SEARCH_MODE_NORMAL) { @@ -441,7 +475,10 @@ error_code cellSearchInitialize(CellSearchMode mode, u32 container, vm::ptrget(); - if (error_code error = check_search_state(search.state.compare_and_swap(search_state::not_initialized, search_state::initializing), search_state::initializing)) + if (error_code error = check_search_state( + search.state.compare_and_swap(search_state::not_initialized, + search_state::initializing), + search_state::initializing)) { return error; } @@ -465,7 +502,10 @@ error_code cellSearchFinalize() auto& search = g_fxo->get(); - if (error_code error = check_search_state(search.state.compare_and_swap(search_state::idle, search_state::finalizing), search_state::finalizing)) + if (error_code error = + check_search_state(search.state.compare_and_swap( + search_state::idle, search_state::finalizing), + search_state::finalizing)) { return error; } @@ -477,16 +517,21 @@ error_code cellSearchFinalize() search.content_links.clear(); } search.state.store(search_state::not_initialized); - search.func(ppu, CELL_SEARCH_EVENT_FINALIZE_RESULT, CELL_OK, vm::null, search.userData); + search.func(ppu, CELL_SEARCH_EVENT_FINALIZE_RESULT, CELL_OK, vm::null, + search.userData); return CELL_OK; }); return CELL_OK; } -error_code cellSearchStartListSearch(CellSearchListSearchType type, CellSearchSortOrder sortOrder, vm::ptr outSearchId) +error_code cellSearchStartListSearch(CellSearchListSearchType type, + CellSearchSortOrder sortOrder, + vm::ptr outSearchId) { - cellSearch.todo("cellSearchStartListSearch(type=0x%x, sortOrder=0x%x, outSearchId=*0x%x)", +type, +sortOrder, outSearchId); + cellSearch.todo( + "cellSearchStartListSearch(type=0x%x, sortOrder=0x%x, outSearchId=*0x%x)", + +type, +sortOrder, outSearchId); if (!outSearchId) { @@ -520,7 +565,8 @@ error_code cellSearchStartListSearch(CellSearchListSearchType type, CellSearchSo return CELL_SEARCH_ERROR_PARAM; } - if (sortOrder != CELL_SEARCH_SORTORDER_ASCENDING && sortOrder != CELL_SEARCH_SORTORDER_DESCENDING) + if (sortOrder != CELL_SEARCH_SORTORDER_ASCENDING && + sortOrder != CELL_SEARCH_SORTORDER_DESCENDING) { return CELL_SEARCH_ERROR_PARAM; } @@ -532,23 +578,29 @@ error_code cellSearchStartListSearch(CellSearchListSearchType type, CellSearchSo auto& search = g_fxo->get(); - if (error_code error = check_search_state(search.state.compare_and_swap(search_state::idle, search_state::in_progress), search_state::in_progress)) + if (error_code error = + check_search_state(search.state.compare_and_swap( + search_state::idle, search_state::in_progress), + search_state::in_progress)) { return error; } const u32 id = *outSearchId = idm::make(); - sysutil_register_cb([=, &content_map = g_fxo->get(), &search](ppu_thread& ppu) -> s32 + sysutil_register_cb([=, &content_map = g_fxo->get(), + &search](ppu_thread& ppu) -> s32 { auto curr_search = idm::get_unlocked(id); vm::var resultParam; resultParam->searchId = id; resultParam->resultNum = 0; // Set again later - std::function searchInFolder = [&, type](const std::string& vpath) + std::function searchInFolder = + [&, type](const std::string& vpath) { - // TODO: this is just a workaround. On a real PS3 the playlists seem to be stored in dev_hdd0/mms/db/metadata_db_hdd + // TODO: this is just a workaround. On a real PS3 the playlists seem + // to be stored in dev_hdd0/mms/db/metadata_db_hdd std::vector dirs_sorted; @@ -613,20 +665,28 @@ error_code cellSearchStartListSearch(CellSearchListSearchType type, CellSearchSo const u64 hash = std::hash()(item_path); auto found = content_map.map.find(hash); - if (found == content_map.map.end()) // content isn't yet being tracked + if (found == + content_map.map.end()) // content isn't yet being tracked { - shared_ptr curr_find = make_shared(); + shared_ptr curr_find = + make_shared(); if (item_path.length() > CELL_SEARCH_PATH_LEN_MAX) { - // TODO: Create mapping which will be resolved to an actual hard link in VFS by cellSearchPrepareFile - cellSearch.warning("cellSearchStartListSearch(): Directory-Path \"%s\" is too long and will be omitted: %i", item_path, item_path.length()); + // TODO: Create mapping which will be resolved to an actual hard + // link in VFS by cellSearchPrepareFile + cellSearch.warning( + "cellSearchStartListSearch(): Directory-Path \"%s\" is too " + "long and will be omitted: %i", + item_path, item_path.length()); continue; // const size_t ext_offset = item.name.find_last_of('.'); - // std::string link = link_base + std::to_string(hash) + item.name.substr(ext_offset); + // std::string link = link_base + std::to_string(hash) + + // item.name.substr(ext_offset); // strcpy_trunc(curr_find->infoPath.contentPath, link); // std::lock_guard lock(search.links_mutex); - // search.content_links.emplace(std::move(link), search_info::link_data{ .path = item_path, .is_dir = true }); + // search.content_links.emplace(std::move(link), + // search_info::link_data{ .path = item_path, .is_dir = true }); } else { @@ -647,14 +707,18 @@ error_code cellSearchStartListSearch(CellSearchListSearchType type, CellSearchSo { curr_find->type = CELL_SEARCH_CONTENTTYPE_MUSICLIST; CellSearchMusicListInfo& info = curr_find->data.music_list; - info.listType = type; // CellSearchListType matches CellSearchListSearchType + info.listType = + type; // CellSearchListType matches CellSearchListSearchType info.numOfItems = numOfItems; info.duration = 0; strcpy_trunc(info.title, item.name); strcpy_trunc(info.artistName, "ARTIST NAME"); - cellSearch.notice("CellSearchMusicListInfo: title='%s', artistName='%s', listType=%d, numOfItems=%d, duration=%d", - info.title, info.artistName, info.listType, info.numOfItems, info.duration); + cellSearch.notice( + "CellSearchMusicListInfo: title='%s', artistName='%s', " + "listType=%d, numOfItems=%d, duration=%d", + info.title, info.artistName, info.listType, info.numOfItems, + info.duration); break; } case CELL_SEARCH_LISTSEARCHTYPE_PHOTO_YEAR: @@ -664,11 +728,13 @@ error_code cellSearchStartListSearch(CellSearchListSearchType type, CellSearchSo { curr_find->type = CELL_SEARCH_CONTENTTYPE_PHOTOLIST; CellSearchPhotoListInfo& info = curr_find->data.photo_list; - info.listType = type; // CellSearchListType matches CellSearchListSearchType + info.listType = + type; // CellSearchListType matches CellSearchListSearchType info.numOfItems = numOfItems; strcpy_trunc(info.title, item.name); - cellSearch.notice("CellSearchPhotoListInfo: title='%s', listType=%d, numOfItems=%d", + cellSearch.notice("CellSearchPhotoListInfo: title='%s', " + "listType=%d, numOfItems=%d", info.title, info.listType, info.numOfItems); break; } @@ -676,37 +742,49 @@ error_code cellSearchStartListSearch(CellSearchListSearchType type, CellSearchSo { curr_find->type = CELL_SEARCH_CONTENTTYPE_VIDEOLIST; CellSearchVideoListInfo& info = curr_find->data.video_list; - info.listType = type; // CellSearchListType matches CellSearchListSearchType + info.listType = + type; // CellSearchListType matches CellSearchListSearchType info.numOfItems = numOfItems; info.duration = 0; strcpy_trunc(info.title, item.name); - cellSearch.notice("CellSearchVideoListInfo: title='%s', listType=%d, numOfItems=%d, duration=%d", - info.title, info.listType, info.numOfItems, info.duration); + cellSearch.notice("CellSearchVideoListInfo: title='%s', " + "listType=%d, numOfItems=%d, duration=%d", + info.title, info.listType, info.numOfItems, + info.duration); break; } case CELL_SEARCH_LISTSEARCHTYPE_NONE: default: { - // Should be unreachable, because it is already handled in the main function + // Should be unreachable, because it is already handled in the + // main function break; } } content_map.map.emplace(hash, curr_find); - curr_search->content_ids.emplace_back(hash, curr_find); // place this file's "ID" into the list of found types + curr_search->content_ids.emplace_back( + hash, curr_find); // place this file's "ID" into the list of + // found types - cellSearch.notice("cellSearchStartListSearch(): CellSearchId: 0x%x, Content ID: %08X, Path: \"%s\"", id, hash, item_path); + cellSearch.notice("cellSearchStartListSearch(): CellSearchId: " + "0x%x, Content ID: %08X, Path: \"%s\"", + id, hash, item_path); } else // list is already stored and tracked { // TODO - // Perform checks to see if the identified list has been modified since last checked - // In which case, update the stored content's properties - // auto content_found = &content_map->at(content_id); - curr_search->content_ids.emplace_back(found->first, found->second); + // Perform checks to see if the identified list has been modified + // since last checked In which case, update the stored content's + // properties auto content_found = &content_map->at(content_id); + curr_search->content_ids.emplace_back(found->first, + found->second); - cellSearch.notice("cellSearchStartListSearch(): Already tracked: CellSearchId: 0x%x, Content ID: %08X, Path: \"%s\"", id, hash, item_path); + cellSearch.notice( + "cellSearchStartListSearch(): Already tracked: CellSearchId: " + "0x%x, Content ID: %08X, Path: \"%s\"", + id, hash, item_path); } } }; @@ -715,16 +793,21 @@ error_code cellSearchStartListSearch(CellSearchListSearchType type, CellSearchSo resultParam->resultNum = ::narrow(curr_search->content_ids.size()); search.state.store(search_state::idle); - search.func(ppu, CELL_SEARCH_EVENT_LISTSEARCH_RESULT, CELL_OK, vm::cast(resultParam.addr()), search.userData); + search.func(ppu, CELL_SEARCH_EVENT_LISTSEARCH_RESULT, CELL_OK, + vm::cast(resultParam.addr()), search.userData); return CELL_OK; }); return CELL_OK; } -error_code cellSearchStartContentSearchInList(vm::cptr listId, CellSearchSortKey sortKey, CellSearchSortOrder sortOrder, vm::ptr outSearchId) +error_code cellSearchStartContentSearchInList( + vm::cptr listId, CellSearchSortKey sortKey, + CellSearchSortOrder sortOrder, vm::ptr outSearchId) { - cellSearch.todo("cellSearchStartContentSearchInList(listId=*0x%x, sortKey=0x%x, sortOrder=0x%x, outSearchId=*0x%x)", listId, +sortKey, +sortOrder, outSearchId); + cellSearch.todo("cellSearchStartContentSearchInList(listId=*0x%x, " + "sortKey=0x%x, sortOrder=0x%x, outSearchId=*0x%x)", + listId, +sortKey, +sortOrder, outSearchId); // Reset values first if (outSearchId) @@ -755,20 +838,25 @@ error_code cellSearchStartContentSearchInList(vm::cptr list return CELL_SEARCH_ERROR_PARAM; } - if (sortOrder != CELL_SEARCH_SORTORDER_ASCENDING && sortOrder != CELL_SEARCH_SORTORDER_DESCENDING) + if (sortOrder != CELL_SEARCH_SORTORDER_ASCENDING && + sortOrder != CELL_SEARCH_SORTORDER_DESCENDING) { return CELL_SEARCH_ERROR_PARAM; } auto& search = g_fxo->get(); - if (error_code error = check_search_state(search.state.compare_and_swap(search_state::idle, search_state::in_progress), search_state::in_progress)) + if (error_code error = + check_search_state(search.state.compare_and_swap( + search_state::idle, search_state::in_progress), + search_state::in_progress)) { return error; } auto& content_map = g_fxo->get(); - auto found = content_map.map.find(*reinterpret_cast(listId->data)); + auto found = + content_map.map.find(*reinterpret_cast(listId->data)); if (found == content_map.map.end()) { // content ID not found, perform a search first @@ -800,14 +888,18 @@ error_code cellSearchStartContentSearchInList(vm::cptr list const u32 id = *outSearchId = idm::make(); - sysutil_register_cb([=, list_path = std::string(content_info->infoPath.contentPath), &search, &content_map](ppu_thread& ppu) -> s32 + sysutil_register_cb([=, + list_path = + std::string(content_info->infoPath.contentPath), + &search, &content_map](ppu_thread& ppu) -> s32 { auto curr_search = idm::get_unlocked(id); vm::var resultParam; resultParam->searchId = id; resultParam->resultNum = 0; // Set again later - std::function searchInFolder = [&, type](const std::string& vpath) + std::function searchInFolder = + [&, type](const std::string& vpath) { std::vector files_sorted; @@ -842,31 +934,39 @@ error_code cellSearchStartContentSearchInList(vm::cptr list }); // clang-format on - // TODO: Use sortKey (CellSearchSortKey) to allow for sorting by category + // TODO: Use sortKey (CellSearchSortKey) to allow for sorting by + // category for (auto&& item : files_sorted) { // TODO - // Perform first check that file is of desired type. For example, don't wanna go - // identifying "AlbumArt.jpg" as an MP3. Hrm... Postpone this thought. Do games - // perform their own checks? DIVA ignores anything without the MP3 extension. + // Perform first check that file is of desired type. For example, + // don't wanna go identifying "AlbumArt.jpg" as an MP3. Hrm... + // Postpone this thought. Do games perform their own checks? DIVA + // ignores anything without the MP3 extension. const std::string item_path(vpath + "/" + item.name); const u64 hash = std::hash()(item_path); auto found = content_map.map.find(hash); - if (found == content_map.map.end()) // content isn't yet being tracked + if (found == + content_map.map.end()) // content isn't yet being tracked { - shared_ptr curr_find = make_shared(); + shared_ptr curr_find = + make_shared(); if (item_path.length() > CELL_SEARCH_PATH_LEN_MAX) { - // Create mapping which will be resolved to an actual hard link in VFS by cellSearchPrepareFile + // Create mapping which will be resolved to an actual hard link + // in VFS by cellSearchPrepareFile const size_t ext_offset = item.name.find_last_of('.'); - std::string link = link_base + std::to_string(hash) + item.name.substr(ext_offset); + std::string link = link_base + std::to_string(hash) + + item.name.substr(ext_offset); strcpy_trunc(curr_find->infoPath.contentPath, link); std::lock_guard lock(search.links_mutex); - search.content_links.emplace(std::move(link), search_info::link_data{.path = item_path, .is_dir = false}); + search.content_links.emplace( + std::move(link), + search_info::link_data{.path = item_path, .is_dir = false}); } else { @@ -882,7 +982,8 @@ error_code cellSearchStartContentSearchInList(vm::cptr list curr_find->type = CELL_SEARCH_CONTENTTYPE_MUSIC; const std::string path = vfs::get(item_path); - const auto [success, mi] = utils::get_media_info(path, 1); // AVMEDIA_TYPE_AUDIO + const auto [success, mi] = + utils::get_media_info(path, 1); // AVMEDIA_TYPE_AUDIO if (!success) { continue; @@ -903,7 +1004,8 @@ error_code cellSearchStartContentSearchInList(vm::cptr list curr_find->type = CELL_SEARCH_CONTENTTYPE_VIDEO; const std::string path = vfs::get(item_path); - const auto [success, mi] = utils::get_media_info(path, 0); // AVMEDIA_TYPE_VIDEO + const auto [success, mi] = + utils::get_media_info(path, 0); // AVMEDIA_TYPE_VIDEO if (!success) { continue; @@ -915,25 +1017,35 @@ error_code cellSearchStartContentSearchInList(vm::cptr list case CELL_SEARCH_CONTENTSEARCHTYPE_NONE: default: { - // Should be unreachable, because it is already handled in the main function + // Should be unreachable, because it is already handled in the + // main function break; } } content_map.map.emplace(hash, curr_find); - curr_search->content_ids.emplace_back(hash, curr_find); // place this file's "ID" into the list of found types + curr_search->content_ids.emplace_back( + hash, curr_find); // place this file's "ID" into the list of + // found types - cellSearch.notice("cellSearchStartContentSearchInList(): CellSearchId: 0x%x, Content ID: %08X, Path: \"%s\"", id, hash, item_path); + cellSearch.notice( + "cellSearchStartContentSearchInList(): CellSearchId: 0x%x, " + "Content ID: %08X, Path: \"%s\"", + id, hash, item_path); } else // file is already stored and tracked { // TODO - // Perform checks to see if the identified file has been modified since last checked - // In which case, update the stored content's properties - // auto content_found = &content_map->at(content_id); - curr_search->content_ids.emplace_back(found->first, found->second); + // Perform checks to see if the identified file has been modified + // since last checked In which case, update the stored content's + // properties auto content_found = &content_map->at(content_id); + curr_search->content_ids.emplace_back(found->first, + found->second); - cellSearch.notice("cellSearchStartContentSearchInList(): Already Tracked: CellSearchId: 0x%x, Content ID: %08X, Path: \"%s\"", id, hash, item_path); + cellSearch.notice( + "cellSearchStartContentSearchInList(): Already Tracked: " + "CellSearchId: 0x%x, Content ID: %08X, Path: \"%s\"", + id, hash, item_path); } } }; @@ -942,16 +1054,22 @@ error_code cellSearchStartContentSearchInList(vm::cptr list resultParam->resultNum = ::narrow(curr_search->content_ids.size()); search.state.store(search_state::idle); - search.func(ppu, CELL_SEARCH_EVENT_CONTENTSEARCH_INLIST_RESULT, CELL_OK, vm::cast(resultParam.addr()), search.userData); + search.func(ppu, CELL_SEARCH_EVENT_CONTENTSEARCH_INLIST_RESULT, CELL_OK, + vm::cast(resultParam.addr()), search.userData); return CELL_OK; }); return CELL_OK; } -error_code cellSearchStartContentSearch(CellSearchContentSearchType type, CellSearchSortKey sortKey, CellSearchSortOrder sortOrder, vm::ptr outSearchId) +error_code cellSearchStartContentSearch(CellSearchContentSearchType type, + CellSearchSortKey sortKey, + CellSearchSortOrder sortOrder, + vm::ptr outSearchId) { - cellSearch.todo("cellSearchStartContentSearch(type=0x%x, sortKey=0x%x, sortOrder=0x%x, outSearchId=*0x%x)", +type, +sortKey, +sortOrder, outSearchId); + cellSearch.todo("cellSearchStartContentSearch(type=0x%x, sortKey=0x%x, " + "sortOrder=0x%x, outSearchId=*0x%x)", + +type, +sortKey, +sortOrder, outSearchId); // Reset values first if (outSearchId) @@ -982,7 +1100,8 @@ error_code cellSearchStartContentSearch(CellSearchContentSearchType type, CellSe return CELL_SEARCH_ERROR_PARAM; } - if (sortOrder != CELL_SEARCH_SORTORDER_ASCENDING && sortOrder != CELL_SEARCH_SORTORDER_DESCENDING) + if (sortOrder != CELL_SEARCH_SORTORDER_ASCENDING && + sortOrder != CELL_SEARCH_SORTORDER_DESCENDING) { return CELL_SEARCH_ERROR_PARAM; } @@ -990,9 +1109,15 @@ error_code cellSearchStartContentSearch(CellSearchContentSearchType type, CellSe const char* media_dir; switch (type) { - case CELL_SEARCH_CONTENTSEARCHTYPE_MUSIC_ALL: media_dir = "music"; break; - case CELL_SEARCH_CONTENTSEARCHTYPE_PHOTO_ALL: media_dir = "photo"; break; - case CELL_SEARCH_CONTENTSEARCHTYPE_VIDEO_ALL: media_dir = "video"; break; + case CELL_SEARCH_CONTENTSEARCHTYPE_MUSIC_ALL: + media_dir = "music"; + break; + case CELL_SEARCH_CONTENTSEARCHTYPE_PHOTO_ALL: + media_dir = "photo"; + break; + case CELL_SEARCH_CONTENTSEARCHTYPE_VIDEO_ALL: + media_dir = "video"; + break; case CELL_SEARCH_CONTENTSEARCHTYPE_NONE: default: return CELL_SEARCH_ERROR_PARAM; @@ -1000,7 +1125,10 @@ error_code cellSearchStartContentSearch(CellSearchContentSearchType type, CellSe auto& search = g_fxo->get(); - if (error_code error = check_search_state(search.state.compare_and_swap(search_state::idle, search_state::in_progress), search_state::in_progress)) + if (error_code error = + check_search_state(search.state.compare_and_swap( + search_state::idle, search_state::in_progress), + search_state::in_progress)) { return error; } @@ -1009,14 +1137,22 @@ error_code cellSearchStartContentSearch(CellSearchContentSearchType type, CellSe { switch (type) { - case CELL_SEARCH_CONTENTSEARCHTYPE_MUSIC_ALL: sortKey = CELL_SEARCH_SORTKEY_ARTISTNAME; break; - case CELL_SEARCH_CONTENTSEARCHTYPE_PHOTO_ALL: sortKey = CELL_SEARCH_SORTKEY_TAKENDATE; break; - case CELL_SEARCH_CONTENTSEARCHTYPE_VIDEO_ALL: sortKey = CELL_SEARCH_SORTKEY_TITLE; break; - default: break; + case CELL_SEARCH_CONTENTSEARCHTYPE_MUSIC_ALL: + sortKey = CELL_SEARCH_SORTKEY_ARTISTNAME; + break; + case CELL_SEARCH_CONTENTSEARCHTYPE_PHOTO_ALL: + sortKey = CELL_SEARCH_SORTKEY_TAKENDATE; + break; + case CELL_SEARCH_CONTENTSEARCHTYPE_VIDEO_ALL: + sortKey = CELL_SEARCH_SORTKEY_TITLE; + break; + default: + break; } } - if (sortKey != CELL_SEARCH_SORTKEY_IMPORTEDDATE && sortKey != CELL_SEARCH_SORTKEY_MODIFIEDDATE) + if (sortKey != CELL_SEARCH_SORTKEY_IMPORTEDDATE && + sortKey != CELL_SEARCH_SORTKEY_MODIFIEDDATE) { switch (type) { @@ -1039,7 +1175,8 @@ error_code cellSearchStartContentSearch(CellSearchContentSearchType type, CellSe { if (sortKey != CELL_SEARCH_SORTKEY_TAKENDATE) { - if (sortOrder != CELL_SEARCH_SORTORDER_ASCENDING || sortKey != CELL_SEARCH_SORTKEY_TITLE) + if (sortOrder != CELL_SEARCH_SORTORDER_ASCENDING || + sortKey != CELL_SEARCH_SORTKEY_TITLE) { return CELL_SEARCH_ERROR_NOT_SUPPORTED_SEARCH; } @@ -1048,28 +1185,34 @@ error_code cellSearchStartContentSearch(CellSearchContentSearchType type, CellSe } case CELL_SEARCH_CONTENTSEARCHTYPE_VIDEO_ALL: { - if (sortOrder != CELL_SEARCH_SORTORDER_ASCENDING || sortKey != CELL_SEARCH_SORTKEY_TITLE) + if (sortOrder != CELL_SEARCH_SORTORDER_ASCENDING || + sortKey != CELL_SEARCH_SORTKEY_TITLE) { return CELL_SEARCH_ERROR_NOT_SUPPORTED_SEARCH; } break; } - default: break; + default: + break; } } const u32 id = *outSearchId = idm::make(); - sysutil_register_cb([=, &content_map = g_fxo->get(), &search](ppu_thread& ppu) -> s32 + sysutil_register_cb([=, &content_map = g_fxo->get(), + &search](ppu_thread& ppu) -> s32 { auto curr_search = idm::get_unlocked(id); vm::var resultParam; resultParam->searchId = id; resultParam->resultNum = 0; // Set again later - std::function searchInFolder = [&, type](const std::string& vpath, const std::string& prev) + std::function + searchInFolder = [&, type](const std::string& vpath, + const std::string& prev) { - const std::string relative_vpath = (!prev.empty() ? prev + "/" : "") + vpath; + const std::string relative_vpath = + (!prev.empty() ? prev + "/" : "") + vpath; for (auto&& item : fs::dir(vfs::get(relative_vpath))) { @@ -1087,27 +1230,35 @@ error_code cellSearchStartContentSearch(CellSearchContentSearchType type, CellSe } // TODO - // Perform first check that file is of desired type. For example, don't wanna go - // identifying "AlbumArt.jpg" as an MP3. Hrm... Postpone this thought. Do games - // perform their own checks? DIVA ignores anything without the MP3 extension. + // Perform first check that file is of desired type. For example, + // don't wanna go identifying "AlbumArt.jpg" as an MP3. Hrm... + // Postpone this thought. Do games perform their own checks? DIVA + // ignores anything without the MP3 extension. - // TODO - Identify sorting method and insert the appropriate values where applicable + // TODO - Identify sorting method and insert the appropriate values + // where applicable const std::string item_path(relative_vpath + "/" + item.name); const u64 hash = std::hash()(item_path); auto found = content_map.map.find(hash); - if (found == content_map.map.end()) // content isn't yet being tracked + if (found == + content_map.map.end()) // content isn't yet being tracked { - shared_ptr curr_find = make_shared(); + shared_ptr curr_find = + make_shared(); if (item_path.length() > CELL_SEARCH_PATH_LEN_MAX) { - // Create mapping which will be resolved to an actual hard link in VFS by cellSearchPrepareFile + // Create mapping which will be resolved to an actual hard link + // in VFS by cellSearchPrepareFile const size_t ext_offset = item.name.find_last_of('.'); - std::string link = link_base + std::to_string(hash) + item.name.substr(ext_offset); + std::string link = link_base + std::to_string(hash) + + item.name.substr(ext_offset); strcpy_trunc(curr_find->infoPath.contentPath, link); std::lock_guard lock(search.links_mutex); - search.content_links.emplace(std::move(link), search_info::link_data{.path = item_path, .is_dir = false}); + search.content_links.emplace( + std::move(link), + search_info::link_data{.path = item_path, .is_dir = false}); } else { @@ -1123,7 +1274,8 @@ error_code cellSearchStartContentSearch(CellSearchContentSearchType type, CellSe curr_find->type = CELL_SEARCH_CONTENTTYPE_MUSIC; const std::string path = vfs::get(item_path); - const auto [success, mi] = utils::get_media_info(path, 1); // AVMEDIA_TYPE_AUDIO + const auto [success, mi] = + utils::get_media_info(path, 1); // AVMEDIA_TYPE_AUDIO if (!success) { continue; @@ -1144,7 +1296,8 @@ error_code cellSearchStartContentSearch(CellSearchContentSearchType type, CellSe curr_find->type = CELL_SEARCH_CONTENTTYPE_VIDEO; const std::string path = vfs::get(item_path); - const auto [success, mi] = utils::get_media_info(path, 0); // AVMEDIA_TYPE_VIDEO + const auto [success, mi] = + utils::get_media_info(path, 0); // AVMEDIA_TYPE_VIDEO if (!success) { continue; @@ -1156,25 +1309,34 @@ error_code cellSearchStartContentSearch(CellSearchContentSearchType type, CellSe case CELL_SEARCH_CONTENTSEARCHTYPE_NONE: default: { - // Should be unreachable, because it is already handled in the main function + // Should be unreachable, because it is already handled in the + // main function break; } } content_map.map.emplace(hash, curr_find); - curr_search->content_ids.emplace_back(hash, curr_find); // place this file's "ID" into the list of found types + curr_search->content_ids.emplace_back( + hash, curr_find); // place this file's "ID" into the list of + // found types - cellSearch.notice("cellSearchStartContentSearch(): CellSearchId: 0x%x, Content ID: %08X, Path: \"%s\"", id, hash, item_path); + cellSearch.notice("cellSearchStartContentSearch(): CellSearchId: " + "0x%x, Content ID: %08X, Path: \"%s\"", + id, hash, item_path); } else // file is already stored and tracked { // TODO - // Perform checks to see if the identified file has been modified since last checked - // In which case, update the stored content's properties - // auto content_found = &content_map->at(content_id); - curr_search->content_ids.emplace_back(found->first, found->second); + // Perform checks to see if the identified file has been modified + // since last checked In which case, update the stored content's + // properties auto content_found = &content_map->at(content_id); + curr_search->content_ids.emplace_back(found->first, + found->second); - cellSearch.notice("cellSearchStartContentSearch(): Already Tracked: CellSearchId: 0x%x, Content ID: %08X, Path: \"%s\"", id, hash, item_path); + cellSearch.notice( + "cellSearchStartContentSearch(): Already Tracked: " + "CellSearchId: 0x%x, Content ID: %08X, Path: \"%s\"", + id, hash, item_path); } } }; @@ -1183,16 +1345,21 @@ error_code cellSearchStartContentSearch(CellSearchContentSearchType type, CellSe resultParam->resultNum = ::narrow(curr_search->content_ids.size()); search.state.store(search_state::idle); - search.func(ppu, CELL_SEARCH_EVENT_CONTENTSEARCH_RESULT, CELL_OK, vm::cast(resultParam.addr()), search.userData); + search.func(ppu, CELL_SEARCH_EVENT_CONTENTSEARCH_RESULT, CELL_OK, + vm::cast(resultParam.addr()), search.userData); return CELL_OK; }); return CELL_OK; } -error_code cellSearchStartSceneSearchInVideo(vm::cptr videoId, CellSearchSceneSearchType searchType, CellSearchSortOrder sortOrder, vm::ptr outSearchId) +error_code cellSearchStartSceneSearchInVideo( + vm::cptr videoId, CellSearchSceneSearchType searchType, + CellSearchSortOrder sortOrder, vm::ptr outSearchId) { - cellSearch.todo("cellSearchStartSceneSearchInVideo(videoId=*0x%x, searchType=0x%x, sortOrder=0x%x, outSearchId=*0x%x)", videoId, +searchType, +sortOrder, outSearchId); + cellSearch.todo("cellSearchStartSceneSearchInVideo(videoId=*0x%x, " + "searchType=0x%x, sortOrder=0x%x, outSearchId=*0x%x)", + videoId, +searchType, +sortOrder, outSearchId); // Reset values first if (outSearchId) @@ -1218,20 +1385,25 @@ error_code cellSearchStartSceneSearchInVideo(vm::cptr video return CELL_SEARCH_ERROR_PARAM; } - if (sortOrder != CELL_SEARCH_SORTORDER_ASCENDING && sortOrder != CELL_SEARCH_SORTORDER_DESCENDING) + if (sortOrder != CELL_SEARCH_SORTORDER_ASCENDING && + sortOrder != CELL_SEARCH_SORTORDER_DESCENDING) { return CELL_SEARCH_ERROR_PARAM; } auto& search = g_fxo->get(); - if (error_code error = check_search_state(search.state.compare_and_swap(search_state::idle, search_state::in_progress), search_state::in_progress)) + if (error_code error = + check_search_state(search.state.compare_and_swap( + search_state::idle, search_state::in_progress), + search_state::in_progress)) { return error; } auto& content_map = g_fxo->get(); - auto found = content_map.map.find(*reinterpret_cast(videoId->data)); + auto found = + content_map.map.find(*reinterpret_cast(videoId->data)); if (found == content_map.map.end()) { // content ID not found, perform a search first @@ -1253,16 +1425,25 @@ error_code cellSearchStartSceneSearchInVideo(vm::cptr video resultParam->resultNum = 0; // TODO search.state.store(search_state::idle); - search.func(ppu, CELL_SEARCH_EVENT_SCENESEARCH_INVIDEO_RESULT, CELL_OK, vm::cast(resultParam.addr()), search.userData); + search.func(ppu, CELL_SEARCH_EVENT_SCENESEARCH_INVIDEO_RESULT, CELL_OK, + vm::cast(resultParam.addr()), search.userData); return CELL_OK; }); return CELL_OK; } -error_code cellSearchStartSceneSearch(CellSearchSceneSearchType searchType, vm::cptr gameTitle, vm::cpptr tags, u32 tagNum, CellSearchSortKey sortKey, CellSearchSortOrder sortOrder, vm::ptr outSearchId) +error_code cellSearchStartSceneSearch(CellSearchSceneSearchType searchType, + vm::cptr gameTitle, + vm::cpptr tags, u32 tagNum, + CellSearchSortKey sortKey, + CellSearchSortOrder sortOrder, + vm::ptr outSearchId) { - cellSearch.todo("cellSearchStartSceneSearch(searchType=0x%x, gameTitle=%s, tags=**0x%x, tagNum=0x%x, sortKey=0x%x, sortOrder=0x%x, outSearchId=*0x%x)", +searchType, gameTitle, tags, tagNum, +sortKey, +sortOrder, outSearchId); + cellSearch.todo( + "cellSearchStartSceneSearch(searchType=0x%x, gameTitle=%s, tags=**0x%x, " + "tagNum=0x%x, sortKey=0x%x, sortOrder=0x%x, outSearchId=*0x%x)", + +searchType, gameTitle, tags, tagNum, +sortKey, +sortOrder, outSearchId); // Reset values first if (outSearchId) @@ -1315,7 +1496,8 @@ error_code cellSearchStartSceneSearch(CellSearchSceneSearchType searchType, vm:: for (u32 n = 0; n < tagNum; n++) { - if (!tags[tagNum] || !memchr(&tags[tagNum], '\0', CELL_SEARCH_TAG_LEN_MAX)) + if (!tags[tagNum] || + !memchr(&tags[tagNum], '\0', CELL_SEARCH_TAG_LEN_MAX)) { return CELL_SEARCH_ERROR_TAG; } @@ -1325,14 +1507,18 @@ error_code cellSearchStartSceneSearch(CellSearchSceneSearchType searchType, vm:: if (sortKey != CELL_SEARCH_SORTKEY_DEFAULT && sortKey != CELL_SEARCH_SORTKEY_IMPORTEDDATE && sortKey != CELL_SEARCH_SORTKEY_MODIFIEDDATE && - (sortKey != CELL_SEARCH_SORTKEY_TITLE || sortOrder != CELL_SEARCH_SORTORDER_ASCENDING)) + (sortKey != CELL_SEARCH_SORTKEY_TITLE || + sortOrder != CELL_SEARCH_SORTORDER_ASCENDING)) { return CELL_SEARCH_ERROR_NOT_SUPPORTED_SEARCH; } auto& search = g_fxo->get(); - if (error_code error = check_search_state(search.state.compare_and_swap(search_state::idle, search_state::in_progress), search_state::in_progress)) + if (error_code error = + check_search_state(search.state.compare_and_swap( + search_state::idle, search_state::in_progress), + search_state::in_progress)) { return error; } @@ -1346,16 +1532,24 @@ error_code cellSearchStartSceneSearch(CellSearchSceneSearchType searchType, vm:: resultParam->resultNum = 0; // TODO search.state.store(search_state::idle); - search.func(ppu, CELL_SEARCH_EVENT_SCENESEARCH_RESULT, CELL_OK, vm::cast(resultParam.addr()), search.userData); + search.func(ppu, CELL_SEARCH_EVENT_SCENESEARCH_RESULT, CELL_OK, + vm::cast(resultParam.addr()), search.userData); return CELL_OK; }); return CELL_OK; } -error_code cellSearchGetContentInfoByOffset(CellSearchId searchId, s32 offset, vm::ptr infoBuffer, vm::ptr outContentType, vm::ptr outContentId) +error_code +cellSearchGetContentInfoByOffset(CellSearchId searchId, s32 offset, + vm::ptr infoBuffer, + vm::ptr outContentType, + vm::ptr outContentId) { - cellSearch.warning("cellSearchGetContentInfoByOffset(searchId=0x%x, offset=0x%x, infoBuffer=*0x%x, outContentType=*0x%x, outContentId=*0x%x)", searchId, offset, infoBuffer, outContentType, outContentId); + cellSearch.warning( + "cellSearchGetContentInfoByOffset(searchId=0x%x, offset=0x%x, " + "infoBuffer=*0x%x, outContentType=*0x%x, outContentId=*0x%x)", + searchId, offset, infoBuffer, outContentType, outContentId); // Reset values first if (outContentType) @@ -1386,7 +1580,8 @@ error_code cellSearchGetContentInfoByOffset(CellSearchId searchId, s32 offset, v return CELL_SEARCH_ERROR_PARAM; } - if (error_code error = check_search_state(g_fxo->get().state.load(), search_state::in_progress)) + if (error_code error = check_search_state( + g_fxo->get().state.load(), search_state::in_progress)) { return error; } @@ -1400,31 +1595,38 @@ error_code cellSearchGetContentInfoByOffset(CellSearchId searchId, s32 offset, v { case CELL_SEARCH_CONTENTTYPE_MUSIC: if (infoBuffer) - std::memcpy(infoBuffer.get_ptr(), &content_info->data.music, sizeof(content_info->data.music)); + std::memcpy(infoBuffer.get_ptr(), &content_info->data.music, + sizeof(content_info->data.music)); break; case CELL_SEARCH_CONTENTTYPE_PHOTO: if (infoBuffer) - std::memcpy(infoBuffer.get_ptr(), &content_info->data.photo, sizeof(content_info->data.photo)); + std::memcpy(infoBuffer.get_ptr(), &content_info->data.photo, + sizeof(content_info->data.photo)); break; case CELL_SEARCH_CONTENTTYPE_VIDEO: if (infoBuffer) - std::memcpy(infoBuffer.get_ptr(), &content_info->data.video, sizeof(content_info->data.photo)); + std::memcpy(infoBuffer.get_ptr(), &content_info->data.video, + sizeof(content_info->data.photo)); break; case CELL_SEARCH_CONTENTTYPE_MUSICLIST: if (infoBuffer) - std::memcpy(infoBuffer.get_ptr(), &content_info->data.music_list, sizeof(content_info->data.music_list)); + std::memcpy(infoBuffer.get_ptr(), &content_info->data.music_list, + sizeof(content_info->data.music_list)); break; case CELL_SEARCH_CONTENTTYPE_PHOTOLIST: if (infoBuffer) - std::memcpy(infoBuffer.get_ptr(), &content_info->data.photo_list, sizeof(content_info->data.photo_list)); + std::memcpy(infoBuffer.get_ptr(), &content_info->data.photo_list, + sizeof(content_info->data.photo_list)); break; case CELL_SEARCH_CONTENTTYPE_VIDEOLIST: if (infoBuffer) - std::memcpy(infoBuffer.get_ptr(), &content_info->data.video_list, sizeof(content_info->data.video_list)); + std::memcpy(infoBuffer.get_ptr(), &content_info->data.video_list, + sizeof(content_info->data.video_list)); break; case CELL_SEARCH_CONTENTTYPE_SCENE: if (infoBuffer) - std::memcpy(infoBuffer.get_ptr(), &content_info->data.scene, sizeof(content_info->data.scene)); + std::memcpy(infoBuffer.get_ptr(), &content_info->data.scene, + sizeof(content_info->data.scene)); break; default: return CELL_SEARCH_ERROR_GENERIC; @@ -1435,7 +1637,8 @@ error_code cellSearchGetContentInfoByOffset(CellSearchId searchId, s32 offset, v if (outContentId) { - std::memcpy(outContentId->data, &content_id_128, CELL_SEARCH_CONTENT_ID_SIZE); + std::memcpy(outContentId->data, &content_id_128, + CELL_SEARCH_CONTENT_ID_SIZE); } } else // content ID not found, perform a search first @@ -1446,9 +1649,13 @@ error_code cellSearchGetContentInfoByOffset(CellSearchId searchId, s32 offset, v return CELL_OK; } -error_code cellSearchGetContentInfoByContentId(vm::cptr contentId, vm::ptr infoBuffer, vm::ptr outContentType) +error_code cellSearchGetContentInfoByContentId( + vm::cptr contentId, vm::ptr infoBuffer, + vm::ptr outContentType) { - cellSearch.warning("cellSearchGetContentInfoByContentId(contentId=*0x%x, infoBuffer=*0x%x, outContentType=*0x%x)", contentId, infoBuffer, outContentType); + cellSearch.warning("cellSearchGetContentInfoByContentId(contentId=*0x%x, " + "infoBuffer=*0x%x, outContentType=*0x%x)", + contentId, infoBuffer, outContentType); // Reset values first if (outContentType) @@ -1466,13 +1673,15 @@ error_code cellSearchGetContentInfoByContentId(vm::cptr con return CELL_SEARCH_ERROR_PARAM; } - if (error_code error = check_search_state(g_fxo->get().state.load(), search_state::in_progress)) + if (error_code error = check_search_state( + g_fxo->get().state.load(), search_state::in_progress)) { return error; } auto& content_map = g_fxo->get(); - auto found = content_map.map.find(*reinterpret_cast(contentId->data)); + auto found = + content_map.map.find(*reinterpret_cast(contentId->data)); if (found != content_map.map.end()) { const auto& content_info = found->second; @@ -1480,31 +1689,38 @@ error_code cellSearchGetContentInfoByContentId(vm::cptr con { case CELL_SEARCH_CONTENTTYPE_MUSIC: if (infoBuffer) - std::memcpy(infoBuffer.get_ptr(), &content_info->data.music, sizeof(content_info->data.music)); + std::memcpy(infoBuffer.get_ptr(), &content_info->data.music, + sizeof(content_info->data.music)); break; case CELL_SEARCH_CONTENTTYPE_PHOTO: if (infoBuffer) - std::memcpy(infoBuffer.get_ptr(), &content_info->data.photo, sizeof(content_info->data.photo)); + std::memcpy(infoBuffer.get_ptr(), &content_info->data.photo, + sizeof(content_info->data.photo)); break; case CELL_SEARCH_CONTENTTYPE_VIDEO: if (infoBuffer) - std::memcpy(infoBuffer.get_ptr(), &content_info->data.video, sizeof(content_info->data.photo)); + std::memcpy(infoBuffer.get_ptr(), &content_info->data.video, + sizeof(content_info->data.photo)); break; case CELL_SEARCH_CONTENTTYPE_MUSICLIST: if (infoBuffer) - std::memcpy(infoBuffer.get_ptr(), &content_info->data.music_list, sizeof(content_info->data.music_list)); + std::memcpy(infoBuffer.get_ptr(), &content_info->data.music_list, + sizeof(content_info->data.music_list)); break; case CELL_SEARCH_CONTENTTYPE_PHOTOLIST: if (infoBuffer) - std::memcpy(infoBuffer.get_ptr(), &content_info->data.photo_list, sizeof(content_info->data.photo_list)); + std::memcpy(infoBuffer.get_ptr(), &content_info->data.photo_list, + sizeof(content_info->data.photo_list)); break; case CELL_SEARCH_CONTENTTYPE_VIDEOLIST: if (infoBuffer) - std::memcpy(infoBuffer.get_ptr(), &content_info->data.video_list, sizeof(content_info->data.video_list)); + std::memcpy(infoBuffer.get_ptr(), &content_info->data.video_list, + sizeof(content_info->data.video_list)); break; case CELL_SEARCH_CONTENTTYPE_SCENE: if (infoBuffer) - std::memcpy(infoBuffer.get_ptr(), &content_info->data.scene, sizeof(content_info->data.scene)); + std::memcpy(infoBuffer.get_ptr(), &content_info->data.scene, + sizeof(content_info->data.scene)); break; default: return CELL_SEARCH_ERROR_GENERIC; @@ -1520,16 +1736,22 @@ error_code cellSearchGetContentInfoByContentId(vm::cptr con return CELL_OK; } -error_code cellSearchGetOffsetByContentId(CellSearchId searchId, vm::cptr contentId, vm::ptr outOffset) +error_code +cellSearchGetOffsetByContentId(CellSearchId searchId, + vm::cptr contentId, + vm::ptr outOffset) { - cellSearch.warning("cellSearchGetOffsetByContentId(searchId=0x%x, contentId=*0x%x, outOffset=*0x%x)", searchId, contentId, outOffset); + cellSearch.warning("cellSearchGetOffsetByContentId(searchId=0x%x, " + "contentId=*0x%x, outOffset=*0x%x)", + searchId, contentId, outOffset); if (outOffset) { *outOffset = -1; } - if (error_code error = check_search_state(g_fxo->get().state.load(), search_state::in_progress)) + if (error_code error = check_search_state( + g_fxo->get().state.load(), search_state::in_progress)) { return error; } @@ -1561,9 +1783,16 @@ error_code cellSearchGetOffsetByContentId(CellSearchId searchId, vm::cptr outContentType, vm::ptr outContentId, vm::ptr outTimeInfo) +error_code +cellSearchGetContentIdByOffset(CellSearchId searchId, s32 offset, + vm::ptr outContentType, + vm::ptr outContentId, + vm::ptr outTimeInfo) { - cellSearch.todo("cellSearchGetContentIdByOffset(searchId=0x%x, offset=0x%x, outContentType=*0x%x, outContentId=*0x%x, outTimeInfo=*0x%x)", searchId, offset, outContentType, outContentId, outTimeInfo); + cellSearch.todo( + "cellSearchGetContentIdByOffset(searchId=0x%x, offset=0x%x, " + "outContentType=*0x%x, outContentId=*0x%x, outTimeInfo=*0x%x)", + searchId, offset, outContentType, outContentId, outTimeInfo); // Reset values first if (outTimeInfo) @@ -1596,7 +1825,8 @@ error_code cellSearchGetContentIdByOffset(CellSearchId searchId, s32 offset, vm: return CELL_SEARCH_ERROR_PARAM; } - if (error_code error = check_search_state(g_fxo->get().state.load(), search_state::in_progress)) + if (error_code error = check_search_state( + g_fxo->get().state.load(), search_state::in_progress)) { return error; } @@ -1606,11 +1836,13 @@ error_code cellSearchGetContentIdByOffset(CellSearchId searchId, s32 offset, vm: auto& content_id = ::at32(searchObject->content_ids, offset); const u128 content_id_128 = content_id.first; *outContentType = content_id.second->type; - std::memcpy(outContentId->data, &content_id_128, CELL_SEARCH_CONTENT_ID_SIZE); + std::memcpy(outContentId->data, &content_id_128, + CELL_SEARCH_CONTENT_ID_SIZE); if (outTimeInfo) { - std::memcpy(outTimeInfo.get_ptr(), &content_id.second->time_info, sizeof(content_id.second->time_info)); + std::memcpy(outTimeInfo.get_ptr(), &content_id.second->time_info, + sizeof(content_id.second->time_info)); } } else // content ID not found, perform a search first @@ -1621,9 +1853,13 @@ error_code cellSearchGetContentIdByOffset(CellSearchId searchId, s32 offset, vm: return CELL_OK; } -error_code cellSearchGetContentInfoGameComment(vm::cptr contentId, vm::ptr gameComment) +error_code +cellSearchGetContentInfoGameComment(vm::cptr contentId, + vm::ptr gameComment) { - cellSearch.todo("cellSearchGetContentInfoGameComment(contentId=*0x%x, gameComment=*0x%x)", contentId, gameComment); + cellSearch.todo( + "cellSearchGetContentInfoGameComment(contentId=*0x%x, gameComment=*0x%x)", + contentId, gameComment); // Reset values first if (gameComment) @@ -1637,13 +1873,15 @@ error_code cellSearchGetContentInfoGameComment(vm::cptr con } // TODO: find out if this check is correct - if (error_code error = check_search_state(g_fxo->get().state.load(), search_state::in_progress)) + if (error_code error = check_search_state( + g_fxo->get().state.load(), search_state::in_progress)) { return error; } auto& content_map = g_fxo->get(); - auto found = content_map.map.find(*reinterpret_cast(contentId->data)); + auto found = + content_map.map.find(*reinterpret_cast(contentId->data)); if (found == content_map.map.end()) { // content ID not found, perform a search first @@ -1666,9 +1904,15 @@ error_code cellSearchGetContentInfoGameComment(vm::cptr con return CELL_OK; } -error_code cellSearchGetMusicSelectionContext(CellSearchId searchId, vm::cptr contentId, CellSearchRepeatMode repeatMode, CellSearchContextOption option, vm::ptr outContext) +error_code cellSearchGetMusicSelectionContext( + CellSearchId searchId, vm::cptr contentId, + CellSearchRepeatMode repeatMode, CellSearchContextOption option, + vm::ptr outContext) { - cellSearch.todo("cellSearchGetMusicSelectionContext(searchId=0x%x, contentId=*0x%x, repeatMode=0x%x, option=0x%x, outContext=*0x%x)", searchId, contentId, +repeatMode, +option, outContext); + cellSearch.todo( + "cellSearchGetMusicSelectionContext(searchId=0x%x, contentId=*0x%x, " + "repeatMode=0x%x, option=0x%x, outContext=*0x%x)", + searchId, contentId, +repeatMode, +option, outContext); if (!outContext) { @@ -1688,7 +1932,8 @@ error_code cellSearchGetMusicSelectionContext(CellSearchId searchId, vm::cptrget(); // TODO: find out if this check is correct - if (error_code error = check_search_state(search.state.load(), search_state::in_progress)) + if (error_code error = + check_search_state(search.state.load(), search_state::in_progress)) { return error; } @@ -1705,7 +1950,8 @@ error_code cellSearchGetMusicSelectionContext(CellSearchId searchId, vm::cptr shared_ptr + const auto get_random_content = + [&searchObject, &first_content]() -> shared_ptr { if (searchObject->content_ids.size() == 1) { @@ -1713,7 +1959,9 @@ error_code cellSearchGetMusicSelectionContext(CellSearchId searchId, vm::cptr result; - std::sample(searchObject->content_ids.begin(), searchObject->content_ids.end(), std::back_inserter(result), 1, std::mt19937{std::random_device{}()}); + std::sample(searchObject->content_ids.begin(), + searchObject->content_ids.end(), std::back_inserter(result), 1, + std::mt19937{std::random_device{}()}); ensure(result.size() == 1); shared_ptr content = ensure(result[0].second); return content; @@ -1723,7 +1971,9 @@ error_code cellSearchGetMusicSelectionContext(CellSearchId searchId, vm::cptr(contentId->data); - auto content = std::find_if(searchObject->content_ids.begin(), searchObject->content_ids.end(), [&content_hash](const content_id_type& cid) + auto content = std::find_if(searchObject->content_ids.begin(), + searchObject->content_ids.end(), + [&content_hash](const content_id_type& cid) { return cid.first == content_hash; }); @@ -1732,23 +1982,30 @@ error_code cellSearchGetMusicSelectionContext(CellSearchId searchId, vm::cptrsecond->type != CELL_SEARCH_CONTENTTYPE_MUSIC) { - return {CELL_SEARCH_ERROR_INVALID_CONTENTTYPE, "Type: %d, Expected: CELL_SEARCH_CONTENTTYPE_MUSIC"}; + return {CELL_SEARCH_ERROR_INVALID_CONTENTTYPE, + "Type: %d, Expected: CELL_SEARCH_CONTENTTYPE_MUSIC"}; } // Check if the type of the found content matches our search content type if (content->second->type != first_content->type) { - return {CELL_SEARCH_ERROR_NOT_SUPPORTED_CONTEXT, "Type: %d, Expected: %d", +content->second->type, +first_content->type}; + return {CELL_SEARCH_ERROR_NOT_SUPPORTED_CONTEXT, + "Type: %d, Expected: %d", +content->second->type, + +first_content->type}; } // Use the found content context.playlist.push_back(content->second->infoPath.contentPath); - cellSearch.notice("cellSearchGetMusicSelectionContext(): Hash=%08X, Assigning found track: Type=0x%x, Path=%s", content_hash, +content->second->type, context.playlist.back()); + cellSearch.notice("cellSearchGetMusicSelectionContext(): Hash=%08X, " + "Assigning found track: Type=0x%x, Path=%s", + content_hash, +content->second->type, + context.playlist.back()); } else if (first_content->type == CELL_SEARCH_CONTENTTYPE_MUSICLIST) { // Abort if we can't find the playlist. - return {CELL_SEARCH_ERROR_CONTENT_NOT_FOUND, "Type: CELL_SEARCH_CONTENTTYPE_MUSICLIST"}; + return {CELL_SEARCH_ERROR_CONTENT_NOT_FOUND, + "Type: CELL_SEARCH_CONTENTTYPE_MUSICLIST"}; } else if (option == CELL_SEARCH_CONTEXTOPTION_SHUFFLE) { @@ -1756,20 +2013,26 @@ error_code cellSearchGetMusicSelectionContext(CellSearchId searchId, vm::cptr content = get_random_content(); context.playlist.push_back(content->infoPath.contentPath); - cellSearch.notice("cellSearchGetMusicSelectionContext(): Hash=%08X, Assigning random track: Type=0x%x, Path=%s", content_hash, +content->type, context.playlist.back()); + cellSearch.notice("cellSearchGetMusicSelectionContext(): Hash=%08X, " + "Assigning random track: Type=0x%x, Path=%s", + content_hash, +content->type, context.playlist.back()); } else { // Select the first track by default // TODO: whole playlist context.playlist.push_back(first_content->infoPath.contentPath); - cellSearch.notice("cellSearchGetMusicSelectionContext(): Hash=%08X, Assigning first track: Type=0x%x, Path=%s", content_hash, +first_content->type, context.playlist.back()); + cellSearch.notice("cellSearchGetMusicSelectionContext(): Hash=%08X, " + "Assigning first track: Type=0x%x, Path=%s", + content_hash, +first_content->type, + context.playlist.back()); } } else if (first_content->type == CELL_SEARCH_CONTENTTYPE_MUSICLIST) { // Abort if we don't have the necessary info to select a playlist. - return {CELL_SEARCH_ERROR_NOT_SUPPORTED_CONTEXT, "Type: CELL_SEARCH_CONTENTTYPE_MUSICLIST"}; + return {CELL_SEARCH_ERROR_NOT_SUPPORTED_CONTEXT, + "Type: CELL_SEARCH_CONTENTTYPE_MUSICLIST"}; } else if (option == CELL_SEARCH_CONTEXTOPTION_SHUFFLE) { @@ -1777,14 +2040,18 @@ error_code cellSearchGetMusicSelectionContext(CellSearchId searchId, vm::cptr content = get_random_content(); context.playlist.push_back(content->infoPath.contentPath); - cellSearch.notice("cellSearchGetMusicSelectionContext(): Assigning random track: Type=0x%x, Path=%s", +content->type, context.playlist.back()); + cellSearch.notice("cellSearchGetMusicSelectionContext(): Assigning random " + "track: Type=0x%x, Path=%s", + +content->type, context.playlist.back()); } else { // Select the first track by default // TODO: whole playlist context.playlist.push_back(first_content->infoPath.contentPath); - cellSearch.notice("cellSearchGetMusicSelectionContext(): Assigning first track: Type=0x%x, Path=%s", +first_content->type, context.playlist.back()); + cellSearch.notice("cellSearchGetMusicSelectionContext(): Assigning first " + "track: Type=0x%x, Path=%s", + +first_content->type, context.playlist.back()); } context.content_type = first_content->type; @@ -1795,7 +2062,8 @@ error_code cellSearchGetMusicSelectionContext(CellSearchId searchId, vm::cptrsecond.path; } @@ -1804,14 +2072,20 @@ error_code cellSearchGetMusicSelectionContext(CellSearchId searchId, vm::cptr contentId, vm::ptr outContext) +error_code cellSearchGetMusicSelectionContextOfSingleTrack( + vm::cptr contentId, + vm::ptr outContext) { - cellSearch.todo("cellSearchGetMusicSelectionContextOfSingleTrack(contentId=*0x%x, outContext=*0x%x)", contentId, outContext); + cellSearch.todo("cellSearchGetMusicSelectionContextOfSingleTrack(contentId=*" + "0x%x, outContext=*0x%x)", + contentId, outContext); // Reset values first if (outContext) @@ -1827,13 +2101,15 @@ error_code cellSearchGetMusicSelectionContextOfSingleTrack(vm::cptrget(); // TODO: find out if this check is correct - if (error_code error = check_search_state(search.state.load(), search_state::in_progress)) + if (error_code error = + check_search_state(search.state.load(), search_state::in_progress)) { return error; } auto& content_map = g_fxo->get(); - auto found = content_map.map.find(*reinterpret_cast(contentId->data)); + auto found = + content_map.map.find(*reinterpret_cast(contentId->data)); if (found == content_map.map.end()) { // content ID not found, perform a search first @@ -1854,7 +2130,8 @@ error_code cellSearchGetMusicSelectionContextOfSingleTrack(vm::cptrsecond.path; } @@ -1863,14 +2140,20 @@ error_code cellSearchGetMusicSelectionContextOfSingleTrack(vm::cptr contentId, vm::ptr infoPath) +error_code +cellSearchGetContentInfoPath(vm::cptr contentId, + vm::ptr infoPath) { - cellSearch.todo("cellSearchGetContentInfoPath(contentId=*0x%x, infoPath=*0x%x)", contentId, infoPath); + cellSearch.todo( + "cellSearchGetContentInfoPath(contentId=*0x%x, infoPath=*0x%x)", + contentId, infoPath); // Reset values first if (infoPath) @@ -1883,7 +2166,8 @@ error_code cellSearchGetContentInfoPath(vm::cptr contentId, return CELL_SEARCH_ERROR_PARAM; } - if (error_code error = check_search_state(g_fxo->get().state.load(), search_state::in_progress)) + if (error_code error = check_search_state( + g_fxo->get().state.load(), search_state::in_progress)) { return error; } @@ -1893,22 +2177,29 @@ error_code cellSearchGetContentInfoPath(vm::cptr contentId, auto found = content_map.map.find(id); if (found != content_map.map.end()) { - std::memcpy(infoPath.get_ptr(), &found->second->infoPath, sizeof(found->second->infoPath)); + std::memcpy(infoPath.get_ptr(), &found->second->infoPath, + sizeof(found->second->infoPath)); } else { - cellSearch.error("cellSearchGetContentInfoPath(): ID not found : 0x%08X", id); + cellSearch.error("cellSearchGetContentInfoPath(): ID not found : 0x%08X", + id); return CELL_SEARCH_ERROR_CONTENT_NOT_FOUND; } - cellSearch.success("contentId=%08X, contentPath=\"%s\"", id, infoPath->contentPath); + cellSearch.success("contentId=%08X, contentPath=\"%s\"", id, + infoPath->contentPath); return CELL_OK; } -error_code cellSearchGetContentInfoPathMovieThumb(vm::cptr contentId, vm::ptr infoMt) +error_code cellSearchGetContentInfoPathMovieThumb( + vm::cptr contentId, + vm::ptr infoMt) { - cellSearch.todo("cellSearchGetContentInfoPathMovieThumb(contentId=*0x%x, infoMt=*0x%x)", contentId, infoMt); + cellSearch.todo( + "cellSearchGetContentInfoPathMovieThumb(contentId=*0x%x, infoMt=*0x%x)", + contentId, infoMt); // Reset values first if (infoMt) @@ -1922,13 +2213,15 @@ error_code cellSearchGetContentInfoPathMovieThumb(vm::cptr } // TODO: find out if this check is correct - if (error_code error = check_search_state(g_fxo->get().state.load(), search_state::in_progress)) + if (error_code error = check_search_state( + g_fxo->get().state.load(), search_state::in_progress)) { return error; } auto& content_map = g_fxo->get(); - auto found = content_map.map.find(*reinterpret_cast(contentId->data)); + auto found = + content_map.map.find(*reinterpret_cast(contentId->data)); if (found == content_map.map.end()) { // content ID not found, perform a search first @@ -1941,7 +2234,8 @@ error_code cellSearchGetContentInfoPathMovieThumb(vm::cptr return CELL_SEARCH_ERROR_INVALID_CONTENTTYPE; } - strcpy_trunc(infoMt->movieThumbnailPath, content_info->infoPath.thumbnailPath); + strcpy_trunc(infoMt->movieThumbnailPath, + content_info->infoPath.thumbnailPath); // TODO: set infoMt->movieThumbnailOption return CELL_OK; @@ -1958,7 +2252,8 @@ error_code cellSearchPrepareFile(vm::cptr path) auto& search = g_fxo->get(); - if (error_code error = check_search_state(search.state.load(), search_state::in_progress)) + if (error_code error = + check_search_state(search.state.load(), search_state::in_progress)) { return error; } @@ -1967,15 +2262,20 @@ error_code cellSearchPrepareFile(vm::cptr path) auto found = search.content_links.find(path.get_ptr()); if (found != search.content_links.end()) { - vfs::mount(found->first, vfs::get(found->second.path), found->second.is_dir); + vfs::mount(found->first, vfs::get(found->second.path), + found->second.is_dir); } return CELL_OK; } -error_code cellSearchGetContentInfoDeveloperData(vm::cptr contentId, vm::ptr developerData) +error_code +cellSearchGetContentInfoDeveloperData(vm::cptr contentId, + vm::ptr developerData) { - cellSearch.todo("cellSearchGetContentInfoDeveloperData(contentId=*0x%x, developerData=*0x%x)", contentId, developerData); + cellSearch.todo("cellSearchGetContentInfoDeveloperData(contentId=*0x%x, " + "developerData=*0x%x)", + contentId, developerData); // Reset values first if (developerData) @@ -1989,13 +2289,15 @@ error_code cellSearchGetContentInfoDeveloperData(vm::cptr c } // TODO: find out if this check is correct - if (error_code error = check_search_state(g_fxo->get().state.load(), search_state::in_progress)) + if (error_code error = check_search_state( + g_fxo->get().state.load(), search_state::in_progress)) { return error; } auto& content_map = g_fxo->get(); - auto found = content_map.map.find(*reinterpret_cast(contentId->data)); + auto found = + content_map.map.find(*reinterpret_cast(contentId->data)); if (found == content_map.map.end()) { // content ID not found, perform a search first @@ -2017,9 +2319,13 @@ error_code cellSearchGetContentInfoDeveloperData(vm::cptr c return CELL_OK; } -error_code cellSearchGetContentInfoSharable(vm::cptr contentId, vm::ptr sharable) +error_code +cellSearchGetContentInfoSharable(vm::cptr contentId, + vm::ptr sharable) { - cellSearch.todo("cellSearchGetContentInfoSharable(contentId=*0x%x, sharable=*0x%x)", contentId, sharable); + cellSearch.todo( + "cellSearchGetContentInfoSharable(contentId=*0x%x, sharable=*0x%x)", + contentId, sharable); // Reset values first if (sharable) @@ -2033,13 +2339,15 @@ error_code cellSearchGetContentInfoSharable(vm::cptr conten } // TODO: find out if this check is correct - if (error_code error = check_search_state(g_fxo->get().state.load(), search_state::in_progress)) + if (error_code error = check_search_state( + g_fxo->get().state.load(), search_state::in_progress)) { return error; } auto& content_map = g_fxo->get(); - auto found = content_map.map.find(*reinterpret_cast(contentId->data)); + auto found = + content_map.map.find(*reinterpret_cast(contentId->data)); if (found == content_map.map.end()) { // content ID not found, perform a search first @@ -2069,7 +2377,8 @@ error_code cellSearchCancel(CellSearchId searchId) return CELL_SEARCH_ERROR_INVALID_SEARCHID; } - if (error_code error = check_search_state(g_fxo->get().state.load(), search_state::canceling)) + if (error_code error = check_search_state( + g_fxo->get().state.load(), search_state::canceling)) { return error; } @@ -2088,7 +2397,8 @@ error_code cellSearchEnd(CellSearchId searchId) return CELL_SEARCH_ERROR_INVALID_SEARCHID; } - if (error_code error = check_search_state(g_fxo->get().state.load(), search_state::finalizing)) + if (error_code error = check_search_state( + g_fxo->get().state.load(), search_state::finalizing)) { return error; } @@ -2131,7 +2441,8 @@ DECLARE(ppu_module_manager::cellSearch)("cellSearchUtility", []() }); // Helper -error_code music_selection_context::find_content_id(vm::ptr contents_id) +error_code music_selection_context::find_content_id( + vm::ptr contents_id) { if (!contents_id) return CELL_MUSIC_ERROR_PARAM; @@ -2152,7 +2463,8 @@ error_code music_selection_context::find_content_id(vm::ptr hash = std::hash()(track); } - if (auto found = content_map.map.find(hash); found != content_map.map.end()) + if (auto found = content_map.map.find(hash); + found != content_map.map.end()) { found_content = found->second; break; @@ -2163,8 +2475,11 @@ error_code music_selection_context::find_content_id(vm::ptr { // TODO: check if the content type is correct const u128 content_id_128 = hash; - std::memcpy(contents_id->data, &content_id_128, CELL_SEARCH_CONTENT_ID_SIZE); - cellSearch.warning("find_content_id: found existing content for %s (path control: '%s')", to_string(), found_content->infoPath.contentPath); + std::memcpy(contents_id->data, &content_id_128, + CELL_SEARCH_CONTENT_ID_SIZE); + cellSearch.warning( + "find_content_id: found existing content for %s (path control: '%s')", + to_string(), found_content->infoPath.contentPath); return CELL_OK; } @@ -2205,19 +2520,23 @@ error_code music_selection_context::find_content_id(vm::ptr } // TODO: check for actual content inside the directory - shared_ptr curr_find = make_shared(); + shared_ptr curr_find = + make_shared(); curr_find->type = CELL_SEARCH_CONTENTTYPE_MUSICLIST; curr_find->repeat_mode = repeat_mode; curr_find->context_option = context_option; if (dir_path.length() > CELL_SEARCH_PATH_LEN_MAX) { - // Create mapping which will be resolved to an actual hard link in VFS by cellSearchPrepareFile + // Create mapping which will be resolved to an actual hard link in VFS + // by cellSearchPrepareFile std::string link = link_base + std::to_string(hash) + entry.name; strcpy_trunc(curr_find->infoPath.contentPath, link); std::lock_guard lock(search.links_mutex); - search.content_links.emplace(std::move(link), search_info::link_data{.path = dir_path, .is_dir = true}); + search.content_links.emplace( + std::move(link), + search_info::link_data{.path = dir_path, .is_dir = true}); } else { @@ -2233,16 +2552,20 @@ error_code music_selection_context::find_content_id(vm::ptr content_map.map.emplace(dir_hash, curr_find); const u128 content_id_128 = dir_hash; - std::memcpy(contents_id->data, &content_id_128, CELL_SEARCH_CONTENT_ID_SIZE); + std::memcpy(contents_id->data, &content_id_128, + CELL_SEARCH_CONTENT_ID_SIZE); - cellSearch.warning("find_content_id: found music list %s (path control: '%s')", to_string(), dir_path); + cellSearch.warning( + "find_content_id: found music list %s (path control: '%s')", + to_string(), dir_path); return CELL_OK; } continue; } - // Search the subfolders. We assume all music is located in a depth of 2 (max_depth, root + 1 folder + file). + // Search the subfolders. We assume all music is located in a depth of 2 + // (max_depth, root + 1 folder + file). for (auto&& item : fs::dir(vfs_dir_path)) { if (item.is_directory || item.name == "." || item.name == "..") @@ -2255,26 +2578,32 @@ error_code music_selection_context::find_content_id(vm::ptr if (hash == file_hash) { - const auto [success, mi] = utils::get_media_info(vfs_dir_path + "/" + item.name, 1); // AVMEDIA_TYPE_AUDIO + const auto [success, mi] = utils::get_media_info( + vfs_dir_path + "/" + item.name, 1); // AVMEDIA_TYPE_AUDIO if (!success) { continue; } - shared_ptr curr_find = make_shared(); + shared_ptr curr_find = + make_shared(); curr_find->type = CELL_SEARCH_CONTENTTYPE_MUSIC; curr_find->repeat_mode = repeat_mode; curr_find->context_option = context_option; if (file_path.length() > CELL_SEARCH_PATH_LEN_MAX) { - // Create mapping which will be resolved to an actual hard link in VFS by cellSearchPrepareFile + // Create mapping which will be resolved to an actual hard link in VFS + // by cellSearchPrepareFile const size_t ext_offset = item.name.find_last_of('.'); - std::string link = link_base + std::to_string(hash) + item.name.substr(ext_offset); + std::string link = + link_base + std::to_string(hash) + item.name.substr(ext_offset); strcpy_trunc(curr_find->infoPath.contentPath, link); std::lock_guard lock(search.links_mutex); - search.content_links.emplace(std::move(link), search_info::link_data{.path = file_path, .is_dir = false}); + search.content_links.emplace( + std::move(link), + search_info::link_data{.path = file_path, .is_dir = false}); } else { @@ -2285,9 +2614,12 @@ error_code music_selection_context::find_content_id(vm::ptr content_map.map.emplace(file_hash, curr_find); const u128 content_id_128 = file_hash; - std::memcpy(contents_id->data, &content_id_128, CELL_SEARCH_CONTENT_ID_SIZE); + std::memcpy(contents_id->data, &content_id_128, + CELL_SEARCH_CONTENT_ID_SIZE); - cellSearch.warning("find_content_id: found music track %s (path control: '%s')", to_string(), file_path); + cellSearch.warning( + "find_content_id: found music track %s (path control: '%s')", + to_string(), file_path); return CELL_OK; } } diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellSheap.cpp b/ps3fw/cellSheap.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellSheap.cpp rename to ps3fw/cellSheap.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellSpudll.cpp b/ps3fw/cellSpudll.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellSpudll.cpp rename to ps3fw/cellSpudll.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellSpurs.cpp b/ps3fw/cellSpurs.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellSpurs.cpp rename to ps3fw/cellSpurs.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellSpursJq.cpp b/ps3fw/cellSpursJq.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellSpursJq.cpp rename to ps3fw/cellSpursJq.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellSpursSpu.cpp b/ps3fw/cellSpursSpu.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellSpursSpu.cpp rename to ps3fw/cellSpursSpu.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellSsl.cpp b/ps3fw/cellSsl.cpp similarity index 89% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellSsl.cpp rename to ps3fw/cellSsl.cpp index d5a9fb8a0..5253de3b2 100644 --- a/rpcs3/rpcs3/Emu/Cell/Modules/cellSsl.cpp +++ b/ps3fw/cellSsl.cpp @@ -3,11 +3,11 @@ #include #include -#include "cellSsl.h" #include "Emu/Cell/PPUModule.h" -#include "Utilities/File.h" -#include "Emu/VFS.h" #include "Emu/IdManager.h" +#include "Emu/VFS.h" +#include "cellSsl.h" +#include "util/File.h" #include "cellRtc.h" @@ -75,12 +75,14 @@ error_code cellSslGetMemoryInfo() return CELL_OK; } -std::string getCert(const std::string& certPath, const int certID, const bool isNormalCert) +std::string getCert(const std::string& certPath, const int certID, + const bool isNormalCert) { int newID = certID; // The 'normal' certs have some special rules for loading. - if (isNormalCert && certID >= BaltimoreCert && certID <= GTECyberTrustGlobalCert) + if (isNormalCert && certID >= BaltimoreCert && + certID <= GTECyberTrustGlobalCert) { if (certID == BaltimoreCert) newID = GTECyberTrustGlobalCert; @@ -96,15 +98,20 @@ std::string getCert(const std::string& certPath, const int certID, const bool is if (!fs::exists(filePath)) { - cellSsl.error("Can't find certificate file %s, do you have the PS3 firmware installed?", filePath); + cellSsl.error("Can't find certificate file %s, do you have the PS3 " + "firmware installed?", + filePath); return ""; } return fs::file(filePath).to_string(); } -error_code cellSslCertificateLoader(u64 flag, vm::ptr buffer, u32 size, vm::ptr required) +error_code cellSslCertificateLoader(u64 flag, vm::ptr buffer, u32 size, + vm::ptr required) { - cellSsl.trace("cellSslCertificateLoader(flag=%llu, buffer=*0x%x, size=%zu, required=*0x%x)", flag, buffer, size, required); + cellSsl.trace("cellSslCertificateLoader(flag=%llu, buffer=*0x%x, size=%zu, " + "required=*0x%x)", + flag, buffer, size, required); const std::bitset<58> flagBits(flag); const std::string certPath = vfs::get("/dev_flash/data/cert/"); @@ -116,7 +123,8 @@ error_code cellSslCertificateLoader(u64 flag, vm::ptr buffer, u32 size, vm { if (!flagBits[i - 1]) continue; - // If we're loading cert 6 (the baltimore cert), then we need set that we're loading the 'normal' set of certs. + // If we're loading cert 6 (the baltimore cert), then we need set that + // we're loading the 'normal' set of certs. *required += ::size32(getCert(certPath, i, flagBits[BaltimoreCert - 1])); } } @@ -127,7 +135,8 @@ error_code cellSslCertificateLoader(u64 flag, vm::ptr buffer, u32 size, vm { if (!flagBits[i - 1]) continue; - // If we're loading cert 6 (the baltimore cert), then we need set that we're loading the 'normal' set of certs. + // If we're loading cert 6 (the baltimore cert), then we need set that + // we're loading the 'normal' set of certs. final.append(getCert(certPath, i, flagBits[BaltimoreCert - 1])); } @@ -138,9 +147,13 @@ error_code cellSslCertificateLoader(u64 flag, vm::ptr buffer, u32 size, vm return CELL_OK; } -error_code cellSslCertGetSerialNumber(vm::cptr sslCert, vm::cpptr sboData, vm::ptr sboLength) +error_code cellSslCertGetSerialNumber(vm::cptr sslCert, + vm::cpptr sboData, + vm::ptr sboLength) { - cellSsl.todo("cellSslCertGetSerialNumber(sslCert=*0x%x, sboData=**0x%x, sboLength=*0x%x)", sslCert, sboData, sboLength); + cellSsl.todo("cellSslCertGetSerialNumber(sslCert=*0x%x, sboData=**0x%x, " + "sboLength=*0x%x)", + sslCert, sboData, sboLength); if (!g_fxo->get().is_init) return CELL_SSL_ERROR_NOT_INITIALIZED; @@ -154,9 +167,13 @@ error_code cellSslCertGetSerialNumber(vm::cptr sslCert, vm::cpptr sboD return CELL_OK; } -error_code cellSslCertGetPublicKey(vm::cptr sslCert, vm::cpptr sboData, vm::ptr sboLength) +error_code cellSslCertGetPublicKey(vm::cptr sslCert, + vm::cpptr sboData, + vm::ptr sboLength) { - cellSsl.todo("cellSslCertGetPublicKey(sslCert=*0x%x, sboData=**0x%x, sboLength=*0x%x)", sslCert, sboData, sboLength); + cellSsl.todo( + "cellSslCertGetPublicKey(sslCert=*0x%x, sboData=**0x%x, sboLength=*0x%x)", + sslCert, sboData, sboLength); if (!g_fxo->get().is_init) return CELL_SSL_ERROR_NOT_INITIALIZED; @@ -170,9 +187,13 @@ error_code cellSslCertGetPublicKey(vm::cptr sslCert, vm::cpptr sboData return CELL_OK; } -error_code cellSslCertGetRsaPublicKeyModulus(vm::cptr sslCert, vm::cpptr sboData, vm::ptr sboLength) +error_code cellSslCertGetRsaPublicKeyModulus(vm::cptr sslCert, + vm::cpptr sboData, + vm::ptr sboLength) { - cellSsl.todo("cellSslCertGetRsaPublicKeyModulus(sslCert=*0x%x, sboData=**0x%x, sboLength=*0x%x)", sslCert, sboData, sboLength); + cellSsl.todo("cellSslCertGetRsaPublicKeyModulus(sslCert=*0x%x, " + "sboData=**0x%x, sboLength=*0x%x)", + sslCert, sboData, sboLength); if (!g_fxo->get().is_init) return CELL_SSL_ERROR_NOT_INITIALIZED; @@ -186,9 +207,13 @@ error_code cellSslCertGetRsaPublicKeyModulus(vm::cptr sslCert, vm::cpptr sslCert, vm::cpptr sboData, vm::ptr sboLength) +error_code cellSslCertGetRsaPublicKeyExponent(vm::cptr sslCert, + vm::cpptr sboData, + vm::ptr sboLength) { - cellSsl.todo("cellSslCertGetRsaPublicKeyExponent(sslCert=*0x%x, sboData=**0x%x, sboLength=*0x%x)", sslCert, sboData, sboLength); + cellSsl.todo("cellSslCertGetRsaPublicKeyExponent(sslCert=*0x%x, " + "sboData=**0x%x, sboLength=*0x%x)", + sslCert, sboData, sboLength); if (!g_fxo->get().is_init) return CELL_SSL_ERROR_NOT_INITIALIZED; @@ -202,9 +227,11 @@ error_code cellSslCertGetRsaPublicKeyExponent(vm::cptr sslCert, vm::cpptr< return CELL_OK; } -error_code cellSslCertGetNotBefore(vm::cptr sslCert, vm::ptr begin) +error_code cellSslCertGetNotBefore(vm::cptr sslCert, + vm::ptr begin) { - cellSsl.todo("cellSslCertGetNotBefore(sslCert=*0x%x, begin=*0x%x)", sslCert, begin); + cellSsl.todo("cellSslCertGetNotBefore(sslCert=*0x%x, begin=*0x%x)", sslCert, + begin); if (!g_fxo->get().is_init) return CELL_SSL_ERROR_NOT_INITIALIZED; @@ -218,9 +245,11 @@ error_code cellSslCertGetNotBefore(vm::cptr sslCert, vm::ptr return CELL_OK; } -error_code cellSslCertGetNotAfter(vm::cptr sslCert, vm::ptr limit) +error_code cellSslCertGetNotAfter(vm::cptr sslCert, + vm::ptr limit) { - cellSsl.todo("cellSslCertGetNotAfter(sslCert=*0x%x, limit=*0x%x)", sslCert, limit); + cellSsl.todo("cellSslCertGetNotAfter(sslCert=*0x%x, limit=*0x%x)", sslCert, + limit); if (!g_fxo->get().is_init) return CELL_SSL_ERROR_NOT_INITIALIZED; @@ -234,9 +263,11 @@ error_code cellSslCertGetNotAfter(vm::cptr sslCert, vm::ptr l return CELL_OK; } -error_code cellSslCertGetSubjectName(vm::cptr sslCert, vm::cpptr certName) +error_code cellSslCertGetSubjectName(vm::cptr sslCert, + vm::cpptr certName) { - cellSsl.todo("cellSslCertGetSubjectName(sslCert=*0x%x, certName=**0x%x)", sslCert, certName); + cellSsl.todo("cellSslCertGetSubjectName(sslCert=*0x%x, certName=**0x%x)", + sslCert, certName); if (!g_fxo->get().is_init) return CELL_SSL_ERROR_NOT_INITIALIZED; @@ -250,9 +281,11 @@ error_code cellSslCertGetSubjectName(vm::cptr sslCert, vm::cpptr cer return CELL_OK; } -error_code cellSslCertGetIssuerName(vm::cptr sslCert, vm::cpptr certName) +error_code cellSslCertGetIssuerName(vm::cptr sslCert, + vm::cpptr certName) { - cellSsl.todo("cellSslCertGetIssuerName(sslCert=*0x%x, certName=**0x%x)", sslCert, certName); + cellSsl.todo("cellSslCertGetIssuerName(sslCert=*0x%x, certName=**0x%x)", + sslCert, certName); if (!g_fxo->get().is_init) return CELL_SSL_ERROR_NOT_INITIALIZED; @@ -266,9 +299,11 @@ error_code cellSslCertGetIssuerName(vm::cptr sslCert, vm::cpptr cert return CELL_OK; } -error_code cellSslCertGetNameEntryCount(vm::cptr certName, vm::ptr entryCount) +error_code cellSslCertGetNameEntryCount(vm::cptr certName, + vm::ptr entryCount) { - cellSsl.todo("cellSslCertGetNameEntryCount(certName=*0x%x, entryCount=*0x%x)", certName, entryCount); + cellSsl.todo("cellSslCertGetNameEntryCount(certName=*0x%x, entryCount=*0x%x)", + certName, entryCount); if (!g_fxo->get().is_init) return CELL_SSL_ERROR_NOT_INITIALIZED; @@ -282,9 +317,14 @@ error_code cellSslCertGetNameEntryCount(vm::cptr certName, vm::ptr en return CELL_OK; } -error_code cellSslCertGetNameEntryInfo(vm::cptr certName, u32 entryNum, vm::cpptr oidName, vm::cpptr value, vm::ptr valueLength, s32 flag) +error_code cellSslCertGetNameEntryInfo(vm::cptr certName, u32 entryNum, + vm::cpptr oidName, + vm::cpptr value, + vm::ptr valueLength, s32 flag) { - cellSsl.todo("cellSslCertGetNameEntryInfo(certName=*0x%x, entryNum=%d, oidName=**0x%x, value=**0x%x, valueLength=*0x%x, flag=0x%x)", certName, entryNum, oidName, value, valueLength, flag); + cellSsl.todo("cellSslCertGetNameEntryInfo(certName=*0x%x, entryNum=%d, " + "oidName=**0x%x, value=**0x%x, valueLength=*0x%x, flag=0x%x)", + certName, entryNum, oidName, value, valueLength, flag); if (!g_fxo->get().is_init) return CELL_SSL_ERROR_NOT_INITIALIZED; @@ -298,9 +338,12 @@ error_code cellSslCertGetNameEntryInfo(vm::cptr certName, u32 entryNum, vm return CELL_OK; } -error_code cellSslCertGetMd5Fingerprint(vm::cptr sslCert, vm::cptr buf, vm::cptr plen) +error_code cellSslCertGetMd5Fingerprint(vm::cptr sslCert, + vm::cptr buf, vm::cptr plen) { - cellSsl.todo("cellSslCertGetMd5Fingerprint(sslCert=*0x%x, buf=*0x%x, plen=*0x%x)", sslCert, buf, plen); + cellSsl.todo( + "cellSslCertGetMd5Fingerprint(sslCert=*0x%x, buf=*0x%x, plen=*0x%x)", + sslCert, buf, plen); if (!g_fxo->get().is_init) return CELL_SSL_ERROR_NOT_INITIALIZED; diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellStorage.cpp b/ps3fw/cellStorage.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellStorage.cpp rename to ps3fw/cellStorage.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellSubDisplay.cpp b/ps3fw/cellSubDisplay.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellSubDisplay.cpp rename to ps3fw/cellSubDisplay.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellSubDisplay.h b/ps3fw/cellSubDisplay.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellSubDisplay.h rename to ps3fw/cellSubDisplay.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellSync.cpp b/ps3fw/cellSync.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellSync.cpp rename to ps3fw/cellSync.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellSync2.cpp b/ps3fw/cellSync2.cpp similarity index 60% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellSync2.cpp rename to ps3fw/cellSync2.cpp index 63ff75c0c..e9a46fa17 100644 --- a/rpcs3/rpcs3/Emu/Cell/Modules/cellSync2.cpp +++ b/ps3fw/cellSync2.cpp @@ -1,9 +1,9 @@ -#include "stdafx.h" #include "Emu/Cell/PPUModule.h" +#include "stdafx.h" #include "cellSync2.h" -#include "Utilities/StrUtil.h" +#include "util/StrUtil.h" LOG_CHANNEL(cellSync2); @@ -39,17 +39,22 @@ void fmt_class_string::format(std::string& out, u64 arg) }); } -error_code _cellSync2MutexAttributeInitialize(vm::ptr attr, u32 sdkVersion) +error_code +_cellSync2MutexAttributeInitialize(vm::ptr attr, + u32 sdkVersion) { - cellSync2.warning("_cellSync2MutexAttributeInitialize(attr=*0x%x, sdkVersion=0x%x)", attr, sdkVersion); + cellSync2.warning( + "_cellSync2MutexAttributeInitialize(attr=*0x%x, sdkVersion=0x%x)", attr, + sdkVersion); if (!attr) return CELL_SYNC2_ERROR_NULL_POINTER; attr->sdkVersion = sdkVersion; - attr->threadTypes = CELL_SYNC2_THREAD_TYPE_PPU_THREAD | CELL_SYNC2_THREAD_TYPE_PPU_FIBER | - CELL_SYNC2_THREAD_TYPE_SPURS_TASK | CELL_SYNC2_THREAD_TYPE_SPURS_JOB | - CELL_SYNC2_THREAD_TYPE_SPURS_JOBQUEUE_JOB; + attr->threadTypes = + CELL_SYNC2_THREAD_TYPE_PPU_THREAD | CELL_SYNC2_THREAD_TYPE_PPU_FIBER | + CELL_SYNC2_THREAD_TYPE_SPURS_TASK | CELL_SYNC2_THREAD_TYPE_SPURS_JOB | + CELL_SYNC2_THREAD_TYPE_SPURS_JOBQUEUE_JOB; attr->maxWaiters = 15; attr->recursive = false; strcpy_trunc(attr->name, "CellSync2Mutex"); @@ -57,9 +62,13 @@ error_code _cellSync2MutexAttributeInitialize(vm::ptr a return CELL_OK; } -error_code cellSync2MutexEstimateBufferSize(vm::cptr attr, vm::ptr bufferSize) +error_code +cellSync2MutexEstimateBufferSize(vm::cptr attr, + vm::ptr bufferSize) { - cellSync2.todo("cellSync2MutexEstimateBufferSize(attr=*0x%x, bufferSize=*0x%x)", attr, bufferSize); + cellSync2.todo( + "cellSync2MutexEstimateBufferSize(attr=*0x%x, bufferSize=*0x%x)", attr, + bufferSize); if (!attr || !bufferSize) return CELL_SYNC2_ERROR_NULL_POINTER; @@ -70,9 +79,13 @@ error_code cellSync2MutexEstimateBufferSize(vm::cptr at return CELL_OK; } -error_code cellSync2MutexInitialize(vm::ptr mutex, vm::ptr buffer, vm::cptr attr) +error_code cellSync2MutexInitialize(vm::ptr mutex, + vm::ptr buffer, + vm::cptr attr) { - cellSync2.todo("cellSync2MutexInitialize(mutex=*0x%x, buffer=*0x%x, attr=*0x%x)", mutex, buffer, attr); + cellSync2.todo( + "cellSync2MutexInitialize(mutex=*0x%x, buffer=*0x%x, attr=*0x%x)", mutex, + buffer, attr); if (!mutex || !attr) return CELL_SYNC2_ERROR_NULL_POINTER; @@ -96,9 +109,11 @@ error_code cellSync2MutexFinalize(vm::ptr mutex) return CELL_OK; } -error_code cellSync2MutexLock(vm::ptr mutex, vm::cptr config) +error_code cellSync2MutexLock(vm::ptr mutex, + vm::cptr config) { - cellSync2.todo("cellSync2MutexLock(mutex=*0x%x, config=*0x%x)", mutex, config); + cellSync2.todo("cellSync2MutexLock(mutex=*0x%x, config=*0x%x)", mutex, + config); if (!mutex) return CELL_SYNC2_ERROR_NULL_POINTER; @@ -106,9 +121,11 @@ error_code cellSync2MutexLock(vm::ptr mutex, vm::cptr mutex, vm::cptr config) +error_code cellSync2MutexTryLock(vm::ptr mutex, + vm::cptr config) { - cellSync2.todo("cellSync2MutexTryLock(mutex=*0x%x, config=*0x%x)", mutex, config); + cellSync2.todo("cellSync2MutexTryLock(mutex=*0x%x, config=*0x%x)", mutex, + config); if (!mutex) return CELL_SYNC2_ERROR_NULL_POINTER; @@ -116,9 +133,11 @@ error_code cellSync2MutexTryLock(vm::ptr mutex, vm::cptr mutex, vm::cptr config) +error_code cellSync2MutexUnlock(vm::ptr mutex, + vm::cptr config) { - cellSync2.todo("cellSync2MutexUnlock(mutex=*0x%x, config=*0x%x)", mutex, config); + cellSync2.todo("cellSync2MutexUnlock(mutex=*0x%x, config=*0x%x)", mutex, + config); if (!mutex) return CELL_SYNC2_ERROR_NULL_POINTER; @@ -126,9 +145,13 @@ error_code cellSync2MutexUnlock(vm::ptr mutex, vm::cptr attr, u32 sdkVersion) +error_code +_cellSync2CondAttributeInitialize(vm::ptr attr, + u32 sdkVersion) { - cellSync2.warning("_cellSync2CondAttributeInitialize(attr=*0x%x, sdkVersion=0x%x)", attr, sdkVersion); + cellSync2.warning( + "_cellSync2CondAttributeInitialize(attr=*0x%x, sdkVersion=0x%x)", attr, + sdkVersion); if (!attr) return CELL_SYNC2_ERROR_NULL_POINTER; @@ -140,9 +163,13 @@ error_code _cellSync2CondAttributeInitialize(vm::ptr att return CELL_OK; } -error_code cellSync2CondEstimateBufferSize(vm::cptr attr, vm::ptr bufferSize) +error_code +cellSync2CondEstimateBufferSize(vm::cptr attr, + vm::ptr bufferSize) { - cellSync2.todo("cellSync2CondEstimateBufferSize(attr=*0x%x, bufferSize=*0x%x)", attr, bufferSize); + cellSync2.todo( + "cellSync2CondEstimateBufferSize(attr=*0x%x, bufferSize=*0x%x)", attr, + bufferSize); if (!attr || !bufferSize) return CELL_SYNC2_ERROR_NULL_POINTER; @@ -153,9 +180,14 @@ error_code cellSync2CondEstimateBufferSize(vm::cptr attr return CELL_OK; } -error_code cellSync2CondInitialize(vm::ptr cond, vm::ptr mutex, vm::ptr buffer, vm::cptr attr) +error_code cellSync2CondInitialize(vm::ptr cond, + vm::ptr mutex, + vm::ptr buffer, + vm::cptr attr) { - cellSync2.todo("cellSync2CondInitialize(cond=*0x%x, mutex=*0x%x, buffer=*0x%x, attr=*0x%x)", cond, mutex, buffer, attr); + cellSync2.todo("cellSync2CondInitialize(cond=*0x%x, mutex=*0x%x, " + "buffer=*0x%x, attr=*0x%x)", + cond, mutex, buffer, attr); if (!cond || !mutex || !buffer || !attr) return CELL_SYNC2_ERROR_NULL_POINTER; @@ -176,7 +208,8 @@ error_code cellSync2CondFinalize(vm::ptr cond) return CELL_OK; } -error_code cellSync2CondWait(vm::ptr cond, vm::cptr config) +error_code cellSync2CondWait(vm::ptr cond, + vm::cptr config) { cellSync2.todo("cellSync2CondWait(cond=*0x%x, config=*0x%x)", cond, config); @@ -186,7 +219,8 @@ error_code cellSync2CondWait(vm::ptr cond, vm::cptr cond, vm::cptr config) +error_code cellSync2CondSignal(vm::ptr cond, + vm::cptr config) { cellSync2.todo("cellSync2CondSignal(cond=*0x%x, config=*0x%x)", cond, config); @@ -196,9 +230,11 @@ error_code cellSync2CondSignal(vm::ptr cond, vm::cptr cond, vm::cptr config) +error_code cellSync2CondSignalAll(vm::ptr cond, + vm::cptr config) { - cellSync2.todo("cellSync2CondSignalAll(cond=*0x%x, config=*0x%x)", cond, config); + cellSync2.todo("cellSync2CondSignalAll(cond=*0x%x, config=*0x%x)", cond, + config); if (!cond) return CELL_SYNC2_ERROR_NULL_POINTER; @@ -206,26 +242,34 @@ error_code cellSync2CondSignalAll(vm::ptr cond, vm::cptr attr, u32 sdkVersion) +error_code _cellSync2SemaphoreAttributeInitialize( + vm::ptr attr, u32 sdkVersion) { - cellSync2.warning("_cellSync2SemaphoreAttributeInitialize(attr=*0x%x, sdkVersion=0x%x)", attr, sdkVersion); + cellSync2.warning( + "_cellSync2SemaphoreAttributeInitialize(attr=*0x%x, sdkVersion=0x%x)", + attr, sdkVersion); if (!attr) return CELL_SYNC2_ERROR_NULL_POINTER; attr->sdkVersion = sdkVersion; - attr->threadTypes = CELL_SYNC2_THREAD_TYPE_PPU_THREAD | CELL_SYNC2_THREAD_TYPE_PPU_FIBER | - CELL_SYNC2_THREAD_TYPE_SPURS_TASK | CELL_SYNC2_THREAD_TYPE_SPURS_JOB | - CELL_SYNC2_THREAD_TYPE_SPURS_JOBQUEUE_JOB; + attr->threadTypes = + CELL_SYNC2_THREAD_TYPE_PPU_THREAD | CELL_SYNC2_THREAD_TYPE_PPU_FIBER | + CELL_SYNC2_THREAD_TYPE_SPURS_TASK | CELL_SYNC2_THREAD_TYPE_SPURS_JOB | + CELL_SYNC2_THREAD_TYPE_SPURS_JOBQUEUE_JOB; attr->maxWaiters = 1; strcpy_trunc(attr->name, "CellSync2Semaphore"); return CELL_OK; } -error_code cellSync2SemaphoreEstimateBufferSize(vm::cptr attr, vm::ptr bufferSize) +error_code +cellSync2SemaphoreEstimateBufferSize(vm::cptr attr, + vm::ptr bufferSize) { - cellSync2.todo("cellSync2SemaphoreEstimateBufferSize(attr=*0x%x, bufferSize=*0x%x)", attr, bufferSize); + cellSync2.todo( + "cellSync2SemaphoreEstimateBufferSize(attr=*0x%x, bufferSize=*0x%x)", + attr, bufferSize); if (!attr || !bufferSize) return CELL_SYNC2_ERROR_NULL_POINTER; @@ -236,14 +280,20 @@ error_code cellSync2SemaphoreEstimateBufferSize(vm::cptr semaphore, vm::ptr buffer, s32 initialValue, vm::cptr attr) +error_code +cellSync2SemaphoreInitialize(vm::ptr semaphore, + vm::ptr buffer, s32 initialValue, + vm::cptr attr) { - cellSync2.todo("cellSync2SemaphoreInitialize(semaphore=*0x%x, buffer=*0x%x, initialValue=0x%x, attr=*0x%x)", semaphore, buffer, initialValue, attr); + cellSync2.todo("cellSync2SemaphoreInitialize(semaphore=*0x%x, buffer=*0x%x, " + "initialValue=0x%x, attr=*0x%x)", + semaphore, buffer, initialValue, attr); if (!semaphore || !attr || ((attr->maxWaiters >= 2) && !buffer)) return CELL_SYNC2_ERROR_NULL_POINTER; - if ((initialValue > s32{0x7FFFFF}) || (initialValue < s32{-0x800000}) || (attr->maxWaiters == 0) || ((attr->maxWaiters == 1) && buffer)) + if ((initialValue > s32{0x7FFFFF}) || (initialValue < s32{-0x800000}) || + (attr->maxWaiters == 0) || ((attr->maxWaiters == 1) && buffer)) return CELL_SYNC2_ERROR_INVAL; return CELL_OK; @@ -259,9 +309,13 @@ error_code cellSync2SemaphoreFinalize(vm::ptr semaphore) return CELL_OK; } -error_code cellSync2SemaphoreAcquire(vm::ptr semaphore, u32 count, vm::cptr config) +error_code cellSync2SemaphoreAcquire(vm::ptr semaphore, + u32 count, + vm::cptr config) { - cellSync2.todo("cellSync2SemaphoreAcquire(semaphore=*0x%x, count=0x%x, config=*0x%x)", semaphore, count, config); + cellSync2.todo( + "cellSync2SemaphoreAcquire(semaphore=*0x%x, count=0x%x, config=*0x%x)", + semaphore, count, config); if (!semaphore) return CELL_SYNC2_ERROR_NULL_POINTER; @@ -272,9 +326,13 @@ error_code cellSync2SemaphoreAcquire(vm::ptr semaphore, u32 return CELL_OK; } -error_code cellSync2SemaphoreTryAcquire(vm::ptr semaphore, u32 count, vm::cptr config) +error_code +cellSync2SemaphoreTryAcquire(vm::ptr semaphore, u32 count, + vm::cptr config) { - cellSync2.todo("cellSync2SemaphoreTryAcquire(semaphore=*0x%x, count=0x%x, config=*0x%x)", semaphore, count, config); + cellSync2.todo( + "cellSync2SemaphoreTryAcquire(semaphore=*0x%x, count=0x%x, config=*0x%x)", + semaphore, count, config); if (!semaphore) return CELL_SYNC2_ERROR_NULL_POINTER; @@ -285,9 +343,13 @@ error_code cellSync2SemaphoreTryAcquire(vm::ptr semaphore, u return CELL_OK; } -error_code cellSync2SemaphoreRelease(vm::ptr semaphore, u32 count, vm::cptr config) +error_code cellSync2SemaphoreRelease(vm::ptr semaphore, + u32 count, + vm::cptr config) { - cellSync2.todo("cellSync2SemaphoreRelease(semaphore=*0x%x, count=0x%x, config=*0x%x)", semaphore, count, config); + cellSync2.todo( + "cellSync2SemaphoreRelease(semaphore=*0x%x, count=0x%x, config=*0x%x)", + semaphore, count, config); if (!semaphore) return CELL_SYNC2_ERROR_NULL_POINTER; @@ -298,9 +360,11 @@ error_code cellSync2SemaphoreRelease(vm::ptr semaphore, u32 return CELL_OK; } -error_code cellSync2SemaphoreGetCount(vm::ptr semaphore, vm::ptr count) +error_code cellSync2SemaphoreGetCount(vm::ptr semaphore, + vm::ptr count) { - cellSync2.todo("cellSync2SemaphoreGetCount(semaphore=*0x%x, count=*0x%x)", semaphore, count); + cellSync2.todo("cellSync2SemaphoreGetCount(semaphore=*0x%x, count=*0x%x)", + semaphore, count); if (!semaphore || !count) return CELL_SYNC2_ERROR_NULL_POINTER; @@ -308,17 +372,22 @@ error_code cellSync2SemaphoreGetCount(vm::ptr semaphore, vm: return CELL_OK; } -error_code _cellSync2QueueAttributeInitialize(vm::ptr attr, u32 sdkVersion) +error_code +_cellSync2QueueAttributeInitialize(vm::ptr attr, + u32 sdkVersion) { - cellSync2.warning("_cellSync2QueueAttributeInitialize(attr=*0x%x, sdkVersion=0x%x)", attr, sdkVersion); + cellSync2.warning( + "_cellSync2QueueAttributeInitialize(attr=*0x%x, sdkVersion=0x%x)", attr, + sdkVersion); if (!attr) return CELL_SYNC2_ERROR_NULL_POINTER; attr->sdkVersion = sdkVersion; - attr->threadTypes = CELL_SYNC2_THREAD_TYPE_PPU_THREAD | CELL_SYNC2_THREAD_TYPE_PPU_FIBER | - CELL_SYNC2_THREAD_TYPE_SPURS_TASK | CELL_SYNC2_THREAD_TYPE_SPURS_JOB | - CELL_SYNC2_THREAD_TYPE_SPURS_JOBQUEUE_JOB; + attr->threadTypes = + CELL_SYNC2_THREAD_TYPE_PPU_THREAD | CELL_SYNC2_THREAD_TYPE_PPU_FIBER | + CELL_SYNC2_THREAD_TYPE_SPURS_TASK | CELL_SYNC2_THREAD_TYPE_SPURS_JOB | + CELL_SYNC2_THREAD_TYPE_SPURS_JOBQUEUE_JOB; attr->elementSize = 16; attr->depth = 1024; attr->maxPushWaiters = 15; @@ -328,29 +397,41 @@ error_code _cellSync2QueueAttributeInitialize(vm::ptr a return CELL_OK; } -error_code cellSync2QueueEstimateBufferSize(vm::cptr attr, vm::ptr bufferSize) +error_code +cellSync2QueueEstimateBufferSize(vm::cptr attr, + vm::ptr bufferSize) { - cellSync2.todo("cellSync2QueueEstimateBufferSize(attr=*0x%x, bufferSize=*0x%x)", attr, bufferSize); + cellSync2.todo( + "cellSync2QueueEstimateBufferSize(attr=*0x%x, bufferSize=*0x%x)", attr, + bufferSize); if (!attr || !bufferSize) return CELL_SYNC2_ERROR_NULL_POINTER; - if (attr->elementSize == 0u || attr->elementSize > 0x4000u || attr->elementSize % 16u || attr->depth == 0u || attr->depth > 0xFFFFFFFCu || - attr->maxPushWaiters > 0x8000u || attr->maxPopWaiters > 0x8000u) + if (attr->elementSize == 0u || attr->elementSize > 0x4000u || + attr->elementSize % 16u || attr->depth == 0u || + attr->depth > 0xFFFFFFFCu || attr->maxPushWaiters > 0x8000u || + attr->maxPopWaiters > 0x8000u) return CELL_SYNC2_ERROR_INVAL; return CELL_OK; } -error_code cellSync2QueueInitialize(vm::ptr queue, vm::ptr buffer, vm::cptr attr) +error_code cellSync2QueueInitialize(vm::ptr queue, + vm::ptr buffer, + vm::cptr attr) { - cellSync2.todo("cellSync2QueueInitialize(queue=*0x%x, buffer=*0x%x, attr=*0x%x)", queue, buffer, attr); + cellSync2.todo( + "cellSync2QueueInitialize(queue=*0x%x, buffer=*0x%x, attr=*0x%x)", queue, + buffer, attr); if (!queue || !buffer || !attr) return CELL_SYNC2_ERROR_NULL_POINTER; - if (attr->elementSize == 0u || attr->elementSize > 0x4000u || attr->elementSize % 16u || attr->depth == 0u || attr->depth > 0xFFFFFFFCu || - attr->maxPushWaiters > 0x8000u || attr->maxPopWaiters > 0x8000u) + if (attr->elementSize == 0u || attr->elementSize > 0x4000u || + attr->elementSize % 16u || attr->depth == 0u || + attr->depth > 0xFFFFFFFCu || attr->maxPushWaiters > 0x8000u || + attr->maxPopWaiters > 0x8000u) return CELL_SYNC2_ERROR_INVAL; return CELL_OK; @@ -366,9 +447,12 @@ error_code cellSync2QueueFinalize(vm::ptr queue) return CELL_OK; } -error_code cellSync2QueuePush(vm::ptr queue, vm::cptr data, vm::cptr config) +error_code cellSync2QueuePush(vm::ptr queue, + vm::cptr data, + vm::cptr config) { - cellSync2.todo("cellSync2QueuePush(queue=*0x%x, data=*0x%x, config=*0x%x)", queue, data, config); + cellSync2.todo("cellSync2QueuePush(queue=*0x%x, data=*0x%x, config=*0x%x)", + queue, data, config); if (!queue || !data) return CELL_SYNC2_ERROR_NULL_POINTER; @@ -376,9 +460,13 @@ error_code cellSync2QueuePush(vm::ptr queue, vm::cptr data return CELL_OK; } -error_code cellSync2QueueTryPush(vm::ptr queue, vm::cpptr data, u32 numData, vm::cptr config) +error_code cellSync2QueueTryPush(vm::ptr queue, + vm::cpptr data, u32 numData, + vm::cptr config) { - cellSync2.todo("cellSync2QueueTryPush(queue=*0x%x, data=**0x%x, numData=0x%x, config=*0x%x)", queue, data, numData, config); + cellSync2.todo("cellSync2QueueTryPush(queue=*0x%x, data=**0x%x, " + "numData=0x%x, config=*0x%x)", + queue, data, numData, config); if (!queue || !data) return CELL_SYNC2_ERROR_NULL_POINTER; @@ -386,9 +474,12 @@ error_code cellSync2QueueTryPush(vm::ptr queue, vm::cpptr return CELL_OK; } -error_code cellSync2QueuePop(vm::ptr queue, vm::ptr buffer, vm::cptr config) +error_code cellSync2QueuePop(vm::ptr queue, + vm::ptr buffer, + vm::cptr config) { - cellSync2.todo("cellSync2QueuePop(queue=*0x%x, buffer=*0x%x, config=*0x%x)", queue, buffer, config); + cellSync2.todo("cellSync2QueuePop(queue=*0x%x, buffer=*0x%x, config=*0x%x)", + queue, buffer, config); if (!queue || !buffer) return CELL_SYNC2_ERROR_NULL_POINTER; @@ -396,9 +487,13 @@ error_code cellSync2QueuePop(vm::ptr queue, vm::ptr buffer return CELL_OK; } -error_code cellSync2QueueTryPop(vm::ptr queue, vm::ptr buffer, vm::cptr config) +error_code cellSync2QueueTryPop(vm::ptr queue, + vm::ptr buffer, + vm::cptr config) { - cellSync2.todo("cellSync2QueueTryPop(queue=*0x%x, buffer=*0x%x, config=*0x%x)", queue, buffer, config); + cellSync2.todo( + "cellSync2QueueTryPop(queue=*0x%x, buffer=*0x%x, config=*0x%x)", queue, + buffer, config); if (!queue || !buffer) return CELL_SYNC2_ERROR_NULL_POINTER; @@ -406,7 +501,8 @@ error_code cellSync2QueueTryPop(vm::ptr queue, vm::ptr buf return CELL_OK; } -error_code cellSync2QueueGetSize(vm::ptr queue, vm::ptr size) +error_code cellSync2QueueGetSize(vm::ptr queue, + vm::ptr size) { cellSync2.todo("cellSync2QueueGetSize(queue=*0x%x, size=*0x%x)", queue, size); @@ -416,9 +512,11 @@ error_code cellSync2QueueGetSize(vm::ptr queue, vm::ptr siz return CELL_OK; } -error_code cellSync2QueueGetDepth(vm::ptr queue, vm::ptr depth) +error_code cellSync2QueueGetDepth(vm::ptr queue, + vm::ptr depth) { - cellSync2.todo("cellSync2QueueGetDepth(queue=*0x%x, depth=*0x%x)", queue, depth); + cellSync2.todo("cellSync2QueueGetDepth(queue=*0x%x, depth=*0x%x)", queue, + depth); if (!queue || !depth) return CELL_SYNC2_ERROR_NULL_POINTER; diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellSysCache.cpp b/ps3fw/cellSysCache.cpp similarity index 73% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellSysCache.cpp rename to ps3fw/cellSysCache.cpp index 05321adc6..bd3f58a6e 100644 --- a/rpcs3/rpcs3/Emu/Cell/Modules/cellSysCache.cpp +++ b/ps3fw/cellSysCache.cpp @@ -1,14 +1,14 @@ -#include "stdafx.h" -#include "Emu/System.h" -#include "Emu/system_utils.hpp" -#include "Emu/VFS.h" -#include "Emu/IdManager.h" #include "Emu/Cell/PPUModule.h" +#include "Emu/IdManager.h" +#include "Emu/System.h" +#include "Emu/VFS.h" +#include "Emu/system_utils.hpp" +#include "stdafx.h" #include "Emu/Cell/lv2/sys_fs.h" #include "cellSysutil.h" +#include "util/StrUtil.h" #include "util/init_mutex.hpp" -#include "Utilities/StrUtil.h" LOG_CHANNEL(cellSysutil); @@ -31,7 +31,8 @@ void fmt_class_string::format(std::string& out, u64 arg) extern lv2_fs_mount_point g_mp_sys_dev_hdd1; -extern std::string get_syscache_state_corruption_indicator_file_path(std::string_view dir_path); +extern std::string +get_syscache_state_corruption_indicator_file_path(std::string_view dir_path); struct syscache_info { @@ -56,9 +57,14 @@ struct syscache_info id = id.substr(id.find_last_of(fs::delim) + 1); cache_id = std::string{id}; - if (!Emu.DeserialManager() && !fs::write_file(get_syscache_state_corruption_indicator_file_path(Emu.hdd1), fs::write_new)) + if (!Emu.DeserialManager() && + !fs::write_file( + get_syscache_state_corruption_indicator_file_path(Emu.hdd1), + fs::write_new)) { - fmt::throw_exception("Failed to create HDD1 corruption indicator file! (path='%s', reason='%s')", Emu.hdd1, fs::g_tls_error); + fmt::throw_exception("Failed to create HDD1 corruption indicator file! " + "(path='%s', reason='%s')", + Emu.hdd1, fs::g_tls_error); } cellSysutil.success("Retained cache from parent process: %s", Emu.hdd1); @@ -74,7 +80,8 @@ struct syscache_info { cache_id = vfs::unescape(entry.name); - if (fs::is_file(get_syscache_state_corruption_indicator_file_path(cache_root + '/' + cache_id))) + if (fs::is_file(get_syscache_state_corruption_indicator_file_path( + cache_root + '/' + cache_id))) { // State is not complete clear(true); @@ -82,7 +89,8 @@ struct syscache_info continue; } - cellSysutil.notice("Retained cache from past data: %s", cache_root + '/' + cache_id); + cellSysutil.notice("Retained cache from past data: %s", + cache_root + '/' + cache_id); break; } } @@ -91,9 +99,12 @@ struct syscache_info void clear(bool remove_root, bool lock = false) const noexcept { // Clear cache - if (!vfs::host::remove_all(cache_root + cache_id, cache_root, &g_mp_sys_dev_hdd1, remove_root, lock)) + if (!vfs::host::remove_all(cache_root + cache_id, cache_root, + &g_mp_sys_dev_hdd1, remove_root, lock)) { - cellSysutil.fatal("cellSysCache: failed to clear cache directory '%s%s' (%s)", cache_root, cache_id, fs::g_tls_error); + cellSysutil.fatal( + "cellSysCache: failed to clear cache directory '%s%s' (%s)", + cache_root, cache_id, fs::g_tls_error); } // Poison opened files in /dev_hdd1 to return CELL_EIO on access @@ -118,30 +129,37 @@ struct syscache_info if (!retain_caches) { - vfs::host::remove_all(cache_root + cache_id, cache_root, &g_mp_sys_dev_hdd1, true, false, true); + vfs::host::remove_all(cache_root + cache_id, cache_root, + &g_mp_sys_dev_hdd1, true, false, true); return; } idm::select([](u32 /*id*/, lv2_file& file) { - if (file.file && file.mp->flags & lv2_mp_flag::cache && file.flags & CELL_FS_O_ACCMODE) + if (file.file && file.mp->flags & lv2_mp_flag::cache && + file.flags & CELL_FS_O_ACCMODE) { file.file.sync(); } }); - fs::remove_file(get_syscache_state_corruption_indicator_file_path(cache_root + cache_id)); + fs::remove_file(get_syscache_state_corruption_indicator_file_path( + cache_root + cache_id)); } }; -extern std::string get_syscache_state_corruption_indicator_file_path(std::string_view dir_path) +extern std::string +get_syscache_state_corruption_indicator_file_path(std::string_view dir_path) { constexpr std::u8string_view append_path = u8"/$hdd0_temp_state_indicator"; - const std::string_view filename = reinterpret_cast(append_path.data()); + const std::string_view filename = + reinterpret_cast(append_path.data()); if (dir_path.empty()) { - return rpcs3::utils::get_hdd1_dir() + "/caches/" + ensure(g_fxo->try_get())->cache_id + "/" + filename.data(); + return rpcs3::utils::get_hdd1_dir() + "/caches/" + + ensure(g_fxo->try_get())->cache_id + "/" + + filename.data(); } return std::string{dir_path} + filename.data(); @@ -177,7 +195,8 @@ error_code cellSysCacheClear() error_code cellSysCacheMount(vm::ptr param) { - cellSysutil.notice("cellSysCacheMount(param=*0x%x ('%s'))", param, param.ptr(&CellSysCacheParam::cacheId)); + cellSysutil.notice("cellSysCacheMount(param=*0x%x ('%s'))", param, + param.ptr(&CellSysCacheParam::cacheId)); auto& cache = g_fxo->get(); @@ -188,9 +207,13 @@ error_code cellSysCacheMount(vm::ptr param) std::string cache_name; - ensure(vm::read_string(param.ptr(&CellSysCacheParam::cacheId).addr(), sizeof(param->cacheId), cache_name), "Access violation"); + ensure(vm::read_string(param.ptr(&CellSysCacheParam::cacheId).addr(), + sizeof(param->cacheId), cache_name), + "Access violation"); - if (!cache_name.empty() && sysutil_check_name_string(cache_name.data(), 1, CELL_SYSCACHE_ID_SIZE) != 0) + if (!cache_name.empty() && + sysutil_check_name_string(cache_name.data(), 1, CELL_SYSCACHE_ID_SIZE) != + 0) { return CELL_SYSCACHE_ERROR_PARAM; } @@ -209,7 +232,8 @@ error_code cellSysCacheMount(vm::ptr param) std::lock_guard lock0(g_mp_sys_dev_hdd1.mutex); - // Check if can reuse existing cache (won't if cache id is an empty string or cache is damaged/incomplete) + // Check if can reuse existing cache (won't if cache id is an empty string or + // cache is damaged/incomplete) if (!cache_name.empty() && cache_id == cache.cache_id) { // Isn't mounted yet on first call to cellSysCacheMount @@ -239,7 +263,9 @@ error_code cellSysCacheMount(vm::ptr param) { if (fs::g_tls_error != fs::error::exist) { - fmt::throw_exception("Failed to create HDD1 cache! (path='%s', reason='%s')", new_path, fs::g_tls_error); + fmt::throw_exception( + "Failed to create HDD1 cache! (path='%s', reason='%s')", new_path, + fs::g_tls_error); } // Clear new cache @@ -247,9 +273,13 @@ error_code cellSysCacheMount(vm::ptr param) } } - if (!fs::write_file(get_syscache_state_corruption_indicator_file_path(new_path), fs::write_new)) + if (!fs::write_file( + get_syscache_state_corruption_indicator_file_path(new_path), + fs::write_new)) { - fmt::throw_exception("Failed to create HDD1 corruption indicator file! (path='%s', reason='%s')", new_path, fs::g_tls_error); + fmt::throw_exception("Failed to create HDD1 corruption indicator file! " + "(path='%s', reason='%s')", + new_path, fs::g_tls_error); } if (vfs::mount("/dev_hdd1", new_path)) diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellSysconf.cpp b/ps3fw/cellSysconf.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellSysconf.cpp rename to ps3fw/cellSysconf.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellSysmodule.cpp b/ps3fw/cellSysmodule.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellSysmodule.cpp rename to ps3fw/cellSysmodule.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellSysutil.cpp b/ps3fw/cellSysutil.cpp similarity index 77% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellSysutil.cpp rename to ps3fw/cellSysutil.cpp index e2ebb317a..1dd124d96 100644 --- a/rpcs3/rpcs3/Emu/Cell/Modules/cellSysutil.cpp +++ b/ps3fw/cellSysutil.cpp @@ -1,20 +1,20 @@ #include "stdafx.h" -#include "Emu/System.h" -#include "Emu/system_config.h" -#include "Emu/IdManager.h" -#include "Emu/VFS.h" +#include "cellGame.h" #include "Emu/Cell/PPUModule.h" -#include "Emu/Cell/Modules/cellGame.h" +#include "Emu/IdManager.h" +#include "Emu/System.h" +#include "Emu/VFS.h" +#include "Emu/system_config.h" #include "Emu/Cell/lv2/sys_game.h" #include "Emu/Cell/lv2/sys_process.h" #include "cellSysutil.h" -#include "Utilities/StrUtil.h" -#include "Utilities/lockless.h" +#include "util/StrUtil.h" +#include "util/lockless.h" -#include #include +#include LOG_CHANNEL(cellSysutil); @@ -87,9 +87,11 @@ struct sysutil_cb_manager std::shared_ptr> call_active; }; - std::deque>>> registered_callbacks_abort_handles = []() + std::deque>>> + registered_callbacks_abort_handles = []() { - // Do resize for deque (cheap container which can store all non-movable value types) + // Do resize for deque (cheap container which can store all non-movable + // value types) std::deque>>> result; for (usz i = 0; i < g_sysutil_callback_id_assigner; i++) @@ -121,7 +123,8 @@ struct sysutil_cb_manager } }; -void sysutil_register_cb_with_id_internal(std::function&& cb, usz call_id) +void sysutil_register_cb_with_id_internal(std::function&& cb, + usz call_id) { auto& cbm = *ensure(g_fxo->try_get()); @@ -130,7 +133,8 @@ void sysutil_register_cb_with_id_internal(std::function&& cb, if (call_id != umax) { info.call_active = std::make_shared>(true); - ::at32(cbm.registered_callbacks_abort_handles, call_id).push(info.call_active); + ::at32(cbm.registered_callbacks_abort_handles, call_id) + .push(info.call_active); } cbm.registered.push(std::move(info)); @@ -145,7 +149,8 @@ extern void sysutil_unregister_cb_with_id_internal(usz call_id) return; } - for (auto&& abort_handle : ::at32(cbm->registered_callbacks_abort_handles, call_id).pop_all()) + for (auto&& abort_handle : + ::at32(cbm->registered_callbacks_abort_handles, call_id).pop_all()) { // Deactivate the existing event once abort_handle->store(false); @@ -167,7 +172,8 @@ extern s32 sysutil_send_system_cmd(u64 status, u64 param) { if (cbm->draw_cb_started.exchange(true)) { - cellSysutil.error("Tried to enqueue a second or more DRAWING_BEGIN callback!"); + cellSysutil.error( + "Tried to enqueue a second or more DRAWING_BEGIN callback!"); return CELL_SYSUTIL_ERROR_BUSY; } } @@ -175,7 +181,8 @@ extern s32 sysutil_send_system_cmd(u64 status, u64 param) { if (!cbm->draw_cb_started.exchange(false)) { - cellSysutil.error("Tried to enqueue a DRAWING_END callback without a BEGIN callback!"); + cellSysutil.error("Tried to enqueue a DRAWING_END callback without a " + "BEGIN callback!"); return -1; } } @@ -188,12 +195,14 @@ extern s32 sysutil_send_system_cmd(u64 status, u64 param) { if (cb.callback) { - cbm->registered.push(sysutil_cb_manager::dispatcher_cb{[=](ppu_thread& ppu) -> s32 - { - // TODO: check it and find the source of the return value (void isn't equal to CELL_OK) - cb.callback(ppu, status, param, cb.user_data); - return CELL_OK; - }}); + cbm->registered.push( + sysutil_cb_manager::dispatcher_cb{[=](ppu_thread& ppu) -> s32 + { + // TODO: check it and find the source of the return value (void + // isn't equal to CELL_OK) + cb.callback(ppu, status, param, cb.user_data); + return CELL_OK; + }}); count++; } @@ -258,26 +267,46 @@ void fmt_class_string::format(std::string& out, u64 arg) { switch (value) { - case CELL_SYSUTIL_LANG_JAPANESE: return "Japanese"; - case CELL_SYSUTIL_LANG_ENGLISH_US: return "English (US)"; - case CELL_SYSUTIL_LANG_FRENCH: return "French"; - case CELL_SYSUTIL_LANG_SPANISH: return "Spanish"; - case CELL_SYSUTIL_LANG_GERMAN: return "German"; - case CELL_SYSUTIL_LANG_ITALIAN: return "Italian"; - case CELL_SYSUTIL_LANG_DUTCH: return "Dutch"; - case CELL_SYSUTIL_LANG_PORTUGUESE_PT: return "Portuguese (Portugal)"; - case CELL_SYSUTIL_LANG_RUSSIAN: return "Russian"; - case CELL_SYSUTIL_LANG_KOREAN: return "Korean"; - case CELL_SYSUTIL_LANG_CHINESE_T: return "Chinese (Traditional)"; - case CELL_SYSUTIL_LANG_CHINESE_S: return "Chinese (Simplified)"; - case CELL_SYSUTIL_LANG_FINNISH: return "Finnish"; - case CELL_SYSUTIL_LANG_SWEDISH: return "Swedish"; - case CELL_SYSUTIL_LANG_DANISH: return "Danish"; - case CELL_SYSUTIL_LANG_NORWEGIAN: return "Norwegian"; - case CELL_SYSUTIL_LANG_POLISH: return "Polish"; - case CELL_SYSUTIL_LANG_ENGLISH_GB: return "English (UK)"; - case CELL_SYSUTIL_LANG_PORTUGUESE_BR: return "Portuguese (Brazil)"; - case CELL_SYSUTIL_LANG_TURKISH: return "Turkish"; + case CELL_SYSUTIL_LANG_JAPANESE: + return "Japanese"; + case CELL_SYSUTIL_LANG_ENGLISH_US: + return "English (US)"; + case CELL_SYSUTIL_LANG_FRENCH: + return "French"; + case CELL_SYSUTIL_LANG_SPANISH: + return "Spanish"; + case CELL_SYSUTIL_LANG_GERMAN: + return "German"; + case CELL_SYSUTIL_LANG_ITALIAN: + return "Italian"; + case CELL_SYSUTIL_LANG_DUTCH: + return "Dutch"; + case CELL_SYSUTIL_LANG_PORTUGUESE_PT: + return "Portuguese (Portugal)"; + case CELL_SYSUTIL_LANG_RUSSIAN: + return "Russian"; + case CELL_SYSUTIL_LANG_KOREAN: + return "Korean"; + case CELL_SYSUTIL_LANG_CHINESE_T: + return "Chinese (Traditional)"; + case CELL_SYSUTIL_LANG_CHINESE_S: + return "Chinese (Simplified)"; + case CELL_SYSUTIL_LANG_FINNISH: + return "Finnish"; + case CELL_SYSUTIL_LANG_SWEDISH: + return "Swedish"; + case CELL_SYSUTIL_LANG_DANISH: + return "Danish"; + case CELL_SYSUTIL_LANG_NORWEGIAN: + return "Norwegian"; + case CELL_SYSUTIL_LANG_POLISH: + return "Polish"; + case CELL_SYSUTIL_LANG_ENGLISH_GB: + return "English (UK)"; + case CELL_SYSUTIL_LANG_PORTUGUESE_BR: + return "Portuguese (Brazil)"; + case CELL_SYSUTIL_LANG_TURKISH: + return "Turkish"; } return unknown; @@ -285,19 +314,27 @@ void fmt_class_string::format(std::string& out, u64 arg) } template <> -void fmt_class_string::format(std::string& out, u64 arg) +void fmt_class_string::format(std::string& out, + u64 arg) { format_enum(out, arg, [](CellSysutilLicenseArea value) { switch (value) { - case CELL_SYSUTIL_LICENSE_AREA_J: return "SCEJ"; - case CELL_SYSUTIL_LICENSE_AREA_A: return "SCEA"; - case CELL_SYSUTIL_LICENSE_AREA_E: return "SCEE"; - case CELL_SYSUTIL_LICENSE_AREA_H: return "SCEH"; - case CELL_SYSUTIL_LICENSE_AREA_K: return "SCEK"; - case CELL_SYSUTIL_LICENSE_AREA_C: return "SCH"; - case CELL_SYSUTIL_LICENSE_AREA_OTHER: return "Other"; + case CELL_SYSUTIL_LICENSE_AREA_J: + return "SCEJ"; + case CELL_SYSUTIL_LICENSE_AREA_A: + return "SCEA"; + case CELL_SYSUTIL_LICENSE_AREA_E: + return "SCEE"; + case CELL_SYSUTIL_LICENSE_AREA_H: + return "SCEH"; + case CELL_SYSUTIL_LICENSE_AREA_K: + return "SCEK"; + case CELL_SYSUTIL_LICENSE_AREA_C: + return "SCH"; + case CELL_SYSUTIL_LICENSE_AREA_OTHER: + return "Other"; } return unknown; @@ -311,29 +348,52 @@ void fmt_class_string::format(std::string& out, u64 arg) { switch (value) { - case CELL_SYSUTIL_SYSTEMPARAM_ID_LANG: return "ID_LANG"; - case CELL_SYSUTIL_SYSTEMPARAM_ID_ENTER_BUTTON_ASSIGN: return "ID_ENTER_BUTTON_ASSIGN"; - case CELL_SYSUTIL_SYSTEMPARAM_ID_DATE_FORMAT: return "ID_DATE_FORMAT"; - case CELL_SYSUTIL_SYSTEMPARAM_ID_TIME_FORMAT: return "ID_TIME_FORMAT"; - case CELL_SYSUTIL_SYSTEMPARAM_ID_TIMEZONE: return "ID_TIMEZONE"; - case CELL_SYSUTIL_SYSTEMPARAM_ID_SUMMERTIME: return "ID_SUMMERTIME"; - case CELL_SYSUTIL_SYSTEMPARAM_ID_GAME_PARENTAL_LEVEL: return "ID_GAME_PARENTAL_LEVEL"; - case CELL_SYSUTIL_SYSTEMPARAM_ID_LICENSE_AREA: return "ID_LICENSE_AREA"; - case CELL_SYSUTIL_SYSTEMPARAM_ID_GAME_PARENTAL_LEVEL0_RESTRICT: return "ID_GAME_PARENTAL_LEVEL0_RESTRICT"; - case CELL_SYSUTIL_SYSTEMPARAM_ID_CURRENT_USER_HAS_NP_ACCOUNT: return "ID_CURRENT_USER_HAS_NP_ACCOUNT"; - case CELL_SYSUTIL_SYSTEMPARAM_ID_CAMERA_PLFREQ: return "ID_CAMERA_PLFREQ"; - case CELL_SYSUTIL_SYSTEMPARAM_ID_PAD_RUMBLE: return "ID_PAD_RUMBLE"; - case CELL_SYSUTIL_SYSTEMPARAM_ID_KEYBOARD_TYPE: return "ID_KEYBOARD_TYPE"; - case CELL_SYSUTIL_SYSTEMPARAM_ID_JAPANESE_KEYBOARD_ENTRY_METHOD: return "ID_JAPANESE_KEYBOARD_ENTRY_METHOD"; - case CELL_SYSUTIL_SYSTEMPARAM_ID_CHINESE_KEYBOARD_ENTRY_METHOD: return "ID_CHINESE_KEYBOARD_ENTRY_METHOD"; - case CELL_SYSUTIL_SYSTEMPARAM_ID_PAD_AUTOOFF: return "ID_PAD_AUTOOFF"; - case CELL_SYSUTIL_SYSTEMPARAM_ID_MAGNETOMETER: return "ID_MAGNETOMETER"; - case CELL_SYSUTIL_SYSTEMPARAM_ID_NICKNAME: return "ID_NICKNAME"; - case CELL_SYSUTIL_SYSTEMPARAM_ID_CURRENT_USERNAME: return "ID_CURRENT_USERNAME"; - case CELL_SYSUTIL_SYSTEMPARAM_ID_x1008: return "ID_x1008"; - case CELL_SYSUTIL_SYSTEMPARAM_ID_x1011: return "ID_x1011"; - case CELL_SYSUTIL_SYSTEMPARAM_ID_x1012: return "ID_x1012"; - case CELL_SYSUTIL_SYSTEMPARAM_ID_x1024: return "ID_x1024"; + case CELL_SYSUTIL_SYSTEMPARAM_ID_LANG: + return "ID_LANG"; + case CELL_SYSUTIL_SYSTEMPARAM_ID_ENTER_BUTTON_ASSIGN: + return "ID_ENTER_BUTTON_ASSIGN"; + case CELL_SYSUTIL_SYSTEMPARAM_ID_DATE_FORMAT: + return "ID_DATE_FORMAT"; + case CELL_SYSUTIL_SYSTEMPARAM_ID_TIME_FORMAT: + return "ID_TIME_FORMAT"; + case CELL_SYSUTIL_SYSTEMPARAM_ID_TIMEZONE: + return "ID_TIMEZONE"; + case CELL_SYSUTIL_SYSTEMPARAM_ID_SUMMERTIME: + return "ID_SUMMERTIME"; + case CELL_SYSUTIL_SYSTEMPARAM_ID_GAME_PARENTAL_LEVEL: + return "ID_GAME_PARENTAL_LEVEL"; + case CELL_SYSUTIL_SYSTEMPARAM_ID_LICENSE_AREA: + return "ID_LICENSE_AREA"; + case CELL_SYSUTIL_SYSTEMPARAM_ID_GAME_PARENTAL_LEVEL0_RESTRICT: + return "ID_GAME_PARENTAL_LEVEL0_RESTRICT"; + case CELL_SYSUTIL_SYSTEMPARAM_ID_CURRENT_USER_HAS_NP_ACCOUNT: + return "ID_CURRENT_USER_HAS_NP_ACCOUNT"; + case CELL_SYSUTIL_SYSTEMPARAM_ID_CAMERA_PLFREQ: + return "ID_CAMERA_PLFREQ"; + case CELL_SYSUTIL_SYSTEMPARAM_ID_PAD_RUMBLE: + return "ID_PAD_RUMBLE"; + case CELL_SYSUTIL_SYSTEMPARAM_ID_KEYBOARD_TYPE: + return "ID_KEYBOARD_TYPE"; + case CELL_SYSUTIL_SYSTEMPARAM_ID_JAPANESE_KEYBOARD_ENTRY_METHOD: + return "ID_JAPANESE_KEYBOARD_ENTRY_METHOD"; + case CELL_SYSUTIL_SYSTEMPARAM_ID_CHINESE_KEYBOARD_ENTRY_METHOD: + return "ID_CHINESE_KEYBOARD_ENTRY_METHOD"; + case CELL_SYSUTIL_SYSTEMPARAM_ID_PAD_AUTOOFF: + return "ID_PAD_AUTOOFF"; + case CELL_SYSUTIL_SYSTEMPARAM_ID_MAGNETOMETER: + return "ID_MAGNETOMETER"; + case CELL_SYSUTIL_SYSTEMPARAM_ID_NICKNAME: + return "ID_NICKNAME"; + case CELL_SYSUTIL_SYSTEMPARAM_ID_CURRENT_USERNAME: + return "ID_CURRENT_USERNAME"; + case CELL_SYSUTIL_SYSTEMPARAM_ID_x1008: + return "ID_x1008"; + case CELL_SYSUTIL_SYSTEMPARAM_ID_x1011: + return "ID_x1011"; + case CELL_SYSUTIL_SYSTEMPARAM_ID_x1012: + return "ID_x1012"; + case CELL_SYSUTIL_SYSTEMPARAM_ID_x1024: + return "ID_x1024"; } return unknown; @@ -404,9 +464,11 @@ error_code _cellSysutilGetSystemParamInt() return CELL_OK; } -error_code cellSysutilGetSystemParamInt(CellSysutilParamId id, vm::ptr value) +error_code cellSysutilGetSystemParamInt(CellSysutilParamId id, + vm::ptr value) { - cellSysutil.warning("cellSysutilGetSystemParamInt(id=0x%x(%s), value=*0x%x)", id, id, value); + cellSysutil.warning("cellSysutilGetSystemParamInt(id=0x%x(%s), value=*0x%x)", + id, id, value); if (!value) { @@ -503,9 +565,12 @@ error_code cellSysutilGetSystemParamInt(CellSysutilParamId id, vm::ptr valu return CELL_OK; } -error_code cellSysutilGetSystemParamString(CellSysutilParamId id, vm::ptr buf, u32 bufsize) +error_code cellSysutilGetSystemParamString(CellSysutilParamId id, + vm::ptr buf, u32 bufsize) { - cellSysutil.trace("cellSysutilGetSystemParamString(id=0x%x(%s), buf=*0x%x, bufsize=%d)", id, id, buf, bufsize); + cellSysutil.trace( + "cellSysutilGetSystemParamString(id=0x%x(%s), buf=*0x%x, bufsize=%d)", id, + id, buf, bufsize); if (!buf) { @@ -527,11 +592,14 @@ error_code cellSysutilGetSystemParamString(CellSysutilParamId id, vm::ptr case CELL_SYSUTIL_SYSTEMPARAM_ID_CURRENT_USERNAME: { - const fs::file username(vfs::get(fmt::format("/dev_hdd0/home/%08u/localusername", Emu.GetUsrId()))); + const fs::file username(vfs::get( + fmt::format("/dev_hdd0/home/%08u/localusername", Emu.GetUsrId()))); if (!username) { - cellSysutil.error("cellSysutilGetSystemParamString(): Username for user %08u doesn't exist. Did you delete the username file?", Emu.GetUsrId()); + cellSysutil.error("cellSysutilGetSystemParamString(): Username for user " + "%08u doesn't exist. Did you delete the username file?", + Emu.GetUsrId()); } else { @@ -569,7 +637,8 @@ error_code cellSysutilGetSystemParamString(CellSysutilParamId id, vm::ptr if (report_use) { - cellSysutil.error("cellSysutilGetSystemParamString: Unknown ParamId 0x%x", id); + cellSysutil.error("cellSysutilGetSystemParamString: Unknown ParamId 0x%x", + id); } std::span dst(buf.get_ptr(), copy_size); @@ -578,11 +647,15 @@ error_code cellSysutilGetSystemParamString(CellSysutilParamId id, vm::ptr } // Note: the way we do things here is inaccurate(but maybe sufficient) -// The real function goes over a table of 0x20 entries[ event_code:u32 callback_addr:u32 ] -// Those callbacks are registered through cellSysutilRegisterCallbackDispatcher(u32 event_code, vm::ptr func_addr) -// The function goes through all the callback looking for one callback associated with event 0x100, if any is found it is called with parameters r3=0x101 r4=0 -// This particular CB seems to be associated with sysutil itself -// Then it checks for events on an event_queue associated with sysutil, checks if any cb is associated with that event and calls them with parameters that come from the event +// The real function goes over a table of 0x20 entries[ event_code:u32 +// callback_addr:u32 ] Those callbacks are registered through +// cellSysutilRegisterCallbackDispatcher(u32 event_code, vm::ptr +// func_addr) The function goes through all the callback looking for one +// callback associated with event 0x100, if any is found it is called with +// parameters r3=0x101 r4=0 This particular CB seems to be associated with +// sysutil itself Then it checks for events on an event_queue associated with +// sysutil, checks if any cb is associated with that event and calls them with +// parameters that come from the event error_code cellSysutilCheckCallback(ppu_thread& ppu) { cellSysutil.trace("cellSysutilCheckCallback()"); @@ -620,9 +693,13 @@ error_code cellSysutilCheckCallback(ppu_thread& ppu) return CELL_OK; } -error_code cellSysutilRegisterCallback(u32 slot, vm::ptr func, vm::ptr userdata) +error_code cellSysutilRegisterCallback(u32 slot, + vm::ptr func, + vm::ptr userdata) { - cellSysutil.warning("cellSysutilRegisterCallback(slot=%d, func=*0x%x, userdata=*0x%x)", slot, func, userdata); + cellSysutil.warning( + "cellSysutilRegisterCallback(slot=%d, func=*0x%x, userdata=*0x%x)", slot, + func, userdata); if (slot >= 4) { @@ -676,15 +753,20 @@ error_code cellSysutilEnableBgmPlayback() return CELL_OK; } -error_code cellSysutilEnableBgmPlaybackEx(vm::ptr param) +error_code cellSysutilEnableBgmPlaybackEx( + vm::ptr param) { cellSysutil.warning("cellSysutilEnableBgmPlaybackEx(param=*0x%x)", param); if (!param || - param->systemBgmFadeInTime < CELL_SYSUTIL_BGMPLAYBACK_FADE_INVALID || param->systemBgmFadeInTime > 60000 || - param->systemBgmFadeOutTime < CELL_SYSUTIL_BGMPLAYBACK_FADE_INVALID || param->systemBgmFadeOutTime > 60000 || - param->gameBgmFadeInTime < CELL_SYSUTIL_BGMPLAYBACK_FADE_INVALID || param->gameBgmFadeInTime > 60000 || - param->gameBgmFadeOutTime < CELL_SYSUTIL_BGMPLAYBACK_FADE_INVALID || param->gameBgmFadeOutTime > 60000) + param->systemBgmFadeInTime < CELL_SYSUTIL_BGMPLAYBACK_FADE_INVALID || + param->systemBgmFadeInTime > 60000 || + param->systemBgmFadeOutTime < CELL_SYSUTIL_BGMPLAYBACK_FADE_INVALID || + param->systemBgmFadeOutTime > 60000 || + param->gameBgmFadeInTime < CELL_SYSUTIL_BGMPLAYBACK_FADE_INVALID || + param->gameBgmFadeInTime > 60000 || + param->gameBgmFadeOutTime < CELL_SYSUTIL_BGMPLAYBACK_FADE_INVALID || + param->gameBgmFadeOutTime > 60000) { return CELL_SYSUTIL_BGMPLAYBACK_EX_ERROR_PARAM; } @@ -713,15 +795,20 @@ error_code cellSysutilDisableBgmPlayback() return CELL_OK; } -error_code cellSysutilDisableBgmPlaybackEx(vm::ptr param) +error_code cellSysutilDisableBgmPlaybackEx( + vm::ptr param) { cellSysutil.warning("cellSysutilDisableBgmPlaybackEx(param=*0x%x)", param); if (!param || - param->systemBgmFadeInTime < CELL_SYSUTIL_BGMPLAYBACK_FADE_INVALID || param->systemBgmFadeInTime > 60000 || - param->systemBgmFadeOutTime < CELL_SYSUTIL_BGMPLAYBACK_FADE_INVALID || param->systemBgmFadeOutTime > 60000 || - param->gameBgmFadeInTime < CELL_SYSUTIL_BGMPLAYBACK_FADE_INVALID || param->gameBgmFadeInTime > 60000 || - param->gameBgmFadeOutTime < CELL_SYSUTIL_BGMPLAYBACK_FADE_INVALID || param->gameBgmFadeOutTime > 60000) + param->systemBgmFadeInTime < CELL_SYSUTIL_BGMPLAYBACK_FADE_INVALID || + param->systemBgmFadeInTime > 60000 || + param->systemBgmFadeOutTime < CELL_SYSUTIL_BGMPLAYBACK_FADE_INVALID || + param->systemBgmFadeOutTime > 60000 || + param->gameBgmFadeInTime < CELL_SYSUTIL_BGMPLAYBACK_FADE_INVALID || + param->gameBgmFadeInTime > 60000 || + param->gameBgmFadeOutTime < CELL_SYSUTIL_BGMPLAYBACK_FADE_INVALID || + param->gameBgmFadeOutTime > 60000) { return CELL_SYSUTIL_BGMPLAYBACK_EX_ERROR_PARAM; } @@ -739,7 +826,8 @@ error_code cellSysutilDisableBgmPlaybackEx(vm::ptr status) +error_code +cellSysutilGetBgmPlaybackStatus(vm::ptr status) { cellSysutil.trace("cellSysutilGetBgmPlaybackStatus(status=*0x%x)", status); @@ -755,7 +843,8 @@ error_code cellSysutilGetBgmPlaybackStatus(vm::ptr return CELL_OK; } -error_code cellSysutilGetBgmPlaybackStatus2(vm::ptr status2) +error_code cellSysutilGetBgmPlaybackStatus2( + vm::ptr status2) { cellSysutil.trace("cellSysutilGetBgmPlaybackStatus2(status2=*0x%x)", status2); @@ -772,15 +861,21 @@ error_code cellSysutilGetBgmPlaybackStatus2(vm::ptr param) +error_code cellSysutilSetBgmPlaybackExtraParam( + vm::ptr param) { - cellSysutil.warning("cellSysutilSetBgmPlaybackExtraParam(param=*0x%x)", param); + cellSysutil.warning("cellSysutilSetBgmPlaybackExtraParam(param=*0x%x)", + param); if (!param || - param->systemBgmFadeInTime < CELL_SYSUTIL_BGMPLAYBACK_FADE_INVALID || param->systemBgmFadeInTime > 60000 || - param->systemBgmFadeOutTime < CELL_SYSUTIL_BGMPLAYBACK_FADE_INVALID || param->systemBgmFadeOutTime > 60000 || - param->gameBgmFadeInTime < CELL_SYSUTIL_BGMPLAYBACK_FADE_INVALID || param->gameBgmFadeInTime > 60000 || - param->gameBgmFadeOutTime < CELL_SYSUTIL_BGMPLAYBACK_FADE_INVALID || param->gameBgmFadeOutTime > 60000) + param->systemBgmFadeInTime < CELL_SYSUTIL_BGMPLAYBACK_FADE_INVALID || + param->systemBgmFadeInTime > 60000 || + param->systemBgmFadeOutTime < CELL_SYSUTIL_BGMPLAYBACK_FADE_INVALID || + param->systemBgmFadeOutTime > 60000 || + param->gameBgmFadeInTime < CELL_SYSUTIL_BGMPLAYBACK_FADE_INVALID || + param->gameBgmFadeInTime > 60000 || + param->gameBgmFadeOutTime < CELL_SYSUTIL_BGMPLAYBACK_FADE_INVALID || + param->gameBgmFadeOutTime > 60000) { return CELL_SYSUTIL_BGMPLAYBACK_EX_ERROR_PARAM; } @@ -792,20 +887,25 @@ error_code cellSysutilSetBgmPlaybackExtraParam(vm::ptrgameBgmFadeInTime; bgm.param.gameBgmFadeOutTime = param->gameBgmFadeOutTime; - // TODO: apparently you are only able to set this only once and while bgm is enabled + // TODO: apparently you are only able to set this only once and while bgm is + // enabled return CELL_OK; } -error_code cellSysutilRegisterCallbackDispatcher(u32 event_code, u32 func_addr) +error_code cellSysutilRegisterCallbackDispatcher(u32 event_code, + u32 func_addr) { - cellSysutil.warning("cellSysutilRegisterCallbackDispatcher(event_code=0x%x, func_addr=0x%x)", event_code, func_addr); + cellSysutil.warning( + "cellSysutilRegisterCallbackDispatcher(event_code=0x%x, func_addr=0x%x)", + event_code, func_addr); auto& cbm = g_fxo->get(); for (u32 i = 0; i < cbm.dispatchers.size(); i++) { - if (cbm.dispatchers[i].atomic_op([&](sysutil_cb_manager::registered_dispatcher& dispatcher) + if (cbm.dispatchers[i].atomic_op( + [&](sysutil_cb_manager::registered_dispatcher& dispatcher) { if (dispatcher.event_code == 0) { @@ -825,13 +925,15 @@ error_code cellSysutilRegisterCallbackDispatcher(u32 event_code, u32 func_addr) error_code cellSysutilUnregisterCallbackDispatcher(u32 event_code) { - cellSysutil.warning("cellSysutilUnregisterCallbackDispatcher(event_code=0x%x)", event_code); + cellSysutil.warning( + "cellSysutilUnregisterCallbackDispatcher(event_code=0x%x)", event_code); auto& cbm = g_fxo->get(); for (u32 i = 0; i < cbm.dispatchers.size(); i++) { - if (cbm.dispatchers[i].atomic_op([&](sysutil_cb_manager::registered_dispatcher& dispatcher) + if (cbm.dispatchers[i].atomic_op( + [&](sysutil_cb_manager::registered_dispatcher& dispatcher) { if (dispatcher.event_code == event_code) { @@ -1095,7 +1197,8 @@ error_code _ZN16sysutil_cxmlutil11FixedMemory5BeginEi() return CELL_OK; } -error_code _ZN16sysutil_cxmlutil11FixedMemory8AllocateEN4cxml14AllocationTypeEPvS3_jPS3_Pj() +error_code +_ZN16sysutil_cxmlutil11FixedMemory8AllocateEN4cxml14AllocationTypeEPvS3_jPS3_Pj() { UNIMPLEMENTED_FUNC(cellSysutil); return CELL_OK; @@ -1207,14 +1310,18 @@ DECLARE(ppu_module_manager::cellSysutil)("cellSysutil", []() REG_FUNC(cellSysutil, _ZN8cxmlutil9GetStringERKN4cxml7ElementEPKcPS5_Pj); REG_FUNC(cellSysutil, _ZN8cxmlutil9SetStringERKN4cxml7ElementEPKcS5_); REG_FUNC(cellSysutil, _ZN8cxmlutil16CheckElementNameERKN4cxml7ElementEPKc); - REG_FUNC(cellSysutil, _ZN8cxmlutil16FindChildElementERKN4cxml7ElementEPKcS5_S5_); + REG_FUNC(cellSysutil, + _ZN8cxmlutil16FindChildElementERKN4cxml7ElementEPKcS5_S5_); REG_FUNC(cellSysutil, _ZN8cxmlutil7GetFileERKN4cxml7ElementEPKcPNS0_4FileE); REG_FUNC(cellSysutil, _ZN16sysutil_cxmlutil11FixedMemory3EndEi); REG_FUNC(cellSysutil, _ZN16sysutil_cxmlutil11FixedMemory5BeginEi); - REG_FUNC(cellSysutil, _ZN16sysutil_cxmlutil11FixedMemory8AllocateEN4cxml14AllocationTypeEPvS3_jPS3_Pj); + REG_FUNC( + cellSysutil, + _ZN16sysutil_cxmlutil11FixedMemory8AllocateEN4cxml14AllocationTypeEPvS3_jPS3_Pj); REG_FUNC(cellSysutil, _ZN16sysutil_cxmlutil12PacketWriter5WriteEPKvjPv); - REG_FUNC(cellSysutil, _ZN16sysutil_cxmlutil12PacketWriterC1EiiRN4cxml8DocumentE); + REG_FUNC(cellSysutil, + _ZN16sysutil_cxmlutil12PacketWriterC1EiiRN4cxml8DocumentE); REG_FNID(cellSysutil, 0xE1EC7B6A, cellSysutil_E1EC7B6A); }); diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellSysutilAp.cpp b/ps3fw/cellSysutilAp.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellSysutilAp.cpp rename to ps3fw/cellSysutilAp.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellSysutilAvc.cpp b/ps3fw/cellSysutilAvc.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellSysutilAvc.cpp rename to ps3fw/cellSysutilAvc.cpp index e1375087d..df65bf4f3 100644 --- a/rpcs3/rpcs3/Emu/Cell/Modules/cellSysutilAvc.cpp +++ b/ps3fw/cellSysutilAvc.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "Emu/Cell/PPUModule.h" -#include "Emu/Cell/Modules/cellSysutilAvc.h" -#include "Emu/Cell/Modules/cellSysutil.h" +#include "cellSysutilAvc.h" +#include "cellSysutil.h" #include "Emu/IdManager.h" LOG_CHANNEL(cellSysutil); diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellSysutilAvc2.cpp b/ps3fw/cellSysutilAvc2.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellSysutilAvc2.cpp rename to ps3fw/cellSysutilAvc2.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellSysutilAvcExt.cpp b/ps3fw/cellSysutilAvcExt.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellSysutilAvcExt.cpp rename to ps3fw/cellSysutilAvcExt.cpp index cbafb3068..21fbb3f97 100644 --- a/rpcs3/rpcs3/Emu/Cell/Modules/cellSysutilAvcExt.cpp +++ b/ps3fw/cellSysutilAvcExt.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "Emu/Cell/PPUModule.h" -#include "Emu/Cell/Modules/cellSysutilAvc.h" +#include "cellSysutilAvc.h" LOG_CHANNEL(cellSysutilAvcExt); diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellSysutilMisc.cpp b/ps3fw/cellSysutilMisc.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellSysutilMisc.cpp rename to ps3fw/cellSysutilMisc.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellSysutilNpEula.cpp b/ps3fw/cellSysutilNpEula.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellSysutilNpEula.cpp rename to ps3fw/cellSysutilNpEula.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellUsbd.cpp b/ps3fw/cellUsbd.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellUsbd.cpp rename to ps3fw/cellUsbd.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellUsbpspcm.cpp b/ps3fw/cellUsbpspcm.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellUsbpspcm.cpp rename to ps3fw/cellUsbpspcm.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellUserInfo.cpp b/ps3fw/cellUserInfo.cpp similarity index 63% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellUserInfo.cpp rename to ps3fw/cellUserInfo.cpp index 0ea97d98e..18da6e124 100644 --- a/rpcs3/rpcs3/Emu/Cell/Modules/cellUserInfo.cpp +++ b/ps3fw/cellUserInfo.cpp @@ -1,17 +1,17 @@ -#include "stdafx.h" -#include "Emu/System.h" -#include "Emu/system_utils.hpp" -#include "Emu/VFS.h" -#include "Emu/IdManager.h" #include "Emu/Cell/PPUModule.h" +#include "Emu/IdManager.h" +#include "Emu/System.h" +#include "Emu/VFS.h" +#include "Emu/system_utils.hpp" +#include "stdafx.h" #include "Emu/RSX/Overlays/overlay_manager.h" #include "Emu/RSX/Overlays/overlay_user_list_dialog.h" #include "cellUserInfo.h" -#include "Utilities/StrUtil.h" #include "cellSysutil.h" +#include "util/StrUtil.h" LOG_CHANNEL(cellUserInfo); @@ -25,7 +25,8 @@ std::string get_username(const u32 user_id) { std::string username; - if (const fs::file file{rpcs3::utils::get_hdd0_dir() + fmt::format("home/%08d/localusername", user_id)}) + if (const fs::file file{rpcs3::utils::get_hdd0_dir() + + fmt::format("home/%08d/localusername", user_id)}) { username = file.to_string(); username.resize(CELL_USERINFO_USERNAME_SIZE); // TODO: investigate @@ -52,7 +53,8 @@ void fmt_class_string::format(std::string& out, u64 arg) } template <> -void fmt_class_string::format(std::string& out, u64 arg) +void fmt_class_string::format(std::string& out, + u64 arg) { format_enum(out, arg, [](auto error) { @@ -86,7 +88,9 @@ error_code cellUserInfoGetStat(u32 id, vm::ptr stat) if (!fs::is_dir(path)) { - cellUserInfo.error("cellUserInfoGetStat(): CELL_USERINFO_ERROR_NOUSER. User %d doesn't exist. Did you delete the user folder?", id); + cellUserInfo.error("cellUserInfoGetStat(): CELL_USERINFO_ERROR_NOUSER. " + "User %d doesn't exist. Did you delete the user folder?", + id); return CELL_USERINFO_ERROR_NOUSER; } @@ -94,7 +98,10 @@ error_code cellUserInfoGetStat(u32 id, vm::ptr stat) if (!f) { - cellUserInfo.error("cellUserInfoGetStat(): CELL_USERINFO_ERROR_INTERNAL. Username for user %08u doesn't exist. Did you delete the username file?", id); + cellUserInfo.error( + "cellUserInfoGetStat(): CELL_USERINFO_ERROR_INTERNAL. Username for " + "user %08u doesn't exist. Did you delete the username file?", + id); return CELL_USERINFO_ERROR_INTERNAL; } @@ -107,9 +114,14 @@ error_code cellUserInfoGetStat(u32 id, vm::ptr stat) return CELL_OK; } -error_code cellUserInfoSelectUser_ListType(vm::ptr listType, vm::ptr funcSelect, u32 container, vm::ptr userdata) +error_code +cellUserInfoSelectUser_ListType(vm::ptr listType, + vm::ptr funcSelect, + u32 container, vm::ptr userdata) { - cellUserInfo.warning("cellUserInfoSelectUser_ListType(listType=*0x%x, funcSelect=*0x%x, container=0x%x, userdata=*0x%x)", listType, funcSelect, container, userdata); + cellUserInfo.warning("cellUserInfoSelectUser_ListType(listType=*0x%x, " + "funcSelect=*0x%x, container=0x%x, userdata=*0x%x)", + listType, funcSelect, container, userdata); if (!listType || !funcSelect) // TODO: confirm { @@ -146,7 +158,8 @@ error_code cellUserInfoSelectUser_ListType(vm::ptr listType } // TODO: maybe also restrict this to CELL_USERINFO_USER_MAX - if (listType->type != CELL_USERINFO_LISTTYPE_NOCURRENT || user_id != Emu.GetUsrId()) + if (listType->type != CELL_USERINFO_LISTTYPE_NOCURRENT || + user_id != Emu.GetUsrId()) { user_ids.push_back(user_id); } @@ -159,7 +172,8 @@ error_code cellUserInfoSelectUser_ListType(vm::ptr listType return CELL_USERINFO_ERROR_BUSY; } - if (s32 ret = sysutil_send_system_cmd(CELL_SYSUTIL_DRAWING_BEGIN, 0); ret < 0) + if (s32 ret = sysutil_send_system_cmd(CELL_SYSUTIL_DRAWING_BEGIN, 0); + ret < 0) { g_fxo->get().dialog_opened = false; return CELL_USERINFO_ERROR_BUSY; @@ -168,45 +182,55 @@ error_code cellUserInfoSelectUser_ListType(vm::ptr listType const std::string title = listType->title.get_ptr(); const u32 focused = listType->focus; - cellUserInfo.warning("cellUserInfoSelectUser_ListType: opening user_list_dialog with: title='%s', focused=%d", title, focused); + cellUserInfo.warning("cellUserInfoSelectUser_ListType: opening " + "user_list_dialog with: title='%s', focused=%d", + title, focused); const bool enable_overlay = g_fxo->get().enable_overlay; - const error_code result = manager->create()->show(title, focused, user_ids, enable_overlay, [funcSelect, userdata](s32 status) - { - s32 callback_result = CELL_USERINFO_RET_CANCEL; - u32 selected_user_id = 0; - std::string selected_username; - - if (status >= 0) + const error_code result = + manager->create()->show( + title, focused, user_ids, enable_overlay, + [funcSelect, userdata](s32 status) { - callback_result = CELL_USERINFO_RET_OK; - selected_user_id = static_cast(status); - selected_username = get_username(selected_user_id); - } + s32 callback_result = CELL_USERINFO_RET_CANCEL; + u32 selected_user_id = 0; + std::string selected_username; - cellUserInfo.warning("cellUserInfoSelectUser_ListType: callback_result=%s, selected_user_id=%d, selected_username='%s'", callback_result, selected_user_id, selected_username); - - g_fxo->get().dialog_opened = false; - - sysutil_send_system_cmd(CELL_SYSUTIL_DRAWING_END, 0); - - sysutil_register_cb([=](ppu_thread& ppu) -> s32 + if (status >= 0) { - vm::var selectUser; - if (status >= 0) + callback_result = CELL_USERINFO_RET_OK; + selected_user_id = static_cast(status); + selected_username = get_username(selected_user_id); + } + + cellUserInfo.warning( + "cellUserInfoSelectUser_ListType: callback_result=%s, " + "selected_user_id=%d, selected_username='%s'", + callback_result, selected_user_id, selected_username); + + g_fxo->get().dialog_opened = false; + + sysutil_send_system_cmd(CELL_SYSUTIL_DRAWING_END, 0); + + sysutil_register_cb([=](ppu_thread& ppu) -> s32 { - selectUser->id = selected_user_id; - strcpy_trunc(selectUser->name, selected_username); - } - funcSelect(ppu, callback_result, selectUser, userdata); - return CELL_OK; - }); - }); + vm::var selectUser; + if (status >= 0) + { + selectUser->id = selected_user_id; + strcpy_trunc(selectUser->name, selected_username); + } + funcSelect(ppu, callback_result, selectUser, userdata); + return CELL_OK; + }); + }); return result; } - cellUserInfo.error("User selection is only possible when the native user interface is enabled in the settings. The currently active user will be selected as a fallback."); + cellUserInfo.error("User selection is only possible when the native user " + "interface is enabled in the settings. The currently " + "active user will be selected as a fallback."); sysutil_register_cb([=](ppu_thread& ppu) -> s32 { @@ -220,9 +244,14 @@ error_code cellUserInfoSelectUser_ListType(vm::ptr listType return CELL_OK; } -error_code cellUserInfoSelectUser_SetList(vm::ptr setList, vm::ptr funcSelect, u32 container, vm::ptr userdata) +error_code +cellUserInfoSelectUser_SetList(vm::ptr setList, + vm::ptr funcSelect, + u32 container, vm::ptr userdata) { - cellUserInfo.warning("cellUserInfoSelectUser_SetList(setList=*0x%x, funcSelect=*0x%x, container=0x%x, userdata=*0x%x)", setList, funcSelect, container, userdata); + cellUserInfo.warning("cellUserInfoSelectUser_SetList(setList=*0x%x, " + "funcSelect=*0x%x, container=0x%x, userdata=*0x%x)", + setList, funcSelect, container, userdata); if (!setList || !funcSelect) // TODO: confirm { @@ -236,7 +265,8 @@ error_code cellUserInfoSelectUser_SetList(vm::ptr setList, std::vector user_ids; - for (usz i = 0; i < CELL_USERINFO_USER_MAX && i < setList->fixedListNum; i++) + for (usz i = 0; i < CELL_USERINFO_USER_MAX && i < setList->fixedListNum; + i++) { if (const u32 id = setList->fixedList->userId[i]) { @@ -246,8 +276,10 @@ error_code cellUserInfoSelectUser_SetList(vm::ptr setList, if (user_ids.empty()) { - // TODO: Confirm. Also check if this is possible in cellUserInfoSelectUser_ListType. - cellUserInfo.error("cellUserInfoSelectUser_SetList: callback_result=%s", CELL_USERINFO_ERROR_NOUSER); + // TODO: Confirm. Also check if this is possible in + // cellUserInfoSelectUser_ListType. + cellUserInfo.error("cellUserInfoSelectUser_SetList: callback_result=%s", + CELL_USERINFO_ERROR_NOUSER); sysutil_register_cb([=](ppu_thread& ppu) -> s32 { @@ -259,7 +291,8 @@ error_code cellUserInfoSelectUser_SetList(vm::ptr setList, return CELL_OK; } - // TODO: does this function return an error if any (user_id > 0 && not_found) ? + // TODO: does this function return an error if any (user_id > 0 && not_found) + // ? if (auto manager = g_fxo->try_get()) { @@ -268,7 +301,8 @@ error_code cellUserInfoSelectUser_SetList(vm::ptr setList, return CELL_USERINFO_ERROR_BUSY; } - if (s32 ret = sysutil_send_system_cmd(CELL_SYSUTIL_DRAWING_BEGIN, 0); ret < 0) + if (s32 ret = sysutil_send_system_cmd(CELL_SYSUTIL_DRAWING_BEGIN, 0); + ret < 0) { g_fxo->get().dialog_opened = false; return CELL_USERINFO_ERROR_BUSY; @@ -277,45 +311,55 @@ error_code cellUserInfoSelectUser_SetList(vm::ptr setList, const std::string title = setList->title.get_ptr(); const u32 focused = setList->focus; - cellUserInfo.warning("cellUserInfoSelectUser_SetList: opening user_list_dialog with: title='%s', focused=%d", title, focused); + cellUserInfo.warning("cellUserInfoSelectUser_SetList: opening " + "user_list_dialog with: title='%s', focused=%d", + title, focused); const bool enable_overlay = g_fxo->get().enable_overlay; - const error_code result = manager->create()->show(title, focused, user_ids, enable_overlay, [funcSelect, userdata](s32 status) - { - s32 callback_result = CELL_USERINFO_RET_CANCEL; - u32 selected_user_id = 0; - std::string selected_username; - - if (status >= 0) + const error_code result = + manager->create()->show( + title, focused, user_ids, enable_overlay, + [funcSelect, userdata](s32 status) { - callback_result = CELL_USERINFO_RET_OK; - selected_user_id = static_cast(status); - selected_username = get_username(selected_user_id); - } + s32 callback_result = CELL_USERINFO_RET_CANCEL; + u32 selected_user_id = 0; + std::string selected_username; - cellUserInfo.warning("cellUserInfoSelectUser_SetList: callback_result=%s, selected_user_id=%d, selected_username='%s'", callback_result, selected_user_id, selected_username); - - g_fxo->get().dialog_opened = false; - - sysutil_send_system_cmd(CELL_SYSUTIL_DRAWING_END, 0); - - sysutil_register_cb([=](ppu_thread& ppu) -> s32 + if (status >= 0) { - vm::var selectUser; - if (status >= 0) + callback_result = CELL_USERINFO_RET_OK; + selected_user_id = static_cast(status); + selected_username = get_username(selected_user_id); + } + + cellUserInfo.warning( + "cellUserInfoSelectUser_SetList: callback_result=%s, " + "selected_user_id=%d, selected_username='%s'", + callback_result, selected_user_id, selected_username); + + g_fxo->get().dialog_opened = false; + + sysutil_send_system_cmd(CELL_SYSUTIL_DRAWING_END, 0); + + sysutil_register_cb([=](ppu_thread& ppu) -> s32 { - selectUser->id = selected_user_id; - strcpy_trunc(selectUser->name, selected_username); - } - funcSelect(ppu, callback_result, selectUser, userdata); - return CELL_OK; - }); - }); + vm::var selectUser; + if (status >= 0) + { + selectUser->id = selected_user_id; + strcpy_trunc(selectUser->name, selected_username); + } + funcSelect(ppu, callback_result, selectUser, userdata); + return CELL_OK; + }); + }); return result; } - cellUserInfo.error("User selection is only possible when the native user interface is enabled in the settings. The currently active user will be selected as a fallback."); + cellUserInfo.error("User selection is only possible when the native user " + "interface is enabled in the settings. The currently " + "active user will be selected as a fallback."); sysutil_register_cb([=](ppu_thread& ppu) -> s32 { @@ -336,9 +380,13 @@ void cellUserInfoEnableOverlay(s32 enable) manager.enable_overlay = enable != 0; } -error_code cellUserInfoGetList(vm::ptr listNum, vm::ptr listBuf, vm::ptr currentUserId) +error_code cellUserInfoGetList(vm::ptr listNum, + vm::ptr listBuf, + vm::ptr currentUserId) { - cellUserInfo.warning("cellUserInfoGetList(listNum=*0x%x, listBuf=*0x%x, currentUserId=*0x%x)", listNum, listBuf, currentUserId); + cellUserInfo.warning( + "cellUserInfoGetList(listNum=*0x%x, listBuf=*0x%x, currentUserId=*0x%x)", + listNum, listBuf, currentUserId); // If only listNum is NULL, an error will be returned if (!listNum) @@ -379,7 +427,9 @@ error_code cellUserInfoGetList(vm::ptr listNum, vm::ptr #include #include -#include -#include "Utilities/lockless.h" #include -#include "util/asm.hpp" std::mutex g_mutex_avcodec_open2; @@ -74,11 +74,14 @@ void fmt_class_string::format(std::string& out, u64 arg) // resetting -> ready enum class sequence_state : u32 { - closed = 0, // Also called non-existent. Needs to be opened before anything can be done with it. - dormant = 1, // Waiting for the next sequence. The last picture and pic-item can be aqcuired in this state. + closed = 0, // Also called non-existent. Needs to be opened before anything + // can be done with it. + dormant = 1, // Waiting for the next sequence. The last picture and pic-item + // can be aqcuired in this state. ready = 2, // Ready for decoding. Can also restart sequences in this state. ending = 3, // Ending a sequence. Goes to dormant afterwards. - resetting = 4, // Stops the current sequence and starts a new one. The pictures of the old sequence are flushed + resetting = 4, // Stops the current sequence and starts a new one. The + // pictures of the old sequence are flushed invalid = 5, // Any other value is invalid }; @@ -101,7 +104,9 @@ void fmt_class_string::format(std::string& out, u64 arg) }); } -vm::gvar _cell_vdec_prx_ver; // TODO: this should probably specify the VDEC module that was loaded. E.g. CELL_SYSMODULE_VDEC_MPEG2 +vm::gvar + _cell_vdec_prx_ver; // TODO: this should probably specify the VDEC module + // that was loaded. E.g. CELL_SYSMODULE_VDEC_MPEG2 enum class vdec_cmd_type : u32 { @@ -121,7 +126,8 @@ struct vdec_cmd ensure(_type != vdec_cmd_type::framerate); } - explicit vdec_cmd(vdec_cmd_type _type, u64 _seq_id, u64 _id, s32 _mode, CellVdecAuInfo _au) + explicit vdec_cmd(vdec_cmd_type _type, u64 _seq_id, u64 _id, s32 _mode, + CellVdecAuInfo _au) : type(_type), seq_id(_seq_id), id(_id), mode(_mode), au(std::move(_au)) { ensure(_type == vdec_cmd_type::au_decode); @@ -212,7 +218,8 @@ struct vdec_context final AVRational log_time_base{}; // Used to reduce log spam - vdec_context(s32 type, u32 /*profile*/, u32 addr, u32 size, vm::ptr func, u32 arg) + vdec_context(s32 type, u32 /*profile*/, u32 addr, u32 size, + vm::ptr func, u32 arg) : type(type), mem_addr(addr), mem_size(size), cb_func(func), cb_arg(arg) { switch (type) @@ -274,7 +281,8 @@ struct vdec_context final fmt::append(dict_content, "['%s': '%s']", tag->key, tag->value); } } - fmt::throw_exception("avcodec_open2() failed (err=0x%x='%s', opts=%s)", err, utils::av_error_to_string(err), dict_content); + fmt::throw_exception("avcodec_open2() failed (err=0x%x='%s', opts=%s)", + err, utils::av_error_to_string(err), dict_content); } av_dict_free(&opts); @@ -294,7 +302,8 @@ struct vdec_context final ppu_tid.release(ppu.id); - for (auto slice = in_cmd.pop_all(); thread_ctrl::state() != thread_state::aborting; [&] + for (auto slice = in_cmd.pop_all(); + thread_ctrl::state() != thread_state::aborting; [&] { if (slice) { @@ -326,11 +335,15 @@ struct vdec_context final if (seq_state == sequence_state::resetting) { - cellVdec.trace("Reset sequence... (handle=0x%x, seq_id=%d, cmd_id=%d)", handle, cmd->seq_id, cmd->id); + cellVdec.trace( + "Reset sequence... (handle=0x%x, seq_id=%d, cmd_id=%d)", handle, + cmd->seq_id, cmd->id); } else { - cellVdec.trace("Start sequence... (handle=0x%x, seq_id=%d, cmd_id=%d)", handle, cmd->seq_id, cmd->id); + cellVdec.trace( + "Start sequence... (handle=0x%x, seq_id=%d, cmd_id=%d)", handle, + cmd->seq_id, cmd->id); } avcodec_flush_buffers(ctx); @@ -348,14 +361,17 @@ struct vdec_context final } case vdec_cmd_type::end_sequence: { - cellVdec.trace("End sequence... (handle=0x%x, seq_id=%d, cmd_id=%d)", handle, cmd->seq_id, cmd->id); + cellVdec.trace("End sequence... (handle=0x%x, seq_id=%d, cmd_id=%d)", + handle, cmd->seq_id, cmd->id); { std::lock_guard lock{mutex}; seq_state = sequence_state::dormant; } - cellVdec.trace("Sending CELL_VDEC_MSG_TYPE_SEQDONE (handle=0x%x, seq_id=%d, cmd_id=%d)", handle, cmd->seq_id, cmd->id); + cellVdec.trace("Sending CELL_VDEC_MSG_TYPE_SEQDONE (handle=0x%x, " + "seq_id=%d, cmd_id=%d)", + handle, cmd->seq_id, cmd->id); cb_func(ppu, vid, CELL_VDEC_MSG_TYPE_SEQDONE, CELL_OK, cb_arg); lv2_obj::sleep(ppu); break; @@ -392,19 +408,24 @@ struct vdec_context final const CellVdecPicAttr attr = au_mode == CELL_VDEC_DEC_MODE_NORMAL ? CELL_VDEC_PICITEM_ATTR_NORMAL : CELL_VDEC_PICITEM_ATTR_SKIPPED; ctx->skip_frame = - au_mode == CELL_VDEC_DEC_MODE_NORMAL ? AVDISCARD_DEFAULT : - au_mode == CELL_VDEC_DEC_MODE_B_SKIP ? AVDISCARD_NONREF : - AVDISCARD_NONINTRA; + au_mode == CELL_VDEC_DEC_MODE_NORMAL ? AVDISCARD_DEFAULT : au_mode == CELL_VDEC_DEC_MODE_B_SKIP ? AVDISCARD_NONREF : + AVDISCARD_NONINTRA; std::deque decoded_frames; if (!abort_decode && seq_id == cmd->seq_id) { - cellVdec.trace("AU decoding: handle=0x%x, seq_id=%d, cmd_id=%d, size=0x%x, pts=0x%llx, dts=0x%llx, userdata=0x%llx", handle, cmd->seq_id, cmd->id, au_size, au_pts, au_dts, au_usrd); + cellVdec.trace("AU decoding: handle=0x%x, seq_id=%d, cmd_id=%d, " + "size=0x%x, pts=0x%llx, dts=0x%llx, userdata=0x%llx", + handle, cmd->seq_id, cmd->id, au_size, au_pts, au_dts, + au_usrd); if (int ret = avcodec_send_packet(ctx, &packet); ret < 0) { - fmt::throw_exception("AU queuing error (handle=0x%x, seq_id=%d, cmd_id=%d, error=0x%x): %s", handle, cmd->seq_id, cmd->id, ret, utils::av_error_to_string(ret)); + fmt::throw_exception("AU queuing error (handle=0x%x, seq_id=%d, " + "cmd_id=%d, error=0x%x): %s", + handle, cmd->seq_id, cmd->id, ret, + utils::av_error_to_string(ret)); } while (!abort_decode && seq_id == cmd->seq_id) @@ -417,40 +438,53 @@ struct vdec_context final if (!frame.avf) { - fmt::throw_exception("av_frame_alloc() failed (handle=0x%x, seq_id=%d, cmd_id=%d)", handle, cmd->seq_id, cmd->id); + fmt::throw_exception( + "av_frame_alloc() failed (handle=0x%x, seq_id=%d, cmd_id=%d)", + handle, cmd->seq_id, cmd->id); } - if (int ret = avcodec_receive_frame(ctx, frame.avf.get()); ret < 0) + if (int ret = avcodec_receive_frame(ctx, frame.avf.get()); + ret < 0) { if (ret == AVERROR(EAGAIN) || ret == AVERROR(EOF)) { break; } - fmt::throw_exception("AU decoding error (handle=0x%x, seq_id=%d, cmd_id=%d, error=0x%x): %s", handle, cmd->seq_id, cmd->id, ret, utils::av_error_to_string(ret)); + fmt::throw_exception("AU decoding error (handle=0x%x, seq_id=%d, " + "cmd_id=%d, error=0x%x): %s", + handle, cmd->seq_id, cmd->id, ret, + utils::av_error_to_string(ret)); } #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(60, 31, 102) const int ticks_per_frame = ctx->ticks_per_frame; #else - const int ticks_per_frame = (codec_desc->props & AV_CODEC_PROP_FIELDS) ? 2 : 1; + const int ticks_per_frame = + (codec_desc->props & AV_CODEC_PROP_FIELDS) ? 2 : 1; #endif #if LIBAVUTIL_VERSION_INT < AV_VERSION_INT(58, 29, 100) const bool is_interlaced = frame->interlaced_frame != 0; #else - const bool is_interlaced = !!(frame->flags & AV_FRAME_FLAG_INTERLACED); + const bool is_interlaced = + !!(frame->flags & AV_FRAME_FLAG_INTERLACED); #endif if (is_interlaced) { // NPEB01838, NPUB31260 - cellVdec.todo("Interlaced frames not supported (handle=0x%x, seq_id=%d, cmd_id=%d)", handle, cmd->seq_id, cmd->id); + cellVdec.todo("Interlaced frames not supported (handle=0x%x, " + "seq_id=%d, cmd_id=%d)", + handle, cmd->seq_id, cmd->id); } if (frame->repeat_pict) { - fmt::throw_exception("Repeated frames not supported (handle=0x%x, seq_id=%d, cmd_id=%d, repear_pict=0x%x)", handle, cmd->seq_id, cmd->id, frame->repeat_pict); + fmt::throw_exception( + "Repeated frames not supported (handle=0x%x, seq_id=%d, " + "cmd_id=%d, repear_pict=0x%x)", + handle, cmd->seq_id, cmd->id, frame->repeat_pict); } if (frame->pts != smin) @@ -474,17 +508,36 @@ struct vdec_context final switch (frc_set) { - case CELL_VDEC_FRC_24000DIV1001: amend = 1001 * 90000 / 24000; break; - case CELL_VDEC_FRC_24: amend = 90000 / 24; break; - case CELL_VDEC_FRC_25: amend = 90000 / 25; break; - case CELL_VDEC_FRC_30000DIV1001: amend = 1001 * 90000 / 30000; break; - case CELL_VDEC_FRC_30: amend = 90000 / 30; break; - case CELL_VDEC_FRC_50: amend = 90000 / 50; break; - case CELL_VDEC_FRC_60000DIV1001: amend = 1001 * 90000 / 60000; break; - case CELL_VDEC_FRC_60: amend = 90000 / 60; break; + case CELL_VDEC_FRC_24000DIV1001: + amend = 1001 * 90000 / 24000; + break; + case CELL_VDEC_FRC_24: + amend = 90000 / 24; + break; + case CELL_VDEC_FRC_25: + amend = 90000 / 25; + break; + case CELL_VDEC_FRC_30000DIV1001: + amend = 1001 * 90000 / 30000; + break; + case CELL_VDEC_FRC_30: + amend = 90000 / 30; + break; + case CELL_VDEC_FRC_50: + amend = 90000 / 50; + break; + case CELL_VDEC_FRC_60000DIV1001: + amend = 1001 * 90000 / 60000; + break; + case CELL_VDEC_FRC_60: + amend = 90000 / 60; + break; default: { - fmt::throw_exception("Invalid frame rate code set (handle=0x%x, seq_id=%d, cmd_id=%d, frc=0x%x)", handle, cmd->seq_id, cmd->id, frc_set); + fmt::throw_exception( + "Invalid frame rate code set (handle=0x%x, seq_id=%d, " + "cmd_id=%d, frc=0x%x)", + handle, cmd->seq_id, cmd->id, frc_set); } } @@ -494,9 +547,14 @@ struct vdec_context final } else if (ctx->time_base.num == 0) { - if (log_time_base.den != ctx->time_base.den || log_time_base.num != ctx->time_base.num) + if (log_time_base.den != ctx->time_base.den || + log_time_base.num != ctx->time_base.num) { - cellVdec.error("time_base.num is 0 (handle=0x%x, seq_id=%d, cmd_id=%d, %d/%d, tpf=%d framerate=%d/%d)", handle, cmd->seq_id, cmd->id, ctx->time_base.num, ctx->time_base.den, ticks_per_frame, ctx->framerate.num, ctx->framerate.den); + cellVdec.error("time_base.num is 0 (handle=0x%x, seq_id=%d, " + "cmd_id=%d, %d/%d, tpf=%d framerate=%d/%d)", + handle, cmd->seq_id, cmd->id, ctx->time_base.num, + ctx->time_base.den, ticks_per_frame, + ctx->framerate.num, ctx->framerate.den); log_time_base = ctx->time_base; } @@ -508,8 +566,10 @@ struct vdec_context final } else { - u64 amend = u64{90000} * ctx->time_base.num * ticks_per_frame / ctx->time_base.den; - const auto freq = 1. * ctx->time_base.den / ctx->time_base.num / ticks_per_frame; + u64 amend = u64{90000} * ctx->time_base.num * ticks_per_frame / + ctx->time_base.den; + const auto freq = 1. * ctx->time_base.den / ctx->time_base.num / + ticks_per_frame; if (std::abs(freq - 23.976) < 0.002) frame.frc = CELL_VDEC_FRC_24000DIV1001; @@ -529,10 +589,17 @@ struct vdec_context final frame.frc = CELL_VDEC_FRC_60; else { - if (log_time_base.den != ctx->time_base.den || log_time_base.num != ctx->time_base.num) + if (log_time_base.den != ctx->time_base.den || + log_time_base.num != ctx->time_base.num) { - // 1/1000 usually means that the time stamps are written in 1ms units and that the frame rate may vary. - cellVdec.error("Unsupported time_base (handle=0x%x, seq_id=%d, cmd_id=%d, %d/%d, tpf=%d framerate=%d/%d)", handle, cmd->seq_id, cmd->id, ctx->time_base.num, ctx->time_base.den, ticks_per_frame, ctx->framerate.num, ctx->framerate.den); + // 1/1000 usually means that the time stamps are written in + // 1ms units and that the frame rate may vary. + cellVdec.error( + "Unsupported time_base (handle=0x%x, seq_id=%d, " + "cmd_id=%d, %d/%d, tpf=%d framerate=%d/%d)", + handle, cmd->seq_id, cmd->id, ctx->time_base.num, + ctx->time_base.den, ticks_per_frame, ctx->framerate.num, + ctx->framerate.den); log_time_base = ctx->time_base; } @@ -545,7 +612,10 @@ struct vdec_context final next_dts += amend; } - cellVdec.trace("Got picture (handle=0x%x, seq_id=%d, cmd_id=%d, pts=0x%llx[0x%llx], dts=0x%llx[0x%llx])", handle, cmd->seq_id, cmd->id, frame.pts, frame->pts, frame.dts, frame->pkt_dts); + cellVdec.trace("Got picture (handle=0x%x, seq_id=%d, cmd_id=%d, " + "pts=0x%llx[0x%llx], dts=0x%llx[0x%llx])", + handle, cmd->seq_id, cmd->id, frame.pts, frame->pts, + frame.dts, frame->pkt_dts); decoded_frames.push_back(std::move(frame)); } @@ -553,8 +623,11 @@ struct vdec_context final if (thread_ctrl::state() != thread_state::aborting) { - // Send AUDONE even if the current sequence was reset and a new sequence was started. - cellVdec.trace("Sending CELL_VDEC_MSG_TYPE_AUDONE (handle=0x%x, seq_id=%d, cmd_id=%d)", handle, cmd->seq_id, cmd->id); + // Send AUDONE even if the current sequence was reset and a new + // sequence was started. + cellVdec.trace("Sending CELL_VDEC_MSG_TYPE_AUDONE (handle=0x%x, " + "seq_id=%d, cmd_id=%d)", + handle, cmd->seq_id, cmd->id); ensure(au_count.try_dec(0)); cb_func(ppu, vid, CELL_VDEC_MSG_TYPE_AUDONE, CELL_OK, cb_arg); @@ -563,9 +636,11 @@ struct vdec_context final while (!decoded_frames.empty() && seq_id == cmd->seq_id) { // Wait until there is free space in the image queue. - // Do this after pushing the frame to the queue. That way the game can consume the frame and we can move on. + // Do this after pushing the frame to the queue. That way the game + // can consume the frame and we can move on. u32 elapsed = 0; - while (thread_ctrl::state() != thread_state::aborting && !abort_decode && seq_id == cmd->seq_id) + while (thread_ctrl::state() != thread_state::aborting && + !abort_decode && seq_id == cmd->seq_id) { { std::lock_guard lock{mutex}; @@ -580,12 +655,16 @@ struct vdec_context final if (elapsed++ >= 500) // 5 seconds { - cellVdec.error("Video au decode has been waiting for a consumer for 5 seconds. (handle=0x%x, seq_id=%d, cmd_id=%d, queue_size=%d)", handle, cmd->seq_id, cmd->id, out_queue.size()); + cellVdec.error("Video au decode has been waiting for a " + "consumer for 5 seconds. (handle=0x%x, " + "seq_id=%d, cmd_id=%d, queue_size=%d)", + handle, cmd->seq_id, cmd->id, out_queue.size()); elapsed = 0; } } - if (thread_ctrl::state() == thread_state::aborting || abort_decode || seq_id != cmd->seq_id) + if (thread_ctrl::state() == thread_state::aborting || + abort_decode || seq_id != cmd->seq_id) { break; } @@ -596,7 +675,9 @@ struct vdec_context final decoded_frames.pop_front(); } - cellVdec.trace("Sending CELL_VDEC_MSG_TYPE_PICOUT (handle=0x%x, seq_id=%d, cmd_id=%d)", handle, cmd->seq_id, cmd->id); + cellVdec.trace("Sending CELL_VDEC_MSG_TYPE_PICOUT (handle=0x%x, " + "seq_id=%d, cmd_id=%d)", + handle, cmd->seq_id, cmd->id); cb_func(ppu, vid, CELL_VDEC_MSG_TYPE_PICOUT, CELL_OK, cb_arg); lv2_obj::sleep(ppu); } @@ -604,11 +685,15 @@ struct vdec_context final if (abort_decode || seq_id != cmd->seq_id) { - cellVdec.warning("AU decoding: aborted (handle=0x%x, seq_id=%d, cmd_id=%d, abort_decode=%d)", handle, cmd->seq_id, cmd->id, abort_decode.load()); + cellVdec.warning("AU decoding: aborted (handle=0x%x, seq_id=%d, " + "cmd_id=%d, abort_decode=%d)", + handle, cmd->seq_id, cmd->id, abort_decode.load()); } else { - cellVdec.trace("AU decoding: done (handle=0x%x, seq_id=%d, cmd_id=%d)", handle, cmd->seq_id, cmd->id); + cellVdec.trace( + "AU decoding: done (handle=0x%x, seq_id=%d, cmd_id=%d)", handle, + cmd->seq_id, cmd->id); } break; @@ -625,7 +710,10 @@ struct vdec_context final break; } default: - fmt::throw_exception("Unknown vdec_cmd_type (handle=0x%x, seq_id=%d, cmd_id=%d, type=%d)", handle, cmd->seq_id, cmd->id, static_cast(cmd->type)); + fmt::throw_exception("Unknown vdec_cmd_type (handle=0x%x, seq_id=%d, " + "cmd_id=%d, type=%d)", + handle, cmd->seq_id, cmd->id, + static_cast(cmd->type)); break; } @@ -646,7 +734,8 @@ extern bool check_if_vdec_contexts_exist() { bool context_exists = false; - idm::select([&](u32, vdec_context&) + idm::select( + [&](u32, vdec_context&) { context_exists = true; }); @@ -661,7 +750,9 @@ extern void vdecEntry(ppu_thread& ppu, u32 vid) ppu.state += cpu_flag::exit; } -static error_code vdecQueryAttr(s32 type, u32 profile, u32 spec_addr /* may be 0 */, CellVdecAttr* attr) +static error_code vdecQueryAttr(s32 type, u32 profile, + u32 spec_addr /* may be 0 */, + CellVdecAttr* attr) { // Write 0 at start attr->memSize = 0; @@ -683,20 +774,47 @@ static error_code vdecQueryAttr(s32 type, u32 profile, u32 spec_addr /* may be 0 switch (profile) { - case CELL_VDEC_AVC_LEVEL_1P0: memSize = new_sdk ? 0x70167D : 0xA014FD; break; - case CELL_VDEC_AVC_LEVEL_1P1: memSize = new_sdk ? 0x86CB7D : 0xB6C9FD; break; - case CELL_VDEC_AVC_LEVEL_1P2: memSize = new_sdk ? 0x9E307D : 0xCE2D7D; break; - case CELL_VDEC_AVC_LEVEL_1P3: memSize = new_sdk ? 0xA057FD : 0xD054FD; break; - case CELL_VDEC_AVC_LEVEL_2P0: memSize = new_sdk ? 0xA057FD : 0xD054FD; break; - case CELL_VDEC_AVC_LEVEL_2P1: memSize = new_sdk ? 0xE90DFD : 0x1190AFD; break; - case CELL_VDEC_AVC_LEVEL_2P2: memSize = new_sdk ? 0x14E49FD : 0x17E46FD; break; - case CELL_VDEC_AVC_LEVEL_3P0: memSize = new_sdk ? 0x155B5FD : 0x185B17D; break; - case CELL_VDEC_AVC_LEVEL_3P1: memSize = new_sdk ? 0x1CD327D : 0x1FD2AFD; break; - case CELL_VDEC_AVC_LEVEL_3P2: memSize = new_sdk ? 0x2397B7D : 0x2696F7D; break; - case CELL_VDEC_AVC_LEVEL_4P0: memSize = new_sdk ? 0x33A5FFD : 0x36A527D; break; - case CELL_VDEC_AVC_LEVEL_4P1: memSize = new_sdk ? 0x33A5FFD : 0x36A527D; break; - case CELL_VDEC_AVC_LEVEL_4P2: memSize = new_sdk ? 0x33A5FFD : 0x36A527D; break; - default: return CELL_VDEC_ERROR_ARG; + case CELL_VDEC_AVC_LEVEL_1P0: + memSize = new_sdk ? 0x70167D : 0xA014FD; + break; + case CELL_VDEC_AVC_LEVEL_1P1: + memSize = new_sdk ? 0x86CB7D : 0xB6C9FD; + break; + case CELL_VDEC_AVC_LEVEL_1P2: + memSize = new_sdk ? 0x9E307D : 0xCE2D7D; + break; + case CELL_VDEC_AVC_LEVEL_1P3: + memSize = new_sdk ? 0xA057FD : 0xD054FD; + break; + case CELL_VDEC_AVC_LEVEL_2P0: + memSize = new_sdk ? 0xA057FD : 0xD054FD; + break; + case CELL_VDEC_AVC_LEVEL_2P1: + memSize = new_sdk ? 0xE90DFD : 0x1190AFD; + break; + case CELL_VDEC_AVC_LEVEL_2P2: + memSize = new_sdk ? 0x14E49FD : 0x17E46FD; + break; + case CELL_VDEC_AVC_LEVEL_3P0: + memSize = new_sdk ? 0x155B5FD : 0x185B17D; + break; + case CELL_VDEC_AVC_LEVEL_3P1: + memSize = new_sdk ? 0x1CD327D : 0x1FD2AFD; + break; + case CELL_VDEC_AVC_LEVEL_3P2: + memSize = new_sdk ? 0x2397B7D : 0x2696F7D; + break; + case CELL_VDEC_AVC_LEVEL_4P0: + memSize = new_sdk ? 0x33A5FFD : 0x36A527D; + break; + case CELL_VDEC_AVC_LEVEL_4P1: + memSize = new_sdk ? 0x33A5FFD : 0x36A527D; + break; + case CELL_VDEC_AVC_LEVEL_4P2: + memSize = new_sdk ? 0x33A5FFD : 0x36A527D; + break; + default: + return CELL_VDEC_ERROR_ARG; } decoderVerLower = 0x11300; @@ -763,7 +881,8 @@ static error_code vdecQueryAttr(s32 type, u32 profile, u32 spec_addr /* may be 0 memSize = new_sdk ? 0xD2F40B : 0xEB990B; break; } - default: return CELL_VDEC_ERROR_ARG; + default: + return CELL_VDEC_ERROR_ARG; } decoderVerLower = 0x1030000; @@ -795,7 +914,8 @@ static error_code vdecQueryAttr(s32 type, u32 profile, u32 spec_addr /* may be 0 } else if (nrOfBuf == 2) { - if (profile != CELL_VDEC_DIVX_QMOBILE && profile != CELL_VDEC_DIVX_MOBILE) + if (profile != CELL_VDEC_DIVX_QMOBILE && + profile != CELL_VDEC_DIVX_MOBILE) { return CELL_VDEC_ERROR_ARG; } @@ -809,18 +929,30 @@ static error_code vdecQueryAttr(s32 type, u32 profile, u32 spec_addr /* may be 0 switch (profile) { - case CELL_VDEC_DIVX_QMOBILE: memSize = new_sdk ? 0x11B720 : 0x1DEF30; break; - case CELL_VDEC_DIVX_MOBILE: memSize = new_sdk ? 0x19A740 : 0x26DED0; break; - case CELL_VDEC_DIVX_HOME_THEATER: memSize = new_sdk ? 0x386A60 : 0x498060; break; - case CELL_VDEC_DIVX_HD_720: memSize = new_sdk ? 0x692070 : 0x805690; break; - case CELL_VDEC_DIVX_HD_1080: memSize = new_sdk ? 0xD78100 : 0xFC9870; break; - default: return CELL_VDEC_ERROR_ARG; + case CELL_VDEC_DIVX_QMOBILE: + memSize = new_sdk ? 0x11B720 : 0x1DEF30; + break; + case CELL_VDEC_DIVX_MOBILE: + memSize = new_sdk ? 0x19A740 : 0x26DED0; + break; + case CELL_VDEC_DIVX_HOME_THEATER: + memSize = new_sdk ? 0x386A60 : 0x498060; + break; + case CELL_VDEC_DIVX_HD_720: + memSize = new_sdk ? 0x692070 : 0x805690; + break; + case CELL_VDEC_DIVX_HD_1080: + memSize = new_sdk ? 0xD78100 : 0xFC9870; + break; + default: + return CELL_VDEC_ERROR_ARG; } decoderVerLower = 0x30806; break; } - default: return CELL_VDEC_ERROR_ARG; + default: + return CELL_VDEC_ERROR_ARG; } attr->decoderVerLower = decoderVerLower; @@ -830,7 +962,8 @@ static error_code vdecQueryAttr(s32 type, u32 profile, u32 spec_addr /* may be 0 return CELL_OK; } -error_code cellVdecQueryAttr(vm::cptr type, vm::ptr attr) +error_code cellVdecQueryAttr(vm::cptr type, + vm::ptr attr) { cellVdec.warning("cellVdecQueryAttr(type=*0x%x, attr=*0x%x)", type, attr); @@ -842,7 +975,8 @@ error_code cellVdecQueryAttr(vm::cptr type, vm::ptr return vdecQueryAttr(type->codecType, type->profileLevel, 0, attr.get_ptr()); } -error_code cellVdecQueryAttrEx(vm::cptr type, vm::ptr attr) +error_code cellVdecQueryAttrEx(vm::cptr type, + vm::ptr attr) { cellVdec.warning("cellVdecQueryAttrEx(type=*0x%x, attr=*0x%x)", type, attr); @@ -851,32 +985,37 @@ error_code cellVdecQueryAttrEx(vm::cptr type, vm::ptrcodecType, type->profileLevel, type->codecSpecificInfo_addr, attr.get_ptr()); + return vdecQueryAttr(type->codecType, type->profileLevel, + type->codecSpecificInfo_addr, attr.get_ptr()); } template -static error_code vdecOpen(ppu_thread& ppu, T type, U res, vm::cptr cb, vm::ptr handle) +static error_code vdecOpen(ppu_thread& ppu, T type, U res, + vm::cptr cb, vm::ptr handle) { if (!type || !res || !cb || !handle || !cb->cbFunc) { return CELL_VDEC_ERROR_ARG; } - if (!res->memAddr || res->ppuThreadPriority + 0u >= 3072 || res->spuThreadPriority + 0u >= 256 || res->ppuThreadStackSize < 4096 || type->codecType + 0u >= 0xe) + if (!res->memAddr || res->ppuThreadPriority + 0u >= 3072 || + res->spuThreadPriority + 0u >= 256 || res->ppuThreadStackSize < 4096 || + type->codecType + 0u >= 0xe) { return CELL_VDEC_ERROR_ARG; } u32 spec_addr = 0; - if constexpr (std::is_same_v, CellVdecTypeEx>) + if constexpr (std::is_same_v, + CellVdecTypeEx>) { spec_addr = type->codecSpecificInfo_addr; } - if (CellVdecAttr attr{}; - vdecQueryAttr(type->codecType, type->profileLevel, spec_addr, &attr) != CELL_OK || - attr.memSize > res->memSize) + if (CellVdecAttr attr{}; vdecQueryAttr(type->codecType, type->profileLevel, + spec_addr, &attr) != CELL_OK || + attr.memSize > res->memSize) { return CELL_VDEC_ERROR_ARG; } @@ -886,7 +1025,9 @@ static error_code vdecOpen(ppu_thread& ppu, T type, U res, vm::cptr if (std::unique_lock lock{g_fxo->get(), std::try_to_lock}) { - vdec = idm::make_ptr(type->codecType, type->profileLevel, res->memAddr, res->memSize, cb->cbFunc, cb->cbArg); + vdec = idm::make_ptr(type->codecType, type->profileLevel, + res->memAddr, res->memSize, cb->cbFunc, + cb->cbArg); } else { @@ -902,10 +1043,13 @@ static error_code vdecOpen(ppu_thread& ppu, T type, U res, vm::cptr // Run thread vm::var _tid; vm::var _name = vm::make_str("HLE Video Decoder"); - ppu_execute<&sys_ppu_thread_create>(ppu, +_tid, 0x10000, vid, +res->ppuThreadPriority, +res->ppuThreadStackSize, SYS_PPU_THREAD_CREATE_INTERRUPT, +_name); + ppu_execute<&sys_ppu_thread_create>( + ppu, +_tid, 0x10000, vid, +res->ppuThreadPriority, + +res->ppuThreadStackSize, SYS_PPU_THREAD_CREATE_INTERRUPT, +_name); *handle = vid; - const auto thrd = idm::get_unlocked>(static_cast(*_tid)); + const auto thrd = + idm::get_unlocked>(static_cast(*_tid)); thrd->cmd_list({ {ppu_cmd::set_args, 1}, @@ -919,16 +1063,24 @@ static error_code vdecOpen(ppu_thread& ppu, T type, U res, vm::cptr return CELL_OK; } -error_code cellVdecOpen(ppu_thread& ppu, vm::cptr type, vm::cptr res, vm::cptr cb, vm::ptr handle) +error_code cellVdecOpen(ppu_thread& ppu, vm::cptr type, + vm::cptr res, vm::cptr cb, + vm::ptr handle) { - cellVdec.warning("cellVdecOpen(type=*0x%x, res=*0x%x, cb=*0x%x, handle=*0x%x)", type, res, cb, handle); + cellVdec.warning( + "cellVdecOpen(type=*0x%x, res=*0x%x, cb=*0x%x, handle=*0x%x)", type, res, + cb, handle); return vdecOpen(ppu, type, res, cb, handle); } -error_code cellVdecOpenEx(ppu_thread& ppu, vm::cptr type, vm::cptr res, vm::cptr cb, vm::ptr handle) +error_code cellVdecOpenEx(ppu_thread& ppu, vm::cptr type, + vm::cptr res, + vm::cptr cb, vm::ptr handle) { - cellVdec.warning("cellVdecOpenEx(type=*0x%x, res=*0x%x, cb=*0x%x, handle=*0x%x)", type, res, cb, handle); + cellVdec.warning( + "cellVdecOpenEx(type=*0x%x, res=*0x%x, cb=*0x%x, handle=*0x%x)", type, + res, cb, handle); return vdecOpen(ppu, type, res, cb, handle); } @@ -963,7 +1115,8 @@ error_code cellVdecClose(ppu_thread& ppu, u32 handle) const u64 seq_id = vdec->seq_id; const u64 cmd_id = vdec->next_cmd_id++; - cellVdec.trace("Adding close cmd (handle=0x%x, seq_id=%d, cmd_id=%d)", handle, seq_id, cmd_id); + cellVdec.trace("Adding close cmd (handle=0x%x, seq_id=%d, cmd_id=%d)", handle, + seq_id, cmd_id); lv2_obj::sleep(ppu); vdec->abort_decode = true; @@ -1012,7 +1165,8 @@ error_code cellVdecStartSeq(ppu_thread& ppu, u32 handle) std::lock_guard lock{vdec->mutex}; old_state = vdec->seq_state; - if (old_state != sequence_state::dormant && old_state != sequence_state::ready) + if (old_state != sequence_state::dormant && + old_state != sequence_state::ready) { return {CELL_VDEC_ERROR_SEQ, old_state}; } @@ -1025,7 +1179,8 @@ error_code cellVdecStartSeq(ppu_thread& ppu, u32 handle) const u64 seq_id = ++vdec->seq_id; const u64 cmd_id = vdec->next_cmd_id++; - cellVdec.trace("Adding start cmd (handle=0x%x, seq_id=%d, cmd_id=%d)", handle, seq_id, cmd_id); + cellVdec.trace("Adding start cmd (handle=0x%x, seq_id=%d, cmd_id=%d)", handle, + seq_id, cmd_id); vdec->abort_decode = false; vdec->is_running = false; @@ -1071,24 +1226,33 @@ error_code cellVdecEndSeq(ppu_thread& ppu, u32 handle) const u64 seq_id = vdec->seq_id; const u64 cmd_id = vdec->next_cmd_id++; - cellVdec.trace("Adding end cmd (handle=0x%x, seq_id=%d, cmd_id=%d)", handle, seq_id, cmd_id); + cellVdec.trace("Adding end cmd (handle=0x%x, seq_id=%d, cmd_id=%d)", handle, + seq_id, cmd_id); vdec->in_cmd.push(vdec_cmd(vdec_cmd_type::end_sequence, seq_id, cmd_id)); return CELL_OK; } -error_code cellVdecDecodeAu(ppu_thread& ppu, u32 handle, CellVdecDecodeMode mode, vm::cptr auInfo) +error_code cellVdecDecodeAu(ppu_thread& ppu, u32 handle, + CellVdecDecodeMode mode, + vm::cptr auInfo) { ppu.state += cpu_flag::wait; - cellVdec.trace("cellVdecDecodeAu(handle=0x%x, mode=%d, auInfo=*0x%x)", handle, +mode, auInfo); + cellVdec.trace("cellVdecDecodeAu(handle=0x%x, mode=%d, auInfo=*0x%x)", handle, + +mode, auInfo); const auto vdec = idm::get_unlocked(handle); if (!vdec || !auInfo || !auInfo->size || !auInfo->startAddr) { - return {CELL_VDEC_ERROR_ARG, "vdec=%d, auInfo=%d, size=%d, startAddr=0x%x", !!vdec, !!auInfo, auInfo ? auInfo->size.value() : 0, auInfo ? auInfo->startAddr.value() : 0}; + return {CELL_VDEC_ERROR_ARG, + "vdec=%d, auInfo=%d, size=%d, startAddr=0x%x", + !!vdec, + !!auInfo, + auInfo ? auInfo->size.value() : 0, + auInfo ? auInfo->startAddr.value() : 0}; } { @@ -1100,14 +1264,17 @@ error_code cellVdecDecodeAu(ppu_thread& ppu, u32 handle, CellVdecDecodeMode mode } } - if (mode < 0 || mode > (CELL_VDEC_DEC_MODE_B_SKIP | CELL_VDEC_DEC_MODE_PB_SKIP)) + if (mode < 0 || + mode > (CELL_VDEC_DEC_MODE_B_SKIP | CELL_VDEC_DEC_MODE_PB_SKIP)) { return {CELL_VDEC_ERROR_ARG, "mode=%d", +mode}; } // TODO: what does the 3 stand for ? - if ((mode == (CELL_VDEC_DEC_MODE_B_SKIP | CELL_VDEC_DEC_MODE_PB_SKIP) && vdec->type != 3) || - (mode == CELL_VDEC_DEC_MODE_PB_SKIP && vdec->type != CELL_VDEC_CODEC_TYPE_AVC)) + if ((mode == (CELL_VDEC_DEC_MODE_B_SKIP | CELL_VDEC_DEC_MODE_PB_SKIP) && + vdec->type != 3) || + (mode == CELL_VDEC_DEC_MODE_PB_SKIP && + vdec->type != CELL_VDEC_CODEC_TYPE_AVC)) { return {CELL_VDEC_ERROR_ARG, "mode=%d, type=%d", +mode, vdec->type}; } @@ -1119,24 +1286,34 @@ error_code cellVdecDecodeAu(ppu_thread& ppu, u32 handle, CellVdecDecodeMode mode const u64 seq_id = vdec->seq_id; const u64 cmd_id = vdec->next_cmd_id++; - cellVdec.trace("Adding decode cmd (handle=0x%x, seq_id=%d, cmd_id=%d)", handle, seq_id, cmd_id); + cellVdec.trace("Adding decode cmd (handle=0x%x, seq_id=%d, cmd_id=%d)", + handle, seq_id, cmd_id); // TODO: check info - vdec->in_cmd.push(vdec_cmd(vdec_cmd_type::au_decode, seq_id, cmd_id, mode, *auInfo)); + vdec->in_cmd.push( + vdec_cmd(vdec_cmd_type::au_decode, seq_id, cmd_id, mode, *auInfo)); return CELL_OK; } -error_code cellVdecDecodeAuEx2(ppu_thread& ppu, u32 handle, CellVdecDecodeMode mode, vm::cptr auInfo) +error_code cellVdecDecodeAuEx2(ppu_thread& ppu, u32 handle, + CellVdecDecodeMode mode, + vm::cptr auInfo) { ppu.state += cpu_flag::wait; - cellVdec.todo("cellVdecDecodeAuEx2(handle=0x%x, mode=%d, auInfo=*0x%x)", handle, +mode, auInfo); + cellVdec.todo("cellVdecDecodeAuEx2(handle=0x%x, mode=%d, auInfo=*0x%x)", + handle, +mode, auInfo); const auto vdec = idm::get_unlocked(handle); if (!vdec || !auInfo || !auInfo->size || !auInfo->startAddr) { - return {CELL_VDEC_ERROR_ARG, "vdec=%d, auInfo=%d, size=%d, startAddr=0x%x", !!vdec, !!auInfo, auInfo ? auInfo->size.value() : 0, auInfo ? auInfo->startAddr.value() : 0}; + return {CELL_VDEC_ERROR_ARG, + "vdec=%d, auInfo=%d, size=%d, startAddr=0x%x", + !!vdec, + !!auInfo, + auInfo ? auInfo->size.value() : 0, + auInfo ? auInfo->startAddr.value() : 0}; } { @@ -1148,14 +1325,17 @@ error_code cellVdecDecodeAuEx2(ppu_thread& ppu, u32 handle, CellVdecDecodeMode m } } - if (mode < 0 || mode > (CELL_VDEC_DEC_MODE_B_SKIP | CELL_VDEC_DEC_MODE_PB_SKIP)) + if (mode < 0 || + mode > (CELL_VDEC_DEC_MODE_B_SKIP | CELL_VDEC_DEC_MODE_PB_SKIP)) { return {CELL_VDEC_ERROR_ARG, "mode=%d", +mode}; } // TODO: what does the 3 stand for ? - if ((mode == (CELL_VDEC_DEC_MODE_B_SKIP | CELL_VDEC_DEC_MODE_PB_SKIP) && vdec->type != 3) || - (mode == CELL_VDEC_DEC_MODE_PB_SKIP && vdec->type != CELL_VDEC_CODEC_TYPE_AVC)) + if ((mode == (CELL_VDEC_DEC_MODE_B_SKIP | CELL_VDEC_DEC_MODE_PB_SKIP) && + vdec->type != 3) || + (mode == CELL_VDEC_DEC_MODE_PB_SKIP && + vdec->type != CELL_VDEC_CODEC_TYPE_AVC)) { return {CELL_VDEC_ERROR_ARG, "mode=%d, type=%d", +mode, vdec->type}; } @@ -1175,18 +1355,24 @@ error_code cellVdecDecodeAuEx2(ppu_thread& ppu, u32 handle, CellVdecDecodeMode m const u64 seq_id = vdec->seq_id; const u64 cmd_id = vdec->next_cmd_id++; - cellVdec.trace("Adding decode cmd (handle=0x%x, seq_id=%d, cmd_id=%d)", handle, seq_id, cmd_id); + cellVdec.trace("Adding decode cmd (handle=0x%x, seq_id=%d, cmd_id=%d)", + handle, seq_id, cmd_id); // TODO: check info - vdec->in_cmd.push(vdec_cmd(vdec_cmd_type::au_decode, seq_id, cmd_id, mode, au_info)); + vdec->in_cmd.push( + vdec_cmd(vdec_cmd_type::au_decode, seq_id, cmd_id, mode, au_info)); return CELL_OK; } -error_code cellVdecGetPictureExt(ppu_thread& ppu, u32 handle, vm::cptr format, vm::ptr outBuff, u32 arg4) +error_code cellVdecGetPictureExt(ppu_thread& ppu, u32 handle, + vm::cptr format, + vm::ptr outBuff, u32 arg4) { ppu.state += cpu_flag::wait; - cellVdec.trace("cellVdecGetPictureExt(handle=0x%x, format=*0x%x, outBuff=*0x%x, arg4=*0x%x)", handle, format, outBuff, arg4); + cellVdec.trace("cellVdecGetPictureExt(handle=0x%x, format=*0x%x, " + "outBuff=*0x%x, arg4=*0x%x)", + handle, format, outBuff, arg4); const auto vdec = idm::get_unlocked(handle); @@ -1198,13 +1384,16 @@ error_code cellVdecGetPictureExt(ppu_thread& ppu, u32 handle, vm::cptrmutex}; - if (vdec->seq_state == sequence_state::closed || vdec->seq_state > sequence_state::ending) + if (vdec->seq_state == sequence_state::closed || + vdec->seq_state > sequence_state::ending) { return {CELL_VDEC_ERROR_SEQ, vdec->seq_state.load()}; } } - if (format->formatType > 4 || (format->formatType <= CELL_VDEC_PICFMT_RGBA32_ILV && format->colorMatrixType > CELL_VDEC_COLOR_MATRIX_TYPE_BT709)) + if (format->formatType > 4 || + (format->formatType <= CELL_VDEC_PICFMT_RGBA32_ILV && + format->colorMatrixType > CELL_VDEC_COLOR_MATRIX_TYPE_BT709)) { return CELL_VDEC_ERROR_ARG; } @@ -1216,7 +1405,9 @@ error_code cellVdecGetPictureExt(ppu_thread& ppu, u32 handle, vm::cptrunk0 || format->unk1) { - fmt::throw_exception("cellVdecGetPictureExt: Unknown arguments (arg4=*0x%x, unk0=0x%x, unk1=0x%x)", arg4, format->unk0, format->unk1); + fmt::throw_exception("cellVdecGetPictureExt: Unknown arguments " + "(arg4=*0x%x, unk0=0x%x, unk1=0x%x)", + arg4, format->unk0, format->unk1); } vdec_frame frame; @@ -1248,7 +1439,8 @@ error_code cellVdecGetPictureExt(ppu_thread& ppu, u32 handle, vm::cptrformat) { case AV_PIX_FMT_YUVJ420P: - cellVdec.error("cellVdecGetPictureExt: experimental AVPixelFormat (handle=0x%x, seq_id=%d, cmd_id=%d, format=%d). This may cause suboptimal video quality.", handle, frame.seq_id, frame.cmd_id, frame->format); + cellVdec.error("cellVdecGetPictureExt: experimental AVPixelFormat " + "(handle=0x%x, seq_id=%d, cmd_id=%d, format=%d). This may " + "cause suboptimal video quality.", + handle, frame.seq_id, frame.cmd_id, frame->format); [[fallthrough]]; case AV_PIX_FMT_YUV420P: in_f = alpha_plane ? AV_PIX_FMT_YUVA420P : static_cast(frame->format); break; default: - fmt::throw_exception("cellVdecGetPictureExt: Unknown frame format (%d)", frame->format); + fmt::throw_exception("cellVdecGetPictureExt: Unknown frame format (%d)", + frame->format); } - cellVdec.trace("cellVdecGetPictureExt: handle=0x%x, seq_id=%d, cmd_id=%d, w=%d, h=%d, frameFormat=%d, formatType=%d, in_f=%d, out_f=%d, alpha_plane=%d, alpha=%d, colorMatrixType=%d", handle, frame.seq_id, frame.cmd_id, w, h, frame->format, format->formatType, +in_f, +out_f, !!alpha_plane, format->alpha, format->colorMatrixType); + cellVdec.trace("cellVdecGetPictureExt: handle=0x%x, seq_id=%d, cmd_id=%d, " + "w=%d, h=%d, frameFormat=%d, formatType=%d, in_f=%d, " + "out_f=%d, alpha_plane=%d, alpha=%d, colorMatrixType=%d", + handle, frame.seq_id, frame.cmd_id, w, h, frame->format, + format->formatType, +in_f, +out_f, !!alpha_plane, + format->alpha, format->colorMatrixType); - vdec->sws = sws_getCachedContext(vdec->sws, w, h, in_f, w, h, out_f, SWS_POINT, nullptr, nullptr, nullptr); + vdec->sws = sws_getCachedContext(vdec->sws, w, h, in_f, w, h, out_f, + SWS_POINT, nullptr, nullptr, nullptr); - u8* in_data[4] = {frame->data[0], frame->data[1], frame->data[2], alpha_plane.get()}; - int in_line[4] = {frame->linesize[0], frame->linesize[1], frame->linesize[2], w * 1}; + u8* in_data[4] = {frame->data[0], frame->data[1], frame->data[2], + alpha_plane.get()}; + int in_line[4] = {frame->linesize[0], frame->linesize[1], + frame->linesize[2], w * 1}; u8* out_data[4] = {outBuff.get_ptr()}; int out_line[4] = {w * 4}; // RGBA32 or ARGB32 @@ -1318,9 +1528,14 @@ error_code cellVdecGetPictureExt(ppu_thread& ppu, u32 handle, vm::cptr format, vm::ptr outBuff) +error_code cellVdecGetPicture(ppu_thread& ppu, u32 handle, + vm::cptr format, + vm::ptr outBuff) { ppu.state += cpu_flag::wait; - cellVdec.trace("cellVdecGetPicture(handle=0x%x, format=*0x%x, outBuff=*0x%x)", handle, format, outBuff); + cellVdec.trace("cellVdecGetPicture(handle=0x%x, format=*0x%x, outBuff=*0x%x)", + handle, format, outBuff); if (!format) { @@ -1351,11 +1569,13 @@ error_code cellVdecGetPicture(ppu_thread& ppu, u32 handle, vm::cptr picItem) +error_code cellVdecGetPicItem(ppu_thread& ppu, u32 handle, + vm::pptr picItem) { ppu.state += cpu_flag::wait; - cellVdec.trace("cellVdecGetPicItem(handle=0x%x, picItem=**0x%x)", handle, picItem); + cellVdec.trace("cellVdecGetPicItem(handle=0x%x, picItem=**0x%x)", handle, + picItem); const auto vdec = idm::get_unlocked(handle); @@ -1369,7 +1589,8 @@ error_code cellVdecGetPicItem(ppu_thread& ppu, u32 handle, vm::pptrmutex}; - if (vdec->seq_state == sequence_state::closed || vdec->seq_state > sequence_state::ending) + if (vdec->seq_state == sequence_state::closed || + vdec->seq_state > sequence_state::ending) { return {CELL_VDEC_ERROR_SEQ, vdec->seq_state.load()}; } @@ -1380,7 +1601,9 @@ error_code cellVdecGetPicItem(ppu_thread& ppu, u32 handle, vm::pptr picInfo; + std::aligned_union_t<0, CellVdecAvcInfo, CellVdecDivxInfo, + CellVdecMpeg2Info> + picInfo; }; AVFrame* frame{}; @@ -1412,7 +1635,8 @@ error_code cellVdecGetPicItem(ppu_thread& ppu, u32 handle, vm::pptrmem_bias + size_needed >= vdec->mem_size / size_needed * size_needed) + if (vdec->mem_bias + size_needed >= + vdec->mem_size / size_needed * size_needed) { vdec->mem_bias = 0; break; @@ -1427,12 +1651,14 @@ error_code cellVdecGetPicItem(ppu_thread& ppu, u32 handle, vm::pptrcodecType = vdec->type; info->startAddr = 0x00000123; // invalid value (no address for picture) - const int buffer_size = av_image_get_buffer_size(vdec->ctx->pix_fmt, vdec->ctx->width, vdec->ctx->height, 1); + const int buffer_size = av_image_get_buffer_size( + vdec->ctx->pix_fmt, vdec->ctx->width, vdec->ctx->height, 1); ensure(buffer_size >= 0); info->size = utils::align(buffer_size, 128); info->auNum = 1; @@ -1461,13 +1687,21 @@ error_code cellVdecGetPicItem(ppu_thread& ppu, u32 handle, vm::pptrpict_type) { - case AV_PICTURE_TYPE_I: avc->pictureType[0] = CELL_VDEC_AVC_PCT_I; break; - case AV_PICTURE_TYPE_P: avc->pictureType[0] = CELL_VDEC_AVC_PCT_P; break; - case AV_PICTURE_TYPE_B: avc->pictureType[0] = CELL_VDEC_AVC_PCT_B; break; + case AV_PICTURE_TYPE_I: + avc->pictureType[0] = CELL_VDEC_AVC_PCT_I; + break; + case AV_PICTURE_TYPE_P: + avc->pictureType[0] = CELL_VDEC_AVC_PCT_P; + break; + case AV_PICTURE_TYPE_B: + avc->pictureType[0] = CELL_VDEC_AVC_PCT_B; + break; default: { avc->pictureType[0] = CELL_VDEC_AVC_PCT_UNKNOWN; - cellVdec.error("cellVdecGetPicItem(AVC): unknown pict_type value (handle=0x%x, seq_id=%d, cmd_id=%d, pct=0x%x)", handle, seq_id, cmd_id, pct); + cellVdec.error("cellVdecGetPicItem(AVC): unknown pict_type value " + "(handle=0x%x, seq_id=%d, cmd_id=%d, pct=0x%x)", + handle, seq_id, cmd_id, pct); break; } } @@ -1493,15 +1727,34 @@ error_code cellVdecGetPicItem(ppu_thread& ppu, u32 handle, vm::pptrframeRateCode = CELL_VDEC_AVC_FRC_24000DIV1001; break; - case CELL_VDEC_FRC_24: avc->frameRateCode = CELL_VDEC_AVC_FRC_24; break; - case CELL_VDEC_FRC_25: avc->frameRateCode = CELL_VDEC_AVC_FRC_25; break; - case CELL_VDEC_FRC_30000DIV1001: avc->frameRateCode = CELL_VDEC_AVC_FRC_30000DIV1001; break; - case CELL_VDEC_FRC_30: avc->frameRateCode = CELL_VDEC_AVC_FRC_30; break; - case CELL_VDEC_FRC_50: avc->frameRateCode = CELL_VDEC_AVC_FRC_50; break; - case CELL_VDEC_FRC_60000DIV1001: avc->frameRateCode = CELL_VDEC_AVC_FRC_60000DIV1001; break; - case CELL_VDEC_FRC_60: avc->frameRateCode = CELL_VDEC_AVC_FRC_60; break; - default: cellVdec.error("cellVdecGetPicItem(AVC): unknown frc value (handle=0x%x, seq_id=%d, cmd_id=%d, frc=0x%x)", handle, seq_id, cmd_id, frc); + case CELL_VDEC_FRC_24000DIV1001: + avc->frameRateCode = CELL_VDEC_AVC_FRC_24000DIV1001; + break; + case CELL_VDEC_FRC_24: + avc->frameRateCode = CELL_VDEC_AVC_FRC_24; + break; + case CELL_VDEC_FRC_25: + avc->frameRateCode = CELL_VDEC_AVC_FRC_25; + break; + case CELL_VDEC_FRC_30000DIV1001: + avc->frameRateCode = CELL_VDEC_AVC_FRC_30000DIV1001; + break; + case CELL_VDEC_FRC_30: + avc->frameRateCode = CELL_VDEC_AVC_FRC_30; + break; + case CELL_VDEC_FRC_50: + avc->frameRateCode = CELL_VDEC_AVC_FRC_50; + break; + case CELL_VDEC_FRC_60000DIV1001: + avc->frameRateCode = CELL_VDEC_AVC_FRC_60000DIV1001; + break; + case CELL_VDEC_FRC_60: + avc->frameRateCode = CELL_VDEC_AVC_FRC_60; + break; + default: + cellVdec.error("cellVdecGetPicItem(AVC): unknown frc value (handle=0x%x, " + "seq_id=%d, cmd_id=%d, frc=0x%x)", + handle, seq_id, cmd_id, frc); } avc->fixed_frame_rate_flag = true; @@ -1519,10 +1772,19 @@ error_code cellVdecGetPicItem(ppu_thread& ppu, u32 handle, vm::pptrpict_type) { - case AV_PICTURE_TYPE_I: dvx->pictureType = CELL_VDEC_DIVX_VCT_I; break; - case AV_PICTURE_TYPE_P: dvx->pictureType = CELL_VDEC_DIVX_VCT_P; break; - case AV_PICTURE_TYPE_B: dvx->pictureType = CELL_VDEC_DIVX_VCT_B; break; - default: cellVdec.error("cellVdecGetPicItem(DivX): unknown pict_type value (handle=0x%x, seq_id=%d, cmd_id=%d, pct=0x%x)", handle, seq_id, cmd_id, pct); + case AV_PICTURE_TYPE_I: + dvx->pictureType = CELL_VDEC_DIVX_VCT_I; + break; + case AV_PICTURE_TYPE_P: + dvx->pictureType = CELL_VDEC_DIVX_VCT_P; + break; + case AV_PICTURE_TYPE_B: + dvx->pictureType = CELL_VDEC_DIVX_VCT_B; + break; + default: + cellVdec.error("cellVdecGetPicItem(DivX): unknown pict_type value " + "(handle=0x%x, seq_id=%d, cmd_id=%d, pct=0x%x)", + handle, seq_id, cmd_id, pct); } dvx->horizontalSize = frame->width; @@ -1538,15 +1800,34 @@ error_code cellVdecGetPicItem(ppu_thread& ppu, u32 handle, vm::pptrframeRateCode = CELL_VDEC_DIVX_FRC_24000DIV1001; break; - case CELL_VDEC_FRC_24: dvx->frameRateCode = CELL_VDEC_DIVX_FRC_24; break; - case CELL_VDEC_FRC_25: dvx->frameRateCode = CELL_VDEC_DIVX_FRC_25; break; - case CELL_VDEC_FRC_30000DIV1001: dvx->frameRateCode = CELL_VDEC_DIVX_FRC_30000DIV1001; break; - case CELL_VDEC_FRC_30: dvx->frameRateCode = CELL_VDEC_DIVX_FRC_30; break; - case CELL_VDEC_FRC_50: dvx->frameRateCode = CELL_VDEC_DIVX_FRC_50; break; - case CELL_VDEC_FRC_60000DIV1001: dvx->frameRateCode = CELL_VDEC_DIVX_FRC_60000DIV1001; break; - case CELL_VDEC_FRC_60: dvx->frameRateCode = CELL_VDEC_DIVX_FRC_60; break; - default: cellVdec.error("cellVdecGetPicItem(DivX): unknown frc value (handle=0x%x, seq_id=%d, cmd_id=%d, frc=0x%x)", handle, seq_id, cmd_id, frc); + case CELL_VDEC_FRC_24000DIV1001: + dvx->frameRateCode = CELL_VDEC_DIVX_FRC_24000DIV1001; + break; + case CELL_VDEC_FRC_24: + dvx->frameRateCode = CELL_VDEC_DIVX_FRC_24; + break; + case CELL_VDEC_FRC_25: + dvx->frameRateCode = CELL_VDEC_DIVX_FRC_25; + break; + case CELL_VDEC_FRC_30000DIV1001: + dvx->frameRateCode = CELL_VDEC_DIVX_FRC_30000DIV1001; + break; + case CELL_VDEC_FRC_30: + dvx->frameRateCode = CELL_VDEC_DIVX_FRC_30; + break; + case CELL_VDEC_FRC_50: + dvx->frameRateCode = CELL_VDEC_DIVX_FRC_50; + break; + case CELL_VDEC_FRC_60000DIV1001: + dvx->frameRateCode = CELL_VDEC_DIVX_FRC_60000DIV1001; + break; + case CELL_VDEC_FRC_60: + dvx->frameRateCode = CELL_VDEC_DIVX_FRC_60; + break; + default: + cellVdec.error("cellVdecGetPicItem(DivX): unknown frc value " + "(handle=0x%x, seq_id=%d, cmd_id=%d, frc=0x%x)", + handle, seq_id, cmd_id, frc); } } else if (vdec->type == CELL_VDEC_CODEC_TYPE_MPEG2) @@ -1560,15 +1841,34 @@ error_code cellVdecGetPicItem(ppu_thread& ppu, u32 handle, vm::pptrframe_rate_code = CELL_VDEC_MPEG2_FRC_24000DIV1001; break; - case CELL_VDEC_FRC_24: mp2->frame_rate_code = CELL_VDEC_MPEG2_FRC_24; break; - case CELL_VDEC_FRC_25: mp2->frame_rate_code = CELL_VDEC_MPEG2_FRC_25; break; - case CELL_VDEC_FRC_30000DIV1001: mp2->frame_rate_code = CELL_VDEC_MPEG2_FRC_30000DIV1001; break; - case CELL_VDEC_FRC_30: mp2->frame_rate_code = CELL_VDEC_MPEG2_FRC_30; break; - case CELL_VDEC_FRC_50: mp2->frame_rate_code = CELL_VDEC_MPEG2_FRC_50; break; - case CELL_VDEC_FRC_60000DIV1001: mp2->frame_rate_code = CELL_VDEC_MPEG2_FRC_60000DIV1001; break; - case CELL_VDEC_FRC_60: mp2->frame_rate_code = CELL_VDEC_MPEG2_FRC_60; break; - default: cellVdec.error("cellVdecGetPicItem(MPEG2): unknown frc value (handle=0x%x, seq_id=%d, cmd_id=%d, frc=0x%x)", handle, seq_id, cmd_id, frc); + case CELL_VDEC_FRC_24000DIV1001: + mp2->frame_rate_code = CELL_VDEC_MPEG2_FRC_24000DIV1001; + break; + case CELL_VDEC_FRC_24: + mp2->frame_rate_code = CELL_VDEC_MPEG2_FRC_24; + break; + case CELL_VDEC_FRC_25: + mp2->frame_rate_code = CELL_VDEC_MPEG2_FRC_25; + break; + case CELL_VDEC_FRC_30000DIV1001: + mp2->frame_rate_code = CELL_VDEC_MPEG2_FRC_30000DIV1001; + break; + case CELL_VDEC_FRC_30: + mp2->frame_rate_code = CELL_VDEC_MPEG2_FRC_30; + break; + case CELL_VDEC_FRC_50: + mp2->frame_rate_code = CELL_VDEC_MPEG2_FRC_50; + break; + case CELL_VDEC_FRC_60000DIV1001: + mp2->frame_rate_code = CELL_VDEC_MPEG2_FRC_60000DIV1001; + break; + case CELL_VDEC_FRC_60: + mp2->frame_rate_code = CELL_VDEC_MPEG2_FRC_60; + break; + default: + cellVdec.error("cellVdecGetPicItem(MPEG2): unknown frc value " + "(handle=0x%x, seq_id=%d, cmd_id=%d, frc=0x%x)", + handle, seq_id, cmd_id, frc); } mp2->progressive_sequence = true; // ??? @@ -1578,10 +1878,19 @@ error_code cellVdecGetPicItem(ppu_thread& ppu, u32 handle, vm::pptrpict_type) { - case AV_PICTURE_TYPE_I: mp2->picture_coding_type[0] = CELL_VDEC_MPEG2_PCT_I; break; - case AV_PICTURE_TYPE_P: mp2->picture_coding_type[0] = CELL_VDEC_MPEG2_PCT_P; break; - case AV_PICTURE_TYPE_B: mp2->picture_coding_type[0] = CELL_VDEC_MPEG2_PCT_B; break; - default: cellVdec.error("cellVdecGetPicItem(MPEG2): unknown pict_type value (handle=0x%x, seq_id=%d, cmd_id=%d, pct=0x%x)", handle, seq_id, cmd_id, pct); + case AV_PICTURE_TYPE_I: + mp2->picture_coding_type[0] = CELL_VDEC_MPEG2_PCT_I; + break; + case AV_PICTURE_TYPE_P: + mp2->picture_coding_type[0] = CELL_VDEC_MPEG2_PCT_P; + break; + case AV_PICTURE_TYPE_B: + mp2->picture_coding_type[0] = CELL_VDEC_MPEG2_PCT_B; + break; + default: + cellVdec.error("cellVdecGetPicItem(MPEG2): unknown pict_type value " + "(handle=0x%x, seq_id=%d, cmd_id=%d, pct=0x%x)", + handle, seq_id, cmd_id, pct); } mp2->picture_coding_type[1] = CELL_VDEC_MPEG2_PCT_FORBIDDEN; // ??? @@ -1597,7 +1906,8 @@ error_code cellVdecGetPicItem(ppu_thread& ppu, u32 handle, vm::pptr(handle); @@ -1609,22 +1919,29 @@ error_code cellVdecSetFrameRate(u32 handle, CellVdecFrameRate frameRateCode) std::lock_guard lock{vdec->mutex}; - if (vdec->seq_state == sequence_state::closed || vdec->seq_state >= sequence_state::invalid) + if (vdec->seq_state == sequence_state::closed || + vdec->seq_state >= sequence_state::invalid) { return {CELL_VDEC_ERROR_SEQ, vdec->seq_state.load()}; } const u64 seq_id = vdec->seq_id; const u64 cmd_id = vdec->next_cmd_id++; - cellVdec.trace("Adding framerate cmd (handle=0x%x, seq_id=%d, cmd_id=%d)", handle, seq_id, cmd_id); + cellVdec.trace("Adding framerate cmd (handle=0x%x, seq_id=%d, cmd_id=%d)", + handle, seq_id, cmd_id); - vdec->in_cmd.push(vdec_cmd(vdec_cmd_type::framerate, seq_id, cmd_id, frameRateCode & 0x87)); + vdec->in_cmd.push( + vdec_cmd(vdec_cmd_type::framerate, seq_id, cmd_id, frameRateCode & 0x87)); return CELL_OK; } -error_code cellVdecOpenExt(ppu_thread& ppu, vm::cptr type, vm::cptr res, vm::cptr cb, vm::ptr handle) +error_code cellVdecOpenExt(ppu_thread& ppu, vm::cptr type, + vm::cptr res, + vm::cptr cb, vm::ptr handle) { - cellVdec.warning("cellVdecOpenExt(type=*0x%x, res=*0x%x, cb=*0x%x, handle=*0x%x)", type, res, cb, handle); + cellVdec.warning( + "cellVdecOpenExt(type=*0x%x, res=*0x%x, cb=*0x%x, handle=*0x%x)", type, + res, cb, handle); if (!res) { @@ -1686,7 +2003,8 @@ error_code cellVdecSetPts(u32 handle, vm::ptr unk) std::lock_guard lock{vdec->mutex}; - if (vdec->seq_state == sequence_state::closed || vdec->seq_state >= sequence_state::invalid) + if (vdec->seq_state == sequence_state::closed || + vdec->seq_state >= sequence_state::invalid) { return {CELL_VDEC_ERROR_SEQ, vdec->seq_state.load()}; } diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellVideoExport.cpp b/ps3fw/cellVideoExport.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellVideoExport.cpp rename to ps3fw/cellVideoExport.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellVideoOut.cpp b/ps3fw/cellVideoOut.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellVideoOut.cpp rename to ps3fw/cellVideoOut.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellVideoPlayerUtility.cpp b/ps3fw/cellVideoPlayerUtility.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellVideoPlayerUtility.cpp rename to ps3fw/cellVideoPlayerUtility.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellVideoUpload.cpp b/ps3fw/cellVideoUpload.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellVideoUpload.cpp rename to ps3fw/cellVideoUpload.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellVoice.cpp b/ps3fw/cellVoice.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellVoice.cpp rename to ps3fw/cellVoice.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellVpost.cpp b/ps3fw/cellVpost.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellVpost.cpp rename to ps3fw/cellVpost.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellWebBrowser.cpp b/ps3fw/cellWebBrowser.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellWebBrowser.cpp rename to ps3fw/cellWebBrowser.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cell_FreeType2.cpp b/ps3fw/cell_FreeType2.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cell_FreeType2.cpp rename to ps3fw/cell_FreeType2.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/StaticHLE.h b/ps3fw/include/rpcsx/fw/ps3/StaticHLE.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/StaticHLE.h rename to ps3fw/include/rpcsx/fw/ps3/StaticHLE.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellAdec.h b/ps3fw/include/rpcsx/fw/ps3/cellAdec.h similarity index 99% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellAdec.h rename to ps3fw/include/rpcsx/fw/ps3/cellAdec.h index 4015d721a..ca6f36730 100644 --- a/rpcs3/rpcs3/Emu/Cell/Modules/cellAdec.h +++ b/ps3fw/include/rpcsx/fw/ps3/cellAdec.h @@ -1,8 +1,8 @@ #pragma once #include "cellPamf.h" // CellCodecTimeStamp -#include "../lv2/sys_mutex.h" -#include "../lv2/sys_cond.h" +#include "Emu/Cell/lv2/sys_mutex.h" +#include "Emu/Cell/lv2/sys_cond.h" // Error Codes enum CellAdecError : u32 diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellAtrac.h b/ps3fw/include/rpcsx/fw/ps3/cellAtrac.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellAtrac.h rename to ps3fw/include/rpcsx/fw/ps3/cellAtrac.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellAtracMulti.h b/ps3fw/include/rpcsx/fw/ps3/cellAtracMulti.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellAtracMulti.h rename to ps3fw/include/rpcsx/fw/ps3/cellAtracMulti.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellAtracXdec.h b/ps3fw/include/rpcsx/fw/ps3/cellAtracXdec.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellAtracXdec.h rename to ps3fw/include/rpcsx/fw/ps3/cellAtracXdec.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellAudio.h b/ps3fw/include/rpcsx/fw/ps3/cellAudio.h similarity index 84% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellAudio.h rename to ps3fw/include/rpcsx/fw/ps3/cellAudio.h index 04e7a2dd5..0d1153cfd 100644 --- a/rpcs3/rpcs3/Emu/Cell/Modules/cellAudio.h +++ b/ps3fw/include/rpcsx/fw/ps3/cellAudio.h @@ -1,13 +1,13 @@ #pragma once -#include "Emu/Memory/vm_ptr.h" -#include "Utilities/Thread.h" -#include "Utilities/simple_ringbuf.h" -#include "Emu/Memory/vm.h" #include "Emu/Audio/AudioBackend.h" #include "Emu/Audio/AudioDumper.h" #include "Emu/Audio/audio_resampler.h" +#include "Emu/Memory/vm.h" +#include "Emu/Memory/vm_ptr.h" #include "Emu/system_config_types.h" +#include "util/Thread.h" +#include "util/simple_ringbuf.h" struct lv2_event_queue; @@ -106,7 +106,8 @@ enum : u32 AUDIO_MAX_BLOCK_COUNT = 32, AUDIO_MAX_CHANNELS_COUNT = 8, - AUDIO_PORT_OFFSET = AUDIO_BUFFER_SAMPLES * AUDIO_MAX_BLOCK_COUNT * AUDIO_MAX_CHANNELS_COUNT * sizeof(f32), + AUDIO_PORT_OFFSET = AUDIO_BUFFER_SAMPLES * AUDIO_MAX_BLOCK_COUNT * + AUDIO_MAX_CHANNELS_COUNT * sizeof(f32), EXTRA_AUDIO_BUFFERS = 8, MAX_AUDIO_EVENT_QUEUES = 64, @@ -116,12 +117,16 @@ enum : u32 PORT_BUFFER_TAG_COUNT = 6, PORT_BUFFER_TAG_LAST_2CH = AUDIO_BLOCK_SIZE_2CH - 1, - PORT_BUFFER_TAG_DELTA_2CH = PORT_BUFFER_TAG_LAST_2CH / (PORT_BUFFER_TAG_COUNT - 1), - PORT_BUFFER_TAG_FIRST_2CH = PORT_BUFFER_TAG_LAST_2CH % (PORT_BUFFER_TAG_COUNT - 1), + PORT_BUFFER_TAG_DELTA_2CH = + PORT_BUFFER_TAG_LAST_2CH / (PORT_BUFFER_TAG_COUNT - 1), + PORT_BUFFER_TAG_FIRST_2CH = + PORT_BUFFER_TAG_LAST_2CH % (PORT_BUFFER_TAG_COUNT - 1), PORT_BUFFER_TAG_LAST_8CH = AUDIO_BLOCK_SIZE_8CH - 1, - PORT_BUFFER_TAG_DELTA_8CH = PORT_BUFFER_TAG_LAST_8CH / (PORT_BUFFER_TAG_COUNT - 1), - PORT_BUFFER_TAG_FIRST_8CH = PORT_BUFFER_TAG_LAST_8CH % (PORT_BUFFER_TAG_COUNT - 1), + PORT_BUFFER_TAG_DELTA_8CH = + PORT_BUFFER_TAG_LAST_8CH / (PORT_BUFFER_TAG_COUNT - 1), + PORT_BUFFER_TAG_FIRST_8CH = + PORT_BUFFER_TAG_LAST_8CH % (PORT_BUFFER_TAG_COUNT - 1), }; enum class audio_port_state : u32 @@ -222,7 +227,8 @@ struct cell_audio_config std::shared_ptr backend = nullptr; AudioChannelCnt audio_downmix = AudioChannelCnt::SURROUND_7_1; - audio_channel_layout backend_channel_layout = audio_channel_layout::surround_7_1; + audio_channel_layout backend_channel_layout = + audio_channel_layout::surround_7_1; u32 backend_ch_cnt = 8; u32 audio_channels = 2; u32 audio_sampling_rate = DEFAULT_AUDIO_SAMPLING_RATE; @@ -238,37 +244,49 @@ struct cell_audio_config u64 desired_buffer_duration = 0; - // We need a non-blocking backend (implementing play/pause/flush) to be able to do buffering correctly - // We also need to be able to query the current playing state + // We need a non-blocking backend (implementing play/pause/flush) to be able + // to do buffering correctly We also need to be able to query the current + // playing state bool buffering_enabled = false; - u64 minimum_block_period = 0; // the block period will not be dynamically lowered below this value (usecs) - u64 maximum_block_period = 0; // the block period will not be dynamically increased above this value (usecs) + u64 minimum_block_period = 0; // the block period will not be dynamically + // lowered below this value (usecs) + u64 maximum_block_period = 0; // the block period will not be dynamically + // increased above this value (usecs) u32 desired_full_buffers = 0; u32 num_allocated_buffers = 0; // number of ringbuffer buffers - static constexpr f32 period_average_alpha = 0.02f; // alpha factor for the m_average_period rolling average + static constexpr f32 period_average_alpha = + 0.02f; // alpha factor for the m_average_period rolling average - // when comparing the current period time with the desired period, if it is below this number of usecs we do not wait any longer(quantum dependent) + // when comparing the current period time with the desired period, if it is + // below this number of usecs we do not wait any longer(quantum dependent) #ifdef _WIN32 static constexpr s64 period_comparison_margin = 250; #else static constexpr s64 period_comparison_margin = 5; #endif - u64 fully_untouched_timeout = 0; // timeout if the game has not touched any audio buffer yet - u64 partially_untouched_timeout = 0; // timeout if the game has not touched all audio buffers yet + u64 fully_untouched_timeout = + 0; // timeout if the game has not touched any audio buffer yet + u64 partially_untouched_timeout = + 0; // timeout if the game has not touched all audio buffers yet /* * Time Stretching */ - // We need to be able to set a dynamic frequency ratio to be able to do time stretching + // We need to be able to set a dynamic frequency ratio to be able to do time + // stretching bool time_stretching_enabled = false; - f32 time_stretching_threshold = 0.0f; // we only apply time stretching below this buffer fill rate (adjusted for average period) - static constexpr f32 time_stretching_step = 0.1f; // will only reduce/increase the frequency ratio in steps of at least this value + f32 time_stretching_threshold = + 0.0f; // we only apply time stretching below this buffer fill rate + // (adjusted for average period) + static constexpr f32 time_stretching_step = + 0.1f; // will only reduce/increase the frequency ratio in steps of at + // least this value /* * Constructor @@ -355,7 +373,8 @@ public: bool device_changed() { - return backend_device_changed.test_and_reset() && backend->DefaultDeviceChanged(); + return backend_device_changed.test_and_reset() && + backend->DefaultDeviceChanged(); } std::string_view get_backend_name() const @@ -382,7 +401,8 @@ private: public: shared_mutex emu_cfg_upd_m{}; cell_audio_config cfg{}; - atomic_t m_update_configuration = audio_backend_update::NONE; + atomic_t m_update_configuration = + audio_backend_update::NONE; shared_mutex mutex{}; atomic_t init = 0; diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellAudioIn.h b/ps3fw/include/rpcsx/fw/ps3/cellAudioIn.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellAudioIn.h rename to ps3fw/include/rpcsx/fw/ps3/cellAudioIn.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellAudioOut.h b/ps3fw/include/rpcsx/fw/ps3/cellAudioOut.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellAudioOut.h rename to ps3fw/include/rpcsx/fw/ps3/cellAudioOut.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellBgdl.h b/ps3fw/include/rpcsx/fw/ps3/cellBgdl.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellBgdl.h rename to ps3fw/include/rpcsx/fw/ps3/cellBgdl.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellCamera.h b/ps3fw/include/rpcsx/fw/ps3/cellCamera.h similarity index 97% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellCamera.h rename to ps3fw/include/rpcsx/fw/ps3/cellCamera.h index 2a29a01ca..76dd03ca8 100644 --- a/rpcs3/rpcs3/Emu/Cell/Modules/cellCamera.h +++ b/ps3fw/include/rpcsx/fw/ps3/cellCamera.h @@ -1,9 +1,9 @@ #pragma once -#include "Utilities/Thread.h" #include "Emu/Io/camera_handler_base.h" #include "Emu/Memory/vm_ptr.h" -#include "Utilities/mutex.h" +#include "util/Thread.h" +#include "util/mutex.h" #include @@ -365,7 +365,8 @@ struct CellCameraInfoEx vm::bptr buffer; be_t bytesize; - be_t width; // only used if resolution == CELL_CAMERA_SPECIFIED_WIDTH_HEIGHT + be_t + width; // only used if resolution == CELL_CAMERA_SPECIFIED_WIDTH_HEIGHT be_t height; // likewise be_t dev_num; be_t guid; @@ -404,7 +405,8 @@ public: void set_attr(s32 attrib, u32 arg1, u32 arg2); /** - * \brief Sets up notify event queue supplied and immediately sends an ATTACH event to it + * \brief Sets up notify event queue supplied and immediately sends an ATTACH + * event to it * \param key Event queue key to add * \param source Event source port * \param flag Event flag (CELL_CAMERA_EFLAG_*) @@ -460,7 +462,8 @@ public: std::shared_ptr handler; bool open_camera(); bool start_camera(); - bool get_camera_frame(u8* dst, u32& width, u32& height, u64& frame_number, u64& bytes_read); + bool get_camera_frame(u8* dst, u32& width, u32& height, u64& frame_number, + u64& bytes_read); void stop_camera(); void close_camera(); bool on_handler_state(camera_handler_base::camera_handler_state state); @@ -478,7 +481,8 @@ struct gem_camera_shared SAVESTATE_INIT_POS(7); - atomic_t frame_timestamp_us{}; // latest read timestamp from cellCamera (cellCameraRead(Ex)) + atomic_t frame_timestamp_us{}; // latest read timestamp from cellCamera + // (cellCameraRead(Ex)) atomic_t width{640}; atomic_t height{480}; atomic_t size{0}; diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellCelp8Enc.h b/ps3fw/include/rpcsx/fw/ps3/cellCelp8Enc.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellCelp8Enc.h rename to ps3fw/include/rpcsx/fw/ps3/cellCelp8Enc.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellCelpEnc.h b/ps3fw/include/rpcsx/fw/ps3/cellCelpEnc.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellCelpEnc.h rename to ps3fw/include/rpcsx/fw/ps3/cellCelpEnc.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellCrossController.h b/ps3fw/include/rpcsx/fw/ps3/cellCrossController.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellCrossController.h rename to ps3fw/include/rpcsx/fw/ps3/cellCrossController.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellDaisy.h b/ps3fw/include/rpcsx/fw/ps3/cellDaisy.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellDaisy.h rename to ps3fw/include/rpcsx/fw/ps3/cellDaisy.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellDmux.h b/ps3fw/include/rpcsx/fw/ps3/cellDmux.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellDmux.h rename to ps3fw/include/rpcsx/fw/ps3/cellDmux.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellDmuxPamf.h b/ps3fw/include/rpcsx/fw/ps3/cellDmuxPamf.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellDmuxPamf.h rename to ps3fw/include/rpcsx/fw/ps3/cellDmuxPamf.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellFiber.h b/ps3fw/include/rpcsx/fw/ps3/cellFiber.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellFiber.h rename to ps3fw/include/rpcsx/fw/ps3/cellFiber.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellFont.h b/ps3fw/include/rpcsx/fw/ps3/cellFont.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellFont.h rename to ps3fw/include/rpcsx/fw/ps3/cellFont.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellFontFT.h b/ps3fw/include/rpcsx/fw/ps3/cellFontFT.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellFontFT.h rename to ps3fw/include/rpcsx/fw/ps3/cellFontFT.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellFs.h b/ps3fw/include/rpcsx/fw/ps3/cellFs.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellFs.h rename to ps3fw/include/rpcsx/fw/ps3/cellFs.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellGame.h b/ps3fw/include/rpcsx/fw/ps3/cellGame.h similarity index 99% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellGame.h rename to ps3fw/include/rpcsx/fw/ps3/cellGame.h index fa41e9fa2..e0f625b08 100644 --- a/rpcs3/rpcs3/Emu/Cell/Modules/cellGame.h +++ b/ps3fw/include/rpcsx/fw/ps3/cellGame.h @@ -1,5 +1,6 @@ #pragma once +#include "Emu/Cell/ErrorCodes.h" #include "Emu/Memory/vm_ptr.h" // Return Codes diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellGcmSys.h b/ps3fw/include/rpcsx/fw/ps3/cellGcmSys.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellGcmSys.h rename to ps3fw/include/rpcsx/fw/ps3/cellGcmSys.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellGem.h b/ps3fw/include/rpcsx/fw/ps3/cellGem.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellGem.h rename to ps3fw/include/rpcsx/fw/ps3/cellGem.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellGifDec.h b/ps3fw/include/rpcsx/fw/ps3/cellGifDec.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellGifDec.h rename to ps3fw/include/rpcsx/fw/ps3/cellGifDec.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellHttp.h b/ps3fw/include/rpcsx/fw/ps3/cellHttp.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellHttp.h rename to ps3fw/include/rpcsx/fw/ps3/cellHttp.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellHttpUtil.h b/ps3fw/include/rpcsx/fw/ps3/cellHttpUtil.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellHttpUtil.h rename to ps3fw/include/rpcsx/fw/ps3/cellHttpUtil.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellImeJp.h b/ps3fw/include/rpcsx/fw/ps3/cellImeJp.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellImeJp.h rename to ps3fw/include/rpcsx/fw/ps3/cellImeJp.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellJpgDec.h b/ps3fw/include/rpcsx/fw/ps3/cellJpgDec.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellJpgDec.h rename to ps3fw/include/rpcsx/fw/ps3/cellJpgDec.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellJpgEnc.h b/ps3fw/include/rpcsx/fw/ps3/cellJpgEnc.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellJpgEnc.h rename to ps3fw/include/rpcsx/fw/ps3/cellJpgEnc.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellKb.h b/ps3fw/include/rpcsx/fw/ps3/cellKb.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellKb.h rename to ps3fw/include/rpcsx/fw/ps3/cellKb.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellL10n.h b/ps3fw/include/rpcsx/fw/ps3/cellL10n.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellL10n.h rename to ps3fw/include/rpcsx/fw/ps3/cellL10n.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellMic.h b/ps3fw/include/rpcsx/fw/ps3/cellMic.h similarity index 94% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellMic.h rename to ps3fw/include/rpcsx/fw/ps3/cellMic.h index 2b69893e9..7d5f96ed3 100644 --- a/rpcs3/rpcs3/Emu/Cell/Modules/cellMic.h +++ b/ps3fw/include/rpcsx/fw/ps3/cellMic.h @@ -1,8 +1,8 @@ #pragma once -#include "Utilities/Thread.h" #include "3rdparty/OpenAL/openal-soft/include/AL/alc.h" -#include "Utilities/mutex.h" +#include "util/Thread.h" +#include "util/mutex.h" // Error Codes enum CellMicInError : u32 @@ -279,7 +279,8 @@ public: mic_registered = registered; }; - error_code open_microphone(const u8 type, const u32 dsp_r, const u32 raw_r, const u8 channels = 2); + error_code open_microphone(const u8 type, const u32 dsp_r, const u32 raw_r, + const u8 channels = 2); error_code close_microphone(); error_code start_microphone(); @@ -355,7 +356,8 @@ public: private: template static inline void variable_byteswap(const void* src, void* dst); - inline u32 convert_16_bit_pcm_to_float(const std::vector& buffer, u32 num_bytes); + inline u32 convert_16_bit_pcm_to_float(const std::vector& buffer, + u32 num_bytes); u32 capture_audio(); @@ -392,7 +394,8 @@ private: static constexpr u8 bit_resolution = 16; static constexpr usz inbuf_size = 400000; // Default value unknown - static constexpr usz float_buf_size = inbuf_size * (sizeof(f32) / sizeof(s16)); + static constexpr usz float_buf_size = + inbuf_size * (sizeof(f32) / sizeof(s16)); simple_ringbuf rbuf_raw; simple_ringbuf rbuf_dsp; @@ -424,12 +427,12 @@ public: protected: atomic_t wakey = 0; - // u32 signalStateLocalTalk = 9; // value is in range 0-10. 10 indicates talking, 0 indicating none. - // u32 signalStateFarTalk = 0; // value is in range 0-10. 10 indicates talking from far away, 0 indicating none. - // f32 signalStateNoiseSupression; // value is in decibels - // f32 signalStateGainControl; - // f32 signalStateMicSignalLevel; // value is in decibels - // f32 signalStateSpeakerSignalLevel; // value is in decibels + // u32 signalStateLocalTalk = 9; // value is in range 0-10. 10 indicates + // talking, 0 indicating none. u32 signalStateFarTalk = 0; // value is in range + // 0-10. 10 indicates talking from far away, 0 indicating none. f32 + // signalStateNoiseSupression; // value is in decibels f32 + // signalStateGainControl; f32 signalStateMicSignalLevel; // value is in + // decibels f32 signalStateSpeakerSignalLevel; // value is in decibels }; using mic_thread = named_thread; diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellMouse.h b/ps3fw/include/rpcsx/fw/ps3/cellMouse.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellMouse.h rename to ps3fw/include/rpcsx/fw/ps3/cellMouse.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellMsgDialog.h b/ps3fw/include/rpcsx/fw/ps3/cellMsgDialog.h similarity index 80% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellMsgDialog.h rename to ps3fw/include/rpcsx/fw/ps3/cellMsgDialog.h index d24749e05..30234070f 100644 --- a/rpcs3/rpcs3/Emu/Cell/Modules/cellMsgDialog.h +++ b/ps3fw/include/rpcsx/fw/ps3/cellMsgDialog.h @@ -1,13 +1,13 @@ #pragma once -#include "util/types.hpp" -#include "util/atomic.hpp" -#include "Utilities/BitField.h" -#include "Emu/Memory/vm_ptr.h" #include "Emu/Cell/ErrorCodes.h" +#include "Emu/Memory/vm_ptr.h" +#include "util/BitField.h" +#include "util/atomic.hpp" +#include "util/types.hpp" -#include #include +#include enum { @@ -62,9 +62,12 @@ enum : s32 enum CellMsgDialogProgressBarIndex { - CELL_MSGDIALOG_PROGRESSBAR_INDEX_SINGLE = 0, // the only bar in a single bar dialog - CELL_MSGDIALOG_PROGRESSBAR_INDEX_DOUBLE_UPPER = 0, // the upper bar in a double bar dialog - CELL_MSGDIALOG_PROGRESSBAR_INDEX_DOUBLE_LOWER = 1, // the lower bar in a double bar dialog + CELL_MSGDIALOG_PROGRESSBAR_INDEX_SINGLE = + 0, // the only bar in a single bar dialog + CELL_MSGDIALOG_PROGRESSBAR_INDEX_DOUBLE_UPPER = + 0, // the upper bar in a double bar dialog + CELL_MSGDIALOG_PROGRESSBAR_INDEX_DOUBLE_LOWER = + 1, // the lower bar in a double bar dialog }; using CellMsgDialogCallback = void(s32 buttonType, vm::ptr userData); @@ -102,13 +105,20 @@ enum class msg_dialog_source }; void close_msg_dialog(); -error_code open_msg_dialog(bool is_blocking, u32 type, vm::cptr msgString, msg_dialog_source source, vm::ptr callback = vm::null, vm::ptr userData = vm::null, vm::ptr extParam = vm::null, s32* return_code = nullptr); -error_code open_exit_dialog(const std::string& message, bool is_exit_requested, msg_dialog_source source); +error_code open_msg_dialog(bool is_blocking, u32 type, vm::cptr msgString, + msg_dialog_source source, + vm::ptr callback = vm::null, + vm::ptr userData = vm::null, + vm::ptr extParam = vm::null, + s32* return_code = nullptr); +error_code open_exit_dialog(const std::string& message, bool is_exit_requested, + msg_dialog_source source); class MsgDialogBase { protected: - // the progressbar that will be represented in the taskbar. Use -1 to combine the progress. + // the progressbar that will be represented in the taskbar. Use -1 to combine + // the progress. s32 taskbar_index = 0; public: @@ -120,10 +130,12 @@ public: std::function on_close = nullptr; virtual ~MsgDialogBase(); - virtual void Create(const std::string& msg, const std::string& title = "") = 0; + virtual void Create(const std::string& msg, + const std::string& title = "") = 0; virtual void Close(bool success) = 0; virtual void SetMsg(const std::string& msg) = 0; - virtual void ProgressBarSetMsg(u32 progressBarIndex, const std::string& msg) = 0; + virtual void ProgressBarSetMsg(u32 progressBarIndex, + const std::string& msg) = 0; virtual void ProgressBarReset(u32 progressBarIndex) = 0; virtual void ProgressBarInc(u32 progressBarIndex, u32 delta) = 0; virtual void ProgressBarSetValue(u32 progressBarIndex, u32 value) = 0; diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellMusic.h b/ps3fw/include/rpcsx/fw/ps3/cellMusic.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellMusic.h rename to ps3fw/include/rpcsx/fw/ps3/cellMusic.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellMusicDecode.h b/ps3fw/include/rpcsx/fw/ps3/cellMusicDecode.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellMusicDecode.h rename to ps3fw/include/rpcsx/fw/ps3/cellMusicDecode.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellNetCtl.h b/ps3fw/include/rpcsx/fw/ps3/cellNetCtl.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellNetCtl.h rename to ps3fw/include/rpcsx/fw/ps3/cellNetCtl.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellOskDialog.h b/ps3fw/include/rpcsx/fw/ps3/cellOskDialog.h similarity index 75% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellOskDialog.h rename to ps3fw/include/rpcsx/fw/ps3/cellOskDialog.h index 2c69cce0f..ce4d0ab4d 100644 --- a/rpcs3/rpcs3/Emu/Cell/Modules/cellOskDialog.h +++ b/ps3fw/include/rpcsx/fw/ps3/cellOskDialog.h @@ -1,12 +1,12 @@ #pragma once -#include "util/types.hpp" +#include "Emu/Memory/vm_ptr.h" #include "util/atomic.hpp" #include "util/init_mutex.hpp" -#include "Utilities/mutex.h" -#include "Emu/Memory/vm_ptr.h" -#include +#include "util/mutex.h" +#include "util/types.hpp" #include +#include // error codes enum CellOskDialogError : u32 @@ -106,7 +106,8 @@ enum CellOskDialogType enum { - CELL_OSKDIALOG_STRING_SIZE = 512, // Theroretical maximum for osk input, games can specify a lower limit + CELL_OSKDIALOG_STRING_SIZE = 512, // Theroretical maximum for osk input, games + // can specify a lower limit }; enum @@ -241,13 +242,17 @@ struct CellOskDialogImeDictionaryInfo vm::bcptr dictionaryPath; }; -using cellOskDialogConfirmWordFilterCallback = int(vm::ptr pConfirmString, s32 wordLength); -using cellOskDialogHardwareKeyboardEventHookCallback = class b8(vm::ptr keyMessage, vm::ptr action, vm::ptr pActionInfo); +using cellOskDialogConfirmWordFilterCallback = int(vm::ptr pConfirmString, + s32 wordLength); +using cellOskDialogHardwareKeyboardEventHookCallback = + class b8(vm::ptr keyMessage, vm::ptr action, + vm::ptr pActionInfo); using cellOskDialogForceFinishCallback = class b8(); struct osk_window_layout { - u32 layout_mode = CELL_OSKDIALOG_LAYOUTMODE_X_ALIGN_LEFT | CELL_OSKDIALOG_LAYOUTMODE_Y_ALIGN_TOP; + u32 layout_mode = CELL_OSKDIALOG_LAYOUTMODE_X_ALIGN_LEFT | + CELL_OSKDIALOG_LAYOUTMODE_Y_ALIGN_TOP; u32 x_align = CELL_OSKDIALOG_LAYOUTMODE_X_ALIGN_LEFT; u32 y_align = CELL_OSKDIALOG_LAYOUTMODE_Y_ALIGN_TOP; f32 x_offset = 0.0f; @@ -255,7 +260,9 @@ struct osk_window_layout std::string to_string() const { - return fmt::format("{ layout_mode=0x%x, x_align=0x%x, y_align=0x%x, x_offset=%.2f, y_offset=%.2f }", layout_mode, x_align, y_align, x_offset, y_offset); + return fmt::format("{ layout_mode=0x%x, x_align=0x%x, y_align=0x%x, " + "x_offset=%.2f, y_offset=%.2f }", + layout_mode, x_align, y_align, x_offset, y_offset); } }; @@ -289,10 +296,11 @@ public: u32 support_language = 0; u32 first_view_panel = 0; osk_window_layout layout{}; - osk_window_layout input_layout{}; // Only used with separate windows - osk_window_layout panel_layout{}; // Only used with separate windows - u32 input_field_window_width = 0; // Only used with separate windows - f32 input_field_background_transparency = 1.0f; // Only used with separate windows + osk_window_layout input_layout{}; // Only used with separate windows + osk_window_layout panel_layout{}; // Only used with separate windows + u32 input_field_window_width = 0; // Only used with separate windows + f32 input_field_background_transparency = + 1.0f; // Only used with separate windows f32 initial_scale = 1.0f; color base_color{}; bool dimmer_enabled = false; @@ -306,24 +314,32 @@ public: virtual void SetText(const std::u16string& text) = 0; // Closes the dialog. - // Set status to CELL_OSKDIALOG_CLOSE_CONFIRM or CELL_OSKDIALOG_CLOSE_CANCEL for user input. - // Set status to -1 if closed by the game or system. - // Set status to -2 if terminated by the system. + // Set status to CELL_OSKDIALOG_CLOSE_CONFIRM or CELL_OSKDIALOG_CLOSE_CANCEL + // for user input. Set status to -1 if closed by the game or system. Set + // status to -2 if terminated by the system. virtual void Close(s32 status) = 0; virtual ~OskDialogBase() {}; std::function on_osk_close; - std::function on_osk_key_input_entered; + std::function + on_osk_key_input_entered; atomic_t state{OskDialogState::Unloaded}; - atomic_t continuous_mode{CELL_OSKDIALOG_CONTINUOUS_MODE_NONE}; - atomic_t input_device{CELL_OSKDIALOG_INPUT_DEVICE_PAD}; // The current input device. - atomic_t pad_input_enabled{true}; // Determines if the OSK consumes the device's input. - atomic_t mouse_input_enabled{true}; // Determines if the OSK consumes the device's input. - atomic_t keyboard_input_enabled{true}; // Determines if the OSK consumes the device's input. - atomic_t ignore_device_events{false}; // Determines if the OSK ignores device events. + atomic_t continuous_mode{ + CELL_OSKDIALOG_CONTINUOUS_MODE_NONE}; + atomic_t input_device{ + CELL_OSKDIALOG_INPUT_DEVICE_PAD}; // The current input device. + atomic_t pad_input_enabled{ + true}; // Determines if the OSK consumes the device's input. + atomic_t mouse_input_enabled{ + true}; // Determines if the OSK consumes the device's input. + atomic_t keyboard_input_enabled{ + true}; // Determines if the OSK consumes the device's input. + atomic_t ignore_device_events{ + false}; // Determines if the OSK ignores device events. - atomic_t osk_input_result{CellOskDialogInputFieldResult::CELL_OSKDIALOG_INPUT_FIELD_RESULT_OK}; + atomic_t osk_input_result{ + CellOskDialogInputFieldResult::CELL_OSKDIALOG_INPUT_FIELD_RESULT_OK}; std::array osk_text{}; }; @@ -331,27 +347,35 @@ struct osk_info { std::shared_ptr dlg; - std::array valid_text{}; // The string that's going to be served to the game. + std::array + valid_text{}; // The string that's going to be served to the game. shared_mutex text_mtx; atomic_t use_separate_windows = false; atomic_t lock_ext_input_device = false; - atomic_t device_mask = 0; // OSK ignores input from the specified devices. 0 means all devices can influence the OSK + atomic_t device_mask = + 0; // OSK ignores input from the specified devices. 0 means all devices + // can influence the OSK atomic_t input_field_window_width = 0; atomic_t input_field_background_transparency = 1.0f; osk_window_layout input_field_layout_info{}; osk_window_layout input_panel_layout_info{}; atomic_t key_layout_options = CELL_OSKDIALOG_10KEY_PANEL; - atomic_t initial_key_layout = CELL_OSKDIALOG_INITIAL_PANEL_LAYOUT_SYSTEM; // TODO: use - atomic_t initial_input_device = CELL_OSKDIALOG_INPUT_DEVICE_PAD; // OSK at first only receives input from the initial device + atomic_t initial_key_layout = + CELL_OSKDIALOG_INITIAL_PANEL_LAYOUT_SYSTEM; // TODO: use + atomic_t initial_input_device = + CELL_OSKDIALOG_INPUT_DEVICE_PAD; // OSK at first only receives input from + // the initial device atomic_t clipboard_enabled = false; // For copy and paste atomic_t half_byte_kana_enabled = false; - atomic_t supported_languages = 0; // Used to enable non-default languages in the OSK + atomic_t supported_languages = + 0; // Used to enable non-default languages in the OSK atomic_t dimmer_enabled = true; - atomic_t base_color = OskDialogBase::color{0.2f, 0.2f, 0.2f, 1.0f}; + atomic_t base_color = + OskDialogBase::color{0.2f, 0.2f, 0.2f, 1.0f}; atomic_t pointer_enabled = false; atomic_t pointer_x = 0.0f; @@ -360,12 +384,18 @@ struct osk_info osk_window_layout layout = {}; - atomic_t osk_continuous_mode = CELL_OSKDIALOG_CONTINUOUS_MODE_NONE; - atomic_t last_dialog_state = CELL_SYSUTIL_OSKDIALOG_UNLOADED; // Used for continuous seperate window dialog + atomic_t osk_continuous_mode = + CELL_OSKDIALOG_CONTINUOUS_MODE_NONE; + atomic_t last_dialog_state = + CELL_SYSUTIL_OSKDIALOG_UNLOADED; // Used for continuous seperate window + // dialog - atomic_t> osk_confirm_callback{}; - atomic_t> osk_force_finish_callback{}; - atomic_t> osk_hardware_keyboard_event_hook_callback{}; + atomic_t> + osk_confirm_callback{}; + atomic_t> + osk_force_finish_callback{}; + atomic_t> + osk_hardware_keyboard_event_hook_callback{}; atomic_t hook_event_mode{0}; stx::init_mutex init; diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellPad.h b/ps3fw/include/rpcsx/fw/ps3/cellPad.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellPad.h rename to ps3fw/include/rpcsx/fw/ps3/cellPad.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellPamf.h b/ps3fw/include/rpcsx/fw/ps3/cellPamf.h similarity index 99% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellPamf.h rename to ps3fw/include/rpcsx/fw/ps3/cellPamf.h index 3f5bfde82..dd36d4279 100644 --- a/rpcs3/rpcs3/Emu/Cell/Modules/cellPamf.h +++ b/ps3fw/include/rpcsx/fw/ps3/cellPamf.h @@ -1,7 +1,11 @@ #pragma once +#include "Emu/Cell/ErrorCodes.h" #include "Emu/Memory/vm_ptr.h" +#include +#include + // Error Codes enum CellPamfError : u32 { @@ -588,9 +592,6 @@ CHECK_SIZE(CellPamfReader, 128); error_code cellPamfReaderInitialize(vm::ptr pSelf, vm::cptr pAddr, u64 fileSize, u32 attribute); -#include -#include - extern const std::function SQUEUE_ALWAYS_EXIT; extern const std::function SQUEUE_NEVER_EXIT; diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellPng.h b/ps3fw/include/rpcsx/fw/ps3/cellPng.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellPng.h rename to ps3fw/include/rpcsx/fw/ps3/cellPng.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellPngDec.h b/ps3fw/include/rpcsx/fw/ps3/cellPngDec.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellPngDec.h rename to ps3fw/include/rpcsx/fw/ps3/cellPngDec.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellPngEnc.h b/ps3fw/include/rpcsx/fw/ps3/cellPngEnc.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellPngEnc.h rename to ps3fw/include/rpcsx/fw/ps3/cellPngEnc.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellRec.h b/ps3fw/include/rpcsx/fw/ps3/cellRec.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellRec.h rename to ps3fw/include/rpcsx/fw/ps3/cellRec.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellRemotePlay.h b/ps3fw/include/rpcsx/fw/ps3/cellRemotePlay.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellRemotePlay.h rename to ps3fw/include/rpcsx/fw/ps3/cellRemotePlay.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellResc.h b/ps3fw/include/rpcsx/fw/ps3/cellResc.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellResc.h rename to ps3fw/include/rpcsx/fw/ps3/cellResc.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellRtc.h b/ps3fw/include/rpcsx/fw/ps3/cellRtc.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellRtc.h rename to ps3fw/include/rpcsx/fw/ps3/cellRtc.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellRudp.h b/ps3fw/include/rpcsx/fw/ps3/cellRudp.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellRudp.h rename to ps3fw/include/rpcsx/fw/ps3/cellRudp.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellSail.h b/ps3fw/include/rpcsx/fw/ps3/cellSail.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellSail.h rename to ps3fw/include/rpcsx/fw/ps3/cellSail.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellSaveData.h b/ps3fw/include/rpcsx/fw/ps3/cellSaveData.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellSaveData.h rename to ps3fw/include/rpcsx/fw/ps3/cellSaveData.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellScreenshot.h b/ps3fw/include/rpcsx/fw/ps3/cellScreenshot.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellScreenshot.h rename to ps3fw/include/rpcsx/fw/ps3/cellScreenshot.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellSearch.h b/ps3fw/include/rpcsx/fw/ps3/cellSearch.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellSearch.h rename to ps3fw/include/rpcsx/fw/ps3/cellSearch.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellSpudll.h b/ps3fw/include/rpcsx/fw/ps3/cellSpudll.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellSpudll.h rename to ps3fw/include/rpcsx/fw/ps3/cellSpudll.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellSpurs.h b/ps3fw/include/rpcsx/fw/ps3/cellSpurs.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellSpurs.h rename to ps3fw/include/rpcsx/fw/ps3/cellSpurs.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellSpursJq.h b/ps3fw/include/rpcsx/fw/ps3/cellSpursJq.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellSpursJq.h rename to ps3fw/include/rpcsx/fw/ps3/cellSpursJq.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellSsl.h b/ps3fw/include/rpcsx/fw/ps3/cellSsl.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellSsl.h rename to ps3fw/include/rpcsx/fw/ps3/cellSsl.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellStorage.h b/ps3fw/include/rpcsx/fw/ps3/cellStorage.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellStorage.h rename to ps3fw/include/rpcsx/fw/ps3/cellStorage.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellSync.h b/ps3fw/include/rpcsx/fw/ps3/cellSync.h similarity index 98% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellSync.h rename to ps3fw/include/rpcsx/fw/ps3/cellSync.h index c4f0c6915..64b822717 100644 --- a/rpcs3/rpcs3/Emu/Cell/Modules/cellSync.h +++ b/ps3fw/include/rpcsx/fw/ps3/cellSync.h @@ -2,7 +2,7 @@ #include "Emu/Memory/vm_ptr.h" -#include "Utilities/BitField.h" +#include "util/BitField.h" #include "Emu/Cell/ErrorCodes.h" @@ -361,4 +361,6 @@ struct alignas(128) CellSyncLFQueue CHECK_SIZE_ALIGN(CellSyncLFQueue, 128, 128); // Prototypes -error_code cellSyncLFQueueInitialize(vm::ptr queue, vm::cptr buffer, u32 size, u32 depth, u32 direction, vm::ptr eaSignal); +error_code cellSyncLFQueueInitialize(vm::ptr queue, + vm::cptr buffer, u32 size, u32 depth, + u32 direction, vm::ptr eaSignal); diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellSync2.h b/ps3fw/include/rpcsx/fw/ps3/cellSync2.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellSync2.h rename to ps3fw/include/rpcsx/fw/ps3/cellSync2.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellSysconf.h b/ps3fw/include/rpcsx/fw/ps3/cellSysconf.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellSysconf.h rename to ps3fw/include/rpcsx/fw/ps3/cellSysconf.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellSysutil.h b/ps3fw/include/rpcsx/fw/ps3/cellSysutil.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellSysutil.h rename to ps3fw/include/rpcsx/fw/ps3/cellSysutil.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellSysutilAvc.h b/ps3fw/include/rpcsx/fw/ps3/cellSysutilAvc.h similarity index 99% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellSysutilAvc.h rename to ps3fw/include/rpcsx/fw/ps3/cellSysutilAvc.h index fdd742188..6105f3b4b 100644 --- a/rpcs3/rpcs3/Emu/Cell/Modules/cellSysutilAvc.h +++ b/ps3fw/include/rpcsx/fw/ps3/cellSysutilAvc.h @@ -1,6 +1,6 @@ #pragma once -#include "Emu/Cell/Modules/sceNp.h" +#include "sceNp.h" enum CellAvcError : u32 { diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellSysutilAvc2.h b/ps3fw/include/rpcsx/fw/ps3/cellSysutilAvc2.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellSysutilAvc2.h rename to ps3fw/include/rpcsx/fw/ps3/cellSysutilAvc2.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellUsbd.h b/ps3fw/include/rpcsx/fw/ps3/cellUsbd.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellUsbd.h rename to ps3fw/include/rpcsx/fw/ps3/cellUsbd.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellUserInfo.h b/ps3fw/include/rpcsx/fw/ps3/cellUserInfo.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellUserInfo.h rename to ps3fw/include/rpcsx/fw/ps3/cellUserInfo.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellVdec.h b/ps3fw/include/rpcsx/fw/ps3/cellVdec.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellVdec.h rename to ps3fw/include/rpcsx/fw/ps3/cellVdec.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellVideoOut.h b/ps3fw/include/rpcsx/fw/ps3/cellVideoOut.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellVideoOut.h rename to ps3fw/include/rpcsx/fw/ps3/cellVideoOut.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellVideoUpload.h b/ps3fw/include/rpcsx/fw/ps3/cellVideoUpload.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellVideoUpload.h rename to ps3fw/include/rpcsx/fw/ps3/cellVideoUpload.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellVoice.h b/ps3fw/include/rpcsx/fw/ps3/cellVoice.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellVoice.h rename to ps3fw/include/rpcsx/fw/ps3/cellVoice.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellVpost.h b/ps3fw/include/rpcsx/fw/ps3/cellVpost.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellVpost.h rename to ps3fw/include/rpcsx/fw/ps3/cellVpost.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/cellWebBrowser.h b/ps3fw/include/rpcsx/fw/ps3/cellWebBrowser.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/cellWebBrowser.h rename to ps3fw/include/rpcsx/fw/ps3/cellWebBrowser.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/libfs_utility_init.h b/ps3fw/include/rpcsx/fw/ps3/libfs_utility_init.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/libfs_utility_init.h rename to ps3fw/include/rpcsx/fw/ps3/libfs_utility_init.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/libmixer.h b/ps3fw/include/rpcsx/fw/ps3/libmixer.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/libmixer.h rename to ps3fw/include/rpcsx/fw/ps3/libmixer.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/libsnd3.h b/ps3fw/include/rpcsx/fw/ps3/libsnd3.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/libsnd3.h rename to ps3fw/include/rpcsx/fw/ps3/libsnd3.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/libsynth2.h b/ps3fw/include/rpcsx/fw/ps3/libsynth2.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/libsynth2.h rename to ps3fw/include/rpcsx/fw/ps3/libsynth2.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/sceNp.h b/ps3fw/include/rpcsx/fw/ps3/sceNp.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/sceNp.h rename to ps3fw/include/rpcsx/fw/ps3/sceNp.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/sceNp2.h b/ps3fw/include/rpcsx/fw/ps3/sceNp2.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/sceNp2.h rename to ps3fw/include/rpcsx/fw/ps3/sceNp2.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/sceNpClans.h b/ps3fw/include/rpcsx/fw/ps3/sceNpClans.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/sceNpClans.h rename to ps3fw/include/rpcsx/fw/ps3/sceNpClans.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/sceNpCommerce2.h b/ps3fw/include/rpcsx/fw/ps3/sceNpCommerce2.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/sceNpCommerce2.h rename to ps3fw/include/rpcsx/fw/ps3/sceNpCommerce2.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/sceNpPlus.h b/ps3fw/include/rpcsx/fw/ps3/sceNpPlus.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/sceNpPlus.h rename to ps3fw/include/rpcsx/fw/ps3/sceNpPlus.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/sceNpSns.h b/ps3fw/include/rpcsx/fw/ps3/sceNpSns.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/sceNpSns.h rename to ps3fw/include/rpcsx/fw/ps3/sceNpSns.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/sceNpTrophy.h b/ps3fw/include/rpcsx/fw/ps3/sceNpTrophy.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/sceNpTrophy.h rename to ps3fw/include/rpcsx/fw/ps3/sceNpTrophy.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/sceNpTus.h b/ps3fw/include/rpcsx/fw/ps3/sceNpTus.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/sceNpTus.h rename to ps3fw/include/rpcsx/fw/ps3/sceNpTus.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/sceNpUtil.h b/ps3fw/include/rpcsx/fw/ps3/sceNpUtil.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/sceNpUtil.h rename to ps3fw/include/rpcsx/fw/ps3/sceNpUtil.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/sysPrxForUser.h b/ps3fw/include/rpcsx/fw/ps3/sysPrxForUser.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/sysPrxForUser.h rename to ps3fw/include/rpcsx/fw/ps3/sysPrxForUser.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/sys_crashdump.h b/ps3fw/include/rpcsx/fw/ps3/sys_crashdump.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/sys_crashdump.h rename to ps3fw/include/rpcsx/fw/ps3/sys_crashdump.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/sys_lv2dbg.h b/ps3fw/include/rpcsx/fw/ps3/sys_lv2dbg.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/sys_lv2dbg.h rename to ps3fw/include/rpcsx/fw/ps3/sys_lv2dbg.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/sys_net_.h b/ps3fw/include/rpcsx/fw/ps3/sys_net_.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/sys_net_.h rename to ps3fw/include/rpcsx/fw/ps3/sys_net_.h diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/libad_async.cpp b/ps3fw/libad_async.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/libad_async.cpp rename to ps3fw/libad_async.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/libad_core.cpp b/ps3fw/libad_core.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/libad_core.cpp rename to ps3fw/libad_core.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/libfs_utility_init.cpp b/ps3fw/libfs_utility_init.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/libfs_utility_init.cpp rename to ps3fw/libfs_utility_init.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/libmedi.cpp b/ps3fw/libmedi.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/libmedi.cpp rename to ps3fw/libmedi.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/libmixer.cpp b/ps3fw/libmixer.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/libmixer.cpp rename to ps3fw/libmixer.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/libsnd3.cpp b/ps3fw/libsnd3.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/libsnd3.cpp rename to ps3fw/libsnd3.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/libsynth2.cpp b/ps3fw/libsynth2.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/libsynth2.cpp rename to ps3fw/libsynth2.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/sceNp.cpp b/ps3fw/sceNp.cpp similarity index 74% rename from rpcs3/rpcs3/Emu/Cell/Modules/sceNp.cpp rename to ps3fw/sceNp.cpp index 9294d295c..39b6a5de6 100644 --- a/rpcs3/rpcs3/Emu/Cell/Modules/sceNp.cpp +++ b/ps3fw/sceNp.cpp @@ -1,38 +1,40 @@ #include "stdafx.h" +#include "cellUserInfo.h" +#include "Emu/Cell/PPUModule.h" +#include "Emu/Io/interception.h" #include "Emu/System.h" #include "Emu/system_utils.hpp" -#include "Emu/Cell/PPUModule.h" -#include "Emu/Cell/Modules/cellUserInfo.h" -#include "Emu/Io/interception.h" -#include "Utilities/StrUtil.h" +#include "util/StrUtil.h" -#include "sysPrxForUser.h" -#include "Emu/IdManager.h" #include "Crypto/unedat.h" #include "Crypto/unself.h" +#include "Emu/IdManager.h" #include "cellRtc.h" -#include "sceNp.h" #include "cellSysutil.h" +#include "sceNp.h" +#include "sysPrxForUser.h" -#include "Emu/Cell/timers.hpp" -#include "Emu/Cell/lv2/sys_time.h" #include "Emu/Cell/lv2/sys_fs.h" #include "Emu/Cell/lv2/sys_sync.h" -#include "Emu/NP/np_handler.h" +#include "Emu/Cell/lv2/sys_time.h" +#include "Emu/Cell/timers.hpp" #include "Emu/NP/np_contexts.h" +#include "Emu/NP/np_handler.h" #include "Emu/NP/np_helpers.h" #include "Emu/NP/np_structs_extra.h" #include "Emu/NP/signaling_handler.h" #include "Emu/system_config.h" -#include "Emu/RSX/Overlays/overlay_manager.h" #include "Emu/RSX/Overlays/Network/overlay_recvmessage_dialog.h" #include "Emu/RSX/Overlays/Network/overlay_sendmessage_dialog.h" +#include "Emu/RSX/Overlays/overlay_manager.h" LOG_CHANNEL(sceNp); error_code sceNpManagerGetNpId(vm::ptr npId); -error_code sceNpCommerceGetCurrencyInfo(vm::ptr pc, vm::ptr info); +error_code +sceNpCommerceGetCurrencyInfo(vm::ptr pc, + vm::ptr info); error_code check_text(vm::cptr text); @@ -188,7 +190,8 @@ void fmt_class_string::format(std::string& out, u64 arg) STR_CASE(SCE_NP_COMMUNITY_SERVER_ERROR_NOT_BEST_SCORE); STR_CASE(SCE_NP_COMMUNITY_SERVER_ERROR_LATEST_UPDATE_NOT_FOUND); STR_CASE(SCE_NP_COMMUNITY_SERVER_ERROR_RANKING_BOARD_MASTER_NOT_FOUND); - STR_CASE(SCE_NP_COMMUNITY_SERVER_ERROR_RANKING_GAME_DATA_MASTER_NOT_FOUND); + STR_CASE( + SCE_NP_COMMUNITY_SERVER_ERROR_RANKING_GAME_DATA_MASTER_NOT_FOUND); STR_CASE(SCE_NP_COMMUNITY_SERVER_ERROR_INVALID_ANTICHEAT_DATA); STR_CASE(SCE_NP_COMMUNITY_SERVER_ERROR_TOO_LARGE_DATA); STR_CASE(SCE_NP_COMMUNITY_SERVER_ERROR_NO_SUCH_USER_NPID); @@ -207,7 +210,8 @@ void fmt_class_string::format(std::string& out, u64 arg) STR_CASE(SCE_NP_COMMUNITY_SERVER_ERROR_GAME_DATA_ALREADY_EXISTS); STR_CASE(SCE_NP_COMMUNITY_SERVER_ERROR_TOO_MANY_RESULTS); STR_CASE(SCE_NP_COMMUNITY_SERVER_ERROR_NOT_RECORDABLE_VERSION); - STR_CASE(SCE_NP_COMMUNITY_SERVER_ERROR_USER_STORAGE_TITLE_MASTER_NOT_FOUND); + STR_CASE( + SCE_NP_COMMUNITY_SERVER_ERROR_USER_STORAGE_TITLE_MASTER_NOT_FOUND); STR_CASE(SCE_NP_COMMUNITY_SERVER_ERROR_INVALID_VIRTUAL_USER); STR_CASE(SCE_NP_COMMUNITY_SERVER_ERROR_USER_STORAGE_DATA_NOT_FOUND); STR_CASE(SCE_NP_COMMUNITY_SERVER_ERROR_CONDITIONS_NOT_SATISFIED); @@ -569,7 +573,10 @@ void fmt_class_string::format(std::string& out, u64 arg) void message_data::print() const { - sceNp.notice("commId: %s, msgId: %d, mainType: %d, subType: %d, subject: %s, body: %s, data_size: %d", static_cast(commId.data), msgId, mainType, subType, subject, body, data.size()); + sceNp.notice("commId: %s, msgId: %d, mainType: %d, subType: %d, subject: %s, " + "body: %s, data_size: %d", + static_cast(commId.data), msgId, mainType, subType, + subject, body, data.size()); } extern void lv2_sleep(u64 timeout, ppu_thread* ppu = nullptr); @@ -629,7 +636,8 @@ error_code sceNpTerm() return CELL_OK; } -error_code npDrmIsAvailable(vm::cptr k_licensee_addr, vm::cptr drm_path) +error_code npDrmIsAvailable(vm::cptr k_licensee_addr, + vm::cptr drm_path) { if (!drm_path) { @@ -641,7 +649,8 @@ error_code npDrmIsAvailable(vm::cptr k_licensee_addr, vm::cptr drm_pat if (k_licensee_addr) { std::memcpy(&k_licensee, k_licensee_addr.get_ptr(), sizeof(k_licensee)); - sceNp.notice("npDrmIsAvailable(): KLicense key or KLIC=%s", std::bit_cast>(k_licensee)); + sceNp.notice("npDrmIsAvailable(): KLicense key or KLIC=%s", + std::bit_cast>(k_licensee)); } if (Emu.GetFakeCat() == "PE") @@ -651,13 +660,15 @@ error_code npDrmIsAvailable(vm::cptr k_licensee_addr, vm::cptr drm_pat } std::string enc_drm_path; - ensure(vm::read_string(drm_path.addr(), 0x100, enc_drm_path, true), "Secret access violation"); + ensure(vm::read_string(drm_path.addr(), 0x100, enc_drm_path, true), + "Secret access violation"); sceNp.warning("npDrmIsAvailable(): drm_path=\"%s\"", enc_drm_path); auto& npdrmkeys = g_fxo->get(); - const auto [fs_error, ppath, real_path, enc_file, type] = lv2_file::open(enc_drm_path, 0, 0); + const auto [fs_error, ppath, real_path, enc_file, type] = + lv2_file::open(enc_drm_path, 0, 0); if (fs_error) { @@ -674,13 +685,15 @@ error_code npDrmIsAvailable(vm::cptr k_licensee_addr, vm::cptr drm_pat if (!k_licensee_addr) k_licensee = get_default_self_klic(); - if (verify_npdrm_self_headers(enc_file, reinterpret_cast(&k_licensee))) + if (verify_npdrm_self_headers(enc_file, + reinterpret_cast(&k_licensee))) { npdrmkeys.install_decryption_key(k_licensee); } else { - sceNp.error(u8"npDrmIsAvailable(): Failed to verify sce file “%s”", enc_drm_path); + sceNp.error(u8"npDrmIsAvailable(): Failed to verify sce file “%s”", + enc_drm_path); return {SCE_NP_DRM_ERROR_NO_ENTITLEMENT, enc_drm_path}; } } @@ -690,7 +703,9 @@ error_code npDrmIsAvailable(vm::cptr k_licensee_addr, vm::cptr drm_pat NPD_HEADER npd; - if (VerifyEDATHeaderWithKLicense(enc_file, enc_drm_path, reinterpret_cast(&k_licensee), &npd)) + if (VerifyEDATHeaderWithKLicense(enc_file, enc_drm_path, + reinterpret_cast(&k_licensee), + &npd)) { // Check if RAP-free if (npd.license == 3) @@ -699,13 +714,16 @@ error_code npDrmIsAvailable(vm::cptr k_licensee_addr, vm::cptr drm_pat } else { - const std::string rap_file = rpcs3::utils::get_rap_file_path(npd.content_id); + const std::string rap_file = + rpcs3::utils::get_rap_file_path(npd.content_id); if (fs::file rap_fd{rap_file}) { if (rap_fd.size() < sizeof(u128)) { - sceNp.error("npDrmIsAvailable(): Rap file too small: '%s' (%d bytes)", rap_file, rap_fd.size()); + sceNp.error( + "npDrmIsAvailable(): Rap file too small: '%s' (%d bytes)", + rap_file, rap_fd.size()); return {SCE_NP_DRM_ERROR_BAD_FORMAT, enc_drm_path}; } @@ -713,29 +731,35 @@ error_code npDrmIsAvailable(vm::cptr k_licensee_addr, vm::cptr drm_pat } else { - sceNp.error("npDrmIsAvailable(): Rap file not found: '%s' (%s)", rap_file, fs::g_tls_error); + sceNp.error("npDrmIsAvailable(): Rap file not found: '%s' (%s)", + rap_file, fs::g_tls_error); return {SCE_NP_DRM_ERROR_LICENSE_NOT_FOUND, enc_drm_path}; } } } else { - sceNp.error(u8"npDrmIsAvailable(): Failed to verify npd file “%s”", enc_drm_path); + sceNp.error(u8"npDrmIsAvailable(): Failed to verify npd file “%s”", + enc_drm_path); return {SCE_NP_DRM_ERROR_NO_ENTITLEMENT, enc_drm_path}; } } else { // for now assume its just unencrypted - sceNp.notice(u8"npDrmIsAvailable(): Assuming npdrm file is unencrypted at “%s”", enc_drm_path); + sceNp.notice( + u8"npDrmIsAvailable(): Assuming npdrm file is unencrypted at “%s”", + enc_drm_path); } return CELL_OK; } -error_code sceNpDrmIsAvailable(ppu_thread& ppu, vm::cptr k_licensee_addr, vm::cptr drm_path) +error_code sceNpDrmIsAvailable(ppu_thread& ppu, vm::cptr k_licensee_addr, + vm::cptr drm_path) { - sceNp.warning("sceNpDrmIsAvailable(k_licensee=*0x%x, drm_path=*0x%x)", k_licensee_addr, drm_path); + sceNp.warning("sceNpDrmIsAvailable(k_licensee=*0x%x, drm_path=*0x%x)", + k_licensee_addr, drm_path); if (!drm_path) { @@ -750,9 +774,11 @@ error_code sceNpDrmIsAvailable(ppu_thread& ppu, vm::cptr k_licensee_addr, vm return ret; } -error_code sceNpDrmIsAvailable2(ppu_thread& ppu, vm::cptr k_licensee_addr, vm::cptr drm_path) +error_code sceNpDrmIsAvailable2(ppu_thread& ppu, vm::cptr k_licensee_addr, + vm::cptr drm_path) { - sceNp.warning("sceNpDrmIsAvailable2(k_licensee=*0x%x, drm_path=*0x%x)", k_licensee_addr, drm_path); + sceNp.warning("sceNpDrmIsAvailable2(k_licensee=*0x%x, drm_path=*0x%x)", + k_licensee_addr, drm_path); if (!drm_path) { @@ -777,7 +803,8 @@ error_code npDrmVerifyUpgradeLicense(vm::cptr content_id) } std::string content_str; - ensure(vm::read_string(content_id.addr(), 0x2f, content_str, true), "Secret access violation"); + ensure(vm::read_string(content_id.addr(), 0x2f, content_str, true), + "Secret access violation"); sceNp.warning("npDrmVerifyUpgradeLicense(): content_id=%s", content_str); @@ -806,17 +833,20 @@ error_code sceNpDrmExecuteGamePurchase() sceNp.todo("sceNpDrmExecuteGamePurchase()"); // TODO: - // 0. Check if the game can be purchased (return GAME_ERR_NOT_XMBBUY_CONTENT otherwise) + // 0. Check if the game can be purchased (return GAME_ERR_NOT_XMBBUY_CONTENT + // otherwise) // 1. Send game termination request // 2. "Buy game" transaction (a.k.a. do nothing for now) - // 3. Reboot game with CELL_GAME_ATTRIBUTE_XMBBUY attribute set (cellGameBootCheck) + // 3. Reboot game with CELL_GAME_ATTRIBUTE_XMBBUY attribute set + // (cellGameBootCheck) return CELL_OK; } error_code sceNpDrmGetTimelimit(vm::cptr path, vm::ptr time_remain) { - sceNp.warning("sceNpDrmGetTimelimit(path=%s, time_remain=*0x%x)", path, time_remain); + sceNp.warning("sceNpDrmGetTimelimit(path=%s, time_remain=*0x%x)", path, + time_remain); if (!path || !time_remain) { @@ -834,9 +864,11 @@ error_code sceNpDrmGetTimelimit(vm::cptr path, vm::ptr time_remain) } std::string enc_drm_path; - ensure(vm::read_string(path.addr(), 0x100, enc_drm_path, true), "Secret access violation"); + ensure(vm::read_string(path.addr(), 0x100, enc_drm_path, true), + "Secret access violation"); - const auto [fs_error, ppath, real_path, enc_file, type] = lv2_file::open(enc_drm_path, 0, 0); + const auto [fs_error, ppath, real_path, enc_file, type] = + lv2_file::open(enc_drm_path, 0, 0); if (fs_error) { @@ -849,12 +881,15 @@ error_code sceNpDrmGetTimelimit(vm::cptr path, vm::ptr time_remain) enc_file.read(magic); enc_file.seek(0); - // Read expiration time from NPD header which is Unix timestamp in milliseconds + // Read expiration time from NPD header which is Unix timestamp in + // milliseconds if (magic == "SCE\0"_u32) { if (!get_npdrm_self_header(enc_file, npd)) { - sceNp.error("sceNpDrmGetTimelimit(): Failed to read NPD header from sce file '%s'", enc_drm_path); + sceNp.error("sceNpDrmGetTimelimit(): Failed to read NPD header from sce " + "file '%s'", + enc_drm_path); return {SCE_NP_DRM_ERROR_BAD_FORMAT, enc_drm_path}; } } @@ -894,22 +929,35 @@ error_code sceNpDrmGetTimelimit(vm::cptr path, vm::ptr time_remain) return CELL_OK; } -error_code sceNpDrmProcessExitSpawn(ppu_thread& ppu, vm::cptr klicensee, vm::cptr path, vm::cpptr argv, vm::cpptr envp, u32 data, u32 data_size, s32 prio, u64 flags) +error_code sceNpDrmProcessExitSpawn(ppu_thread& ppu, vm::cptr klicensee, + vm::cptr path, vm::cpptr argv, + vm::cpptr envp, u32 data, + u32 data_size, s32 prio, u64 flags) { - sceNp.warning("sceNpDrmProcessExitSpawn(klicensee=*0x%x, path=*0x%x, argv=**0x%x, envp=**0x%x, data=*0x%x, data_size=0x%x, prio=%d, flags=0x%x)", klicensee, path, argv, envp, data, data_size, prio, flags); + sceNp.warning( + "sceNpDrmProcessExitSpawn(klicensee=*0x%x, path=*0x%x, argv=**0x%x, " + "envp=**0x%x, data=*0x%x, data_size=0x%x, prio=%d, flags=0x%x)", + klicensee, path, argv, envp, data, data_size, prio, flags); if (s32 error = npDrmIsAvailable(klicensee, path)) { return error; } - ppu_execute<&sys_game_process_exitspawn>(ppu, path, argv, envp, data, data_size, prio, flags); + ppu_execute<&sys_game_process_exitspawn>(ppu, path, argv, envp, data, + data_size, prio, flags); return CELL_OK; } -error_code sceNpDrmProcessExitSpawn2(ppu_thread& ppu, vm::cptr klicensee, vm::cptr path, vm::cpptr argv, vm::cpptr envp, u32 data, u32 data_size, s32 prio, u64 flags) +error_code sceNpDrmProcessExitSpawn2(ppu_thread& ppu, vm::cptr klicensee, + vm::cptr path, vm::cpptr argv, + vm::cpptr envp, u32 data, + u32 data_size, s32 prio, u64 flags) { - sceNp.warning("sceNpDrmProcessExitSpawn2(klicensee=*0x%x, path=*0x%x, argv=**0x%x, envp=**0x%x, data=*0x%x, data_size=0x%x, prio=%d, flags=0x%x)", klicensee, path, argv, envp, data, data_size, prio, flags); + sceNp.warning( + "sceNpDrmProcessExitSpawn2(klicensee=*0x%x, path=*0x%x, argv=**0x%x, " + "envp=**0x%x, data=*0x%x, data_size=0x%x, prio=%d, flags=0x%x)", + klicensee, path, argv, envp, data, data_size, prio, flags); if (s32 error = npDrmIsAvailable(klicensee, path)) { @@ -917,13 +965,18 @@ error_code sceNpDrmProcessExitSpawn2(ppu_thread& ppu, vm::cptr klicensee, vm } // TODO: check if SCE_NP_DRM_EXITSPAWN2_EXIT_WO_FINI logic is implemented - ppu_execute<&sys_game_process_exitspawn2>(ppu, path, argv, envp, data, data_size, prio, flags); + ppu_execute<&sys_game_process_exitspawn2>(ppu, path, argv, envp, data, + data_size, prio, flags); return CELL_OK; } -error_code sceNpBasicRegisterHandler(vm::cptr context, vm::ptr handler, vm::ptr arg) +error_code sceNpBasicRegisterHandler(vm::cptr context, + vm::ptr handler, + vm::ptr arg) { - sceNp.warning("sceNpBasicRegisterHandler(context=*0x%x(%s), handler=*0x%x, arg=*0x%x)", context, context ? context->data : "", handler, arg); + sceNp.warning( + "sceNpBasicRegisterHandler(context=*0x%x(%s), handler=*0x%x, arg=*0x%x)", + context, context ? context->data : "", handler, arg); auto& nph = g_fxo->get>(); @@ -947,9 +1000,13 @@ error_code sceNpBasicRegisterHandler(vm::cptr context, vm: return CELL_OK; } -error_code sceNpBasicRegisterContextSensitiveHandler(vm::cptr context, vm::ptr handler, vm::ptr arg) +error_code sceNpBasicRegisterContextSensitiveHandler( + vm::cptr context, + vm::ptr handler, vm::ptr arg) { - sceNp.notice("sceNpBasicRegisterContextSensitiveHandler(context=*0x%x(%s), handler=*0x%x, arg=*0x%x)", context, context ? context->data : "", handler, arg); + sceNp.notice("sceNpBasicRegisterContextSensitiveHandler(context=*0x%x(%s), " + "handler=*0x%x, arg=*0x%x)", + context, context ? context->data : "", handler, arg); auto& nph = g_fxo->get>(); @@ -1024,9 +1081,12 @@ error_code sceNpBasicSetPresence(vm::cptr data, u32 size) return CELL_OK; } -error_code sceNpBasicSetPresenceDetails(vm::cptr pres, u32 options) +error_code +sceNpBasicSetPresenceDetails(vm::cptr pres, + u32 options) { - sceNp.warning("sceNpBasicSetPresenceDetails(pres=*0x%x, options=0x%x)", pres, options); + sceNp.warning("sceNpBasicSetPresenceDetails(pres=*0x%x, options=0x%x)", pres, + options); auto& nph = g_fxo->get>(); @@ -1040,7 +1100,8 @@ error_code sceNpBasicSetPresenceDetails(vm::cptr pres return SCE_NP_BASIC_ERROR_NOT_REGISTERED; } - if (options < SCE_NP_BASIC_PRESENCE_OPTIONS_SET_DATA || options > SCE_NP_BASIC_PRESENCE_OPTIONS_ALL_OPTIONS) + if (options < SCE_NP_BASIC_PRESENCE_OPTIONS_SET_DATA || + options > SCE_NP_BASIC_PRESENCE_OPTIONS_ALL_OPTIONS) { return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT; } @@ -1056,7 +1117,8 @@ error_code sceNpBasicSetPresenceDetails(vm::cptr pres std::optional pr_status; if (options & SCE_NP_BASIC_PRESENCE_OPTIONS_SET_STATUS) { - pr_status = std::optional(std::string(reinterpret_cast(&pres->status[0]))); + pr_status = std::optional( + std::string(reinterpret_cast(&pres->status[0]))); } std::optional> pr_data; @@ -1071,9 +1133,12 @@ error_code sceNpBasicSetPresenceDetails(vm::cptr pres return CELL_OK; } -error_code sceNpBasicSetPresenceDetails2(vm::cptr pres, u32 options) +error_code +sceNpBasicSetPresenceDetails2(vm::cptr pres, + u32 options) { - sceNp.warning("sceNpBasicSetPresenceDetails2(pres=*0x%x, options=0x%x)", pres, options); + sceNp.warning("sceNpBasicSetPresenceDetails2(pres=*0x%x, options=0x%x)", pres, + options); auto& nph = g_fxo->get>(); @@ -1087,7 +1152,9 @@ error_code sceNpBasicSetPresenceDetails2(vm::cptr pr return SCE_NP_BASIC_ERROR_NOT_REGISTERED; } - if (options < SCE_NP_BASIC_PRESENCE_OPTIONS_SET_DATA || options > SCE_NP_BASIC_PRESENCE_OPTIONS_ALL_OPTIONS || pres->struct_size != sizeof(SceNpBasicPresenceDetails2)) + if (options < SCE_NP_BASIC_PRESENCE_OPTIONS_SET_DATA || + options > SCE_NP_BASIC_PRESENCE_OPTIONS_ALL_OPTIONS || + pres->struct_size != sizeof(SceNpBasicPresenceDetails2)) { return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT; } @@ -1103,7 +1170,8 @@ error_code sceNpBasicSetPresenceDetails2(vm::cptr pr std::optional pr_status; if (options & SCE_NP_BASIC_PRESENCE_OPTIONS_SET_STATUS) { - pr_status = std::optional(std::string(reinterpret_cast(&pres->status[0]))); + pr_status = std::optional( + std::string(reinterpret_cast(&pres->status[0]))); } std::optional> pr_data; @@ -1118,9 +1186,11 @@ error_code sceNpBasicSetPresenceDetails2(vm::cptr pr return CELL_OK; } -error_code sceNpBasicSendMessage(vm::cptr to, vm::cptr data, u32 size) +error_code sceNpBasicSendMessage(vm::cptr to, vm::cptr data, + u32 size) { - sceNp.warning("sceNpBasicSendMessage(to=*0x%x, data=*0x%x, size=%d)", to, data, size); + sceNp.warning("sceNpBasicSendMessage(to=*0x%x, data=*0x%x, size=%d)", to, + data, size); auto& nph = g_fxo->get>(); @@ -1155,7 +1225,8 @@ error_code sceNpBasicSendMessage(vm::cptr to, vm::cptr data, u32 .mainType = SCE_NP_BASIC_MESSAGE_MAIN_TYPE_GENERAL, .subType = SCE_NP_BASIC_MESSAGE_GENERAL_SUBTYPE_NONE, .msgFeatures = {}, - .data = std::vector(static_cast(data.get_ptr()), static_cast(data.get_ptr()) + size)}; + .data = std::vector(static_cast(data.get_ptr()), + static_cast(data.get_ptr()) + size)}; std::set npids; npids.insert(std::string(to->handle.data)); @@ -1164,16 +1235,23 @@ error_code sceNpBasicSendMessage(vm::cptr to, vm::cptr data, u32 return CELL_OK; } -error_code sceNpBasicSendMessageGui(ppu_thread& ppu, vm::cptr msg, sys_memory_container_t containerId) +error_code sceNpBasicSendMessageGui(ppu_thread& ppu, + vm::cptr msg, + sys_memory_container_t containerId) { - sceNp.warning("sceNpBasicSendMessageGui(msg=*0x%x, containerId=%d)", msg, containerId); + sceNp.warning("sceNpBasicSendMessageGui(msg=*0x%x, containerId=%d)", msg, + containerId); if (msg) { - sceNp.notice("sceNpBasicSendMessageGui: msgId: %d, mainType: %d, subType: %d, msgFeatures: %d, count: %d, npids: *0x%x", msg->msgId, msg->mainType, msg->subType, msg->msgFeatures, msg->count, msg->npids); + sceNp.notice("sceNpBasicSendMessageGui: msgId: %d, mainType: %d, subType: " + "%d, msgFeatures: %d, count: %d, npids: *0x%x", + msg->msgId, msg->mainType, msg->subType, msg->msgFeatures, + msg->count, msg->npids); for (u32 i = 0; i < msg->count && msg->npids; i++) { - sceNp.trace("sceNpBasicSendMessageGui: NpId[%d] = %s", i, static_cast(&msg->npids[i].handle.data[0])); + sceNp.trace("sceNpBasicSendMessageGui: NpId[%d] = %s", i, + static_cast(&msg->npids[i].handle.data[0])); } sceNp.notice("sceNpBasicSendMessageGui: subject: %s", msg->subject); sceNp.notice("sceNpBasicSendMessageGui: body: %s", msg->body); @@ -1191,8 +1269,10 @@ error_code sceNpBasicSendMessageGui(ppu_thread& ppu, vm::cptrcount > SCE_NP_BASIC_SEND_MESSAGE_MAX_RECIPIENTS || (msg->msgFeatures & ~SCE_NP_BASIC_MESSAGE_FEATURES_ALL_FEATURES) || - msg->mainType > SCE_NP_BASIC_MESSAGE_MAIN_TYPE_URL_ATTACHMENT || msg->msgId != 0ull) + if (!msg || msg->count > SCE_NP_BASIC_SEND_MESSAGE_MAX_RECIPIENTS || + (msg->msgFeatures & ~SCE_NP_BASIC_MESSAGE_FEATURES_ALL_FEATURES) || + msg->mainType > SCE_NP_BASIC_MESSAGE_MAIN_TYPE_URL_ATTACHMENT || + msg->msgId != 0ull) { return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT; } @@ -1202,7 +1282,8 @@ error_code sceNpBasicSendMessageGui(ppu_thread& ppu, vm::cptrmainType) { case SCE_NP_BASIC_MESSAGE_MAIN_TYPE_DATA_ATTACHMENT: - if (msg->subType != SCE_NP_BASIC_MESSAGE_DATA_ATTACHMENT_SUBTYPE_ACTION_USE) + if (msg->subType != + SCE_NP_BASIC_MESSAGE_DATA_ATTACHMENT_SUBTYPE_ACTION_USE) return SCE_NP_BASIC_ERROR_NOT_SUPPORTED; break; case SCE_NP_BASIC_MESSAGE_MAIN_TYPE_CUSTOM_DATA: @@ -1210,12 +1291,14 @@ error_code sceNpBasicSendMessageGui(ppu_thread& ppu, vm::cptrsubType != SCE_NP_BASIC_MESSAGE_URL_ATTACHMENT_SUBTYPE_ACTION_USE) + if (msg->subType != + SCE_NP_BASIC_MESSAGE_URL_ATTACHMENT_SUBTYPE_ACTION_USE) return SCE_NP_BASIC_ERROR_NOT_SUPPORTED; break; case SCE_NP_BASIC_MESSAGE_MAIN_TYPE_GENERAL: case SCE_NP_BASIC_MESSAGE_MAIN_TYPE_ADD_FRIEND: - if (msg->subType != 0) // SCE_NP_BASIC_MESSAGE_GENERAL_SUBTYPE_NONE, SCE_NP_BASIC_MESSAGE_ADD_FRIEND_SUBTYPE_NONE + if (msg->subType != 0) // SCE_NP_BASIC_MESSAGE_GENERAL_SUBTYPE_NONE, + // SCE_NP_BASIC_MESSAGE_ADD_FRIEND_SUBTYPE_NONE return SCE_NP_BASIC_ERROR_NOT_SUPPORTED; if (msg->data) return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT; @@ -1252,7 +1335,8 @@ error_code sceNpBasicSendMessageGui(ppu_thread& ppu, vm::cptrcount > SCE_NP_BASIC_SEND_MESSAGE_MAX_RECIPIENTS) return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT; - if (msg->mainType == SCE_NP_BASIC_MESSAGE_MAIN_TYPE_ADD_FRIEND && msg->count != 1u) + if (msg->mainType == SCE_NP_BASIC_MESSAGE_MAIN_TYPE_ADD_FRIEND && + msg->count != 1u) return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT; if (msg->npids) @@ -1321,7 +1405,8 @@ error_code sceNpBasicSendMessageGui(ppu_thread& ppu, vm::cptrcount || !length_body) return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT; - if (msg->mainType != SCE_NP_BASIC_MESSAGE_MAIN_TYPE_ADD_FRIEND && !length_subject) + if (msg->mainType != SCE_NP_BASIC_MESSAGE_MAIN_TYPE_ADD_FRIEND && + !length_subject) return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT; } @@ -1331,8 +1416,7 @@ error_code sceNpBasicSendMessageGui(ppu_thread& ppu, vm::cptrmsgId, .mainType = msg->mainType, .subType = msg->subType, @@ -1362,7 +1446,8 @@ error_code sceNpBasicSendMessageGui(ppu_thread& ppu, vm::cptrdata.get_ptr(), msg->data.get_ptr() + msg->size); } - sceNp.trace("Message Data:\n%s", fmt::buf_to_hexstring(msg->data.get_ptr(), msg->size)); + sceNp.trace("Message Data:\n%s", + fmt::buf_to_hexstring(msg->data.get_ptr(), msg->size)); error_code result = CELL_CANCEL; @@ -1377,7 +1462,8 @@ error_code sceNpBasicSendMessageGui(ppu_thread& ppu, vm::cptrExec(msg_data, npids); @@ -1416,9 +1502,16 @@ error_code sceNpBasicSendMessageGui(ppu_thread& ppu, vm::cptr to, vm::cptr subject, vm::cptr body, vm::cptr data, u32 size, sys_memory_container_t containerId) +error_code sceNpBasicSendMessageAttachment(ppu_thread& ppu, + vm::cptr to, + vm::cptr subject, + vm::cptr body, + vm::cptr data, u32 size, + sys_memory_container_t containerId) { - sceNp.warning("sceNpBasicSendMessageAttachment(to=*0x%x, subject=%s, body=%s, data=%s, size=%d, containerId=%d)", to, subject, body, data, size, containerId); + sceNp.warning("sceNpBasicSendMessageAttachment(to=*0x%x, subject=%s, " + "body=%s, data=%s, size=%d, containerId=%d)", + to, subject, body, data, size, containerId); vm::var msg; msg->msgId = 0; @@ -1437,7 +1530,8 @@ error_code sceNpBasicSendMessageAttachment(ppu_thread& ppu, vm::cptr to error_code recv_message_gui(ppu_thread& ppu, u16 mainType, u32 recvOptions); -error_code sceNpBasicRecvMessageAttachment(ppu_thread& ppu, sys_memory_container_t containerId) +error_code sceNpBasicRecvMessageAttachment(ppu_thread& ppu, + sys_memory_container_t containerId) { sceNp.warning("sceNpBasicRecvMessageAttachment(containerId=%d)", containerId); @@ -1459,9 +1553,13 @@ error_code sceNpBasicRecvMessageAttachment(ppu_thread& ppu, sys_memory_container return recv_message_gui(ppu, main_type, options); } -error_code sceNpBasicRecvMessageAttachmentLoad(SceNpBasicAttachmentDataId id, vm::ptr buffer, vm::ptr size) +error_code sceNpBasicRecvMessageAttachmentLoad(SceNpBasicAttachmentDataId id, + vm::ptr buffer, + vm::ptr size) { - sceNp.warning("sceNpBasicRecvMessageAttachmentLoad(id=%d, buffer=*0x%x, size=*0x%x)", id, buffer, size); + sceNp.warning( + "sceNpBasicRecvMessageAttachmentLoad(id=%d, buffer=*0x%x, size=*0x%x)", + id, buffer, size); auto& nph = g_fxo->get>(); @@ -1480,7 +1578,8 @@ error_code sceNpBasicRecvMessageAttachmentLoad(SceNpBasicAttachmentDataId id, vm return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT; } - if (id != SCE_NP_BASIC_SELECTED_INVITATION_DATA && id != SCE_NP_BASIC_SELECTED_MESSAGE_DATA) + if (id != SCE_NP_BASIC_SELECTED_INVITATION_DATA && + id != SCE_NP_BASIC_SELECTED_MESSAGE_DATA) { return SCE_NP_BASIC_ERROR_INVALID_DATA_ID; } @@ -1498,10 +1597,13 @@ error_code sceNpBasicRecvMessageAttachmentLoad(SceNpBasicAttachmentDataId id, vm const auto msg = msg_pair->second; const u32 orig_size = *size; - const u32 size_to_copy = std::min(static_cast(msg.data.size()), orig_size); + const u32 size_to_copy = + std::min(static_cast(msg.data.size()), orig_size); memcpy(buffer.get_ptr(), msg.data.data(), size_to_copy); - sceNp.trace("Message Data received:\n%s", fmt::buf_to_hexstring(static_cast(buffer.get_ptr()), size_to_copy)); + sceNp.trace( + "Message Data received:\n%s", + fmt::buf_to_hexstring(static_cast(buffer.get_ptr()), size_to_copy)); *size = size_to_copy; if (size_to_copy < msg.data.size()) @@ -1512,9 +1614,13 @@ error_code sceNpBasicRecvMessageAttachmentLoad(SceNpBasicAttachmentDataId id, vm return CELL_OK; } -error_code sceNpBasicRecvMessageCustom(ppu_thread& ppu, u16 mainType, u32 recvOptions, sys_memory_container_t containerId) +error_code sceNpBasicRecvMessageCustom(ppu_thread& ppu, u16 mainType, + u32 recvOptions, + sys_memory_container_t containerId) { - sceNp.warning("sceNpBasicRecvMessageCustom(mainType=%d, recvOptions=%d, containerId=%d)", mainType, recvOptions, containerId); + sceNp.warning("sceNpBasicRecvMessageCustom(mainType=%d, recvOptions=%d, " + "containerId=%d)", + mainType, recvOptions, containerId); auto& nph = g_fxo->get>(); @@ -1528,7 +1634,8 @@ error_code sceNpBasicRecvMessageCustom(ppu_thread& ppu, u16 mainType, u32 recvOp return SCE_NP_BASIC_ERROR_NOT_REGISTERED; } - if (mainType != SCE_NP_BASIC_MESSAGE_MAIN_TYPE_INVITE && mainType != SCE_NP_BASIC_MESSAGE_MAIN_TYPE_CUSTOM_DATA) + if (mainType != SCE_NP_BASIC_MESSAGE_MAIN_TYPE_INVITE && + mainType != SCE_NP_BASIC_MESSAGE_MAIN_TYPE_CUSTOM_DATA) { return SCE_NP_BASIC_ERROR_NOT_SUPPORTED; } @@ -1555,16 +1662,23 @@ error_code recv_message_gui(ppu_thread& ppu, u16 mainType, u32 recvOptions) if (auto manager = g_fxo->try_get()) { auto recv_dlg = manager->create(); - result = recv_dlg->Exec(static_cast(mainType), static_cast(recvOptions), recv_result, chosen_msg_id); + result = + recv_dlg->Exec(static_cast(mainType), + static_cast(recvOptions), + recv_result, chosen_msg_id); } else { input::SetIntercepted(true); - Emu.BlockingCallFromMainThread([=, &result, &recv_result, &chosen_msg_id]() + Emu.BlockingCallFromMainThread([=, &result, &recv_result, + &chosen_msg_id]() { auto recv_dlg = Emu.GetCallbacks().get_recvmessage_dialog(); - result = recv_dlg->Exec(static_cast(mainType), static_cast(recvOptions), recv_result, chosen_msg_id); + result = + recv_dlg->Exec(static_cast(mainType), + static_cast(recvOptions), + recv_result, chosen_msg_id); }); input::SetIntercepted(false); @@ -1579,7 +1693,9 @@ error_code recv_message_gui(ppu_thread& ppu, u16 mainType, u32 recvOptions) if (!opt_msg) { - sceNp.fatal("sceNpBasicRecvMessageCustom: message is invalid: chosen_msg_id=%d", chosen_msg_id); + sceNp.fatal( + "sceNpBasicRecvMessageCustom: message is invalid: chosen_msg_id=%d", + chosen_msg_id); return SCE_NP_BASIC_ERROR_CANCEL; } @@ -1616,7 +1732,8 @@ error_code recv_message_gui(ppu_thread& ppu, u16 mainType, u32 recvOptions) if (mainType == SCE_NP_BASIC_MESSAGE_MAIN_TYPE_DATA_ATTACHMENT) { to_add.data.resize(sizeof(SceNpBasicAttachmentData)); - SceNpBasicAttachmentData* att_data = reinterpret_cast(to_add.data.data()); + SceNpBasicAttachmentData* att_data = + reinterpret_cast(to_add.data.data()); *att_data = data; extra_nps::print_SceNpBasicAttachmentData(att_data); @@ -1624,19 +1741,23 @@ error_code recv_message_gui(ppu_thread& ppu, u16 mainType, u32 recvOptions) else { to_add.data.resize(sizeof(SceNpBasicExtendedAttachmentData)); - SceNpBasicExtendedAttachmentData* att_data = reinterpret_cast(to_add.data.data()); + SceNpBasicExtendedAttachmentData* att_data = + reinterpret_cast( + to_add.data.data()); att_data->flags = 0; // ? att_data->msgId = chosen_msg_id; att_data->data = data; att_data->userAction = recv_result; - att_data->markedAsUsed = (recvOptions & SCE_NP_BASIC_RECV_MESSAGE_OPTIONS_PRESERVE) ? 0 : 1; + att_data->markedAsUsed = + (recvOptions & SCE_NP_BASIC_RECV_MESSAGE_OPTIONS_PRESERVE) ? 0 : 1; extra_nps::print_SceNpBasicExtendedAttachmentData(att_data); } nph.set_message_selected(data.id, chosen_msg_id); - // Is this sent if used from home menu but not from sceNpBasicRecvMessageCustom, not sure + // Is this sent if used from home menu but not from + // sceNpBasicRecvMessageCustom, not sure // sysutil_send_system_cmd(CELL_SYSUTIL_NP_INVITATION_SELECTED, 0); nph.queue_basic_event(to_add); @@ -1690,9 +1811,12 @@ error_code sceNpBasicAbortGui() return CELL_OK; } -error_code sceNpBasicAddFriend(ppu_thread& ppu, vm::cptr contact, vm::cptr body, sys_memory_container_t containerId) +error_code sceNpBasicAddFriend(ppu_thread& ppu, vm::cptr contact, + vm::cptr body, + sys_memory_container_t containerId) { - sceNp.warning("sceNpBasicAddFriend(contact=*0x%x, body=%s, containerId=%d)", contact, body, containerId); + sceNp.warning("sceNpBasicAddFriend(contact=*0x%x, body=%s, containerId=%d)", + contact, body, containerId); vm::var msg; msg->msgId = 0; @@ -1738,7 +1862,8 @@ error_code sceNpBasicGetFriendListEntryCount(vm::ptr count) error_code sceNpBasicGetFriendListEntry(u32 index, vm::ptr npid) { - sceNp.trace("sceNpBasicGetFriendListEntry(index=%d, npid=*0x%x)", index, npid); + sceNp.trace("sceNpBasicGetFriendListEntry(index=%d, npid=*0x%x)", index, + npid); auto& nph = g_fxo->get>(); @@ -1770,9 +1895,14 @@ error_code sceNpBasicGetFriendListEntry(u32 index, vm::ptr npid) return CELL_OK; } -error_code sceNpBasicGetFriendPresenceByIndex(u32 index, vm::ptr user, vm::ptr pres, u32 options) +error_code +sceNpBasicGetFriendPresenceByIndex(u32 index, vm::ptr user, + vm::ptr pres, + u32 options) { - sceNp.warning("sceNpBasicGetFriendPresenceByIndex(index=%d, user=*0x%x, pres=*0x%x, options=%d)", index, user, pres, options); + sceNp.warning("sceNpBasicGetFriendPresenceByIndex(index=%d, user=*0x%x, " + "pres=*0x%x, options=%d)", + index, user, pres, options); if (!pres) { @@ -1788,16 +1918,23 @@ error_code sceNpBasicGetFriendPresenceByIndex(u32 index, vm::ptr if (!user) { - // TODO: check index and (options & SCE_NP_BASIC_PRESENCE_OPTIONS_ALL_OPTIONS) depending on fw + // TODO: check index and (options & + // SCE_NP_BASIC_PRESENCE_OPTIONS_ALL_OPTIONS) depending on fw return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT; } - return nph.get_friend_presence_by_index(index, user.get_ptr(), pres.get_ptr()); + return nph.get_friend_presence_by_index(index, user.get_ptr(), + pres.get_ptr()); } -error_code sceNpBasicGetFriendPresenceByIndex2(u32 index, vm::ptr user, vm::ptr pres, u32 options) +error_code +sceNpBasicGetFriendPresenceByIndex2(u32 index, vm::ptr user, + vm::ptr pres, + u32 options) { - sceNp.warning("sceNpBasicGetFriendPresenceByIndex2(index=%d, user=*0x%x, pres=*0x%x, options=%d)", index, user, pres, options); + sceNp.warning("sceNpBasicGetFriendPresenceByIndex2(index=%d, user=*0x%x, " + "pres=*0x%x, options=%d)", + index, user, pres, options); if (!pres) { @@ -1813,16 +1950,23 @@ error_code sceNpBasicGetFriendPresenceByIndex2(u32 index, vm::ptr if (!user) { - // TODO: check index and (options & SCE_NP_BASIC_PRESENCE_OPTIONS_ALL_OPTIONS) depending on fw + // TODO: check index and (options & + // SCE_NP_BASIC_PRESENCE_OPTIONS_ALL_OPTIONS) depending on fw return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT; } - return nph.get_friend_presence_by_index(index, user.get_ptr(), pres.get_ptr()); + return nph.get_friend_presence_by_index(index, user.get_ptr(), + pres.get_ptr()); } -error_code sceNpBasicGetFriendPresenceByNpId(vm::cptr npid, vm::ptr pres, u32 options) +error_code +sceNpBasicGetFriendPresenceByNpId(vm::cptr npid, + vm::ptr pres, + u32 options) { - sceNp.warning("sceNpBasicGetFriendPresenceByNpId(npid=*0x%x, pres=*0x%x, options=%d)", npid, pres, options); + sceNp.warning( + "sceNpBasicGetFriendPresenceByNpId(npid=*0x%x, pres=*0x%x, options=%d)", + npid, pres, options); if (!pres) { @@ -1838,16 +1982,22 @@ error_code sceNpBasicGetFriendPresenceByNpId(vm::cptr npid, vm::ptr npid, vm::ptr pres, u32 options) +error_code +sceNpBasicGetFriendPresenceByNpId2(vm::cptr npid, + vm::ptr pres, + u32 options) { - sceNp.warning("sceNpBasicGetFriendPresenceByNpId2(npid=*0x%x, pres=*0x%x, options=%d)", npid, pres, options); + sceNp.warning( + "sceNpBasicGetFriendPresenceByNpId2(npid=*0x%x, pres=*0x%x, options=%d)", + npid, pres, options); if (!pres) { @@ -1863,16 +2013,19 @@ error_code sceNpBasicGetFriendPresenceByNpId2(vm::cptr npid, vm::ptr npid, vm::cptr description) +error_code sceNpBasicAddPlayersHistory(vm::cptr npid, + vm::cptr description) { - sceNp.warning("sceNpBasicAddPlayersHistory(npid=*0x%x, description=*0x%x)", npid, description); + sceNp.warning("sceNpBasicAddPlayersHistory(npid=*0x%x, description=*0x%x)", + npid, description); auto& nph = g_fxo->get>(); @@ -1886,19 +2039,25 @@ error_code sceNpBasicAddPlayersHistory(vm::cptr npid, vm::cptr de return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT; } - if (description && strlen(description.get_ptr()) > SCE_NP_BASIC_DESCRIPTION_CHARACTER_MAX) + if (description && + strlen(description.get_ptr()) > SCE_NP_BASIC_DESCRIPTION_CHARACTER_MAX) { return SCE_NP_BASIC_ERROR_EXCEEDS_MAX; } - nph.add_player_to_history(npid.get_ptr(), description ? description.get_ptr() : nullptr); + nph.add_player_to_history(npid.get_ptr(), + description ? description.get_ptr() : nullptr); return CELL_OK; } -error_code sceNpBasicAddPlayersHistoryAsync(vm::cptr npids, u32 count, vm::cptr description, vm::ptr reqId) +error_code sceNpBasicAddPlayersHistoryAsync(vm::cptr npids, u32 count, + vm::cptr description, + vm::ptr reqId) { - sceNp.warning("sceNpBasicAddPlayersHistoryAsync(npids=*0x%x, count=%d, description=*0x%x, reqId=*0x%x)", npids, count, description, reqId); + sceNp.warning("sceNpBasicAddPlayersHistoryAsync(npids=*0x%x, count=%d, " + "description=*0x%x, reqId=*0x%x)", + npids, count, description, reqId); auto& nph = g_fxo->get>(); @@ -1930,12 +2089,14 @@ error_code sceNpBasicAddPlayersHistoryAsync(vm::cptr npids, u32 count, } } - if (description && strlen(description.get_ptr()) > SCE_NP_BASIC_DESCRIPTION_CHARACTER_MAX) + if (description && + strlen(description.get_ptr()) > SCE_NP_BASIC_DESCRIPTION_CHARACTER_MAX) { return SCE_NP_BASIC_ERROR_EXCEEDS_MAX; } - auto req_id = nph.add_players_to_history(npids.get_ptr(), description ? description.get_ptr() : nullptr, count); + auto req_id = nph.add_players_to_history( + npids.get_ptr(), description ? description.get_ptr() : nullptr, count); if (reqId) { @@ -1945,9 +2106,12 @@ error_code sceNpBasicAddPlayersHistoryAsync(vm::cptr npids, u32 count, return CELL_OK; } -error_code sceNpBasicGetPlayersHistoryEntryCount(u32 options, vm::ptr count) +error_code sceNpBasicGetPlayersHistoryEntryCount(u32 options, + vm::ptr count) { - sceNp.warning("sceNpBasicGetPlayersHistoryEntryCount(options=%d, count=*0x%x)", options, count); + sceNp.warning( + "sceNpBasicGetPlayersHistoryEntryCount(options=%d, count=*0x%x)", options, + count); if (options > SCE_NP_BASIC_PLAYERS_HISTORY_OPTIONS_ALL) { @@ -1982,9 +2146,12 @@ error_code sceNpBasicGetPlayersHistoryEntryCount(u32 options, vm::ptr count return CELL_OK; } -error_code sceNpBasicGetPlayersHistoryEntry(u32 options, u32 index, vm::ptr npid) +error_code sceNpBasicGetPlayersHistoryEntry(u32 options, u32 index, + vm::ptr npid) { - sceNp.warning("sceNpBasicGetPlayersHistoryEntry(options=%d, index=%d, npid=*0x%x)", options, index, npid); + sceNp.warning( + "sceNpBasicGetPlayersHistoryEntry(options=%d, index=%d, npid=*0x%x)", + options, index, npid); if (options > SCE_NP_BASIC_PLAYERS_HISTORY_OPTIONS_ALL) { @@ -2139,9 +2306,11 @@ error_code sceNpBasicGetMessageAttachmentEntryCount(vm::ptr count) return CELL_OK; } -error_code sceNpBasicGetMessageAttachmentEntry(u32 index, vm::ptr from) +error_code sceNpBasicGetMessageAttachmentEntry(u32 index, + vm::ptr from) { - sceNp.todo("sceNpBasicGetMessageAttachmentEntry(index=%d, from=*0x%x)", index, from); + sceNp.todo("sceNpBasicGetMessageAttachmentEntry(index=%d, from=*0x%x)", index, + from); auto& nph = g_fxo->get>(); @@ -2203,9 +2372,11 @@ error_code sceNpBasicGetCustomInvitationEntryCount(vm::ptr count) return CELL_OK; } -error_code sceNpBasicGetCustomInvitationEntry(u32 index, vm::ptr from) +error_code sceNpBasicGetCustomInvitationEntry(u32 index, + vm::ptr from) { - sceNp.todo("sceNpBasicGetCustomInvitationEntry(index=%d, from=*0x%x)", index, from); + sceNp.todo("sceNpBasicGetCustomInvitationEntry(index=%d, from=*0x%x)", index, + from); auto& nph = g_fxo->get>(); @@ -2267,9 +2438,11 @@ error_code sceNpBasicGetMatchingInvitationEntryCount(vm::ptr count) return CELL_OK; } -error_code sceNpBasicGetMatchingInvitationEntry(u32 index, vm::ptr from) +error_code sceNpBasicGetMatchingInvitationEntry(u32 index, + vm::ptr from) { - sceNp.todo("sceNpBasicGetMatchingInvitationEntry(index=%d, from=*0x%x)", index, from); + sceNp.todo("sceNpBasicGetMatchingInvitationEntry(index=%d, from=*0x%x)", + index, from); auto& nph = g_fxo->get>(); @@ -2331,9 +2504,11 @@ error_code sceNpBasicGetClanMessageEntryCount(vm::ptr count) return CELL_OK; } -error_code sceNpBasicGetClanMessageEntry(u32 index, vm::ptr from) +error_code sceNpBasicGetClanMessageEntry(u32 index, + vm::ptr from) { - sceNp.todo("sceNpBasicGetClanMessageEntry(index=%d, from=*0x%x)", index, from); + sceNp.todo("sceNpBasicGetClanMessageEntry(index=%d, from=*0x%x)", index, + from); auto& nph = g_fxo->get>(); @@ -2364,7 +2539,8 @@ error_code sceNpBasicGetClanMessageEntry(u32 index, vm::ptr from) error_code sceNpBasicGetMessageEntryCount(u32 type, vm::ptr count) { - sceNp.todo("sceNpBasicGetMessageEntryCount(type=%d, count=*0x%x)", type, count); + sceNp.todo("sceNpBasicGetMessageEntryCount(type=%d, count=*0x%x)", type, + count); // TODO: verify this check and its location if (type > SCE_NP_BASIC_MESSAGE_INFO_TYPE_BOOTABLE_CUSTOM_DATA_MESSAGE) @@ -2396,9 +2572,11 @@ error_code sceNpBasicGetMessageEntryCount(u32 type, vm::ptr count) return CELL_OK; } -error_code sceNpBasicGetMessageEntry(u32 type, u32 index, vm::ptr from) +error_code sceNpBasicGetMessageEntry(u32 type, u32 index, + vm::ptr from) { - sceNp.todo("sceNpBasicGetMessageEntry(type=%d, index=%d, from=*0x%x)", type, index, from); + sceNp.todo("sceNpBasicGetMessageEntry(type=%d, index=%d, from=*0x%x)", type, + index, from); // TODO: verify this check and its location if (type > SCE_NP_BASIC_MESSAGE_INFO_TYPE_BOOTABLE_CUSTOM_DATA_MESSAGE) @@ -2428,9 +2606,12 @@ error_code sceNpBasicGetMessageEntry(u32 type, u32 index, vm::ptr return CELL_OK; } -error_code sceNpBasicGetEvent(vm::ptr event, vm::ptr from, vm::ptr data, vm::ptr size) +error_code sceNpBasicGetEvent(vm::ptr event, vm::ptr from, + vm::ptr data, vm::ptr size) { - sceNp.trace("sceNpBasicGetEvent(event=*0x%x, from=*0x%x, data=*0x%x, size=*0x%x)", event, from, data, size); + sceNp.trace( + "sceNpBasicGetEvent(event=*0x%x, from=*0x%x, data=*0x%x, size=*0x%x)", + event, from, data, size); auto& nph = g_fxo->get>(); @@ -2452,9 +2633,13 @@ error_code sceNpBasicGetEvent(vm::ptr event, vm::ptr from, v return nph.get_basic_event(event, from, data, size); } -error_code sceNpCommerceCreateCtx(u32 version, vm::ptr npId, vm::ptr handler, vm::ptr arg, vm::ptr ctx_id) +error_code sceNpCommerceCreateCtx(u32 version, vm::ptr npId, + vm::ptr handler, + vm::ptr arg, vm::ptr ctx_id) { - sceNp.todo("sceNpCommerceCreateCtx(version=%d, event=*0x%x, from=*0x%x, arg=*0x%x, ctx_id=*0x%x)", version, npId, handler, arg, ctx_id); + sceNp.todo("sceNpCommerceCreateCtx(version=%d, event=*0x%x, from=*0x%x, " + "arg=*0x%x, ctx_id=*0x%x)", + version, npId, handler, arg, ctx_id); if (false) // TODO return SCE_NP_COMMERCE_ERROR_NOT_INITIALIZED; @@ -2481,9 +2666,13 @@ error_code sceNpCommerceDestroyCtx(u32 ctx_id) return CELL_OK; } -error_code sceNpCommerceInitProductCategory(vm::ptr pc, vm::cptr data, u32 data_size) +error_code +sceNpCommerceInitProductCategory(vm::ptr pc, + vm::cptr data, u32 data_size) { - sceNp.todo("sceNpCommerceInitProductCategory(pc=*0x%x, data=*0x%x, data_size=%d)", pc, data, data_size); + sceNp.todo( + "sceNpCommerceInitProductCategory(pc=*0x%x, data=*0x%x, data_size=%d)", + pc, data, data_size); if (!pc) // Not really checked return SCE_NP_COMMERCE_ERROR_PARSE_PRODUCT_CATEGORY; @@ -2534,7 +2723,8 @@ error_code sceNpCommerceInitProductCategory(vm::ptr pc) +void sceNpCommerceDestroyProductCategory( + vm::ptr pc) { sceNp.todo("sceNpCommerceDestroyProductCategory(pc=*0x%x)", pc); @@ -2545,9 +2735,14 @@ void sceNpCommerceDestroyProductCategory(vm::ptr p } } -error_code sceNpCommerceGetProductCategoryStart(u32 ctx_id, vm::cptr category_id, s32 lang_code, vm::ptr req_id) +error_code sceNpCommerceGetProductCategoryStart(u32 ctx_id, + vm::cptr category_id, + s32 lang_code, + vm::ptr req_id) { - sceNp.todo("sceNpCommerceGetProductCategoryStart(ctx_id=%d, category_id=%s, lang_code=%d, req_id=*0x%x)", ctx_id, category_id, lang_code, req_id); + sceNp.todo("sceNpCommerceGetProductCategoryStart(ctx_id=%d, category_id=%s, " + "lang_code=%d, req_id=*0x%x)", + ctx_id, category_id, lang_code, req_id); if (false) // TODO return SCE_NP_COMMERCE_ERROR_NOT_INITIALIZED; @@ -2568,9 +2763,13 @@ error_code sceNpCommerceGetProductCategoryFinish(u32 req_id) return CELL_OK; } -error_code sceNpCommerceGetProductCategoryResult(u32 req_id, vm::ptr buf, u32 buf_size, vm::ptr fill_size) +error_code sceNpCommerceGetProductCategoryResult(u32 req_id, vm::ptr buf, + u32 buf_size, + vm::ptr fill_size) { - sceNp.todo("sceNpCommerceGetProductCategoryResult(req_id=%d, buf=*0x%x, buf_size=%d, fill_size=*0x%x)", req_id, buf, buf_size, fill_size); + sceNp.todo("sceNpCommerceGetProductCategoryResult(req_id=%d, buf=*0x%x, " + "buf_size=%d, fill_size=*0x%x)", + req_id, buf, buf_size, fill_size); if (false) // TODO return SCE_NP_COMMERCE_ERROR_NOT_INITIALIZED; @@ -2596,42 +2795,49 @@ error_code sceNpCommerceGetProductCategoryAbort(u32 req_id) return CELL_OK; } -vm::cptr sceNpCommerceGetProductId(vm::ptr info) +vm::cptr +sceNpCommerceGetProductId(vm::ptr info) { sceNp.todo("sceNpCommerceGetProductId(info=*0x%x)", info); // if (info) return info->data + 0x38; return vm::null; } -vm::cptr sceNpCommerceGetProductName(vm::ptr info) +vm::cptr +sceNpCommerceGetProductName(vm::ptr info) { sceNp.todo("sceNpCommerceGetProductName(info=*0x%x)", info); // if (info) return info->data + 0x68; return vm::null; } -vm::cptr sceNpCommerceGetCategoryDescription(vm::ptr info) +vm::cptr +sceNpCommerceGetCategoryDescription(vm::ptr info) { sceNp.todo("sceNpCommerceGetCategoryDescription(info=*0x%x)", info); // if (info) return info->data + 0xf8; return vm::null; } -vm::cptr sceNpCommerceGetCategoryId(vm::ptr info) +vm::cptr +sceNpCommerceGetCategoryId(vm::ptr info) { sceNp.todo("sceNpCommerceGetCategoryId(info=*0x%x)", info); // if (info) return info->data; return vm::null; } -vm::cptr sceNpCommerceGetCategoryImageURL(vm::ptr info) +vm::cptr +sceNpCommerceGetCategoryImageURL(vm::ptr info) { sceNp.todo("sceNpCommerceGetCategoryImageURL(info=*0x%x)", info); // if (info) return info->data + 0x278; return vm::null; } -error_code sceNpCommerceGetCategoryInfo(vm::ptr pc, vm::ptr info) +error_code +sceNpCommerceGetCategoryInfo(vm::ptr pc, + vm::ptr info) { sceNp.todo("sceNpCommerceGetCategoryInfo(pc=*0x%x, info=*0x%x)", pc, info); @@ -2653,14 +2859,16 @@ error_code sceNpCommerceGetCategoryInfo(vm::ptr pc return CELL_OK; } -vm::cptr sceNpCommerceGetCategoryName(vm::ptr info) +vm::cptr +sceNpCommerceGetCategoryName(vm::ptr info) { sceNp.todo("sceNpCommerceGetCategoryName(info=*0x%x)", info); // if (info) return info->data + 0x38; return vm::null; } -vm::cptr sceNpCommerceGetCurrencyCode(vm::ptr info) +vm::cptr +sceNpCommerceGetCurrencyCode(vm::ptr info) { sceNp.todo("sceNpCommerceGetCurrencyCode(info=*0x%x)", info); // if (info) return info->data; @@ -2682,7 +2890,9 @@ u32 sceNpCommerceGetCurrencyDecimals(vm::ptr info) return 0; } -error_code sceNpCommerceGetCurrencyInfo(vm::ptr pc, vm::ptr info) +error_code +sceNpCommerceGetCurrencyInfo(vm::ptr pc, + vm::ptr info) { sceNp.todo("sceNpCommerceGetCurrencyInfo(pc=*0x%x, info=*0x%x)", pc, info); @@ -2701,9 +2911,12 @@ error_code sceNpCommerceGetCurrencyInfo(vm::ptr pc return CELL_OK; } -error_code sceNpCommerceGetNumOfChildCategory(vm::ptr pc, vm::ptr num) +error_code +sceNpCommerceGetNumOfChildCategory(vm::ptr pc, + vm::ptr num) { - sceNp.todo("sceNpCommerceGetNumOfChildCategory(pc=*0x%x, num=*0x%x)", pc, num); + sceNp.todo("sceNpCommerceGetNumOfChildCategory(pc=*0x%x, num=*0x%x)", pc, + num); if (!pc || pc->dataSize < 780) return SCE_NP_COMMERCE_ERROR_CHILD_CATEGORY_COUNT_NOT_FOUND; @@ -2713,9 +2926,12 @@ error_code sceNpCommerceGetNumOfChildCategory(vm::ptr pc, vm::ptr num) +error_code +sceNpCommerceGetNumOfChildProductSku(vm::ptr pc, + vm::ptr num) { - sceNp.todo("sceNpCommerceGetNumOfChildProductSku(pc=*0x%x, num=*0x%x)", pc, num); + sceNp.todo("sceNpCommerceGetNumOfChildProductSku(pc=*0x%x, num=*0x%x)", pc, + num); if (!pc || pc->dataSize < 780) // TODO: some other check return SCE_NP_COMMERCE_ERROR_SKU_COUNT_NOT_FOUND; @@ -2725,35 +2941,40 @@ error_code sceNpCommerceGetNumOfChildProductSku(vm::ptr sceNpCommerceGetSkuDescription(vm::ptr info) +vm::cptr +sceNpCommerceGetSkuDescription(vm::ptr info) { sceNp.todo("sceNpCommerceGetSkuDescription(info=*0x%x)", info); // if (info) return info->data + 0x168; return vm::null; } -vm::cptr sceNpCommerceGetSkuId(vm::ptr info) +vm::cptr +sceNpCommerceGetSkuId(vm::ptr info) { sceNp.todo("sceNpCommerceGetSkuId(info=*0x%x)", info); // if (info) return info->data; return vm::null; } -vm::cptr sceNpCommerceGetSkuImageURL(vm::ptr info) +vm::cptr +sceNpCommerceGetSkuImageURL(vm::ptr info) { sceNp.todo("sceNpCommerceGetSkuImageURL(info=*0x%x)", info); // if (info) return info->data + 0x2e8; return vm::null; } -vm::cptr sceNpCommerceGetSkuName(vm::ptr info) +vm::cptr +sceNpCommerceGetSkuName(vm::ptr info) { sceNp.todo("sceNpCommerceGetSkuName(info=*0x%x)", info); // if (info) return info->data + 0x128; return vm::null; } -void sceNpCommerceGetSkuPrice(vm::ptr info, vm::ptr price) +void sceNpCommerceGetSkuPrice(vm::ptr info, + vm::ptr price) { sceNp.todo("sceNpCommerceGetSkuPrice(info=*0x%x, price=*0x%x)", info, price); @@ -2764,7 +2985,8 @@ void sceNpCommerceGetSkuPrice(vm::ptr info, vm::ptr { // TODO // price->integer = something / info->pc->dval; - // price->fractional = something - static_cast(price->integer) * info->pc->dval; + // price->fractional = something - static_cast(price->integer) * + // info->pc->dval; return; } @@ -2773,16 +2995,20 @@ void sceNpCommerceGetSkuPrice(vm::ptr info, vm::ptr price->fractional = 0; } -vm::cptr sceNpCommerceGetSkuUserData(vm::ptr info) +vm::cptr +sceNpCommerceGetSkuUserData(vm::ptr info) { sceNp.todo("sceNpCommerceGetSkuUserData(info=*0x%x)", info); // if (info) return info->data + 0x368; return vm::null; } -error_code sceNpCommerceSetDataFlagStart(u32 arg1, u32 arg2, u32 arg3, u32 arg4, u32 arg5) +error_code sceNpCommerceSetDataFlagStart(u32 arg1, u32 arg2, u32 arg3, u32 arg4, + u32 arg5) { - sceNp.todo("sceNpCommerceSetDataFlagStart(arg1=0x%x, arg2=0x%x, arg3=0x%x, arg4=0x%x, arg5=0x%x)", arg1, arg2, arg3, arg4, arg5); + sceNp.todo("sceNpCommerceSetDataFlagStart(arg1=0x%x, arg2=0x%x, arg3=0x%x, " + "arg4=0x%x, arg5=0x%x)", + arg1, arg2, arg3, arg4, arg5); if (false) // TODO return SCE_NP_COMMERCE_ERROR_NOT_INITIALIZED; @@ -2796,9 +3022,12 @@ error_code sceNpCommerceSetDataFlagStart(u32 arg1, u32 arg2, u32 arg3, u32 arg4, return CELL_OK; } -error_code sceNpCommerceGetDataFlagStart(u32 arg1, u32 arg2, u32 arg3, u32 arg4, u32 arg5) +error_code sceNpCommerceGetDataFlagStart(u32 arg1, u32 arg2, u32 arg3, u32 arg4, + u32 arg5) { - sceNp.todo("sceNpCommerceGetDataFlagStart(arg1=0x%x, arg2=0x%x, arg3=0x%x, arg4=0x%x, arg5=0x%x)", arg1, arg2, arg3, arg4, arg5); + sceNp.todo("sceNpCommerceGetDataFlagStart(arg1=0x%x, arg2=0x%x, arg3=0x%x, " + "arg4=0x%x, arg5=0x%x)", + arg1, arg2, arg3, arg4, arg5); if (false) // TODO return SCE_NP_COMMERCE_ERROR_NOT_INITIALIZED; @@ -2834,7 +3063,8 @@ error_code sceNpCommerceGetDataFlagFinish() error_code sceNpCommerceGetDataFlagState(u32 arg1, u32 arg2, u32 arg3) { - sceNp.todo("sceNpCommerceGetDataFlagState(arg1=0x%x, arg2=0x%x, arg3=0x%x)", arg1, arg2, arg3); + sceNp.todo("sceNpCommerceGetDataFlagState(arg1=0x%x, arg2=0x%x, arg3=0x%x)", + arg1, arg2, arg3); if (false) // TODO return SCE_NP_COMMERCE_ERROR_NOT_INITIALIZED; @@ -2855,9 +3085,14 @@ error_code sceNpCommerceGetDataFlagAbort() return CELL_OK; } -error_code sceNpCommerceGetChildCategoryInfo(vm::ptr pc, u32 child_index, vm::ptr info) +error_code +sceNpCommerceGetChildCategoryInfo(vm::ptr pc, + u32 child_index, + vm::ptr info) { - sceNp.todo("sceNpCommerceGetChildCategoryInfo(pc=*0x%x, child_index=%d, info=*0x%x)", pc, child_index, info); + sceNp.todo( + "sceNpCommerceGetChildCategoryInfo(pc=*0x%x, child_index=%d, info=*0x%x)", + pc, child_index, info); if (!pc || !info) // Not really checked I think return SCE_NP_COMMERCE_ERROR_CHILD_CATEGORY_INFO_NOT_FOUND; @@ -2879,9 +3114,14 @@ error_code sceNpCommerceGetChildCategoryInfo(vm::ptr pc, u32 child_index, vm::ptr info) +error_code +sceNpCommerceGetChildProductSkuInfo(vm::ptr pc, + u32 child_index, + vm::ptr info) { - sceNp.todo("sceNpCommerceGetChildProductSkuInfo(pc=*0x%x, child_index=%d, info=*0x%x)", pc, child_index, info); + sceNp.todo("sceNpCommerceGetChildProductSkuInfo(pc=*0x%x, child_index=%d, " + "info=*0x%x)", + pc, child_index, info); if (!pc || !info) // Not really checked I think return SCE_NP_COMMERCE_ERROR_SKU_INFO_NOT_FOUND; @@ -2910,9 +3150,15 @@ error_code sceNpCommerceGetChildProductSkuInfo(vm::ptr sku_ids, u32 sku_num, sys_memory_container_t container, vm::ptr req_id) +error_code sceNpCommerceDoCheckoutStartAsync(u32 ctx_id, + vm::cpptr sku_ids, + u32 sku_num, + sys_memory_container_t container, + vm::ptr req_id) { - sceNp.todo("sceNpCommerceDoCheckoutStartAsync(ctx_id=%d, sku_ids=*0x%x, sku_num=%d, container=%d, req_id=*0x%x)", ctx_id, sku_ids, sku_num, container, req_id); + sceNp.todo("sceNpCommerceDoCheckoutStartAsync(ctx_id=%d, sku_ids=*0x%x, " + "sku_num=%d, container=%d, req_id=*0x%x)", + ctx_id, sku_ids, sku_num, container, req_id); if (false) // TODO return SCE_NP_COMMERCE_ERROR_NOT_INITIALIZED; @@ -2944,9 +3190,14 @@ error_code sceNpCommerceDoCheckoutFinishAsync(u32 req_id) return CELL_OK; } -error_code sceNpCustomMenuRegisterActions(vm::cptr menu, vm::ptr handler, vm::ptr userArg, u64 options) +error_code +sceNpCustomMenuRegisterActions(vm::cptr menu, + vm::ptr handler, + vm::ptr userArg, u64 options) { - sceNp.todo("sceNpCustomMenuRegisterActions(menu=*0x%x, handler=*0x%x, userArg=*0x%x, options=0x%x)", menu, handler, userArg, options); + sceNp.todo("sceNpCustomMenuRegisterActions(menu=*0x%x, handler=*0x%x, " + "userArg=*0x%x, options=0x%x)", + menu, handler, userArg, options); // TODO: Is there any error if options is not 0 ? @@ -2984,7 +3235,8 @@ error_code sceNpCustomMenuRegisterActions(vm::cptr menu, vm::pt return SCE_NP_UTIL_ERROR_INVALID_CHARACTER; } - if (!memchr(menu->actions[i].name.get_ptr(), '\0', SCE_NP_CUSTOM_MENU_ACTION_CHARACTER_MAX)) + if (!memchr(menu->actions[i].name.get_ptr(), '\0', + SCE_NP_CUSTOM_MENU_ACTION_CHARACTER_MAX)) { return SCE_NP_CUSTOM_MENU_ERROR_EXCEEDS_MAX; } @@ -2994,7 +3246,8 @@ error_code sceNpCustomMenuRegisterActions(vm::cptr menu, vm::pt action.mask = menu->actions[i].mask; action.name = menu->actions[i].name.get_ptr(); - sceNp.notice("Registering menu action: id=%d, mask=0x%x, name=%s", action.id, action.mask, action.name); + sceNp.notice("Registering menu action: id=%d, mask=0x%x, name=%s", + action.id, action.mask, action.name); actions.push_back(std::move(action)); } @@ -3011,9 +3264,12 @@ error_code sceNpCustomMenuRegisterActions(vm::cptr menu, vm::pt return CELL_OK; } -error_code sceNpCustomMenuActionSetActivation(vm::cptr array, u64 options) +error_code +sceNpCustomMenuActionSetActivation(vm::cptr array, + u64 options) { - sceNp.todo("sceNpCustomMenuActionSetActivation(array=*0x%x, options=0x%x)", array, options); + sceNp.todo("sceNpCustomMenuActionSetActivation(array=*0x%x, options=0x%x)", + array, options); // TODO: Is there any error if options is not 0 ? @@ -3041,9 +3297,13 @@ error_code sceNpCustomMenuActionSetActivation(vm::cptr items, u32 numItems, u64 options) +error_code sceNpCustomMenuRegisterExceptionList( + vm::cptr items, u32 numItems, + u64 options) { - sceNp.todo("sceNpCustomMenuRegisterExceptionList(items=*0x%x, numItems=%d, options=0x%x)", items, numItems, options); + sceNp.todo("sceNpCustomMenuRegisterExceptionList(items=*0x%x, numItems=%d, " + "options=0x%x)", + items, numItems, options); // TODO: Is there any error if options is not 0 ? @@ -3082,9 +3342,13 @@ error_code sceNpCustomMenuRegisterExceptionList(vm::cptr resultHandler, vm::ptr userArg, sys_memory_container_t containerId) +error_code sceNpFriendlist(vm::ptr resultHandler, + vm::ptr userArg, + sys_memory_container_t containerId) { - sceNp.warning("sceNpFriendlist(resultHandler=*0x%x, userArg=*0x%x, containerId=%d)", resultHandler, userArg, containerId); + sceNp.warning( + "sceNpFriendlist(resultHandler=*0x%x, userArg=*0x%x, containerId=%d)", + resultHandler, userArg, containerId); auto& nph = g_fxo->get>(); @@ -3110,9 +3374,15 @@ error_code sceNpFriendlist(vm::ptr resultHandler, return CELL_OK; } -error_code sceNpFriendlistCustom(SceNpFriendlistCustomOptions options, vm::ptr resultHandler, vm::ptr userArg, sys_memory_container_t containerId) +error_code +sceNpFriendlistCustom(SceNpFriendlistCustomOptions options, + vm::ptr resultHandler, + vm::ptr userArg, + sys_memory_container_t containerId) { - sceNp.warning("sceNpFriendlistCustom(options=0x%x, resultHandler=*0x%x, userArg=*0x%x, containerId=%d)", options, resultHandler, userArg, containerId); + sceNp.warning("sceNpFriendlistCustom(options=0x%x, resultHandler=*0x%x, " + "userArg=*0x%x, containerId=%d)", + options, resultHandler, userArg, containerId); auto& nph = g_fxo->get>(); @@ -3196,9 +3466,13 @@ error_code sceNpLookupTerm() return CELL_OK; } -error_code sceNpLookupCreateTitleCtx(vm::cptr communicationId, vm::cptr selfNpId) +error_code +sceNpLookupCreateTitleCtx(vm::cptr communicationId, + vm::cptr selfNpId) { - sceNp.warning("sceNpLookupCreateTitleCtx(communicationId=*0x%x(%s), selfNpId=0x%x)", communicationId, communicationId ? communicationId->data : "", selfNpId); + sceNp.warning( + "sceNpLookupCreateTitleCtx(communicationId=*0x%x(%s), selfNpId=0x%x)", + communicationId, communicationId ? communicationId->data : "", selfNpId); auto& nph = g_fxo->get>(); @@ -3333,9 +3607,12 @@ error_code sceNpLookupPollAsync(s32 transId, vm::ptr result) return CELL_OK; } -error_code sceNpLookupNpId(s32 transId, vm::cptr onlineId, vm::ptr npId, vm::ptr option) +error_code sceNpLookupNpId(s32 transId, vm::cptr onlineId, + vm::ptr npId, vm::ptr option) { - sceNp.todo("sceNpLookupNpId(transId=%d, onlineId=*0x%x, npId=*0x%x, option=*0x%x)", transId, onlineId, npId, option); + sceNp.todo( + "sceNpLookupNpId(transId=%d, onlineId=*0x%x, npId=*0x%x, option=*0x%x)", + transId, onlineId, npId, option); auto& nph = g_fxo->get>(); @@ -3366,140 +3643,56 @@ error_code sceNpLookupNpId(s32 transId, vm::cptr onlineId, vm::pt return CELL_OK; } -error_code sceNpLookupNpIdAsync(s32 transId, vm::cptr onlineId, vm::ptr npId, s32 prio, vm::ptr option) -{ - sceNp.todo("sceNpLookupNpIdAsync(transId=%d, onlineId=*0x%x, npId=*0x%x, prio=%d, option=*0x%x)", transId, onlineId, npId, prio, option); - - auto& nph = g_fxo->get>(); - - if (!nph.is_NP_Lookup_init) - { - return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED; - } - - if (!onlineId || !npId) - { - return SCE_NP_COMMUNITY_ERROR_INSUFFICIENT_ARGUMENT; - } - - if (option) // option check at least until fw 4.71 - { - return SCE_NP_COMMUNITY_ERROR_INVALID_ARGUMENT; - } - - if (nph.get_psn_status() != SCE_NP_MANAGER_STATUS_ONLINE) - { - return SCE_NP_COMMUNITY_ERROR_INVALID_ONLINE_ID; - } - - // Hack - better than nothing for now - memset(npId.get_ptr(), 0, sizeof(SceNpId)); - memcpy(npId->handle.data, onlineId->data, sizeof(npId->handle.data) - 1); - - return CELL_OK; -} - -error_code sceNpLookupUserProfile(s32 transId, vm::cptr npId, vm::ptr userInfo, vm::ptr aboutMe, vm::ptr languages, - vm::ptr countryCode, vm::ptr avatarImage, vm::ptr option) -{ - sceNp.todo("sceNpLookupUserProfile(transId=%d, npId=*0x%x, userInfo=*0x%x, aboutMe=*0x%x, languages=*0x%x, countryCode=*0x%x, avatarImage=*0x%x, option=*0x%x)", transId, npId, userInfo, aboutMe, - languages, countryCode, avatarImage, option); - - auto& nph = g_fxo->get>(); - - if (!nph.is_NP_Lookup_init) - { - return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED; - } - - if (!npId) - { - return SCE_NP_COMMUNITY_ERROR_INSUFFICIENT_ARGUMENT; - } - - if (option) // option check at least until fw 4.71 - { - return SCE_NP_COMMUNITY_ERROR_INVALID_ARGUMENT; - } - - if (nph.get_psn_status() != SCE_NP_MANAGER_STATUS_ONLINE) - { - return SCE_NP_COMMUNITY_ERROR_INVALID_ONLINE_ID; - } - - return CELL_OK; -} - -error_code sceNpLookupUserProfileAsync(s32 transId, vm::cptr npId, vm::ptr userInfo, vm::ptr aboutMe, vm::ptr languages, - vm::ptr countryCode, vm::ptr avatarImage, s32 prio, vm::ptr option) -{ - sceNp.todo("sceNpLookupUserProfile(transId=%d, npId=*0x%x, userInfo=*0x%x, aboutMe=*0x%x, languages=*0x%x, countryCode=*0x%x, avatarImage=*0x%x, prio=%d, option=*0x%x)", transId, npId, userInfo, - aboutMe, languages, countryCode, avatarImage, prio, option); - - auto& nph = g_fxo->get>(); - - if (!nph.is_NP_Lookup_init) - { - return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED; - } - - if (!npId) - { - return SCE_NP_COMMUNITY_ERROR_INSUFFICIENT_ARGUMENT; - } - - if (option) // option check at least until fw 4.71 - { - return SCE_NP_COMMUNITY_ERROR_INVALID_ARGUMENT; - } - - if (nph.get_psn_status() != SCE_NP_MANAGER_STATUS_ONLINE) - { - return SCE_NP_COMMUNITY_ERROR_INVALID_ONLINE_ID; - } - - return CELL_OK; -} - -error_code sceNpLookupUserProfileWithAvatarSize(s32 transId, s32 avatarSizeType, vm::cptr npId, vm::ptr userInfo, vm::ptr aboutMe, - vm::ptr languages, vm::ptr countryCode, vm::ptr avatarImageData, u32 avatarImageDataMaxSize, vm::ptr avatarImageDataSize, vm::ptr option) -{ - sceNp.todo("sceNpLookupUserProfileWithAvatarSize(transId=%d, avatarSizeType=%d, npId=*0x%x, userInfo=*0x%x, aboutMe=*0x%x, languages=*0x%x, countryCode=*0x%x, avatarImageData=*0x%x, " - "avatarImageDataMaxSize=%d, avatarImageDataSize=*0x%x, option=*0x%x)", - transId, avatarSizeType, npId, userInfo, aboutMe, languages, countryCode, avatarImageData, avatarImageDataMaxSize, avatarImageDataSize, option); - - auto& nph = g_fxo->get>(); - - if (!nph.is_NP_Lookup_init) - { - return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED; - } - - if (!npId) - { - return SCE_NP_COMMUNITY_ERROR_INSUFFICIENT_ARGUMENT; - } - - if (option) // option check at least until fw 4.71 - { - return SCE_NP_COMMUNITY_ERROR_INVALID_ARGUMENT; - } - - if (nph.get_psn_status() != SCE_NP_MANAGER_STATUS_ONLINE) - { - return SCE_NP_COMMUNITY_ERROR_INVALID_ONLINE_ID; - } - - return CELL_OK; -} - -error_code sceNpLookupUserProfileWithAvatarSizeAsync(s32 transId, s32 avatarSizeType, vm::cptr npId, vm::ptr userInfo, vm::ptr aboutMe, - vm::ptr languages, vm::ptr countryCode, vm::ptr avatarImageData, u32 avatarImageDataMaxSize, vm::ptr avatarImageDataSize, s32 prio, +error_code sceNpLookupNpIdAsync(s32 transId, vm::cptr onlineId, + vm::ptr npId, s32 prio, vm::ptr option) { - sceNp.todo("sceNpLookupUserProfileWithAvatarSizeAsync(transId=%d, avatarSizeType=%d, npId=*0x%x, userInfo=*0x%x, aboutMe=*0x%x, languages=*0x%x, countryCode=*0x%x, avatarImageData=*0x%x, " - "avatarImageDataMaxSize=%d, avatarImageDataSize=*0x%x, prio=%d, option=*0x%x)", - transId, avatarSizeType, npId, userInfo, aboutMe, languages, countryCode, avatarImageData, avatarImageDataMaxSize, avatarImageDataSize, prio, option); + sceNp.todo("sceNpLookupNpIdAsync(transId=%d, onlineId=*0x%x, npId=*0x%x, " + "prio=%d, option=*0x%x)", + transId, onlineId, npId, prio, option); + + auto& nph = g_fxo->get>(); + + if (!nph.is_NP_Lookup_init) + { + return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED; + } + + if (!onlineId || !npId) + { + return SCE_NP_COMMUNITY_ERROR_INSUFFICIENT_ARGUMENT; + } + + if (option) // option check at least until fw 4.71 + { + return SCE_NP_COMMUNITY_ERROR_INVALID_ARGUMENT; + } + + if (nph.get_psn_status() != SCE_NP_MANAGER_STATUS_ONLINE) + { + return SCE_NP_COMMUNITY_ERROR_INVALID_ONLINE_ID; + } + + // Hack - better than nothing for now + memset(npId.get_ptr(), 0, sizeof(SceNpId)); + memcpy(npId->handle.data, onlineId->data, sizeof(npId->handle.data) - 1); + + return CELL_OK; +} + +error_code sceNpLookupUserProfile(s32 transId, vm::cptr npId, + vm::ptr userInfo, + vm::ptr aboutMe, + vm::ptr languages, + vm::ptr countryCode, + vm::ptr avatarImage, + vm::ptr option) +{ + sceNp.todo("sceNpLookupUserProfile(transId=%d, npId=*0x%x, userInfo=*0x%x, " + "aboutMe=*0x%x, languages=*0x%x, countryCode=*0x%x, " + "avatarImage=*0x%x, option=*0x%x)", + transId, npId, userInfo, aboutMe, languages, countryCode, + avatarImage, option); auto& nph = g_fxo->get>(); @@ -3526,9 +3719,134 @@ error_code sceNpLookupUserProfileWithAvatarSizeAsync(s32 transId, s32 avatarSize return CELL_OK; } -error_code sceNpLookupAvatarImage(s32 transId, vm::ptr avatarUrl, vm::ptr avatarImage, vm::ptr option) +error_code sceNpLookupUserProfileAsync(s32 transId, vm::cptr npId, + vm::ptr userInfo, + vm::ptr aboutMe, + vm::ptr languages, + vm::ptr countryCode, + vm::ptr avatarImage, + s32 prio, vm::ptr option) { - sceNp.todo("sceNpLookupAvatarImage(transId=%d, avatarUrl=*0x%x, avatarImage=*0x%x, option=*0x%x)", transId, avatarUrl, avatarImage, option); + sceNp.todo("sceNpLookupUserProfile(transId=%d, npId=*0x%x, userInfo=*0x%x, " + "aboutMe=*0x%x, languages=*0x%x, countryCode=*0x%x, " + "avatarImage=*0x%x, prio=%d, option=*0x%x)", + transId, npId, userInfo, aboutMe, languages, countryCode, + avatarImage, prio, option); + + auto& nph = g_fxo->get>(); + + if (!nph.is_NP_Lookup_init) + { + return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED; + } + + if (!npId) + { + return SCE_NP_COMMUNITY_ERROR_INSUFFICIENT_ARGUMENT; + } + + if (option) // option check at least until fw 4.71 + { + return SCE_NP_COMMUNITY_ERROR_INVALID_ARGUMENT; + } + + if (nph.get_psn_status() != SCE_NP_MANAGER_STATUS_ONLINE) + { + return SCE_NP_COMMUNITY_ERROR_INVALID_ONLINE_ID; + } + + return CELL_OK; +} + +error_code sceNpLookupUserProfileWithAvatarSize( + s32 transId, s32 avatarSizeType, vm::cptr npId, + vm::ptr userInfo, vm::ptr aboutMe, + vm::ptr languages, vm::ptr countryCode, + vm::ptr avatarImageData, u32 avatarImageDataMaxSize, + vm::ptr avatarImageDataSize, vm::ptr option) +{ + sceNp.todo( + "sceNpLookupUserProfileWithAvatarSize(transId=%d, avatarSizeType=%d, " + "npId=*0x%x, userInfo=*0x%x, aboutMe=*0x%x, languages=*0x%x, " + "countryCode=*0x%x, avatarImageData=*0x%x, " + "avatarImageDataMaxSize=%d, avatarImageDataSize=*0x%x, option=*0x%x)", + transId, avatarSizeType, npId, userInfo, aboutMe, languages, countryCode, + avatarImageData, avatarImageDataMaxSize, avatarImageDataSize, option); + + auto& nph = g_fxo->get>(); + + if (!nph.is_NP_Lookup_init) + { + return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED; + } + + if (!npId) + { + return SCE_NP_COMMUNITY_ERROR_INSUFFICIENT_ARGUMENT; + } + + if (option) // option check at least until fw 4.71 + { + return SCE_NP_COMMUNITY_ERROR_INVALID_ARGUMENT; + } + + if (nph.get_psn_status() != SCE_NP_MANAGER_STATUS_ONLINE) + { + return SCE_NP_COMMUNITY_ERROR_INVALID_ONLINE_ID; + } + + return CELL_OK; +} + +error_code sceNpLookupUserProfileWithAvatarSizeAsync( + s32 transId, s32 avatarSizeType, vm::cptr npId, + vm::ptr userInfo, vm::ptr aboutMe, + vm::ptr languages, vm::ptr countryCode, + vm::ptr avatarImageData, u32 avatarImageDataMaxSize, + vm::ptr avatarImageDataSize, s32 prio, vm::ptr option) +{ + sceNp.todo("sceNpLookupUserProfileWithAvatarSizeAsync(transId=%d, " + "avatarSizeType=%d, npId=*0x%x, userInfo=*0x%x, aboutMe=*0x%x, " + "languages=*0x%x, countryCode=*0x%x, avatarImageData=*0x%x, " + "avatarImageDataMaxSize=%d, avatarImageDataSize=*0x%x, prio=%d, " + "option=*0x%x)", + transId, avatarSizeType, npId, userInfo, aboutMe, languages, + countryCode, avatarImageData, avatarImageDataMaxSize, + avatarImageDataSize, prio, option); + + auto& nph = g_fxo->get>(); + + if (!nph.is_NP_Lookup_init) + { + return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED; + } + + if (!npId) + { + return SCE_NP_COMMUNITY_ERROR_INSUFFICIENT_ARGUMENT; + } + + if (option) // option check at least until fw 4.71 + { + return SCE_NP_COMMUNITY_ERROR_INVALID_ARGUMENT; + } + + if (nph.get_psn_status() != SCE_NP_MANAGER_STATUS_ONLINE) + { + return SCE_NP_COMMUNITY_ERROR_INVALID_ONLINE_ID; + } + + return CELL_OK; +} + +error_code sceNpLookupAvatarImage(s32 transId, + vm::ptr avatarUrl, + vm::ptr avatarImage, + vm::ptr option) +{ + sceNp.todo("sceNpLookupAvatarImage(transId=%d, avatarUrl=*0x%x, " + "avatarImage=*0x%x, option=*0x%x)", + transId, avatarUrl, avatarImage, option); auto& nph = g_fxo->get>(); @@ -3555,9 +3873,14 @@ error_code sceNpLookupAvatarImage(s32 transId, vm::ptr avatarUrl return CELL_OK; } -error_code sceNpLookupAvatarImageAsync(s32 transId, vm::ptr avatarUrl, vm::ptr avatarImage, s32 prio, vm::ptr option) +error_code sceNpLookupAvatarImageAsync(s32 transId, + vm::ptr avatarUrl, + vm::ptr avatarImage, + s32 prio, vm::ptr option) { - sceNp.todo("sceNpLookupAvatarImageAsync(transId=%d, avatarUrl=*0x%x, avatarImage=*0x%x, prio=%d, option=*0x%x)", transId, avatarUrl, avatarImage, prio, option); + sceNp.todo("sceNpLookupAvatarImageAsync(transId=%d, avatarUrl=*0x%x, " + "avatarImage=*0x%x, prio=%d, option=*0x%x)", + transId, avatarUrl, avatarImage, prio, option); auto& nph = g_fxo->get>(); @@ -3612,9 +3935,13 @@ error_code sceNpLookupTitleStorageAsync() return CELL_OK; } -error_code sceNpLookupTitleSmallStorage(s32 transId, vm::ptr data, u32 maxSize, vm::ptr contentLength, vm::ptr option) +error_code sceNpLookupTitleSmallStorage(s32 transId, vm::ptr data, + u32 maxSize, vm::ptr contentLength, + vm::ptr option) { - sceNp.todo("sceNpLookupTitleSmallStorage(transId=%d, data=*0x%x, maxSize=%d, contentLength=*0x%x, option=*0x%x)", transId, data, maxSize, contentLength, option); + sceNp.todo("sceNpLookupTitleSmallStorage(transId=%d, data=*0x%x, maxSize=%d, " + "contentLength=*0x%x, option=*0x%x)", + transId, data, maxSize, contentLength, option); auto& nph = g_fxo->get>(); @@ -3646,9 +3973,14 @@ error_code sceNpLookupTitleSmallStorage(s32 transId, vm::ptr data, u32 max return CELL_OK; } -error_code sceNpLookupTitleSmallStorageAsync(s32 transId, vm::ptr data, u32 maxSize, vm::ptr contentLength, s32 prio, vm::ptr option) +error_code sceNpLookupTitleSmallStorageAsync(s32 transId, vm::ptr data, + u32 maxSize, + vm::ptr contentLength, + s32 prio, vm::ptr option) { - sceNp.todo("sceNpLookupTitleSmallStorageAsync(transId=%d, data=*0x%x, maxSize=%d, contentLength=*0x%x, prio=%d, option=*0x%x)", transId, data, maxSize, contentLength, prio, option); + sceNp.todo("sceNpLookupTitleSmallStorageAsync(transId=%d, data=*0x%x, " + "maxSize=%d, contentLength=*0x%x, prio=%d, option=*0x%x)", + transId, data, maxSize, contentLength, prio, option); auto& nph = g_fxo->get>(); @@ -3677,16 +4009,19 @@ error_code sceNpLookupTitleSmallStorageAsync(s32 transId, vm::ptr data, u3 return SCE_NP_COMMUNITY_ERROR_INVALID_ONLINE_ID; } - // TSS are game specific data we don't have access to, set buf to 0, return size 0 + // TSS are game specific data we don't have access to, set buf to 0, return + // size 0 std::memset(data.get_ptr(), 0, maxSize); *contentLength = 0; return CELL_OK; } -error_code sceNpManagerRegisterCallback(vm::ptr callback, vm::ptr arg) +error_code sceNpManagerRegisterCallback(vm::ptr callback, + vm::ptr arg) { - sceNp.warning("sceNpManagerRegisterCallback(callback=*0x%x, arg=*0x%x)", callback, arg); + sceNp.warning("sceNpManagerRegisterCallback(callback=*0x%x, arg=*0x%x)", + callback, arg); auto& nph = g_fxo->get>(); @@ -3795,7 +4130,8 @@ error_code sceNpManagerGetOnlineId(vm::ptr onlineId) return not_an_error(SCE_NP_ERROR_OFFLINE); } - if (nph.get_psn_status() != SCE_NP_MANAGER_STATUS_LOGGING_IN && nph.get_psn_status() != SCE_NP_MANAGER_STATUS_ONLINE) + if (nph.get_psn_status() != SCE_NP_MANAGER_STATUS_LOGGING_IN && + nph.get_psn_status() != SCE_NP_MANAGER_STATUS_ONLINE) { return SCE_NP_ERROR_INVALID_STATE; } @@ -3826,7 +4162,8 @@ error_code sceNpManagerGetNpId(vm::ptr npId) return not_an_error(SCE_NP_ERROR_OFFLINE); } - if (nph.get_psn_status() != SCE_NP_MANAGER_STATUS_LOGGING_IN && nph.get_psn_status() != SCE_NP_MANAGER_STATUS_ONLINE) + if (nph.get_psn_status() != SCE_NP_MANAGER_STATUS_LOGGING_IN && + nph.get_psn_status() != SCE_NP_MANAGER_STATUS_ONLINE) { return SCE_NP_ERROR_INVALID_STATE; } @@ -3836,7 +4173,8 @@ error_code sceNpManagerGetNpId(vm::ptr npId) return CELL_OK; } -error_code sceNpManagerGetOnlineName(ppu_thread& ppu, vm::ptr onlineName) +error_code sceNpManagerGetOnlineName(ppu_thread& ppu, + vm::ptr onlineName) { ppu.state += cpu_flag::wait; @@ -3870,7 +4208,8 @@ error_code sceNpManagerGetOnlineName(ppu_thread& ppu, vm::ptr o return CELL_OK; } -error_code sceNpManagerGetAvatarUrl(ppu_thread& ppu, vm::ptr avatarUrl) +error_code sceNpManagerGetAvatarUrl(ppu_thread& ppu, + vm::ptr avatarUrl) { ppu.state += cpu_flag::wait; @@ -3937,9 +4276,12 @@ error_code sceNpManagerGetMyLanguages(vm::ptr myLanguages) return CELL_OK; } -error_code sceNpManagerGetAccountRegion(vm::ptr countryCode, vm::ptr language) +error_code sceNpManagerGetAccountRegion(vm::ptr countryCode, + vm::ptr language) { - sceNp.warning("sceNpManagerGetAccountRegion(countryCode=*0x%x, language=*0x%x)", countryCode, language); + sceNp.warning( + "sceNpManagerGetAccountRegion(countryCode=*0x%x, language=*0x%x)", + countryCode, language); auto& nph = g_fxo->get>(); @@ -3958,7 +4300,8 @@ error_code sceNpManagerGetAccountRegion(vm::ptr countryCode, v return not_an_error(SCE_NP_ERROR_OFFLINE); } - if (nph.get_psn_status() != SCE_NP_MANAGER_STATUS_LOGGING_IN && nph.get_psn_status() != SCE_NP_MANAGER_STATUS_ONLINE) + if (nph.get_psn_status() != SCE_NP_MANAGER_STATUS_LOGGING_IN && + nph.get_psn_status() != SCE_NP_MANAGER_STATUS_ONLINE) { return SCE_NP_ERROR_INVALID_STATE; } @@ -3994,7 +4337,8 @@ error_code sceNpManagerGetAccountAge(vm::ptr age) return not_an_error(SCE_NP_ERROR_OFFLINE); } - if (nph.get_psn_status() != SCE_NP_MANAGER_STATUS_LOGGING_IN && nph.get_psn_status() != SCE_NP_MANAGER_STATUS_ONLINE) + if (nph.get_psn_status() != SCE_NP_MANAGER_STATUS_LOGGING_IN && + nph.get_psn_status() != SCE_NP_MANAGER_STATUS_ONLINE) { return SCE_NP_ERROR_INVALID_STATE; } @@ -4004,9 +4348,11 @@ error_code sceNpManagerGetAccountAge(vm::ptr age) return CELL_OK; } -error_code sceNpManagerGetContentRatingFlag(vm::ptr isRestricted, vm::ptr age) +error_code sceNpManagerGetContentRatingFlag(vm::ptr isRestricted, + vm::ptr age) { - sceNp.trace("sceNpManagerGetContentRatingFlag(isRestricted=*0x%x, age=*0x%x)", isRestricted, age); + sceNp.trace("sceNpManagerGetContentRatingFlag(isRestricted=*0x%x, age=*0x%x)", + isRestricted, age); auto& nph = g_fxo->get>(); @@ -4025,7 +4371,8 @@ error_code sceNpManagerGetContentRatingFlag(vm::ptr isRestricted, vm::ptr isRestricted, vm::ptr isRestricted) { - sceNp.trace("sceNpManagerGetChatRestrictionFlag(isRestricted=*0x%x)", isRestricted); + sceNp.trace("sceNpManagerGetChatRestrictionFlag(isRestricted=*0x%x)", + isRestricted); auto& nph = g_fxo->get>(); @@ -4058,7 +4406,8 @@ error_code sceNpManagerGetChatRestrictionFlag(vm::ptr isRestricted) return not_an_error(SCE_NP_ERROR_OFFLINE); } - if (nph.get_psn_status() != SCE_NP_MANAGER_STATUS_LOGGING_IN && nph.get_psn_status() != SCE_NP_MANAGER_STATUS_ONLINE) + if (nph.get_psn_status() != SCE_NP_MANAGER_STATUS_LOGGING_IN && + nph.get_psn_status() != SCE_NP_MANAGER_STATUS_ONLINE) { return SCE_NP_ERROR_INVALID_STATE; } @@ -4069,9 +4418,11 @@ error_code sceNpManagerGetChatRestrictionFlag(vm::ptr isRestricted) return CELL_OK; } -error_code sceNpManagerGetCachedInfo(CellSysutilUserId userId, vm::ptr param) +error_code sceNpManagerGetCachedInfo(CellSysutilUserId userId, + vm::ptr param) { - sceNp.warning("sceNpManagerGetCachedInfo(userId=%d, param=*0x%x)", userId, param); + sceNp.warning("sceNpManagerGetCachedInfo(userId=%d, param=*0x%x)", userId, + param); auto& nph = g_fxo->get>(); @@ -4106,9 +4457,16 @@ error_code sceNpManagerGetPsHandle(vm::ptr onlineId) return sceNpManagerGetOnlineId(onlineId); } -error_code sceNpManagerRequestTicket(vm::cptr npId, vm::cptr serviceId, vm::cptr cookie, u32 cookieSize, vm::cptr entitlementId, u32 consumedCount) +error_code sceNpManagerRequestTicket(vm::cptr npId, + vm::cptr serviceId, + vm::cptr cookie, u32 cookieSize, + vm::cptr entitlementId, + u32 consumedCount) { - sceNp.warning("sceNpManagerRequestTicket(npId=*0x%x, serviceId=%s, cookie=*0x%x, cookieSize=%d, entitlementId=%s, consumedCount=%d)", npId, serviceId, cookie, cookieSize, entitlementId, consumedCount); + sceNp.warning( + "sceNpManagerRequestTicket(npId=*0x%x, serviceId=%s, cookie=*0x%x, " + "cookieSize=%d, entitlementId=%s, consumedCount=%d)", + npId, serviceId, cookie, cookieSize, entitlementId, consumedCount); auto& nph = g_fxo->get>(); @@ -4127,21 +4485,31 @@ error_code sceNpManagerRequestTicket(vm::cptr npId, vm::cptr serv return not_an_error(SCE_NP_ERROR_OFFLINE); } - if (nph.get_psn_status() != SCE_NP_MANAGER_STATUS_LOGGING_IN && nph.get_psn_status() != SCE_NP_MANAGER_STATUS_ONLINE) + if (nph.get_psn_status() != SCE_NP_MANAGER_STATUS_LOGGING_IN && + nph.get_psn_status() != SCE_NP_MANAGER_STATUS_ONLINE) { return SCE_NP_ERROR_INVALID_STATE; } - nph.req_ticket(0x00020001, npId.get_ptr(), serviceId.get_ptr(), static_cast(cookie.get_ptr()), cookieSize, entitlementId.get_ptr(), consumedCount); + nph.req_ticket(0x00020001, npId.get_ptr(), serviceId.get_ptr(), + static_cast(cookie.get_ptr()), cookieSize, + entitlementId.get_ptr(), consumedCount); return CELL_OK; } -error_code sceNpManagerRequestTicket2(vm::cptr npId, vm::cptr version, vm::cptr serviceId, - vm::cptr cookie, u32 cookieSize, vm::cptr entitlementId, u32 consumedCount) +error_code sceNpManagerRequestTicket2(vm::cptr npId, + vm::cptr version, + vm::cptr serviceId, + vm::cptr cookie, u32 cookieSize, + vm::cptr entitlementId, + u32 consumedCount) { - sceNp.warning("sceNpManagerRequestTicket2(npId=*0x%x, version=*0x%x, serviceId=%s, cookie=*0x%x, cookieSize=%d, entitlementId=%s, consumedCount=%d)", npId, version, serviceId, cookie, cookieSize, - entitlementId, consumedCount); + sceNp.warning( + "sceNpManagerRequestTicket2(npId=*0x%x, version=*0x%x, serviceId=%s, " + "cookie=*0x%x, cookieSize=%d, entitlementId=%s, consumedCount=%d)", + npId, version, serviceId, cookie, cookieSize, entitlementId, + consumedCount); auto& nph = g_fxo->get>(); @@ -4160,19 +4528,24 @@ error_code sceNpManagerRequestTicket2(vm::cptr npId, vm::cptr(cookie.get_ptr()), cookieSize, entitlementId.get_ptr(), consumedCount); + nph.req_ticket(0x00020001, npId.get_ptr(), serviceId.get_ptr(), + static_cast(cookie.get_ptr()), cookieSize, + entitlementId.get_ptr(), consumedCount); return CELL_OK; } -error_code sceNpManagerGetTicket(vm::ptr buffer, vm::ptr bufferSize) +error_code sceNpManagerGetTicket(vm::ptr buffer, + vm::ptr bufferSize) { - sceNp.warning("sceNpManagerGetTicket(buffer=*0x%x, bufferSize=*0x%x)", buffer, bufferSize); + sceNp.warning("sceNpManagerGetTicket(buffer=*0x%x, bufferSize=*0x%x)", buffer, + bufferSize); auto& nph = g_fxo->get>(); @@ -4204,9 +4577,11 @@ error_code sceNpManagerGetTicket(vm::ptr buffer, vm::ptr bufferSize) return CELL_OK; } -error_code sceNpManagerGetTicketParam(s32 paramId, vm::ptr param) +error_code sceNpManagerGetTicketParam(s32 paramId, + vm::ptr param) { - sceNp.notice("sceNpManagerGetTicketParam(paramId=%d, param=*0x%x)", paramId, param); + sceNp.notice("sceNpManagerGetTicketParam(paramId=%d, param=*0x%x)", paramId, + param); auto& nph = g_fxo->get>(); @@ -4215,7 +4590,8 @@ error_code sceNpManagerGetTicketParam(s32 paramId, vm::ptr par return SCE_NP_ERROR_NOT_INITIALIZED; } - if (!param || paramId < SCE_NP_TICKET_PARAM_SERIAL_ID || paramId > SCE_NP_TICKET_PARAM_SUBJECT_DOB) + if (!param || paramId < SCE_NP_TICKET_PARAM_SERIAL_ID || + paramId > SCE_NP_TICKET_PARAM_SUBJECT_DOB) { return SCE_NP_ERROR_INVALID_ARGUMENT; } @@ -4235,9 +4611,13 @@ error_code sceNpManagerGetTicketParam(s32 paramId, vm::ptr par return CELL_OK; } -error_code sceNpManagerGetEntitlementIdList(vm::ptr entIdList, u32 entIdListNum) +error_code +sceNpManagerGetEntitlementIdList(vm::ptr entIdList, + u32 entIdListNum) { - sceNp.todo("sceNpManagerGetEntitlementIdList(entIdList=*0x%x, entIdListNum=%d)", entIdList, entIdListNum); + sceNp.todo( + "sceNpManagerGetEntitlementIdList(entIdList=*0x%x, entIdListNum=%d)", + entIdList, entIdListNum); auto& nph = g_fxo->get>(); @@ -4249,7 +4629,8 @@ error_code sceNpManagerGetEntitlementIdList(vm::ptr entIdLis return not_an_error(0); } -error_code sceNpManagerGetEntitlementById(vm::cptr entId, vm::ptr ent) +error_code sceNpManagerGetEntitlementById(vm::cptr entId, + vm::ptr ent) { sceNp.todo("sceNpManagerGetEntitlementById(entId=%s, ent=*0x%x)", entId, ent); @@ -4284,14 +4665,19 @@ error_code sceNpManagerGetSigninId(vm::ptr signInId) return SCE_NP_ERROR_INVALID_ARGUMENT; } - std::memset(signInId.get_ptr(), 0, 64); // signInId seems to be a 64 byte thing + std::memset(signInId.get_ptr(), 0, + 64); // signInId seems to be a 64 byte thing return CELL_OK; } -error_code sceNpManagerSubSignin(CellSysutilUserId userId, vm::ptr cb_func, vm::ptr cb_arg, s32 flag) +error_code sceNpManagerSubSignin(CellSysutilUserId userId, + vm::ptr cb_func, + vm::ptr cb_arg, s32 flag) { - sceNp.todo("sceNpManagerSubSignin(userId=%d, cb_func=*0x%x, cb_arg=*0x%x, flag=%d)", userId, cb_func, cb_arg, flag); + sceNp.todo( + "sceNpManagerSubSignin(userId=%d, cb_func=*0x%x, cb_arg=*0x%x, flag=%d)", + userId, cb_func, cb_arg, flag); auto& nph = g_fxo->get>(); @@ -4413,23 +4799,19 @@ error_code check_text(vm::cptr text) if (c < '\0') { - if ((val & 0xe0) == 0xc0 && val > 0xc1 && - (text[1] & 0xc0U) == 0x80) + if ((val & 0xe0) == 0xc0 && val > 0xc1 && (text[1] & 0xc0U) == 0x80) { text += 2; } - else if ((val & 0xf0) == 0xe0 && - (text[1] & 0xc0U) == 0x80 && + else if ((val & 0xf0) == 0xe0 && (text[1] & 0xc0U) == 0x80 && (text[2] & 0xc0U) == 0x80) { text += 3; } else { - if ((val & 0xf8) != 0xf0 || - (text[1] & 0xc0U) != 0x80 || - (text[2] & 0xc0U) != 0x80 || - (text[3] & 0xc0U) != 0x80) + if ((val & 0xf8) != 0xf0 || (text[1] & 0xc0U) != 0x80 || + (text[2] & 0xc0U) != 0x80 || (text[3] & 0xc0U) != 0x80) { return SCE_NP_UTIL_ERROR_INVALID_CHARACTER; } @@ -4450,9 +4832,13 @@ error_code check_text(vm::cptr text) return not_an_error(count); } -error_code sceNpMatchingCreateCtx(vm::ptr npId, vm::ptr handler, vm::ptr arg, vm::ptr ctx_id) +error_code sceNpMatchingCreateCtx(vm::ptr npId, + vm::ptr handler, + vm::ptr arg, vm::ptr ctx_id) { - sceNp.warning("sceNpMatchingCreateCtx(npId=*0x%x, handler=*0x%x, arg=*0x%x, ctx_id=*0x%x)", npId, handler, arg, ctx_id); + sceNp.warning("sceNpMatchingCreateCtx(npId=*0x%x, handler=*0x%x, arg=*0x%x, " + "ctx_id=*0x%x)", + npId, handler, arg, ctx_id); auto& nph = g_fxo->get>(); @@ -4505,9 +4891,12 @@ error_code sceNpMatchingDestroyCtx(u32 ctx_id) return CELL_OK; } -error_code sceNpMatchingGetResult(u32 ctx_id, u32 req_id, vm::ptr buf, vm::ptr size, vm::ptr event) +error_code sceNpMatchingGetResult(u32 ctx_id, u32 req_id, vm::ptr buf, + vm::ptr size, vm::ptr event) { - sceNp.warning("sceNpMatchingGetResult(ctx_id=%d, req_id=%d, buf=*0x%x, size=*0x%x, event=*0x%x)", ctx_id, req_id, buf, size, event); + sceNp.warning("sceNpMatchingGetResult(ctx_id=%d, req_id=%d, buf=*0x%x, " + "size=*0x%x, event=*0x%x)", + ctx_id, req_id, buf, size, event); auto& nph = g_fxo->get>(); @@ -4522,14 +4911,16 @@ error_code sceNpMatchingGetResult(u32 ctx_id, u32 req_id, vm::ptr buf, vm: return nph.get_matching_result(ctx_id, req_id, buf, size, event); - // const u64 id_check = static_cast(static_cast(req_id)) >> 0x17 & 0x3f; - // if (id_check > 32 || (1ULL << id_check & 0x1f89ad040U) == 0) - // return SCE_NP_MATCHING_ERROR_INVALID_REQ_ID; + // const u64 id_check = static_cast(static_cast(req_id)) >> 0x17 & + // 0x3f; if (id_check > 32 || (1ULL << id_check & 0x1f89ad040U) == 0) return + // SCE_NP_MATCHING_ERROR_INVALID_REQ_ID; } -error_code sceNpMatchingGetResultGUI(vm::ptr buf, vm::ptr size, vm::ptr event) +error_code sceNpMatchingGetResultGUI(vm::ptr buf, vm::ptr size, + vm::ptr event) { - sceNp.warning("sceNpMatchingGetResultGUI(buf=*0x%x, size=*0x%x, event=*0x%x)", buf, size, event); + sceNp.warning("sceNpMatchingGetResultGUI(buf=*0x%x, size=*0x%x, event=*0x%x)", + buf, size, event); auto& nph = g_fxo->get>(); @@ -4542,7 +4933,10 @@ error_code sceNpMatchingGetResultGUI(vm::ptr buf, vm::ptr size, vm::p return nph.get_result_gui(buf, size, event); } -error_code matching_set_room_info(u32 ctx_id, vm::ptr lobby_id, vm::ptr room_id, vm::ptr attr, vm::ptr req_id, bool limit) +error_code matching_set_room_info(u32 ctx_id, vm::ptr lobby_id, + vm::ptr room_id, + vm::ptr attr, + vm::ptr req_id, bool limit) { auto& nph = g_fxo->get>(); @@ -4578,21 +4972,35 @@ error_code matching_set_room_info(u32 ctx_id, vm::ptr lobby_id, vm return CELL_OK; } -error_code sceNpMatchingSetRoomInfo(u32 ctx_id, vm::ptr lobby_id, vm::ptr room_id, vm::ptr attr, vm::ptr req_id) +error_code sceNpMatchingSetRoomInfo(u32 ctx_id, vm::ptr lobby_id, + vm::ptr room_id, + vm::ptr attr, + vm::ptr req_id) { - sceNp.warning("sceNpMatchingSetRoomInfo(ctx_id=%d, lobby_id=*0x%x, room_id=*0x%x, attr=*0x%x, req_id=*0x%x)", ctx_id, lobby_id, room_id, attr, req_id); + sceNp.warning("sceNpMatchingSetRoomInfo(ctx_id=%d, lobby_id=*0x%x, " + "room_id=*0x%x, attr=*0x%x, req_id=*0x%x)", + ctx_id, lobby_id, room_id, attr, req_id); return matching_set_room_info(ctx_id, lobby_id, room_id, attr, req_id, true); } -error_code sceNpMatchingSetRoomInfoNoLimit(u32 ctx_id, vm::ptr lobby_id, vm::ptr room_id, vm::ptr attr, vm::ptr req_id) +error_code sceNpMatchingSetRoomInfoNoLimit(u32 ctx_id, + vm::ptr lobby_id, + vm::ptr room_id, + vm::ptr attr, + vm::ptr req_id) { - sceNp.warning("sceNpMatchingSetRoomInfoNoLimit(ctx_id=%d, lobby_id=*0x%x, room_id=*0x%x, attr=*0x%x, req_id=*0x%x)", ctx_id, lobby_id, room_id, attr, req_id); + sceNp.warning("sceNpMatchingSetRoomInfoNoLimit(ctx_id=%d, lobby_id=*0x%x, " + "room_id=*0x%x, attr=*0x%x, req_id=*0x%x)", + ctx_id, lobby_id, room_id, attr, req_id); return matching_set_room_info(ctx_id, lobby_id, room_id, attr, req_id, false); } -error_code matching_get_room_info(u32 ctx_id, vm::ptr lobby_id, vm::ptr room_id, vm::ptr attr, vm::ptr req_id, bool limit) +error_code matching_get_room_info(u32 ctx_id, vm::ptr lobby_id, + vm::ptr room_id, + vm::ptr attr, + vm::ptr req_id, bool limit) { auto& nph = g_fxo->get>(); @@ -4628,23 +5036,39 @@ error_code matching_get_room_info(u32 ctx_id, vm::ptr lobby_id, vm return CELL_OK; } -error_code sceNpMatchingGetRoomInfo(u32 ctx_id, vm::ptr lobby_id, vm::ptr room_id, vm::ptr attr, vm::ptr req_id) +error_code sceNpMatchingGetRoomInfo(u32 ctx_id, vm::ptr lobby_id, + vm::ptr room_id, + vm::ptr attr, + vm::ptr req_id) { - sceNp.warning("sceNpMatchingGetRoomInfo(ctx_id=%d, lobby_id=*0x%x, room_id=*0x%x, attr=*0x%x, req_id=*0x%x)", ctx_id, lobby_id, room_id, attr, req_id); + sceNp.warning("sceNpMatchingGetRoomInfo(ctx_id=%d, lobby_id=*0x%x, " + "room_id=*0x%x, attr=*0x%x, req_id=*0x%x)", + ctx_id, lobby_id, room_id, attr, req_id); return matching_get_room_info(ctx_id, lobby_id, room_id, attr, req_id, true); } -error_code sceNpMatchingGetRoomInfoNoLimit(u32 ctx_id, vm::ptr lobby_id, vm::ptr room_id, vm::ptr attr, vm::ptr req_id) +error_code sceNpMatchingGetRoomInfoNoLimit(u32 ctx_id, + vm::ptr lobby_id, + vm::ptr room_id, + vm::ptr attr, + vm::ptr req_id) { - sceNp.warning("sceNpMatchingGetRoomInfoNoLimit(ctx_id=%d, lobby_id=*0x%x, room_id=*0x%x, attr=*0x%x, req_id=*0x%x)", ctx_id, lobby_id, room_id, attr, req_id); + sceNp.warning("sceNpMatchingGetRoomInfoNoLimit(ctx_id=%d, lobby_id=*0x%x, " + "room_id=*0x%x, attr=*0x%x, req_id=*0x%x)", + ctx_id, lobby_id, room_id, attr, req_id); return matching_get_room_info(ctx_id, lobby_id, room_id, attr, req_id, false); } -error_code sceNpMatchingSetRoomSearchFlag(u32 ctx_id, vm::ptr lobby_id, vm::ptr room_id, s32 flag, vm::ptr req_id) +error_code sceNpMatchingSetRoomSearchFlag(u32 ctx_id, + vm::ptr lobby_id, + vm::ptr room_id, + s32 flag, vm::ptr req_id) { - sceNp.warning("sceNpMatchingSetRoomSearchFlag(ctx_id=%d, lobby_id=*0x%x, room_id=*0x%x, flag=%d, req_id=*0x%x)", ctx_id, lobby_id, room_id, flag, req_id); + sceNp.warning("sceNpMatchingSetRoomSearchFlag(ctx_id=%d, lobby_id=*0x%x, " + "room_id=*0x%x, flag=%d, req_id=*0x%x)", + ctx_id, lobby_id, room_id, flag, req_id); auto& nph = g_fxo->get>(); @@ -4654,7 +5078,9 @@ error_code sceNpMatchingSetRoomSearchFlag(u32 ctx_id, vm::ptr lobb if (!nph.is_NP_init) return SCE_NP_MATCHING_ERROR_NOT_INITIALIZED; - if (!lobby_id || !room_id || !req_id || (flag < SCE_NP_MATCHING_ROOM_SEARCH_FLAG_OPEN || flag > SCE_NP_MATCHING_ROOM_SEARCH_FLAG_STEALTH)) + if (!lobby_id || !room_id || !req_id || + (flag < SCE_NP_MATCHING_ROOM_SEARCH_FLAG_OPEN || + flag > SCE_NP_MATCHING_ROOM_SEARCH_FLAG_STEALTH)) return SCE_NP_MATCHING_ERROR_INVALID_ARG; auto res = nph.set_room_search_flag_gui(ctx_id, lobby_id, room_id, flag); @@ -4666,9 +5092,14 @@ error_code sceNpMatchingSetRoomSearchFlag(u32 ctx_id, vm::ptr lobb return CELL_OK; } -error_code sceNpMatchingGetRoomSearchFlag(u32 ctx_id, vm::ptr lobby_id, vm::ptr room_id, vm::ptr req_id) +error_code sceNpMatchingGetRoomSearchFlag(u32 ctx_id, + vm::ptr lobby_id, + vm::ptr room_id, + vm::ptr req_id) { - sceNp.warning("sceNpMatchingGetRoomSearchFlag(ctx_id=%d, lobby_id=*0x%x, room_id=*0x%x, req_id=*0x%x)", ctx_id, lobby_id, room_id, req_id); + sceNp.warning("sceNpMatchingGetRoomSearchFlag(ctx_id=%d, lobby_id=*0x%x, " + "room_id=*0x%x, req_id=*0x%x)", + ctx_id, lobby_id, room_id, req_id); auto& nph = g_fxo->get>(); @@ -4690,7 +5121,10 @@ error_code sceNpMatchingGetRoomSearchFlag(u32 ctx_id, vm::ptr lobb return CELL_OK; } -error_code matching_get_room_member_list(u32 ctx_id, vm::ptr room_id, vm::ptr buflen, vm::ptr buf) +error_code matching_get_room_member_list(u32 ctx_id, + vm::ptr room_id, + vm::ptr buflen, + vm::ptr buf) { auto& nph = g_fxo->get>(); @@ -4706,16 +5140,26 @@ error_code matching_get_room_member_list(u32 ctx_id, vm::ptr room_i return nph.get_room_member_list_local_gui(ctx_id, room_id, buflen, buf); } -error_code sceNpMatchingGetRoomMemberListLocal(u32 ctx_id, vm::ptr room_id, vm::ptr buflen, vm::ptr buf) +error_code sceNpMatchingGetRoomMemberListLocal(u32 ctx_id, + vm::ptr room_id, + vm::ptr buflen, + vm::ptr buf) { - sceNp.warning("sceNpMatchingGetRoomMemberListLocal(ctx_id=%d, room_id=*0x%x, buflen=*0x%x, buf=*0x%x)", ctx_id, room_id, buflen, buf); + sceNp.warning("sceNpMatchingGetRoomMemberListLocal(ctx_id=%d, room_id=*0x%x, " + "buflen=*0x%x, buf=*0x%x)", + ctx_id, room_id, buflen, buf); return matching_get_room_member_list(ctx_id, room_id, buflen, buf); } // FUN_00014bdc -error_code check_room_list_params([[maybe_unused]] u32 ctx_id, vm::ptr communicationId, vm::ptr range, vm::ptr cond, - vm::ptr attribute, vm::ptr handler, int param_7, int param_8) +error_code check_room_list_params([[maybe_unused]] u32 ctx_id, + vm::ptr communicationId, + vm::ptr range, + vm::ptr cond, + vm::ptr attribute, + vm::ptr handler, + int param_7, int param_8) { if (!communicationId || !range || !handler) return SCE_NP_MATCHING_ERROR_INVALID_ARG; @@ -4782,8 +5226,13 @@ error_code check_room_list_params([[maybe_unused]] u32 ctx_id, vm::ptr communicationId, vm::ptr range, vm::ptr cond, - vm::ptr attr, vm::ptr handler, vm::ptr arg, bool limit) +error_code matching_get_room_list(u32 ctx_id, + vm::ptr communicationId, + vm::ptr range, + vm::ptr cond, + vm::ptr attr, + vm::ptr handler, + vm::ptr arg, bool limit) { auto& nph = g_fxo->get>(); @@ -4793,24 +5242,38 @@ error_code matching_get_room_list(u32 ctx_id, vm::ptr comm // TODO: add limiter // This check is used in all sceNpMatchingGetRoomList functions - error_code err = check_room_list_params(ctx_id, communicationId, range, cond, attr, handler, 1, 0); + error_code err = check_room_list_params(ctx_id, communicationId, range, cond, + attr, handler, 1, 0); if (err != CELL_OK) return err; - return nph.get_room_list_gui(ctx_id, communicationId, range, cond, attr, handler, arg, limit); + return nph.get_room_list_gui(ctx_id, communicationId, range, cond, attr, + handler, arg, limit); } -error_code sceNpMatchingGetRoomListLimitGUI(u32 ctx_id, vm::ptr communicationId, vm::ptr range, vm::ptr cond, - vm::ptr attr, vm::ptr handler, vm::ptr arg) +error_code sceNpMatchingGetRoomListLimitGUI( + u32 ctx_id, vm::ptr communicationId, + vm::ptr range, + vm::ptr cond, vm::ptr attr, + vm::ptr handler, vm::ptr arg) { - sceNp.warning("sceNpMatchingGetRoomListLimitGUI(ctx_id=%d, communicationId=*0x%x, range=*0x%x, cond=*0x%x, attr=*0x%x, handler=*0x%x, arg=*0x%x)", ctx_id, communicationId, range, cond, attr, handler, arg); + sceNp.warning( + "sceNpMatchingGetRoomListLimitGUI(ctx_id=%d, communicationId=*0x%x, " + "range=*0x%x, cond=*0x%x, attr=*0x%x, handler=*0x%x, arg=*0x%x)", + ctx_id, communicationId, range, cond, attr, handler, arg); - return matching_get_room_list(ctx_id, communicationId, range, cond, attr, handler, arg, true); + return matching_get_room_list(ctx_id, communicationId, range, cond, attr, + handler, arg, true); } -error_code sceNpMatchingKickRoomMember(u32 ctx_id, vm::cptr room_id, vm::cptr user_id, vm::ptr req_id) +error_code sceNpMatchingKickRoomMember(u32 ctx_id, + vm::cptr room_id, + vm::cptr user_id, + vm::ptr req_id) { - sceNp.todo("sceNpMatchingKickRoomMember(ctx_id=%d, room_id=*0x%x, user_id=*0x%x, req_id=*0x%x)", ctx_id, room_id, user_id, req_id); + sceNp.todo("sceNpMatchingKickRoomMember(ctx_id=%d, room_id=*0x%x, " + "user_id=*0x%x, req_id=*0x%x)", + ctx_id, room_id, user_id, req_id); auto& nph = g_fxo->get>(); @@ -4832,9 +5295,15 @@ error_code sceNpMatchingKickRoomMember(u32 ctx_id, vm::cptr room_id return CELL_OK; } -error_code sceNpMatchingKickRoomMemberWithOpt(u32 ctx_id, vm::cptr room_id, vm::cptr user_id, vm::cptr opt, s32 opt_len, vm::ptr req_id) +error_code sceNpMatchingKickRoomMemberWithOpt(u32 ctx_id, + vm::cptr room_id, + vm::cptr user_id, + vm::cptr opt, s32 opt_len, + vm::ptr req_id) { - sceNp.todo("sceNpMatchingKickRoomMemberWithOpt(ctx_id=%d, room_id=*0x%x, user_id=*0x%x, opt=*0x%x, opt_len=%d, req_id=*0x%x)", ctx_id, room_id, user_id, opt, opt_len, req_id); + sceNp.todo("sceNpMatchingKickRoomMemberWithOpt(ctx_id=%d, room_id=*0x%x, " + "user_id=*0x%x, opt=*0x%x, opt_len=%d, req_id=*0x%x)", + ctx_id, room_id, user_id, opt, opt_len, req_id); auto& nph = g_fxo->get>(); @@ -4859,11 +5328,15 @@ error_code sceNpMatchingKickRoomMemberWithOpt(u32 ctx_id, vm::cptr return CELL_OK; } -error_code sceNpMatchingQuickMatchGUI(u32 ctx_id, vm::cptr communicationId, vm::cptr cond, s32 available_num, s32 timeout, +error_code sceNpMatchingQuickMatchGUI( + u32 ctx_id, vm::cptr communicationId, + vm::cptr cond, s32 available_num, s32 timeout, vm::ptr handler, vm::ptr arg) { - sceNp.warning("sceNpMatchingQuickMatchGUI(ctx_id=%d, communicationId=*0x%x, cond=*0x%x, available_num=%d, timeout=%d, handler=*0x%x, arg=*0x%x)", ctx_id, communicationId, cond, available_num, timeout, - handler, arg); + sceNp.warning( + "sceNpMatchingQuickMatchGUI(ctx_id=%d, communicationId=*0x%x, " + "cond=*0x%x, available_num=%d, timeout=%d, handler=*0x%x, arg=*0x%x)", + ctx_id, communicationId, cond, available_num, timeout, handler, arg); auto& nph = g_fxo->get>(); @@ -4885,7 +5358,8 @@ error_code sceNpMatchingQuickMatchGUI(u32 ctx_id, vm::cptr con->comp_op > SCE_NP_MATCHING_CONDITION_SEARCH_NE) return SCE_NP_MATCHING_ERROR_INVALID_COMP_OP; - if (con->comp_type == 1) // weird, should be != SCE_NP_MATCHING_CONDITION_TYPE_VALUE + if (con->comp_type == + 1) // weird, should be != SCE_NP_MATCHING_CONDITION_TYPE_VALUE return SCE_NP_MATCHING_ERROR_INVALID_COMP_TYPE; switch (con->target_attr_type) @@ -4907,21 +5381,30 @@ error_code sceNpMatchingQuickMatchGUI(u32 ctx_id, vm::cptr } } - return nph.quickmatch_gui(ctx_id, communicationId, cond, available_num, timeout, handler, arg); + return nph.quickmatch_gui(ctx_id, communicationId, cond, available_num, + timeout, handler, arg); } -error_code sceNpMatchingSendInvitationGUI(u32 ctx_id, vm::cptr room_id, vm::cptr communicationId, vm::cptr dsts, s32 num, s32 slot_type, - vm::cptr subject, vm::cptr body, sys_memory_container_t container, vm::ptr handler, vm::ptr arg) +error_code sceNpMatchingSendInvitationGUI( + u32 ctx_id, vm::cptr room_id, + vm::cptr communicationId, vm::cptr dsts, + s32 num, s32 slot_type, vm::cptr subject, vm::cptr body, + sys_memory_container_t container, vm::ptr handler, + vm::ptr arg) { - sceNp.todo("sceNpMatchingSendInvitationGUI(ctx_id=%d, room_id=*0x%x, communicationId=*0x%x, dsts=*0x%x, num=%d, slot_type=%d, subject=%s, body=%s, container=%d, handler=*0x%x, arg=*0x%x)", ctx_id, - room_id, communicationId, dsts, num, slot_type, subject, body, container, handler, arg); + sceNp.todo("sceNpMatchingSendInvitationGUI(ctx_id=%d, room_id=*0x%x, " + "communicationId=*0x%x, dsts=*0x%x, num=%d, slot_type=%d, " + "subject=%s, body=%s, container=%d, handler=*0x%x, arg=*0x%x)", + ctx_id, room_id, communicationId, dsts, num, slot_type, subject, + body, container, handler, arg); auto& nph = g_fxo->get>(); if (nph.is_NP2_Match2_init) return SCE_NP_MATCHING_ERROR_UTILITY_UNAVAILABLE; - if (!room_id || !communicationId || !subject || !body) // TODO: || (in_stack_0000007c != 0) + if (!room_id || !communicationId || !subject || + !body) // TODO: || (in_stack_0000007c != 0) return SCE_NP_MATCHING_ERROR_INVALID_ARG; if (dsts && (num <= 0 || num > SCE_NP_MATCHING_INVITATION_DESTINATION_MAX)) @@ -4941,7 +5424,8 @@ error_code sceNpMatchingSendInvitationGUI(u32 ctx_id, vm::cptr room if (err > 128) return SCE_NP_MATCHING_ERROR_INVALID_ARG; - if (slot_type < SCE_NP_MATCHING_ROOM_SLOT_TYPE_PUBLIC || slot_type > SCE_NP_MATCHING_ROOM_SLOT_TYPE_PRIVATE) + if (slot_type < SCE_NP_MATCHING_ROOM_SLOT_TYPE_PUBLIC || + slot_type > SCE_NP_MATCHING_ROOM_SLOT_TYPE_PRIVATE) return SCE_NP_MATCHING_ERROR_INVALID_ARG; if (false) // TODO @@ -4958,9 +5442,14 @@ error_code sceNpMatchingSendInvitationGUI(u32 ctx_id, vm::cptr room return err; } -error_code sceNpMatchingAcceptInvitationGUI(u32 ctx_id, vm::cptr communicationId, sys_memory_container_t container, vm::ptr handler, vm::ptr arg) +error_code sceNpMatchingAcceptInvitationGUI( + u32 ctx_id, vm::cptr communicationId, + sys_memory_container_t container, vm::ptr handler, + vm::ptr arg) { - sceNp.todo("sceNpMatchingAcceptInvitationGUI(ctx_id=%d, communicationId=*0x%x, container=%d, handler=*0x%x, arg=*0x%x)", ctx_id, communicationId, container, handler, arg); + sceNp.todo("sceNpMatchingAcceptInvitationGUI(ctx_id=%d, " + "communicationId=*0x%x, container=%d, handler=*0x%x, arg=*0x%x)", + ctx_id, communicationId, container, handler, arg); auto& nph = g_fxo->get>(); @@ -5053,7 +5542,11 @@ error_code check_attr_create_room(vm::cptr attribute) return SCE_NP_MATCHING_ERROR_ATTR_NOT_SPECIFIED; } -error_code matching_create_room(u32 ctx_id, vm::cptr communicationId, vm::cptr attr, vm::ptr handler, vm::ptr arg) +error_code matching_create_room(u32 ctx_id, + vm::cptr communicationId, + vm::cptr attr, + vm::ptr handler, + vm::ptr arg) { auto& nph = g_fxo->get>(); @@ -5073,14 +5566,21 @@ error_code matching_create_room(u32 ctx_id, vm::cptr commu return nph.create_room_gui(ctx_id, communicationId, attr, handler, arg); } -error_code sceNpMatchingCreateRoomGUI(u32 ctx_id, vm::cptr communicationId, vm::cptr attr, vm::ptr handler, vm::ptr arg) +error_code sceNpMatchingCreateRoomGUI( + u32 ctx_id, vm::cptr communicationId, + vm::cptr attr, vm::ptr handler, + vm::ptr arg) { - sceNp.warning("sceNpMatchingCreateRoomGUI(ctx_id=%d, communicationId=*0x%x, attr=*0x%x, handler=*0x%x, arg=*0x%x)", ctx_id, communicationId, attr, handler, arg); + sceNp.warning("sceNpMatchingCreateRoomGUI(ctx_id=%d, communicationId=*0x%x, " + "attr=*0x%x, handler=*0x%x, arg=*0x%x)", + ctx_id, communicationId, attr, handler, arg); return matching_create_room(ctx_id, communicationId, attr, handler, arg); } -error_code matching_join_room(u32 ctx_id, vm::ptr room_id, vm::ptr handler, vm::ptr arg) +error_code matching_join_room(u32 ctx_id, vm::ptr room_id, + vm::ptr handler, + vm::ptr arg) { auto& nph = g_fxo->get>(); @@ -5093,16 +5593,23 @@ error_code matching_join_room(u32 ctx_id, vm::ptr room_id, vm::ptr< return nph.join_room_gui(ctx_id, room_id, handler, arg); } -error_code sceNpMatchingJoinRoomGUI(u32 ctx_id, vm::ptr room_id, vm::ptr handler, vm::ptr arg) +error_code sceNpMatchingJoinRoomGUI(u32 ctx_id, vm::ptr room_id, + vm::ptr handler, + vm::ptr arg) { - sceNp.warning("sceNpMatchingJoinRoomGUI(ctx_id=%d, room_id=*0x%x, handler=*0x%x, arg=*0x%x)", ctx_id, room_id, handler, arg); + sceNp.warning("sceNpMatchingJoinRoomGUI(ctx_id=%d, room_id=*0x%x, " + "handler=*0x%x, arg=*0x%x)", + ctx_id, room_id, handler, arg); return matching_join_room(ctx_id, room_id, handler, arg); } -error_code sceNpMatchingLeaveRoom(u32 ctx_id, vm::cptr room_id, vm::ptr req_id) +error_code sceNpMatchingLeaveRoom(u32 ctx_id, vm::cptr room_id, + vm::ptr req_id) { - sceNp.warning("sceNpMatchingLeaveRoom(ctx_id=%d, room_id=*0x%x, req_id=*0x%x)", ctx_id, room_id, req_id); + sceNp.warning( + "sceNpMatchingLeaveRoom(ctx_id=%d, room_id=*0x%x, req_id=*0x%x)", ctx_id, + room_id, req_id); auto& nph = g_fxo->get>(); @@ -5122,10 +5629,16 @@ error_code sceNpMatchingLeaveRoom(u32 ctx_id, vm::cptr room_id, vm: return CELL_OK; } -error_code sceNpMatchingSearchJoinRoomGUI(u32 ctx_id, vm::cptr communicationId, vm::cptr cond, vm::cptr attr, - vm::ptr handler, vm::ptr arg) +error_code sceNpMatchingSearchJoinRoomGUI( + u32 ctx_id, vm::cptr communicationId, + vm::cptr cond, + vm::cptr attr, vm::ptr handler, + vm::ptr arg) { - sceNp.warning("sceNpMatchingSearchJoinRoomGUI(ctx_id=%d, communicationId=*0x%x, cond=*0x%x, attr=*0x%x, handler=*0x%x, arg=*0x%x)", ctx_id, communicationId, cond, attr, handler, arg); + sceNp.warning( + "sceNpMatchingSearchJoinRoomGUI(ctx_id=%d, communicationId=*0x%x, " + "cond=*0x%x, attr=*0x%x, handler=*0x%x, arg=*0x%x)", + ctx_id, communicationId, cond, attr, handler, arg); auto& nph = g_fxo->get>(); @@ -5184,9 +5697,14 @@ error_code sceNpMatchingSearchJoinRoomGUI(u32 ctx_id, vm::cptr room_id, vm::cptr user_id, vm::ptr req_id) +error_code sceNpMatchingGrantOwnership(u32 ctx_id, + vm::cptr room_id, + vm::cptr user_id, + vm::ptr req_id) { - sceNp.todo("sceNpMatchingGrantOwnership(ctx_id=%d, room_id=*0x%x, user_id=*0x%x, req_id=*0x%x)", ctx_id, room_id, user_id, req_id); + sceNp.todo("sceNpMatchingGrantOwnership(ctx_id=%d, room_id=*0x%x, " + "user_id=*0x%x, req_id=*0x%x)", + ctx_id, room_id, user_id, req_id); auto& nph = g_fxo->get>(); @@ -5208,9 +5726,13 @@ error_code sceNpMatchingGrantOwnership(u32 ctx_id, vm::cptr room_id return CELL_OK; } -error_code sceNpProfileCallGui(vm::cptr npid, vm::ptr handler, vm::ptr userArg, u64 options) +error_code sceNpProfileCallGui(vm::cptr npid, + vm::ptr handler, + vm::ptr userArg, u64 options) { - sceNp.todo("sceNpProfileCallGui(npid=*0x%x, handler=*0x%x, userArg=*0x%x, options=0x%x)", npid, handler, userArg, options); + sceNp.todo("sceNpProfileCallGui(npid=*0x%x, handler=*0x%x, userArg=*0x%x, " + "options=0x%x)", + npid, handler, userArg, options); auto& nph = g_fxo->get>(); @@ -5242,7 +5764,9 @@ error_code sceNpProfileAbortGui() if (!nph.is_NP_init) { - return SCE_NP_FRIENDLIST_ERROR_NOT_INITIALIZED; // Not SCE_NP_PROFILE_ERROR_NOT_INITIALIZED ! + return SCE_NP_FRIENDLIST_ERROR_NOT_INITIALIZED; // Not + // SCE_NP_PROFILE_ERROR_NOT_INITIALIZED + // ! } return CELL_OK; @@ -5290,9 +5814,16 @@ error_code sceNpScoreTerm() return CELL_OK; } -error_code sceNpScoreCreateTitleCtx(vm::cptr communicationId, vm::cptr passphrase, vm::cptr selfNpId) +error_code +sceNpScoreCreateTitleCtx(vm::cptr communicationId, + vm::cptr passphrase, + vm::cptr selfNpId) { - sceNp.warning("sceNpScoreCreateTitleCtx(communicationId=*0x%x(%s), passphrase=*0x%x, selfNpId=*0x%x)", communicationId, communicationId ? np::communication_id_to_string(*communicationId).c_str() : "", passphrase, selfNpId); + sceNp.warning("sceNpScoreCreateTitleCtx(communicationId=*0x%x(%s), " + "passphrase=*0x%x, selfNpId=*0x%x)", + communicationId, + communicationId ? np::communication_id_to_string(*communicationId).c_str() : "", + passphrase, selfNpId); auto& nph = g_fxo->get>(); @@ -5419,7 +5950,8 @@ error_code sceNpScoreSetTimeout(s32 ctxId, usecond_t timeout) error_code sceNpScoreSetPlayerCharacterId(s32 ctxId, SceNpScorePcId pcId) { - sceNp.warning("sceNpScoreSetPlayerCharacterId(ctxId=%d, pcId=%d)", ctxId, pcId); + sceNp.warning("sceNpScoreSetPlayerCharacterId(ctxId=%d, pcId=%d)", ctxId, + pcId); auto& nph = g_fxo->get>(); @@ -5451,7 +5983,8 @@ error_code sceNpScoreSetPlayerCharacterId(s32 ctxId, SceNpScorePcId pcId) error_code sceNpScoreWaitAsync(s32 transId, vm::ptr result) { - sceNp.warning("sceNpScoreWaitAsync(transId=%d, result=*0x%x)", transId, result); + sceNp.warning("sceNpScoreWaitAsync(transId=%d, result=*0x%x)", transId, + result); auto& nph = g_fxo->get>(); @@ -5473,7 +6006,8 @@ error_code sceNpScoreWaitAsync(s32 transId, vm::ptr result) error_code sceNpScorePollAsync(s32 transId, vm::ptr result) { - sceNp.warning("sceNpScorePollAsync(transId=%d, result=*0x%x)", transId, result); + sceNp.warning("sceNpScorePollAsync(transId=%d, result=*0x%x)", transId, + result); auto& nph = g_fxo->get>(); @@ -5499,7 +6033,8 @@ error_code sceNpScorePollAsync(s32 transId, vm::ptr result) return CELL_OK; } -std::pair, shared_ptr> get_score_transaction_context(s32 transId, bool reset_transaction = true) +std::pair, shared_ptr> +get_score_transaction_context(s32 transId, bool reset_transaction = true) { auto trans_ctx = idm::get_unlocked(transId); @@ -5511,8 +6046,9 @@ std::pair, shared_ptr> get_scor if (reset_transaction) { // Check for games reusing score transaction context - // Unsure about the actual behaviour, only one game does this afaik(Marvel vs Capcom Origins) - // For now we just clean the context and pretend it's a new one + // Unsure about the actual behaviour, only one game does this afaik(Marvel + // vs Capcom Origins) For now we just clean the context and pretend it's a + // new one std::lock_guard lock(trans_ctx->mutex); if (trans_ctx->result) { @@ -5527,7 +6063,9 @@ std::pair, shared_ptr> get_scor return {{}, trans_ctx}; } -error_code scenp_score_get_board_info(s32 transId, SceNpScoreBoardId boardId, vm::ptr boardInfo, vm::ptr option, bool async) +error_code scenp_score_get_board_info(s32 transId, SceNpScoreBoardId boardId, + vm::ptr boardInfo, + vm::ptr option, bool async) { auto& nph = g_fxo->get>(); @@ -5565,22 +6103,35 @@ error_code scenp_score_get_board_info(s32 transId, SceNpScoreBoardId boardId, vm return *trans_ctx->result; } -error_code sceNpScoreGetBoardInfo(s32 transId, SceNpScoreBoardId boardId, vm::ptr boardInfo, vm::ptr option) +error_code sceNpScoreGetBoardInfo(s32 transId, SceNpScoreBoardId boardId, + vm::ptr boardInfo, + vm::ptr option) { - sceNp.warning("sceNpScoreGetBoardInfo(transId=%d, boardId=%d, boardInfo=*0x%x, option=*0x%x)", transId, boardId, boardInfo, option); + sceNp.warning("sceNpScoreGetBoardInfo(transId=%d, boardId=%d, " + "boardInfo=*0x%x, option=*0x%x)", + transId, boardId, boardInfo, option); return scenp_score_get_board_info(transId, boardId, boardInfo, option, false); } -error_code sceNpScoreGetBoardInfoAsync(s32 transId, SceNpScoreBoardId boardId, vm::ptr boardInfo, s32 prio, vm::ptr option) +error_code sceNpScoreGetBoardInfoAsync(s32 transId, SceNpScoreBoardId boardId, + vm::ptr boardInfo, + s32 prio, vm::ptr option) { - sceNp.warning("sceNpScoreGetBoardInfo(transId=%d, boardId=%d, boardInfo=*0x%x, prio=%d, option=*0x%x)", transId, boardId, boardInfo, prio, option); + sceNp.warning("sceNpScoreGetBoardInfo(transId=%d, boardId=%d, " + "boardInfo=*0x%x, prio=%d, option=*0x%x)", + transId, boardId, boardInfo, prio, option); return scenp_score_get_board_info(transId, boardId, boardInfo, option, true); } -error_code scenp_score_record_score(s32 transId, SceNpScoreBoardId boardId, SceNpScoreValue score, vm::cptr scoreComment, vm::cptr gameInfo, - vm::ptr tmpRank, vm::ptr option, bool async) +error_code scenp_score_record_score(s32 transId, SceNpScoreBoardId boardId, + SceNpScoreValue score, + vm::cptr scoreComment, + vm::cptr gameInfo, + vm::ptr tmpRank, + vm::ptr option, + bool async) { auto& nph = g_fxo->get>(); @@ -5625,7 +6176,8 @@ error_code scenp_score_record_score(s32 transId, SceNpScoreBoardId boardId, SceN data_size = 64; } - nph.record_score(trans_ctx, boardId, score, scoreComment, data, data_size, tmpRank, async); + nph.record_score(trans_ctx, boardId, score, scoreComment, data, data_size, + tmpRank, async); if (async) { @@ -5635,24 +6187,45 @@ error_code scenp_score_record_score(s32 transId, SceNpScoreBoardId boardId, SceN return *trans_ctx->result; } -error_code sceNpScoreRecordScore(s32 transId, SceNpScoreBoardId boardId, SceNpScoreValue score, vm::cptr scoreComment, vm::cptr gameInfo, - vm::ptr tmpRank, vm::ptr option) +error_code sceNpScoreRecordScore(s32 transId, SceNpScoreBoardId boardId, + SceNpScoreValue score, + vm::cptr scoreComment, + vm::cptr gameInfo, + vm::ptr tmpRank, + vm::ptr option) { - sceNp.warning("sceNpScoreRecordScore(transId=%d, boardId=%d, score=%d, scoreComment=*0x%x, gameInfo=*0x%x, tmpRank=*0x%x, option=*0x%x)", transId, boardId, score, scoreComment, gameInfo, tmpRank, option); + sceNp.warning( + "sceNpScoreRecordScore(transId=%d, boardId=%d, score=%d, " + "scoreComment=*0x%x, gameInfo=*0x%x, tmpRank=*0x%x, option=*0x%x)", + transId, boardId, score, scoreComment, gameInfo, tmpRank, option); - return scenp_score_record_score(transId, boardId, score, scoreComment, gameInfo, tmpRank, option, false); + return scenp_score_record_score(transId, boardId, score, scoreComment, + gameInfo, tmpRank, option, false); } -error_code sceNpScoreRecordScoreAsync(s32 transId, SceNpScoreBoardId boardId, SceNpScoreValue score, vm::cptr scoreComment, vm::cptr gameInfo, - vm::ptr tmpRank, s32 prio, vm::ptr option) +error_code +sceNpScoreRecordScoreAsync(s32 transId, SceNpScoreBoardId boardId, + SceNpScoreValue score, + vm::cptr scoreComment, + vm::cptr gameInfo, + vm::ptr tmpRank, s32 prio, + vm::ptr option) { - sceNp.warning("sceNpScoreRecordScoreAsync(transId=%d, boardId=%d, score=%d, scoreComment=*0x%x, gameInfo=*0x%x, tmpRank=*0x%x, prio=%d, option=*0x%x)", transId, boardId, score, scoreComment, gameInfo, - tmpRank, prio, option); + sceNp.warning("sceNpScoreRecordScoreAsync(transId=%d, boardId=%d, score=%d, " + "scoreComment=*0x%x, gameInfo=*0x%x, tmpRank=*0x%x, prio=%d, " + "option=*0x%x)", + transId, boardId, score, scoreComment, gameInfo, tmpRank, prio, + option); - return scenp_score_record_score(transId, boardId, score, scoreComment, gameInfo, tmpRank, option, true); + return scenp_score_record_score(transId, boardId, score, scoreComment, + gameInfo, tmpRank, option, true); } -error_code scenp_score_record_game_data(s32 transId, SceNpScoreBoardId boardId, SceNpScoreValue score, u32 totalSize, u32 sendSize, vm::cptr data, vm::ptr /* option */, bool async) +error_code scenp_score_record_game_data(s32 transId, SceNpScoreBoardId boardId, + SceNpScoreValue score, u32 totalSize, + u32 sendSize, vm::cptr data, + vm::ptr /* option */, + bool async) { auto& nph = g_fxo->get>(); @@ -5680,7 +6253,8 @@ error_code scenp_score_record_game_data(s32 transId, SceNpScoreBoardId boardId, return SCE_NP_COMMUNITY_ERROR_INVALID_ONLINE_ID; } - nph.record_score_data(trans_ctx, boardId, score, totalSize, sendSize, static_cast(data.get_ptr()), async); + nph.record_score_data(trans_ctx, boardId, score, totalSize, sendSize, + static_cast(data.get_ptr()), async); if (async) { @@ -5690,21 +6264,38 @@ error_code scenp_score_record_game_data(s32 transId, SceNpScoreBoardId boardId, return *trans_ctx->result; } -error_code sceNpScoreRecordGameData(s32 transId, SceNpScoreBoardId boardId, SceNpScoreValue score, u32 totalSize, u32 sendSize, vm::cptr data, vm::ptr option) +error_code sceNpScoreRecordGameData(s32 transId, SceNpScoreBoardId boardId, + SceNpScoreValue score, u32 totalSize, + u32 sendSize, vm::cptr data, + vm::ptr option) { - sceNp.warning("sceNpScoreRecordGameData(transId=%d, boardId=%d, score=%d, totalSize=%d, sendSize=%d, data=*0x%x, option=*0x%x)", transId, boardId, score, totalSize, sendSize, data, option); + sceNp.warning("sceNpScoreRecordGameData(transId=%d, boardId=%d, score=%d, " + "totalSize=%d, sendSize=%d, data=*0x%x, option=*0x%x)", + transId, boardId, score, totalSize, sendSize, data, option); - return scenp_score_record_game_data(transId, boardId, score, totalSize, sendSize, data, option, false); + return scenp_score_record_game_data(transId, boardId, score, totalSize, + sendSize, data, option, false); } -error_code sceNpScoreRecordGameDataAsync(s32 transId, SceNpScoreBoardId boardId, SceNpScoreValue score, u32 totalSize, u32 sendSize, vm::cptr data, s32 prio, vm::ptr option) +error_code sceNpScoreRecordGameDataAsync(s32 transId, SceNpScoreBoardId boardId, + SceNpScoreValue score, u32 totalSize, + u32 sendSize, vm::cptr data, + s32 prio, vm::ptr option) { - sceNp.warning("sceNpScoreRecordGameDataAsync(transId=%d, boardId=%d, score=%d, totalSize=%d, sendSize=%d, data=*0x%x, prio=%d, option=*0x%x)", transId, boardId, score, totalSize, sendSize, data, prio, option); + sceNp.warning( + "sceNpScoreRecordGameDataAsync(transId=%d, boardId=%d, score=%d, " + "totalSize=%d, sendSize=%d, data=*0x%x, prio=%d, option=*0x%x)", + transId, boardId, score, totalSize, sendSize, data, prio, option); - return scenp_score_record_game_data(transId, boardId, score, totalSize, sendSize, data, option, true); + return scenp_score_record_game_data(transId, boardId, score, totalSize, + sendSize, data, option, true); } -error_code scenp_score_get_game_data(s32 transId, SceNpScoreBoardId boardId, vm::cptr npId, vm::ptr totalSize, u32 recvSize, vm::ptr data, vm::ptr /* option */, bool async) +error_code scenp_score_get_game_data(s32 transId, SceNpScoreBoardId boardId, + vm::cptr npId, + vm::ptr totalSize, u32 recvSize, + vm::ptr data, + vm::ptr /* option */, bool async) { auto& nph = g_fxo->get>(); @@ -5727,7 +6318,8 @@ error_code scenp_score_get_game_data(s32 transId, SceNpScoreBoardId boardId, vm: return SCE_NP_COMMUNITY_ERROR_INVALID_ONLINE_ID; } - nph.get_score_data(trans_ctx, boardId, *npId, totalSize, recvSize, data, async); + nph.get_score_data(trans_ctx, boardId, *npId, totalSize, recvSize, data, + async); if (async) { @@ -5737,25 +6329,43 @@ error_code scenp_score_get_game_data(s32 transId, SceNpScoreBoardId boardId, vm: return *trans_ctx->result; } -error_code sceNpScoreGetGameData(s32 transId, SceNpScoreBoardId boardId, vm::cptr npId, vm::ptr totalSize, u32 recvSize, vm::ptr data, vm::ptr option) +error_code sceNpScoreGetGameData(s32 transId, SceNpScoreBoardId boardId, + vm::cptr npId, vm::ptr totalSize, + u32 recvSize, vm::ptr data, + vm::ptr option) { - sceNp.warning("sceNpScoreGetGameData(transId=%d, boardId=%d, npId=*0x%x, totalSize=*0x%x, recvSize=%d, data=*0x%x, option=*0x%x)", transId, boardId, npId, totalSize, recvSize, data, option); + sceNp.warning("sceNpScoreGetGameData(transId=%d, boardId=%d, npId=*0x%x, " + "totalSize=*0x%x, recvSize=%d, data=*0x%x, option=*0x%x)", + transId, boardId, npId, totalSize, recvSize, data, option); - return scenp_score_get_game_data(transId, boardId, npId, totalSize, recvSize, data, option, false); + return scenp_score_get_game_data(transId, boardId, npId, totalSize, recvSize, + data, option, false); } -error_code sceNpScoreGetGameDataAsync(s32 transId, SceNpScoreBoardId boardId, vm::cptr npId, vm::ptr totalSize, u32 recvSize, vm::ptr data, s32 prio, vm::ptr option) +error_code sceNpScoreGetGameDataAsync(s32 transId, SceNpScoreBoardId boardId, + vm::cptr npId, + vm::ptr totalSize, u32 recvSize, + vm::ptr data, s32 prio, + vm::ptr option) { - sceNp.warning("sceNpScoreGetGameDataAsync(transId=%d, boardId=%d, npId=*0x%x, totalSize=*0x%x, recvSize=%d, data=*0x%x, prio=%d, option=*0x%x)", transId, boardId, npId, totalSize, recvSize, data, prio, - option); + sceNp.warning( + "sceNpScoreGetGameDataAsync(transId=%d, boardId=%d, npId=*0x%x, " + "totalSize=*0x%x, recvSize=%d, data=*0x%x, prio=%d, option=*0x%x)", + transId, boardId, npId, totalSize, recvSize, data, prio, option); - return scenp_score_get_game_data(transId, boardId, npId, totalSize, recvSize, data, option, true); + return scenp_score_get_game_data(transId, boardId, npId, totalSize, recvSize, + data, option, true); } template -error_code scenp_score_get_ranking_by_npid(s32 transId, SceNpScoreBoardId boardId, T npIdArray, u32 npIdArraySize, vm::ptr rankArray, u32 rankArraySize, - vm::ptr commentArray, u32 commentArraySize, vm::ptr infoArray, u32 infoArraySize, u32 arrayNum, vm::ptr lastSortDate, - vm::ptr totalRecord, vm::ptr /* option */, bool async) +error_code scenp_score_get_ranking_by_npid( + s32 transId, SceNpScoreBoardId boardId, T npIdArray, u32 npIdArraySize, + vm::ptr rankArray, u32 rankArraySize, + vm::ptr commentArray, u32 commentArraySize, + vm::ptr infoArray, u32 infoArraySize, u32 arrayNum, + vm::ptr lastSortDate, + vm::ptr totalRecord, vm::ptr /* option */, + bool async) { auto& nph = g_fxo->get>(); @@ -5788,20 +6398,25 @@ error_code scenp_score_get_ranking_by_npid(s32 transId, SceNpScoreBoardId boardI return SCE_NP_COMMUNITY_ERROR_INVALID_ONLINE_ID; } - if (commentArray && commentArraySize != (arrayNum * sizeof(SceNpScoreComment))) + if (commentArray && + commentArraySize != (arrayNum * sizeof(SceNpScoreComment))) { return SCE_NP_COMMUNITY_ERROR_INVALID_ALIGNMENT; } - if (infoArray && infoArraySize != (arrayNum * sizeof(SceNpScoreGameInfo)) && infoArraySize != (arrayNum * sizeof(SceNpScoreVariableSizeGameInfo))) + if (infoArray && infoArraySize != (arrayNum * sizeof(SceNpScoreGameInfo)) && + infoArraySize != (arrayNum * sizeof(SceNpScoreVariableSizeGameInfo))) { return SCE_NP_COMMUNITY_ERROR_INVALID_ALIGNMENT; } // SceNpScorePlayerRankData changed with 180.002 - const bool deprecated = (rankArraySize == (arrayNum * sizeof(SceNpScorePlayerRankData_deprecated))); + const bool deprecated = + (rankArraySize == + (arrayNum * sizeof(SceNpScorePlayerRankData_deprecated))); - if (rankArraySize != (arrayNum * sizeof(SceNpScorePlayerRankData)) && !deprecated) + if (rankArraySize != (arrayNum * sizeof(SceNpScorePlayerRankData)) && + !deprecated) { return SCE_NP_COMMUNITY_ERROR_INVALID_ALIGNMENT; } @@ -5809,8 +6424,11 @@ error_code scenp_score_get_ranking_by_npid(s32 transId, SceNpScoreBoardId boardI std::vector> npid_vec; static constexpr bool is_npid = std::is_same_v>; - static constexpr bool is_npidpcid = std::is_same_v>; - static_assert(is_npid || is_npidpcid, "T should be vm::cptr or vm::cptr"); + static constexpr bool is_npidpcid = + std::is_same_v>; + static_assert( + is_npid || is_npidpcid, + "T should be vm::cptr or vm::cptr"); if constexpr (is_npid) { @@ -5833,11 +6451,14 @@ error_code scenp_score_get_ranking_by_npid(s32 transId, SceNpScoreBoardId boardI for (u32 index = 0; index < arrayNum; index++) { - npid_vec.push_back(std::make_pair(npIdArray[index].npId, npIdArray[index].pcId)); + npid_vec.push_back( + std::make_pair(npIdArray[index].npId, npIdArray[index].pcId)); } } - nph.get_score_npid(trans_ctx, boardId, npid_vec, rankArray, rankArraySize, commentArray, commentArraySize, infoArray, infoArraySize, arrayNum, lastSortDate, totalRecord, async, deprecated); + nph.get_score_npid(trans_ctx, boardId, npid_vec, rankArray, rankArraySize, + commentArray, commentArraySize, infoArray, infoArraySize, + arrayNum, lastSortDate, totalRecord, async, deprecated); if (async) { @@ -5847,33 +6468,62 @@ error_code scenp_score_get_ranking_by_npid(s32 transId, SceNpScoreBoardId boardI return *trans_ctx->result; } -error_code sceNpScoreGetRankingByNpId(s32 transId, SceNpScoreBoardId boardId, vm::cptr npIdArray, u32 npIdArraySize, vm::ptr rankArray, u32 rankArraySize, - vm::ptr commentArray, u32 commentArraySize, vm::ptr infoArray, u32 infoArraySize, u32 arrayNum, vm::ptr lastSortDate, +error_code sceNpScoreGetRankingByNpId( + s32 transId, SceNpScoreBoardId boardId, vm::cptr npIdArray, + u32 npIdArraySize, vm::ptr rankArray, + u32 rankArraySize, vm::ptr commentArray, + u32 commentArraySize, vm::ptr infoArray, u32 infoArraySize, + u32 arrayNum, vm::ptr lastSortDate, vm::ptr totalRecord, vm::ptr option) { - sceNp.warning("sceNpScoreGetRankingByNpId(transId=%d, boardId=%d, npIdArray=*0x%x, npIdArraySize=%d, rankArray=*0x%x, rankArraySize=%d, commentArray=*0x%x, commentArraySize=%d, infoArray=*0x%x, " - "infoArraySize=%d, arrayNum=%d, lastSortDate=*0x%x, totalRecord=*0x%x, option=*0x%x)", - transId, boardId, npIdArray, npIdArraySize, rankArray, rankArraySize, commentArray, commentArraySize, infoArray, infoArraySize, arrayNum, lastSortDate, totalRecord, option); + sceNp.warning( + "sceNpScoreGetRankingByNpId(transId=%d, boardId=%d, npIdArray=*0x%x, " + "npIdArraySize=%d, rankArray=*0x%x, rankArraySize=%d, " + "commentArray=*0x%x, commentArraySize=%d, infoArray=*0x%x, " + "infoArraySize=%d, arrayNum=%d, lastSortDate=*0x%x, totalRecord=*0x%x, " + "option=*0x%x)", + transId, boardId, npIdArray, npIdArraySize, rankArray, rankArraySize, + commentArray, commentArraySize, infoArray, infoArraySize, arrayNum, + lastSortDate, totalRecord, option); - return scenp_score_get_ranking_by_npid(transId, boardId, npIdArray, npIdArraySize, rankArray, rankArraySize, commentArray, commentArraySize, infoArray, - infoArraySize, arrayNum, lastSortDate, totalRecord, option, false); + return scenp_score_get_ranking_by_npid( + transId, boardId, npIdArray, npIdArraySize, rankArray, rankArraySize, + commentArray, commentArraySize, infoArray, infoArraySize, arrayNum, + lastSortDate, totalRecord, option, false); } -error_code sceNpScoreGetRankingByNpIdAsync(s32 transId, SceNpScoreBoardId boardId, vm::cptr npIdArray, u32 npIdArraySize, vm::ptr rankArray, u32 rankArraySize, - vm::ptr commentArray, u32 commentArraySize, vm::ptr infoArray, u32 infoArraySize, u32 arrayNum, vm::ptr lastSortDate, +error_code sceNpScoreGetRankingByNpIdAsync( + s32 transId, SceNpScoreBoardId boardId, vm::cptr npIdArray, + u32 npIdArraySize, vm::ptr rankArray, + u32 rankArraySize, vm::ptr commentArray, + u32 commentArraySize, vm::ptr infoArray, u32 infoArraySize, + u32 arrayNum, vm::ptr lastSortDate, vm::ptr totalRecord, s32 prio, vm::ptr option) { - sceNp.warning("sceNpScoreGetRankingByNpIdAsync(transId=%d, boardId=%d, npIdArray=*0x%x, npIdArraySize=%d, rankArray=*0x%x, rankArraySize=%d, commentArray=*0x%x, commentArraySize=%d, infoArray=*0x%x, " - "infoArraySize=%d, arrayNum=%d, lastSortDate=*0x%x, totalRecord=*0x%x, prio=%d, option=*0x%x)", - transId, boardId, npIdArray, npIdArraySize, rankArray, rankArraySize, commentArray, commentArraySize, infoArray, infoArraySize, arrayNum, lastSortDate, totalRecord, prio, option); + sceNp.warning( + "sceNpScoreGetRankingByNpIdAsync(transId=%d, boardId=%d, " + "npIdArray=*0x%x, npIdArraySize=%d, rankArray=*0x%x, rankArraySize=%d, " + "commentArray=*0x%x, commentArraySize=%d, infoArray=*0x%x, " + "infoArraySize=%d, arrayNum=%d, lastSortDate=*0x%x, totalRecord=*0x%x, " + "prio=%d, option=*0x%x)", + transId, boardId, npIdArray, npIdArraySize, rankArray, rankArraySize, + commentArray, commentArraySize, infoArray, infoArraySize, arrayNum, + lastSortDate, totalRecord, prio, option); - return scenp_score_get_ranking_by_npid(transId, boardId, npIdArray, npIdArraySize, rankArray, rankArraySize, commentArray, commentArraySize, infoArray, - infoArraySize, arrayNum, lastSortDate, totalRecord, option, true); + return scenp_score_get_ranking_by_npid( + transId, boardId, npIdArray, npIdArraySize, rankArray, rankArraySize, + commentArray, commentArraySize, infoArray, infoArraySize, arrayNum, + lastSortDate, totalRecord, option, true); } -error_code scenp_score_get_ranking_by_range(s32 transId, SceNpScoreBoardId boardId, SceNpScoreRankNumber startSerialRank, vm::ptr rankArray, u32 rankArraySize, - vm::ptr commentArray, u32 commentArraySize, vm::ptr infoArray, u32 infoArraySize, u32 arrayNum, vm::ptr lastSortDate, - vm::ptr totalRecord, vm::ptr option, bool async) +error_code scenp_score_get_ranking_by_range( + s32 transId, SceNpScoreBoardId boardId, + SceNpScoreRankNumber startSerialRank, vm::ptr rankArray, + u32 rankArraySize, vm::ptr commentArray, + u32 commentArraySize, vm::ptr infoArray, u32 infoArraySize, + u32 arrayNum, vm::ptr lastSortDate, + vm::ptr totalRecord, vm::ptr option, + bool async) { auto& nph = g_fxo->get>(); @@ -5918,18 +6568,21 @@ error_code scenp_score_get_ranking_by_range(s32 transId, SceNpScoreBoardId board return SCE_NP_COMMUNITY_ERROR_TOO_LARGE_RANGE; } - if (commentArray && commentArraySize != (arrayNum * sizeof(SceNpScoreComment))) + if (commentArray && + commentArraySize != (arrayNum * sizeof(SceNpScoreComment))) { return SCE_NP_COMMUNITY_ERROR_INVALID_ALIGNMENT; } - if (infoArray && infoArraySize != (arrayNum * sizeof(SceNpScoreGameInfo)) && infoArraySize != (arrayNum * sizeof(SceNpScoreVariableSizeGameInfo))) + if (infoArray && infoArraySize != (arrayNum * sizeof(SceNpScoreGameInfo)) && + infoArraySize != (arrayNum * sizeof(SceNpScoreVariableSizeGameInfo))) { return SCE_NP_COMMUNITY_ERROR_INVALID_ALIGNMENT; } // SceNpScoreRankData changed with 180.002 - const bool deprecated = (rankArraySize == (arrayNum * sizeof(SceNpScoreRankData_deprecated))); + const bool deprecated = + (rankArraySize == (arrayNum * sizeof(SceNpScoreRankData_deprecated))); if (rankArraySize != (arrayNum * sizeof(SceNpScoreRankData)) && !deprecated) { @@ -5941,7 +6594,10 @@ error_code scenp_score_get_ranking_by_range(s32 transId, SceNpScoreBoardId board return SCE_NP_COMMUNITY_ERROR_INVALID_ONLINE_ID; } - nph.get_score_range(trans_ctx, boardId, startSerialRank, rankArray, rankArraySize, commentArray, commentArraySize, infoArray, infoArraySize, arrayNum, lastSortDate, totalRecord, async, deprecated); + nph.get_score_range(trans_ctx, boardId, startSerialRank, rankArray, + rankArraySize, commentArray, commentArraySize, infoArray, + infoArraySize, arrayNum, lastSortDate, totalRecord, async, + deprecated); if (async) { @@ -5951,32 +6607,59 @@ error_code scenp_score_get_ranking_by_range(s32 transId, SceNpScoreBoardId board return *trans_ctx->result; } -error_code sceNpScoreGetRankingByRange(s32 transId, SceNpScoreBoardId boardId, SceNpScoreRankNumber startSerialRank, vm::ptr rankArray, u32 rankArraySize, - vm::ptr commentArray, u32 commentArraySize, vm::ptr infoArray, u32 infoArraySize, u32 arrayNum, vm::ptr lastSortDate, +error_code sceNpScoreGetRankingByRange( + s32 transId, SceNpScoreBoardId boardId, + SceNpScoreRankNumber startSerialRank, vm::ptr rankArray, + u32 rankArraySize, vm::ptr commentArray, + u32 commentArraySize, vm::ptr infoArray, u32 infoArraySize, + u32 arrayNum, vm::ptr lastSortDate, vm::ptr totalRecord, vm::ptr option) { - sceNp.warning("sceNpScoreGetRankingByRange(transId=%d, boardId=%d, startSerialRank=%d, rankArray=*0x%x, rankArraySize=%d, commentArray=*0x%x, commentArraySize=%d, infoArray=*0x%x, infoArraySize=%d, " - "arrayNum=%d, lastSortDate=*0x%x, totalRecord=*0x%x, option=*0x%x)", - transId, boardId, startSerialRank, rankArray, rankArraySize, commentArray, commentArraySize, infoArray, infoArraySize, arrayNum, lastSortDate, totalRecord, option); + sceNp.warning( + "sceNpScoreGetRankingByRange(transId=%d, boardId=%d, startSerialRank=%d, " + "rankArray=*0x%x, rankArraySize=%d, commentArray=*0x%x, " + "commentArraySize=%d, infoArray=*0x%x, infoArraySize=%d, " + "arrayNum=%d, lastSortDate=*0x%x, totalRecord=*0x%x, option=*0x%x)", + transId, boardId, startSerialRank, rankArray, rankArraySize, commentArray, + commentArraySize, infoArray, infoArraySize, arrayNum, lastSortDate, + totalRecord, option); - return scenp_score_get_ranking_by_range(transId, boardId, startSerialRank, rankArray, rankArraySize, commentArray, commentArraySize, infoArray, infoArraySize, - arrayNum, lastSortDate, totalRecord, option, false); + return scenp_score_get_ranking_by_range( + transId, boardId, startSerialRank, rankArray, rankArraySize, commentArray, + commentArraySize, infoArray, infoArraySize, arrayNum, lastSortDate, + totalRecord, option, false); } -error_code sceNpScoreGetRankingByRangeAsync(s32 transId, SceNpScoreBoardId boardId, SceNpScoreRankNumber startSerialRank, vm::ptr rankArray, u32 rankArraySize, - vm::ptr commentArray, u32 commentArraySize, vm::ptr infoArray, u32 infoArraySize, u32 arrayNum, vm::ptr lastSortDate, +error_code sceNpScoreGetRankingByRangeAsync( + s32 transId, SceNpScoreBoardId boardId, + SceNpScoreRankNumber startSerialRank, vm::ptr rankArray, + u32 rankArraySize, vm::ptr commentArray, + u32 commentArraySize, vm::ptr infoArray, u32 infoArraySize, + u32 arrayNum, vm::ptr lastSortDate, vm::ptr totalRecord, s32 prio, vm::ptr option) { - sceNp.warning("sceNpScoreGetRankingByRangeAsync(transId=%d, boardId=%d, startSerialRank=%d, rankArray=*0x%x, rankArraySize=%d, commentArray=*0x%x, commentArraySize=%d, infoArray=*0x%x, " - "infoArraySize=%d, arrayNum=%d, lastSortDate=*0x%x, totalRecord=*0x%x, prio=%d, option=*0x%x)", - transId, boardId, startSerialRank, rankArray, rankArraySize, commentArray, commentArraySize, infoArray, infoArraySize, arrayNum, lastSortDate, totalRecord, prio, option); + sceNp.warning("sceNpScoreGetRankingByRangeAsync(transId=%d, boardId=%d, " + "startSerialRank=%d, rankArray=*0x%x, rankArraySize=%d, " + "commentArray=*0x%x, commentArraySize=%d, infoArray=*0x%x, " + "infoArraySize=%d, arrayNum=%d, lastSortDate=*0x%x, " + "totalRecord=*0x%x, prio=%d, option=*0x%x)", + transId, boardId, startSerialRank, rankArray, rankArraySize, + commentArray, commentArraySize, infoArray, infoArraySize, + arrayNum, lastSortDate, totalRecord, prio, option); - return scenp_score_get_ranking_by_range(transId, boardId, startSerialRank, rankArray, rankArraySize, commentArray, commentArraySize, infoArray, infoArraySize, - arrayNum, lastSortDate, totalRecord, option, true); + return scenp_score_get_ranking_by_range( + transId, boardId, startSerialRank, rankArray, rankArraySize, commentArray, + commentArraySize, infoArray, infoArraySize, arrayNum, lastSortDate, + totalRecord, option, true); } -error_code scenp_score_get_friends_ranking(s32 transId, SceNpScoreBoardId boardId, s32 includeSelf, vm::ptr rankArray, u32 rankArraySize, vm::ptr commentArray, - u32 commentArraySize, vm::ptr infoArray, u32 infoArraySize, u32 arrayNum, vm::ptr lastSortDate, vm::ptr totalRecord, vm::ptr option, +error_code scenp_score_get_friends_ranking( + s32 transId, SceNpScoreBoardId boardId, s32 includeSelf, + vm::ptr rankArray, u32 rankArraySize, + vm::ptr commentArray, u32 commentArraySize, + vm::ptr infoArray, u32 infoArraySize, u32 arrayNum, + vm::ptr lastSortDate, + vm::ptr totalRecord, vm::ptr option, bool async) { auto& nph = g_fxo->get>(); @@ -5995,23 +6678,27 @@ error_code scenp_score_get_friends_ranking(s32 transId, SceNpScoreBoardId boardI return SCE_NP_COMMUNITY_ERROR_INSUFFICIENT_ARGUMENT; } - if (arrayNum > SCE_NP_SCORE_MAX_SELECTED_FRIENDS_NUM || option) // option check at least until fw 4.71 + if (arrayNum > SCE_NP_SCORE_MAX_SELECTED_FRIENDS_NUM || + option) // option check at least until fw 4.71 { return SCE_NP_COMMUNITY_ERROR_INVALID_ARGUMENT; } - if (commentArray && commentArraySize != (arrayNum * sizeof(SceNpScoreComment))) + if (commentArray && + commentArraySize != (arrayNum * sizeof(SceNpScoreComment))) { return SCE_NP_COMMUNITY_ERROR_INVALID_ALIGNMENT; } - if (infoArray && infoArraySize != (arrayNum * sizeof(SceNpScoreGameInfo)) && infoArraySize != (arrayNum * sizeof(SceNpScoreVariableSizeGameInfo))) + if (infoArray && infoArraySize != (arrayNum * sizeof(SceNpScoreGameInfo)) && + infoArraySize != (arrayNum * sizeof(SceNpScoreVariableSizeGameInfo))) { return SCE_NP_COMMUNITY_ERROR_INVALID_ALIGNMENT; } // The SceNpScoreRankData changed with 180.002 - const bool deprecated = (rankArraySize == (arrayNum * sizeof(SceNpScoreRankData_deprecated))); + const bool deprecated = + (rankArraySize == (arrayNum * sizeof(SceNpScoreRankData_deprecated))); if (rankArraySize != (arrayNum * sizeof(SceNpScoreRankData)) && !deprecated) { @@ -6023,7 +6710,10 @@ error_code scenp_score_get_friends_ranking(s32 transId, SceNpScoreBoardId boardI return SCE_NP_COMMUNITY_ERROR_INVALID_ONLINE_ID; } - nph.get_score_friend(trans_ctx, boardId, includeSelf, rankArray, rankArraySize, commentArray, commentArraySize, infoArray, infoArraySize, arrayNum, lastSortDate, totalRecord, async, deprecated); + nph.get_score_friend(trans_ctx, boardId, includeSelf, rankArray, + rankArraySize, commentArray, commentArraySize, infoArray, + infoArraySize, arrayNum, lastSortDate, totalRecord, + async, deprecated); if (async) { @@ -6033,30 +6723,55 @@ error_code scenp_score_get_friends_ranking(s32 transId, SceNpScoreBoardId boardI return *trans_ctx->result; } -error_code sceNpScoreGetFriendsRanking(s32 transId, SceNpScoreBoardId boardId, s32 includeSelf, vm::ptr rankArray, u32 rankArraySize, vm::ptr commentArray, - u32 commentArraySize, vm::ptr infoArray, u32 infoArraySize, u32 arrayNum, vm::ptr lastSortDate, vm::ptr totalRecord, vm::ptr option) +error_code sceNpScoreGetFriendsRanking( + s32 transId, SceNpScoreBoardId boardId, s32 includeSelf, + vm::ptr rankArray, u32 rankArraySize, + vm::ptr commentArray, u32 commentArraySize, + vm::ptr infoArray, u32 infoArraySize, u32 arrayNum, + vm::ptr lastSortDate, + vm::ptr totalRecord, vm::ptr option) { - sceNp.warning("sceNpScoreGetFriendsRanking(transId=%d, boardId=%d, includeSelf=%d, rankArray=*0x%x, rankArraySize=%d, commentArray=*0x%x, commentArraySize=%d, infoArray=*0x%x, infoArraySize=%d, " - "arrayNum=%d, lastSortDate=*0x%x, totalRecord=*0x%x, option=*0x%x)", - transId, boardId, includeSelf, rankArray, rankArraySize, commentArray, commentArraySize, infoArray, infoArraySize, arrayNum, lastSortDate, totalRecord, option); + sceNp.warning( + "sceNpScoreGetFriendsRanking(transId=%d, boardId=%d, includeSelf=%d, " + "rankArray=*0x%x, rankArraySize=%d, commentArray=*0x%x, " + "commentArraySize=%d, infoArray=*0x%x, infoArraySize=%d, " + "arrayNum=%d, lastSortDate=*0x%x, totalRecord=*0x%x, option=*0x%x)", + transId, boardId, includeSelf, rankArray, rankArraySize, commentArray, + commentArraySize, infoArray, infoArraySize, arrayNum, lastSortDate, + totalRecord, option); - return scenp_score_get_friends_ranking(transId, boardId, includeSelf, rankArray, rankArraySize, commentArray, commentArraySize, infoArray, infoArraySize, - arrayNum, lastSortDate, totalRecord, option, false); + return scenp_score_get_friends_ranking( + transId, boardId, includeSelf, rankArray, rankArraySize, commentArray, + commentArraySize, infoArray, infoArraySize, arrayNum, lastSortDate, + totalRecord, option, false); } -error_code sceNpScoreGetFriendsRankingAsync(s32 transId, SceNpScoreBoardId boardId, s32 includeSelf, vm::ptr rankArray, u32 rankArraySize, vm::ptr commentArray, - u32 commentArraySize, vm::ptr infoArray, u32 infoArraySize, u32 arrayNum, vm::ptr lastSortDate, vm::ptr totalRecord, s32 prio, - vm::ptr option) +error_code sceNpScoreGetFriendsRankingAsync( + s32 transId, SceNpScoreBoardId boardId, s32 includeSelf, + vm::ptr rankArray, u32 rankArraySize, + vm::ptr commentArray, u32 commentArraySize, + vm::ptr infoArray, u32 infoArraySize, u32 arrayNum, + vm::ptr lastSortDate, + vm::ptr totalRecord, s32 prio, vm::ptr option) { - sceNp.warning("sceNpScoreGetFriendsRankingAsync(transId=%d, boardId=%d, includeSelf=%d, rankArray=*0x%x, rankArraySize=%d, commentArray=*0x%x, commentArraySize=%d, infoArray=*0x%x, infoArraySize=%d, " - "arrayNum=%d, lastSortDate=*0x%x, totalRecord=*0x%x, prio=%d, option=*0x%x)", - transId, boardId, includeSelf, rankArray, rankArraySize, commentArray, commentArraySize, infoArray, infoArraySize, arrayNum, lastSortDate, totalRecord, prio, option); + sceNp.warning( + "sceNpScoreGetFriendsRankingAsync(transId=%d, boardId=%d, " + "includeSelf=%d, rankArray=*0x%x, rankArraySize=%d, commentArray=*0x%x, " + "commentArraySize=%d, infoArray=*0x%x, infoArraySize=%d, " + "arrayNum=%d, lastSortDate=*0x%x, totalRecord=*0x%x, prio=%d, " + "option=*0x%x)", + transId, boardId, includeSelf, rankArray, rankArraySize, commentArray, + commentArraySize, infoArray, infoArraySize, arrayNum, lastSortDate, + totalRecord, prio, option); - return scenp_score_get_friends_ranking(transId, boardId, includeSelf, rankArray, rankArraySize, commentArray, commentArraySize, infoArray, infoArraySize, - arrayNum, lastSortDate, totalRecord, option, true); + return scenp_score_get_friends_ranking( + transId, boardId, includeSelf, rankArray, rankArraySize, commentArray, + commentArraySize, infoArray, infoArraySize, arrayNum, lastSortDate, + totalRecord, option, true); } -error_code scenp_score_censor_comment(s32 transId, vm::cptr comment, vm::ptr option, bool async) +error_code scenp_score_censor_comment(s32 transId, vm::cptr comment, + vm::ptr option, bool async) { auto& nph = g_fxo->get>(); @@ -6070,7 +6785,8 @@ error_code scenp_score_censor_comment(s32 transId, vm::cptr comment, vm::p return SCE_NP_COMMUNITY_ERROR_INSUFFICIENT_ARGUMENT; } - if (strlen(comment.get_ptr()) > SCE_NP_SCORE_CENSOR_COMMENT_MAXLEN || option) // option check at least until fw 4.71 + if (strlen(comment.get_ptr()) > SCE_NP_SCORE_CENSOR_COMMENT_MAXLEN || + option) // option check at least until fw 4.71 { // TODO: is SCE_NP_SCORE_CENSOR_COMMENT_MAXLEN + 1 allowed ? return SCE_NP_COMMUNITY_ERROR_INVALID_ARGUMENT; @@ -6096,21 +6812,29 @@ error_code scenp_score_censor_comment(s32 transId, vm::cptr comment, vm::p return *trans_ctx->result; } -error_code sceNpScoreCensorComment(s32 transId, vm::cptr comment, vm::ptr option) +error_code sceNpScoreCensorComment(s32 transId, vm::cptr comment, + vm::ptr option) { - sceNp.todo("sceNpScoreCensorComment(transId=%d, comment=%s, option=*0x%x)", transId, comment, option); + sceNp.todo("sceNpScoreCensorComment(transId=%d, comment=%s, option=*0x%x)", + transId, comment, option); return scenp_score_censor_comment(transId, comment, option, false); } -error_code sceNpScoreCensorCommentAsync(s32 transId, vm::cptr comment, s32 prio, vm::ptr option) +error_code sceNpScoreCensorCommentAsync(s32 transId, vm::cptr comment, + s32 prio, vm::ptr option) { - sceNp.todo("sceNpScoreCensorCommentAsync(transId=%d, comment=%s, prio=%d, option=*0x%x)", transId, comment, prio, option); + sceNp.todo("sceNpScoreCensorCommentAsync(transId=%d, comment=%s, prio=%d, " + "option=*0x%x)", + transId, comment, prio, option); return scenp_score_censor_comment(transId, comment, option, true); } -error_code scenp_score_sanitize_comment(s32 transId, vm::cptr comment, vm::ptr sanitizedComment, vm::ptr /* option */, bool async) +error_code scenp_score_sanitize_comment(s32 transId, vm::cptr comment, + vm::ptr sanitizedComment, + vm::ptr /* option */, + bool async) { if (!sanitizedComment) { @@ -6152,42 +6876,78 @@ error_code scenp_score_sanitize_comment(s32 transId, vm::cptr comment, vm: return *trans_ctx->result; } -error_code sceNpScoreSanitizeComment(s32 transId, vm::cptr comment, vm::ptr sanitizedComment, vm::ptr option) +error_code sceNpScoreSanitizeComment(s32 transId, vm::cptr comment, + vm::ptr sanitizedComment, + vm::ptr option) { - sceNp.warning("sceNpScoreSanitizeComment(transId=%d, comment=%s, sanitizedComment=*0x%x, option=*0x%x)", transId, comment, sanitizedComment, option); + sceNp.warning("sceNpScoreSanitizeComment(transId=%d, comment=%s, " + "sanitizedComment=*0x%x, option=*0x%x)", + transId, comment, sanitizedComment, option); - return scenp_score_sanitize_comment(transId, comment, sanitizedComment, option, false); + return scenp_score_sanitize_comment(transId, comment, sanitizedComment, + option, false); } -error_code sceNpScoreSanitizeCommentAsync(s32 transId, vm::cptr comment, vm::ptr sanitizedComment, s32 prio, vm::ptr option) +error_code sceNpScoreSanitizeCommentAsync(s32 transId, vm::cptr comment, + vm::ptr sanitizedComment, + s32 prio, vm::ptr option) { - sceNp.warning("sceNpScoreSanitizeCommentAsync(transId=%d, comment=%s, sanitizedComment=*0x%x, prio=%d, option=*0x%x)", transId, comment, sanitizedComment, prio, option); + sceNp.warning("sceNpScoreSanitizeCommentAsync(transId=%d, comment=%s, " + "sanitizedComment=*0x%x, prio=%d, option=*0x%x)", + transId, comment, sanitizedComment, prio, option); - return scenp_score_sanitize_comment(transId, comment, sanitizedComment, option, true); + return scenp_score_sanitize_comment(transId, comment, sanitizedComment, + option, true); } -error_code sceNpScoreGetRankingByNpIdPcId(s32 transId, SceNpScoreBoardId boardId, vm::cptr idArray, u32 idArraySize, vm::ptr rankArray, u32 rankArraySize, - vm::ptr commentArray, u32 commentArraySize, vm::ptr infoArray, u32 infoArraySize, u32 arrayNum, vm::ptr lastSortDate, +error_code sceNpScoreGetRankingByNpIdPcId( + s32 transId, SceNpScoreBoardId boardId, + vm::cptr idArray, u32 idArraySize, + vm::ptr rankArray, u32 rankArraySize, + vm::ptr commentArray, u32 commentArraySize, + vm::ptr infoArray, u32 infoArraySize, u32 arrayNum, + vm::ptr lastSortDate, vm::ptr totalRecord, vm::ptr option) { - sceNp.warning("sceNpScoreGetRankingByNpIdPcId(transId=%d, boardId=%d, idArray=*0x%x, idArraySize=%d, rankArray=*0x%x, rankArraySize=%d, commentArray=*0x%x, commentArraySize=%d, infoArray=*0x%x, " - "infoArraySize=%d, arrayNum=%d, lastSortDate=*0x%x, totalRecord=*0x%x, option=*0x%x)", - transId, boardId, idArray, idArraySize, rankArray, rankArraySize, commentArray, commentArraySize, infoArray, infoArraySize, arrayNum, lastSortDate, totalRecord, option); + sceNp.warning( + "sceNpScoreGetRankingByNpIdPcId(transId=%d, boardId=%d, idArray=*0x%x, " + "idArraySize=%d, rankArray=*0x%x, rankArraySize=%d, commentArray=*0x%x, " + "commentArraySize=%d, infoArray=*0x%x, " + "infoArraySize=%d, arrayNum=%d, lastSortDate=*0x%x, totalRecord=*0x%x, " + "option=*0x%x)", + transId, boardId, idArray, idArraySize, rankArray, rankArraySize, + commentArray, commentArraySize, infoArray, infoArraySize, arrayNum, + lastSortDate, totalRecord, option); - return scenp_score_get_ranking_by_npid(transId, boardId, idArray, idArraySize, rankArray, rankArraySize, commentArray, commentArraySize, infoArray, - infoArraySize, arrayNum, lastSortDate, totalRecord, option, false); + return scenp_score_get_ranking_by_npid( + transId, boardId, idArray, idArraySize, rankArray, rankArraySize, + commentArray, commentArraySize, infoArray, infoArraySize, arrayNum, + lastSortDate, totalRecord, option, false); } -error_code sceNpScoreGetRankingByNpIdPcIdAsync(s32 transId, SceNpScoreBoardId boardId, vm::cptr idArray, u32 idArraySize, vm::ptr rankArray, - u32 rankArraySize, vm::ptr commentArray, u32 commentArraySize, vm::ptr infoArray, u32 infoArraySize, u32 arrayNum, vm::ptr lastSortDate, +error_code sceNpScoreGetRankingByNpIdPcIdAsync( + s32 transId, SceNpScoreBoardId boardId, + vm::cptr idArray, u32 idArraySize, + vm::ptr rankArray, u32 rankArraySize, + vm::ptr commentArray, u32 commentArraySize, + vm::ptr infoArray, u32 infoArraySize, u32 arrayNum, + vm::ptr lastSortDate, vm::ptr totalRecord, s32 prio, vm::ptr option) { - sceNp.warning("sceNpScoreGetRankingByNpIdPcIdAsync(transId=%d, boardId=%d, idArray=*0x%x, idArraySize=%d, rankArray=*0x%x, rankArraySize=%d, commentArray=*0x%x, commentArraySize=%d, infoArray=*0x%x, " - "infoArraySize=%d, arrayNum=%d, lastSortDate=*0x%x, totalRecord=*0x%x, prio=%d, option=*0x%x)", - transId, boardId, idArray, idArraySize, rankArray, rankArraySize, commentArray, commentArraySize, infoArray, infoArraySize, arrayNum, lastSortDate, totalRecord, prio, option); + sceNp.warning( + "sceNpScoreGetRankingByNpIdPcIdAsync(transId=%d, boardId=%d, " + "idArray=*0x%x, idArraySize=%d, rankArray=*0x%x, rankArraySize=%d, " + "commentArray=*0x%x, commentArraySize=%d, infoArray=*0x%x, " + "infoArraySize=%d, arrayNum=%d, lastSortDate=*0x%x, totalRecord=*0x%x, " + "prio=%d, option=*0x%x)", + transId, boardId, idArray, idArraySize, rankArray, rankArraySize, + commentArray, commentArraySize, infoArray, infoArraySize, arrayNum, + lastSortDate, totalRecord, prio, option); - return scenp_score_get_ranking_by_npid(transId, boardId, idArray, idArraySize, rankArray, rankArraySize, commentArray, commentArraySize, infoArray, - infoArraySize, arrayNum, lastSortDate, totalRecord, option, true); + return scenp_score_get_ranking_by_npid( + transId, boardId, idArray, idArraySize, rankArray, rankArraySize, + commentArray, commentArraySize, infoArray, infoArraySize, arrayNum, + lastSortDate, totalRecord, option, true); } error_code sceNpScoreAbortTransaction(s32 transId) @@ -6212,84 +6972,28 @@ error_code sceNpScoreAbortTransaction(s32 transId) return CELL_OK; } -error_code sceNpScoreGetClansMembersRankingByNpId(s32 transId, SceNpClanId clanId, SceNpScoreBoardId boardId, vm::cptr idArray, u32 idArraySize, vm::ptr rankArray, - u32 rankArraySize, vm::ptr commentArray, u32 commentArraySize, vm::ptr infoArray, u32 infoArraySize, vm::ptr descriptArray, - u32 descriptArraySize, u32 arrayNum, vm::ptr clanInfo, vm::ptr lastSortDate, vm::ptr totalRecord, vm::ptr option) -{ - sceNp.todo("sceNpScoreGetClansMembersRankingByNpId(transId=%d, clanId=%d, boardId=%d, idArray=*0x%x, idArraySize=%d, rankArray=*0x%x, rankArraySize=%d, commentArray=*0x%x, commentArraySize=%d, " - "infoArray=*0x%x, infoArraySize=%d, descriptArray=*0x%x, descriptArraySize=%d, arrayNum=%d, clanInfo=*0x%x, lastSortDate=*0x%x, totalRecord=*0x%x, option=*0x%x)", - transId, clanId, boardId, idArray, idArraySize, rankArray, rankArraySize, commentArray, commentArraySize, infoArray, infoArraySize, descriptArray, descriptArraySize, arrayNum, clanInfo, - lastSortDate, totalRecord, option); - - auto& nph = g_fxo->get>(); - - if (!nph.is_NP_Score_init) - { - return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED; - } - - if (!idArray || !rankArray || !totalRecord || !lastSortDate || !arrayNum) - { - return SCE_NP_COMMUNITY_ERROR_INSUFFICIENT_ARGUMENT; - } - - if (option) // option check at least until fw 4.71 - { - return SCE_NP_COMMUNITY_ERROR_INVALID_ARGUMENT; - } - - if (arrayNum > SCE_NP_SCORE_MAX_NPID_NUM_PER_TRANS) - { - return SCE_NP_COMMUNITY_ERROR_TOO_MANY_NPID; - } - - if (nph.get_psn_status() != SCE_NP_MANAGER_STATUS_ONLINE) - { - return SCE_NP_COMMUNITY_ERROR_INVALID_ONLINE_ID; - } - - return CELL_OK; -} - -error_code sceNpScoreGetClansMembersRankingByNpIdAsync(s32 transId, SceNpClanId clanId, SceNpScoreBoardId boardId, vm::cptr idArray, u32 idArraySize, - vm::ptr rankArray, u32 rankArraySize, vm::ptr commentArray, u32 commentArraySize, vm::ptr infoArray, u32 infoArraySize, - vm::ptr descriptArray, u32 descriptArraySize, u32 arrayNum, vm::ptr clanInfo, vm::ptr lastSortDate, - vm::ptr totalRecord, s32 prio, vm::ptr option) -{ - sceNp.todo("sceNpScoreGetClansMembersRankingByNpIdAsync(transId=%d, clanId=%d, boardId=%d, idArray=*0x%x, idArraySize=%d, rankArray=*0x%x, rankArraySize=%d, commentArray=*0x%x, commentArraySize=%d, " - "infoArray=*0x%x, infoArraySize=%d, descriptArray=*0x%x, descriptArraySize=%d, arrayNum=%d, clanInfo=*0x%x, lastSortDate=*0x%x, totalRecord=*0x%x, prio=%d, option=*0x%x)", - transId, clanId, boardId, idArray, idArraySize, rankArray, rankArraySize, commentArray, commentArraySize, infoArray, infoArraySize, descriptArray, descriptArraySize, arrayNum, clanInfo, - lastSortDate, totalRecord, prio, option); - - auto& nph = g_fxo->get>(); - - if (!nph.is_NP_Score_init) - { - return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED; - } - - if (!idArray || !arrayNum) - { - return SCE_NP_COMMUNITY_ERROR_INSUFFICIENT_ARGUMENT; - } - - if (option) // option check at least until fw 4.71 - { - return SCE_NP_COMMUNITY_ERROR_INVALID_ARGUMENT; - } - - return CELL_OK; -} - -error_code sceNpScoreGetClansMembersRankingByNpIdPcId(s32 transId, SceNpClanId clanId, SceNpScoreBoardId boardId, vm::cptr idArray, u32 idArraySize, - vm::ptr rankArray, u32 rankArraySize, vm::ptr commentArray, u32 commentArraySize, vm::ptr infoArray, u32 infoArraySize, - vm::ptr descriptArray, u32 descriptArraySize, u32 arrayNum, vm::ptr clanInfo, vm::ptr lastSortDate, +error_code sceNpScoreGetClansMembersRankingByNpId( + s32 transId, SceNpClanId clanId, SceNpScoreBoardId boardId, + vm::cptr idArray, u32 idArraySize, + vm::ptr rankArray, u32 rankArraySize, + vm::ptr commentArray, u32 commentArraySize, + vm::ptr infoArray, u32 infoArraySize, + vm::ptr descriptArray, + u32 descriptArraySize, u32 arrayNum, + vm::ptr clanInfo, + vm::ptr lastSortDate, vm::ptr totalRecord, vm::ptr option) { - sceNp.todo("sceNpScoreGetClansMembersRankingByNpIdPcId(transId=%d, clanId=%d, boardId=%d, idArray=*0x%x, idArraySize=%d, rankArray=*0x%x, rankArraySize=%d, commentArray=*0x%x, commentArraySize=%d, " - "infoArray=*0x%x, infoArraySize=%d, descriptArray=*0x%x, descriptArraySize=%d, arrayNum=%d, clanInfo=*0x%x, lastSortDate=*0x%x, totalRecord=*0x%x, option=*0x%x)", - transId, clanId, boardId, idArray, idArraySize, rankArray, rankArraySize, commentArray, commentArraySize, infoArray, infoArraySize, descriptArray, descriptArraySize, arrayNum, clanInfo, - lastSortDate, totalRecord, option); + sceNp.todo("sceNpScoreGetClansMembersRankingByNpId(transId=%d, clanId=%d, " + "boardId=%d, idArray=*0x%x, idArraySize=%d, rankArray=*0x%x, " + "rankArraySize=%d, commentArray=*0x%x, commentArraySize=%d, " + "infoArray=*0x%x, infoArraySize=%d, descriptArray=*0x%x, " + "descriptArraySize=%d, arrayNum=%d, clanInfo=*0x%x, " + "lastSortDate=*0x%x, totalRecord=*0x%x, option=*0x%x)", + transId, clanId, boardId, idArray, idArraySize, rankArray, + rankArraySize, commentArray, commentArraySize, infoArray, + infoArraySize, descriptArray, descriptArraySize, arrayNum, + clanInfo, lastSortDate, totalRecord, option); auto& nph = g_fxo->get>(); @@ -6321,16 +7025,29 @@ error_code sceNpScoreGetClansMembersRankingByNpIdPcId(s32 transId, SceNpClanId c return CELL_OK; } -error_code sceNpScoreGetClansMembersRankingByNpIdPcIdAsync(s32 transId, SceNpClanId clanId, SceNpScoreBoardId boardId, vm::cptr idArray, u32 idArraySize, - vm::ptr rankArray, u32 rankArraySize, vm::ptr commentArray, u32 commentArraySize, vm::ptr infoArray, u32 infoArraySize, - vm::ptr descriptArray, u32 descriptArraySize, u32 arrayNum, vm::ptr clanInfo, vm::ptr lastSortDate, +error_code sceNpScoreGetClansMembersRankingByNpIdAsync( + s32 transId, SceNpClanId clanId, SceNpScoreBoardId boardId, + vm::cptr idArray, u32 idArraySize, + vm::ptr rankArray, u32 rankArraySize, + vm::ptr commentArray, u32 commentArraySize, + vm::ptr infoArray, u32 infoArraySize, + vm::ptr descriptArray, + u32 descriptArraySize, u32 arrayNum, + vm::ptr clanInfo, + vm::ptr lastSortDate, vm::ptr totalRecord, s32 prio, vm::ptr option) { sceNp.todo( - "sceNpScoreGetClansMembersRankingByNpIdPcIdAsync(transId=%d, clanId=%d, boardId=%d, idArray=*0x%x, idArraySize=%d, rankArray=*0x%x, rankArraySize=%d, commentArray=*0x%x, commentArraySize=%d, " - "infoArray=*0x%x, infoArraySize=%d, descriptArray=*0x%x, descriptArraySize=%d, arrayNum=%d, clanInfo=*0x%x, lastSortDate=*0x%x, totalRecord=*0x%x, prio=%d, option=*0x%x)", - transId, clanId, boardId, idArray, idArraySize, rankArray, rankArraySize, commentArray, commentArraySize, infoArray, infoArraySize, descriptArray, descriptArraySize, arrayNum, clanInfo, - lastSortDate, totalRecord, prio, option); + "sceNpScoreGetClansMembersRankingByNpIdAsync(transId=%d, clanId=%d, " + "boardId=%d, idArray=*0x%x, idArraySize=%d, rankArray=*0x%x, " + "rankArraySize=%d, commentArray=*0x%x, commentArraySize=%d, " + "infoArray=*0x%x, infoArraySize=%d, descriptArray=*0x%x, " + "descriptArraySize=%d, arrayNum=%d, clanInfo=*0x%x, lastSortDate=*0x%x, " + "totalRecord=*0x%x, prio=%d, option=*0x%x)", + transId, clanId, boardId, idArray, idArraySize, rankArray, rankArraySize, + commentArray, commentArraySize, infoArray, infoArraySize, descriptArray, + descriptArraySize, arrayNum, clanInfo, lastSortDate, totalRecord, prio, + option); auto& nph = g_fxo->get>(); @@ -6352,13 +7069,119 @@ error_code sceNpScoreGetClansMembersRankingByNpIdPcIdAsync(s32 transId, SceNpCla return CELL_OK; } -error_code sceNpScoreGetClansRankingByRange(s32 transId, SceNpScoreClansBoardId clanBoardId, SceNpScoreRankNumber startSerialRank, vm::ptr rankArray, u32 rankArraySize, - vm::ptr reserved1, u32 reservedSize1, vm::ptr reserved2, u32 reservedSize2, u32 arrayNum, vm::ptr lastSortDate, vm::ptr totalRecord, - vm::ptr option) +error_code sceNpScoreGetClansMembersRankingByNpIdPcId( + s32 transId, SceNpClanId clanId, SceNpScoreBoardId boardId, + vm::cptr idArray, u32 idArraySize, + vm::ptr rankArray, u32 rankArraySize, + vm::ptr commentArray, u32 commentArraySize, + vm::ptr infoArray, u32 infoArraySize, + vm::ptr descriptArray, + u32 descriptArraySize, u32 arrayNum, + vm::ptr clanInfo, + vm::ptr lastSortDate, + vm::ptr totalRecord, vm::ptr option) { - sceNp.todo("sceNpScoreGetClansRankingByRange(transId=%d, clanBoardId=%d, startSerialRank=%d, rankArray=*0x%x, rankArraySize=%d, reserved1=*0x%x, reservedSize1=%d, reserved2=*0x%x, reservedSize2=%d, " - "arrayNum=%d, lastSortDate=*0x%x, totalRecord=*0x%x, option=*0x%x)", - transId, clanBoardId, startSerialRank, rankArray, rankArraySize, reserved1, reservedSize1, reserved2, reservedSize2, arrayNum, lastSortDate, totalRecord, option); + sceNp.todo( + "sceNpScoreGetClansMembersRankingByNpIdPcId(transId=%d, clanId=%d, " + "boardId=%d, idArray=*0x%x, idArraySize=%d, rankArray=*0x%x, " + "rankArraySize=%d, commentArray=*0x%x, commentArraySize=%d, " + "infoArray=*0x%x, infoArraySize=%d, descriptArray=*0x%x, " + "descriptArraySize=%d, arrayNum=%d, clanInfo=*0x%x, lastSortDate=*0x%x, " + "totalRecord=*0x%x, option=*0x%x)", + transId, clanId, boardId, idArray, idArraySize, rankArray, rankArraySize, + commentArray, commentArraySize, infoArray, infoArraySize, descriptArray, + descriptArraySize, arrayNum, clanInfo, lastSortDate, totalRecord, option); + + auto& nph = g_fxo->get>(); + + if (!nph.is_NP_Score_init) + { + return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED; + } + + if (!idArray || !rankArray || !totalRecord || !lastSortDate || !arrayNum) + { + return SCE_NP_COMMUNITY_ERROR_INSUFFICIENT_ARGUMENT; + } + + if (option) // option check at least until fw 4.71 + { + return SCE_NP_COMMUNITY_ERROR_INVALID_ARGUMENT; + } + + if (arrayNum > SCE_NP_SCORE_MAX_NPID_NUM_PER_TRANS) + { + return SCE_NP_COMMUNITY_ERROR_TOO_MANY_NPID; + } + + if (nph.get_psn_status() != SCE_NP_MANAGER_STATUS_ONLINE) + { + return SCE_NP_COMMUNITY_ERROR_INVALID_ONLINE_ID; + } + + return CELL_OK; +} + +error_code sceNpScoreGetClansMembersRankingByNpIdPcIdAsync( + s32 transId, SceNpClanId clanId, SceNpScoreBoardId boardId, + vm::cptr idArray, u32 idArraySize, + vm::ptr rankArray, u32 rankArraySize, + vm::ptr commentArray, u32 commentArraySize, + vm::ptr infoArray, u32 infoArraySize, + vm::ptr descriptArray, + u32 descriptArraySize, u32 arrayNum, + vm::ptr clanInfo, + vm::ptr lastSortDate, + vm::ptr totalRecord, s32 prio, vm::ptr option) +{ + sceNp.todo( + "sceNpScoreGetClansMembersRankingByNpIdPcIdAsync(transId=%d, clanId=%d, " + "boardId=%d, idArray=*0x%x, idArraySize=%d, rankArray=*0x%x, " + "rankArraySize=%d, commentArray=*0x%x, commentArraySize=%d, " + "infoArray=*0x%x, infoArraySize=%d, descriptArray=*0x%x, " + "descriptArraySize=%d, arrayNum=%d, clanInfo=*0x%x, lastSortDate=*0x%x, " + "totalRecord=*0x%x, prio=%d, option=*0x%x)", + transId, clanId, boardId, idArray, idArraySize, rankArray, rankArraySize, + commentArray, commentArraySize, infoArray, infoArraySize, descriptArray, + descriptArraySize, arrayNum, clanInfo, lastSortDate, totalRecord, prio, + option); + + auto& nph = g_fxo->get>(); + + if (!nph.is_NP_Score_init) + { + return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED; + } + + if (!idArray || !arrayNum) + { + return SCE_NP_COMMUNITY_ERROR_INSUFFICIENT_ARGUMENT; + } + + if (option) // option check at least until fw 4.71 + { + return SCE_NP_COMMUNITY_ERROR_INVALID_ARGUMENT; + } + + return CELL_OK; +} + +error_code sceNpScoreGetClansRankingByRange( + s32 transId, SceNpScoreClansBoardId clanBoardId, + SceNpScoreRankNumber startSerialRank, + vm::ptr rankArray, u32 rankArraySize, + vm::ptr reserved1, u32 reservedSize1, vm::ptr reserved2, + u32 reservedSize2, u32 arrayNum, vm::ptr lastSortDate, + vm::ptr totalRecord, vm::ptr option) +{ + sceNp.todo( + "sceNpScoreGetClansRankingByRange(transId=%d, clanBoardId=%d, " + "startSerialRank=%d, rankArray=*0x%x, rankArraySize=%d, reserved1=*0x%x, " + "reservedSize1=%d, reserved2=*0x%x, reservedSize2=%d, " + "arrayNum=%d, lastSortDate=*0x%x, totalRecord=*0x%x, option=*0x%x)", + transId, clanBoardId, startSerialRank, rankArray, rankArraySize, + reserved1, reservedSize1, reserved2, reservedSize2, arrayNum, + lastSortDate, totalRecord, option); auto& nph = g_fxo->get>(); @@ -6372,7 +7195,9 @@ error_code sceNpScoreGetClansRankingByRange(s32 transId, SceNpScoreClansBoardId return SCE_NP_COMMUNITY_ERROR_INSUFFICIENT_ARGUMENT; } - if (!startSerialRank || reserved1 || reservedSize1 || reserved2 || reservedSize2 || option) // reserved and option checks at least until fw 4.71 + if (!startSerialRank || reserved1 || reservedSize1 || reserved2 || + reservedSize2 || + option) // reserved and option checks at least until fw 4.71 { return SCE_NP_COMMUNITY_ERROR_INVALID_ARGUMENT; } @@ -6390,13 +7215,23 @@ error_code sceNpScoreGetClansRankingByRange(s32 transId, SceNpScoreClansBoardId return CELL_OK; } -error_code sceNpScoreGetClansRankingByRangeAsync(s32 transId, SceNpScoreClansBoardId clanBoardId, SceNpScoreRankNumber startSerialRank, vm::ptr rankArray, u32 rankArraySize, - vm::ptr reserved1, u32 reservedSize1, vm::ptr reserved2, u32 reservedSize2, u32 arrayNum, vm::ptr lastSortDate, vm::ptr totalRecord, s32 prio, - vm::ptr option) +error_code sceNpScoreGetClansRankingByRangeAsync( + s32 transId, SceNpScoreClansBoardId clanBoardId, + SceNpScoreRankNumber startSerialRank, + vm::ptr rankArray, u32 rankArraySize, + vm::ptr reserved1, u32 reservedSize1, vm::ptr reserved2, + u32 reservedSize2, u32 arrayNum, vm::ptr lastSortDate, + vm::ptr totalRecord, s32 prio, vm::ptr option) { - sceNp.todo("sceNpScoreGetClansRankingByRangeAsync(transId=%d, clanBoardId=%d, startSerialRank=%d, rankArray=*0x%x, rankArraySize=%d, reserved1=*0x%x, reservedSize1=%d, reserved2=*0x%x, " - "reservedSize2=%d, arrayNum=%d, lastSortDate=*0x%x, totalRecord=*0x%x, prio=%d, option=*0x%x)", - transId, clanBoardId, startSerialRank, rankArray, rankArraySize, reserved1, reservedSize1, reserved2, reservedSize2, arrayNum, lastSortDate, totalRecord, prio, option); + sceNp.todo( + "sceNpScoreGetClansRankingByRangeAsync(transId=%d, clanBoardId=%d, " + "startSerialRank=%d, rankArray=*0x%x, rankArraySize=%d, reserved1=*0x%x, " + "reservedSize1=%d, reserved2=*0x%x, " + "reservedSize2=%d, arrayNum=%d, lastSortDate=*0x%x, totalRecord=*0x%x, " + "prio=%d, option=*0x%x)", + transId, clanBoardId, startSerialRank, rankArray, rankArraySize, + reserved1, reservedSize1, reserved2, reservedSize2, arrayNum, + lastSortDate, totalRecord, prio, option); auto& nph = g_fxo->get>(); @@ -6410,7 +7245,9 @@ error_code sceNpScoreGetClansRankingByRangeAsync(s32 transId, SceNpScoreClansBoa return SCE_NP_COMMUNITY_ERROR_INSUFFICIENT_ARGUMENT; } - if (!startSerialRank || reserved1 || reservedSize1 || reserved2 || reservedSize2 || option) // reserved and option checks at least until fw 4.71 + if (!startSerialRank || reserved1 || reservedSize1 || reserved2 || + reservedSize2 || + option) // reserved and option checks at least until fw 4.71 { return SCE_NP_COMMUNITY_ERROR_INVALID_ARGUMENT; } @@ -6418,11 +7255,16 @@ error_code sceNpScoreGetClansRankingByRangeAsync(s32 transId, SceNpScoreClansBoa return CELL_OK; } -error_code sceNpScoreGetClanMemberGameData( - s32 transId, SceNpScoreBoardId boardId, SceNpClanId clanId, vm::cptr npId, vm::ptr totalSize, u32 recvSize, vm::ptr data, vm::ptr option) +error_code +sceNpScoreGetClanMemberGameData(s32 transId, SceNpScoreBoardId boardId, + SceNpClanId clanId, vm::cptr npId, + vm::ptr totalSize, u32 recvSize, + vm::ptr data, vm::ptr option) { - sceNp.todo("sceNpScoreGetClanMemberGameData(transId=%d, boardId=%d, clanId=%d, npId=*0x%x, totalSize=*0x%x, recvSize=%d, data=*0x%x, option=*0x%x)", transId, boardId, clanId, npId, totalSize, - recvSize, data, option); + sceNp.todo( + "sceNpScoreGetClanMemberGameData(transId=%d, boardId=%d, clanId=%d, " + "npId=*0x%x, totalSize=*0x%x, recvSize=%d, data=*0x%x, option=*0x%x)", + transId, boardId, clanId, npId, totalSize, recvSize, data, option); auto& nph = g_fxo->get>(); @@ -6450,10 +7292,15 @@ error_code sceNpScoreGetClanMemberGameData( } error_code sceNpScoreGetClanMemberGameDataAsync( - s32 transId, SceNpScoreBoardId boardId, SceNpClanId clanId, vm::cptr npId, vm::ptr totalSize, u32 recvSize, vm::ptr data, s32 prio, vm::ptr option) + s32 transId, SceNpScoreBoardId boardId, SceNpClanId clanId, + vm::cptr npId, vm::ptr totalSize, u32 recvSize, + vm::ptr data, s32 prio, vm::ptr option) { - sceNp.todo("sceNpScoreGetClanMemberGameDataAsync(transId=%d, boardId=%d, clanId=%d, npId=*0x%x, totalSize=*0x%x, recvSize=%d, data=*0x%x, prio=%d, option=*0x%x)", transId, boardId, clanId, npId, - totalSize, recvSize, data, prio, option); + sceNp.todo("sceNpScoreGetClanMemberGameDataAsync(transId=%d, boardId=%d, " + "clanId=%d, npId=*0x%x, totalSize=*0x%x, recvSize=%d, data=*0x%x, " + "prio=%d, option=*0x%x)", + transId, boardId, clanId, npId, totalSize, recvSize, data, prio, + option); auto& nph = g_fxo->get>(); @@ -6470,13 +7317,22 @@ error_code sceNpScoreGetClanMemberGameDataAsync( return CELL_OK; } -error_code sceNpScoreGetClansRankingByClanId(s32 transId, SceNpScoreClansBoardId clanBoardId, vm::cptr clanIdArray, u32 clanIdArraySize, vm::ptr rankArray, - u32 rankArraySize, vm::ptr reserved1, u32 reservedSize1, vm::ptr reserved2, u32 reservedSize2, u32 arrayNum, vm::ptr lastSortDate, +error_code sceNpScoreGetClansRankingByClanId( + s32 transId, SceNpScoreClansBoardId clanBoardId, + vm::cptr clanIdArray, u32 clanIdArraySize, + vm::ptr rankArray, u32 rankArraySize, + vm::ptr reserved1, u32 reservedSize1, vm::ptr reserved2, + u32 reservedSize2, u32 arrayNum, vm::ptr lastSortDate, vm::ptr totalRecord, vm::ptr option) { - sceNp.todo("sceNpScoreGetClansRankingByClanId(transId=%d, clanBoardId=%d, clanIdArray=*0x%x, clanIdArraySize=%d, rankArray=*0x%x, rankArraySize=%d, reserved1=*0x%x, reservedSize1=%d, " - "reserved2=*0x%x, reservedSize2=%d, arrayNum=%d, lastSortDate=*0x%x, totalRecord=*0x%x, option=*0x%x)", - transId, clanBoardId, clanIdArray, clanIdArraySize, rankArray, rankArraySize, reserved1, reservedSize1, reserved2, reservedSize2, arrayNum, lastSortDate, totalRecord, option); + sceNp.todo("sceNpScoreGetClansRankingByClanId(transId=%d, clanBoardId=%d, " + "clanIdArray=*0x%x, clanIdArraySize=%d, rankArray=*0x%x, " + "rankArraySize=%d, reserved1=*0x%x, reservedSize1=%d, " + "reserved2=*0x%x, reservedSize2=%d, arrayNum=%d, " + "lastSortDate=*0x%x, totalRecord=*0x%x, option=*0x%x)", + transId, clanBoardId, clanIdArray, clanIdArraySize, rankArray, + rankArraySize, reserved1, reservedSize1, reserved2, reservedSize2, + arrayNum, lastSortDate, totalRecord, option); auto& nph = g_fxo->get>(); @@ -6485,12 +7341,14 @@ error_code sceNpScoreGetClansRankingByClanId(s32 transId, SceNpScoreClansBoardId return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED; } - if (!clanIdArray || !rankArray || !totalRecord || !lastSortDate || !arrayNum) + if (!clanIdArray || !rankArray || !totalRecord || !lastSortDate || + !arrayNum) { return SCE_NP_COMMUNITY_ERROR_INSUFFICIENT_ARGUMENT; } - if (reserved1 || reservedSize1 || reserved2 || reservedSize2 || option) // reserved and option checks at least until fw 4.71 + if (reserved1 || reservedSize1 || reserved2 || reservedSize2 || + option) // reserved and option checks at least until fw 4.71 { return SCE_NP_COMMUNITY_ERROR_INVALID_ARGUMENT; } @@ -6508,13 +7366,23 @@ error_code sceNpScoreGetClansRankingByClanId(s32 transId, SceNpScoreClansBoardId return CELL_OK; } -error_code sceNpScoreGetClansRankingByClanIdAsync(s32 transId, SceNpScoreClansBoardId clanBoardId, vm::cptr clanIdArray, u32 clanIdArraySize, vm::ptr rankArray, - u32 rankArraySize, vm::ptr reserved1, u32 reservedSize1, vm::ptr reserved2, u32 reservedSize2, u32 arrayNum, vm::ptr lastSortDate, +error_code sceNpScoreGetClansRankingByClanIdAsync( + s32 transId, SceNpScoreClansBoardId clanBoardId, + vm::cptr clanIdArray, u32 clanIdArraySize, + vm::ptr rankArray, u32 rankArraySize, + vm::ptr reserved1, u32 reservedSize1, vm::ptr reserved2, + u32 reservedSize2, u32 arrayNum, vm::ptr lastSortDate, vm::ptr totalRecord, s32 prio, vm::ptr option) { - sceNp.todo("sceNpScoreGetClansRankingByRangeAsync(transId=%d, clanBoardId=%d, clanIdArray=*0x%x, clanIdArraySize=%d, rankArray=*0x%x, rankArraySize=%d, reserved1=*0x%x, reservedSize1=%d, " - "reserved2=*0x%x, reservedSize2=%d, arrayNum=%d, lastSortDate=*0x%x, totalRecord=*0x%x, prio=%d, option=*0x%x)", - transId, clanBoardId, clanIdArray, clanIdArraySize, rankArray, rankArraySize, reserved1, reservedSize1, reserved2, reservedSize2, arrayNum, lastSortDate, totalRecord, prio, option); + sceNp.todo( + "sceNpScoreGetClansRankingByRangeAsync(transId=%d, clanBoardId=%d, " + "clanIdArray=*0x%x, clanIdArraySize=%d, rankArray=*0x%x, " + "rankArraySize=%d, reserved1=*0x%x, reservedSize1=%d, " + "reserved2=*0x%x, reservedSize2=%d, arrayNum=%d, lastSortDate=*0x%x, " + "totalRecord=*0x%x, prio=%d, option=*0x%x)", + transId, clanBoardId, clanIdArray, clanIdArraySize, rankArray, + rankArraySize, reserved1, reservedSize1, reserved2, reservedSize2, + arrayNum, lastSortDate, totalRecord, prio, option); auto& nph = g_fxo->get>(); @@ -6528,7 +7396,8 @@ error_code sceNpScoreGetClansRankingByClanIdAsync(s32 transId, SceNpScoreClansBo return SCE_NP_COMMUNITY_ERROR_INSUFFICIENT_ARGUMENT; } - if (reserved1 || reservedSize1 || reserved2 || reservedSize2 || option) // reserved and option checks at least until fw 4.71 + if (reserved1 || reservedSize1 || reserved2 || reservedSize2 || + option) // reserved and option checks at least until fw 4.71 { return SCE_NP_COMMUNITY_ERROR_INVALID_ARGUMENT; } @@ -6536,14 +7405,28 @@ error_code sceNpScoreGetClansRankingByClanIdAsync(s32 transId, SceNpScoreClansBo return CELL_OK; } -error_code sceNpScoreGetClansMembersRankingByRange(s32 transId, SceNpClanId clanId, SceNpScoreBoardId boardId, SceNpScoreRankNumber startSerialRank, vm::ptr rankArray, - u32 rankArraySize, vm::ptr commentArray, u32 commentArraySize, vm::ptr infoArray, u32 infoArraySize, vm::ptr descriptArray, - u32 descriptArraySize, u32 arrayNum, vm::ptr clanInfo, vm::ptr lastSortDate, vm::ptr totalRecord, vm::ptr option) +error_code sceNpScoreGetClansMembersRankingByRange( + s32 transId, SceNpClanId clanId, SceNpScoreBoardId boardId, + SceNpScoreRankNumber startSerialRank, + vm::ptr rankArray, u32 rankArraySize, + vm::ptr commentArray, u32 commentArraySize, + vm::ptr infoArray, u32 infoArraySize, + vm::ptr descriptArray, + u32 descriptArraySize, u32 arrayNum, + vm::ptr clanInfo, + vm::ptr lastSortDate, + vm::ptr totalRecord, vm::ptr option) { - sceNp.todo("sceNpScoreGetClansMembersRankingByRange(transId=%d, clanId=%d, boardId=%d, startSerialRank=%d, rankArray=*0x%x, rankArraySize=%d, commentArray=*0x%x, commentArraySize=%d, " - "infoArray=*0x%x, infoArraySize=%d, descriptArray=*0x%x, descriptArraySize=%d, arrayNum=%d, clanInfo=*0x%x, lastSortDate=*0x%x, totalRecord=*0x%x, option=*0x%x)", - transId, clanId, boardId, startSerialRank, rankArray, rankArraySize, commentArray, commentArraySize, infoArray, infoArraySize, descriptArray, descriptArraySize, arrayNum, clanInfo, lastSortDate, - totalRecord, option); + sceNp.todo("sceNpScoreGetClansMembersRankingByRange(transId=%d, clanId=%d, " + "boardId=%d, startSerialRank=%d, rankArray=*0x%x, " + "rankArraySize=%d, commentArray=*0x%x, commentArraySize=%d, " + "infoArray=*0x%x, infoArraySize=%d, descriptArray=*0x%x, " + "descriptArraySize=%d, arrayNum=%d, clanInfo=*0x%x, " + "lastSortDate=*0x%x, totalRecord=*0x%x, option=*0x%x)", + transId, clanId, boardId, startSerialRank, rankArray, + rankArraySize, commentArray, commentArraySize, infoArray, + infoArraySize, descriptArray, descriptArraySize, arrayNum, + clanInfo, lastSortDate, totalRecord, option); auto& nph = g_fxo->get>(); @@ -6575,14 +7458,28 @@ error_code sceNpScoreGetClansMembersRankingByRange(s32 transId, SceNpClanId clan return CELL_OK; } -error_code sceNpScoreGetClansMembersRankingByRangeAsync(s32 transId, SceNpClanId clanId, SceNpScoreBoardId boardId, SceNpScoreRankNumber startSerialRank, vm::ptr rankArray, - u32 rankArraySize, vm::ptr commentArray, u32 commentArraySize, vm::ptr infoArray, u32 infoArraySize, vm::ptr descriptArray, - u32 descriptArraySize, u32 arrayNum, vm::ptr clanInfo, vm::ptr lastSortDate, vm::ptr totalRecord, s32 prio, vm::ptr option) +error_code sceNpScoreGetClansMembersRankingByRangeAsync( + s32 transId, SceNpClanId clanId, SceNpScoreBoardId boardId, + SceNpScoreRankNumber startSerialRank, + vm::ptr rankArray, u32 rankArraySize, + vm::ptr commentArray, u32 commentArraySize, + vm::ptr infoArray, u32 infoArraySize, + vm::ptr descriptArray, + u32 descriptArraySize, u32 arrayNum, + vm::ptr clanInfo, + vm::ptr lastSortDate, + vm::ptr totalRecord, s32 prio, vm::ptr option) { - sceNp.todo("sceNpScoreGetClansMembersRankingByRangeAsync(transId=%d, clanId=%d, boardId=%d, startSerialRank=%d, rankArray=*0x%x, rankArraySize=%d, commentArray=*0x%x, commentArraySize=%d, " - "infoArray=*0x%x, infoArraySize=%d, descriptArray=*0x%x, descriptArraySize=%d, arrayNum=%d, clanInfo=*0x%x, lastSortDate=*0x%x, totalRecord=*0x%x, prio=%d, option=*0x%x)", - transId, clanId, boardId, startSerialRank, rankArray, rankArraySize, commentArray, commentArraySize, infoArray, infoArraySize, descriptArray, descriptArraySize, arrayNum, clanInfo, lastSortDate, - totalRecord, prio, option); + sceNp.todo("sceNpScoreGetClansMembersRankingByRangeAsync(transId=%d, " + "clanId=%d, boardId=%d, startSerialRank=%d, rankArray=*0x%x, " + "rankArraySize=%d, commentArray=*0x%x, commentArraySize=%d, " + "infoArray=*0x%x, infoArraySize=%d, descriptArray=*0x%x, " + "descriptArraySize=%d, arrayNum=%d, clanInfo=*0x%x, " + "lastSortDate=*0x%x, totalRecord=*0x%x, prio=%d, option=*0x%x)", + transId, clanId, boardId, startSerialRank, rankArray, + rankArraySize, commentArray, commentArraySize, infoArray, + infoArraySize, descriptArray, descriptArraySize, arrayNum, + clanInfo, lastSortDate, totalRecord, prio, option); auto& nph = g_fxo->get>(); @@ -6604,9 +7501,13 @@ error_code sceNpScoreGetClansMembersRankingByRangeAsync(s32 transId, SceNpClanId return CELL_OK; } -error_code sceNpSignalingCreateCtx(vm::ptr npId, vm::ptr handler, vm::ptr arg, vm::ptr ctx_id) +error_code sceNpSignalingCreateCtx(vm::ptr npId, + vm::ptr handler, + vm::ptr arg, vm::ptr ctx_id) { - sceNp.warning("sceNpSignalingCreateCtx(npId=*0x%x, handler=*0x%x, arg=*0x%x, ctx_id=*0x%x)", npId, handler, arg, ctx_id); + sceNp.warning("sceNpSignalingCreateCtx(npId=*0x%x, handler=*0x%x, arg=*0x%x, " + "ctx_id=*0x%x)", + npId, handler, arg, ctx_id); auto& nph = g_fxo->get>(); @@ -6657,9 +7558,12 @@ error_code sceNpSignalingDestroyCtx(u32 ctx_id) return CELL_OK; } -error_code sceNpSignalingAddExtendedHandler(u32 ctx_id, vm::ptr handler, vm::ptr arg) +error_code sceNpSignalingAddExtendedHandler( + u32 ctx_id, vm::ptr handler, vm::ptr arg) { - sceNp.warning("sceNpSignalingAddExtendedHandler(ctx_id=%d, handler=*0x%x, arg=*0x%x)", ctx_id, handler, arg); + sceNp.warning( + "sceNpSignalingAddExtendedHandler(ctx_id=%d, handler=*0x%x, arg=*0x%x)", + ctx_id, handler, arg); auto& nph = g_fxo->get>(); @@ -6684,7 +7588,8 @@ error_code sceNpSignalingAddExtendedHandler(u32 ctx_id, vm::ptrget>(); @@ -6710,9 +7615,11 @@ error_code sceNpSignalingSetCtxOpt(u32 ctx_id, s32 optname, s32 optval) return CELL_OK; } -error_code sceNpSignalingGetCtxOpt(u32 ctx_id, s32 optname, vm::ptr optval) +error_code sceNpSignalingGetCtxOpt(u32 ctx_id, s32 optname, + vm::ptr optval) { - sceNp.todo("sceNpSignalingGetCtxOpt(ctx_id=%d, optname=%d, optval=*0x%x)", ctx_id, optname, optval); + sceNp.todo("sceNpSignalingGetCtxOpt(ctx_id=%d, optname=%d, optval=*0x%x)", + ctx_id, optname, optval); auto& nph = g_fxo->get>(); @@ -6738,9 +7645,12 @@ error_code sceNpSignalingGetCtxOpt(u32 ctx_id, s32 optname, vm::ptr optval) return CELL_OK; } -error_code sceNpSignalingActivateConnection(u32 ctx_id, vm::ptr npId, vm::ptr conn_id) +error_code sceNpSignalingActivateConnection(u32 ctx_id, vm::ptr npId, + vm::ptr conn_id) { - sceNp.warning("sceNpSignalingActivateConnection(ctx_id=%d, npId=*0x%x, conn_id=*0x%x)", ctx_id, npId, conn_id); + sceNp.warning( + "sceNpSignalingActivateConnection(ctx_id=%d, npId=*0x%x, conn_id=*0x%x)", + ctx_id, npId, conn_id); auto& nph = g_fxo->get>(); @@ -6765,7 +7675,8 @@ error_code sceNpSignalingActivateConnection(u32 ctx_id, vm::ptr npId, v error_code sceNpSignalingDeactivateConnection(u32 ctx_id, u32 conn_id) { - sceNp.warning("sceNpSignalingDeactivateConnection(ctx_id=%d, conn_id=%d)", ctx_id, conn_id); + sceNp.warning("sceNpSignalingDeactivateConnection(ctx_id=%d, conn_id=%d)", + ctx_id, conn_id); auto& nph = g_fxo->get>(); @@ -6783,7 +7694,8 @@ error_code sceNpSignalingDeactivateConnection(u32 ctx_id, u32 conn_id) error_code sceNpSignalingTerminateConnection(u32 ctx_id, u32 conn_id) { - sceNp.warning("sceNpSignalingTerminateConnection(ctx_id=%d, conn_id=%d)", ctx_id, conn_id); + sceNp.warning("sceNpSignalingTerminateConnection(ctx_id=%d, conn_id=%d)", + ctx_id, conn_id); auto& nph = g_fxo->get>(); @@ -6799,9 +7711,14 @@ error_code sceNpSignalingTerminateConnection(u32 ctx_id, u32 conn_id) return CELL_OK; } -error_code sceNpSignalingGetConnectionStatus(u32 ctx_id, u32 conn_id, vm::ptr conn_status, vm::ptr peer_addr, vm::ptr peer_port) +error_code sceNpSignalingGetConnectionStatus(u32 ctx_id, u32 conn_id, + vm::ptr conn_status, + vm::ptr peer_addr, + vm::ptr peer_port) { - sceNp.warning("sceNpSignalingGetConnectionStatus(ctx_id=%d, conn_id=%d, conn_status=*0x%x, peer_addr=*0x%x, peer_port=*0x%x)", ctx_id, conn_id, conn_status, peer_addr, peer_port); + sceNp.warning("sceNpSignalingGetConnectionStatus(ctx_id=%d, conn_id=%d, " + "conn_status=*0x%x, peer_addr=*0x%x, peer_port=*0x%x)", + ctx_id, conn_id, conn_status, peer_addr, peer_port); auto& nph = g_fxo->get>(); @@ -6835,9 +7752,13 @@ error_code sceNpSignalingGetConnectionStatus(u32 ctx_id, u32 conn_id, vm::ptr info) +error_code +sceNpSignalingGetConnectionInfo(u32 ctx_id, u32 conn_id, s32 code, + vm::ptr info) { - sceNp.warning("sceNpSignalingGetConnectionInfo(ctx_id=%d, conn_id=%d, code=%d, info=*0x%x)", ctx_id, conn_id, code, info); + sceNp.warning("sceNpSignalingGetConnectionInfo(ctx_id=%d, conn_id=%d, " + "code=%d, info=*0x%x)", + ctx_id, conn_id, code, info); auto& nph = g_fxo->get>(); @@ -6900,9 +7821,13 @@ error_code sceNpSignalingGetConnectionInfo(u32 ctx_id, u32 conn_id, s32 code, vm return CELL_OK; } -error_code sceNpSignalingGetConnectionFromNpId(u32 ctx_id, vm::ptr npId, vm::ptr conn_id) +error_code sceNpSignalingGetConnectionFromNpId(u32 ctx_id, + vm::ptr npId, + vm::ptr conn_id) { - sceNp.notice("sceNpSignalingGetConnectionFromNpId(ctx_id=%d, npId=*0x%x, conn_id=*0x%x)", ctx_id, npId, conn_id); + sceNp.notice("sceNpSignalingGetConnectionFromNpId(ctx_id=%d, npId=*0x%x, " + "conn_id=*0x%x)", + ctx_id, npId, conn_id); auto& nph = g_fxo->get>(); @@ -6934,9 +7859,14 @@ error_code sceNpSignalingGetConnectionFromNpId(u32 ctx_id, vm::ptr npId return CELL_OK; } -error_code sceNpSignalingGetConnectionFromPeerAddress(u32 ctx_id, np_in_addr_t peer_addr, np_in_port_t peer_port, vm::ptr conn_id) +error_code sceNpSignalingGetConnectionFromPeerAddress(u32 ctx_id, + np_in_addr_t peer_addr, + np_in_port_t peer_port, + vm::ptr conn_id) { - sceNp.warning("sceNpSignalingGetConnectionFromPeerAddress(ctx_id=%d, peer_addr=0x%x, peer_port=%d, conn_id=*0x%x)", ctx_id, peer_addr, peer_port, conn_id); + sceNp.warning("sceNpSignalingGetConnectionFromPeerAddress(ctx_id=%d, " + "peer_addr=0x%x, peer_port=%d, conn_id=*0x%x)", + ctx_id, peer_addr, peer_port, conn_id); auto& nph = g_fxo->get>(); @@ -6963,9 +7893,11 @@ error_code sceNpSignalingGetConnectionFromPeerAddress(u32 ctx_id, np_in_addr_t p return CELL_OK; } -error_code sceNpSignalingGetLocalNetInfo(u32 ctx_id, vm::ptr info) +error_code sceNpSignalingGetLocalNetInfo(u32 ctx_id, + vm::ptr info) { - sceNp.warning("sceNpSignalingGetLocalNetInfo(ctx_id=%d, info=*0x%x)", ctx_id, info); + sceNp.warning("sceNpSignalingGetLocalNetInfo(ctx_id=%d, info=*0x%x)", ctx_id, + info); auto& nph = g_fxo->get>(); @@ -6991,9 +7923,12 @@ error_code sceNpSignalingGetLocalNetInfo(u32 ctx_id, vm::ptr npId, vm::ptr req_id) +error_code sceNpSignalingGetPeerNetInfo(u32 ctx_id, vm::ptr npId, + vm::ptr req_id) { - sceNp.todo("sceNpSignalingGetPeerNetInfo(ctx_id=%d, npId=*0x%x, req_id=*0x%x)", ctx_id, npId, req_id); + sceNp.todo( + "sceNpSignalingGetPeerNetInfo(ctx_id=%d, npId=*0x%x, req_id=*0x%x)", + ctx_id, npId, req_id); auto& nph = g_fxo->get>(); @@ -7012,7 +7947,8 @@ error_code sceNpSignalingGetPeerNetInfo(u32 ctx_id, vm::ptr npId, vm::p error_code sceNpSignalingCancelPeerNetInfo(u32 ctx_id, u32 req_id) { - sceNp.todo("sceNpSignalingCancelPeerNetInfo(ctx_id=%d, req_id=%d)", ctx_id, req_id); + sceNp.todo("sceNpSignalingCancelPeerNetInfo(ctx_id=%d, req_id=%d)", ctx_id, + req_id); auto& nph = g_fxo->get>(); @@ -7024,9 +7960,13 @@ error_code sceNpSignalingCancelPeerNetInfo(u32 ctx_id, u32 req_id) return CELL_OK; } -error_code sceNpSignalingGetPeerNetInfoResult(u32 ctx_id, u32 req_id, vm::ptr info) +error_code +sceNpSignalingGetPeerNetInfoResult(u32 ctx_id, u32 req_id, + vm::ptr info) { - sceNp.todo("sceNpSignalingGetPeerNetInfoResult(ctx_id=%d, req_id=%d, info=*0x%x)", ctx_id, req_id, info); + sceNp.todo( + "sceNpSignalingGetPeerNetInfoResult(ctx_id=%d, req_id=%d, info=*0x%x)", + ctx_id, req_id, info); auto& nph = g_fxo->get>(); @@ -7084,7 +8024,8 @@ error_code sceNpUtilCanonicalizeNpIdForPsp(vm::ptr npId) error_code sceNpUtilCmpNpId(vm::ptr id1, vm::ptr id2) { - sceNp.trace("sceNpUtilCmpNpId(id1=*0x%x(%s), id2=*0x%x(%s))", id1, id1 ? id1->handle.data : "", id2, id2 ? id2->handle.data : ""); + sceNp.trace("sceNpUtilCmpNpId(id1=*0x%x(%s), id2=*0x%x(%s))", id1, + id1 ? id1->handle.data : "", id2, id2 ? id2->handle.data : ""); if (!id1 || !id2) { @@ -7097,9 +8038,11 @@ error_code sceNpUtilCmpNpId(vm::ptr id1, vm::ptr id2) return CELL_OK; } -error_code sceNpUtilCmpNpIdInOrder(vm::cptr id1, vm::cptr id2, vm::ptr order) +error_code sceNpUtilCmpNpIdInOrder(vm::cptr id1, vm::cptr id2, + vm::ptr order) { - sceNp.trace("sceNpUtilCmpNpIdInOrder(id1=*0x%x, id2=*0x%x, order=*0x%x)", id1, id2, order); + sceNp.trace("sceNpUtilCmpNpIdInOrder(id1=*0x%x, id2=*0x%x, order=*0x%x)", id1, + id2, order); if (!id1 || !id2) { @@ -7192,9 +8135,11 @@ error_code sceNpUtilGetPlatformType(vm::cptr npId) return SCE_NP_UTIL_ERROR_UNKNOWN_PLATFORM_TYPE; } -error_code sceNpUtilSetPlatformType(vm::ptr npId, SceNpPlatformType platformType) +error_code sceNpUtilSetPlatformType(vm::ptr npId, + SceNpPlatformType platformType) { - sceNp.warning("sceNpUtilSetPlatformType(npId=*0x%x, platformType=%d)", npId, platformType); + sceNp.warning("sceNpUtilSetPlatformType(npId=*0x%x, platformType=%d)", npId, + platformType); if (!npId) { @@ -7236,7 +8181,8 @@ error_code _sceNpSysutilClientFree() s32 _Z33_sce_np_sysutil_send_empty_packetiPN16sysutil_cxmlutil11FixedMemoryEPKcS3_() { - sceNp.todo("_Z33_sce_np_sysutil_send_empty_packetiPN16sysutil_cxmlutil11FixedMemoryEPKcS3_()"); + sceNp.todo("_Z33_sce_np_sysutil_send_empty_packetiPN16sysutil_" + "cxmlutil11FixedMemoryEPKcS3_()"); return CELL_OK; } @@ -7248,25 +8194,29 @@ s32 _Z27_sce_np_sysutil_send_packetiRN4cxml8DocumentE() s32 _Z36_sce_np_sysutil_recv_packet_fixedmemiPN16sysutil_cxmlutil11FixedMemoryERN4cxml8DocumentERNS2_7ElementE() { - sceNp.todo("_Z36_sce_np_sysutil_recv_packet_fixedmemiPN16sysutil_cxmlutil11FixedMemoryERN4cxml8DocumentERNS2_7ElementE()"); + sceNp.todo("_Z36_sce_np_sysutil_recv_packet_fixedmemiPN16sysutil_" + "cxmlutil11FixedMemoryERN4cxml8DocumentERNS2_7ElementE()"); return CELL_OK; } s32 _Z40_sce_np_sysutil_recv_packet_fixedmem_subiPN16sysutil_cxmlutil11FixedMemoryERN4cxml8DocumentERNS2_7ElementE() { - sceNp.todo("_Z40_sce_np_sysutil_recv_packet_fixedmem_subiPN16sysutil_cxmlutil11FixedMemoryERN4cxml8DocumentERNS2_7ElementE()"); + sceNp.todo("_Z40_sce_np_sysutil_recv_packet_fixedmem_subiPN16sysutil_" + "cxmlutil11FixedMemoryERN4cxml8DocumentERNS2_7ElementE()"); return CELL_OK; } s32 _Z27_sce_np_sysutil_recv_packetiRN4cxml8DocumentERNS_7ElementE() { - sceNp.todo("_Z27_sce_np_sysutil_recv_packetiRN4cxml8DocumentERNS_7ElementE()"); + sceNp.todo( + "_Z27_sce_np_sysutil_recv_packetiRN4cxml8DocumentERNS_7ElementE()"); return CELL_OK; } s32 _Z29_sce_np_sysutil_cxml_set_npidRN4cxml8DocumentERNS_7ElementEPKcPK7SceNpId() { - sceNp.todo("_Z29_sce_np_sysutil_cxml_set_npidRN4cxml8DocumentERNS_7ElementEPKcPK7SceNpId()"); + sceNp.todo("_Z29_sce_np_sysutil_cxml_set_npidRN4cxml8DocumentERNS_" + "7ElementEPKcPK7SceNpId()"); return CELL_OK; } @@ -7284,7 +8234,8 @@ s32 _Z37sce_np_matching_set_matching2_runningb() s32 _Z32_sce_np_sysutil_cxml_prepare_docPN16sysutil_cxmlutil11FixedMemoryERN4cxml8DocumentEPKcRNS2_7ElementES6_i() { - sceNp.todo("_Z32_sce_np_sysutil_cxml_prepare_docPN16sysutil_cxmlutil11FixedMemoryERN4cxml8DocumentEPKcRNS2_7ElementES6_i()"); + sceNp.todo("_Z32_sce_np_sysutil_cxml_prepare_docPN16sysutil_" + "cxmlutil11FixedMemoryERN4cxml8DocumentEPKcRNS2_7ElementES6_i()"); return CELL_OK; } @@ -7521,13 +8472,24 @@ DECLARE(ppu_module_manager::sceNp) REG_FUNC(sceNp, sceNpUtilSetPlatformType); REG_FUNC(sceNp, _sceNpSysutilClientMalloc); REG_FUNC(sceNp, _sceNpSysutilClientFree); - REG_FUNC(sceNp, _Z33_sce_np_sysutil_send_empty_packetiPN16sysutil_cxmlutil11FixedMemoryEPKcS3_); + REG_FUNC( + sceNp, + _Z33_sce_np_sysutil_send_empty_packetiPN16sysutil_cxmlutil11FixedMemoryEPKcS3_); REG_FUNC(sceNp, _Z27_sce_np_sysutil_send_packetiRN4cxml8DocumentE); - REG_FUNC(sceNp, _Z36_sce_np_sysutil_recv_packet_fixedmemiPN16sysutil_cxmlutil11FixedMemoryERN4cxml8DocumentERNS2_7ElementE); - REG_FUNC(sceNp, _Z40_sce_np_sysutil_recv_packet_fixedmem_subiPN16sysutil_cxmlutil11FixedMemoryERN4cxml8DocumentERNS2_7ElementE); - REG_FUNC(sceNp, _Z27_sce_np_sysutil_recv_packetiRN4cxml8DocumentERNS_7ElementE); - REG_FUNC(sceNp, _Z29_sce_np_sysutil_cxml_set_npidRN4cxml8DocumentERNS_7ElementEPKcPK7SceNpId); + REG_FUNC( + sceNp, + _Z36_sce_np_sysutil_recv_packet_fixedmemiPN16sysutil_cxmlutil11FixedMemoryERN4cxml8DocumentERNS2_7ElementE); + REG_FUNC( + sceNp, + _Z40_sce_np_sysutil_recv_packet_fixedmem_subiPN16sysutil_cxmlutil11FixedMemoryERN4cxml8DocumentERNS2_7ElementE); + REG_FUNC(sceNp, + _Z27_sce_np_sysutil_recv_packetiRN4cxml8DocumentERNS_7ElementE); + REG_FUNC( + sceNp, + _Z29_sce_np_sysutil_cxml_set_npidRN4cxml8DocumentERNS_7ElementEPKcPK7SceNpId); REG_FUNC(sceNp, _Z31_sce_np_sysutil_send_packet_subiRN4cxml8DocumentE); REG_FUNC(sceNp, _Z37sce_np_matching_set_matching2_runningb); - REG_FUNC(sceNp, _Z32_sce_np_sysutil_cxml_prepare_docPN16sysutil_cxmlutil11FixedMemoryERN4cxml8DocumentEPKcRNS2_7ElementES6_i); + REG_FUNC( + sceNp, + _Z32_sce_np_sysutil_cxml_prepare_docPN16sysutil_cxmlutil11FixedMemoryERN4cxml8DocumentEPKcRNS2_7ElementES6_i); }); diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/sceNp2.cpp b/ps3fw/sceNp2.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/sceNp2.cpp rename to ps3fw/sceNp2.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/sceNpClans.cpp b/ps3fw/sceNpClans.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/sceNpClans.cpp rename to ps3fw/sceNpClans.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/sceNpCommerce2.cpp b/ps3fw/sceNpCommerce2.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/sceNpCommerce2.cpp rename to ps3fw/sceNpCommerce2.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/sceNpMatchingInt.cpp b/ps3fw/sceNpMatchingInt.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/sceNpMatchingInt.cpp rename to ps3fw/sceNpMatchingInt.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/sceNpPlus.cpp b/ps3fw/sceNpPlus.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/sceNpPlus.cpp rename to ps3fw/sceNpPlus.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/sceNpSns.cpp b/ps3fw/sceNpSns.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/sceNpSns.cpp rename to ps3fw/sceNpSns.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/sceNpTrophy.cpp b/ps3fw/sceNpTrophy.cpp similarity index 76% rename from rpcs3/rpcs3/Emu/Cell/Modules/sceNpTrophy.cpp rename to ps3fw/sceNpTrophy.cpp index 1bfe4f185..84217e041 100644 --- a/rpcs3/rpcs3/Emu/Cell/Modules/sceNpTrophy.cpp +++ b/ps3fw/sceNpTrophy.cpp @@ -1,35 +1,33 @@ #include "stdafx.h" -#include "Emu/System.h" -#include "Emu/system_config.h" -#include "Emu/VFS.h" -#include "Emu/IdManager.h" +#include "cellMsgDialog.h" #include "Emu/Cell/PPUModule.h" #include "Emu/Cell/timers.hpp" -#include "Emu/Cell/Modules/cellMsgDialog.h" +#include "Emu/IdManager.h" +#include "Emu/System.h" +#include "Emu/VFS.h" +#include "Emu/system_config.h" -#include "Utilities/rXml.h" -#include "Loader/TRP.h" #include "Loader/TROPUSR.h" +#include "Loader/TRP.h" +#include "util/rXml.h" +#include "cellSysutil.h" #include "sceNp.h" #include "sceNpTrophy.h" -#include "cellSysutil.h" -#include "Utilities/StrUtil.h" +#include "util/StrUtil.h" #include "Emu/Cell/lv2/sys_event.h" #include "Emu/Cell/lv2/sys_fs.h" +#include "util/asm.hpp" #include #include #include -#include "util/asm.hpp" LOG_CHANNEL(sceNpTrophy); -TrophyNotificationBase::~TrophyNotificationBase() -{ -} +TrophyNotificationBase::~TrophyNotificationBase() {} struct trophy_context_t { @@ -44,16 +42,17 @@ struct trophy_context_t trophy_context_t() = default; - trophy_context_t(utils::serial& ar) - : trp_name(ar.pop()) + trophy_context_t(utils::serial& ar) : trp_name(ar.pop()) { - std::string trophy_path = vfs::get(Emu.GetDir() + "TROPDIR/" + trp_name + "/TROPHY.TRP"); + std::string trophy_path = + vfs::get(Emu.GetDir() + "TROPDIR/" + trp_name + "/TROPHY.TRP"); fs::file trp_stream(trophy_path); if (!trp_stream) { // Fallback - trophy_path = vfs::get("/dev_bdvd/PS3_GAME/TROPDIR/" + trp_name + "/TROPHY.TRP"); + trophy_path = + vfs::get("/dev_bdvd/PS3_GAME/TROPDIR/" + trp_name + "/TROPHY.TRP"); trp_stream.open(trophy_path); } @@ -70,7 +69,8 @@ struct trophy_context_t return; } - const std::string trophyPath = "/dev_hdd0/home/" + Emu.GetUsr() + "/trophy/" + trp_name; + const std::string trophyPath = + "/dev_hdd0/home/" + Emu.GetUsr() + "/trophy/" + trp_name; tropusr = std::make_unique(); const std::string trophyUsrPath = trophyPath + "/TROPUSR.DAT"; const std::string trophyConfPath = trophyPath + "/TROPCONF.SFM"; @@ -94,10 +94,7 @@ struct trophy_handle_t trophy_handle_t() = default; - trophy_handle_t(utils::serial& ar) - : is_aborted(ar) - { - } + trophy_handle_t(utils::serial& ar) : is_aborted(ar) {} void save(utils::serial& ar) { @@ -111,7 +108,8 @@ struct sce_np_trophy_manager atomic_t is_initialized = false; // Get context + check handle given - static std::pair get_context_ex(u32 context, u32 handle, bool test_writeable = false) + static std::pair + get_context_ex(u32 context, u32 handle, bool test_writeable = false) { decltype(get_context_ex(0, 0)) res{}; auto& [ctxt, error] = res; @@ -165,10 +163,7 @@ struct sce_np_trophy_manager sce_np_trophy_manager() = default; - sce_np_trophy_manager(utils::serial& ar) - : is_initialized(ar) - { - } + sce_np_trophy_manager(utils::serial& ar) : is_initialized(ar) {} void save(utils::serial& ar) { @@ -239,7 +234,8 @@ void fmt_class_string::format(std::string& out, u64 arg) } template <> -void fmt_class_string::format(std::string& out, u64 arg) +void fmt_class_string::format(std::string& out, + u64 arg) { const auto& sign = get_object(arg); @@ -252,40 +248,55 @@ void fmt_class_string::format(std::string& out, u64 arg) const auto& id = get_object(arg); const u8 term = id.data[9]; - fmt::append(out, "{ data='%s', term='%s' (0x%x), num=%d, dummy=%d }", id.data, std::isprint(term) ? fmt::format("%c", term) : "", term, id.num, id.dummy); + fmt::append(out, "{ data='%s', term='%s' (0x%x), num=%d, dummy=%d }", id.data, + std::isprint(term) ? fmt::format("%c", term) : "", term, id.num, + id.dummy); } // Helpers -static error_code NpTrophyGetTrophyInfo(const trophy_context_t* ctxt, s32 trophyId, SceNpTrophyDetails* details, SceNpTrophyData* data); +static error_code NpTrophyGetTrophyInfo(const trophy_context_t* ctxt, + s32 trophyId, + SceNpTrophyDetails* details, + SceNpTrophyData* data); -static void show_trophy_notification(const trophy_context_t* ctxt, s32 trophyId) +static void show_trophy_notification(const trophy_context_t* ctxt, + s32 trophyId) { // Get icon for the notification. const std::string padded_trophy_id = fmt::format("%03u", trophyId); - const std::string trophy_icon_path = "/dev_hdd0/home/" + Emu.GetUsr() + "/trophy/" + ctxt->trp_name + "/TROP" + padded_trophy_id + ".PNG"; + const std::string trophy_icon_path = "/dev_hdd0/home/" + Emu.GetUsr() + + "/trophy/" + ctxt->trp_name + "/TROP" + + padded_trophy_id + ".PNG"; fs::file trophy_icon_file = fs::file(vfs::get(trophy_icon_path)); std::vector trophy_icon_data; trophy_icon_file.read(trophy_icon_data, trophy_icon_file.size()); SceNpTrophyDetails details{}; - if (const auto ret = NpTrophyGetTrophyInfo(ctxt, trophyId, &details, nullptr)) + if (const auto ret = + NpTrophyGetTrophyInfo(ctxt, trophyId, &details, nullptr)) { - sceNpTrophy.error("Failed to get info for trophy dialog. Error code 0x%x", +ret); + sceNpTrophy.error("Failed to get info for trophy dialog. Error code 0x%x", + +ret); } - if (auto trophy_notification_dialog = Emu.GetCallbacks().get_trophy_notification_dialog()) + if (auto trophy_notification_dialog = + Emu.GetCallbacks().get_trophy_notification_dialog()) { - trophy_notification_dialog->ShowTrophyNotification(details, trophy_icon_data); + trophy_notification_dialog->ShowTrophyNotification(details, + trophy_icon_data); } } // Functions -error_code sceNpTrophyInit(vm::ptr pool, u32 poolSize, u32 containerId, u64 options) +error_code sceNpTrophyInit(vm::ptr pool, u32 poolSize, u32 containerId, + u64 options) { - sceNpTrophy.warning("sceNpTrophyInit(pool=*0x%x, poolSize=0x%x, containerId=0x%x, options=0x%llx)", pool, poolSize, containerId, options); + sceNpTrophy.warning("sceNpTrophyInit(pool=*0x%x, poolSize=0x%x, " + "containerId=0x%x, options=0x%llx)", + pool, poolSize, containerId, options); auto& trophy_manager = g_fxo->get(); @@ -418,14 +429,19 @@ error_code sceNpTrophyAbortHandle(u32 handle) } // Once it is aborted it cannot be used anymore - // TODO: Implement function abortion process maybe? (depends if its actually make sense for some functions) + // TODO: Implement function abortion process maybe? (depends if its actually + // make sense for some functions) hndl->is_aborted = true; return CELL_OK; } -error_code sceNpTrophyCreateContext(vm::ptr context, vm::cptr commId, vm::cptr commSign, u64 options) +error_code sceNpTrophyCreateContext( + vm::ptr context, vm::cptr commId, + vm::cptr commSign, u64 options) { - sceNpTrophy.warning("sceNpTrophyCreateContext(context=*0x%x, commId=*0x%x, commSign=*0x%x, options=0x%llx)", context, commId, commSign, options); + sceNpTrophy.warning("sceNpTrophyCreateContext(context=*0x%x, commId=*0x%x, " + "commSign=*0x%x, options=0x%llx)", + context, commId, commSign, options); if (!commSign) { @@ -462,26 +478,30 @@ error_code sceNpTrophyCreateContext(vm::ptr context, vm::cptrterm is unused in our code (at least until someone finds out if we need to account for it) + // NOTE: commId->term is unused in our code (at least until someone finds out + // if we need to account for it) // Generate trophy context name, limited to 9 characters // Read once for thread-safety reasons std::string name_str(commId->data, 9); // resize the name if it was shorter than expected - if (const auto pos = name_str.find_first_of('\0'); pos != std::string_view::npos) + if (const auto pos = name_str.find_first_of('\0'); + pos != std::string_view::npos) { name_str = name_str.substr(0, pos); } const SceNpCommunicationSignature commSign_data = *commSign; - if (read_from_ptr>(commSign_data.data, 0) != NP_TROPHY_COMM_SIGN_MAGIC) + if (read_from_ptr>(commSign_data.data, 0) != + NP_TROPHY_COMM_SIGN_MAGIC) { return SCE_NP_TROPHY_ERROR_INVALID_NP_COMM_ID; } - if (std::any_of(&commSign_data.data[6], &commSign_data.data[6] + 6, FN(x != '\0'))) + if (std::any_of(&commSign_data.data[6], &commSign_data.data[6] + 6, + FN(x != '\0'))) { // 6 padding bytes - must be 0 return SCE_NP_TROPHY_ERROR_INVALID_NP_COMM_ID; @@ -504,9 +524,11 @@ error_code sceNpTrophyCreateContext(vm::ptr context, vm::cptrtrp_name = name; - ctxt->read_only = !!(options & SCE_NP_TROPHY_OPTIONS_CREATE_CONTEXT_READ_ONLY); + ctxt->read_only = + !!(options & SCE_NP_TROPHY_OPTIONS_CREATE_CONTEXT_READ_ONLY); *context = idm::last_id(); // set current trophy name for trophy list overlay @@ -546,9 +568,14 @@ error_code sceNpTrophyDestroyContext(u32 context) return CELL_OK; } -error_code sceNpTrophyRegisterContext(ppu_thread& ppu, u32 context, u32 handle, vm::ptr statusCb, vm::ptr arg, u64 options) +error_code +sceNpTrophyRegisterContext(ppu_thread& ppu, u32 context, u32 handle, + vm::ptr statusCb, + vm::ptr arg, u64 options) { - sceNpTrophy.warning("sceNpTrophyRegisterContext(context=0x%x, handle=0x%x, statusCb=*0x%x, arg=*0x%x, options=0x%llx)", context, handle, statusCb, arg, options); + sceNpTrophy.warning("sceNpTrophyRegisterContext(context=0x%x, handle=0x%x, " + "statusCb=*0x%x, arg=*0x%x, options=0x%llx)", + context, handle, statusCb, arg, options); auto& trophy_manager = g_fxo->get(); @@ -559,7 +586,8 @@ error_code sceNpTrophyRegisterContext(ppu_thread& ppu, u32 context, u32 handle, return SCE_NP_TROPHY_ERROR_NOT_INITIALIZED; } - const auto [ctxt, error] = trophy_manager.get_context_ex(context, handle, true); + const auto [ctxt, error] = + trophy_manager.get_context_ex(context, handle, true); const auto handle_ptr = idm::get_unlocked(handle); if (error) @@ -581,42 +609,55 @@ error_code sceNpTrophyRegisterContext(ppu_thread& ppu, u32 context, u32 handle, { if (!!(options & SCE_NP_TROPHY_OPTIONS_REGISTER_CONTEXT_SHOW_ERROR_EXIT)) { - static_cast(open_exit_dialog("Error during trophy registration! The game will now be terminated.", true, msg_dialog_source::_sceNpTrophy)); + static_cast(open_exit_dialog( + "Error during trophy registration! The game will now be terminated.", + true, msg_dialog_source::_sceNpTrophy)); } }; // open trophy pack file - std::string trp_path = vfs::get(Emu.GetDir() + "TROPDIR/" + ctxt->trp_name + "/TROPHY.TRP"); + std::string trp_path = + vfs::get(Emu.GetDir() + "TROPDIR/" + ctxt->trp_name + "/TROPHY.TRP"); fs::file stream(trp_path); if (!stream && Emu.GetCat() == "GD") { - sceNpTrophy.warning("sceNpTrophyRegisterContext failed to open trophy file from boot path: '%s' (%s)", trp_path, fs::g_tls_error); - trp_path = vfs::get("/dev_bdvd/PS3_GAME/TROPDIR/" + ctxt->trp_name + "/TROPHY.TRP"); + sceNpTrophy.warning("sceNpTrophyRegisterContext failed to open trophy file " + "from boot path: '%s' (%s)", + trp_path, fs::g_tls_error); + trp_path = vfs::get("/dev_bdvd/PS3_GAME/TROPDIR/" + ctxt->trp_name + + "/TROPHY.TRP"); stream.open(trp_path); } // check if exists and opened if (!stream) { - const std::string msg = fmt::format("Failed to open trophy file: '%s' (%s)", trp_path, fs::g_tls_error); + const std::string msg = fmt::format("Failed to open trophy file: '%s' (%s)", + trp_path, fs::g_tls_error); return {SCE_NP_TROPHY_ERROR_CONF_DOES_NOT_EXIST, msg}; } // TODO: // SCE_NP_TROPHY_STATUS_DATA_CORRUPT -> reinstall - // SCE_NP_TROPHY_STATUS_REQUIRES_UPDATE -> reinstall (for example if a patch has updates for the trophy data) - // SCE_NP_TROPHY_STATUS_CHANGES_DETECTED -> reinstall (only possible in dev mode) + // SCE_NP_TROPHY_STATUS_REQUIRES_UPDATE -> reinstall (for example if a patch + // has updates for the trophy data) SCE_NP_TROPHY_STATUS_CHANGES_DETECTED -> + // reinstall (only possible in dev mode) - const std::string trophyPath = "/dev_hdd0/home/" + Emu.GetUsr() + "/trophy/" + ctxt->trp_name; + const std::string trophyPath = + "/dev_hdd0/home/" + Emu.GetUsr() + "/trophy/" + ctxt->trp_name; const s32 trp_status = fs::is_dir(vfs::get(trophyPath)) ? SCE_NP_TROPHY_STATUS_INSTALLED : SCE_NP_TROPHY_STATUS_NOT_INSTALLED; lock.unlock(); - sceNpTrophy.notice("sceNpTrophyRegisterContext(): Callback is being called (trp_status=%u)", trp_status); + sceNpTrophy.notice( + "sceNpTrophyRegisterContext(): Callback is being called (trp_status=%u)", + trp_status); // "Ask permission" to install the trophy data. - // The callback is called once and then if it returns >= 0 the cb is called through events(coming from vsh) that are passed to the CB through cellSysutilCheckCallback + // The callback is called once and then if it returns >= 0 the cb is called + // through events(coming from vsh) that are passed to the CB through + // cellSysutilCheckCallback if (statusCb(ppu, context, trp_status, 0, 0, arg) < 0) { on_error(); @@ -625,7 +666,8 @@ error_code sceNpTrophyRegisterContext(ppu_thread& ppu, u32 context, u32 handle, std::unique_lock lock2(trophy_manager.mtx); - // Rerun error checks, the callback could have changed stuff by calling sceNpTrophy functions internally + // Rerun error checks, the callback could have changed stuff by calling + // sceNpTrophy functions internally if (!trophy_manager.is_initialized) { @@ -641,8 +683,8 @@ error_code sceNpTrophyRegisterContext(ppu_thread& ppu, u32 context, u32 handle, return error2; } - // Paranoid checks: context/handler could have been destroyed and replaced with new ones with the same IDs - // Return an error for such cases + // Paranoid checks: context/handler could have been destroyed and replaced + // with new ones with the same IDs Return an error for such cases if (ctxt2 != ctxt) { on_error(); @@ -658,7 +700,8 @@ error_code sceNpTrophyRegisterContext(ppu_thread& ppu, u32 context, u32 handle, TRPLoader trp(stream); if (!trp.LoadHeader()) { - sceNpTrophy.error("sceNpTrophyRegisterContext(): Failed to load trophy config header"); + sceNpTrophy.error( + "sceNpTrophyRegisterContext(): Failed to load trophy config header"); on_error(); return SCE_NP_TROPHY_ERROR_ILLEGAL_UPDATE; } @@ -666,7 +709,8 @@ error_code sceNpTrophyRegisterContext(ppu_thread& ppu, u32 context, u32 handle, // Rename or discard certain entries based on the files found const usz kTargetBufferLength = 31; char target[kTargetBufferLength + 1]{}; - strcpy_trunc(target, fmt::format("TROP_%02d.SFM", static_cast(g_cfg.sys.language))); + strcpy_trunc(target, fmt::format("TROP_%02d.SFM", + static_cast(g_cfg.sys.language))); if (trp.ContainsEntry(target)) { @@ -681,7 +725,8 @@ error_code sceNpTrophyRegisterContext(ppu_thread& ppu, u32 context, u32 handle, } else if (!trp.ContainsEntry("TROPCONF.SFM")) { - sceNpTrophy.error("sceNpTrophyRegisterContext(): Invalid/Incomplete trophy config"); + sceNpTrophy.error( + "sceNpTrophyRegisterContext(): Invalid/Incomplete trophy config"); on_error(); return SCE_NP_TROPHY_ERROR_ILLEGAL_UPDATE; } @@ -698,7 +743,9 @@ error_code sceNpTrophyRegisterContext(ppu_thread& ppu, u32 context, u32 handle, if (!trp.Install(trophyPath)) { - sceNpTrophy.error("sceNpTrophyRegisterContext(): Failed to install trophy context '%s' (%s)", trophyPath, fs::g_tls_error); + sceNpTrophy.error("sceNpTrophyRegisterContext(): Failed to install trophy " + "context '%s' (%s)", + trophyPath, fs::g_tls_error); on_error(); return SCE_NP_TROPHY_ERROR_ILLEGAL_UPDATE; } @@ -709,13 +756,14 @@ error_code sceNpTrophyRegisterContext(ppu_thread& ppu, u32 context, u32 handle, ensure(tropusr->Load(trophyUsrPath, trophyConfPath).success); - // This emulates vsh sending the events and ensures that not 2 events are processed at once - const std::pair statuses[] = - { - {SCE_NP_TROPHY_STATUS_PROCESSING_SETUP, 3}, - {SCE_NP_TROPHY_STATUS_PROCESSING_PROGRESS, ::narrow(tropusr->GetTrophiesCount()) - 1}, - {SCE_NP_TROPHY_STATUS_PROCESSING_FINALIZE, 4}, - {SCE_NP_TROPHY_STATUS_PROCESSING_COMPLETE, 0}}; + // This emulates vsh sending the events and ensures that not 2 events are + // processed at once + const std::pair statuses[] = { + {SCE_NP_TROPHY_STATUS_PROCESSING_SETUP, 3}, + {SCE_NP_TROPHY_STATUS_PROCESSING_PROGRESS, + ::narrow(tropusr->GetTrophiesCount()) - 1}, + {SCE_NP_TROPHY_STATUS_PROCESSING_FINALIZE, 4}, + {SCE_NP_TROPHY_STATUS_PROCESSING_COMPLETE, 0}}; lock2.unlock(); @@ -730,9 +778,11 @@ error_code sceNpTrophyRegisterContext(ppu_thread& ppu, u32 context, u32 handle, *queued += status.second; for (s32 completed = 0; completed <= status.second; completed++) { - sysutil_register_cb([statusCb, status, context, completed, arg, queued](ppu_thread& cb_ppu) -> s32 + sysutil_register_cb([statusCb, status, context, completed, arg, + queued](ppu_thread& cb_ppu) -> s32 { - // TODO: it is possible that we need to check the return value here as well. + // TODO: it is possible that we need to check the return value here as + // well. statusCb(cb_ppu, context, status.first, completed, status.second, arg); if (queued && (*queued)-- == 1) @@ -763,9 +813,12 @@ error_code sceNpTrophyRegisterContext(ppu_thread& ppu, u32 context, u32 handle, return CELL_OK; } -error_code sceNpTrophyGetRequiredDiskSpace(u32 context, u32 handle, vm::ptr reqspace, u64 options) +error_code sceNpTrophyGetRequiredDiskSpace(u32 context, u32 handle, + vm::ptr reqspace, u64 options) { - sceNpTrophy.warning("sceNpTrophyGetRequiredDiskSpace(context=0x%x, handle=0x%x, reqspace=*0x%x, options=0x%llx)", context, handle, reqspace, options); + sceNpTrophy.warning("sceNpTrophyGetRequiredDiskSpace(context=0x%x, " + "handle=0x%x, reqspace=*0x%x, options=0x%llx)", + context, handle, reqspace, options); if (!reqspace) { @@ -795,16 +848,21 @@ error_code sceNpTrophyGetRequiredDiskSpace(u32 context, u32 handle, vm::ptr u64 space = 0; - if (!fs::is_dir(vfs::get("/dev_hdd0/home/" + Emu.GetUsr() + "/trophy/" + ctxt->trp_name))) + if (!fs::is_dir(vfs::get("/dev_hdd0/home/" + Emu.GetUsr() + "/trophy/" + + ctxt->trp_name))) { // open trophy pack file - std::string trophy_path = vfs::get(Emu.GetDir() + "TROPDIR/" + ctxt->trp_name + "/TROPHY.TRP"); + std::string trophy_path = + vfs::get(Emu.GetDir() + "TROPDIR/" + ctxt->trp_name + "/TROPHY.TRP"); fs::file stream(trophy_path); if (!stream && Emu.GetCat() == "GD") { - sceNpTrophy.warning("sceNpTrophyGetRequiredDiskSpace failed to open trophy file from boot path: '%s'", trophy_path); - trophy_path = vfs::get("/dev_bdvd/PS3_GAME/TROPDIR/" + ctxt->trp_name + "/TROPHY.TRP"); + sceNpTrophy.warning("sceNpTrophyGetRequiredDiskSpace failed to open " + "trophy file from boot path: '%s'", + trophy_path); + trophy_path = vfs::get("/dev_bdvd/PS3_GAME/TROPDIR/" + ctxt->trp_name + + "/TROPHY.TRP"); stream.open(trophy_path); } @@ -822,23 +880,31 @@ error_code sceNpTrophyGetRequiredDiskSpace(u32 context, u32 handle, vm::ptr } else { - sceNpTrophy.error("sceNpTrophyGetRequiredDiskSpace(): Failed to load trophy header! (trp_name=%s)", ctxt->trp_name); + sceNpTrophy.error("sceNpTrophyGetRequiredDiskSpace(): Failed to load " + "trophy header! (trp_name=%s)", + ctxt->trp_name); } } else { - sceNpTrophy.warning("sceNpTrophyGetRequiredDiskSpace(): Trophy config is already installed (trp_name=%s)", ctxt->trp_name); + sceNpTrophy.warning("sceNpTrophyGetRequiredDiskSpace(): Trophy config is " + "already installed (trp_name=%s)", + ctxt->trp_name); } - sceNpTrophy.warning("sceNpTrophyGetRequiredDiskSpace(): reqspace is 0x%llx", space); + sceNpTrophy.warning("sceNpTrophyGetRequiredDiskSpace(): reqspace is 0x%llx", + space); *reqspace = space; return CELL_OK; } -error_code sceNpTrophySetSoundLevel(u32 context, u32 handle, u32 level, u64 options) +error_code sceNpTrophySetSoundLevel(u32 context, u32 handle, u32 level, + u64 options) { - sceNpTrophy.todo("sceNpTrophySetSoundLevel(context=0x%x, handle=0x%x, level=%d, options=0x%llx)", context, handle, level, options); + sceNpTrophy.todo("sceNpTrophySetSoundLevel(context=0x%x, handle=0x%x, " + "level=%d, options=0x%llx)", + context, handle, level, options); if (level > 100 || level < 20) { @@ -869,9 +935,13 @@ error_code sceNpTrophySetSoundLevel(u32 context, u32 handle, u32 level, u64 opti return CELL_OK; } -error_code sceNpTrophyGetGameInfo(u32 context, u32 handle, vm::ptr details, vm::ptr data) +error_code sceNpTrophyGetGameInfo(u32 context, u32 handle, + vm::ptr details, + vm::ptr data) { - sceNpTrophy.warning("sceNpTrophyGetGameInfo(context=0x%x, handle=0x%x, details=*0x%x, data=*0x%x)", context, handle, details, data); + sceNpTrophy.warning("sceNpTrophyGetGameInfo(context=0x%x, handle=0x%x, " + "details=*0x%x, data=*0x%x)", + context, handle, details, data); auto& trophy_manager = g_fxo->get(); @@ -900,7 +970,9 @@ error_code sceNpTrophyGetGameInfo(u32 context, u32 handle, vm::ptrtrp_name + "/TROPCONF.SFM"); + const std::string config_path = + vfs::get("/dev_hdd0/home/" + Emu.GetUsr() + "/trophy/" + ctxt->trp_name + + "/TROPCONF.SFM"); fs::file config(config_path); @@ -918,7 +990,8 @@ error_code sceNpTrophyGetGameInfo(u32 context, u32 handle, vm::ptr trophy_base = doc.GetRoot(); if (!trophy_base) { - sceNpTrophy.error("sceNpTrophyGetGameInfo: Failed to read TROPCONF.SFM (root is null): %s", config_path); + sceNpTrophy.error("sceNpTrophyGetGameInfo: Failed to read TROPCONF.SFM " + "(root is null): %s", + config_path); // TODO: return some error return CELL_OK; } - for (std::shared_ptr n = trophy_base->GetChildren(); n; n = n->GetNext()) + for (std::shared_ptr n = trophy_base->GetChildren(); n; + n = n->GetNext()) { const std::string n_name = n->GetName(); @@ -956,10 +1032,18 @@ error_code sceNpTrophyGetGameInfo(u32 context, u32 handle, vm::ptrnumTrophies++; switch (n->GetAttribute("ttype")[0]) { - case 'B': details->numBronze++; break; - case 'S': details->numSilver++; break; - case 'G': details->numGold++; break; - case 'P': details->numPlatinum++; break; + case 'B': + details->numBronze++; + break; + case 'S': + details->numSilver++; + break; + case 'G': + details->numGold++; + break; + case 'P': + details->numPlatinum++; + break; } } @@ -972,11 +1056,20 @@ error_code sceNpTrophyGetGameInfo(u32 context, u32 handle, vm::ptrunlockedTrophies++; switch (n->GetAttribute("ttype")[0]) { - case 'B': data->unlockedBronze++; break; - case 'S': data->unlockedSilver++; break; - case 'G': data->unlockedGold++; break; - case 'P': data->unlockedPlatinum++; break; - default: break; + case 'B': + data->unlockedBronze++; + break; + case 'S': + data->unlockedSilver++; + break; + case 'G': + data->unlockedGold++; + break; + case 'P': + data->unlockedPlatinum++; + break; + default: + break; } } } @@ -992,9 +1085,12 @@ error_code sceNpTrophyGetLatestTrophies() return CELL_OK; } -error_code sceNpTrophyUnlockTrophy(ppu_thread& ppu, u32 context, u32 handle, s32 trophyId, vm::ptr platinumId) +error_code sceNpTrophyUnlockTrophy(ppu_thread& ppu, u32 context, u32 handle, + s32 trophyId, vm::ptr platinumId) { - sceNpTrophy.warning("sceNpTrophyUnlockTrophy(context=0x%x, handle=0x%x, trophyId=%d, platinumId=*0x%x)", context, handle, trophyId, platinumId); + sceNpTrophy.warning("sceNpTrophyUnlockTrophy(context=0x%x, handle=0x%x, " + "trophyId=%d, platinumId=*0x%x)", + context, handle, trophyId, platinumId); auto& trophy_manager = g_fxo->get(); @@ -1018,7 +1114,8 @@ error_code sceNpTrophyUnlockTrophy(ppu_thread& ppu, u32 context, u32 handle, s32 return SCE_NP_TROPHY_ERROR_CONTEXT_NOT_REGISTERED; } - if (trophyId < 0 || trophyId >= static_cast(ctxt->tropusr->GetTrophiesCount())) + if (trophyId < 0 || + trophyId >= static_cast(ctxt->tropusr->GetTrophiesCount())) { return SCE_NP_TROPHY_ERROR_INVALID_TROPHY_ID; } @@ -1036,7 +1133,8 @@ error_code sceNpTrophyUnlockTrophy(ppu_thread& ppu, u32 context, u32 handle, s32 vm::var tick; if (error_code error = cellRtcGetCurrentTick(ppu, tick)) { - sceNpTrophy.error("sceNpTrophyUnlockTrophy: Failed to get timestamp: 0x%x", +error); + sceNpTrophy.error("sceNpTrophyUnlockTrophy: Failed to get timestamp: 0x%x", + +error); } if (ctxt->tropusr->UnlockTrophy(trophyId, tick->tick, tick->tick)) @@ -1044,15 +1142,22 @@ error_code sceNpTrophyUnlockTrophy(ppu_thread& ppu, u32 context, u32 handle, s32 sceNpTrophy.notice("Trophy %d unlocked", trophyId); } - // TODO: Make sure that unlocking platinum trophies is properly implemented and improve upon it - const std::string& config_path = vfs::get("/dev_hdd0/home/" + Emu.GetUsr() + "/trophy/" + ctxt->trp_name + "/TROPCONF.SFM"); - const u32 unlocked_platinum_id = ctxt->tropusr->GetUnlockedPlatinumID(trophyId, config_path); + // TODO: Make sure that unlocking platinum trophies is properly implemented + // and improve upon it + const std::string& config_path = + vfs::get("/dev_hdd0/home/" + Emu.GetUsr() + "/trophy/" + ctxt->trp_name + + "/TROPCONF.SFM"); + const u32 unlocked_platinum_id = + ctxt->tropusr->GetUnlockedPlatinumID(trophyId, config_path); if (unlocked_platinum_id != SCE_NP_TROPHY_INVALID_TROPHY_ID) { - sceNpTrophy.warning("sceNpTrophyUnlockTrophy: All requirements for unlocking the platinum trophy (ID = %d) were met.)", unlocked_platinum_id); + sceNpTrophy.warning("sceNpTrophyUnlockTrophy: All requirements for " + "unlocking the platinum trophy (ID = %d) were met.)", + unlocked_platinum_id); - if (ctxt->tropusr->UnlockTrophy(unlocked_platinum_id, tick->tick, tick->tick)) + if (ctxt->tropusr->UnlockTrophy(unlocked_platinum_id, tick->tick, + tick->tick)) { sceNpTrophy.success("You unlocked a platinum trophy! Hooray!!!"); } @@ -1061,13 +1166,16 @@ error_code sceNpTrophyUnlockTrophy(ppu_thread& ppu, u32 context, u32 handle, s32 if (platinumId) { *platinumId = unlocked_platinum_id; - sceNpTrophy.warning("sceNpTrophyUnlockTrophy: platinumId was set to %d", unlocked_platinum_id); + sceNpTrophy.warning("sceNpTrophyUnlockTrophy: platinumId was set to %d", + unlocked_platinum_id); } - const std::string trophyPath = "/dev_hdd0/home/" + Emu.GetUsr() + "/trophy/" + ctxt->trp_name + "/TROPUSR.DAT"; + const std::string trophyPath = "/dev_hdd0/home/" + Emu.GetUsr() + "/trophy/" + + ctxt->trp_name + "/TROPUSR.DAT"; if (!ctxt->tropusr->Save(trophyPath)) { - sceNpTrophy.error("sceNpTrophyUnlockTrophy: failed to save '%s'", trophyPath); + sceNpTrophy.error("sceNpTrophyUnlockTrophy: failed to save '%s'", + trophyPath); } if (g_cfg.misc.show_trophy_popups) @@ -1085,9 +1193,13 @@ error_code sceNpTrophyUnlockTrophy(ppu_thread& ppu, u32 context, u32 handle, s32 return CELL_OK; } -error_code sceNpTrophyGetTrophyUnlockState(u32 context, u32 handle, vm::ptr flags, vm::ptr count) +error_code sceNpTrophyGetTrophyUnlockState(u32 context, u32 handle, + vm::ptr flags, + vm::ptr count) { - sceNpTrophy.warning("sceNpTrophyGetTrophyUnlockState(context=0x%x, handle=0x%x, flags=*0x%x, count=*0x%x)", context, handle, flags, count); + sceNpTrophy.warning("sceNpTrophyGetTrophyUnlockState(context=0x%x, " + "handle=0x%x, flags=*0x%x, count=*0x%x)", + context, handle, flags, count); if (!flags || !count) { @@ -1115,7 +1227,8 @@ error_code sceNpTrophyGetTrophyUnlockState(u32 context, u32 handle, vm::ptrread_only) { - const std::string trophyPath = "/dev_hdd0/home/" + Emu.GetUsr() + "/trophy/" + ctxt->trp_name; + const std::string trophyPath = + "/dev_hdd0/home/" + Emu.GetUsr() + "/trophy/" + ctxt->trp_name; const std::string trophyUsrPath = trophyPath + "/TROPUSR.DAT"; const std::string trophyConfPath = trophyPath + "/TROPCONF.SFM"; @@ -1135,7 +1248,8 @@ error_code sceNpTrophyGetTrophyUnlockState(u32 context, u32 handle, vm::ptrtropusr) { - // TODO: May return SCE_NP_TROPHY_ERROR_UNKNOWN_TITLE for older sdk version + // TODO: May return SCE_NP_TROPHY_ERROR_UNKNOWN_TITLE for older sdk + // version return SCE_NP_TROPHY_ERROR_CONTEXT_NOT_REGISTERED; } @@ -1147,7 +1261,8 @@ error_code sceNpTrophyGetTrophyUnlockState(u32 context, u32 handle, vm::ptrGetTrophiesCount(); *count = count_; if (count_ > 128) - sceNpTrophy.error("sceNpTrophyGetTrophyUnlockState: More than 128 trophies detected!"); + sceNpTrophy.error( + "sceNpTrophyGetTrophyUnlockState: More than 128 trophies detected!"); // Needs hw testing *flags = {}; @@ -1170,7 +1285,10 @@ error_code sceNpTrophyGetTrophyDetails() return CELL_OK; } -static error_code NpTrophyGetTrophyInfo(const trophy_context_t* ctxt, s32 trophyId, SceNpTrophyDetails* details, SceNpTrophyData* data) +static error_code NpTrophyGetTrophyInfo(const trophy_context_t* ctxt, + s32 trophyId, + SceNpTrophyDetails* details, + SceNpTrophyData* data) { if (!details && !data) { @@ -1183,7 +1301,9 @@ static error_code NpTrophyGetTrophyInfo(const trophy_context_t* ctxt, s32 trophy return SCE_NP_TROPHY_ERROR_CONTEXT_NOT_REGISTERED; } - const std::string config_path = vfs::get("/dev_hdd0/home/" + Emu.GetUsr() + "/trophy/" + ctxt->trp_name + "/TROPCONF.SFM"); + const std::string config_path = + vfs::get("/dev_hdd0/home/" + Emu.GetUsr() + "/trophy/" + ctxt->trp_name + + "/TROPCONF.SFM"); fs::file config(config_path); @@ -1199,21 +1319,26 @@ static error_code NpTrophyGetTrophyInfo(const trophy_context_t* ctxt, s32 trophy pugi::xml_parse_result res = doc.Read(config.to_string()); if (!res) { - sceNpTrophy.error("sceNpTrophyGetGameInfo: Failed to read TROPCONF.SFM: %s", config_path); + sceNpTrophy.error("sceNpTrophyGetGameInfo: Failed to read TROPCONF.SFM: %s", + config_path); // TODO: return some error } auto trophy_base = doc.GetRoot(); if (!trophy_base) { - sceNpTrophy.error("sceNpTrophyGetGameInfo: Failed to read TROPCONF.SFM (root is null): %s", config_path); + sceNpTrophy.error("sceNpTrophyGetGameInfo: Failed to read TROPCONF.SFM " + "(root is null): %s", + config_path); // TODO: return some error } bool found = false; - for (std::shared_ptr n = trophy_base ? trophy_base->GetChildren() : nullptr; n; n = n->GetNext()) + for (std::shared_ptr n = trophy_base ? trophy_base->GetChildren() : nullptr; + n; n = n->GetNext()) { - if (n->GetName() == "trophy" && (trophyId == atoi(n->GetAttribute("id").c_str()))) + if (n->GetName() == "trophy" && + (trophyId == atoi(n->GetAttribute("id").c_str()))) { found = true; @@ -1232,14 +1357,24 @@ static error_code NpTrophyGetTrophyInfo(const trophy_context_t* ctxt, s32 trophy switch (n->GetAttribute("ttype")[0]) { - case 'B': tmp_details.trophyGrade = SCE_NP_TROPHY_GRADE_BRONZE; break; - case 'S': tmp_details.trophyGrade = SCE_NP_TROPHY_GRADE_SILVER; break; - case 'G': tmp_details.trophyGrade = SCE_NP_TROPHY_GRADE_GOLD; break; - case 'P': tmp_details.trophyGrade = SCE_NP_TROPHY_GRADE_PLATINUM; break; - default: break; + case 'B': + tmp_details.trophyGrade = SCE_NP_TROPHY_GRADE_BRONZE; + break; + case 'S': + tmp_details.trophyGrade = SCE_NP_TROPHY_GRADE_SILVER; + break; + case 'G': + tmp_details.trophyGrade = SCE_NP_TROPHY_GRADE_GOLD; + break; + case 'P': + tmp_details.trophyGrade = SCE_NP_TROPHY_GRADE_PLATINUM; + break; + default: + break; } - for (std::shared_ptr n2 = n->GetChildren(); n2; n2 = n2->GetNext()) + for (std::shared_ptr n2 = n->GetChildren(); n2; + n2 = n2->GetNext()) { const std::string n2_name = n2->GetName(); @@ -1283,9 +1418,13 @@ static error_code NpTrophyGetTrophyInfo(const trophy_context_t* ctxt, s32 trophy return CELL_OK; } -error_code sceNpTrophyGetTrophyInfo(u32 context, u32 handle, s32 trophyId, vm::ptr details, vm::ptr data) +error_code sceNpTrophyGetTrophyInfo(u32 context, u32 handle, s32 trophyId, + vm::ptr details, + vm::ptr data) { - sceNpTrophy.warning("sceNpTrophyGetTrophyInfo(context=0x%x, handle=0x%x, trophyId=%d, details=*0x%x, data=*0x%x)", context, handle, trophyId, details, data); + sceNpTrophy.warning("sceNpTrophyGetTrophyInfo(context=0x%x, handle=0x%x, " + "trophyId=%d, details=*0x%x, data=*0x%x)", + context, handle, trophyId, details, data); if (trophyId < 0 || trophyId > 127) // max 128 trophies { @@ -1308,12 +1447,17 @@ error_code sceNpTrophyGetTrophyInfo(u32 context, u32 handle, s32 trophyId, vm::p return error; } - return NpTrophyGetTrophyInfo(ctxt, trophyId, details ? details.get_ptr() : nullptr, data ? data.get_ptr() : nullptr); + return NpTrophyGetTrophyInfo(ctxt, trophyId, + details ? details.get_ptr() : nullptr, + data ? data.get_ptr() : nullptr); } -error_code sceNpTrophyGetGameProgress(u32 context, u32 handle, vm::ptr percentage) +error_code sceNpTrophyGetGameProgress(u32 context, u32 handle, + vm::ptr percentage) { - sceNpTrophy.warning("sceNpTrophyGetGameProgress(context=0x%x, handle=0x%x, percentage=*0x%x)", context, handle, percentage); + sceNpTrophy.warning( + "sceNpTrophyGetGameProgress(context=0x%x, handle=0x%x, percentage=*0x%x)", + context, handle, percentage); if (!percentage) { @@ -1350,15 +1494,20 @@ error_code sceNpTrophyGetGameProgress(u32 context, u32 handle, vm::ptr perc if (trp_count == 0 || trp_count > 128) { - sceNpTrophy.warning("sceNpTrophyGetGameProgress(): Trophies count may be invalid or untested (%d)", trp_count); + sceNpTrophy.warning("sceNpTrophyGetGameProgress(): Trophies count may be " + "invalid or untested (%d)", + trp_count); } return CELL_OK; } -error_code sceNpTrophyGetGameIcon(u32 context, u32 handle, vm::ptr buffer, vm::ptr size) +error_code sceNpTrophyGetGameIcon(u32 context, u32 handle, vm::ptr buffer, + vm::ptr size) { - sceNpTrophy.warning("sceNpTrophyGetGameIcon(context=0x%x, handle=0x%x, buffer=*0x%x, size=*0x%x)", context, handle, buffer, size); + sceNpTrophy.warning("sceNpTrophyGetGameIcon(context=0x%x, handle=0x%x, " + "buffer=*0x%x, size=*0x%x)", + context, handle, buffer, size); auto& trophy_manager = g_fxo->get(); @@ -1382,10 +1531,13 @@ error_code sceNpTrophyGetGameIcon(u32 context, u32 handle, vm::ptr buffer, } // Try to get icon in current language first - const std::string trophy_path = fmt::format("/dev_hdd0/home/%s/trophy/%s/", Emu.GetUsr(), ctxt->trp_name); - fs::file icon_file(vfs::get(fmt::format("%s/ICON0_%02d.PNG", trophy_path, static_cast(g_cfg.sys.language)))); + const std::string trophy_path = + fmt::format("/dev_hdd0/home/%s/trophy/%s/", Emu.GetUsr(), ctxt->trp_name); + fs::file icon_file(vfs::get(fmt::format( + "%s/ICON0_%02d.PNG", trophy_path, static_cast(g_cfg.sys.language)))); - if (!icon_file && !icon_file.open(vfs::get(fmt::format("%s/ICON0.PNG", trophy_path)))) + if (!icon_file && + !icon_file.open(vfs::get(fmt::format("%s/ICON0.PNG", trophy_path)))) { return SCE_NP_TROPHY_ERROR_UNKNOWN_FILE; } @@ -1408,9 +1560,12 @@ error_code sceNpTrophyGetUserInfo() return CELL_OK; } -error_code sceNpTrophyGetTrophyIcon(u32 context, u32 handle, s32 trophyId, vm::ptr buffer, vm::ptr size) +error_code sceNpTrophyGetTrophyIcon(u32 context, u32 handle, s32 trophyId, + vm::ptr buffer, vm::ptr size) { - sceNpTrophy.warning("sceNpTrophyGetTrophyIcon(context=0x%x, handle=0x%x, trophyId=%d, buffer=*0x%x, size=*0x%x)", context, handle, trophyId, buffer, size); + sceNpTrophy.warning("sceNpTrophyGetTrophyIcon(context=0x%x, handle=0x%x, " + "trophyId=%d, buffer=*0x%x, size=*0x%x)", + context, handle, trophyId, buffer, size); auto& trophy_manager = g_fxo->get(); @@ -1446,7 +1601,9 @@ error_code sceNpTrophyGetTrophyIcon(u32 context, u32 handle, s32 trophyId, vm::p if (!ctxt->tropusr->GetTrophyUnlockState(trophyId)) { - const std::string config_path = vfs::get("/dev_hdd0/home/" + Emu.GetUsr() + "/trophy/" + ctxt->trp_name + "/TROPCONF.SFM"); + const std::string config_path = + vfs::get("/dev_hdd0/home/" + Emu.GetUsr() + "/trophy/" + + ctxt->trp_name + "/TROPCONF.SFM"); fs::file config(config_path); if (config) @@ -1455,20 +1612,28 @@ error_code sceNpTrophyGetTrophyIcon(u32 context, u32 handle, s32 trophyId, vm::p pugi::xml_parse_result res = doc.Read(config.to_string()); if (!res) { - sceNpTrophy.error("sceNpTrophyGetTrophyIcon: Failed to read TROPCONF.SFM: %s", config_path); + sceNpTrophy.error( + "sceNpTrophyGetTrophyIcon: Failed to read TROPCONF.SFM: %s", + config_path); // TODO: return some error } auto trophy_base = doc.GetRoot(); if (!trophy_base) { - sceNpTrophy.error("sceNpTrophyGetTrophyIcon: Failed to read TROPCONF.SFM (root is null): %s", config_path); + sceNpTrophy.error("sceNpTrophyGetTrophyIcon: Failed to read " + "TROPCONF.SFM (root is null): %s", + config_path); // TODO: return some error } - for (std::shared_ptr n = trophy_base ? trophy_base->GetChildren() : nullptr; n; n = n->GetNext()) + for (std::shared_ptr n = + trophy_base ? trophy_base->GetChildren() : nullptr; + n; n = n->GetNext()) { - if (n->GetName() == "trophy" && trophyId == atoi(n->GetAttribute("id").c_str()) && n->GetAttribute("hidden")[0] == 'y') + if (n->GetName() == "trophy" && + trophyId == atoi(n->GetAttribute("id").c_str()) && + n->GetAttribute("hidden")[0] == 'y') { return SCE_NP_TROPHY_ERROR_HIDDEN; } @@ -1482,7 +1647,9 @@ error_code sceNpTrophyGetTrophyIcon(u32 context, u32 handle, s32 trophyId, vm::p return SCE_NP_TROPHY_ERROR_LOCKED; } - fs::file icon_file(vfs::get("/dev_hdd0/home/" + Emu.GetUsr() + "/trophy/" + ctxt->trp_name + fmt::format("/TROP%03d.PNG", trophyId))); + fs::file icon_file(vfs::get("/dev_hdd0/home/" + Emu.GetUsr() + "/trophy/" + + ctxt->trp_name + + fmt::format("/TROP%03d.PNG", trophyId))); if (!icon_file) { diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/sceNpTus.cpp b/ps3fw/sceNpTus.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/sceNpTus.cpp rename to ps3fw/sceNpTus.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/sceNpUtil.cpp b/ps3fw/sceNpUtil.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/sceNpUtil.cpp rename to ps3fw/sceNpUtil.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/sysPrxForUser.cpp b/ps3fw/sysPrxForUser.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/sysPrxForUser.cpp rename to ps3fw/sysPrxForUser.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/sys_crashdump.cpp b/ps3fw/sys_crashdump.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/sys_crashdump.cpp rename to ps3fw/sys_crashdump.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/sys_game_.cpp b/ps3fw/sys_game_.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/sys_game_.cpp rename to ps3fw/sys_game_.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/sys_heap.cpp b/ps3fw/sys_heap.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/sys_heap.cpp rename to ps3fw/sys_heap.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/sys_io_.cpp b/ps3fw/sys_io_.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/Cell/Modules/sys_io_.cpp rename to ps3fw/sys_io_.cpp index 103b768f5..037351cfc 100644 --- a/rpcs3/rpcs3/Emu/Cell/Modules/sys_io_.cpp +++ b/ps3fw/sys_io_.cpp @@ -5,7 +5,7 @@ #include "Emu/Cell/lv2/sys_event.h" #include "Emu/Cell/lv2/sys_ppu_thread.h" -#include "Emu/Cell/Modules/sysPrxForUser.h" +#include "sysPrxForUser.h" LOG_CHANNEL(sys_io); diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/sys_libc.cpp b/ps3fw/sys_libc.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/sys_libc.cpp rename to ps3fw/sys_libc.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/sys_libc_.cpp b/ps3fw/sys_libc_.cpp similarity index 92% rename from rpcs3/rpcs3/Emu/Cell/Modules/sys_libc_.cpp rename to ps3fw/sys_libc_.cpp index 7a5fd57c9..e9fee8d1d 100644 --- a/rpcs3/rpcs3/Emu/Cell/Modules/sys_libc_.cpp +++ b/ps3fw/sys_libc_.cpp @@ -1,7 +1,7 @@ -#include "stdafx.h" -#include "Emu/Cell/lv2/sys_tty.h" #include "Emu/Cell/PPUModule.h" -#include "Utilities/cfmt.h" +#include "Emu/Cell/lv2/sys_tty.h" +#include "stdafx.h" +#include "util/cfmt.h" LOG_CHANNEL(sysPrxForUser); @@ -59,7 +59,8 @@ f64 ps3_fmt_src::get(usz index) const return std::bit_cast(get(index)); } -static std::string ps3_fmt(ppu_thread& context, vm::cptr fmt, u32 g_count) +static std::string ps3_fmt(ppu_thread& context, vm::cptr fmt, + u32 g_count) { std::string result; @@ -229,7 +230,8 @@ s32 _sys_toupper(s32 ch) vm::ptr _sys_memset(vm::ptr dst, s32 value, u32 size) { - sysPrxForUser.trace("_sys_memset(dst=*0x%x, value=%d, size=0x%x)", dst, value, size); + sysPrxForUser.trace("_sys_memset(dst=*0x%x, value=%d, size=0x%x)", dst, value, + size); std::memset(dst.get_ptr(), value, size); @@ -238,7 +240,8 @@ vm::ptr _sys_memset(vm::ptr dst, s32 value, u32 size) vm::ptr _sys_memcpy(vm::ptr dst, vm::cptr src, u32 size) { - sysPrxForUser.trace("_sys_memcpy(dst=*0x%x, src=*0x%x, size=0x%x)", dst, src, size); + sysPrxForUser.trace("_sys_memcpy(dst=*0x%x, src=*0x%x, size=0x%x)", dst, src, + size); std::memcpy(dst.get_ptr(), src.get_ptr(), size); @@ -247,7 +250,8 @@ vm::ptr _sys_memcpy(vm::ptr dst, vm::cptr src, u32 size) s32 _sys_memcmp(vm::cptr buf1, vm::cptr buf2, u32 size) { - sysPrxForUser.trace("_sys_memcmp(buf1=*0x%x, buf2=*0x%x, size=%d)", buf1, buf2, size); + sysPrxForUser.trace("_sys_memcmp(buf1=*0x%x, buf2=*0x%x, size=%d)", buf1, + buf2, size); for (u32 i = 0; i < size; i++) { @@ -269,7 +273,8 @@ s32 _sys_memcmp(vm::cptr buf1, vm::cptr buf2, u32 size) vm::ptr _sys_memchr(vm::ptr buf, u8 ch, s32 size) { - sysPrxForUser.trace("_sys_memchr(buf=*0x%x, ch=0x%x, size=0x%x)", buf, ch, size); + sysPrxForUser.trace("_sys_memchr(buf=*0x%x, ch=0x%x, size=0x%x)", buf, ch, + size); if (!buf) { @@ -292,7 +297,8 @@ vm::ptr _sys_memchr(vm::ptr buf, u8 ch, s32 size) vm::ptr _sys_memmove(vm::ptr dst, vm::cptr src, u32 size) { - sysPrxForUser.trace("_sys_memmove(dst=*0x%x, src=*0x%x, size=%d)", dst, src, size); + sysPrxForUser.trace("_sys_memmove(dst=*0x%x, src=*0x%x, size=%d)", dst, src, + size); std::memmove(dst.get_ptr(), src.get_ptr(), size); @@ -335,7 +341,8 @@ s32 _sys_strcmp(vm::cptr str1, vm::cptr str2) s32 _sys_strncmp(vm::cptr str1, vm::cptr str2, u32 max) { - sysPrxForUser.trace("_sys_strncmp(str1=%s, str2=%s, max=%d)", str1, str2, max); + sysPrxForUser.trace("_sys_strncmp(str1=%s, str2=%s, max=%d)", str1, str2, + max); for (u32 i = 0; i < max; i++) { @@ -387,7 +394,8 @@ vm::cptr _sys_strchr(vm::cptr str, char ch) vm::ptr _sys_strncat(vm::ptr dst, vm::cptr src, u32 max) { - sysPrxForUser.trace("_sys_strncat(dst=*0x%x %s, src=%s, max=%u)", dst, dst, src, max); + sysPrxForUser.trace("_sys_strncat(dst=*0x%x %s, src=%s, max=%u)", dst, dst, + src, max); auto str = dst; @@ -423,7 +431,8 @@ vm::ptr _sys_strcpy(vm::ptr dst, vm::cptr src) vm::ptr _sys_strncpy(vm::ptr dst, vm::cptr src, s32 len) { - sysPrxForUser.trace("_sys_strncpy(dst=*0x%x %s, src=%s, len=%d)", dst, dst, src, len); + sysPrxForUser.trace("_sys_strncpy(dst=*0x%x %s, src=%s, len=%d)", dst, dst, + src, len); if (!dst || !src) { @@ -448,7 +457,8 @@ vm::ptr _sys_strncpy(vm::ptr dst, vm::cptr src, s32 len) s32 _sys_strncasecmp(vm::cptr str1, vm::cptr str2, u32 n) { - sysPrxForUser.trace("_sys_strncasecmp(str1=%s, str2=%s, n=%d)", str1, str2, n); + sysPrxForUser.trace("_sys_strncasecmp(str1=%s, str2=%s, n=%d)", str1, str2, + n); for (u32 i = 0; i < n; i++) { @@ -504,9 +514,11 @@ error_code _sys_free(u32 addr) return CELL_OK; } -s32 _sys_snprintf(ppu_thread& ppu, vm::ptr dst, u32 count, vm::cptr fmt, ppu_va_args_t va_args) +s32 _sys_snprintf(ppu_thread& ppu, vm::ptr dst, u32 count, + vm::cptr fmt, ppu_va_args_t va_args) { - sysPrxForUser.warning("_sys_snprintf(dst=*0x%x, count=%d, fmt=%s, ...)", dst, count, fmt); + sysPrxForUser.warning("_sys_snprintf(dst=*0x%x, count=%d, fmt=%s, ...)", dst, + count, fmt); std::string result = ps3_fmt(ppu, fmt, va_args.count); @@ -524,7 +536,8 @@ s32 _sys_snprintf(ppu_thread& ppu, vm::ptr dst, u32 count, vm::cptr } } -error_code _sys_printf(ppu_thread& ppu, vm::cptr fmt, ppu_va_args_t va_args) +error_code _sys_printf(ppu_thread& ppu, vm::cptr fmt, + ppu_va_args_t va_args) { sysPrxForUser.warning("_sys_printf(fmt=%s, ...)", fmt); @@ -535,7 +548,8 @@ error_code _sys_printf(ppu_thread& ppu, vm::cptr fmt, ppu_va_args_t va_arg return CELL_OK; } -s32 _sys_sprintf(ppu_thread& ppu, vm::ptr buffer, vm::cptr fmt, ppu_va_args_t va_args) +s32 _sys_sprintf(ppu_thread& ppu, vm::ptr buffer, vm::cptr fmt, + ppu_va_args_t va_args) { sysPrxForUser.warning("_sys_sprintf(buffer=*0x%x, fmt=%s, ...)", buffer, fmt); @@ -564,16 +578,21 @@ error_code _sys_vsprintf() return CELL_OK; } -void _sys_qsort(vm::ptr base, u32 nelem, u32 size, vm::ptr cmp) +void _sys_qsort(vm::ptr base, u32 nelem, u32 size, + vm::ptr cmp) { - sysPrxForUser.warning("_sys_qsort(base=*0x%x, nelem=%d, size=0x%x, cmp=*0x%x)", base, nelem, size, cmp); + sysPrxForUser.warning( + "_sys_qsort(base=*0x%x, nelem=%d, size=0x%x, cmp=*0x%x)", base, nelem, + size, cmp); static thread_local decltype(cmp) g_tls_cmp; g_tls_cmp = cmp; - std::qsort(base.get_ptr(), nelem, size, [](const void* a, const void* b) -> s32 + std::qsort( + base.get_ptr(), nelem, size, [](const void* a, const void* b) -> s32 { - return g_tls_cmp(static_cast(*get_current_cpu_thread()), vm::get_addr(a), vm::get_addr(b)); + return g_tls_cmp(static_cast(*get_current_cpu_thread()), + vm::get_addr(a), vm::get_addr(b)); }); } diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/sys_lv2dbg.cpp b/ps3fw/sys_lv2dbg.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/sys_lv2dbg.cpp rename to ps3fw/sys_lv2dbg.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/sys_lwcond_.cpp b/ps3fw/sys_lwcond_.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/sys_lwcond_.cpp rename to ps3fw/sys_lwcond_.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/sys_lwmutex_.cpp b/ps3fw/sys_lwmutex_.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/sys_lwmutex_.cpp rename to ps3fw/sys_lwmutex_.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/sys_mempool.cpp b/ps3fw/sys_mempool.cpp similarity index 86% rename from rpcs3/rpcs3/Emu/Cell/Modules/sys_mempool.cpp rename to ps3fw/sys_mempool.cpp index a3fd13e73..3868eb4aa 100644 --- a/rpcs3/rpcs3/Emu/Cell/Modules/sys_mempool.cpp +++ b/ps3fw/sys_mempool.cpp @@ -1,11 +1,11 @@ #include "stdafx.h" -#include "Utilities/StrUtil.h" +#include "util/StrUtil.h" #include "Emu/Cell/PPUModule.h" -#include "Emu/Cell/lv2/sys_mutex.h" #include "Emu/Cell/lv2/sys_cond.h" +#include "Emu/Cell/lv2/sys_mutex.h" LOG_CHANNEL(sysPrxForUser); @@ -28,9 +28,13 @@ struct memory_pool_t std::vector> free_blocks; }; -error_code sys_mempool_create(ppu_thread& ppu, vm::ptr mempool, vm::ptr chunk, const u64 chunk_size, const u64 block_size, const u64 ralignment) +error_code sys_mempool_create(ppu_thread& ppu, vm::ptr mempool, + vm::ptr chunk, const u64 chunk_size, + const u64 block_size, const u64 ralignment) { - sysPrxForUser.warning("sys_mempool_create(mempool=*0x%x, chunk=*0x%x, chunk_size=%d, block_size=%d, ralignment=%d)", mempool, chunk, chunk_size, block_size, ralignment); + sysPrxForUser.warning("sys_mempool_create(mempool=*0x%x, chunk=*0x%x, " + "chunk_size=%d, block_size=%d, ralignment=%d)", + mempool, chunk, chunk_size, block_size, ralignment); if (block_size > chunk_size) { @@ -70,7 +74,8 @@ error_code sys_mempool_create(ppu_thread& ppu, vm::ptr mempool, v memory_pool->free_blocks.resize(num_blocks); for (u32 i = 0; i < num_blocks; ++i) { - memory_pool->free_blocks[i] = vm::ptr::make(chunk.addr() + i * static_cast(block_size)); + memory_pool->free_blocks[i] = + vm::ptr::make(chunk.addr() + i * static_cast(block_size)); } // Create synchronization variables @@ -101,7 +106,8 @@ error_code sys_mempool_create(ppu_thread& ppu, vm::ptr mempool, v ret = sys_cond_create(ppu, condid, *mutexid, condAttr); if (ret != CELL_OK) { // TODO: Better exception handling. - fmt::throw_exception("mempool %x failed to create condition variable", mempool); + fmt::throw_exception("mempool %x failed to create condition variable", + mempool); } memory_pool->condid = *condid; @@ -126,13 +132,16 @@ void sys_mempool_destroy(ppu_thread& ppu, sys_mempool_t mempool) } else { - sysPrxForUser.error("Trying to destroy an already destroyed mempool=%d", mempool); + sysPrxForUser.error("Trying to destroy an already destroyed mempool=%d", + mempool); } } -error_code sys_mempool_free_block(ppu_thread& ppu, sys_mempool_t mempool, vm::ptr block) +error_code sys_mempool_free_block(ppu_thread& ppu, sys_mempool_t mempool, + vm::ptr block) { - sysPrxForUser.warning("sys_mempool_free_block(mempool=%d, block=*0x%x)", mempool, block); + sysPrxForUser.warning("sys_mempool_free_block(mempool=%d, block=*0x%x)", + mempool, block); auto memory_pool = idm::get_unlocked(mempool); if (!memory_pool) @@ -169,22 +178,26 @@ u64 sys_mempool_get_count(ppu_thread& ppu, sys_mempool_t mempool) return ret; } -vm::ptr sys_mempool_allocate_block(ppu_thread& ppu, sys_mempool_t mempool) +vm::ptr sys_mempool_allocate_block(ppu_thread& ppu, + sys_mempool_t mempool) { sysPrxForUser.warning("sys_mempool_allocate_block(mempool=%d)", mempool); auto memory_pool = idm::get_unlocked(mempool); if (!memory_pool) - { // if the memory pool gets deleted-- is null, clearly it's impossible to allocate memory. + { // if the memory pool gets deleted-- is null, clearly it's + // impossible to allocate memory. return vm::null; } sys_mutex_lock(ppu, memory_pool->mutexid, 0); - while (memory_pool->free_blocks.empty()) // while is to guard against spurious wakeups + while (memory_pool->free_blocks + .empty()) // while is to guard against spurious wakeups { sys_cond_wait(ppu, memory_pool->condid, 0); memory_pool = idm::get_unlocked(mempool); - if (!memory_pool) // in case spurious wake up was from delete, don't die by accessing a freed pool. + if (!memory_pool) // in case spurious wake up was from delete, don't die by + // accessing a freed pool. { // No need to unlock as if the pool is freed, the lock was freed as well. return vm::null; } @@ -196,7 +209,8 @@ vm::ptr sys_mempool_allocate_block(ppu_thread& ppu, sys_mempool_t mempool) return block_ptr; } -vm::ptr sys_mempool_try_allocate_block(ppu_thread& ppu, sys_mempool_t mempool) +vm::ptr sys_mempool_try_allocate_block(ppu_thread& ppu, + sys_mempool_t mempool) { sysPrxForUser.warning("sys_mempool_try_allocate_block(mempool=%d)", mempool); diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/sys_mmapper_.cpp b/ps3fw/sys_mmapper_.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/sys_mmapper_.cpp rename to ps3fw/sys_mmapper_.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/sys_net_.cpp b/ps3fw/sys_net_.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/sys_net_.cpp rename to ps3fw/sys_net_.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/sys_ppu_thread_.cpp b/ps3fw/sys_ppu_thread_.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/sys_ppu_thread_.cpp rename to ps3fw/sys_ppu_thread_.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/sys_prx_.cpp b/ps3fw/sys_prx_.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/sys_prx_.cpp rename to ps3fw/sys_prx_.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/sys_rsxaudio_.cpp b/ps3fw/sys_rsxaudio_.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/sys_rsxaudio_.cpp rename to ps3fw/sys_rsxaudio_.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/sys_spinlock.cpp b/ps3fw/sys_spinlock.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/sys_spinlock.cpp rename to ps3fw/sys_spinlock.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/Modules/sys_spu_.cpp b/ps3fw/sys_spu_.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Modules/sys_spu_.cpp rename to ps3fw/sys_spu_.cpp diff --git a/rpcs3/BUILDING.md b/rpcs3/BUILDING.md deleted file mode 100644 index 83693b0f4..000000000 --- a/rpcs3/BUILDING.md +++ /dev/null @@ -1,193 +0,0 @@ -# Building - -Only Windows and Linux are officially supported for building. However, various other platforms are capable of building RPCS3. -Other instructions may be found [here](https://wiki.rpcs3.net/index.php?title=Building). - -## Setup your environment - -### Windows 10 or later - -The following tools are required to build RPCS3 on Windows 10 or later: -- [Visual Studio 2022](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community) -- **Optional** - [CMake 3.28.0+](https://www.cmake.org/download/) (add to PATH) - - **NOTES:** - - **Visual Studio 2022** integrates **CMake 3.29+** and it also supports both the `sln` solution (`.sln`, `.vcxproj`) and `CMake` solution (`CMakeLists.txt`, `CMakePresets.json`). - See sections [Building with Visual Studio sln solution](#building-with-visual-studio-sln-solution) and [Building with Visual Studio CMake solution](#building-with-visual-studio-cmake-solution) - on how to build the project with **Visual Studio**. - - Install and use this standalone **CMake** tool just in case of your preference. See section [Building with standalone CMake tool](#building-with-standalone-cmake-tool) on how to build the project - with standalone **CMake** tool. - -- [Python 3.6+](https://www.python.org/downloads/) (add to PATH) -- [Qt 6.8.3](https://www.qt.io/download-qt-installer) In case you can't download from the official installer, you can use [Another Qt installer](https://github.com/miurahr/aqtinstall) (In that case you will need to manually add the "qtmultimedia" module when installing Qt) -- [Vulkan SDK 1.3.268.0](https://vulkan.lunarg.com/sdk/home) (see "Install the SDK" [here](https://vulkan.lunarg.com/doc/sdk/latest/windows/getting_started.html)) for now future SDKs don't work. You need precisely 1.3.268.0. - -The `sln` solution available only on **Visual Studio** is the preferred building solution. It easily allows to build the **RPCS3** application in `Release` and `Debug` mode. - -In order to build **RPCS3** with the `sln` solution (with **Visual Studio**), **Qt** libs need to be detected. To detect the libs: -- add and set the `QTDIR` environment variable, e.g. `\6.8.3\msvc2022_64\` -- or use the [Visual Studio Qt Plugin](https://marketplace.visualstudio.com/items?itemName=TheQtCompany.QtVisualStudioTools2022) - - **NOTE:** If you have issues with the **Visual Studio Qt Plugin**, you may want to uninstall it and install the [Legacy Qt Plugin](https://marketplace.visualstudio.com/items?itemName=TheQtCompany.LEGACYQtVisualStudioTools2022) instead. - -In order to build **RPCS3** with the `CMake` solution (with both **Visual Studio** and standalone **CMake** tool): -- add and set the `Qt6_ROOT` environment variable to the **Qt** libs path, e.g. `\6.8.3\msvc2022_64\` - -### Linux - -These are the essentials tools to build RPCS3 on Linux. Some of them can be installed through your favorite package manager: -- Clang 17+ or GCC 13+ -- [CMake 3.28.0+](https://www.cmake.org/download/) -- [Qt 6.8.3](https://www.qt.io/download-qt-installer) -- [Vulkan SDK 1.3.268.0](https://vulkan.lunarg.com/sdk/home) (See "Install the SDK" [here](https://vulkan.lunarg.com/doc/sdk/latest/linux/getting_started.html)) for now future SDKs don't work. You need precisely 1.3.268.0. -- [SDL3](https://github.com/libsdl-org/SDL/releases) (for the FAudio backend) - -**If you have an NVIDIA GPU, you may need to install the libglvnd package.** - -#### Arch Linux - - sudo pacman -S glew openal cmake ninja vulkan-validation-layers qt6-base qt6-declarative qt6-multimedia qt6-svg sdl3 sndio jack2 base-devel - -#### Debian & Ubuntu - - sudo apt-get install build-essential ninja-build libasound2-dev libpulse-dev libopenal-dev libglew-dev zlib1g-dev libedit-dev libvulkan-dev libudev-dev git libevdev-dev libsdl3-3.2 libsdl3-dev libjack-dev libsndio-dev - -Ubuntu is usually horrendously out of date, and some packages need to be downloaded by hand. This part is for Qt, GCC, Vulkan, and CMake - -##### Qt PPA - -Ubuntu usually does not have a new enough Qt package to suit rpcs3's needs. There is currently no PPA available to work around this. - -##### GCC 13.x installation - -If the `gcc-13` package is not available on your system, use the following commands -``` -sudo add-apt-repository ppa:ubuntu-toolchain-r/test -sudo apt-get update -sudo apt-get install gcc-13 g++-13 -``` - -You can either use `update-alternatives` to setup `gcc-13`/`g++-13` as your default compilers or prefix the `cmake` build file generation command by `CXX=g++-13 CC=gcc-13` to use it. - -##### Vulkan SDK - -For Ubuntu systems, it is strongly recommended to use the PPA from [LunarG](https://packages.lunarg.com/) which will provide a compatible Vulkan SDK to compile RPCS3. If your Vulkan SDK is older, it can lead to compilation errors. -``` -. /etc/os-release -wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add - -sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-1.3.268-$UBUNTU_CODENAME.list https://packages.lunarg.com/vulkan/1.3.268/lunarg-vulkan-1.3.268-$UBUNTU_CODENAME.list -sudo apt update -sudo apt install vulkan-sdk -``` - -##### CMake - -``` -. /etc/os-release -wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | sudo apt-key add - -sudo apt-add-repository "deb https://apt.kitware.com/ubuntu/ $UBUNTU_CODENAME main" -sudo apt-get update -sudo apt-get install kitware-archive-keyring -sudo apt-key --keyring /etc/apt/trusted.gpg del C1F34CDD40CD72DA -sudo apt-get install cmake -``` - -#### Fedora - - sudo dnf install alsa-lib-devel cmake ninja-build glew glew-devel libatomic libevdev-devel libudev-devel openal-devel qt6-qtbase-devel qt6-qtbase-private-devel vulkan-devel pipewire-jack-audio-connection-kit-devel qt6-qtmultimedia-devel qt6-qtsvg-devel llvm-devel - -#### OpenSUSE - - sudo zypper install git cmake ninja libasound2 libpulse-devel openal-soft-devel glew-devel zlib-devel libedit-devel vulkan-devel libudev-devel libqt6-qtbase-devel libqt6-qtmultimedia-devel libqt6-qtsvg-devel libQt6Gui-private-headers-devel libevdev-devel libsndio7_1 libjack-devel - -## Setup the project - -Clone and initialize the repository - -```bash -git clone --recurse-submodules https://github.com/RPCS3/rpcs3.git -cd rpcs3 -# This is automatically done by `git clone --recurse-submodules`, -# but in case you forgot it, you can manually fetch submodules this way: -git submodule update --init -``` - -### Windows - -#### Building with Visual Studio sln solution - -Start **Visual Studio**, click on `Open a project or solution` and select the `rpcs3.sln` file inside the RPCS3's root folder - -##### Configuring the Qt Plugin (if used) - -1) go to `Extensions->Qt VS Tools->Qt Versions` -2) add the path to your Qt installation with compiler e.g. `\6.8.3\msvc2022_64`, version will fill in automatically -3) go to `Extensions->Qt VS Tools->Options->Legacy Project Format`. (Only available in the **Legacy Qt Plugin**) -4) set `Build: Run pre-build setup` to `true`. (Only available in the **Legacy Qt Plugin**) - -##### Building the projects - -**NOTE:** The recommended build configuration is `Release`. (On older revisions: `Release - LLVM`) - -To speed up the compilation time, you may want to download and extract to `\build\lib_ext\<$(Configuration)>-x64` (e.g. `c:\rpcs3\build\lib_ext\Release-x64`; the path needs to be created) some of the following precompiled libs: -- [LLVM libs](https://github.com/RPCS3/llvm-mirror/releases/download/custom-build-win-19.1.7/llvmlibs_mt.7z) -- [additional libs](https://github.com/RPCS3/glslang/releases/latest/download/glslanglibs_mt.7z) - -**NOTES:** -- `<$(Configuration)>` can assume values `Release` or `Debug`. -- Unoptimised/debug libs are currently not available precompiled for both **LLVM** and **glslang**. Trying to use them when building the **RPCS3** application in `Debug` mode will provide a `cannot open file` error. - -If you're not using the precompiled libs, those dependency libs need to be compiled first. From the `Solution Explorer` panel: -1) expand `__BUILD_BEFORE` -2) from the `Solution Configurations` drop-down menu, select `Release` (select `Debug` if you want to build in `Debug` mode) -3) one after another, right-click on the following projects and then click on `Build` to build the selected lib: - - `glslang` - - `llvm_build` - - or `llvm_build_clang_cl` (if you have also the **clang** compiler installed on VS) - -**NOTE:** Compiled dependency libs have priority over precompiled libs, if installed. It means that they will always be referenced and linked in case the precompiled libs are also available. - -In order to build the **RPCS3** application: -1) from the `Solution Configurations` drop-down menu, select `Release` (select `Debug` if you want to build in `Debug` mode) - - **NOTE:** In case you previously compiled the dependency libs under `__BUILD_BEFORE`, you have also to select the same build configuration (e.g. `Release`, if you compiled the dependency libs in `Release` mode) - -2) click on `Build` menu and then on `Build Solution` -3) once the build is completed, the **RPCS3** application will be available under the `\bin` folder - -#### Building with Visual Studio CMake solution - -Start **Visual Studio**, click on `Open a local folder` and select the RPCS3's root folder - -Once the project is open on VS, from the `Solution Explorer` panel: -1) right-click on `rpcs3` and then click on `Switch to CMake Targets View` -2) from the `Configuration` drop-down menu, select `msvc-release` (select `msvc-debug` if you want to build in `Debug` mode) -3) right-click on `CMakeLists.txt Project` and then click on `Configure Cache` -4) once the cache is created, the `rpcs3 project` will be available -5) right-click on `rpcs3 Project` and then click on `Build All`, or click on `Build` menu and then on `Build All` -6) once the build is completed, the **RPCS3** application will be available under the `\build-msvc\bin` folder - -#### Building with standalone CMake tool - -In case you preferred to install and use the standalone **CMake** tool: -1) move on the RPCS3's root folder -2) execute the following commands to create the cache and to build the application (for the build, use `--preset msvc-debug` if you want to build in `Debug` mode), respectively: - - ``` - cmake --preset msvc - cmake --build --preset msvc-release - ``` -3) once the build is completed, the **RPCS3** application will be available under the `\build-msvc\bin` folder - -### Linux - -While still in the project root: - -1) `cmake -B build -G Ninja` to generate build files with the default compiler (override the compiler by prepending e.g. `CC=clang CXX=clang++`) -2) `cmake --build build` to compile -3) run RPCS3 with `build/bin/rpcs3` - -If compiling for ARM, pass the flag `-DUSE_NATIVE_INSTRUCTIONS=OFF` to the first `cmake` command. This resolves some NEON errors when compiling our SIMD headers. - -When using GDB, configure it to ignore SIGSEGV signal (`handle SIGSEGV nostop noprint`). -If desired, use the various build options in [CMakeLists](https://github.com/RPCS3/rpcs3/blob/master/CMakeLists.txt). diff --git a/rpcs3/CMakeLists.txt b/rpcs3/CMakeLists.txt index 65314b5b2..3b8080c6b 100644 --- a/rpcs3/CMakeLists.txt +++ b/rpcs3/CMakeLists.txt @@ -1,103 +1,3 @@ -cmake_minimum_required(VERSION 3.28) - -project(rpcs3 LANGUAGES C CXX) - -set(CMAKE_EXPORT_COMPILE_COMMANDS ON) - -if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11) - message(FATAL_ERROR "RPCS3 requires at least gcc-11.") - endif() -elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.0) - message(FATAL_ERROR "RPCS3 requires at least clang-12.0.") - endif() -endif() - -include(CheckCXXCompilerFlag) - -get_property(IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) -if(IS_MULTI_CONFIG) - # TODO(cjj19970505@live.cn) - # Currently DicordRPC is included as a binary compiled with /MT flag. - # We need all 4 binaries(/MT /MTd /MD /MDd) or including the source instead of binary. - set(USE_DISCORD_RPC OFF CACHE BOOL "Discord RPC is only avaliable with single-config generator" FORCE) -else() - if(NOT CMAKE_BUILD_TYPE) - message(STATUS "No build type selected, default to Release") - set(CMAKE_BUILD_TYPE "Release") - endif() -endif() - -if(CMAKE_BUILD_TYPE MATCHES "Debug" AND NOT MSVC) - add_compile_definitions(_DEBUG) -endif() - -if(MSVC) - option(USE_MSVC_STATIC_CRT "Use static MSVC C runtime" OFF) - - # TODO(cjj19970505@live.cn) - # DiscordRPC binary in 3rdparty is compiled /MT - # So theoretically we should enable DiscordRPC in Release and static CRT build - # since we might encounter some rumtime issues when more than one CRT version are presented. - # https://docs.microsoft.com/en-us/cpp/c-runtime-library/crt-library-features?view=msvc-160#what-problems-exist-if-an-application-uses-more-than-one-crt-version - # Add other DiscordRPC binaries(compiled with /MTd, /MD, /MDd) or compile it from source may address this issue. - if(NOT IS_MULTI_CONFIG) - if(NOT(CMAKE_BUILD_TYPE MATCHES "Release" AND USE_MSVC_STATIC_CRT)) - set(USE_DISCORD_RPC OFF CACHE BOOL "Discord RPC is only available in Release and static CRT build." FORCE) - endif() - endif() - - if(USE_MSVC_STATIC_CRT) - set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") - else() - # though doc ( https://cmake.org/cmake/help/latest/variable/CMAKE_MSVC_RUNTIME_LIBRARY.html ) - # says if that property is not set then CMake uses the default value MultiThreaded$<$:Debug>DLL - # to select a MSVC runtime library. - # But yaml-cpp set /MT(d) if CMAKE_MSVC_RUNTIME_LIBRARY is undefined - # So we have to define it explicitly - set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>DLL") - endif() - - # TODO(cjj19970505@live.cn) - # offical QT uses dynamic CRT. - # When building our lib with static CRT and debug build type - # and linking with Qt with dynamic CRT and debug build, - # error is encountered in runtime (which is expected). - # But building our lib with static CRT and release build type, - # and linking with Qt with dynamic CRT and release build seems to be working, - # which is the same config with VS solution. - # (though technically it might still have some hidden errors). - # So we allow static CRT in both relase and debug build, but prompt warning in debug build. - # For more info: - # https://docs.microsoft.com/en-us/cpp/c-runtime-library/crt-library-features?view=msvc-160#what-problems-exist-if-an-application-uses-more-than-one-crt-version - # https://wiki.qt.io/Technical_FAQ#Why_does_a_statically_built_Qt_use_the_dynamic_Visual_Studio_runtime_libraries_.3F_Do_I_need_to_deploy_those_with_my_application_.3F - if(USE_MSVC_STATIC_CRT) - if(IS_MULTI_CONFIG OR CMAKE_BUILD_TYPE MATCHES "Debug") - message(AUTHOR_WARNING "Debug build currently can not work with static CRT.") - endif() - endif() - add_compile_options(/MP) -endif() - -if(CMAKE_SIZEOF_VOID_P AND NOT CMAKE_SIZEOF_VOID_P EQUAL 8) - message( FATAL_ERROR "RPCS3 can only be compiled on 64-bit platforms. ${CMAKE_SIZEOF_VOID_P}" ) -endif() - -find_program(CCACHE_FOUND ccache) -if(CCACHE_FOUND) - set(CMAKE_CXX_COMPILER_LAUNCHER ccache) -endif() - -if(APPLE AND CMAKE_OSX_ARCHITECTURES STREQUAL "arm64") - include_directories(/opt/homebrew/include) - link_directories(/opt/homebrew/lib) -endif() - -if(MSVC) - add_compile_options(/wd4530 /utf-8) # C++ exception handler used, but unwind semantics are not enabled -endif() - add_subdirectory(3rdparty) if (DISABLE_LTO) @@ -123,6 +23,176 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${PROJECT_BINARY_DIR}/bin") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${PROJECT_BINARY_DIR}/bin") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${PROJECT_BINARY_DIR}/bin") -add_subdirectory(rpcs3) +# Define GNU standard installation directories +include(GNUInstallDirs) -set_directory_properties(PROPERTIES VS_STARTUP_PROJECT rpcs3) +# Generate git-version.h at build time. +include(${CMAKE_CURRENT_SOURCE_DIR}/git-version.cmake) + +# Check for a sufficient compiler and set build options +include(ConfigureCompiler) +include(CheckFunctionExists) + +set(CMAKE_CXX_STANDARD 20) + +set(ADDITIONAL_LIBS "") +if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + #on some Linux distros shm_unlink and similar functions are in librt only + set(ADDITIONAL_LIBS ${ADDITIONAL_LIBS} "rt") +elseif(NOT WIN32 AND NOT CMAKE_CXX_FLAGS MATCHES "LIBICONV_PLUG") + #it seems like glibc includes the iconv functions we use but other libc + #implementations like the one on OSX don't seem implement them + set(ADDITIONAL_LIBS ${ADDITIONAL_LIBS} "iconv") +endif() + +# subdirectories +add_subdirectory(Emu) + +if(UNIX AND NOT APPLE AND NOT ANDROID) + add_definitions(-DDATADIR="${CMAKE_INSTALL_FULL_DATADIR}/rpcs3") + # Optionally enable X11 for window management + find_package(X11) + if(X11_FOUND) + target_compile_definitions(rpcs3_emu PUBLIC -DHAVE_X11) + endif() + find_package(Wayland) + if(WAYLAND_FOUND) + target_compile_definitions(rpcs3_emu PUBLIC -DHAVE_WAYLAND) + endif() +endif() + + +gen_git_version(${CMAKE_CURRENT_SOURCE_DIR}) + +add_library(rpcs3 STATIC + rpcs3_version.cpp + module_verifier.cpp + stb_image.cpp + + dev/iso.cpp + + util/atomic.cpp + util/console.cpp + util/emu_utils.cpp + util/media_utils.cpp + util/video_provider.cpp + util/logs.cpp + util/yaml.cpp + util/vm_native.cpp + util/dyn_lib.cpp + util/sysinfo.cpp + util/cpu_stats.cpp + util/serialization_ext.cpp + util/bin_patch.cpp + util/cheat_info.cpp + util/cond.cpp + util/Config.cpp + util/date_time.cpp + util/File.cpp + util/JITASM.cpp + util/JITLLVM.cpp + util/LUrlParser.cpp + util/mutex.cpp + util/rXml.cpp + util/sema.cpp + util/simple_ringbuf.cpp + util/stack_trace.cpp + util/StrFmt.cpp + util/Thread.cpp + util/version.cpp + + Crypto/aes.cpp + Crypto/aesni.cpp + Crypto/decrypt_binaries.cpp + Crypto/ec.cpp + Crypto/key_vault.cpp + Crypto/lz.cpp + Crypto/md5.cpp + Crypto/sha1.cpp + Crypto/sha256.cpp + Crypto/unedat.cpp + Crypto/unpkg.cpp + Crypto/unself.cpp + Crypto/unzip.cpp + Crypto/utils.cpp + + Loader/disc.cpp + Loader/ELF.cpp + Loader/mself.cpp + Loader/PSF.cpp + Loader/PUP.cpp + Loader/TAR.cpp + Loader/TROPUSR.cpp + Loader/TRP.cpp + + Input/ds3_pad_handler.cpp + Input/ds4_pad_handler.cpp + Input/dualsense_pad_handler.cpp + Input/evdev_joystick_handler.cpp + Input/evdev_gun_handler.cpp + Input/hid_pad_handler.cpp + Input/mm_joystick_handler.cpp + Input/pad_thread.cpp + Input/product_info.cpp + Input/ps_move_calibration.cpp + Input/ps_move_config.cpp + Input/ps_move_handler.cpp + Input/ps_move_tracker.cpp + Input/raw_mouse_config.cpp + Input/raw_mouse_handler.cpp + Input/sdl_pad_handler.cpp + Input/skateboard_pad_handler.cpp + Input/xinput_pad_handler.cpp + Input/virtual_pad_handler.cpp +) + +target_include_directories(rpcs3 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) + +if(APPLE) + target_sources(rpcs3 PRIVATE + util/darwin/sysinfo_darwin.mm + ) +endif() + +set_source_files_properties("util/JITLLVM.cpp" "util/JITASM.cpp" PROPERTIES + COMPILE_FLAGS "$,/GR-,-fno-rtti>" + SKIP_PRECOMPILE_HEADERS ON +) + +set_source_files_properties("util/yaml.cpp" PROPERTIES + COMPILE_FLAGS "$,/EHsc,-fexceptions>" + SKIP_PRECOMPILE_HEADERS ON +) + +target_link_libraries(rpcs3 PUBLIC + rpcs3_emu + 3rdparty::zlib + 3rdparty::pugixml + 3rdparty::discordRPC + 3rdparty::hidapi + 3rdparty::libusb + 3rdparty::libpng + 3rdparty::7zip + 3rdparty::wolfssl + 3rdparty::libcurl + 3rdparty::opencv + 3rdparty::fusion + 3rdparty::rtmidi + 3rdparty::stblib + 3rdparty::ffmpeg + 3rdparty::yaml-cpp + 3rdparty::zstd + ${ADDITIONAL_LIBS} +) + +if(USE_PRECOMPILED_HEADERS) + target_precompile_headers(rpcs3 PUBLIC stdafx.h) +endif() + +# Unix display manager +if(X11_FOUND) + target_link_libraries(rpcs3 PRIVATE X11::X11) +elseif(USE_VULKAN AND UNIX AND NOT WAYLAND_FOUND AND NOT APPLE AND NOT ANDROID) + # Wayland has been checked in 3rdparty/CMakeLists.txt already. + message(FATAL_ERROR "RPCS3 requires either X11 or Wayland (or both) for Vulkan.") +endif() diff --git a/rpcs3/rpcs3/Crypto/aes.cpp b/rpcs3/Crypto/aes.cpp similarity index 100% rename from rpcs3/rpcs3/Crypto/aes.cpp rename to rpcs3/Crypto/aes.cpp diff --git a/rpcs3/rpcs3/Crypto/aes.h b/rpcs3/Crypto/aes.h similarity index 100% rename from rpcs3/rpcs3/Crypto/aes.h rename to rpcs3/Crypto/aes.h diff --git a/rpcs3/rpcs3/Crypto/aesni.cpp b/rpcs3/Crypto/aesni.cpp similarity index 100% rename from rpcs3/rpcs3/Crypto/aesni.cpp rename to rpcs3/Crypto/aesni.cpp diff --git a/rpcs3/rpcs3/Crypto/aesni.h b/rpcs3/Crypto/aesni.h similarity index 100% rename from rpcs3/rpcs3/Crypto/aesni.h rename to rpcs3/Crypto/aesni.h diff --git a/rpcs3/rpcs3/Crypto/decrypt_binaries.cpp b/rpcs3/Crypto/decrypt_binaries.cpp similarity index 99% rename from rpcs3/rpcs3/Crypto/decrypt_binaries.cpp rename to rpcs3/Crypto/decrypt_binaries.cpp index 35a0b69d6..b78e0f802 100644 --- a/rpcs3/rpcs3/Crypto/decrypt_binaries.cpp +++ b/rpcs3/Crypto/decrypt_binaries.cpp @@ -4,7 +4,7 @@ #include "unself.h" #include "Emu/IdManager.h" #include "Emu/System.h" -#include "Utilities/StrUtil.h" +#include "util/StrUtil.h" #include #include diff --git a/rpcs3/rpcs3/Crypto/decrypt_binaries.h b/rpcs3/Crypto/decrypt_binaries.h similarity index 100% rename from rpcs3/rpcs3/Crypto/decrypt_binaries.h rename to rpcs3/Crypto/decrypt_binaries.h diff --git a/rpcs3/rpcs3/Crypto/ec.cpp b/rpcs3/Crypto/ec.cpp similarity index 100% rename from rpcs3/rpcs3/Crypto/ec.cpp rename to rpcs3/Crypto/ec.cpp diff --git a/rpcs3/rpcs3/Crypto/ec.h b/rpcs3/Crypto/ec.h similarity index 100% rename from rpcs3/rpcs3/Crypto/ec.h rename to rpcs3/Crypto/ec.h diff --git a/rpcs3/rpcs3/Crypto/key_vault.cpp b/rpcs3/Crypto/key_vault.cpp similarity index 100% rename from rpcs3/rpcs3/Crypto/key_vault.cpp rename to rpcs3/Crypto/key_vault.cpp diff --git a/rpcs3/rpcs3/Crypto/key_vault.h b/rpcs3/Crypto/key_vault.h similarity index 100% rename from rpcs3/rpcs3/Crypto/key_vault.h rename to rpcs3/Crypto/key_vault.h diff --git a/rpcs3/rpcs3/Crypto/lz.cpp b/rpcs3/Crypto/lz.cpp similarity index 100% rename from rpcs3/rpcs3/Crypto/lz.cpp rename to rpcs3/Crypto/lz.cpp diff --git a/rpcs3/rpcs3/Crypto/lz.h b/rpcs3/Crypto/lz.h similarity index 100% rename from rpcs3/rpcs3/Crypto/lz.h rename to rpcs3/Crypto/lz.h diff --git a/rpcs3/rpcs3/Crypto/md5.cpp b/rpcs3/Crypto/md5.cpp similarity index 100% rename from rpcs3/rpcs3/Crypto/md5.cpp rename to rpcs3/Crypto/md5.cpp diff --git a/rpcs3/rpcs3/Crypto/md5.h b/rpcs3/Crypto/md5.h similarity index 100% rename from rpcs3/rpcs3/Crypto/md5.h rename to rpcs3/Crypto/md5.h diff --git a/rpcs3/rpcs3/Crypto/sha1.cpp b/rpcs3/Crypto/sha1.cpp similarity index 100% rename from rpcs3/rpcs3/Crypto/sha1.cpp rename to rpcs3/Crypto/sha1.cpp diff --git a/rpcs3/rpcs3/Crypto/sha1.h b/rpcs3/Crypto/sha1.h similarity index 100% rename from rpcs3/rpcs3/Crypto/sha1.h rename to rpcs3/Crypto/sha1.h diff --git a/rpcs3/rpcs3/Crypto/sha256.cpp b/rpcs3/Crypto/sha256.cpp similarity index 100% rename from rpcs3/rpcs3/Crypto/sha256.cpp rename to rpcs3/Crypto/sha256.cpp diff --git a/rpcs3/rpcs3/Crypto/sha256.h b/rpcs3/Crypto/sha256.h similarity index 100% rename from rpcs3/rpcs3/Crypto/sha256.h rename to rpcs3/Crypto/sha256.h diff --git a/rpcs3/rpcs3/Crypto/unedat.cpp b/rpcs3/Crypto/unedat.cpp similarity index 100% rename from rpcs3/rpcs3/Crypto/unedat.cpp rename to rpcs3/Crypto/unedat.cpp diff --git a/rpcs3/rpcs3/Crypto/unedat.h b/rpcs3/Crypto/unedat.h similarity index 99% rename from rpcs3/rpcs3/Crypto/unedat.h rename to rpcs3/Crypto/unedat.h index 6b96d598b..5122e67ed 100644 --- a/rpcs3/rpcs3/Crypto/unedat.h +++ b/rpcs3/Crypto/unedat.h @@ -1,7 +1,7 @@ #pragma once #include -#include "Utilities/File.h" +#include "util/File.h" constexpr u32 SDAT_FLAG = 0x01000000; constexpr u32 EDAT_COMPRESSED_FLAG = 0x00000001; diff --git a/rpcs3/rpcs3/Crypto/unpkg.cpp b/rpcs3/Crypto/unpkg.cpp similarity index 99% rename from rpcs3/rpcs3/Crypto/unpkg.cpp rename to rpcs3/Crypto/unpkg.cpp index 935bb17fe..3dd5448c2 100644 --- a/rpcs3/rpcs3/Crypto/unpkg.cpp +++ b/rpcs3/Crypto/unpkg.cpp @@ -3,8 +3,8 @@ #include "sha1.h" #include "key_vault.h" #include "util/logs.hpp" -#include "Utilities/StrUtil.h" -#include "Utilities/Thread.h" +#include "util/StrUtil.h" +#include "util/Thread.h" #include "Emu/System.h" #include "Emu/system_utils.hpp" #include "Emu/VFS.h" diff --git a/rpcs3/rpcs3/Crypto/unpkg.h b/rpcs3/Crypto/unpkg.h similarity index 99% rename from rpcs3/rpcs3/Crypto/unpkg.h rename to rpcs3/Crypto/unpkg.h index cdfeeefbf..b0c74e6d4 100644 --- a/rpcs3/rpcs3/Crypto/unpkg.h +++ b/rpcs3/Crypto/unpkg.h @@ -3,7 +3,7 @@ #include "Loader/PSF.h" #include "util/endian.hpp" #include "util/types.hpp" -#include "Utilities/File.h" +#include "util/File.h" #include #include #include diff --git a/rpcs3/rpcs3/Crypto/unself.cpp b/rpcs3/Crypto/unself.cpp similarity index 100% rename from rpcs3/rpcs3/Crypto/unself.cpp rename to rpcs3/Crypto/unself.cpp diff --git a/rpcs3/rpcs3/Crypto/unself.h b/rpcs3/Crypto/unself.h similarity index 95% rename from rpcs3/rpcs3/Crypto/unself.h rename to rpcs3/Crypto/unself.h index c823db402..8f99a8091 100644 --- a/rpcs3/rpcs3/Crypto/unself.h +++ b/rpcs3/Crypto/unself.h @@ -4,7 +4,7 @@ #include "zlib.h" #include "util/types.hpp" -#include "Utilities/File.h" +#include "util/File.h" #include "util/logs.hpp" #include "unedat.h" diff --git a/rpcs3/rpcs3/Crypto/unzip.cpp b/rpcs3/Crypto/unzip.cpp similarity index 100% rename from rpcs3/rpcs3/Crypto/unzip.cpp rename to rpcs3/Crypto/unzip.cpp diff --git a/rpcs3/rpcs3/Crypto/unzip.h b/rpcs3/Crypto/unzip.h similarity index 100% rename from rpcs3/rpcs3/Crypto/unzip.h rename to rpcs3/Crypto/unzip.h diff --git a/rpcs3/rpcs3/Crypto/utils.cpp b/rpcs3/Crypto/utils.cpp similarity index 95% rename from rpcs3/rpcs3/Crypto/utils.cpp rename to rpcs3/Crypto/utils.cpp index 4cab23071..3098422c9 100644 --- a/rpcs3/rpcs3/Crypto/utils.cpp +++ b/rpcs3/Crypto/utils.cpp @@ -10,8 +10,8 @@ #include #include #include -#include "Utilities/StrUtil.h" -#include "Utilities/File.h" +#include "util/StrUtil.h" +#include "util/File.h" #include #include diff --git a/rpcs3/rpcs3/Crypto/utils.h b/rpcs3/Crypto/utils.h similarity index 100% rename from rpcs3/rpcs3/Crypto/utils.h rename to rpcs3/Crypto/utils.h diff --git a/rpcs3/rpcs3/Emu/Audio/AudioBackend.cpp b/rpcs3/Emu/Audio/AudioBackend.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/Audio/AudioBackend.cpp rename to rpcs3/Emu/Audio/AudioBackend.cpp index e0d96c8c2..c89d25986 100644 --- a/rpcs3/rpcs3/Emu/Audio/AudioBackend.cpp +++ b/rpcs3/Emu/Audio/AudioBackend.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "AudioBackend.h" #include "Emu/IdManager.h" -#include "Emu//Cell/Modules/cellAudioOut.h" +#include "rpcsx/fw/ps3/cellAudioOut.h" AudioBackend::AudioBackend() {} diff --git a/rpcs3/rpcs3/Emu/Audio/AudioBackend.h b/rpcs3/Emu/Audio/AudioBackend.h similarity index 99% rename from rpcs3/rpcs3/Emu/Audio/AudioBackend.h rename to rpcs3/Emu/Audio/AudioBackend.h index 062b22305..8a2e7e888 100644 --- a/rpcs3/rpcs3/Emu/Audio/AudioBackend.h +++ b/rpcs3/Emu/Audio/AudioBackend.h @@ -2,8 +2,8 @@ #include "util/types.hpp" #include "util/logs.hpp" -#include "Utilities/mutex.h" -#include "Utilities/StrFmt.h" +#include "util/mutex.h" +#include "util/StrFmt.h" #include "Emu/system_config_types.h" #include diff --git a/rpcs3/rpcs3/Emu/Audio/AudioDumper.cpp b/rpcs3/Emu/Audio/AudioDumper.cpp similarity index 98% rename from rpcs3/rpcs3/Emu/Audio/AudioDumper.cpp rename to rpcs3/Emu/Audio/AudioDumper.cpp index 783adf66e..d0551392a 100644 --- a/rpcs3/rpcs3/Emu/Audio/AudioDumper.cpp +++ b/rpcs3/Emu/Audio/AudioDumper.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "AudioDumper.h" -#include "Utilities/date_time.h" +#include "util/date_time.h" #include "Emu/System.h" #include diff --git a/rpcs3/rpcs3/Emu/Audio/AudioDumper.h b/rpcs3/Emu/Audio/AudioDumper.h similarity index 98% rename from rpcs3/rpcs3/Emu/Audio/AudioDumper.h rename to rpcs3/Emu/Audio/AudioDumper.h index 0bea072e0..ea517752a 100644 --- a/rpcs3/rpcs3/Emu/Audio/AudioDumper.h +++ b/rpcs3/Emu/Audio/AudioDumper.h @@ -1,7 +1,7 @@ #pragma once #include "util/types.hpp" -#include "Utilities/File.h" +#include "util/File.h" #include "Emu/Audio/AudioBackend.h" struct WAVHeader diff --git a/rpcs3/rpcs3/Emu/Audio/Cubeb/CubebBackend.cpp b/rpcs3/Emu/Audio/Cubeb/CubebBackend.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Audio/Cubeb/CubebBackend.cpp rename to rpcs3/Emu/Audio/Cubeb/CubebBackend.cpp diff --git a/rpcs3/rpcs3/Emu/Audio/Cubeb/CubebBackend.h b/rpcs3/Emu/Audio/Cubeb/CubebBackend.h similarity index 100% rename from rpcs3/rpcs3/Emu/Audio/Cubeb/CubebBackend.h rename to rpcs3/Emu/Audio/Cubeb/CubebBackend.h diff --git a/rpcs3/rpcs3/Emu/Audio/Cubeb/cubeb_enumerator.cpp b/rpcs3/Emu/Audio/Cubeb/cubeb_enumerator.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Audio/Cubeb/cubeb_enumerator.cpp rename to rpcs3/Emu/Audio/Cubeb/cubeb_enumerator.cpp diff --git a/rpcs3/rpcs3/Emu/Audio/Cubeb/cubeb_enumerator.h b/rpcs3/Emu/Audio/Cubeb/cubeb_enumerator.h similarity index 100% rename from rpcs3/rpcs3/Emu/Audio/Cubeb/cubeb_enumerator.h rename to rpcs3/Emu/Audio/Cubeb/cubeb_enumerator.h diff --git a/rpcs3/rpcs3/Emu/Audio/FAudio/FAudioBackend.cpp b/rpcs3/Emu/Audio/FAudio/FAudioBackend.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/Audio/FAudio/FAudioBackend.cpp rename to rpcs3/Emu/Audio/FAudio/FAudioBackend.cpp index 9d6099ec1..7fdeb1984 100644 --- a/rpcs3/rpcs3/Emu/Audio/FAudio/FAudioBackend.cpp +++ b/rpcs3/Emu/Audio/FAudio/FAudioBackend.cpp @@ -6,7 +6,7 @@ #include "FAudioBackend.h" #include "Emu/System.h" #include "Emu/Audio/audio_device_enumerator.h" -#include "Utilities/StrUtil.h" +#include "util/StrUtil.h" LOG_CHANNEL(FAudio_, "FAudio"); diff --git a/rpcs3/rpcs3/Emu/Audio/FAudio/FAudioBackend.h b/rpcs3/Emu/Audio/FAudio/FAudioBackend.h similarity index 100% rename from rpcs3/rpcs3/Emu/Audio/FAudio/FAudioBackend.h rename to rpcs3/Emu/Audio/FAudio/FAudioBackend.h diff --git a/rpcs3/rpcs3/Emu/Audio/FAudio/faudio_enumerator.cpp b/rpcs3/Emu/Audio/FAudio/faudio_enumerator.cpp similarity index 98% rename from rpcs3/rpcs3/Emu/Audio/FAudio/faudio_enumerator.cpp rename to rpcs3/Emu/Audio/FAudio/faudio_enumerator.cpp index 0eff57e8a..298025db1 100644 --- a/rpcs3/rpcs3/Emu/Audio/FAudio/faudio_enumerator.cpp +++ b/rpcs3/Emu/Audio/FAudio/faudio_enumerator.cpp @@ -4,7 +4,7 @@ #include "Emu/Audio/FAudio/faudio_enumerator.h" #include -#include "Utilities/StrUtil.h" +#include "util/StrUtil.h" #include "util/logs.hpp" LOG_CHANNEL(faudio_dev_enum); diff --git a/rpcs3/rpcs3/Emu/Audio/FAudio/faudio_enumerator.h b/rpcs3/Emu/Audio/FAudio/faudio_enumerator.h similarity index 100% rename from rpcs3/rpcs3/Emu/Audio/FAudio/faudio_enumerator.h rename to rpcs3/Emu/Audio/FAudio/faudio_enumerator.h diff --git a/rpcs3/rpcs3/Emu/Audio/Null/NullAudioBackend.h b/rpcs3/Emu/Audio/Null/NullAudioBackend.h similarity index 100% rename from rpcs3/rpcs3/Emu/Audio/Null/NullAudioBackend.h rename to rpcs3/Emu/Audio/Null/NullAudioBackend.h diff --git a/rpcs3/rpcs3/Emu/Audio/Null/null_enumerator.h b/rpcs3/Emu/Audio/Null/null_enumerator.h similarity index 100% rename from rpcs3/rpcs3/Emu/Audio/Null/null_enumerator.h rename to rpcs3/Emu/Audio/Null/null_enumerator.h diff --git a/rpcs3/rpcs3/Emu/Audio/XAudio2/XAudio2Backend.cpp b/rpcs3/Emu/Audio/XAudio2/XAudio2Backend.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/Audio/XAudio2/XAudio2Backend.cpp rename to rpcs3/Emu/Audio/XAudio2/XAudio2Backend.cpp index c48a2dc7f..07aad2d51 100644 --- a/rpcs3/rpcs3/Emu/Audio/XAudio2/XAudio2Backend.cpp +++ b/rpcs3/Emu/Audio/XAudio2/XAudio2Backend.cpp @@ -6,7 +6,7 @@ #include "util/logs.hpp" #include "Emu/System.h" #include "Emu/Audio/audio_device_enumerator.h" -#include "Utilities/StrUtil.h" +#include "util/StrUtil.h" #include "XAudio2Backend.h" #include diff --git a/rpcs3/rpcs3/Emu/Audio/XAudio2/XAudio2Backend.h b/rpcs3/Emu/Audio/XAudio2/XAudio2Backend.h similarity index 100% rename from rpcs3/rpcs3/Emu/Audio/XAudio2/XAudio2Backend.h rename to rpcs3/Emu/Audio/XAudio2/XAudio2Backend.h diff --git a/rpcs3/rpcs3/Emu/Audio/XAudio2/xaudio2_enumerator.cpp b/rpcs3/Emu/Audio/XAudio2/xaudio2_enumerator.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/Audio/XAudio2/xaudio2_enumerator.cpp rename to rpcs3/Emu/Audio/XAudio2/xaudio2_enumerator.cpp index fd3d611c4..ac956e3af 100644 --- a/rpcs3/rpcs3/Emu/Audio/XAudio2/xaudio2_enumerator.cpp +++ b/rpcs3/Emu/Audio/XAudio2/xaudio2_enumerator.cpp @@ -4,7 +4,7 @@ #include "Emu/Audio/XAudio2/xaudio2_enumerator.h" #include "util/logs.hpp" -#include "Utilities/StrUtil.h" +#include "util/StrUtil.h" #include #include diff --git a/rpcs3/rpcs3/Emu/Audio/XAudio2/xaudio2_enumerator.h b/rpcs3/Emu/Audio/XAudio2/xaudio2_enumerator.h similarity index 100% rename from rpcs3/rpcs3/Emu/Audio/XAudio2/xaudio2_enumerator.h rename to rpcs3/Emu/Audio/XAudio2/xaudio2_enumerator.h diff --git a/rpcs3/rpcs3/Emu/Audio/audio_device_enumerator.h b/rpcs3/Emu/Audio/audio_device_enumerator.h similarity index 100% rename from rpcs3/rpcs3/Emu/Audio/audio_device_enumerator.h rename to rpcs3/Emu/Audio/audio_device_enumerator.h diff --git a/rpcs3/rpcs3/Emu/Audio/audio_resampler.cpp b/rpcs3/Emu/Audio/audio_resampler.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Audio/audio_resampler.cpp rename to rpcs3/Emu/Audio/audio_resampler.cpp diff --git a/rpcs3/rpcs3/Emu/Audio/audio_resampler.h b/rpcs3/Emu/Audio/audio_resampler.h similarity index 100% rename from rpcs3/rpcs3/Emu/Audio/audio_resampler.h rename to rpcs3/Emu/Audio/audio_resampler.h diff --git a/rpcs3/rpcs3/Emu/Audio/audio_utils.cpp b/rpcs3/Emu/Audio/audio_utils.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Audio/audio_utils.cpp rename to rpcs3/Emu/Audio/audio_utils.cpp diff --git a/rpcs3/rpcs3/Emu/Audio/audio_utils.h b/rpcs3/Emu/Audio/audio_utils.h similarity index 100% rename from rpcs3/rpcs3/Emu/Audio/audio_utils.h rename to rpcs3/Emu/Audio/audio_utils.h diff --git a/rpcs3/rpcs3/Emu/CMakeLists.txt b/rpcs3/Emu/CMakeLists.txt similarity index 66% rename from rpcs3/rpcs3/Emu/CMakeLists.txt rename to rpcs3/Emu/CMakeLists.txt index 1b813c559..bfcf682a2 100644 --- a/rpcs3/rpcs3/Emu/CMakeLists.txt +++ b/rpcs3/Emu/CMakeLists.txt @@ -55,90 +55,12 @@ target_include_directories(rpcs3_emu ${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty ) -# Utilities -target_sources(rpcs3_emu PRIVATE - ../util/atomic.cpp - ../util/console.cpp - ../util/emu_utils.cpp - ../util/media_utils.cpp - ../util/video_provider.cpp - ../util/logs.cpp - ../util/yaml.cpp - ../util/vm_native.cpp - ../util/dyn_lib.cpp - ../util/sysinfo.cpp - ../util/cpu_stats.cpp - ../util/serialization_ext.cpp - ../../Utilities/bin_patch.cpp - ../../Utilities/cheat_info.cpp - ../../Utilities/cond.cpp - ../../Utilities/Config.cpp - ../../Utilities/date_time.cpp - ../../Utilities/File.cpp - ../../Utilities/JITASM.cpp - ../../Utilities/JITLLVM.cpp - ../../Utilities/LUrlParser.cpp - ../../Utilities/mutex.cpp - ../../Utilities/rXml.cpp - ../../Utilities/sema.cpp - ../../Utilities/simple_ringbuf.cpp - ../../Utilities/stack_trace.cpp - ../../Utilities/StrFmt.cpp - ../../Utilities/Thread.cpp - ../../Utilities/version.cpp -) -if(APPLE) - target_sources(rpcs3_emu PRIVATE - ../../darwin/util/sysinfo_darwin.mm - ) -endif() - target_include_directories(rpcs3_emu PUBLIC "${CMAKE_SOURCE_DIR}") target_link_libraries(rpcs3_emu PUBLIC 3rdparty::pugixml) -set_source_files_properties("../../Utilities/JITLLVM.cpp" "../../Utilities/JITASM.cpp" PROPERTIES - COMPILE_FLAGS "$,/GR-,-fno-rtti>" - SKIP_PRECOMPILE_HEADERS ON -) - -set_source_files_properties("../util/yaml.cpp" PROPERTIES - COMPILE_FLAGS "$,/EHsc,-fexceptions>" - SKIP_PRECOMPILE_HEADERS ON -) - -# Crypto -target_sources(rpcs3_emu PRIVATE - ../Crypto/aes.cpp - ../Crypto/aesni.cpp - ../Crypto/decrypt_binaries.cpp - ../Crypto/ec.cpp - ../Crypto/key_vault.cpp - ../Crypto/lz.cpp - ../Crypto/md5.cpp - ../Crypto/sha1.cpp - ../Crypto/sha256.cpp - ../Crypto/unedat.cpp - ../Crypto/unpkg.cpp - ../Crypto/unself.cpp - ../Crypto/unzip.cpp - ../Crypto/utils.cpp -) - -# Loader -target_sources(rpcs3_emu PRIVATE - ../Loader/disc.cpp - ../Loader/ELF.cpp - ../Loader/mself.cpp - ../Loader/PSF.cpp - ../Loader/PUP.cpp - ../Loader/TAR.cpp - ../Loader/TROPUSR.cpp - ../Loader/TRP.cpp -) - # Audio target_sources(rpcs3_emu PRIVATE Audio/audio_resampler.cpp @@ -253,141 +175,6 @@ target_sources(rpcs3_emu PRIVATE Cell/lv2/sys_uart.cpp Cell/lv2/sys_usbd.cpp Cell/lv2/sys_vm.cpp - Cell/Modules/cellAdec.cpp - Cell/Modules/cellAtrac.cpp - Cell/Modules/cellAtracMulti.cpp - Cell/Modules/cellAtracXdec.cpp - Cell/Modules/cellAudio.cpp - Cell/Modules/cellAudioOut.cpp - Cell/Modules/cellAuthDialog.cpp - Cell/Modules/cellAvconfExt.cpp - Cell/Modules/cellBgdl.cpp - Cell/Modules/cellCamera.cpp - Cell/Modules/cellCelp8Enc.cpp - Cell/Modules/cellCelpEnc.cpp - Cell/Modules/cellCrossController.cpp - Cell/Modules/cellDaisy.cpp - Cell/Modules/cellDmux.cpp - Cell/Modules/cellDmuxPamf.cpp - Cell/Modules/cellDtcpIpUtility.cpp - Cell/Modules/cellFiber.cpp - Cell/Modules/cellFont.cpp - Cell/Modules/cellFontFT.cpp - Cell/Modules/cell_FreeType2.cpp - Cell/Modules/cellFs.cpp - Cell/Modules/cellGame.cpp - Cell/Modules/cellGameExec.cpp - Cell/Modules/cellGcmSys.cpp - Cell/Modules/cellGem.cpp - Cell/Modules/cellGifDec.cpp - Cell/Modules/cellHttp.cpp - Cell/Modules/cellHttpUtil.cpp - Cell/Modules/cellImeJp.cpp - Cell/Modules/cellJpgDec.cpp - Cell/Modules/cellJpgEnc.cpp - Cell/Modules/cellKb.cpp - Cell/Modules/cellKey2char.cpp - Cell/Modules/cellL10n.cpp - Cell/Modules/cellLibprof.cpp - Cell/Modules/cellMic.cpp - Cell/Modules/cellMouse.cpp - Cell/Modules/cellMsgDialog.cpp - Cell/Modules/cellMusic.cpp - Cell/Modules/cellMusicDecode.cpp - Cell/Modules/cellMusicSelectionContext.cpp - Cell/Modules/cellMusicExport.cpp - Cell/Modules/cellNetAoi.cpp - Cell/Modules/cellNetCtl.cpp - Cell/Modules/cellOskDialog.cpp - Cell/Modules/cellOvis.cpp - Cell/Modules/cellPad.cpp - Cell/Modules/cellPamf.cpp - Cell/Modules/cellPesmUtility.cpp - Cell/Modules/cellPhotoDecode.cpp - Cell/Modules/cellPhotoExport.cpp - Cell/Modules/cellPhotoImport.cpp - Cell/Modules/cellPngDec.cpp - Cell/Modules/cellPngEnc.cpp - Cell/Modules/cellPrint.cpp - Cell/Modules/cellRec.cpp - Cell/Modules/cellRemotePlay.cpp - Cell/Modules/cellResc.cpp - Cell/Modules/cellRtcAlarm.cpp - Cell/Modules/cellRtc.cpp - Cell/Modules/cellRudp.cpp - Cell/Modules/cellSail.cpp - Cell/Modules/cellSailRec.cpp - Cell/Modules/cellSaveData.cpp - Cell/Modules/cellScreenshot.cpp - Cell/Modules/cellSearch.cpp - Cell/Modules/cellSheap.cpp - Cell/Modules/cellSpudll.cpp - Cell/Modules/cellSpurs.cpp - Cell/Modules/cellSpursJq.cpp - Cell/Modules/cellSpursSpu.cpp - Cell/Modules/cellSsl.cpp - Cell/Modules/cellStorage.cpp - Cell/Modules/cellSubDisplay.cpp - Cell/Modules/cellSync2.cpp - Cell/Modules/cellSync.cpp - Cell/Modules/cellSysconf.cpp - Cell/Modules/cellSysCache.cpp - Cell/Modules/cellSysmodule.cpp - Cell/Modules/cellSysutilAp.cpp - Cell/Modules/cellSysutilAvc2.cpp - Cell/Modules/cellSysutilAvc.cpp - Cell/Modules/cellSysutilAvcExt.cpp - Cell/Modules/cellSysutil.cpp - Cell/Modules/cellSysutilMisc.cpp - Cell/Modules/cellSysutilNpEula.cpp - Cell/Modules/cellUsbd.cpp - Cell/Modules/cellUsbpspcm.cpp - Cell/Modules/cellUserInfo.cpp - Cell/Modules/cellVdec.cpp - Cell/Modules/cellVideoExport.cpp - Cell/Modules/cellVideoOut.cpp - Cell/Modules/cellVideoPlayerUtility.cpp - Cell/Modules/cellVideoUpload.cpp - Cell/Modules/cellVoice.cpp - Cell/Modules/cellVpost.cpp - Cell/Modules/cellWebBrowser.cpp - Cell/Modules/HLE_PATCHES.cpp - Cell/Modules/libad_async.cpp - Cell/Modules/libad_core.cpp - Cell/Modules/libmedi.cpp - Cell/Modules/libmixer.cpp - Cell/Modules/libsnd3.cpp - Cell/Modules/libsynth2.cpp - Cell/Modules/sceNp2.cpp - Cell/Modules/sceNpClans.cpp - Cell/Modules/sceNpCommerce2.cpp - Cell/Modules/sceNp.cpp - Cell/Modules/sceNpMatchingInt.cpp - Cell/Modules/sceNpPlus.cpp - Cell/Modules/sceNpSns.cpp - Cell/Modules/sceNpTrophy.cpp - Cell/Modules/sceNpTus.cpp - Cell/Modules/sceNpUtil.cpp - Cell/Modules/StaticHLE.cpp - Cell/Modules/sys_crashdump.cpp - Cell/Modules/sys_game_.cpp - Cell/Modules/sys_heap.cpp - Cell/Modules/sys_io_.cpp - Cell/Modules/sys_libc_.cpp - Cell/Modules/sys_libc.cpp - Cell/Modules/sys_lv2dbg.cpp - Cell/Modules/sys_lwcond_.cpp - Cell/Modules/sys_lwmutex_.cpp - Cell/Modules/sys_mempool.cpp - Cell/Modules/sys_mmapper_.cpp - Cell/Modules/sys_net_.cpp - Cell/Modules/sys_ppu_thread_.cpp - Cell/Modules/sys_prx_.cpp - Cell/Modules/sysPrxForUser.cpp - Cell/Modules/sys_rsxaudio_.cpp - Cell/Modules/sys_spinlock.cpp - Cell/Modules/sys_spu_.cpp - Cell/Modules/libfs_utility_init.cpp ) if(NOT MSVC) @@ -399,7 +186,8 @@ endif() target_link_libraries(rpcs3_emu PRIVATE - 3rdparty::stblib 3rdparty::libpng) + 3rdparty::stblib 3rdparty::libpng +) # CPU @@ -656,6 +444,7 @@ target_link_libraries(rpcs3_emu 3rdparty::vulkan 3rdparty::glew 3rdparty::libusb 3rdparty::wolfssl Vulkan::Headers + rpcsx::fw::ps3::api PRIVATE 3rdparty::glslang diff --git a/rpcs3/rpcs3/Emu/CPU/Backends/AArch64/AArch64ASM.cpp b/rpcs3/Emu/CPU/Backends/AArch64/AArch64ASM.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/CPU/Backends/AArch64/AArch64ASM.cpp rename to rpcs3/Emu/CPU/Backends/AArch64/AArch64ASM.cpp index a34e35fe5..df2cb0869 100644 --- a/rpcs3/rpcs3/Emu/CPU/Backends/AArch64/AArch64ASM.cpp +++ b/rpcs3/Emu/CPU/Backends/AArch64/AArch64ASM.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "AArch64ASM.h" -#include "Utilities/StrFmt.h" +#include "util/StrFmt.h" namespace aarch64 { diff --git a/rpcs3/rpcs3/Emu/CPU/Backends/AArch64/AArch64ASM.h b/rpcs3/Emu/CPU/Backends/AArch64/AArch64ASM.h similarity index 100% rename from rpcs3/rpcs3/Emu/CPU/Backends/AArch64/AArch64ASM.h rename to rpcs3/Emu/CPU/Backends/AArch64/AArch64ASM.h diff --git a/rpcs3/rpcs3/Emu/CPU/Backends/AArch64/AArch64Common.cpp b/rpcs3/Emu/CPU/Backends/AArch64/AArch64Common.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/CPU/Backends/AArch64/AArch64Common.cpp rename to rpcs3/Emu/CPU/Backends/AArch64/AArch64Common.cpp diff --git a/rpcs3/rpcs3/Emu/CPU/Backends/AArch64/AArch64Common.h b/rpcs3/Emu/CPU/Backends/AArch64/AArch64Common.h similarity index 100% rename from rpcs3/rpcs3/Emu/CPU/Backends/AArch64/AArch64Common.h rename to rpcs3/Emu/CPU/Backends/AArch64/AArch64Common.h diff --git a/rpcs3/rpcs3/Emu/CPU/Backends/AArch64/AArch64JIT.cpp b/rpcs3/Emu/CPU/Backends/AArch64/AArch64JIT.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/CPU/Backends/AArch64/AArch64JIT.cpp rename to rpcs3/Emu/CPU/Backends/AArch64/AArch64JIT.cpp diff --git a/rpcs3/rpcs3/Emu/CPU/Backends/AArch64/AArch64JIT.h b/rpcs3/Emu/CPU/Backends/AArch64/AArch64JIT.h similarity index 100% rename from rpcs3/rpcs3/Emu/CPU/Backends/AArch64/AArch64JIT.h rename to rpcs3/Emu/CPU/Backends/AArch64/AArch64JIT.h diff --git a/rpcs3/rpcs3/Emu/CPU/Backends/AArch64/AArch64Signal.cpp b/rpcs3/Emu/CPU/Backends/AArch64/AArch64Signal.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/CPU/Backends/AArch64/AArch64Signal.cpp rename to rpcs3/Emu/CPU/Backends/AArch64/AArch64Signal.cpp diff --git a/rpcs3/rpcs3/Emu/CPU/Backends/AArch64/AArch64Signal.h b/rpcs3/Emu/CPU/Backends/AArch64/AArch64Signal.h similarity index 100% rename from rpcs3/rpcs3/Emu/CPU/Backends/AArch64/AArch64Signal.h rename to rpcs3/Emu/CPU/Backends/AArch64/AArch64Signal.h diff --git a/rpcs3/rpcs3/Emu/CPU/CPUDisAsm.h b/rpcs3/Emu/CPU/CPUDisAsm.h similarity index 99% rename from rpcs3/rpcs3/Emu/CPU/CPUDisAsm.h rename to rpcs3/Emu/CPU/CPUDisAsm.h index db48e33a7..06f0e9774 100644 --- a/rpcs3/rpcs3/Emu/CPU/CPUDisAsm.h +++ b/rpcs3/Emu/CPU/CPUDisAsm.h @@ -2,7 +2,7 @@ #include #include "Emu/CPU/CPUThread.h" -#include "Utilities/StrFmt.h" +#include "util/StrFmt.h" enum class cpu_disasm_mode { diff --git a/rpcs3/rpcs3/Emu/CPU/CPUThread.cpp b/rpcs3/Emu/CPU/CPUThread.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/CPU/CPUThread.cpp rename to rpcs3/Emu/CPU/CPUThread.cpp diff --git a/rpcs3/rpcs3/Emu/CPU/CPUThread.h b/rpcs3/Emu/CPU/CPUThread.h similarity index 99% rename from rpcs3/rpcs3/Emu/CPU/CPUThread.h rename to rpcs3/Emu/CPU/CPUThread.h index 4780578df..176a8f86a 100644 --- a/rpcs3/rpcs3/Emu/CPU/CPUThread.h +++ b/rpcs3/Emu/CPU/CPUThread.h @@ -1,7 +1,7 @@ #pragma once -#include "../Utilities/Thread.h" -#include "../Utilities/bit_set.h" +#include "util/Thread.h" +#include "util/bit_set.h" #include #include diff --git a/rpcs3/rpcs3/Emu/CPU/CPUTranslator.cpp b/rpcs3/Emu/CPU/CPUTranslator.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/CPU/CPUTranslator.cpp rename to rpcs3/Emu/CPU/CPUTranslator.cpp diff --git a/rpcs3/rpcs3/Emu/CPU/CPUTranslator.h b/rpcs3/Emu/CPU/CPUTranslator.h similarity index 99% rename from rpcs3/rpcs3/Emu/CPU/CPUTranslator.h rename to rpcs3/Emu/CPU/CPUTranslator.h index d129ed4fc..f7f22faab 100644 --- a/rpcs3/rpcs3/Emu/CPU/CPUTranslator.h +++ b/rpcs3/Emu/CPU/CPUTranslator.h @@ -4,8 +4,8 @@ #include "util/types.hpp" #include "util/sysinfo.hpp" -#include "Utilities/StrFmt.h" -#include "Utilities/JIT.h" +#include "util/StrFmt.h" +#include "util/JIT.h" #include "util/v128.hpp" #ifdef _MSC_VER diff --git a/rpcs3/rpcs3/Emu/CPU/Hypervisor.h b/rpcs3/Emu/CPU/Hypervisor.h similarity index 100% rename from rpcs3/rpcs3/Emu/CPU/Hypervisor.h rename to rpcs3/Emu/CPU/Hypervisor.h diff --git a/rpcs3/rpcs3/Emu/CPU/sse2neon.h b/rpcs3/Emu/CPU/sse2neon.h similarity index 100% rename from rpcs3/rpcs3/Emu/CPU/sse2neon.h rename to rpcs3/Emu/CPU/sse2neon.h diff --git a/rpcs3/rpcs3/Emu/Cell/Common.h b/rpcs3/Emu/Cell/Common.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/Common.h rename to rpcs3/Emu/Cell/Common.h diff --git a/rpcs3/rpcs3/Emu/Cell/ErrorCodes.cpp b/rpcs3/Emu/Cell/ErrorCodes.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/ErrorCodes.cpp rename to rpcs3/Emu/Cell/ErrorCodes.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/ErrorCodes.h b/rpcs3/Emu/Cell/ErrorCodes.h similarity index 99% rename from rpcs3/rpcs3/Emu/Cell/ErrorCodes.h rename to rpcs3/Emu/Cell/ErrorCodes.h index 6224b2fb3..7c3f37ec2 100644 --- a/rpcs3/rpcs3/Emu/Cell/ErrorCodes.h +++ b/rpcs3/Emu/Cell/ErrorCodes.h @@ -1,7 +1,7 @@ #pragma once #include "util/types.hpp" -#include "Utilities/StrFmt.h" +#include "util/StrFmt.h" namespace logs { diff --git a/rpcs3/rpcs3/Emu/Cell/MFC.cpp b/rpcs3/Emu/Cell/MFC.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/MFC.cpp rename to rpcs3/Emu/Cell/MFC.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/MFC.h b/rpcs3/Emu/Cell/MFC.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/MFC.h rename to rpcs3/Emu/Cell/MFC.h diff --git a/rpcs3/rpcs3/Emu/Cell/PPCDisAsm.h b/rpcs3/Emu/Cell/PPCDisAsm.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/PPCDisAsm.h rename to rpcs3/Emu/Cell/PPCDisAsm.h diff --git a/rpcs3/rpcs3/Emu/Cell/PPUAnalyser.cpp b/rpcs3/Emu/Cell/PPUAnalyser.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/PPUAnalyser.cpp rename to rpcs3/Emu/Cell/PPUAnalyser.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/PPUAnalyser.h b/rpcs3/Emu/Cell/PPUAnalyser.h similarity index 99% rename from rpcs3/rpcs3/Emu/Cell/PPUAnalyser.h rename to rpcs3/Emu/Cell/PPUAnalyser.h index e7c9f4e59..9ce0a4b17 100644 --- a/rpcs3/rpcs3/Emu/Cell/PPUAnalyser.h +++ b/rpcs3/Emu/Cell/PPUAnalyser.h @@ -8,7 +8,7 @@ #include "util/asm.hpp" #include "util/to_endian.hpp" -#include "Utilities/bit_set.h" +#include "util/bit_set.h" #include "PPUOpcodes.h" // PPU Function Attributes diff --git a/rpcs3/rpcs3/Emu/Cell/PPUCallback.h b/rpcs3/Emu/Cell/PPUCallback.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/PPUCallback.h rename to rpcs3/Emu/Cell/PPUCallback.h diff --git a/rpcs3/rpcs3/Emu/Cell/PPUDisAsm.cpp b/rpcs3/Emu/Cell/PPUDisAsm.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/PPUDisAsm.cpp rename to rpcs3/Emu/Cell/PPUDisAsm.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/PPUDisAsm.h b/rpcs3/Emu/Cell/PPUDisAsm.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/PPUDisAsm.h rename to rpcs3/Emu/Cell/PPUDisAsm.h diff --git a/rpcs3/rpcs3/Emu/Cell/PPUFunction.cpp b/rpcs3/Emu/Cell/PPUFunction.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/Cell/PPUFunction.cpp rename to rpcs3/Emu/Cell/PPUFunction.cpp index 45cac3b40..df7eaa76f 100644 --- a/rpcs3/rpcs3/Emu/Cell/PPUFunction.cpp +++ b/rpcs3/Emu/Cell/PPUFunction.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "PPUFunction.h" -#include "Utilities/JIT.h" +#include "util/JIT.h" #include "util/serialization.hpp" #include "PPUModule.h" diff --git a/rpcs3/rpcs3/Emu/Cell/PPUFunction.h b/rpcs3/Emu/Cell/PPUFunction.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/PPUFunction.h rename to rpcs3/Emu/Cell/PPUFunction.h diff --git a/rpcs3/rpcs3/Emu/Cell/PPUInterpreter.cpp b/rpcs3/Emu/Cell/PPUInterpreter.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/Cell/PPUInterpreter.cpp rename to rpcs3/Emu/Cell/PPUInterpreter.cpp index c3f301f4f..77b7fd785 100644 --- a/rpcs3/rpcs3/Emu/Cell/PPUInterpreter.cpp +++ b/rpcs3/Emu/Cell/PPUInterpreter.cpp @@ -18,7 +18,7 @@ #include "util/v128.hpp" #include "util/simd.hpp" #include "util/sysinfo.hpp" -#include "Utilities/JIT.h" +#include "util/JIT.h" #if !defined(_MSC_VER) #pragma GCC diagnostic push diff --git a/rpcs3/rpcs3/Emu/Cell/PPUInterpreter.h b/rpcs3/Emu/Cell/PPUInterpreter.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/PPUInterpreter.h rename to rpcs3/Emu/Cell/PPUInterpreter.h diff --git a/rpcs3/rpcs3/Emu/Cell/PPUModule.cpp b/rpcs3/Emu/Cell/PPUModule.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/Cell/PPUModule.cpp rename to rpcs3/Emu/Cell/PPUModule.cpp index 6f5055db8..05e5a1a5e 100644 --- a/rpcs3/rpcs3/Emu/Cell/PPUModule.cpp +++ b/rpcs3/Emu/Cell/PPUModule.cpp @@ -1,9 +1,9 @@ #include "stdafx.h" #include "Emu/Cell/PPUModule.h" -#include "Utilities/bin_patch.h" -#include "Utilities/StrUtil.h" -#include "Utilities/address_range.h" +#include "util/bin_patch.h" +#include "util/StrUtil.h" +#include "util/address_range.h" #include "util/serialization.hpp" #include "Crypto/sha1.h" #include "Crypto/unself.h" @@ -22,7 +22,7 @@ #include "Emu/Cell/lv2/sys_memory.h" #include "Emu/Cell/lv2/sys_overlay.h" -#include "Emu/Cell/Modules/StaticHLE.h" +#include "rpcsx/fw/ps3/StaticHLE.h" #include #include diff --git a/rpcs3/rpcs3/Emu/Cell/PPUModule.h b/rpcs3/Emu/Cell/PPUModule.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/PPUModule.h rename to rpcs3/Emu/Cell/PPUModule.h diff --git a/rpcs3/rpcs3/Emu/Cell/PPUOpcodes.h b/rpcs3/Emu/Cell/PPUOpcodes.h similarity index 99% rename from rpcs3/rpcs3/Emu/Cell/PPUOpcodes.h rename to rpcs3/Emu/Cell/PPUOpcodes.h index 8fbbcdcb0..9e2571928 100644 --- a/rpcs3/rpcs3/Emu/Cell/PPUOpcodes.h +++ b/rpcs3/Emu/Cell/PPUOpcodes.h @@ -1,6 +1,6 @@ #pragma once -#include "Utilities/BitField.h" +#include "util/BitField.h" template using ppu_bf_t = bf_t; diff --git a/rpcs3/rpcs3/Emu/Cell/PPUThread.cpp b/rpcs3/Emu/Cell/PPUThread.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/Cell/PPUThread.cpp rename to rpcs3/Emu/Cell/PPUThread.cpp index 9286823d5..bb3e7bb8d 100644 --- a/rpcs3/rpcs3/Emu/Cell/PPUThread.cpp +++ b/rpcs3/Emu/Cell/PPUThread.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" -#include "Utilities/JIT.h" -#include "Utilities/StrUtil.h" +#include "util/JIT.h" +#include "util/StrUtil.h" #include "util/serialization.hpp" #include "Crypto/sha1.h" #include "Crypto/unself.h" @@ -65,7 +65,7 @@ #include "util/simd.hpp" #include "util/sysinfo.hpp" -#include "Utilities/sema.h" +#include "util/sema.h" #ifdef __APPLE__ #include diff --git a/rpcs3/rpcs3/Emu/Cell/PPUThread.h b/rpcs3/Emu/Cell/PPUThread.h similarity index 99% rename from rpcs3/rpcs3/Emu/Cell/PPUThread.h rename to rpcs3/Emu/Cell/PPUThread.h index bd4928c82..83c30a7b1 100644 --- a/rpcs3/rpcs3/Emu/Cell/PPUThread.h +++ b/rpcs3/Emu/Cell/PPUThread.h @@ -3,8 +3,8 @@ #include "../CPU/CPUThread.h" #include "../CPU/Hypervisor.h" #include "../Memory/vm_ptr.h" -#include "Utilities/lockless.h" -#include "Utilities/BitField.h" +#include "util/lockless.h" +#include "util/BitField.h" #include "util/logs.hpp" #include "util/v128.hpp" diff --git a/rpcs3/rpcs3/Emu/Cell/PPUTranslator.cpp b/rpcs3/Emu/Cell/PPUTranslator.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/Cell/PPUTranslator.cpp rename to rpcs3/Emu/Cell/PPUTranslator.cpp index 18620d477..46d28c14e 100644 --- a/rpcs3/rpcs3/Emu/Cell/PPUTranslator.cpp +++ b/rpcs3/Emu/Cell/PPUTranslator.cpp @@ -19,7 +19,7 @@ #ifdef ARCH_ARM64 #include "Emu/CPU/Backends/AArch64/AArch64JIT.h" #include "Emu/IdManager.h" -#include "Utilities/ppu_patch.h" +#include "util/ppu_patch.h" #endif using namespace llvm; diff --git a/rpcs3/rpcs3/Emu/Cell/PPUTranslator.h b/rpcs3/Emu/Cell/PPUTranslator.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/PPUTranslator.h rename to rpcs3/Emu/Cell/PPUTranslator.h diff --git a/rpcs3/rpcs3/Emu/Cell/RawSPUThread.cpp b/rpcs3/Emu/Cell/RawSPUThread.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/RawSPUThread.cpp rename to rpcs3/Emu/Cell/RawSPUThread.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/RawSPUThread.h b/rpcs3/Emu/Cell/RawSPUThread.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/RawSPUThread.h rename to rpcs3/Emu/Cell/RawSPUThread.h diff --git a/rpcs3/rpcs3/Emu/Cell/SPUASMJITRecompiler.cpp b/rpcs3/Emu/Cell/SPUASMJITRecompiler.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/SPUASMJITRecompiler.cpp rename to rpcs3/Emu/Cell/SPUASMJITRecompiler.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/SPUASMJITRecompiler.h b/rpcs3/Emu/Cell/SPUASMJITRecompiler.h similarity index 99% rename from rpcs3/rpcs3/Emu/Cell/SPUASMJITRecompiler.h rename to rpcs3/Emu/Cell/SPUASMJITRecompiler.h index 36c238f23..622ce7f6d 100644 --- a/rpcs3/rpcs3/Emu/Cell/SPUASMJITRecompiler.h +++ b/rpcs3/Emu/Cell/SPUASMJITRecompiler.h @@ -1,6 +1,6 @@ #pragma once -#include "Utilities/JIT.h" +#include "util/JIT.h" #include "SPURecompiler.h" #include diff --git a/rpcs3/rpcs3/Emu/Cell/SPUAnalyser.cpp b/rpcs3/Emu/Cell/SPUAnalyser.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/SPUAnalyser.cpp rename to rpcs3/Emu/Cell/SPUAnalyser.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/SPUAnalyser.h b/rpcs3/Emu/Cell/SPUAnalyser.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/SPUAnalyser.h rename to rpcs3/Emu/Cell/SPUAnalyser.h diff --git a/rpcs3/rpcs3/Emu/Cell/SPUCommonRecompiler.cpp b/rpcs3/Emu/Cell/SPUCommonRecompiler.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/Cell/SPUCommonRecompiler.cpp rename to rpcs3/Emu/Cell/SPUCommonRecompiler.cpp index c9c2a297a..74ae4055a 100644 --- a/rpcs3/rpcs3/Emu/Cell/SPUCommonRecompiler.cpp +++ b/rpcs3/Emu/Cell/SPUCommonRecompiler.cpp @@ -9,12 +9,12 @@ #include "Emu/IdManager.h" #include "Emu/localized_string.h" #include "Crypto/sha1.h" -#include "Utilities/StrUtil.h" -#include "Utilities/JIT.h" +#include "util/StrUtil.h" +#include "util/JIT.h" #include "util/init_mutex.hpp" #include "util/shared_ptr.hpp" -#include "Emu/Cell/Modules/cellSync.h" +#include "rpcsx/fw/ps3/cellSync.h" #include "SPUThread.h" #include "SPUAnalyser.h" diff --git a/rpcs3/rpcs3/Emu/Cell/SPUDisAsm.cpp b/rpcs3/Emu/Cell/SPUDisAsm.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/SPUDisAsm.cpp rename to rpcs3/Emu/Cell/SPUDisAsm.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/SPUDisAsm.h b/rpcs3/Emu/Cell/SPUDisAsm.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/SPUDisAsm.h rename to rpcs3/Emu/Cell/SPUDisAsm.h diff --git a/rpcs3/rpcs3/Emu/Cell/SPUInterpreter.cpp b/rpcs3/Emu/Cell/SPUInterpreter.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/Cell/SPUInterpreter.cpp rename to rpcs3/Emu/Cell/SPUInterpreter.cpp index 1f242a75d..537196b88 100644 --- a/rpcs3/rpcs3/Emu/Cell/SPUInterpreter.cpp +++ b/rpcs3/Emu/Cell/SPUInterpreter.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "SPUInterpreter.h" -#include "Utilities/JIT.h" +#include "util/JIT.h" #include "SPUThread.h" #include "Emu/Cell/SPUAnalyser.h" #include "Emu/system_config.h" diff --git a/rpcs3/rpcs3/Emu/Cell/SPUInterpreter.h b/rpcs3/Emu/Cell/SPUInterpreter.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/SPUInterpreter.h rename to rpcs3/Emu/Cell/SPUInterpreter.h diff --git a/rpcs3/rpcs3/Emu/Cell/SPULLVMRecompiler.cpp b/rpcs3/Emu/Cell/SPULLVMRecompiler.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/Cell/SPULLVMRecompiler.cpp rename to rpcs3/Emu/Cell/SPULLVMRecompiler.cpp index 26cd703fa..eb92feb68 100644 --- a/rpcs3/rpcs3/Emu/Cell/SPULLVMRecompiler.cpp +++ b/rpcs3/Emu/Cell/SPULLVMRecompiler.cpp @@ -9,7 +9,7 @@ #include "Emu/Memory/vm_reservation.h" #include "Emu/RSX/Core/RSXReservationLock.hpp" #include "Crypto/sha1.h" -#include "Utilities/JIT.h" +#include "util/JIT.h" #include "SPUThread.h" #include "SPUAnalyser.h" diff --git a/rpcs3/rpcs3/Emu/Cell/SPUOpcodes.h b/rpcs3/Emu/Cell/SPUOpcodes.h similarity index 99% rename from rpcs3/rpcs3/Emu/Cell/SPUOpcodes.h rename to rpcs3/Emu/Cell/SPUOpcodes.h index 5a9d0a0ff..b8c895150 100644 --- a/rpcs3/rpcs3/Emu/Cell/SPUOpcodes.h +++ b/rpcs3/Emu/Cell/SPUOpcodes.h @@ -1,6 +1,6 @@ #pragma once -#include "Utilities/BitField.h" +#include "util/BitField.h" union spu_opcode_t { diff --git a/rpcs3/rpcs3/Emu/Cell/SPURecompiler.h b/rpcs3/Emu/Cell/SPURecompiler.h similarity index 99% rename from rpcs3/rpcs3/Emu/Cell/SPURecompiler.h rename to rpcs3/Emu/Cell/SPURecompiler.h index 0b67d9258..f1d205262 100644 --- a/rpcs3/rpcs3/Emu/Cell/SPURecompiler.h +++ b/rpcs3/Emu/Cell/SPURecompiler.h @@ -1,8 +1,8 @@ #pragma once -#include "Utilities/File.h" -#include "Utilities/lockless.h" -#include "Utilities/address_range.h" +#include "util/File.h" +#include "util/lockless.h" +#include "util/address_range.h" #include "SPUThread.h" #include #include diff --git a/rpcs3/rpcs3/Emu/Cell/SPUThread.cpp b/rpcs3/Emu/Cell/SPUThread.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/Cell/SPUThread.cpp rename to rpcs3/Emu/Cell/SPUThread.cpp index 4a675a10e..27f1434dc 100644 --- a/rpcs3/rpcs3/Emu/Cell/SPUThread.cpp +++ b/rpcs3/Emu/Cell/SPUThread.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" -#include "Utilities/JIT.h" -#include "Utilities/date_time.h" +#include "util/JIT.h" +#include "util/date_time.h" #include "Emu/Memory/vm.h" #include "Emu/Memory/vm_ptr.h" #include "Emu/Memory/vm_reservation.h" diff --git a/rpcs3/rpcs3/Emu/Cell/SPUThread.h b/rpcs3/Emu/Cell/SPUThread.h similarity index 99% rename from rpcs3/rpcs3/Emu/Cell/SPUThread.h rename to rpcs3/Emu/Cell/SPUThread.h index 9f0b8a93c..4c6255610 100644 --- a/rpcs3/rpcs3/Emu/Cell/SPUThread.h +++ b/rpcs3/Emu/Cell/SPUThread.h @@ -10,7 +10,7 @@ #include "util/logs.hpp" #include "util/to_endian.hpp" -#include "Utilities/mutex.h" +#include "util/mutex.h" #include "Loader/ELF.h" diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/lv2.cpp b/rpcs3/Emu/Cell/lv2/lv2.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/lv2.cpp rename to rpcs3/Emu/Cell/lv2/lv2.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_bdemu.cpp b/rpcs3/Emu/Cell/lv2/sys_bdemu.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_bdemu.cpp rename to rpcs3/Emu/Cell/lv2/sys_bdemu.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_bdemu.h b/rpcs3/Emu/Cell/lv2/sys_bdemu.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_bdemu.h rename to rpcs3/Emu/Cell/lv2/sys_bdemu.h diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_btsetting.cpp b/rpcs3/Emu/Cell/lv2/sys_btsetting.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_btsetting.cpp rename to rpcs3/Emu/Cell/lv2/sys_btsetting.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_btsetting.h b/rpcs3/Emu/Cell/lv2/sys_btsetting.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_btsetting.h rename to rpcs3/Emu/Cell/lv2/sys_btsetting.h diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_cond.cpp b/rpcs3/Emu/Cell/lv2/sys_cond.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_cond.cpp rename to rpcs3/Emu/Cell/lv2/sys_cond.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_cond.h b/rpcs3/Emu/Cell/lv2/sys_cond.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_cond.h rename to rpcs3/Emu/Cell/lv2/sys_cond.h diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_config.cpp b/rpcs3/Emu/Cell/lv2/sys_config.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_config.cpp rename to rpcs3/Emu/Cell/lv2/sys_config.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_config.h b/rpcs3/Emu/Cell/lv2/sys_config.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_config.h rename to rpcs3/Emu/Cell/lv2/sys_config.h diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_console.cpp b/rpcs3/Emu/Cell/lv2/sys_console.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_console.cpp rename to rpcs3/Emu/Cell/lv2/sys_console.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_console.h b/rpcs3/Emu/Cell/lv2/sys_console.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_console.h rename to rpcs3/Emu/Cell/lv2/sys_console.h diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_crypto_engine.cpp b/rpcs3/Emu/Cell/lv2/sys_crypto_engine.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_crypto_engine.cpp rename to rpcs3/Emu/Cell/lv2/sys_crypto_engine.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_crypto_engine.h b/rpcs3/Emu/Cell/lv2/sys_crypto_engine.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_crypto_engine.h rename to rpcs3/Emu/Cell/lv2/sys_crypto_engine.h diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_dbg.cpp b/rpcs3/Emu/Cell/lv2/sys_dbg.cpp similarity index 98% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_dbg.cpp rename to rpcs3/Emu/Cell/lv2/sys_dbg.cpp index 27fa51b14..0c0dd4e38 100644 --- a/rpcs3/rpcs3/Emu/Cell/lv2/sys_dbg.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_dbg.cpp @@ -4,7 +4,7 @@ #include "Emu/Cell/ErrorCodes.h" #include "Emu/Cell/PPUInterpreter.h" -#include "Emu/Cell/Modules/sys_lv2dbg.h" +#include "rpcsx/fw/ps3/sys_lv2dbg.h" #include "Emu/Memory/vm_locking.h" #include "util/asm.hpp" diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_dbg.h b/rpcs3/Emu/Cell/lv2/sys_dbg.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_dbg.h rename to rpcs3/Emu/Cell/lv2/sys_dbg.h diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_event.cpp b/rpcs3/Emu/Cell/lv2/sys_event.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_event.cpp rename to rpcs3/Emu/Cell/lv2/sys_event.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_event.h b/rpcs3/Emu/Cell/lv2/sys_event.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_event.h rename to rpcs3/Emu/Cell/lv2/sys_event.h diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_event_flag.cpp b/rpcs3/Emu/Cell/lv2/sys_event_flag.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_event_flag.cpp rename to rpcs3/Emu/Cell/lv2/sys_event_flag.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_event_flag.h b/rpcs3/Emu/Cell/lv2/sys_event_flag.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_event_flag.h rename to rpcs3/Emu/Cell/lv2/sys_event_flag.h diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_fs.cpp b/rpcs3/Emu/Cell/lv2/sys_fs.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_fs.cpp rename to rpcs3/Emu/Cell/lv2/sys_fs.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_fs.h b/rpcs3/Emu/Cell/lv2/sys_fs.h similarity index 99% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_fs.h rename to rpcs3/Emu/Cell/lv2/sys_fs.h index 8f0156baf..9acf7fa18 100644 --- a/rpcs3/rpcs3/Emu/Cell/lv2/sys_fs.h +++ b/rpcs3/Emu/Cell/lv2/sys_fs.h @@ -2,8 +2,9 @@ #include "Emu/Memory/vm_ptr.h" #include "Emu/Cell/ErrorCodes.h" -#include "Utilities/File.h" -#include "Utilities/StrUtil.h" +#include "util/File.h" +#include "util/StrUtil.h" +#include "util/mutex.h" #include diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_game.cpp b/rpcs3/Emu/Cell/lv2/sys_game.cpp similarity index 98% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_game.cpp rename to rpcs3/Emu/Cell/lv2/sys_game.cpp index 61093a383..0bd23e0c7 100644 --- a/rpcs3/rpcs3/Emu/Cell/lv2/sys_game.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_game.cpp @@ -7,8 +7,8 @@ #include "Emu/System.h" #include "Emu/system_utils.hpp" #include "Emu/IdManager.h" -#include "Utilities/StrUtil.h" -#include "Utilities/Thread.h" +#include "util/StrUtil.h" +#include "util/Thread.h" #include "Emu/Cell/timers.hpp" #include "sys_game.h" diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_game.h b/rpcs3/Emu/Cell/lv2/sys_game.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_game.h rename to rpcs3/Emu/Cell/lv2/sys_game.h diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_gamepad.cpp b/rpcs3/Emu/Cell/lv2/sys_gamepad.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_gamepad.cpp rename to rpcs3/Emu/Cell/lv2/sys_gamepad.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_gamepad.h b/rpcs3/Emu/Cell/lv2/sys_gamepad.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_gamepad.h rename to rpcs3/Emu/Cell/lv2/sys_gamepad.h diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_gpio.cpp b/rpcs3/Emu/Cell/lv2/sys_gpio.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_gpio.cpp rename to rpcs3/Emu/Cell/lv2/sys_gpio.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_gpio.h b/rpcs3/Emu/Cell/lv2/sys_gpio.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_gpio.h rename to rpcs3/Emu/Cell/lv2/sys_gpio.h diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_hid.cpp b/rpcs3/Emu/Cell/lv2/sys_hid.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_hid.cpp rename to rpcs3/Emu/Cell/lv2/sys_hid.cpp index ef932b614..1cf90c7a5 100644 --- a/rpcs3/rpcs3/Emu/Cell/lv2/sys_hid.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_hid.cpp @@ -5,7 +5,7 @@ #include "Emu/Cell/PPUThread.h" #include "Emu/Cell/ErrorCodes.h" -#include "Emu/Cell/Modules/cellPad.h" +#include "rpcsx/fw/ps3/cellPad.h" #include "sys_process.h" diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_hid.h b/rpcs3/Emu/Cell/lv2/sys_hid.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_hid.h rename to rpcs3/Emu/Cell/lv2/sys_hid.h diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_interrupt.cpp b/rpcs3/Emu/Cell/lv2/sys_interrupt.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_interrupt.cpp rename to rpcs3/Emu/Cell/lv2/sys_interrupt.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_interrupt.h b/rpcs3/Emu/Cell/lv2/sys_interrupt.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_interrupt.h rename to rpcs3/Emu/Cell/lv2/sys_interrupt.h diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_io.cpp b/rpcs3/Emu/Cell/lv2/sys_io.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_io.cpp rename to rpcs3/Emu/Cell/lv2/sys_io.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_io.h b/rpcs3/Emu/Cell/lv2/sys_io.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_io.h rename to rpcs3/Emu/Cell/lv2/sys_io.h diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_lwcond.cpp b/rpcs3/Emu/Cell/lv2/sys_lwcond.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_lwcond.cpp rename to rpcs3/Emu/Cell/lv2/sys_lwcond.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_lwcond.h b/rpcs3/Emu/Cell/lv2/sys_lwcond.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_lwcond.h rename to rpcs3/Emu/Cell/lv2/sys_lwcond.h diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_lwmutex.cpp b/rpcs3/Emu/Cell/lv2/sys_lwmutex.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_lwmutex.cpp rename to rpcs3/Emu/Cell/lv2/sys_lwmutex.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_lwmutex.h b/rpcs3/Emu/Cell/lv2/sys_lwmutex.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_lwmutex.h rename to rpcs3/Emu/Cell/lv2/sys_lwmutex.h diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_memory.cpp b/rpcs3/Emu/Cell/lv2/sys_memory.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_memory.cpp rename to rpcs3/Emu/Cell/lv2/sys_memory.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_memory.h b/rpcs3/Emu/Cell/lv2/sys_memory.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_memory.h rename to rpcs3/Emu/Cell/lv2/sys_memory.h diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_mmapper.cpp b/rpcs3/Emu/Cell/lv2/sys_mmapper.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_mmapper.cpp rename to rpcs3/Emu/Cell/lv2/sys_mmapper.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_mmapper.h b/rpcs3/Emu/Cell/lv2/sys_mmapper.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_mmapper.h rename to rpcs3/Emu/Cell/lv2/sys_mmapper.h diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_mutex.cpp b/rpcs3/Emu/Cell/lv2/sys_mutex.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_mutex.cpp rename to rpcs3/Emu/Cell/lv2/sys_mutex.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_mutex.h b/rpcs3/Emu/Cell/lv2/sys_mutex.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_mutex.h rename to rpcs3/Emu/Cell/lv2/sys_mutex.h diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_net.cpp b/rpcs3/Emu/Cell/lv2/sys_net.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_net.cpp rename to rpcs3/Emu/Cell/lv2/sys_net.cpp index 1b5be6482..d790e2f5f 100644 --- a/rpcs3/rpcs3/Emu/Cell/lv2/sys_net.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_net.cpp @@ -3,7 +3,7 @@ #include "Emu/IdManager.h" #include "Emu/Cell/PPUThread.h" -#include "Utilities/Thread.h" +#include "util/Thread.h" #include "sys_sync.h" diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_net.h b/rpcs3/Emu/Cell/lv2/sys_net.h similarity index 99% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_net.h rename to rpcs3/Emu/Cell/lv2/sys_net.h index d9577a0ac..f0d5dd99a 100644 --- a/rpcs3/rpcs3/Emu/Cell/lv2/sys_net.h +++ b/rpcs3/Emu/Cell/lv2/sys_net.h @@ -1,7 +1,7 @@ #pragma once -#include "Utilities/bit_set.h" -#include "Utilities/mutex.h" +#include "util/bit_set.h" +#include "util/mutex.h" #include "Emu/Memory/vm_ptr.h" #include "Emu/Cell/ErrorCodes.h" diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_net/lv2_socket.cpp b/rpcs3/Emu/Cell/lv2/sys_net/lv2_socket.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_net/lv2_socket.cpp rename to rpcs3/Emu/Cell/lv2/sys_net/lv2_socket.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_net/lv2_socket.h b/rpcs3/Emu/Cell/lv2/sys_net/lv2_socket.h similarity index 99% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_net/lv2_socket.h rename to rpcs3/Emu/Cell/lv2/sys_net/lv2_socket.h index 48f14182c..d31be953a 100644 --- a/rpcs3/rpcs3/Emu/Cell/lv2/sys_net/lv2_socket.h +++ b/rpcs3/Emu/Cell/lv2/sys_net/lv2_socket.h @@ -3,7 +3,7 @@ #include #include -#include "Utilities/mutex.h" +#include "util/mutex.h" #include "Emu/IdManager.h" #include "Emu/Cell/lv2/sys_net.h" #include "Emu/NP/ip_address.h" diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_net/lv2_socket_native.cpp b/rpcs3/Emu/Cell/lv2/sys_net/lv2_socket_native.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_net/lv2_socket_native.cpp rename to rpcs3/Emu/Cell/lv2/sys_net/lv2_socket_native.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_net/lv2_socket_native.h b/rpcs3/Emu/Cell/lv2/sys_net/lv2_socket_native.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_net/lv2_socket_native.h rename to rpcs3/Emu/Cell/lv2/sys_net/lv2_socket_native.h diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_net/lv2_socket_p2p.cpp b/rpcs3/Emu/Cell/lv2/sys_net/lv2_socket_p2p.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_net/lv2_socket_p2p.cpp rename to rpcs3/Emu/Cell/lv2/sys_net/lv2_socket_p2p.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_net/lv2_socket_p2p.h b/rpcs3/Emu/Cell/lv2/sys_net/lv2_socket_p2p.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_net/lv2_socket_p2p.h rename to rpcs3/Emu/Cell/lv2/sys_net/lv2_socket_p2p.h diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_net/lv2_socket_p2ps.cpp b/rpcs3/Emu/Cell/lv2/sys_net/lv2_socket_p2ps.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_net/lv2_socket_p2ps.cpp rename to rpcs3/Emu/Cell/lv2/sys_net/lv2_socket_p2ps.cpp index 31676477c..f199ab079 100644 --- a/rpcs3/rpcs3/Emu/Cell/lv2/sys_net/lv2_socket_p2ps.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_net/lv2_socket_p2ps.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" -#include "Utilities/Thread.h" +#include "util/Thread.h" #include "util/atomic.hpp" #include "lv2_socket_p2ps.h" #include "Emu/NP/np_helpers.h" diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_net/lv2_socket_p2ps.h b/rpcs3/Emu/Cell/lv2/sys_net/lv2_socket_p2ps.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_net/lv2_socket_p2ps.h rename to rpcs3/Emu/Cell/lv2/sys_net/lv2_socket_p2ps.h diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_net/lv2_socket_raw.cpp b/rpcs3/Emu/Cell/lv2/sys_net/lv2_socket_raw.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_net/lv2_socket_raw.cpp rename to rpcs3/Emu/Cell/lv2/sys_net/lv2_socket_raw.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_net/lv2_socket_raw.h b/rpcs3/Emu/Cell/lv2/sys_net/lv2_socket_raw.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_net/lv2_socket_raw.h rename to rpcs3/Emu/Cell/lv2/sys_net/lv2_socket_raw.h diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_net/network_context.cpp b/rpcs3/Emu/Cell/lv2/sys_net/network_context.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_net/network_context.cpp rename to rpcs3/Emu/Cell/lv2/sys_net/network_context.cpp index 61bd5a404..6f754c9a9 100644 --- a/rpcs3/rpcs3/Emu/Cell/lv2/sys_net/network_context.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_net/network_context.cpp @@ -1,7 +1,7 @@ -#include "Emu/NP/ip_address.h" #include "stdafx.h" +#include "Emu/NP/ip_address.h" #include "Emu/Cell/lv2/sys_sync.h" -#include "Emu/Cell/Modules/sceNp.h" // for SCE_NP_PORT +#include "rpcsx/fw/ps3/sceNp.h" // for SCE_NP_PORT #include "network_context.h" #include "sys_net_helpers.h" diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_net/network_context.h b/rpcs3/Emu/Cell/lv2/sys_net/network_context.h similarity index 96% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_net/network_context.h rename to rpcs3/Emu/Cell/lv2/sys_net/network_context.h index 658196c4b..bfff69fa2 100644 --- a/rpcs3/rpcs3/Emu/Cell/lv2/sys_net/network_context.h +++ b/rpcs3/Emu/Cell/lv2/sys_net/network_context.h @@ -2,7 +2,7 @@ #include #include -#include "Utilities/mutex.h" +#include "util/mutex.h" #include "Emu/Cell/PPUThread.h" #include "nt_p2p_port.h" diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_net/nt_p2p_port.cpp b/rpcs3/Emu/Cell/lv2/sys_net/nt_p2p_port.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_net/nt_p2p_port.cpp rename to rpcs3/Emu/Cell/lv2/sys_net/nt_p2p_port.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_net/nt_p2p_port.h b/rpcs3/Emu/Cell/lv2/sys_net/nt_p2p_port.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_net/nt_p2p_port.h rename to rpcs3/Emu/Cell/lv2/sys_net/nt_p2p_port.h diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_net/sys_net_helpers.cpp b/rpcs3/Emu/Cell/lv2/sys_net/sys_net_helpers.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_net/sys_net_helpers.cpp rename to rpcs3/Emu/Cell/lv2/sys_net/sys_net_helpers.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_net/sys_net_helpers.h b/rpcs3/Emu/Cell/lv2/sys_net/sys_net_helpers.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_net/sys_net_helpers.h rename to rpcs3/Emu/Cell/lv2/sys_net/sys_net_helpers.h diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_overlay.cpp b/rpcs3/Emu/Cell/lv2/sys_overlay.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_overlay.cpp rename to rpcs3/Emu/Cell/lv2/sys_overlay.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_overlay.h b/rpcs3/Emu/Cell/lv2/sys_overlay.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_overlay.h rename to rpcs3/Emu/Cell/lv2/sys_overlay.h diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_ppu_thread.cpp b/rpcs3/Emu/Cell/lv2/sys_ppu_thread.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_ppu_thread.cpp rename to rpcs3/Emu/Cell/lv2/sys_ppu_thread.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_ppu_thread.h b/rpcs3/Emu/Cell/lv2/sys_ppu_thread.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_ppu_thread.h rename to rpcs3/Emu/Cell/lv2/sys_ppu_thread.h diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_process.cpp b/rpcs3/Emu/Cell/lv2/sys_process.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_process.cpp rename to rpcs3/Emu/Cell/lv2/sys_process.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_process.h b/rpcs3/Emu/Cell/lv2/sys_process.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_process.h rename to rpcs3/Emu/Cell/lv2/sys_process.h diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_prx.cpp b/rpcs3/Emu/Cell/lv2/sys_prx.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_prx.cpp rename to rpcs3/Emu/Cell/lv2/sys_prx.cpp index 0cf82ec7b..15e7ea982 100644 --- a/rpcs3/rpcs3/Emu/Cell/lv2/sys_prx.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_prx.cpp @@ -11,7 +11,7 @@ #include "Emu/Cell/PPUThread.h" #include "Emu/Cell/ErrorCodes.h" #include "Crypto/unedat.h" -#include "Utilities/StrUtil.h" +#include "util/StrUtil.h" #include "sys_fs.h" #include "sys_process.h" #include "sys_memory.h" diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_prx.h b/rpcs3/Emu/Cell/lv2/sys_prx.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_prx.h rename to rpcs3/Emu/Cell/lv2/sys_prx.h diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_rsx.cpp b/rpcs3/Emu/Cell/lv2/sys_rsx.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_rsx.cpp rename to rpcs3/Emu/Cell/lv2/sys_rsx.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_rsx.h b/rpcs3/Emu/Cell/lv2/sys_rsx.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_rsx.h rename to rpcs3/Emu/Cell/lv2/sys_rsx.h diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_rsxaudio.cpp b/rpcs3/Emu/Cell/lv2/sys_rsxaudio.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_rsxaudio.cpp rename to rpcs3/Emu/Cell/lv2/sys_rsxaudio.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_rsxaudio.h b/rpcs3/Emu/Cell/lv2/sys_rsxaudio.h similarity index 99% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_rsxaudio.h rename to rpcs3/Emu/Cell/lv2/sys_rsxaudio.h index 91f2cdcfd..766817409 100644 --- a/rpcs3/rpcs3/Emu/Cell/lv2/sys_rsxaudio.h +++ b/rpcs3/Emu/Cell/lv2/sys_rsxaudio.h @@ -2,9 +2,9 @@ #include "sys_sync.h" #include "sys_event.h" -#include "Utilities/simple_ringbuf.h" -#include "Utilities/transactional_storage.h" -#include "Utilities/cond.h" +#include "util/simple_ringbuf.h" +#include "util/transactional_storage.h" +#include "util/cond.h" #include "Emu/system_config_types.h" #include "Emu/Memory/vm_ptr.h" #include "Emu/Cell/ErrorCodes.h" diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_rwlock.cpp b/rpcs3/Emu/Cell/lv2/sys_rwlock.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_rwlock.cpp rename to rpcs3/Emu/Cell/lv2/sys_rwlock.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_rwlock.h b/rpcs3/Emu/Cell/lv2/sys_rwlock.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_rwlock.h rename to rpcs3/Emu/Cell/lv2/sys_rwlock.h diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_semaphore.cpp b/rpcs3/Emu/Cell/lv2/sys_semaphore.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_semaphore.cpp rename to rpcs3/Emu/Cell/lv2/sys_semaphore.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_semaphore.h b/rpcs3/Emu/Cell/lv2/sys_semaphore.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_semaphore.h rename to rpcs3/Emu/Cell/lv2/sys_semaphore.h diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_sm.cpp b/rpcs3/Emu/Cell/lv2/sys_sm.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_sm.cpp rename to rpcs3/Emu/Cell/lv2/sys_sm.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_sm.h b/rpcs3/Emu/Cell/lv2/sys_sm.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_sm.h rename to rpcs3/Emu/Cell/lv2/sys_sm.h diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_spu.cpp b/rpcs3/Emu/Cell/lv2/sys_spu.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_spu.cpp rename to rpcs3/Emu/Cell/lv2/sys_spu.cpp index 074af2795..addb39876 100644 --- a/rpcs3/rpcs3/Emu/Cell/lv2/sys_spu.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_spu.cpp @@ -7,7 +7,7 @@ #include "Crypto/unedat.h" #include "Crypto/sha1.h" #include "Loader/ELF.h" -#include "Utilities/bin_patch.h" +#include "util/bin_patch.h" #include "Emu/Cell/ErrorCodes.h" #include "Emu/Cell/PPUThread.h" diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_spu.h b/rpcs3/Emu/Cell/lv2/sys_spu.h similarity index 99% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_spu.h rename to rpcs3/Emu/Cell/lv2/sys_spu.h index bf4e86b67..c72b99de2 100644 --- a/rpcs3/rpcs3/Emu/Cell/lv2/sys_spu.h +++ b/rpcs3/Emu/Cell/lv2/sys_spu.h @@ -6,7 +6,7 @@ #include "Emu/Cell/ErrorCodes.h" #include "Emu/Memory/vm_ptr.h" -#include "Utilities/File.h" +#include "util/File.h" #include diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_ss.cpp b/rpcs3/Emu/Cell/lv2/sys_ss.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_ss.cpp rename to rpcs3/Emu/Cell/lv2/sys_ss.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_ss.h b/rpcs3/Emu/Cell/lv2/sys_ss.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_ss.h rename to rpcs3/Emu/Cell/lv2/sys_ss.h diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_storage.cpp b/rpcs3/Emu/Cell/lv2/sys_storage.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_storage.cpp rename to rpcs3/Emu/Cell/lv2/sys_storage.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_storage.h b/rpcs3/Emu/Cell/lv2/sys_storage.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_storage.h rename to rpcs3/Emu/Cell/lv2/sys_storage.h diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_sync.h b/rpcs3/Emu/Cell/lv2/sys_sync.h similarity index 99% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_sync.h rename to rpcs3/Emu/Cell/lv2/sys_sync.h index d13bf7754..e1495ba3e 100644 --- a/rpcs3/rpcs3/Emu/Cell/lv2/sys_sync.h +++ b/rpcs3/Emu/Cell/lv2/sys_sync.h @@ -1,6 +1,6 @@ #pragma once -#include "Utilities/mutex.h" +#include "util/mutex.h" #include "Emu/CPU/CPUThread.h" #include "Emu/Cell/ErrorCodes.h" diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_time.cpp b/rpcs3/Emu/Cell/lv2/sys_time.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_time.cpp rename to rpcs3/Emu/Cell/lv2/sys_time.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_time.h b/rpcs3/Emu/Cell/lv2/sys_time.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_time.h rename to rpcs3/Emu/Cell/lv2/sys_time.h diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_timer.cpp b/rpcs3/Emu/Cell/lv2/sys_timer.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_timer.cpp rename to rpcs3/Emu/Cell/lv2/sys_timer.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_timer.h b/rpcs3/Emu/Cell/lv2/sys_timer.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_timer.h rename to rpcs3/Emu/Cell/lv2/sys_timer.h diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_trace.cpp b/rpcs3/Emu/Cell/lv2/sys_trace.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_trace.cpp rename to rpcs3/Emu/Cell/lv2/sys_trace.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_trace.h b/rpcs3/Emu/Cell/lv2/sys_trace.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_trace.h rename to rpcs3/Emu/Cell/lv2/sys_trace.h diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_tty.cpp b/rpcs3/Emu/Cell/lv2/sys_tty.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_tty.cpp rename to rpcs3/Emu/Cell/lv2/sys_tty.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_tty.h b/rpcs3/Emu/Cell/lv2/sys_tty.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_tty.h rename to rpcs3/Emu/Cell/lv2/sys_tty.h diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_uart.cpp b/rpcs3/Emu/Cell/lv2/sys_uart.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_uart.cpp rename to rpcs3/Emu/Cell/lv2/sys_uart.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_uart.h b/rpcs3/Emu/Cell/lv2/sys_uart.h similarity index 99% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_uart.h rename to rpcs3/Emu/Cell/lv2/sys_uart.h index 1fb3a8f24..b203dc91e 100644 --- a/rpcs3/rpcs3/Emu/Cell/lv2/sys_uart.h +++ b/rpcs3/Emu/Cell/lv2/sys_uart.h @@ -1,9 +1,9 @@ #pragma once #include "Emu/Memory/vm_ptr.h" -#include "Utilities/mutex.h" -#include "Utilities/cond.h" -#include "Utilities/simple_ringbuf.h" +#include "util/mutex.h" +#include "util/cond.h" +#include "util/simple_ringbuf.h" enum : u32 { diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_usbd.cpp b/rpcs3/Emu/Cell/lv2/sys_usbd.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_usbd.cpp rename to rpcs3/Emu/Cell/lv2/sys_usbd.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_usbd.h b/rpcs3/Emu/Cell/lv2/sys_usbd.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_usbd.h rename to rpcs3/Emu/Cell/lv2/sys_usbd.h diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_vm.cpp b/rpcs3/Emu/Cell/lv2/sys_vm.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_vm.cpp rename to rpcs3/Emu/Cell/lv2/sys_vm.cpp diff --git a/rpcs3/rpcs3/Emu/Cell/lv2/sys_vm.h b/rpcs3/Emu/Cell/lv2/sys_vm.h similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/lv2/sys_vm.h rename to rpcs3/Emu/Cell/lv2/sys_vm.h diff --git a/rpcs3/rpcs3/Emu/Cell/timers.hpp b/rpcs3/Emu/Cell/timers.hpp similarity index 100% rename from rpcs3/rpcs3/Emu/Cell/timers.hpp rename to rpcs3/Emu/Cell/timers.hpp diff --git a/rpcs3/rpcs3/Emu/GDB.cpp b/rpcs3/Emu/GDB.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/GDB.cpp rename to rpcs3/Emu/GDB.cpp index c4726acd1..702e4a28c 100644 --- a/rpcs3/rpcs3/Emu/GDB.cpp +++ b/rpcs3/Emu/GDB.cpp @@ -2,7 +2,7 @@ #include "GDB.h" #include "util/logs.hpp" -#include "Utilities/StrUtil.h" +#include "util/StrUtil.h" #include "Emu/Memory/vm.h" #include "Emu/System.h" #include "Emu/system_config.h" diff --git a/rpcs3/rpcs3/Emu/GDB.h b/rpcs3/Emu/GDB.h similarity index 99% rename from rpcs3/rpcs3/Emu/GDB.h rename to rpcs3/Emu/GDB.h index 4c86d0e5c..2933074e5 100644 --- a/rpcs3/rpcs3/Emu/GDB.h +++ b/rpcs3/Emu/GDB.h @@ -1,6 +1,6 @@ #pragma once -#include "Utilities/Thread.h" +#include "util/Thread.h" #include struct gdb_cmd; diff --git a/rpcs3/rpcs3/Emu/GameInfo.h b/rpcs3/Emu/GameInfo.h similarity index 100% rename from rpcs3/rpcs3/Emu/GameInfo.h rename to rpcs3/Emu/GameInfo.h diff --git a/rpcs3/rpcs3/Emu/IPC.h b/rpcs3/Emu/IPC.h similarity index 98% rename from rpcs3/rpcs3/Emu/IPC.h rename to rpcs3/Emu/IPC.h index 7c9445837..29058abb5 100644 --- a/rpcs3/rpcs3/Emu/IPC.h +++ b/rpcs3/Emu/IPC.h @@ -2,7 +2,7 @@ #include -#include "Utilities/mutex.h" +#include "util/mutex.h" #include "util/shared_ptr.hpp" diff --git a/rpcs3/rpcs3/Emu/IPC_config.cpp b/rpcs3/Emu/IPC_config.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/IPC_config.cpp rename to rpcs3/Emu/IPC_config.cpp diff --git a/rpcs3/rpcs3/Emu/IPC_config.h b/rpcs3/Emu/IPC_config.h similarity index 93% rename from rpcs3/rpcs3/Emu/IPC_config.h rename to rpcs3/Emu/IPC_config.h index 29be94a0f..5cce60ba5 100644 --- a/rpcs3/rpcs3/Emu/IPC_config.h +++ b/rpcs3/Emu/IPC_config.h @@ -1,6 +1,6 @@ #pragma once -#include "Utilities/Config.h" +#include "util/Config.h" struct cfg_ipc : cfg::node { diff --git a/rpcs3/rpcs3/Emu/IPC_socket.cpp b/rpcs3/Emu/IPC_socket.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/IPC_socket.cpp rename to rpcs3/Emu/IPC_socket.cpp diff --git a/rpcs3/rpcs3/Emu/IPC_socket.h b/rpcs3/Emu/IPC_socket.h similarity index 98% rename from rpcs3/rpcs3/Emu/IPC_socket.h rename to rpcs3/Emu/IPC_socket.h index 618dafea3..cba7b5cbf 100644 --- a/rpcs3/rpcs3/Emu/IPC_socket.h +++ b/rpcs3/Emu/IPC_socket.h @@ -1,6 +1,6 @@ #pragma once -#include "Utilities/Thread.h" +#include "util/Thread.h" #include "util/logs.hpp" #include "Emu/Memory/vm.h" #include "3rdparty/pine/pine_server.h" diff --git a/rpcs3/rpcs3/Emu/IdManager.cpp b/rpcs3/Emu/IdManager.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/IdManager.cpp rename to rpcs3/Emu/IdManager.cpp diff --git a/rpcs3/rpcs3/Emu/IdManager.h b/rpcs3/Emu/IdManager.h similarity index 99% rename from rpcs3/rpcs3/Emu/IdManager.h rename to rpcs3/Emu/IdManager.h index bf0823a52..bf0cb9ac5 100644 --- a/rpcs3/rpcs3/Emu/IdManager.h +++ b/rpcs3/Emu/IdManager.h @@ -1,7 +1,7 @@ #pragma once #include "util/types.hpp" -#include "Utilities/mutex.h" +#include "util/mutex.h" #include #include diff --git a/rpcs3/rpcs3/Emu/Io/Buzz.cpp b/rpcs3/Emu/Io/Buzz.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Io/Buzz.cpp rename to rpcs3/Emu/Io/Buzz.cpp diff --git a/rpcs3/rpcs3/Emu/Io/Buzz.h b/rpcs3/Emu/Io/Buzz.h similarity index 100% rename from rpcs3/rpcs3/Emu/Io/Buzz.h rename to rpcs3/Emu/Io/Buzz.h diff --git a/rpcs3/rpcs3/Emu/Io/Dimensions.cpp b/rpcs3/Emu/Io/Dimensions.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Io/Dimensions.cpp rename to rpcs3/Emu/Io/Dimensions.cpp diff --git a/rpcs3/rpcs3/Emu/Io/Dimensions.h b/rpcs3/Emu/Io/Dimensions.h similarity index 99% rename from rpcs3/rpcs3/Emu/Io/Dimensions.h rename to rpcs3/Emu/Io/Dimensions.h index e4886c11f..3ad359cba 100644 --- a/rpcs3/rpcs3/Emu/Io/Dimensions.h +++ b/rpcs3/Emu/Io/Dimensions.h @@ -1,7 +1,7 @@ #pragma once #include "Emu/Io/usb_device.h" -#include "Utilities/mutex.h" +#include "util/mutex.h" #include #include #include diff --git a/rpcs3/rpcs3/Emu/Io/GHLtar.cpp b/rpcs3/Emu/Io/GHLtar.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Io/GHLtar.cpp rename to rpcs3/Emu/Io/GHLtar.cpp diff --git a/rpcs3/rpcs3/Emu/Io/GHLtar.h b/rpcs3/Emu/Io/GHLtar.h similarity index 100% rename from rpcs3/rpcs3/Emu/Io/GHLtar.h rename to rpcs3/Emu/Io/GHLtar.h diff --git a/rpcs3/rpcs3/Emu/Io/GameTablet.cpp b/rpcs3/Emu/Io/GameTablet.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Io/GameTablet.cpp rename to rpcs3/Emu/Io/GameTablet.cpp diff --git a/rpcs3/rpcs3/Emu/Io/GameTablet.h b/rpcs3/Emu/Io/GameTablet.h similarity index 100% rename from rpcs3/rpcs3/Emu/Io/GameTablet.h rename to rpcs3/Emu/Io/GameTablet.h diff --git a/rpcs3/rpcs3/Emu/Io/GunCon3.cpp b/rpcs3/Emu/Io/GunCon3.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Io/GunCon3.cpp rename to rpcs3/Emu/Io/GunCon3.cpp diff --git a/rpcs3/rpcs3/Emu/Io/GunCon3.h b/rpcs3/Emu/Io/GunCon3.h similarity index 100% rename from rpcs3/rpcs3/Emu/Io/GunCon3.h rename to rpcs3/Emu/Io/GunCon3.h diff --git a/rpcs3/rpcs3/Emu/Io/Infinity.cpp b/rpcs3/Emu/Io/Infinity.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Io/Infinity.cpp rename to rpcs3/Emu/Io/Infinity.cpp diff --git a/rpcs3/rpcs3/Emu/Io/Infinity.h b/rpcs3/Emu/Io/Infinity.h similarity index 98% rename from rpcs3/rpcs3/Emu/Io/Infinity.h rename to rpcs3/Emu/Io/Infinity.h index 2bfcff245..45ea52228 100644 --- a/rpcs3/rpcs3/Emu/Io/Infinity.h +++ b/rpcs3/Emu/Io/Infinity.h @@ -1,7 +1,7 @@ #pragma once #include "Emu/Io/usb_device.h" -#include "Utilities/mutex.h" +#include "util/mutex.h" #include #include diff --git a/rpcs3/rpcs3/Emu/Io/Keyboard.h b/rpcs3/Emu/Io/Keyboard.h similarity index 100% rename from rpcs3/rpcs3/Emu/Io/Keyboard.h rename to rpcs3/Emu/Io/Keyboard.h diff --git a/rpcs3/rpcs3/Emu/Io/KeyboardHandler.cpp b/rpcs3/Emu/Io/KeyboardHandler.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Io/KeyboardHandler.cpp rename to rpcs3/Emu/Io/KeyboardHandler.cpp diff --git a/rpcs3/rpcs3/Emu/Io/KeyboardHandler.h b/rpcs3/Emu/Io/KeyboardHandler.h similarity index 100% rename from rpcs3/rpcs3/Emu/Io/KeyboardHandler.h rename to rpcs3/Emu/Io/KeyboardHandler.h diff --git a/rpcs3/rpcs3/Emu/Io/MouseHandler.cpp b/rpcs3/Emu/Io/MouseHandler.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Io/MouseHandler.cpp rename to rpcs3/Emu/Io/MouseHandler.cpp diff --git a/rpcs3/rpcs3/Emu/Io/MouseHandler.h b/rpcs3/Emu/Io/MouseHandler.h similarity index 98% rename from rpcs3/rpcs3/Emu/Io/MouseHandler.h rename to rpcs3/Emu/Io/MouseHandler.h index 20ccb6429..a7367fd22 100644 --- a/rpcs3/rpcs3/Emu/Io/MouseHandler.h +++ b/rpcs3/Emu/Io/MouseHandler.h @@ -2,8 +2,8 @@ #include #include -#include "Utilities/StrFmt.h" -#include "Utilities/mutex.h" +#include "util/StrFmt.h" +#include "util/mutex.h" #include "util/init_mutex.hpp" #include "Emu/system_config_types.h" diff --git a/rpcs3/rpcs3/Emu/Io/Null/NullKeyboardHandler.h b/rpcs3/Emu/Io/Null/NullKeyboardHandler.h similarity index 100% rename from rpcs3/rpcs3/Emu/Io/Null/NullKeyboardHandler.h rename to rpcs3/Emu/Io/Null/NullKeyboardHandler.h diff --git a/rpcs3/rpcs3/Emu/Io/Null/NullMouseHandler.h b/rpcs3/Emu/Io/Null/NullMouseHandler.h similarity index 100% rename from rpcs3/rpcs3/Emu/Io/Null/NullMouseHandler.h rename to rpcs3/Emu/Io/Null/NullMouseHandler.h diff --git a/rpcs3/rpcs3/Emu/Io/Null/NullPadHandler.h b/rpcs3/Emu/Io/Null/NullPadHandler.h similarity index 100% rename from rpcs3/rpcs3/Emu/Io/Null/NullPadHandler.h rename to rpcs3/Emu/Io/Null/NullPadHandler.h diff --git a/rpcs3/rpcs3/Emu/Io/Null/null_camera_handler.h b/rpcs3/Emu/Io/Null/null_camera_handler.h similarity index 100% rename from rpcs3/rpcs3/Emu/Io/Null/null_camera_handler.h rename to rpcs3/Emu/Io/Null/null_camera_handler.h diff --git a/rpcs3/rpcs3/Emu/Io/Null/null_music_handler.h b/rpcs3/Emu/Io/Null/null_music_handler.h similarity index 100% rename from rpcs3/rpcs3/Emu/Io/Null/null_music_handler.h rename to rpcs3/Emu/Io/Null/null_music_handler.h diff --git a/rpcs3/rpcs3/Emu/Io/PadHandler.cpp b/rpcs3/Emu/Io/PadHandler.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Io/PadHandler.cpp rename to rpcs3/Emu/Io/PadHandler.cpp diff --git a/rpcs3/rpcs3/Emu/Io/PadHandler.h b/rpcs3/Emu/Io/PadHandler.h similarity index 100% rename from rpcs3/rpcs3/Emu/Io/PadHandler.h rename to rpcs3/Emu/Io/PadHandler.h diff --git a/rpcs3/rpcs3/Emu/Io/RB3MidiDrums.cpp b/rpcs3/Emu/Io/RB3MidiDrums.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Io/RB3MidiDrums.cpp rename to rpcs3/Emu/Io/RB3MidiDrums.cpp diff --git a/rpcs3/rpcs3/Emu/Io/RB3MidiDrums.h b/rpcs3/Emu/Io/RB3MidiDrums.h similarity index 100% rename from rpcs3/rpcs3/Emu/Io/RB3MidiDrums.h rename to rpcs3/Emu/Io/RB3MidiDrums.h diff --git a/rpcs3/rpcs3/Emu/Io/RB3MidiGuitar.cpp b/rpcs3/Emu/Io/RB3MidiGuitar.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Io/RB3MidiGuitar.cpp rename to rpcs3/Emu/Io/RB3MidiGuitar.cpp diff --git a/rpcs3/rpcs3/Emu/Io/RB3MidiGuitar.h b/rpcs3/Emu/Io/RB3MidiGuitar.h similarity index 100% rename from rpcs3/rpcs3/Emu/Io/RB3MidiGuitar.h rename to rpcs3/Emu/Io/RB3MidiGuitar.h diff --git a/rpcs3/rpcs3/Emu/Io/RB3MidiKeyboard.cpp b/rpcs3/Emu/Io/RB3MidiKeyboard.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Io/RB3MidiKeyboard.cpp rename to rpcs3/Emu/Io/RB3MidiKeyboard.cpp diff --git a/rpcs3/rpcs3/Emu/Io/RB3MidiKeyboard.h b/rpcs3/Emu/Io/RB3MidiKeyboard.h similarity index 100% rename from rpcs3/rpcs3/Emu/Io/RB3MidiKeyboard.h rename to rpcs3/Emu/Io/RB3MidiKeyboard.h diff --git a/rpcs3/rpcs3/Emu/Io/Skylander.cpp b/rpcs3/Emu/Io/Skylander.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Io/Skylander.cpp rename to rpcs3/Emu/Io/Skylander.cpp diff --git a/rpcs3/rpcs3/Emu/Io/Skylander.h b/rpcs3/Emu/Io/Skylander.h similarity index 97% rename from rpcs3/rpcs3/Emu/Io/Skylander.h rename to rpcs3/Emu/Io/Skylander.h index c3eb596b2..436f566ef 100644 --- a/rpcs3/rpcs3/Emu/Io/Skylander.h +++ b/rpcs3/Emu/Io/Skylander.h @@ -1,7 +1,7 @@ #pragma once #include "Emu/Io/usb_device.h" -#include "Utilities/mutex.h" +#include "util/mutex.h" #include struct skylander diff --git a/rpcs3/rpcs3/Emu/Io/TopShotElite.cpp b/rpcs3/Emu/Io/TopShotElite.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Io/TopShotElite.cpp rename to rpcs3/Emu/Io/TopShotElite.cpp diff --git a/rpcs3/rpcs3/Emu/Io/TopShotElite.h b/rpcs3/Emu/Io/TopShotElite.h similarity index 100% rename from rpcs3/rpcs3/Emu/Io/TopShotElite.h rename to rpcs3/Emu/Io/TopShotElite.h diff --git a/rpcs3/rpcs3/Emu/Io/TopShotFearmaster.cpp b/rpcs3/Emu/Io/TopShotFearmaster.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Io/TopShotFearmaster.cpp rename to rpcs3/Emu/Io/TopShotFearmaster.cpp diff --git a/rpcs3/rpcs3/Emu/Io/TopShotFearmaster.h b/rpcs3/Emu/Io/TopShotFearmaster.h similarity index 100% rename from rpcs3/rpcs3/Emu/Io/TopShotFearmaster.h rename to rpcs3/Emu/Io/TopShotFearmaster.h diff --git a/rpcs3/rpcs3/Emu/Io/Turntable.cpp b/rpcs3/Emu/Io/Turntable.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Io/Turntable.cpp rename to rpcs3/Emu/Io/Turntable.cpp diff --git a/rpcs3/rpcs3/Emu/Io/Turntable.h b/rpcs3/Emu/Io/Turntable.h similarity index 100% rename from rpcs3/rpcs3/Emu/Io/Turntable.h rename to rpcs3/Emu/Io/Turntable.h diff --git a/rpcs3/rpcs3/Emu/Io/buzz_config.h b/rpcs3/Emu/Io/buzz_config.h similarity index 100% rename from rpcs3/rpcs3/Emu/Io/buzz_config.h rename to rpcs3/Emu/Io/buzz_config.h diff --git a/rpcs3/rpcs3/Emu/Io/camera_config.cpp b/rpcs3/Emu/Io/camera_config.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Io/camera_config.cpp rename to rpcs3/Emu/Io/camera_config.cpp diff --git a/rpcs3/rpcs3/Emu/Io/camera_config.h b/rpcs3/Emu/Io/camera_config.h similarity index 95% rename from rpcs3/rpcs3/Emu/Io/camera_config.h rename to rpcs3/Emu/Io/camera_config.h index 238db5622..034baff92 100644 --- a/rpcs3/rpcs3/Emu/Io/camera_config.h +++ b/rpcs3/Emu/Io/camera_config.h @@ -1,6 +1,6 @@ #pragma once -#include "Utilities/Config.h" +#include "util/Config.h" struct cfg_camera final : cfg::node { diff --git a/rpcs3/rpcs3/Emu/Io/camera_handler_base.h b/rpcs3/Emu/Io/camera_handler_base.h similarity index 100% rename from rpcs3/rpcs3/Emu/Io/camera_handler_base.h rename to rpcs3/Emu/Io/camera_handler_base.h diff --git a/rpcs3/rpcs3/Emu/Io/emulated_pad_config.h b/rpcs3/Emu/Io/emulated_pad_config.h similarity index 99% rename from rpcs3/rpcs3/Emu/Io/emulated_pad_config.h rename to rpcs3/Emu/Io/emulated_pad_config.h index 4b44e0080..5b9c5eb1b 100644 --- a/rpcs3/rpcs3/Emu/Io/emulated_pad_config.h +++ b/rpcs3/Emu/Io/emulated_pad_config.h @@ -1,7 +1,7 @@ #pragma once -#include "Utilities/Config.h" -#include "Utilities/mutex.h" +#include "util/Config.h" +#include "util/mutex.h" #include "pad_types.h" #include "MouseHandler.h" diff --git a/rpcs3/rpcs3/Emu/Io/gem_config.h b/rpcs3/Emu/Io/gem_config.h similarity index 100% rename from rpcs3/rpcs3/Emu/Io/gem_config.h rename to rpcs3/Emu/Io/gem_config.h diff --git a/rpcs3/rpcs3/Emu/Io/ghltar_config.h b/rpcs3/Emu/Io/ghltar_config.h similarity index 100% rename from rpcs3/rpcs3/Emu/Io/ghltar_config.h rename to rpcs3/Emu/Io/ghltar_config.h diff --git a/rpcs3/rpcs3/Emu/Io/guncon3_config.h b/rpcs3/Emu/Io/guncon3_config.h similarity index 100% rename from rpcs3/rpcs3/Emu/Io/guncon3_config.h rename to rpcs3/Emu/Io/guncon3_config.h diff --git a/rpcs3/rpcs3/Emu/Io/interception.cpp b/rpcs3/Emu/Io/interception.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Io/interception.cpp rename to rpcs3/Emu/Io/interception.cpp diff --git a/rpcs3/rpcs3/Emu/Io/interception.h b/rpcs3/Emu/Io/interception.h similarity index 100% rename from rpcs3/rpcs3/Emu/Io/interception.h rename to rpcs3/Emu/Io/interception.h diff --git a/rpcs3/rpcs3/Emu/Io/midi_config_types.cpp b/rpcs3/Emu/Io/midi_config_types.cpp similarity index 95% rename from rpcs3/rpcs3/Emu/Io/midi_config_types.cpp rename to rpcs3/Emu/Io/midi_config_types.cpp index e730f4bf1..cc7520ccc 100644 --- a/rpcs3/rpcs3/Emu/Io/midi_config_types.cpp +++ b/rpcs3/Emu/Io/midi_config_types.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "midi_config_types.h" -#include "Utilities/StrUtil.h" -#include "Utilities/Config.h" +#include "util/StrUtil.h" +#include "util/Config.h" template <> void fmt_class_string::format(std::string& out, u64 arg) diff --git a/rpcs3/rpcs3/Emu/Io/midi_config_types.h b/rpcs3/Emu/Io/midi_config_types.h similarity index 100% rename from rpcs3/rpcs3/Emu/Io/midi_config_types.h rename to rpcs3/Emu/Io/midi_config_types.h diff --git a/rpcs3/rpcs3/Emu/Io/mouse_config.cpp b/rpcs3/Emu/Io/mouse_config.cpp similarity index 97% rename from rpcs3/rpcs3/Emu/Io/mouse_config.cpp rename to rpcs3/Emu/Io/mouse_config.cpp index 07ec4b525..53054739e 100644 --- a/rpcs3/rpcs3/Emu/Io/mouse_config.cpp +++ b/rpcs3/Emu/Io/mouse_config.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "mouse_config.h" #include "MouseHandler.h" -#include "Utilities/File.h" +#include "util/File.h" mouse_config::mouse_config() : cfg_name(fs::get_config_dir(true) + "config_mouse.yml") diff --git a/rpcs3/rpcs3/Emu/Io/mouse_config.h b/rpcs3/Emu/Io/mouse_config.h similarity index 96% rename from rpcs3/rpcs3/Emu/Io/mouse_config.h rename to rpcs3/Emu/Io/mouse_config.h index 219ede29b..1929db17e 100644 --- a/rpcs3/rpcs3/Emu/Io/mouse_config.h +++ b/rpcs3/Emu/Io/mouse_config.h @@ -1,6 +1,6 @@ #pragma once -#include "Utilities/Config.h" +#include "util/Config.h" // For simplicity's sake, there is only one config instead of 127 for MAX_MICE struct mouse_config final : cfg::node diff --git a/rpcs3/rpcs3/Emu/Io/music_handler_base.h b/rpcs3/Emu/Io/music_handler_base.h similarity index 100% rename from rpcs3/rpcs3/Emu/Io/music_handler_base.h rename to rpcs3/Emu/Io/music_handler_base.h diff --git a/rpcs3/rpcs3/Emu/Io/pad_config.cpp b/rpcs3/Emu/Io/pad_config.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Io/pad_config.cpp rename to rpcs3/Emu/Io/pad_config.cpp diff --git a/rpcs3/rpcs3/Emu/Io/pad_config.h b/rpcs3/Emu/Io/pad_config.h similarity index 99% rename from rpcs3/rpcs3/Emu/Io/pad_config.h rename to rpcs3/Emu/Io/pad_config.h index db62d869a..8275295bc 100644 --- a/rpcs3/rpcs3/Emu/Io/pad_config.h +++ b/rpcs3/Emu/Io/pad_config.h @@ -2,7 +2,7 @@ #include "pad_types.h" -#include "Utilities/Config.h" +#include "util/Config.h" #include diff --git a/rpcs3/rpcs3/Emu/Io/pad_config_types.cpp b/rpcs3/Emu/Io/pad_config_types.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Io/pad_config_types.cpp rename to rpcs3/Emu/Io/pad_config_types.cpp diff --git a/rpcs3/rpcs3/Emu/Io/pad_config_types.h b/rpcs3/Emu/Io/pad_config_types.h similarity index 100% rename from rpcs3/rpcs3/Emu/Io/pad_config_types.h rename to rpcs3/Emu/Io/pad_config_types.h diff --git a/rpcs3/rpcs3/Emu/Io/pad_types.cpp b/rpcs3/Emu/Io/pad_types.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Io/pad_types.cpp rename to rpcs3/Emu/Io/pad_types.cpp diff --git a/rpcs3/rpcs3/Emu/Io/pad_types.h b/rpcs3/Emu/Io/pad_types.h similarity index 100% rename from rpcs3/rpcs3/Emu/Io/pad_types.h rename to rpcs3/Emu/Io/pad_types.h diff --git a/rpcs3/rpcs3/Emu/Io/rb3drums_config.cpp b/rpcs3/Emu/Io/rb3drums_config.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Io/rb3drums_config.cpp rename to rpcs3/Emu/Io/rb3drums_config.cpp diff --git a/rpcs3/rpcs3/Emu/Io/rb3drums_config.h b/rpcs3/Emu/Io/rb3drums_config.h similarity index 97% rename from rpcs3/rpcs3/Emu/Io/rb3drums_config.h rename to rpcs3/Emu/Io/rb3drums_config.h index 5910d88d7..3670d7513 100644 --- a/rpcs3/rpcs3/Emu/Io/rb3drums_config.h +++ b/rpcs3/Emu/Io/rb3drums_config.h @@ -1,6 +1,6 @@ #pragma once -#include "Utilities/Config.h" +#include "util/Config.h" struct cfg_rb3drums final : cfg::node { diff --git a/rpcs3/rpcs3/Emu/Io/recording_config.cpp b/rpcs3/Emu/Io/recording_config.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Io/recording_config.cpp rename to rpcs3/Emu/Io/recording_config.cpp diff --git a/rpcs3/rpcs3/Emu/Io/recording_config.h b/rpcs3/Emu/Io/recording_config.h similarity index 97% rename from rpcs3/rpcs3/Emu/Io/recording_config.h rename to rpcs3/Emu/Io/recording_config.h index 24019d499..488b1ba8b 100644 --- a/rpcs3/rpcs3/Emu/Io/recording_config.h +++ b/rpcs3/Emu/Io/recording_config.h @@ -1,6 +1,6 @@ #pragma once -#include "Utilities/Config.h" +#include "util/Config.h" struct cfg_recording final : cfg::node { diff --git a/rpcs3/rpcs3/Emu/Io/topshotelite_config.h b/rpcs3/Emu/Io/topshotelite_config.h similarity index 100% rename from rpcs3/rpcs3/Emu/Io/topshotelite_config.h rename to rpcs3/Emu/Io/topshotelite_config.h diff --git a/rpcs3/rpcs3/Emu/Io/topshotfearmaster_config.h b/rpcs3/Emu/Io/topshotfearmaster_config.h similarity index 100% rename from rpcs3/rpcs3/Emu/Io/topshotfearmaster_config.h rename to rpcs3/Emu/Io/topshotfearmaster_config.h diff --git a/rpcs3/rpcs3/Emu/Io/turntable_config.h b/rpcs3/Emu/Io/turntable_config.h similarity index 100% rename from rpcs3/rpcs3/Emu/Io/turntable_config.h rename to rpcs3/Emu/Io/turntable_config.h diff --git a/rpcs3/rpcs3/Emu/Io/usb_device.cpp b/rpcs3/Emu/Io/usb_device.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/Io/usb_device.cpp rename to rpcs3/Emu/Io/usb_device.cpp index 799f6f77a..42c517473 100644 --- a/rpcs3/rpcs3/Emu/Io/usb_device.cpp +++ b/rpcs3/Emu/Io/usb_device.cpp @@ -3,7 +3,7 @@ #include "Emu/Cell/timers.hpp" #include "Emu/Cell/lv2/sys_usbd.h" #include "Emu/Io/usb_device.h" -#include "Utilities/StrUtil.h" +#include "util/StrUtil.h" #include LOG_CHANNEL(sys_usbd); diff --git a/rpcs3/rpcs3/Emu/Io/usb_device.h b/rpcs3/Emu/Io/usb_device.h similarity index 100% rename from rpcs3/rpcs3/Emu/Io/usb_device.h rename to rpcs3/Emu/Io/usb_device.h diff --git a/rpcs3/rpcs3/Emu/Io/usb_vfs.cpp b/rpcs3/Emu/Io/usb_vfs.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Io/usb_vfs.cpp rename to rpcs3/Emu/Io/usb_vfs.cpp diff --git a/rpcs3/rpcs3/Emu/Io/usb_vfs.h b/rpcs3/Emu/Io/usb_vfs.h similarity index 87% rename from rpcs3/rpcs3/Emu/Io/usb_vfs.h rename to rpcs3/Emu/Io/usb_vfs.h index ad734d368..f21f79bef 100644 --- a/rpcs3/rpcs3/Emu/Io/usb_vfs.h +++ b/rpcs3/Emu/Io/usb_vfs.h @@ -1,7 +1,7 @@ #pragma once #include "Emu/Io/usb_device.h" -#include "Utilities/Config.h" +#include "util/Config.h" class usb_device_vfs : public usb_device_emulated { diff --git a/rpcs3/rpcs3/Emu/Io/usio.cpp b/rpcs3/Emu/Io/usio.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/Io/usio.cpp rename to rpcs3/Emu/Io/usio.cpp diff --git a/rpcs3/rpcs3/Emu/Io/usio.h b/rpcs3/Emu/Io/usio.h similarity index 100% rename from rpcs3/rpcs3/Emu/Io/usio.h rename to rpcs3/Emu/Io/usio.h diff --git a/rpcs3/rpcs3/Emu/Io/usio_config.h b/rpcs3/Emu/Io/usio_config.h similarity index 100% rename from rpcs3/rpcs3/Emu/Io/usio_config.h rename to rpcs3/Emu/Io/usio_config.h diff --git a/rpcs3/rpcs3/Emu/Memory/vm.cpp b/rpcs3/Emu/Memory/vm.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/Memory/vm.cpp rename to rpcs3/Emu/Memory/vm.cpp index 421b7990f..66585f440 100644 --- a/rpcs3/rpcs3/Emu/Memory/vm.cpp +++ b/rpcs3/Emu/Memory/vm.cpp @@ -4,8 +4,8 @@ #include "vm_ref.h" #include "vm_reservation.h" -#include "Utilities/Thread.h" -#include "Utilities/address_range.h" +#include "util/Thread.h" +#include "util/address_range.h" #include "Emu/CPU/CPUThread.h" #include "Emu/RSX/RSXThread.h" #include "Emu/Cell/SPURecompiler.h" diff --git a/rpcs3/rpcs3/Emu/Memory/vm.h b/rpcs3/Emu/Memory/vm.h similarity index 100% rename from rpcs3/rpcs3/Emu/Memory/vm.h rename to rpcs3/Emu/Memory/vm.h diff --git a/rpcs3/rpcs3/Emu/Memory/vm_locking.h b/rpcs3/Emu/Memory/vm_locking.h similarity index 100% rename from rpcs3/rpcs3/Emu/Memory/vm_locking.h rename to rpcs3/Emu/Memory/vm_locking.h diff --git a/rpcs3/rpcs3/Emu/Memory/vm_ptr.h b/rpcs3/Emu/Memory/vm_ptr.h similarity index 99% rename from rpcs3/rpcs3/Emu/Memory/vm_ptr.h rename to rpcs3/Emu/Memory/vm_ptr.h index ac7588013..28e46d9a0 100644 --- a/rpcs3/rpcs3/Emu/Memory/vm_ptr.h +++ b/rpcs3/Emu/Memory/vm_ptr.h @@ -2,7 +2,7 @@ #include "util/types.hpp" #include "util/to_endian.hpp" -#include "Utilities/StrFmt.h" +#include "util/StrFmt.h" #include "vm.h" class ppu_thread; diff --git a/rpcs3/rpcs3/Emu/Memory/vm_ref.h b/rpcs3/Emu/Memory/vm_ref.h similarity index 100% rename from rpcs3/rpcs3/Emu/Memory/vm_ref.h rename to rpcs3/Emu/Memory/vm_ref.h diff --git a/rpcs3/rpcs3/Emu/Memory/vm_reservation.h b/rpcs3/Emu/Memory/vm_reservation.h similarity index 100% rename from rpcs3/rpcs3/Emu/Memory/vm_reservation.h rename to rpcs3/Emu/Memory/vm_reservation.h diff --git a/rpcs3/rpcs3/Emu/Memory/vm_var.h b/rpcs3/Emu/Memory/vm_var.h similarity index 100% rename from rpcs3/rpcs3/Emu/Memory/vm_var.h rename to rpcs3/Emu/Memory/vm_var.h diff --git a/rpcs3/rpcs3/Emu/NP/fb_helpers.cpp b/rpcs3/Emu/NP/fb_helpers.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/NP/fb_helpers.cpp rename to rpcs3/Emu/NP/fb_helpers.cpp diff --git a/rpcs3/rpcs3/Emu/NP/fb_helpers.h b/rpcs3/Emu/NP/fb_helpers.h similarity index 98% rename from rpcs3/rpcs3/Emu/NP/fb_helpers.h rename to rpcs3/Emu/NP/fb_helpers.h index 6b92cfba3..02623c025 100644 --- a/rpcs3/rpcs3/Emu/NP/fb_helpers.h +++ b/rpcs3/Emu/NP/fb_helpers.h @@ -1,7 +1,7 @@ #pragma once -#include "Emu/Cell/Modules/sceNp.h" -#include "Emu/Cell/Modules/sceNp2.h" +#include "rpcsx/fw/ps3/sceNp.h" +#include "rpcsx/fw/ps3/sceNp2.h" #include "np_event_data.h" #include "generated/np2_structs_generated.h" diff --git a/rpcs3/rpcs3/Emu/NP/generated/np2_structs.fbs b/rpcs3/Emu/NP/generated/np2_structs.fbs similarity index 100% rename from rpcs3/rpcs3/Emu/NP/generated/np2_structs.fbs rename to rpcs3/Emu/NP/generated/np2_structs.fbs diff --git a/rpcs3/rpcs3/Emu/NP/generated/np2_structs_generated.h b/rpcs3/Emu/NP/generated/np2_structs_generated.h similarity index 100% rename from rpcs3/rpcs3/Emu/NP/generated/np2_structs_generated.h rename to rpcs3/Emu/NP/generated/np2_structs_generated.h diff --git a/rpcs3/rpcs3/Emu/NP/ip_address.cpp b/rpcs3/Emu/NP/ip_address.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/NP/ip_address.cpp rename to rpcs3/Emu/NP/ip_address.cpp index 705f4782e..1760ca06a 100644 --- a/rpcs3/rpcs3/Emu/NP/ip_address.cpp +++ b/rpcs3/Emu/NP/ip_address.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "ip_address.h" -#include "Utilities/StrFmt.h" +#include "util/StrFmt.h" #include "Emu/IdManager.h" #include "util/endian.hpp" #include "util/types.hpp" diff --git a/rpcs3/rpcs3/Emu/NP/ip_address.h b/rpcs3/Emu/NP/ip_address.h similarity index 98% rename from rpcs3/rpcs3/Emu/NP/ip_address.h rename to rpcs3/Emu/NP/ip_address.h index 3857275aa..dd70a9bda 100644 --- a/rpcs3/rpcs3/Emu/NP/ip_address.h +++ b/rpcs3/Emu/NP/ip_address.h @@ -6,7 +6,7 @@ #include #include "util/types.hpp" -#include "Utilities/mutex.h" +#include "util/mutex.h" #ifdef _WIN32 #include diff --git a/rpcs3/rpcs3/Emu/NP/np_allocator.h b/rpcs3/Emu/NP/np_allocator.h similarity index 99% rename from rpcs3/rpcs3/Emu/NP/np_allocator.h rename to rpcs3/Emu/NP/np_allocator.h index a78bb1beb..5915fb371 100644 --- a/rpcs3/rpcs3/Emu/NP/np_allocator.h +++ b/rpcs3/Emu/NP/np_allocator.h @@ -3,7 +3,7 @@ #include #include "Emu/Memory/vm_ptr.h" -#include "Utilities/mutex.h" +#include "util/mutex.h" #include "util/asm.hpp" #include "util/logs.hpp" diff --git a/rpcs3/rpcs3/Emu/NP/np_cache.cpp b/rpcs3/Emu/NP/np_cache.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/NP/np_cache.cpp rename to rpcs3/Emu/NP/np_cache.cpp diff --git a/rpcs3/rpcs3/Emu/NP/np_cache.h b/rpcs3/Emu/NP/np_cache.h similarity index 96% rename from rpcs3/rpcs3/Emu/NP/np_cache.h rename to rpcs3/Emu/NP/np_cache.h index d9de5e937..8b7dc88e8 100644 --- a/rpcs3/rpcs3/Emu/NP/np_cache.h +++ b/rpcs3/Emu/NP/np_cache.h @@ -3,10 +3,10 @@ #include #include -#include "Utilities/mutex.h" +#include "util/mutex.h" -#include "Emu/Cell/Modules/sceNp.h" -#include "Emu/Cell/Modules/sceNp2.h" +#include "rpcsx/fw/ps3/sceNp.h" +#include "rpcsx/fw/ps3/sceNp2.h" namespace np { diff --git a/rpcs3/rpcs3/Emu/NP/np_contexts.cpp b/rpcs3/Emu/NP/np_contexts.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/NP/np_contexts.cpp rename to rpcs3/Emu/NP/np_contexts.cpp index fe1a7241e..18d47bdba 100644 --- a/rpcs3/rpcs3/Emu/NP/np_contexts.cpp +++ b/rpcs3/Emu/NP/np_contexts.cpp @@ -3,7 +3,7 @@ #include "Emu/Cell/PPUCallback.h" #include "Emu/IdManager.h" -#include "Emu/Cell/Modules/cellSysutil.h" +#include "rpcsx/fw/ps3/cellSysutil.h" LOG_CHANNEL(sceNp2); diff --git a/rpcs3/rpcs3/Emu/NP/np_contexts.h b/rpcs3/Emu/NP/np_contexts.h similarity index 97% rename from rpcs3/rpcs3/Emu/NP/np_contexts.h rename to rpcs3/Emu/NP/np_contexts.h index 7922c0a88..b706815a9 100644 --- a/rpcs3/rpcs3/Emu/NP/np_contexts.h +++ b/rpcs3/Emu/NP/np_contexts.h @@ -5,13 +5,13 @@ #include #include -#include "Utilities/mutex.h" +#include "util/mutex.h" #include "Emu/Memory/vm_ptr.h" -#include "Emu/Cell/Modules/sceNp.h" -#include "Emu/Cell/Modules/sceNp2.h" -#include "Emu/Cell/Modules/sceNpCommerce2.h" -#include "Emu/Cell/Modules/sceNpTus.h" -#include "Utilities/Thread.h" +#include "rpcsx/fw/ps3/sceNp.h" +#include "rpcsx/fw/ps3/sceNp2.h" +#include "rpcsx/fw/ps3/sceNpCommerce2.h" +#include "rpcsx/fw/ps3/sceNpTus.h" +#include "util/Thread.h" // Used By Score and Tus struct generic_async_transaction_context diff --git a/rpcs3/rpcs3/Emu/NP/np_dnshook.cpp b/rpcs3/Emu/NP/np_dnshook.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/NP/np_dnshook.cpp rename to rpcs3/Emu/NP/np_dnshook.cpp index acf4b0ead..3969d4406 100644 --- a/rpcs3/rpcs3/Emu/NP/np_dnshook.cpp +++ b/rpcs3/Emu/NP/np_dnshook.cpp @@ -2,7 +2,7 @@ #include "Emu/NP/np_dnshook.h" #include "Emu/system_config.h" -#include "Utilities/StrUtil.h" +#include "util/StrUtil.h" #include "util/logs.hpp" #include diff --git a/rpcs3/rpcs3/Emu/NP/np_dnshook.h b/rpcs3/Emu/NP/np_dnshook.h similarity index 95% rename from rpcs3/rpcs3/Emu/NP/np_dnshook.h rename to rpcs3/Emu/NP/np_dnshook.h index 57a72e97e..dc579b73b 100644 --- a/rpcs3/rpcs3/Emu/NP/np_dnshook.h +++ b/rpcs3/Emu/NP/np_dnshook.h @@ -6,7 +6,7 @@ #include #include "util/types.hpp" -#include "Utilities/mutex.h" +#include "util/mutex.h" namespace np { diff --git a/rpcs3/rpcs3/Emu/NP/np_event_data.h b/rpcs3/Emu/NP/np_event_data.h similarity index 100% rename from rpcs3/rpcs3/Emu/NP/np_event_data.h rename to rpcs3/Emu/NP/np_event_data.h diff --git a/rpcs3/rpcs3/Emu/NP/np_gui_cache.cpp b/rpcs3/Emu/NP/np_gui_cache.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/NP/np_gui_cache.cpp rename to rpcs3/Emu/NP/np_gui_cache.cpp diff --git a/rpcs3/rpcs3/Emu/NP/np_gui_cache.h b/rpcs3/Emu/NP/np_gui_cache.h similarity index 94% rename from rpcs3/rpcs3/Emu/NP/np_gui_cache.h rename to rpcs3/Emu/NP/np_gui_cache.h index d742cc574..718850317 100644 --- a/rpcs3/rpcs3/Emu/NP/np_gui_cache.h +++ b/rpcs3/Emu/NP/np_gui_cache.h @@ -1,8 +1,8 @@ #pragma once #include -#include "Utilities/mutex.h" -#include "Emu/Cell/Modules/sceNp.h" +#include "util/mutex.h" +#include "rpcsx/fw/ps3/sceNp.h" template <> struct std::less diff --git a/rpcs3/rpcs3/Emu/NP/np_handler.cpp b/rpcs3/Emu/NP/np_handler.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/NP/np_handler.cpp rename to rpcs3/Emu/NP/np_handler.cpp index 86fa47b1a..d7a34933c 100644 --- a/rpcs3/rpcs3/Emu/NP/np_handler.cpp +++ b/rpcs3/Emu/NP/np_handler.cpp @@ -2,11 +2,11 @@ #include "Emu/system_config.h" #include "Emu/NP/np_handler.h" #include "Emu/Cell/PPUCallback.h" -#include "Emu/Cell/Modules/sceNp.h" -#include "Emu/Cell/Modules/sceNp2.h" -#include "Emu/Cell/Modules/cellNetCtl.h" +#include "rpcsx/fw/ps3/sceNp.h" +#include "rpcsx/fw/ps3/sceNp2.h" +#include "rpcsx/fw/ps3/cellNetCtl.h" #include "Emu/Cell/timers.hpp" -#include "Utilities/StrUtil.h" +#include "util/StrUtil.h" #include "Emu/IdManager.h" #include "Emu/System.h" #include "Emu/NP/rpcn_config.h" diff --git a/rpcs3/rpcs3/Emu/NP/np_handler.h b/rpcs3/Emu/NP/np_handler.h similarity index 99% rename from rpcs3/rpcs3/Emu/NP/np_handler.h rename to rpcs3/Emu/NP/np_handler.h index 5921a1700..18d567623 100644 --- a/rpcs3/rpcs3/Emu/NP/np_handler.h +++ b/rpcs3/Emu/NP/np_handler.h @@ -5,9 +5,9 @@ #include #include "Emu/Memory/vm_ptr.h" -#include "Emu/Cell/Modules/sceNp.h" -#include "Emu/Cell/Modules/sceNp2.h" -#include "Emu/Cell/Modules/cellSysutil.h" +#include "rpcsx/fw/ps3/sceNp.h" +#include "rpcsx/fw/ps3/sceNp2.h" +#include "rpcsx/fw/ps3/cellSysutil.h" #include "Emu/NP/rpcn_client.h" #include "Emu/NP/np_allocator.h" diff --git a/rpcs3/rpcs3/Emu/NP/np_helpers.cpp b/rpcs3/Emu/NP/np_helpers.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/NP/np_helpers.cpp rename to rpcs3/Emu/NP/np_helpers.cpp index d6147c352..579c3976b 100644 --- a/rpcs3/rpcs3/Emu/NP/np_helpers.cpp +++ b/rpcs3/Emu/NP/np_helpers.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "util/types.hpp" -#include "Utilities/StrUtil.h" +#include "util/StrUtil.h" #include "rpcn_client.h" #ifdef _WIN32 diff --git a/rpcs3/rpcs3/Emu/NP/np_helpers.h b/rpcs3/Emu/NP/np_helpers.h similarity index 96% rename from rpcs3/rpcs3/Emu/NP/np_helpers.h rename to rpcs3/Emu/NP/np_helpers.h index e9017346c..e52e4b8f4 100644 --- a/rpcs3/rpcs3/Emu/NP/np_helpers.h +++ b/rpcs3/Emu/NP/np_helpers.h @@ -1,7 +1,7 @@ #pragma once #include "util/types.hpp" -#include "Emu/Cell/Modules/sceNp.h" +#include "rpcsx/fw/ps3/sceNp.h" #include "rpcn_client.h" namespace np diff --git a/rpcs3/rpcs3/Emu/NP/np_notifications.cpp b/rpcs3/Emu/NP/np_notifications.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/NP/np_notifications.cpp rename to rpcs3/Emu/NP/np_notifications.cpp index 9fa79053a..9bf0611a7 100644 --- a/rpcs3/rpcs3/Emu/NP/np_notifications.cpp +++ b/rpcs3/Emu/NP/np_notifications.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "Emu/Cell/PPUCallback.h" -#include "Emu/Cell/Modules/cellSysutil.h" +#include "rpcsx/fw/ps3/cellSysutil.h" #include "Emu/IdManager.h" #include "Emu/NP/np_handler.h" #include "Emu/NP/np_helpers.h" diff --git a/rpcs3/rpcs3/Emu/NP/np_requests.cpp b/rpcs3/Emu/NP/np_requests.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/NP/np_requests.cpp rename to rpcs3/Emu/NP/np_requests.cpp index f49967750..3aa1a607f 100644 --- a/rpcs3/rpcs3/Emu/NP/np_requests.cpp +++ b/rpcs3/Emu/NP/np_requests.cpp @@ -1,12 +1,12 @@ -#include "Emu/Cell/Modules/sceNp.h" -#include "Emu/Cell/Modules/sceNp2.h" +#include "rpcsx/fw/ps3/sceNp.h" +#include "rpcsx/fw/ps3/sceNp2.h" #include "Emu/NP/rpcn_types.h" -#include "Utilities/StrFmt.h" +#include "util/StrFmt.h" #include "stdafx.h" #include "Emu/Cell/PPUCallback.h" #include "Emu/Cell/lv2/sys_sync.h" #include "Emu/system_config.h" -#include "Emu/Cell/Modules/cellSysutil.h" +#include "rpcsx/fw/ps3/cellSysutil.h" #include "Emu/Memory/vm_ptr.h" #include "Emu/IdManager.h" #include "np_handler.h" diff --git a/rpcs3/rpcs3/Emu/NP/np_requests_gui.cpp b/rpcs3/Emu/NP/np_requests_gui.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/NP/np_requests_gui.cpp rename to rpcs3/Emu/NP/np_requests_gui.cpp diff --git a/rpcs3/rpcs3/Emu/NP/np_structs_extra.cpp b/rpcs3/Emu/NP/np_structs_extra.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/NP/np_structs_extra.cpp rename to rpcs3/Emu/NP/np_structs_extra.cpp index 5fb857e22..f7fa71415 100644 --- a/rpcs3/rpcs3/Emu/NP/np_structs_extra.cpp +++ b/rpcs3/Emu/NP/np_structs_extra.cpp @@ -1,4 +1,4 @@ -#include "Utilities/StrUtil.h" +#include "util/StrUtil.h" #include "stdafx.h" #include #include "np_structs_extra.h" diff --git a/rpcs3/rpcs3/Emu/NP/np_structs_extra.h b/rpcs3/Emu/NP/np_structs_extra.h similarity index 98% rename from rpcs3/rpcs3/Emu/NP/np_structs_extra.h rename to rpcs3/Emu/NP/np_structs_extra.h index d05711fab..47fb86d73 100644 --- a/rpcs3/rpcs3/Emu/NP/np_structs_extra.h +++ b/rpcs3/Emu/NP/np_structs_extra.h @@ -1,6 +1,6 @@ #pragma once -#include "Emu/Cell/Modules/sceNp2.h" +#include "rpcsx/fw/ps3/sceNp2.h" namespace extra_nps { diff --git a/rpcs3/rpcs3/Emu/NP/rpcn_client.cpp b/rpcs3/Emu/NP/rpcn_client.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/NP/rpcn_client.cpp rename to rpcs3/Emu/NP/rpcn_client.cpp index 3658a471d..7f1359876 100644 --- a/rpcs3/rpcs3/Emu/NP/rpcn_client.cpp +++ b/rpcs3/Emu/NP/rpcn_client.cpp @@ -6,9 +6,9 @@ #include #include #include "rpcn_client.h" -#include "Utilities/StrUtil.h" -#include "Utilities/StrFmt.h" -#include "Utilities/Thread.h" +#include "util/StrUtil.h" +#include "util/StrFmt.h" +#include "util/Thread.h" #include "Emu/System.h" #include "Emu/NP/rpcn_config.h" #include "Emu/NP/np_helpers.h" diff --git a/rpcs3/rpcs3/Emu/NP/rpcn_client.h b/rpcs3/Emu/NP/rpcn_client.h similarity index 99% rename from rpcs3/rpcs3/Emu/NP/rpcn_client.h rename to rpcs3/Emu/NP/rpcn_client.h index d13721087..7595eee14 100644 --- a/rpcs3/rpcs3/Emu/NP/rpcn_client.h +++ b/rpcs3/Emu/NP/rpcn_client.h @@ -4,7 +4,7 @@ #include #include #include -#include "Utilities/mutex.h" +#include "util/mutex.h" #include "Emu/localized_string_id.h" #ifdef _WIN32 @@ -22,9 +22,9 @@ #endif #endif -#include "Emu/Cell/Modules/sceNp.h" -#include "Emu/Cell/Modules/sceNp2.h" -#include "Emu/Cell/Modules/sceNpTus.h" +#include "rpcsx/fw/ps3/sceNp.h" +#include "rpcsx/fw/ps3/sceNp2.h" +#include "rpcsx/fw/ps3/sceNpTus.h" #include #ifdef __clang__ diff --git a/rpcs3/rpcs3/Emu/NP/rpcn_config.cpp b/rpcs3/Emu/NP/rpcn_config.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/NP/rpcn_config.cpp rename to rpcs3/Emu/NP/rpcn_config.cpp index a112084da..3399fcaad 100644 --- a/rpcs3/rpcs3/Emu/NP/rpcn_config.cpp +++ b/rpcs3/Emu/NP/rpcn_config.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "rpcn_config.h" -#include "Utilities/File.h" +#include "util/File.h" cfg_rpcn g_cfg_rpcn; diff --git a/rpcs3/rpcs3/Emu/NP/rpcn_config.h b/rpcs3/Emu/NP/rpcn_config.h similarity index 97% rename from rpcs3/rpcs3/Emu/NP/rpcn_config.h rename to rpcs3/Emu/NP/rpcn_config.h index 7c1317fbe..d6e2f400a 100644 --- a/rpcs3/rpcs3/Emu/NP/rpcn_config.h +++ b/rpcs3/Emu/NP/rpcn_config.h @@ -1,6 +1,6 @@ #pragma once -#include "Utilities/Config.h" +#include "util/Config.h" struct cfg_rpcn : cfg::node { diff --git a/rpcs3/rpcs3/Emu/NP/rpcn_countries.cpp b/rpcs3/Emu/NP/rpcn_countries.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/NP/rpcn_countries.cpp rename to rpcs3/Emu/NP/rpcn_countries.cpp diff --git a/rpcs3/rpcs3/Emu/NP/rpcn_countries.h b/rpcs3/Emu/NP/rpcn_countries.h similarity index 100% rename from rpcs3/rpcs3/Emu/NP/rpcn_countries.h rename to rpcs3/Emu/NP/rpcn_countries.h diff --git a/rpcs3/rpcs3/Emu/NP/rpcn_types.h b/rpcs3/Emu/NP/rpcn_types.h similarity index 100% rename from rpcs3/rpcs3/Emu/NP/rpcn_types.h rename to rpcs3/Emu/NP/rpcn_types.h diff --git a/rpcs3/rpcs3/Emu/NP/signaling_handler.cpp b/rpcs3/Emu/NP/signaling_handler.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/NP/signaling_handler.cpp rename to rpcs3/Emu/NP/signaling_handler.cpp index 30ef1a092..b4b73846f 100644 --- a/rpcs3/rpcs3/Emu/NP/signaling_handler.cpp +++ b/rpcs3/Emu/NP/signaling_handler.cpp @@ -1,9 +1,9 @@ -#include "Emu/NP/ip_address.h" #include "stdafx.h" +#include "Emu/NP/ip_address.h" #include "Emu/Cell/PPUCallback.h" #include "signaling_handler.h" #include "Emu/IdManager.h" -#include "Emu/Cell/Modules/cellSysutil.h" +#include "rpcsx/fw/ps3/cellSysutil.h" #include "np_handler.h" #include "Emu/NP/vport0.h" #include "Emu/NP/np_helpers.h" diff --git a/rpcs3/rpcs3/Emu/NP/signaling_handler.h b/rpcs3/Emu/NP/signaling_handler.h similarity index 97% rename from rpcs3/rpcs3/Emu/NP/signaling_handler.h rename to rpcs3/Emu/NP/signaling_handler.h index b4ec8229b..a95d8f8d5 100644 --- a/rpcs3/rpcs3/Emu/NP/signaling_handler.h +++ b/rpcs3/Emu/NP/signaling_handler.h @@ -1,8 +1,8 @@ #pragma once -#include "Emu/Cell/Modules/sceNp.h" -#include "Emu/Cell/Modules/sceNp2.h" -#include "Utilities/Thread.h" -#include "Utilities/mutex.h" +#include "rpcsx/fw/ps3/sceNp.h" +#include "rpcsx/fw/ps3/sceNp2.h" +#include "util/Thread.h" +#include "util/mutex.h" #include #include #include diff --git a/rpcs3/rpcs3/Emu/NP/upnp_config.cpp b/rpcs3/Emu/NP/upnp_config.cpp similarity index 97% rename from rpcs3/rpcs3/Emu/NP/upnp_config.cpp rename to rpcs3/Emu/NP/upnp_config.cpp index bf43b8e55..1a1d793dd 100644 --- a/rpcs3/rpcs3/Emu/NP/upnp_config.cpp +++ b/rpcs3/Emu/NP/upnp_config.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "upnp_config.h" -#include "Utilities/File.h" +#include "util/File.h" LOG_CHANNEL(upnp_cfg_log, "UPNP_CFG"); diff --git a/rpcs3/rpcs3/Emu/NP/upnp_config.h b/rpcs3/Emu/NP/upnp_config.h similarity index 89% rename from rpcs3/rpcs3/Emu/NP/upnp_config.h rename to rpcs3/Emu/NP/upnp_config.h index f1068c07c..ce9bb0c8d 100644 --- a/rpcs3/rpcs3/Emu/NP/upnp_config.h +++ b/rpcs3/Emu/NP/upnp_config.h @@ -1,6 +1,6 @@ #pragma once -#include "Utilities/Config.h" +#include "util/Config.h" struct cfg_upnp : cfg::node { diff --git a/rpcs3/rpcs3/Emu/NP/upnp_handler.cpp b/rpcs3/Emu/NP/upnp_handler.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/NP/upnp_handler.cpp rename to rpcs3/Emu/NP/upnp_handler.cpp diff --git a/rpcs3/rpcs3/Emu/NP/upnp_handler.h b/rpcs3/Emu/NP/upnp_handler.h similarity index 95% rename from rpcs3/rpcs3/Emu/NP/upnp_handler.h rename to rpcs3/Emu/NP/upnp_handler.h index 40892f744..5b48e5bbf 100644 --- a/rpcs3/rpcs3/Emu/NP/upnp_handler.h +++ b/rpcs3/Emu/NP/upnp_handler.h @@ -5,7 +5,7 @@ #include #include "upnp_config.h" -#include "Utilities/mutex.h" +#include "util/mutex.h" class upnp_handler { diff --git a/rpcs3/rpcs3/Emu/NP/vport0.h b/rpcs3/Emu/NP/vport0.h similarity index 100% rename from rpcs3/rpcs3/Emu/NP/vport0.h rename to rpcs3/Emu/NP/vport0.h diff --git a/rpcs3/rpcs3/Emu/RSX/Capture/rsx_capture.cpp b/rpcs3/Emu/RSX/Capture/rsx_capture.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Capture/rsx_capture.cpp rename to rpcs3/Emu/RSX/Capture/rsx_capture.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/Capture/rsx_capture.h b/rpcs3/Emu/RSX/Capture/rsx_capture.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Capture/rsx_capture.h rename to rpcs3/Emu/RSX/Capture/rsx_capture.h diff --git a/rpcs3/rpcs3/Emu/RSX/Capture/rsx_replay.cpp b/rpcs3/Emu/RSX/Capture/rsx_replay.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Capture/rsx_replay.cpp rename to rpcs3/Emu/RSX/Capture/rsx_replay.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/Capture/rsx_replay.h b/rpcs3/Emu/RSX/Capture/rsx_replay.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Capture/rsx_replay.h rename to rpcs3/Emu/RSX/Capture/rsx_replay.h diff --git a/rpcs3/rpcs3/Emu/RSX/Capture/rsx_trace.h b/rpcs3/Emu/RSX/Capture/rsx_trace.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Capture/rsx_trace.h rename to rpcs3/Emu/RSX/Capture/rsx_trace.h diff --git a/rpcs3/rpcs3/Emu/RSX/Common/BufferUtils.cpp b/rpcs3/Emu/RSX/Common/BufferUtils.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/RSX/Common/BufferUtils.cpp rename to rpcs3/Emu/RSX/Common/BufferUtils.cpp index bcb461b60..688c56312 100644 --- a/rpcs3/rpcs3/Emu/RSX/Common/BufferUtils.cpp +++ b/rpcs3/Emu/RSX/Common/BufferUtils.cpp @@ -2,7 +2,7 @@ #include "BufferUtils.h" #include "util/to_endian.hpp" #include "util/sysinfo.hpp" -#include "Utilities/JIT.h" +#include "util/JIT.h" #include "util/v128.hpp" #include "util/simd.hpp" diff --git a/rpcs3/rpcs3/Emu/RSX/Common/BufferUtils.h b/rpcs3/Emu/RSX/Common/BufferUtils.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Common/BufferUtils.h rename to rpcs3/Emu/RSX/Common/BufferUtils.h diff --git a/rpcs3/rpcs3/Emu/RSX/Common/TextureUtils.cpp b/rpcs3/Emu/RSX/Common/TextureUtils.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Common/TextureUtils.cpp rename to rpcs3/Emu/RSX/Common/TextureUtils.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/Common/TextureUtils.h b/rpcs3/Emu/RSX/Common/TextureUtils.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Common/TextureUtils.h rename to rpcs3/Emu/RSX/Common/TextureUtils.h diff --git a/rpcs3/rpcs3/Emu/RSX/Common/bitfield.hpp b/rpcs3/Emu/RSX/Common/bitfield.hpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Common/bitfield.hpp rename to rpcs3/Emu/RSX/Common/bitfield.hpp diff --git a/rpcs3/rpcs3/Emu/RSX/Common/buffer_stream.hpp b/rpcs3/Emu/RSX/Common/buffer_stream.hpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Common/buffer_stream.hpp rename to rpcs3/Emu/RSX/Common/buffer_stream.hpp diff --git a/rpcs3/rpcs3/Emu/RSX/Common/expected.hpp b/rpcs3/Emu/RSX/Common/expected.hpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Common/expected.hpp rename to rpcs3/Emu/RSX/Common/expected.hpp diff --git a/rpcs3/rpcs3/Emu/RSX/Common/io_buffer.h b/rpcs3/Emu/RSX/Common/io_buffer.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Common/io_buffer.h rename to rpcs3/Emu/RSX/Common/io_buffer.h diff --git a/rpcs3/rpcs3/Emu/RSX/Common/profiling_timer.hpp b/rpcs3/Emu/RSX/Common/profiling_timer.hpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Common/profiling_timer.hpp rename to rpcs3/Emu/RSX/Common/profiling_timer.hpp diff --git a/rpcs3/rpcs3/Emu/RSX/Common/ranged_map.hpp b/rpcs3/Emu/RSX/Common/ranged_map.hpp similarity index 94% rename from rpcs3/rpcs3/Emu/RSX/Common/ranged_map.hpp rename to rpcs3/Emu/RSX/Common/ranged_map.hpp index 94a8ee112..1632c2d14 100644 --- a/rpcs3/rpcs3/Emu/RSX/Common/ranged_map.hpp +++ b/rpcs3/Emu/RSX/Common/ranged_map.hpp @@ -1,7 +1,7 @@ #pragma once #include -#include "Utilities/address_range.h" +#include "util/address_range.h" #include diff --git a/rpcs3/rpcs3/Emu/RSX/Common/ring_buffer_helper.h b/rpcs3/Emu/RSX/Common/ring_buffer_helper.h similarity index 99% rename from rpcs3/rpcs3/Emu/RSX/Common/ring_buffer_helper.h rename to rpcs3/Emu/RSX/Common/ring_buffer_helper.h index 6b602ee05..babc24595 100644 --- a/rpcs3/rpcs3/Emu/RSX/Common/ring_buffer_helper.h +++ b/rpcs3/Emu/RSX/Common/ring_buffer_helper.h @@ -1,6 +1,6 @@ #pragma once -#include "Utilities/StrFmt.h" +#include "util/StrFmt.h" #include "util/asm.hpp" /** diff --git a/rpcs3/rpcs3/Emu/RSX/Common/simple_array.hpp b/rpcs3/Emu/RSX/Common/simple_array.hpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Common/simple_array.hpp rename to rpcs3/Emu/RSX/Common/simple_array.hpp diff --git a/rpcs3/rpcs3/Emu/RSX/Common/surface_cache_dma.hpp b/rpcs3/Emu/RSX/Common/surface_cache_dma.hpp similarity index 98% rename from rpcs3/rpcs3/Emu/RSX/Common/surface_cache_dma.hpp rename to rpcs3/Emu/RSX/Common/surface_cache_dma.hpp index 07491b4ae..dd5ff8edb 100644 --- a/rpcs3/rpcs3/Emu/RSX/Common/surface_cache_dma.hpp +++ b/rpcs3/Emu/RSX/Common/surface_cache_dma.hpp @@ -1,7 +1,7 @@ #pragma once #include -#include "Utilities/address_range.h" +#include "util/address_range.h" namespace rsx { diff --git a/rpcs3/rpcs3/Emu/RSX/Common/surface_store.cpp b/rpcs3/Emu/RSX/Common/surface_store.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Common/surface_store.cpp rename to rpcs3/Emu/RSX/Common/surface_store.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/Common/surface_store.h b/rpcs3/Emu/RSX/Common/surface_store.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Common/surface_store.h rename to rpcs3/Emu/RSX/Common/surface_store.h diff --git a/rpcs3/rpcs3/Emu/RSX/Common/surface_utils.h b/rpcs3/Emu/RSX/Common/surface_utils.h similarity index 99% rename from rpcs3/rpcs3/Emu/RSX/Common/surface_utils.h rename to rpcs3/Emu/RSX/Common/surface_utils.h index b4b22fe7e..3f6efbfa1 100644 --- a/rpcs3/rpcs3/Emu/RSX/Common/surface_utils.h +++ b/rpcs3/Emu/RSX/Common/surface_utils.h @@ -1,7 +1,7 @@ #pragma once #include "util/types.hpp" -#include "Utilities/geometry.h" +#include "util/geometry.h" #include "TextureUtils.h" #include "../rsx_utils.h" #include "Emu/Memory/vm.h" diff --git a/rpcs3/rpcs3/Emu/RSX/Common/texture_cache.cpp b/rpcs3/Emu/RSX/Common/texture_cache.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/RSX/Common/texture_cache.cpp rename to rpcs3/Emu/RSX/Common/texture_cache.cpp index 0a1ce43ed..37d7c1e93 100644 --- a/rpcs3/rpcs3/Emu/RSX/Common/texture_cache.cpp +++ b/rpcs3/Emu/RSX/Common/texture_cache.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "texture_cache_utils.h" -#include "Utilities/address_range.h" +#include "util/address_range.h" #include "util/fnv_hash.hpp" namespace rsx diff --git a/rpcs3/rpcs3/Emu/RSX/Common/texture_cache.h b/rpcs3/Emu/RSX/Common/texture_cache.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Common/texture_cache.h rename to rpcs3/Emu/RSX/Common/texture_cache.h diff --git a/rpcs3/rpcs3/Emu/RSX/Common/texture_cache_checker.h b/rpcs3/Emu/RSX/Common/texture_cache_checker.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Common/texture_cache_checker.h rename to rpcs3/Emu/RSX/Common/texture_cache_checker.h diff --git a/rpcs3/rpcs3/Emu/RSX/Common/texture_cache_helpers.h b/rpcs3/Emu/RSX/Common/texture_cache_helpers.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Common/texture_cache_helpers.h rename to rpcs3/Emu/RSX/Common/texture_cache_helpers.h diff --git a/rpcs3/rpcs3/Emu/RSX/Common/texture_cache_predictor.h b/rpcs3/Emu/RSX/Common/texture_cache_predictor.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Common/texture_cache_predictor.h rename to rpcs3/Emu/RSX/Common/texture_cache_predictor.h diff --git a/rpcs3/rpcs3/Emu/RSX/Common/texture_cache_types.cpp b/rpcs3/Emu/RSX/Common/texture_cache_types.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Common/texture_cache_types.cpp rename to rpcs3/Emu/RSX/Common/texture_cache_types.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/Common/texture_cache_types.h b/rpcs3/Emu/RSX/Common/texture_cache_types.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Common/texture_cache_types.h rename to rpcs3/Emu/RSX/Common/texture_cache_types.h diff --git a/rpcs3/rpcs3/Emu/RSX/Common/texture_cache_utils.h b/rpcs3/Emu/RSX/Common/texture_cache_utils.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Common/texture_cache_utils.h rename to rpcs3/Emu/RSX/Common/texture_cache_utils.h diff --git a/rpcs3/rpcs3/Emu/RSX/Common/tiled_dma_copy.hpp b/rpcs3/Emu/RSX/Common/tiled_dma_copy.hpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Common/tiled_dma_copy.hpp rename to rpcs3/Emu/RSX/Common/tiled_dma_copy.hpp diff --git a/rpcs3/rpcs3/Emu/RSX/Common/time.hpp b/rpcs3/Emu/RSX/Common/time.hpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Common/time.hpp rename to rpcs3/Emu/RSX/Common/time.hpp diff --git a/rpcs3/rpcs3/Emu/RSX/Common/unordered_map.hpp b/rpcs3/Emu/RSX/Common/unordered_map.hpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Common/unordered_map.hpp rename to rpcs3/Emu/RSX/Common/unordered_map.hpp diff --git a/rpcs3/rpcs3/Emu/RSX/Core/RSXContext.cpp b/rpcs3/Emu/RSX/Core/RSXContext.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Core/RSXContext.cpp rename to rpcs3/Emu/RSX/Core/RSXContext.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/Core/RSXContext.h b/rpcs3/Emu/RSX/Core/RSXContext.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Core/RSXContext.h rename to rpcs3/Emu/RSX/Core/RSXContext.h diff --git a/rpcs3/rpcs3/Emu/RSX/Core/RSXDisplay.cpp b/rpcs3/Emu/RSX/Core/RSXDisplay.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Core/RSXDisplay.cpp rename to rpcs3/Emu/RSX/Core/RSXDisplay.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/Core/RSXDisplay.h b/rpcs3/Emu/RSX/Core/RSXDisplay.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Core/RSXDisplay.h rename to rpcs3/Emu/RSX/Core/RSXDisplay.h diff --git a/rpcs3/rpcs3/Emu/RSX/Core/RSXDrawCommands.cpp b/rpcs3/Emu/RSX/Core/RSXDrawCommands.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Core/RSXDrawCommands.cpp rename to rpcs3/Emu/RSX/Core/RSXDrawCommands.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/Core/RSXDrawCommands.h b/rpcs3/Emu/RSX/Core/RSXDrawCommands.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Core/RSXDrawCommands.h rename to rpcs3/Emu/RSX/Core/RSXDrawCommands.h diff --git a/rpcs3/rpcs3/Emu/RSX/Core/RSXDriverState.h b/rpcs3/Emu/RSX/Core/RSXDriverState.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Core/RSXDriverState.h rename to rpcs3/Emu/RSX/Core/RSXDriverState.h diff --git a/rpcs3/rpcs3/Emu/RSX/Core/RSXEngLock.hpp b/rpcs3/Emu/RSX/Core/RSXEngLock.hpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Core/RSXEngLock.hpp rename to rpcs3/Emu/RSX/Core/RSXEngLock.hpp diff --git a/rpcs3/rpcs3/Emu/RSX/Core/RSXFrameBuffer.h b/rpcs3/Emu/RSX/Core/RSXFrameBuffer.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Core/RSXFrameBuffer.h rename to rpcs3/Emu/RSX/Core/RSXFrameBuffer.h diff --git a/rpcs3/rpcs3/Emu/RSX/Core/RSXIOMap.hpp b/rpcs3/Emu/RSX/Core/RSXIOMap.hpp similarity index 93% rename from rpcs3/rpcs3/Emu/RSX/Core/RSXIOMap.hpp rename to rpcs3/Emu/RSX/Core/RSXIOMap.hpp index cacc39e13..14134ea09 100644 --- a/rpcs3/rpcs3/Emu/RSX/Core/RSXIOMap.hpp +++ b/rpcs3/Emu/RSX/Core/RSXIOMap.hpp @@ -1,7 +1,7 @@ #pragma once #include -#include "Utilities/mutex.h" +#include "util/mutex.h" #include "Emu/CPU/CPUThread.h" namespace rsx diff --git a/rpcs3/rpcs3/Emu/RSX/Core/RSXReservationLock.hpp b/rpcs3/Emu/RSX/Core/RSXReservationLock.hpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Core/RSXReservationLock.hpp rename to rpcs3/Emu/RSX/Core/RSXReservationLock.hpp diff --git a/rpcs3/rpcs3/Emu/RSX/Core/RSXVertexTypes.h b/rpcs3/Emu/RSX/Core/RSXVertexTypes.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Core/RSXVertexTypes.h rename to rpcs3/Emu/RSX/Core/RSXVertexTypes.h diff --git a/rpcs3/rpcs3/Emu/RSX/GCM.h b/rpcs3/Emu/RSX/GCM.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GCM.h rename to rpcs3/Emu/RSX/GCM.h diff --git a/rpcs3/rpcs3/Emu/RSX/GL/GLCommonDecompiler.cpp b/rpcs3/Emu/RSX/GL/GLCommonDecompiler.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/GLCommonDecompiler.cpp rename to rpcs3/Emu/RSX/GL/GLCommonDecompiler.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/GL/GLCommonDecompiler.h b/rpcs3/Emu/RSX/GL/GLCommonDecompiler.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/GLCommonDecompiler.h rename to rpcs3/Emu/RSX/GL/GLCommonDecompiler.h diff --git a/rpcs3/rpcs3/Emu/RSX/GL/GLCompute.cpp b/rpcs3/Emu/RSX/GL/GLCompute.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/RSX/GL/GLCompute.cpp rename to rpcs3/Emu/RSX/GL/GLCompute.cpp index 407898022..7fe9c342f 100644 --- a/rpcs3/rpcs3/Emu/RSX/GL/GLCompute.cpp +++ b/rpcs3/Emu/RSX/GL/GLCompute.cpp @@ -1,6 +1,6 @@ #include "GLCompute.h" #include "GLTexture.h" -#include "Utilities/StrUtil.h" +#include "util/StrUtil.h" namespace gl { diff --git a/rpcs3/rpcs3/Emu/RSX/GL/GLCompute.h b/rpcs3/Emu/RSX/GL/GLCompute.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/GLCompute.h rename to rpcs3/Emu/RSX/GL/GLCompute.h diff --git a/rpcs3/rpcs3/Emu/RSX/GL/GLDMA.cpp b/rpcs3/Emu/RSX/GL/GLDMA.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/GLDMA.cpp rename to rpcs3/Emu/RSX/GL/GLDMA.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/GL/GLDMA.h b/rpcs3/Emu/RSX/GL/GLDMA.h similarity index 92% rename from rpcs3/rpcs3/Emu/RSX/GL/GLDMA.h rename to rpcs3/Emu/RSX/GL/GLDMA.h index dfb24f751..41bf5cbc3 100644 --- a/rpcs3/rpcs3/Emu/RSX/GL/GLDMA.h +++ b/rpcs3/Emu/RSX/GL/GLDMA.h @@ -1,7 +1,7 @@ #pragma once #include -#include "Utilities/address_range.h" +#include "util/address_range.h" #include "glutils/buffer_object.h" diff --git a/rpcs3/rpcs3/Emu/RSX/GL/GLDraw.cpp b/rpcs3/Emu/RSX/GL/GLDraw.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/GLDraw.cpp rename to rpcs3/Emu/RSX/GL/GLDraw.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/GL/GLFragmentProgram.cpp b/rpcs3/Emu/RSX/GL/GLFragmentProgram.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/GLFragmentProgram.cpp rename to rpcs3/Emu/RSX/GL/GLFragmentProgram.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/GL/GLFragmentProgram.h b/rpcs3/Emu/RSX/GL/GLFragmentProgram.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/GLFragmentProgram.h rename to rpcs3/Emu/RSX/GL/GLFragmentProgram.h diff --git a/rpcs3/rpcs3/Emu/RSX/GL/GLGSRender.cpp b/rpcs3/Emu/RSX/GL/GLGSRender.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/GLGSRender.cpp rename to rpcs3/Emu/RSX/GL/GLGSRender.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/GL/GLGSRender.h b/rpcs3/Emu/RSX/GL/GLGSRender.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/GLGSRender.h rename to rpcs3/Emu/RSX/GL/GLGSRender.h diff --git a/rpcs3/rpcs3/Emu/RSX/GL/GLHelpers.cpp b/rpcs3/Emu/RSX/GL/GLHelpers.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/GLHelpers.cpp rename to rpcs3/Emu/RSX/GL/GLHelpers.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/GL/GLHelpers.h b/rpcs3/Emu/RSX/GL/GLHelpers.h similarity index 89% rename from rpcs3/rpcs3/Emu/RSX/GL/GLHelpers.h rename to rpcs3/Emu/RSX/GL/GLHelpers.h index db9bbaef2..bc920493d 100644 --- a/rpcs3/rpcs3/Emu/RSX/GL/GLHelpers.h +++ b/rpcs3/Emu/RSX/GL/GLHelpers.h @@ -11,9 +11,9 @@ #include "../Common/TextureUtils.h" #include "../Program/GLSLTypes.h" -#include "Utilities/mutex.h" -#include "Utilities/geometry.h" -#include "Utilities/File.h" +#include "util/mutex.h" +#include "util/geometry.h" +#include "util/File.h" #include "util/logs.hpp" #include "util/asm.hpp" diff --git a/rpcs3/rpcs3/Emu/RSX/GL/GLOverlays.cpp b/rpcs3/Emu/RSX/GL/GLOverlays.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/RSX/GL/GLOverlays.cpp rename to rpcs3/Emu/RSX/GL/GLOverlays.cpp index 33e1e0507..3f90883a1 100644 --- a/rpcs3/rpcs3/Emu/RSX/GL/GLOverlays.cpp +++ b/rpcs3/Emu/RSX/GL/GLOverlays.cpp @@ -1,6 +1,6 @@ #include "GLOverlays.h" -#include "Utilities/StrUtil.h" +#include "util/StrUtil.h" #include "../Program/RSXOverlay.h" #include "Emu/Cell/timers.hpp" diff --git a/rpcs3/rpcs3/Emu/RSX/GL/GLOverlays.h b/rpcs3/Emu/RSX/GL/GLOverlays.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/GLOverlays.h rename to rpcs3/Emu/RSX/GL/GLOverlays.h diff --git a/rpcs3/rpcs3/Emu/RSX/GL/GLPipelineCompiler.cpp b/rpcs3/Emu/RSX/GL/GLPipelineCompiler.cpp similarity index 95% rename from rpcs3/rpcs3/Emu/RSX/GL/GLPipelineCompiler.cpp rename to rpcs3/Emu/RSX/GL/GLPipelineCompiler.cpp index 6a9fe12a9..3ff0ea63f 100644 --- a/rpcs3/rpcs3/Emu/RSX/GL/GLPipelineCompiler.cpp +++ b/rpcs3/Emu/RSX/GL/GLPipelineCompiler.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "GLPipelineCompiler.h" -#include "Utilities/Thread.h" +#include "util/Thread.h" #include "util/sysinfo.hpp" namespace gl diff --git a/rpcs3/rpcs3/Emu/RSX/GL/GLPipelineCompiler.h b/rpcs3/Emu/RSX/GL/GLPipelineCompiler.h similarity index 94% rename from rpcs3/rpcs3/Emu/RSX/GL/GLPipelineCompiler.h rename to rpcs3/Emu/RSX/GL/GLPipelineCompiler.h index f70994d8b..ad35e8c0c 100644 --- a/rpcs3/rpcs3/Emu/RSX/GL/GLPipelineCompiler.h +++ b/rpcs3/Emu/RSX/GL/GLPipelineCompiler.h @@ -2,7 +2,7 @@ #include "GLHelpers.h" #include "glutils/program.h" #include "Emu/RSX/display.h" -#include "Utilities/lockless.h" +#include "util/lockless.h" namespace gl { diff --git a/rpcs3/rpcs3/Emu/RSX/GL/GLPresent.cpp b/rpcs3/Emu/RSX/GL/GLPresent.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/RSX/GL/GLPresent.cpp rename to rpcs3/Emu/RSX/GL/GLPresent.cpp index 1379c56d4..f09ca3796 100644 --- a/rpcs3/rpcs3/Emu/RSX/GL/GLPresent.cpp +++ b/rpcs3/Emu/RSX/GL/GLPresent.cpp @@ -5,7 +5,7 @@ #include "upscalers/fsr_pass.h" #include "upscalers/nearest_pass.hpp" -#include "Emu/Cell/Modules/cellVideoOut.h" +#include "rpcsx/fw/ps3/cellVideoOut.h" #include "Emu/RSX/Overlays/overlay_manager.h" #include "Emu/RSX/Overlays/overlay_debug_overlay.h" diff --git a/rpcs3/rpcs3/Emu/RSX/GL/GLProcTable.h b/rpcs3/Emu/RSX/GL/GLProcTable.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/GLProcTable.h rename to rpcs3/Emu/RSX/GL/GLProcTable.h diff --git a/rpcs3/rpcs3/Emu/RSX/GL/GLProgramBuffer.h b/rpcs3/Emu/RSX/GL/GLProgramBuffer.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/GLProgramBuffer.h rename to rpcs3/Emu/RSX/GL/GLProgramBuffer.h diff --git a/rpcs3/rpcs3/Emu/RSX/GL/GLRenderTargets.cpp b/rpcs3/Emu/RSX/GL/GLRenderTargets.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/GLRenderTargets.cpp rename to rpcs3/Emu/RSX/GL/GLRenderTargets.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/GL/GLRenderTargets.h b/rpcs3/Emu/RSX/GL/GLRenderTargets.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/GLRenderTargets.h rename to rpcs3/Emu/RSX/GL/GLRenderTargets.h diff --git a/rpcs3/rpcs3/Emu/RSX/GL/GLResolveHelper.cpp b/rpcs3/Emu/RSX/GL/GLResolveHelper.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/GLResolveHelper.cpp rename to rpcs3/Emu/RSX/GL/GLResolveHelper.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/GL/GLResolveHelper.h b/rpcs3/Emu/RSX/GL/GLResolveHelper.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/GLResolveHelper.h rename to rpcs3/Emu/RSX/GL/GLResolveHelper.h diff --git a/rpcs3/rpcs3/Emu/RSX/GL/GLShaderInterpreter.cpp b/rpcs3/Emu/RSX/GL/GLShaderInterpreter.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/GLShaderInterpreter.cpp rename to rpcs3/Emu/RSX/GL/GLShaderInterpreter.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/GL/GLShaderInterpreter.h b/rpcs3/Emu/RSX/GL/GLShaderInterpreter.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/GLShaderInterpreter.h rename to rpcs3/Emu/RSX/GL/GLShaderInterpreter.h diff --git a/rpcs3/rpcs3/Emu/RSX/GL/GLTexture.cpp b/rpcs3/Emu/RSX/GL/GLTexture.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/GLTexture.cpp rename to rpcs3/Emu/RSX/GL/GLTexture.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/GL/GLTexture.h b/rpcs3/Emu/RSX/GL/GLTexture.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/GLTexture.h rename to rpcs3/Emu/RSX/GL/GLTexture.h diff --git a/rpcs3/rpcs3/Emu/RSX/GL/GLTextureCache.cpp b/rpcs3/Emu/RSX/GL/GLTextureCache.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/GLTextureCache.cpp rename to rpcs3/Emu/RSX/GL/GLTextureCache.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/GL/GLTextureCache.h b/rpcs3/Emu/RSX/GL/GLTextureCache.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/GLTextureCache.h rename to rpcs3/Emu/RSX/GL/GLTextureCache.h diff --git a/rpcs3/rpcs3/Emu/RSX/GL/GLVertexBuffers.cpp b/rpcs3/Emu/RSX/GL/GLVertexBuffers.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/GLVertexBuffers.cpp rename to rpcs3/Emu/RSX/GL/GLVertexBuffers.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/GL/GLVertexProgram.cpp b/rpcs3/Emu/RSX/GL/GLVertexProgram.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/GLVertexProgram.cpp rename to rpcs3/Emu/RSX/GL/GLVertexProgram.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/GL/GLVertexProgram.h b/rpcs3/Emu/RSX/GL/GLVertexProgram.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/GLVertexProgram.h rename to rpcs3/Emu/RSX/GL/GLVertexProgram.h diff --git a/rpcs3/rpcs3/Emu/RSX/GL/OpenGL.cpp b/rpcs3/Emu/RSX/GL/OpenGL.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/OpenGL.cpp rename to rpcs3/Emu/RSX/GL/OpenGL.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/GL/OpenGL.h b/rpcs3/Emu/RSX/GL/OpenGL.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/OpenGL.h rename to rpcs3/Emu/RSX/GL/OpenGL.h diff --git a/rpcs3/rpcs3/Emu/RSX/GL/glutils/blitter.cpp b/rpcs3/Emu/RSX/GL/glutils/blitter.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/glutils/blitter.cpp rename to rpcs3/Emu/RSX/GL/glutils/blitter.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/GL/glutils/blitter.h b/rpcs3/Emu/RSX/GL/glutils/blitter.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/glutils/blitter.h rename to rpcs3/Emu/RSX/GL/glutils/blitter.h diff --git a/rpcs3/rpcs3/Emu/RSX/GL/glutils/buffer_object.cpp b/rpcs3/Emu/RSX/GL/glutils/buffer_object.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/glutils/buffer_object.cpp rename to rpcs3/Emu/RSX/GL/glutils/buffer_object.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/GL/glutils/buffer_object.h b/rpcs3/Emu/RSX/GL/glutils/buffer_object.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/glutils/buffer_object.h rename to rpcs3/Emu/RSX/GL/glutils/buffer_object.h diff --git a/rpcs3/rpcs3/Emu/RSX/GL/glutils/capabilities.cpp b/rpcs3/Emu/RSX/GL/glutils/capabilities.cpp similarity index 96% rename from rpcs3/rpcs3/Emu/RSX/GL/glutils/capabilities.cpp rename to rpcs3/Emu/RSX/GL/glutils/capabilities.cpp index 022e5cca8..c4599dbe2 100644 --- a/rpcs3/rpcs3/Emu/RSX/GL/glutils/capabilities.cpp +++ b/rpcs3/Emu/RSX/GL/glutils/capabilities.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "capabilities.h" -#include "Utilities/StrUtil.h" +#include "util/StrUtil.h" #include diff --git a/rpcs3/rpcs3/Emu/RSX/GL/glutils/capabilities.h b/rpcs3/Emu/RSX/GL/glutils/capabilities.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/glutils/capabilities.h rename to rpcs3/Emu/RSX/GL/glutils/capabilities.h diff --git a/rpcs3/rpcs3/Emu/RSX/GL/glutils/common.cpp b/rpcs3/Emu/RSX/GL/glutils/common.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/glutils/common.cpp rename to rpcs3/Emu/RSX/GL/glutils/common.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/GL/glutils/common.h b/rpcs3/Emu/RSX/GL/glutils/common.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/glutils/common.h rename to rpcs3/Emu/RSX/GL/glutils/common.h diff --git a/rpcs3/rpcs3/Emu/RSX/GL/glutils/fbo.cpp b/rpcs3/Emu/RSX/GL/glutils/fbo.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/glutils/fbo.cpp rename to rpcs3/Emu/RSX/GL/glutils/fbo.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/GL/glutils/fbo.h b/rpcs3/Emu/RSX/GL/glutils/fbo.h similarity index 95% rename from rpcs3/rpcs3/Emu/RSX/GL/glutils/fbo.h rename to rpcs3/Emu/RSX/GL/glutils/fbo.h index 7b84a25e5..4e9c7cf62 100644 --- a/rpcs3/rpcs3/Emu/RSX/GL/glutils/fbo.h +++ b/rpcs3/Emu/RSX/GL/glutils/fbo.h @@ -4,7 +4,7 @@ #include "image.h" #include "pixel_settings.hpp" -#include "Utilities/geometry.h" +#include "util/geometry.h" namespace gl { diff --git a/rpcs3/rpcs3/Emu/RSX/GL/glutils/image.cpp b/rpcs3/Emu/RSX/GL/glutils/image.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/glutils/image.cpp rename to rpcs3/Emu/RSX/GL/glutils/image.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/GL/glutils/image.h b/rpcs3/Emu/RSX/GL/glutils/image.h similarity index 95% rename from rpcs3/rpcs3/Emu/RSX/GL/glutils/image.h rename to rpcs3/Emu/RSX/GL/glutils/image.h index 1d4b5930c..9f677d9bd 100644 --- a/rpcs3/rpcs3/Emu/RSX/GL/glutils/image.h +++ b/rpcs3/Emu/RSX/GL/glutils/image.h @@ -2,7 +2,7 @@ #include "common.h" -#include "Utilities/geometry.h" +#include "util/geometry.h" #include "Emu/RSX/Common/TextureUtils.h" // using enum rsx::format_class; diff --git a/rpcs3/rpcs3/Emu/RSX/GL/glutils/pixel_settings.hpp b/rpcs3/Emu/RSX/GL/glutils/pixel_settings.hpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/glutils/pixel_settings.hpp rename to rpcs3/Emu/RSX/GL/glutils/pixel_settings.hpp diff --git a/rpcs3/rpcs3/Emu/RSX/GL/glutils/program.cpp b/rpcs3/Emu/RSX/GL/glutils/program.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/glutils/program.cpp rename to rpcs3/Emu/RSX/GL/glutils/program.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/GL/glutils/program.h b/rpcs3/Emu/RSX/GL/glutils/program.h similarity index 93% rename from rpcs3/rpcs3/Emu/RSX/GL/glutils/program.h rename to rpcs3/Emu/RSX/GL/glutils/program.h index 067d8bef5..47013ada6 100644 --- a/rpcs3/rpcs3/Emu/RSX/GL/glutils/program.h +++ b/rpcs3/Emu/RSX/GL/glutils/program.h @@ -4,8 +4,8 @@ #include "sync.hpp" #include "Emu/RSX/Program/GLSLTypes.h" -#include "Utilities/geometry.h" -#include "Utilities/mutex.h" +#include "util/geometry.h" +#include "util/mutex.h" namespace gl { diff --git a/rpcs3/rpcs3/Emu/RSX/GL/glutils/ring_buffer.cpp b/rpcs3/Emu/RSX/GL/glutils/ring_buffer.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/glutils/ring_buffer.cpp rename to rpcs3/Emu/RSX/GL/glutils/ring_buffer.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/GL/glutils/ring_buffer.h b/rpcs3/Emu/RSX/GL/glutils/ring_buffer.h similarity index 94% rename from rpcs3/rpcs3/Emu/RSX/GL/glutils/ring_buffer.h rename to rpcs3/Emu/RSX/GL/glutils/ring_buffer.h index 88f08fd32..99422fa43 100644 --- a/rpcs3/rpcs3/Emu/RSX/GL/glutils/ring_buffer.h +++ b/rpcs3/Emu/RSX/GL/glutils/ring_buffer.h @@ -2,7 +2,7 @@ #include "buffer_object.h" #include "sync.hpp" -#include "Utilities/address_range.h" +#include "util/address_range.h" namespace gl { diff --git a/rpcs3/rpcs3/Emu/RSX/GL/glutils/sampler.cpp b/rpcs3/Emu/RSX/GL/glutils/sampler.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/glutils/sampler.cpp rename to rpcs3/Emu/RSX/GL/glutils/sampler.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/GL/glutils/sampler.h b/rpcs3/Emu/RSX/GL/glutils/sampler.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/glutils/sampler.h rename to rpcs3/Emu/RSX/GL/glutils/sampler.h diff --git a/rpcs3/rpcs3/Emu/RSX/GL/glutils/state_tracker.hpp b/rpcs3/Emu/RSX/GL/glutils/state_tracker.hpp similarity index 95% rename from rpcs3/rpcs3/Emu/RSX/GL/glutils/state_tracker.hpp rename to rpcs3/Emu/RSX/GL/glutils/state_tracker.hpp index 66d6e513a..0b4e37de4 100644 --- a/rpcs3/rpcs3/Emu/RSX/GL/glutils/state_tracker.hpp +++ b/rpcs3/Emu/RSX/GL/glutils/state_tracker.hpp @@ -2,7 +2,7 @@ #include "capabilities.h" -#include "Utilities/geometry.h" +#include "util/geometry.h" #include namespace gl diff --git a/rpcs3/rpcs3/Emu/RSX/GL/glutils/sync.hpp b/rpcs3/Emu/RSX/GL/glutils/sync.hpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/glutils/sync.hpp rename to rpcs3/Emu/RSX/GL/glutils/sync.hpp diff --git a/rpcs3/rpcs3/Emu/RSX/GL/glutils/vao.hpp b/rpcs3/Emu/RSX/GL/glutils/vao.hpp similarity index 94% rename from rpcs3/rpcs3/Emu/RSX/GL/glutils/vao.hpp rename to rpcs3/Emu/RSX/GL/glutils/vao.hpp index 6488b47b4..111ce93c9 100644 --- a/rpcs3/rpcs3/Emu/RSX/GL/glutils/vao.hpp +++ b/rpcs3/Emu/RSX/GL/glutils/vao.hpp @@ -3,7 +3,7 @@ #include "common.h" #include "buffer_object.h" -#include "Utilities/geometry.h" +#include "util/geometry.h" namespace gl { diff --git a/rpcs3/rpcs3/Emu/RSX/GL/upscalers/bilinear_pass.hpp b/rpcs3/Emu/RSX/GL/upscalers/bilinear_pass.hpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/upscalers/bilinear_pass.hpp rename to rpcs3/Emu/RSX/GL/upscalers/bilinear_pass.hpp diff --git a/rpcs3/rpcs3/Emu/RSX/GL/upscalers/fsr1/fsr_pass.cpp b/rpcs3/Emu/RSX/GL/upscalers/fsr1/fsr_pass.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/upscalers/fsr1/fsr_pass.cpp rename to rpcs3/Emu/RSX/GL/upscalers/fsr1/fsr_pass.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/GL/upscalers/fsr_pass.h b/rpcs3/Emu/RSX/GL/upscalers/fsr_pass.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/upscalers/fsr_pass.h rename to rpcs3/Emu/RSX/GL/upscalers/fsr_pass.h diff --git a/rpcs3/rpcs3/Emu/RSX/GL/upscalers/nearest_pass.hpp b/rpcs3/Emu/RSX/GL/upscalers/nearest_pass.hpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/upscalers/nearest_pass.hpp rename to rpcs3/Emu/RSX/GL/upscalers/nearest_pass.hpp diff --git a/rpcs3/rpcs3/Emu/RSX/GL/upscalers/static_pass.hpp b/rpcs3/Emu/RSX/GL/upscalers/static_pass.hpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/upscalers/static_pass.hpp rename to rpcs3/Emu/RSX/GL/upscalers/static_pass.hpp diff --git a/rpcs3/rpcs3/Emu/RSX/GL/upscalers/upscaling.h b/rpcs3/Emu/RSX/GL/upscalers/upscaling.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GL/upscalers/upscaling.h rename to rpcs3/Emu/RSX/GL/upscalers/upscaling.h diff --git a/rpcs3/rpcs3/Emu/RSX/GSFrameBase.cpp b/rpcs3/Emu/RSX/GSFrameBase.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GSFrameBase.cpp rename to rpcs3/Emu/RSX/GSFrameBase.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/GSFrameBase.h b/rpcs3/Emu/RSX/GSFrameBase.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GSFrameBase.h rename to rpcs3/Emu/RSX/GSFrameBase.h diff --git a/rpcs3/rpcs3/Emu/RSX/GSRender.cpp b/rpcs3/Emu/RSX/GSRender.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GSRender.cpp rename to rpcs3/Emu/RSX/GSRender.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/GSRender.h b/rpcs3/Emu/RSX/GSRender.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/GSRender.h rename to rpcs3/Emu/RSX/GSRender.h diff --git a/rpcs3/rpcs3/Emu/RSX/Host/MM.cpp b/rpcs3/Emu/RSX/Host/MM.cpp similarity index 93% rename from rpcs3/rpcs3/Emu/RSX/Host/MM.cpp rename to rpcs3/Emu/RSX/Host/MM.cpp index 0b6019d27..18e80a6cf 100644 --- a/rpcs3/rpcs3/Emu/RSX/Host/MM.cpp +++ b/rpcs3/Emu/RSX/Host/MM.cpp @@ -6,8 +6,8 @@ #include #include #include -#include -#include +#include +#include namespace rsx { diff --git a/rpcs3/rpcs3/Emu/RSX/Host/MM.h b/rpcs3/Emu/RSX/Host/MM.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Host/MM.h rename to rpcs3/Emu/RSX/Host/MM.h diff --git a/rpcs3/rpcs3/Emu/RSX/Host/RSXDMAWriter.cpp b/rpcs3/Emu/RSX/Host/RSXDMAWriter.cpp similarity index 93% rename from rpcs3/rpcs3/Emu/RSX/Host/RSXDMAWriter.cpp rename to rpcs3/Emu/RSX/Host/RSXDMAWriter.cpp index d5c4d2c58..0afb82553 100644 --- a/rpcs3/rpcs3/Emu/RSX/Host/RSXDMAWriter.cpp +++ b/rpcs3/Emu/RSX/Host/RSXDMAWriter.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "RSXDMAWriter.h" -#include "Utilities//Thread.h" +#include "util//Thread.h" #include namespace rsx diff --git a/rpcs3/rpcs3/Emu/RSX/Host/RSXDMAWriter.h b/rpcs3/Emu/RSX/Host/RSXDMAWriter.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Host/RSXDMAWriter.h rename to rpcs3/Emu/RSX/Host/RSXDMAWriter.h diff --git a/rpcs3/rpcs3/Emu/RSX/NV47/FW/GRAPH_backend.h b/rpcs3/Emu/RSX/NV47/FW/GRAPH_backend.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/NV47/FW/GRAPH_backend.h rename to rpcs3/Emu/RSX/NV47/FW/GRAPH_backend.h diff --git a/rpcs3/rpcs3/Emu/RSX/NV47/FW/draw_call.cpp b/rpcs3/Emu/RSX/NV47/FW/draw_call.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/NV47/FW/draw_call.cpp rename to rpcs3/Emu/RSX/NV47/FW/draw_call.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/NV47/FW/draw_call.hpp b/rpcs3/Emu/RSX/NV47/FW/draw_call.hpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/NV47/FW/draw_call.hpp rename to rpcs3/Emu/RSX/NV47/FW/draw_call.hpp diff --git a/rpcs3/rpcs3/Emu/RSX/NV47/FW/draw_call.inc.h b/rpcs3/Emu/RSX/NV47/FW/draw_call.inc.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/NV47/FW/draw_call.inc.h rename to rpcs3/Emu/RSX/NV47/FW/draw_call.inc.h diff --git a/rpcs3/rpcs3/Emu/RSX/NV47/FW/reg_context.cpp b/rpcs3/Emu/RSX/NV47/FW/reg_context.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/NV47/FW/reg_context.cpp rename to rpcs3/Emu/RSX/NV47/FW/reg_context.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/NV47/FW/reg_context.h b/rpcs3/Emu/RSX/NV47/FW/reg_context.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/NV47/FW/reg_context.h rename to rpcs3/Emu/RSX/NV47/FW/reg_context.h diff --git a/rpcs3/rpcs3/Emu/RSX/NV47/HW/common.cpp b/rpcs3/Emu/RSX/NV47/HW/common.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/NV47/HW/common.cpp rename to rpcs3/Emu/RSX/NV47/HW/common.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/NV47/HW/common.h b/rpcs3/Emu/RSX/NV47/HW/common.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/NV47/HW/common.h rename to rpcs3/Emu/RSX/NV47/HW/common.h diff --git a/rpcs3/rpcs3/Emu/RSX/NV47/HW/context.h b/rpcs3/Emu/RSX/NV47/HW/context.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/NV47/HW/context.h rename to rpcs3/Emu/RSX/NV47/HW/context.h diff --git a/rpcs3/rpcs3/Emu/RSX/NV47/HW/context_accessors.define.h b/rpcs3/Emu/RSX/NV47/HW/context_accessors.define.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/NV47/HW/context_accessors.define.h rename to rpcs3/Emu/RSX/NV47/HW/context_accessors.define.h diff --git a/rpcs3/rpcs3/Emu/RSX/NV47/HW/context_accessors.undef.h b/rpcs3/Emu/RSX/NV47/HW/context_accessors.undef.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/NV47/HW/context_accessors.undef.h rename to rpcs3/Emu/RSX/NV47/HW/context_accessors.undef.h diff --git a/rpcs3/rpcs3/Emu/RSX/NV47/HW/nv0039.cpp b/rpcs3/Emu/RSX/NV47/HW/nv0039.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/NV47/HW/nv0039.cpp rename to rpcs3/Emu/RSX/NV47/HW/nv0039.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/NV47/HW/nv0039.h b/rpcs3/Emu/RSX/NV47/HW/nv0039.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/NV47/HW/nv0039.h rename to rpcs3/Emu/RSX/NV47/HW/nv0039.h diff --git a/rpcs3/rpcs3/Emu/RSX/NV47/HW/nv3089.cpp b/rpcs3/Emu/RSX/NV47/HW/nv3089.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/NV47/HW/nv3089.cpp rename to rpcs3/Emu/RSX/NV47/HW/nv3089.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/NV47/HW/nv3089.h b/rpcs3/Emu/RSX/NV47/HW/nv3089.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/NV47/HW/nv3089.h rename to rpcs3/Emu/RSX/NV47/HW/nv3089.h diff --git a/rpcs3/rpcs3/Emu/RSX/NV47/HW/nv308a.cpp b/rpcs3/Emu/RSX/NV47/HW/nv308a.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/NV47/HW/nv308a.cpp rename to rpcs3/Emu/RSX/NV47/HW/nv308a.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/NV47/HW/nv308a.h b/rpcs3/Emu/RSX/NV47/HW/nv308a.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/NV47/HW/nv308a.h rename to rpcs3/Emu/RSX/NV47/HW/nv308a.h diff --git a/rpcs3/rpcs3/Emu/RSX/NV47/HW/nv406e.cpp b/rpcs3/Emu/RSX/NV47/HW/nv406e.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/NV47/HW/nv406e.cpp rename to rpcs3/Emu/RSX/NV47/HW/nv406e.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/NV47/HW/nv406e.h b/rpcs3/Emu/RSX/NV47/HW/nv406e.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/NV47/HW/nv406e.h rename to rpcs3/Emu/RSX/NV47/HW/nv406e.h diff --git a/rpcs3/rpcs3/Emu/RSX/NV47/HW/nv4097.cpp b/rpcs3/Emu/RSX/NV47/HW/nv4097.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/NV47/HW/nv4097.cpp rename to rpcs3/Emu/RSX/NV47/HW/nv4097.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/NV47/HW/nv4097.h b/rpcs3/Emu/RSX/NV47/HW/nv4097.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/NV47/HW/nv4097.h rename to rpcs3/Emu/RSX/NV47/HW/nv4097.h diff --git a/rpcs3/rpcs3/Emu/RSX/NV47/HW/nv47.h b/rpcs3/Emu/RSX/NV47/HW/nv47.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/NV47/HW/nv47.h rename to rpcs3/Emu/RSX/NV47/HW/nv47.h diff --git a/rpcs3/rpcs3/Emu/RSX/NV47/HW/nv47_sync.hpp b/rpcs3/Emu/RSX/NV47/HW/nv47_sync.hpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/NV47/HW/nv47_sync.hpp rename to rpcs3/Emu/RSX/NV47/HW/nv47_sync.hpp diff --git a/rpcs3/rpcs3/Emu/RSX/Null/NullGSRender.cpp b/rpcs3/Emu/RSX/Null/NullGSRender.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Null/NullGSRender.cpp rename to rpcs3/Emu/RSX/Null/NullGSRender.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/Null/NullGSRender.h b/rpcs3/Emu/RSX/Null/NullGSRender.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Null/NullGSRender.h rename to rpcs3/Emu/RSX/Null/NullGSRender.h diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/FriendsList/overlay_friends_list_dialog.cpp b/rpcs3/Emu/RSX/Overlays/FriendsList/overlay_friends_list_dialog.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Overlays/FriendsList/overlay_friends_list_dialog.cpp rename to rpcs3/Emu/RSX/Overlays/FriendsList/overlay_friends_list_dialog.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/FriendsList/overlay_friends_list_dialog.h b/rpcs3/Emu/RSX/Overlays/FriendsList/overlay_friends_list_dialog.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Overlays/FriendsList/overlay_friends_list_dialog.h rename to rpcs3/Emu/RSX/Overlays/FriendsList/overlay_friends_list_dialog.h diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu.cpp b/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu.cpp rename to rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu.cpp index 77a35b4df..2c53bc06a 100644 --- a/rpcs3/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu.cpp +++ b/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu.cpp @@ -2,7 +2,7 @@ #include "overlay_home_menu.h" #include "../overlay_manager.h" #include "Emu/system_config.h" -#include "Utilities/date_time.h" +#include "util/date_time.h" namespace rsx { diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu.h b/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu.h rename to rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu.h diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_components.cpp b/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_components.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_components.cpp rename to rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_components.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_components.h b/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_components.h similarity index 99% rename from rpcs3/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_components.h rename to rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_components.h index 388b51b91..eb55e0ff0 100644 --- a/rpcs3/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_components.h +++ b/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_components.h @@ -2,7 +2,7 @@ #include "Emu/RSX/Overlays/overlays.h" #include "Emu/System.h" -#include "Utilities/Config.h" +#include "util/Config.h" namespace rsx { diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_main_menu.cpp b/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_main_menu.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_main_menu.cpp rename to rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_main_menu.cpp index 2ca8f4c5e..abae256c7 100644 --- a/rpcs3/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_main_menu.cpp +++ b/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_main_menu.cpp @@ -8,7 +8,7 @@ #include "Emu/RSX/Overlays/overlay_manager.h" #include "Emu/System.h" #include "Emu/system_config.h" -#include "Emu/Cell/Modules/sceNpTrophy.h" +#include "rpcsx/fw/ps3/sceNpTrophy.h" extern atomic_t g_user_asked_for_recording; extern atomic_t g_user_asked_for_screenshot; diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_main_menu.h b/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_main_menu.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_main_menu.h rename to rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_main_menu.h diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_message_box.cpp b/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_message_box.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_message_box.cpp rename to rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_message_box.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_message_box.h b/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_message_box.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_message_box.h rename to rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_message_box.h diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_page.cpp b/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_page.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_page.cpp rename to rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_page.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_page.h b/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_page.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_page.h rename to rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_page.h diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_savestate.cpp b/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_savestate.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_savestate.cpp rename to rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_savestate.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_savestate.h b/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_savestate.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_savestate.h rename to rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_savestate.h diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_settings.cpp b/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_settings.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_settings.cpp rename to rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_settings.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_settings.h b/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_settings.h similarity index 99% rename from rpcs3/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_settings.h rename to rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_settings.h index 7d5f9ccd0..a62d009b8 100644 --- a/rpcs3/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_settings.h +++ b/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_settings.h @@ -2,7 +2,7 @@ #include "overlay_home_menu_page.h" #include "Emu/System.h" -#include "Utilities/Config.h" +#include "util/Config.h" namespace rsx { diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/Network/overlay_recvmessage_dialog.cpp b/rpcs3/Emu/RSX/Overlays/Network/overlay_recvmessage_dialog.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Overlays/Network/overlay_recvmessage_dialog.cpp rename to rpcs3/Emu/RSX/Overlays/Network/overlay_recvmessage_dialog.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/Network/overlay_recvmessage_dialog.h b/rpcs3/Emu/RSX/Overlays/Network/overlay_recvmessage_dialog.h similarity index 97% rename from rpcs3/rpcs3/Emu/RSX/Overlays/Network/overlay_recvmessage_dialog.h rename to rpcs3/Emu/RSX/Overlays/Network/overlay_recvmessage_dialog.h index 58f5fe3bc..890c36b48 100644 --- a/rpcs3/rpcs3/Emu/RSX/Overlays/Network/overlay_recvmessage_dialog.h +++ b/rpcs3/Emu/RSX/Overlays/Network/overlay_recvmessage_dialog.h @@ -3,7 +3,7 @@ #include "../overlays.h" #include "../overlay_list_view.hpp" #include "Emu/Cell/ErrorCodes.h" -#include "Emu/Cell/Modules/sceNp.h" +#include "rpcsx/fw/ps3/sceNp.h" namespace rsx { diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/Network/overlay_sendmessage_dialog.cpp b/rpcs3/Emu/RSX/Overlays/Network/overlay_sendmessage_dialog.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/RSX/Overlays/Network/overlay_sendmessage_dialog.cpp rename to rpcs3/Emu/RSX/Overlays/Network/overlay_sendmessage_dialog.cpp index bc4712d40..fa117e61e 100644 --- a/rpcs3/rpcs3/Emu/RSX/Overlays/Network/overlay_sendmessage_dialog.cpp +++ b/rpcs3/Emu/RSX/Overlays/Network/overlay_sendmessage_dialog.cpp @@ -3,7 +3,7 @@ #include "overlay_sendmessage_dialog.h" #include "Emu/System.h" #include "Emu/NP/rpcn_client.h" -#include "Emu/Cell/Modules/cellMsgDialog.h" +#include "rpcsx/fw/ps3/cellMsgDialog.h" #include "Emu/Cell/PPUThread.h" // for vm_var #include "Emu/Memory/vm_var.h" #include "Emu/Io/interception.h" diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/Network/overlay_sendmessage_dialog.h b/rpcs3/Emu/RSX/Overlays/Network/overlay_sendmessage_dialog.h similarity index 95% rename from rpcs3/rpcs3/Emu/RSX/Overlays/Network/overlay_sendmessage_dialog.h rename to rpcs3/Emu/RSX/Overlays/Network/overlay_sendmessage_dialog.h index 70c163cee..0d02f5e54 100644 --- a/rpcs3/rpcs3/Emu/RSX/Overlays/Network/overlay_sendmessage_dialog.h +++ b/rpcs3/Emu/RSX/Overlays/Network/overlay_sendmessage_dialog.h @@ -3,7 +3,8 @@ #include "../overlays.h" #include "../overlay_list_view.hpp" #include "Emu/Cell/ErrorCodes.h" -#include "Emu/Cell/Modules/sceNp.h" +#include "rpcsx/fw/ps3/sceNp.h" +#include "util/mutex.h" namespace rsx { diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/Shaders/shader_loading_dialog.cpp b/rpcs3/Emu/RSX/Overlays/Shaders/shader_loading_dialog.cpp similarity index 97% rename from rpcs3/rpcs3/Emu/RSX/Overlays/Shaders/shader_loading_dialog.cpp rename to rpcs3/Emu/RSX/Overlays/Shaders/shader_loading_dialog.cpp index 317b38313..e83c702eb 100644 --- a/rpcs3/rpcs3/Emu/RSX/Overlays/Shaders/shader_loading_dialog.cpp +++ b/rpcs3/Emu/RSX/Overlays/Shaders/shader_loading_dialog.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "shader_loading_dialog.h" #include "Emu/System.h" -#include "Emu/Cell/Modules/cellMsgDialog.h" +#include "rpcsx/fw/ps3/cellMsgDialog.h" #include "util/asm.hpp" diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/Shaders/shader_loading_dialog.h b/rpcs3/Emu/RSX/Overlays/Shaders/shader_loading_dialog.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Overlays/Shaders/shader_loading_dialog.h rename to rpcs3/Emu/RSX/Overlays/Shaders/shader_loading_dialog.h diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/Shaders/shader_loading_dialog_native.cpp b/rpcs3/Emu/RSX/Overlays/Shaders/shader_loading_dialog_native.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Overlays/Shaders/shader_loading_dialog_native.cpp rename to rpcs3/Emu/RSX/Overlays/Shaders/shader_loading_dialog_native.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/Shaders/shader_loading_dialog_native.h b/rpcs3/Emu/RSX/Overlays/Shaders/shader_loading_dialog_native.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Overlays/Shaders/shader_loading_dialog_native.h rename to rpcs3/Emu/RSX/Overlays/Shaders/shader_loading_dialog_native.h diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/Trophies/overlay_trophy_list_dialog.cpp b/rpcs3/Emu/RSX/Overlays/Trophies/overlay_trophy_list_dialog.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/RSX/Overlays/Trophies/overlay_trophy_list_dialog.cpp rename to rpcs3/Emu/RSX/Overlays/Trophies/overlay_trophy_list_dialog.cpp index 852ca36ee..9f1e05d76 100644 --- a/rpcs3/rpcs3/Emu/RSX/Overlays/Trophies/overlay_trophy_list_dialog.cpp +++ b/rpcs3/Emu/RSX/Overlays/Trophies/overlay_trophy_list_dialog.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "../overlay_manager.h" #include "overlay_trophy_list_dialog.h" -#include "Emu/Cell/Modules/sceNpTrophy.h" +#include "rpcsx/fw/ps3/sceNpTrophy.h" #include "Emu/System.h" #include "Emu/VFS.h" diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/Trophies/overlay_trophy_list_dialog.h b/rpcs3/Emu/RSX/Overlays/Trophies/overlay_trophy_list_dialog.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Overlays/Trophies/overlay_trophy_list_dialog.h rename to rpcs3/Emu/RSX/Overlays/Trophies/overlay_trophy_list_dialog.h diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_animated_icon.cpp b/rpcs3/Emu/RSX/Overlays/overlay_animated_icon.cpp similarity index 95% rename from rpcs3/rpcs3/Emu/RSX/Overlays/overlay_animated_icon.cpp rename to rpcs3/Emu/RSX/Overlays/overlay_animated_icon.cpp index 0fc1c165b..efb9dad90 100644 --- a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_animated_icon.cpp +++ b/rpcs3/Emu/RSX/Overlays/overlay_animated_icon.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "overlay_animated_icon.h" -#include "Utilities/File.h" +#include "util/File.h" #include "Emu/Cell/timers.hpp" diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_animated_icon.h b/rpcs3/Emu/RSX/Overlays/overlay_animated_icon.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Overlays/overlay_animated_icon.h rename to rpcs3/Emu/RSX/Overlays/overlay_animated_icon.h diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_animation.cpp b/rpcs3/Emu/RSX/Overlays/overlay_animation.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Overlays/overlay_animation.cpp rename to rpcs3/Emu/RSX/Overlays/overlay_animation.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_animation.h b/rpcs3/Emu/RSX/Overlays/overlay_animation.h similarity index 98% rename from rpcs3/rpcs3/Emu/RSX/Overlays/overlay_animation.h rename to rpcs3/Emu/RSX/Overlays/overlay_animation.h index 16a00586a..11c9d255d 100644 --- a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_animation.h +++ b/rpcs3/Emu/RSX/Overlays/overlay_animation.h @@ -1,7 +1,7 @@ #pragma once #include "util/types.hpp" -#include "Utilities/geometry.h" +#include "util/geometry.h" #include "overlay_utils.h" #include diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_compile_notification.cpp b/rpcs3/Emu/RSX/Overlays/overlay_compile_notification.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Overlays/overlay_compile_notification.cpp rename to rpcs3/Emu/RSX/Overlays/overlay_compile_notification.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_compile_notification.h b/rpcs3/Emu/RSX/Overlays/overlay_compile_notification.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Overlays/overlay_compile_notification.h rename to rpcs3/Emu/RSX/Overlays/overlay_compile_notification.h diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_controls.cpp b/rpcs3/Emu/RSX/Overlays/overlay_controls.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/RSX/Overlays/overlay_controls.cpp rename to rpcs3/Emu/RSX/Overlays/overlay_controls.cpp index 90ab4a9d0..58a4d9d3c 100644 --- a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_controls.cpp +++ b/rpcs3/Emu/RSX/Overlays/overlay_controls.cpp @@ -3,8 +3,8 @@ #include "util/types.hpp" #include "util/logs.hpp" -#include "Utilities/geometry.h" -#include "Utilities/File.h" +#include "util/geometry.h" +#include "util/File.h" #include "Emu/Cell/timers.hpp" #ifndef _WIN32 diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_controls.h b/rpcs3/Emu/RSX/Overlays/overlay_controls.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Overlays/overlay_controls.h rename to rpcs3/Emu/RSX/Overlays/overlay_controls.h diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_cursor.cpp b/rpcs3/Emu/RSX/Overlays/overlay_cursor.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Overlays/overlay_cursor.cpp rename to rpcs3/Emu/RSX/Overlays/overlay_cursor.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_cursor.h b/rpcs3/Emu/RSX/Overlays/overlay_cursor.h similarity index 97% rename from rpcs3/rpcs3/Emu/RSX/Overlays/overlay_cursor.h rename to rpcs3/Emu/RSX/Overlays/overlay_cursor.h index d464c509f..244c9762d 100644 --- a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_cursor.h +++ b/rpcs3/Emu/RSX/Overlays/overlay_cursor.h @@ -1,7 +1,7 @@ #pragma once #include "overlays.h" -#include "Utilities/mutex.h" +#include "util/mutex.h" #include namespace rsx diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_debug_overlay.cpp b/rpcs3/Emu/RSX/Overlays/overlay_debug_overlay.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Overlays/overlay_debug_overlay.cpp rename to rpcs3/Emu/RSX/Overlays/overlay_debug_overlay.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_debug_overlay.h b/rpcs3/Emu/RSX/Overlays/overlay_debug_overlay.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Overlays/overlay_debug_overlay.h rename to rpcs3/Emu/RSX/Overlays/overlay_debug_overlay.h diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_edit_text.cpp b/rpcs3/Emu/RSX/Overlays/overlay_edit_text.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Overlays/overlay_edit_text.cpp rename to rpcs3/Emu/RSX/Overlays/overlay_edit_text.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_edit_text.hpp b/rpcs3/Emu/RSX/Overlays/overlay_edit_text.hpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Overlays/overlay_edit_text.hpp rename to rpcs3/Emu/RSX/Overlays/overlay_edit_text.hpp diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_fonts.cpp b/rpcs3/Emu/RSX/Overlays/overlay_fonts.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Overlays/overlay_fonts.cpp rename to rpcs3/Emu/RSX/Overlays/overlay_fonts.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_fonts.h b/rpcs3/Emu/RSX/Overlays/overlay_fonts.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Overlays/overlay_fonts.h rename to rpcs3/Emu/RSX/Overlays/overlay_fonts.h diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_list_view.cpp b/rpcs3/Emu/RSX/Overlays/overlay_list_view.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Overlays/overlay_list_view.cpp rename to rpcs3/Emu/RSX/Overlays/overlay_list_view.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_list_view.hpp b/rpcs3/Emu/RSX/Overlays/overlay_list_view.hpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Overlays/overlay_list_view.hpp rename to rpcs3/Emu/RSX/Overlays/overlay_list_view.hpp diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_loading_icon.hpp b/rpcs3/Emu/RSX/Overlays/overlay_loading_icon.hpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Overlays/overlay_loading_icon.hpp rename to rpcs3/Emu/RSX/Overlays/overlay_loading_icon.hpp diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_manager.cpp b/rpcs3/Emu/RSX/Overlays/overlay_manager.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Overlays/overlay_manager.cpp rename to rpcs3/Emu/RSX/Overlays/overlay_manager.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_manager.h b/rpcs3/Emu/RSX/Overlays/overlay_manager.h similarity index 95% rename from rpcs3/rpcs3/Emu/RSX/Overlays/overlay_manager.h rename to rpcs3/Emu/RSX/Overlays/overlay_manager.h index e24ddf769..cebdfe2bb 100644 --- a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_manager.h +++ b/rpcs3/Emu/RSX/Overlays/overlay_manager.h @@ -3,9 +3,9 @@ #include "overlays.h" #include "Emu/IdManager.h" -#include "Utilities/mutex.h" -#include "Utilities/Thread.h" -#include "Utilities/lockless.h" +#include "util/mutex.h" +#include "util/Thread.h" +#include "util/lockless.h" namespace rsx { diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_media_list_dialog.cpp b/rpcs3/Emu/RSX/Overlays/overlay_media_list_dialog.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/RSX/Overlays/overlay_media_list_dialog.cpp rename to rpcs3/Emu/RSX/Overlays/overlay_media_list_dialog.cpp index 4ccef47e8..b0552096b 100644 --- a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_media_list_dialog.cpp +++ b/rpcs3/Emu/RSX/Overlays/overlay_media_list_dialog.cpp @@ -3,11 +3,11 @@ #include "overlay_manager.h" #include "overlay_media_list_dialog.h" -#include "Emu/Cell/Modules/cellMusic.h" +#include "rpcsx/fw/ps3/cellMusic.h" #include "Emu/System.h" #include "Emu/VFS.h" -#include "Utilities/StrUtil.h" -#include "Utilities/Thread.h" +#include "util/StrUtil.h" +#include "util/Thread.h" namespace rsx { diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_media_list_dialog.h b/rpcs3/Emu/RSX/Overlays/overlay_media_list_dialog.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Overlays/overlay_media_list_dialog.h rename to rpcs3/Emu/RSX/Overlays/overlay_media_list_dialog.h diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_message.cpp b/rpcs3/Emu/RSX/Overlays/overlay_message.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Overlays/overlay_message.cpp rename to rpcs3/Emu/RSX/Overlays/overlay_message.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_message.h b/rpcs3/Emu/RSX/Overlays/overlay_message.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Overlays/overlay_message.h rename to rpcs3/Emu/RSX/Overlays/overlay_message.h diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_message_dialog.cpp b/rpcs3/Emu/RSX/Overlays/overlay_message_dialog.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/RSX/Overlays/overlay_message_dialog.cpp rename to rpcs3/Emu/RSX/Overlays/overlay_message_dialog.cpp index 4f173ab78..60b6eadc5 100644 --- a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_message_dialog.cpp +++ b/rpcs3/Emu/RSX/Overlays/overlay_message_dialog.cpp @@ -6,7 +6,7 @@ #include "Emu/system_utils.hpp" #include "Emu/Cell/ErrorCodes.h" #include "Emu/IdManager.h" -#include "Utilities/Thread.h" +#include "util/Thread.h" #include diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_message_dialog.h b/rpcs3/Emu/RSX/Overlays/overlay_message_dialog.h similarity index 97% rename from rpcs3/rpcs3/Emu/RSX/Overlays/overlay_message_dialog.h rename to rpcs3/Emu/RSX/Overlays/overlay_message_dialog.h index a96a6a0d2..b96f4de0b 100644 --- a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_message_dialog.h +++ b/rpcs3/Emu/RSX/Overlays/overlay_message_dialog.h @@ -2,7 +2,7 @@ #include "overlays.h" #include "overlay_progress_bar.hpp" -#include "Emu/Cell/Modules/cellMsgDialog.h" +#include "rpcsx/fw/ps3/cellMsgDialog.h" namespace rsx { diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_osk.cpp b/rpcs3/Emu/RSX/Overlays/overlay_osk.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/RSX/Overlays/overlay_osk.cpp rename to rpcs3/Emu/RSX/Overlays/overlay_osk.cpp index 574749597..b8d7a3756 100644 --- a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_osk.cpp +++ b/rpcs3/Emu/RSX/Overlays/overlay_osk.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "overlay_manager.h" #include "overlay_osk.h" -#include "Emu/Cell/Modules/cellSysutil.h" +#include "rpcsx/fw/ps3/cellSysutil.h" #include "Emu/Io/Keyboard.h" #include "Emu/System.h" #include "Emu/system_config.h" diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_osk.h b/rpcs3/Emu/RSX/Overlays/overlay_osk.h similarity index 98% rename from rpcs3/rpcs3/Emu/RSX/Overlays/overlay_osk.h rename to rpcs3/Emu/RSX/Overlays/overlay_osk.h index 703e40ce8..80bfedcbf 100644 --- a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_osk.h +++ b/rpcs3/Emu/RSX/Overlays/overlay_osk.h @@ -4,7 +4,7 @@ #include "overlay_edit_text.hpp" #include "overlay_cursor.h" #include "overlay_osk_panel.h" -#include "Emu/Cell/Modules/cellOskDialog.h" +#include "rpcsx/fw/ps3/cellOskDialog.h" namespace rsx { diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_osk_panel.cpp b/rpcs3/Emu/RSX/Overlays/overlay_osk_panel.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Overlays/overlay_osk_panel.cpp rename to rpcs3/Emu/RSX/Overlays/overlay_osk_panel.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_osk_panel.h b/rpcs3/Emu/RSX/Overlays/overlay_osk_panel.h similarity index 98% rename from rpcs3/rpcs3/Emu/RSX/Overlays/overlay_osk_panel.h rename to rpcs3/Emu/RSX/Overlays/overlay_osk_panel.h index 3f0f92e9c..2a5b2d8d9 100644 --- a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_osk_panel.h +++ b/rpcs3/Emu/RSX/Overlays/overlay_osk_panel.h @@ -1,7 +1,7 @@ #pragma once -#include "Emu/Cell/Modules/cellOskDialog.h" -#include "Utilities/geometry.h" +#include "rpcsx/fw/ps3/cellOskDialog.h" +#include "util/geometry.h" namespace rsx { diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_perf_metrics.cpp b/rpcs3/Emu/RSX/Overlays/overlay_perf_metrics.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Overlays/overlay_perf_metrics.cpp rename to rpcs3/Emu/RSX/Overlays/overlay_perf_metrics.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_perf_metrics.h b/rpcs3/Emu/RSX/Overlays/overlay_perf_metrics.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Overlays/overlay_perf_metrics.h rename to rpcs3/Emu/RSX/Overlays/overlay_perf_metrics.h diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_progress_bar.cpp b/rpcs3/Emu/RSX/Overlays/overlay_progress_bar.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Overlays/overlay_progress_bar.cpp rename to rpcs3/Emu/RSX/Overlays/overlay_progress_bar.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_progress_bar.hpp b/rpcs3/Emu/RSX/Overlays/overlay_progress_bar.hpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Overlays/overlay_progress_bar.hpp rename to rpcs3/Emu/RSX/Overlays/overlay_progress_bar.hpp diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_save_dialog.cpp b/rpcs3/Emu/RSX/Overlays/overlay_save_dialog.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/RSX/Overlays/overlay_save_dialog.cpp rename to rpcs3/Emu/RSX/Overlays/overlay_save_dialog.cpp index 0870869d5..da793ca8d 100644 --- a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_save_dialog.cpp +++ b/rpcs3/Emu/RSX/Overlays/overlay_save_dialog.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "overlay_save_dialog.h" #include "overlay_video.h" -#include "Utilities/date_time.h" +#include "util/date_time.h" #include "Emu/System.h" namespace rsx diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_save_dialog.h b/rpcs3/Emu/RSX/Overlays/overlay_save_dialog.h similarity index 96% rename from rpcs3/rpcs3/Emu/RSX/Overlays/overlay_save_dialog.h rename to rpcs3/Emu/RSX/Overlays/overlay_save_dialog.h index e277fac6c..796a1e175 100644 --- a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_save_dialog.h +++ b/rpcs3/Emu/RSX/Overlays/overlay_save_dialog.h @@ -2,7 +2,7 @@ #include "overlays.h" #include "overlay_list_view.hpp" -#include "Emu/Cell/Modules/cellSaveData.h" +#include "rpcsx/fw/ps3/cellSaveData.h" namespace rsx { diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_trophy_notification.cpp b/rpcs3/Emu/RSX/Overlays/overlay_trophy_notification.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Overlays/overlay_trophy_notification.cpp rename to rpcs3/Emu/RSX/Overlays/overlay_trophy_notification.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_trophy_notification.h b/rpcs3/Emu/RSX/Overlays/overlay_trophy_notification.h similarity index 94% rename from rpcs3/rpcs3/Emu/RSX/Overlays/overlay_trophy_notification.h rename to rpcs3/Emu/RSX/Overlays/overlay_trophy_notification.h index 88b4aef00..eb448be18 100644 --- a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_trophy_notification.h +++ b/rpcs3/Emu/RSX/Overlays/overlay_trophy_notification.h @@ -1,7 +1,7 @@ #pragma once #include "overlays.h" -#include "Emu/Cell/Modules/sceNpTrophy.h" +#include "rpcsx/fw/ps3/sceNpTrophy.h" namespace rsx { diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_user_list_dialog.cpp b/rpcs3/Emu/RSX/Overlays/overlay_user_list_dialog.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Overlays/overlay_user_list_dialog.cpp rename to rpcs3/Emu/RSX/Overlays/overlay_user_list_dialog.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_user_list_dialog.h b/rpcs3/Emu/RSX/Overlays/overlay_user_list_dialog.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Overlays/overlay_user_list_dialog.h rename to rpcs3/Emu/RSX/Overlays/overlay_user_list_dialog.h diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_utils.cpp b/rpcs3/Emu/RSX/Overlays/overlay_utils.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Overlays/overlay_utils.cpp rename to rpcs3/Emu/RSX/Overlays/overlay_utils.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_utils.h b/rpcs3/Emu/RSX/Overlays/overlay_utils.h similarity index 99% rename from rpcs3/rpcs3/Emu/RSX/Overlays/overlay_utils.h rename to rpcs3/Emu/RSX/Overlays/overlay_utils.h index 17899a157..6a65b655d 100644 --- a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_utils.h +++ b/rpcs3/Emu/RSX/Overlays/overlay_utils.h @@ -1,7 +1,7 @@ #pragma once #include "util/types.hpp" -#include "Utilities/geometry.h" +#include "util/geometry.h" #include diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_video.cpp b/rpcs3/Emu/RSX/Overlays/overlay_video.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Overlays/overlay_video.cpp rename to rpcs3/Emu/RSX/Overlays/overlay_video.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/overlay_video.h b/rpcs3/Emu/RSX/Overlays/overlay_video.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Overlays/overlay_video.h rename to rpcs3/Emu/RSX/Overlays/overlay_video.h diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/overlays.cpp b/rpcs3/Emu/RSX/Overlays/overlays.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Overlays/overlays.cpp rename to rpcs3/Emu/RSX/Overlays/overlays.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/Overlays/overlays.h b/rpcs3/Emu/RSX/Overlays/overlays.h similarity index 99% rename from rpcs3/rpcs3/Emu/RSX/Overlays/overlays.h rename to rpcs3/Emu/RSX/Overlays/overlays.h index 92b4f55d9..372a37192 100644 --- a/rpcs3/rpcs3/Emu/RSX/Overlays/overlays.h +++ b/rpcs3/Emu/RSX/Overlays/overlays.h @@ -4,7 +4,7 @@ #include "Emu/Io/pad_types.h" -#include "Utilities/Timer.h" +#include "util/Timer.h" #include "../Common/bitfield.hpp" diff --git a/rpcs3/rpcs3/Emu/RSX/Program/CgBinaryFragmentProgram.cpp b/rpcs3/Emu/RSX/Program/CgBinaryFragmentProgram.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/CgBinaryFragmentProgram.cpp rename to rpcs3/Emu/RSX/Program/CgBinaryFragmentProgram.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/Program/CgBinaryProgram.h b/rpcs3/Emu/RSX/Program/CgBinaryProgram.h similarity index 99% rename from rpcs3/rpcs3/Emu/RSX/Program/CgBinaryProgram.h rename to rpcs3/Emu/RSX/Program/CgBinaryProgram.h index 519faec1c..880389477 100644 --- a/rpcs3/rpcs3/Emu/RSX/Program/CgBinaryProgram.h +++ b/rpcs3/Emu/RSX/Program/CgBinaryProgram.h @@ -5,7 +5,7 @@ #include "Emu/RSX/Program/RSXFragmentProgram.h" #include "Emu/RSX/Program/ProgramStateCache.h" #include "Emu/RSX/Program/ShaderParam.h" -#include "Utilities/File.h" +#include "util/File.h" #ifndef WITHOUT_OPENGL #include "Emu/RSX/GL/GLVertexProgram.h" diff --git a/rpcs3/rpcs3/Emu/RSX/Program/CgBinaryVertexProgram.cpp b/rpcs3/Emu/RSX/Program/CgBinaryVertexProgram.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/CgBinaryVertexProgram.cpp rename to rpcs3/Emu/RSX/Program/CgBinaryVertexProgram.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/Program/FragmentProgramDecompiler.cpp b/rpcs3/Emu/RSX/Program/FragmentProgramDecompiler.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/FragmentProgramDecompiler.cpp rename to rpcs3/Emu/RSX/Program/FragmentProgramDecompiler.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/Program/FragmentProgramDecompiler.h b/rpcs3/Emu/RSX/Program/FragmentProgramDecompiler.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/FragmentProgramDecompiler.h rename to rpcs3/Emu/RSX/Program/FragmentProgramDecompiler.h diff --git a/rpcs3/rpcs3/Emu/RSX/Program/FragmentProgramRegister.cpp b/rpcs3/Emu/RSX/Program/FragmentProgramRegister.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/FragmentProgramRegister.cpp rename to rpcs3/Emu/RSX/Program/FragmentProgramRegister.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/Program/FragmentProgramRegister.h b/rpcs3/Emu/RSX/Program/FragmentProgramRegister.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/FragmentProgramRegister.h rename to rpcs3/Emu/RSX/Program/FragmentProgramRegister.h diff --git a/rpcs3/rpcs3/Emu/RSX/Program/GLSLCommon.cpp b/rpcs3/Emu/RSX/Program/GLSLCommon.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/RSX/Program/GLSLCommon.cpp rename to rpcs3/Emu/RSX/Program/GLSLCommon.cpp index 12ae2d87b..4d8135150 100644 --- a/rpcs3/rpcs3/Emu/RSX/Program/GLSLCommon.cpp +++ b/rpcs3/Emu/RSX/Program/GLSLCommon.cpp @@ -4,7 +4,7 @@ #include "RSXFragmentProgram.h" #include "Emu/RSX/gcm_enums.h" -#include "Utilities/StrFmt.h" +#include "util/StrFmt.h" namespace program_common { diff --git a/rpcs3/rpcs3/Emu/RSX/Program/GLSLCommon.h b/rpcs3/Emu/RSX/Program/GLSLCommon.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/GLSLCommon.h rename to rpcs3/Emu/RSX/Program/GLSLCommon.h diff --git a/rpcs3/rpcs3/Emu/RSX/Program/GLSLInterpreter/FragmentInterpreter.glsl b/rpcs3/Emu/RSX/Program/GLSLInterpreter/FragmentInterpreter.glsl similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/GLSLInterpreter/FragmentInterpreter.glsl rename to rpcs3/Emu/RSX/Program/GLSLInterpreter/FragmentInterpreter.glsl diff --git a/rpcs3/rpcs3/Emu/RSX/Program/GLSLInterpreter/VertexInterpreter.glsl b/rpcs3/Emu/RSX/Program/GLSLInterpreter/VertexInterpreter.glsl similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/GLSLInterpreter/VertexInterpreter.glsl rename to rpcs3/Emu/RSX/Program/GLSLInterpreter/VertexInterpreter.glsl diff --git a/rpcs3/rpcs3/Emu/RSX/Program/GLSLSnippets/CopyBufferToColorImage.glsl b/rpcs3/Emu/RSX/Program/GLSLSnippets/CopyBufferToColorImage.glsl similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/GLSLSnippets/CopyBufferToColorImage.glsl rename to rpcs3/Emu/RSX/Program/GLSLSnippets/CopyBufferToColorImage.glsl diff --git a/rpcs3/rpcs3/Emu/RSX/Program/GLSLSnippets/CopyBufferToGenericImage.glsl b/rpcs3/Emu/RSX/Program/GLSLSnippets/CopyBufferToGenericImage.glsl similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/GLSLSnippets/CopyBufferToGenericImage.glsl rename to rpcs3/Emu/RSX/Program/GLSLSnippets/CopyBufferToGenericImage.glsl diff --git a/rpcs3/rpcs3/Emu/RSX/Program/GLSLSnippets/CopyD24x8ToBuffer.glsl b/rpcs3/Emu/RSX/Program/GLSLSnippets/CopyD24x8ToBuffer.glsl similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/GLSLSnippets/CopyD24x8ToBuffer.glsl rename to rpcs3/Emu/RSX/Program/GLSLSnippets/CopyD24x8ToBuffer.glsl diff --git a/rpcs3/rpcs3/Emu/RSX/Program/GLSLSnippets/CopyRGBA8ToBuffer.glsl b/rpcs3/Emu/RSX/Program/GLSLSnippets/CopyRGBA8ToBuffer.glsl similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/GLSLSnippets/CopyRGBA8ToBuffer.glsl rename to rpcs3/Emu/RSX/Program/GLSLSnippets/CopyRGBA8ToBuffer.glsl diff --git a/rpcs3/rpcs3/Emu/RSX/Program/GLSLSnippets/GPUDeswizzle.glsl b/rpcs3/Emu/RSX/Program/GLSLSnippets/GPUDeswizzle.glsl similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/GLSLSnippets/GPUDeswizzle.glsl rename to rpcs3/Emu/RSX/Program/GLSLSnippets/GPUDeswizzle.glsl diff --git a/rpcs3/rpcs3/Emu/RSX/Program/GLSLSnippets/GenericVSPassthrough.glsl b/rpcs3/Emu/RSX/Program/GLSLSnippets/GenericVSPassthrough.glsl similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/GLSLSnippets/GenericVSPassthrough.glsl rename to rpcs3/Emu/RSX/Program/GLSLSnippets/GenericVSPassthrough.glsl diff --git a/rpcs3/rpcs3/Emu/RSX/Program/GLSLSnippets/OverlayRenderFS.glsl b/rpcs3/Emu/RSX/Program/GLSLSnippets/OverlayRenderFS.glsl similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/GLSLSnippets/OverlayRenderFS.glsl rename to rpcs3/Emu/RSX/Program/GLSLSnippets/OverlayRenderFS.glsl diff --git a/rpcs3/rpcs3/Emu/RSX/Program/GLSLSnippets/OverlayRenderVS.glsl b/rpcs3/Emu/RSX/Program/GLSLSnippets/OverlayRenderVS.glsl similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/GLSLSnippets/OverlayRenderVS.glsl rename to rpcs3/Emu/RSX/Program/GLSLSnippets/OverlayRenderVS.glsl diff --git a/rpcs3/rpcs3/Emu/RSX/Program/GLSLSnippets/RSXMemoryTiling.glsl b/rpcs3/Emu/RSX/Program/GLSLSnippets/RSXMemoryTiling.glsl similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/GLSLSnippets/RSXMemoryTiling.glsl rename to rpcs3/Emu/RSX/Program/GLSLSnippets/RSXMemoryTiling.glsl diff --git a/rpcs3/rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXDefines2.glsl b/rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXDefines2.glsl similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXDefines2.glsl rename to rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXDefines2.glsl diff --git a/rpcs3/rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXFragmentPrologue.glsl b/rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXFragmentPrologue.glsl similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXFragmentPrologue.glsl rename to rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXFragmentPrologue.glsl diff --git a/rpcs3/rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXFragmentTextureDepthConversion.glsl b/rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXFragmentTextureDepthConversion.glsl similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXFragmentTextureDepthConversion.glsl rename to rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXFragmentTextureDepthConversion.glsl diff --git a/rpcs3/rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXFragmentTextureMSAAOps.glsl b/rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXFragmentTextureMSAAOps.glsl similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXFragmentTextureMSAAOps.glsl rename to rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXFragmentTextureMSAAOps.glsl diff --git a/rpcs3/rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXFragmentTextureMSAAOpsInternal.glsl b/rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXFragmentTextureMSAAOpsInternal.glsl similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXFragmentTextureMSAAOpsInternal.glsl rename to rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXFragmentTextureMSAAOpsInternal.glsl diff --git a/rpcs3/rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXFragmentTextureOps.glsl b/rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXFragmentTextureOps.glsl similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXFragmentTextureOps.glsl rename to rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXFragmentTextureOps.glsl diff --git a/rpcs3/rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXProgramCommon.glsl b/rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXProgramCommon.glsl similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXProgramCommon.glsl rename to rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXProgramCommon.glsl diff --git a/rpcs3/rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXProgrammableBlendPrologue.glsl b/rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXProgrammableBlendPrologue.glsl similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXProgrammableBlendPrologue.glsl rename to rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXProgrammableBlendPrologue.glsl diff --git a/rpcs3/rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXROPEpilogue.glsl b/rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXROPEpilogue.glsl similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXROPEpilogue.glsl rename to rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXROPEpilogue.glsl diff --git a/rpcs3/rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXROPPrologue.glsl b/rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXROPPrologue.glsl similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXROPPrologue.glsl rename to rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXROPPrologue.glsl diff --git a/rpcs3/rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXVertexFetch.glsl b/rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXVertexFetch.glsl similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXVertexFetch.glsl rename to rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXVertexFetch.glsl diff --git a/rpcs3/rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXVertexPrologue.glsl b/rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXVertexPrologue.glsl similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXVertexPrologue.glsl rename to rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXVertexPrologue.glsl diff --git a/rpcs3/rpcs3/Emu/RSX/Program/GLSLSnippets/ShuffleBytes.glsl b/rpcs3/Emu/RSX/Program/GLSLSnippets/ShuffleBytes.glsl similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/GLSLSnippets/ShuffleBytes.glsl rename to rpcs3/Emu/RSX/Program/GLSLSnippets/ShuffleBytes.glsl diff --git a/rpcs3/rpcs3/Emu/RSX/Program/GLSLSnippets/VideoOutCalibrationPass.glsl b/rpcs3/Emu/RSX/Program/GLSLSnippets/VideoOutCalibrationPass.glsl similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/GLSLSnippets/VideoOutCalibrationPass.glsl rename to rpcs3/Emu/RSX/Program/GLSLSnippets/VideoOutCalibrationPass.glsl diff --git a/rpcs3/rpcs3/Emu/RSX/Program/GLSLTypes.h b/rpcs3/Emu/RSX/Program/GLSLTypes.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/GLSLTypes.h rename to rpcs3/Emu/RSX/Program/GLSLTypes.h diff --git a/rpcs3/rpcs3/Emu/RSX/Program/MSAA/ColorResolvePass.glsl b/rpcs3/Emu/RSX/Program/MSAA/ColorResolvePass.glsl similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/MSAA/ColorResolvePass.glsl rename to rpcs3/Emu/RSX/Program/MSAA/ColorResolvePass.glsl diff --git a/rpcs3/rpcs3/Emu/RSX/Program/MSAA/ColorUnresolvePass.glsl b/rpcs3/Emu/RSX/Program/MSAA/ColorUnresolvePass.glsl similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/MSAA/ColorUnresolvePass.glsl rename to rpcs3/Emu/RSX/Program/MSAA/ColorUnresolvePass.glsl diff --git a/rpcs3/rpcs3/Emu/RSX/Program/MSAA/DepthResolvePass.glsl b/rpcs3/Emu/RSX/Program/MSAA/DepthResolvePass.glsl similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/MSAA/DepthResolvePass.glsl rename to rpcs3/Emu/RSX/Program/MSAA/DepthResolvePass.glsl diff --git a/rpcs3/rpcs3/Emu/RSX/Program/MSAA/DepthStencilResolvePass.glsl b/rpcs3/Emu/RSX/Program/MSAA/DepthStencilResolvePass.glsl similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/MSAA/DepthStencilResolvePass.glsl rename to rpcs3/Emu/RSX/Program/MSAA/DepthStencilResolvePass.glsl diff --git a/rpcs3/rpcs3/Emu/RSX/Program/MSAA/DepthStencilUnresolvePass.glsl b/rpcs3/Emu/RSX/Program/MSAA/DepthStencilUnresolvePass.glsl similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/MSAA/DepthStencilUnresolvePass.glsl rename to rpcs3/Emu/RSX/Program/MSAA/DepthStencilUnresolvePass.glsl diff --git a/rpcs3/rpcs3/Emu/RSX/Program/MSAA/DepthUnresolvePass.glsl b/rpcs3/Emu/RSX/Program/MSAA/DepthUnresolvePass.glsl similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/MSAA/DepthUnresolvePass.glsl rename to rpcs3/Emu/RSX/Program/MSAA/DepthUnresolvePass.glsl diff --git a/rpcs3/rpcs3/Emu/RSX/Program/MSAA/StencilResolvePass.glsl b/rpcs3/Emu/RSX/Program/MSAA/StencilResolvePass.glsl similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/MSAA/StencilResolvePass.glsl rename to rpcs3/Emu/RSX/Program/MSAA/StencilResolvePass.glsl diff --git a/rpcs3/rpcs3/Emu/RSX/Program/MSAA/StencilUnresolvePass.glsl b/rpcs3/Emu/RSX/Program/MSAA/StencilUnresolvePass.glsl similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/MSAA/StencilUnresolvePass.glsl rename to rpcs3/Emu/RSX/Program/MSAA/StencilUnresolvePass.glsl diff --git a/rpcs3/rpcs3/Emu/RSX/Program/ProgramStateCache.cpp b/rpcs3/Emu/RSX/Program/ProgramStateCache.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/ProgramStateCache.cpp rename to rpcs3/Emu/RSX/Program/ProgramStateCache.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/Program/ProgramStateCache.h b/rpcs3/Emu/RSX/Program/ProgramStateCache.h similarity index 99% rename from rpcs3/rpcs3/Emu/RSX/Program/ProgramStateCache.h rename to rpcs3/Emu/RSX/Program/ProgramStateCache.h index 442038328..32b4f3185 100644 --- a/rpcs3/rpcs3/Emu/RSX/Program/ProgramStateCache.h +++ b/rpcs3/Emu/RSX/Program/ProgramStateCache.h @@ -3,7 +3,7 @@ #include "RSXFragmentProgram.h" #include "RSXVertexProgram.h" -#include "Utilities/mutex.h" +#include "util/mutex.h" #include "util/logs.hpp" #include "util/fnv_hash.hpp" #include "util/v128.hpp" diff --git a/rpcs3/rpcs3/Emu/RSX/Program/RSXFragmentProgram.h b/rpcs3/Emu/RSX/Program/RSXFragmentProgram.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/RSXFragmentProgram.h rename to rpcs3/Emu/RSX/Program/RSXFragmentProgram.h diff --git a/rpcs3/rpcs3/Emu/RSX/Program/RSXOverlay.h b/rpcs3/Emu/RSX/Program/RSXOverlay.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/RSXOverlay.h rename to rpcs3/Emu/RSX/Program/RSXOverlay.h diff --git a/rpcs3/rpcs3/Emu/RSX/Program/RSXVertexProgram.h b/rpcs3/Emu/RSX/Program/RSXVertexProgram.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/RSXVertexProgram.h rename to rpcs3/Emu/RSX/Program/RSXVertexProgram.h diff --git a/rpcs3/rpcs3/Emu/RSX/Program/SPIRVCommon.cpp b/rpcs3/Emu/RSX/Program/SPIRVCommon.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/SPIRVCommon.cpp rename to rpcs3/Emu/RSX/Program/SPIRVCommon.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/Program/SPIRVCommon.h b/rpcs3/Emu/RSX/Program/SPIRVCommon.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/SPIRVCommon.h rename to rpcs3/Emu/RSX/Program/SPIRVCommon.h diff --git a/rpcs3/rpcs3/Emu/RSX/Program/ShaderInterpreter.h b/rpcs3/Emu/RSX/Program/ShaderInterpreter.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/ShaderInterpreter.h rename to rpcs3/Emu/RSX/Program/ShaderInterpreter.h diff --git a/rpcs3/rpcs3/Emu/RSX/Program/ShaderParam.h b/rpcs3/Emu/RSX/Program/ShaderParam.h similarity index 99% rename from rpcs3/rpcs3/Emu/RSX/Program/ShaderParam.h rename to rpcs3/Emu/RSX/Program/ShaderParam.h index e9b222d76..a668ed755 100644 --- a/rpcs3/rpcs3/Emu/RSX/Program/ShaderParam.h +++ b/rpcs3/Emu/RSX/Program/ShaderParam.h @@ -3,7 +3,7 @@ #include #include -#include "Utilities/StrUtil.h" +#include "util/StrUtil.h" #include "util/types.hpp" #include diff --git a/rpcs3/rpcs3/Emu/RSX/Program/Upscalers/FSR1/fsr_ffx_a_flattened.inc b/rpcs3/Emu/RSX/Program/Upscalers/FSR1/fsr_ffx_a_flattened.inc similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/Upscalers/FSR1/fsr_ffx_a_flattened.inc rename to rpcs3/Emu/RSX/Program/Upscalers/FSR1/fsr_ffx_a_flattened.inc diff --git a/rpcs3/rpcs3/Emu/RSX/Program/Upscalers/FSR1/fsr_ffx_fsr1_flattened.inc b/rpcs3/Emu/RSX/Program/Upscalers/FSR1/fsr_ffx_fsr1_flattened.inc similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/Upscalers/FSR1/fsr_ffx_fsr1_flattened.inc rename to rpcs3/Emu/RSX/Program/Upscalers/FSR1/fsr_ffx_fsr1_flattened.inc diff --git a/rpcs3/rpcs3/Emu/RSX/Program/Upscalers/FSR1/fsr_ubershader.glsl b/rpcs3/Emu/RSX/Program/Upscalers/FSR1/fsr_ubershader.glsl similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/Upscalers/FSR1/fsr_ubershader.glsl rename to rpcs3/Emu/RSX/Program/Upscalers/FSR1/fsr_ubershader.glsl diff --git a/rpcs3/rpcs3/Emu/RSX/Program/VertexProgramDecompiler.cpp b/rpcs3/Emu/RSX/Program/VertexProgramDecompiler.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/VertexProgramDecompiler.cpp rename to rpcs3/Emu/RSX/Program/VertexProgramDecompiler.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/Program/VertexProgramDecompiler.h b/rpcs3/Emu/RSX/Program/VertexProgramDecompiler.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/VertexProgramDecompiler.h rename to rpcs3/Emu/RSX/Program/VertexProgramDecompiler.h diff --git a/rpcs3/rpcs3/Emu/RSX/Program/program_util.cpp b/rpcs3/Emu/RSX/Program/program_util.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/program_util.cpp rename to rpcs3/Emu/RSX/Program/program_util.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/Program/program_util.h b/rpcs3/Emu/RSX/Program/program_util.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/Program/program_util.h rename to rpcs3/Emu/RSX/Program/program_util.h diff --git a/rpcs3/rpcs3/Emu/RSX/RSXDisAsm.cpp b/rpcs3/Emu/RSX/RSXDisAsm.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/RSXDisAsm.cpp rename to rpcs3/Emu/RSX/RSXDisAsm.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/RSXDisAsm.h b/rpcs3/Emu/RSX/RSXDisAsm.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/RSXDisAsm.h rename to rpcs3/Emu/RSX/RSXDisAsm.h diff --git a/rpcs3/rpcs3/Emu/RSX/RSXFIFO.cpp b/rpcs3/Emu/RSX/RSXFIFO.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/RSXFIFO.cpp rename to rpcs3/Emu/RSX/RSXFIFO.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/RSXFIFO.h b/rpcs3/Emu/RSX/RSXFIFO.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/RSXFIFO.h rename to rpcs3/Emu/RSX/RSXFIFO.h diff --git a/rpcs3/rpcs3/Emu/RSX/RSXOffload.cpp b/rpcs3/Emu/RSX/RSXOffload.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/RSX/RSXOffload.cpp rename to rpcs3/Emu/RSX/RSXOffload.cpp index 71e99791e..588b35ad1 100644 --- a/rpcs3/rpcs3/Emu/RSX/RSXOffload.cpp +++ b/rpcs3/Emu/RSX/RSXOffload.cpp @@ -6,7 +6,7 @@ #include "RSXOffload.h" #include "RSXThread.h" -#include "Utilities/lockless.h" +#include "util/lockless.h" #include #include "util/asm.hpp" diff --git a/rpcs3/rpcs3/Emu/RSX/RSXOffload.h b/rpcs3/Emu/RSX/RSXOffload.h similarity index 98% rename from rpcs3/rpcs3/Emu/RSX/RSXOffload.h rename to rpcs3/Emu/RSX/RSXOffload.h index 489617443..c27b59799 100644 --- a/rpcs3/rpcs3/Emu/RSX/RSXOffload.h +++ b/rpcs3/Emu/RSX/RSXOffload.h @@ -1,7 +1,7 @@ #pragma once #include "util/types.hpp" -#include "Utilities/address_range.h" +#include "util/address_range.h" #include "gcm_enums.h" #include diff --git a/rpcs3/rpcs3/Emu/RSX/RSXTexture.cpp b/rpcs3/Emu/RSX/RSXTexture.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/RSXTexture.cpp rename to rpcs3/Emu/RSX/RSXTexture.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/RSXTexture.h b/rpcs3/Emu/RSX/RSXTexture.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/RSXTexture.h rename to rpcs3/Emu/RSX/RSXTexture.h diff --git a/rpcs3/rpcs3/Emu/RSX/RSXThread.cpp b/rpcs3/Emu/RSX/RSXThread.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/RSX/RSXThread.cpp rename to rpcs3/Emu/RSX/RSXThread.cpp index 50360e024..0b297f2a9 100644 --- a/rpcs3/rpcs3/Emu/RSX/RSXThread.cpp +++ b/rpcs3/Emu/RSX/RSXThread.cpp @@ -19,13 +19,13 @@ #include "Emu/Cell/timers.hpp" #include "Emu/Cell/lv2/sys_event.h" #include "Emu/Cell/lv2/sys_time.h" -#include "Emu/Cell/Modules/cellGcmSys.h" +#include "rpcsx/fw/ps3/cellGcmSys.h" #include "util/serialization_ext.hpp" #include "Overlays/overlay_perf_metrics.h" #include "Overlays/overlay_debug_overlay.h" #include "Overlays/overlay_manager.h" -#include "Utilities/date_time.h" +#include "util/date_time.h" #include "util/asm.hpp" diff --git a/rpcs3/rpcs3/Emu/RSX/RSXThread.h b/rpcs3/Emu/RSX/RSXThread.h similarity index 99% rename from rpcs3/rpcs3/Emu/RSX/RSXThread.h rename to rpcs3/Emu/RSX/RSXThread.h index 70f8d15bc..359d55c76 100644 --- a/rpcs3/rpcs3/Emu/RSX/RSXThread.h +++ b/rpcs3/Emu/RSX/RSXThread.h @@ -14,8 +14,8 @@ #include "Program/RSXVertexProgram.h" #include "Program/RSXFragmentProgram.h" -#include "Utilities/Thread.h" -#include "Utilities/geometry.h" +#include "util/Thread.h" +#include "util/geometry.h" #include "Capture/rsx_trace.h" #include "Capture/rsx_replay.h" diff --git a/rpcs3/rpcs3/Emu/RSX/RSXZCULL.cpp b/rpcs3/Emu/RSX/RSXZCULL.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/RSXZCULL.cpp rename to rpcs3/Emu/RSX/RSXZCULL.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/RSXZCULL.h b/rpcs3/Emu/RSX/RSXZCULL.h similarity index 96% rename from rpcs3/rpcs3/Emu/RSX/RSXZCULL.h rename to rpcs3/Emu/RSX/RSXZCULL.h index acff59ea1..67990ac92 100644 --- a/rpcs3/rpcs3/Emu/RSX/RSXZCULL.h +++ b/rpcs3/Emu/RSX/RSXZCULL.h @@ -4,7 +4,7 @@ #include #include -#include "Utilities/mutex.h" +#include "util/mutex.h" #include "rsx_utils.h" diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKAsyncScheduler.cpp b/rpcs3/Emu/RSX/VK/VKAsyncScheduler.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/VKAsyncScheduler.cpp rename to rpcs3/Emu/RSX/VK/VKAsyncScheduler.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKAsyncScheduler.h b/rpcs3/Emu/RSX/VK/VKAsyncScheduler.h similarity index 94% rename from rpcs3/rpcs3/Emu/RSX/VK/VKAsyncScheduler.h rename to rpcs3/Emu/RSX/VK/VKAsyncScheduler.h index a9c422c38..3581336bc 100644 --- a/rpcs3/rpcs3/Emu/RSX/VK/VKAsyncScheduler.h +++ b/rpcs3/Emu/RSX/VK/VKAsyncScheduler.h @@ -2,7 +2,7 @@ #include "vkutils/commands.h" #include "vkutils/sync.h" -#include "Utilities/mutex.h" +#include "util/mutex.h" #define VK_MAX_ASYNC_COMPUTE_QUEUES 256 diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKCommandStream.cpp b/rpcs3/Emu/RSX/VK/VKCommandStream.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/VKCommandStream.cpp rename to rpcs3/Emu/RSX/VK/VKCommandStream.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKCommandStream.h b/rpcs3/Emu/RSX/VK/VKCommandStream.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/VKCommandStream.h rename to rpcs3/Emu/RSX/VK/VKCommandStream.h diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKCommonDecompiler.cpp b/rpcs3/Emu/RSX/VK/VKCommonDecompiler.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/VKCommonDecompiler.cpp rename to rpcs3/Emu/RSX/VK/VKCommonDecompiler.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKCommonDecompiler.h b/rpcs3/Emu/RSX/VK/VKCommonDecompiler.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/VKCommonDecompiler.h rename to rpcs3/Emu/RSX/VK/VKCommonDecompiler.h diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKCommonPipelineLayout.cpp b/rpcs3/Emu/RSX/VK/VKCommonPipelineLayout.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/VKCommonPipelineLayout.cpp rename to rpcs3/Emu/RSX/VK/VKCommonPipelineLayout.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKCommonPipelineLayout.h b/rpcs3/Emu/RSX/VK/VKCommonPipelineLayout.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/VKCommonPipelineLayout.h rename to rpcs3/Emu/RSX/VK/VKCommonPipelineLayout.h diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKCompute.cpp b/rpcs3/Emu/RSX/VK/VKCompute.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/VKCompute.cpp rename to rpcs3/Emu/RSX/VK/VKCompute.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKCompute.h b/rpcs3/Emu/RSX/VK/VKCompute.h similarity index 99% rename from rpcs3/rpcs3/Emu/RSX/VK/VKCompute.h rename to rpcs3/Emu/RSX/VK/VKCompute.h index a6a0a9c4e..8874b2604 100644 --- a/rpcs3/rpcs3/Emu/RSX/VK/VKCompute.h +++ b/rpcs3/Emu/RSX/VK/VKCompute.h @@ -5,7 +5,7 @@ #include "Emu/IdManager.h" -#include "Utilities/StrUtil.h" +#include "util/StrUtil.h" #include "util/asm.hpp" #include diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKDMA.cpp b/rpcs3/Emu/RSX/VK/VKDMA.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/RSX/VK/VKDMA.cpp rename to rpcs3/Emu/RSX/VK/VKDMA.cpp index 6869fe376..21c361400 100644 --- a/rpcs3/rpcs3/Emu/RSX/VK/VKDMA.cpp +++ b/rpcs3/Emu/RSX/VK/VKDMA.cpp @@ -5,7 +5,7 @@ #include "Emu/Memory/vm.h" #include "Emu/RSX/RSXThread.h" -#include "Utilities/mutex.h" +#include "util/mutex.h" #include "util/asm.hpp" #include diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKDMA.h b/rpcs3/Emu/RSX/VK/VKDMA.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/VKDMA.h rename to rpcs3/Emu/RSX/VK/VKDMA.h diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKDraw.cpp b/rpcs3/Emu/RSX/VK/VKDraw.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/VKDraw.cpp rename to rpcs3/Emu/RSX/VK/VKDraw.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKFormats.cpp b/rpcs3/Emu/RSX/VK/VKFormats.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/VKFormats.cpp rename to rpcs3/Emu/RSX/VK/VKFormats.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKFormats.h b/rpcs3/Emu/RSX/VK/VKFormats.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/VKFormats.h rename to rpcs3/Emu/RSX/VK/VKFormats.h diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKFragmentProgram.cpp b/rpcs3/Emu/RSX/VK/VKFragmentProgram.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/VKFragmentProgram.cpp rename to rpcs3/Emu/RSX/VK/VKFragmentProgram.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKFragmentProgram.h b/rpcs3/Emu/RSX/VK/VKFragmentProgram.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/VKFragmentProgram.h rename to rpcs3/Emu/RSX/VK/VKFragmentProgram.h diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKFramebuffer.cpp b/rpcs3/Emu/RSX/VK/VKFramebuffer.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/VKFramebuffer.cpp rename to rpcs3/Emu/RSX/VK/VKFramebuffer.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKFramebuffer.h b/rpcs3/Emu/RSX/VK/VKFramebuffer.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/VKFramebuffer.h rename to rpcs3/Emu/RSX/VK/VKFramebuffer.h diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKGSRender.cpp b/rpcs3/Emu/RSX/VK/VKGSRender.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/VKGSRender.cpp rename to rpcs3/Emu/RSX/VK/VKGSRender.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKGSRender.h b/rpcs3/Emu/RSX/VK/VKGSRender.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/VKGSRender.h rename to rpcs3/Emu/RSX/VK/VKGSRender.h diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKGSRenderTypes.hpp b/rpcs3/Emu/RSX/VK/VKGSRenderTypes.hpp similarity index 99% rename from rpcs3/rpcs3/Emu/RSX/VK/VKGSRenderTypes.hpp rename to rpcs3/Emu/RSX/VK/VKGSRenderTypes.hpp index 1f48c6b89..c5b80ccbd 100644 --- a/rpcs3/rpcs3/Emu/RSX/VK/VKGSRenderTypes.hpp +++ b/rpcs3/Emu/RSX/VK/VKGSRenderTypes.hpp @@ -7,7 +7,7 @@ #include "Emu/RSX/Common/simple_array.hpp" #include "Emu/RSX/rsx_utils.h" #include "Emu/RSX/rsx_cache.h" -#include "Utilities/mutex.h" +#include "util/mutex.h" #include "util/asm.hpp" #include diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKHelpers.cpp b/rpcs3/Emu/RSX/VK/VKHelpers.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/VKHelpers.cpp rename to rpcs3/Emu/RSX/VK/VKHelpers.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKHelpers.h b/rpcs3/Emu/RSX/VK/VKHelpers.h similarity index 99% rename from rpcs3/rpcs3/Emu/RSX/VK/VKHelpers.h rename to rpcs3/Emu/RSX/VK/VKHelpers.h index 8caaa4167..a01b0a6c8 100644 --- a/rpcs3/rpcs3/Emu/RSX/VK/VKHelpers.h +++ b/rpcs3/Emu/RSX/VK/VKHelpers.h @@ -4,7 +4,7 @@ #include #include "VulkanAPI.h" -#include "Utilities/geometry.h" +#include "util/geometry.h" #include "Emu/RSX/Common/TextureUtils.h" #include "Emu/RSX/rsx_utils.h" diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKMemAlloc.cpp b/rpcs3/Emu/RSX/VK/VKMemAlloc.cpp similarity index 98% rename from rpcs3/rpcs3/Emu/RSX/VK/VKMemAlloc.cpp rename to rpcs3/Emu/RSX/VK/VKMemAlloc.cpp index 8d45008c7..b1b025726 100644 --- a/rpcs3/rpcs3/Emu/RSX/VK/VKMemAlloc.cpp +++ b/rpcs3/Emu/RSX/VK/VKMemAlloc.cpp @@ -1,7 +1,7 @@ #define VMA_IMPLEMENTATION #include "util/atomic.hpp" -#include "Utilities/mutex.h" +#include "util/mutex.h" // Protect some STL headers from macro (add more if it fails to compile) #include diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKOverlays.cpp b/rpcs3/Emu/RSX/VK/VKOverlays.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/VKOverlays.cpp rename to rpcs3/Emu/RSX/VK/VKOverlays.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKOverlays.h b/rpcs3/Emu/RSX/VK/VKOverlays.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/VKOverlays.h rename to rpcs3/Emu/RSX/VK/VKOverlays.h diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKPipelineCompiler.cpp b/rpcs3/Emu/RSX/VK/VKPipelineCompiler.cpp similarity index 96% rename from rpcs3/rpcs3/Emu/RSX/VK/VKPipelineCompiler.cpp rename to rpcs3/Emu/RSX/VK/VKPipelineCompiler.cpp index 8dfb96819..fbf7f3844 100644 --- a/rpcs3/rpcs3/Emu/RSX/VK/VKPipelineCompiler.cpp +++ b/rpcs3/Emu/RSX/VK/VKPipelineCompiler.cpp @@ -2,7 +2,7 @@ #include "VKPipelineCompiler.h" #include "VKRenderPass.h" #include "vkutils/device.h" -#include "Utilities/Thread.h" +#include "util/Thread.h" #include "util/sysinfo.hpp" diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKPipelineCompiler.h b/rpcs3/Emu/RSX/VK/VKPipelineCompiler.h similarity index 99% rename from rpcs3/rpcs3/Emu/RSX/VK/VKPipelineCompiler.h rename to rpcs3/Emu/RSX/VK/VKPipelineCompiler.h index cb642a923..e240f210d 100644 --- a/rpcs3/rpcs3/Emu/RSX/VK/VKPipelineCompiler.h +++ b/rpcs3/Emu/RSX/VK/VKPipelineCompiler.h @@ -1,5 +1,5 @@ #pragma once -#include "Utilities/lockless.h" +#include "util/lockless.h" #include "VKProgramPipeline.h" #include "vkutils/graphics_pipeline_state.hpp" #include "util/fnv_hash.hpp" diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKPresent.cpp b/rpcs3/Emu/RSX/VK/VKPresent.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/RSX/VK/VKPresent.cpp rename to rpcs3/Emu/RSX/VK/VKPresent.cpp index 98c391682..8e8c8377c 100644 --- a/rpcs3/rpcs3/Emu/RSX/VK/VKPresent.cpp +++ b/rpcs3/Emu/RSX/VK/VKPresent.cpp @@ -3,7 +3,7 @@ #include "vkutils/buffer_object.h" #include "Emu/RSX/Overlays/overlay_manager.h" #include "Emu/RSX/Overlays/overlay_debug_overlay.h" -#include "Emu/Cell/Modules/cellVideoOut.h" +#include "rpcsx/fw/ps3/cellVideoOut.h" #include "upscalers/bilinear_pass.hpp" #include "upscalers/fsr_pass.h" diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKProgramBuffer.h b/rpcs3/Emu/RSX/VK/VKProgramBuffer.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/VKProgramBuffer.h rename to rpcs3/Emu/RSX/VK/VKProgramBuffer.h diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKProgramPipeline.cpp b/rpcs3/Emu/RSX/VK/VKProgramPipeline.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/VKProgramPipeline.cpp rename to rpcs3/Emu/RSX/VK/VKProgramPipeline.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKProgramPipeline.h b/rpcs3/Emu/RSX/VK/VKProgramPipeline.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/VKProgramPipeline.h rename to rpcs3/Emu/RSX/VK/VKProgramPipeline.h diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKQueryPool.cpp b/rpcs3/Emu/RSX/VK/VKQueryPool.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/VKQueryPool.cpp rename to rpcs3/Emu/RSX/VK/VKQueryPool.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKQueryPool.h b/rpcs3/Emu/RSX/VK/VKQueryPool.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/VKQueryPool.h rename to rpcs3/Emu/RSX/VK/VKQueryPool.h diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKRenderPass.cpp b/rpcs3/Emu/RSX/VK/VKRenderPass.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/RSX/VK/VKRenderPass.cpp rename to rpcs3/Emu/RSX/VK/VKRenderPass.cpp index 5af472f86..b1b138015 100644 --- a/rpcs3/rpcs3/Emu/RSX/VK/VKRenderPass.cpp +++ b/rpcs3/Emu/RSX/VK/VKRenderPass.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" -#include "Utilities/mutex.h" +#include "util/mutex.h" #include "VKRenderPass.h" #include "vkutils/image.h" diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKRenderPass.h b/rpcs3/Emu/RSX/VK/VKRenderPass.h similarity index 95% rename from rpcs3/rpcs3/Emu/RSX/VK/VKRenderPass.h rename to rpcs3/Emu/RSX/VK/VKRenderPass.h index 294cbb5de..f5fa65d4a 100644 --- a/rpcs3/rpcs3/Emu/RSX/VK/VKRenderPass.h +++ b/rpcs3/Emu/RSX/VK/VKRenderPass.h @@ -1,7 +1,7 @@ #pragma once #include "VulkanAPI.h" -#include "Utilities/geometry.h" +#include "util/geometry.h" namespace vk { diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKRenderTargets.cpp b/rpcs3/Emu/RSX/VK/VKRenderTargets.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/VKRenderTargets.cpp rename to rpcs3/Emu/RSX/VK/VKRenderTargets.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKRenderTargets.h b/rpcs3/Emu/RSX/VK/VKRenderTargets.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/VKRenderTargets.h rename to rpcs3/Emu/RSX/VK/VKRenderTargets.h diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKResolveHelper.cpp b/rpcs3/Emu/RSX/VK/VKResolveHelper.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/VKResolveHelper.cpp rename to rpcs3/Emu/RSX/VK/VKResolveHelper.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKResolveHelper.h b/rpcs3/Emu/RSX/VK/VKResolveHelper.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/VKResolveHelper.h rename to rpcs3/Emu/RSX/VK/VKResolveHelper.h diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKResourceManager.cpp b/rpcs3/Emu/RSX/VK/VKResourceManager.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/VKResourceManager.cpp rename to rpcs3/Emu/RSX/VK/VKResourceManager.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKResourceManager.h b/rpcs3/Emu/RSX/VK/VKResourceManager.h similarity index 99% rename from rpcs3/rpcs3/Emu/RSX/VK/VKResourceManager.h rename to rpcs3/Emu/RSX/VK/VKResourceManager.h index 006dd9292..39f0858c6 100644 --- a/rpcs3/rpcs3/Emu/RSX/VK/VKResourceManager.h +++ b/rpcs3/Emu/RSX/VK/VKResourceManager.h @@ -4,7 +4,7 @@ #include "vkutils/query_pool.hpp" #include "vkutils/sampler.h" -#include "Utilities/mutex.h" +#include "util/mutex.h" #include #include diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKShaderInterpreter.cpp b/rpcs3/Emu/RSX/VK/VKShaderInterpreter.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/VKShaderInterpreter.cpp rename to rpcs3/Emu/RSX/VK/VKShaderInterpreter.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKShaderInterpreter.h b/rpcs3/Emu/RSX/VK/VKShaderInterpreter.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/VKShaderInterpreter.h rename to rpcs3/Emu/RSX/VK/VKShaderInterpreter.h diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKTexture.cpp b/rpcs3/Emu/RSX/VK/VKTexture.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/VKTexture.cpp rename to rpcs3/Emu/RSX/VK/VKTexture.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKTextureCache.cpp b/rpcs3/Emu/RSX/VK/VKTextureCache.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/VKTextureCache.cpp rename to rpcs3/Emu/RSX/VK/VKTextureCache.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKTextureCache.h b/rpcs3/Emu/RSX/VK/VKTextureCache.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/VKTextureCache.h rename to rpcs3/Emu/RSX/VK/VKTextureCache.h diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKVertexBuffers.cpp b/rpcs3/Emu/RSX/VK/VKVertexBuffers.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/VKVertexBuffers.cpp rename to rpcs3/Emu/RSX/VK/VKVertexBuffers.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKVertexProgram.cpp b/rpcs3/Emu/RSX/VK/VKVertexProgram.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/VKVertexProgram.cpp rename to rpcs3/Emu/RSX/VK/VKVertexProgram.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VKVertexProgram.h b/rpcs3/Emu/RSX/VK/VKVertexProgram.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/VKVertexProgram.h rename to rpcs3/Emu/RSX/VK/VKVertexProgram.h diff --git a/rpcs3/rpcs3/Emu/RSX/VK/VulkanAPI.h b/rpcs3/Emu/RSX/VK/VulkanAPI.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/VulkanAPI.h rename to rpcs3/Emu/RSX/VK/VulkanAPI.h diff --git a/rpcs3/rpcs3/Emu/RSX/VK/upscalers/bilinear_pass.hpp b/rpcs3/Emu/RSX/VK/upscalers/bilinear_pass.hpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/upscalers/bilinear_pass.hpp rename to rpcs3/Emu/RSX/VK/upscalers/bilinear_pass.hpp diff --git a/rpcs3/rpcs3/Emu/RSX/VK/upscalers/fsr1/fsr_pass.cpp b/rpcs3/Emu/RSX/VK/upscalers/fsr1/fsr_pass.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/upscalers/fsr1/fsr_pass.cpp rename to rpcs3/Emu/RSX/VK/upscalers/fsr1/fsr_pass.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/VK/upscalers/fsr_pass.h b/rpcs3/Emu/RSX/VK/upscalers/fsr_pass.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/upscalers/fsr_pass.h rename to rpcs3/Emu/RSX/VK/upscalers/fsr_pass.h diff --git a/rpcs3/rpcs3/Emu/RSX/VK/upscalers/nearest_pass.hpp b/rpcs3/Emu/RSX/VK/upscalers/nearest_pass.hpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/upscalers/nearest_pass.hpp rename to rpcs3/Emu/RSX/VK/upscalers/nearest_pass.hpp diff --git a/rpcs3/rpcs3/Emu/RSX/VK/upscalers/upscaling.h b/rpcs3/Emu/RSX/VK/upscalers/upscaling.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/upscalers/upscaling.h rename to rpcs3/Emu/RSX/VK/upscalers/upscaling.h diff --git a/rpcs3/rpcs3/Emu/RSX/VK/vkutils/barriers.cpp b/rpcs3/Emu/RSX/VK/vkutils/barriers.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/vkutils/barriers.cpp rename to rpcs3/Emu/RSX/VK/vkutils/barriers.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/VK/vkutils/barriers.h b/rpcs3/Emu/RSX/VK/vkutils/barriers.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/vkutils/barriers.h rename to rpcs3/Emu/RSX/VK/vkutils/barriers.h diff --git a/rpcs3/rpcs3/Emu/RSX/VK/vkutils/buffer_object.cpp b/rpcs3/Emu/RSX/VK/vkutils/buffer_object.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/vkutils/buffer_object.cpp rename to rpcs3/Emu/RSX/VK/vkutils/buffer_object.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/VK/vkutils/buffer_object.h b/rpcs3/Emu/RSX/VK/vkutils/buffer_object.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/vkutils/buffer_object.h rename to rpcs3/Emu/RSX/VK/vkutils/buffer_object.h diff --git a/rpcs3/rpcs3/Emu/RSX/VK/vkutils/chip_class.cpp b/rpcs3/Emu/RSX/VK/vkutils/chip_class.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/vkutils/chip_class.cpp rename to rpcs3/Emu/RSX/VK/vkutils/chip_class.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/VK/vkutils/chip_class.h b/rpcs3/Emu/RSX/VK/vkutils/chip_class.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/vkutils/chip_class.h rename to rpcs3/Emu/RSX/VK/vkutils/chip_class.h diff --git a/rpcs3/rpcs3/Emu/RSX/VK/vkutils/commands.cpp b/rpcs3/Emu/RSX/VK/vkutils/commands.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/vkutils/commands.cpp rename to rpcs3/Emu/RSX/VK/vkutils/commands.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/VK/vkutils/commands.h b/rpcs3/Emu/RSX/VK/vkutils/commands.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/vkutils/commands.h rename to rpcs3/Emu/RSX/VK/vkutils/commands.h diff --git a/rpcs3/rpcs3/Emu/RSX/VK/vkutils/data_heap.cpp b/rpcs3/Emu/RSX/VK/vkutils/data_heap.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/vkutils/data_heap.cpp rename to rpcs3/Emu/RSX/VK/vkutils/data_heap.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/VK/vkutils/data_heap.h b/rpcs3/Emu/RSX/VK/vkutils/data_heap.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/vkutils/data_heap.h rename to rpcs3/Emu/RSX/VK/vkutils/data_heap.h diff --git a/rpcs3/rpcs3/Emu/RSX/VK/vkutils/descriptors.cpp b/rpcs3/Emu/RSX/VK/vkutils/descriptors.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/vkutils/descriptors.cpp rename to rpcs3/Emu/RSX/VK/vkutils/descriptors.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/VK/vkutils/descriptors.h b/rpcs3/Emu/RSX/VK/vkutils/descriptors.h similarity index 99% rename from rpcs3/rpcs3/Emu/RSX/VK/vkutils/descriptors.h rename to rpcs3/Emu/RSX/VK/vkutils/descriptors.h index 3f38446d7..639729fd0 100644 --- a/rpcs3/rpcs3/Emu/RSX/VK/vkutils/descriptors.h +++ b/rpcs3/Emu/RSX/VK/vkutils/descriptors.h @@ -1,7 +1,7 @@ #pragma once #include "../VulkanAPI.h" -#include "Utilities/mutex.h" +#include "util/mutex.h" #include "commands.h" #include "device.h" diff --git a/rpcs3/rpcs3/Emu/RSX/VK/vkutils/device.cpp b/rpcs3/Emu/RSX/VK/vkutils/device.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/vkutils/device.cpp rename to rpcs3/Emu/RSX/VK/vkutils/device.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/VK/vkutils/device.h b/rpcs3/Emu/RSX/VK/vkutils/device.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/vkutils/device.h rename to rpcs3/Emu/RSX/VK/vkutils/device.h diff --git a/rpcs3/rpcs3/Emu/RSX/VK/vkutils/framebuffer_object.hpp b/rpcs3/Emu/RSX/VK/vkutils/framebuffer_object.hpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/vkutils/framebuffer_object.hpp rename to rpcs3/Emu/RSX/VK/vkutils/framebuffer_object.hpp diff --git a/rpcs3/rpcs3/Emu/RSX/VK/vkutils/garbage_collector.h b/rpcs3/Emu/RSX/VK/vkutils/garbage_collector.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/vkutils/garbage_collector.h rename to rpcs3/Emu/RSX/VK/vkutils/garbage_collector.h diff --git a/rpcs3/rpcs3/Emu/RSX/VK/vkutils/graphics_pipeline_state.hpp b/rpcs3/Emu/RSX/VK/vkutils/graphics_pipeline_state.hpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/vkutils/graphics_pipeline_state.hpp rename to rpcs3/Emu/RSX/VK/vkutils/graphics_pipeline_state.hpp diff --git a/rpcs3/rpcs3/Emu/RSX/VK/vkutils/image.cpp b/rpcs3/Emu/RSX/VK/vkutils/image.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/vkutils/image.cpp rename to rpcs3/Emu/RSX/VK/vkutils/image.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/VK/vkutils/image.h b/rpcs3/Emu/RSX/VK/vkutils/image.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/vkutils/image.h rename to rpcs3/Emu/RSX/VK/vkutils/image.h diff --git a/rpcs3/rpcs3/Emu/RSX/VK/vkutils/image_helpers.cpp b/rpcs3/Emu/RSX/VK/vkutils/image_helpers.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/vkutils/image_helpers.cpp rename to rpcs3/Emu/RSX/VK/vkutils/image_helpers.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/VK/vkutils/image_helpers.h b/rpcs3/Emu/RSX/VK/vkutils/image_helpers.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/vkutils/image_helpers.h rename to rpcs3/Emu/RSX/VK/vkutils/image_helpers.h diff --git a/rpcs3/rpcs3/Emu/RSX/VK/vkutils/instance.cpp b/rpcs3/Emu/RSX/VK/vkutils/instance.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/vkutils/instance.cpp rename to rpcs3/Emu/RSX/VK/vkutils/instance.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/VK/vkutils/instance.h b/rpcs3/Emu/RSX/VK/vkutils/instance.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/vkutils/instance.h rename to rpcs3/Emu/RSX/VK/vkutils/instance.h diff --git a/rpcs3/rpcs3/Emu/RSX/VK/vkutils/memory.cpp b/rpcs3/Emu/RSX/VK/vkutils/memory.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/vkutils/memory.cpp rename to rpcs3/Emu/RSX/VK/vkutils/memory.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/VK/vkutils/memory.h b/rpcs3/Emu/RSX/VK/vkutils/memory.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/vkutils/memory.h rename to rpcs3/Emu/RSX/VK/vkutils/memory.h diff --git a/rpcs3/rpcs3/Emu/RSX/VK/vkutils/pipeline_binding_table.h b/rpcs3/Emu/RSX/VK/vkutils/pipeline_binding_table.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/vkutils/pipeline_binding_table.h rename to rpcs3/Emu/RSX/VK/vkutils/pipeline_binding_table.h diff --git a/rpcs3/rpcs3/Emu/RSX/VK/vkutils/query_pool.hpp b/rpcs3/Emu/RSX/VK/vkutils/query_pool.hpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/vkutils/query_pool.hpp rename to rpcs3/Emu/RSX/VK/vkutils/query_pool.hpp diff --git a/rpcs3/rpcs3/Emu/RSX/VK/vkutils/sampler.cpp b/rpcs3/Emu/RSX/VK/vkutils/sampler.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/vkutils/sampler.cpp rename to rpcs3/Emu/RSX/VK/vkutils/sampler.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/VK/vkutils/sampler.h b/rpcs3/Emu/RSX/VK/vkutils/sampler.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/vkutils/sampler.h rename to rpcs3/Emu/RSX/VK/vkutils/sampler.h diff --git a/rpcs3/rpcs3/Emu/RSX/VK/vkutils/scratch.cpp b/rpcs3/Emu/RSX/VK/vkutils/scratch.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/vkutils/scratch.cpp rename to rpcs3/Emu/RSX/VK/vkutils/scratch.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/VK/vkutils/scratch.h b/rpcs3/Emu/RSX/VK/vkutils/scratch.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/vkutils/scratch.h rename to rpcs3/Emu/RSX/VK/vkutils/scratch.h diff --git a/rpcs3/rpcs3/Emu/RSX/VK/vkutils/shared.cpp b/rpcs3/Emu/RSX/VK/vkutils/shared.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/vkutils/shared.cpp rename to rpcs3/Emu/RSX/VK/vkutils/shared.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/VK/vkutils/shared.h b/rpcs3/Emu/RSX/VK/vkutils/shared.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/vkutils/shared.h rename to rpcs3/Emu/RSX/VK/vkutils/shared.h diff --git a/rpcs3/rpcs3/Emu/RSX/VK/vkutils/swapchain.cpp b/rpcs3/Emu/RSX/VK/vkutils/swapchain.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/vkutils/swapchain.cpp rename to rpcs3/Emu/RSX/VK/vkutils/swapchain.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/VK/vkutils/swapchain.h b/rpcs3/Emu/RSX/VK/vkutils/swapchain.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/vkutils/swapchain.h rename to rpcs3/Emu/RSX/VK/vkutils/swapchain.h diff --git a/rpcs3/rpcs3/Emu/RSX/VK/vkutils/swapchain_android.hpp b/rpcs3/Emu/RSX/VK/vkutils/swapchain_android.hpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/vkutils/swapchain_android.hpp rename to rpcs3/Emu/RSX/VK/vkutils/swapchain_android.hpp diff --git a/rpcs3/rpcs3/Emu/RSX/VK/vkutils/swapchain_core.h b/rpcs3/Emu/RSX/VK/vkutils/swapchain_core.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/vkutils/swapchain_core.h rename to rpcs3/Emu/RSX/VK/vkutils/swapchain_core.h diff --git a/rpcs3/rpcs3/Emu/RSX/VK/vkutils/swapchain_macos.hpp b/rpcs3/Emu/RSX/VK/vkutils/swapchain_macos.hpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/vkutils/swapchain_macos.hpp rename to rpcs3/Emu/RSX/VK/vkutils/swapchain_macos.hpp diff --git a/rpcs3/rpcs3/Emu/RSX/VK/vkutils/swapchain_unix.hpp b/rpcs3/Emu/RSX/VK/vkutils/swapchain_unix.hpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/vkutils/swapchain_unix.hpp rename to rpcs3/Emu/RSX/VK/vkutils/swapchain_unix.hpp diff --git a/rpcs3/rpcs3/Emu/RSX/VK/vkutils/swapchain_win32.hpp b/rpcs3/Emu/RSX/VK/vkutils/swapchain_win32.hpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/vkutils/swapchain_win32.hpp rename to rpcs3/Emu/RSX/VK/vkutils/swapchain_win32.hpp diff --git a/rpcs3/rpcs3/Emu/RSX/VK/vkutils/sync.cpp b/rpcs3/Emu/RSX/VK/vkutils/sync.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/vkutils/sync.cpp rename to rpcs3/Emu/RSX/VK/vkutils/sync.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/VK/vkutils/sync.h b/rpcs3/Emu/RSX/VK/vkutils/sync.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/VK/vkutils/sync.h rename to rpcs3/Emu/RSX/VK/vkutils/sync.h diff --git a/rpcs3/rpcs3/Emu/RSX/color_utils.h b/rpcs3/Emu/RSX/color_utils.h similarity index 96% rename from rpcs3/rpcs3/Emu/RSX/color_utils.h rename to rpcs3/Emu/RSX/color_utils.h index ce1e6921e..d116ca03d 100644 --- a/rpcs3/rpcs3/Emu/RSX/color_utils.h +++ b/rpcs3/Emu/RSX/color_utils.h @@ -1,9 +1,9 @@ #pragma once #include -#include +#include #include "gcm_enums.h" -#include "Utilities/StrFmt.h" +#include "util/StrFmt.h" namespace rsx { diff --git a/rpcs3/rpcs3/Emu/RSX/display.h b/rpcs3/Emu/RSX/display.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/display.h rename to rpcs3/Emu/RSX/display.h diff --git a/rpcs3/rpcs3/Emu/RSX/gcm_enums.cpp b/rpcs3/Emu/RSX/gcm_enums.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/RSX/gcm_enums.cpp rename to rpcs3/Emu/RSX/gcm_enums.cpp index c4f7edd1d..9e62704a6 100644 --- a/rpcs3/rpcs3/Emu/RSX/gcm_enums.cpp +++ b/rpcs3/Emu/RSX/gcm_enums.cpp @@ -1,5 +1,5 @@ #include "gcm_enums.h" -#include "Utilities/StrFmt.h" +#include "util/StrFmt.h" using namespace rsx; diff --git a/rpcs3/rpcs3/Emu/RSX/gcm_enums.h b/rpcs3/Emu/RSX/gcm_enums.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/gcm_enums.h rename to rpcs3/Emu/RSX/gcm_enums.h diff --git a/rpcs3/rpcs3/Emu/RSX/gcm_printing.cpp b/rpcs3/Emu/RSX/gcm_printing.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/RSX/gcm_printing.cpp rename to rpcs3/Emu/RSX/gcm_printing.cpp index 4ef84a1ad..a18212f40 100644 --- a/rpcs3/rpcs3/Emu/RSX/gcm_printing.cpp +++ b/rpcs3/Emu/RSX/gcm_printing.cpp @@ -1,7 +1,7 @@ #include "gcm_printing.h" #include "rsx_decode.h" #include -#include +#include namespace { diff --git a/rpcs3/rpcs3/Emu/RSX/gcm_printing.h b/rpcs3/Emu/RSX/gcm_printing.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/gcm_printing.h rename to rpcs3/Emu/RSX/gcm_printing.h diff --git a/rpcs3/rpcs3/Emu/RSX/rsx_cache.h b/rpcs3/Emu/RSX/rsx_cache.h similarity index 99% rename from rpcs3/rpcs3/Emu/RSX/rsx_cache.h rename to rpcs3/Emu/RSX/rsx_cache.h index 19bd9695d..3d3298532 100644 --- a/rpcs3/rpcs3/Emu/RSX/rsx_cache.h +++ b/rpcs3/Emu/RSX/rsx_cache.h @@ -1,8 +1,8 @@ #pragma once #include "../system_config.h" -#include "Utilities/File.h" -#include "Utilities/lockless.h" -#include "Utilities/Thread.h" +#include "util/File.h" +#include "util/lockless.h" +#include "util/Thread.h" #include "Common/bitfield.hpp" #include "Common/unordered_map.hpp" #include "Emu/System.h" diff --git a/rpcs3/rpcs3/Emu/RSX/rsx_decode.h b/rpcs3/Emu/RSX/rsx_decode.h similarity index 99% rename from rpcs3/rpcs3/Emu/RSX/rsx_decode.h rename to rpcs3/Emu/RSX/rsx_decode.h index 5b13d56f2..e407daf83 100644 --- a/rpcs3/rpcs3/Emu/RSX/rsx_decode.h +++ b/rpcs3/Emu/RSX/rsx_decode.h @@ -1,8 +1,8 @@ #pragma once #include "util/types.hpp" -#include "Utilities/BitField.h" -#include "Utilities/StrFmt.h" +#include "util/BitField.h" +#include "util/StrFmt.h" #include #include #include "gcm_enums.h" diff --git a/rpcs3/rpcs3/Emu/RSX/rsx_methods.cpp b/rpcs3/Emu/RSX/rsx_methods.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/rsx_methods.cpp rename to rpcs3/Emu/RSX/rsx_methods.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/rsx_methods.h b/rpcs3/Emu/RSX/rsx_methods.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/rsx_methods.h rename to rpcs3/Emu/RSX/rsx_methods.h diff --git a/rpcs3/rpcs3/Emu/RSX/rsx_utils.cpp b/rpcs3/Emu/RSX/rsx_utils.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/RSX/rsx_utils.cpp rename to rpcs3/Emu/RSX/rsx_utils.cpp index 8f0dff156..e27ca0d77 100644 --- a/rpcs3/rpcs3/Emu/RSX/rsx_utils.cpp +++ b/rpcs3/Emu/RSX/rsx_utils.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "rsx_utils.h" #include "rsx_methods.h" -#include "Emu/Cell/Modules/cellVideoOut.h" +#include "rpcsx/fw/ps3/cellVideoOut.h" #ifdef _MSC_VER #pragma warning(push, 0) diff --git a/rpcs3/rpcs3/Emu/RSX/rsx_utils.h b/rpcs3/Emu/RSX/rsx_utils.h similarity index 99% rename from rpcs3/rpcs3/Emu/RSX/rsx_utils.h rename to rpcs3/Emu/RSX/rsx_utils.h index 88ef41d0b..8d01e4e1d 100644 --- a/rpcs3/rpcs3/Emu/RSX/rsx_utils.h +++ b/rpcs3/Emu/RSX/rsx_utils.h @@ -1,8 +1,8 @@ #pragma once #include "../system_config.h" -#include "Utilities/address_range.h" -#include "Utilities/geometry.h" +#include "util/address_range.h" +#include "util/geometry.h" #include "gcm_enums.h" extern "C" diff --git a/rpcs3/rpcs3/Emu/RSX/rsx_vertex_data.cpp b/rpcs3/Emu/RSX/rsx_vertex_data.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/rsx_vertex_data.cpp rename to rpcs3/Emu/RSX/rsx_vertex_data.cpp diff --git a/rpcs3/rpcs3/Emu/RSX/rsx_vertex_data.h b/rpcs3/Emu/RSX/rsx_vertex_data.h similarity index 100% rename from rpcs3/rpcs3/Emu/RSX/rsx_vertex_data.h rename to rpcs3/Emu/RSX/rsx_vertex_data.h diff --git a/rpcs3/rpcs3/Emu/System.cpp b/rpcs3/Emu/System.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/System.cpp rename to rpcs3/Emu/System.cpp index fc6ee882b..85f4c6523 100644 --- a/rpcs3/rpcs3/Emu/System.cpp +++ b/rpcs3/Emu/System.cpp @@ -3,11 +3,11 @@ #include "Crypto/unedat.h" #include "Crypto/unpkg.h" #include "Loader/PUP.h" -#include "Utilities/File.h" +#include "util/File.h" #include "dev/block_dev.hpp" #include "dev/iso.hpp" #include "VFS.h" -#include "Utilities/bin_patch.h" +#include "util/bin_patch.h" #include "Emu/Memory/vm.h" #include "Emu/System.h" #include "Emu/system_progress.hpp" @@ -31,8 +31,8 @@ #include "Emu/Cell/lv2/sys_prx.h" #include "Emu/Cell/lv2/sys_overlay.h" #include "Emu/Cell/lv2/sys_spu.h" -#include "Emu/Cell/Modules/cellGame.h" -#include "Emu/Cell/Modules/cellSysutil.h" +#include "rpcsx/fw/ps3/cellGame.h" +#include "rpcsx/fw/ps3/cellSysutil.h" #include "Emu/title.h" #include "Emu/IdManager.h" @@ -46,7 +46,7 @@ #include "rpcs3_version.h" -#include "Utilities/StrUtil.h" +#include "util/StrUtil.h" #include "../Crypto/unself.h" #include "util/logs.hpp" @@ -56,7 +56,7 @@ #include #include -#include "Utilities/JIT.h" +#include "util/JIT.h" #include "Emu/IPC_socket.h" diff --git a/rpcs3/rpcs3/Emu/System.h b/rpcs3/Emu/System.h similarity index 99% rename from rpcs3/rpcs3/Emu/System.h rename to rpcs3/Emu/System.h index 0368ac1cc..b77e92085 100644 --- a/rpcs3/rpcs3/Emu/System.h +++ b/rpcs3/Emu/System.h @@ -4,7 +4,7 @@ #include "util/types.hpp" #include "util/atomic.hpp" #include "util/shared_ptr.hpp" -#include "Utilities/bit_set.h" +#include "util/bit_set.h" #include "config_mode.h" #include "games_config.h" #include diff --git a/rpcs3/rpcs3/Emu/VFS.cpp b/rpcs3/Emu/VFS.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/VFS.cpp rename to rpcs3/Emu/VFS.cpp index 173080f7f..425e26d6d 100644 --- a/rpcs3/rpcs3/Emu/VFS.cpp +++ b/rpcs3/Emu/VFS.cpp @@ -5,8 +5,8 @@ #include "Cell/lv2/sys_fs.h" -#include "Utilities/mutex.h" -#include "Utilities/StrUtil.h" +#include "util/mutex.h" +#include "util/StrUtil.h" #ifdef _WIN32 #include diff --git a/rpcs3/rpcs3/Emu/VFS.h b/rpcs3/Emu/VFS.h similarity index 100% rename from rpcs3/rpcs3/Emu/VFS.h rename to rpcs3/Emu/VFS.h diff --git a/rpcs3/rpcs3/Emu/cache_utils.cpp b/rpcs3/Emu/cache_utils.cpp similarity index 97% rename from rpcs3/rpcs3/Emu/cache_utils.cpp rename to rpcs3/Emu/cache_utils.cpp index 64d31ad35..bfdf59165 100644 --- a/rpcs3/rpcs3/Emu/cache_utils.cpp +++ b/rpcs3/Emu/cache_utils.cpp @@ -1,5 +1,7 @@ #include "stdafx.h" #include "cache_utils.hpp" + +#include #include "system_utils.hpp" #include "system_config.h" #include "IdManager.h" @@ -76,7 +78,7 @@ namespace rpcs3::cache cache_dir.close(); // sort oldest first - std::sort(file_list.begin(), file_list.end(), FN(x.mtime < y.mtime)); + std::ranges::sort(file_list, FN(x.mtime < y.mtime)); // keep removing until cache is empty or enough bytes have been cleared // cache is cleared down to 80% of limit to increase interval between clears diff --git a/rpcs3/rpcs3/Emu/cache_utils.hpp b/rpcs3/Emu/cache_utils.hpp similarity index 100% rename from rpcs3/rpcs3/Emu/cache_utils.hpp rename to rpcs3/Emu/cache_utils.hpp diff --git a/rpcs3/rpcs3/Emu/config_mode.h b/rpcs3/Emu/config_mode.h similarity index 100% rename from rpcs3/rpcs3/Emu/config_mode.h rename to rpcs3/Emu/config_mode.h diff --git a/rpcs3/rpcs3/Emu/games_config.cpp b/rpcs3/Emu/games_config.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/games_config.cpp rename to rpcs3/Emu/games_config.cpp index cfa43f6e1..e6f1f22b0 100644 --- a/rpcs3/rpcs3/Emu/games_config.cpp +++ b/rpcs3/Emu/games_config.cpp @@ -2,7 +2,7 @@ #include "games_config.h" #include "util/logs.hpp" #include "util/yaml.hpp" -#include "Utilities/File.h" +#include "util/File.h" LOG_CHANNEL(cfg_log, "CFG"); diff --git a/rpcs3/rpcs3/Emu/games_config.h b/rpcs3/Emu/games_config.h similarity index 96% rename from rpcs3/rpcs3/Emu/games_config.h rename to rpcs3/Emu/games_config.h index 86e91b570..7dedebc1f 100644 --- a/rpcs3/rpcs3/Emu/games_config.h +++ b/rpcs3/Emu/games_config.h @@ -1,6 +1,6 @@ #pragma once -#include "Utilities/mutex.h" +#include "util/mutex.h" #include class games_config diff --git a/rpcs3/rpcs3/Emu/localized_string.cpp b/rpcs3/Emu/localized_string.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/localized_string.cpp rename to rpcs3/Emu/localized_string.cpp diff --git a/rpcs3/rpcs3/Emu/localized_string.h b/rpcs3/Emu/localized_string.h similarity index 100% rename from rpcs3/rpcs3/Emu/localized_string.h rename to rpcs3/Emu/localized_string.h diff --git a/rpcs3/rpcs3/Emu/localized_string_id.h b/rpcs3/Emu/localized_string_id.h similarity index 100% rename from rpcs3/rpcs3/Emu/localized_string_id.h rename to rpcs3/Emu/localized_string_id.h diff --git a/rpcs3/rpcs3/Emu/perf_meter.cpp b/rpcs3/Emu/perf_meter.cpp similarity index 98% rename from rpcs3/rpcs3/Emu/perf_meter.cpp rename to rpcs3/Emu/perf_meter.cpp index c120fa7b4..f8b2dd243 100644 --- a/rpcs3/rpcs3/Emu/perf_meter.cpp +++ b/rpcs3/Emu/perf_meter.cpp @@ -4,8 +4,8 @@ #include "util/sysinfo.hpp" #include "util/fence.hpp" #include "util/tsc.hpp" -#include "Utilities/Thread.h" -#include "Utilities/mutex.h" +#include "util/Thread.h" +#include "util/mutex.h" #include #include diff --git a/rpcs3/rpcs3/Emu/perf_meter.hpp b/rpcs3/Emu/perf_meter.hpp similarity index 100% rename from rpcs3/rpcs3/Emu/perf_meter.hpp rename to rpcs3/Emu/perf_meter.hpp diff --git a/rpcs3/rpcs3/Emu/perf_monitor.cpp b/rpcs3/Emu/perf_monitor.cpp similarity index 98% rename from rpcs3/rpcs3/Emu/perf_monitor.cpp rename to rpcs3/Emu/perf_monitor.cpp index 15cdcf498..d60015268 100644 --- a/rpcs3/rpcs3/Emu/perf_monitor.cpp +++ b/rpcs3/Emu/perf_monitor.cpp @@ -4,7 +4,7 @@ #include "Emu/System.h" #include "Emu/Cell/timers.hpp" #include "util/cpu_stats.hpp" -#include "Utilities/Thread.h" +#include "util/Thread.h" LOG_CHANNEL(perf_log, "PERF"); diff --git a/rpcs3/rpcs3/Emu/perf_monitor.hpp b/rpcs3/Emu/perf_monitor.hpp similarity index 100% rename from rpcs3/rpcs3/Emu/perf_monitor.hpp rename to rpcs3/Emu/perf_monitor.hpp diff --git a/rpcs3/rpcs3/Emu/savestate_utils.cpp b/rpcs3/Emu/savestate_utils.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/savestate_utils.cpp rename to rpcs3/Emu/savestate_utils.cpp index 659e1c932..46fbc0c37 100644 --- a/rpcs3/rpcs3/Emu/savestate_utils.cpp +++ b/rpcs3/Emu/savestate_utils.cpp @@ -3,8 +3,8 @@ #include "util/logs.hpp" #include "util/v128.hpp" #include "util/simd.hpp" -#include "Utilities/File.h" -#include "Utilities/StrFmt.h" +#include "util/File.h" +#include "util/StrFmt.h" #include "system_config.h" #include "savestate_utils.hpp" diff --git a/rpcs3/rpcs3/Emu/savestate_utils.hpp b/rpcs3/Emu/savestate_utils.hpp similarity index 100% rename from rpcs3/rpcs3/Emu/savestate_utils.hpp rename to rpcs3/Emu/savestate_utils.hpp diff --git a/rpcs3/rpcs3/Emu/scoped_progress_dialog.cpp b/rpcs3/Emu/scoped_progress_dialog.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/scoped_progress_dialog.cpp rename to rpcs3/Emu/scoped_progress_dialog.cpp diff --git a/rpcs3/rpcs3/Emu/system_config.cpp b/rpcs3/Emu/system_config.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/system_config.cpp rename to rpcs3/Emu/system_config.cpp diff --git a/rpcs3/rpcs3/Emu/system_config.h b/rpcs3/Emu/system_config.h similarity index 99% rename from rpcs3/rpcs3/Emu/system_config.h rename to rpcs3/Emu/system_config.h index 366740340..1245148f5 100644 --- a/rpcs3/rpcs3/Emu/system_config.h +++ b/rpcs3/Emu/system_config.h @@ -1,8 +1,8 @@ #pragma once -#include "Utilities/Thread.h" +#include "util/Thread.h" #include "system_config_types.h" -#include "Utilities/Config.h" +#include "util/Config.h" #include enum CellNetCtlState : s32; diff --git a/rpcs3/rpcs3/Emu/system_config_types.cpp b/rpcs3/Emu/system_config_types.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/system_config_types.cpp rename to rpcs3/Emu/system_config_types.cpp diff --git a/rpcs3/rpcs3/Emu/system_config_types.h b/rpcs3/Emu/system_config_types.h similarity index 100% rename from rpcs3/rpcs3/Emu/system_config_types.h rename to rpcs3/Emu/system_config_types.h diff --git a/rpcs3/rpcs3/Emu/system_progress.cpp b/rpcs3/Emu/system_progress.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/system_progress.cpp rename to rpcs3/Emu/system_progress.cpp index 33ba1f93d..780deb81a 100644 --- a/rpcs3/rpcs3/Emu/system_progress.cpp +++ b/rpcs3/Emu/system_progress.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "system_progress.hpp" -#include "Emu/Cell/Modules/cellMsgDialog.h" +#include "rpcsx/fw/ps3/cellMsgDialog.h" #include "Emu/RSX/RSXThread.h" #include "Emu/RSX/Overlays/overlay_manager.h" #include "Emu/RSX/Overlays/overlay_message_dialog.h" diff --git a/rpcs3/rpcs3/Emu/system_progress.hpp b/rpcs3/Emu/system_progress.hpp similarity index 98% rename from rpcs3/rpcs3/Emu/system_progress.hpp rename to rpcs3/Emu/system_progress.hpp index 67e4e68df..a3822c17b 100644 --- a/rpcs3/rpcs3/Emu/system_progress.hpp +++ b/rpcs3/Emu/system_progress.hpp @@ -2,7 +2,7 @@ #include "util/types.hpp" #include "util/atomic.hpp" -#include "Utilities/lockless.h" +#include "util/lockless.h" #include "util/shared_ptr.hpp" extern lf_array> g_progr_text_queue; diff --git a/rpcs3/rpcs3/Emu/system_utils.cpp b/rpcs3/Emu/system_utils.cpp similarity index 99% rename from rpcs3/rpcs3/Emu/system_utils.cpp rename to rpcs3/Emu/system_utils.cpp index 91d12dae5..6a55ce847 100644 --- a/rpcs3/rpcs3/Emu/system_utils.cpp +++ b/rpcs3/Emu/system_utils.cpp @@ -6,8 +6,8 @@ #include "Emu/System.h" #include "Emu/VFS.h" #include "util/sysinfo.hpp" -#include "Utilities/File.h" -#include "Utilities/Thread.h" +#include "util/File.h" +#include "util/Thread.h" #include "Crypto/unpkg.h" #include "Crypto/unself.h" #include "Crypto/unedat.h" diff --git a/rpcs3/rpcs3/Emu/system_utils.hpp b/rpcs3/Emu/system_utils.hpp similarity index 100% rename from rpcs3/rpcs3/Emu/system_utils.hpp rename to rpcs3/Emu/system_utils.hpp diff --git a/rpcs3/rpcs3/Emu/title.cpp b/rpcs3/Emu/title.cpp similarity index 100% rename from rpcs3/rpcs3/Emu/title.cpp rename to rpcs3/Emu/title.cpp diff --git a/rpcs3/rpcs3/Emu/title.h b/rpcs3/Emu/title.h similarity index 100% rename from rpcs3/rpcs3/Emu/title.h rename to rpcs3/Emu/title.h diff --git a/rpcs3/rpcs3/Emu/vfs_config.cpp b/rpcs3/Emu/vfs_config.cpp similarity index 98% rename from rpcs3/rpcs3/Emu/vfs_config.cpp rename to rpcs3/Emu/vfs_config.cpp index bd292f9a2..4451a6368 100644 --- a/rpcs3/rpcs3/Emu/vfs_config.cpp +++ b/rpcs3/Emu/vfs_config.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "vfs_config.h" -#include "Utilities/StrUtil.h" +#include "util/StrUtil.h" LOG_CHANNEL(vfs_log, "VFS"); diff --git a/rpcs3/rpcs3/Emu/vfs_config.h b/rpcs3/Emu/vfs_config.h similarity index 98% rename from rpcs3/rpcs3/Emu/vfs_config.h rename to rpcs3/Emu/vfs_config.h index af3ea7ef0..a46805b60 100644 --- a/rpcs3/rpcs3/Emu/vfs_config.h +++ b/rpcs3/Emu/vfs_config.h @@ -1,6 +1,6 @@ #pragma once -#include "Utilities/Config.h" +#include "util/Config.h" struct cfg_vfs : cfg::node { diff --git a/rpcs3/rpcs3/Input/basic_keyboard_handler.cpp b/rpcs3/Input/basic_keyboard_handler.cpp similarity index 100% rename from rpcs3/rpcs3/Input/basic_keyboard_handler.cpp rename to rpcs3/Input/basic_keyboard_handler.cpp diff --git a/rpcs3/rpcs3/Input/basic_keyboard_handler.h b/rpcs3/Input/basic_keyboard_handler.h similarity index 100% rename from rpcs3/rpcs3/Input/basic_keyboard_handler.h rename to rpcs3/Input/basic_keyboard_handler.h diff --git a/rpcs3/rpcs3/Input/basic_mouse_handler.cpp b/rpcs3/Input/basic_mouse_handler.cpp similarity index 100% rename from rpcs3/rpcs3/Input/basic_mouse_handler.cpp rename to rpcs3/Input/basic_mouse_handler.cpp diff --git a/rpcs3/rpcs3/Input/basic_mouse_handler.h b/rpcs3/Input/basic_mouse_handler.h similarity index 100% rename from rpcs3/rpcs3/Input/basic_mouse_handler.h rename to rpcs3/Input/basic_mouse_handler.h diff --git a/rpcs3/rpcs3/Input/ds3_pad_handler.cpp b/rpcs3/Input/ds3_pad_handler.cpp similarity index 100% rename from rpcs3/rpcs3/Input/ds3_pad_handler.cpp rename to rpcs3/Input/ds3_pad_handler.cpp diff --git a/rpcs3/rpcs3/Input/ds3_pad_handler.h b/rpcs3/Input/ds3_pad_handler.h similarity index 100% rename from rpcs3/rpcs3/Input/ds3_pad_handler.h rename to rpcs3/Input/ds3_pad_handler.h diff --git a/rpcs3/rpcs3/Input/ds4_pad_handler.cpp b/rpcs3/Input/ds4_pad_handler.cpp similarity index 100% rename from rpcs3/rpcs3/Input/ds4_pad_handler.cpp rename to rpcs3/Input/ds4_pad_handler.cpp diff --git a/rpcs3/rpcs3/Input/ds4_pad_handler.h b/rpcs3/Input/ds4_pad_handler.h similarity index 100% rename from rpcs3/rpcs3/Input/ds4_pad_handler.h rename to rpcs3/Input/ds4_pad_handler.h diff --git a/rpcs3/rpcs3/Input/dualsense_pad_handler.cpp b/rpcs3/Input/dualsense_pad_handler.cpp similarity index 100% rename from rpcs3/rpcs3/Input/dualsense_pad_handler.cpp rename to rpcs3/Input/dualsense_pad_handler.cpp diff --git a/rpcs3/rpcs3/Input/dualsense_pad_handler.h b/rpcs3/Input/dualsense_pad_handler.h similarity index 100% rename from rpcs3/rpcs3/Input/dualsense_pad_handler.h rename to rpcs3/Input/dualsense_pad_handler.h diff --git a/rpcs3/rpcs3/Input/evdev_gun_handler.cpp b/rpcs3/Input/evdev_gun_handler.cpp similarity index 100% rename from rpcs3/rpcs3/Input/evdev_gun_handler.cpp rename to rpcs3/Input/evdev_gun_handler.cpp diff --git a/rpcs3/rpcs3/Input/evdev_gun_handler.h b/rpcs3/Input/evdev_gun_handler.h similarity index 96% rename from rpcs3/rpcs3/Input/evdev_gun_handler.h rename to rpcs3/Input/evdev_gun_handler.h index 342fff40d..0a42a3494 100644 --- a/rpcs3/rpcs3/Input/evdev_gun_handler.h +++ b/rpcs3/Input/evdev_gun_handler.h @@ -2,7 +2,7 @@ #ifdef HAVE_LIBEVDEV #include -#include "Utilities/mutex.h" +#include "util/mutex.h" enum class gun_button { diff --git a/rpcs3/rpcs3/Input/evdev_joystick_handler.cpp b/rpcs3/Input/evdev_joystick_handler.cpp similarity index 100% rename from rpcs3/rpcs3/Input/evdev_joystick_handler.cpp rename to rpcs3/Input/evdev_joystick_handler.cpp diff --git a/rpcs3/rpcs3/Input/evdev_joystick_handler.h b/rpcs3/Input/evdev_joystick_handler.h similarity index 99% rename from rpcs3/rpcs3/Input/evdev_joystick_handler.h rename to rpcs3/Input/evdev_joystick_handler.h index 10facd18a..17e832c33 100644 --- a/rpcs3/rpcs3/Input/evdev_joystick_handler.h +++ b/rpcs3/Input/evdev_joystick_handler.h @@ -2,7 +2,7 @@ #ifdef HAVE_LIBEVDEV #include "util/types.hpp" -#include "Utilities/File.h" +#include "util/File.h" #include "Emu/Io/PadHandler.h" #include #include diff --git a/rpcs3/rpcs3/Input/gui_pad_thread.cpp b/rpcs3/Input/gui_pad_thread.cpp similarity index 100% rename from rpcs3/rpcs3/Input/gui_pad_thread.cpp rename to rpcs3/Input/gui_pad_thread.cpp diff --git a/rpcs3/rpcs3/Input/gui_pad_thread.h b/rpcs3/Input/gui_pad_thread.h similarity index 97% rename from rpcs3/rpcs3/Input/gui_pad_thread.h rename to rpcs3/Input/gui_pad_thread.h index 97a498f29..d4a8c169d 100644 --- a/rpcs3/rpcs3/Input/gui_pad_thread.h +++ b/rpcs3/Input/gui_pad_thread.h @@ -5,8 +5,8 @@ #include "Emu/Io/pad_types.h" #include "Emu/Io/pad_config.h" #include "Emu/Io/pad_config_types.h" -#include "Utilities/Timer.h" -#include "Utilities/Thread.h" +#include "util/Timer.h" +#include "util/Thread.h" class PadHandlerBase; class gui_settings; diff --git a/rpcs3/rpcs3/Input/hid_pad_handler.cpp b/rpcs3/Input/hid_pad_handler.cpp similarity index 99% rename from rpcs3/rpcs3/Input/hid_pad_handler.cpp rename to rpcs3/Input/hid_pad_handler.cpp index f22b3dc40..fe5a226c7 100644 --- a/rpcs3/rpcs3/Input/hid_pad_handler.cpp +++ b/rpcs3/Input/hid_pad_handler.cpp @@ -5,7 +5,7 @@ #include "skateboard_pad_handler.h" #include "ps_move_handler.h" #include "util/logs.hpp" -#include "Utilities/Timer.h" +#include "util/Timer.h" #include "Emu/System.h" #include "pad_thread.h" diff --git a/rpcs3/rpcs3/Input/hid_pad_handler.h b/rpcs3/Input/hid_pad_handler.h similarity index 98% rename from rpcs3/rpcs3/Input/hid_pad_handler.h rename to rpcs3/Input/hid_pad_handler.h index 7c1af2755..4bf2c2913 100644 --- a/rpcs3/rpcs3/Input/hid_pad_handler.h +++ b/rpcs3/Input/hid_pad_handler.h @@ -1,8 +1,8 @@ #pragma once #include "Emu/Io/PadHandler.h" -#include "Utilities/CRC.h" -#include "Utilities/Thread.h" +#include "util/CRC.h" +#include "util/Thread.h" #include "hidapi.h" diff --git a/rpcs3/rpcs3/Input/mm_joystick_handler.cpp b/rpcs3/Input/mm_joystick_handler.cpp similarity index 100% rename from rpcs3/rpcs3/Input/mm_joystick_handler.cpp rename to rpcs3/Input/mm_joystick_handler.cpp diff --git a/rpcs3/rpcs3/Input/mm_joystick_handler.h b/rpcs3/Input/mm_joystick_handler.h similarity index 100% rename from rpcs3/rpcs3/Input/mm_joystick_handler.h rename to rpcs3/Input/mm_joystick_handler.h diff --git a/rpcs3/rpcs3/Input/pad_thread.cpp b/rpcs3/Input/pad_thread.cpp similarity index 99% rename from rpcs3/rpcs3/Input/pad_thread.cpp rename to rpcs3/Input/pad_thread.cpp index f666b1e2f..fb9a43462 100644 --- a/rpcs3/rpcs3/Input/pad_thread.cpp +++ b/rpcs3/Input/pad_thread.cpp @@ -25,9 +25,9 @@ #include "Emu/RSX/Overlays/HomeMenu/overlay_home_menu.h" #include "Emu/RSX/Overlays/overlay_message.h" #include "Emu/Cell/lv2/sys_usbd.h" -#include "Emu/Cell/Modules/cellGem.h" +#include "rpcsx/fw/ps3/cellGem.h" #include "Emu/Cell/timers.hpp" -#include "Utilities/Thread.h" +#include "util/Thread.h" #include "util/atomic.hpp" LOG_CHANNEL(sys_log, "SYS"); diff --git a/rpcs3/rpcs3/Input/pad_thread.h b/rpcs3/Input/pad_thread.h similarity index 98% rename from rpcs3/rpcs3/Input/pad_thread.h rename to rpcs3/Input/pad_thread.h index ab9e365e9..5165ad171 100644 --- a/rpcs3/rpcs3/Input/pad_thread.h +++ b/rpcs3/Input/pad_thread.h @@ -5,7 +5,7 @@ #include "Emu/Io/pad_types.h" #include "Emu/Io/pad_config.h" #include "Emu/Io/pad_config_types.h" -#include "Utilities/mutex.h" +#include "util/mutex.h" #include #include diff --git a/rpcs3/rpcs3/Input/product_info.cpp b/rpcs3/Input/product_info.cpp similarity index 100% rename from rpcs3/rpcs3/Input/product_info.cpp rename to rpcs3/Input/product_info.cpp diff --git a/rpcs3/rpcs3/Input/product_info.h b/rpcs3/Input/product_info.h similarity index 100% rename from rpcs3/rpcs3/Input/product_info.h rename to rpcs3/Input/product_info.h diff --git a/rpcs3/rpcs3/Input/ps_move_calibration.cpp b/rpcs3/Input/ps_move_calibration.cpp similarity index 100% rename from rpcs3/rpcs3/Input/ps_move_calibration.cpp rename to rpcs3/Input/ps_move_calibration.cpp diff --git a/rpcs3/rpcs3/Input/ps_move_calibration.h b/rpcs3/Input/ps_move_calibration.h similarity index 100% rename from rpcs3/rpcs3/Input/ps_move_calibration.h rename to rpcs3/Input/ps_move_calibration.h diff --git a/rpcs3/rpcs3/Input/ps_move_config.cpp b/rpcs3/Input/ps_move_config.cpp similarity index 100% rename from rpcs3/rpcs3/Input/ps_move_config.cpp rename to rpcs3/Input/ps_move_config.cpp diff --git a/rpcs3/rpcs3/Input/ps_move_config.h b/rpcs3/Input/ps_move_config.h similarity index 97% rename from rpcs3/rpcs3/Input/ps_move_config.h rename to rpcs3/Input/ps_move_config.h index 48b118dce..4ffe00bb2 100644 --- a/rpcs3/rpcs3/Input/ps_move_config.h +++ b/rpcs3/Input/ps_move_config.h @@ -1,6 +1,6 @@ #pragma once -#include "Utilities/Config.h" +#include "util/Config.h" #include diff --git a/rpcs3/rpcs3/Input/ps_move_handler.cpp b/rpcs3/Input/ps_move_handler.cpp similarity index 99% rename from rpcs3/rpcs3/Input/ps_move_handler.cpp rename to rpcs3/Input/ps_move_handler.cpp index 4b1c0f65a..97f1bc8ac 100644 --- a/rpcs3/rpcs3/Input/ps_move_handler.cpp +++ b/rpcs3/Input/ps_move_handler.cpp @@ -2,7 +2,7 @@ #include "ps_move_handler.h" #include "ps_move_calibration.h" #include "Emu/Io/pad_config.h" -#include "Emu/Cell/Modules/cellGem.h" +#include "rpcsx/fw/ps3//cellGem.h" LOG_CHANNEL(move_log, "Move"); diff --git a/rpcs3/rpcs3/Input/ps_move_handler.h b/rpcs3/Input/ps_move_handler.h similarity index 100% rename from rpcs3/rpcs3/Input/ps_move_handler.h rename to rpcs3/Input/ps_move_handler.h diff --git a/rpcs3/rpcs3/Input/ps_move_tracker.cpp b/rpcs3/Input/ps_move_tracker.cpp similarity index 99% rename from rpcs3/rpcs3/Input/ps_move_tracker.cpp rename to rpcs3/Input/ps_move_tracker.cpp index 66ed98a2e..3b3dd0e0d 100644 --- a/rpcs3/rpcs3/Input/ps_move_tracker.cpp +++ b/rpcs3/Input/ps_move_tracker.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" -#include "Emu/Cell/Modules/cellCamera.h" -#include "Emu/Cell/Modules/cellGem.h" +#include "rpcsx/fw/ps3/cellCamera.h" +#include "rpcsx/fw/ps3/cellGem.h" #include "ps_move_tracker.h" #include diff --git a/rpcs3/rpcs3/Input/ps_move_tracker.h b/rpcs3/Input/ps_move_tracker.h similarity index 97% rename from rpcs3/rpcs3/Input/ps_move_tracker.h rename to rpcs3/Input/ps_move_tracker.h index d2281d350..613d4c7db 100644 --- a/rpcs3/rpcs3/Input/ps_move_tracker.h +++ b/rpcs3/Input/ps_move_tracker.h @@ -1,6 +1,9 @@ #pragma once -#include "Emu/Cell/Modules/cellGem.h" +#include "rpcsx/fw/ps3/cellGem.h" +#include "util/Thread.h" +#include "util/types.hpp" +#include #ifdef HAVE_OPENCV constexpr bool g_ps_move_tracking_supported = true; diff --git a/rpcs3/rpcs3/Input/raw_mouse_config.cpp b/rpcs3/Input/raw_mouse_config.cpp similarity index 100% rename from rpcs3/rpcs3/Input/raw_mouse_config.cpp rename to rpcs3/Input/raw_mouse_config.cpp diff --git a/rpcs3/rpcs3/Input/raw_mouse_config.h b/rpcs3/Input/raw_mouse_config.h similarity index 96% rename from rpcs3/rpcs3/Input/raw_mouse_config.h rename to rpcs3/Input/raw_mouse_config.h index 5766d1ff8..54a887bde 100644 --- a/rpcs3/rpcs3/Input/raw_mouse_config.h +++ b/rpcs3/Input/raw_mouse_config.h @@ -1,7 +1,7 @@ #pragma once -#include "Utilities/Config.h" -#include "Utilities/mutex.h" +#include "util/Config.h" +#include "util/mutex.h" #include diff --git a/rpcs3/rpcs3/Input/raw_mouse_handler.cpp b/rpcs3/Input/raw_mouse_handler.cpp similarity index 99% rename from rpcs3/rpcs3/Input/raw_mouse_handler.cpp rename to rpcs3/Input/raw_mouse_handler.cpp index cc235e55d..6ad02cb6e 100644 --- a/rpcs3/rpcs3/Input/raw_mouse_handler.cpp +++ b/rpcs3/Input/raw_mouse_handler.cpp @@ -5,7 +5,7 @@ #include "Emu/RSX/RSXThread.h" #include "Emu/Io/interception.h" #include "Input/raw_mouse_config.h" -#include "Utilities/Timer.h" +#include "util/Timer.h" #ifdef _WIN32 #include diff --git a/rpcs3/rpcs3/Input/raw_mouse_handler.h b/rpcs3/Input/raw_mouse_handler.h similarity index 97% rename from rpcs3/rpcs3/Input/raw_mouse_handler.h rename to rpcs3/Input/raw_mouse_handler.h index 6f48490ae..e4ab2695c 100644 --- a/rpcs3/rpcs3/Input/raw_mouse_handler.h +++ b/rpcs3/Input/raw_mouse_handler.h @@ -2,9 +2,9 @@ #include "Emu/Io/MouseHandler.h" #include "Emu/RSX/display.h" -#include "Utilities/Config.h" -#include "Utilities/mutex.h" -#include "Utilities/Thread.h" +#include "util/Config.h" +#include "util/mutex.h" +#include "util/Thread.h" class raw_mouse_handler; diff --git a/rpcs3/rpcs3/Input/sdl_pad_handler.cpp b/rpcs3/Input/sdl_pad_handler.cpp similarity index 100% rename from rpcs3/rpcs3/Input/sdl_pad_handler.cpp rename to rpcs3/Input/sdl_pad_handler.cpp diff --git a/rpcs3/rpcs3/Input/sdl_pad_handler.h b/rpcs3/Input/sdl_pad_handler.h similarity index 100% rename from rpcs3/rpcs3/Input/sdl_pad_handler.h rename to rpcs3/Input/sdl_pad_handler.h diff --git a/rpcs3/rpcs3/Input/skateboard_pad_handler.cpp b/rpcs3/Input/skateboard_pad_handler.cpp similarity index 100% rename from rpcs3/rpcs3/Input/skateboard_pad_handler.cpp rename to rpcs3/Input/skateboard_pad_handler.cpp diff --git a/rpcs3/rpcs3/Input/skateboard_pad_handler.h b/rpcs3/Input/skateboard_pad_handler.h similarity index 100% rename from rpcs3/rpcs3/Input/skateboard_pad_handler.h rename to rpcs3/Input/skateboard_pad_handler.h diff --git a/rpcs3/rpcs3/Input/virtual_pad_handler.cpp b/rpcs3/Input/virtual_pad_handler.cpp similarity index 100% rename from rpcs3/rpcs3/Input/virtual_pad_handler.cpp rename to rpcs3/Input/virtual_pad_handler.cpp diff --git a/rpcs3/rpcs3/Input/virtual_pad_handler.h b/rpcs3/Input/virtual_pad_handler.h similarity index 100% rename from rpcs3/rpcs3/Input/virtual_pad_handler.h rename to rpcs3/Input/virtual_pad_handler.h diff --git a/rpcs3/rpcs3/Input/xinput_pad_handler.cpp b/rpcs3/Input/xinput_pad_handler.cpp similarity index 100% rename from rpcs3/rpcs3/Input/xinput_pad_handler.cpp rename to rpcs3/Input/xinput_pad_handler.cpp diff --git a/rpcs3/rpcs3/Input/xinput_pad_handler.h b/rpcs3/Input/xinput_pad_handler.h similarity index 100% rename from rpcs3/rpcs3/Input/xinput_pad_handler.h rename to rpcs3/Input/xinput_pad_handler.h diff --git a/rpcs3/rpcs3/Loader/ELF.cpp b/rpcs3/Loader/ELF.cpp similarity index 100% rename from rpcs3/rpcs3/Loader/ELF.cpp rename to rpcs3/Loader/ELF.cpp diff --git a/rpcs3/rpcs3/Loader/ELF.h b/rpcs3/Loader/ELF.h similarity index 99% rename from rpcs3/rpcs3/Loader/ELF.h rename to rpcs3/Loader/ELF.h index 03ee85f4f..56da9f464 100644 --- a/rpcs3/rpcs3/Loader/ELF.h +++ b/rpcs3/Loader/ELF.h @@ -1,8 +1,8 @@ #pragma once #include "util/types.hpp" -#include "../../Utilities/File.h" -#include "../../Utilities/bit_set.h" +#include "util/File.h" +#include "util/bit_set.h" #include diff --git a/rpcs3/rpcs3/Loader/PSF.cpp b/rpcs3/Loader/PSF.cpp similarity index 100% rename from rpcs3/rpcs3/Loader/PSF.cpp rename to rpcs3/Loader/PSF.cpp diff --git a/rpcs3/rpcs3/Loader/PSF.h b/rpcs3/Loader/PSF.h similarity index 100% rename from rpcs3/rpcs3/Loader/PSF.h rename to rpcs3/Loader/PSF.h diff --git a/rpcs3/rpcs3/Loader/PUP.cpp b/rpcs3/Loader/PUP.cpp similarity index 100% rename from rpcs3/rpcs3/Loader/PUP.cpp rename to rpcs3/Loader/PUP.cpp diff --git a/rpcs3/rpcs3/Loader/PUP.h b/rpcs3/Loader/PUP.h similarity index 96% rename from rpcs3/rpcs3/Loader/PUP.h rename to rpcs3/Loader/PUP.h index f882fe6ac..3eec25676 100644 --- a/rpcs3/rpcs3/Loader/PUP.h +++ b/rpcs3/Loader/PUP.h @@ -2,7 +2,7 @@ #include "util/types.hpp" #include "util/endian.hpp" -#include "../../Utilities/File.h" +#include "util/File.h" #include diff --git a/rpcs3/rpcs3/Loader/TAR.cpp b/rpcs3/Loader/TAR.cpp similarity index 100% rename from rpcs3/rpcs3/Loader/TAR.cpp rename to rpcs3/Loader/TAR.cpp diff --git a/rpcs3/rpcs3/Loader/TAR.h b/rpcs3/Loader/TAR.h similarity index 100% rename from rpcs3/rpcs3/Loader/TAR.h rename to rpcs3/Loader/TAR.h diff --git a/rpcs3/rpcs3/Loader/TROPUSR.cpp b/rpcs3/Loader/TROPUSR.cpp similarity index 100% rename from rpcs3/rpcs3/Loader/TROPUSR.cpp rename to rpcs3/Loader/TROPUSR.cpp diff --git a/rpcs3/rpcs3/Loader/TROPUSR.h b/rpcs3/Loader/TROPUSR.h similarity index 98% rename from rpcs3/rpcs3/Loader/TROPUSR.h rename to rpcs3/Loader/TROPUSR.h index a830b03b5..2465b7dc6 100644 --- a/rpcs3/rpcs3/Loader/TROPUSR.h +++ b/rpcs3/Loader/TROPUSR.h @@ -1,7 +1,7 @@ #pragma once #include "stdafx.h" -#include "Utilities/rXml.h" -#include "Utilities/File.h" +#include "util/rXml.h" +#include "util/File.h" struct TROPUSRHeader { diff --git a/rpcs3/rpcs3/Loader/TRP.cpp b/rpcs3/Loader/TRP.cpp similarity index 99% rename from rpcs3/rpcs3/Loader/TRP.cpp rename to rpcs3/Loader/TRP.cpp index d0e9df438..cdc326f8d 100644 --- a/rpcs3/rpcs3/Loader/TRP.cpp +++ b/rpcs3/Loader/TRP.cpp @@ -2,7 +2,7 @@ #include "Emu/VFS.h" #include "TRP.h" #include "Crypto/sha1.h" -#include "Utilities/StrUtil.h" +#include "util/StrUtil.h" LOG_CHANNEL(trp_log, "Trophy"); diff --git a/rpcs3/rpcs3/Loader/TRP.h b/rpcs3/Loader/TRP.h similarity index 100% rename from rpcs3/rpcs3/Loader/TRP.h rename to rpcs3/Loader/TRP.h diff --git a/rpcs3/rpcs3/Loader/disc.cpp b/rpcs3/Loader/disc.cpp similarity index 99% rename from rpcs3/rpcs3/Loader/disc.cpp rename to rpcs3/Loader/disc.cpp index 3ef738fac..f0006011a 100644 --- a/rpcs3/rpcs3/Loader/disc.cpp +++ b/rpcs3/Loader/disc.cpp @@ -2,7 +2,7 @@ #include "disc.h" #include "PSF.h" #include "util/logs.hpp" -#include "Utilities/StrUtil.h" +#include "util/StrUtil.h" #include "Emu/System.h" #include "Emu/system_utils.hpp" diff --git a/rpcs3/rpcs3/Loader/disc.h b/rpcs3/Loader/disc.h similarity index 100% rename from rpcs3/rpcs3/Loader/disc.h rename to rpcs3/Loader/disc.h diff --git a/rpcs3/rpcs3/Loader/mself.cpp b/rpcs3/Loader/mself.cpp similarity index 98% rename from rpcs3/rpcs3/Loader/mself.cpp rename to rpcs3/Loader/mself.cpp index 0437cb4d1..8a3e8acdf 100644 --- a/rpcs3/rpcs3/Loader/mself.cpp +++ b/rpcs3/Loader/mself.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" -#include "Utilities/File.h" +#include "util/File.h" #include "util/logs.hpp" #include "Emu/VFS.h" diff --git a/rpcs3/rpcs3/Loader/mself.hpp b/rpcs3/Loader/mself.hpp similarity index 100% rename from rpcs3/rpcs3/Loader/mself.hpp rename to rpcs3/Loader/mself.hpp diff --git a/rpcs3/rpcs3/dev/block_dev.hpp b/rpcs3/dev/block_dev.hpp similarity index 98% rename from rpcs3/rpcs3/dev/block_dev.hpp rename to rpcs3/dev/block_dev.hpp index 5ebe8a14e..89d170c52 100644 --- a/rpcs3/rpcs3/dev/block_dev.hpp +++ b/rpcs3/dev/block_dev.hpp @@ -1,6 +1,6 @@ #pragma once -#include "Utilities/File.h" +#include "util/File.h" #include #include diff --git a/rpcs3/rpcs3/dev/iso.cpp b/rpcs3/dev/iso.cpp similarity index 99% rename from rpcs3/rpcs3/dev/iso.cpp rename to rpcs3/dev/iso.cpp index 9376b36fd..a2e50e9f9 100644 --- a/rpcs3/rpcs3/dev/iso.cpp +++ b/rpcs3/dev/iso.cpp @@ -1,6 +1,6 @@ #include "iso.hpp" -#include "Utilities/File.h" +#include "util/File.h" #include "util/types.hpp" #include #include diff --git a/rpcs3/rpcs3/dev/iso.hpp b/rpcs3/dev/iso.hpp similarity index 99% rename from rpcs3/rpcs3/dev/iso.hpp rename to rpcs3/dev/iso.hpp index 62ae3f0e4..019bbdc35 100644 --- a/rpcs3/rpcs3/dev/iso.hpp +++ b/rpcs3/dev/iso.hpp @@ -1,6 +1,6 @@ #pragma once -#include "Utilities/File.h" +#include "util/File.h" #include "block_dev.hpp" #include "util/endian.hpp" #include "util/types.hpp" diff --git a/rpcs3/rpcs3/git-version.cmake b/rpcs3/git-version.cmake similarity index 100% rename from rpcs3/rpcs3/git-version.cmake rename to rpcs3/git-version.cmake diff --git a/rpcs3/rpcs3/module_verifier.cpp b/rpcs3/module_verifier.cpp similarity index 97% rename from rpcs3/rpcs3/module_verifier.cpp rename to rpcs3/module_verifier.cpp index bf6989bc2..302007ef7 100644 --- a/rpcs3/rpcs3/module_verifier.cpp +++ b/rpcs3/module_verifier.cpp @@ -12,8 +12,8 @@ #include #include -#include -#include +#include +#include LOG_CHANNEL(sys_log, "SYS"); diff --git a/rpcs3/rpcs3/module_verifier.hpp b/rpcs3/module_verifier.hpp similarity index 100% rename from rpcs3/rpcs3/module_verifier.hpp rename to rpcs3/module_verifier.hpp diff --git a/rpcs3/rpcs3/CMakeLists.txt b/rpcs3/rpcs3/CMakeLists.txt deleted file mode 100644 index 508c3512b..000000000 --- a/rpcs3/rpcs3/CMakeLists.txt +++ /dev/null @@ -1,97 +0,0 @@ -# Define GNU standard installation directories -include(GNUInstallDirs) - -# Generate git-version.h at build time. -include(${CMAKE_CURRENT_SOURCE_DIR}/git-version.cmake) - -# Check for a sufficient compiler and set build options -include(ConfigureCompiler) -include(CheckFunctionExists) - -set(CMAKE_CXX_STANDARD 20) - -set(ADDITIONAL_LIBS "") -if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - #on some Linux distros shm_unlink and similar functions are in librt only - set(ADDITIONAL_LIBS ${ADDITIONAL_LIBS} "rt") -elseif(NOT WIN32 AND NOT CMAKE_CXX_FLAGS MATCHES "LIBICONV_PLUG") - #it seems like glibc includes the iconv functions we use but other libc - #implementations like the one on OSX don't seem implement them - set(ADDITIONAL_LIBS ${ADDITIONAL_LIBS} "iconv") -endif() - -# subdirectories -add_subdirectory(Emu) - -if(UNIX AND NOT APPLE AND NOT ANDROID) - add_definitions(-DDATADIR="${CMAKE_INSTALL_FULL_DATADIR}/rpcs3") - # Optionally enable X11 for window management - find_package(X11) - if(X11_FOUND) - target_compile_definitions(rpcs3_emu PUBLIC -DHAVE_X11) - endif() - find_package(Wayland) - if(WAYLAND_FOUND) - target_compile_definitions(rpcs3_emu PUBLIC -DHAVE_WAYLAND) - endif() -endif() - - -gen_git_version(${CMAKE_CURRENT_SOURCE_DIR}) - -add_library(rpcs3 STATIC - rpcs3_version.cpp - module_verifier.cpp - stb_image.cpp - - dev/iso.cpp - - Input/ds3_pad_handler.cpp - Input/ds4_pad_handler.cpp - Input/dualsense_pad_handler.cpp - Input/evdev_joystick_handler.cpp - Input/evdev_gun_handler.cpp - Input/hid_pad_handler.cpp - Input/mm_joystick_handler.cpp - Input/pad_thread.cpp - Input/product_info.cpp - Input/ps_move_calibration.cpp - Input/ps_move_config.cpp - Input/ps_move_handler.cpp - Input/ps_move_tracker.cpp - Input/raw_mouse_config.cpp - Input/raw_mouse_handler.cpp - Input/sdl_pad_handler.cpp - Input/skateboard_pad_handler.cpp - Input/xinput_pad_handler.cpp - Input/virtual_pad_handler.cpp -) - -target_link_libraries(rpcs3 PUBLIC - rpcs3_emu - 3rdparty::zlib - 3rdparty::pugixml - 3rdparty::discordRPC - 3rdparty::hidapi - 3rdparty::libusb - 3rdparty::libpng - 3rdparty::7zip - 3rdparty::wolfssl - 3rdparty::libcurl - 3rdparty::opencv - 3rdparty::fusion - 3rdparty::rtmidi - ${ADDITIONAL_LIBS} -) - -if(USE_PRECOMPILED_HEADERS) - target_precompile_headers(rpcs3 PUBLIC stdafx.h) -endif() - -# Unix display manager -if(X11_FOUND) - target_link_libraries(rpcs3 PRIVATE X11::X11) -elseif(USE_VULKAN AND UNIX AND NOT WAYLAND_FOUND AND NOT APPLE AND NOT ANDROID) - # Wayland has been checked in 3rdparty/CMakeLists.txt already. - message(FATAL_ERROR "RPCS3 requires either X11 or Wayland (or both) for Vulkan.") -endif() diff --git a/rpcs3/rpcs3/tools/CMakeLists.txt b/rpcs3/rpcs3/tools/CMakeLists.txt deleted file mode 100644 index 82bd6b34b..000000000 --- a/rpcs3/rpcs3/tools/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ -cmake_minimum_required(VERSION 3.20) - -set(CMAKE_CXX_STANDARD 20) -project(iso-tool) - -add_executable(iso-tool - iso-tool.cpp - ../../Utilities/StrFmt.cpp - ../../Utilities/File.cpp - ../dev/iso.cpp - ../util/atomic.cpp - ../../Utilities/mutex.cpp - # ../util/dyn_lib.cpp - # ../util/logs.cpp -) - -target_include_directories(iso-tool PUBLIC ../../ .. ../../3rdparty/json/include) -target_compile_definitions(iso-tool PUBLIC WIN32_LEAN_AND_MEAN _UNICODE UNICODE) diff --git a/rpcs3/rpcs3/tools/iso-tool.cpp b/rpcs3/rpcs3/tools/iso-tool.cpp deleted file mode 100644 index 3fbd6203d..000000000 --- a/rpcs3/rpcs3/tools/iso-tool.cpp +++ /dev/null @@ -1,51 +0,0 @@ -#include "Utilities/File.h" -#include "Utilities/StrFmt.h" -#include "Utilities/Thread.h" -#include "dev/block_dev.hpp" -#include "dev/iso.hpp" -#include - -[[noreturn]] void thread_ctrl::emergency_exit(std::string_view reason) -{ - std::fprintf(stderr, "%s\n", std::string(reason).c_str()); - std::abort(); -} - -int main(int argc, const char* argv[]) -{ - auto file = fs::file(argv[1]); - if (!file) - { - std::fprintf(stderr, "failed to open: %s (%s)\n", argv[1], fmt::format("%s", fs::g_tls_error).c_str()); - return 1; - } - - auto iso = *iso_dev::open(std::make_unique(std::move(file))); - - if (argc <= 2) - { - return 0; - } - - if (auto rawDir = iso.open_dir(argv[2])) - { - fs::dir dir; - dir.reset(std::move(rawDir)); - for (auto& entry : dir) - { - std::printf("%s - %zd\n", entry.name.c_str(), entry.size); - } - - return 0; - } - - if (auto rawFile = iso.open(argv[2], fs::read)) - { - fs::file file; - file.reset(std::move(rawFile)); - auto name = std::filesystem::path(argv[2]).filename().string(); - fs::write_file(name, fs::create + fs::trunc, file.to_vector()); - } - - return 1; -} diff --git a/rpcs3/rpcs3/rpcs3_version.cpp b/rpcs3/rpcs3_version.cpp similarity index 98% rename from rpcs3/rpcs3/rpcs3_version.cpp rename to rpcs3/rpcs3_version.cpp index b43132e11..8e420b225 100644 --- a/rpcs3/rpcs3/rpcs3_version.cpp +++ b/rpcs3/rpcs3_version.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "rpcs3_version.h" #include "git-version.h" -#include "Utilities/StrUtil.h" +#include "util/StrUtil.h" namespace rpcs3 { diff --git a/rpcs3/rpcs3/rpcs3_version.h b/rpcs3/rpcs3_version.h similarity index 92% rename from rpcs3/rpcs3/rpcs3_version.h rename to rpcs3/rpcs3_version.h index 1fdacf556..e85c3fe12 100644 --- a/rpcs3/rpcs3/rpcs3_version.h +++ b/rpcs3/rpcs3_version.h @@ -1,6 +1,6 @@ #pragma once #include -#include +#include namespace rpcs3 { diff --git a/rpcs3/rpcs3/stb_image.cpp b/rpcs3/stb_image.cpp similarity index 100% rename from rpcs3/rpcs3/stb_image.cpp rename to rpcs3/stb_image.cpp diff --git a/rpcs3/rpcs3/stdafx.cpp b/rpcs3/stdafx.cpp similarity index 100% rename from rpcs3/rpcs3/stdafx.cpp rename to rpcs3/stdafx.cpp diff --git a/rpcs3/rpcs3/stdafx.h b/rpcs3/stdafx.h similarity index 85% rename from rpcs3/rpcs3/stdafx.h rename to rpcs3/stdafx.h index 362cafd75..882f389a4 100644 --- a/rpcs3/rpcs3/stdafx.h +++ b/rpcs3/stdafx.h @@ -3,9 +3,9 @@ #include "util/types.hpp" #include "util/atomic.hpp" #include "util/endian.hpp" -#include "Utilities/Config.h" -#include "Utilities/StrFmt.h" -#include "Utilities/File.h" +#include "util/Config.h" +#include "util/StrFmt.h" +#include "util/File.h" #include "util/logs.hpp" #include "util/shared_ptr.hpp" #include "util/typeindices.hpp" diff --git a/rpcs3/rpcs3/update_helper.sh b/rpcs3/update_helper.sh similarity index 100% rename from rpcs3/rpcs3/update_helper.sh rename to rpcs3/update_helper.sh diff --git a/rpcs3/Utilities/BitField.h b/rpcs3/util/BitField.h similarity index 99% rename from rpcs3/Utilities/BitField.h rename to rpcs3/util/BitField.h index c29f15589..3835e237c 100644 --- a/rpcs3/Utilities/BitField.h +++ b/rpcs3/util/BitField.h @@ -1,7 +1,7 @@ #pragma once #include "util/types.hpp" -#include "Utilities/StrFmt.h" +#include "util/StrFmt.h" #ifndef _MSC_VER #pragma GCC diagnostic push diff --git a/rpcs3/Utilities/CRC.h b/rpcs3/util/CRC.h similarity index 100% rename from rpcs3/Utilities/CRC.h rename to rpcs3/util/CRC.h diff --git a/rpcs3/Utilities/Config.cpp b/rpcs3/util/Config.cpp similarity index 100% rename from rpcs3/Utilities/Config.cpp rename to rpcs3/util/Config.cpp diff --git a/rpcs3/Utilities/Config.h b/rpcs3/util/Config.h similarity index 99% rename from rpcs3/Utilities/Config.h rename to rpcs3/util/Config.h index 9d1c58090..039cb1b5b 100644 --- a/rpcs3/Utilities/Config.h +++ b/rpcs3/util/Config.h @@ -1,7 +1,7 @@ #pragma once #include "util/types.hpp" -#include "Utilities/StrUtil.h" +#include "util/StrUtil.h" #include "util/logs.hpp" #include "util/atomic.hpp" #include "util/shared_ptr.hpp" diff --git a/rpcs3/Utilities/File.cpp b/rpcs3/util/File.cpp similarity index 99% rename from rpcs3/Utilities/File.cpp rename to rpcs3/util/File.cpp index 2c79e7fbe..709c26db1 100644 --- a/rpcs3/Utilities/File.cpp +++ b/rpcs3/util/File.cpp @@ -22,7 +22,7 @@ std::string g_android_cache_dir; #ifdef _WIN32 -#include "Utilities/StrUtil.h" +#include "util/StrUtil.h" #include #include diff --git a/rpcs3/Utilities/File.h b/rpcs3/util/File.h similarity index 100% rename from rpcs3/Utilities/File.h rename to rpcs3/util/File.h diff --git a/rpcs3/Utilities/JIT.h b/rpcs3/util/JIT.h similarity index 100% rename from rpcs3/Utilities/JIT.h rename to rpcs3/util/JIT.h diff --git a/rpcs3/Utilities/JITASM.cpp b/rpcs3/util/JITASM.cpp similarity index 100% rename from rpcs3/Utilities/JITASM.cpp rename to rpcs3/util/JITASM.cpp diff --git a/rpcs3/Utilities/JITLLVM.cpp b/rpcs3/util/JITLLVM.cpp similarity index 99% rename from rpcs3/Utilities/JITLLVM.cpp rename to rpcs3/util/JITLLVM.cpp index 86657aaaf..898726c26 100644 --- a/rpcs3/Utilities/JITLLVM.cpp +++ b/rpcs3/util/JITLLVM.cpp @@ -1,6 +1,6 @@ #include "util/types.hpp" #include "util/sysinfo.hpp" -#include "Utilities/Thread.h" +#include "util/Thread.h" #include "JIT.h" #include "StrFmt.h" #include "File.h" diff --git a/rpcs3/Utilities/LUrlParser.cpp b/rpcs3/util/LUrlParser.cpp similarity index 100% rename from rpcs3/Utilities/LUrlParser.cpp rename to rpcs3/util/LUrlParser.cpp diff --git a/rpcs3/Utilities/LUrlParser.h b/rpcs3/util/LUrlParser.h similarity index 100% rename from rpcs3/Utilities/LUrlParser.h rename to rpcs3/util/LUrlParser.h diff --git a/rpcs3/Utilities/StrFmt.cpp b/rpcs3/util/StrFmt.cpp similarity index 100% rename from rpcs3/Utilities/StrFmt.cpp rename to rpcs3/util/StrFmt.cpp diff --git a/rpcs3/Utilities/StrFmt.h b/rpcs3/util/StrFmt.h similarity index 100% rename from rpcs3/Utilities/StrFmt.h rename to rpcs3/util/StrFmt.h diff --git a/rpcs3/Utilities/StrUtil.h b/rpcs3/util/StrUtil.h similarity index 100% rename from rpcs3/Utilities/StrUtil.h rename to rpcs3/util/StrUtil.h diff --git a/rpcs3/Utilities/Thread.cpp b/rpcs3/util/Thread.cpp similarity index 99% rename from rpcs3/Utilities/Thread.cpp rename to rpcs3/util/Thread.cpp index 32ece914e..f7286a371 100644 --- a/rpcs3/Utilities/Thread.cpp +++ b/rpcs3/util/Thread.cpp @@ -7,7 +7,7 @@ #include "Emu/Cell/lv2/sys_event.h" #include "Emu/Cell/lv2/sys_process.h" #include "Thread.h" -#include "Utilities/JIT.h" +#include "util/JIT.h" #include #include diff --git a/rpcs3/Utilities/Thread.h b/rpcs3/util/Thread.h similarity index 100% rename from rpcs3/Utilities/Thread.h rename to rpcs3/util/Thread.h diff --git a/rpcs3/Utilities/Timer.h b/rpcs3/util/Timer.h similarity index 100% rename from rpcs3/Utilities/Timer.h rename to rpcs3/util/Timer.h diff --git a/rpcs3/Utilities/address_range.h b/rpcs3/util/address_range.h similarity index 100% rename from rpcs3/Utilities/address_range.h rename to rpcs3/util/address_range.h diff --git a/rpcs3/rpcs3/util/asm.hpp b/rpcs3/util/asm.hpp similarity index 100% rename from rpcs3/rpcs3/util/asm.hpp rename to rpcs3/util/asm.hpp diff --git a/rpcs3/rpcs3/util/atomic.cpp b/rpcs3/util/atomic.cpp similarity index 99% rename from rpcs3/rpcs3/util/atomic.cpp rename to rpcs3/util/atomic.cpp index 70fa044be..631859f09 100644 --- a/rpcs3/rpcs3/util/atomic.cpp +++ b/rpcs3/util/atomic.cpp @@ -25,8 +25,8 @@ namespace utils } // namespace utils #endif -#include "Utilities/sync.h" -#include "Utilities/StrFmt.h" +#include "util/sync.h" +#include "util/StrFmt.h" #ifdef __linux__ static bool has_waitv() diff --git a/rpcs3/rpcs3/util/atomic.hpp b/rpcs3/util/atomic.hpp similarity index 100% rename from rpcs3/rpcs3/util/atomic.hpp rename to rpcs3/util/atomic.hpp diff --git a/rpcs3/rpcs3/util/auto_typemap.hpp b/rpcs3/util/auto_typemap.hpp similarity index 100% rename from rpcs3/rpcs3/util/auto_typemap.hpp rename to rpcs3/util/auto_typemap.hpp diff --git a/rpcs3/Utilities/bin_patch.cpp b/rpcs3/util/bin_patch.cpp similarity index 100% rename from rpcs3/Utilities/bin_patch.cpp rename to rpcs3/util/bin_patch.cpp diff --git a/rpcs3/Utilities/bin_patch.h b/rpcs3/util/bin_patch.h similarity index 100% rename from rpcs3/Utilities/bin_patch.h rename to rpcs3/util/bin_patch.h diff --git a/rpcs3/Utilities/bit_set.h b/rpcs3/util/bit_set.h similarity index 99% rename from rpcs3/Utilities/bit_set.h rename to rpcs3/util/bit_set.h index a731b89e1..919210175 100644 --- a/rpcs3/Utilities/bit_set.h +++ b/rpcs3/util/bit_set.h @@ -23,7 +23,7 @@ Intersection (&) and symmetric difference (^) is also available. #include "util/types.hpp" #include "util/atomic.hpp" -#include "Utilities/StrFmt.h" +#include "util/StrFmt.h" template concept BitSetEnum = std::is_enum_v && requires(T x) { diff --git a/rpcs3/rpcs3/util/bless.hpp b/rpcs3/util/bless.hpp similarity index 100% rename from rpcs3/rpcs3/util/bless.hpp rename to rpcs3/util/bless.hpp diff --git a/rpcs3/Utilities/cfmt.h b/rpcs3/util/cfmt.h similarity index 100% rename from rpcs3/Utilities/cfmt.h rename to rpcs3/util/cfmt.h diff --git a/rpcs3/Utilities/cheat_info.cpp b/rpcs3/util/cheat_info.cpp similarity index 100% rename from rpcs3/Utilities/cheat_info.cpp rename to rpcs3/util/cheat_info.cpp diff --git a/rpcs3/Utilities/cheat_info.h b/rpcs3/util/cheat_info.h similarity index 100% rename from rpcs3/Utilities/cheat_info.h rename to rpcs3/util/cheat_info.h diff --git a/rpcs3/Utilities/cond.cpp b/rpcs3/util/cond.cpp similarity index 100% rename from rpcs3/Utilities/cond.cpp rename to rpcs3/util/cond.cpp diff --git a/rpcs3/Utilities/cond.h b/rpcs3/util/cond.h similarity index 100% rename from rpcs3/Utilities/cond.h rename to rpcs3/util/cond.h diff --git a/rpcs3/rpcs3/util/console.cpp b/rpcs3/util/console.cpp similarity index 100% rename from rpcs3/rpcs3/util/console.cpp rename to rpcs3/util/console.cpp diff --git a/rpcs3/rpcs3/util/console.h b/rpcs3/util/console.h similarity index 100% rename from rpcs3/rpcs3/util/console.h rename to rpcs3/util/console.h diff --git a/rpcs3/rpcs3/util/coro.hpp b/rpcs3/util/coro.hpp similarity index 100% rename from rpcs3/rpcs3/util/coro.hpp rename to rpcs3/util/coro.hpp diff --git a/rpcs3/rpcs3/util/cpu_stats.cpp b/rpcs3/util/cpu_stats.cpp similarity index 99% rename from rpcs3/rpcs3/util/cpu_stats.cpp rename to rpcs3/util/cpu_stats.cpp index 4a8475e2b..1fe48c969 100644 --- a/rpcs3/rpcs3/util/cpu_stats.cpp +++ b/rpcs3/util/cpu_stats.cpp @@ -2,7 +2,7 @@ #include "util/cpu_stats.hpp" #include "util/sysinfo.hpp" #include "util/logs.hpp" -#include "Utilities/StrUtil.h" +#include "util/StrUtil.h" #include diff --git a/rpcs3/rpcs3/util/cpu_stats.hpp b/rpcs3/util/cpu_stats.hpp similarity index 100% rename from rpcs3/rpcs3/util/cpu_stats.hpp rename to rpcs3/util/cpu_stats.hpp diff --git a/rpcs3/darwin/util/sysinfo_darwin.mm b/rpcs3/util/darwin/sysinfo_darwin.mm similarity index 100% rename from rpcs3/darwin/util/sysinfo_darwin.mm rename to rpcs3/util/darwin/sysinfo_darwin.mm diff --git a/rpcs3/Utilities/date_time.cpp b/rpcs3/util/date_time.cpp similarity index 100% rename from rpcs3/Utilities/date_time.cpp rename to rpcs3/util/date_time.cpp diff --git a/rpcs3/Utilities/date_time.h b/rpcs3/util/date_time.h similarity index 100% rename from rpcs3/Utilities/date_time.h rename to rpcs3/util/date_time.h diff --git a/rpcs3/rpcs3/util/dyn_lib.cpp b/rpcs3/util/dyn_lib.cpp similarity index 100% rename from rpcs3/rpcs3/util/dyn_lib.cpp rename to rpcs3/util/dyn_lib.cpp diff --git a/rpcs3/rpcs3/util/dyn_lib.hpp b/rpcs3/util/dyn_lib.hpp similarity index 100% rename from rpcs3/rpcs3/util/dyn_lib.hpp rename to rpcs3/util/dyn_lib.hpp diff --git a/rpcs3/rpcs3/util/emu_utils.cpp b/rpcs3/util/emu_utils.cpp similarity index 98% rename from rpcs3/rpcs3/util/emu_utils.cpp rename to rpcs3/util/emu_utils.cpp index 02d4f9865..667133dff 100644 --- a/rpcs3/rpcs3/util/emu_utils.cpp +++ b/rpcs3/util/emu_utils.cpp @@ -8,7 +8,7 @@ #include "Emu/Cell/PPUThread.h" #include "Emu/RSX/RSXDisAsm.h" #include "Emu/Memory/vm.h" -#include "Utilities/Thread.h" +#include "util/Thread.h" bool is_using_interpreter(thread_class t_class) { diff --git a/rpcs3/rpcs3/util/endian.hpp b/rpcs3/util/endian.hpp similarity index 100% rename from rpcs3/rpcs3/util/endian.hpp rename to rpcs3/util/endian.hpp diff --git a/rpcs3/rpcs3/util/fence.hpp b/rpcs3/util/fence.hpp similarity index 100% rename from rpcs3/rpcs3/util/fence.hpp rename to rpcs3/util/fence.hpp diff --git a/rpcs3/rpcs3/util/fifo_mutex.hpp b/rpcs3/util/fifo_mutex.hpp similarity index 100% rename from rpcs3/rpcs3/util/fifo_mutex.hpp rename to rpcs3/util/fifo_mutex.hpp diff --git a/rpcs3/rpcs3/util/fixed_typemap.hpp b/rpcs3/util/fixed_typemap.hpp similarity index 100% rename from rpcs3/rpcs3/util/fixed_typemap.hpp rename to rpcs3/util/fixed_typemap.hpp diff --git a/rpcs3/rpcs3/util/fnv_hash.hpp b/rpcs3/util/fnv_hash.hpp similarity index 100% rename from rpcs3/rpcs3/util/fnv_hash.hpp rename to rpcs3/util/fnv_hash.hpp diff --git a/rpcs3/Utilities/geometry.h b/rpcs3/util/geometry.h similarity index 100% rename from rpcs3/Utilities/geometry.h rename to rpcs3/util/geometry.h diff --git a/rpcs3/Utilities/git-version-gen.cmd b/rpcs3/util/git-version-gen.cmd similarity index 100% rename from rpcs3/Utilities/git-version-gen.cmd rename to rpcs3/util/git-version-gen.cmd diff --git a/rpcs3/rpcs3/util/init_mutex.hpp b/rpcs3/util/init_mutex.hpp similarity index 100% rename from rpcs3/rpcs3/util/init_mutex.hpp rename to rpcs3/util/init_mutex.hpp diff --git a/rpcs3/Utilities/lockless.h b/rpcs3/util/lockless.h similarity index 100% rename from rpcs3/Utilities/lockless.h rename to rpcs3/util/lockless.h diff --git a/rpcs3/rpcs3/util/logs.cpp b/rpcs3/util/logs.cpp similarity index 99% rename from rpcs3/rpcs3/util/logs.cpp rename to rpcs3/util/logs.cpp index b9386c989..c7b1e874a 100644 --- a/rpcs3/rpcs3/util/logs.cpp +++ b/rpcs3/util/logs.cpp @@ -1,8 +1,8 @@ #include "util/logs.hpp" -#include "Utilities/File.h" -#include "Utilities/mutex.h" -#include "Utilities/Thread.h" -#include "Utilities/StrFmt.h" +#include "util/File.h" +#include "util/mutex.h" +#include "util/Thread.h" +#include "util/StrFmt.h" #include #include #include diff --git a/rpcs3/rpcs3/util/logs.hpp b/rpcs3/util/logs.hpp similarity index 99% rename from rpcs3/rpcs3/util/logs.hpp rename to rpcs3/util/logs.hpp index 9b266447b..f3cca4d29 100644 --- a/rpcs3/rpcs3/util/logs.hpp +++ b/rpcs3/util/logs.hpp @@ -6,7 +6,7 @@ #include #include #include "util/atomic.hpp" -#include "Utilities/StrFmt.h" +#include "util/StrFmt.h" namespace logs { diff --git a/rpcs3/rpcs3/util/media_utils.cpp b/rpcs3/util/media_utils.cpp similarity index 100% rename from rpcs3/rpcs3/util/media_utils.cpp rename to rpcs3/util/media_utils.cpp diff --git a/rpcs3/rpcs3/util/media_utils.h b/rpcs3/util/media_utils.h similarity index 97% rename from rpcs3/rpcs3/util/media_utils.h rename to rpcs3/util/media_utils.h index 90d30ba36..fca72f534 100644 --- a/rpcs3/rpcs3/util/media_utils.h +++ b/rpcs3/util/media_utils.h @@ -1,9 +1,9 @@ #pragma once -#include "Utilities/StrUtil.h" -#include "Utilities/Thread.h" +#include "util/StrUtil.h" +#include "util/Thread.h" #include "util/video_sink.h" -#include "Emu/Cell/Modules/cellMusic.h" +#include "rpcsx/fw/ps3/cellMusic.h" #include #include diff --git a/rpcs3/Utilities/mutex.cpp b/rpcs3/util/mutex.cpp similarity index 100% rename from rpcs3/Utilities/mutex.cpp rename to rpcs3/util/mutex.cpp diff --git a/rpcs3/Utilities/mutex.h b/rpcs3/util/mutex.h similarity index 100% rename from rpcs3/Utilities/mutex.h rename to rpcs3/util/mutex.h diff --git a/rpcs3/Utilities/ppu_patch.h b/rpcs3/util/ppu_patch.h similarity index 100% rename from rpcs3/Utilities/ppu_patch.h rename to rpcs3/util/ppu_patch.h diff --git a/rpcs3/Utilities/rXml.cpp b/rpcs3/util/rXml.cpp similarity index 98% rename from rpcs3/Utilities/rXml.cpp rename to rpcs3/util/rXml.cpp index 14ac0659f..92bc383ae 100644 --- a/rpcs3/Utilities/rXml.cpp +++ b/rpcs3/util/rXml.cpp @@ -1,5 +1,5 @@ #include "stdafx.h" -#include "Utilities/rXml.h" +#include "util/rXml.h" rXmlNode::rXmlNode() { diff --git a/rpcs3/Utilities/rXml.h b/rpcs3/util/rXml.h similarity index 100% rename from rpcs3/Utilities/rXml.h rename to rpcs3/util/rXml.h diff --git a/rpcs3/Utilities/sema.cpp b/rpcs3/util/sema.cpp similarity index 100% rename from rpcs3/Utilities/sema.cpp rename to rpcs3/util/sema.cpp diff --git a/rpcs3/Utilities/sema.h b/rpcs3/util/sema.h similarity index 100% rename from rpcs3/Utilities/sema.h rename to rpcs3/util/sema.h diff --git a/rpcs3/rpcs3/util/serialization.hpp b/rpcs3/util/serialization.hpp similarity index 100% rename from rpcs3/rpcs3/util/serialization.hpp rename to rpcs3/util/serialization.hpp diff --git a/rpcs3/rpcs3/util/serialization_ext.cpp b/rpcs3/util/serialization_ext.cpp similarity index 99% rename from rpcs3/rpcs3/util/serialization_ext.cpp rename to rpcs3/util/serialization_ext.cpp index d4ff2d094..8bdbcf2f2 100644 --- a/rpcs3/rpcs3/util/serialization_ext.cpp +++ b/rpcs3/util/serialization_ext.cpp @@ -3,9 +3,9 @@ #include "util/asm.hpp" #include "util/sysinfo.hpp" #include "util/endian.hpp" -#include "Utilities/lockless.h" -#include "Utilities/File.h" -#include "Utilities/StrFmt.h" +#include "util/lockless.h" +#include "util/File.h" +#include "util/StrFmt.h" #include "serialization_ext.hpp" #include diff --git a/rpcs3/rpcs3/util/serialization_ext.hpp b/rpcs3/util/serialization_ext.hpp similarity index 99% rename from rpcs3/rpcs3/util/serialization_ext.hpp rename to rpcs3/util/serialization_ext.hpp index 757122fbc..60cbeba84 100644 --- a/rpcs3/rpcs3/util/serialization_ext.hpp +++ b/rpcs3/util/serialization_ext.hpp @@ -3,7 +3,7 @@ #include "util/serialization.hpp" #include "util/shared_ptr.hpp" -#include "Utilities/Thread.h" +#include "util/Thread.h" #include diff --git a/rpcs3/rpcs3/util/shared_ptr.hpp b/rpcs3/util/shared_ptr.hpp similarity index 100% rename from rpcs3/rpcs3/util/shared_ptr.hpp rename to rpcs3/util/shared_ptr.hpp diff --git a/rpcs3/rpcs3/util/simd.hpp b/rpcs3/util/simd.hpp similarity index 99% rename from rpcs3/rpcs3/util/simd.hpp rename to rpcs3/util/simd.hpp index 104cc8d96..4a1bdb1af 100644 --- a/rpcs3/rpcs3/util/simd.hpp +++ b/rpcs3/util/simd.hpp @@ -1,11 +1,11 @@ #pragma once -#include "Utilities/StrFmt.h" +#include "util/StrFmt.h" #include "util/types.hpp" #include "util/v128.hpp" #include "util/sysinfo.hpp" #include "util/asm.hpp" -#include "Utilities/JIT.h" +#include "util/JIT.h" #if defined(ARCH_X64) #ifdef _MSC_VER diff --git a/rpcs3/Utilities/simple_ringbuf.cpp b/rpcs3/util/simple_ringbuf.cpp similarity index 99% rename from rpcs3/Utilities/simple_ringbuf.cpp rename to rpcs3/util/simple_ringbuf.cpp index 0d9b8042e..d8dadbb5b 100644 --- a/rpcs3/Utilities/simple_ringbuf.cpp +++ b/rpcs3/util/simple_ringbuf.cpp @@ -1,4 +1,4 @@ -#include "Utilities/simple_ringbuf.h" +#include "util/simple_ringbuf.h" simple_ringbuf::simple_ringbuf(u64 size) { diff --git a/rpcs3/Utilities/simple_ringbuf.h b/rpcs3/util/simple_ringbuf.h similarity index 100% rename from rpcs3/Utilities/simple_ringbuf.h rename to rpcs3/util/simple_ringbuf.h diff --git a/rpcs3/rpcs3/util/slow_mutex.hpp b/rpcs3/util/slow_mutex.hpp similarity index 98% rename from rpcs3/rpcs3/util/slow_mutex.hpp rename to rpcs3/util/slow_mutex.hpp index d0d1d4469..def5280e4 100644 --- a/rpcs3/rpcs3/util/slow_mutex.hpp +++ b/rpcs3/util/slow_mutex.hpp @@ -2,7 +2,7 @@ #include "util/types.hpp" #include "util/atomic.hpp" -#include "Utilities/StrFmt.h" +#include "util/StrFmt.h" // Pessimistic mutex for slow operation, does not spin wait, occupies only one byte class slow_mutex diff --git a/rpcs3/Utilities/stack_trace.cpp b/rpcs3/util/stack_trace.cpp similarity index 100% rename from rpcs3/Utilities/stack_trace.cpp rename to rpcs3/util/stack_trace.cpp diff --git a/rpcs3/Utilities/stack_trace.h b/rpcs3/util/stack_trace.h similarity index 100% rename from rpcs3/Utilities/stack_trace.h rename to rpcs3/util/stack_trace.h diff --git a/rpcs3/Utilities/sync.h b/rpcs3/util/sync.h similarity index 100% rename from rpcs3/Utilities/sync.h rename to rpcs3/util/sync.h diff --git a/rpcs3/rpcs3/util/sysinfo.cpp b/rpcs3/util/sysinfo.cpp similarity index 99% rename from rpcs3/rpcs3/util/sysinfo.cpp rename to rpcs3/util/sysinfo.cpp index 74ed64417..1367ac661 100644 --- a/rpcs3/rpcs3/util/sysinfo.cpp +++ b/rpcs3/util/sysinfo.cpp @@ -1,8 +1,8 @@ #include "util/sysinfo.hpp" -#include "Utilities/StrFmt.h" -#include "Utilities/File.h" +#include "util/StrFmt.h" +#include "util/File.h" #include "Emu/vfs_config.h" -#include "Utilities/Thread.h" +#include "util/Thread.h" #if defined(ARCH_ARM64) #include "Emu/CPU/Backends/AArch64/AArch64Common.h" diff --git a/rpcs3/rpcs3/util/sysinfo.hpp b/rpcs3/util/sysinfo.hpp similarity index 100% rename from rpcs3/rpcs3/util/sysinfo.hpp rename to rpcs3/util/sysinfo.hpp diff --git a/rpcs3/rpcs3/util/to_endian.hpp b/rpcs3/util/to_endian.hpp similarity index 100% rename from rpcs3/rpcs3/util/to_endian.hpp rename to rpcs3/util/to_endian.hpp diff --git a/rpcs3/Utilities/transactional_storage.h b/rpcs3/util/transactional_storage.h similarity index 100% rename from rpcs3/Utilities/transactional_storage.h rename to rpcs3/util/transactional_storage.h diff --git a/rpcs3/rpcs3/util/tsc.hpp b/rpcs3/util/tsc.hpp similarity index 100% rename from rpcs3/rpcs3/util/tsc.hpp rename to rpcs3/util/tsc.hpp diff --git a/rpcs3/rpcs3/util/typeindices.hpp b/rpcs3/util/typeindices.hpp similarity index 100% rename from rpcs3/rpcs3/util/typeindices.hpp rename to rpcs3/util/typeindices.hpp diff --git a/rpcs3/rpcs3/util/types.hpp b/rpcs3/util/types.hpp similarity index 100% rename from rpcs3/rpcs3/util/types.hpp rename to rpcs3/util/types.hpp diff --git a/rpcs3/rpcs3/util/v128.hpp b/rpcs3/util/v128.hpp similarity index 100% rename from rpcs3/rpcs3/util/v128.hpp rename to rpcs3/util/v128.hpp diff --git a/rpcs3/Utilities/version.cpp b/rpcs3/util/version.cpp similarity index 100% rename from rpcs3/Utilities/version.cpp rename to rpcs3/util/version.cpp diff --git a/rpcs3/Utilities/version.h b/rpcs3/util/version.h similarity index 100% rename from rpcs3/Utilities/version.h rename to rpcs3/util/version.h diff --git a/rpcs3/rpcs3/util/video_provider.cpp b/rpcs3/util/video_provider.cpp similarity index 100% rename from rpcs3/rpcs3/util/video_provider.cpp rename to rpcs3/util/video_provider.cpp diff --git a/rpcs3/rpcs3/util/video_provider.h b/rpcs3/util/video_provider.h similarity index 100% rename from rpcs3/rpcs3/util/video_provider.h rename to rpcs3/util/video_provider.h diff --git a/rpcs3/rpcs3/util/video_sink.h b/rpcs3/util/video_sink.h similarity index 99% rename from rpcs3/rpcs3/util/video_sink.h rename to rpcs3/util/video_sink.h index 8654e81e2..809494092 100644 --- a/rpcs3/rpcs3/util/video_sink.h +++ b/rpcs3/util/video_sink.h @@ -2,7 +2,7 @@ #include "util/types.hpp" #include "util/atomic.hpp" -#include "Utilities/mutex.h" +#include "util/mutex.h" #include #include diff --git a/rpcs3/rpcs3/util/video_source.h b/rpcs3/util/video_source.h similarity index 100% rename from rpcs3/rpcs3/util/video_source.h rename to rpcs3/util/video_source.h diff --git a/rpcs3/rpcs3/util/vm.hpp b/rpcs3/util/vm.hpp similarity index 100% rename from rpcs3/rpcs3/util/vm.hpp rename to rpcs3/util/vm.hpp diff --git a/rpcs3/rpcs3/util/vm_native.cpp b/rpcs3/util/vm_native.cpp similarity index 99% rename from rpcs3/rpcs3/util/vm_native.cpp rename to rpcs3/util/vm_native.cpp index e8bd27a87..008b13fde 100644 --- a/rpcs3/rpcs3/util/vm_native.cpp +++ b/rpcs3/util/vm_native.cpp @@ -2,9 +2,9 @@ #include "util/vm.hpp" #include "util/asm.hpp" #ifdef _WIN32 -#include "Utilities/File.h" +#include "util/File.h" #include "util/dyn_lib.hpp" -#include "Utilities/lockless.h" +#include "util/lockless.h" #include #include #include diff --git a/rpcs3/rpcs3/util/yaml.cpp b/rpcs3/util/yaml.cpp similarity index 97% rename from rpcs3/rpcs3/util/yaml.cpp rename to rpcs3/util/yaml.cpp index 1ab8bd868..3757393b1 100644 --- a/rpcs3/rpcs3/util/yaml.cpp +++ b/rpcs3/util/yaml.cpp @@ -1,7 +1,7 @@ #include "util/yaml.hpp" #include "util/types.hpp" -#include "Utilities/cheat_info.h" -#include "Utilities/Config.h" +#include "util/cheat_info.h" +#include "util/Config.h" namespace YAML { diff --git a/rpcs3/rpcs3/util/yaml.hpp b/rpcs3/util/yaml.hpp similarity index 100% rename from rpcs3/rpcs3/util/yaml.hpp rename to rpcs3/util/yaml.hpp diff --git a/rpcs3qt-legacy/CMakeLists.txt b/rpcs3qt-legacy/CMakeLists.txt index 43c0cf691..f6b868a3e 100644 --- a/rpcs3qt-legacy/CMakeLists.txt +++ b/rpcs3qt-legacy/CMakeLists.txt @@ -159,7 +159,9 @@ target_link_libraries(rpcs3_ui PUBLIC 3rdparty::qt6 3rdparty::yaml-cpp - rpcs3) + rpcs3 + rpcsx::fw::ps3::api +) if(TARGET OpenGL::EGL) target_link_libraries(rpcs3_ui PUBLIC OpenGL::EGL) @@ -206,7 +208,9 @@ if (NOT ANDROID) PRIVATE rpcs3_emu rpcs3_ui - 3rdparty::qt6) + 3rdparty::qt6 + rpcsx::fw::ps3 + rpcsx::fw::ps3::api) if(UNIX) set(CMAKE_THREAD_PREFER_PTHREAD TRUE) diff --git a/rpcs3qt-legacy/Input/gui_pad_thread.h b/rpcs3qt-legacy/Input/gui_pad_thread.h index 97a498f29..d4a8c169d 100644 --- a/rpcs3qt-legacy/Input/gui_pad_thread.h +++ b/rpcs3qt-legacy/Input/gui_pad_thread.h @@ -5,8 +5,8 @@ #include "Emu/Io/pad_types.h" #include "Emu/Io/pad_config.h" #include "Emu/Io/pad_config_types.h" -#include "Utilities/Timer.h" -#include "Utilities/Thread.h" +#include "util/Timer.h" +#include "util/Thread.h" class PadHandlerBase; class gui_settings; diff --git a/rpcs3qt-legacy/auto_pause_settings_dialog.cpp b/rpcs3qt-legacy/auto_pause_settings_dialog.cpp index 7054f8116..2091381f9 100644 --- a/rpcs3qt-legacy/auto_pause_settings_dialog.cpp +++ b/rpcs3qt-legacy/auto_pause_settings_dialog.cpp @@ -9,7 +9,7 @@ #include #include "util/logs.hpp" -#include "Utilities/File.h" +#include "util/File.h" LOG_CHANNEL(autopause_log, "AutoPause"); diff --git a/rpcs3qt-legacy/breakpoint_handler.h b/rpcs3qt-legacy/breakpoint_handler.h index d07bbeedd..1d731b6e9 100644 --- a/rpcs3qt-legacy/breakpoint_handler.h +++ b/rpcs3qt-legacy/breakpoint_handler.h @@ -1,9 +1,9 @@ #pragma once #include "util/types.hpp" -#include "Utilities/bit_set.h" +#include "util/bit_set.h" #include -#include "Utilities/mutex.h" +#include "util/mutex.h" enum class breakpoint_types { diff --git a/rpcs3qt-legacy/call_stack_list.cpp b/rpcs3qt-legacy/call_stack_list.cpp index d4dedfca0..c2b8f343b 100644 --- a/rpcs3qt-legacy/call_stack_list.cpp +++ b/rpcs3qt-legacy/call_stack_list.cpp @@ -1,6 +1,6 @@ #include "call_stack_list.h" -#include "Utilities/StrFmt.h" +#include "util/StrFmt.h" #include #include diff --git a/rpcs3qt-legacy/cheat_manager.cpp b/rpcs3qt-legacy/cheat_manager.cpp index d3e8f998f..2e6c756ba 100644 --- a/rpcs3qt-legacy/cheat_manager.cpp +++ b/rpcs3qt-legacy/cheat_manager.cpp @@ -21,9 +21,9 @@ #include "util/asm.hpp" #include "util/logs.hpp" #include "util/to_endian.hpp" -#include "Utilities/File.h" -#include "Utilities/StrUtil.h" -#include "Utilities/bin_patch.h" // get_patches_path() +#include "util/File.h" +#include "util/StrUtil.h" +#include "util/bin_patch.h" // get_patches_path() LOG_CHANNEL(log_cheat, "Cheat"); diff --git a/rpcs3qt-legacy/cheat_manager.h b/rpcs3qt-legacy/cheat_manager.h index 458c7400b..a6447787c 100644 --- a/rpcs3qt-legacy/cheat_manager.h +++ b/rpcs3qt-legacy/cheat_manager.h @@ -13,7 +13,7 @@ #include #include -#include "Utilities/cheat_info.h" +#include "util/cheat_info.h" class cheat_engine { diff --git a/rpcs3qt-legacy/curl_handle.cpp b/rpcs3qt-legacy/curl_handle.cpp index 998a9fa81..dbb393915 100644 --- a/rpcs3qt-legacy/curl_handle.cpp +++ b/rpcs3qt-legacy/curl_handle.cpp @@ -3,7 +3,7 @@ #include "util/logs.hpp" #ifdef _WIN32 -#include "Utilities/StrUtil.h" +#include "util/StrUtil.h" #endif LOG_CHANNEL(network_log, "NET"); diff --git a/rpcs3qt-legacy/custom_table_widget_item.cpp b/rpcs3qt-legacy/custom_table_widget_item.cpp index cbd9facca..4c17da7a4 100644 --- a/rpcs3qt-legacy/custom_table_widget_item.cpp +++ b/rpcs3qt-legacy/custom_table_widget_item.cpp @@ -1,5 +1,5 @@ #include "custom_table_widget_item.h" -#include "Utilities/StrFmt.h" +#include "util/StrFmt.h" #include diff --git a/rpcs3qt-legacy/debugger_add_bp_window.cpp b/rpcs3qt-legacy/debugger_add_bp_window.cpp index b56a39d83..710757fac 100644 --- a/rpcs3qt-legacy/debugger_add_bp_window.cpp +++ b/rpcs3qt-legacy/debugger_add_bp_window.cpp @@ -1,6 +1,6 @@ #include "debugger_add_bp_window.h" -#include "Utilities/StrFmt.h" -#include "Utilities/StrUtil.h" +#include "util/StrFmt.h" +#include "util/StrUtil.h" #include "breakpoint_handler.h" #include "util/types.hpp" diff --git a/rpcs3qt-legacy/dimensions_dialog.cpp b/rpcs3qt-legacy/dimensions_dialog.cpp index a6eb07018..f59483988 100644 --- a/rpcs3qt-legacy/dimensions_dialog.cpp +++ b/rpcs3qt-legacy/dimensions_dialog.cpp @@ -1,5 +1,5 @@ #include "stdafx.h" -#include "Utilities/File.h" +#include "util/File.h" #include "dimensions_dialog.h" #include "Emu/Io/Dimensions.h" diff --git a/rpcs3qt-legacy/emu_settings.cpp b/rpcs3qt-legacy/emu_settings.cpp index 04b9bd065..277f1d354 100644 --- a/rpcs3qt-legacy/emu_settings.cpp +++ b/rpcs3qt-legacy/emu_settings.cpp @@ -9,16 +9,16 @@ #include "Emu/System.h" #include "Emu/system_config.h" #include "Emu/system_utils.hpp" -#include "Emu/Cell/Modules/cellSysutil.h" +#include "rpcsx/fw/ps3/cellSysutil.h" #include "Emu/Io/Keyboard.h" #include "util/yaml.hpp" -#include "Utilities/File.h" -#include "Utilities/Config.h" +#include "util/File.h" +#include "util/Config.h" LOG_CHANNEL(cfg_log, "CFG"); -extern std::string g_cfg_defaults; //! Default settings grabbed from Utilities/Config.h +extern std::string g_cfg_defaults; //! Default settings grabbed from util/Config.h // Emit sorted YAML namespace diff --git a/rpcs3qt-legacy/game_list_frame.cpp b/rpcs3qt-legacy/game_list_frame.cpp index f7baab7d6..61e945e93 100644 --- a/rpcs3qt-legacy/game_list_frame.cpp +++ b/rpcs3qt-legacy/game_list_frame.cpp @@ -19,7 +19,7 @@ #include "Emu/system_utils.hpp" #include "Loader/PSF.h" #include "util/types.hpp" -#include "Utilities/File.h" +#include "util/File.h" #include "util/sysinfo.hpp" #include "Input/pad_thread.h" diff --git a/rpcs3qt-legacy/game_list_frame.h b/rpcs3qt-legacy/game_list_frame.h index c30c55773..5326a0989 100644 --- a/rpcs3qt-legacy/game_list_frame.h +++ b/rpcs3qt-legacy/game_list_frame.h @@ -3,8 +3,8 @@ #include "game_list.h" #include "custom_dock_widget.h" #include "shortcut_utils.h" -#include "Utilities/lockless.h" -#include "Utilities/mutex.h" +#include "util/lockless.h" +#include "util/mutex.h" #include "util/auto_typemap.hpp" #include "Emu/config_mode.h" diff --git a/rpcs3qt-legacy/game_list_grid.cpp b/rpcs3qt-legacy/game_list_grid.cpp index 53888b968..c43855989 100644 --- a/rpcs3qt-legacy/game_list_grid.cpp +++ b/rpcs3qt-legacy/game_list_grid.cpp @@ -3,7 +3,7 @@ #include "game_list_grid_item.h" #include "gui_settings.h" #include "qt_utils.h" -#include "Utilities/File.h" +#include "util/File.h" #include #include diff --git a/rpcs3qt-legacy/game_list_table.cpp b/rpcs3qt-legacy/game_list_table.cpp index 39418debe..3e639537a 100644 --- a/rpcs3qt-legacy/game_list_table.cpp +++ b/rpcs3qt-legacy/game_list_table.cpp @@ -9,7 +9,7 @@ #include "qt_utils.h" #include "Emu/vfs_config.h" -#include "Utilities/StrUtil.h" +#include "util/StrUtil.h" #include #include diff --git a/rpcs3qt-legacy/gs_frame.cpp b/rpcs3qt-legacy/gs_frame.cpp index ac4e293d0..79f958ccf 100644 --- a/rpcs3qt-legacy/gs_frame.cpp +++ b/rpcs3qt-legacy/gs_frame.cpp @@ -1,18 +1,18 @@ #include "gs_frame.h" #include "gui_settings.h" -#include "Utilities/Config.h" -#include "Utilities/Timer.h" -#include "Utilities/date_time.h" -#include "Utilities/File.h" +#include "util/Config.h" +#include "util/Timer.h" +#include "util/date_time.h" +#include "util/File.h" #include "util/video_provider.h" #include "Emu/System.h" #include "Emu/system_config.h" #include "Emu/system_progress.hpp" #include "Emu/IdManager.h" #include "Emu/Audio/audio_utils.h" -#include "Emu/Cell/Modules/cellScreenshot.h" -#include "Emu/Cell/Modules/cellAudio.h" +#include "rpcsx/fw/ps3/cellScreenshot.h" +#include "rpcsx/fw/ps3/cellAudio.h" #include "Emu/Cell/lv2/sys_rsxaudio.h" #include "Emu/RSX/rsx_utils.h" #include "Emu/RSX/Overlays/overlay_message.h" diff --git a/rpcs3qt-legacy/gui_application.cpp b/rpcs3qt-legacy/gui_application.cpp index 168805d5a..43362f861 100644 --- a/rpcs3qt-legacy/gui_application.cpp +++ b/rpcs3qt-legacy/gui_application.cpp @@ -21,7 +21,7 @@ #endif #include "Emu/Audio/audio_utils.h" -#include "Emu/Cell/Modules/cellSysutil.h" +#include "rpcsx/fw/ps3/cellSysutil.h" #include "Emu/Io/Null/null_camera_handler.h" #include "Emu/Io/Null/null_music_handler.h" #include "Emu/vfs_config.h" diff --git a/rpcs3qt-legacy/headless_application.cpp b/rpcs3qt-legacy/headless_application.cpp index 462d3ca06..e60ce14ef 100644 --- a/rpcs3qt-legacy/headless_application.cpp +++ b/rpcs3qt-legacy/headless_application.cpp @@ -2,10 +2,10 @@ #include "Emu/System.h" #include "Emu/RSX/Null/NullGSRender.h" -#include "Emu/Cell/Modules/cellMsgDialog.h" -#include "Emu/Cell/Modules/cellOskDialog.h" -#include "Emu/Cell/Modules/cellSaveData.h" -#include "Emu/Cell/Modules/sceNpTrophy.h" +#include "rpcsx/fw/ps3/cellMsgDialog.h" +#include "rpcsx/fw/ps3/cellOskDialog.h" +#include "rpcsx/fw/ps3/cellSaveData.h" +#include "rpcsx/fw/ps3/sceNpTrophy.h" #include "Emu/Io/Null/null_camera_handler.h" #include "Emu/Io/Null/null_music_handler.h" #include "Emu/Io/Null/NullPadHandler.h" diff --git a/rpcs3qt-legacy/infinity_dialog.cpp b/rpcs3qt-legacy/infinity_dialog.cpp index b172ddad2..54d244ff7 100644 --- a/rpcs3qt-legacy/infinity_dialog.cpp +++ b/rpcs3qt-legacy/infinity_dialog.cpp @@ -1,5 +1,5 @@ #include "stdafx.h" -#include "Utilities/File.h" +#include "util/File.h" #include "Crypto/aes.h" #include "Crypto/sha1.h" #include "infinity_dialog.h" diff --git a/rpcs3qt-legacy/kernel_explorer.cpp b/rpcs3qt-legacy/kernel_explorer.cpp index 117275687..26a8df6d6 100644 --- a/rpcs3qt-legacy/kernel_explorer.cpp +++ b/rpcs3qt-legacy/kernel_explorer.cpp @@ -31,7 +31,7 @@ #include "Emu/Cell/lv2/sys_fs.h" #include "Emu/Cell/lv2/sys_interrupt.h" #include "Emu/Cell/lv2/sys_rsxaudio.h" -#include "Emu/Cell/Modules/cellSpurs.h" +#include "rpcsx/fw/ps3/cellSpurs.h" #include "Emu/RSX/RSXThread.h" diff --git a/rpcs3qt-legacy/log_frame.cpp b/rpcs3qt-legacy/log_frame.cpp index f388ee3fc..1e757f74a 100644 --- a/rpcs3qt-legacy/log_frame.cpp +++ b/rpcs3qt-legacy/log_frame.cpp @@ -2,7 +2,7 @@ #include "qt_utils.h" #include "gui_settings.h" -#include "Utilities/lockless.h" +#include "util/lockless.h" #include "util/asm.hpp" #include diff --git a/rpcs3qt-legacy/log_frame.h b/rpcs3qt-legacy/log_frame.h index 0a07f338f..22ebfcf03 100644 --- a/rpcs3qt-legacy/log_frame.h +++ b/rpcs3qt-legacy/log_frame.h @@ -1,6 +1,6 @@ #pragma once -#include "Utilities/File.h" +#include "util/File.h" #include "util/logs.hpp" #include "custom_dock_widget.h" diff --git a/rpcs3qt-legacy/main.cpp b/rpcs3qt-legacy/main.cpp index b48f6239f..e3598b893 100644 --- a/rpcs3qt-legacy/main.cpp +++ b/rpcs3qt-legacy/main.cpp @@ -27,8 +27,8 @@ #include "uuid.h" #include "headless_application.h" -#include "Utilities/sema.h" -#include "Utilities/date_time.h" +#include "util/sema.h" +#include "util/date_time.h" #include "util/console.h" #include "Crypto/decrypt_binaries.h" #ifdef _WIN32 @@ -64,10 +64,10 @@ DYNAMIC_IMPORT("ntdll.dll", NtSetTimerResolution, NTSTATUS(ULONG DesiredResoluti #include #endif -#include "Utilities/Config.h" -#include "Utilities/Thread.h" -#include "Utilities/File.h" -#include "Utilities/StrUtil.h" +#include "util/Config.h" +#include "util/Thread.h" +#include "util/File.h" +#include "util/StrUtil.h" #include "util/media_utils.h" #include "rpcs3_version.h" #include "Emu/System.h" diff --git a/rpcs3qt-legacy/main_application.cpp b/rpcs3qt-legacy/main_application.cpp index 37e4ed7eb..287e65487 100644 --- a/rpcs3qt-legacy/main_application.cpp +++ b/rpcs3qt-legacy/main_application.cpp @@ -6,8 +6,8 @@ #include "util/logs.hpp" #include "util/sysinfo.hpp" -#include "Utilities/Thread.h" -#include "Utilities/File.h" +#include "util/Thread.h" +#include "util/File.h" #include "Input/pad_thread.h" #include "Emu/System.h" #include "Emu/system_config.h" diff --git a/rpcs3qt-legacy/main_window.cpp b/rpcs3qt-legacy/main_window.cpp index 1b3f6c1e6..bd7eba8f8 100644 --- a/rpcs3qt-legacy/main_window.cpp +++ b/rpcs3qt-legacy/main_window.cpp @@ -75,7 +75,7 @@ #include "Loader/PSF.h" #include "Loader/mself.hpp" -#include "Utilities/Thread.h" +#include "util/Thread.h" #include "util/sysinfo.hpp" #include "util/serialization_ext.hpp" diff --git a/rpcs3qt-legacy/memory_string_searcher.cpp b/rpcs3qt-legacy/memory_string_searcher.cpp index 14f2b309d..a7cab9567 100644 --- a/rpcs3qt-legacy/memory_string_searcher.cpp +++ b/rpcs3qt-legacy/memory_string_searcher.cpp @@ -5,8 +5,8 @@ #include "Emu/CPU/CPUDisAsm.h" #include "Emu/Cell/SPUDisAsm.h" -#include "Utilities/Thread.h" -#include "Utilities/StrUtil.h" +#include "util/Thread.h" +#include "util/StrUtil.h" #include diff --git a/rpcs3qt-legacy/memory_viewer_panel.h b/rpcs3qt-legacy/memory_viewer_panel.h index f5d96b666..93426b542 100644 --- a/rpcs3qt-legacy/memory_viewer_panel.h +++ b/rpcs3qt-legacy/memory_viewer_panel.h @@ -1,7 +1,7 @@ #pragma once #include "util/types.hpp" -#include "Utilities/Thread.h" +#include "util/Thread.h" #include #include diff --git a/rpcs3qt-legacy/microphone_creator.cpp b/rpcs3qt-legacy/microphone_creator.cpp index 1e0220b57..e62d48d1e 100644 --- a/rpcs3qt-legacy/microphone_creator.cpp +++ b/rpcs3qt-legacy/microphone_creator.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "microphone_creator.h" -#include "Utilities/StrUtil.h" +#include "util/StrUtil.h" #include "3rdparty/OpenAL/openal-soft/include/AL/al.h" #include "3rdparty/OpenAL/openal-soft/include/AL/alc.h" diff --git a/rpcs3qt-legacy/midi_creator.cpp b/rpcs3qt-legacy/midi_creator.cpp index 84e8142d7..50c368eb0 100644 --- a/rpcs3qt-legacy/midi_creator.cpp +++ b/rpcs3qt-legacy/midi_creator.cpp @@ -1,8 +1,8 @@ #include "stdafx.h" #include "midi_creator.h" -#include "Utilities/StrFmt.h" -#include "Utilities/StrUtil.h" +#include "util/StrFmt.h" +#include "util/StrUtil.h" #include diff --git a/rpcs3qt-legacy/msg_dialog_frame.h b/rpcs3qt-legacy/msg_dialog_frame.h index 67a7dc105..c35f2ebd5 100644 --- a/rpcs3qt-legacy/msg_dialog_frame.h +++ b/rpcs3qt-legacy/msg_dialog_frame.h @@ -1,7 +1,7 @@ #pragma once #include "util/types.hpp" -#include "Emu/Cell/Modules/cellMsgDialog.h" +#include "rpcsx/fw/ps3/cellMsgDialog.h" #include "progress_indicator.h" #include diff --git a/rpcs3qt-legacy/osk_dialog_frame.h b/rpcs3qt-legacy/osk_dialog_frame.h index a402332a7..552dfa8c8 100644 --- a/rpcs3qt-legacy/osk_dialog_frame.h +++ b/rpcs3qt-legacy/osk_dialog_frame.h @@ -1,7 +1,7 @@ #pragma once #include "util/types.hpp" -#include "Emu/Cell/Modules/cellOskDialog.h" +#include "rpcsx/fw/ps3/cellOskDialog.h" #include diff --git a/rpcs3qt-legacy/pad_motion_settings_dialog.h b/rpcs3qt-legacy/pad_motion_settings_dialog.h index d5e415957..dd432fce6 100644 --- a/rpcs3qt-legacy/pad_motion_settings_dialog.h +++ b/rpcs3qt-legacy/pad_motion_settings_dialog.h @@ -3,7 +3,7 @@ #include "ui_pad_motion_settings_dialog.h" #include "pad_device_info.h" #include "Emu/Io/PadHandler.h" -#include "Utilities/Thread.h" +#include "util/Thread.h" #include #include diff --git a/rpcs3qt-legacy/pad_settings_dialog.h b/rpcs3qt-legacy/pad_settings_dialog.h index b37aeb69e..792c96867 100644 --- a/rpcs3qt-legacy/pad_settings_dialog.h +++ b/rpcs3qt-legacy/pad_settings_dialog.h @@ -11,7 +11,7 @@ #include "Emu/Io/PadHandler.h" #include "Emu/Io/pad_config.h" #include "Emu/GameInfo.h" -#include "Utilities/Thread.h" +#include "util/Thread.h" #include "pad_device_info.h" class gui_settings; diff --git a/rpcs3qt-legacy/patch_creator_dialog.cpp b/rpcs3qt-legacy/patch_creator_dialog.cpp index e316b245b..771e12eb7 100644 --- a/rpcs3qt-legacy/patch_creator_dialog.cpp +++ b/rpcs3qt-legacy/patch_creator_dialog.cpp @@ -2,7 +2,7 @@ #include "patch_creator_dialog.h" #include "table_item_delegate.h" #include "qt_utils.h" -#include "Utilities/Config.h" +#include "util/Config.h" #include #include diff --git a/rpcs3qt-legacy/patch_creator_dialog.h b/rpcs3qt-legacy/patch_creator_dialog.h index 112d827e5..6b3137ac1 100644 --- a/rpcs3qt-legacy/patch_creator_dialog.h +++ b/rpcs3qt-legacy/patch_creator_dialog.h @@ -1,6 +1,6 @@ #pragma once -#include "Utilities/bin_patch.h" +#include "util/bin_patch.h" #include #include diff --git a/rpcs3qt-legacy/patch_manager_dialog.cpp b/rpcs3qt-legacy/patch_manager_dialog.cpp index 5dbfeaa84..18a590c39 100644 --- a/rpcs3qt-legacy/patch_manager_dialog.cpp +++ b/rpcs3qt-legacy/patch_manager_dialog.cpp @@ -17,7 +17,7 @@ #include "gui_settings.h" #include "downloader.h" #include "qt_utils.h" -#include "Utilities/File.h" +#include "util/File.h" #include "util/logs.hpp" #include "Crypto/utils.h" diff --git a/rpcs3qt-legacy/patch_manager_dialog.h b/rpcs3qt-legacy/patch_manager_dialog.h index ab76f8d8b..ca67e69f9 100644 --- a/rpcs3qt-legacy/patch_manager_dialog.h +++ b/rpcs3qt-legacy/patch_manager_dialog.h @@ -6,7 +6,7 @@ #include #include "gui_game_info.h" -#include "Utilities/bin_patch.h" +#include "util/bin_patch.h" #include namespace Ui diff --git a/rpcs3qt-legacy/ps_move_tracker_dialog.cpp b/rpcs3qt-legacy/ps_move_tracker_dialog.cpp index 8608a001a..b9d3ecd06 100644 --- a/rpcs3qt-legacy/ps_move_tracker_dialog.cpp +++ b/rpcs3qt-legacy/ps_move_tracker_dialog.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "ps_move_tracker_dialog.h" #include "ui_ps_move_tracker_dialog.h" -#include "Emu/Cell/Modules/cellCamera.h" +#include "rpcsx/fw/ps3/cellCamera.h" #include "qt_camera_handler.h" #include "Input/ps_move_handler.h" #include "Input/ps_move_config.h" diff --git a/rpcs3qt-legacy/ps_move_tracker_dialog.h b/rpcs3qt-legacy/ps_move_tracker_dialog.h index a2e614df3..e6d0edae6 100644 --- a/rpcs3qt-legacy/ps_move_tracker_dialog.h +++ b/rpcs3qt-legacy/ps_move_tracker_dialog.h @@ -1,6 +1,6 @@ #pragma once -#include "Utilities/Thread.h" +#include "util/Thread.h" #include "Input/pad_thread.h" #include diff --git a/rpcs3qt-legacy/qt_camera_video_sink.cpp b/rpcs3qt-legacy/qt_camera_video_sink.cpp index 52fe86ed4..cedd1f61e 100644 --- a/rpcs3qt-legacy/qt_camera_video_sink.cpp +++ b/rpcs3qt-legacy/qt_camera_video_sink.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "qt_camera_video_sink.h" -#include "Emu/Cell/Modules/cellCamera.h" +#include "rpcsx/fw/ps3/cellCamera.h" #include "Emu/system_config.h" #include diff --git a/rpcs3qt-legacy/qt_music_handler.cpp b/rpcs3qt-legacy/qt_music_handler.cpp index 595444811..aca5d25b7 100644 --- a/rpcs3qt-legacy/qt_music_handler.cpp +++ b/rpcs3qt-legacy/qt_music_handler.cpp @@ -1,5 +1,5 @@ #include "qt_music_handler.h" -#include "Emu/Cell/Modules/cellMusic.h" +#include "rpcsx/fw/ps3/cellMusic.h" #include "Emu/System.h" #include "util/logs.hpp" diff --git a/rpcs3qt-legacy/qt_utils.cpp b/rpcs3qt-legacy/qt_utils.cpp index ddd351198..ae25ff9b0 100644 --- a/rpcs3qt-legacy/qt_utils.cpp +++ b/rpcs3qt-legacy/qt_utils.cpp @@ -11,7 +11,7 @@ #include #include "Emu/system_utils.hpp" -#include "Utilities/File.h" +#include "util/File.h" #include LOG_CHANNEL(gui_log, "GUI"); diff --git a/rpcs3qt-legacy/qt_video_source.h b/rpcs3qt-legacy/qt_video_source.h index e43b9ebf8..c2e102515 100644 --- a/rpcs3qt-legacy/qt_video_source.h +++ b/rpcs3qt-legacy/qt_video_source.h @@ -2,7 +2,7 @@ #include "util/video_source.h" #include "util/atomic.hpp" -#include "Utilities/mutex.h" +#include "util/mutex.h" #include #include diff --git a/rpcs3qt-legacy/recvmessage_dialog_frame.h b/rpcs3qt-legacy/recvmessage_dialog_frame.h index 10b9bd87e..7fca43c57 100644 --- a/rpcs3qt-legacy/recvmessage_dialog_frame.h +++ b/rpcs3qt-legacy/recvmessage_dialog_frame.h @@ -6,7 +6,7 @@ #include "util/types.hpp" #include "util/shared_ptr.hpp" #include "custom_dialog.h" -#include "Emu/Cell/Modules/sceNp.h" +#include "rpcsx/fw/ps3/sceNp.h" struct recvmessage_signal_struct { diff --git a/rpcs3qt-legacy/render_creator.cpp b/rpcs3qt-legacy/render_creator.cpp index ff0921af5..731344f50 100644 --- a/rpcs3qt-legacy/render_creator.cpp +++ b/rpcs3qt-legacy/render_creator.cpp @@ -2,7 +2,7 @@ #include -#include "Utilities/Thread.h" +#include "util/Thread.h" #if defined(HAVE_VULKAN) #include "Emu/RSX/VK/vkutils/instance.h" diff --git a/rpcs3qt-legacy/rsx_debugger.cpp b/rpcs3qt-legacy/rsx_debugger.cpp index e4a4c9679..dacf2aa0b 100644 --- a/rpcs3qt-legacy/rsx_debugger.cpp +++ b/rpcs3qt-legacy/rsx_debugger.cpp @@ -4,7 +4,7 @@ #include "table_item_delegate.h" #include "Emu/RSX/RSXThread.h" #include "Emu/RSX/gcm_printing.h" -#include "Utilities/File.h" +#include "util/File.h" #include #include diff --git a/rpcs3qt-legacy/save_data_dialog.cpp b/rpcs3qt-legacy/save_data_dialog.cpp index 5a2ccd7cf..c76e3351a 100644 --- a/rpcs3qt-legacy/save_data_dialog.cpp +++ b/rpcs3qt-legacy/save_data_dialog.cpp @@ -6,7 +6,7 @@ #include "Emu/Io/interception.h" #include "Emu/RSX/Overlays/overlay_manager.h" #include "Emu/RSX/Overlays/overlay_save_dialog.h" -#include "Emu/Cell/Modules/cellSysutil.h" +#include "rpcsx/fw/ps3/cellSysutil.h" #include "util/logs.hpp" diff --git a/rpcs3qt-legacy/save_data_dialog.h b/rpcs3qt-legacy/save_data_dialog.h index e98ee8e4a..26959c8c2 100644 --- a/rpcs3qt-legacy/save_data_dialog.h +++ b/rpcs3qt-legacy/save_data_dialog.h @@ -1,7 +1,7 @@ #pragma once #include "util/types.hpp" -#include "Emu/Cell/Modules/cellSaveData.h" +#include "rpcsx/fw/ps3/cellSaveData.h" class save_data_dialog : public SaveDialogBase { diff --git a/rpcs3qt-legacy/save_data_info_dialog.h b/rpcs3qt-legacy/save_data_info_dialog.h index 4e7ca73a8..7d17c8191 100644 --- a/rpcs3qt-legacy/save_data_info_dialog.h +++ b/rpcs3qt-legacy/save_data_info_dialog.h @@ -1,7 +1,7 @@ #pragma once // I just want the struct for the save data. -#include "Emu/Cell/Modules/cellSaveData.h" +#include "rpcsx/fw/ps3/cellSaveData.h" #include #include diff --git a/rpcs3qt-legacy/save_data_list_dialog.h b/rpcs3qt-legacy/save_data_list_dialog.h index ae9f222a8..341c579e7 100644 --- a/rpcs3qt-legacy/save_data_list_dialog.h +++ b/rpcs3qt-legacy/save_data_list_dialog.h @@ -1,7 +1,7 @@ #pragma once #include "util/types.hpp" -#include "Emu/Cell/Modules/cellSaveData.h" +#include "rpcsx/fw/ps3/cellSaveData.h" #include "Emu/RSX/Overlays/overlays.h" #include diff --git a/rpcs3qt-legacy/save_manager_dialog.cpp b/rpcs3qt-legacy/save_manager_dialog.cpp index 14596cac5..4fdec9023 100644 --- a/rpcs3qt-legacy/save_manager_dialog.cpp +++ b/rpcs3qt-legacy/save_manager_dialog.cpp @@ -27,8 +27,8 @@ #include #include -#include "Utilities/File.h" -#include "Utilities/mutex.h" +#include "util/File.h" +#include "util/mutex.h" LOG_CHANNEL(gui_log, "GUI"); diff --git a/rpcs3qt-legacy/save_manager_dialog.h b/rpcs3qt-legacy/save_manager_dialog.h index 6f6307b6a..08495d975 100644 --- a/rpcs3qt-legacy/save_manager_dialog.h +++ b/rpcs3qt-legacy/save_manager_dialog.h @@ -2,7 +2,7 @@ #include "game_list.h" -#include "Emu/Cell/Modules/cellSaveData.h" +#include "rpcsx/fw/ps3/cellSaveData.h" #include #include diff --git a/rpcs3qt-legacy/screenshot_manager_dialog.cpp b/rpcs3qt-legacy/screenshot_manager_dialog.cpp index e5678c89c..3b0e6aa9c 100644 --- a/rpcs3qt-legacy/screenshot_manager_dialog.cpp +++ b/rpcs3qt-legacy/screenshot_manager_dialog.cpp @@ -4,7 +4,7 @@ #include "screenshot_item.h" #include "flow_widget.h" #include "qt_utils.h" -#include "Utilities/File.h" +#include "util/File.h" #include "Emu/system_utils.hpp" #include diff --git a/rpcs3qt-legacy/sendmessage_dialog_frame.h b/rpcs3qt-legacy/sendmessage_dialog_frame.h index d4aad5cd5..6b135b427 100644 --- a/rpcs3qt-legacy/sendmessage_dialog_frame.h +++ b/rpcs3qt-legacy/sendmessage_dialog_frame.h @@ -6,7 +6,7 @@ #include "util/types.hpp" #include "custom_dialog.h" -#include "Emu/Cell/Modules/sceNp.h" +#include "rpcsx/fw/ps3/sceNp.h" class sendmessage_dialog_frame : public QObject, public SendMessageDialogBase { diff --git a/rpcs3qt-legacy/settings.cpp b/rpcs3qt-legacy/settings.cpp index c7dc8b21b..987ad907e 100644 --- a/rpcs3qt-legacy/settings.cpp +++ b/rpcs3qt-legacy/settings.cpp @@ -1,6 +1,6 @@ #include "settings.h" -#include "Utilities/File.h" +#include "util/File.h" settings::settings(QObject* parent) : QObject(parent), m_settings_dir(ComputeSettingsDir()) diff --git a/rpcs3qt-legacy/shortcut_utils.cpp b/rpcs3qt-legacy/shortcut_utils.cpp index b57ff1203..8eefee50c 100644 --- a/rpcs3qt-legacy/shortcut_utils.cpp +++ b/rpcs3qt-legacy/shortcut_utils.cpp @@ -2,8 +2,8 @@ #include "shortcut_utils.h" #include "qt_utils.h" #include "Emu/VFS.h" -#include "Utilities/File.h" -#include "Utilities/StrUtil.h" +#include "util/File.h" +#include "util/StrUtil.h" #ifdef _WIN32 #include diff --git a/rpcs3qt-legacy/skylander_dialog.cpp b/rpcs3qt-legacy/skylander_dialog.cpp index da74cdd3f..2cf108dc0 100644 --- a/rpcs3qt-legacy/skylander_dialog.cpp +++ b/rpcs3qt-legacy/skylander_dialog.cpp @@ -1,5 +1,5 @@ #include "stdafx.h" -#include "Utilities/File.h" +#include "util/File.h" #include "skylander_dialog.h" #include "Emu/Io/Skylander.h" diff --git a/rpcs3qt-legacy/system_cmd_dialog.cpp b/rpcs3qt-legacy/system_cmd_dialog.cpp index 60c54f3cd..f608e416c 100644 --- a/rpcs3qt-legacy/system_cmd_dialog.cpp +++ b/rpcs3qt-legacy/system_cmd_dialog.cpp @@ -2,9 +2,9 @@ #include "system_cmd_dialog.h" #include "Emu/System.h" -#include "Emu/Cell/Modules/cellSysutil.h" -#include "Emu/Cell/Modules/cellNetCtl.h" -#include "Emu/Cell/Modules/cellOskDialog.h" +#include "rpcsx/fw/ps3/cellSysutil.h" +#include "rpcsx/fw/ps3/cellNetCtl.h" +#include "rpcsx/fw/ps3/cellOskDialog.h" #include #include diff --git a/rpcs3qt-legacy/trophy_manager_dialog.cpp b/rpcs3qt-legacy/trophy_manager_dialog.cpp index 47360c8bd..34d886c68 100644 --- a/rpcs3qt-legacy/trophy_manager_dialog.cpp +++ b/rpcs3qt-legacy/trophy_manager_dialog.cpp @@ -10,13 +10,13 @@ #include "persistent_settings.h" #include "util/logs.hpp" -#include "Utilities/StrUtil.h" -#include "Utilities/File.h" +#include "util/StrUtil.h" +#include "util/File.h" #include "Emu/VFS.h" #include "Emu/System.h" #include "Emu/system_utils.hpp" -#include "Emu/Cell/Modules/sceNpTrophy.h" -#include "Emu/Cell/Modules/cellRtc.h" +#include "rpcsx/fw/ps3/sceNpTrophy.h" +#include "rpcsx/fw/ps3/cellRtc.h" #include #include diff --git a/rpcs3qt-legacy/trophy_notification_frame.h b/rpcs3qt-legacy/trophy_notification_frame.h index ed9ea4e59..c8ef1c617 100644 --- a/rpcs3qt-legacy/trophy_notification_frame.h +++ b/rpcs3qt-legacy/trophy_notification_frame.h @@ -1,6 +1,6 @@ #pragma once -#include "Emu/Cell/Modules/sceNpTrophy.h" +#include "rpcsx/fw/ps3/sceNpTrophy.h" #include diff --git a/rpcs3qt-legacy/trophy_notification_helper.cpp b/rpcs3qt-legacy/trophy_notification_helper.cpp index fe257f589..ebaa3f9b0 100644 --- a/rpcs3qt-legacy/trophy_notification_helper.cpp +++ b/rpcs3qt-legacy/trophy_notification_helper.cpp @@ -7,7 +7,7 @@ #include "Emu/RSX/Overlays/overlay_manager.h" #include "Emu/RSX/Overlays/overlay_trophy_notification.h" -#include "Utilities/File.h" +#include "util/File.h" s32 trophy_notification_helper::ShowTrophyNotification(const SceNpTrophyDetails& trophy, const std::vector& trophy_icon_buffer) { diff --git a/rpcs3qt-legacy/trophy_notification_helper.h b/rpcs3qt-legacy/trophy_notification_helper.h index b8579e87b..3359da350 100644 --- a/rpcs3qt-legacy/trophy_notification_helper.h +++ b/rpcs3qt-legacy/trophy_notification_helper.h @@ -1,7 +1,7 @@ #pragma once #include "util/types.hpp" -#include "Emu/Cell/Modules/sceNpTrophy.h" +#include "rpcsx/fw/ps3/sceNpTrophy.h" #include #include diff --git a/rpcs3qt-legacy/update_manager.cpp b/rpcs3qt-legacy/update_manager.cpp index f1a533f46..6916c70f4 100644 --- a/rpcs3qt-legacy/update_manager.cpp +++ b/rpcs3qt-legacy/update_manager.cpp @@ -4,7 +4,7 @@ #include "rpcs3_version.h" #include "downloader.h" #include "gui_settings.h" -#include "Utilities/File.h" +#include "util/File.h" #include "Emu/System.h" #include "Crypto/utils.h" #include "util/logs.hpp" @@ -39,7 +39,7 @@ #define PATH_MAX MAX_PATH #endif -#include "Utilities/StrUtil.h" +#include "util/StrUtil.h" #else #include #include diff --git a/rpcs3qt-legacy/user_account.cpp b/rpcs3qt-legacy/user_account.cpp index 16360ea80..4fdc3430d 100644 --- a/rpcs3qt-legacy/user_account.cpp +++ b/rpcs3qt-legacy/user_account.cpp @@ -1,7 +1,7 @@ #include "user_account.h" #include "Emu/system_utils.hpp" -#include "Utilities/File.h" +#include "util/File.h" #include "util/logs.hpp" LOG_CHANNEL(gui_log, "GUI"); diff --git a/rpcs3qt-legacy/user_manager_dialog.cpp b/rpcs3qt-legacy/user_manager_dialog.cpp index fd6cb2023..c5118d9eb 100644 --- a/rpcs3qt-legacy/user_manager_dialog.cpp +++ b/rpcs3qt-legacy/user_manager_dialog.cpp @@ -22,7 +22,7 @@ #include "Emu/System.h" #include "Emu/system_utils.hpp" -#include "Utilities/File.h" +#include "util/File.h" #include "util/logs.hpp" constexpr auto qstr = QString::fromStdString; diff --git a/rpcs3qt-legacy/uuid.cpp b/rpcs3qt-legacy/uuid.cpp index a2bd678a8..4f3545487 100644 --- a/rpcs3qt-legacy/uuid.cpp +++ b/rpcs3qt-legacy/uuid.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "uuid.h" -#include "Utilities/StrUtil.h" +#include "util/StrUtil.h" #include #include diff --git a/rpcs3qt-legacy/vfs_dialog_tab.cpp b/rpcs3qt-legacy/vfs_dialog_tab.cpp index ecc854220..21990eaa1 100644 --- a/rpcs3qt-legacy/vfs_dialog_tab.cpp +++ b/rpcs3qt-legacy/vfs_dialog_tab.cpp @@ -1,5 +1,5 @@ #include "vfs_dialog_tab.h" -#include "Utilities/Config.h" +#include "util/Config.h" vfs_dialog_tab::vfs_dialog_tab(const QString& name, gui_save list_location, cfg::string* cfg_node, std::shared_ptr _gui_settings, QWidget* parent) : vfs_dialog_path_widget(name, QString::fromStdString(cfg_node->to_string()), QString::fromStdString(cfg_node->def), std::move(list_location), std::move(_gui_settings), parent), m_cfg_node(cfg_node) diff --git a/rpcs3qt-legacy/vfs_dialog_usb_tab.cpp b/rpcs3qt-legacy/vfs_dialog_usb_tab.cpp index efd7d954d..4908a227a 100644 --- a/rpcs3qt-legacy/vfs_dialog_usb_tab.cpp +++ b/rpcs3qt-legacy/vfs_dialog_usb_tab.cpp @@ -1,7 +1,7 @@ #include "vfs_dialog_usb_tab.h" #include "vfs_dialog_usb_input.h" #include "table_item_delegate.h" -#include "Utilities/Config.h" +#include "util/Config.h" #include #include diff --git a/rpcs3qt-legacy/welcome_dialog.cpp b/rpcs3qt-legacy/welcome_dialog.cpp index 390998650..710349ac2 100644 --- a/rpcs3qt-legacy/welcome_dialog.cpp +++ b/rpcs3qt-legacy/welcome_dialog.cpp @@ -5,7 +5,7 @@ #include "shortcut_utils.h" #include "qt_utils.h" -#include "Utilities/File.h" +#include "util/File.h" #include #include