Compare commits
138 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a33e5e909e | |||
| 5cd8a00c8c | |||
| 488c4d198f | |||
| 081d7c5de7 | |||
| 09c77ff46c | |||
| 2102b5d4aa | |||
| 57f0ddd13c | |||
| 5f047034ae | |||
| ffe6c9ba5a | |||
| 910fc54ee2 | |||
| f00d9a7c7f | |||
| 2dce55d036 | |||
| 315798b1f4 | |||
| dece1e01f4 | |||
| a19ffba8e8 | |||
| e230867492 | |||
| 0c8e4c0887 | |||
| 84b8a08d26 | |||
| 2855869530 | |||
| d41b49d8b4 | |||
| 4804efc17d | |||
| 053ab585f4 | |||
| 20d4c09a1c | |||
| 68b3229756 | |||
| 87741141f1 | |||
| 705820c430 | |||
| 6b23e733d0 | |||
| 07cbf3da48 | |||
| af1b13550b | |||
| 8ccaabb502 | |||
| 01349b8cee | |||
| 4487cc8e7a | |||
| cb9e6e75db | |||
| e487480ca9 | |||
| bc9594ed57 | |||
| 817dfe8651 | |||
| ba54f7ae39 | |||
| f328cdbaef | |||
| f2e5b6c350 | |||
| ac82ecf387 | |||
| 4b1c052030 | |||
| c0a0cb98c5 | |||
| 4fd69a09c7 | |||
| eea2c20420 | |||
| f4d2fccdfe | |||
| c8a6bc6e24 | |||
| 7f542a5c99 | |||
| c1f32aa570 | |||
| 7bbadfd08b | |||
| 3a9428a88e | |||
| 7233640cf0 | |||
| effdb65ae4 | |||
| 91d0511154 | |||
| d4e88aa11c | |||
| ec0cd9f006 | |||
| 8db7ef4d5a | |||
| 504e3112dd | |||
| f96e9b6ed7 | |||
| f056b2f4ab | |||
| 445b7c0758 | |||
| 53f8b03acc | |||
| 900329a1de | |||
| 7c6c33eef8 | |||
| dacc9af38f | |||
| 8d7620d95f | |||
| 3043c73745 | |||
| f786c078c2 | |||
| 31cee7e4c8 | |||
| 6e8ccbcf17 | |||
| 72e54e8b60 | |||
| e0f53ace19 | |||
| 2444385763 | |||
| 6141bc5598 | |||
| 9138d537c8 | |||
| 05354698f0 | |||
| 14e15b2feb | |||
| 324d21d849 | |||
| aa30e865c2 | |||
| 0772b9c879 | |||
| 296052b1ff | |||
| be834a67d1 | |||
| b63461f599 | |||
| 1fb7cc4002 | |||
| a766478e15 | |||
| b61a69c877 | |||
| 7753ac60b0 | |||
| aabf3c6695 | |||
| d78b0467d8 | |||
| dc55d5be8f | |||
| 06546b5195 | |||
| ca9c1674f7 | |||
| ede76033a7 | |||
| 41bd07274f | |||
| 5266dd6c60 | |||
| cf1c45dfe8 | |||
| ae7e275a9d | |||
| b60f29282a | |||
| bda466c3bd | |||
| 4c6ceeff11 | |||
| 77f2b521e1 | |||
| 1b26ec56ed | |||
| 7c0fd5094e | |||
| d5b9eb0caa | |||
| 1a0b2bf050 | |||
| f52fa5e46c | |||
| 77b8f3a0f9 | |||
| 95d232db4f | |||
| 00b1ff752d | |||
| 877b296fc3 | |||
| ee88e7f948 | |||
| ebb9fc7cd9 | |||
| 32f0e91893 | |||
| a8ab408f64 | |||
| 661b8b006f | |||
| 1bd77c2f51 | |||
| c191a98ec3 | |||
| 3bbecd998a | |||
| 3406cc9886 | |||
| bd297d079d | |||
| a5500ebfa4 | |||
| a64bea1286 | |||
| b67f28e00d | |||
| 89c548b5d3 | |||
| 02e571adbc | |||
| 98e50d3064 | |||
| f20fd217f8 | |||
| 95c6ac699b | |||
| 9caceeacd7 | |||
| 2f7f8a629d | |||
| a994c46256 | |||
| c689a9ba8e | |||
| 777cd9a8ae | |||
| 6dd2c78b1b | |||
| 372cb39ce8 | |||
| d2652aedd2 | |||
| fa04ff6d90 | |||
| cce0ad0c35 | |||
| 76be7d40ac |
@@ -6,7 +6,7 @@ or our discord:
|
||||
https://discord.me/RPCS3
|
||||
|
||||
PLEASE READ THE GUIDELINES BEFORE OPENING AN ISSUE:
|
||||
https://github.com/RPCS3/rpcs3/blob/master/CONTRIBUTING.md
|
||||
https://github.com/RPCS3/rpcs3/blob/master/.github/CONTRIBUTING.md
|
||||
|
||||
====================================================
|
||||
|
||||
|
||||
@@ -59,6 +59,8 @@ rpcs3/git-version.h
|
||||
|
||||
# Visual Studio Files
|
||||
.vs/*
|
||||
.vscode/*
|
||||
*.ipch
|
||||
*.vspx
|
||||
*.psess
|
||||
*.VC.*
|
||||
@@ -92,6 +94,10 @@ CMakeCache.txt
|
||||
rpcs3/cotire/*
|
||||
rpcs3/rpcs3_*_cotire.cmake
|
||||
|
||||
# kdevelop
|
||||
*.kdev4
|
||||
.kdev4/*
|
||||
|
||||
# Qt
|
||||
moc_*.cpp
|
||||
qrc_resources.cpp
|
||||
|
||||
+7
-3
@@ -7,14 +7,14 @@
|
||||
ignore = dirty
|
||||
[submodule "llvm"]
|
||||
path = llvm
|
||||
url = https://github.com/RPCS3/llvm
|
||||
url = https://github.com/llvm-mirror/llvm
|
||||
branch = release_60
|
||||
[submodule "GSL"]
|
||||
path = 3rdparty/GSL
|
||||
url = https://github.com/Microsoft/GSL.git
|
||||
[submodule "libpng"]
|
||||
path = 3rdparty/libpng
|
||||
url = https://github.com/RPCS3/libpng
|
||||
url = https://github.com/Zangetsu38/libpng
|
||||
ignore = dirty
|
||||
[submodule "Vulkan/glslang"]
|
||||
path = Vulkan/glslang
|
||||
@@ -33,7 +33,7 @@
|
||||
url = https://github.com/madler/zlib
|
||||
[submodule "3rdparty/hidapi"]
|
||||
path = 3rdparty/hidapi
|
||||
url = https://github.com/RPCS3/hidapi
|
||||
url = https://github.com/Zangetsu38/hidapi
|
||||
branch = master
|
||||
ignore = dirty
|
||||
[submodule "3rdparty/Optional"]
|
||||
@@ -42,3 +42,7 @@
|
||||
[submodule "3rdparty/pugixml"]
|
||||
path = 3rdparty/pugixml
|
||||
url = https://github.com/zeux/pugixml
|
||||
[submodule "polly"]
|
||||
path = polly
|
||||
url = https://github.com/llvm-mirror/polly
|
||||
branch = release_60
|
||||
|
||||
+21
-27
@@ -25,17 +25,15 @@ git:
|
||||
depth: false # Unshallow clone to obtain proper GIT_VERSION
|
||||
submodules: false
|
||||
|
||||
env:
|
||||
- QTVER=5.10.1
|
||||
|
||||
before_install:
|
||||
- if [ "$TRAVIS_OS_NAME" = "linux" ] && [ "$CXX" = "g++" ]; then
|
||||
export CXX="g++-5" CC="gcc-5" CXXFLAGS="-Wno-format-security";
|
||||
fi;
|
||||
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then
|
||||
wget http://download.qt.io/official_releases/online_installers/qt-unified-linux-x64-online.run ;
|
||||
chmod a+x ./qt-unified-linux-x64-online.run ;
|
||||
export QT_QPA_PLATFORM=minimal ;
|
||||
travis_wait 60 ./qt-unified-linux-x64-online.run --script qt-installer-noninteractive.qs --no-force-installations --verbose ;
|
||||
fi;
|
||||
|
||||
install:
|
||||
# Install updated libglew-dev since the version provided by trusty is outdated
|
||||
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then
|
||||
wget https://mirrors.kernel.org/ubuntu/pool/universe/g/glew/libglew-dev_2.0.0-5_amd64.deb;
|
||||
@@ -50,9 +48,8 @@ before_install:
|
||||
|
||||
before_script:
|
||||
- git submodule update --init asmjit 3rdparty/ffmpeg 3rdparty/pugixml 3rdparty/GSL 3rdparty/libpng Utilities/yaml-cpp 3rdparty/cereal 3rdparty/hidapi 3rdparty/Optional Vulkan/glslang Vulkan/Vulkan-LoaderAndValidationLayers
|
||||
- mkdir build
|
||||
- cd build
|
||||
- export CMAKE_PREFIX_PATH=~/Qt/5.10.0/gcc_64/lib/cmake
|
||||
- mkdir build ; cd build
|
||||
- export CMAKE_PREFIX_PATH=~/Qt/${QTVER}/gcc_64/lib/cmake
|
||||
- export CXXFLAGS="$CXXFLAGS -DTRAVIS=true";
|
||||
- if [ "$TRAVIS_PULL_REQUEST" = false ]; then
|
||||
export CXXFLAGS="$CXXFLAGS -DBRANCH=$TRAVIS_REPO_SLUG/$TRAVIS_BRANCH";
|
||||
@@ -60,42 +57,39 @@ before_script:
|
||||
export CXXFLAGS="$CXXFLAGS -DBRANCH=$TRAVIS_REPO_SLUG/$TRAVIS_BRANCH/#$TRAVIS_PULL_REQUEST";
|
||||
fi;
|
||||
- cmake .. -DCMAKE_INSTALL_PREFIX=/usr -G Ninja;
|
||||
|
||||
script:
|
||||
- ninja
|
||||
|
||||
after_script:
|
||||
- cd build
|
||||
- # AppImage generation
|
||||
- if [ -n "$UPLOAD_URL" ] && [ "$TRAVIS_BRANCH" = "master" ] && [ "$CC" = "clang" ] && [ "$TRAVIS_PULL_REQUEST" = false ]; then
|
||||
export LD_LIBRARY_PATH=~/Qt/5.10.0/gcc_64/lib;
|
||||
source /opt/qt510/bin/qt510-env.sh ;
|
||||
echo $LD_LIBRARY_PATH ;
|
||||
export LD_LIBRARY_PATH=/opt/qt510/lib ;
|
||||
DESTDIR=appdir ninja install ; find appdir/ ;
|
||||
find ../bin ;
|
||||
wget -c "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" ;
|
||||
chmod a+x linuxdeployqt*.AppImage ;
|
||||
export PATH=~/Qt/5.10.0/gcc_64/bin/:${PATH} ;
|
||||
export PATH=~/Qt/$QTVER/gcc_64/bin/:${PATH} ;
|
||||
./linuxdeployqt*.AppImage --appimage-extract ;
|
||||
./linuxdeployqt*.AppImage ./appdir/usr/share/applications/*.desktop -bundle-non-qt-libs ;
|
||||
mkdir ./appdir/usr/plugins/xcbglintegrations/ ;
|
||||
mkdir ./appdir/usr/plugins/imageformats/ ;
|
||||
cp ~/Qt/5.10.0/gcc_64/lib/libQt5Svg.so.5 ./appdir/usr/lib/ ;
|
||||
cp ~/Qt/5.10.0/gcc_64/plugins/xcbglintegrations/* ./appdir/usr/plugins/xcbglintegrations/ ;
|
||||
cp ~/Qt/5.10.0/gcc_64/plugins/imageformats/* ./appdir/usr/plugins/imageformats/ ;
|
||||
cp ~/Qt/5.10.0/gcc_64/plugins/platforms/* ./appdir/usr/plugins/platforms/ ;
|
||||
rm ./appdir/usr/lib/libfreetype.so.6 ;
|
||||
export PATH=${TRAVIS_BUILD_DIR}/build/squashfs-root/usr/bin/:${PATH} ;
|
||||
./squashfs-root/usr/bin/appimagetool ${TRAVIS_BUILD_DIR}/build/appdir ;
|
||||
find ./appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq ;
|
||||
curl ${UPLOAD_URL}${TRAVIS_COMMIT:0:7}-${TRAVIS_BUILD_NUMBER}_linux64 --upload-file ./RPCS3*.AppImage;
|
||||
COMM_TAG="$(git describe --tags $(git rev-list --tags --max-count=1))" ;
|
||||
COMM_COUNT="$(git rev-list --count HEAD)" ;
|
||||
curl "${UPLOAD_URL}${TRAVIS_COMMIT:0:8}&t=${COMM_TAG}&a=${COMM_COUNT}" --upload-file ./RPCS3*.AppImage;
|
||||
fi;
|
||||
|
||||
script:
|
||||
# Add a command to show all the variables. May be useful for debugging Travis.
|
||||
#- echo "--Shell Export Lists START--" ; export -p; echo "--Shell Export Lists STOP--";
|
||||
# And to ensure the versions of toolchain
|
||||
- echo "--CXX version?"; "$CXX" --version; echo "--CXX version confirmed";
|
||||
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-trusty-4.0
|
||||
- sourceline: 'ppa:jonathonf/binutils' # We need to update binutils to a newer version to link against the ffmpeg libs on.
|
||||
- sourceline: 'ppa:beineri/opt-qt-5.10.1-trusty' # <<WARNING>>: This needs to be updated manually whenever the QT Version changes. Add QT PPA since the installer is quite bad.
|
||||
packages:
|
||||
- binutils
|
||||
- cmake
|
||||
@@ -117,8 +111,8 @@ addons:
|
||||
- libstdc++-5-dev
|
||||
- lib32stdc++6
|
||||
- zlib1g-dev
|
||||
# We need to install qt 5.10.0 manually because the version trusty provides is too old.
|
||||
#- qtbase5-dev
|
||||
# From the beineri PPA
|
||||
- qt510-meta-minimal # <<WARNING>>: This needs to be updated manually whenever the QT Version changes.
|
||||
- libudev-dev
|
||||
- libevdev-dev
|
||||
- libpulse-dev
|
||||
|
||||
Vendored
+699
-25
File diff suppressed because it is too large
Load Diff
Vendored
+68
-2
@@ -13,8 +13,8 @@
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
* Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
* Or go to http://www.gnu.org/copyleft/lgpl.html
|
||||
*/
|
||||
|
||||
@@ -393,6 +393,72 @@ ALC_API void ALC_APIENTRY alcDeviceResumeSOFT(ALCdevice *device);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef AL_EXT_BFORMAT
|
||||
#define AL_EXT_BFORMAT 1
|
||||
#define AL_FORMAT_BFORMAT2D_8 0x20021
|
||||
#define AL_FORMAT_BFORMAT2D_16 0x20022
|
||||
#define AL_FORMAT_BFORMAT2D_FLOAT32 0x20023
|
||||
#define AL_FORMAT_BFORMAT3D_8 0x20031
|
||||
#define AL_FORMAT_BFORMAT3D_16 0x20032
|
||||
#define AL_FORMAT_BFORMAT3D_FLOAT32 0x20033
|
||||
#endif
|
||||
|
||||
#ifndef AL_EXT_MULAW_BFORMAT
|
||||
#define AL_EXT_MULAW_BFORMAT 1
|
||||
#define AL_FORMAT_BFORMAT2D_MULAW 0x10031
|
||||
#define AL_FORMAT_BFORMAT3D_MULAW 0x10032
|
||||
#endif
|
||||
|
||||
#ifndef ALC_SOFT_HRTF
|
||||
#define ALC_SOFT_HRTF 1
|
||||
#define ALC_HRTF_SOFT 0x1992
|
||||
#define ALC_DONT_CARE_SOFT 0x0002
|
||||
#define ALC_HRTF_STATUS_SOFT 0x1993
|
||||
#define ALC_HRTF_DISABLED_SOFT 0x0000
|
||||
#define ALC_HRTF_ENABLED_SOFT 0x0001
|
||||
#define ALC_HRTF_DENIED_SOFT 0x0002
|
||||
#define ALC_HRTF_REQUIRED_SOFT 0x0003
|
||||
#define ALC_HRTF_HEADPHONES_DETECTED_SOFT 0x0004
|
||||
#define ALC_HRTF_UNSUPPORTED_FORMAT_SOFT 0x0005
|
||||
#define ALC_NUM_HRTF_SPECIFIERS_SOFT 0x1994
|
||||
#define ALC_HRTF_SPECIFIER_SOFT 0x1995
|
||||
#define ALC_HRTF_ID_SOFT 0x1996
|
||||
typedef const ALCchar* (ALC_APIENTRY*LPALCGETSTRINGISOFT)(ALCdevice *device, ALCenum paramName, ALCsizei index);
|
||||
typedef ALCboolean (ALC_APIENTRY*LPALCRESETDEVICESOFT)(ALCdevice *device, const ALCint *attribs);
|
||||
#ifdef AL_ALEXT_PROTOTYPES
|
||||
ALC_API const ALCchar* ALC_APIENTRY alcGetStringiSOFT(ALCdevice *device, ALCenum paramName, ALCsizei index);
|
||||
ALC_API ALCboolean ALC_APIENTRY alcResetDeviceSOFT(ALCdevice *device, const ALCint *attribs);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef AL_SOFT_gain_clamp_ex
|
||||
#define AL_SOFT_gain_clamp_ex 1
|
||||
#define AL_GAIN_LIMIT_SOFT 0x200E
|
||||
#endif
|
||||
|
||||
#ifndef AL_SOFT_source_resampler
|
||||
#define AL_SOFT_source_resampler
|
||||
#define AL_NUM_RESAMPLERS_SOFT 0x1210
|
||||
#define AL_DEFAULT_RESAMPLER_SOFT 0x1211
|
||||
#define AL_SOURCE_RESAMPLER_SOFT 0x1212
|
||||
#define AL_RESAMPLER_NAME_SOFT 0x1213
|
||||
typedef const ALchar* (AL_APIENTRY*LPALGETSTRINGISOFT)(ALenum pname, ALsizei index);
|
||||
#ifdef AL_ALEXT_PROTOTYPES
|
||||
AL_API const ALchar* AL_APIENTRY alGetStringiSOFT(ALenum pname, ALsizei index);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef AL_SOFT_source_spatialize
|
||||
#define AL_SOFT_source_spatialize
|
||||
#define AL_SOURCE_SPATIALIZE_SOFT 0x1214
|
||||
#define AL_AUTO_SOFT 0x0002
|
||||
#endif
|
||||
|
||||
#ifndef ALC_SOFT_output_limiter
|
||||
#define ALC_SOFT_output_limiter
|
||||
#define ALC_OUTPUT_LIMITER_SOFT 0x199A
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -345,7 +345,7 @@ typedef struct {
|
||||
/* Driving Presets */
|
||||
|
||||
#define EFX_REVERB_PRESET_DRIVING_COMMENTATOR \
|
||||
{ 1.0000f, 0.0000f, 3.1623f, 0.5623f, 0.5012f, 2.4200f, 0.8800f, 0.6800f, 0.1995f, 0.0930f, { 0.0000f, 0.0000f, 0.0000f }, 0.2512f, 0.0170f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 1.0000f, 0.2500f, 0.0000f, 0.9886f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
|
||||
{ 1.0000f, 0.0000f, 0.3162f, 0.5623f, 0.5012f, 2.4200f, 0.8800f, 0.6800f, 0.1995f, 0.0930f, { 0.0000f, 0.0000f, 0.0000f }, 0.2512f, 0.0170f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 1.0000f, 0.2500f, 0.0000f, 0.9886f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_DRIVING_PITGARAGE \
|
||||
{ 0.4287f, 0.5900f, 0.3162f, 0.7079f, 0.5623f, 1.7200f, 0.9300f, 0.8700f, 0.5623f, 0.0000f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0160f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.1100f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 }
|
||||
|
||||
+4
-31
@@ -18,9 +18,6 @@ EXPORTS
|
||||
alDeleteBuffers
|
||||
alDeleteEffects
|
||||
alDeleteFilters
|
||||
alDeleteFontsoundsSOFT
|
||||
alDeletePresetsSOFT
|
||||
alDeleteSoundfontsSOFT
|
||||
alDeleteSources
|
||||
alDisable
|
||||
alDistanceModel
|
||||
@@ -35,17 +32,10 @@ EXPORTS
|
||||
alFilterfv
|
||||
alFilteri
|
||||
alFilteriv
|
||||
alFontsound2iSOFT
|
||||
alFontsoundModulatoriSOFT
|
||||
alFontsoundiSOFT
|
||||
alFontsoundivSOFT
|
||||
alGenAuxiliaryEffectSlots
|
||||
alGenBuffers
|
||||
alGenEffects
|
||||
alGenFilters
|
||||
alGenFontsoundsSOFT
|
||||
alGenPresetsSOFT
|
||||
alGenSoundfontsSOFT
|
||||
alGenSources
|
||||
alGetAuxiliaryEffectSlotf
|
||||
alGetAuxiliaryEffectSlotfv
|
||||
@@ -74,8 +64,6 @@ EXPORTS
|
||||
alGetFilteriv
|
||||
alGetFloat
|
||||
alGetFloatv
|
||||
alGetFontsoundModulatorivSOFT
|
||||
alGetFontsoundivSOFT
|
||||
alGetInteger
|
||||
alGetInteger64SOFT
|
||||
alGetInteger64vSOFT
|
||||
@@ -86,9 +74,7 @@ EXPORTS
|
||||
alGetListenerfv
|
||||
alGetListeneri
|
||||
alGetListeneriv
|
||||
alGetPresetivSOFT
|
||||
alGetProcAddress
|
||||
alGetSoundfontivSOFT
|
||||
alGetSource3dSOFT
|
||||
alGetSource3f
|
||||
alGetSource3i
|
||||
@@ -102,6 +88,7 @@ EXPORTS
|
||||
alGetSourcei64vSOFT
|
||||
alGetSourceiv
|
||||
alGetString
|
||||
alGetStringiSOFT
|
||||
alIsAuxiliaryEffectSlot
|
||||
alIsBuffer
|
||||
alIsBufferFormatSupportedSOFT
|
||||
@@ -109,9 +96,6 @@ EXPORTS
|
||||
alIsEnabled
|
||||
alIsExtensionPresent
|
||||
alIsFilter
|
||||
alIsFontsoundSOFT
|
||||
alIsPresetSOFT
|
||||
alIsSoundfontSOFT
|
||||
alIsSource
|
||||
alListener3f
|
||||
alListener3i
|
||||
@@ -119,21 +103,7 @@ EXPORTS
|
||||
alListenerfv
|
||||
alListeneri
|
||||
alListeneriv
|
||||
alLoadSoundfontSOFT
|
||||
alMidiEventSOFT
|
||||
alMidiGainSOFT
|
||||
alMidiPauseSOFT
|
||||
alMidiPlaySOFT
|
||||
alMidiResetSOFT
|
||||
alMidiSoundfontSOFT
|
||||
alMidiSoundfontvSOFT
|
||||
alMidiStopSOFT
|
||||
alMidiSysExSOFT
|
||||
alPresetFontsoundsSOFT
|
||||
alPresetiSOFT
|
||||
alPresetivSOFT
|
||||
alProcessUpdatesSOFT
|
||||
alSoundfontPresetsSOFT
|
||||
alSource3dSOFT
|
||||
alSource3f
|
||||
alSource3i
|
||||
@@ -175,7 +145,9 @@ EXPORTS
|
||||
alcGetIntegerv
|
||||
alcGetProcAddress
|
||||
alcGetString
|
||||
alcGetStringiSOFT
|
||||
alcGetThreadContext
|
||||
alcIsAmbisonicFormatSupportedSOFT
|
||||
alcIsExtensionPresent
|
||||
alcIsRenderFormatSupportedSOFT
|
||||
alcLoopbackOpenDeviceSOFT
|
||||
@@ -183,5 +155,6 @@ EXPORTS
|
||||
alcOpenDevice
|
||||
alcProcessContext
|
||||
alcRenderSamplesSOFT
|
||||
alcResetDeviceSOFT
|
||||
alcSetThreadContext
|
||||
alcSuspendContext
|
||||
|
||||
BIN
Binary file not shown.
Vendored
+1
-1
Submodule 3rdparty/hidapi updated: ca39ce8939...4c2750112e
Vendored
+1
-1
Submodule 3rdparty/libpng updated: 1dcba4d6eb...bbbcaf1122
+2
-2
@@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.1)
|
||||
|
||||
option(WITH_GDB "WITH_GDB" OFF)
|
||||
option(WITHOUT_LLVM "WITHOUT_LLVM" OFF)
|
||||
option(USE_NATIVE_INSTRUCTIONS "USE_NATIVE_INSTRUCTIONS makes rpcs3 compile with -march=native, which is useful for local builds, but not good for packages." ON)
|
||||
option(VULKAN_PREBUILT "" OFF)
|
||||
|
||||
if (WITH_GDB)
|
||||
add_definitions(-DWITH_GDB_DEBUGGER)
|
||||
@@ -35,8 +37,6 @@ if (NOT USE_SYSTEM_LIBPNG)
|
||||
add_subdirectory( 3rdparty/libpng )
|
||||
endif()
|
||||
|
||||
option(VULKAN_PREBUILT "" OFF)
|
||||
|
||||
# TODO: do real installation, including copying directory structure
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${PROJECT_BINARY_DIR}/bin")
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${PROJECT_BINARY_DIR}/bin")
|
||||
|
||||
@@ -20,15 +20,15 @@ If you want to contribute please take a look at the [Coding Style](https://githu
|
||||
## Dependencies
|
||||
|
||||
### Windows
|
||||
* [Visual Studio 2015](https://www.visualstudio.com/vs/older-downloads/)
|
||||
* [Visual C++ Redistributable Packages for Visual Studio 2015](http://www.microsoft.com/en-us/download/details.aspx?id=48145)
|
||||
* [Visual Studio 2017](https://www.visualstudio.com/en/downloads/)
|
||||
* [Visual C++ Redistributable Packages for Visual Studio 2017](https://go.microsoft.com/fwlink/?LinkId=746572)
|
||||
* [Cmake 3.1.0+](https://www.cmake.org/download/) (required; add to PATH)
|
||||
* [Python 3.3+](https://www.python.org/downloads/) (required; add to PATH)
|
||||
* [Qt 5.8+](https://www.qt.io/download-open-source/) (required; add QTDIR `<QtInstallFolder>\5.8\msvc2015_64\` environment variable if you do not want to use the Visual Studio Qt Plugin)
|
||||
* [Qt 5.10+](https://www.qt.io/download-open-source/) (required; add QTDIR environment variable if you do not want to use the Visual Studio Qt Plugin: e.g. `<QtInstallFolder>\5.10.1\msvc2017_64\`)
|
||||
* [Visual Studio Qt Plugin](https://marketplace.visualstudio.com/items?itemName=TheQtCompany.QtVisualStudioTools2015) (optional; see above)
|
||||
|
||||
### Linux
|
||||
* [Qt 5.7+](https://www.qt.io/download-open-source/)
|
||||
* [Qt 5.10+](https://www.qt.io/download-open-source/)
|
||||
* GCC 5.1+ or Clang 3.5.0+ ([not GCC 6.1](https://github.com/RPCS3/rpcs3/issues/1691))
|
||||
* Debian & Ubuntu: `sudo apt-get install cmake build-essential libasound2-dev libpulse-dev libopenal-dev libglew-dev zlib1g-dev libedit-dev libvulkan-dev libudev-dev git qt5-default`
|
||||
* Arch: `sudo pacman -S glew openal cmake llvm qt5-base`
|
||||
@@ -48,14 +48,14 @@ To initialize the repository don't forget to execute `git submodule update --ini
|
||||
### Configuring Qt
|
||||
|
||||
*If you're using Visual Studio 2017 without Qt plugin support (or simply dont want to use it):*
|
||||
1) Add `QTDIR` environment variable and set it to `<QtInstallFolder>\5.8\msvc2015_64\` </br>
|
||||
1) Add `QTDIR` environment variable and set it to e.g `<QtInstallFolder>\5.10.1\msvc2017_64\` </br>
|
||||
|
||||
|
||||
Open `rpcs3.sln`
|
||||
|
||||
|
||||
*If you wish to use the Visual Studio plugin for Qt:* </br>
|
||||
1) Go to the Qt5 menu and edit Qt5 options. Add the path to your Qt installation with compiler e.g. `C:\Qt\5.8\msvc2015_64`. </br>
|
||||
1) Go to the Qt5 menu and edit Qt5 options. Add the path to your Qt installation with compiler e.g. `C:\Qt\5.10.1\msvc2017_64`. </br>
|
||||
2) While selecting the rpcs3qt project, go to Qt5->Project Setting and select the version you added.
|
||||
|
||||
### Building the projects
|
||||
@@ -101,6 +101,9 @@ This Builds RPCS3 with support for debugging PS3 games using gdb.
|
||||
- ```-DUSE_VULKAN=ON/OFF``` (default = *ON*)
|
||||
This builds RPCS3 with Vulkan support.
|
||||
|
||||
- ```-DUSE_NATIVE_INSTRUCTIONS=ON/OFF``` (default = *ON*)
|
||||
This builds rpcs3 with -march=native, which is useful for local builds, but not good for packages.
|
||||
|
||||
## License
|
||||
|
||||
Most files are licensed under the terms of GNU GPLv2 License, see LICENSE file for details. Some files may be licensed differently, check appropriate file headers for details.
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "Emu/Cell/SPUThread.h"
|
||||
|
||||
#ifndef _WIN32
|
||||
#include"fcntl.h"
|
||||
#include "fcntl.h"
|
||||
#endif
|
||||
|
||||
extern void ppu_set_breakpoint(u32 addr);
|
||||
@@ -166,9 +166,10 @@ char GDBDebugServer::read_char()
|
||||
|
||||
u8 GDBDebugServer::read_hexbyte()
|
||||
{
|
||||
char buf[2];
|
||||
read(buf, 2);
|
||||
return static_cast<u8>(strtol(buf, nullptr, 16));
|
||||
std::string s = "";
|
||||
s += read_char();
|
||||
s += read_char();
|
||||
return hex_to_u8(s);
|
||||
}
|
||||
|
||||
void GDBDebugServer::try_read_cmd(gdb_cmd & out_cmd)
|
||||
@@ -176,7 +177,7 @@ void GDBDebugServer::try_read_cmd(gdb_cmd & out_cmd)
|
||||
char c = read_char();
|
||||
//interrupt
|
||||
if (UNLIKELY(c == 0x03)) {
|
||||
out_cmd.cmd = "\0x03";
|
||||
out_cmd.cmd = '\x03';
|
||||
out_cmd.data = "";
|
||||
out_cmd.checksum = 0;
|
||||
return;
|
||||
@@ -223,7 +224,7 @@ void GDBDebugServer::try_read_cmd(gdb_cmd & out_cmd)
|
||||
}
|
||||
out_cmd.checksum = read_hexbyte();
|
||||
if (out_cmd.checksum != checksum) {
|
||||
throw new wrong_checksum_exception("Wrong checksum for packet" HERE);
|
||||
throw wrong_checksum_exception("Wrong checksum for packet" HERE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -365,7 +366,7 @@ std::string GDBDebugServer::get_reg(std::shared_ptr<ppu_thread> thread, u32 rid)
|
||||
return std::string(8, 'x');
|
||||
default:
|
||||
if (rid > 70) return "";
|
||||
return (rid > 31)
|
||||
return (rid > 31)
|
||||
? u64_to_padded_hex(reinterpret_cast<u64&>(thread->fpr[rid - 32])) //fpr
|
||||
: u64_to_padded_hex(thread->gpr[rid]); //gpr
|
||||
}
|
||||
@@ -427,6 +428,25 @@ bool GDBDebugServer::send_reason()
|
||||
return send_cmd_ack("S05");
|
||||
}
|
||||
|
||||
void GDBDebugServer::wait_with_interrupts() {
|
||||
char c;
|
||||
while (!paused) {
|
||||
int result = recv(client_socket, &c, 1, 0);
|
||||
|
||||
if (result == SOCKET_ERROR) {
|
||||
if (check_errno_again()) {
|
||||
thread_ctrl::wait_for(50);
|
||||
continue;
|
||||
}
|
||||
|
||||
gdbDebugServer.error("Error during socket read");
|
||||
fmt::throw_exception("Error during socket read" HERE);
|
||||
} else if (c == 0x03) {
|
||||
paused = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool GDBDebugServer::cmd_extended_mode(gdb_cmd & cmd)
|
||||
{
|
||||
return send_cmd_ack("OK");
|
||||
@@ -453,24 +473,25 @@ bool GDBDebugServer::cmd_thread_info(gdb_cmd & cmd)
|
||||
result += u64_to_padded_hex(static_cast<u64>(cpu.id));
|
||||
};
|
||||
idm::select<ppu_thread>(on_select);
|
||||
idm::select<ARMv7Thread>(on_select);
|
||||
idm::select<RawSPUThread>(on_select);
|
||||
idm::select<SPUThread>(on_select);
|
||||
//idm::select<RawSPUThread>(on_select);
|
||||
//idm::select<SPUThread>(on_select);
|
||||
|
||||
//todo: this may exceed max command length
|
||||
result = "m" + result + "l";
|
||||
|
||||
|
||||
return send_cmd_ack(result);;
|
||||
}
|
||||
|
||||
bool GDBDebugServer::cmd_current_thread(gdb_cmd & cmd)
|
||||
{
|
||||
return send_cmd_ack(selected_thread.expired() ? "" : u64_to_padded_hex(selected_thread.lock()->id));
|
||||
return send_cmd_ack(selected_thread.expired() ? "" : ("QC" + u64_to_padded_hex(selected_thread.lock()->id)));
|
||||
}
|
||||
|
||||
bool GDBDebugServer::cmd_read_register(gdb_cmd & cmd)
|
||||
{
|
||||
select_thread(general_ops_thread_id);
|
||||
if (!select_thread(general_ops_thread_id)) {
|
||||
return send_cmd_ack("E02");
|
||||
}
|
||||
auto th = selected_thread.lock();
|
||||
if (th->id_type() == 1) {
|
||||
auto ppu = std::static_pointer_cast<ppu_thread>(th);
|
||||
@@ -488,7 +509,9 @@ bool GDBDebugServer::cmd_read_register(gdb_cmd & cmd)
|
||||
|
||||
bool GDBDebugServer::cmd_write_register(gdb_cmd & cmd)
|
||||
{
|
||||
select_thread(general_ops_thread_id);
|
||||
if (!select_thread(general_ops_thread_id)) {
|
||||
return send_cmd_ack("E02");
|
||||
}
|
||||
auto th = selected_thread.lock();
|
||||
if (th->id_type() == 1) {
|
||||
auto ppu = std::static_pointer_cast<ppu_thread>(th);
|
||||
@@ -517,7 +540,7 @@ bool GDBDebugServer::cmd_read_memory(gdb_cmd & cmd)
|
||||
std::string result;
|
||||
result.reserve(len * 2);
|
||||
for (u32 i = 0; i < len; ++i) {
|
||||
if (vm::check_addr(addr + i)) {
|
||||
if (vm::check_addr(addr, 1, vm::page_info_t::page_readable)) {
|
||||
result += to_hexbyte(vm::read8(addr + i));
|
||||
} else {
|
||||
break;
|
||||
@@ -543,7 +566,7 @@ bool GDBDebugServer::cmd_write_memory(gdb_cmd & cmd)
|
||||
u32 len = hex_to_u32(cmd.data.substr(s + 1, s2 - s - 1));
|
||||
const char* data_ptr = (cmd.data.c_str()) + s2 + 1;
|
||||
for (u32 i = 0; i < len; ++i) {
|
||||
if (vm::check_addr(addr + i)) {
|
||||
if (vm::check_addr(addr + i, 1, vm::page_info_t::page_writable)) {
|
||||
u8 val;
|
||||
int res = sscanf_s(data_ptr, "%02hhX", &val);
|
||||
if (!res) {
|
||||
@@ -634,30 +657,31 @@ bool GDBDebugServer::cmd_vcont(gdb_cmd & cmd)
|
||||
{
|
||||
//todo: handle multiple actions and thread ids
|
||||
this->from_breakpoint = false;
|
||||
if (cmd.data[1] == 'c') {
|
||||
if (cmd.data[1] == 'c' || cmd.data[1] == 's') {
|
||||
select_thread(continue_ops_thread_id);
|
||||
auto ppu = std::static_pointer_cast<ppu_thread>(selected_thread.lock());
|
||||
ppu->state -= cpu_flag::dbg_pause;
|
||||
if (Emu.IsPaused()) {
|
||||
Emu.Resume();
|
||||
paused = false;
|
||||
if (cmd.data[1] == 's') {
|
||||
ppu->state += cpu_flag::dbg_step;
|
||||
}
|
||||
thread_ctrl::wait();
|
||||
//we are in all-stop mode
|
||||
Emu.Pause();
|
||||
return send_reason();
|
||||
} else if (cmd.data[1] == 's') {
|
||||
select_thread(continue_ops_thread_id);
|
||||
auto ppu = std::static_pointer_cast<ppu_thread>(selected_thread.lock());
|
||||
ppu->state += cpu_flag::dbg_step;
|
||||
ppu->state -= cpu_flag::dbg_pause;
|
||||
//special case if app didn't start yet (only loaded)
|
||||
if (!Emu.IsPaused() && !Emu.IsRunning()) {
|
||||
Emu.Run();
|
||||
}
|
||||
if (Emu.IsPaused()) {
|
||||
Emu.Resume();
|
||||
} else {
|
||||
ppu->notify();
|
||||
}
|
||||
thread_ctrl::wait();
|
||||
wait_with_interrupts();
|
||||
//we are in all-stop mode
|
||||
Emu.Pause();
|
||||
select_thread(pausedBy);
|
||||
// we have to remove dbg_pause from thread that paused execution, otherwise
|
||||
// it will be paused forever (Emu.Resume only removes dbg_global_pause)
|
||||
ppu = std::static_pointer_cast<ppu_thread>(selected_thread.lock());
|
||||
ppu->state -= cpu_flag::dbg_pause;
|
||||
return send_reason();
|
||||
}
|
||||
return send_cmd_ack("");
|
||||
@@ -729,7 +753,9 @@ void GDBDebugServer::on_task()
|
||||
return;
|
||||
}
|
||||
//stop immediately
|
||||
Emu.Pause();
|
||||
if (Emu.IsRunning()) {
|
||||
Emu.Pause();
|
||||
}
|
||||
|
||||
try {
|
||||
char hostbuf[32];
|
||||
@@ -768,7 +794,7 @@ void GDBDebugServer::on_task()
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (std::runtime_error& e)
|
||||
catch (std::runtime_error& e)
|
||||
{
|
||||
if (client_socket) {
|
||||
closesocket(client_socket);
|
||||
@@ -805,6 +831,15 @@ void GDBDebugServer::on_stop()
|
||||
named_thread::on_stop();
|
||||
}
|
||||
|
||||
void GDBDebugServer::pause_from(cpu_thread* t) {
|
||||
if (paused) {
|
||||
return;
|
||||
}
|
||||
paused = true;
|
||||
pausedBy = t->id;
|
||||
notify();
|
||||
}
|
||||
|
||||
u32 g_gdb_debugger_id = 0;
|
||||
|
||||
#ifndef _WIN32
|
||||
|
||||
@@ -50,7 +50,7 @@ class GDBDebugServer : public named_thread {
|
||||
|
||||
//initialize server socket and start listening
|
||||
void start_server();
|
||||
//read at most cnt bytes to buf, returns nubmer of bytes actually read
|
||||
//read at most cnt bytes to buf, returns number of bytes actually read
|
||||
int read(void* buf, int cnt);
|
||||
//reads one character
|
||||
char read_char();
|
||||
@@ -90,6 +90,8 @@ class GDBDebugServer : public named_thread {
|
||||
//send reason of stop, returns false if sending response failed
|
||||
bool send_reason();
|
||||
|
||||
void wait_with_interrupts();
|
||||
|
||||
//commands
|
||||
bool cmd_extended_mode(gdb_cmd& cmd);
|
||||
bool cmd_reason(gdb_cmd& cmd);
|
||||
@@ -115,17 +117,24 @@ protected:
|
||||
void on_exit() override final;
|
||||
|
||||
public:
|
||||
static const u32 id_base = 1;
|
||||
static const u32 id_step = 1;
|
||||
static const u32 id_count = 0x100000;
|
||||
|
||||
bool from_breakpoint = true;
|
||||
bool stop = false;
|
||||
bool paused = false;
|
||||
u64 pausedBy;
|
||||
|
||||
virtual std::string get_name() const;
|
||||
virtual void on_stop() override final;
|
||||
void pause_from(cpu_thread* t);
|
||||
};
|
||||
|
||||
extern u32 g_gdb_debugger_id;
|
||||
|
||||
template <>
|
||||
struct id_manager::on_stop<GDBDebugServer> {
|
||||
static inline void func(GDBDebugServer* ptr)
|
||||
{
|
||||
if (ptr) ptr->on_stop();
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+3
-3
@@ -293,7 +293,7 @@ struct MemoryManager : llvm::RTDyldMemoryManager
|
||||
return RTDyldMemoryManager::registerEHFrames(addr, load_addr, size);
|
||||
}
|
||||
|
||||
void deregisterEHFrames(u8* addr, u64 load_addr, std::size_t size) override
|
||||
virtual void deregisterEHFrames() override
|
||||
{
|
||||
}
|
||||
};
|
||||
@@ -376,11 +376,11 @@ public:
|
||||
LOG_SUCCESS(GENERAL, "LLVM: Created module: %s", module->getName().data());
|
||||
}
|
||||
|
||||
static std::unique_ptr<llvm::MemoryBuffer> load(const std::string& path)
|
||||
static std::unique_ptr<llvm::WritableMemoryBuffer> load(const std::string& path)
|
||||
{
|
||||
if (fs::file cached{path, fs::read})
|
||||
{
|
||||
auto buf = llvm::MemoryBuffer::getNewUninitMemBuffer(cached.size());
|
||||
auto buf = llvm::WritableMemoryBuffer::getNewUninitMemBuffer(cached.size());
|
||||
cached.read(const_cast<char*>(buf->getBufferStart()), buf->getBufferSize());
|
||||
return buf;
|
||||
}
|
||||
|
||||
@@ -177,7 +177,6 @@ namespace logs
|
||||
channel HLE("HLE");
|
||||
channel PPU("PPU");
|
||||
channel SPU("SPU");
|
||||
channel ARMv7("ARMv7");
|
||||
|
||||
// Channel registry mutex
|
||||
semaphore<> g_mutex;
|
||||
|
||||
@@ -104,7 +104,6 @@ namespace logs
|
||||
extern channel HLE;
|
||||
extern channel PPU;
|
||||
extern channel SPU;
|
||||
extern channel ARMv7;
|
||||
|
||||
// Log level control: set all channels to level::notice
|
||||
void reset();
|
||||
|
||||
+31
-18
@@ -21,7 +21,7 @@
|
||||
#include <mach/thread_act.h>
|
||||
#include <mach/thread_policy.h>
|
||||
#endif
|
||||
#if defined(__DragonFly__) || defined(__FreeBSD__)
|
||||
#if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__OpenBSD__)
|
||||
#include <pthread_np.h>
|
||||
#define cpu_set_t cpuset_t
|
||||
#endif
|
||||
@@ -90,7 +90,7 @@ enum x64_reg_t : u32
|
||||
X64R_XMM13,
|
||||
X64R_XMM14,
|
||||
X64R_XMM15,
|
||||
|
||||
|
||||
X64R_AL,
|
||||
X64R_CL,
|
||||
X64R_DL,
|
||||
@@ -99,7 +99,7 @@ enum x64_reg_t : u32
|
||||
X64R_CH,
|
||||
X64R_DH,
|
||||
X64R_BH,
|
||||
|
||||
|
||||
X64_NOT_SET,
|
||||
X64_IMM8,
|
||||
X64_IMM16,
|
||||
@@ -176,7 +176,7 @@ void decode_x64_reg_op(const u8* code, x64_op_t& out_op, x64_reg_t& out_reg, siz
|
||||
{
|
||||
LOG_ERROR(MEMORY, "decode_x64_reg_op(%016llxh): LOCK prefix found twice", (size_t)code - out_length);
|
||||
}
|
||||
|
||||
|
||||
lock = true;
|
||||
continue;
|
||||
}
|
||||
@@ -186,7 +186,7 @@ void decode_x64_reg_op(const u8* code, x64_op_t& out_op, x64_reg_t& out_reg, siz
|
||||
{
|
||||
LOG_ERROR(MEMORY, "decode_x64_reg_op(%016llxh): REPNE/REPNZ prefix found twice", (size_t)code - out_length);
|
||||
}
|
||||
|
||||
|
||||
repne = true;
|
||||
continue;
|
||||
}
|
||||
@@ -196,7 +196,7 @@ void decode_x64_reg_op(const u8* code, x64_op_t& out_op, x64_reg_t& out_reg, siz
|
||||
{
|
||||
LOG_ERROR(MEMORY, "decode_x64_reg_op(%016llxh): REP/REPE/REPZ prefix found twice", (size_t)code - out_length);
|
||||
}
|
||||
|
||||
|
||||
repe = true;
|
||||
continue;
|
||||
}
|
||||
@@ -225,7 +225,7 @@ void decode_x64_reg_op(const u8* code, x64_op_t& out_op, x64_reg_t& out_reg, siz
|
||||
{
|
||||
LOG_ERROR(MEMORY, "decode_x64_reg_op(%016llxh): operand-size override prefix found twice", (size_t)code - out_length);
|
||||
}
|
||||
|
||||
|
||||
oso = true;
|
||||
continue;
|
||||
}
|
||||
@@ -917,7 +917,7 @@ bool get_x64_reg_value(x64_context* context, x64_reg_t reg, size_t d_size, size_
|
||||
else if (reg == X64_IMM32)
|
||||
{
|
||||
const s32 imm_value = *(s32*)(RIP(context) + i_size - 4);
|
||||
|
||||
|
||||
switch (d_size)
|
||||
{
|
||||
case 4: out_value = (u32)imm_value; return true;
|
||||
@@ -1254,7 +1254,7 @@ bool handle_access_violation(u32 addr, bool is_writing, x64_context* context)
|
||||
}
|
||||
if (entry.start_addr <= addr && addr <= addr + mem->size - 1)
|
||||
{
|
||||
// Place the page fault event onto table so that other functions [sys_mmapper_free_address and ppu pagefault funcs]
|
||||
// Place the page fault event onto table so that other functions [sys_mmapper_free_address and ppu pagefault funcs]
|
||||
// know that this thread is page faulted and where.
|
||||
|
||||
auto pf_entries = fxm::get_always<page_fault_event_entries>();
|
||||
@@ -1274,7 +1274,7 @@ bool handle_access_violation(u32 addr, bool is_writing, x64_context* context)
|
||||
addr, data3 == SYS_MEMORY_PAGE_FAULT_CAUSE_READ_ONLY ? "writing read-only" : "using unmapped");
|
||||
|
||||
error_code sending_error = sys_event_port_send(entry.port_id, data1, data2, data3);
|
||||
|
||||
|
||||
// If we fail due to being busy, wait a bit and try again.
|
||||
while (sending_error == CELL_EBUSY)
|
||||
{
|
||||
@@ -1282,7 +1282,7 @@ bool handle_access_violation(u32 addr, bool is_writing, x64_context* context)
|
||||
thread_ctrl::wait_for(1000);
|
||||
sending_error = sys_event_port_send(entry.port_id, data1, data2, data3);
|
||||
}
|
||||
|
||||
|
||||
if (sending_error)
|
||||
{
|
||||
fmt::throw_exception("Unknown error %x while trying to pass page fault.", sending_error.value);
|
||||
@@ -1295,6 +1295,7 @@ bool handle_access_violation(u32 addr, bool is_writing, x64_context* context)
|
||||
}
|
||||
}
|
||||
|
||||
vm::temporary_unlock(*cpu);
|
||||
LOG_FATAL(MEMORY, "Access violation %s location 0x%x", is_writing ? "writing" : "reading", addr);
|
||||
cpu->state += cpu_flag::dbg_pause;
|
||||
cpu->check_state();
|
||||
@@ -1638,6 +1639,16 @@ void thread_ctrl::initialize()
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE__)
|
||||
pthread_setname_np(m_name.substr(0, 15).c_str());
|
||||
#elif defined(__DragonFly__) || defined(__FreeBSD__) || defined(__OpenBSD__)
|
||||
pthread_set_name_np(pthread_self(), m_name.c_str());
|
||||
#elif defined(__NetBSD__)
|
||||
pthread_setname_np(pthread_self(), "%s", (void*)m_name.c_str());
|
||||
#elif !defined(_WIN32)
|
||||
pthread_setname_np(pthread_self(), m_name.substr(0, 15).c_str());
|
||||
#endif
|
||||
}
|
||||
|
||||
void thread_ctrl::finalize(std::exception_ptr eptr) noexcept
|
||||
@@ -1707,7 +1718,7 @@ bool thread_ctrl::_wait_for(u64 usec)
|
||||
}
|
||||
}
|
||||
_lock{_this->m_mutex};
|
||||
|
||||
|
||||
do
|
||||
{
|
||||
// Mutex is unlocked at the start and after the waiting
|
||||
@@ -1890,32 +1901,34 @@ u16 thread_ctrl::get_affinity_mask(thread_class group)
|
||||
}
|
||||
case native_core_arrangement::amd_ccx:
|
||||
{
|
||||
u16 spu_mask, ppu_mask, rsx_mask;
|
||||
u16 spu_mask, ppu_mask, rsx_mask, general;
|
||||
if (thread_count >= 16)
|
||||
{
|
||||
// Threadripper, R7
|
||||
// Assign threads 8-16
|
||||
// Assign threads 1-16
|
||||
// It appears some windows code is bound to lower core addresses, binding 8-16 is alot faster than 0-7
|
||||
ppu_mask = spu_mask = 0b1111111100000000;
|
||||
rsx_mask = all_cores_mask;
|
||||
rsx_mask = 0b11110000;
|
||||
general = 0b00001111;
|
||||
}
|
||||
else if (thread_count == 12)
|
||||
{
|
||||
// 1600/2600 (x)
|
||||
ppu_mask = spu_mask = 0b111111000000;
|
||||
rsx_mask = all_cores_mask;
|
||||
rsx_mask = 0b111000;
|
||||
general = 0b000111;
|
||||
}
|
||||
else
|
||||
{
|
||||
// R5 & R3 don't seem to improve performance no matter how these are shuffled
|
||||
ppu_mask = spu_mask = rsx_mask = 0b11111111 & all_cores_mask;
|
||||
ppu_mask = spu_mask = rsx_mask = general = 0b11111111;
|
||||
}
|
||||
|
||||
switch (group)
|
||||
{
|
||||
default:
|
||||
case thread_class::general:
|
||||
return all_cores_mask;
|
||||
return general = all_cores_mask;
|
||||
case thread_class::rsx:
|
||||
return rsx_mask;
|
||||
case thread_class::ppu:
|
||||
|
||||
+4
-4
@@ -64,7 +64,7 @@ void shared_mutex::imp_lock_shared(s64 _old)
|
||||
|
||||
if (value0 >= c_min)
|
||||
{
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
// Acquire writer lock
|
||||
@@ -79,7 +79,7 @@ void shared_mutex::imp_lock_shared(s64 _old)
|
||||
}
|
||||
|
||||
value1 += c_one - c_min;
|
||||
|
||||
|
||||
if (value1 > 0)
|
||||
{
|
||||
return;
|
||||
@@ -109,7 +109,7 @@ void shared_mutex::imp_lock_shared(s64 _old)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
imp_unlock_shared(value2);
|
||||
}
|
||||
#endif
|
||||
@@ -300,7 +300,7 @@ safe_writer_lock::safe_writer_lock(shared_mutex& mutex)
|
||||
|
||||
if (m_is_owned)
|
||||
{
|
||||
m_mutex.lock_shared();
|
||||
m_mutex.lock();
|
||||
g_tls_locks.emplace_back(&m_mutex);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<PropertyGroup Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
|
||||
Submodule Vulkan/Vulkan-LoaderAndValidationLayers updated: 28d93dfc0f...354ad3ba8b
@@ -19,12 +19,12 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Makefile</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Makefile</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
@@ -40,23 +40,23 @@
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<NMakeBuildCommandLine>start /W /B pre-build.bat
|
||||
cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DBUILD_TESTS=OFF -DBUILD_DEMOS=OFF -DBUILD_LAYERS=OFF -DBUILD_VKJSON=OFF ../Vulkan-LoaderAndValidationLayers
|
||||
cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DBUILD_TESTS=OFF -DBUILD_DEMOS=OFF -DBUILD_LAYERS=OFF -DBUILD_VKJSON=OFF ../Vulkan-LoaderAndValidationLayers
|
||||
msbuild.exe ALL_BUILD.vcxproj /t:build /p:Configuration=Release /m</NMakeBuildCommandLine>
|
||||
<NMakeCleanCommandLine>cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DBUILD_TESTS=OFF -DBUILD_DEMOS=OFF -DBUILD_LAYERS=OFF -DBUILD_VKJSON=OFF ../Vulkan-LoaderAndValidationLayers
|
||||
<NMakeCleanCommandLine>cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DBUILD_TESTS=OFF -DBUILD_DEMOS=OFF -DBUILD_LAYERS=OFF -DBUILD_VKJSON=OFF ../Vulkan-LoaderAndValidationLayers
|
||||
msbuild.exe ALL_BUILD.vcxproj /t:clean /p:Configuration=Release /m</NMakeCleanCommandLine>
|
||||
<NMakeReBuildCommandLine>start /W /B pre-build.bat
|
||||
cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DBUILD_TESTS=OFF -DBUILD_DEMOS=OFF -DBUILD_LAYERS=OFF -DBUILD_VKJSON=OFF ../Vulkan-LoaderAndValidationLayers
|
||||
cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DBUILD_TESTS=OFF -DBUILD_DEMOS=OFF -DBUILD_LAYERS=OFF -DBUILD_VKJSON=OFF ../Vulkan-LoaderAndValidationLayers
|
||||
msbuild.exe ALL_BUILD.vcxproj /t:rebuild /p:Configuration=Release /m
|
||||
</NMakeReBuildCommandLine>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<NMakeBuildCommandLine>start /W /B pre-build.bat
|
||||
cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DBUILD_TESTS=OFF -DBUILD_DEMOS=OFF -DBUILD_LAYERS=OFF -DBUILD_VKJSON=OFF ../Vulkan-LoaderAndValidationLayers
|
||||
cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DBUILD_TESTS=OFF -DBUILD_DEMOS=OFF -DBUILD_LAYERS=OFF -DBUILD_VKJSON=OFF ../Vulkan-LoaderAndValidationLayers
|
||||
msbuild.exe ALL_BUILD.vcxproj /t:build /p:Configuration=Debug /m</NMakeBuildCommandLine>
|
||||
<NMakeReBuildCommandLine>start /W /B pre-build.bat
|
||||
cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DBUILD_TESTS=OFF -DBUILD_DEMOS=OFF -DBUILD_LAYERS=OFF -DBUILD_VKJSON=OFF ../Vulkan-LoaderAndValidationLayers
|
||||
cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DBUILD_TESTS=OFF -DBUILD_DEMOS=OFF -DBUILD_LAYERS=OFF -DBUILD_VKJSON=OFF ../Vulkan-LoaderAndValidationLayers
|
||||
msbuild.exe ALL_BUILD.vcxproj /t:rebuild /p:Configuration=Debug /m</NMakeReBuildCommandLine>
|
||||
<NMakeCleanCommandLine>cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DBUILD_TESTS=OFF -DBUILD_DEMOS=OFF -DBUILD_LAYERS=OFF -DBUILD_VKJSON=OFF ../Vulkan-LoaderAndValidationLayers
|
||||
<NMakeCleanCommandLine>cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DBUILD_TESTS=OFF -DBUILD_DEMOS=OFF -DBUILD_LAYERS=OFF -DBUILD_VKJSON=OFF ../Vulkan-LoaderAndValidationLayers
|
||||
msbuild.exe ALL_BUILD.vcxproj /t:clean /p:Configuration=Debug /m</NMakeCleanCommandLine>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup>
|
||||
|
||||
@@ -19,12 +19,12 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Makefile</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Makefile</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
@@ -39,24 +39,24 @@
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<NMakeBuildCommandLine>cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" ../glslang
|
||||
<NMakeBuildCommandLine>cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" ../glslang
|
||||
msbuild.exe ALL_BUILD.vcxproj /t:build /p:Configuration=Release /m</NMakeBuildCommandLine>
|
||||
<NMakeReBuildCommandLine>cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" ../glslang
|
||||
<NMakeReBuildCommandLine>cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" ../glslang
|
||||
msbuild.exe ALL_BUILD.vcxproj /t:rebuild /p:Configuration=Release /m</NMakeReBuildCommandLine>
|
||||
<NMakeCleanCommandLine>cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" ../glslang
|
||||
<NMakeCleanCommandLine>cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" ../glslang
|
||||
msbuild.exe ALL_BUILD.vcxproj /t:clean /p:Configuration=Release /m</NMakeCleanCommandLine>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<NMakeBuildCommandLine>
|
||||
cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" ../glslang
|
||||
cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" ../glslang
|
||||
msbuild.exe ALL_BUILD.vcxproj /t:build /p:Configuration=Debug /m
|
||||
</NMakeBuildCommandLine>
|
||||
<NMakeReBuildCommandLine>
|
||||
cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" ../glslang
|
||||
cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" ../glslang
|
||||
msbuild.exe ALL_BUILD.vcxproj /t:rebuild /p:Configuration=Debug /m
|
||||
</NMakeReBuildCommandLine>
|
||||
<NMakeCleanCommandLine>
|
||||
cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" ../glslang
|
||||
cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" ../glslang
|
||||
msbuild.exe ALL_BUILD.vcxproj /t:clean /p:Configuration=Debug /m
|
||||
</NMakeCleanCommandLine>
|
||||
</PropertyGroup>
|
||||
|
||||
+15
-9
@@ -1,10 +1,10 @@
|
||||
|
||||
version: '{build}'
|
||||
|
||||
image: Visual Studio 2015
|
||||
image: Visual Studio 2017
|
||||
|
||||
environment:
|
||||
QTDIR: C:\Qt\5.10.0\msvc2015_64
|
||||
QTDIR: C:\Qt\5.10\msvc2017_64
|
||||
LLVMLIBS: https://drive.google.com/uc?export=download&id=0B8A6NaxhQAGRY2k3Q2Yya05lcm8
|
||||
VULKAN: https://drive.google.com/uc?export=download&id=1A2eOMmCO714i0U7J0qI4aEMKnuWl8l_R
|
||||
COMPATDB: https://rpcs3.net/compatibility?api=v1&export
|
||||
@@ -16,12 +16,18 @@ cache:
|
||||
|
||||
install:
|
||||
- ps: | # set env vars for versioning
|
||||
$commDate = $env:APPVEYOR_REPO_COMMIT_TIMESTAMP.Substring(0,10)
|
||||
$commSha = $env:APPVEYOR_REPO_COMMIT.Substring(0,8)
|
||||
$commTag = $(git describe --tags $(git rev-list --tags --max-count=1))
|
||||
$env:COMM_TAG = $(git describe --tags $(git rev-list --tags --max-count=1))
|
||||
$env:COMM_COUNT = $(git rev-list --count HEAD)
|
||||
$env:COMM_HASH = $env:APPVEYOR_REPO_COMMIT.Substring(0,8)
|
||||
|
||||
$env:AVVER = "{0}-{1}" -f $commTag.TrimStart("v"), $env:APPVEYOR_BUILD_NUMBER
|
||||
$env:BUILD = "rpcs3-{0}-{1}-{2}_win64.7z" -f $commTag, $commDate, $commSha
|
||||
if ($env:APPVEYOR_PULL_REQUEST_NUMBER) {
|
||||
$env:BUILD = "rpcs3-{0}-{1}_win64.7z" -f $env:COMM_TAG, $env:COMM_HASH
|
||||
$env:AVVER = "{0}-{1}" -f $env:COMM_TAG.TrimStart("v"), $env:COMM_HASH
|
||||
}
|
||||
else {
|
||||
$env:BUILD = "rpcs3-{0}-{1}-{2}_win64.7z" -f $env:COMM_TAG, $env:COMM_COUNT, $env:COMM_HASH
|
||||
$env:AVVER = "{0}-{1}" -f $env:COMM_TAG.TrimStart("v"), $env:COMM_COUNT
|
||||
}
|
||||
|
||||
- ps: | # used for experimental build warnings for pr builds
|
||||
$env:BRANCH = "{0}/{1}/#{2}" -f $env:APPVEYOR_REPO_NAME, `
|
||||
@@ -80,8 +86,8 @@ after_build:
|
||||
C:\OpenSSL-Win64\bin\ssleay32.dll
|
||||
|
||||
- ps: | # generate sha256 hashes
|
||||
(Get-FileHash $env:BUILD -Algorithm SHA256).Hash | Out-File -encoding ASCII "$($env:BUILD).sha256"
|
||||
(Get-FileHash openssl_win64.7z -Algorithm SHA256).Hash | Out-File -encoding ASCII "openssl_win64.7z.sha256"
|
||||
(get-filehash $env:BUILD -algorithm SHA256).Hash | out-file ("{0}.sha256" -f $env:BUILD) -encoding ascii
|
||||
(get-filehash openssl_win64.7z -algorithm SHA256).Hash | out-file "openssl_win64.7z.sha256" -encoding ascii
|
||||
|
||||
test: off
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
<PropertyGroup Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
|
||||
@@ -244,9 +244,6 @@ QToolButton::hover {
|
||||
QLabel#gamelist_icon_background_color {
|
||||
color: transparent;
|
||||
}
|
||||
QLabel#gamelist_toolbar_icon_color {
|
||||
color: #828790;
|
||||
}
|
||||
|
||||
/* Set Windows Taskbar Thumbnail colors */
|
||||
QLabel#thumbnail_icon_color {
|
||||
|
||||
@@ -243,9 +243,6 @@ QToolButton::hover {
|
||||
QLabel#gamelist_icon_background_color {
|
||||
color: transparent;
|
||||
}
|
||||
QLabel#gamelist_toolbar_icon_color {
|
||||
color: #828790;
|
||||
}
|
||||
|
||||
/* Set Windows Taskbar Thumbnail colors */
|
||||
QLabel#thumbnail_icon_color {
|
||||
|
||||
@@ -241,9 +241,6 @@ QToolButton::hover {
|
||||
QLabel#gamelist_icon_background_color {
|
||||
color: transparent;
|
||||
}
|
||||
QLabel#gamelist_toolbar_icon_color {
|
||||
color: #828790;
|
||||
}
|
||||
|
||||
/* Set Windows Taskbar Thumbnail colors */
|
||||
QLabel#thumbnail_icon_color {
|
||||
|
||||
@@ -0,0 +1,440 @@
|
||||
/*
|
||||
YoRHa Theme for RPCS3
|
||||
by Ani @ https://github.com/AniLeo
|
||||
r1 (2018.02.27)
|
||||
*/
|
||||
|
||||
/*
|
||||
Color Scheme
|
||||
|
||||
- Pod Programs
|
||||
8c806a
|
||||
bd9d86
|
||||
c1b398
|
||||
eadfb1
|
||||
ebe4d2
|
||||
|
||||
- Light
|
||||
b3ac98
|
||||
aea993
|
||||
|
||||
- Dark
|
||||
4d4940
|
||||
*/
|
||||
|
||||
|
||||
/* Every widget */
|
||||
QWidget {
|
||||
font-family: SCE-PS3 Rodin LATIN, Arial;
|
||||
font-size: 9.00pt;
|
||||
|
||||
color: #292929;
|
||||
background: transparent;
|
||||
alternate-background-color: transparent;
|
||||
}
|
||||
|
||||
|
||||
/* Debugger: Sets font-family to default (any invalid value could be provided) */
|
||||
#debugger QListWidget, #debugger QTextEdit {
|
||||
font-family: none;
|
||||
}
|
||||
|
||||
|
||||
/* Log+TTY: Use flat dark color background with default font for better readability */
|
||||
#log_frame, #tty_frame {
|
||||
background: rgba(52, 49, 40, 0.9);
|
||||
font-size: 8.50pt;
|
||||
font-family: none;
|
||||
}
|
||||
|
||||
|
||||
/* Debugger: Restore original font size */
|
||||
#debugger QListWidget, #debugger QTextEdit {
|
||||
font-size: 9.50pt;
|
||||
}
|
||||
|
||||
|
||||
/* LLE: Style QListWidget checkboxes (QListWidget) */
|
||||
#lleList::indicator {
|
||||
border: 0.05em solid #4d4940;
|
||||
}
|
||||
#lleList::indicator::unchecked {
|
||||
background-color: #b3ac98;
|
||||
}
|
||||
#lleList::indicator::checked {
|
||||
background-color: #4d4940;
|
||||
}
|
||||
#lleList::indicator::disabled {
|
||||
background-color: #828790;
|
||||
}
|
||||
#lleList::item::selected {
|
||||
color: #4d4940;
|
||||
}
|
||||
|
||||
|
||||
/* Mouse Tooltips */
|
||||
QToolTip {
|
||||
background-color: #b3ac98;
|
||||
color: #4d4940;
|
||||
border: 0.10em solid #4d4940;
|
||||
}
|
||||
|
||||
|
||||
/* CG Disasm: background-image doesn't work, use static color */
|
||||
QWidget#cg_disasm {
|
||||
background: #b3ac98;
|
||||
}
|
||||
|
||||
|
||||
/* Main Window, Dialogs and Trophy Manager which isn't a dialog */
|
||||
QDialog, QWidget#trophy_manager, QMainWindow#main_window {
|
||||
border-image: url("GuiConfigs/YoRHa-background.jpg");
|
||||
}
|
||||
|
||||
|
||||
/* Table headers */
|
||||
QHeaderView::section {
|
||||
text-transform: uppercase;
|
||||
background: #4d4940;
|
||||
color: #b3ac98;
|
||||
padding-left: 0.15em;
|
||||
padding-top: 0.15em;
|
||||
padding-bottom: 0.10em;
|
||||
text-transform: uppercase;
|
||||
border: none;
|
||||
}
|
||||
|
||||
|
||||
/* All other Tabs */
|
||||
QTabBar {
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
QTabBar::tab {
|
||||
background: transparent;
|
||||
padding-left: 0.50em;
|
||||
padding-right: 0.50em;
|
||||
padding-top: 0.25em;
|
||||
padding-bottom: 0.25em;
|
||||
margin-right: 0.25em;
|
||||
}
|
||||
QTabBar::tab::selected {
|
||||
background: #4d4940;
|
||||
color: #aea993;
|
||||
border-bottom-style: solid;
|
||||
}
|
||||
|
||||
|
||||
/* Settings Dialog: Tabs */
|
||||
QTabBar#tab_bar_settings {
|
||||
border-bottom: 0.05em solid #4d4940;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
QTabBar::tab#tab_bar_settings {
|
||||
background: transparent;
|
||||
width: 5.20em;
|
||||
padding-left: 0.50em;
|
||||
padding-right: 0.50em;
|
||||
padding-top: 0.65em;
|
||||
padding-bottom: 0.65em;
|
||||
margin-right: 0.25em;
|
||||
font-size: 10.5pt;
|
||||
font-weight: 550;
|
||||
}
|
||||
QTabBar::tab:last#tab_bar_settings {
|
||||
margin-right: 0em;
|
||||
}
|
||||
QTabBar::tab:!selected:hover#tab_bar_settings {
|
||||
background: transparent;
|
||||
color: #4d4940;
|
||||
}
|
||||
QTabBar::tab::selected#tab_bar_settings {
|
||||
background: #4d4940;
|
||||
color: #aea993;
|
||||
border-bottom-style: solid;
|
||||
margin-top: 0.15em;
|
||||
}
|
||||
|
||||
|
||||
/* Checkboxes */
|
||||
QCheckBox::indicator {
|
||||
border-radius: 0.1em;
|
||||
border: 0.05em solid #4d4940;
|
||||
margin-top: 0.05em;
|
||||
width: 0.8em;
|
||||
height: 0.8em;
|
||||
}
|
||||
QCheckBox::indicator:checked {
|
||||
background-color: #4d4940; /* Dark */
|
||||
}
|
||||
QCheckBox::indicator:unchecked {
|
||||
background-color: #b3ac98; /* Light */
|
||||
}
|
||||
QCheckBox::indicator::disabled {
|
||||
background-color: #828790; /* Gray */
|
||||
}
|
||||
|
||||
|
||||
/* Radio Buttons */
|
||||
QRadioButton::indicator {
|
||||
border-radius: 0.4em;
|
||||
border: 0.05em solid #4d4940;
|
||||
width: 0.8em;
|
||||
height: 0.8em;
|
||||
}
|
||||
QRadioButton::indicator:checked {
|
||||
background-color: #4d4940; /* Dark */
|
||||
}
|
||||
QRadioButton::indicator:unchecked {
|
||||
background-color: #b3ac98; /* Light */
|
||||
}
|
||||
QRadioButton::indicator::disabled {
|
||||
background-color: #828790; /* Gray */
|
||||
}
|
||||
|
||||
|
||||
/* Combo Boxes */
|
||||
QComboBox {
|
||||
background: transparent;
|
||||
color: #4d4940;
|
||||
border: 0.05em solid #1e1e1e;
|
||||
border-radius: 0.15em;
|
||||
padding-bottom: 0.2em;
|
||||
padding-left: 0.4em;
|
||||
}
|
||||
QComboBox QAbstractItemView {
|
||||
background: #b3ac98;
|
||||
}
|
||||
QComboBox::disabled {
|
||||
background: #828790;
|
||||
color: #4d4940;
|
||||
}
|
||||
|
||||
|
||||
/* Group Boxes (Settings Dialog) */
|
||||
QGroupBox {
|
||||
margin-top: 1em;
|
||||
border: 0.05em solid #4d4940;
|
||||
text-transform: uppercase;
|
||||
font-size: 9.25pt;
|
||||
}
|
||||
QGroupBox::title {
|
||||
subcontrol-origin: margin;
|
||||
subcontrol-position: top;
|
||||
padding: 0.3em 0.5em 0.3em 0.5em;
|
||||
color: #4d4940;
|
||||
}
|
||||
|
||||
|
||||
/* Buttons */
|
||||
QPushButton {
|
||||
background: #b3ac98;
|
||||
}
|
||||
QPushButton::disabled {
|
||||
background: #828790;
|
||||
}
|
||||
|
||||
|
||||
/* QSpinBox (Settings -> Emulator -> width/height) */
|
||||
QSpinBox {
|
||||
/* background: transparent; - This hits a weird bug in Qt where background flickers */
|
||||
background-color: #b3ac98;
|
||||
border: 0.05em solid #4d4940;
|
||||
border-radius: 0.10em;
|
||||
}
|
||||
|
||||
|
||||
/* Styles Sliders */
|
||||
QSlider::groove:horizontal {
|
||||
border: 0.10em solid #4d4940;
|
||||
border-radius: 0.10em;
|
||||
}
|
||||
QSlider::handle:horizontal {
|
||||
background: #4d4940;
|
||||
width: 0.50em;
|
||||
}
|
||||
|
||||
|
||||
/* Log and Debugger borders */
|
||||
QTextEdit {
|
||||
border: 0.05em solid #4d4940;
|
||||
}
|
||||
|
||||
|
||||
/* For dock buttons to be visible */
|
||||
QDockWidget {
|
||||
background: transparent;
|
||||
text-transform: uppercase;
|
||||
color: #b3ac98;
|
||||
font-weight: 500;
|
||||
}
|
||||
[floating="true"] {
|
||||
border-image: url("GuiConfigs/YoRHa-background.jpg");
|
||||
}
|
||||
QDockWidget::title {
|
||||
background: #4d4940;
|
||||
padding-top: 0.2em;
|
||||
}
|
||||
QDockWidget::close-button, QDockWidget::float-button {
|
||||
background-color: #b3ac98;
|
||||
}
|
||||
|
||||
|
||||
/* Disable ugly borders */
|
||||
QTabWidget::pane {
|
||||
border: 0em solid #4d4940;
|
||||
}
|
||||
|
||||
|
||||
/* Top menu bar */
|
||||
QMenuBar {
|
||||
height:1.50em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
QMenuBar::item {
|
||||
margin-right: 0.20em;
|
||||
margin-left: 0.20em;
|
||||
padding-left: 1.20em;
|
||||
padding-right: 1.20em;
|
||||
}
|
||||
QMenuBar::item:selected {
|
||||
background: #4d4940;
|
||||
color: #aea993
|
||||
}
|
||||
|
||||
|
||||
QMenu {
|
||||
background: #b3ac98;
|
||||
color: #4d4940;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
QMenu::item {
|
||||
padding-left: 1.5em;
|
||||
padding-right: 0.75em;
|
||||
padding-top: 0.25em;
|
||||
padding-bottom: 0.25em;
|
||||
|
||||
}
|
||||
QMenu::item:selected {
|
||||
background: #4d4940;
|
||||
color: #aea993;
|
||||
border: 0.05em solid #4d4940;
|
||||
}
|
||||
QMenu::item:disabled {
|
||||
background-color: #828790;
|
||||
color: #4d4940;
|
||||
}
|
||||
|
||||
|
||||
/* Pad Settings: Controller Image */
|
||||
QLabel#l_controller {
|
||||
color: #4d4940;
|
||||
}
|
||||
|
||||
|
||||
/* Game Grid Font */
|
||||
QLabel#gamegrid_font {
|
||||
font-weight: 600;
|
||||
color: #4d4940;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
|
||||
/* Debug UI Settings buttons */
|
||||
QLabel#color_button {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
|
||||
/* Searchbar on main Toolbar */
|
||||
QLineEdit#mw_searchbar {
|
||||
margin-left: 0.7em;
|
||||
color: #4d4940;
|
||||
font-size: 10.25pt;
|
||||
}
|
||||
|
||||
|
||||
/* Uniform colors in Toolbar */
|
||||
QToolButton {
|
||||
background: transparent;
|
||||
color: transparent;
|
||||
}
|
||||
QToolButton::hover {
|
||||
background-color: #b3ac98;
|
||||
}
|
||||
|
||||
|
||||
/* Set Theme UI colors */
|
||||
QLabel#gamelist_icon_background_color {
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
|
||||
/* Set Windows Taskbar Thumbnail colors */
|
||||
QLabel#thumbnail_icon_color {
|
||||
color: #4d4940;
|
||||
}
|
||||
|
||||
|
||||
QLabel#log_level_always {
|
||||
color: #00ffff; /* Cyan */
|
||||
}
|
||||
QLabel#log_level_fatal {
|
||||
color: #ff00ff; /* Fuchsia */
|
||||
}
|
||||
QLabel#log_level_error {
|
||||
color: #ff0000; /* Red */
|
||||
}
|
||||
QLabel#log_level_todo {
|
||||
color: #ff6000; /* Orange */
|
||||
}
|
||||
QLabel#log_level_success {
|
||||
color: #00ff00; /* Green */
|
||||
}
|
||||
QLabel#log_level_warning {
|
||||
color: #ffff00; /* Yellow */
|
||||
}
|
||||
QLabel#log_level_notice {
|
||||
color: #ffffff; /* White */
|
||||
}
|
||||
QLabel#log_level_trace {
|
||||
color: #808080; /* Gray */
|
||||
}
|
||||
QLabel#log_stack {
|
||||
color: #b3ac98; /* Light */
|
||||
}
|
||||
|
||||
/* Set TTY colors */
|
||||
#tty_frame {
|
||||
color: #b3ac98; /* Light */
|
||||
}
|
||||
|
||||
|
||||
/* Memory Viewer */
|
||||
QLabel#memory_viewer_address_panel {
|
||||
color: #0000ff; /* Font Color: Blue */
|
||||
}
|
||||
QLabel#memory_viewer_hex_panel {
|
||||
color: #4d4940; /* Font Color: Grey */
|
||||
}
|
||||
QLabel#memory_viewer_ascii_panel {
|
||||
color: #4d4940; /* Font Color: Grey */
|
||||
}
|
||||
|
||||
|
||||
/* Debugger colors */
|
||||
QLabel#debugger_frame_breakpoint {
|
||||
color: #000000; /* Font Color: Black */
|
||||
background-color: #ffff00; /* Yellow */
|
||||
}
|
||||
QLabel#debugger_frame_pc {
|
||||
color: #000000; /* Font Color: Black */
|
||||
background-color: #00ff00; /* Green */
|
||||
}
|
||||
|
||||
|
||||
/* Trophy Notification Popup */
|
||||
QWidget#trophy_notification_frame {
|
||||
background-color: #b3ac98;
|
||||
color: #4d4940;
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 564 KiB |
Binary file not shown.
+1
-1
Submodule llvm updated: 4423e35117...fde9f2060a
@@ -1,7 +1,7 @@
|
||||
REM You need cmake and python to update the project files
|
||||
REM this script relies on CWD being the path that this script is in
|
||||
|
||||
cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_TOOLS=OFF -DLLVM_INCLUDE_UTILS=OFF -DWITH_POLLY=OFF -DCMAKE_SYSTEM_VERSION=6.1 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=8.1 ../llvm
|
||||
cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_EXTERNAL_POLLY_SOURCE_DIR=../polly -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_TOOLS=ON -DLLVM_INCLUDE_UTILS=ON -DWITH_POLLY=ON -DCMAKE_SYSTEM_VERSION=6.1 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=8.1 ../llvm
|
||||
|
||||
RD /S /Q cmake
|
||||
RD /S /Q CMakeFiles
|
||||
|
||||
@@ -18,12 +18,12 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Makefile</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Makefile</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
@@ -39,30 +39,30 @@
|
||||
<NMakePreprocessorDefinitions>
|
||||
</NMakePreprocessorDefinitions>
|
||||
<NMakeBuildCommandLine>
|
||||
cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_TOOLS=OFF -DLLVM_INCLUDE_UTILS=OFF -DWITH_POLLY=OFF -DCMAKE_SYSTEM_VERSION=6.1 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=8.1 ../llvm
|
||||
cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_EXTERNAL_POLLY_SOURCE_DIR=../polly -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_TOOLS=ON -DLLVM_INCLUDE_UTILS=ON -DWITH_POLLY=ON -DCMAKE_SYSTEM_VERSION=6.1 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=8.1 ../llvm
|
||||
msbuild.exe ALL_BUILD.vcxproj /t:build /p:Configuration=Debug /m
|
||||
</NMakeBuildCommandLine>
|
||||
<NMakeReBuildCommandLine>
|
||||
cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_TOOLS=OFF -DLLVM_INCLUDE_UTILS=OFF -DWITH_POLLY=OFF -DCMAKE_SYSTEM_VERSION=6.1 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=8.1 ../llvm
|
||||
cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_EXTERNAL_POLLY_SOURCE_DIR=../polly -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_TOOLS=ON -DLLVM_INCLUDE_UTILS=ON -DWITH_POLLY=ON -DCMAKE_SYSTEM_VERSION=6.1 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=8.1 ../llvm
|
||||
msbuild.exe ALL_BUILD.vcxproj /t:rebuild /p:Configuration=Debug /m
|
||||
</NMakeReBuildCommandLine>
|
||||
<NMakeCleanCommandLine>
|
||||
cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_TOOLS=OFF -DLLVM_INCLUDE_UTILS=OFF -DWITH_POLLY=OFF -DCMAKE_SYSTEM_VERSION=6.1 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=8.1 ../llvm
|
||||
cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_EXTERNAL_POLLY_SOURCE_DIR=../polly -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_TOOLS=ON -DLLVM_INCLUDE_UTILS=ON -DWITH_POLLY=ON -DCMAKE_SYSTEM_VERSION=6.1 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=8.1 ../llvm
|
||||
msbuild.exe ALL_BUILD.vcxproj /t:clean /p:Configuration=Debug /m
|
||||
</NMakeCleanCommandLine>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<NMakePreprocessorDefinitions />
|
||||
<NMakeBuildCommandLine>
|
||||
cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_TOOLS=OFF -DLLVM_INCLUDE_UTILS=OFF -DWITH_POLLY=OFF -DCMAKE_SYSTEM_VERSION=6.1 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=8.1 ../llvm
|
||||
cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_EXTERNAL_POLLY_SOURCE_DIR=../polly -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_TOOLS=ON -DLLVM_INCLUDE_UTILS=ON -DWITH_POLLY=ON -DCMAKE_SYSTEM_VERSION=6.1 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=8.1 ../llvm
|
||||
msbuild.exe ALL_BUILD.vcxproj /t:build /p:Configuration=Release /m
|
||||
</NMakeBuildCommandLine>
|
||||
<NMakeReBuildCommandLine>
|
||||
cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_TOOLS=OFF -DLLVM_INCLUDE_UTILS=OFF -DWITH_POLLY=OFF -DCMAKE_SYSTEM_VERSION=6.1 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=8.1 ../llvm
|
||||
cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_EXTERNAL_POLLY_SOURCE_DIR=../polly -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_TOOLS=ON -DLLVM_INCLUDE_UTILS=ON -DWITH_POLLY=ON -DCMAKE_SYSTEM_VERSION=6.1 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=8.1 ../llvm
|
||||
msbuild.exe ALL_BUILD.vcxproj /t:rebuild /p:Configuration=Release /m
|
||||
</NMakeReBuildCommandLine>
|
||||
<NMakeCleanCommandLine>
|
||||
cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_TOOLS=OFF -DLLVM_INCLUDE_UTILS=OFF -DWITH_POLLY=OFF -DCMAKE_SYSTEM_VERSION=6.1 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=8.1 ../llvm
|
||||
cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_EXTERNAL_POLLY_SOURCE_DIR=../polly -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_TOOLS=ON -DLLVM_INCLUDE_UTILS=ON -DWITH_POLLY=ON -DCMAKE_SYSTEM_VERSION=6.1 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=8.1 ../llvm
|
||||
msbuild.exe ALL_BUILD.vcxproj /t:clean /p:Configuration=Release /m
|
||||
</NMakeCleanCommandLine>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -62,6 +62,9 @@ vcxproj_files = ["lib\Analysis\LLVMAnalysis.vcxproj",
|
||||
"lib\Transforms\Utils\LLVMTransformUtils.vcxproj",
|
||||
"lib\Transforms\Vectorize\LLVMVectorize.vcxproj",
|
||||
"include\llvm\IR\intrinsics_gen.vcxproj",
|
||||
"tools\polly\lib\Polly.vcxproj",
|
||||
"tools\polly\lib\External\PollyISL.vcxproj",
|
||||
"tools\polly\lib\External\PollyPPCG.vcxproj",
|
||||
"utils\TableGen\llvm-tblgen.vcxproj",
|
||||
]
|
||||
|
||||
|
||||
Submodule
+1
Submodule polly added at 5664a18f6d
@@ -1,65 +0,0 @@
|
||||
#include "ps3emu_api.h"
|
||||
|
||||
ps3emu_api::ps3emu_api(const std::string &path)
|
||||
{
|
||||
load(path);
|
||||
}
|
||||
|
||||
bool ps3emu_api::load(const std::string &path)
|
||||
{
|
||||
if (!m_library.load(path))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool is_no_errors = true;
|
||||
|
||||
if (!m_library.get(get_api_version, "ps3emu_api_get_api_version") || get_api_version() != ps3emu_api_version)
|
||||
{
|
||||
is_no_errors = false;
|
||||
}
|
||||
|
||||
is_no_errors = is_no_errors && m_library.get(initialize, "ps3emu_api_initialize");
|
||||
is_no_errors = is_no_errors && m_library.get(destroy, "ps3emu_api_destroy");
|
||||
|
||||
is_no_errors = is_no_errors && m_library.get(get_version_string, "ps3emu_api_get_version_string");
|
||||
is_no_errors = is_no_errors && m_library.get(get_version_number, "ps3emu_api_get_version_number");
|
||||
is_no_errors = is_no_errors && m_library.get(get_name_string, "ps3emu_api_get_name_string");
|
||||
|
||||
is_no_errors = is_no_errors && m_library.get(load_elf, "ps3emu_api_load_elf");
|
||||
|
||||
is_no_errors = is_no_errors && m_library.get(set_state, "ps3emu_api_set_state");
|
||||
is_no_errors = is_no_errors && m_library.get(get_state, "ps3emu_api_get_state");
|
||||
|
||||
if (!is_no_errors)
|
||||
{
|
||||
close();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ps3emu_api::loaded() const
|
||||
{
|
||||
return m_library.loaded();
|
||||
}
|
||||
|
||||
void ps3emu_api::close()
|
||||
{
|
||||
initialize = nullptr;
|
||||
destroy = nullptr;
|
||||
get_version_string = nullptr;
|
||||
get_version_number = nullptr;
|
||||
get_name_string = nullptr;
|
||||
load_elf = nullptr;
|
||||
set_state = nullptr;
|
||||
get_state = nullptr;
|
||||
|
||||
m_library.close();
|
||||
}
|
||||
|
||||
ps3emu_api::operator bool() const
|
||||
{
|
||||
return loaded();
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <Utilities/dynamic_library.h>
|
||||
#include <string>
|
||||
#include "ps3emu_api_enums.h"
|
||||
#include "ps3emu_api_structs.h"
|
||||
|
||||
class ps3emu_api
|
||||
{
|
||||
utils::dynamic_library m_library;
|
||||
|
||||
public:
|
||||
ps3emu_api() = default;
|
||||
ps3emu_api(const std::string &path);
|
||||
|
||||
unsigned int(*get_api_version)() = nullptr;
|
||||
ps3emu_api_error_code(*initialize)(const ps3emu_api_initialize_callbacks *callbacks) = nullptr;
|
||||
ps3emu_api_error_code(*destroy)() = nullptr;
|
||||
|
||||
ps3emu_api_error_code(*get_version_string)(char *dest_buffer, int dest_buffer_size) = nullptr;
|
||||
ps3emu_api_error_code(*get_version_number)(int *version_number) = nullptr;
|
||||
ps3emu_api_error_code(*get_name_string)(char *dest_buffer, int dest_buffer_size) = nullptr;
|
||||
|
||||
ps3emu_api_error_code(*load_elf)(const char *path) = nullptr;
|
||||
|
||||
ps3emu_api_error_code(*set_state)(ps3emu_api_state state) = nullptr;
|
||||
ps3emu_api_error_code(*get_state)(ps3emu_api_state *state) = nullptr;
|
||||
|
||||
bool load(const std::string &path);
|
||||
bool loaded() const;
|
||||
void close();
|
||||
|
||||
explicit operator bool() const;
|
||||
};
|
||||
|
||||
@@ -33,8 +33,7 @@ Controller.prototype.ComponentSelectionPageCallback = function() {
|
||||
var widget = gui.currentPageWidget();
|
||||
|
||||
widget.deselectAll();
|
||||
widget.selectComponent("qt.qt5.5100.gcc_64");
|
||||
|
||||
widget.selectComponent("qt.qt5." + installer.environmentVariable("QTVER") + ".gcc_64");
|
||||
gui.clickButton(buttons.NextButton);
|
||||
}
|
||||
|
||||
|
||||
@@ -20,14 +20,14 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.25420.1
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.27130.2027
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "asmjit", "asmjitsrc\asmjit.vcxproj", "{AC40FF01-426E-4838-A317-66354CEFAE88}"
|
||||
EndProject
|
||||
@@ -243,4 +243,7 @@ Global
|
||||
{FDC361C5-7734-493B-8CFB-037308B35122} = {DDF904CA-2771-441A-8629-5DF2EB922A79}
|
||||
{A107C21C-418A-4697-BB10-20C3AA60E2E4} = {FA1E6C16-CA63-45F8-8D52-E21DF396BE36}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {06CC7920-E085-4B81-9582-8DE8AAD42510}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
+44
-16
@@ -6,32 +6,32 @@ set(CMAKE_CXX_STANDARD 14)
|
||||
include(CheckCXXCompilerFlag)
|
||||
|
||||
# Qt section
|
||||
find_package(Qt5 5.7 COMPONENTS Widgets Network)
|
||||
find_package(Qt5 5.10 COMPONENTS Widgets Network Qml)
|
||||
if(WIN32)
|
||||
find_package(Qt5 5.7 COMPONENTS WinExtras REQUIRED)
|
||||
set(RPCS3_QT_LIBS Qt5::Widgets Qt5::WinExtras Qt5::Network)
|
||||
find_package(Qt5 5.10 COMPONENTS WinExtras REQUIRED)
|
||||
set(RPCS3_QT_LIBS Qt5::Widgets Qt5::WinExtras Qt5::Network Qt5::Qml)
|
||||
else()
|
||||
find_package(Qt5 5.7 COMPONENTS DBus Gui)
|
||||
find_package(Qt5 5.10 COMPONENTS DBus Gui)
|
||||
if(Qt5DBus_FOUND)
|
||||
set(RPCS3_QT_LIBS Qt5::Widgets Qt5::DBus Qt5::Network)
|
||||
set(RPCS3_QT_LIBS Qt5::Widgets Qt5::DBus Qt5::Network Qt5::Qml)
|
||||
add_definitions(-DHAVE_QTDBUS)
|
||||
else()
|
||||
set(RPCS3_QT_LIBS Qt5::Widgets Qt5::Network)
|
||||
set(RPCS3_QT_LIBS Qt5::Widgets Qt5::Network Qt5::Qml)
|
||||
endif()
|
||||
include_directories(${Qt5Gui_PRIVATE_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
# Let's make sure we have Qt before we continue
|
||||
if(NOT Qt5Widgets_FOUND)
|
||||
if(Qt5Widgets_VERSION VERSION_LESS 5.7.0)
|
||||
message("Minimum supported Qt5 version is 5.7! You have version ${Qt5Widgets_VERSION} installed, please upgrade!")
|
||||
if(Qt5Widgets_VERSION VERSION_LESS 5.10.0)
|
||||
message("Minimum supported Qt5 version is 5.10.0! You have version ${Qt5Widgets_VERSION} installed, please upgrade!")
|
||||
if("${CMAKE_SYSTEM}" MATCHES "Linux")
|
||||
message(FATAL_ERROR "Most distros do not provide an up-to-date version of Qt.
|
||||
If you're on Ubuntu or Linux Mint, there are PPAs you can use to install an up-to-date qt5 version.
|
||||
https://launchpad.net/~beineri/+archive/ubuntu/opt-qt593-xenial
|
||||
https://launchpad.net/~beineri/+archive/ubuntu/opt-qt593-trusty
|
||||
https://launchpad.net/~beineri/+archive/ubuntu/opt-qt-5.10.1-xenial
|
||||
https://launchpad.net/~beineri/+archive/ubuntu/opt-qt-5.10.1-trusty
|
||||
just make sure to run
|
||||
source /opt/qt59/bin/qt59-env.sh
|
||||
source /opt/qt510/bin/qt510-env.sh
|
||||
before re-running cmake")
|
||||
elseif(WIN32)
|
||||
message(FATAL_ERROR "You can download the latest version of Qt5 here: https://www.qt.io/download-open-source/")
|
||||
@@ -42,7 +42,7 @@ before re-running cmake")
|
||||
|
||||
message("CMake was unable to find Qt5!")
|
||||
if(WIN32)
|
||||
message(FATAL_ERROR "Make sure the QTDIR env variable has been set properly. (for example C:\\Qt\\5.8\\msvc2017_64\\)")
|
||||
message(FATAL_ERROR "Make sure the QTDIR env variable has been set properly. (for example C:\\Qt\\5.10.1\\msvc2017_64\\)")
|
||||
elseif("${CMAKE_SYSTEM}" MATCHES "Linux")
|
||||
message(FATAL_ERROR "Make sure to install your distro's qt5 package!")
|
||||
else()
|
||||
@@ -96,7 +96,7 @@ if(NOT MSVC)
|
||||
if(NOT APPLE)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--exclude-libs,ALL")
|
||||
endif()
|
||||
|
||||
|
||||
if(WIN32)
|
||||
set(CMAKE_RC_COMPILER_INIT windres)
|
||||
enable_language(RC)
|
||||
@@ -108,7 +108,7 @@ if(NOT MSVC)
|
||||
|
||||
add_compile_options(-msse -msse2 -mcx16 -mrtm)
|
||||
|
||||
if(NOT DEFINED ENV{TRAVIS})
|
||||
if(NOT DEFINED ENV{TRAVIS} AND USE_NATIVE_INSTRUCTIONS)
|
||||
add_compile_options(-march=native)
|
||||
endif()
|
||||
|
||||
@@ -173,7 +173,7 @@ set(CMAKE_MODULE_PATH "${RPCS3_SRC_DIR}/cmake_modules")
|
||||
find_package(OpenGL REQUIRED)
|
||||
find_package(OpenAL REQUIRED)
|
||||
if(NOT WITHOUT_LLVM)
|
||||
find_package(LLVM 4.0 CONFIG)
|
||||
find_package(LLVM 6.0 CONFIG)
|
||||
if(NOT LLVM_FOUND)
|
||||
message("System LLVM was not found, LLVM will be built from the submodule.")
|
||||
|
||||
@@ -198,6 +198,28 @@ if(NOT WITHOUT_LLVM)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Now let's look for polly.
|
||||
find_package(Polly)
|
||||
if(Polly_FOUND)
|
||||
add_definitions(-DPOLLY_AVAILABLE)
|
||||
endif()
|
||||
# Polly LLVM Compiler checks
|
||||
CHECK_C_COMPILER_FLAG("-mllvm -polly" HAS_POLLY)
|
||||
CHECK_C_COMPILER_FLAG("-mllvm -polly-target=hybrid" HAS_POLLY_HYBRID)
|
||||
CHECK_C_COMPILER_FLAG("-mllvm -polly-target=cpu" HAS_POLLY_CPU)
|
||||
|
||||
if (HAS_POLLY)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mllvm -polly -mllvm -polly-parallel -lgomp -mllvm -polly-vectorizer=stripmine")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mllvm -polly -mllvm -polly-parallel -lgomp -mllvm -polly-vectorizer=stripmine")
|
||||
if(HAS_POLLY_HYBRID)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mllvm -polly-target=hybrid")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -mllvm -polly-target=cpu")
|
||||
elseif(HAS_POLLY_CPU)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mllvm -polly-target=cpu")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -mllvm -polly-target=cpu")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
if(APPLE)
|
||||
@@ -274,6 +296,7 @@ endif()
|
||||
include_directories(
|
||||
${OPENAL_INCLUDE_DIR}
|
||||
${LLVM_INCLUDE_DIRS}
|
||||
${Polly_INCLUDE_DIRS}
|
||||
"${RPCS3_SRC_DIR}/../3rdparty/pugixml/src"
|
||||
"${RPCS3_SRC_DIR}"
|
||||
"${RPCS3_SRC_DIR}/Loader"
|
||||
@@ -319,6 +342,7 @@ endif()
|
||||
link_directories(
|
||||
"${RPCS3_SRC_DIR}/../3rdparty/minidx12/"
|
||||
"${RPCS3_SRC_DIR}/../Vulkan"
|
||||
"${Polly_LIBRARY_DIRS}"
|
||||
)
|
||||
|
||||
|
||||
@@ -393,8 +417,12 @@ if(NOT MSVC)
|
||||
target_link_libraries(rpcs3 GLEW::GLEW)
|
||||
endif()
|
||||
|
||||
if(Polly_FOUND)
|
||||
target_link_libraries(rpcs3 Polly PollyISL PollyPPCG)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
target_link_libraries(rpcs3 ws2_32.lib Winmm.lib Psapi.lib VKstatic.1 glslang OSDependent OGLCompiler SPIRV HLSL setupapi.lib hidapi-hid Shlwapi.lib)
|
||||
target_link_libraries(rpcs3 ws2_32.lib Winmm.lib Psapi.lib gdi32.lib VKstatic.1 glslang OSDependent OGLCompiler SPIRV HLSL setupapi.lib hidapi-hid Shlwapi.lib)
|
||||
if(NOT MSVC)
|
||||
target_link_libraries(rpcs3 ${OPENGL_LIBRARIES} opengl32.lib glu32.lib libpthread)
|
||||
else()
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<PropertyGroup Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
|
||||
@@ -101,7 +101,7 @@ bool cpu_thread::check_state()
|
||||
{
|
||||
#ifdef WITH_GDB_DEBUGGER
|
||||
if (test(state, cpu_flag::dbg_pause)) {
|
||||
fxm::get<GDBDebugServer>()->notify();
|
||||
fxm::get<GDBDebugServer>()->pause_from(this);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ struct llvm_value_t
|
||||
static_assert(std::is_same<T, void>::value, "llvm_value_t<> error: unknown type");
|
||||
|
||||
using type = void;
|
||||
using base = llvm_value_t;
|
||||
static constexpr uint esize = 0;
|
||||
static constexpr bool is_int = false;
|
||||
static constexpr bool is_sint = false;
|
||||
@@ -669,6 +670,117 @@ inline llvm_not_t<typename T1::type, T1> operator ~(T1 a1)
|
||||
return {a1};
|
||||
}
|
||||
|
||||
template <typename T, typename A1, typename A2, llvm::CmpInst::Predicate UPred>
|
||||
struct llvm_icmp_t
|
||||
{
|
||||
using type = std::conditional_t<llvm_value_t<T>::is_vector, bool[llvm_value_t<T>::is_vector], bool>;
|
||||
|
||||
A1 a1;
|
||||
A2 a2;
|
||||
|
||||
static_assert(llvm_value_t<T>::is_int, "llvm_eq_t<>: invalid type");
|
||||
|
||||
// Convert unsigned comparison predicate to signed if necessary
|
||||
static constexpr llvm::CmpInst::Predicate pred = llvm_value_t<T>::is_uint ? UPred :
|
||||
UPred == llvm::ICmpInst::ICMP_UGT ? llvm::ICmpInst::ICMP_SGT :
|
||||
UPred == llvm::ICmpInst::ICMP_UGE ? llvm::ICmpInst::ICMP_SGE :
|
||||
UPred == llvm::ICmpInst::ICMP_ULT ? llvm::ICmpInst::ICMP_SLT :
|
||||
UPred == llvm::ICmpInst::ICMP_ULE ? llvm::ICmpInst::ICMP_SLE : UPred;
|
||||
|
||||
static inline llvm::Value* icmp(llvm::IRBuilder<>* ir, llvm::Value* lhs, llvm::Value* rhs)
|
||||
{
|
||||
return ir->CreateICmp(pred, lhs, rhs);
|
||||
}
|
||||
|
||||
static inline llvm::Value* icmp(llvm::IRBuilder<>* ir, llvm::Value* lhs, u64 value)
|
||||
{
|
||||
return ir->CreateICmp(pred, lhs, llvm::ConstantInt::get(llvm_value_t<T>::get_type(ir->getContext()), value, llvm_value_t<T>::is_sint));
|
||||
}
|
||||
|
||||
llvm::Value* eval(llvm::IRBuilder<>* ir) const
|
||||
{
|
||||
const auto v1 = a1.eval(ir);
|
||||
const auto v2 = a2.eval(ir);
|
||||
|
||||
if (llvm_value_t<T>::is_int)
|
||||
{
|
||||
return icmp(ir, v1, v2);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T1, typename T2, typename = decltype(std::declval<T1>().eval(0)), typename = std::enable_if_t<std::is_same<typename T1::type, typename T2::type>::value>>
|
||||
inline llvm_icmp_t<typename T1::type, T1, T2, llvm::ICmpInst::ICMP_EQ> operator ==(T1 a1, T2 a2)
|
||||
{
|
||||
return {a1, a2};
|
||||
}
|
||||
|
||||
template <typename T1, typename = decltype(std::declval<T1>().eval(0)), typename = std::enable_if_t<llvm_value_t<typename T1::type>::is_int>>
|
||||
inline llvm_icmp_t<typename T1::type, T1, llvm_int_t, llvm::ICmpInst::ICMP_EQ> operator ==(T1 a1, u64 a2)
|
||||
{
|
||||
return {a1, llvm_int_t{a2}};
|
||||
}
|
||||
|
||||
template <typename T1, typename T2, typename = decltype(std::declval<T1>().eval(0)), typename = std::enable_if_t<std::is_same<typename T1::type, typename T2::type>::value>>
|
||||
inline llvm_icmp_t<typename T1::type, T1, T2, llvm::ICmpInst::ICMP_NE> operator !=(T1 a1, T2 a2)
|
||||
{
|
||||
return {a1, a2};
|
||||
}
|
||||
|
||||
template <typename T1, typename = decltype(std::declval<T1>().eval(0)), typename = std::enable_if_t<llvm_value_t<typename T1::type>::is_int>>
|
||||
inline llvm_icmp_t<typename T1::type, T1, llvm_int_t, llvm::ICmpInst::ICMP_NE> operator !=(T1 a1, u64 a2)
|
||||
{
|
||||
return {a1, llvm_int_t{a2}};
|
||||
}
|
||||
|
||||
template <typename T1, typename T2, typename = decltype(std::declval<T1>().eval(0)), typename = std::enable_if_t<std::is_same<typename T1::type, typename T2::type>::value>>
|
||||
inline llvm_icmp_t<typename T1::type, T1, T2, llvm::ICmpInst::ICMP_UGT> operator >(T1 a1, T2 a2)
|
||||
{
|
||||
return {a1, a2};
|
||||
}
|
||||
|
||||
template <typename T1, typename = decltype(std::declval<T1>().eval(0)), typename = std::enable_if_t<llvm_value_t<typename T1::type>::is_int>>
|
||||
inline llvm_icmp_t<typename T1::type, T1, llvm_int_t, llvm::ICmpInst::ICMP_UGT> operator >(T1 a1, u64 a2)
|
||||
{
|
||||
return {a1, llvm_int_t{a2}};
|
||||
}
|
||||
|
||||
template <typename T1, typename T2, typename = decltype(std::declval<T1>().eval(0)), typename = std::enable_if_t<std::is_same<typename T1::type, typename T2::type>::value>>
|
||||
inline llvm_icmp_t<typename T1::type, T1, T2, llvm::ICmpInst::ICMP_UGE> operator >=(T1 a1, T2 a2)
|
||||
{
|
||||
return {a1, a2};
|
||||
}
|
||||
|
||||
template <typename T1, typename = decltype(std::declval<T1>().eval(0)), typename = std::enable_if_t<llvm_value_t<typename T1::type>::is_int>>
|
||||
inline llvm_icmp_t<typename T1::type, T1, llvm_int_t, llvm::ICmpInst::ICMP_UGE> operator >=(T1 a1, u64 a2)
|
||||
{
|
||||
return {a1, llvm_int_t{a2}};
|
||||
}
|
||||
|
||||
template <typename T1, typename T2, typename = decltype(std::declval<T1>().eval(0)), typename = std::enable_if_t<std::is_same<typename T1::type, typename T2::type>::value>>
|
||||
inline llvm_icmp_t<typename T1::type, T1, T2, llvm::ICmpInst::ICMP_ULT> operator <(T1 a1, T2 a2)
|
||||
{
|
||||
return {a1, a2};
|
||||
}
|
||||
|
||||
template <typename T1, typename = decltype(std::declval<T1>().eval(0)), typename = std::enable_if_t<llvm_value_t<typename T1::type>::is_int>>
|
||||
inline llvm_icmp_t<typename T1::type, T1, llvm_int_t, llvm::ICmpInst::ICMP_ULT> operator <(T1 a1, u64 a2)
|
||||
{
|
||||
return {a1, llvm_int_t{a2}};
|
||||
}
|
||||
|
||||
template <typename T1, typename T2, typename = decltype(std::declval<T1>().eval(0)), typename = std::enable_if_t<std::is_same<typename T1::type, typename T2::type>::value>>
|
||||
inline llvm_icmp_t<typename T1::type, T1, T2, llvm::ICmpInst::ICMP_ULE> operator <=(T1 a1, T2 a2)
|
||||
{
|
||||
return {a1, a2};
|
||||
}
|
||||
|
||||
template <typename T1, typename = decltype(std::declval<T1>().eval(0)), typename = std::enable_if_t<llvm_value_t<typename T1::type>::is_int>>
|
||||
inline llvm_icmp_t<typename T1::type, T1, llvm_int_t, llvm::ICmpInst::ICMP_ULE> operator <=(T1 a1, u64 a2)
|
||||
{
|
||||
return {a1, llvm_int_t{a2}};
|
||||
}
|
||||
|
||||
class cpu_translator
|
||||
{
|
||||
protected:
|
||||
@@ -711,6 +823,38 @@ public:
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename T, typename T2>
|
||||
value_t<T> bitcast(T2 expr)
|
||||
{
|
||||
value_t<T> result;
|
||||
result.value = m_ir->CreateBitCast(expr.eval(m_ir), result.get_type(m_context));
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename T, typename T2>
|
||||
value_t<T> trunc(T2 expr)
|
||||
{
|
||||
value_t<T> result;
|
||||
result.value = m_ir->CreateTrunc(expr.eval(m_ir), result.get_type(m_context));
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename T, typename T2>
|
||||
value_t<T> sext(T2 expr)
|
||||
{
|
||||
value_t<T> result;
|
||||
result.value = m_ir->CreateSExt(expr.eval(m_ir), result.get_type(m_context));
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename T, typename T2>
|
||||
value_t<T> zext(T2 expr)
|
||||
{
|
||||
value_t<T> result;
|
||||
result.value = m_ir->CreateZExt(expr.eval(m_ir), result.get_type(m_context));
|
||||
return result;
|
||||
}
|
||||
|
||||
// Get unsigned addition carry into the sign bit (s = a + b)
|
||||
template <typename T>
|
||||
static inline auto ucarry(T a, T b, T s)
|
||||
|
||||
@@ -158,7 +158,7 @@ void mfc_thread::cpu_task()
|
||||
|
||||
if ((cmd.cmd & ~(MFC_BARRIER_MASK | MFC_FENCE_MASK)) == MFC_PUTQLLUC_CMD)
|
||||
{
|
||||
auto& data = vm::ps3::_ref<decltype(spu.rdata)>(cmd.eal);
|
||||
auto& data = vm::_ref<decltype(spu.rdata)>(cmd.eal);
|
||||
const auto to_write = spu._ref<decltype(spu.rdata)>(cmd.lsa & 0x3ffff);
|
||||
|
||||
cmd.size = 0;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
namespace vm { using namespace ps3; }
|
||||
|
||||
|
||||
// Error Codes
|
||||
enum
|
||||
@@ -308,7 +308,7 @@ enum CellAdecChannel : s32
|
||||
CELL_ADEC_CH_3_4,
|
||||
CELL_ADEC_CH_3_4_LFE,
|
||||
CELL_ADEC_CH_RESERVED3,
|
||||
};
|
||||
};
|
||||
|
||||
// Sampling Rate
|
||||
enum CellAdecSampleRate : s32
|
||||
@@ -532,13 +532,13 @@ struct CellAdecParamM4Aac
|
||||
|
||||
union
|
||||
{
|
||||
struct
|
||||
struct
|
||||
{
|
||||
be_t<u32> programNumber;
|
||||
}
|
||||
adifConfig;
|
||||
|
||||
struct
|
||||
struct
|
||||
{
|
||||
be_t<s32> samplingFreqIndex; // MPEG4AAC_SamplingFreq
|
||||
be_t<u32> profile; // LC profile (1)
|
||||
@@ -683,10 +683,10 @@ struct CellAdecParamAc3
|
||||
AC3_WordSize wordSize;
|
||||
AC3_OutputMode outputMode;
|
||||
AC3_LFE outLfeOn;
|
||||
|
||||
|
||||
be_t<float> drcCutScaleFactor;
|
||||
be_t<float> drcBoostScaleFactor;
|
||||
|
||||
|
||||
AC3_CompressionMode compressionMode;
|
||||
AC3_InputChannel numberOfChannels;
|
||||
AC3_StereoMode stereoMode;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
namespace vm { using namespace ps3; }
|
||||
|
||||
|
||||
// Return Codes
|
||||
enum
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
namespace vm { using namespace ps3; }
|
||||
|
||||
|
||||
// Return Codes
|
||||
enum
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include "Utilities/Thread.h"
|
||||
|
||||
namespace vm { using namespace ps3; }
|
||||
|
||||
|
||||
// Error codes
|
||||
enum CellAudioError : u32
|
||||
@@ -32,7 +32,7 @@ enum
|
||||
CELL_AUDIO_BLOCK_SAMPLES = 256,
|
||||
CELL_AUDIO_CREATEEVENTFLAG_SPU = 0x00000001,
|
||||
CELL_AUDIO_EVENT_HEADPHONE = 1,
|
||||
CELL_AUDIO_EVENT_MIX = 0,
|
||||
CELL_AUDIO_EVENT_MIX = 0,
|
||||
CELL_AUDIO_EVENTFLAG_BEFOREMIX = 0x80000000,
|
||||
CELL_AUDIO_EVENTFLAG_DECIMATE_2 = 0x08000000,
|
||||
CELL_AUDIO_EVENTFLAG_DECIMATE_4 = 0x10000000,
|
||||
@@ -40,7 +40,7 @@ enum
|
||||
CELL_AUDIO_EVENTFLAG_NOMIX = 0x40000000,
|
||||
CELL_AUDIO_MAX_PORT = 4,
|
||||
CELL_AUDIO_MAX_PORT_2 = 8,
|
||||
CELL_AUDIO_MISC_ACCVOL_ALLDEVICE = 0x0000ffffUL,
|
||||
CELL_AUDIO_MISC_ACCVOL_ALLDEVICE = 0x0000ffffUL,
|
||||
CELL_AUDIO_PERSONAL_DEVICE_PRIMARY = 0x8000,
|
||||
CELL_AUDIO_PORT_2CH = 2,
|
||||
CELL_AUDIO_PORT_8CH = 8,
|
||||
@@ -51,7 +51,7 @@ enum
|
||||
CELL_AUDIO_PORTATTR_OUT_PERSONAL_1 = 0x0000000002000000ULL,
|
||||
CELL_AUDIO_PORTATTR_OUT_PERSONAL_2 = 0x0000000004000000ULL,
|
||||
CELL_AUDIO_PORTATTR_OUT_PERSONAL_3 = 0x0000000008000000ULL,
|
||||
CELL_AUDIO_PORTATTR_OUT_SECONDARY = 0x0000000000000001ULL,
|
||||
CELL_AUDIO_PORTATTR_OUT_SECONDARY = 0x0000000000000001ULL,
|
||||
CELL_AUDIO_STATUS_CLOSE = 0x1010,
|
||||
CELL_AUDIO_STATUS_READY = 1,
|
||||
CELL_AUDIO_STATUS_RUN = 2,
|
||||
@@ -59,15 +59,15 @@ enum
|
||||
|
||||
//libaudio datatypes
|
||||
struct CellAudioPortParam
|
||||
{
|
||||
{
|
||||
be_t<u64> nChannel;
|
||||
be_t<u64> nBlock;
|
||||
be_t<u64> attr;
|
||||
be_t<float> level;
|
||||
};
|
||||
};
|
||||
|
||||
struct CellAudioPortConfig
|
||||
{
|
||||
{
|
||||
vm::bptr<u64> readIndexAddr;
|
||||
be_t<u32> status;
|
||||
be_t<u64> nChannel;
|
||||
@@ -115,7 +115,7 @@ struct audio_port
|
||||
float inc;
|
||||
};
|
||||
|
||||
float level;
|
||||
float level;
|
||||
atomic_t<level_set_t> level_set;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
namespace vm { using namespace ps3; }
|
||||
|
||||
|
||||
// Error codes
|
||||
enum
|
||||
|
||||
@@ -191,13 +191,17 @@ s32 cellAudioOutGetDeviceInfo(u32 audioOut, u32 deviceIndex, vm::ptr<CellAudioOu
|
||||
if (deviceIndex) return CELL_AUDIO_OUT_ERROR_DEVICE_NOT_FOUND;
|
||||
|
||||
info->portType = CELL_AUDIO_OUT_PORT_HDMI;
|
||||
info->availableModeCount = 1;
|
||||
info->availableModeCount = 2;
|
||||
info->state = CELL_AUDIO_OUT_DEVICE_STATE_AVAILABLE;
|
||||
info->latency = 1000;
|
||||
info->availableModes[0].type = CELL_AUDIO_OUT_CODING_TYPE_LPCM;
|
||||
info->availableModes[0].channel = CELL_AUDIO_OUT_CHNUM_8;
|
||||
info->availableModes[0].fs = CELL_AUDIO_OUT_FS_48KHZ;
|
||||
info->availableModes[0].layout = CELL_AUDIO_OUT_SPEAKER_LAYOUT_8CH_LREClrxy;
|
||||
info->availableModes[1].type = CELL_AUDIO_OUT_CODING_TYPE_LPCM;
|
||||
info->availableModes[1].channel = CELL_AUDIO_OUT_CHNUM_2;
|
||||
info->availableModes[1].fs = CELL_AUDIO_OUT_FS_48KHZ;
|
||||
info->availableModes[1].layout = CELL_AUDIO_OUT_SPEAKER_LAYOUT_2CH;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
namespace vm { using namespace ps3; }
|
||||
|
||||
|
||||
// Error codes
|
||||
enum
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include "cellBgdl.h"
|
||||
|
||||
namespace vm { using namespace ps3; }
|
||||
|
||||
|
||||
logs::channel cellBGDL("cellBGDL");
|
||||
|
||||
|
||||
@@ -30,5 +30,5 @@ struct CellBGDLInfo
|
||||
be_t<u64> received_size;
|
||||
be_t<u64> content_size;
|
||||
be_t<s32> state; // CellBGDLState
|
||||
vm::ps3::bptr<void> reserved;
|
||||
vm::bptr<void> reserved;
|
||||
};
|
||||
|
||||
@@ -1,12 +1,26 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/IdManager.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
#include "cellCamera.h"
|
||||
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
#include "Emu/Cell/lv2/sys_event.h"
|
||||
#include "Emu/IdManager.h"
|
||||
#include "Emu/Io/PadHandler.h"
|
||||
#include "Emu/System.h"
|
||||
|
||||
#include <thread>
|
||||
|
||||
logs::channel cellCamera("cellCamera");
|
||||
|
||||
// **************
|
||||
// * Prototypes *
|
||||
// **************
|
||||
|
||||
s32 cellCameraSetAttribute(s32 dev_num, s32 attrib, u32 arg1, u32 arg2);
|
||||
|
||||
// ************************
|
||||
// * HLE helper functions *
|
||||
// ************************
|
||||
|
||||
template <>
|
||||
void fmt_class_string<camera_handler>::format(std::string& out, u64 arg)
|
||||
{
|
||||
@@ -97,71 +111,126 @@ static const char* get_camera_attr_name(s32 value)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Custom struct to keep track of cameras
|
||||
struct camera_t
|
||||
static bool check_dev_num(u32 dev_num)
|
||||
{
|
||||
struct attr_t
|
||||
{
|
||||
u32 v1, v2;
|
||||
};
|
||||
return dev_num == 0;
|
||||
}
|
||||
|
||||
attr_t attr[500]{};
|
||||
};
|
||||
/**
|
||||
* \brief Sets read mode attribute (used for deciding how image data is passed to games)
|
||||
* Also sends it to the camera thread
|
||||
* NOTE: thread-safe (uses camera_thread::mutex)
|
||||
* \param dev_num Device number (always 0)
|
||||
* \param read_mode Either CELL_CAMERA_READ_FUNCCALL or CELL_CAMERA_READ_DIRECT
|
||||
* \return CELL error code or CELL_OK
|
||||
*/
|
||||
u32 set_and_send_read_mode(s32 dev_num, const s32 read_mode)
|
||||
{
|
||||
if (read_mode == CELL_CAMERA_READ_FUNCCALL ||
|
||||
read_mode == CELL_CAMERA_READ_DIRECT)
|
||||
{
|
||||
if (const auto status = cellCameraSetAttribute(dev_num, CELL_CAMERA_READMODE, read_mode, 0))
|
||||
{
|
||||
return status;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cellCamera.error("Unknown read mode set: %d", read_mode);
|
||||
}
|
||||
|
||||
// Send read mode to camera thread
|
||||
const auto g_camera = fxm::get<camera_thread>();
|
||||
|
||||
g_camera->read_mode.exchange(read_mode);
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
std::pair<u32, u32> get_video_resolution(const CellCameraInfoEx& info)
|
||||
{
|
||||
std::pair<u32, u32> res;
|
||||
switch (info.resolution)
|
||||
{
|
||||
case CELL_CAMERA_VGA: return{ 640, 480 };
|
||||
case CELL_CAMERA_QVGA: return { 320, 240 };
|
||||
case CELL_CAMERA_WGA: return{ 640, 360 };
|
||||
case CELL_CAMERA_SPECIFIED_WIDTH_HEIGHT: return{ info.width, info.height };
|
||||
case CELL_CAMERA_RESOLUTION_UNKNOWN:
|
||||
default: return{ 0, 0 };
|
||||
}
|
||||
}
|
||||
|
||||
u32 get_video_buffer_size(const CellCameraInfoEx& info)
|
||||
{
|
||||
u32 width, height;
|
||||
std::tie(width, height) = get_video_resolution(info);
|
||||
|
||||
const auto bpp = 4;
|
||||
return width * height * bpp;
|
||||
}
|
||||
|
||||
// ************************
|
||||
// * cellCamera functions *
|
||||
// ************************
|
||||
|
||||
s32 cellCameraInit()
|
||||
{
|
||||
cellCamera.warning("cellCameraInit()");
|
||||
cellCamera.todo("cellCameraInit()");
|
||||
|
||||
if (g_cfg.io.camera == camera_handler::null)
|
||||
{
|
||||
return CELL_CAMERA_ERROR_DEVICE_NOT_FOUND;
|
||||
}
|
||||
|
||||
const auto camera = fxm::make<camera_t>();
|
||||
// Start camera thread
|
||||
const auto g_camera = fxm::make<camera_thread>();
|
||||
|
||||
if (!camera)
|
||||
if (!g_camera)
|
||||
{
|
||||
return CELL_CAMERA_ERROR_ALREADY_INIT;
|
||||
}
|
||||
|
||||
semaphore_lock lock(g_camera->mutex);
|
||||
|
||||
switch (g_cfg.io.camera_type)
|
||||
{
|
||||
case fake_camera_type::eyetoy:
|
||||
{
|
||||
camera->attr[CELL_CAMERA_SATURATION] = { 164 };
|
||||
camera->attr[CELL_CAMERA_BRIGHTNESS] = { 96 };
|
||||
camera->attr[CELL_CAMERA_AEC] = { 1 };
|
||||
camera->attr[CELL_CAMERA_AGC] = { 1 };
|
||||
camera->attr[CELL_CAMERA_AWB] = { 1 };
|
||||
camera->attr[CELL_CAMERA_ABC] = { 0 };
|
||||
camera->attr[CELL_CAMERA_LED] = { 1 };
|
||||
camera->attr[CELL_CAMERA_QS] = { 0 };
|
||||
camera->attr[CELL_CAMERA_NONZEROCOEFFS] = { 32, 32 };
|
||||
camera->attr[CELL_CAMERA_YUVFLAG] = { 0 };
|
||||
camera->attr[CELL_CAMERA_BACKLIGHTCOMP] = { 0 };
|
||||
camera->attr[CELL_CAMERA_MIRRORFLAG] = { 1 };
|
||||
camera->attr[CELL_CAMERA_422FLAG] = { 1 };
|
||||
camera->attr[CELL_CAMERA_USBLOAD] = { 4 };
|
||||
g_camera->attr[CELL_CAMERA_SATURATION] = { 164 };
|
||||
g_camera->attr[CELL_CAMERA_BRIGHTNESS] = { 96 };
|
||||
g_camera->attr[CELL_CAMERA_AEC] = { 1 };
|
||||
g_camera->attr[CELL_CAMERA_AGC] = { 1 };
|
||||
g_camera->attr[CELL_CAMERA_AWB] = { 1 };
|
||||
g_camera->attr[CELL_CAMERA_ABC] = { 0 };
|
||||
g_camera->attr[CELL_CAMERA_LED] = { 1 };
|
||||
g_camera->attr[CELL_CAMERA_QS] = { 0 };
|
||||
g_camera->attr[CELL_CAMERA_NONZEROCOEFFS] = { 32, 32 };
|
||||
g_camera->attr[CELL_CAMERA_YUVFLAG] = { 0 };
|
||||
g_camera->attr[CELL_CAMERA_BACKLIGHTCOMP] = { 0 };
|
||||
g_camera->attr[CELL_CAMERA_MIRRORFLAG] = { 1 };
|
||||
g_camera->attr[CELL_CAMERA_422FLAG] = { 1 };
|
||||
g_camera->attr[CELL_CAMERA_USBLOAD] = { 4 };
|
||||
break;
|
||||
}
|
||||
|
||||
case fake_camera_type::eyetoy2:
|
||||
{
|
||||
camera->attr[CELL_CAMERA_SATURATION] = { 64 };
|
||||
camera->attr[CELL_CAMERA_BRIGHTNESS] = { 8 };
|
||||
camera->attr[CELL_CAMERA_AEC] = { 1 };
|
||||
camera->attr[CELL_CAMERA_AGC] = { 1 };
|
||||
camera->attr[CELL_CAMERA_AWB] = { 1 };
|
||||
camera->attr[CELL_CAMERA_LED] = { 1 };
|
||||
camera->attr[CELL_CAMERA_BACKLIGHTCOMP] = { 0 };
|
||||
camera->attr[CELL_CAMERA_MIRRORFLAG] = { 1 };
|
||||
camera->attr[CELL_CAMERA_GAMMA] = { 1 };
|
||||
camera->attr[CELL_CAMERA_AGCLIMIT] = { 4 };
|
||||
camera->attr[CELL_CAMERA_DENOISE] = { 0 };
|
||||
camera->attr[CELL_CAMERA_FRAMERATEADJUST] = { 0 };
|
||||
camera->attr[CELL_CAMERA_PIXELOUTLIERFILTER] = { 1 };
|
||||
camera->attr[CELL_CAMERA_AGCLOW] = { 48 };
|
||||
camera->attr[CELL_CAMERA_AGCHIGH] = { 64 };
|
||||
g_camera->attr[CELL_CAMERA_SATURATION] = { 64 };
|
||||
g_camera->attr[CELL_CAMERA_BRIGHTNESS] = { 8 };
|
||||
g_camera->attr[CELL_CAMERA_AEC] = { 1 };
|
||||
g_camera->attr[CELL_CAMERA_AGC] = { 1 };
|
||||
g_camera->attr[CELL_CAMERA_AWB] = { 1 };
|
||||
g_camera->attr[CELL_CAMERA_LED] = { 1 };
|
||||
g_camera->attr[CELL_CAMERA_BACKLIGHTCOMP] = { 0 };
|
||||
g_camera->attr[CELL_CAMERA_MIRRORFLAG] = { 1 };
|
||||
g_camera->attr[CELL_CAMERA_GAMMA] = { 1 };
|
||||
g_camera->attr[CELL_CAMERA_AGCLIMIT] = { 4 };
|
||||
g_camera->attr[CELL_CAMERA_DENOISE] = { 0 };
|
||||
g_camera->attr[CELL_CAMERA_FRAMERATEADJUST] = { 0 };
|
||||
g_camera->attr[CELL_CAMERA_PIXELOUTLIERFILTER] = { 1 };
|
||||
g_camera->attr[CELL_CAMERA_AGCLOW] = { 48 };
|
||||
g_camera->attr[CELL_CAMERA_AGCHIGH] = { 64 };
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@@ -175,9 +244,9 @@ s32 cellCameraInit()
|
||||
|
||||
s32 cellCameraEnd()
|
||||
{
|
||||
cellCamera.warning("cellCameraEnd()");
|
||||
cellCamera.todo("cellCameraEnd()");
|
||||
|
||||
if (!fxm::remove<camera_t>())
|
||||
if (!fxm::remove<camera_thread>())
|
||||
{
|
||||
return CELL_CAMERA_ERROR_NOT_INIT;
|
||||
}
|
||||
@@ -185,7 +254,7 @@ s32 cellCameraEnd()
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellCameraOpen()
|
||||
s32 cellCameraOpen() // seems unused
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellCamera);
|
||||
return CELL_OK;
|
||||
@@ -193,13 +262,63 @@ s32 cellCameraOpen()
|
||||
|
||||
s32 cellCameraOpenEx(s32 dev_num, vm::ptr<CellCameraInfoEx> info)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellCamera);
|
||||
cellCamera.todo("cellCameraOpenEx(dev_num=%d, type=*0x%x)", dev_num, info);
|
||||
|
||||
const auto g_camera = fxm::get<camera_thread>();
|
||||
|
||||
if (!g_camera)
|
||||
{
|
||||
return CELL_CAMERA_ERROR_NOT_INIT;
|
||||
}
|
||||
|
||||
s32 read_mode = info->read_mode;
|
||||
|
||||
u32 status = set_and_send_read_mode(dev_num, read_mode);
|
||||
if (status != CELL_OK)
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
status = cellCameraSetAttribute(dev_num, CELL_CAMERA_GAMEPID, status, 0); // yup, that's what libGem does
|
||||
if (status != CELL_OK)
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
const auto vbuf_size = get_video_buffer_size(*info);
|
||||
|
||||
if (info->read_mode == CELL_CAMERA_READ_FUNCCALL && !info->buffer)
|
||||
{
|
||||
info->buffer = vm::cast(vm::alloc(vbuf_size, vm::memory_location_t::main));
|
||||
info->bytesize = vbuf_size;
|
||||
}
|
||||
|
||||
std::tie(info->width, info->height) = get_video_resolution(*info);
|
||||
|
||||
semaphore_lock lock(g_camera->mutex);
|
||||
|
||||
g_camera->is_open = true;
|
||||
g_camera->info = *info;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellCameraClose(s32 dev_num)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellCamera);
|
||||
cellCamera.todo("cellCameraClose(dev_num=%d)", dev_num);
|
||||
|
||||
const auto g_camera = fxm::get<camera_thread>();
|
||||
|
||||
if (!g_camera)
|
||||
{
|
||||
return CELL_CAMERA_ERROR_NOT_INIT;
|
||||
}
|
||||
|
||||
semaphore_lock lock(g_camera->mutex);
|
||||
|
||||
vm::dealloc(g_camera->info.buffer.addr(), vm::memory_location_t::main);
|
||||
g_camera->is_open = false;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@@ -211,15 +330,20 @@ s32 cellCameraGetDeviceGUID(s32 dev_num, vm::ptr<u32> guid)
|
||||
|
||||
s32 cellCameraGetType(s32 dev_num, vm::ptr<s32> type)
|
||||
{
|
||||
cellCamera.warning("cellCameraGetType(dev_num=%d, type=*0x%x)", dev_num, type);
|
||||
cellCamera.todo("cellCameraGetType(dev_num=%d, type=*0x%x)", dev_num, type);
|
||||
|
||||
const auto camera = fxm::get<camera_t>();
|
||||
const auto g_camera = fxm::get<camera_thread>();
|
||||
|
||||
if (!camera)
|
||||
if (!g_camera)
|
||||
{
|
||||
return CELL_CAMERA_ERROR_NOT_INIT;
|
||||
}
|
||||
|
||||
if (!check_dev_num(dev_num) || !type )
|
||||
{
|
||||
return CELL_CAMERA_ERROR_PARAM;
|
||||
}
|
||||
|
||||
switch (g_cfg.io.camera_type)
|
||||
{
|
||||
case fake_camera_type::unknown: *type = CELL_CAMERA_TYPE_UNKNOWN; break;
|
||||
@@ -234,42 +358,80 @@ s32 cellCameraGetType(s32 dev_num, vm::ptr<s32> type)
|
||||
s32 cellCameraIsAvailable(s32 dev_num)
|
||||
{
|
||||
cellCamera.todo("cellCameraIsAvailable(dev_num=%d)", dev_num);
|
||||
return CELL_OK;
|
||||
|
||||
const auto g_camera = fxm::get<camera_thread>();
|
||||
|
||||
if (!g_camera || !check_dev_num(dev_num))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
s32 cellCameraIsAttached(s32 dev_num)
|
||||
{
|
||||
cellCamera.warning("cellCameraIsAttached(dev_num=%d)", dev_num);
|
||||
cellCamera.todo("cellCameraIsAttached(dev_num=%d)", dev_num);
|
||||
|
||||
if (g_cfg.io.camera == camera_handler::fake)
|
||||
if (g_cfg.io.camera == camera_handler::null)
|
||||
{
|
||||
return 1;
|
||||
return false;
|
||||
}
|
||||
|
||||
return 0; // It's not CELL_OK lol
|
||||
const auto g_camera = fxm::get<camera_thread>();
|
||||
|
||||
semaphore_lock lock(g_camera->mutex);
|
||||
|
||||
bool is_attached = g_camera->is_attached;
|
||||
|
||||
// "attach" camera here
|
||||
if (!is_attached)
|
||||
{
|
||||
g_camera->send_attach_state(true);
|
||||
is_attached = g_camera->is_attached;
|
||||
}
|
||||
|
||||
return is_attached;
|
||||
}
|
||||
|
||||
s32 cellCameraIsOpen(s32 dev_num)
|
||||
{
|
||||
cellCamera.todo("cellCameraIsOpen(dev_num=%d)", dev_num);
|
||||
return CELL_OK;
|
||||
|
||||
if (g_cfg.io.camera == camera_handler::null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const auto g_camera = fxm::get<camera_thread>();
|
||||
|
||||
bool is_open = g_camera->is_open;
|
||||
return is_open;
|
||||
}
|
||||
|
||||
s32 cellCameraIsStarted(s32 dev_num)
|
||||
{
|
||||
cellCamera.todo("cellCameraIsStarted(dev_num=%d)", dev_num);
|
||||
return CELL_OK;
|
||||
|
||||
if (g_cfg.io.camera == camera_handler::null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const auto g_camera = fxm::get<camera_thread>();
|
||||
|
||||
bool is_streaming = g_camera->is_streaming;
|
||||
return is_streaming;
|
||||
}
|
||||
|
||||
s32 cellCameraGetAttribute(s32 dev_num, s32 attrib, vm::ptr<u32> arg1, vm::ptr<u32> arg2)
|
||||
{
|
||||
cellCamera.warning("cellCameraGetAttribute(dev_num=%d, attrib=%d, arg1=*0x%x, arg2=*0x%x)", dev_num, attrib, arg1, arg2);
|
||||
|
||||
const auto attr_name = get_camera_attr_name(attrib);
|
||||
cellCamera.todo("cellCameraGetAttribute: get attrib %s to: 0x%x - 0x%x)", attr_name ? attr_name : "(invalid)", arg1, arg2);
|
||||
|
||||
const auto camera = fxm::get<camera_t>();
|
||||
const auto g_camera = fxm::get<camera_thread>();
|
||||
|
||||
if (!camera)
|
||||
if (!g_camera)
|
||||
{
|
||||
return CELL_CAMERA_ERROR_NOT_INIT;
|
||||
}
|
||||
@@ -279,21 +441,30 @@ s32 cellCameraGetAttribute(s32 dev_num, s32 attrib, vm::ptr<u32> arg1, vm::ptr<u
|
||||
return CELL_CAMERA_ERROR_PARAM;
|
||||
}
|
||||
|
||||
*arg1 = camera->attr[attrib].v1;
|
||||
*arg2 = camera->attr[attrib].v2;
|
||||
cellCamera.todo("cellCameraGetAttribute: get attrib %s arg1: %d arg2: %d", attr_name, arg1, arg2);
|
||||
|
||||
semaphore_lock lock(g_camera->mutex);
|
||||
|
||||
if (arg1)
|
||||
{
|
||||
*arg1 = g_camera->attr[attrib].v1;
|
||||
}
|
||||
if (arg2)
|
||||
{
|
||||
*arg2 = g_camera->attr[attrib].v2;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellCameraSetAttribute(s32 dev_num, s32 attrib, u32 arg1, u32 arg2)
|
||||
{
|
||||
cellCamera.warning("cellCameraSetAttribute(dev_num=%d, attrib=%d, arg1=%d, arg2=%d)", dev_num, attrib, arg1, arg2);
|
||||
|
||||
const auto attr_name = get_camera_attr_name(attrib);
|
||||
cellCamera.todo("cellCameraSetAttribute: set attrib %s to: %d - %d)", attr_name ? attr_name : "(invalid)", arg1, arg2);
|
||||
|
||||
const auto camera = fxm::get<camera_t>();
|
||||
const auto g_camera = fxm::get<camera_thread>();
|
||||
|
||||
if (!camera)
|
||||
if (!g_camera)
|
||||
{
|
||||
return CELL_CAMERA_ERROR_NOT_INIT;
|
||||
}
|
||||
@@ -303,15 +474,45 @@ s32 cellCameraSetAttribute(s32 dev_num, s32 attrib, u32 arg1, u32 arg2)
|
||||
return CELL_CAMERA_ERROR_PARAM;
|
||||
}
|
||||
|
||||
camera->attr[attrib] = { arg1, arg2 };
|
||||
semaphore_lock lock(g_camera->mutex);
|
||||
g_camera->attr[attrib] = { arg1, arg2 };
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellCameraGetBufferSize(s32 dev_num, vm::ptr<CellCameraInfoEx> info)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellCamera);
|
||||
return CELL_OK;
|
||||
cellCamera.todo("cellCameraGetBufferSize(dev_num=%d, info=*0x%x)", dev_num, info);
|
||||
|
||||
const auto g_camera = fxm::get<camera_thread>();
|
||||
|
||||
if (!g_camera)
|
||||
{
|
||||
return CELL_CAMERA_ERROR_NOT_INIT;
|
||||
}
|
||||
|
||||
// TODO: a bunch of arg checks. here's one
|
||||
if (!cellCameraIsAttached(dev_num))
|
||||
{
|
||||
return CELL_CAMERA_ERROR_DEVICE_NOT_FOUND;
|
||||
}
|
||||
|
||||
const auto read_mode = info->read_mode;
|
||||
|
||||
u32 status = set_and_send_read_mode(dev_num, read_mode);
|
||||
if (status != CELL_OK)
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
semaphore_lock lock(g_camera->mutex);
|
||||
|
||||
info->bytesize = get_video_buffer_size(g_camera->info);
|
||||
info->buffer = g_camera->info.buffer;
|
||||
|
||||
g_camera->info = *info;
|
||||
|
||||
return info->bytesize;
|
||||
}
|
||||
|
||||
s32 cellCameraGetBufferInfo()
|
||||
@@ -322,7 +523,24 @@ s32 cellCameraGetBufferInfo()
|
||||
|
||||
s32 cellCameraGetBufferInfoEx(s32 dev_num, vm::ptr<CellCameraInfoEx> info)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellCamera);
|
||||
cellCamera.todo("cellCameraReadEx(dev_num=%d, read=0x%x)", dev_num, info);
|
||||
|
||||
const auto g_camera = fxm::get<camera_thread>();
|
||||
|
||||
if (!g_camera)
|
||||
{
|
||||
return CELL_CAMERA_ERROR_NOT_INIT;
|
||||
}
|
||||
|
||||
if (!info)
|
||||
{
|
||||
return CELL_CAMERA_ERROR_PARAM;
|
||||
}
|
||||
|
||||
semaphore_lock lock(g_camera->mutex);
|
||||
|
||||
*info = g_camera->info;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@@ -353,12 +571,21 @@ s32 cellCameraSetExtensionUnit(s32 dev_num, u16 value, u16 length, vm::ptr<u8> d
|
||||
s32 cellCameraReset(s32 dev_num)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellCamera);
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellCameraStart(s32 dev_num)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellCamera);
|
||||
cellCamera.todo("cellCameraStart(dev_num=%d", dev_num);
|
||||
|
||||
const auto g_camera = fxm::get<camera_thread>();
|
||||
|
||||
semaphore_lock lock(g_camera->mutex);
|
||||
|
||||
g_camera->timer.Start();
|
||||
g_camera->is_streaming = true;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@@ -370,19 +597,46 @@ s32 cellCameraRead(s32 dev_num, vm::ptr<u32> frame_num, vm::ptr<u32> bytes_read)
|
||||
|
||||
s32 cellCameraReadEx(s32 dev_num, vm::ptr<CellCameraReadEx> read)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellCamera);
|
||||
cellCamera.todo("cellCameraReadEx(dev_num=%d, read=0x%x)", dev_num, read);
|
||||
|
||||
const auto g_camera = fxm::get<camera_thread>();
|
||||
|
||||
if (!g_camera)
|
||||
{
|
||||
return CELL_CAMERA_ERROR_NOT_INIT;
|
||||
}
|
||||
|
||||
semaphore_lock lock(g_camera->mutex);
|
||||
|
||||
read->timestamp = g_camera->timer.GetElapsedTimeInMicroSec();
|
||||
read->frame = g_camera->frame_num;
|
||||
read->bytesread = g_camera->is_streaming ?
|
||||
get_video_buffer_size(g_camera->info) : 0;
|
||||
|
||||
auto shared_data = fxm::get_always<gem_camera_shared>();
|
||||
|
||||
shared_data->frame_timestamp.exchange(read->timestamp);
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellCameraReadComplete(s32 dev_num, u32 bufnum, u32 arg2)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellCamera);
|
||||
return CELL_OK;
|
||||
cellCamera.todo("cellCameraReadComplete(dev_num=%d, bufnum=%d, arg2=%d)", dev_num, bufnum, arg2);
|
||||
return cellCameraSetAttribute(dev_num, CELL_CAMERA_READFINISH, bufnum, arg2);
|
||||
}
|
||||
|
||||
s32 cellCameraStop(s32 dev_num)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellCamera);
|
||||
cellCamera.todo("cellCameraStop(dev_num=%d", dev_num);
|
||||
|
||||
const auto g_camera = fxm::get<camera_thread>();
|
||||
|
||||
semaphore_lock lock(g_camera->mutex);
|
||||
|
||||
g_camera->is_streaming = false;
|
||||
g_camera->timer.Stop();
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@@ -400,13 +654,43 @@ s32 cellCameraRemoveNotifyEventQueue(u64 key)
|
||||
|
||||
s32 cellCameraSetNotifyEventQueue2(u64 key, u64 source, u64 flag)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellCamera);
|
||||
cellCamera.todo("cellCameraSetNotifyEventQueue2(key=0x%x, source=%d, flag=%d)", key, source, flag);
|
||||
|
||||
const auto g_camera = fxm::get<camera_thread>();
|
||||
|
||||
if (!g_camera)
|
||||
{
|
||||
return CELL_CAMERA_ERROR_NOT_INIT;
|
||||
}
|
||||
{
|
||||
semaphore_lock lock_data_map(g_camera->mutex_notify_data_map);
|
||||
|
||||
g_camera->notify_data_map[key] = { source, flag };
|
||||
}
|
||||
{
|
||||
semaphore_lock lock(g_camera->mutex);
|
||||
|
||||
// send ATTACH event if necessary - HACKY
|
||||
g_camera->send_attach_state(true);
|
||||
}
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellCameraRemoveNotifyEventQueue2(u64 key)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellCamera);
|
||||
cellCamera.todo("cellCameraRemoveNotifyEventQueue2(key=0x%x", key);
|
||||
|
||||
const auto g_camera = fxm::get<camera_thread>();
|
||||
|
||||
if (!g_camera)
|
||||
{
|
||||
return CELL_CAMERA_ERROR_NOT_INIT;
|
||||
}
|
||||
|
||||
semaphore_lock lock(g_camera->mutex_notify_data_map);
|
||||
|
||||
g_camera->notify_data_map.erase(key);
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@@ -447,3 +731,114 @@ DECLARE(ppu_module_manager::cellCamera)("cellCamera", []()
|
||||
REG_FUNC(cellCamera, cellCameraSetNotifyEventQueue2);
|
||||
REG_FUNC(cellCamera, cellCameraRemoveNotifyEventQueue2);
|
||||
});
|
||||
|
||||
void camera_thread::on_task()
|
||||
{
|
||||
while (fxm::check<camera_thread>() && !Emu.IsStopped())
|
||||
{
|
||||
std::chrono::steady_clock::time_point frame_start = std::chrono::steady_clock::now();
|
||||
|
||||
if (Emu.IsPaused())
|
||||
{
|
||||
std::this_thread::sleep_for(1ms); // hack
|
||||
continue;
|
||||
}
|
||||
|
||||
semaphore_lock lock(mutex_notify_data_map);
|
||||
|
||||
for (auto const& notify_data_entry : notify_data_map)
|
||||
{
|
||||
const auto& key = notify_data_entry.first;
|
||||
const auto& evt_data = notify_data_entry.second;
|
||||
|
||||
// handle FRAME_UPDATE
|
||||
if (is_streaming &&
|
||||
evt_data.flag & CELL_CAMERA_EFLAG_FRAME_UPDATE &&
|
||||
info.framerate != 0)
|
||||
{
|
||||
if (auto queue = lv2_event_queue::find(key))
|
||||
{
|
||||
u64 data2{ 0 };
|
||||
u64 data3{ 0 };
|
||||
|
||||
switch (read_mode.load())
|
||||
{
|
||||
case CELL_CAMERA_READ_FUNCCALL:
|
||||
{
|
||||
data2 = 0; // device id (always 0)
|
||||
data3 = 0; // unused
|
||||
break;
|
||||
}
|
||||
case CELL_CAMERA_READ_DIRECT:
|
||||
{
|
||||
const u64 image_data_size = static_cast<u64>(info.bytesize);
|
||||
const u64 buffer_number = 0;
|
||||
const u64 camera_id = 0;
|
||||
|
||||
data2 = image_data_size << 32 | buffer_number << 16 | camera_id;
|
||||
data3 = timer.GetElapsedTimeInMicroSec(); // timestamp
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
cellCamera.error("Unknown read mode set: %d. This should never happen.", read_mode.load());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const auto send_status = queue->send(evt_data.source, CELL_CAMERA_FRAME_UPDATE, data2, data3);
|
||||
if (LIKELY(send_status))
|
||||
{
|
||||
++frame_num;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const std::chrono::microseconds frame_target_time{ static_cast<u32>(1000000.0 / info.framerate) };
|
||||
|
||||
std::chrono::steady_clock::time_point now = std::chrono::steady_clock::now();
|
||||
|
||||
std::chrono::microseconds frame_processing_time = std::chrono::duration_cast<std::chrono::microseconds>(now - frame_start);
|
||||
|
||||
if (frame_processing_time < frame_target_time)
|
||||
{
|
||||
std::chrono::microseconds frame_idle_time = frame_target_time - frame_processing_time;
|
||||
std::this_thread::sleep_for(frame_idle_time);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void camera_thread::on_init(const std::shared_ptr<void>& _this)
|
||||
{
|
||||
named_thread::on_init(_this);
|
||||
}
|
||||
|
||||
void camera_thread::send_attach_state(bool attached)
|
||||
{
|
||||
semaphore_lock lock(mutex_notify_data_map);
|
||||
|
||||
if (!notify_data_map.empty())
|
||||
{
|
||||
for (auto const& notify_data_entry : notify_data_map)
|
||||
{
|
||||
const auto& key = notify_data_entry.first;
|
||||
const auto& evt_data = notify_data_entry.second;
|
||||
|
||||
if (auto queue = lv2_event_queue::find(key))
|
||||
{
|
||||
const auto send_result = queue->send(evt_data.source, attached ? CELL_CAMERA_ATTACH : CELL_CAMERA_DETACH, 0, 0);
|
||||
if (LIKELY(send_result))
|
||||
{
|
||||
is_attached = attached;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// We're not expected to send any events for attaching/detaching
|
||||
is_attached = attached;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
namespace vm { using namespace ps3; }
|
||||
#include "Utilities/Timer.h"
|
||||
#include "Emu/Cell/lv2/sys_memory.h"
|
||||
#include "Utilities/sema.h"
|
||||
#include "Utilities/Thread.h"
|
||||
|
||||
#include <map>
|
||||
|
||||
|
||||
// Error Codes
|
||||
enum
|
||||
@@ -20,7 +26,7 @@ enum
|
||||
CELL_CAMERA_ERROR_FATAL = 0x8014080f,
|
||||
};
|
||||
|
||||
// Event types
|
||||
// Event masks
|
||||
enum
|
||||
{
|
||||
CELL_CAMERA_EFLAG_FRAME_UPDATE = 0x00000001,
|
||||
@@ -31,6 +37,26 @@ enum
|
||||
CELL_CAMERA_EFLAG_RESET = 0x00000020,
|
||||
};
|
||||
|
||||
// Event types
|
||||
enum
|
||||
{
|
||||
CELL_CAMERA_DETACH = 0,
|
||||
CELL_CAMERA_ATTACH = 1,
|
||||
CELL_CAMERA_FRAME_UPDATE = 2,
|
||||
CELL_CAMERA_OPEN = 3,
|
||||
CELL_CAMERA_CLOSE = 4,
|
||||
CELL_CAMERA_START = 5,
|
||||
CELL_CAMERA_STOP = 6,
|
||||
CELL_CAMERA_RESET = 7
|
||||
};
|
||||
|
||||
// Read mode
|
||||
enum
|
||||
{
|
||||
CELL_CAMERA_READ_FUNCCALL = 0,
|
||||
CELL_CAMERA_READ_DIRECT = 1,
|
||||
};
|
||||
|
||||
// Colormatching
|
||||
enum
|
||||
{
|
||||
@@ -286,14 +312,14 @@ enum CellCameraAttribute : s32
|
||||
|
||||
struct CellCameraInfoEx
|
||||
{
|
||||
be_t<s32> format; // CellCameraFormat
|
||||
be_t<s32> format; // CellCameraFormat
|
||||
be_t<s32> resolution; // CellCameraResolution
|
||||
be_t<s32> framerate;
|
||||
|
||||
vm::bptr<u8> buffer;
|
||||
be_t<s32> bytesize;
|
||||
be_t<s32> width;
|
||||
be_t<s32> height;
|
||||
be_t<s32> width; // only used if resolution == CELL_CAMERA_SPECIFIED_WIDTH_HEIGHT
|
||||
be_t<s32> height; // likewise
|
||||
be_t<s32> dev_num;
|
||||
be_t<s32> guid;
|
||||
|
||||
@@ -311,3 +337,52 @@ struct CellCameraReadEx
|
||||
be_t<s64> timestamp;
|
||||
vm::bptr<u8> pbuf;
|
||||
};
|
||||
|
||||
class camera_thread final : public named_thread
|
||||
{
|
||||
private:
|
||||
struct notify_event_data
|
||||
{
|
||||
u64 source;
|
||||
u64 flag;
|
||||
};
|
||||
|
||||
void on_task() override;
|
||||
|
||||
std::string get_name() const override { return "Camera Thread"; }
|
||||
|
||||
public:
|
||||
void on_init(const std::shared_ptr<void>&) override;
|
||||
void send_attach_state(bool attached);
|
||||
|
||||
std::map<u64, notify_event_data> notify_data_map;
|
||||
|
||||
semaphore<> mutex;
|
||||
semaphore<> mutex_notify_data_map;
|
||||
Timer timer;
|
||||
|
||||
atomic_t<u8> read_mode;
|
||||
atomic_t<bool> is_streaming;
|
||||
atomic_t<bool> is_attached;
|
||||
atomic_t<bool> is_open;
|
||||
|
||||
CellCameraInfoEx info;
|
||||
|
||||
struct attr_t
|
||||
{
|
||||
u32 v1, v2;
|
||||
};
|
||||
attr_t attr[500]{};
|
||||
|
||||
lv2_memory_container container;
|
||||
atomic_t<u32> frame_num;
|
||||
|
||||
camera_thread() : read_mode(CELL_CAMERA_READ_FUNCCALL) {}
|
||||
~camera_thread() = default;
|
||||
};
|
||||
|
||||
/// Shared data between cellGem and cellCamera
|
||||
struct gem_camera_shared
|
||||
{
|
||||
atomic_t<s64> frame_timestamp; // latest read timestamp from cellCamera (cellCameraRead(Ex))
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
namespace vm { using namespace ps3; }
|
||||
|
||||
|
||||
// libCelp8Enc = 0x806140a1 - 0x806140bf
|
||||
|
||||
@@ -19,9 +19,9 @@ enum
|
||||
enum
|
||||
{
|
||||
CELL_CELP8ENC_FS_8kHz = 1,
|
||||
|
||||
|
||||
CELL_CELP8ENC_EXCITATION_MODE_MPE = 0,
|
||||
|
||||
|
||||
CELL_CELP8ENC_MPE_CONFIG_0 = 0,
|
||||
CELL_CELP8ENC_MPE_CONFIG_2 = 2,
|
||||
CELL_CELP8ENC_MPE_CONFIG_6 = 6,
|
||||
@@ -32,6 +32,6 @@ enum
|
||||
CELL_CELP8ENC_MPE_CONFIG_21 = 21,
|
||||
CELL_CELP8ENC_MPE_CONFIG_24 = 24,
|
||||
CELL_CELP8ENC_MPE_CONFIG_26 = 26,
|
||||
|
||||
|
||||
CELL_CELP8ENC_WORD_SZ_FLOAT,
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
namespace vm { using namespace ps3; }
|
||||
|
||||
|
||||
// libCelpEnc = 0x80614001 - 0x806140ff
|
||||
|
||||
@@ -19,14 +19,14 @@ enum
|
||||
enum
|
||||
{
|
||||
CELL_CELPENC_FS_16kHz = 2,
|
||||
|
||||
|
||||
CELL_CELPENC_EXCITATION_MODE_RPE = 1,
|
||||
|
||||
|
||||
CELL_CELPENC_RPE_CONFIG_0,
|
||||
CELL_CELPENC_RPE_CONFIG_1,
|
||||
CELL_CELPENC_RPE_CONFIG_2,
|
||||
CELL_CELPENC_RPE_CONFIG_3,
|
||||
|
||||
|
||||
CELL_CELPENC_WORD_SZ_INI16_LE,
|
||||
CELL_CELPENC_WORD_SZ_FLOAT,
|
||||
};
|
||||
|
||||
@@ -1,11 +1,18 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
#include "cellSysutil.h"
|
||||
|
||||
|
||||
namespace vm { using namespace ps3; }
|
||||
|
||||
logs::channel cellCrossController("cellCrossController");
|
||||
|
||||
enum
|
||||
{
|
||||
CELL_CROSS_CONTROLLER_STATUS_INITIALIZED = 1,
|
||||
CELL_CROSS_CONTROLLER_STATUS_FINALIZED = 2
|
||||
};
|
||||
|
||||
struct CellCrossControllerParam
|
||||
{
|
||||
vm::bcptr<char> pPackageFileName;
|
||||
@@ -26,6 +33,15 @@ using CellCrossControllerCallback = void(s32 status, s32 errorCode, vm::ptr<void
|
||||
s32 cellCrossControllerInitialize(vm::cptr<CellCrossControllerParam> pParam, vm::cptr<CellCrossControllerPackageInfo> pPkgInfo, vm::ptr<CellCrossControllerCallback> cb, vm::ptr<void> userdata) // LittleBigPlanet 2 and 3
|
||||
{
|
||||
cellCrossController.todo("cellCrossControllerInitialize(pParam=*0x%x, pPkgInfo=*0x%x, cb=*0x%x, userdata=*0x%x)", pParam, pPkgInfo, cb, userdata);
|
||||
|
||||
sysutil_register_cb([=](ppu_thread& ppu) -> s32
|
||||
{
|
||||
cb(ppu, CELL_CROSS_CONTROLLER_STATUS_INITIALIZED, CELL_OK, vm::null, userdata);
|
||||
cb(ppu, CELL_CROSS_CONTROLLER_STATUS_FINALIZED, CELL_OK, vm::null, userdata);
|
||||
|
||||
return CELL_OK;
|
||||
});
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
namespace vm { using namespace ps3; }
|
||||
|
||||
|
||||
// libDaisy = 0x80410501 - 0x804105ff
|
||||
|
||||
@@ -35,7 +35,7 @@ enum
|
||||
CELL_DAISY_MIN_ENTRY_SIZE = 16,
|
||||
CELL_DAISY_MAX_ENTRY_SIZE = (16*1024),
|
||||
CELL_DAISY_MAX_DMA_TAG = 31,
|
||||
|
||||
|
||||
// CELL_DAISY_ENTRY_SIZE(x)
|
||||
// CELL_DAISY_EA_ATOMIC(x)
|
||||
// CELL_DAISY_EA_DMA(x)
|
||||
@@ -48,35 +48,35 @@ enum
|
||||
// Queue IO
|
||||
DAISY_OUTPUT,
|
||||
DAISY_INPUT,
|
||||
|
||||
|
||||
// Block Mode
|
||||
DAISY_NOT_STALL = 0,
|
||||
DAISY_STALL = 1,
|
||||
|
||||
|
||||
// Queue Status
|
||||
DAISY_PTR_UNAVAILABLE = 0x40000001,
|
||||
DAISY_PTR_TERMINATED = 0x40000002,
|
||||
|
||||
|
||||
// Buffer Mode
|
||||
DAISY_COPY = 0,
|
||||
DAISY_REFERENCE = 1,
|
||||
|
||||
|
||||
// Constructor Mode
|
||||
DAISY_NO_PARAMETER = 0,
|
||||
DAISY_PARAMETER = 1,
|
||||
|
||||
|
||||
// Glue Mode
|
||||
DAISY_ONE_PORT = 1,
|
||||
DAISY_TWO_PORT = 2,
|
||||
|
||||
|
||||
// Queue Mode
|
||||
DAISY_IN_ORDER,
|
||||
DAISY_OUT_OF_ORDER,
|
||||
|
||||
|
||||
// Buffer Type
|
||||
DAISY_BUFFER_TYPE_REMOTE = 1,
|
||||
DAISY_BUFFER_TYPE_LOCAL = 2,
|
||||
|
||||
|
||||
// Queue Control Type
|
||||
DAISY_QCTL_TYPE_ATOMIC = 1,
|
||||
DAISY_QCTL_TYPE_LOCAL = 2,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
namespace vm { using namespace ps3; }
|
||||
|
||||
|
||||
// Error Codes
|
||||
enum
|
||||
@@ -156,7 +156,7 @@ struct CellDmuxEsMsg
|
||||
be_t<u64> supplementalInfo;
|
||||
};
|
||||
|
||||
struct CellDmuxType
|
||||
struct CellDmuxType
|
||||
{
|
||||
be_t<s32> streamType; // CellDmuxStreamType
|
||||
be_t<u32> reserved[2];
|
||||
@@ -223,7 +223,7 @@ using CellDmuxCbMsg = u32(u32 demuxerHandle, vm::ptr<CellDmuxMsg> demuxerMsg, u3
|
||||
|
||||
struct CellDmuxCb
|
||||
{
|
||||
vm::bptr<CellDmuxCbMsg> cbMsgFunc;
|
||||
vm::bptr<CellDmuxCbMsg> cbMsgFunc;
|
||||
be_t<u32> cbArg;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
namespace vm { using namespace ps3; }
|
||||
|
||||
|
||||
// Return Codes
|
||||
enum CellFiberError : u32
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "stdafx.h"
|
||||
#include "stdafx.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
@@ -554,7 +554,7 @@ s32 cellFontExtend(u32 a1, u32 a2, u32 a3)
|
||||
//Something happens
|
||||
}
|
||||
//Something happens?
|
||||
return CELL_OK;
|
||||
return -1;
|
||||
}
|
||||
|
||||
s32 cellFontRenderCharGlyphImageVertical()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
namespace vm { using namespace ps3; }
|
||||
|
||||
|
||||
// Error codes
|
||||
enum
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include "cellFont.h"
|
||||
|
||||
namespace vm { using namespace ps3; }
|
||||
|
||||
|
||||
struct CellFontLibraryConfigFT
|
||||
{
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include <mutex>
|
||||
|
||||
namespace vm { using namespace ps3; }
|
||||
|
||||
|
||||
logs::channel cellFs("cellFs");
|
||||
|
||||
@@ -417,7 +417,7 @@ error_code cellFsGetDirectoryEntries(u32 fd, vm::ptr<CellFsDirectoryEntry> entri
|
||||
return CellError(+op->arg._code);
|
||||
}
|
||||
|
||||
return not_an_error(rc);
|
||||
return not_an_error(rc);
|
||||
}
|
||||
|
||||
error_code cellFsReadWithOffset(u32 fd, u64 offset, vm::ptr<void> buf, u64 buffer_size, vm::ptr<u64> nread)
|
||||
@@ -433,7 +433,7 @@ error_code cellFsReadWithOffset(u32 fd, u64 offset, vm::ptr<void> buf, u64 buffe
|
||||
vm::var<lv2_file_op_rw> arg;
|
||||
|
||||
arg->_vtable = vm::cast(0xfa8a0000); // Intentionally wrong (provide correct vtable if necessary)
|
||||
|
||||
|
||||
arg->op = 0x8000000a;
|
||||
arg->fd = fd;
|
||||
arg->buf = buf;
|
||||
@@ -447,7 +447,7 @@ error_code cellFsReadWithOffset(u32 fd, u64 offset, vm::ptr<void> buf, u64 buffe
|
||||
{
|
||||
*nread = rc && rc != CELL_EFSSPECIFIC ? 0 : arg->out_size.value();
|
||||
}
|
||||
|
||||
|
||||
if (!rc && arg->out_code)
|
||||
{
|
||||
return CellError(+arg->out_code);
|
||||
@@ -475,7 +475,7 @@ error_code cellFsWriteWithOffset(u32 fd, u64 offset, vm::cptr<void> buf, u64 dat
|
||||
vm::var<lv2_file_op_rw> arg;
|
||||
|
||||
arg->_vtable = vm::cast(0xfa8b0000); // Intentionally wrong (provide correct vtable if necessary)
|
||||
|
||||
|
||||
arg->op = 0x8000000b;
|
||||
arg->fd = fd;
|
||||
arg->buf = vm::const_ptr_cast<void>(buf);
|
||||
@@ -623,7 +623,7 @@ error_code cellFsAllocateFileAreaWithoutZeroFill(vm::cptr<char> path, u64 size)
|
||||
{
|
||||
return CellError(rc);
|
||||
}
|
||||
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@@ -670,7 +670,7 @@ s32 cellFsStReadInit(u32 fd, vm::cptr<CellFsRingBuffer> ringbuf)
|
||||
{
|
||||
return CELL_EBADF;
|
||||
}
|
||||
|
||||
|
||||
if (file->flags & CELL_FS_O_WRONLY)
|
||||
{
|
||||
return CELL_EPERM;
|
||||
@@ -780,7 +780,7 @@ s32 cellFsStReadStop(u32 fd)
|
||||
s32 cellFsStRead(u32 fd, vm::ptr<u8> buf, u64 size, vm::ptr<u64> rsize)
|
||||
{
|
||||
cellFs.todo("cellFsStRead(fd=%d, buf=*0x%x, size=0x%llx, rsize=*0x%x)", fd, buf, size, rsize);
|
||||
|
||||
|
||||
const auto file = idm::get<lv2_fs_object, lv2_file>(fd);
|
||||
|
||||
if (!file)
|
||||
@@ -812,7 +812,7 @@ s32 cellFsStReadGetCurrentAddr(u32 fd, vm::ptr<u32> addr, vm::ptr<u64> size)
|
||||
s32 cellFsStReadPutCurrentAddr(u32 fd, vm::ptr<u8> addr, u64 size)
|
||||
{
|
||||
cellFs.todo("cellFsStReadPutCurrentAddr(fd=%d, addr=*0x%x, size=0x%llx)", fd, addr, size);
|
||||
|
||||
|
||||
const auto file = idm::get<lv2_fs_object, lv2_file>(fd);
|
||||
|
||||
if (!file)
|
||||
@@ -828,7 +828,7 @@ s32 cellFsStReadPutCurrentAddr(u32 fd, vm::ptr<u8> addr, u64 size)
|
||||
s32 cellFsStReadWait(u32 fd, u64 size)
|
||||
{
|
||||
cellFs.todo("cellFsStReadWait(fd=%d, size=0x%llx)", fd, size);
|
||||
|
||||
|
||||
const auto file = idm::get<lv2_fs_object, lv2_file>(fd);
|
||||
|
||||
if (!file)
|
||||
@@ -837,7 +837,7 @@ s32 cellFsStReadWait(u32 fd, u64 size)
|
||||
}
|
||||
|
||||
// TODO
|
||||
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@@ -853,7 +853,7 @@ s32 cellFsStReadWaitCallback(u32 fd, u64 size, vm::ptr<void(s32 xfd, u64 xsize)>
|
||||
}
|
||||
|
||||
// TODO
|
||||
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -63,6 +63,22 @@ void fmt_class_string<CellGameDataError>::format(std::string& out, u64 arg)
|
||||
});
|
||||
}
|
||||
|
||||
template<>
|
||||
void fmt_class_string<CellDiscGameError>::format(std::string& out, u64 arg)
|
||||
{
|
||||
format_enum(out, arg, [](auto error)
|
||||
{
|
||||
switch (error)
|
||||
{
|
||||
STR_CASE(CELL_DISCGAME_ERROR_INTERNAL);
|
||||
STR_CASE(CELL_DISCGAME_ERROR_NOT_DISCBOOT);
|
||||
STR_CASE(CELL_DISCGAME_ERROR_PARAM);
|
||||
}
|
||||
|
||||
return unknown;
|
||||
});
|
||||
}
|
||||
|
||||
// If dir is empty:
|
||||
// contentInfo = "/dev_bdvd/PS3_GAME"
|
||||
// usrdir = "/dev_bdvd/PS3_GAME/USRDIR"
|
||||
@@ -83,6 +99,8 @@ struct content_permission final
|
||||
// Temporary directory path
|
||||
std::string temp;
|
||||
|
||||
bool can_create = false;
|
||||
|
||||
template <typename Dir, typename Sfo>
|
||||
content_permission(Dir&& dir, Sfo&& sfo)
|
||||
: dir(std::forward<Dir>(dir))
|
||||
@@ -182,7 +200,7 @@ s32 cellHddGameGetSizeKB(vm::ptr<u32> size)
|
||||
{
|
||||
cellGame.warning("cellHddGameGetSizeKB(size=*0x%x)", size);
|
||||
|
||||
const std::string local_dir = vfs::get("/dev_hdd0/game/" + Emu.GetTitleID());
|
||||
const std::string local_dir = vfs::get(Emu.GetDir());
|
||||
|
||||
if (!fs::is_dir(local_dir))
|
||||
{
|
||||
@@ -210,7 +228,7 @@ s32 cellGameDataGetSizeKB(vm::ptr<u32> size)
|
||||
{
|
||||
cellGame.warning("cellGameDataGetSizeKB(size=*0x%x)", size);
|
||||
|
||||
const std::string local_dir = vfs::get("/dev_hdd0/game/" + Emu.GetTitleID());
|
||||
const std::string local_dir = vfs::get(Emu.GetDir());
|
||||
|
||||
if (!fs::is_dir(local_dir))
|
||||
{
|
||||
@@ -270,7 +288,7 @@ error_code cellGameBootCheck(vm::ptr<u32> type, vm::ptr<u32> attributes, vm::ptr
|
||||
*attributes = CELL_GAME_ATTRIBUTE_PATCH; // TODO
|
||||
if (dirName) strcpy_trunc(*dirName, Emu.GetTitleID()); // ???
|
||||
|
||||
if (!fxm::make<content_permission>("", psf::load_object(fs::file(vfs::get("/dev_hdd0/game/" + Emu.GetTitleID() + "/PARAM.SFO")))))
|
||||
if (!fxm::make<content_permission>("", psf::load_object(fs::file(vfs::get(Emu.GetDir() + "PARAM.SFO")))))
|
||||
{
|
||||
return CELL_GAME_ERROR_BUSY;
|
||||
}
|
||||
@@ -281,7 +299,7 @@ error_code cellGameBootCheck(vm::ptr<u32> type, vm::ptr<u32> attributes, vm::ptr
|
||||
*attributes = 0; // TODO
|
||||
if (dirName) strcpy_trunc(*dirName, Emu.GetTitleID());
|
||||
|
||||
if (!fxm::make<content_permission>(Emu.GetTitleID(), psf::load_object(fs::file(vfs::get("/dev_hdd0/game/" + Emu.GetTitleID() + "/PARAM.SFO")))))
|
||||
if (!fxm::make<content_permission>(Emu.GetTitleID(), psf::load_object(fs::file(vfs::get(Emu.GetDir() + "PARAM.SFO")))))
|
||||
{
|
||||
return CELL_GAME_ERROR_BUSY;
|
||||
}
|
||||
@@ -309,7 +327,7 @@ error_code cellGamePatchCheck(vm::ptr<CellGameContentSize> size, vm::ptr<void> r
|
||||
return CELL_GAME_ERROR_NOTPATCH;
|
||||
}
|
||||
|
||||
if (!fxm::make<content_permission>(Emu.GetTitleID(), psf::load_object(fs::file(vfs::get("/dev_hdd0/game/" + Emu.GetTitleID() + "/PARAM.SFO")))))
|
||||
if (!fxm::make<content_permission>(Emu.GetTitleID(), psf::load_object(fs::file(vfs::get(Emu.GetDir() + "PARAM.SFO")))))
|
||||
{
|
||||
return CELL_GAME_ERROR_BUSY;
|
||||
}
|
||||
@@ -344,6 +362,11 @@ error_code cellGameDataCheck(u32 type, vm::cptr<char> dirName, vm::ptr<CellGameC
|
||||
return CELL_GAME_ERROR_BUSY;
|
||||
}
|
||||
|
||||
if (type == CELL_GAME_GAMETYPE_GAMEDATA)
|
||||
{
|
||||
prm->can_create = true;
|
||||
}
|
||||
|
||||
const std::string dir = prm->dir.empty() ? "/dev_bdvd/PS3_GAME"s : "/dev_hdd0/game/" + prm->dir;
|
||||
|
||||
if (!fs::is_dir(vfs::get(dir)))
|
||||
@@ -353,7 +376,6 @@ error_code cellGameDataCheck(u32 type, vm::cptr<char> dirName, vm::ptr<CellGameC
|
||||
}
|
||||
|
||||
prm->sfo = psf::load_object(fs::file(vfs::get(dir + "/PARAM.SFO")));
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@@ -380,18 +402,17 @@ error_code cellGameContentPermit(vm::ptr<char[CELL_GAME_PATH_MAX]> contentInfoPa
|
||||
// Make temporary directory persistent
|
||||
const auto vdir = vfs::get(dir);
|
||||
|
||||
if (fs::exists(vdir))
|
||||
{
|
||||
fmt::throw_exception("cellGameContentPermit(): epic fail: directory '%s' already exists", dir);
|
||||
}
|
||||
|
||||
if (fs::rename(prm->temp, vdir, false))
|
||||
{
|
||||
cellGame.success("cellGameContentPermit(): directory '%s' has been created", dir);
|
||||
}
|
||||
else
|
||||
{
|
||||
fmt::throw_exception("cellGameContentPermit(): failed to initialize directory '%s'", dir);
|
||||
cellGame.error("cellGameContentPermit(): failed to initialize directory '%s' (%s)", dir, fs::g_tls_error);
|
||||
strcpy_trunc(*contentInfoPath, dir);
|
||||
strcpy_trunc(*usrdirPath, dir + "/USRDIR");
|
||||
verify(HERE), fxm::remove<content_permission>();
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
// Create PARAM.SFO
|
||||
@@ -444,7 +465,7 @@ error_code cellGameDataCheckCreate2(ppu_thread& ppu, u32 version, vm::cptr<char>
|
||||
cbGet->sizeKB = CELL_GAMEDATA_SIZEKB_NOTCALC;
|
||||
cbGet->sysSizeKB = 0;
|
||||
|
||||
psf::registry sfo = psf::load_object(fs::file(vfs::get(Emu.GetCat() == "DG" ? "/dev_bdvd/PS3_GAME/PARAM.SFO"s : "/dev_hdd0/game/" + Emu.GetTitleID() + "/PARAM.SFO")));
|
||||
psf::registry sfo = psf::load_object(fs::file(vfs::get(dir + "/PARAM.SFO")));
|
||||
|
||||
cbGet->getParam.attribute = CELL_GAMEDATA_ATTR_NORMAL;
|
||||
cbGet->getParam.parentalLevel = psf::get_integer(sfo, "PARENTAL_LEVEL", 0);
|
||||
@@ -549,6 +570,11 @@ error_code cellGameCreateGameData(vm::ptr<CellGameSetInitParams> init, vm::ptr<c
|
||||
return CELL_GAME_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
if (!prm->can_create)
|
||||
{
|
||||
return CELL_GAME_ERROR_NOTSUPPORTED;
|
||||
}
|
||||
|
||||
std::string tmp_contentInfo = "/dev_hdd1/game/" + prm->dir;
|
||||
std::string tmp_usrdir = "/dev_hdd1/game/" + prm->dir + "/USRDIR";
|
||||
|
||||
@@ -831,16 +857,18 @@ s32 cellDiscGameGetBootDiscInfo(vm::ptr<CellDiscGameSystemFileParam> getParam)
|
||||
{
|
||||
cellGame.warning("cellDiscGameGetBootDiscInfo(getParam=*0x%x)", getParam);
|
||||
|
||||
if (!getParam)
|
||||
return CELL_DISCGAME_ERROR_PARAM;
|
||||
|
||||
// This is also called by non-disc games, see NPUB90029
|
||||
const std::string dir = "/dev_bdvd/PS3_GAME"s;
|
||||
|
||||
if (!fs::is_dir(vfs::get(dir)))
|
||||
{
|
||||
// Not a disc game. TODO: Fetch PARAM.SFO from proper game dir
|
||||
cellGame.warning("cellDiscGameGetBootDiscInfo(): directory '%s' not found", dir);
|
||||
getParam->parentalLevel = 0;
|
||||
strcpy_trunc(getParam->titleId, "0");
|
||||
return CELL_OK;
|
||||
|
||||
return CELL_DISCGAME_ERROR_NOT_DISCBOOT;
|
||||
}
|
||||
|
||||
const auto& psf = psf::load_object(fs::file(vfs::get(dir + "/PARAM.SFO")));
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include "Emu/Cell/ErrorCodes.h"
|
||||
|
||||
namespace vm { using namespace ps3; }
|
||||
|
||||
|
||||
// Return Codes
|
||||
enum
|
||||
@@ -43,6 +43,13 @@ enum CellGameDataError : u32
|
||||
CELL_GAMEDATA_ERROR_FAILURE = 0x8002b607,
|
||||
};
|
||||
|
||||
enum CellDiscGameError : u32
|
||||
{
|
||||
CELL_DISCGAME_ERROR_INTERNAL = 0x8002bd01,
|
||||
CELL_DISCGAME_ERROR_NOT_DISCBOOT = 0x8002bd02,
|
||||
CELL_DISCGAME_ERROR_PARAM = 0x8002bd03,
|
||||
};
|
||||
|
||||
// Definitions
|
||||
enum
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
namespace vm { using namespace ps3; }
|
||||
|
||||
|
||||
#include "Emu/RSX/GCM.h"
|
||||
|
||||
|
||||
@@ -1,25 +1,326 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/IdManager.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
#include "cellGem.h"
|
||||
|
||||
#include "cellCamera.h"
|
||||
#include "Emu/IdManager.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
#include "pad_thread.h"
|
||||
#include "Utilities/Timer.h"
|
||||
|
||||
logs::channel cellGem("cellGem");
|
||||
|
||||
// **********************
|
||||
// * HLE helper structs *
|
||||
// **********************
|
||||
|
||||
struct gem_t
|
||||
{
|
||||
struct gem_color
|
||||
{
|
||||
float r, g, b;
|
||||
|
||||
gem_color() : r(0.0f), g(0.0f), b(0.0f) {}
|
||||
gem_color(float r_, float g_, float b_)
|
||||
{
|
||||
r = clamp(r_);
|
||||
g = clamp(g_);
|
||||
b = clamp(b_);
|
||||
}
|
||||
|
||||
float clamp(float f) const
|
||||
{
|
||||
return std::max(0.0f, std::min(f, 1.0f));
|
||||
}
|
||||
};
|
||||
|
||||
struct gem_controller
|
||||
{
|
||||
u32 status; // connection status (CELL_GEM_STATUS_DISCONNECTED or CELL_GEM_STATUS_READY)
|
||||
u32 port; // assigned port
|
||||
bool enabled_magnetometer; // whether the magnetometer is enabled (probably used for additional rotational precision)
|
||||
bool calibrated_magnetometer; // whether the magnetometer is calibrated
|
||||
bool enabled_filtering; // whether filtering is enabled
|
||||
u8 rumble; // rumble intensity
|
||||
gem_color sphere_rgb; // RGB color of the sphere LED
|
||||
|
||||
gem_controller() :
|
||||
status(CELL_GEM_STATUS_DISCONNECTED),
|
||||
enabled_filtering(false), rumble(0), sphere_rgb() {}
|
||||
};
|
||||
|
||||
CellGemAttribute attribute;
|
||||
CellGemVideoConvertAttribute vc_attribute;
|
||||
u64 status_flags;
|
||||
bool enable_pitch_correction;
|
||||
u32 inertial_counter;
|
||||
|
||||
std::array<gem_controller, CELL_GEM_MAX_NUM> controllers;
|
||||
u32 connected_controllers;
|
||||
|
||||
Timer timer;
|
||||
|
||||
// helper functions
|
||||
bool is_controller_ready(u32 gem_num) const
|
||||
{
|
||||
return controllers[gem_num].status == CELL_GEM_STATUS_READY;
|
||||
}
|
||||
|
||||
void reset_controller(u32 gem_num)
|
||||
{
|
||||
switch (g_cfg.io.move)
|
||||
{
|
||||
default:
|
||||
case move_handler::null:
|
||||
{
|
||||
connected_controllers = 0;
|
||||
|
||||
controllers[gem_num].status = CELL_GEM_STATUS_DISCONNECTED;
|
||||
controllers[gem_num].port = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
case move_handler::fake:
|
||||
{
|
||||
// fake one connected controller
|
||||
connected_controllers = 1;
|
||||
|
||||
if (gem_num < connected_controllers)
|
||||
{
|
||||
controllers[gem_num].status = CELL_GEM_STATUS_READY;
|
||||
controllers[gem_num].port = 7u - gem_num;
|
||||
}
|
||||
else
|
||||
{
|
||||
controllers[gem_num].status = CELL_GEM_STATUS_DISCONNECTED;
|
||||
controllers[gem_num].port = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
s32 cellGemCalibrate()
|
||||
// ************************
|
||||
// * HLE helper functions *
|
||||
// ************************
|
||||
|
||||
template <>
|
||||
void fmt_class_string<move_handler>::format(std::string& out, u64 arg)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellGem);
|
||||
format_enum(out, arg, [](auto value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case move_handler::null: return "Null";
|
||||
case move_handler::fake: return "Fake";
|
||||
}
|
||||
|
||||
return unknown;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Verifies that a Move controller id is valid
|
||||
* \param gem_num Move controler ID to verify
|
||||
* \return True if the ID is valid, false otherwise
|
||||
*/
|
||||
static bool check_gem_num(const u32 gem_num)
|
||||
{
|
||||
return gem_num >= 0 && gem_num < CELL_GEM_MAX_NUM;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Maps Move controller data (digital buttons, and analog Trigger data) to DS3 pad input.
|
||||
* Unavoidably buttons conflict with DS3 mappings, which is problematic for some games.
|
||||
* \param port_no DS3 port number to use
|
||||
* \param digital_buttons Bitmask filled with CELL_GEM_CTRL_* values
|
||||
* \param analog_t Analog value of Move's Trigger. Currently mapped to R2.
|
||||
* \return true on success, false if port_no controller is invalid
|
||||
*/
|
||||
static bool map_to_ds3_input(const u32 port_no, be_t<u16>& digital_buttons, be_t<u16>& analog_t)
|
||||
{
|
||||
const auto handler = fxm::get<pad_thread>();
|
||||
|
||||
if (!handler)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const PadInfo& rinfo = handler->GetInfo();
|
||||
|
||||
if (port_no >= rinfo.max_connect || port_no >= rinfo.now_connect)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
auto& pads = handler->GetPads();
|
||||
auto pad = pads[port_no];
|
||||
|
||||
for (Button& button : pad->m_buttons)
|
||||
{
|
||||
//here we check btns, and set pad accordingly,
|
||||
if (button.m_offset == CELL_PAD_BTN_OFFSET_DIGITAL2)
|
||||
{
|
||||
if (button.m_pressed) pad->m_digital_2 |= button.m_outKeyCode;
|
||||
else pad->m_digital_2 &= ~button.m_outKeyCode;
|
||||
|
||||
switch (button.m_outKeyCode)
|
||||
{
|
||||
case CELL_PAD_CTRL_SQUARE:
|
||||
pad->m_press_square = button.m_value;
|
||||
break;
|
||||
case CELL_PAD_CTRL_CROSS:
|
||||
pad->m_press_cross = button.m_value;
|
||||
break;
|
||||
case CELL_PAD_CTRL_CIRCLE:
|
||||
pad->m_press_circle = button.m_value;
|
||||
break;
|
||||
case CELL_PAD_CTRL_TRIANGLE:
|
||||
pad->m_press_triangle = button.m_value;
|
||||
break;
|
||||
case CELL_PAD_CTRL_R1:
|
||||
pad->m_press_R1 = button.m_value;
|
||||
break;
|
||||
case CELL_PAD_CTRL_L1:
|
||||
pad->m_press_L1 = button.m_value;
|
||||
break;
|
||||
case CELL_PAD_CTRL_R2:
|
||||
pad->m_press_R2 = button.m_value;
|
||||
break;
|
||||
case CELL_PAD_CTRL_L2:
|
||||
pad->m_press_L2 = button.m_value;
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
||||
if (button.m_flush)
|
||||
{
|
||||
button.m_pressed = false;
|
||||
button.m_flush = false;
|
||||
button.m_value = 0;
|
||||
}
|
||||
}
|
||||
|
||||
memset(&digital_buttons, 0, sizeof(digital_buttons));
|
||||
|
||||
// map the Move key to R1 and the Trigger to R2
|
||||
|
||||
if (pad->m_press_R1)
|
||||
digital_buttons |= CELL_GEM_CTRL_MOVE;
|
||||
if (pad->m_press_R2)
|
||||
digital_buttons |= CELL_GEM_CTRL_T;
|
||||
|
||||
if (pad->m_press_cross)
|
||||
digital_buttons |= CELL_GEM_CTRL_CROSS;
|
||||
if (pad->m_press_circle)
|
||||
digital_buttons |= CELL_GEM_CTRL_CIRCLE;
|
||||
if (pad->m_press_square)
|
||||
digital_buttons |= CELL_GEM_CTRL_SQUARE;
|
||||
if (pad->m_press_triangle)
|
||||
digital_buttons |= CELL_GEM_CTRL_TRIANGLE;
|
||||
if (pad->m_digital_1)
|
||||
digital_buttons |= CELL_GEM_CTRL_SELECT;
|
||||
if (pad->m_digital_2)
|
||||
digital_buttons |= CELL_GEM_CTRL_START;
|
||||
|
||||
analog_t = pad->m_press_R2;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Maps external Move controller data to DS3 input
|
||||
* Implementation detail: CellGemExtPortData's digital/analog fields map the same way as
|
||||
* libPad, so no translation is needed.
|
||||
* \param port_no DS3 port number to use
|
||||
* \param ext External data to modify
|
||||
* \return true on success, false if port_no controller is invalid
|
||||
*/
|
||||
static bool map_ext_to_ds3_input(const u32 port_no, CellGemExtPortData& ext)
|
||||
{
|
||||
const auto handler = fxm::get<pad_thread>();
|
||||
|
||||
if (!handler)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
auto& pads = handler->GetPads();
|
||||
|
||||
const PadInfo& rinfo = handler->GetInfo();
|
||||
|
||||
if (port_no >= rinfo.max_connect)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//We have a choice here of NO_DEVICE or READ_FAILED...lets try no device for now
|
||||
if (port_no >= rinfo.now_connect)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
auto pad = pads[port_no];
|
||||
|
||||
ext.status = 0; // CELL_GEM_EXT_CONNECTED | CELL_GEM_EXT_EXT0 | CELL_GEM_EXT_EXT1
|
||||
ext.analog_left_x = pad->m_analog_left_x;
|
||||
ext.analog_left_y = pad->m_analog_left_y;
|
||||
ext.analog_right_x = pad->m_analog_right_x;
|
||||
ext.analog_right_y = pad->m_analog_right_y;
|
||||
ext.digital1 = pad->m_digital_1;
|
||||
ext.digital2 = pad->m_digital_2;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// *********************
|
||||
// * cellGem functions *
|
||||
// *********************
|
||||
|
||||
s32 cellGemCalibrate(u32 gem_num)
|
||||
{
|
||||
cellGem.todo("cellGemCalibrate(gem_num=%d)", gem_num);
|
||||
const auto gem = fxm::get<gem_t>();
|
||||
|
||||
if (!gem)
|
||||
{
|
||||
return CELL_GEM_ERROR_UNINITIALIZED;
|
||||
}
|
||||
|
||||
if (!check_gem_num(gem_num))
|
||||
{
|
||||
return CELL_GEM_ERROR_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if (g_cfg.io.move == move_handler::fake)
|
||||
{
|
||||
gem->controllers[gem_num].calibrated_magnetometer = true;
|
||||
gem->status_flags = CELL_GEM_FLAG_CALIBRATION_OCCURRED | CELL_GEM_FLAG_CALIBRATION_SUCCEEDED;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellGemClearStatusFlags()
|
||||
s32 cellGemClearStatusFlags(u32 gem_num, u64 mask)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellGem);
|
||||
cellGem.todo("cellGemClearStatusFlags(gem_num=%d, mask=0x%x)", gem_num, mask);
|
||||
const auto gem = fxm::get<gem_t>();
|
||||
|
||||
if (!gem)
|
||||
{
|
||||
return CELL_GEM_ERROR_UNINITIALIZED;
|
||||
}
|
||||
|
||||
if (!check_gem_num(gem_num))
|
||||
{
|
||||
return CELL_GEM_ERROR_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
gem->status_flags &= ~mask;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@@ -35,15 +336,38 @@ s32 cellGemConvertVideoStart()
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellGemEnableCameraPitchAngleCorrection()
|
||||
s32 cellGemEnableCameraPitchAngleCorrection(u32 enable_flag)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellGem);
|
||||
cellGem.todo("cellGemEnableCameraPitchAngleCorrection(enable_flag=%d", enable_flag);
|
||||
const auto gem = fxm::get<gem_t>();
|
||||
|
||||
if (!gem)
|
||||
{
|
||||
return CELL_GEM_ERROR_UNINITIALIZED;
|
||||
}
|
||||
|
||||
gem->enable_pitch_correction = !!enable_flag;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellGemEnableMagnetometer()
|
||||
s32 cellGemEnableMagnetometer(u32 gem_num, u32 enable)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellGem);
|
||||
cellGem.todo("cellGemEnableMagnetometer(gem_num=%d, enable=0x%x)", gem_num, enable);
|
||||
const auto gem = fxm::get<gem_t>();
|
||||
|
||||
if (!gem)
|
||||
{
|
||||
return CELL_GEM_ERROR_UNINITIALIZED;
|
||||
}
|
||||
|
||||
if (!gem->is_controller_ready(gem_num))
|
||||
{
|
||||
return CELL_GEM_NOT_CONNECTED;
|
||||
}
|
||||
|
||||
gem->controllers[gem_num].enabled_magnetometer = !!enable;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@@ -59,15 +383,43 @@ s32 cellGemEnd()
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellGemFilterState()
|
||||
s32 cellGemFilterState(u32 gem_num, u32 enable)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellGem);
|
||||
cellGem.warning("cellGemFilterState(gem_num=%d, enable=%d)", gem_num, enable);
|
||||
const auto gem = fxm::get<gem_t>();
|
||||
|
||||
if (!gem)
|
||||
{
|
||||
return CELL_GEM_ERROR_UNINITIALIZED;
|
||||
}
|
||||
|
||||
if (!check_gem_num(gem_num))
|
||||
{
|
||||
return CELL_GEM_ERROR_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
gem->controllers[gem_num].enabled_filtering = !!enable;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellGemForceRGB()
|
||||
s32 cellGemForceRGB(u32 gem_num, float r, float g, float b)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellGem);
|
||||
cellGem.todo("cellGemForceRGB(gem_num=%d, r=%f, g=%f, b=%f)", gem_num, r, g, b);
|
||||
const auto gem = fxm::get<gem_t>();
|
||||
|
||||
if (!gem)
|
||||
{
|
||||
return CELL_GEM_ERROR_UNINITIALIZED;
|
||||
}
|
||||
|
||||
if (!check_gem_num(gem_num))
|
||||
{
|
||||
return CELL_GEM_ERROR_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
gem->controllers[gem_num].sphere_rgb = gem_t::gem_color(r, g, b);
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@@ -77,15 +429,30 @@ s32 cellGemGetAccelerometerPositionInDevice()
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellGemGetAllTrackableHues()
|
||||
s32 cellGemGetAllTrackableHues(vm::ptr<u8> hues)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellGem);
|
||||
cellGem.todo("cellGemGetAllTrackableHues(hues=*0x%x)");
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellGemGetCameraState()
|
||||
s32 cellGemGetCameraState(vm::ptr<CellGemCameraState> camera_state)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellGem);
|
||||
cellGem.todo("cellGemGetCameraState(camera_state=0x%x)", camera_state);
|
||||
const auto gem = fxm::get<gem_t>();
|
||||
|
||||
if (!gem)
|
||||
{
|
||||
return CELL_GEM_ERROR_UNINITIALIZED;
|
||||
}
|
||||
|
||||
if (!camera_state)
|
||||
{
|
||||
return CELL_GEM_ERROR_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
camera_state->exposure_time = 1.0f / 60.0f; // TODO: use correct framerate
|
||||
camera_state->gain = 1.0;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@@ -101,15 +468,68 @@ s32 cellGemGetHuePixels()
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellGemGetImageState()
|
||||
s32 cellGemGetImageState(u32 gem_num, vm::ptr<CellGemImageState> image_state)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellGem);
|
||||
cellGem.todo("cellGemGetImageState(gem_num=%d, image_state=&0x%x)", gem_num, image_state);
|
||||
const auto gem = fxm::get<gem_t>();
|
||||
|
||||
if (!gem)
|
||||
{
|
||||
return CELL_GEM_ERROR_UNINITIALIZED;
|
||||
}
|
||||
|
||||
if (!check_gem_num(gem_num))
|
||||
{
|
||||
return CELL_GEM_ERROR_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if (g_cfg.io.move == move_handler::fake)
|
||||
{
|
||||
auto shared_data = fxm::get_always<gem_camera_shared>();
|
||||
|
||||
image_state->frame_timestamp = shared_data->frame_timestamp.load();
|
||||
image_state->timestamp = image_state->frame_timestamp + 10; // arbitrarily define 10 usecs of frame processing
|
||||
image_state->visible = true;
|
||||
image_state->u = 0;
|
||||
image_state->v = 0;
|
||||
image_state->r = 20;
|
||||
image_state->r_valid = true;
|
||||
image_state->distance = 2 * 1000; // 2 meters away from camera
|
||||
// TODO
|
||||
image_state->projectionx = 1;
|
||||
image_state->projectiony = 1;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellGemGetInertialState()
|
||||
s32 cellGemGetInertialState(u32 gem_num, u32 state_flag, u64 timestamp, vm::ptr<CellGemInertialState> inertial_state)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellGem);
|
||||
cellGem.todo("cellGemGetInertialState(gem_num=%d, state_flag=%d, timestamp=0x%x, inertial_state=0x%x)", gem_num, state_flag, timestamp, inertial_state);
|
||||
const auto gem = fxm::get<gem_t>();
|
||||
|
||||
if (!gem)
|
||||
{
|
||||
return CELL_GEM_ERROR_UNINITIALIZED;
|
||||
}
|
||||
|
||||
if (!check_gem_num(gem_num) || !inertial_state || !gem->is_controller_ready(gem_num))
|
||||
{
|
||||
return CELL_GEM_ERROR_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if (g_cfg.io.move == move_handler::fake)
|
||||
{
|
||||
map_to_ds3_input(gem_num, inertial_state->pad.digitalbuttons, inertial_state->pad.analog_T);
|
||||
map_ext_to_ds3_input(gem_num, inertial_state->ext);
|
||||
|
||||
inertial_state->timestamp = gem->timer.GetElapsedTimeInMicroSec();
|
||||
|
||||
inertial_state->counter = gem->inertial_counter++;
|
||||
|
||||
inertial_state->accelerometer[0] = 10;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@@ -124,14 +544,19 @@ s32 cellGemGetInfo(vm::ptr<CellGemInfo> info)
|
||||
return CELL_GEM_ERROR_UNINITIALIZED;
|
||||
}
|
||||
|
||||
if (!info)
|
||||
{
|
||||
return CELL_GEM_ERROR_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
// TODO: Support connecting PlayStation Move controllers
|
||||
info->max_connect = gem->attribute.max_connect;
|
||||
info->now_connect = 0;
|
||||
info->now_connect = gem->connected_controllers;
|
||||
|
||||
for (int i = 0; i < CELL_GEM_MAX_NUM; i++)
|
||||
{
|
||||
info->status[i] = CELL_GEM_STATUS_DISCONNECTED;
|
||||
info->port[i] = 0;
|
||||
info->status[i] = gem->controllers[i].status;
|
||||
info->port[i] = gem->controllers[i].port;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
@@ -149,15 +574,46 @@ s32 cellGemGetMemorySize(s32 max_connect)
|
||||
return max_connect <= 2 ? 0x120000 : 0x140000;
|
||||
}
|
||||
|
||||
s32 cellGemGetRGB()
|
||||
s32 cellGemGetRGB(u32 gem_num, vm::ptr<float> r, vm::ptr<float> g, vm::ptr<float> b)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellGem);
|
||||
cellGem.todo("cellGemGetRGB(gem_num=%d, r=*0x%x, g=*0x%x, b=*0x%x)", gem_num, r, g, b);
|
||||
const auto gem = fxm::get<gem_t>();
|
||||
|
||||
if (!gem)
|
||||
{
|
||||
return CELL_GEM_ERROR_UNINITIALIZED;
|
||||
}
|
||||
|
||||
if (!check_gem_num(gem_num) | !r || !g || !b )
|
||||
{
|
||||
return CELL_GEM_ERROR_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
auto& sphere_color = gem->controllers[gem_num].sphere_rgb;
|
||||
*r = sphere_color.r;
|
||||
*g = sphere_color.g;
|
||||
*b = sphere_color.b;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellGemGetRumble()
|
||||
s32 cellGemGetRumble(u32 gem_num, vm::ptr<u8> rumble)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellGem);
|
||||
cellGem.todo("cellGemGetRumble(gem_num=%d, rumble=*0x%x)", gem_num, rumble);
|
||||
auto gem = fxm::get<gem_t>();
|
||||
|
||||
if (!gem)
|
||||
{
|
||||
return CELL_GEM_ERROR_UNINITIALIZED;
|
||||
}
|
||||
|
||||
if (!check_gem_num(gem_num) || !rumble)
|
||||
{
|
||||
return CELL_GEM_ERROR_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
*rumble = gem->controllers[gem_num].rumble;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@@ -167,17 +623,47 @@ s32 cellGemGetState(u32 gem_num, u32 flag, u64 time_parameter, vm::ptr<CellGemSt
|
||||
const auto gem = fxm::get<gem_t>();
|
||||
|
||||
if (!gem)
|
||||
{
|
||||
return CELL_GEM_ERROR_UNINITIALIZED;
|
||||
}
|
||||
|
||||
// clear out gem_state so no games get any funny ideas about them being connected...
|
||||
std::memset(gem_state.get_ptr(), 0, sizeof(CellGemState));
|
||||
if (!check_gem_num(gem_num))
|
||||
{
|
||||
return CELL_GEM_ERROR_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if (g_cfg.io.move == move_handler::fake)
|
||||
{
|
||||
map_to_ds3_input(gem_num, gem_state->pad.digitalbuttons, gem_state->pad.analog_T);
|
||||
map_ext_to_ds3_input(gem_num, gem_state->ext);
|
||||
|
||||
gem_state->tracking_flags = CELL_GEM_TRACKING_FLAG_POSITION_TRACKED |
|
||||
CELL_GEM_TRACKING_FLAG_VISIBLE;
|
||||
gem_state->timestamp = gem->timer.GetElapsedTimeInMicroSec();
|
||||
|
||||
gem_state->quat[3] = 1.0;
|
||||
}
|
||||
|
||||
return CELL_GEM_NOT_CONNECTED;
|
||||
}
|
||||
|
||||
s32 cellGemGetStatusFlags()
|
||||
s32 cellGemGetStatusFlags(u32 gem_num, vm::ptr<u64> flags)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellGem);
|
||||
cellGem.todo("cellGemGetStatusFlags(gem_num=%d, flags=*0x%x)", gem_num, flags);
|
||||
const auto gem = fxm::get<gem_t>();
|
||||
|
||||
if (!gem)
|
||||
{
|
||||
return CELL_GEM_ERROR_UNINITIALIZED;
|
||||
}
|
||||
|
||||
if (!check_gem_num(gem_num) || !flags)
|
||||
{
|
||||
return CELL_GEM_ERROR_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
*flags = gem->status_flags;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@@ -196,7 +682,6 @@ s32 cellGemHSVtoRGB()
|
||||
s32 cellGemInit(vm::cptr<CellGemAttribute> attribute)
|
||||
{
|
||||
cellGem.warning("cellGemInit(attribute=*0x%x)", attribute);
|
||||
|
||||
const auto gem = fxm::make<gem_t>();
|
||||
|
||||
if (!gem)
|
||||
@@ -204,8 +689,21 @@ s32 cellGemInit(vm::cptr<CellGemAttribute> attribute)
|
||||
return CELL_GEM_ERROR_ALREADY_INITIALIZED;
|
||||
}
|
||||
|
||||
if (!attribute || !attribute->spurs_addr || attribute->max_connect > CELL_GEM_MAX_NUM)
|
||||
{
|
||||
return CELL_GEM_ERROR_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
gem->attribute = *attribute;
|
||||
|
||||
for (auto gem_num = 0; gem_num < CELL_GEM_MAX_NUM; gem_num++)
|
||||
{
|
||||
gem->reset_controller(gem_num);
|
||||
}
|
||||
|
||||
// TODO: is this correct?
|
||||
gem->timer.Start();
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@@ -215,10 +713,17 @@ s32 cellGemInvalidateCalibration()
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellGemIsTrackableHue()
|
||||
s32 cellGemIsTrackableHue(u32 hue)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellGem);
|
||||
return CELL_OK;
|
||||
cellGem.todo("cellGemIsTrackableHue(hue=%d)", hue);
|
||||
const auto gem = fxm::get<gem_t>();
|
||||
|
||||
if (!gem || hue > 359)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
s32 cellGemPrepareCamera()
|
||||
@@ -227,9 +732,36 @@ s32 cellGemPrepareCamera()
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellGemPrepareVideoConvert()
|
||||
s32 cellGemPrepareVideoConvert(vm::cptr<CellGemVideoConvertAttribute> vc_attribute)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellGem);
|
||||
cellGem.todo("cellGemPrepareVideoConvert(vc_attribute=*0x%x)", vc_attribute);
|
||||
auto gem = fxm::get<gem_t>();
|
||||
|
||||
if (!gem)
|
||||
{
|
||||
return CELL_GEM_ERROR_UNINITIALIZED;
|
||||
}
|
||||
|
||||
if (!vc_attribute)
|
||||
{
|
||||
return CELL_GEM_ERROR_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
const auto vc = *vc_attribute;
|
||||
|
||||
if (!vc_attribute || vc.version == 0 || vc.output_format == 0 ||
|
||||
vc.conversion_flags & CELL_GEM_VIDEO_CONVERT_UNK3 && !vc.buffer_memory)
|
||||
{
|
||||
return CELL_GEM_ERROR_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if (vc.video_data_out & 0x1f || vc.buffer_memory & 0xff)
|
||||
{
|
||||
return CELL_GEM_ERROR_INVALID_ALIGNMENT;
|
||||
}
|
||||
|
||||
gem->vc_attribute = vc;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@@ -239,15 +771,46 @@ s32 cellGemReadExternalPortDeviceInfo()
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellGemReset()
|
||||
s32 cellGemReset(u32 gem_num)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellGem);
|
||||
cellGem.todo("cellGemReset(gem_num=%d)", gem_num);
|
||||
auto gem = fxm::get<gem_t>();
|
||||
|
||||
if (!gem)
|
||||
{
|
||||
return CELL_GEM_ERROR_UNINITIALIZED;
|
||||
}
|
||||
|
||||
if (!check_gem_num(gem_num))
|
||||
{
|
||||
return CELL_GEM_ERROR_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
gem->reset_controller(gem_num);
|
||||
|
||||
// TODO: is this correct?
|
||||
gem->timer.Start();
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellGemSetRumble()
|
||||
s32 cellGemSetRumble(u32 gem_num, u8 rumble)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellGem);
|
||||
cellGem.todo("cellGemSetRumble(gem_num=%d, rumble=0x%x)", gem_num, rumble);
|
||||
auto gem = fxm::get<gem_t>();
|
||||
|
||||
if (!gem)
|
||||
{
|
||||
return CELL_GEM_ERROR_UNINITIALIZED;
|
||||
}
|
||||
|
||||
if (!check_gem_num(gem_num))
|
||||
{
|
||||
return CELL_GEM_ERROR_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
gem->controllers[gem_num].rumble = rumble;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@@ -269,9 +832,16 @@ s32 cellGemUpdateFinish()
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellGemUpdateStart()
|
||||
s32 cellGemUpdateStart(vm::cptr<void> camera_frame, u64 timestamp)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellGem);
|
||||
cellGem.todo("cellGemUpdateStart(camera_frame=*0x%x, timestamp=%d)", camera_frame, timestamp);
|
||||
auto gem = fxm::get<gem_t>();
|
||||
|
||||
if (!gem)
|
||||
{
|
||||
return CELL_GEM_ERROR_UNINITIALIZED;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
namespace vm { using namespace ps3; }
|
||||
|
||||
|
||||
static const float CELL_GEM_SPHERE_RADIUS_MM = 22.5f;
|
||||
|
||||
// Error Codes
|
||||
// Error codes
|
||||
enum
|
||||
{
|
||||
CELL_GEM_ERROR_RESOURCE_ALLOCATION_FAILED = 0x80121801,
|
||||
@@ -34,7 +34,7 @@ enum
|
||||
CELL_GEM_NO_EXTERNAL_PORT_DEVICE = 9,
|
||||
};
|
||||
|
||||
// General constents
|
||||
// General constants
|
||||
enum
|
||||
{
|
||||
CELL_GEM_CTRL_CIRCLE = 1 << 5,
|
||||
@@ -59,7 +59,7 @@ enum
|
||||
CELL_GEM_FLAG_CALIBRATION_OCCURRED = 1 << 0,
|
||||
CELL_GEM_FLAG_CALIBRATION_SUCCEEDED = 1 << 1,
|
||||
CELL_GEM_FLAG_CALIBRATION_WARNING_BRIGHT_LIGHTING = 1 << 6,
|
||||
ELL_GEM_FLAG_CALIBRATION_WARNING_MOTION_DETECTED = 1 << 5,
|
||||
CELL_GEM_FLAG_CALIBRATION_WARNING_MOTION_DETECTED = 1 << 5,
|
||||
CELL_GEM_FLAG_CAMERA_PITCH_ANGLE_CHANGED = 1 << 9,
|
||||
CELL_GEM_FLAG_CURRENT_HUE_CONFLICTS_WITH_ENVIRONMENT = 1 << 13,
|
||||
CELL_GEM_FLAG_LIGHTING_CHANGED = 1 << 7,
|
||||
@@ -84,6 +84,15 @@ enum
|
||||
CELL_GEM_VERSION = 2,
|
||||
};
|
||||
|
||||
// Video conversion flags
|
||||
enum
|
||||
{
|
||||
CELL_GEM_VIDEO_CONVERT_UNK1 = 1 << 0,
|
||||
CELL_GEM_VIDEO_CONVERT_UNK2 = 1 << 1,
|
||||
CELL_GEM_VIDEO_CONVERT_UNK3 = 1 << 2,
|
||||
CELL_GEM_VIDEO_CONVERT_UNK4 = 1 << 3,
|
||||
};
|
||||
|
||||
struct CellGemAttribute
|
||||
{
|
||||
be_t<u32> version;
|
||||
@@ -118,9 +127,9 @@ struct CellGemImageState
|
||||
{
|
||||
be_t<u64> frame_timestamp;
|
||||
be_t<u64> timestamp;
|
||||
be_t<f32> u;
|
||||
be_t<f32> v;
|
||||
be_t<f32> r;
|
||||
be_t<f32> u; // horizontal screen position in pixels
|
||||
be_t<f32> v; // vertical screen position in pixels
|
||||
be_t<f32> r; // size of sphere on screen in pixels
|
||||
be_t<f32> projectionx;
|
||||
be_t<f32> projectiony;
|
||||
be_t<f32> distance;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
namespace vm { using namespace ps3; }
|
||||
|
||||
|
||||
// Return Codes
|
||||
enum
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
namespace vm { using namespace ps3; }
|
||||
|
||||
|
||||
// libHttp = 0x80710001 - 0x80710fff
|
||||
// libHttps = 0x80710a01 - 0x80710aff
|
||||
@@ -10,10 +10,10 @@ enum
|
||||
{
|
||||
CELL_HTTP_NET_ERROR_TYPE_MASK = 0xffffff00,
|
||||
CELL_HTTP_NET_ERROR_MASK = 0xff,
|
||||
|
||||
|
||||
// CELL_HTTP_NET_ERROR
|
||||
// CELL_HTTP_IS_NET_RESOLVER_ERROR
|
||||
|
||||
|
||||
CELL_HTTP_ERROR_ALREADY_INITIALIZED = 0x80710001,
|
||||
CELL_HTTP_ERROR_NOT_INITIALIZED = 0x80710002,
|
||||
CELL_HTTP_ERROR_NO_MEMORY = 0x80710003,
|
||||
@@ -48,7 +48,7 @@ enum
|
||||
CELL_HTTP_ERROR_CACHE_NOT_INITIALIZED = 0x80710044,
|
||||
CELL_HTTP_ERROR_LINE_EXCEEDS_MAX = 0x80710045,
|
||||
CELL_HTTP_ERROR_REQUIRES_BASIC_AUTH = 0x80710046,
|
||||
|
||||
|
||||
CELL_HTTP_ERROR_UNKNOWN = 0x80710051,
|
||||
CELL_HTTP_ERROR_INTERNAL = 0x80710052,
|
||||
CELL_HTTP_ERROR_NONREMOVABLE = 0x80710053,
|
||||
@@ -62,7 +62,7 @@ enum
|
||||
CELL_HTTP_ERROR_DECODE_SETUP = 0x8071005b,
|
||||
CELL_HTTP_ERROR_DECODE_STREAM = 0x8071005c,
|
||||
CELL_HTTP_ERROR_BROKEN_DECODE_STREAM = 0x8071005d,
|
||||
|
||||
|
||||
CELL_HTTP_ERROR_INVALID_DCACHE_PATH = 0x80710060,
|
||||
CELL_HTTP_ERROR_DCACHE_ALREADY_INITIALIZED = 0x80710061,
|
||||
CELL_HTTP_ERROR_DCACHE_NOT_INITIALIZED = 0x80710062,
|
||||
@@ -94,12 +94,12 @@ enum
|
||||
CELL_HTTP_ERROR_DCACHE_ABORTED = 0x80710082,
|
||||
CELL_HTTP_ERROR_DCACHE_INDEX_IS_CLOSING = 0x80710083,
|
||||
CELL_HTTP_ERROR_DCACHE_UNKNOWN_INDEX_STATE = 0x80710084,
|
||||
|
||||
|
||||
CELL_HTTP_ERROR_NET_FIN = 0x80710091,
|
||||
CELL_HTTP_ERROR_NET_CONNECT_TIMEOUT = 0x80710092,
|
||||
CELL_HTTP_ERROR_NET_SELECT_TIMEOUT = 0x80710093,
|
||||
CELL_HTTP_ERROR_NET_SEND_TIMEOUT = 0x80710094,
|
||||
|
||||
|
||||
CELL_HTTP_ERROR_NET_RESOLVER = 0x80710100,
|
||||
CELL_HTTP_ERROR_NET_ABORT = 0x80710200,
|
||||
CELL_HTTP_ERROR_NET_OPTION = 0x80710300,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
namespace vm { using namespace ps3; }
|
||||
|
||||
|
||||
// libHttp_Util: 0x80711001 - 0x807110ff
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
namespace vm { using namespace ps3; }
|
||||
|
||||
|
||||
typedef vm::ptr<void> CellImeJpHandle;
|
||||
|
||||
@@ -17,11 +17,9 @@ enum {
|
||||
CELL_IMEJP_MOVE_CLAUSE_GAP = 8,
|
||||
};
|
||||
|
||||
//cellImeJpEnterChar, returning values pointed in pOutputStatus.
|
||||
//cellImeJpEnterChar, returning values pointed in pOutputStatus.
|
||||
enum {
|
||||
CELL_IMEJP_RET_NONE = 0,
|
||||
CELL_IMEJP_RET_THROUGH = 1,
|
||||
CELL_IMEJP_RET_CONFIRMED = 2,
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
namespace vm { using namespace ps3; }
|
||||
|
||||
|
||||
//Return Codes
|
||||
enum
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
namespace vm { using namespace ps3; }
|
||||
|
||||
|
||||
// Error Codes
|
||||
enum
|
||||
@@ -11,7 +11,7 @@ enum
|
||||
CELL_JPGENC_ERROR_EMPTY = 0x80611194,
|
||||
CELL_JPGENC_ERROR_RESET = 0x80611195,
|
||||
CELL_JPGENC_ERROR_FATAL = 0x80611196,
|
||||
|
||||
|
||||
CELL_JPGENC_ERROR_STREAM_ABORT = 0x806111A1,
|
||||
CELL_JPGENC_ERROR_STREAM_SKIP = 0x806111A2,
|
||||
CELL_JPGENC_ERROR_STREAM_OVERFLOW = 0x806111A3,
|
||||
@@ -26,19 +26,19 @@ enum
|
||||
CELL_JPGENC_COLOR_SPACE_YCbCr = 3,
|
||||
CELL_JPGENC_COLOR_SPACE_RGBA = 10,
|
||||
CELL_JPGENC_COLOR_SPACE_ARGB = 20,
|
||||
|
||||
|
||||
CELL_JPGENC_SAMPLING_FMT_YCbCr444,
|
||||
CELL_JPGENC_SAMPLING_FMT_YCbCr422,
|
||||
CELL_JPGENC_SAMPLING_FMT_YCbCr420,
|
||||
CELL_JPGENC_SAMPLING_FMT_YCbCr411,
|
||||
CELL_JPGENC_SAMPLING_FMT_FULL,
|
||||
|
||||
|
||||
CELL_JPGENC_DCT_METHOD_QUALITY = 0,
|
||||
CELL_JPGENC_DCT_METHOD_FAST = 5,
|
||||
|
||||
|
||||
CELL_JPGENC_COMPR_MODE_CONSTANT_QUALITY,
|
||||
CELL_JPGENC_COMPR_MODE_STREAM_SIZE_LIMIT,
|
||||
|
||||
|
||||
CELL_JPGENC_LOCATION_FILE,
|
||||
CELL_JPGENC_LOCATION_BUFFER,
|
||||
};
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "Emu/Io/KeyboardHandler.h"
|
||||
#include "cellKb.h"
|
||||
|
||||
namespace vm { using namespace ps3; }
|
||||
|
||||
|
||||
extern logs::channel sys_io;
|
||||
|
||||
@@ -95,8 +95,8 @@ u16 cellKbCnvRawCode(u32 arrange, u32 mkey, u32 led, u16 rawcode)
|
||||
// ASCII
|
||||
if (rawcode >= 0x04 && rawcode <= 0x1D) // 'A' - 'Z'
|
||||
{
|
||||
rawcode -=
|
||||
(mkey&(CELL_KB_MKEY_L_SHIFT|CELL_KB_MKEY_R_SHIFT)) ?
|
||||
rawcode -=
|
||||
(mkey&(CELL_KB_MKEY_L_SHIFT|CELL_KB_MKEY_R_SHIFT)) ?
|
||||
((led&(CELL_KB_LED_CAPS_LOCK)) ? 0 : 0x20) :
|
||||
((led&(CELL_KB_LED_CAPS_LOCK)) ? 0x20 : 0);
|
||||
return rawcode + 0x5D;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
namespace vm { using namespace ps3; }
|
||||
|
||||
|
||||
logs::channel cellKey2char("cellKey2char");
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
namespace vm { using namespace ps3; }
|
||||
|
||||
|
||||
// L10nResult
|
||||
enum
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
namespace vm { using namespace ps3; }
|
||||
|
||||
|
||||
// Error Codes
|
||||
enum
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
namespace vm { using namespace ps3; }
|
||||
|
||||
|
||||
enum
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include "Utilities/BitField.h"
|
||||
|
||||
namespace vm { using namespace ps3; }
|
||||
|
||||
|
||||
enum
|
||||
{
|
||||
|
||||
@@ -2,131 +2,287 @@
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/IdManager.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
#include "cellMusic.h"
|
||||
#include "Emu/Cell/lv2/sys_lwmutex.h"
|
||||
#include "Emu/Cell/lv2/sys_lwcond.h"
|
||||
#include "Emu/Cell/lv2/sys_spu.h"
|
||||
#include "cellSearch.h"
|
||||
#include "cellSpurs.h"
|
||||
#include "cellSysutil.h"
|
||||
|
||||
namespace vm { using namespace ps3; }
|
||||
#include "cellMusic.h"
|
||||
|
||||
logs::channel cellMusic("cellMusic");
|
||||
|
||||
struct music2_t
|
||||
struct music_t
|
||||
{
|
||||
vm::ptr<CellMusic2Callback> func;
|
||||
vm::ptr<void(u32 event, vm::ptr<void> param, vm::ptr<void> userData)> func;
|
||||
vm::ptr<void> userData;
|
||||
};
|
||||
|
||||
s32 cellMusicGetSelectionContext()
|
||||
s32 cellMusicGetSelectionContext(vm::ptr<CellMusicSelectionContext> context)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellMusic);
|
||||
cellMusic.todo("cellMusicGetSelectionContext(context=*0x%x)", context);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellMusicSetSelectionContext2()
|
||||
s32 cellMusicSetSelectionContext2(vm::ptr<CellMusicSelectionContext> context)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellMusic);
|
||||
cellMusic.todo("cellMusicSetSelectionContext2(context=*0x%x)", context);
|
||||
|
||||
const auto music = fxm::get_always<music_t>();
|
||||
|
||||
if (!music->func)
|
||||
return CELL_MUSIC2_ERROR_GENERIC;
|
||||
|
||||
sysutil_register_cb([=](ppu_thread& ppu) -> s32
|
||||
{
|
||||
music->func(ppu, CELL_MUSIC2_EVENT_SET_SELECTION_CONTEXT_RESULT, vm::addr_t(CELL_OK), music->userData);
|
||||
return CELL_OK;
|
||||
});
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellMusicSetVolume2()
|
||||
s32 cellMusicSetVolume2(f32 level)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellMusic);
|
||||
cellMusic.todo("cellMusicSetVolume2(level=0x%x)", level);
|
||||
|
||||
const auto music = fxm::get_always<music_t>();
|
||||
|
||||
if (!music->func)
|
||||
return CELL_MUSIC2_ERROR_GENERIC;
|
||||
|
||||
sysutil_register_cb([=](ppu_thread& ppu) -> s32
|
||||
{
|
||||
music->func(ppu, CELL_MUSIC2_EVENT_SET_VOLUME_RESULT, vm::addr_t(CELL_OK), music->userData);
|
||||
return CELL_OK;
|
||||
});
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellMusicGetContentsId()
|
||||
s32 cellMusicGetContentsId(vm::ptr<CellSearchContentId> contents_id)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellMusic);
|
||||
cellMusic.todo("cellMusicGetContentsId(contents_id=*0x%x)", contents_id);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellMusicSetSelectionContext()
|
||||
s32 cellMusicSetSelectionContext(vm::ptr<CellMusicSelectionContext> context)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellMusic);
|
||||
cellMusic.todo("cellMusicSetSelectionContext(context=*0x%x)", context);
|
||||
|
||||
const auto music = fxm::get_always<music_t>();
|
||||
|
||||
if (!music->func)
|
||||
return CELL_MUSIC_ERROR_GENERIC;
|
||||
|
||||
sysutil_register_cb([=](ppu_thread& ppu) -> s32
|
||||
{
|
||||
music->func(ppu, CELL_MUSIC_EVENT_SET_SELECTION_CONTEXT_RESULT, vm::addr_t(CELL_OK), music->userData);
|
||||
return CELL_OK;
|
||||
});
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellMusicInitialize2SystemWorkload()
|
||||
s32 cellMusicInitialize2SystemWorkload(s32 mode, vm::ptr<CellMusic2Callback> func, vm::ptr<void> userData, vm::ptr<CellSpurs> spurs, vm::cptr<u8> priority, vm::cptr<struct CellSpursSystemWorkloadAttribute> attr)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellMusic);
|
||||
cellMusic.todo("cellMusicInitialize2SystemWorkload(mode=0x%x, func=*0x%x, userData=*0x%x, spurs=*0x%x, priority=*0x%x, attr=*0x%x)", mode, func, userData, spurs, priority, attr);
|
||||
|
||||
const auto music = fxm::make_always<music_t>();
|
||||
music->func = func;
|
||||
music->userData = userData;
|
||||
|
||||
sysutil_register_cb([=](ppu_thread& ppu) -> s32
|
||||
{
|
||||
music->func(ppu, CELL_MUSIC2_EVENT_INITIALIZE_RESULT, vm::addr_t(CELL_OK), userData);
|
||||
return CELL_OK;
|
||||
});
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellMusicGetPlaybackStatus2()
|
||||
s32 cellMusicGetPlaybackStatus2(vm::ptr<s32> status)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellMusic);
|
||||
cellMusic.todo("cellMusicGetPlaybackStatus2(status=*0x%x)", status);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellMusicGetContentsId2()
|
||||
s32 cellMusicGetContentsId2(vm::ptr<CellSearchContentId> contents_id)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellMusic);
|
||||
cellMusic.todo("cellMusicGetContentsId2(contents_id=*0x%x)", contents_id);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellMusicFinalize()
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellMusic);
|
||||
cellMusic.todo("cellMusicFinalize()");
|
||||
|
||||
const auto music = fxm::get_always<music_t>();
|
||||
|
||||
if (music->func)
|
||||
{
|
||||
sysutil_register_cb([=](ppu_thread& ppu) -> s32
|
||||
{
|
||||
music->func(ppu, CELL_MUSIC_EVENT_FINALIZE_RESULT, vm::addr_t(CELL_OK), music->userData);
|
||||
return CELL_OK;
|
||||
});
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellMusicInitializeSystemWorkload()
|
||||
s32 cellMusicInitializeSystemWorkload(s32 mode, u32 container, vm::ptr<CellMusicCallback> func, vm::ptr<void> userData, vm::ptr<CellSpurs> spurs, vm::cptr<u8> priority, vm::cptr<struct CellSpursSystemWorkloadAttribute> attr)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellMusic);
|
||||
cellMusic.todo("cellMusicInitializeSystemWorkload(mode=0x%x, container=0x%x, func=*0x%x, userData=*0x%x, spurs=*0x%x, priority=*0x%x, attr=*0x%x)", mode, container, func, userData, spurs, priority, attr);
|
||||
|
||||
if (mode != CELL_MUSIC2_PLAYER_MODE_NORMAL)
|
||||
{
|
||||
cellMusic.todo("Unknown player mode: 0x%x", mode);
|
||||
return CELL_MUSIC_ERROR_PARAM;
|
||||
}
|
||||
|
||||
const auto music = fxm::make_always<music_t>();
|
||||
music->func = func;
|
||||
music->userData = userData;
|
||||
|
||||
sysutil_register_cb([=](ppu_thread& ppu) -> s32
|
||||
{
|
||||
music->func(ppu, CELL_MUSIC_EVENT_INITIALIZE_RESULT, vm::addr_t(CELL_OK), userData);
|
||||
return CELL_OK;
|
||||
});
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellMusicInitialize()
|
||||
s32 cellMusicInitialize(s32 mode, u32 container, s32 spuPriority, vm::ptr<CellMusicCallback> func, vm::ptr<void> userData)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellMusic);
|
||||
cellMusic.todo("cellMusicInitialize(mode=0x%x, container=0x%x, spuPriority=0x%x, func=*0x%x, userData=*0x%x)", mode, container, spuPriority, func, userData);
|
||||
|
||||
if (mode != CELL_MUSIC2_PLAYER_MODE_NORMAL)
|
||||
{
|
||||
cellMusic.todo("Unknown player mode: 0x%x", mode);
|
||||
return CELL_MUSIC_ERROR_PARAM;
|
||||
}
|
||||
|
||||
const auto music = fxm::make_always<music_t>();
|
||||
music->func = func;
|
||||
music->userData = userData;
|
||||
|
||||
sysutil_register_cb([=](ppu_thread& ppu) -> s32
|
||||
{
|
||||
music->func(ppu, CELL_MUSIC_EVENT_INITIALIZE_RESULT, vm::addr_t(CELL_OK), userData);
|
||||
return CELL_OK;
|
||||
});
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellMusicFinalize2()
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellMusic);
|
||||
cellMusic.todo("cellMusicFinalize2()");
|
||||
|
||||
const auto music = fxm::get_always<music_t>();
|
||||
|
||||
if (music->func)
|
||||
{
|
||||
sysutil_register_cb([=](ppu_thread& ppu) -> s32
|
||||
{
|
||||
music->func(ppu, CELL_MUSIC2_EVENT_FINALIZE_RESULT, vm::addr_t(CELL_OK), music->userData);
|
||||
return CELL_OK;
|
||||
});
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellMusicGetSelectionContext2()
|
||||
s32 cellMusicGetSelectionContext2(vm::ptr<CellMusicSelectionContext> context)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellMusic);
|
||||
cellMusic.todo("cellMusicGetSelectionContext2(context=*0x%x)", context);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellMusicGetVolume()
|
||||
s32 cellMusicGetVolume(vm::ptr<f32> level)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellMusic);
|
||||
cellMusic.todo("cellMusicGetVolume(level=*0x%x)", level);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellMusicGetPlaybackStatus()
|
||||
s32 cellMusicGetPlaybackStatus(vm::ptr<s32> status)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellMusic);
|
||||
cellMusic.todo("cellMusicGetPlaybackStatus(status=*0x%x)", status);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellMusicSetPlaybackCommand2()
|
||||
s32 cellMusicSetPlaybackCommand2(s32 command, vm::ptr<void> param)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellMusic);
|
||||
cellMusic.todo("cellMusicSetPlaybackCommand2(command=0x%x, param=*0x%x)", command, param);
|
||||
|
||||
const auto music = fxm::get_always<music_t>();
|
||||
|
||||
if (!music->func)
|
||||
return CELL_MUSIC2_ERROR_GENERIC;
|
||||
|
||||
sysutil_register_cb([=](ppu_thread& ppu) -> s32
|
||||
{
|
||||
music->func(ppu, CELL_MUSIC2_EVENT_SET_PLAYBACK_COMMAND_RESULT, vm::addr_t(CELL_OK), music->userData);
|
||||
return CELL_OK;
|
||||
});
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellMusicSetPlaybackCommand()
|
||||
s32 cellMusicSetPlaybackCommand(s32 command, vm::ptr<void> param)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellMusic);
|
||||
cellMusic.todo("cellMusicSetPlaybackCommand(command=0x%x, param=*0x%x)", command, param);
|
||||
|
||||
const auto music = fxm::get_always<music_t>();
|
||||
|
||||
if (!music->func)
|
||||
return CELL_MUSIC_ERROR_GENERIC;
|
||||
|
||||
sysutil_register_cb([=](ppu_thread& ppu) -> s32
|
||||
{
|
||||
music->func(ppu, CELL_MUSIC_EVENT_SET_PLAYBACK_COMMAND_RESULT, vm::addr_t(CELL_OK), music->userData);
|
||||
return CELL_OK;
|
||||
});
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellMusicSelectContents2()
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellMusic);
|
||||
cellMusic.todo("cellMusicSelectContents2()");
|
||||
|
||||
const auto music = fxm::get_always<music_t>();
|
||||
|
||||
if (!music->func)
|
||||
return CELL_MUSIC2_ERROR_GENERIC;
|
||||
|
||||
sysutil_register_cb([=](ppu_thread& ppu) -> s32
|
||||
{
|
||||
music->func(ppu, CELL_MUSIC2_EVENT_SELECT_CONTENTS_RESULT, vm::addr_t(CELL_OK), music->userData);
|
||||
return CELL_OK;
|
||||
});
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellMusicSelectContents()
|
||||
s32 cellMusicSelectContents(u32 container)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellMusic);
|
||||
cellMusic.todo("cellMusicSelectContents(container=0x%x)", container);
|
||||
|
||||
const auto music = fxm::get_always<music_t>();
|
||||
|
||||
if (!music->func)
|
||||
return CELL_MUSIC_ERROR_GENERIC;
|
||||
|
||||
sysutil_register_cb([=](ppu_thread& ppu) -> s32
|
||||
{
|
||||
music->func(ppu, CELL_MUSIC_EVENT_SELECT_CONTENTS_RESULT, vm::addr_t(CELL_OK), music->userData);
|
||||
return CELL_OK;
|
||||
});
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@@ -140,28 +296,40 @@ s32 cellMusicInitialize2(s32 mode, s32 spuPriority, vm::ptr<CellMusic2Callback>
|
||||
return CELL_MUSIC2_ERROR_PARAM;
|
||||
}
|
||||
|
||||
const auto music = fxm::make_always<music2_t>();
|
||||
const auto music = fxm::make_always<music_t>();
|
||||
music->func = func;
|
||||
music->userData = userData;
|
||||
|
||||
sysutil_register_cb([=](ppu_thread& ppu) -> s32
|
||||
{
|
||||
func(ppu, CELL_MUSIC2_EVENT_INITIALIZE_RESULT, vm::make_var<s32>(CELL_OK), userData);
|
||||
music->func(ppu, CELL_MUSIC2_EVENT_INITIALIZE_RESULT, vm::addr_t(CELL_OK), userData);
|
||||
return CELL_OK;
|
||||
});
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellMusicSetVolume()
|
||||
s32 cellMusicSetVolume(f32 level)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellMusic);
|
||||
cellMusic.todo("cellMusicSetVolume(level=0x%x)", level);
|
||||
|
||||
const auto music = fxm::get_always<music_t>();
|
||||
|
||||
if (!music->func)
|
||||
return CELL_MUSIC_ERROR_GENERIC;
|
||||
|
||||
sysutil_register_cb([=](ppu_thread& ppu) -> s32
|
||||
{
|
||||
music->func(ppu, CELL_MUSIC_EVENT_SET_VOLUME_RESULT, vm::addr_t(CELL_OK), music->userData);
|
||||
return CELL_OK;
|
||||
});
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellMusicGetVolume2()
|
||||
s32 cellMusicGetVolume2(vm::ptr<f32> level)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellMusic);
|
||||
cellMusic.todo("cellMusicGetVolume2(level=*0x%x)", level);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,8 +12,8 @@ enum
|
||||
CELL_MUSIC_ERROR_PLAYBACK_FAILURE = 0x8002c107,
|
||||
CELL_MUSIC_ERROR_NO_MORE_CONTENT = 0x8002c108,
|
||||
CELL_MUSIC_DIALOG_OPEN = 0x8002c109,
|
||||
CELL_MUSIC_DIALOG_CLOSE = 0x8002c10A,
|
||||
CELL_MUSIC_ERROR_GENERIC = 0x8002c1FF,
|
||||
CELL_MUSIC_DIALOG_CLOSE = 0x8002c10a,
|
||||
CELL_MUSIC_ERROR_GENERIC = 0x8002c1ff,
|
||||
|
||||
CELL_MUSIC2_PLAYBACK_FINISHED = CELL_MUSIC_PLAYBACK_FINISHED,
|
||||
CELL_MUSIC2_ERROR_PARAM = CELL_MUSIC_ERROR_PARAM,
|
||||
@@ -120,8 +120,8 @@ enum
|
||||
CELL_MUSIC_SELECTION_CONTEXT_SIZE = 2048,
|
||||
};
|
||||
|
||||
using CellMusicCallback = void(u32 event, vm::ps3::ptr<void> param, vm::ps3::ptr<void> userData);
|
||||
using CellMusic2Callback = void(u32 event, vm::ps3::ptr<void> param, vm::ps3::ptr<void> userData);
|
||||
using CellMusicCallback = void(u32 event, vm::ptr<void> param, vm::ptr<void> userData);
|
||||
using CellMusic2Callback = void(u32 event, vm::ptr<void> param, vm::ptr<void> userData);
|
||||
|
||||
struct CellMusicSelectionContext
|
||||
{
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
#include "Emu/Cell/lv2/sys_lwmutex.h"
|
||||
#include "Emu/Cell/lv2/sys_lwcond.h"
|
||||
#include "Emu/Cell/lv2/sys_spu.h"
|
||||
#include "cellMusic.h"
|
||||
#include "cellSearch.h"
|
||||
#include "cellSpurs.h"
|
||||
#include "cellSysutil.h"
|
||||
|
||||
|
||||
namespace vm { using namespace ps3; }
|
||||
|
||||
logs::channel cellMusicDecode("cellMusicDecode");
|
||||
|
||||
@@ -23,123 +30,302 @@ enum
|
||||
CELL_MUSIC_DECODE_ERROR_GENERIC = 0x8002C1FF,
|
||||
};
|
||||
|
||||
s32 cellMusicDecodeInitialize()
|
||||
enum
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellMusicDecode);
|
||||
CELL_MUSIC_DECODE_EVENT_STATUS_NOTIFICATION = 0,
|
||||
CELL_MUSIC_DECODE_EVENT_INITIALIZE_RESULT = 1,
|
||||
CELL_MUSIC_DECODE_EVENT_FINALIZE_RESULT = 2,
|
||||
CELL_MUSIC_DECODE_EVENT_SELECT_CONTENTS_RESULT = 3,
|
||||
CELL_MUSIC_DECODE_EVENT_SET_DECODE_COMMAND_RESULT = 4,
|
||||
CELL_MUSIC_DECODE_EVENT_SET_SELECTION_CONTEXT_RESULT = 5,
|
||||
CELL_MUSIC_DECODE_EVENT_UI_NOTIFICATION = 6,
|
||||
CELL_MUSIC_DECODE_EVENT_NEXT_CONTENTS_READY_RESULT = 7,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
CELL_MUSIC_DECODE2_EVENT_STATUS_NOTIFICATION = 0,
|
||||
CELL_MUSIC_DECODE2_EVENT_INITIALIZE_RESULT = 1,
|
||||
CELL_MUSIC_DECODE2_EVENT_FINALIZE_RESULT = 2,
|
||||
CELL_MUSIC_DECODE2_EVENT_SELECT_CONTENTS_RESULT = 3,
|
||||
CELL_MUSIC_DECODE2_EVENT_SET_DECODE_COMMAND_RESULT = 4,
|
||||
CELL_MUSIC_DECODE2_EVENT_SET_SELECTION_CONTEXT_RESULT = 5,
|
||||
CELL_MUSIC_DECODE2_EVENT_UI_NOTIFICATION = 6,
|
||||
CELL_MUSIC_DECODE2_EVENT_NEXT_CONTENTS_READY_RESULT = 7,
|
||||
};
|
||||
|
||||
using CellMusicDecodeCallback = void(u32, vm::ptr<void> param, vm::ptr<void> userData);
|
||||
using CellMusicDecode2Callback = void(u32, vm::ptr<void> param, vm::ptr<void> userData);
|
||||
|
||||
struct music_decode_t
|
||||
{
|
||||
vm::ptr<CellMusicDecodeCallback> func;
|
||||
vm::ptr<void> userData;
|
||||
};
|
||||
|
||||
struct music_decode2_t
|
||||
{
|
||||
vm::ptr<CellMusicDecode2Callback> func;
|
||||
vm::ptr<void> userData;
|
||||
};
|
||||
|
||||
s32 cellMusicDecodeInitialize(s32 mode, u32 container, s32 spuPriority, vm::ptr<CellMusicDecodeCallback> func, vm::ptr<void> userData)
|
||||
{
|
||||
cellMusicDecode.todo("cellMusicDecodeInitialize(mode=0x%x, container=0x%x, spuPriority=0x%x, func=*0x%x, userData=*0x%x)", mode, container, spuPriority, func, userData);
|
||||
|
||||
const auto musicDecode = fxm::make_always<music_decode_t>();
|
||||
musicDecode->func = func;
|
||||
musicDecode->userData = userData;
|
||||
|
||||
sysutil_register_cb([=](ppu_thread& ppu) -> s32
|
||||
{
|
||||
musicDecode->func(ppu, CELL_MUSIC_DECODE_EVENT_INITIALIZE_RESULT, vm::addr_t(CELL_OK), userData);
|
||||
return CELL_OK;
|
||||
});
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellMusicDecodeInitializeSystemWorkload()
|
||||
s32 cellMusicDecodeInitializeSystemWorkload(s32 mode, u32 container, vm::ptr<CellMusicDecodeCallback> func, vm::ptr<void> userData, s32 spuUsageRate, vm::ptr<CellSpurs> spurs, vm::cptr<u8> priority, vm::cptr<struct CellSpursSystemWorkloadAttribute> attr)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellMusicDecode);
|
||||
cellMusicDecode.todo("cellMusicDecodeInitializeSystemWorkload(mode=0x%x, container=0x%x, func=*0x%x, userData=*0x%x, spuUsageRate=0x%x, spurs=*0x%x, priority=*0x%x, attr=*0x%x)", mode, container, func, userData, spuUsageRate, spurs, priority, attr);
|
||||
|
||||
const auto musicDecode = fxm::make_always<music_decode_t>();
|
||||
musicDecode->func = func;
|
||||
musicDecode->userData = userData;
|
||||
|
||||
sysutil_register_cb([=](ppu_thread& ppu) -> s32
|
||||
{
|
||||
musicDecode->func(ppu, CELL_MUSIC_DECODE_EVENT_INITIALIZE_RESULT, vm::addr_t(CELL_OK), userData);
|
||||
return CELL_OK;
|
||||
});
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellMusicDecodeFinalize()
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellMusicDecode);
|
||||
cellMusicDecode.todo("cellMusicDecodeFinalize()");
|
||||
|
||||
const auto musicDecode = fxm::get_always<music_decode_t>();
|
||||
|
||||
if (musicDecode->func)
|
||||
{
|
||||
sysutil_register_cb([=](ppu_thread& ppu) -> s32
|
||||
{
|
||||
musicDecode->func(ppu, CELL_MUSIC_DECODE_EVENT_FINALIZE_RESULT, vm::addr_t(CELL_OK), musicDecode->userData);
|
||||
return CELL_OK;
|
||||
});
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellMusicDecodeSelectContents()
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellMusicDecode);
|
||||
cellMusicDecode.todo("cellMusicDecodeSelectContents()");
|
||||
|
||||
const auto musicDecode = fxm::get_always<music_decode_t>();
|
||||
|
||||
if (!musicDecode->func)
|
||||
return CELL_MUSIC_DECODE_ERROR_GENERIC;
|
||||
|
||||
sysutil_register_cb([=](ppu_thread& ppu) -> s32
|
||||
{
|
||||
musicDecode->func(ppu, CELL_MUSIC_DECODE_EVENT_SELECT_CONTENTS_RESULT, vm::addr_t(CELL_OK), musicDecode->userData);
|
||||
return CELL_OK;
|
||||
});
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellMusicDecodeSetDecodeCommand()
|
||||
s32 cellMusicDecodeSetDecodeCommand(s32 command)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellMusicDecode);
|
||||
cellMusicDecode.todo("cellMusicDecodeSetDecodeCommand(command=0x%x)", command);
|
||||
|
||||
const auto musicDecode = fxm::get_always<music_decode_t>();
|
||||
|
||||
if (!musicDecode->func)
|
||||
return CELL_MUSIC_DECODE_ERROR_GENERIC;
|
||||
|
||||
sysutil_register_cb([=](ppu_thread& ppu) -> s32
|
||||
{
|
||||
musicDecode->func(ppu, CELL_MUSIC_DECODE_EVENT_SET_DECODE_COMMAND_RESULT, vm::addr_t(CELL_OK), musicDecode->userData);
|
||||
return CELL_OK;
|
||||
});
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellMusicDecodeGetDecodeStatus()
|
||||
s32 cellMusicDecodeGetDecodeStatus(vm::ptr<s32> status)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellMusicDecode);
|
||||
cellMusicDecode.todo("cellMusicDecodeGetDecodeStatus(status=*0x%x)", status);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellMusicDecodeRead()
|
||||
s32 cellMusicDecodeRead(vm::ptr<void> buf, vm::ptr<u32> startTime, u64 reqSize, vm::ptr<u64> readSize, vm::ptr<s32> position)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellMusicDecode);
|
||||
cellMusicDecode.todo("cellMusicDecodeRead(buf=*0x%x, startTime=*0x%x, reqSize=0x%llx, readSize=*0x%x, position=*0x%x)", buf, startTime, reqSize, readSize, position);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellMusicDecodeGetSelectionContext()
|
||||
s32 cellMusicDecodeGetSelectionContext(vm::ptr<CellMusicSelectionContext> context)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellMusicDecode);
|
||||
cellMusicDecode.todo("cellMusicDecodeGetSelectionContext(context=*0x%x)", context);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellMusicDecodeSetSelectionContext()
|
||||
s32 cellMusicDecodeSetSelectionContext(vm::ptr<CellMusicSelectionContext> context)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellMusicDecode);
|
||||
cellMusicDecode.todo("cellMusicDecodeSetSelectionContext(context=*0x%x)", context);
|
||||
|
||||
const auto musicDecode = fxm::get_always<music_decode_t>();
|
||||
|
||||
if (!musicDecode->func)
|
||||
return CELL_MUSIC_DECODE_ERROR_GENERIC;
|
||||
|
||||
sysutil_register_cb([=](ppu_thread& ppu) -> s32
|
||||
{
|
||||
musicDecode->func(ppu, CELL_MUSIC_DECODE_EVENT_SET_SELECTION_CONTEXT_RESULT, vm::addr_t(CELL_OK), musicDecode->userData);
|
||||
return CELL_OK;
|
||||
});
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellMusicDecodeGetContentsId()
|
||||
s32 cellMusicDecodeGetContentsId(vm::ptr<CellSearchContentId> contents_id)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellMusicDecode);
|
||||
cellMusicDecode.todo("cellMusicDecodeGetContentsId(contents_id=*0x%x)", contents_id);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellMusicDecodeInitialize2()
|
||||
s32 cellMusicDecodeInitialize2(s32 mode, u32 container, s32 spuPriority, vm::ptr<CellMusicDecode2Callback> func, vm::ptr<void> userData, s32 speed, s32 bufsize)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellMusicDecode);
|
||||
cellMusicDecode.todo("cellMusicDecodeInitialize2(mode=0x%x, container=0x%x, spuPriority=0x%x, func=*0x%x, userData=*0x%x, speed=0x%x, bufsize=0x%x)", mode, container, spuPriority, func, userData, speed, bufsize);
|
||||
|
||||
const auto musicDecode = fxm::make_always<music_decode2_t>();
|
||||
musicDecode->func = func;
|
||||
musicDecode->userData = userData;
|
||||
|
||||
sysutil_register_cb([=](ppu_thread& ppu) -> s32
|
||||
{
|
||||
musicDecode->func(ppu, CELL_MUSIC_DECODE2_EVENT_INITIALIZE_RESULT, vm::addr_t(CELL_OK), userData);
|
||||
return CELL_OK;
|
||||
});
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellMusicDecodeInitialize2SystemWorkload()
|
||||
s32 cellMusicDecodeInitialize2SystemWorkload(s32 mode, u32 container, vm::ptr<CellMusicDecode2Callback> func, vm::ptr<void> userData, s32 spuUsageRate, s32 bufsize, vm::ptr<CellSpurs> spurs, vm::cptr<u8> priority, vm::cptr<CellSpursSystemWorkloadAttribute> attr)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellMusicDecode);
|
||||
cellMusicDecode.todo("cellMusicDecodeInitialize2SystemWorkload(mode=0x%x, container=0x%x, func=*0x%x, userData=*0x%x, spuUsageRate=0x%x, bufsize=0x%x, spurs=*0x%x, priority=*0x%x, attr=*0x%x)", mode, container, func, userData, spuUsageRate, bufsize, spurs, priority, attr);
|
||||
|
||||
const auto musicDecode = fxm::make_always<music_decode2_t>();
|
||||
musicDecode->func = func;
|
||||
musicDecode->userData = userData;
|
||||
|
||||
sysutil_register_cb([=](ppu_thread& ppu) -> s32
|
||||
{
|
||||
musicDecode->func(ppu, CELL_MUSIC_DECODE2_EVENT_INITIALIZE_RESULT, vm::addr_t(CELL_OK), userData);
|
||||
return CELL_OK;
|
||||
});
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellMusicDecodeFinalize2()
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellMusicDecode);
|
||||
cellMusicDecode.todo("cellMusicDecodeFinalize2()");
|
||||
|
||||
const auto musicDecode = fxm::get_always<music_decode2_t>();
|
||||
|
||||
if (musicDecode->func)
|
||||
{
|
||||
sysutil_register_cb([=](ppu_thread& ppu) -> s32
|
||||
{
|
||||
musicDecode->func(ppu, CELL_MUSIC_DECODE2_EVENT_FINALIZE_RESULT, vm::addr_t(CELL_OK), musicDecode->userData);
|
||||
return CELL_OK;
|
||||
});
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellMusicDecodeSelectContents2()
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellMusicDecode);
|
||||
cellMusicDecode.todo("cellMusicDecodeSelectContents2()");
|
||||
|
||||
const auto musicDecode = fxm::get_always<music_decode2_t>();
|
||||
|
||||
if (!musicDecode->func)
|
||||
return CELL_MUSIC_DECODE_ERROR_GENERIC;
|
||||
|
||||
sysutil_register_cb([=](ppu_thread& ppu) -> s32
|
||||
{
|
||||
musicDecode->func(ppu, CELL_MUSIC_DECODE2_EVENT_SELECT_CONTENTS_RESULT, vm::addr_t(CELL_OK), musicDecode->userData);
|
||||
return CELL_OK;
|
||||
});
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellMusicDecodeSetDecodeCommand2()
|
||||
s32 cellMusicDecodeSetDecodeCommand2(s32 command)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellMusicDecode);
|
||||
cellMusicDecode.todo("cellMusicDecodeSetDecodeCommand2(command=0x%x)", command);
|
||||
|
||||
const auto musicDecode = fxm::get_always<music_decode2_t>();
|
||||
|
||||
if (!musicDecode->func)
|
||||
return CELL_MUSIC_DECODE_ERROR_GENERIC;
|
||||
|
||||
sysutil_register_cb([=](ppu_thread& ppu) -> s32
|
||||
{
|
||||
musicDecode->func(ppu, CELL_MUSIC_DECODE2_EVENT_SET_DECODE_COMMAND_RESULT, vm::addr_t(CELL_OK), musicDecode->userData);
|
||||
return CELL_OK;
|
||||
});
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellMusicDecodeGetDecodeStatus2()
|
||||
s32 cellMusicDecodeGetDecodeStatus2(vm::ptr<s32> status)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellMusicDecode);
|
||||
cellMusicDecode.todo("cellMusicDecodeGetDecodeStatus2(status=*0x%x)", status);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellMusicDecodeRead2()
|
||||
s32 cellMusicDecodeRead2(vm::ptr<void> buf, vm::ptr<u32> startTime, u64 reqSize, vm::ptr<u64> readSize, vm::ptr<s32> position)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellMusicDecode);
|
||||
cellMusicDecode.todo("cellMusicDecodeRead2(buf=*0x%x, startTime=*0x%x, reqSize=0x%llx, readSize=*0x%x, position=*0x%x)", buf, startTime, reqSize, readSize, position);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellMusicDecodeGetSelectionContext2()
|
||||
s32 cellMusicDecodeGetSelectionContext2(vm::ptr<CellMusicSelectionContext> context)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellMusicDecode);
|
||||
cellMusicDecode.todo("cellMusicDecodeGetSelectionContext2(context=*0x%x)", context);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellMusicDecodeSetSelectionContext2()
|
||||
s32 cellMusicDecodeSetSelectionContext2(vm::ptr<CellMusicSelectionContext> context)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellMusicDecode);
|
||||
cellMusicDecode.todo("cellMusicDecodeSetSelectionContext2(context=*0x%x)", context);
|
||||
|
||||
const auto musicDecode = fxm::get_always<music_decode2_t>();
|
||||
|
||||
if (!musicDecode->func)
|
||||
return CELL_MUSIC_DECODE_ERROR_GENERIC;
|
||||
|
||||
sysutil_register_cb([=](ppu_thread& ppu) -> s32
|
||||
{
|
||||
musicDecode->func(ppu, CELL_MUSIC_DECODE2_EVENT_SET_SELECTION_CONTEXT_RESULT, vm::addr_t(CELL_OK), musicDecode->userData);
|
||||
return CELL_OK;
|
||||
});
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellMusicDecodeGetContentsId2()
|
||||
s32 cellMusicDecodeGetContentsId2(vm::ptr<CellSearchContentId> contents_id )
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellMusicDecode);
|
||||
cellMusicDecode.todo("cellMusicDecodeGetContentsId2(contents_id=*0x%x)", contents_id);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
#include "cellSysutil.h"
|
||||
|
||||
|
||||
namespace vm { using namespace ps3; }
|
||||
|
||||
logs::channel cellMusicExport("cellMusicExport");
|
||||
|
||||
@@ -20,33 +21,81 @@ enum
|
||||
CELL_MUSIC_EXPORT_UTIL_ERROR_INITIALIZE = 0x8002c60a,
|
||||
};
|
||||
|
||||
s32 cellMusicExportInitialize()
|
||||
struct CellMusicExportSetParam
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellMusicExport);
|
||||
vm::bptr<char> title;
|
||||
vm::bptr<char> game_title;
|
||||
vm::bptr<char> artist;
|
||||
vm::bptr<char> genre;
|
||||
vm::bptr<char> game_comment;
|
||||
vm::bptr<void> reserved1;
|
||||
vm::bptr<void> reserved2;
|
||||
};
|
||||
|
||||
using CellMusicExportUtilFinishCallback = void(s32 result, vm::ptr<void> userdata);
|
||||
|
||||
error_code cellMusicExportInitialize(u32 version, u32 container, vm::ptr<CellMusicExportUtilFinishCallback> funcFinish, vm::ptr<void> userdata)
|
||||
{
|
||||
cellMusicExport.todo("cellMusicExportInitialize(version=0x%x, container=0x%x, funcFinish=*0x%x, userdata=*0x%x)", version, container, funcFinish, userdata);
|
||||
|
||||
sysutil_register_cb([=](ppu_thread& ppu) -> s32
|
||||
{
|
||||
funcFinish(ppu, CELL_OK, userdata);
|
||||
return CELL_OK;
|
||||
});
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellMusicExportInitialize2()
|
||||
error_code cellMusicExportInitialize2(u32 version, vm::ptr<CellMusicExportUtilFinishCallback> funcFinish, vm::ptr<void> userdata)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellMusicExport);
|
||||
cellMusicExport.todo("cellMusicExportInitialize2(version=0x%x, funcFinish=*0x%x, userdata=*0x%x)", version, funcFinish, userdata);
|
||||
|
||||
sysutil_register_cb([=](ppu_thread& ppu) -> s32
|
||||
{
|
||||
funcFinish(ppu, CELL_OK, userdata);
|
||||
return CELL_OK;
|
||||
});
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellMusicExportFinalize()
|
||||
error_code cellMusicExportFinalize(vm::ptr<CellMusicExportUtilFinishCallback> funcFinish, vm::ptr<void> userdata)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellMusicExport);
|
||||
cellMusicExport.todo("cellMusicExportFinalize(funcFinish=*0x%x, userdata=*0x%x)", funcFinish, userdata);
|
||||
|
||||
sysutil_register_cb([=](ppu_thread& ppu) -> s32
|
||||
{
|
||||
funcFinish(ppu, CELL_OK, userdata);
|
||||
return CELL_OK;
|
||||
});
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellMusicExportFromFile()
|
||||
error_code cellMusicExportFromFile(vm::cptr<char> srcHddDir, vm::cptr<char> srcHddFile, vm::ptr<CellMusicExportSetParam> param, vm::ptr<CellMusicExportUtilFinishCallback> funcFinish, vm::ptr<void> userdata)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellMusicExport);
|
||||
cellMusicExport.todo("cellMusicExportFromFile(srcHddDir=%s, srcHddFile=%s, param=*0x%x, funcFinish=*0x%x, userdata=*0x%x)", srcHddDir, srcHddFile, param, funcFinish, userdata);
|
||||
|
||||
sysutil_register_cb([=](ppu_thread& ppu) -> s32
|
||||
{
|
||||
funcFinish(ppu, CELL_OK, userdata);
|
||||
return CELL_OK;
|
||||
});
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellMusicExportProgress()
|
||||
error_code cellMusicExportProgress(vm::ptr<CellMusicExportUtilFinishCallback> funcFinish, vm::ptr<void> userdata)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellMusicExport);
|
||||
cellMusicExport.todo("cellMusicExportProgress(funcFinish=*0x%x, userdata=*0x%x)", funcFinish, userdata);
|
||||
|
||||
sysutil_register_cb([=](ppu_thread& ppu) -> s32
|
||||
{
|
||||
funcFinish(ppu, 0xFFFF, userdata);
|
||||
return CELL_OK;
|
||||
});
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -125,20 +125,25 @@ error_code cellNetCtlGetInfo(s32 code, vm::ptr<CellNetCtlInfo> info)
|
||||
{
|
||||
cellNetCtl.todo("cellNetCtlGetInfo(code=0x%x (%s), info=*0x%x)", code, InfoCodeToName(code), info);
|
||||
|
||||
if (code == CELL_NET_CTL_INFO_ETHER_ADDR)
|
||||
{
|
||||
// dummy values set
|
||||
std::memset(info->ether_addr.data, 0xFF, sizeof(info->ether_addr.data));
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
if (g_cfg.net.net_status == CELL_NET_CTL_STATE_Disconnected)
|
||||
{
|
||||
return CELL_NET_CTL_ERROR_NOT_CONNECTED;
|
||||
}
|
||||
|
||||
if (code == CELL_NET_CTL_INFO_MTU)
|
||||
{
|
||||
info->mtu = 1500;
|
||||
}
|
||||
else if (code == CELL_NET_CTL_INFO_LINK)
|
||||
{
|
||||
if (g_cfg.net.net_status != CELL_NET_CTL_STATE_Disconnected)
|
||||
{
|
||||
info->link = CELL_NET_CTL_LINK_CONNECTED;
|
||||
}
|
||||
else
|
||||
{
|
||||
info->link = CELL_NET_CTL_LINK_DISCONNECTED;
|
||||
}
|
||||
info->link = CELL_NET_CTL_LINK_CONNECTED;
|
||||
}
|
||||
else if (code == CELL_NET_CTL_INFO_IP_ADDRESS)
|
||||
{
|
||||
@@ -266,35 +271,34 @@ error_code cellGameUpdateTerm()
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
error_code cellGameUpdateCheckStartAsync(ppu_thread& ppu, vm::cptr<CellGameUpdateParam> param, vm::ptr<CellGameUpdateCallback> cb_func, vm::ptr<void> userdata)
|
||||
error_code cellGameUpdateCheckStartAsync(vm::cptr<CellGameUpdateParam> param, vm::ptr<CellGameUpdateCallback> cb_func, vm::ptr<void> 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_OK, CELL_OK, userdata);
|
||||
cb_func(ppu, CELL_GAMEUPDATE_RESULT_STATUS_NO_UPDATE, CELL_OK, userdata);
|
||||
return CELL_OK;
|
||||
});
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
error_code cellGameUpdateCheckFinishAsync(ppu_thread& ppu, vm::ptr<CellGameUpdateCallback> cb_func, vm::ptr<void> userdata)
|
||||
error_code cellGameUpdateCheckFinishAsync(vm::ptr<CellGameUpdateCallback> cb_func, vm::ptr<void> userdata)
|
||||
{
|
||||
cellNetCtl.todo("cellGameUpdateCheckFinishAsync(cb_func=*0x%x, userdata=*0x%x)", cb_func, userdata);
|
||||
const u32 PROCESSING_COMPLETE = 5;
|
||||
sysutil_register_cb([=](ppu_thread& ppu) -> s32
|
||||
{
|
||||
cb_func(ppu, PROCESSING_COMPLETE, CELL_OK, userdata);
|
||||
cb_func(ppu, CELL_GAMEUPDATE_RESULT_STATUS_FINISHED, CELL_OK, userdata);
|
||||
return CELL_OK;
|
||||
});
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
error_code cellGameUpdateCheckStartWithoutDialogAsync(ppu_thread& ppu, vm::ptr<CellGameUpdateCallback> cb_func, vm::ptr<void> userdata)
|
||||
error_code cellGameUpdateCheckStartWithoutDialogAsync(vm::ptr<CellGameUpdateCallback> cb_func, vm::ptr<void> 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_OK, CELL_OK, userdata);
|
||||
cb_func(ppu, CELL_GAMEUPDATE_RESULT_STATUS_NO_UPDATE, CELL_OK, userdata);
|
||||
return CELL_OK;
|
||||
});
|
||||
return CELL_OK;
|
||||
@@ -306,35 +310,35 @@ error_code cellGameUpdateCheckAbort()
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
error_code cellGameUpdateCheckStartAsyncEx(ppu_thread& ppu, vm::cptr<CellGameUpdateParam> param, vm::ptr<CellGameUpdateCallbackEx> cb_func, vm::ptr<void> userdata)
|
||||
error_code cellGameUpdateCheckStartAsyncEx(vm::cptr<CellGameUpdateParam> param, vm::ptr<CellGameUpdateCallbackEx> cb_func, vm::ptr<void> 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_OK, CELL_OK, 0x0, 0x0}), userdata);
|
||||
cb_func(ppu, vm::make_var(CellGameUpdateResult{ CELL_GAMEUPDATE_RESULT_STATUS_NO_UPDATE, CELL_OK, 0x0, 0x0}), userdata);
|
||||
return CELL_OK;
|
||||
});
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
error_code cellGameUpdateCheckFinishAsyncEx(ppu_thread& ppu, vm::ptr<CellGameUpdateCallbackEx> cb_func, vm::ptr<void> userdata)
|
||||
error_code cellGameUpdateCheckFinishAsyncEx(vm::ptr<CellGameUpdateCallbackEx> cb_func, vm::ptr<void> userdata)
|
||||
{
|
||||
cellNetCtl.todo("cellGameUpdateCheckFinishAsyncEx(cb_func=*0x%x, userdata=*0x%x)", cb_func, userdata);
|
||||
const s32 PROCESSING_COMPLETE = 5;
|
||||
sysutil_register_cb([=](ppu_thread& ppu) -> s32
|
||||
{
|
||||
cb_func(ppu, vm::make_var(CellGameUpdateResult{ PROCESSING_COMPLETE, CELL_OK, 0x0, 0x0}), userdata);
|
||||
cb_func(ppu, vm::make_var(CellGameUpdateResult{ CELL_GAMEUPDATE_RESULT_STATUS_FINISHED, CELL_OK, 0x0, 0x0}), userdata);
|
||||
return CELL_OK;
|
||||
});
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
error_code cellGameUpdateCheckStartWithoutDialogAsyncEx(ppu_thread& ppu, vm::ptr<CellGameUpdateCallbackEx> cb_func, vm::ptr<void> userdata)
|
||||
error_code cellGameUpdateCheckStartWithoutDialogAsyncEx(vm::ptr<CellGameUpdateCallbackEx> cb_func, vm::ptr<void> 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_OK, CELL_OK, 0x0, 0x0}), userdata);
|
||||
cb_func(ppu, vm::make_var(CellGameUpdateResult{ CELL_GAMEUPDATE_RESULT_STATUS_NO_UPDATE, CELL_OK, 0x0, 0x0}), userdata);
|
||||
return CELL_OK;
|
||||
});
|
||||
return CELL_OK;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
namespace vm { using namespace ps3; }
|
||||
|
||||
|
||||
// Error Codes
|
||||
enum CellNetCtlError : u32
|
||||
@@ -303,6 +303,18 @@ static const char* InfoCodeToName(s32 code)
|
||||
}
|
||||
}
|
||||
|
||||
enum
|
||||
{
|
||||
CELL_GAMEUPDATE_RESULT_STATUS_NO_UPDATE = 0,
|
||||
CELL_GAMEUPDATE_RESULT_STATUS_UPDATE_FOUND = 1,
|
||||
CELL_GAMEUPDATE_RESULT_STATUS_MAINTENANCE = 2,
|
||||
CELL_GAMEUPDATE_RESULT_STATUS_ERROR = 3,
|
||||
CELL_GAMEUPDATE_RESULT_STATUS_CANCELLED = 4,
|
||||
CELL_GAMEUPDATE_RESULT_STATUS_FINISHED = 5,
|
||||
CELL_GAMEUPDATE_RESULT_STATUS_ABORTED = 6,
|
||||
CELL_GAMEUPDATE_RESULT_STATUS_SYSTEM_UPDATE_NEEDED = 7
|
||||
};
|
||||
|
||||
struct CellGameUpdateResult
|
||||
{
|
||||
be_t<s32> status; // CellGameUpdateResultStatus
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
namespace vm { using namespace ps3; }
|
||||
|
||||
|
||||
//error codes
|
||||
enum
|
||||
@@ -92,7 +92,7 @@ enum CellOskDialogType
|
||||
CELL_OSKDIALOG_TYPE_SEPARATE_CANDIDATE_WINDOW = 8,
|
||||
};
|
||||
|
||||
enum
|
||||
enum
|
||||
{
|
||||
CELL_OSKDIALOG_STRING_SIZE = 512, //Theroretical maxium for osk input, games can specify a lower limit
|
||||
};
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
#include "Emu/Cell/lv2/sys_spu.h"
|
||||
|
||||
namespace vm { using namespace ps3; }
|
||||
|
||||
|
||||
logs::channel cellOvis("cellOvis");
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
namespace vm { using namespace ps3; }
|
||||
|
||||
|
||||
enum
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
namespace vm { using namespace ps3; }
|
||||
|
||||
|
||||
// Error Codes
|
||||
enum
|
||||
@@ -38,7 +38,7 @@ enum
|
||||
CELL_PAMF_FS_48kHz = 1,
|
||||
};
|
||||
|
||||
enum
|
||||
enum
|
||||
{
|
||||
CELL_PAMF_BIT_LENGTH_16 = 1,
|
||||
CELL_PAMF_BIT_LENGTH_24 = 3,
|
||||
@@ -60,7 +60,7 @@ enum
|
||||
CELL_PAMF_AVC_LEVEL_4P2 = 42,
|
||||
};
|
||||
|
||||
enum
|
||||
enum
|
||||
{
|
||||
CELL_PAMF_AVC_FRC_24000DIV1001 = 0,
|
||||
CELL_PAMF_AVC_FRC_24 = 1,
|
||||
@@ -263,7 +263,7 @@ struct PamfStreamHeader
|
||||
u8 unknown2;
|
||||
be_t<u32> ep_offset; // offset of EP section in header
|
||||
be_t<u32> ep_num; // count of EPs
|
||||
|
||||
|
||||
union
|
||||
{
|
||||
u8 data[32]; // specific info
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
#include "cellSysutil.h"
|
||||
|
||||
|
||||
namespace vm { using namespace ps3; }
|
||||
|
||||
logs::channel cellPhotoDecode("cellPhotoDecode");
|
||||
|
||||
@@ -16,42 +17,67 @@ enum
|
||||
CELL_PHOTO_DECODE_ERROR_DECODE = 0x8002c906,
|
||||
};
|
||||
|
||||
// Datatypes
|
||||
struct CellPhotoDecodeSetParam
|
||||
{
|
||||
u32 dstBuffer_addr;
|
||||
u16 width;
|
||||
u16 height;
|
||||
{
|
||||
vm::bptr<void> dstBuffer;
|
||||
be_t<u16> width;
|
||||
be_t<u16> height;
|
||||
vm::bptr<void> reserved1;
|
||||
vm::bptr<void> reserved2;
|
||||
};
|
||||
|
||||
struct CellPhotoDecodeReturnParam
|
||||
{
|
||||
u16 width;
|
||||
u16 height;
|
||||
{
|
||||
be_t<u16> width;
|
||||
be_t<u16> height;
|
||||
vm::bptr<void> reserved1;
|
||||
vm::bptr<void> reserved2;
|
||||
};
|
||||
|
||||
// Functions
|
||||
s32 cellPhotoDecodeInitialize()
|
||||
using CellPhotoDecodeFinishCallback = void(s32 result, vm::ptr<void> userdata);
|
||||
|
||||
error_code cellPhotoDecodeInitialize(u32 version, u32 container1, u32 container2, vm::ptr<CellPhotoDecodeFinishCallback> funcFinish, vm::ptr<void> userdata)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellPhotoDecode);
|
||||
cellPhotoDecode.todo("cellPhotoDecodeInitialize(version=0x%x, container1=0x%x, container2=0x%x, funcFinish=*0x%x, userdata=*0x%x)", version, container1, container2, funcFinish, userdata);
|
||||
|
||||
sysutil_register_cb([=](ppu_thread& ppu) -> s32
|
||||
{
|
||||
funcFinish(ppu, CELL_OK, userdata);
|
||||
return CELL_OK;
|
||||
});
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellPhotoDecodeInitialize2()
|
||||
error_code cellPhotoDecodeInitialize2(u32 version, u32 container2, vm::ptr<CellPhotoDecodeFinishCallback> funcFinish, vm::ptr<void> userdata)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellPhotoDecode);
|
||||
cellPhotoDecode.todo("cellPhotoDecodeInitialize2(version=0x%x, container2=0x%x, funcFinish=*0x%x, userdata=*0x%x)", version, container2, funcFinish, userdata);
|
||||
|
||||
sysutil_register_cb([=](ppu_thread& ppu) -> s32
|
||||
{
|
||||
funcFinish(ppu, CELL_OK, userdata);
|
||||
return CELL_OK;
|
||||
});
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellPhotoDecodeFinalize()
|
||||
error_code cellPhotoDecodeFinalize(vm::ptr<CellPhotoDecodeFinishCallback> funcFinish, vm::ptr<void> userdata)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellPhotoDecode);
|
||||
cellPhotoDecode.todo("cellPhotoDecodeFinalize(funcFinish=*0x%x, userdata=*0x%x)", funcFinish, userdata);
|
||||
|
||||
sysutil_register_cb([=](ppu_thread& ppu) -> s32
|
||||
{
|
||||
funcFinish(ppu, CELL_OK, userdata);
|
||||
return CELL_OK;
|
||||
});
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellPhotoDecodeFromFile()
|
||||
error_code cellPhotoDecodeFromFile(vm::cptr<char> srcHddDir, vm::cptr<char> srcHddFile, vm::ptr<CellPhotoDecodeSetParam> set_param, vm::ptr<CellPhotoDecodeReturnParam> return_param)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellPhotoDecode);
|
||||
cellPhotoDecode.todo("cellPhotoDecodeFromFile(srcHddDir=%s, srcHddFile=%s, set_param=*0x%x, return_param=*0x%x)", srcHddDir, srcHddFile, set_param, return_param);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
#include "cellSysutil.h"
|
||||
|
||||
namespace vm { using namespace ps3; }
|
||||
|
||||
|
||||
logs::channel cellPhotoExport("cellPhotoExport");
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
#include "Emu/Cell/lv2/sys_fs.h"
|
||||
#include "cellSysutil.h"
|
||||
|
||||
|
||||
namespace vm { using namespace ps3; }
|
||||
|
||||
logs::channel cellPhotoImportUtil("cellPhotoImportUtil");
|
||||
|
||||
@@ -16,39 +18,88 @@ enum
|
||||
CELL_PHOTO_IMPORT_ERROR_INITIALIZE = 0x8002c706,
|
||||
};
|
||||
|
||||
// Datatypes
|
||||
enum
|
||||
{
|
||||
CELL_PHOTO_IMPORT_HDD_PATH_MAX = 1055,
|
||||
CELL_PHOTO_IMPORT_PHOTO_TITLE_MAX_LENGTH = 64,
|
||||
CELL_PHOTO_IMPORT_GAME_TITLE_MAX_SIZE = 128,
|
||||
CELL_PHOTO_IMPORT_GAME_COMMENT_MAX_SIZE = 1024
|
||||
};
|
||||
|
||||
enum CellPhotoImportFormatType
|
||||
{
|
||||
CELL_PHOTO_IMPORT_FT_UNKNOWN = 0,
|
||||
CELL_PHOTO_IMPORT_FT_JPEG,
|
||||
CELL_PHOTO_IMPORT_FT_PNG,
|
||||
CELL_PHOTO_IMPORT_FT_GIF,
|
||||
CELL_PHOTO_IMPORT_FT_BMP,
|
||||
CELL_PHOTO_IMPORT_FT_TIFF,
|
||||
CELL_PHOTO_IMPORT_FT_MPO,
|
||||
};
|
||||
|
||||
enum CellPhotoImportTexRot
|
||||
{
|
||||
CELL_PHOTO_IMPORT_TEX_ROT_0 = 0,
|
||||
CELL_PHOTO_IMPORT_TEX_ROT_90,
|
||||
CELL_PHOTO_IMPORT_TEX_ROT_180,
|
||||
CELL_PHOTO_IMPORT_TEX_ROT_270,
|
||||
};
|
||||
|
||||
struct CellPhotoImportFileDataSub
|
||||
{
|
||||
int width;
|
||||
int height;
|
||||
//CellPhotoImportFormatType format;
|
||||
//CellPhotoImportTexRot rotate;
|
||||
be_t<s32> width;
|
||||
be_t<s32> height;
|
||||
be_t<CellPhotoImportFormatType> format;
|
||||
be_t<CellPhotoImportTexRot> rotate;
|
||||
};
|
||||
|
||||
struct CellPhotoImportFileData
|
||||
{
|
||||
char dstFileName; //[CELL_FS_MAX_FS_FILE_NAME_LENGTH];
|
||||
char photo_title; //[CELL_PHOTO_IMPORT_PHOTO_TITLE_MAX_LENGTH*3];
|
||||
char game_title; //[CELL_PHOTO_IMPORT_GAME_TITLE_MAX_SIZE];
|
||||
char game_comment; //[CELL_PHOTO_IMPORT_GAME_COMMENT_MAX_SIZE];
|
||||
CellPhotoImportFileDataSub* data_sub;
|
||||
char dstFileName[CELL_FS_MAX_FS_FILE_NAME_LENGTH];
|
||||
char photo_title[CELL_PHOTO_IMPORT_PHOTO_TITLE_MAX_LENGTH * 3];
|
||||
char game_title[CELL_PHOTO_IMPORT_GAME_TITLE_MAX_SIZE];
|
||||
char game_comment[CELL_PHOTO_IMPORT_GAME_COMMENT_MAX_SIZE];
|
||||
char padding;
|
||||
vm::bptr<CellPhotoImportFileDataSub> data_sub;
|
||||
vm::bptr<void> reserved;
|
||||
};
|
||||
|
||||
struct CellPhotoImportSetParam
|
||||
{
|
||||
unsigned int fileSizeMax;
|
||||
be_t<u32> fileSizeMax;
|
||||
vm::bptr<void> reserved1;
|
||||
vm::bptr<void> reserved2;
|
||||
};
|
||||
|
||||
// Functions
|
||||
s32 cellPhotoImport()
|
||||
using CellPhotoImportFinishCallback = void(s32 result, vm::ptr<CellPhotoImportFileData> filedata, vm::ptr<void> userdata);
|
||||
|
||||
error_code cellPhotoImport(u32 version, vm::cptr<char> dstHddPath, vm::ptr<CellPhotoImportSetParam> param, u32 container, vm::ptr<CellPhotoImportFinishCallback> funcFinish, vm::ptr<void> userdata)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellPhotoImportUtil);
|
||||
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);
|
||||
|
||||
sysutil_register_cb([=](ppu_thread& ppu) -> s32
|
||||
{
|
||||
vm::var<CellPhotoImportFileData> filedata;
|
||||
filedata->data_sub = vm::var<CellPhotoImportFileDataSub>();
|
||||
funcFinish(ppu, CELL_OK, filedata, userdata);
|
||||
return CELL_OK;
|
||||
});
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellPhotoImport2()
|
||||
error_code cellPhotoImport2(u32 version, vm::cptr<char> dstHddPath, vm::ptr<CellPhotoImportSetParam> param, vm::ptr<CellPhotoImportFinishCallback> funcFinish, vm::ptr<void> userdata)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellPhotoImportUtil);
|
||||
cellPhotoImportUtil.todo("cellPhotoImport2(version=0x%x, dstHddPath=%s, param=*0x%x, funcFinish=*0x%x, userdata=*0x%x)", version, dstHddPath, param, funcFinish, userdata);
|
||||
|
||||
sysutil_register_cb([=](ppu_thread& ppu) -> s32
|
||||
{
|
||||
vm::var<CellPhotoImportFileData> filedata;
|
||||
filedata->data_sub = vm::var<CellPhotoImportFileDataSub>();
|
||||
funcFinish(ppu, CELL_OK, filedata, userdata);
|
||||
return CELL_OK;
|
||||
});
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
namespace vm { using namespace ps3; }
|
||||
|
||||
|
||||
enum CellPngTxtType : s32
|
||||
{
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user