mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-08 08:10:30 -10:00
Compare commits
10
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fca7bc52ed | ||
|
|
159190cc14 | ||
|
|
984c3a22a3 | ||
|
|
1e11cbf6b4 | ||
|
|
ecebcf8215 | ||
|
|
8f7646ded8 | ||
|
|
b96fd5933c | ||
|
|
03676061b4 | ||
|
|
777ba7c5c3 | ||
|
|
bfb5f58b90 |
No files matched your search
@@ -15,11 +15,6 @@ charset = utf-8
|
||||
indent_style = space
|
||||
indent_size = 3
|
||||
|
||||
# 2 space indentation
|
||||
[*.{json,xml,yaml,yml}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
# Tab indentation
|
||||
[Makefile*]
|
||||
indent_style = tab
|
||||
@@ -1,31 +0,0 @@
|
||||
# Upload sources to Crowdin for translation
|
||||
|
||||
name: Crowdin Workflow
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- 'intl/*_us.h'
|
||||
- 'intl/*_us.json'
|
||||
|
||||
jobs:
|
||||
sync:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Setup Java JDK
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 1.8
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v2
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Crowdin Sync
|
||||
shell: bash
|
||||
env:
|
||||
CROWDIN_API_KEY: ${{ secrets.CROWDIN_API_KEY }}
|
||||
run: |
|
||||
cd intl
|
||||
python3 crowdin_sync.py "$CROWDIN_API_KEY"
|
||||
+1
-39
@@ -8,7 +8,6 @@
|
||||
*.dol
|
||||
*.map
|
||||
*.swp
|
||||
*.cache
|
||||
.tmp
|
||||
.tmp.c
|
||||
.tmp.cxx
|
||||
@@ -34,7 +33,6 @@ Release
|
||||
ipch
|
||||
*.user
|
||||
/bootstrap/gx/wii/app_booter/app_booter.bin
|
||||
/wii/app_booter/app_booter.bin
|
||||
*.zip
|
||||
RetroArch-w32/
|
||||
RetroArch-w64/
|
||||
@@ -69,7 +67,6 @@ apple/RetroArch_iOS.xcodeproj/project.xcworkspace/*
|
||||
/rsound.h
|
||||
.pc
|
||||
/media/shaders_glsl/
|
||||
/media/shaders_slang/
|
||||
/obj-w32/
|
||||
.cproject
|
||||
.settings
|
||||
@@ -79,31 +76,10 @@ convert_rumble.awk
|
||||
*~
|
||||
assets
|
||||
info
|
||||
content_favorites.lpl
|
||||
content_history.lpl
|
||||
content_image_history.lpl
|
||||
content_music_history.lpl
|
||||
content_video_history.lpl
|
||||
saves
|
||||
screenshots
|
||||
autoconfig
|
||||
config
|
||||
database
|
||||
overlays
|
||||
playlists
|
||||
states
|
||||
system
|
||||
shaders/shaders_cg
|
||||
shaders/shaders_glsl
|
||||
shaders/shaders_slang
|
||||
|
||||
# Qt Creator
|
||||
*.cflags
|
||||
*.cxxflags
|
||||
*.creator*
|
||||
*.config
|
||||
*.files
|
||||
*.includes
|
||||
|
||||
# Wii U
|
||||
*.depend
|
||||
@@ -198,7 +174,7 @@ retroarch_switch.nso
|
||||
|
||||
# PS2
|
||||
ps2/irx/*.c
|
||||
*.irx
|
||||
ps2/libcdvd/lib/
|
||||
|
||||
# Wayland
|
||||
gfx/common/wayland/idle-inhibit-unstable-v1.c
|
||||
@@ -209,17 +185,3 @@ gfx/common/wayland/xdg-decoration-unstable-v1.h
|
||||
gfx/common/wayland/xdg-decoration-unstable-v1.c
|
||||
gfx/common/wayland/xdg-shell.c
|
||||
gfx/common/wayland/xdg-shell.h
|
||||
|
||||
# libretro-common samples
|
||||
libretro-common/samples/streams/rzip/rzip
|
||||
|
||||
# DINGUX
|
||||
*.opk
|
||||
|
||||
#VITA
|
||||
param.sfo
|
||||
*.S
|
||||
*.wo
|
||||
*.elf
|
||||
*.self
|
||||
*.vpk
|
||||
+6
-909
@@ -1,911 +1,8 @@
|
||||
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-amd64-ubuntu:latest
|
||||
before_script:
|
||||
- apt-get update -qq && apt-get install -y -qq git build-essential
|
||||
- apt-get update -qq && apt-get build-dep -y retroarch
|
||||
|
||||
stages:
|
||||
- build-prepare
|
||||
- build
|
||||
- prepare-for-static-cores
|
||||
- trigger-static-cores
|
||||
|
||||
build-retroarch-windows-x64:
|
||||
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-mxe-win64-cross:gcc10
|
||||
stage: build
|
||||
variables:
|
||||
MEDIA_PATH: .media
|
||||
STRIP_BIN: 1
|
||||
before_script:
|
||||
- export NUMPROC=$(($(nproc)/3))
|
||||
artifacts:
|
||||
paths:
|
||||
- retroarch.exe
|
||||
- ${MEDIA_PATH}
|
||||
expire_in: 10 min
|
||||
dependencies: []
|
||||
build:
|
||||
script:
|
||||
- "MOC=/usr/lib/mxe/usr/x86_64-w64-mingw32.shared/qt5/bin/moc ./configure --host=x86_64-w64-mingw32.shared"
|
||||
- "make -j$NUMPROC"
|
||||
- if [ $STRIP_BIN -eq 1 ]; then strip --strip-unneeded retroarch.exe; fi
|
||||
- "mkdir -p ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/audio"
|
||||
- "mkdir -p ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/video"
|
||||
- "mkdir -p ${MEDIA_PATH}/${CI_PROJECT_NAME}/pkg"
|
||||
- "mkdir -p ${MEDIA_PATH}/${CI_PROJECT_NAME}/redist"
|
||||
- "cd libretro-common/audio/dsp_filters && make -j$NUMPROC platform=win compiler=x86_64-w64-mingw32.static-gcc build=release && make -j$NUMPROC platform=win compiler=x86_64-w64-mingw32.static-gcc build=release strip && cd -"
|
||||
- "cp -f libretro-common/audio/dsp_filters/*.dll ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/audio"
|
||||
- "cp -f libretro-common/audio/dsp_filters/*.dsp ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/audio"
|
||||
- "cd gfx/video_filters && make -j$NUMPROC platform=win compiler=x86_64-w64-mingw32.static-gcc build=release && make -j$NUMPROC platform=win compiler=x86_64-w64-mingw32.static-gcc build=release strip && cd -"
|
||||
- "cp -f gfx/video_filters/*.dll ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/video"
|
||||
- "cp -f gfx/video_filters/*.filt ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/video"
|
||||
- "cp -f retroarch.cfg ${MEDIA_PATH}/${CI_PROJECT_NAME}/pkg/retroarch.default.cfg"
|
||||
- "echo -e '[Paths]\nPlugins = ./' > ${MEDIA_PATH}/${CI_PROJECT_NAME}/pkg/qt.conf"
|
||||
- "/bin/bash /usr/lib/mxe/tools/copydlldeps.sh
|
||||
--infile retroarch.exe
|
||||
--destdir ${MEDIA_PATH}/${CI_PROJECT_NAME}/redist/
|
||||
--recursivesrcdir /usr/lib/mxe/usr/x86_64-w64-mingw32.shared/
|
||||
--enforcedir /usr/lib/mxe/usr/x86_64-w64-mingw32.shared/qt5/plugins/bearer/
|
||||
--enforcedir /usr/lib/mxe/usr/x86_64-w64-mingw32.shared/qt5/plugins/iconengines/
|
||||
--enforcedir /usr/lib/mxe/usr/x86_64-w64-mingw32.shared/qt5/plugins/imageformats/
|
||||
--enforcedir /usr/lib/mxe/usr/x86_64-w64-mingw32.shared/qt5/plugins/platforms/
|
||||
--enforcedir /usr/lib/mxe/usr/x86_64-w64-mingw32.shared/qt5/plugins/styles/
|
||||
--copy
|
||||
--objdump x86_64-w64-mingw32.shared-objdump"
|
||||
- "rm -f ${MEDIA_PATH}/${CI_PROJECT_NAME}/redist/opengl32.dll"
|
||||
|
||||
build-retroarch-windows-i686:
|
||||
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-mxe-win32-cross:gcc10
|
||||
stage: build
|
||||
variables:
|
||||
MEDIA_PATH: .media
|
||||
STRIP_BIN: 1
|
||||
before_script:
|
||||
- export NUMPROC=$(($(nproc)/3))
|
||||
artifacts:
|
||||
paths:
|
||||
- retroarch.exe
|
||||
- ${MEDIA_PATH}
|
||||
expire_in: 10 min
|
||||
dependencies: []
|
||||
script:
|
||||
- "MOC=/usr/lib/mxe/usr/i686-w64-mingw32.shared/qt5/bin/moc ./configure --host=i686-w64-mingw32.shared"
|
||||
- "make -j$NUMPROC"
|
||||
- if [ $STRIP_BIN -eq 1 ]; then strip --strip-unneeded retroarch.exe; fi
|
||||
- "mkdir -p ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/audio"
|
||||
- "mkdir -p ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/video"
|
||||
- "mkdir -p ${MEDIA_PATH}/${CI_PROJECT_NAME}/pkg"
|
||||
- "mkdir -p ${MEDIA_PATH}/${CI_PROJECT_NAME}/redist"
|
||||
- "cd libretro-common/audio/dsp_filters && make -j$NUMPROC platform=win compiler=i686-w64-mingw32.static-gcc build=release && make -j$NUMPROC platform=win compiler=i686-w64-mingw32.static-gcc build=release strip && cd -"
|
||||
- "cp -f libretro-common/audio/dsp_filters/*.dll ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/audio"
|
||||
- "cp -f libretro-common/audio/dsp_filters/*.dsp ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/audio"
|
||||
- "cd gfx/video_filters && make -j$NUMPROC platform=win compiler=i686-w64-mingw32.static-gcc build=release && make -j$NUMPROC platform=win compiler=i686-w64-mingw32.static-gcc build=release strip && cd -"
|
||||
- "cp -f gfx/video_filters/*.dll ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/video"
|
||||
- "cp -f gfx/video_filters/*.filt ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/video"
|
||||
- "cp -f retroarch.cfg ${MEDIA_PATH}/${CI_PROJECT_NAME}/pkg/retroarch.default.cfg"
|
||||
- "echo -e '[Paths]\nPlugins = ./' > ${MEDIA_PATH}/${CI_PROJECT_NAME}/pkg/qt.conf"
|
||||
- "/bin/bash /usr/lib/mxe/tools/copydlldeps.sh
|
||||
--infile retroarch.exe
|
||||
--destdir ${MEDIA_PATH}/${CI_PROJECT_NAME}/redist/
|
||||
--recursivesrcdir /usr/lib/mxe/usr/i686-w64-mingw32.shared/
|
||||
--enforcedir /usr/lib/mxe/usr/i686-w64-mingw32.shared/qt5/plugins/bearer/
|
||||
--enforcedir /usr/lib/mxe/usr/i686-w64-mingw32.shared/qt5/plugins/iconengines/
|
||||
--enforcedir /usr/lib/mxe/usr/i686-w64-mingw32.shared/qt5/plugins/imageformats/
|
||||
--enforcedir /usr/lib/mxe/usr/i686-w64-mingw32.shared/qt5/plugins/platforms/
|
||||
--enforcedir /usr/lib/mxe/usr/i686-w64-mingw32.shared/qt5/plugins/styles/
|
||||
--copy
|
||||
--objdump i686-w64-mingw32.shared-objdump"
|
||||
- "rm -f ${MEDIA_PATH}/${CI_PROJECT_NAME}/redist/opengl32.dll"
|
||||
|
||||
build-retroarch-windows-msvc10-x64:
|
||||
tags:
|
||||
- msvc2010
|
||||
stage: build
|
||||
variables:
|
||||
MEDIA_PATH: .media
|
||||
MSYSTEM: MINGW64
|
||||
ARCH: x86_64
|
||||
MSYS_BIN_DIR: C:\msys64\usr\bin
|
||||
SDK_BIN_DIR: C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin
|
||||
RCEDIT_BIN_DIR: C:\Program Files\rcedit
|
||||
PEDEPS_BIN_DIR: C:\Program Files\pedeps-0.1.9-win64\bin
|
||||
before_script:
|
||||
- $Env:HOME = "."
|
||||
- $Env:Path += -join(";", "$Env:SDK_BIN_DIR", ";", "$Env:RCEDIT_BIN_DIR", ";", "$Env:PEDEPS_BIN_DIR")
|
||||
artifacts:
|
||||
paths:
|
||||
- retroarch.exe
|
||||
- ${MEDIA_PATH}
|
||||
expire_in: 10 min
|
||||
dependencies: []
|
||||
script:
|
||||
# Build RetroArch
|
||||
- $Script:MakeCmd = "$Env:MSYS_BIN_DIR\env.exe $Env:MSYS_BIN_DIR\bash.exe -l -c 'make -f Makefile.griffin platform=windows_msvc2010_x64'"
|
||||
- Invoke-Expression $Script:MakeCmd
|
||||
- mt.exe -nologo -manifest "retroarch.exe.manifest" -outputresource:"retroarch.exe;#1"
|
||||
- rcedit-x64.exe "retroarch.exe" --set-icon "media\retroarch.ico"
|
||||
# Create .media subdirectories
|
||||
- New-Item -Path "$Env:MEDIA_PATH/$Env:CI_PROJECT_NAME/filters/audio" -ItemType Directory
|
||||
- New-Item -Path "$Env:MEDIA_PATH/$Env:CI_PROJECT_NAME/filters/video" -ItemType Directory
|
||||
- New-Item -Path "$Env:MEDIA_PATH/$Env:CI_PROJECT_NAME/pkg" -ItemType Directory
|
||||
- New-Item -Path "$Env:MEDIA_PATH/$Env:CI_PROJECT_NAME/redist" -ItemType Directory
|
||||
# Copy audio/video filters
|
||||
- Get-ChildItem -Path "libretro-common/audio/dsp_filters/*" -Include *.dsp | Copy-Item -Destination "$Env:MEDIA_PATH/$Env:CI_PROJECT_NAME/filters/audio"
|
||||
- Get-ChildItem -Path "gfx/video_filters/*" -Include *.filt | Copy-Item -Destination "$Env:MEDIA_PATH/$Env:CI_PROJECT_NAME/filters/video"
|
||||
# Copy default config file
|
||||
- Copy-Item -Path "retroarch.cfg" -Destination "$Env:MEDIA_PATH/$Env:CI_PROJECT_NAME/pkg/retroarch.default.cfg"
|
||||
# Copy dll dependencies
|
||||
# (note that msvc10 build should not have any, but this
|
||||
# may change in the future)
|
||||
- copypedeps.exe -r retroarch.exe "$Env:MEDIA_PATH/$Env:CI_PROJECT_NAME/redist"
|
||||
- Remove-Item "$Env:MEDIA_PATH/$Env:CI_PROJECT_NAME/redist/retroarch.exe" -ErrorAction Ignore
|
||||
|
||||
build-retroarch-windows-msvc10-i686:
|
||||
tags:
|
||||
- msvc2010
|
||||
stage: build
|
||||
variables:
|
||||
MEDIA_PATH: .media
|
||||
MSYSTEM: MINGW32
|
||||
ARCH: x86
|
||||
MSYS_BIN_DIR: C:\msys64\usr\bin
|
||||
SDK_BIN_DIR: C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin
|
||||
RCEDIT_BIN_DIR: C:\Program Files\rcedit
|
||||
PEDEPS_BIN_DIR: C:\Program Files\pedeps-0.1.9-win64\bin
|
||||
before_script:
|
||||
- $Env:HOME = "."
|
||||
- $Env:Path += -join(";", "$Env:SDK_BIN_DIR", ";", "$Env:RCEDIT_BIN_DIR", ";", "$Env:PEDEPS_BIN_DIR")
|
||||
artifacts:
|
||||
paths:
|
||||
- retroarch.exe
|
||||
- ${MEDIA_PATH}
|
||||
expire_in: 10 min
|
||||
dependencies: []
|
||||
script:
|
||||
# Build RetroArch
|
||||
- $Script:MakeCmd = "$Env:MSYS_BIN_DIR\env.exe $Env:MSYS_BIN_DIR\bash.exe -l -c 'make -f Makefile.griffin platform=windows_msvc2010_x86'"
|
||||
- Invoke-Expression $Script:MakeCmd
|
||||
- mt.exe -nologo -manifest "retroarch.exe.manifest" -outputresource:"retroarch.exe;#1"
|
||||
- rcedit-x64.exe "retroarch.exe" --set-icon "media\retroarch.ico"
|
||||
# Create .media subdirectories
|
||||
- New-Item -Path "$Env:MEDIA_PATH/$Env:CI_PROJECT_NAME/filters/audio" -ItemType Directory
|
||||
- New-Item -Path "$Env:MEDIA_PATH/$Env:CI_PROJECT_NAME/filters/video" -ItemType Directory
|
||||
- New-Item -Path "$Env:MEDIA_PATH/$Env:CI_PROJECT_NAME/pkg" -ItemType Directory
|
||||
- New-Item -Path "$Env:MEDIA_PATH/$Env:CI_PROJECT_NAME/redist" -ItemType Directory
|
||||
# Copy audio/video filters
|
||||
- Get-ChildItem -Path "libretro-common/audio/dsp_filters/*" -Include *.dsp | Copy-Item -Destination "$Env:MEDIA_PATH/$Env:CI_PROJECT_NAME/filters/audio"
|
||||
- Get-ChildItem -Path "gfx/video_filters/*" -Include *.filt | Copy-Item -Destination "$Env:MEDIA_PATH/$Env:CI_PROJECT_NAME/filters/video"
|
||||
# Copy default config file
|
||||
- Copy-Item -Path "retroarch.cfg" -Destination "$Env:MEDIA_PATH/$Env:CI_PROJECT_NAME/pkg/retroarch.default.cfg"
|
||||
# Copy dll dependencies
|
||||
# (note that msvc10 build should not have any, but this
|
||||
# may change in the future)
|
||||
- copypedeps.exe -r retroarch.exe "$Env:MEDIA_PATH/$Env:CI_PROJECT_NAME/redist"
|
||||
- Remove-Item "$Env:MEDIA_PATH/$Env:CI_PROJECT_NAME/redist/retroarch.exe" -ErrorAction Ignore
|
||||
|
||||
build-retroarch-windows-msvc05-i686:
|
||||
tags:
|
||||
- win10
|
||||
stage: build
|
||||
variables:
|
||||
MEDIA_PATH: .media
|
||||
MSYSTEM: MINGW32
|
||||
ARCH: x86
|
||||
MSYS_BIN_DIR: C:\msys64\usr\bin
|
||||
SDK_BIN_DIR: C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin
|
||||
RCEDIT_BIN_DIR: C:\Program Files\rcedit
|
||||
PEDEPS_BIN_DIR: C:\Program Files\pedeps-0.1.9-win64\bin
|
||||
VS80COMNTOOLS: C:\Program Files (x86)\Microsoft Visual Studio 8\Common7\Tools\
|
||||
before_script:
|
||||
- $Env:HOME = "."
|
||||
- $Env:Path += -join(";", "$Env:SDK_BIN_DIR", ";", "$Env:RCEDIT_BIN_DIR", ";", "$Env:PEDEPS_BIN_DIR")
|
||||
artifacts:
|
||||
paths:
|
||||
- retroarch.exe
|
||||
- ${MEDIA_PATH}
|
||||
expire_in: 10 min
|
||||
dependencies: []
|
||||
script:
|
||||
# Build RetroArch
|
||||
- $Script:MakeCmd = "$Env:MSYS_BIN_DIR\env.exe $Env:MSYS_BIN_DIR\bash.exe -l -c 'make -f Makefile.griffin platform=windows_msvc2005_x86'"
|
||||
- Invoke-Expression $Script:MakeCmd
|
||||
- mt.exe -nologo -manifest "retroarch.exe.manifest" -outputresource:"retroarch.exe;#1"
|
||||
- rcedit-x64.exe "retroarch.exe" --set-icon "media\retroarch.ico"
|
||||
# Create .media subdirectories
|
||||
- New-Item -Path "$Env:MEDIA_PATH/$Env:CI_PROJECT_NAME/filters/audio" -ItemType Directory
|
||||
- New-Item -Path "$Env:MEDIA_PATH/$Env:CI_PROJECT_NAME/filters/video" -ItemType Directory
|
||||
- New-Item -Path "$Env:MEDIA_PATH/$Env:CI_PROJECT_NAME/pkg" -ItemType Directory
|
||||
- New-Item -Path "$Env:MEDIA_PATH/$Env:CI_PROJECT_NAME/redist" -ItemType Directory
|
||||
# Copy audio/video filters
|
||||
- Get-ChildItem -Path "libretro-common/audio/dsp_filters/*" -Include *.dsp | Copy-Item -Destination "$Env:MEDIA_PATH/$Env:CI_PROJECT_NAME/filters/audio"
|
||||
- Get-ChildItem -Path "gfx/video_filters/*" -Include *.filt | Copy-Item -Destination "$Env:MEDIA_PATH/$Env:CI_PROJECT_NAME/filters/video"
|
||||
# Copy default config file
|
||||
- Copy-Item -Path "retroarch.cfg" -Destination "$Env:MEDIA_PATH/$Env:CI_PROJECT_NAME/pkg/retroarch.default.cfg"
|
||||
# Copy dll dependencies
|
||||
# (note that msvc05 build should not have any, but this
|
||||
# may change in the future)
|
||||
- copypedeps.exe -r retroarch.exe "$Env:MEDIA_PATH/$Env:CI_PROJECT_NAME/redist"
|
||||
- Remove-Item "$Env:MEDIA_PATH/$Env:CI_PROJECT_NAME/redist/retroarch.exe" -ErrorAction Ignore
|
||||
|
||||
build-retroarch-linux-x64:
|
||||
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-amd64-ubuntu:xenial-gcc9
|
||||
stage: build
|
||||
variables:
|
||||
MEDIA_PATH: .media
|
||||
STRIP_BIN: 1
|
||||
before_script:
|
||||
- export NUMPROC=$(($(nproc)/3))
|
||||
artifacts:
|
||||
paths:
|
||||
- retroarch
|
||||
- retroarch_qt
|
||||
- ${MEDIA_PATH}
|
||||
expire_in: 10 min
|
||||
dependencies: []
|
||||
script:
|
||||
# Qt build
|
||||
- "mkdir -p ${MEDIA_PATH}/${CI_PROJECT_NAME}/AppDirQt"
|
||||
- "./configure --prefix=/usr"
|
||||
- "make -j$NUMPROC"
|
||||
- if [ $STRIP_BIN -eq 1 ]; then strip --strip-unneeded retroarch; fi
|
||||
- "make install DESTDIR=${MEDIA_PATH}/${CI_PROJECT_NAME}/AppDirQt prefix=/usr"
|
||||
- "rm -rf ${MEDIA_PATH}/${CI_PROJECT_NAME}/AppDirQt/etc"
|
||||
- "cd ${MEDIA_PATH}/${CI_PROJECT_NAME}/ && tar -czf AppDirQt.tar.gz AppDirQt && rm -rf AppDirQt && cd -"
|
||||
- "mv -f retroarch retroarch_qt"
|
||||
# Non-Qt build
|
||||
- "mkdir -p ${MEDIA_PATH}/${CI_PROJECT_NAME}/AppDir"
|
||||
- "make clean"
|
||||
- "./configure --disable-qt --prefix=/usr"
|
||||
- "make -j$NUMPROC"
|
||||
- if [ $STRIP_BIN -eq 1 ]; then strip --strip-unneeded retroarch; fi
|
||||
- "make install DESTDIR=${MEDIA_PATH}/${CI_PROJECT_NAME}/AppDir prefix=/usr"
|
||||
- "rm -rf ${MEDIA_PATH}/${CI_PROJECT_NAME}/AppDir/etc"
|
||||
- "cd ${MEDIA_PATH}/${CI_PROJECT_NAME}/ && tar -czf AppDir.tar.gz AppDir && rm -rf AppDir && cd -"
|
||||
# Filters
|
||||
- "mkdir -p ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/audio"
|
||||
- "mkdir -p ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/video"
|
||||
- "cd libretro-common/audio/dsp_filters && make -j$NUMPROC build=release && make -j$NUMPROC build=release strip && cd -"
|
||||
- "cp -f libretro-common/audio/dsp_filters/*.so ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/audio"
|
||||
- "cp -f libretro-common/audio/dsp_filters/*.dsp ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/audio"
|
||||
- "cd gfx/video_filters && make -j$NUMPROC build=release && make -j$NUMPROC build=release strip && cd -"
|
||||
- "cp -f gfx/video_filters/*.so ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/video"
|
||||
- "cp -f gfx/video_filters/*.filt ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/video"
|
||||
|
||||
build-retroarch-linux-i686:
|
||||
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-i386-ubuntu:xenial-gcc9
|
||||
stage: build
|
||||
variables:
|
||||
MEDIA_PATH: .media
|
||||
STRIP_BIN: 1
|
||||
before_script:
|
||||
- export NUMPROC=$(($(nproc)/3))
|
||||
artifacts:
|
||||
paths:
|
||||
- retroarch
|
||||
- ${MEDIA_PATH}
|
||||
expire_in: 10 min
|
||||
dependencies: []
|
||||
script:
|
||||
# Qt build
|
||||
- "mkdir -p ${MEDIA_PATH}/${CI_PROJECT_NAME}/AppDirQt"
|
||||
- "./configure --prefix=/usr"
|
||||
- "make -j$NUMPROC"
|
||||
- if [ $STRIP_BIN -eq 1 ]; then strip --strip-unneeded retroarch; fi
|
||||
- "make install DESTDIR=${MEDIA_PATH}/${CI_PROJECT_NAME}/AppDirQt prefix=/usr"
|
||||
- "rm -rf ${MEDIA_PATH}/${CI_PROJECT_NAME}/AppDirQt/etc"
|
||||
- "cd ${MEDIA_PATH}/${CI_PROJECT_NAME}/ && tar -czf AppDirQt.tar.gz AppDirQt && rm -rf AppDirQt && cd -"
|
||||
- "mv -f retroarch retroarch_qt"
|
||||
# Non-Qt build
|
||||
- "mkdir -p ${MEDIA_PATH}/${CI_PROJECT_NAME}/AppDir"
|
||||
- "make clean"
|
||||
- "./configure --disable-qt --prefix=/usr"
|
||||
- "make -j$NUMPROC"
|
||||
- if [ $STRIP_BIN -eq 1 ]; then strip --strip-unneeded retroarch; fi
|
||||
- "make install DESTDIR=${MEDIA_PATH}/${CI_PROJECT_NAME}/AppDir prefix=/usr"
|
||||
- "rm -rf ${MEDIA_PATH}/${CI_PROJECT_NAME}/AppDir/etc"
|
||||
- "cd ${MEDIA_PATH}/${CI_PROJECT_NAME}/ && tar -czf AppDir.tar.gz AppDir && rm -rf AppDir && cd -"
|
||||
# Filters
|
||||
- "mkdir -p ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/audio"
|
||||
- "mkdir -p ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/video"
|
||||
- "cd libretro-common/audio/dsp_filters && make -j$NUMPROC build=release && make -j$NUMPROC build=release strip && cd -"
|
||||
- "cp -f libretro-common/audio/dsp_filters/*.so ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/audio"
|
||||
- "cp -f libretro-common/audio/dsp_filters/*.dsp ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/audio"
|
||||
- "cd gfx/video_filters && make -j$NUMPROC build=release && make -j$NUMPROC build=release strip && cd -"
|
||||
- "cp -f gfx/video_filters/*.so ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/video"
|
||||
- "cp -f gfx/video_filters/*.filt ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/video"
|
||||
|
||||
.build-retroarch-macos-xcode:
|
||||
# Metal/Universal x86_64 arm64 is default
|
||||
tags:
|
||||
- macosx-packaging
|
||||
stage: build
|
||||
variables:
|
||||
XCARCHIVE_PATH: pkg/apple/build/RetroArchUniversal
|
||||
XCPROJECT_NAME: RetroArch_Metal
|
||||
XCCONFIG: GitLabCI.xcconfig
|
||||
artifacts:
|
||||
paths:
|
||||
- ${XCPROJECT_NAME}.zip
|
||||
- retroarch-repo/
|
||||
expire_in: 10 min
|
||||
dependencies: []
|
||||
script:
|
||||
- xcodebuild -project pkg/apple/${XCPROJECT_NAME}.xcodeproj -config Release -scheme RetroArch -archivePath ${XCARCHIVE_PATH} -xcconfig pkg/apple/${XCCONFIG} archive
|
||||
- pushd ${XCARCHIVE_PATH}.xcarchive/Products/Users/gitlab/Applications/
|
||||
- ditto -c -k --sequesterRsrc --keepParent RetroArch.app RetroArch.zip
|
||||
- popd
|
||||
- mv ${XCARCHIVE_PATH}.xcarchive/Products/Users/gitlab/Applications/RetroArch.zip ${XCPROJECT_NAME}.zip
|
||||
- mkdir .retroarch-repo
|
||||
- "cp -r ./* .retroarch-repo"
|
||||
- "mv .retroarch-repo/ retroarch-repo/"
|
||||
|
||||
# Mac OS Universal, Metal
|
||||
build-retroarch-osx-universal-metal:
|
||||
extends: .build-retroarch-macos-xcode
|
||||
|
||||
build-retroarch-osx-opengl-x64:
|
||||
extends: .build-retroarch-macos-xcode
|
||||
variables:
|
||||
XCARCHIVE_PATH: pkg/apple/build/RetroArchOpenGL
|
||||
XCPROJECT_NAME: RetroArch
|
||||
XCCONFIG: OpenGL_GitLabCI.xcconfig
|
||||
|
||||
build-retroarch-ios-arm64:
|
||||
extends: .build-retroarch-macos-xcode
|
||||
variables:
|
||||
XCPROJECT_NAME: RetroArch_iOS11_Metal
|
||||
XCCONFIG: GitLabCI.xcconfig
|
||||
XCSCHEME: "RetroArch iOS Release"
|
||||
artifacts:
|
||||
paths:
|
||||
- retroarch-repo/
|
||||
expire_in: 10 min
|
||||
script:
|
||||
- xcodebuild -project pkg/apple/${XCPROJECT_NAME}.xcodeproj -config Release -scheme "${XCSCHEME}" -xcconfig pkg/apple/iOS/GitLabCI.xcconfig build
|
||||
- mkdir .retroarch-repo
|
||||
- "cp -r ./* .retroarch-repo"
|
||||
- "mv .retroarch-repo/ retroarch-repo/"
|
||||
|
||||
build-retroarch-ios9:
|
||||
extends: .build-retroarch-macos-xcode
|
||||
variables:
|
||||
XCPROJECT_NAME: RetroArch_iOS9
|
||||
XCCONFIG: GitLabCI.xcconfig
|
||||
XCSCHEME: "RetroArchiOS9"
|
||||
artifacts:
|
||||
paths:
|
||||
- retroarch-repo/
|
||||
expire_in: 10 min
|
||||
script:
|
||||
- xcodebuild -project pkg/apple/${XCPROJECT_NAME}.xcodeproj -config Release -scheme "${XCSCHEME}" -xcconfig pkg/apple/iOS/GitLabCI.xcconfig build
|
||||
- mkdir .retroarch-repo
|
||||
- "cp -r ./* .retroarch-repo"
|
||||
- "mv .retroarch-repo/ retroarch-repo/"
|
||||
|
||||
build-retroarch-tvos-arm64:
|
||||
extends: build-retroarch-ios-arm64
|
||||
variables:
|
||||
XCSCHEME: "RetroArch tvOS Release"
|
||||
|
||||
build-retroarch-dingux-mips32:
|
||||
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-dingux:latest
|
||||
stage: build
|
||||
variables:
|
||||
MEDIA_PATH: .media
|
||||
STRIP_BIN: 1
|
||||
before_script:
|
||||
- export NUMPROC=$(($(nproc)/3))
|
||||
artifacts:
|
||||
paths:
|
||||
- retroarch
|
||||
- retroarch_rg350.opk
|
||||
- ${MEDIA_PATH}
|
||||
expire_in: 10 min
|
||||
dependencies: []
|
||||
script:
|
||||
- "make -j$NUMPROC -f Makefile.rg350"
|
||||
- "mkdir -p ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/audio"
|
||||
- "mkdir -p ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/video"
|
||||
- "cp -f libretro-common/audio/dsp_filters/*.dsp ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/audio"
|
||||
- "cp -f gfx/video_filters/*.filt ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/video"
|
||||
|
||||
build-retroarch-dingux-odbeta-mips32:
|
||||
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-dingux:odbeta
|
||||
stage: build
|
||||
variables:
|
||||
MEDIA_PATH: .media
|
||||
STRIP_BIN: 1
|
||||
before_script:
|
||||
- export NUMPROC=$(($(nproc)/3))
|
||||
artifacts:
|
||||
paths:
|
||||
- retroarch
|
||||
- retroarch_rg350_odbeta.opk
|
||||
- ${MEDIA_PATH}
|
||||
expire_in: 10 min
|
||||
dependencies: []
|
||||
script:
|
||||
- "make -j$NUMPROC -f Makefile.rg350_odbeta"
|
||||
- "mkdir -p ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/audio"
|
||||
- "mkdir -p ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/video"
|
||||
- "cp -f libretro-common/audio/dsp_filters/*.dsp ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/audio"
|
||||
- "cp -f gfx/video_filters/*.filt ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/video"
|
||||
|
||||
build-retroarch-android-normal:
|
||||
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-android:latest
|
||||
stage: build
|
||||
artifacts:
|
||||
paths:
|
||||
- retroarch-precompiled/
|
||||
expire_in: 10 min
|
||||
script:
|
||||
- "cd pkg/android/phoenix && ./gradlew assembleNormalRelease && cd -"
|
||||
- "mkdir .retroarch-precompiled"
|
||||
- "cp -r ./* .retroarch-precompiled/"
|
||||
- "mv .retroarch-precompiled/ retroarch-precompiled/"
|
||||
|
||||
build-retroarch-android-aarch64:
|
||||
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-android:latest
|
||||
stage: build
|
||||
artifacts:
|
||||
paths:
|
||||
- retroarch-precompiled/
|
||||
expire_in: 10 min
|
||||
script:
|
||||
- "cd pkg/android/phoenix && ./gradlew assembleAarch64Release && cd -"
|
||||
- "mkdir .retroarch-precompiled"
|
||||
- "cp -r ./* .retroarch-precompiled/"
|
||||
- "mv .retroarch-precompiled/ retroarch-precompiled/"
|
||||
|
||||
build-retroarch-android-ra32:
|
||||
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-android:latest
|
||||
stage: build
|
||||
artifacts:
|
||||
paths:
|
||||
- retroarch-precompiled/
|
||||
expire_in: 10 min
|
||||
script:
|
||||
- "cd pkg/android/phoenix && ./gradlew assembleRa32Release && cd -"
|
||||
- "mkdir .retroarch-precompiled"
|
||||
- "cp -r ./* .retroarch-precompiled/"
|
||||
- "mv .retroarch-precompiled/ retroarch-precompiled/"
|
||||
|
||||
build-retroarch-android-playstore-normal:
|
||||
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-android:latest
|
||||
stage: build
|
||||
artifacts:
|
||||
paths:
|
||||
- retroarch-precompiled/
|
||||
expire_in: 10 min
|
||||
script:
|
||||
- "cd pkg/android/phoenix && ./gradlew bundlePlayStoreNormalRelease && cd -"
|
||||
- "mkdir .retroarch-precompiled"
|
||||
- "cp -r ./* .retroarch-precompiled/"
|
||||
- "mv .retroarch-precompiled/ retroarch-precompiled/"
|
||||
|
||||
build-retroarch-android-playstore-plus:
|
||||
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-android:latest
|
||||
stage: build
|
||||
artifacts:
|
||||
paths:
|
||||
- retroarch-precompiled/
|
||||
expire_in: 10 min
|
||||
script:
|
||||
- "cd pkg/android/phoenix && ./gradlew bundlePlayStorePlusRelease && cd -"
|
||||
- "mkdir .retroarch-precompiled"
|
||||
- "cp -r ./* .retroarch-precompiled/"
|
||||
- "mv .retroarch-precompiled/ retroarch-precompiled/"
|
||||
|
||||
build-static-retroarch-libnx-aarch64:
|
||||
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-libnx-devkitpro:latest
|
||||
stage: prepare-for-static-cores
|
||||
before_script:
|
||||
- export NUMPROC=$(($(nproc)/3))
|
||||
artifacts:
|
||||
paths:
|
||||
- retroarch-precompiled/
|
||||
expire_in: 10 min
|
||||
dependencies: []
|
||||
needs:
|
||||
# Static dummy builds without a core so its a good check if it properly builds
|
||||
- build-static-retroarch-dummy-libnx-aarch64
|
||||
script:
|
||||
# Allow failure since we don't have a core
|
||||
- "make -f Makefile.libnx -j$NUMPROC ||:"
|
||||
- "mkdir .retroarch-precompiled"
|
||||
- "cp -r ./* .retroarch-precompiled/"
|
||||
- "mv .retroarch-precompiled/ retroarch-precompiled/"
|
||||
|
||||
build-static-retroarch-dummy-libnx-aarch64:
|
||||
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-libnx-devkitpro:latest
|
||||
stage: build
|
||||
variables:
|
||||
MEDIA_PATH: .media
|
||||
before_script:
|
||||
- export NUMPROC=$(($(nproc)/3))
|
||||
artifacts:
|
||||
paths:
|
||||
- retroarch_switch.nro
|
||||
- retroarch_switch.elf
|
||||
- ${MEDIA_PATH}
|
||||
expire_in: 10 min
|
||||
dependencies: []
|
||||
script:
|
||||
- "make -f Makefile.libnx -j$NUMPROC HAVE_STATIC_DUMMY=1"
|
||||
- "mkdir -p ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/video"
|
||||
- "mkdir -p ${MEDIA_PATH}/${CI_PROJECT_NAME}/pkg"
|
||||
- "cp -f gfx/video_filters/*.filt ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/video"
|
||||
- "cp -f pkg/libnx/retroarch.jpg ${MEDIA_PATH}/${CI_PROJECT_NAME}/pkg"
|
||||
|
||||
build-static-retroarch-vita:
|
||||
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-vita:latest
|
||||
stage: prepare-for-static-cores
|
||||
before_script:
|
||||
- export NUMPROC=$(($(nproc)/3))
|
||||
artifacts:
|
||||
paths:
|
||||
- retroarch-precompiled/
|
||||
- retroarch-precompiled-gl/
|
||||
expire_in: 10 min
|
||||
dependencies: []
|
||||
needs:
|
||||
# Dummy build requires no core
|
||||
- build-static-retroarch-dummy-vita
|
||||
script:
|
||||
# Allow failure since we don't have a core
|
||||
- "make -f Makefile.vita -j$NUMPROC ||:"
|
||||
- "mkdir .retroarch-precompiled"
|
||||
- "cp -r ./* .retroarch-precompiled/"
|
||||
- "make -f Makefile.vita clean"
|
||||
- "HAVE_VITAGLES=1 make -f Makefile.vita -j$NUMPROC ||:"
|
||||
- "mkdir .retroarch-precompiled-gl"
|
||||
- "cp -r ./* .retroarch-precompiled-gl/"
|
||||
- "mv .retroarch-precompiled/ retroarch-precompiled/"
|
||||
- "mv .retroarch-precompiled-gl/ retroarch-precompiled-gl/"
|
||||
|
||||
build-static-retroarch-dummy-vita:
|
||||
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-vita:latest
|
||||
stage: build
|
||||
variables:
|
||||
MEDIA_PATH: .media
|
||||
before_script:
|
||||
- export NUMPROC=$(($(nproc)/3))
|
||||
artifacts:
|
||||
paths:
|
||||
- eboot.bin
|
||||
- param.sfo
|
||||
- ${MEDIA_PATH}
|
||||
expire_in: 10 min
|
||||
dependencies: []
|
||||
script:
|
||||
- "make -f Makefile.vita.salamander -j$NUMPROC"
|
||||
- "mkdir -p ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/video"
|
||||
- "mkdir -p ${MEDIA_PATH}/${CI_PROJECT_NAME}/pkg"
|
||||
- "cp -f gfx/video_filters/*.filt ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/video"
|
||||
- "cp -fr pkg/vita/* ${MEDIA_PATH}/${CI_PROJECT_NAME}/pkg"
|
||||
|
||||
build-static-retroarch-ps2:
|
||||
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-ps2:latest
|
||||
stage: prepare-for-static-cores
|
||||
artifacts:
|
||||
paths:
|
||||
- retroarch-precompiled/
|
||||
expire_in: 10 min
|
||||
dependencies: []
|
||||
needs:
|
||||
# Dummy build requires no core
|
||||
- build-static-retroarch-dummy-ps2
|
||||
script:
|
||||
# Allow failure since we don't have a core
|
||||
# PS2 makefile for now doesn't allow -jX so this is why is hardcoded to -j1
|
||||
- "make -f Makefile.ps2 -j1 ||:"
|
||||
- "mkdir .retroarch-precompiled"
|
||||
- "cp -r ./* .retroarch-precompiled/"
|
||||
- "mv .retroarch-precompiled/ retroarch-precompiled/"
|
||||
|
||||
build-static-retroarch-dummy-ps2:
|
||||
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-ps2:latest
|
||||
stage: build
|
||||
before_script:
|
||||
# PS2 doesn't allow to use -jX for now
|
||||
- export NUMPROC=1
|
||||
artifacts:
|
||||
paths:
|
||||
- raboot.elf
|
||||
expire_in: 10 min
|
||||
dependencies: []
|
||||
script:
|
||||
- "make -f Makefile.ps2.salamander -j$NUMPROC release"
|
||||
|
||||
build-static-retroarch-psp:
|
||||
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-psp:latest
|
||||
stage: prepare-for-static-cores
|
||||
before_script:
|
||||
- export NUMPROC=$(($(nproc)/3))
|
||||
artifacts:
|
||||
paths:
|
||||
- retroarch-precompiled/
|
||||
expire_in: 10 min
|
||||
dependencies: []
|
||||
needs:
|
||||
# Dummy build requires no core
|
||||
- build-static-retroarch-dummy-psp
|
||||
script:
|
||||
# We need to boostrap before compile
|
||||
- "(cd bootstrap/psp1/kernel_functions_prx/ && make && cd -)"
|
||||
# Allow failure since we don't have a core
|
||||
- "make -f Makefile.psp1 -j$NUMPROC ||:"
|
||||
- "mkdir .retroarch-precompiled"
|
||||
- "cp -r ./* .retroarch-precompiled/"
|
||||
- "mv .retroarch-precompiled/ retroarch-precompiled/"
|
||||
|
||||
build-static-retroarch-dummy-psp:
|
||||
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-psp:latest
|
||||
stage: build
|
||||
variables:
|
||||
MEDIA_PATH: .media
|
||||
before_script:
|
||||
- export NUMPROC=$(($(nproc)/3))
|
||||
artifacts:
|
||||
paths:
|
||||
- EBOOT.PBP
|
||||
- kernel_functions.prx
|
||||
- ${MEDIA_PATH}
|
||||
expire_in: 10 min
|
||||
dependencies: []
|
||||
script:
|
||||
- "(cd bootstrap/psp1/kernel_functions_prx/ && make && cd -)"
|
||||
- "make -f Makefile.psp1.salamander -j$NUMPROC"
|
||||
- "make -C bootstrap/psp1/kernel_functions_prx/"
|
||||
- "mkdir -p ${MEDIA_PATH}/${CI_PROJECT_NAME}/pkg"
|
||||
- "cp -f pkg/psp1/ICON0.PNG ${MEDIA_PATH}/${CI_PROJECT_NAME}/pkg"
|
||||
- "cp -f pkg/psp1/PIC1.PNG ${MEDIA_PATH}/${CI_PROJECT_NAME}/pkg"
|
||||
|
||||
build-static-retroarch-ctr:
|
||||
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-devkitpro:latest
|
||||
stage: prepare-for-static-cores
|
||||
before_script:
|
||||
- export NUMPROC=$(($(nproc)/3))
|
||||
artifacts:
|
||||
paths:
|
||||
- retroarch-precompiled/
|
||||
expire_in: 10 min
|
||||
dependencies: []
|
||||
needs:
|
||||
# Dummy build requires no core
|
||||
- build-static-retroarch-dummy-ctr
|
||||
script:
|
||||
# Allow failure since we don't have a core
|
||||
- "make -f Makefile.ctr -j$NUMPROC USE_CTRULIB_2=1 ||:"
|
||||
- "mkdir .retroarch-precompiled"
|
||||
- "cp -r ./* .retroarch-precompiled/"
|
||||
- "mv .retroarch-precompiled/ retroarch-precompiled/"
|
||||
|
||||
build-static-retroarch-ctr-legacy:
|
||||
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-devkitpro:ctr-legacy
|
||||
stage: prepare-for-static-cores
|
||||
before_script:
|
||||
- export NUMPROC=$(($(nproc)/3))
|
||||
artifacts:
|
||||
paths:
|
||||
- retroarch-precompiled/
|
||||
expire_in: 10 min
|
||||
dependencies: []
|
||||
script:
|
||||
# Allow failure since we don't have a core
|
||||
- "make -f Makefile.ctr -j$NUMPROC ||:"
|
||||
- "mkdir .retroarch-precompiled"
|
||||
- "cp -r ./* .retroarch-precompiled/"
|
||||
- "mv .retroarch-precompiled/ retroarch-precompiled/"
|
||||
|
||||
build-static-retroarch-dummy-ctr:
|
||||
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-devkitpro:latest
|
||||
stage: build
|
||||
variables:
|
||||
MEDIA_PATH: .media
|
||||
before_script:
|
||||
- export NUMPROC=$(($(nproc)/3))
|
||||
artifacts:
|
||||
paths:
|
||||
- retroarch_3ds.cia
|
||||
- RetroArch.3dsx
|
||||
- RetroArch.smdh
|
||||
- ${MEDIA_PATH}
|
||||
expire_in: 10 min
|
||||
dependencies: []
|
||||
script:
|
||||
- "make -f Makefile.ctr.salamander -j$NUMPROC USE_CTRULIB_2=1"
|
||||
- "mv -f retroarch_3ds_salamander.cia retroarch_3ds.cia"
|
||||
- "mv -f retroarch_3ds_salamander.3dsx RetroArch.3dsx"
|
||||
- "mv -f retroarch_3ds_salamander.smdh RetroArch.smdh"
|
||||
- "mkdir -p ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/audio"
|
||||
- "mkdir -p ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/video"
|
||||
- "cp -f libretro-common/audio/dsp_filters/*.dsp ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/audio"
|
||||
- "cp -f gfx/video_filters/*.filt ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/video"
|
||||
|
||||
build-static-retroarch-wiiu:
|
||||
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-wiiu:latest
|
||||
stage: prepare-for-static-cores
|
||||
before_script:
|
||||
- export NUMPROC=$(($(nproc)/3))
|
||||
artifacts:
|
||||
paths:
|
||||
- retroarch-precompiled/
|
||||
expire_in: 10 min
|
||||
dependencies: []
|
||||
needs:
|
||||
# Dummy build requires no core
|
||||
- build-static-retroarch-dummy-wiiu
|
||||
script:
|
||||
# Allow failure since we don't have a core
|
||||
- "make -f Makefile.wiiu -j$NUMPROC ||:"
|
||||
- "mkdir .retroarch-precompiled"
|
||||
- "cp -r ./* .retroarch-precompiled/"
|
||||
- "mv .retroarch-precompiled/ retroarch-precompiled/"
|
||||
|
||||
build-static-retroarch-dummy-wiiu:
|
||||
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-devkitpro:latest
|
||||
stage: build
|
||||
variables:
|
||||
MEDIA_PATH: .media
|
||||
before_script:
|
||||
- export NUMPROC=$(($(nproc)/3))
|
||||
artifacts:
|
||||
paths:
|
||||
- retroarch.rpx
|
||||
- ${MEDIA_PATH}
|
||||
expire_in: 10 min
|
||||
dependencies: []
|
||||
script:
|
||||
- "make -f Makefile.wiiu -j$NUMPROC SALAMANDER_BUILD=1"
|
||||
- "mv -f retroarch_wiiu_salamander.rpx retroarch.rpx"
|
||||
- "mkdir -p ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/video"
|
||||
- "mkdir -p ${MEDIA_PATH}/${CI_PROJECT_NAME}/pkg"
|
||||
- "cp -f gfx/video_filters/*.filt ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/video"
|
||||
- "cp -f pkg/wiiu/icon.png ${MEDIA_PATH}/${CI_PROJECT_NAME}/pkg"
|
||||
- "cp -f pkg/wiiu/meta.xml ${MEDIA_PATH}/${CI_PROJECT_NAME}/pkg"
|
||||
|
||||
build-static-retroarch-wii:
|
||||
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-devkitpro:latest
|
||||
stage: prepare-for-static-cores
|
||||
before_script:
|
||||
- export NUMPROC=$(($(nproc)/3))
|
||||
artifacts:
|
||||
paths:
|
||||
- retroarch-precompiled/
|
||||
expire_in: 10 min
|
||||
dependencies: []
|
||||
needs:
|
||||
# Dummy build requires no core
|
||||
- build-static-retroarch-dummy-wii
|
||||
script:
|
||||
# Allow failure since we don't have a core
|
||||
- "make -f Makefile.wii -j$NUMPROC EXTERNAL_LIBOGC=1 GX_PTHREAD_LEGACY=0 ||:"
|
||||
- "mkdir .retroarch-precompiled"
|
||||
- "cp -r ./* .retroarch-precompiled/"
|
||||
- "mv .retroarch-precompiled/ retroarch-precompiled/"
|
||||
|
||||
build-static-retroarch-dummy-wii:
|
||||
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-devkitpro:latest
|
||||
stage: build
|
||||
variables:
|
||||
MEDIA_PATH: .media
|
||||
before_script:
|
||||
- export NUMPROC=$(($(nproc)/3))
|
||||
artifacts:
|
||||
paths:
|
||||
- boot.dol
|
||||
- ${MEDIA_PATH}
|
||||
expire_in: 10 min
|
||||
dependencies: []
|
||||
script:
|
||||
- "make -f Makefile.wii.salamander -j$NUMPROC EXTERNAL_LIBOGC=1 GX_PTHREAD_LEGACY=0"
|
||||
- "mv -f retroarch-salamander_wii.dol boot.dol"
|
||||
- "mkdir -p ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/audio"
|
||||
- "mkdir -p ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/video"
|
||||
- "mkdir -p ${MEDIA_PATH}/${CI_PROJECT_NAME}/pkg"
|
||||
- "cp -f libretro-common/audio/dsp_filters/*.dsp ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/audio"
|
||||
- "cp -f gfx/video_filters/*.filt ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/video"
|
||||
- "cp -f pkg/wii/icon.png ${MEDIA_PATH}/${CI_PROJECT_NAME}/pkg"
|
||||
- "cp -f pkg/wii/meta.xml ${MEDIA_PATH}/${CI_PROJECT_NAME}/pkg"
|
||||
|
||||
build-static-retroarch-ngc:
|
||||
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-devkitpro:latest
|
||||
stage: prepare-for-static-cores
|
||||
before_script:
|
||||
- export NUMPROC=$(($(nproc)/3))
|
||||
artifacts:
|
||||
paths:
|
||||
- retroarch-precompiled/
|
||||
expire_in: 10 min
|
||||
dependencies: []
|
||||
needs:
|
||||
# Dummy build requires no core
|
||||
- build-static-retroarch-dummy-ngc
|
||||
script:
|
||||
# Allow failure since we don't have a core
|
||||
- "make -f Makefile.ngc -j$NUMPROC EXTERNAL_LIBOGC=1 GX_PTHREAD_LEGACY=0 ||:"
|
||||
- "mkdir .retroarch-precompiled"
|
||||
- "cp -r ./* .retroarch-precompiled/"
|
||||
- "mv .retroarch-precompiled/ retroarch-precompiled/"
|
||||
|
||||
build-static-retroarch-dummy-ngc:
|
||||
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-devkitpro:latest
|
||||
stage: build
|
||||
variables:
|
||||
MEDIA_PATH: .media
|
||||
before_script:
|
||||
- export NUMPROC=$(($(nproc)/3))
|
||||
artifacts:
|
||||
paths:
|
||||
- ${MEDIA_PATH}
|
||||
expire_in: 10 min
|
||||
dependencies: []
|
||||
script:
|
||||
- "mkdir -p ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/audio"
|
||||
- "mkdir -p ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/video"
|
||||
- "cp -f libretro-common/audio/dsp_filters/*.dsp ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/audio"
|
||||
- "cp -f gfx/video_filters/*.filt ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/video"
|
||||
|
||||
build-static-retroarch-emscripten:
|
||||
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-emscripten:latest
|
||||
stage: prepare-for-static-cores
|
||||
before_script:
|
||||
- export NUMPROC=$(($(nproc)/3))
|
||||
artifacts:
|
||||
paths:
|
||||
- retroarch-precompiled/
|
||||
expire_in: 10 min
|
||||
dependencies: []
|
||||
needs:
|
||||
# Dummy build requires no core
|
||||
- build-static-retroarch-dummy-emscripten
|
||||
script:
|
||||
# Allow failure since we don't have a core
|
||||
- "emmake make -f Makefile.emscripten -j$NUMPROC ||:"
|
||||
- "mkdir .retroarch-precompiled"
|
||||
- "cp -r ./* .retroarch-precompiled/"
|
||||
- "mv .retroarch-precompiled/ retroarch-precompiled/"
|
||||
|
||||
build-static-retroarch-dummy-emscripten:
|
||||
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-amd64-ubuntu:latest
|
||||
stage: build
|
||||
variables:
|
||||
MEDIA_PATH: .media
|
||||
before_script:
|
||||
- export NUMPROC=$(($(nproc)/3))
|
||||
artifacts:
|
||||
paths:
|
||||
- ${MEDIA_PATH}
|
||||
expire_in: 10 min
|
||||
dependencies: []
|
||||
script:
|
||||
- "mkdir -p ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/audio"
|
||||
- "mkdir -p ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/video"
|
||||
- "mkdir -p ${MEDIA_PATH}/${CI_PROJECT_NAME}/pkg/media"
|
||||
- "cp -f libretro-common/audio/dsp_filters/*.dsp ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/audio"
|
||||
- "cp -f gfx/video_filters/*.filt ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/video"
|
||||
- "cp -rf pkg/emscripten/libretro ${MEDIA_PATH}/${CI_PROJECT_NAME}/pkg"
|
||||
- "cp -f media/canvas.png ${MEDIA_PATH}/${CI_PROJECT_NAME}/pkg/media"
|
||||
- "cp -f media/icon_dark.ico ${MEDIA_PATH}/${CI_PROJECT_NAME}/pkg/media"
|
||||
- "cp -f media/icon_light.ico ${MEDIA_PATH}/${CI_PROJECT_NAME}/pkg/media"
|
||||
- "cp -f media/invader_dark.png ${MEDIA_PATH}/${CI_PROJECT_NAME}/pkg/media"
|
||||
- "cp -f media/invader_light.png ${MEDIA_PATH}/${CI_PROJECT_NAME}/pkg/media"
|
||||
- "cp -f media/libretro-logo.png ${MEDIA_PATH}/${CI_PROJECT_NAME}/pkg/media"
|
||||
- "cp -f media/retroarch-16x16.ico ${MEDIA_PATH}/${CI_PROJECT_NAME}/pkg/media"
|
||||
- "cp -f media/retroarch-16x16.png ${MEDIA_PATH}/${CI_PROJECT_NAME}/pkg/media"
|
||||
- "cp -f media/retroarch-96x96.png ${MEDIA_PATH}/${CI_PROJECT_NAME}/pkg/media"
|
||||
- "cp -f media/retroarch.ico ${MEDIA_PATH}/${CI_PROJECT_NAME}/pkg/media"
|
||||
|
||||
trigger_static-cores:
|
||||
stage: trigger-static-cores
|
||||
needs:
|
||||
- build-static-retroarch-libnx-aarch64
|
||||
- build-static-retroarch-vita
|
||||
- build-static-retroarch-ps2
|
||||
- build-static-retroarch-psp
|
||||
- build-static-retroarch-ctr
|
||||
- build-static-retroarch-ctr-legacy
|
||||
- build-static-retroarch-wiiu
|
||||
- build-static-retroarch-wii
|
||||
- build-static-retroarch-ngc
|
||||
- build-static-retroarch-emscripten
|
||||
dependencies: []
|
||||
script:
|
||||
# Dummy for now
|
||||
- /bin/true
|
||||
- ./configure
|
||||
- make -j2
|
||||
+25
-14
@@ -40,16 +40,12 @@ matrix:
|
||||
env: CXX_BUILD=1 CC=gcc-8 CXX=g++-8
|
||||
- compiler: gcc
|
||||
env: DISABLE_MENU=1 CC=gcc-8 CXX=g++-8
|
||||
- compiler: gcc
|
||||
env: DISABLE_NETWORKING=1 CC=gcc-8 CXX=g++-8
|
||||
- compiler: gcc
|
||||
env: DISABLE_OVERLAY=1 CC=gcc-8 CXX=g++-8
|
||||
- compiler: gcc
|
||||
env: DISABLE_CDROM=1 CC=gcc-8 CXX=g++-8
|
||||
- compiler: gcc
|
||||
env: DISABLE_VIDEO_LAYOUT=1 CC=gcc-8 CXX=g++-8
|
||||
- compiler: gcc
|
||||
env: DISABLE_THREADS=1 CC=gcc-8 CXX=g++-8
|
||||
- compiler: gcc
|
||||
env: DISABLE_AUDIOMIXER=1 CC=gcc-8 CXX=g++-8
|
||||
- compiler: gcc
|
||||
@@ -70,14 +66,37 @@ matrix:
|
||||
script:
|
||||
- ./configure --enable-opengl --disable-metal
|
||||
- make
|
||||
- os: osx
|
||||
osx_image: xcode8
|
||||
script:
|
||||
- xcodebuild -target RetroArch -configuration Release -project pkg/apple/RetroArch.xcodeproj
|
||||
- os: osx
|
||||
osx_image: xcode11.2
|
||||
script:
|
||||
- brew update-reset
|
||||
- brew install --force-bottle qt5
|
||||
- security create-keychain -p travis build.keychain
|
||||
- security default-keychain -s build.keychain
|
||||
- security unlock-keychain -p travis build.keychain
|
||||
- echo $OSX_CERT | base64 --decode > dev.p12
|
||||
- security import dev.p12 -k build.keychain -P $OSX_CERT_PASS -T /usr/bin/codesign
|
||||
- rm dev.p12
|
||||
- security set-key-partition-list -S "apple-tool:,apple:,codesign:" -s -k travis build.keychain
|
||||
- xcodebuild -target RetroArchQt -configuration Release -project pkg/apple/RetroArch_Metal.xcodeproj
|
||||
deploy:
|
||||
skip_cleanup: true
|
||||
provider: script
|
||||
script: bash travis_metal_deploy.sh
|
||||
on:
|
||||
branch: master
|
||||
- language: android
|
||||
# Android builds are only supported on Trusty
|
||||
dist: trusty
|
||||
android:
|
||||
components:
|
||||
- tools
|
||||
- build-tools-29.0.3
|
||||
- android-29
|
||||
- build-tools-28.0.3
|
||||
- android-28
|
||||
install:
|
||||
- echo y | sdkmanager "ndk-bundle"
|
||||
before_script:
|
||||
@@ -117,10 +136,6 @@ before_script:
|
||||
if [ -n "$DISABLE_OVERLAY" ]; then
|
||||
ARGS="$ARGS --disable-overlay"
|
||||
fi
|
||||
- |
|
||||
if [ -n "$DISABLE_NETWORKING" ]; then
|
||||
ARGS="$ARGS --disable-networking"
|
||||
fi
|
||||
- |
|
||||
if [ -n "$DISABLE_CDROM" ]; then
|
||||
ARGS="$ARGS --disable-cdrom"
|
||||
@@ -129,10 +144,6 @@ before_script:
|
||||
if [ -n "$DISABLE_VIDEO_LAYOUT" ]; then
|
||||
ARGS="$ARGS --disable-video_layout"
|
||||
fi
|
||||
- |
|
||||
if [ -n "$DISABLE_THREADS" ]; then
|
||||
ARGS="$ARGS --disable-threads --disable-glslang"
|
||||
fi
|
||||
- |
|
||||
if [ -n "$DISABLE_AUDIOMIXER" ]; then
|
||||
ARGS="$ARGS --disable-audiomixer"
|
||||
|
||||
Vendored
+3
-2
@@ -1,15 +1,15 @@
|
||||
{
|
||||
"terminal.integrated.shell.windows": "C:\\msys64\\usr\\bin\\bash.exe",
|
||||
"terminal.integrated.shell.windows": "C:\\msys64\\usr\\bin\\bash.exe",
|
||||
"terminal.integrated.env.windows": {
|
||||
"PATH": "/mingw64/lib/ccache/bin:/mingw64/lib/ccache/bin:/mingw64/lib/ccache/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:$PATH",
|
||||
"MSYSTEM": "MINGW64",
|
||||
},
|
||||
"terminal.integrated.cursorBlinking": true,
|
||||
|
||||
"editor.tabSize": 3,
|
||||
"editor.detectIndentation": false,
|
||||
"editor.renderWhitespace": "all",
|
||||
"editor.insertSpaces": true,
|
||||
"editor.formatOnSave": false,
|
||||
"files.associations": {
|
||||
"frontend_driver.h": "c",
|
||||
"*.in": "c",
|
||||
@@ -63,6 +63,7 @@
|
||||
"xtree": "c",
|
||||
"xutility": "c",
|
||||
"menu_input_dialog.h": "c",
|
||||
"menu_filebrowser.h": "c",
|
||||
"ozone_sidebar.h": "c",
|
||||
"menu_thumbnail_path.h": "c",
|
||||
"badges.h": "c"
|
||||
|
||||
@@ -93,6 +93,7 @@ ekipan
|
||||
Emmanuel Martin (daliaetnano)
|
||||
endrift
|
||||
erbridge
|
||||
esoptron
|
||||
Ethan Lee (flibitijibibo)
|
||||
Exvat
|
||||
Ezio-PS
|
||||
@@ -213,7 +214,6 @@ Nathan S. (natinusala)
|
||||
NathanStrong-Tripwire
|
||||
nattycleopatra
|
||||
nayslayer
|
||||
Nephilim
|
||||
netux79
|
||||
nfnty
|
||||
nia (ensra)
|
||||
|
||||
+1
-495
@@ -1,512 +1,18 @@
|
||||
# Future
|
||||
|
||||
# 1.9.2
|
||||
- 3DS: Enable graphics widgets / overlays
|
||||
- 3DS: Load texture images as BGR colors
|
||||
- 3DS: Change default asset directory
|
||||
- CHEEVOS: Allow rcheevos_patch_address to be called on game without achievements
|
||||
- CHEEVOS: Update achievement memory maps (add Supervision)
|
||||
- CONFIG/FILE: Use hash map to optimise key/value lookups
|
||||
- CORE INFO: Performance optimisations + code clean-ups/refactors
|
||||
- CRT/SWITCHRES: Fixed CRTSwitchRes framebuffer bug
|
||||
- DISCORD/RP: Fix regression
|
||||
- DRM: set the correct video mode
|
||||
- FASTFORWARD: Enforce minimum fastforward_ratio of 1.0
|
||||
- FONTS/FREETYPE/STB_UNICODE/BITMAPFONT: Prevent texture bleed when rendering text at non-integer scales
|
||||
- INPUT: Ensure that 'retro_set_controller_port_device' is called when updating 'Max Users'
|
||||
- INPUT/XEGL/MOUSE: Fix xegl_ctx.c mouse activation
|
||||
- INPUT/SDL: Fix crash in SDL input driver when analogs are bound.
|
||||
- INPUT/POINTER: Add scaling to pointer input.
|
||||
- INPUT REMAPPING: Fix regression on loading file
|
||||
- INPUT REMAPPING: Fix regression where disabling input remapping would disable input
|
||||
- IOS: Disable system button gestures on iOS 14
|
||||
- IOS: Prevent potential crash on controller connect - randomly would get a crash when connecting a game controller while RA was running
|
||||
- LAKKA: Add menu for time zone setting
|
||||
- LOGGING: RARCH_LOG_V checking for verbosity level is not necessary and can cause issues; removed said check.
|
||||
- LOGGING: Silence inappropriate cheatfile logging
|
||||
- IOS/MAC: Add CPU VFP unit detection for Darwin
|
||||
- MAC: Swallow 'escape' key being pressed - would previously make the game toggle between fullscreen and windowed
|
||||
- MAC: Intel and ARM64 timer change proposal.
|
||||
- MAC/ARM64: run_fast_mode disabled for 64 bits invalid instructions.
|
||||
- MAC/OPENGL: Fix codesigning issue
|
||||
- MAC/UNIVERSAL: Add TTS translation service support.
|
||||
- MENU: Add optional menu screensaver
|
||||
- MENU: Add search filter support to cheats and overlays file browser menus
|
||||
- MENU/FILEBROWSER: Enhanced 'Load Content' file browser search functionality
|
||||
- MENU/INPUT: Block accidental diagonals in menu navigation
|
||||
- MENU/RGUI: Add option to disable menu transparency
|
||||
- MENU/RGUI: Fix display of 'Video > Scaling' menu when 'Lock Menu Aspect Ratio' is enabled
|
||||
- MENU/MATERIALUI: Add icon to 'Turbo Fire' menu entry
|
||||
- MENU/OZONE: Ozone Dracula theme
|
||||
- OPENDINGUX/BETA: Fix IPU scaling when running GBA-resolution content
|
||||
- OPENDINGUX/BETA: Add 50Hz support
|
||||
- OPENDINGUX: Enable 'SaveRAM Autosave Interval' by default
|
||||
- PATCHES: Added multi-softpatching support + OSD messages for patches
|
||||
- RHMAP: Track the complete string in rhmap
|
||||
- VITA: Align VM block size to 1MB - should fix one of the issues with gpSP
|
||||
- WINDOWS/GDI: Fix non-ASCII text rendering
|
||||
- XEGL: Fix mouse not working when using OpenGLES with X11
|
||||
|
||||
# 1.9.1
|
||||
- 3DS: Graphics widgets support
|
||||
- 3DS: On error, only init gfx on salamander build. This prevents graphical issues if the gfx is already initialized.
|
||||
Which should always be the case if called from a running core
|
||||
- 3DS: Update error applet
|
||||
- 3DS: Enable online Core Updater
|
||||
- 3DS: Guard threading
|
||||
- 3DS: Allow sideways screen rotation
|
||||
- 3DS: Enable threading and add a threaded audio driver
|
||||
- ANDROID: Implementation of fullscreen over notch function (for Android 9.0 and up)
|
||||
- ANDROID: Add Play Store module support.
|
||||
- ANDROID: Add option to switch all installed cores to Play Store versions
|
||||
- AUDIO: Memalign audio buffers to 64 bytes. This is the most common cache line size, helps with performance. Also fixes issues with platforms like PSP that wrongly assume that malloc returns aligned buffers (to 16bytes). This recently broke the PSP builds
|
||||
- AUDIO/ALSA: Fix float format detection
|
||||
- AUDIO/JACK: Deinterleave in the process callback. This allows us to avoid the extra copy to the deinterleave buffer and lets us use only a single jack ringbuffer.
|
||||
- AUDIO/JACK: (Audio/JACK) Fix non-blocking write. Previously we would wait on the condition variable even in the non-blocking case. This improves fast-forward performance massively and brings JACK in line with other backends in that regard.
|
||||
- AUDIO/XAUDIO2: Fix threaded audio bugs with cores like Dinothawr
|
||||
- CONFIG: Add support for saving per-directory core options and deleting core option overrides
|
||||
- CONFIG: Enable saving of changed parameters when '#include' directives are used
|
||||
- CONFIG/DIRS: Enable configuration of the directories used for Favorites, History, Images, Music and Video playlists
|
||||
- CONFIG/REMAPS: Allow loading core remaps without content
|
||||
- CONFIG/OVERRIDES: Fix empty override paths when launching without content
|
||||
- CHEATS: Maximum search value corrections
|
||||
- CHEEVOS: Generic memory mapping using rcheevos
|
||||
- CHEEVOS: Ensure badge textures are released before video driver is deinitialized. Should fix crashes with slang shaders.
|
||||
- CHEEVOS: Include achievement runtime state in save states
|
||||
- CHEEVOS: Prevent hardcore toggle when emu-handled cheats are active
|
||||
- CHEEVOS: Add confirmation submenu to achievements hardcore toggle
|
||||
- CHEEVOS: Calculate leaderboard widget spacing based on video resolution
|
||||
- CHEEVOS: Show unsupported core message when viewing achievement list for unsupported core
|
||||
- CHEEVOS: Allow disabling leaderboard notifications and trackers separately
|
||||
- CHEEVOS: Add display widget for active leaderboards
|
||||
- CHEEVOS/CORE OPTIONS: Core options blacklist. Disables hardcore mode when certain core options are set.
|
||||
- CLI: Add option for quitting on close content
|
||||
- CONTEXT/DRIVER SWITCHING: Allow context switching from gl to glcore
|
||||
- CORE OPTIONS: Add option to reset all core options for current core/content
|
||||
- CORE OPTIONS: Add per-folder core options
|
||||
- CRT/SWITCHRES: Improvements
|
||||
- CRT/SWITCHRES: Low resolution switch bug fix - This allows resolutions lower that 32x224 like 256x224 to work
|
||||
- CORE DOWNLOADER: Enhanced core downloader search functionality
|
||||
- D3D10: Should now be able to use shaders with hardware-accelerated libretro cores
|
||||
- D3D11: Should now be able to use shaders with hardware-accelerated libretro cores
|
||||
- D3D11: Skip shader/stock blend when we don't have a texture. This happens if the core calls video_cb with the frame set to null on
|
||||
the first frame, and was causing black screens/driver resets. The ffmpeg core seems to do this.
|
||||
- D3D11: Fix shaders with scaled framebuffers
|
||||
- D3D11: Add flip model support - fallback to blit model for OSes where flip model is not supported (windows 7 and earlier). Will add a menu option later allowing the user to switch inbetween the two
|
||||
- D3D12: Should now be able to use shaders with hardware-accelerated libretro cores
|
||||
- D3D10/11/12: Increase sprite capacity, we need this so that the hardware rendered menu drivers doesn't glitch out
|
||||
- DRM: Fix race condition in drm_surface_set_aspect
|
||||
- DRM/KMS: add support for custom hdmi_timings / modes
|
||||
- DATABASE: Fix crash that could happen when selecting cursor
|
||||
- DATABASE/EXPLORE: Fix - Prevent segfault when accessing 'Explore' menu
|
||||
- EMSCRIPTEN: Only report back one screen pointer for rwebinput, fixes lockup when clicking on an overlay
|
||||
- FILEIO/PERFORMANCE: Only attempt to call dir_check_defaults once per runtime session
|
||||
- FILEIO/PERFORMANCE/3DS: Increase file buffer size and savestate chunk size. This seems to help with saving large savestates.
|
||||
- FONTS: Improve handling of Arabic and Persian text
|
||||
- FONTS/FREETYPE: Use fontconfig to select fonts if available
|
||||
- INPUT: Add hold mode for turbo fire 'Single Button'
|
||||
- INPUT MAPPING: Refresh bind list on device type change
|
||||
- INPUT MAPPING/REMAPPING: Minor bugfix - Remap file browsing starts navigation at input_remapping_directory even if the core-subdir (where saved files go) exists
|
||||
Having remaps for many different cores makes finding the active core files cumbersome, especially because remaps are not compatible between different cores (but maybe for cores emulating the same hardware)
|
||||
- IOS: Take out 'Core Downloader' from iOS 9/iOS 11 builds
|
||||
- IOS: IOSApp doesn't crash anymore when a file is shared to it
|
||||
- INPUT: Keyboard device mapper rework
|
||||
- INPUT: New input bind order scan/clear fix
|
||||
- INPUT: Duplicate key event blocking additions
|
||||
- INPUT: Prevent duplicate key events with hotkeys + keyboard device type
|
||||
- INPUT: Keyboard LED driver
|
||||
- INPUT/AUTOCONFIG: Allow controllers with no/empty names to work.
|
||||
- INPUT/GAME FOCUS: Add option to automatically enable 'game focus' mode when running/resuming content
|
||||
- INPUT/HOTKEYS: Hotkey for Close Content / Unload Core
|
||||
- INPUT/LIBCEC: Map libcec-daemon keys to RETROK
|
||||
- INPUT/X11: Enable keyboard input when mouse cursor is not inside the RetroArch window but window still has focus
|
||||
- INPUT/X11: Fix mouse input when mouse is grabbed
|
||||
- INPUT/UDEV/RUMBLE: Fix rumble.
|
||||
- INPUT/WINDOWS/DINPUT: Simultaneous shift sticky fix
|
||||
- INPUT/WINDOWS/DINPUT: Prevent Win-key from opening Start Menu
|
||||
- INPUT/WINDOWS/DINPUT: Option for disabling Windows hotkeys
|
||||
- INPUT/WINDOWS/DINPUT: Mouse grabbing/clipping with Alt-Tab
|
||||
- INPUT/WINDOWS/DINPUT: Mouse grab fixes
|
||||
- INPUT/WINDOWS/RAWINPUT: Key position fixes
|
||||
- INPUT/WINDOWS/RAWINPUT: Mouse grab fixes
|
||||
- INPUT/WINDOWS/RAWINPUT: Prevent outside window mouse clicks when grabbed
|
||||
- INPUT/WINDOWS/RAWINPUT: Option for disabling Windows hotkeys
|
||||
- INPUT MAPPING/REMAPPING: Major bugfix - Remap file having a different device type requires manual intervention after loading for the core to register the type properly
|
||||
- JSON: New faster json parser/writer library rjson
|
||||
- JSON/RJSON: Replace rapidjson parser/writer in discord-rpc with rjson
|
||||
- LIBRETRO: Add API extension for cores to query the number of active inputs provided by the frontend
|
||||
- LIBRETRO: Ensure RARCH_CTL_CORE_OPTIONS_LIST_GET returns false if no core options are available
|
||||
- LIBRETRO: Add API extension for overriding frontend audio latency
|
||||
- LIBRETRO: Add API extension for cores to monitor frontend audio buffer occupancy
|
||||
- LINUX: Also show /run/media or /run/media/$USER in drives list
|
||||
- LINUX: Adjust brightness according to the limit. Seems like some platforms feature non-standard maximums, but the variable is correclty exported for us to use
|
||||
- LOCALIZATION: Add Finnish language
|
||||
- LOGS/SHADER: Shader log spam reduction
|
||||
- LOGS/CONFIG: Config logging cleanup
|
||||
- LOGS/SAVESTATE: Config logging cleanup
|
||||
- MAC: Apple Silicon/Mac M1 support
|
||||
- MAC: Code signing/notarization
|
||||
- MAC: Fix a leak with NSTemporaryDirectory() on ARC (Automatic Reference Counting) code
|
||||
- MAC: Support bundle assets extraction on macOS
|
||||
- MAC: Universal Metal build for both ARM and Intel Macs
|
||||
- MAC/UNIVERSAL: Add CoreAudio3 audio driver for Metal Universal build
|
||||
- MAC/IOS: Only extract assets once on first install
|
||||
- MENU: Add 'L2 + R2' menu toggle gamepad combo
|
||||
- MENU: Menu text improvements; clarifications, consistency, text mistakes,
|
||||
- MENU: Tweak menu scroll initial hold delays
|
||||
- MENU: Restrict menu acceleration to navigation buttons
|
||||
- MENU: Add 'Menu Driver' setting to 'User Interface'
|
||||
- MENU: Relocate 'Menu Scroll' settings.
|
||||
- MENU: Separate 'Turbo Fire' menu.
|
||||
- MENU: Dropdown menu for 'Custom Aspect Ratio' setting.
|
||||
- MENU: Reorder Mouse Index next to Device Index
|
||||
- MENU: Submenu for Device Index/Mouse Index
|
||||
- MENU: Reorganize User Interface menu
|
||||
- MENU: Add 'Remove DSP Plugin' menu entry
|
||||
- MENU: Hide 'Auto-Shader Delay' menu setting when shaders are unavailable
|
||||
- MENU/ANIMATIONS: Fix non-smooth text ticker + reduce line ticker code duplication
|
||||
- MENU/ANIMATIONS/OZONE: Add cursor wiggle animation
|
||||
- MENU/ANIMATIONS/OZONE: Implement wiggling for main menu when wrap-around is disabled
|
||||
- MENU/NOTIFICATIONS: On-Screen Notifications' menu clean-ups
|
||||
- MENU/NOTIFICATIONS: Add option to show/hide Refresh Rate notification
|
||||
- MENU/FILEBROWSER: Start auto-selecting last used path for more file browser menu entries
|
||||
- MENU/INPUT: Input port label adjustments
|
||||
- MENU/INPUT/XMB: Proper control port icons
|
||||
- MENU/INPUT/OZONE: Proper control port icons
|
||||
- MENU/QUICK MENU: Add remap clearing ability under Quick Menu controls
|
||||
- MENU/QUICK MENU: Cap 'State Slot' drop-down list to a maximum of 1000 (+Auto) entries
|
||||
- MENU: Customizable menu scroll hold delay.
|
||||
- MENU/DESKTOP: Fix mouse cursor limited by window range on F5 press
|
||||
- MENU/DESKTOP: Add simple shader option
|
||||
- MENU/DESKTOP/WINDOWS: Remove broken 'Update RetroArch' functionality for Windows. We want this to not only be system agnostic if we bring it back, but also work outside of the Qt desktop interface
|
||||
- MENU/OZONE: New Theme - Twilight Zone
|
||||
- MENU/RGUI: Add 3:2, 5:3 and 3:2/5:3 (centered) aspects
|
||||
- MENU/RGUI/TEXT RENDERING: Add Russian language text support
|
||||
- MENU/RGUI/TEXT RENDERING: Add support for CJK punctuation glyphs
|
||||
- MIDI/WINMM: Recover from MIDI messages not handled by the device
|
||||
- MIDI/WINMM: Fix winmm midi driver hanging on content closing
|
||||
- NETWORK: Add READ/WRITE_CORE_MEMORY network commands
|
||||
- NETWORK: Fix backwards condition in socket blocking behavior
|
||||
- NETWORK/NETPLAY: Attempt IPv4 when IPv6 fails
|
||||
- OGA/VIDEO: support for OGS
|
||||
- OGA: This keeps the tradition DRM driver along with the OGA one. The probe
|
||||
function skips the driver if the screen is non rotated to fall back to
|
||||
the regular DRM driver.
|
||||
- OGA: Fix messages from not disappearing
|
||||
- OGA: Implement RETRO_ENVIRONMENT_GET_CURRENT_SOFTWARE_FRAMEBUFFER. This is a faster rendering codepath for software rendered libretro cores that some libretro cores use right now. Video drivers in RetroArch have to explicitly implement this for this codepath to work at runtime.
|
||||
- OPENDINGUX: Add/Optimise rumble interface
|
||||
- OPENDINGUX: Fix frozen video when enabling fast forward
|
||||
- OPENDINGUX/SDL: OSD font clean-up
|
||||
- OPENDINGUX/SDL: Enable selection of image interpolation method when using 'sdl_dingux' gfx driver
|
||||
- OPENDINGUX/SDL: Enable integer scaling when using the 'sdl_dingux' gfx driver
|
||||
- OVERLAYS: Add option to scale overlays automatically (with aspect ratio correction)
|
||||
- OVERLAYS: Hide Overlay When Gamepad is Connected. Overlays will be hidden automatically when a gamepad is connected in port 1, and shown again when the gamepad is disconnected.
|
||||
- OVERLAYS: New default overlays for mobile (neo-retropad)
|
||||
- OVERLAYS: In addition to overlay scale, the user can now set an Overlay Aspect Adjustment factor. Most overlays are designed for 16:9 displays, which means they become stretched/ugly on modern wide aspect phones and suchlike. By changing the Overlay Aspect Adjustment factor, a user can scale the overlay width/height to achieve a uniform appearance regardless of display resolution.
|
||||
- OVERLAYS: Since scaling a gamepad overlay can result in buttons being squished too close together (or being pulled too far apart), the user can now adjust the effective spacing of the different 'halves' of an overlay via Overlay Horizontal Separation and Overlay Vertical Separation factors. Overlay Horizontal Separation divides the overlay in two vertically (left/right, at the centre point), and applies a spacing offset (positive or negative) between the UI elements on each side; Overlay Vertical Separation does the same, but the split is horizontal (top/bottom)
|
||||
- OVERLAYS/FIX: The Overlay X Offset and Overlay Y Offset options have been fixed, and now work correctly
|
||||
- OVERLAYS/FIX: All of the above options (and Overlay Scale) are configured and saved independently for landscape and portrait display orientations - so adjusting everything for a nice landscape layout won't break the portrait display
|
||||
- OVERLAYS/FIX: When using the Vulkan gfx driver, memory is leaked every time an overlay is freed
|
||||
- OVERLAYS/FIX: When threaded video is enabled, loading overlays with no images (i.e. utility-type overlays, where everything is hidden until the screen is touched) can generate segfaults due to improper usage of realloc()
|
||||
- OVERLAYS/FIX: When Show Inputs on Overlay is enabled, ASAN reports bit shift errors due to an incorrect range check when handling turbo inputs - essentially, there is no upper limit to the considered input id range, which means overlay hotkeys (menu toggle, etc.) are incorrectly treated as having turbo support, causing bit shifts using wildly inappropriate id indices
|
||||
- PLAYLISTS/PORTABLE: Fixed first load initialization
|
||||
- PS2: Added Multitap support (up to 8 players)
|
||||
- PS2: Fix for not recognized digital and other non-standard controllers
|
||||
- PS2: Fix Quitting from RA
|
||||
- PS2: Add Audio mixer
|
||||
- REWIND: Prevent 'Rewind Frames' from being set to '1' incorrectly on load content
|
||||
- RUNAHEAD: Add Run-Ahead Toggle hotkey with notifications
|
||||
- RBUF/ANIMATIONS: Simplify gfx_animation by switching from dynarray to rbuf
|
||||
- RBUF/CORE UPDATER: Replace static entries array with dynamic array via RBUF library
|
||||
- RBUF/M3U: Replace static entries array with dynamic array via RBUF library
|
||||
- SENSORS: Android (crash-)fixes/improvements + add option to disable sensor input
|
||||
- SDL2/VIDEO: Get the SDL2 video driver to work in Wayland/KMS
|
||||
- SAVESTATES: Adding savestate garbage collector for autoincrement stavestates. As some issues indicate, there's an issue with
|
||||
the autoincrement save slot feature: slot index will increase and very old saves won't be deleted. This adds support to delete old save states with a user defined
|
||||
save state limit (global). Instead of wrapping around the slot counter it will simply delete the oldest save, since it is simpler. For now there's a limit of one deletion per save, which ensures a user cannot delete many saves by accident if they set the limit too low.
|
||||
- SAVESTATES/SAVEFILES: Ensure save file and playlist compression is disabled by default
|
||||
- SHADERS: Add option to remember last selected shader preset/shader pass directories
|
||||
- SHADERS: Use last selected shader preset directory when changing shaders via previous/next hotkeys
|
||||
- SHADERS: Remove Parameters line
|
||||
- SHADERS: Shaders fix for duplicate parameters loading bug
|
||||
- SHADERS: Fix Crash change num shader passes in UI
|
||||
- SHADERS/SLANG: Fix slang shaders with rotation
|
||||
- STREAMING/FFMPEG: Add Facebook Game Stream option (for embedded ffmpeg core-enabled RetroArch builds)
|
||||
- SWITCH: Fix input bind icons being off by one line
|
||||
- SWITCH: Fix audio issues
|
||||
- TLS/SSL: Add BearSSL support, as alternative to mbedTLS
|
||||
- VIDEO: AddVariable BFI (Black Frame Insertion)
|
||||
- VIDEO/DRM GO2: Dynamic resolution support
|
||||
- VIDEO FILTERS: Video filter optimisations
|
||||
- VIDEO FILTERS: Add several LCD-effect video filters
|
||||
- VIDEO FILTERS: Gameboy/Dot_Matrix video filters: Add XRGB8888 support
|
||||
- VIDEO FILTERS: Add Normal4x video filter
|
||||
- VIDEO FILTERS: Add 'Upscale_256x-320x240' video filter
|
||||
- VIDEO FILTERS: Add 'Upscale1.5x' video filter
|
||||
- VITA: Disable temporarily VitaGL
|
||||
- VITA: Fix bubble name
|
||||
- VITA: proper handling of boot params
|
||||
- VITA: Default menu scale 1.5x to improve readability
|
||||
- WIFI/LAKKA: Add a proper WiFi menu, with Enable/Disable & Disconnect options. This also allows WiFi passwords to be remembered. The underlying tool (connman) allows to store passswords (that's why it auto connects whenever you boot a Lakka device), so we expose this so that the user does not have to re-input the pass when connecting to a saved wifi.
|
||||
- WII/HID: Added HID support for HORI mini wired ps4 gamepad
|
||||
- WINDOWS: Add support for accelerators to main win32 message loop
|
||||
- WINDOWS: Add accelerators for Open (Ctrl+O) and Fullscreen (Alt+Enter)
|
||||
- WINDOWS: Fixes some file I/O failures on Windows when paths are longer than 260 characters.
|
||||
- WINDOWS: Fix crashing on startup on Windows when using Chinese Simplified language.
|
||||
- WINDOWS/XP: The OpenGL 1 video driver is now the default for maximum backwards compatibility upon first startup. It's of course always possible for the user to change this.
|
||||
- WINDOWS/MENUBAR: Load accelerators, Localize Win32 menu items to current language, and display shortcut keys
|
||||
- WINDOWS/MENUBAR: Add 'Reinit' to Menubar
|
||||
- WINDOWS/MSVC: Fix rewind crash on MSVC build when using SSE2
|
||||
- UWP: Don't default to XMB menu by default, default to Ozone instead
|
||||
- UWP/VFS: Use Win32 file APIs when possible - better file I/O performance
|
||||
- WIIU/FILEIO/PERFORMANCE: Faster startup times - remove the path_is_valid() call when loading textures
|
||||
- WIIU: Fix touchscreen mouse emulation
|
||||
|
||||
# 1.9.0
|
||||
- 3DS: Fix sound crackling when paused
|
||||
- ANDROID/VIBRATION: Fixes "Vibrate on Key Press" having no effect on Android devices, which occurred because only the off time/strength was defined in what should have been a pair of off/on values
|
||||
- AUTOCONFIG: Ensure correct directory is used when saving autoconfig profiles
|
||||
- BLUETOOTH: Add a Bluetooth driver (Lakka-only for now)
|
||||
- CHEATS: Fix for wrong number of remaining cheat search matches on some machines
|
||||
- CHEEVOS: Option to play sound on achievement unlock.
|
||||
- CHEEVOS: Upgrade to rcheevos 9.1
|
||||
- CHEEVOS: Restore display of unlocked achievements across hardcore modes
|
||||
- CHEEVOS: Hash buffered data when available
|
||||
- CHEEVOS: Fix 'Auto Save State freezes RetroArch while Cheevos is enabled'
|
||||
- CORE OPTIONS: Pressing OK (or clicking/tapping) on a 'boolean toggle' core option no longer opens a drop-down list. The value now toggles directly, just like boolean options everywhere else in the menu
|
||||
- CORE OPTIONS: Toggling an option that changes the number of core options being displayed (i.e. things like `Show Advanced Audio/Video Settings) no longer resets the navigation pointer to the start of the list
|
||||
- CORE OPTIONS: Before, RetroArch would identify core option values as being 'boolean' if they had labels matching the specific strings enabled or disabled. Most core devs would abide by this, but not always... As a result, we sometimes would end up with misidentified values, with all kinds of Enabled, Off, True, etc. strings littering the menu, in place of proper toggle switches. All boolean-type value labels are now detected, and replaced with standard ON/OFF strings.
|
||||
- CLI: A new command line option --load-menu-on-error has been added
|
||||
- CRT: On the fly CRT porch adjuments - these changes allow a user to adjust how the porch algorithm generates the 15khz/31khz output. Giving the ability to change over/under scan.
|
||||
- CONFIG FILE: Optimise parsing of configuration files
|
||||
- D3D9/D3D11: Fix core-initiated D3D9/D3D11 driver switches
|
||||
- DRIVERS: Implemented protection to avoid setting critical drivers to nothing thus preventing the user from locking him/herself out of the program
|
||||
- EMSCRIPTEN: Fix input code to ignore unknown keys
|
||||
- FFMPEG CORE: Prevent seeking past the end of files (hang fix)
|
||||
- FILE I/O: VFS and NBIO interfaces will now use 64-bit fseek/ftell where possible, should allow for reading/writing to files bigger than 2GB
|
||||
- INPUT MAPPING/REMAPPING: Add input remap drop-down lists
|
||||
- IOS: Fixed iOS 6 version
|
||||
- IOS: Hide the home indicator as it obscures the content too frequently
|
||||
- IOS/METAL: Metal video driver now works on RetroArch iOS
|
||||
- IOS/METAL: Support getting video metrics to support proper touchscreen interactions
|
||||
- LOCALIZATION: Updates for several languages (synchronized from Crowdin)
|
||||
- MEMORY/LINUX/ANDROID: Fix reporting of free memory
|
||||
- MEMORY/WINDOWS: Fix reporting of free memory
|
||||
- MENU: Enlarged INT/UINT selection limit from 999 to 9999
|
||||
- MENU: Fix cursor forced to first entry after displaying lists
|
||||
- MENU: Make Notification Font option visible when Graphics Widgets are enabled
|
||||
- MENU/RGUI: Add optional 'toggle switch' icons
|
||||
- MENU/WIDGETS: Add optional widget-based 'load content' launch feedback animation
|
||||
- MENU/WIDGETS: Make notification font size option visible when graphics widgets are enabled
|
||||
- ODROID GO ADVANCE: Video driver - fix race condition with RGUI callback
|
||||
- PLAYLISTS: Change playlists to use dynamic arrays. Instead of a fixed initial 12MB memory allocation (99999 * 128 byte (on 64bit arch)), use a dynamically growing array
|
||||
- PLAYLISTS: Playlist base content directory paths - portable playlists
|
||||
- PLAYLISTS/SEARCH: Enhanced playlist search functionality
|
||||
- PLAYLISTS/DATABASE: Add 'Explore' view
|
||||
- PLAYLISTS/DATABASE/EXPLORE: Show system icons in explore view
|
||||
- PS2: Improve FPS Limiter
|
||||
- RUNAHEAD: Prevent runahead from being disabled *permanently* when an error occurs
|
||||
- SCANNER: Add more region codes for GameCube/Wii game detection
|
||||
- SHADERS/SLANG: Increased Slang max Parameters, Textures & Passes
|
||||
- VIDEO FILTERS/BLARGG: Make Blargg_snes filter customizable
|
||||
- WINDOWS/RAWINPUT: Fix invalid calls to dinput_handle_message when input driver is not set to dinput
|
||||
- X11: Add lightgun support
|
||||
|
||||
# 1.8.9
|
||||
- AUTO SAVESTATES: Ensure save states are correctly flushed to disk when quitting RetroArch (fixes broken save states when exiting RetroArch - without first closing content - with 'Auto Save State' enabled)
|
||||
- BUILTIN CORES: Builtin cores like ffmpeg and imageviewer would previously try to erroneously load a dynamic core named 'builtin' - this would fail and would just be a wasteful operation - this now skips dylib loading in libretro_get_system_info for builtin cores
|
||||
- CHEEVOS: Report API errors when unlocking achievements or submitting leaderboards
|
||||
- CHEEVOS: Support less common file extensions
|
||||
- CHEEVOS: Disable hardcore mode when playing BSV file
|
||||
- CHEEVOS: Correctly report unlocked non-hardcore achievements when hardcore is paused
|
||||
- CHEEVOS/M3U: Bugfix - did not handle absolute/relative paths in M3U files correctly before
|
||||
- CHEEVOS/M3U: Bugfix - it didn't handle comments/directives
|
||||
- CHEEVOS/M3U: Bugfix - it doesn't handle trailing whitespace
|
||||
- CHEEVOS/M3U: Bugfix - failed when loading M3U files with certain line endings
|
||||
- CORE MANAGEMENT: Add 'core management' menu (Settings -> Core)
|
||||
- CORE MANAGEMENT: Add option to backup/restore installed cores
|
||||
- CORE MANAGEMENT: Improved core selection logic
|
||||
- CORE INFO: Search search optimisations
|
||||
- CORE DOWNLOADER: Rename 'Core Updater' to 'Core Downloader'
|
||||
- CORE DOWNLOADER: Add 'Show Experimental Cores' setting under Settings > Network > Updater
|
||||
- CORE DOWNLOADER: Core licenses are now shown for all entries in the Core Updater menu
|
||||
- CORE DOWNLOADER: Pressing RetroPad select on a Core Updater entry will now display any text in the description field of its info file
|
||||
- CORE DOWNLOADER: Installed cores are now highlighted via a [#] symbol
|
||||
- CORE DOWNLOADER: Pressing RetroPad start on a selected, installed entry opens the Core Information menu (when using Material UI, swiping left or right triggers the same action). This means we can now view bios info etc. - and more importantly delete cores - without jumping through all the hoops of loading a core first and navigating all over the place
|
||||
- CORE DOWNLOADER/UPDATER: Add option to automatically backup cores when updating
|
||||
- DISK CONTROL: Enable 'Load New Disc' while disk tray is open
|
||||
- INPUT: Added a hotkey delay option to allow hotkey input to work properly when it is assigned to another action
|
||||
- INPUT: Remove 'All Users Control Menu' setting, was buggy and will be properly reintroduced after input overhaul
|
||||
- LINUX: Set default saves/save states/system paths
|
||||
- LOCALIZATION: Add Persian language
|
||||
- LOCALIZATION: Add Hebrew language
|
||||
- LOCALIZATION: Add Asturian language
|
||||
- MENU: Proper line wrapping for message dialog boxes
|
||||
- MENU/HOTKEYS: Add sublabels to all hotkey bind entries
|
||||
- MENU/QUICK MENU: Suppress the display of 'empty' quick menu listings when closing content
|
||||
- MENU/OZONE: Performance improvements
|
||||
- MENU/SDL: Add mouse controls
|
||||
- OPENGL1/VITA: Initial changes for HW context without FBO
|
||||
- OVERLAYS: Add options for moving the on-screen overlay
|
||||
- PLAYLISTS/WINDOWS: Fix core path entries in image/video/music history playlists
|
||||
- PS2: Add back CDFS support
|
||||
- SDL/GL: Advertise GLSL support
|
||||
- VIDEO/WIDGETS: Fix heap-use-after-free errors, leading to memory corruption
|
||||
- VITA: Added custom bubbles support
|
||||
- VITA: VitaGL update
|
||||
- VULKAN/WSI: Better frame pacing
|
||||
- VULKAN/WSI: Fix Intel Mesa being broken when using Fences, we have to use Semaphores to acquire the swapchain or the entire GPU stalls
|
||||
- VULKAN/WSI: Add support for either using fences or semaphores when syncing
|
||||
- VULKAN/WSI: Prefer using semaphores for integrated GPUs as it promotes better throughput over fences
|
||||
- VULKAN/WSI/ANDROID: Do not use mailbox emulation on Android
|
||||
- UWP/XBOX: Potentially improve performance by enabling 'Game Mode'
|
||||
|
||||
# 1.8.8
|
||||
- AUDIO/JACK: Fix regression introduced after 1.8.4 - would hang at startup
|
||||
- CHEEVOS: Disable hardcore when cheats are enabled
|
||||
- CHD: Return false when special track cannot be found
|
||||
- DISCORD/MATCHMAKING: Fix Discord 'Ask To Join' functionality
|
||||
- FILE PATH: Various file path handling optimisations
|
||||
- FONT: Fix Arabic, Chinese and Korean font rendering
|
||||
- INPUT MAPPING/REMAPPING: Restore broken 'reset to default' functionality with RetroPad 'start' button
|
||||
- INPUT MAPPING/REMAPPING: Fix 'reset to default' action for analog sticks and undefined core inputs
|
||||
- LOCALIZATION: Update Arabic translation
|
||||
- LOCALIZATION: Update Chinese (Simplified) translation
|
||||
- LOCALIZATION: Update Chinese (Traditional) translation
|
||||
- LOCALIZATION: Update German translation
|
||||
- LOCALIZATION: Update Greek translation
|
||||
- LOCALIZATION: Update Spanish translation
|
||||
- LOCALIZATION: Update French translation
|
||||
- LOCALIZATION: Update Italian translation
|
||||
- LOCALIZATION: Update Japanese translation
|
||||
- LOCALIZATION: Update Korean translation
|
||||
- LOCALIZATION: Update Dutch translation
|
||||
- LOCALIZATION: Update Polish translation
|
||||
- LOCALIZATION: Update Portuguese Brazilian translation
|
||||
- LOCALIZATION: Update Russian translation
|
||||
- LOCALIZATION: Update Turkish translation
|
||||
- LOCALIZATION: Update Vietnamese translation
|
||||
- LOCALIZATION: Add Slovak translation
|
||||
- MENU: Small buffer optimizations
|
||||
- MENU/THUMBNAILS/BUGFIX: Fix heap-use-after-free error
|
||||
- MENU/OZONE: Add option to sort playlists after name truncation
|
||||
- MENU/OZONE/ANDROIDTV: Default to Ozone menu driver
|
||||
- MENU/OZONE/ANDROID: Gamepad-like devices default to Ozone now (Shield Portable)
|
||||
- NETPLAY: Lower announcement rate
|
||||
- OVERLAYS: Fix memory leak when loading overlays
|
||||
- SHADER PRESETS: Improved shader preset dirs
|
||||
- TIME/DATE: Enable configuration of date seperator in clock and runtime 'last played' displays
|
||||
- VITA: Fix upside-down vertical games
|
||||
- UWP: Enable playlist and savefile compression by default (because of slow file I/O)
|
||||
- WIIU: Gamepad hotplugging support
|
||||
- WIIU: Theoretical multi-gamepad support
|
||||
- VIDEO/WIDGETS: Fix overlapping text when simultaneous pop-up notifications and core/shader messages are being displayed
|
||||
- X11: Fix crash in x11_display_server_get_screen_orientation
|
||||
- X11/XSHM: Allow X11/XHSM video driver to operate without SHM extension
|
||||
- X11/XSHM: Fix compatibility with X11 input driver
|
||||
- XVIDEO: Fix keyboard input initialization
|
||||
- XVIDEO/XWAYLAND: Fix XVideo support on xwayland (by supporting I420 and YZ12)
|
||||
|
||||
# 1.8.7
|
||||
- 3DS: Add IDs for Frodo
|
||||
- 3DS: Enable basic networking / cheevos
|
||||
- CHEEVOS/BUGFIX: Opening achievements list would crash RetroArch with badges enabled (on new games)
|
||||
- CHEEVOS: Option to start a session with all achievements active
|
||||
- CHEEVOS: Don't perform unnecessary cheevos initialisation when cheevos are disabled. Should reduce startup times when loading content.
|
||||
- CORE OPTIONS: Disable 'Use Global Core Options File' by default
|
||||
- DOS/DJGPP: Add 32bit color support for cores
|
||||
- GLCORE: Switch to glcore video driver when requested by a core
|
||||
- LINUX/XDG: Use GenericName correctly in desktop entry
|
||||
- MAC/COCOA: Fix mouse cursor tracking
|
||||
- MENU/MATERIALUI: Add desktop-style playlist view mode
|
||||
- MENU/MATERIALUI/DESKTOPVIEW: When scrolling playlists, show last selected thumbnails while waiting for next entry to load
|
||||
- MENU/MATERIALUI: Limit tab switch rate when input repeat is active
|
||||
- MENU/OZONE: Fix sidebar playlist sort order when 'Truncate Playlist Names' is enabled
|
||||
- MENU/RGUI: Adjusted menu defaults, adjusted default scrolling speed
|
||||
- MENU/RGUI: Enable custom wallpaper when menu size is reduced at low resolutions
|
||||
- MENU/XMB: Limit tab switch rate when input repeat is active
|
||||
- NETPLAY: Fix regressions introduced in 1.8.5
|
||||
- RGUI: Add option to always stretch menu to fill the screen
|
||||
- WIIU: Enable graphics widgets
|
||||
|
||||
# 1.8.6
|
||||
- 3DS: Add IDs for UZEM, TGB Dual, and NeoCD
|
||||
- 3DS: Fix font driver horizontal text alignment
|
||||
- 3DS: Allow button presses up to INPUT_MAX_USERS - this enables the 3DS to bind and use buttons and axis for users up to the maximum set by 'Max Users' in the input settings menu.
|
||||
- 3DS: Disable video filter if upscaled resolution exceeds hardware limits. The 3DS has a maximum video buffer size of 2048x2048. This is sufficient for every core that it supports, but when using software video filters the core output resolution is doubled. This is made worse by the fact that the video filter upscaling buffer size is dependent upon the maximum output resolution of the core - which in some cases is very large indeed (e.g. pcsx-rearmed sets a maximum width of 1024, for enhanced resolution support). The 3DS has very limited 'linear memory' for graphics buffer purposes, and a large base core buffer + video filter buffer can easily exceed this - which may also disable video output, or cause a crash. This PR very simply adds a 3DS-specific check to the video filter initialisation: if the resultant upscaling buffer exceeds the hardware limitation, then the filter is automatically disabled.
|
||||
- 3DS/FONT/BUGFIX: Text colour was wrong: the RGBA channels were muddled, and R was always set to 255
|
||||
- 3DS/FONT/BUGFIX: When drawing multiline strings, the line spacing was completely incorrect
|
||||
- 3DS/FONT: Improves the appearance of the drop shadow effect on notification text.
|
||||
- 3DS/ARCHIVE/7Z: Re-enable 7zip support.
|
||||
- ARCHIVE/ZIP: Expand functionality of 'rzip_stream' interface. This PR expands the functionality of the new rzip_stream archived stream interface such that it now has almost complete feature parity with the standard file_stream interface, and can therefore be used as a drop-in replacement in most situations
|
||||
- AI SERVICE: Hide redundant entries when service is disabled
|
||||
- AI SERVICE: Added in auto-translate support
|
||||
- AI SERVICE: support for NVDA and SAPI narration
|
||||
- AUTOCONFIG: Use correct port index in input device configured/disconnected notifications
|
||||
- BUGFIX: Fix race condition where task could momentarily not be in the queue when reordering
|
||||
- CHEEVOS/BUGFIX: Prevent null reference rendering achievement list while closing application
|
||||
- CHEEVOS/BUGFIX: Report non-memorymap GBA cores as unsupported
|
||||
- COMMANDLINE: Advise against using -s and -S variables on the command line. …
|
||||
- CONFIG FILE: Only write config files to disk when parameters change
|
||||
- CONFIG FILE/BUGFIX: RetroArch no longer crashes when attempting to save a config file after 'unsetting' a parameter (currently, this can be triggered quite easily by manipulating input remaps)
|
||||
- CONFIG FILE/BUGFIX: When using Material UI, RetroArch no longer modifies the wrong setting (or segfaults...) when tapping entries in the Quick Menu > Controls input remapping submenu
|
||||
- CONFIG FILE/BUGFIX: Quite a few real and potential memory leaks have been fixed.
|
||||
- CHD: Fixes a crash caused by ignoring the return value from one of the CHD library functions
|
||||
- FASTFORWARDING: A new Mute When Fast-Forwarding option has been added under Settings > Audio. When enabled, users can fast forward without having to listen to distorted audio.
|
||||
- GLCORE/SLANG: Set filter and wrap mode correctly when intialising shader textures. Before, the glcore shader driver did not correctly initialise loaded textures. The texture filtering and wrap mode were forced on texture creation, but these settings were not recorded - subsequent updates would set garbage values, that would resolve to linear filtering OFF and wrap mode = CLAMP_TO_EDGE.
|
||||
- LOCALIZATION: Update Japanese translation
|
||||
- LOCALIZATION: Update Spanish translation
|
||||
- LOCALIZATION: Update Portuguese Brazilian translation
|
||||
- IOS: Set audio session category to ambient so sound does not get cut off on interruption (phone call/playing back audio)
|
||||
- MAC/IOHIDMANAGER/BUGFIX: Fix for Mayflash N64 adapter. In case last hatswitch does not match cookie. For the mayflash N64 adapter, I was getting a BAD EXC ADDRESS (in mac OS 10.13) for this line (tmp was NULL). Retroarch would crash in the gui if I pressed a button from the DPAD on controller 2. With this change, it no longer crashes in the gui and still registers the button push.
|
||||
- MAC/COCOA: Fix mouse input - this brings back two lines of code that have been removed over time but
|
||||
appear to be required in order for mouse input to work on macOS
|
||||
- METAL/BUGFIX: GPU capture on Metal/OSX/NVidia could crash
|
||||
- METAL/BUGFIX: Taking screenshots could capture black frames. Resulting PNG screenshots were black.
|
||||
- METAL/BUGFIX: Corrupted image due to incorrect viewport copy when taking screenshot
|
||||
- CHD: Fixes a crash caused by ignoring the return value from one of the CHD library functions.
|
||||
- MENU: Prevent font-related segfaults when using extremely small scales/window sizes
|
||||
- MENU: Fix 'gfx_display_draw_texture_slice()'
|
||||
- MENU/FONT: Enable correct vertical alignment of text (+ font rendering fixes)
|
||||
- MENU/RGUI: Enable automatic menu size reduction when running at low resolutions (down to 256x192)
|
||||
- MENU/OZONE: Update timedate style options for Last Played sublabel metadata
|
||||
- MENU/OZONE: Hide 'Menu Color Theme' setting when 'Use preferred system color theme' is enabled
|
||||
- MENU/OZONE: Fix thumbnail switching via 'scan' button functionality
|
||||
- MENU/OZONE: Prevent glitches when rendering Ozone's selection cursor
|
||||
- MENU/OZONE: Enable proper vertical text alignment + thumbnail display improvements
|
||||
- MENU/OZONE: Enable second thumbnail/content metadata toggle using RetroPad 'select'
|
||||
- MENU/OZONE: Refactor footer display
|
||||
- MENU/OZONE: Hide thumbnail button hints when viewing file browser lists
|
||||
- MENU/OZONE/INPUT/BUGFIX: Fix undefined behaviour when using touch screen to change input remaps
|
||||
- MENU/OZONE/INPUT/BUGFIX: It turns out that Windows reports negative pointer coordinates when the mouse cursor goes beyond the left hand edge of the RetroArch window (this doesn't happen on Linux, so I never encountered this issue before!). As a result, if Ozone is currently not showing the sidebar (menu depth > 1), moving the cursor off the left edge of the window generates a false positive 'cursor in sidebar' event - which breaks menu navigation, as described in #10419. With this PR, we now handle 'cursor in sidebar' status correctly in all cases
|
||||
- MENU/OZONE/INPUT/BUGFIX: Pointer input is now correctly disabled when message boxes are displayed
|
||||
- MENU/XMB: Fix thumbnail switching via 'scan' button functionality
|
||||
- ODROID GO ADVANCE: Add DRM HW context driver
|
||||
- PSL1GHT: Initial port
|
||||
- PSL1GHT/KEYBOARD: Implement PSL1GHT keyboard
|
||||
- PLAYLIST/BUGFIX: Improve handling of 'broken' playlists - RetroArch will no longer segfault when attempting to run content via a playlist entry with missing path or core path fields.
|
||||
- PLAYLIST/BUGFIX: Improve handling of 'broken' playlists - when a playlist entry has either core path and/or core name set to NULL, DETECT or an empty string, attempting to load content will fallback to the normal 'core selection' code (currently this happens only if both core path and core name are DETECT - this is wholly inadequate!)
|
||||
- PLAYLIST/BUGFIX: RetroArch will no longer segfault when attempting to fetch content runtime information when core path is NULL
|
||||
- PLAYLIST/BUGFIX: Core name + runtime info will only be displayed on playlists and in the Information submenu if both the core path and core name fields are 'valid' (i.e. not NULL or DETECT)
|
||||
- PLAYLIST/BUGFIX: When handling entries with missing path fields, the menu sorting order now matches that of the playlist sorting order (at present, everything goes out of sync when paths are empty). Moreover, entries with missing path fields can now be 'selected', so users can remove them (currently, hitting A on such an entry immediately tries - and fails - to load the content, so the only way to remove the broken entry is via the Playlist Management > Clean Playlist feature)
|
||||
- PLAYLIST: Add optional per-playlist alphabetical sorting
|
||||
- PLAYLIST: Omit whitespace when writing compressed JSON format playlists
|
||||
- PLAYLIST: Add optional playlist compression
|
||||
- QNX: Support analog sticks
|
||||
- SAVESTATES: Add optional save state compression (enabled by default now)
|
||||
- SRAM: Add optional save (SRAM) file compression
|
||||
- SCANNER: Prevent redundant playlist entries when handling M3U content
|
||||
- SCANNER/ANDROID: Fix content scanner being unable to identify certain games from CHD images (raw data sector/subcode)
|
||||
- TASKS/BUGFIX: Fix task deadlocks
|
||||
- TASKS/SCREENSHOT/BUGFIX: Fix heap-use-after-free error when widgets are disabled
|
||||
- TVOS: Disable overlays for tvOS, fix app icon
|
||||
- VIDEO/WIDGETS/BUGFIX: The font ascender/descender metrics added in #10375 are now used to achieve 'pixel perfect' vertical text alignment
|
||||
- VIDEO/WIDGETS/BUGFIX: Message queue text now uses its own dedicated font. Previously, a single (larger) font was used for all active widgets, and this was scaled down for message queue items. This 'squished' the text a little; more importantly, when using the stb font renderers (on Android. etc.) it caused ugly artefacts around the edges of glyphs due to pixel interpolation errors. Now that a correctly sized font is used, the message queue is always rendered cleanly.
|
||||
- VIDEO/WIDGETS/BUGFIX: Previously, each widget font was 'flushed' (font_driver_flush()) at least once a frame. This is quite a slow operation. Now we only flush fonts if they have actually been used.
|
||||
- VULKAN/BUGFIX: Fix display of statistics text
|
||||
- UNIX/BUGFIX: Fix overflow when computing total memory on i386
|
||||
- WIIU/BUGFIX: Fix font driver horizontal text alignment
|
||||
- WIIU/BUGFIX: Fix non-vertex coordinates in draws using tex shader
|
||||
- WIIU/BUGFIX: Update and fix meta.xml file for the WiiU release. This change makes it so the information from the meta.xml file parsed for the WiiU's Homebrew Launcher is displayed properly.
|
||||
|
||||
# 1.8.5
|
||||
- 3DS: Keep the bottom screen hidden on sleep/wakeup. When the 3DS wakes back up after being closed, the bottom screen needs to be reinitialized. Adding the condition here will cause the screen to be turned on or off based on the state of ctr_bottom_screen_enabled, as you'd expect
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
Struct ordering
|
||||
---------------
|
||||
|
||||
For POD-types, try to order structs as follows (first to last):
|
||||
|
||||
* long double (8 bytes, 16 bytes [64bit x86], 12 bytes [32bit x86])
|
||||
* double (8 bytes)
|
||||
* int64_t (8 bytes, 8 bytes [32bit ARM], 4 bytes [32bit x86])
|
||||
* uint64_t (4 bytes [32bit], 8 bytes [32bit ARM], 8 bytes [64bit])
|
||||
* pointer (4 bytes [32bit], 8 bytes [64bit] [1])
|
||||
* intptr_t (4 bytes [32bit], 8 bytes [64bit] [1])
|
||||
* uintptr_t (4 bytes [32bit], 8 bytes [64bit] [1])
|
||||
* ptrdiff_t (4 bytes [32bit], 8 bytes [64bit] [1])
|
||||
* ssize_t (4 bytes [32bit], 8 bytes [64bit])
|
||||
* size_t (4 bytes [32bit], 8 bytes [64bit])
|
||||
* jmp_buf (4 bytes)
|
||||
* long (4 bytes [64bit Win], 8 bytes [64bit non-Win], 4 bytes [32bit])
|
||||
* int32_t (4 bytes)
|
||||
* unsigned (4 bytes)
|
||||
* float (4 bytes)
|
||||
* int (4 bytes)
|
||||
* enum (4 bytes)
|
||||
* int16_t (2 bytes)
|
||||
* char (1 byte)
|
||||
* bool (1 byte)
|
||||
|
||||
[1] PS3 uses 4 byte pointers despite having a 64bit processor
|
||||
|
||||
Struct members should be sorted by alignment. Therefore, structs
|
||||
should be sorted by the largest type inside them.
|
||||
|
||||
For example, take a struct like this:
|
||||
|
||||
typedef struct
|
||||
{
|
||||
size_t capacity;
|
||||
bool old_format;
|
||||
bool compress;
|
||||
bool fuzzy_archive_match;
|
||||
bool autofix_paths;
|
||||
char path[PATH_MAX_LENGTH];
|
||||
char base_content_directory[PATH_MAX_LENGTH];
|
||||
} playlist_config_t;
|
||||
|
||||
size_t has the biggest alignment here, so 'struct playlist_config_t' inside a struct should come before or after size_t.
|
||||
|
||||
*** BEST PRACTICES ***
|
||||
|
||||
* If we have pointers and size variable pairs, it's best to interleave them to increase the probability they go in the same cacheline. It also makes the code more readable, that these two variables are connected.
|
||||
|
||||
Example:
|
||||
|
||||
struct a
|
||||
{
|
||||
char* b;
|
||||
size_t b_len;
|
||||
char* c;
|
||||
size_t c_len;
|
||||
};
|
||||
|
||||
Stack size
|
||||
----------
|
||||
|
||||
You have to assume that stack size is going to be limited in RetroArch. Some game consoles (and other embedded systems) might have a default stack size as low as 128Kb or less. Be conservative with stack size but don't try to put very small structs on heap either [to avoid memory fragmentation among other things].
|
||||
|
||||
Be mindful that heap allocations are slow compared to stack.
|
||||
@@ -22,7 +22,7 @@ endif
|
||||
|
||||
OBJ :=
|
||||
LIBS :=
|
||||
DEF_FLAGS := -I.
|
||||
DEF_FLAGS :=
|
||||
ASFLAGS :=
|
||||
DEFINES := -DHAVE_CONFIG_H -DRARCH_INTERNAL -D_FILE_OFFSET_BITS=64
|
||||
DEFINES += -DGLOBAL_CONFIG_DIR='"$(GLOBAL_CONFIG_DIR)"'
|
||||
@@ -118,7 +118,7 @@ ifneq ($(CXX_BUILD), 1)
|
||||
CFLAGS += -D_GNU_SOURCE
|
||||
endif
|
||||
|
||||
DEF_FLAGS += $(INCLUDE_DIRS) -Ideps -Ideps/stb
|
||||
DEF_FLAGS += $(INCLUDE_DIRS) -I. -Ideps -Ideps/stb
|
||||
|
||||
CFLAGS += $(DEF_FLAGS)
|
||||
CXXFLAGS += $(DEF_FLAGS) -D__STDC_CONSTANT_MACROS
|
||||
@@ -215,6 +215,13 @@ $(OBJDIR)/%.o: %.m
|
||||
@$(if $(Q), $(shell echo echo OBJC $<),)
|
||||
$(Q)$(CXX) $(OBJCFLAGS) $(DEFINES) -MMD -c -o $@ $<
|
||||
|
||||
.FORCE:
|
||||
|
||||
$(OBJDIR)/git_version.o: git_version.c .FORCE
|
||||
@mkdir -p $(dir $@)
|
||||
@$(if $(Q), $(shell echo echo CC $<),)
|
||||
$(Q)$(CC) $(CFLAGS) $(DEFINES) -MMD -c -o $@ $<
|
||||
|
||||
$(OBJDIR)/%.o: %.S config.h config.mk $(HEADERS)
|
||||
@mkdir -p $(dir $@)
|
||||
@$(if $(Q), $(shell echo echo AS $<),)
|
||||
@@ -226,17 +233,16 @@ $(OBJDIR)/%.o: %.rc $(HEADERS)
|
||||
$(Q)$(WINDRES) -o $@ $<
|
||||
|
||||
install: $(TARGET)
|
||||
rm -f $(OBJDIR)/git_version.o
|
||||
mkdir -p $(DESTDIR)$(BIN_DIR) 2>/dev/null || /bin/true
|
||||
mkdir -p $(DESTDIR)$(GLOBAL_CONFIG_DIR) 2>/dev/null || /bin/true
|
||||
mkdir -p $(DESTDIR)$(DATA_DIR)/applications 2>/dev/null || /bin/true
|
||||
mkdir -p $(DESTDIR)$(DATA_DIR)/metainfo 2>/dev/null || /bin/true
|
||||
mkdir -p $(DESTDIR)$(DOC_DIR) 2>/dev/null || /bin/true
|
||||
mkdir -p $(DESTDIR)$(MAN_DIR)/man6 2>/dev/null || /bin/true
|
||||
mkdir -p $(DESTDIR)$(DATA_DIR)/pixmaps 2>/dev/null || /bin/true
|
||||
cp $(TARGET) $(DESTDIR)$(BIN_DIR)
|
||||
cp tools/cg2glsl.py $(DESTDIR)$(BIN_DIR)/retroarch-cg2glsl
|
||||
cp retroarch.cfg $(DESTDIR)$(GLOBAL_CONFIG_DIR)
|
||||
cp com.libretro.RetroArch.appdata.xml $(DESTDIR)$(DATA_DIR)/metainfo
|
||||
cp retroarch.desktop $(DESTDIR)$(DATA_DIR)/applications
|
||||
cp docs/retroarch.6 $(DESTDIR)$(MAN_DIR)/man6
|
||||
cp docs/retroarch-cg2glsl.6 $(DESTDIR)$(MAN_DIR)/man6
|
||||
@@ -247,7 +253,6 @@ install: $(TARGET)
|
||||
chmod 755 $(DESTDIR)$(BIN_DIR)/retroarch-cg2glsl
|
||||
chmod 644 $(DESTDIR)$(GLOBAL_CONFIG_DIR)/retroarch.cfg
|
||||
chmod 644 $(DESTDIR)$(DATA_DIR)/applications/retroarch.desktop
|
||||
chmod 644 $(DESTDIR)$(DATA_DIR)/metainfo/com.libretro.RetroArch.appdata.xml
|
||||
chmod 644 $(DESTDIR)$(MAN_DIR)/man6/retroarch.6
|
||||
chmod 644 $(DESTDIR)$(MAN_DIR)/man6/retroarch-cg2glsl.6
|
||||
chmod 644 $(DESTDIR)$(DATA_DIR)/pixmaps/retroarch.svg
|
||||
@@ -272,7 +277,6 @@ uninstall:
|
||||
rm -f $(DESTDIR)$(BIN_DIR)/retroarch-cg2glsl
|
||||
rm -f $(DESTDIR)$(GLOBAL_CONFIG_DIR)/retroarch.cfg
|
||||
rm -f $(DESTDIR)$(DATA_DIR)/applications/retroarch.desktop
|
||||
rm -f $(DESTDIR)$(DATA_DIR)/metainfo/com.libretro.RetroArch.appdata.xml
|
||||
rm -f $(DESTDIR)$(DATA_DIR)/pixmaps/retroarch.svg
|
||||
rm -f $(DESTDIR)$(DOC_DIR)/COPYING
|
||||
rm -f $(DESTDIR)$(DOC_DIR)/COPYING.assets
|
||||
|
||||
+193
-497
File diff suppressed because it is too large.
Load diff
+15
-51
@@ -8,7 +8,6 @@ BUILD_3DSX = 1
|
||||
BUILD_3DS = 0
|
||||
BUILD_CIA = 1
|
||||
LIBCTRU_NO_DEPRECATION = 1
|
||||
USE_CTRULIB_2 ?= 0
|
||||
|
||||
APP_TITLE = RetroArch 3DS
|
||||
APP_DESCRIPTION = RetroArch 3DS
|
||||
@@ -36,7 +35,8 @@ OBJ += ctr/exec-3dsx/exec_cia.o \
|
||||
ctr/exec-3dsx/exec_3dsx.o \
|
||||
ctr/exec-3dsx/mini-hb-menu/launch.o \
|
||||
ctr/exec-3dsx/mini-hb-menu/loaders/rosalina.o \
|
||||
ctr/exec-3dsx/mini-hb-menu/loaders/hax2.o
|
||||
ctr/exec-3dsx/mini-hb-menu/loaders/hax2.o \
|
||||
ctr/exec-3dsx/mini-hb-menu/loaders/ninjhax1.o
|
||||
|
||||
ifeq ($(APP_BIG_TEXT_SECTION), 1)
|
||||
APP_USE_SVCHAX = 1
|
||||
@@ -51,16 +51,8 @@ DEFINES :=
|
||||
ifeq ($(GRIFFIN_BUILD), 1)
|
||||
OBJ += griffin/griffin.o
|
||||
DEFINES += -DHAVE_GRIFFIN=1 -DHAVE_MENU -DHAVE_CONFIGFILE -DHAVE_RGUI -DHAVE_XMB -DHAVE_MATERIALUI -DHAVE_LIBRETRODB -DHAVE_CC_RESAMPLER
|
||||
DEFINES += -DHAVE_ZLIB -DHAVE_7ZIP -D_7ZIP_ST -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_RBMP -DHAVE_RTGA
|
||||
DEFINES += -DHAVE_NETWORKING -DHAVE_CHEEVOS -DRC_DISABLE_LUA -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_CORES
|
||||
#DEFINES += -DHAVE_UPDATE_ASSETS
|
||||
DEFINES += -DHAVE_PATCH -DHAVE_RWAV
|
||||
DEFINES += -DHAVE_SCREENSHOTS
|
||||
DEFINES += -DHAVE_REWIND
|
||||
DEFINES += -DHAVE_THREADS
|
||||
DEFINES += -DHAVE_GFX_WIDGETS
|
||||
DEFINES += -DHAVE_OVERLAY
|
||||
#DEFINES += -DHAVE_SOCKET_LEGACY
|
||||
DEFINES += -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_RBMP -DHAVE_RTGA
|
||||
#DEFINES += -DHAVE_NETWORKING -DHAVE_CHEEVOS -DRC_DISABLE_LUA -DHAVE_SOCKET_LEGACY -DHAVE_THREADS
|
||||
#-DHAVE_SSL -DHAVE_BUILTINMBEDTLS -DMBEDTLS_SSL_DEBUG_ALL
|
||||
#ssl is currently incompatible with griffin due to use of the "static" flag on repeating functions that will conflict when included in one file
|
||||
else
|
||||
@@ -80,15 +72,10 @@ else
|
||||
HAVE_XMB = 1
|
||||
HAVE_STATIC_VIDEO_FILTERS = 1
|
||||
HAVE_STATIC_AUDIO_FILTERS = 1
|
||||
HAVE_PATCH = 1
|
||||
HAVE_SCREENSHOTS = 1
|
||||
HAVE_REWIND = 1
|
||||
HAVE_AUDIOMIXER = 1
|
||||
HAVE_RWAV = 1
|
||||
#HAVE_NETWORKING = 1
|
||||
#HAVE_CHEEVOS = 1
|
||||
#HAVE_SOCKET_LEGACY = 1
|
||||
HAVE_THREADS = 1
|
||||
#HAVE_THREADS = 1
|
||||
#HAVE_SSL = 1
|
||||
#HAVE_BUILTINMBEDTLS = 1
|
||||
|
||||
@@ -108,32 +95,13 @@ ifeq ($(strip $(CTRULIB)),)
|
||||
CTRULIB = $(DEVKITPRO)/libctru
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(USE_CTRULIB_2)),1)
|
||||
CFLAGS += -DUSE_CTRULIB_2
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(DEVKITTOOLS)),)
|
||||
ifeq ($(strip $(USE_CTRULIB_2)),1)
|
||||
DEVKITTOOLS = $(DEVKITPRO)/tools
|
||||
else
|
||||
DEVKITTOOLS = $(DEVKITARM)
|
||||
endif
|
||||
endif
|
||||
|
||||
APP_TITLE := $(shell echo "$(APP_TITLE)" | cut -c1-128)
|
||||
APP_DESCRIPTION := $(shell echo "$(APP_DESCRIPTION)" | cut -c1-256)
|
||||
APP_AUTHOR := $(shell echo "$(APP_AUTHOR)" | cut -c1-128)
|
||||
APP_PRODUCT_CODE := $(shell echo $(APP_PRODUCT_CODE) | cut -c1-16)
|
||||
APP_UNIQUE_ID := $(shell echo $(APP_UNIQUE_ID) | cut -c1-7)
|
||||
|
||||
APP_VERSION_MAJOR := $(shell shuf -i 0-63 -n 1)
|
||||
APP_VERSION_MINOR := $(shell shuf -i 0-63 -n 1)
|
||||
APP_VERSION_MICRO := $(shell shuf -i 0-15 -n 1)
|
||||
|
||||
MAKEROM_ARGS_COMMON = -rsf $(APP_RSF) -exefslogo -elf $(TARGET).elf -icon $(TARGET).icn -banner $(TARGET).bnr \
|
||||
-DAPP_TITLE="$(APP_TITLE)" -DAPP_PRODUCT_CODE="$(APP_PRODUCT_CODE)" -DAPP_UNIQUE_ID=$(APP_UNIQUE_ID) \
|
||||
-DAPP_SYSTEM_MODE=$(APP_SYSTEM_MODE) -DAPP_SYSTEM_MODE_EXT=$(APP_SYSTEM_MODE_EXT) \
|
||||
-major "$(APP_VERSION_MAJOR)" -minor "$(APP_VERSION_MINOR)" -micro "$(APP_VERSION_MICRO)"
|
||||
MAKEROM_ARGS_COMMON = -rsf $(APP_RSF) -exefslogo -elf $(TARGET).elf -icon $(TARGET).icn -banner $(TARGET).bnr -DAPP_TITLE="$(APP_TITLE)" -DAPP_PRODUCT_CODE="$(APP_PRODUCT_CODE)" -DAPP_UNIQUE_ID=$(APP_UNIQUE_ID) -DAPP_SYSTEM_MODE=$(APP_SYSTEM_MODE) -DAPP_SYSTEM_MODE_EXT=$(APP_SYSTEM_MODE_EXT)
|
||||
|
||||
INCDIRS := -I$(CTRULIB)/include
|
||||
LIBDIRS := -L. -L$(CTRULIB)/lib
|
||||
@@ -167,15 +135,11 @@ CFLAGS += -I. \
|
||||
-Ideps \
|
||||
-Ideps/7zip \
|
||||
-Ideps/stb \
|
||||
-Ideps/rcheevos/include \
|
||||
-Ilibretro-common/include \
|
||||
-Ilibretro-common/include/compat/zlib
|
||||
|
||||
CFLAGS += -DRARCH_INTERNAL -DRARCH_CONSOLE
|
||||
CFLAGS += -DHAVE_DSP_FILTER
|
||||
CFLAGS += -DHAVE_VIDEO_FILTER
|
||||
CFLAGS += -DHAVE_FILTERS_BUILTIN $(DEFINES)
|
||||
CFLAGS += -DHAVE_CHEATS
|
||||
|
||||
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11
|
||||
|
||||
@@ -248,13 +212,13 @@ else
|
||||
endif
|
||||
|
||||
%.o: %.vsh %.gsh
|
||||
$(DEVKITTOOLS)/bin/picasso $^ -o $*.shbin
|
||||
$(DEVKITTOOLS)/bin/bin2s $*.shbin | $(PREFIX)as -o $@
|
||||
$(DEVKITARM)/bin/picasso $^ -o $*.shbin
|
||||
$(DEVKITARM)/bin/bin2s $*.shbin | $(PREFIX)as -o $@
|
||||
rm $*.shbin
|
||||
|
||||
%.o: %.vsh
|
||||
$(DEVKITTOOLS)/bin/picasso $^ -o $*.shbin
|
||||
$(DEVKITTOOLS)/bin/bin2s $*.shbin | $(PREFIX)as -o $@
|
||||
$(DEVKITARM)/bin/picasso $^ -o $*.shbin
|
||||
$(DEVKITARM)/bin/bin2s $*.shbin | $(PREFIX)as -o $@
|
||||
rm $*.shbin
|
||||
|
||||
%.o: %.cpp
|
||||
@@ -274,8 +238,8 @@ endif
|
||||
|
||||
%.vsh:
|
||||
|
||||
$(TARGET).smdh: $(TARGET).elf $(APP_ICON)
|
||||
$(DEVKITTOOLS)/bin/smdhtool --create "$(APP_TITLE)" "$(APP_DESCRIPTION)" "$(APP_AUTHOR)" $(APP_ICON) $@
|
||||
$(TARGET).smdh: $(APP_ICON)
|
||||
$(DEVKITARM)/bin/smdhtool --create "$(APP_TITLE)" "$(APP_DESCRIPTION)" "$(APP_AUTHOR)" $(APP_ICON) $@
|
||||
|
||||
$(TARGET).3dsx: $(TARGET).elf
|
||||
ifeq ($(APP_BIG_TEXT_SECTION), 1)
|
||||
@@ -283,16 +247,16 @@ ifeq ($(APP_BIG_TEXT_SECTION), 1)
|
||||
else
|
||||
rm -f $(TARGET).xml
|
||||
endif
|
||||
$(DEVKITTOOLS)/bin/3dsxtool $< $@ $(_3DSXFLAGS)
|
||||
$(DEVKITARM)/bin/3dsxtool $< $@ $(_3DSXFLAGS)
|
||||
|
||||
$(TARGET).elf: ctr/3dsx_custom_crt0.o
|
||||
$(LD) $(LDFLAGS) $(OBJ) $(LIBDIRS) $(LIBS) -o $@
|
||||
$(NM) -CSn $@ > $(notdir $*.lst)
|
||||
|
||||
$(TARGET).bnr: $(TARGET).elf $(APP_BANNER) $(APP_AUDIO)
|
||||
$(TARGET).bnr: $(APP_BANNER) $(APP_AUDIO)
|
||||
$(BANNERTOOL) makebanner -i "$(APP_BANNER)" -a "$(APP_AUDIO)" -o $@
|
||||
|
||||
$(TARGET).icn: $(TARGET).elf $(APP_ICON)
|
||||
$(TARGET).icn: $(APP_ICON)
|
||||
$(BANNERTOOL) makesmdh -s "$(APP_TITLE)" -l "$(APP_TITLE)" -p "$(APP_AUTHOR)" -i $(APP_ICON) -o $@
|
||||
|
||||
$(TARGET).3ds: $(TARGET).elf $(TARGET).bnr $(TARGET).icn $(APP_RSF)
|
||||
|
||||
+10
-22
@@ -5,7 +5,6 @@ DEBUG = 0
|
||||
BUILD_3DSX = 1
|
||||
BUILD_3DS = 0
|
||||
BUILD_CIA = 1
|
||||
USE_CTRULIB_2 ?= 0
|
||||
|
||||
APP_TITLE = RetroArch 3DS
|
||||
APP_DESCRIPTION = RetroArch 3DS
|
||||
@@ -38,32 +37,21 @@ OBJ := ctr/ctr_system.o \
|
||||
libretro-common/file/config_file.o \
|
||||
libretro-common/streams/file_stream.o \
|
||||
libretro-common/vfs/vfs_implementation.o \
|
||||
libretro-common/hash/lrc_hash.o \
|
||||
libretro-common/time/rtime.o \
|
||||
libretro-common/hash/rhash.o \
|
||||
file_path_str.o \
|
||||
verbosity.o
|
||||
|
||||
OBJ += ctr/exec-3dsx/exec_cia.o \
|
||||
ctr/exec-3dsx/exec_3dsx.o \
|
||||
ctr/exec-3dsx/mini-hb-menu/launch.o \
|
||||
ctr/exec-3dsx/mini-hb-menu/loaders/rosalina.o \
|
||||
ctr/exec-3dsx/mini-hb-menu/loaders/hax2.o
|
||||
ctr/exec-3dsx/mini-hb-menu/loaders/hax2.o \
|
||||
ctr/exec-3dsx/mini-hb-menu/loaders/ninjhax1.o
|
||||
|
||||
ifeq ($(strip $(DEVKITPRO)),)
|
||||
$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=<path to>devkitpro")
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(USE_CTRULIB_2)),1)
|
||||
CFLAGS += -DUSE_CTRULIB_2
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(DEVKITTOOLS)),)
|
||||
ifeq ($(strip $(USE_CTRULIB_2)),1)
|
||||
DEVKITTOOLS = $(DEVKITPRO)/tools
|
||||
else
|
||||
DEVKITTOOLS = $(DEVKITARM)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(CTRULIB)),)
|
||||
CTRULIB = $(DEVKITPRO)/libctru
|
||||
endif
|
||||
@@ -165,13 +153,13 @@ else
|
||||
endif
|
||||
|
||||
%.o: %.vsh %.gsh
|
||||
$(DEVKITTOOLS)/bin/picasso $^ -o $*.shbin
|
||||
$(DEVKITTOOLS)/bin/bin2s $*.shbin | $(PREFIX)as -o $@
|
||||
$(DEVKITARM)/bin/picasso $^ -o $*.shbin
|
||||
$(DEVKITARM)/bin/bin2s $*.shbin | $(PREFIX)as -o $@
|
||||
rm $*.shbin
|
||||
|
||||
%.o: %.vsh
|
||||
$(DEVKITTOOLS)/bin/picasso $^ -o $*.shbin
|
||||
$(DEVKITTOOLS)/bin/bin2s $*.shbin | $(PREFIX)as -o $@
|
||||
$(DEVKITARM)/bin/picasso $^ -o $*.shbin
|
||||
$(DEVKITARM)/bin/bin2s $*.shbin | $(PREFIX)as -o $@
|
||||
rm $*.shbin
|
||||
|
||||
%.o: %.cpp
|
||||
@@ -192,7 +180,7 @@ endif
|
||||
%.vsh:
|
||||
|
||||
$(TARGET).smdh: $(APP_ICON)
|
||||
$(DEVKITTOOLS)/bin/smdhtool --create "$(APP_TITLE)" "$(APP_DESCRIPTION)" "$(APP_AUTHOR)" $(APP_ICON) $@
|
||||
$(DEVKITARM)/bin/smdhtool --create "$(APP_TITLE)" "$(APP_DESCRIPTION)" "$(APP_AUTHOR)" $(APP_ICON) $@
|
||||
|
||||
$(TARGET).3dsx: $(TARGET).elf
|
||||
ifeq ($(APP_BIG_TEXT_SECTION), 1)
|
||||
@@ -200,7 +188,7 @@ ifeq ($(APP_BIG_TEXT_SECTION), 1)
|
||||
else
|
||||
rm -f $(TARGET).xml
|
||||
endif
|
||||
$(DEVKITTOOLS)/bin/3dsxtool $< $@ $(_3DSXFLAGS)
|
||||
$(DEVKITARM)/bin/3dsxtool $< $@ $(_3DSXFLAGS)
|
||||
|
||||
$(TARGET).elf: ctr/3dsx_custom_crt0.o
|
||||
$(LD) $(LDFLAGS) $(OBJ) $(LIBDIRS) $(LIBS) -o $@
|
||||
|
||||
+27
-59
@@ -1,47 +1,13 @@
|
||||
#########################
|
||||
## Toolchain variables ##
|
||||
#########################
|
||||
|
||||
# Default toolchain directory
|
||||
TOOLCHAIN_DIR=/opt/gcw0-toolchain
|
||||
|
||||
# All toolchain-related variables may be
|
||||
# overridden via the command line
|
||||
ifdef GCW0_CC
|
||||
CC = $(GCW0_CC)
|
||||
else
|
||||
CC = $(TOOLCHAIN_DIR)/usr/bin/mipsel-gcw0-linux-uclibc-gcc
|
||||
endif
|
||||
|
||||
ifdef GCW0_CXX
|
||||
CXX = $(GCW0_CXX)
|
||||
else
|
||||
CXX = $(TOOLCHAIN_DIR)/usr/bin/mipsel-gcw0-linux-uclibc-g++
|
||||
endif
|
||||
|
||||
GCW0_SDL_CONFIG ?= $(TOOLCHAIN_DIR)/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/bin/sdl-config
|
||||
GCW0_FREETYPE_CONFIG ?= $(TOOLCHAIN_DIR)/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/bin/freetype-config
|
||||
GCW0_MK_SQUASH_FS ?= $(TOOLCHAIN_DIR)/usr/bin/mksquashfs
|
||||
|
||||
GCW0_INC_DIR ?= $(TOOLCHAIN_DIR)/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/include
|
||||
GCW0_LIB_DIR ?= $(TOOLCHAIN_DIR)/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/lib
|
||||
|
||||
#########################
|
||||
#########################
|
||||
|
||||
CC = /opt/gcw0-toolchain/usr/bin/mipsel-gcw0-linux-uclibc-gcc
|
||||
CXX = /opt/gcw0-toolchain/usr/bin/mipsel-gcw0-linux-uclibc-g++
|
||||
PACKAGE_NAME = retroarch
|
||||
|
||||
DEBUG ?= 0
|
||||
|
||||
DINGUX = 1
|
||||
HAVE_SCREENSHOTS = 1
|
||||
HAVE_REWIND = 1
|
||||
HAVE_7ZIP = 1
|
||||
HAVE_AL = 1
|
||||
# this freezes when switching back from menu
|
||||
HAVE_ALSA = 0
|
||||
HAVE_DSP_FILTER = 1
|
||||
HAVE_VIDEO_FILTER = 1
|
||||
HAVE_BUILTINMBEDTLS = 1
|
||||
HAVE_BUILTINZLIB = 1
|
||||
HAVE_C99 = 1
|
||||
@@ -49,7 +15,7 @@ HAVE_CC = 1
|
||||
HAVE_CC_RESAMPLER = 1
|
||||
HAVE_CHD = 1
|
||||
HAVE_CHEEVOS = 1
|
||||
HAVE_COMMAND = 0
|
||||
HAVE_COMMAND = 1
|
||||
HAVE_CXX = 1
|
||||
HAVE_DR_MP3 = 1
|
||||
HAVE_DYNAMIC = 1
|
||||
@@ -87,7 +53,7 @@ HAVE_SHADERPIPELINE = 1
|
||||
HAVE_STB_FONT = 1
|
||||
HAVE_STB_IMAGE = 1
|
||||
HAVE_STB_VORBIS = 1
|
||||
HAVE_STDIN_CMD = 0
|
||||
HAVE_STDIN_CMD = 1
|
||||
HAVE_STRCASESTR = 1
|
||||
HAVE_THREADS = 1
|
||||
HAVE_TRANSLATE = 1
|
||||
@@ -96,9 +62,6 @@ HAVE_VIDEO_LAYOUT = 1
|
||||
HAVE_XMB = 1
|
||||
HAVE_ZLIB = 1
|
||||
HAVE_CONFIGFILE = 1
|
||||
HAVE_PATCH = 1
|
||||
HAVE_CHEATS = 1
|
||||
HAVE_LIBSHAKE = 1
|
||||
|
||||
OS = Linux
|
||||
TARGET = retroarch
|
||||
@@ -106,9 +69,7 @@ OPK_NAME = retroarch.opk
|
||||
|
||||
OBJ :=
|
||||
LINK := $(CXX)
|
||||
DEF_FLAGS := -march=mips32 -mtune=mips32r2 -mhard-float -ffast-math -fomit-frame-pointer
|
||||
DEF_FLAGS += -mplt -mno-shared
|
||||
DEF_FLAGS += -ffunction-sections -fdata-sections
|
||||
DEF_FLAGS := -march=mips32 -mtune=mips32r2 -mhard-float -ffast-math -fomit-frame-pointer -fdata-sections
|
||||
DEF_FLAGS += -I. -Ideps -Ideps/stb -DDINGUX=1 -MMD
|
||||
DEF_FLAGS += -Wall -Wno-unused-variable
|
||||
DEF_FLAGS += -std=gnu99 -D_GNU_SOURCE
|
||||
@@ -116,9 +77,9 @@ LIBS := -ldl -lz -lrt -lcrypto -lssl -ludev -pthread
|
||||
CFLAGS :=
|
||||
CXXFLAGS := -fno-exceptions -fno-rtti -std=c++11 -D__STDC_CONSTANT_MACROS
|
||||
ASFLAGS :=
|
||||
LDFLAGS := -flto -Wl,--gc-sections
|
||||
INCLUDE_DIRS = -I$(GCW0_INC_DIR)
|
||||
LIBRARY_DIRS = -L$(GCW0_LIB_DIR)
|
||||
LDFLAGS := -flto
|
||||
INCLUDE_DIRS = -I/opt/gcw0-toolchain/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/include
|
||||
LIBRARY_DIRS = -L/opt/gcw0-toolchain/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/lib
|
||||
DEFINES := -DRARCH_INTERNAL -D_FILE_OFFSET_BITS=64 -UHAVE_STATIC_DUMMY
|
||||
DEFINES += -DHAVE_C99=1 -DHAVE_CXX=1 -DHAVE_OPENDINGUX_FBDEV=1
|
||||
DEFINES += -DHAVE_GETOPT_LONG=1 -DHAVE_STRCASESTR=1 -DHAVE_DYNAMIC=1
|
||||
@@ -127,10 +88,10 @@ DEFINES += -DHAVE_ONLINE_UPDATER=1
|
||||
DEFINES += -DHAVE_UPDATE_ASSETS=1
|
||||
DEFINES += -DHAVE_UDEV=1
|
||||
|
||||
SDL_DINGUX_CFLAGS := $(shell $(GCW0_SDL_CONFIG) --cflags)
|
||||
SDL_DINGUX_LIBS := $(shell $(GCW0_SDL_CONFIG) --libs)
|
||||
FREETYPE_CFLAGS := $(shell $(GCW0_FREETYPE_CONFIG) --cflags)
|
||||
FREETYPE_LIBS := $(shell $(GCW0_FREETYPE_CONFIG) --libs)
|
||||
SDL_DINGUX_CFLAGS := $(shell /opt/gcw0-toolchain/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/bin/sdl-config --cflags)
|
||||
SDL_DINGUX_LIBS := $(shell /opt/gcw0-toolchain/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/bin/sdl-config --libs)
|
||||
FREETYPE_CFLAGS := $(shell /opt/gcw0-toolchain/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/bin/freetype-config --cflags)
|
||||
FREETYPE_LIBS := $(shell /opt/gcw0-toolchain/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/bin/freetype-config --libs)
|
||||
AL_LIBS := -lopenal
|
||||
OPENGLES_CFLAGS := -DMESA_EGL_NO_X11_HEADERS
|
||||
OPENGLES_LIBS := -lGLESv2 -lEGL
|
||||
@@ -160,8 +121,8 @@ RARCH_OBJ := $(addprefix $(OBJDIR)/,$(OBJ))
|
||||
|
||||
define DESKTOP_ENTRY
|
||||
[Desktop Entry]
|
||||
Name=RetroArch
|
||||
Comment=Frontend for emulators, game engines
|
||||
Name=retroarch
|
||||
Comment=Retroarch
|
||||
Exec=retroarch
|
||||
Terminal=false
|
||||
Type=Application
|
||||
@@ -180,27 +141,34 @@ SYMBOL_MAP := -Wl,-Map=output.map
|
||||
|
||||
$(TARGET): $(RARCH_OBJ)
|
||||
@$(if $(Q), $(shell echo echo LD $@),)
|
||||
$(Q)$(LINK) -o $@ $(RARCH_OBJ) $(LIBS) $(LDFLAGS) $(LIBRARY_DIRS)
|
||||
$(LINK) -o $@ $(RARCH_OBJ) $(LIBS) $(LDFLAGS) $(LIBRARY_DIRS)
|
||||
|
||||
$(OBJDIR)/%.o: %.c
|
||||
@mkdir -p $(dir $@)
|
||||
@$(if $(Q), $(shell echo echo CC $<),)
|
||||
$(Q)$(CC) $(CPPFLAGS) $(CFLAGS) $(DEFINES) -c -o $@ $<
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(DEFINES) -c -o $@ $<
|
||||
|
||||
$(OBJDIR)/%.o: %.cpp
|
||||
@mkdir -p $(dir $@)
|
||||
@$(if $(Q), $(shell echo echo CXX $<),)
|
||||
$(Q)$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) -MMD -c -o $@ $<
|
||||
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) -MMD -c -o $@ $<
|
||||
|
||||
$(OBJDIR)/%.o: %.m
|
||||
@mkdir -p $(dir $@)
|
||||
@$(if $(Q), $(shell echo echo OBJC $<),)
|
||||
$(Q)$(CXX) $(OBJCFLAGS) $(DEFINES) -MMD -c -o $@ $<
|
||||
$(CXX) $(OBJCFLAGS) $(DEFINES) -MMD -c -o $@ $<
|
||||
|
||||
.FORCE:
|
||||
|
||||
$(OBJDIR)/git_version.o: git_version.c .FORCE
|
||||
@mkdir -p $(dir $@)
|
||||
@$(if $(Q), $(shell echo echo CC $<),)
|
||||
$(CC) $(CFLAGS) $(DEFINES) -MMD -c -o $@ $<
|
||||
|
||||
$(OBJDIR)/%.o: %.S $(HEADERS)
|
||||
@mkdir -p $(dir $@)
|
||||
@$(if $(Q), $(shell echo echo AS $<),)
|
||||
$(Q)$(CC) $(CFLAGS) $(ASFLAGS) $(DEFINES) -c -o $@ $<
|
||||
$(CC) $(CFLAGS) $(ASFLAGS) $(DEFINES) -c -o $@ $<
|
||||
|
||||
clean:
|
||||
rm -rf $(OBJDIR_BASE)
|
||||
@@ -212,7 +180,7 @@ opk: $(TARGET)
|
||||
echo "$$DESKTOP_ENTRY" > default.gcw0.desktop
|
||||
rm -f $(OPK_NAME)
|
||||
cp media/ico_src/icon32.png retroarch.png
|
||||
$(GCW0_MK_SQUASH_FS) retroarch default.gcw0.desktop retroarch.png $(OPK_NAME) -all-root -no-xattrs -noappend -no-exports
|
||||
mksquashfs retroarch default.gcw0.desktop retroarch.png $(OPK_NAME) -all-root -no-xattrs -noappend -no-exports
|
||||
rm -f default.gcw0.desktop retroarch.png
|
||||
|
||||
.PHONY: all clean opk
|
||||
|
||||
+1
-23
@@ -1,10 +1,4 @@
|
||||
ifeq ($(TARGET),)
|
||||
ifeq ($(LIBRETRO),)
|
||||
TARGET := retroarch.js
|
||||
else
|
||||
TARGET := $(LIBRETRO)_libretro.js
|
||||
endif
|
||||
endif
|
||||
|
||||
EOPT = USE_ZLIB=1 # Emscripten specific options
|
||||
EOPTS = $(addprefix -s $(EMPTY), $(EOPT)) # Add '-s ' to each option
|
||||
@@ -15,12 +9,8 @@ OBJ :=
|
||||
DEFINES := -DRARCH_INTERNAL -DHAVE_MAIN -s USE_PTHREADS=$(PTHREAD)
|
||||
DEFINES += -DHAVE_FILTERS_BUILTIN
|
||||
|
||||
HAVE_DSP_FILTER = 1
|
||||
HAVE_VIDEO_FILTER = 1
|
||||
HAVE_OVERLAY = 1
|
||||
HAVE_GLSL = 1
|
||||
HAVE_SCREENSHOTS = 1
|
||||
HAVE_REWIND = 1
|
||||
HAVE_AUDIOMIXER = 1
|
||||
HAVE_VIDEO_LAYOUT = 0
|
||||
HAVE_CC_RESAMPLER = 1
|
||||
@@ -40,20 +30,8 @@ HAVE_STATIC_VIDEO_FILTERS = 1
|
||||
HAVE_STATIC_AUDIO_FILTERS = 1
|
||||
HAVE_STB_FONT = 1
|
||||
HAVE_CONFIGFILE = 1
|
||||
HAVE_CHEATS = 1
|
||||
HAVE_IBXM = 1
|
||||
|
||||
ASYNC ?= 0
|
||||
ifeq ($(LIBRETRO), mupen64plus)
|
||||
ASYNC = 1
|
||||
endif
|
||||
|
||||
LTO ?= 0
|
||||
ifeq ($(LIBRETRO), tyrquake)
|
||||
LTO = 0
|
||||
endif
|
||||
|
||||
MEMORY ?= 134217728
|
||||
MEMORY = 134217728
|
||||
|
||||
PRECISE_F32 = 1
|
||||
|
||||
|
||||
+27
-197
@@ -116,8 +116,7 @@ else ifeq ($(platform), ps3-cobra)
|
||||
|
||||
# NGC/Wii - libogc
|
||||
else ifeq ($(libogc_platform), 1)
|
||||
EXTERNAL_LIBOGC ?= 0
|
||||
GX_PTHREAD_LEGACY ?= 1
|
||||
EXTERNAL_LIBOGC=0
|
||||
CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT)
|
||||
CXX = $(DEVKITPPC)/bin/powerpc-eabi-g++$(EXE_EXT)
|
||||
LD = $(DEVKITPPC)/bin/powerpc-eabi-ld$(EXE_EXT)
|
||||
@@ -149,11 +148,6 @@ else ifeq ($(libogc_platform), 1)
|
||||
|
||||
endif
|
||||
|
||||
ifeq ($(GX_PTHREAD_LEGACY), 1)
|
||||
CFLAGS += -DGX_PTHREAD_LEGACY
|
||||
CXXFLAGS += -DGX_PTHREAD_LEGACY
|
||||
endif
|
||||
|
||||
ifeq ($(platform), ngc)
|
||||
MACHDEP := -DHW_DOL -mogc
|
||||
else ifeq ($(platform), wii)
|
||||
@@ -161,7 +155,7 @@ else ifeq ($(libogc_platform), 1)
|
||||
endif
|
||||
|
||||
LIBDIRS += -L.
|
||||
MACHDEP += -DGEKKO -mcpu=750 -meabi -mhard-float
|
||||
MACHDEP += -DGEKKO -mcpu=750 -meabi -mhard-float -DMSB_FIRST
|
||||
|
||||
ifeq ($(platform), ngc)
|
||||
LDFLAGS += $(MACHDEP) -Wl,-Map,$(notdir $(EXT_INTER_TARGET)).map
|
||||
@@ -197,9 +191,8 @@ else ifeq ($(libogc_platform), 1)
|
||||
|
||||
CFLAGS += -DGEKKO -U__INT32_TYPE__ -U __UINT32_TYPE__ -D__INT32_TYPE__=int
|
||||
|
||||
HAVE_AUDIOMIXER := 1
|
||||
HAVE_RUNAHEAD := 1
|
||||
HAVE_DSP_FILTER := 1
|
||||
HAVE_VIDEO_FILTER := 1
|
||||
HAVE_FILTERS_BUILTIN := 1
|
||||
HAVE_THREADS := 1
|
||||
HAVE_RPNG := 1
|
||||
@@ -211,16 +204,11 @@ else ifeq ($(libogc_platform), 1)
|
||||
HAVE_VIDEO_LAYOUT := 0
|
||||
HAVE_ZLIB := 1
|
||||
HAVE_7ZIP := 1
|
||||
HAVE_CONFIGFILE := 1
|
||||
HAVE_PATCH := 1
|
||||
HAVE_CHEATS := 1
|
||||
HAVE_SCREENSHOTS := 1
|
||||
HAVE_REWIND := 1
|
||||
HAVE_AUDIOMIXER := 1
|
||||
HAVE_RWAV := 1
|
||||
HAVE_CONFIGFILE := 1
|
||||
RARCH_CONSOLE = 1
|
||||
|
||||
ifeq ($(platform), wii)
|
||||
HAVE_AUDIOMIXER := 1
|
||||
#HAVE_LANGEXTRA := 1
|
||||
HAVE_WIIUSB_HID := 1
|
||||
HAVE_RARCH_EXEC := 1
|
||||
@@ -256,9 +244,7 @@ else ifeq ($(platform), xenon360)
|
||||
HAVE_THREADS := 1
|
||||
HAVE_GETOPT_LONG := 1
|
||||
RARCH_CONSOLE = 1
|
||||
HAVE_CONFIGFILE := 1
|
||||
HAVE_PATCH := 1
|
||||
HAVE_CHEATS := 1
|
||||
HAVE_CONFIGFILE := 1
|
||||
|
||||
# PSP
|
||||
else ifeq ($(platform), psp1)
|
||||
@@ -283,9 +269,7 @@ else ifeq ($(platform), psp1)
|
||||
HAVE_KERNEL_PRX := 1
|
||||
#HAVE_LANGEXTRA := 1
|
||||
RARCH_CONSOLE = 1
|
||||
HAVE_CONFIGFILE := 1
|
||||
HAVE_PATCH := 1
|
||||
HAVE_CHEATS := 1
|
||||
HAVE_CONFIGFILE := 1
|
||||
|
||||
ifeq ($(BUILD_PRX), 1)
|
||||
LDFLAGS += $(addprefix -L,$(PSPSDK)/lib) -specs=$(PSPSDK)/lib/prxspecs -Wl,-q,-T$(PSPSDK)/lib/linkfile.prx $(LDFLAGS)
|
||||
@@ -325,8 +309,6 @@ else ifeq ($(platform), vita)
|
||||
LIBDIRS += -L.
|
||||
LDFLAGS += -Wl,-q
|
||||
|
||||
HAVE_DSP_FILTER := 1
|
||||
HAVE_VIDEO_FILTER := 1
|
||||
HAVE_FILTERS_BUILTIN := 1
|
||||
HAVE_LANGEXTRA := 1
|
||||
HAVE_RPNG := 1
|
||||
@@ -345,9 +327,7 @@ else ifeq ($(platform), vita)
|
||||
HAVE_THREADS := 1
|
||||
HAVE_LIBRETRODB := 1
|
||||
RARCH_CONSOLE = 1
|
||||
HAVE_CONFIGFILE := 1
|
||||
HAVE_PATCH := 1
|
||||
HAVE_CHEATS := 1
|
||||
HAVE_CONFIGFILE := 1
|
||||
else ifeq ($(platform), windows_msvc6_x86)
|
||||
HAVE_RPNG := 1
|
||||
HAVE_RJPEG := 1
|
||||
@@ -371,9 +351,7 @@ else ifeq ($(platform), windows_msvc6_x86)
|
||||
HAVE_DYLIB := 1
|
||||
HAVE_DYNAMIC := 1
|
||||
HAVE_GRIFFIN_CPP := 1
|
||||
HAVE_CONFIGFILE := 1
|
||||
HAVE_PATCH := 1
|
||||
HAVE_CHEATS := 1
|
||||
HAVE_CONFIGFILE := 1
|
||||
|
||||
EXT_TARGET := $(TARGET_NAME).exe
|
||||
EXT_INTER_TARGET := $(TARGET_NAME).exe
|
||||
@@ -417,10 +395,7 @@ else ifeq ($(platform), windows_msvc2003_x86)
|
||||
HAVE_DYLIB := 1
|
||||
HAVE_DYNAMIC := 1
|
||||
HAVE_GRIFFIN_CPP := 1
|
||||
HAVE_CONFIGFILE := 1
|
||||
HAVE_PATCH := 1
|
||||
HAVE_CHEATS := 1
|
||||
HAVE_GFX_WIDGETS := 1
|
||||
HAVE_CONFIGFILE := 1
|
||||
|
||||
EXT_TARGET := $(TARGET_NAME).exe
|
||||
EXT_INTER_TARGET := $(TARGET_NAME).exe
|
||||
@@ -429,7 +404,6 @@ else ifeq ($(platform), windows_msvc2003_x86)
|
||||
LD = link.exe
|
||||
|
||||
PLATCFLAGS += -D_WIN32 -DWINVER=0x0400 -D_WIN32_WINNT=0x0400 -D__STDC_CONSTANT_MACROS -D_MBCS -D_VC80_UPGRADE=0x0710
|
||||
PLATCFLAGS += -DHAVE_GFX_WIDGETS
|
||||
LDFLAGS += shell32.lib user32.lib gdi32.lib comdlg32.lib winmm.lib ole32.lib
|
||||
|
||||
PATH := $(shell IFS=$$'\n'; cygpath "$(VS71COMNTOOLS)../../Vc7/bin"):$(PATH)
|
||||
@@ -448,7 +422,6 @@ else ifeq ($(platform), windows_msvc2003_x86)
|
||||
endif
|
||||
else ifeq ($(platform), windows_msvc2005_x86)
|
||||
HAVE_GDI := 1
|
||||
HAVE_REWIND := 1
|
||||
HAVE_RPNG := 1
|
||||
HAVE_RJPEG := 1
|
||||
HAVE_RBMP := 1
|
||||
@@ -462,7 +435,6 @@ else ifeq ($(platform), windows_msvc2005_x86)
|
||||
HAVE_VIDEO_LAYOUT := 0
|
||||
HAVE_MATERIALUI := 1
|
||||
HAVE_XMB := 1
|
||||
HAVE_OZONE := 1
|
||||
HAVE_STB_FONT := 1
|
||||
HAVE_THREADS := 1
|
||||
HAVE_LIBRETRODB := 1
|
||||
@@ -472,17 +444,8 @@ else ifeq ($(platform), windows_msvc2005_x86)
|
||||
HAVE_DYLIB := 1
|
||||
HAVE_DYNAMIC := 1
|
||||
HAVE_GRIFFIN_CPP := 1
|
||||
HAVE_RUNAHEAD := 1
|
||||
HAVE_DIRECTX ?= 1
|
||||
HAVE_OPENGL := 1
|
||||
HAVE_OPENGL1 := 1
|
||||
HAVE_CONFIGFILE := 1
|
||||
HAVE_PATCH := 1
|
||||
HAVE_CHEATS := 1
|
||||
HAVE_DSP_FILTER := 1
|
||||
HAVE_VIDEO_FILTER := 1
|
||||
HAVE_FILTERS_BUILTIN := 1
|
||||
HAVE_GFX_WIDGETS := 1
|
||||
HAVE_CONFIGFILE := 1
|
||||
|
||||
EXT_TARGET := $(TARGET_NAME).exe
|
||||
EXT_INTER_TARGET := $(TARGET_NAME).exe
|
||||
@@ -490,32 +453,16 @@ else ifeq ($(platform), windows_msvc2005_x86)
|
||||
CXX = cl.exe
|
||||
LD = link.exe
|
||||
|
||||
PLATCFLAGS += -D_WIN32 -D_WIN32_WINNT=0x0410 -D__STDC_CONSTANT_MACROS -D_MBCS -D__SSE__
|
||||
PLATCFLAGS += -DHAVE_OPENGL -DHAVE_OPENGL1 -DHAVE_GLSL -DHAVE_OZONE -DHAVE_GFX_WIDGETS -DHAVE_CC_RESAMPLER
|
||||
PLATCFLAGS += -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_ASSETS -DHAVE_UPDATE_CORES -DHAVE_CDROM
|
||||
PLATCFLAGS += -bigobj
|
||||
|
||||
LDFLAGS += -MANIFEST shell32.lib user32.lib gdi32.lib comdlg32.lib winmm.lib ole32.lib msimg32.lib
|
||||
PLATCFLAGS += -D_WIN32 -D_WIN32_WINNT=0x0410 -D__STDC_CONSTANT_MACROS -D_MBCS -D__MMX__ -D__SSE__ -DHAVE_OPENGL -DHAVE_OPENGL1 -DHAVE_GLSL -DHAVE_SHADERPIPELINE -DHAVE_OZONE
|
||||
LDFLAGS += shell32.lib user32.lib gdi32.lib comdlg32.lib winmm.lib ole32.lib msimg32.lib
|
||||
|
||||
PATH := $(shell IFS=$$'\n'; cygpath "$(VS80COMNTOOLS)../../VC/bin"):$(PATH)
|
||||
PATH := $(PATH):$(shell IFS=$$'\n'; cygpath "$(VS80COMNTOOLS)../IDE")
|
||||
INCLUDE := $(shell IFS=$$'\n'; cygpath -w "$(VS80COMNTOOLS)../../VC/include")
|
||||
LIB := $(shell IFS=$$'\n'; cygpath -w "$(VS80COMNTOOLS)../../VC/lib")
|
||||
|
||||
WindowsSdkDir := $(shell reg query "HKLM\SOFTWARE\Microsoft\MicrosoftSDK\InstalledSDKs\8F9E5EF3-A9A5-491B-A889-C58EFFECE8B3" -v "Install Dir" | grep -o '[A-Z]:\\.*')
|
||||
|
||||
WindowsSDKIncludeDir := $(shell cygpath -w "$(WindowsSdkDir)\Include")
|
||||
WindowsSDKAtlIncludeDir := $(shell cygpath -w "$(WindowsSdkDir)\Include\atl")
|
||||
WindowsSDKCrtIncludeDir := $(shell cygpath -w "$(WindowsSdkDir)\Include\crt")
|
||||
WindowsSDKGlIncludeDir := $(shell cygpath -w "$(WindowsSdkDir)\Include\gl")
|
||||
WindowsSDKMfcIncludeDir := $(shell cygpath -w "$(WindowsSdkDir)\Include\mfc")
|
||||
WindowsSDKLibDir := $(shell cygpath -w "$(WindowsSdkDir)\Lib")
|
||||
|
||||
INCLUDE := $(INCLUDE);$(WindowsSDKIncludeDir);$(WindowsSDKAtlIncludeDir);$(WindowsSDKCrtIncludeDir);$(WindowsSDKGlIncludeDir);$(WindowsSDKMfcIncludeDir);libretro/msvc/msvc-2005
|
||||
LIB := $(LIB);$(WindowsSDKLibDir)
|
||||
|
||||
ifeq ($(HAVE_DIRECTX), 1)
|
||||
PLATCFLAGS += -DHAVE_DINPUT -DHAVE_DSOUND -DHAVE_D3D -DHAVE_D3D8
|
||||
PLATCFLAGS += -DHAVE_DINPUT -DHAVE_DSOUND
|
||||
DXSDK_DIR := $(DXSDK_DIR:\=)
|
||||
export INCLUDE := $(INCLUDE);$(INETSDK)\Include;$(DXSDK_DIR)\Include;libretro-common\include;libretro-common\include\compat\msvc;gfx\include;deps;deps\stb
|
||||
export LIB := $(LIB);$(INETSDK)\Lib;$(DXSDK_DIR)\Lib\x86
|
||||
@@ -525,10 +472,7 @@ else ifeq ($(platform), windows_msvc2005_x86)
|
||||
endif
|
||||
else ifneq (,$(findstring windows_msvc2010,$(platform)))
|
||||
HAVE_GDI := 1
|
||||
HAVE_SCREENSHOTS := 1
|
||||
HAVE_REWIND := 1
|
||||
HAVE_AUDIOMIXER := 1
|
||||
HAVE_RWAV := 1
|
||||
HAVE_RPNG := 1
|
||||
HAVE_RJPEG := 1
|
||||
HAVE_RBMP := 1
|
||||
@@ -542,7 +486,6 @@ else ifneq (,$(findstring windows_msvc2010,$(platform)))
|
||||
HAVE_VIDEO_LAYOUT := 0
|
||||
HAVE_MATERIALUI := 1
|
||||
HAVE_XMB := 1
|
||||
HAVE_OZONE := 1
|
||||
HAVE_STB_FONT := 1
|
||||
HAVE_THREADS := 1
|
||||
HAVE_LIBRETRODB := 1
|
||||
@@ -554,15 +497,7 @@ else ifneq (,$(findstring windows_msvc2010,$(platform)))
|
||||
HAVE_GRIFFIN_CPP := 1
|
||||
HAVE_RUNAHEAD := 1
|
||||
HAVE_DIRECTX ?= 1
|
||||
HAVE_OPENGL := 1
|
||||
HAVE_OPENGL1 := 1
|
||||
HAVE_CONFIGFILE := 1
|
||||
HAVE_PATCH := 1
|
||||
HAVE_CHEATS := 1
|
||||
HAVE_DSP_FILTER := 1
|
||||
HAVE_VIDEO_FILTER := 1
|
||||
HAVE_FILTERS_BUILTIN := 1
|
||||
HAVE_GFX_WIDGETS := 1
|
||||
HAVE_CONFIGFILE := 1
|
||||
|
||||
EXT_TARGET := $(TARGET_NAME).exe
|
||||
EXT_INTER_TARGET := $(TARGET_NAME).exe
|
||||
@@ -571,14 +506,8 @@ else ifneq (,$(findstring windows_msvc2010,$(platform)))
|
||||
LD = link.exe
|
||||
|
||||
PLATCFLAGS += -D_WIN32 -D__STDC_CONSTANT_MACROS -D_MBCS
|
||||
PLATCFLAGS += -D__i686__ -D__SSE__ -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WINDOWS
|
||||
PLATCFLAGS += -DHAVE_CC_RESAMPLER -DHAVE_GL_SYNC -DHAVE_GLSL -DHAVE_IMAGEVIEWER -DHAVE_LANGEXTRA
|
||||
PLATCFLAGS += -DHAVE_OPENGL -DHAVE_OPENGL1 -DHAVE_OZONE
|
||||
PLATCFLAGS += -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_ASSETS -DHAVE_UPDATE_CORES -DWIN32 -DHAVE_CDROM
|
||||
PLATCFLAGS += -DHAVE_GFX_WIDGETS
|
||||
PLATCFLAGS += -bigobj
|
||||
|
||||
LDFLAGS += -MANIFEST shell32.lib user32.lib gdi32.lib comdlg32.lib winmm.lib ole32.lib iphlpapi.lib msimg32.lib
|
||||
PLATCFLAGS += -D__i686__ -D__MMX__ -D__SSE__ -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WINDOWS -DHAVE_CC_RESAMPLER -DHAVE_GL_SYNC -DHAVE_GLSL -DHAVE_IMAGEVIEWER -DHAVE_LANGEXTRA -DHAVE_OPENGL -DHAVE_SHADERPIPELINE -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_ASSETS -DHAVE_UPDATE_CORES -DWIN32 -DHAVE_CDROM
|
||||
LDFLAGS += shell32.lib user32.lib gdi32.lib comdlg32.lib winmm.lib ole32.lib iphlpapi.lib msimg32.lib
|
||||
|
||||
PlatformSuffix = $(subst windows_msvc2010_,,$(platform))
|
||||
|
||||
@@ -603,12 +532,12 @@ else ifneq (,$(findstring windows_msvc2010,$(platform)))
|
||||
PATH := $(PATH):$(shell IFS=$$'\n'; cygpath "$(VS100COMNTOOLS)../IDE")
|
||||
INCLUDE := $(shell IFS=$$'\n'; cygpath -w "$(VS100COMNTOOLS)../../VC/include")
|
||||
|
||||
WindowsSdkDir ?= $(shell reg query "HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.1A" -v "InstallationFolder" | grep -io '[A-Z]:\\.*')
|
||||
WindowsSdkDir ?= $(shell reg query "HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A" -v "InstallationFolder" | grep -io '[A-Z]:\\.*')
|
||||
WindowsSdkDir ?= $(shell reg query "HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.1A" -v "InstallationFolder" | grep -io '[A-Z]:\\.*')
|
||||
WindowsSdkDir := $(WindowsSdkDir:\=)
|
||||
|
||||
ifeq ($(HAVE_DIRECTX), 1)
|
||||
PLATCFLAGS += -DHAVE_DINPUT -DHAVE_DSOUND -DHAVE_D3D -DHAVE_D3D8 -DHAVE_XAUDIO -DHAVE_XINPUT
|
||||
PLATCFLAGS += -DHAVE_DINPUT -DHAVE_DSOUND -DHAVE_D3D -DHAVE_D3D9 -DHAVE_XAUDIO -DHAVE_XINPUT
|
||||
DXSDK_DIR := $(DXSDK_DIR:\=)
|
||||
export INCLUDE := $(INCLUDE);$(WindowsSdkDir)\Include;$(DXSDK_DIR)\Include;libretro-common\include;libretro-common\include\compat\msvc;gfx\include;deps;deps\stb
|
||||
export LIB := $(LIB);$(WindowsSdkDir)\$(PlatLib);$(DXSDK_DIR)\Lib\$(WinArch)
|
||||
@@ -618,10 +547,7 @@ else ifneq (,$(findstring windows_msvc2010,$(platform)))
|
||||
endif
|
||||
else ifneq (,$(findstring windows_msvc2012,$(platform)))
|
||||
HAVE_GDI := 1
|
||||
HAVE_SCREENSHOTS := 1
|
||||
HAVE_REWIND := 1
|
||||
HAVE_AUDIOMIXER := 1
|
||||
HAVE_RWAV := 1
|
||||
HAVE_RPNG := 1
|
||||
HAVE_RJPEG := 1
|
||||
HAVE_RBMP := 1
|
||||
@@ -646,9 +572,7 @@ else ifneq (,$(findstring windows_msvc2012,$(platform)))
|
||||
HAVE_GRIFFIN_CPP := 1
|
||||
HAVE_RUNAHEAD := 1
|
||||
HAVE_DIRECTX ?= 1
|
||||
HAVE_CONFIGFILE := 1
|
||||
HAVE_PATCH := 1
|
||||
HAVE_CHEATS := 1
|
||||
HAVE_CONFIGFILE := 1
|
||||
|
||||
EXT_TARGET := $(TARGET_NAME).exe
|
||||
EXT_INTER_TARGET := $(TARGET_NAME).exe
|
||||
@@ -702,10 +626,7 @@ else ifneq (,$(findstring windows_msvc2012,$(platform)))
|
||||
endif
|
||||
else ifneq (,$(findstring windows_msvc2013,$(platform)))
|
||||
HAVE_GDI := 1
|
||||
HAVE_SCREENSHOTS := 1
|
||||
HAVE_REWIND := 1
|
||||
HAVE_AUDIOMIXER := 1
|
||||
HAVE_RWAV := 1
|
||||
HAVE_RPNG := 1
|
||||
HAVE_RJPEG := 1
|
||||
HAVE_RBMP := 1
|
||||
@@ -730,9 +651,7 @@ else ifneq (,$(findstring windows_msvc2013,$(platform)))
|
||||
HAVE_GRIFFIN_CPP := 1
|
||||
HAVE_RUNAHEAD := 1
|
||||
HAVE_DIRECTX ?= 1
|
||||
HAVE_CONFIGFILE := 1
|
||||
HAVE_PATCH := 1
|
||||
HAVE_CHEATS := 1
|
||||
HAVE_CONFIGFILE := 1
|
||||
|
||||
EXT_TARGET := $(TARGET_NAME).exe
|
||||
EXT_INTER_TARGET := $(TARGET_NAME).exe
|
||||
@@ -786,10 +705,7 @@ else ifneq (,$(findstring windows_msvc2013,$(platform)))
|
||||
endif
|
||||
else ifneq (,$(findstring windows_msvc2015,$(platform)))
|
||||
HAVE_GDI := 1
|
||||
HAVE_SCREENSHOTS := 1
|
||||
HAVE_REWIND := 1
|
||||
HAVE_AUDIOMIXER := 1
|
||||
HAVE_RWAV := 1
|
||||
HAVE_RPNG := 1
|
||||
HAVE_RJPEG := 1
|
||||
HAVE_RBMP := 1
|
||||
@@ -814,9 +730,7 @@ else ifneq (,$(findstring windows_msvc2015,$(platform)))
|
||||
HAVE_GRIFFIN_CPP := 1
|
||||
HAVE_RUNAHEAD := 1
|
||||
HAVE_DIRECTX ?= 1
|
||||
HAVE_CONFIGFILE := 1
|
||||
HAVE_PATCH := 1
|
||||
HAVE_CHEATS := 1
|
||||
HAVE_CONFIGFILE := 1
|
||||
|
||||
EXT_TARGET := $(TARGET_NAME).exe
|
||||
EXT_INTER_TARGET := $(TARGET_NAME).exe
|
||||
@@ -885,10 +799,7 @@ else ifneq (,$(findstring windows_msvc2015,$(platform)))
|
||||
export LIB := $(LIB)
|
||||
endif
|
||||
else ifeq (qnx,$(platform))
|
||||
HAVE_SCREENSHOTS := 1
|
||||
HAVE_REWIND := 1
|
||||
HAVE_AUDIOMIXER := 1
|
||||
HAVE_RWAV := 1
|
||||
HAVE_RPNG := 1
|
||||
HAVE_RJPEG := 1
|
||||
HAVE_RBMP := 1
|
||||
@@ -912,10 +823,7 @@ else ifeq (qnx,$(platform))
|
||||
HAVE_DYNAMIC := 1
|
||||
HAVE_GRIFFIN_CPP := 0
|
||||
WANT_GLSLANG := 0
|
||||
HAVE_CONFIGFILE := 1
|
||||
HAVE_PATCH := 1
|
||||
HAVE_CHEATS := 1
|
||||
|
||||
HAVE_CONFIGFILE := 1
|
||||
CC=qcc -Vgcc_ntoarmv7le
|
||||
CXX=QCC -Vgcc_ntoarmv7le
|
||||
|
||||
@@ -923,16 +831,13 @@ else ifeq (qnx,$(platform))
|
||||
LDFLAGS += -g
|
||||
endif
|
||||
|
||||
PLATCFLAGS += -DHAVE_SHADERPIPELINE -DHAVE_OPENGL -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DHAVE_OZONE -DHAVE_CC_RESAMPLER -DHAVE_CHEEVOS -DRC_DISABLE_LUA -DHAVE_FBO -DHAVE_GL_SYNC -DHAVE_GLSLANG -DHAVE_BUILTINGLSLANG -DHAVE_IMAGEVIEWER -DHAVE_LANGEXTRA -DHAVE_RUNAHEAD -DHAVE_GFX_WIDGETS -DHAVE_CONFIGFILE -DHAVE_PATCH -DHAVE_SPIRV_CROSS -DHAVE_STB_FONT -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_ASSETS -DHAVE_UPDATE_CORES -DHAVE_XMB -DRARCH_INTERNAL -DWANT_GLSLANG -DHAVE_XCB -DHAVE_EGL -DHAVE_BB10 -DHAVE_GLSL -DHAVE_AL -DHAVE_BSV_MOVIE -DRARCH_MOBILE
|
||||
PLATCFLAGS += -DHAVE_SHADERPIPELINE -DHAVE_OPENGL -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DHAVE_OZONE -DHAVE_CC_RESAMPLER -DHAVE_CHEEVOS -DRC_DISABLE_LUA -DHAVE_FBO -DHAVE_GL_SYNC -DHAVE_GLSLANG -DHAVE_BUILTINGLSLANG -DHAVE_IMAGEVIEWER -DHAVE_LANGEXTRA -DHAVE_RUNAHEAD -DHAVE_GFX_WIDGETS -DHAVE_CONFIGFILE -DHAVE_SPIRV_CROSS -DHAVE_STB_FONT -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_ASSETS -DHAVE_UPDATE_CORES -DHAVE_XMB -DRARCH_INTERNAL -DWANT_GLSLANG -DHAVE_XCB -DHAVE_EGL -DHAVE_BB10 -DHAVE_GLSL -DHAVE_AL -DRARCH_MOBILE
|
||||
EXT_TARGET := $(TARGET_NAME)
|
||||
EXT_INTER_TARGET := $(TARGET_NAME)
|
||||
INCLUDE += -Ilibretro-common/include -Igfx/include -Ideps -Ideps/stb -Ideps/rcheevos/include -Ideps/SPIRV-Cross -Ideps/glslang -I.
|
||||
LIBS += -lEGL -lbps -lscreen -lsocket -lm -lGLESv2 -lOpenAL
|
||||
else ifneq (,$(findstring unix,$(platform)))
|
||||
HAVE_SCREENSHOTS := 1
|
||||
HAVE_REWIND := 1
|
||||
HAVE_AUDIOMIXER := 1
|
||||
HAVE_RWAV := 1
|
||||
HAVE_RPNG := 1
|
||||
HAVE_RJPEG := 1
|
||||
HAVE_RBMP := 1
|
||||
@@ -956,56 +861,13 @@ else ifneq (,$(findstring unix,$(platform)))
|
||||
HAVE_DYNAMIC := 1
|
||||
HAVE_GRIFFIN_CPP := 1
|
||||
WANT_GLSLANG := 1
|
||||
HAVE_CONFIGFILE := 1
|
||||
HAVE_PATCH := 1
|
||||
HAVE_CHEATS := 1
|
||||
HAVE_CONFIGFILE := 1
|
||||
|
||||
PLATCFLAGS += -D__MMX__ -D__SSE__ -DHAVE_OPENGL -DHAVE_OPENGL1 -DHAVE_GLSL -DHAVE_SHADERPIPELINE -DHAVE_OZONE -DHAVE_CC_RESAMPLER -DHAVE_CHEEVOS -DRC_DISABLE_LUA -DHAVE_FBO -DHAVE_GL_SYNC -DHAVE_SLANG -DHAVE_GLSLANG -DHAVE_BUILTINGLSLANG -DHAVE_IMAGEVIEWER -DHAVE_LANGEXTRA -DHAVE_RUNAHEAD -DHAVE_GFX_WIDGETS -DHAVE_CONFIGFILE -DHAVE_PATCH -DHAVE_SPIRV_CROSS -DHAVE_STB_FONT -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_ASSETS -DHAVE_UPDATE_CORES -DHAVE_VULKAN -DHAVE_XMB -DRARCH_INTERNAL -DWANT_GLSLANG -DHAVE_X11 -DHAVE_XCB -DHAVE_UDEV -DHAVE_BSV_MOVIE -DHAVE_PULSE
|
||||
PLATCFLAGS += -D__MMX__ -D__SSE__ -DHAVE_OPENGL -DHAVE_OPENGL1 -DHAVE_GLSL -DHAVE_SHADERPIPELINE -DHAVE_OZONE -DHAVE_CC_RESAMPLER -DHAVE_CHEEVOS -DRC_DISABLE_LUA -DHAVE_FBO -DHAVE_GL_SYNC -DHAVE_SLANG -DHAVE_GLSLANG -DHAVE_BUILTINGLSLANG -DHAVE_IMAGEVIEWER -DHAVE_LANGEXTRA -DHAVE_RUNAHEAD -DHAVE_GFX_WIDGETS -DHAVE_CONFIGFILE -DHAVE_SPIRV_CROSS -DHAVE_STB_FONT -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_ASSETS -DHAVE_UPDATE_CORES -DHAVE_VULKAN -DHAVE_XMB -DRARCH_INTERNAL -DWANT_GLSLANG -DHAVE_X11 -DHAVE_XCB -DHAVE_UDEV -DHAVE_PULSE
|
||||
EXT_TARGET := $(TARGET_NAME)
|
||||
EXT_INTER_TARGET := $(TARGET_NAME)
|
||||
INCLUDE += -Ilibretro-common/include -Igfx/include -Ideps -Ideps/stb -Ideps/rcheevos/include -Ideps/SPIRV-Cross -Ideps/glslang -I.
|
||||
LIBS += -ldl -lm -lpthread -lGL -ludev -lpulse -lX11 -lX11-xcb -lXxf86vm
|
||||
else ifeq (dos,$(platform))
|
||||
HAVE_RPNG := 1
|
||||
HAVE_RJPEG := 1
|
||||
HAVE_RBMP := 1
|
||||
HAVE_RTGA := 1
|
||||
HAVE_ZLIB := 1
|
||||
HAVE_7ZIP := 1
|
||||
HAVE_NETWORKING := 0
|
||||
HAVE_NETWORK_CMD := 0
|
||||
HAVE_NETPLAYDISCOVERY := 0
|
||||
HAVE_OVERLAY := 1
|
||||
HAVE_VIDEO_LAYOUT := 0
|
||||
HAVE_MATERIALUI := 0
|
||||
HAVE_XMB := 0
|
||||
HAVE_STB_FONT := 1
|
||||
HAVE_THREADS := 0
|
||||
HAVE_LIBRETRODB := 1
|
||||
HAVE_COMMAND := 1
|
||||
HAVE_STDIN_CMD := 1
|
||||
HAVE_CMD := 1
|
||||
HAVE_DYLIB := 0
|
||||
HAVE_DYNAMIC := 0
|
||||
HAVE_GRIFFIN_CPP := 0
|
||||
WANT_GLSLANG := 0
|
||||
HAVE_CONFIGFILE := 1
|
||||
HAVE_PATCH := 0
|
||||
HAVE_CHEATS := 0
|
||||
CC=i586-pc-msdosdjgpp-gcc
|
||||
CXX=i586-pc-msdosdjgpp-g++
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
LDFLAGS += -g
|
||||
endif
|
||||
|
||||
PLATCFLAGS += -DHAVE_SHADERPIPELINE -DHAVE_CC_RESAMPLER -DRC_DISABLE_LUA -DHAVE_FBO -DHAVE_IMAGEVIEWER -DHAVE_LANGEXTRA -DHAVE_GFX_WIDGETS -DHAVE_CONFIGFILE -DHAVE_PATCH -DHAVE_SPIRV_CROSS -DHAVE_STB_FONT -DRARCH_INTERNAL -DHAVE_XCB
|
||||
TARGET_NAME := retrodos
|
||||
EXT_TARGET := $(TARGET_NAME).exe
|
||||
EXT_INTER_TARGET := $(TARGET_NAME).exe
|
||||
INCLUDE += -Ilibretro-common/include -Igfx/include -Ideps -Ideps/stb -Ideps/SPIRV-Cross -Ideps/glslang -I.
|
||||
LIBS += -lm
|
||||
LIBDIRS += -L.
|
||||
endif
|
||||
|
||||
ifneq (,$(findstring msvc,$(platform)))
|
||||
@@ -1093,34 +955,18 @@ ifeq ($(HAVE_IMAGEVIEWER), 1)
|
||||
CFLAGS += -DHAVE_IMAGEVIEWER
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_BSV_MOVIE), 1)
|
||||
CFLAGS += -DHAVE_BSV_MOVIE
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_RUNAHEAD), 1)
|
||||
CFLAGS += -DHAVE_RUNAHEAD
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_7ZIP), 1)
|
||||
CFLAGS += -DHAVE_7ZIP -D_7ZIP_ST
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_SCREENSHOTS), 1)
|
||||
CFLAGS += -DHAVE_SCREENSHOTS
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_REWIND), 1)
|
||||
CFLAGS += -DHAVE_REWIND
|
||||
CFLAGS += -DHAVE_7ZIP
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_AUDIOMIXER), 1)
|
||||
CFLAGS += -DHAVE_AUDIOMIXER
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_RWAV), 1)
|
||||
CFLAGS += -DHAVE_RWAV
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_OVERLAY), 1)
|
||||
CFLAGS += -DHAVE_OVERLAY
|
||||
endif
|
||||
@@ -1167,14 +1013,6 @@ ifeq ($(HAVE_LANGEXTRA), 1)
|
||||
CFLAGS += -DHAVE_LANGEXTRA
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_DSP_FILTER), 1)
|
||||
CFLAGS += -DHAVE_DSP_FILTER
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_VIDEO_FILTER), 1)
|
||||
CFLAGS += -DHAVE_VIDEO_FILTER
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_FILTERS_BUILTIN), 1)
|
||||
CFLAGS += -DHAVE_FILTERS_BUILTIN
|
||||
endif
|
||||
@@ -1195,14 +1033,6 @@ ifeq ($(HAVE_CONFIGFILE), 1)
|
||||
CFLAGS += -DHAVE_CONFIGFILE
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_PATCH), 1)
|
||||
CFLAGS += -DHAVE_PATCH
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_CHEATS), 1)
|
||||
CFLAGS += -DHAVE_CHEATS
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_RSOUND), 1)
|
||||
CFLAGS += -DHAVE_RSOUND
|
||||
endif
|
||||
|
||||
+1
-8
@@ -23,8 +23,6 @@ DEFINES := -D__SWITCH__=1 -U__linux__ -U__linux -DGLM_FORCE_PURE=1 -DRARCH_CONSO
|
||||
|
||||
HAVE_DR_MP3 = 1
|
||||
HAVE_TRANSLATE = 1
|
||||
HAVE_SCREENSHOTS = 1
|
||||
HAVE_REWIND = 1
|
||||
HAVE_AUDIOMIXER = 1
|
||||
HAVE_CC_RESAMPLER = 1
|
||||
HAVE_MENU_COMMON = 1
|
||||
@@ -35,14 +33,10 @@ HAVE_RBMP = 1
|
||||
HAVE_ZLIB = 1
|
||||
HAVE_BUILTINZLIB = 1
|
||||
HAVE_LIBRETRODB = 1
|
||||
HAVE_DSP_FILTER = 1
|
||||
HAVE_VIDEO_FILTER = 1
|
||||
HAVE_STATIC_VIDEO_FILTERS = 1
|
||||
HAVE_STATIC_AUDIO_FILTERS = 1
|
||||
HAVE_MENU = 1
|
||||
HAVE_CONFIGFILE = 1
|
||||
HAVE_PATCH = 1
|
||||
HAVE_CHEATS = 1
|
||||
HAVE_RUNAHEAD = 1
|
||||
HAVE_NETWORKING = 1
|
||||
HAVE_NETPLAYDISCOVERY = 1
|
||||
@@ -50,7 +44,6 @@ HAVE_STB_FONT = 1
|
||||
HAVE_CHEEVOS = 1
|
||||
HAVE_CHD = 0 # disabled due to static libretro-common and libchdr conflicts between different cores
|
||||
HAVE_STB_VORBIS = 1
|
||||
HAVE_IBXM = 1
|
||||
|
||||
# RetroArch libnx useful flags
|
||||
HAVE_THREADS = 1
|
||||
@@ -123,7 +116,7 @@ APP_ICON := pkg/libnx/retroarch.jpg
|
||||
#---------------------------------------------------------------------------------
|
||||
ARCH := -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE -mcpu=cortex-a57+crc+fp+simd
|
||||
|
||||
CFLAGS := -g -Wall -O3 -fcommon -ffast-math -ffunction-sections \
|
||||
CFLAGS := -g -Wall -O3 -ffast-math -ffunction-sections \
|
||||
$(ARCH) $(DEFINES) $(INCLUDE_DIRS) -I$(LIBNX)/include -I$(PORTLIBS)/include/ -include $(LIBNX)/include/switch.h #$(shell $(PORTLIBS)/bin/freetype-config --cflags)
|
||||
|
||||
CFLAGS += $(INCLUDE) -DSWITCH=1 -DHAVE_LIBNX=1 -DNXLINK=1 -DHAVE_SHADERPIPELINE -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_ASSETS -DHAVE_UPDATE_CORES -DHAVE_STB_FONT #-DHAVE_FREETYPE
|
||||
|
||||
+3
-8
@@ -11,10 +11,6 @@ WindowsSdkDir = C:\Program Files (x86)\Windows Kits\10\$(NOTHING)
|
||||
WindowsSDKVersion := 10.0.14393.0\$(NOTHING)
|
||||
VCINSTALLDIR := C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\$(NOTHING)
|
||||
|
||||
HAVE_DSP_FILTER := 1
|
||||
HAVE_VIDEO_FILTER := 1
|
||||
HAVE_SCREENSHOTS := 1
|
||||
HAVE_REWIND := 1
|
||||
HAVE_AUDIOMIXER := 1
|
||||
HAVE_D3DX := 1
|
||||
HAVE_D3D8 := 0
|
||||
@@ -36,7 +32,6 @@ HAVE_WINMM := 1
|
||||
HAVE_RPNG := 1
|
||||
HAVE_ZLIB := 1
|
||||
HAVE_CONFIGFILE := 1
|
||||
HAVE_PATCH := 1
|
||||
HAVE_MENU := 1
|
||||
HAVE_RGUI := 1
|
||||
HAVE_XMB := 1
|
||||
@@ -65,8 +60,6 @@ HAVE_LANGEXTRA := 1
|
||||
HAVE_CHEEVOS := 1
|
||||
HAVE_SHADERPIPELINE := 1
|
||||
HAVE_IMAGEVIEWER := 1
|
||||
HAVE_BSV_MOVIE := 1
|
||||
HAVE_CHEATS := 1
|
||||
|
||||
ifeq ($(HAVE_D3D8), 1)
|
||||
D3D8_LIBS := -ld3d8
|
||||
@@ -199,9 +192,11 @@ else
|
||||
OBJ := $(filter-out $(BLACKLIST),$(OBJ))
|
||||
endif
|
||||
|
||||
DEFINES += -DRARCH_INTERNAL -DHAVE_SCREENSHOTS -DHAVE_REWIND -DHAVE_DYNAMIC -DJSON_STATIC
|
||||
DEFINES += -DRARCH_INTERNAL -DHAVE_DYNAMIC -DJSON_STATIC
|
||||
INCLUDE_DIRS += -I. -Igfx/include
|
||||
|
||||
#OBJ := version_git.o
|
||||
|
||||
OBJ := $(patsubst %rarch.o,%rarch.res,$(OBJ))
|
||||
OBJ := $(addprefix $(BUILD_DIR)/,$(OBJ))
|
||||
OBJ := $(OBJ:.o=.obj)
|
||||
|
||||
-363
@@ -1,363 +0,0 @@
|
||||
ROOT_DIR := .
|
||||
DEPS_DIR := $(ROOT_DIR)/deps
|
||||
DEBUG ?= 0
|
||||
HAVE_LOGGER = 0
|
||||
HAVE_FILE_LOGGER = 0
|
||||
HAVE_CC_RESAMPLER = 1
|
||||
WHOLE_ARCHIVE_LINK = 0
|
||||
BIG_STACK = 1
|
||||
PC_DEVELOPMENT_IP_ADDRESS = 255.255.255.255
|
||||
PC_DEVELOPMENT_UDP_PORT = 3490
|
||||
RARCH_CONSOLE = 0
|
||||
USBGECKO = 0
|
||||
|
||||
SPACE :=
|
||||
SPACE := $(SPACE) $(SPACE)
|
||||
BACKSLASH :=
|
||||
BACKSLASH := \$(BACKSLASH)
|
||||
filter_out1 = $(filter-out $(firstword $1),$1)
|
||||
filter_out2 = $(call filter_out1,$(call filter_out1,$1))
|
||||
|
||||
# system platform
|
||||
system_platform = unix
|
||||
ifeq ($(shell uname -s),)
|
||||
EXE_EXT = .exe
|
||||
system_platform = win
|
||||
else ifneq ($(findstring Darwin,$(shell uname -s)),)
|
||||
system_platform = osx
|
||||
else ifneq ($(findstring MINGW,$(shell uname -s)),)
|
||||
system_platform = win
|
||||
endif
|
||||
|
||||
TARGET_NAME := retroarch
|
||||
|
||||
INCLUDE :=
|
||||
LDFLAGS :=
|
||||
LIBDIRS :=
|
||||
|
||||
ifeq ($(LIBRETRO), nxengine)
|
||||
WHOLE_ARCHIVE_LINK = 1
|
||||
endif
|
||||
|
||||
ifeq ($(WHOLE_ARCHIVE_LINK), 1)
|
||||
WHOLE_START := -Wl,--whole-archive
|
||||
WHOLE_END := -Wl,--no-whole-archive
|
||||
endif
|
||||
|
||||
LIBS := $(WHOLE_START) -lretro_ngc $(WHOLE_END)
|
||||
|
||||
libogc_platform := 1
|
||||
|
||||
EXTERNAL_LIBOGC ?= 0
|
||||
GX_PTHREAD_LEGACY ?= 1
|
||||
CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT)
|
||||
CXX = $(DEVKITPPC)/bin/powerpc-eabi-g++$(EXE_EXT)
|
||||
LD = $(DEVKITPPC)/bin/powerpc-eabi-ld$(EXE_EXT)
|
||||
ELF2DOL = $(DEVKITPPC)/bin/elf2dol$(EXE_EXT)
|
||||
EXT_TARGET := $(TARGET_NAME)_ngc.dol
|
||||
EXT_INTER_TARGET := $(TARGET_NAME)_ngc.elf
|
||||
|
||||
# Check whether ELF2DOL executable exists
|
||||
# (path has changed in more recent toolchains)
|
||||
ifeq ("$(wildcard $(ELF2DOL))","")
|
||||
ELF2DOL = $(DEVKITPRO)/tools/bin/elf2dol$(EXE_EXT)
|
||||
endif
|
||||
|
||||
INCLUDE += -I. -I$(DEVKITPRO)/libogc/include -Iwii/libogc/include
|
||||
|
||||
ifeq ($(EXTERNAL_LIBOGC), 1)
|
||||
CFLAGS += -DEXTERNAL_LIBOGC
|
||||
CXXFLAGS += -DEXTERNAL_LIBOGC
|
||||
LIBDIRS += -L$(DEVKITPRO)/libogc/lib/cube
|
||||
else
|
||||
CFLAGS += -DINTERNAL_LIBOGC
|
||||
CXXFLAGS += -DINTERNAL_LIBOGC
|
||||
LIBDIRS += -Lwii/libogc/libs/cube
|
||||
endif
|
||||
|
||||
ifeq ($(GX_PTHREAD_LEGACY), 1)
|
||||
CFLAGS += -DGX_PTHREAD_LEGACY
|
||||
CXXFLAGS += -DGX_PTHREAD_LEGACY
|
||||
endif
|
||||
|
||||
MACHDEP := -DHW_DOL -mogc
|
||||
|
||||
LIBDIRS += -L.
|
||||
MACHDEP += -DGEKKO -mcpu=750 -meabi -mhard-float
|
||||
|
||||
LDFLAGS += $(MACHDEP) -Wl,-Map,$(notdir $(EXT_INTER_TARGET)).map
|
||||
|
||||
ifeq ($(BIG_STACK), 1)
|
||||
LDFLAGS += -T bootstrap/gx/ogc.ld
|
||||
endif
|
||||
|
||||
ifeq ($(EXTERNAL_LIBOGC), 1)
|
||||
LIBS += -lfat
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_LOGGER), 1)
|
||||
LIBS += -lbba
|
||||
endif
|
||||
|
||||
LIBS += -logc
|
||||
|
||||
CFLAGS += -DGEKKO -U__INT32_TYPE__ -U __UINT32_TYPE__ -D__INT32_TYPE__=int
|
||||
|
||||
HAVE_RUNAHEAD := 1
|
||||
HAVE_DSP_FILTER := 1
|
||||
HAVE_VIDEO_FILTER := 1
|
||||
HAVE_FILTERS_BUILTIN := 1
|
||||
HAVE_THREADS := 1
|
||||
HAVE_RPNG := 1
|
||||
HAVE_RJPEG := 1
|
||||
HAVE_RBMP := 1
|
||||
HAVE_RTGA := 1
|
||||
HAVE_IBXM := 1
|
||||
HAVE_OVERLAY := 1
|
||||
HAVE_VIDEO_LAYOUT := 0
|
||||
HAVE_ZLIB := 1
|
||||
HAVE_7ZIP := 1
|
||||
HAVE_CONFIGFILE := 1
|
||||
HAVE_PATCH := 1
|
||||
HAVE_CHEATS := 1
|
||||
HAVE_SCREENSHOTS := 1
|
||||
HAVE_REWIND := 1
|
||||
HAVE_AUDIOMIXER := 1
|
||||
HAVE_RWAV := 1
|
||||
RARCH_CONSOLE = 1
|
||||
HAVE_CHEATS := 1
|
||||
|
||||
CFLAGS += -Wall -std=gnu99 $(MACHDEP) $(PLATCFLAGS) $(INCLUDE)
|
||||
INCLUDE += -I./libretro-common/include \
|
||||
-Ideps \
|
||||
-Ideps/stb
|
||||
|
||||
OBJ = griffin/griffin.o $(PLATOBJS)
|
||||
|
||||
ifeq ($(HAVE_GRIFFIN_CPP), 1)
|
||||
OBJ += griffin/griffin_cpp.o
|
||||
endif
|
||||
|
||||
ifeq ($(WANT_GLSLANG), 1)
|
||||
OBJ += griffin/griffin_glslang.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_LOGGER), 1)
|
||||
CFLAGS += -DHAVE_LOGGER
|
||||
CFLAGS += -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT)
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_KERNEL_PRX), 1)
|
||||
CFLAGS += -DHAVE_KERNEL_PRX
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_WIIUSB_HID), 1)
|
||||
CFLAGS += -DHAVE_WIIUSB_HID -DHAVE_HID
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_LIBRETRODB), 1)
|
||||
CFLAGS += -DHAVE_LIBRETRODB
|
||||
endif
|
||||
|
||||
ifeq ($(BIG_STACK),1)
|
||||
CFLAGS += -DBIG_STACK
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_RJPEG), 1)
|
||||
CFLAGS += -DHAVE_RJPEG
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_FILE_LOGGER), 1)
|
||||
CFLAGS += -DHAVE_FILE_LOGGER
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_RARCH_EXEC), 1)
|
||||
CFLAGS += -DHAVE_RARCH_EXEC
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_ZLIB), 1)
|
||||
CFLAGS += -DHAVE_ZLIB
|
||||
CFLAGS += -I./libretro-common/include/compat/zlib
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_RPNG), 1)
|
||||
CFLAGS += -DHAVE_RPNG
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_RBMP), 1)
|
||||
CFLAGS += -DHAVE_RBMP
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_RTGA), 1)
|
||||
CFLAGS += -DHAVE_RTGA
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_IMAGEVIEWER), 1)
|
||||
CFLAGS += -DHAVE_IMAGEVIEWER
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_BSV_MOVIE), 1)
|
||||
CFLAGS += -DHAVE_BSV_MOVIE
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_RUNAHEAD), 1)
|
||||
CFLAGS += -DHAVE_RUNAHEAD
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_7ZIP), 1)
|
||||
CFLAGS += -DHAVE_7ZIP -D_7ZIP_ST
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_SCREENSHOTS), 1)
|
||||
CFLAGS += -DHAVE_SCREENSHOTS
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_REWIND), 1)
|
||||
CFLAGS += -DHAVE_REWIND
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_AUDIOMIXER), 1)
|
||||
CFLAGS += -DHAVE_AUDIOMIXER
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_RWAV), 1)
|
||||
CFLAGS += -DHAVE_RWAV
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_OVERLAY), 1)
|
||||
CFLAGS += -DHAVE_OVERLAY
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_VIDEO_LAYOUT), 1)
|
||||
CFLAGS += -DHAVE_VIDEO_LAYOUT
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_NETWORKING), 1)
|
||||
CFLAGS += -DHAVE_NETWORKING
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_NETPLAYDISCOVERY), 1)
|
||||
CFLAGS += -DHAVE_NETPLAYDISCOVERY
|
||||
endif
|
||||
|
||||
ifeq ($(RARCH_CONSOLE), 1)
|
||||
CFLAGS += -DRARCH_CONSOLE
|
||||
endif
|
||||
|
||||
ifeq ($(RARCH_MOBILE), 1)
|
||||
CFLAGS += -DRARCH_MOBILE
|
||||
endif
|
||||
|
||||
CFLAGS += -std=gnu99 -DHAVE_RGUI -DHAVE_MENU -DHAVE_GRIFFIN=1 -Wno-char-subscripts -DRARCH_INTERNAL
|
||||
|
||||
ifeq ($(HAVE_MATERIALUI), 1)
|
||||
CFLAGS += -DHAVE_MATERIALUI
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_XMB), 1)
|
||||
CFLAGS += -DHAVE_XMB
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_STB_FONT), 1)
|
||||
CFLAGS += -DHAVE_STB_FONT
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_LANGEXTRA), 1)
|
||||
CFLAGS += -DHAVE_LANGEXTRA
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_DSP_FILTER), 1)
|
||||
CFLAGS += -DHAVE_DSP_FILTER
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_VIDEO_FILTER), 1)
|
||||
CFLAGS += -DHAVE_VIDEO_FILTER
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_FILTERS_BUILTIN), 1)
|
||||
CFLAGS += -DHAVE_FILTERS_BUILTIN
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_THREADS), 1)
|
||||
CFLAGS += -DHAVE_THREADS
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_CONFIGFILE), 1)
|
||||
CFLAGS += -DHAVE_CONFIGFILE
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_PATCH), 1)
|
||||
CFLAGS += -DHAVE_PATCH
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_CHEATS), 1)
|
||||
CFLAGS += -DHAVE_CHEATS
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_RSOUND), 1)
|
||||
CFLAGS += -DHAVE_RSOUND
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_GETOPT_LONG), 1)
|
||||
CFLAGS += -DHAVE_GETOPT_LONG=1
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_DYLIB), 1)
|
||||
CFLAGS += -DHAVE_DYLIB
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_NETWORK_CMD), 1)
|
||||
CFLAGS += -DHAVE_NETWORK_CMD
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_COMMAND), 1)
|
||||
CFLAGS += -DHAVE_COMMAND
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_STDIN_CMD), 1)
|
||||
CFLAGS += -DHAVE_STDIN_CMD
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_DYNAMIC), 1)
|
||||
CFLAGS += -DHAVE_DYNAMIC
|
||||
endif
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
CFLAGS += -O0 -g -DDEBUG
|
||||
else
|
||||
CFLAGS += -O3
|
||||
endif
|
||||
|
||||
OBJOUT = -o
|
||||
LINKOUT = -o
|
||||
LINK = $(CXX)
|
||||
|
||||
all: $(EXT_TARGET)
|
||||
|
||||
%.dol: %.elf
|
||||
$(ELF2DOL) $< $@
|
||||
|
||||
$(EXT_INTER_TARGET): $(OBJ)
|
||||
$(LINK) $(LINKOUT)$@ $(LDFLAGS) $(LIBDIRS) $(OBJ) $(PLATEXTRA) $(LIBS)
|
||||
|
||||
%.o: %.c
|
||||
$(CC) $(CFLAGS) -c $(OBJOUT)$@ $<
|
||||
|
||||
%.o: %.cpp
|
||||
$(CXX) $(CFLAGS) -c $(OBJOUT)$@ $<
|
||||
|
||||
%.o: %.S
|
||||
$(CC) $(CFLAGS) -c $(OBJOUT)$@ $<
|
||||
|
||||
%.binobj: %.bin
|
||||
$(LD) -r -b binary $(OBJOUT)$@ $<
|
||||
|
||||
clean:
|
||||
rm -f $(EXT_TARGET)
|
||||
rm -f $(EXT_INTER_TARGET)
|
||||
rm -f $(OBJ)
|
||||
|
||||
.PHONY: clean
|
||||
|
||||
print-%:
|
||||
@echo '$*=$($*)'
|
||||
@@ -15,9 +15,7 @@ LDFLAGS = -L$(PNDSDK)/usr/lib -Wl,-rpath,$(PNDSDK)/usr/lib
|
||||
|
||||
LIBS = -lGLESv2 -lEGL -ldl -lm -lpthread -lrt -lasound
|
||||
DEFINES = -std=gnu99 -DHAVE_THREADS -DHAVE_GETOPT_LONG=1 -DHAVE_GRIFFIN -DRARCH_INTERNAL
|
||||
DEFINES += -DHAVE_CONFIGFILE -DHAVE_PATCH -DHAVE_SCREENSHOTS -DHAVE_REWIND -D__ARM_ARCH_6__ -DHAVE_OPENGL -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DHAVE_GLSL -DHAVE_DYNAMIC -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_OVERLAY -DHAVE_VIDEO_LAYOUT -DHAVE_ALSA -DHAVE_ZLIB -D__linux__
|
||||
DEFINES += -DHAVE_DSP_FILTER
|
||||
DEFINES += -DHAVE_VIDEO_FILTER
|
||||
DEFINES += -DHAVE_CONFIGFILE -D__ARM_ARCH_6__ -DHAVE_OPENGL -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DHAVE_GLSL -DHAVE_DYNAMIC -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_OVERLAY -DHAVE_VIDEO_LAYOUT -DHAVE_ALSA -DHAVE_ZLIB -D__linux__
|
||||
DEFINES += $(INCDIRS)
|
||||
DEFINES += -D__OPENPANDORA__ -DPANDORA
|
||||
DEFINES += -marm -march=armv7-a -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize
|
||||
|
||||
+1
-8
@@ -16,16 +16,13 @@ DEFINES :=
|
||||
ifeq ($(GRIFFIN_BUILD), 1)
|
||||
OBJ += griffin/griffin.o
|
||||
DEFINES += -DHAVE_GRIFFIN=1
|
||||
DEFINES += -DHAVE_MENU -DHAVE_LIBRETRODB -DHAVE_CONFIGFILE -DHAVE_PATCH -DHAVE_SCREENSHOTS -DHAVE_CHEATS
|
||||
DEFINES += -DHAVE_REWIND
|
||||
DEFINES += -DHAVE_MENU -DHAVE_LIBRETRODB -DHAVE_CONFIGFILE
|
||||
DEFINES += -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_RBMP -DHAVE_RTGA -DHAVE_CC_RESAMPLER
|
||||
ifeq ($(DEBUG), 1)
|
||||
DEFINES += -DHAVE_NETLOGGER
|
||||
endif
|
||||
else
|
||||
|
||||
HAVE_DSP_FILTER := 1
|
||||
HAVE_VIDEO_FILTER := 1
|
||||
HAVE_FILTERS_BUILTIN := 1
|
||||
HAVE_LANGEXTRA := 0
|
||||
HAVE_RPNG := 1
|
||||
@@ -45,10 +42,6 @@ else
|
||||
HAVE_MENU := 1
|
||||
HAVE_MENU_COMMON := 1
|
||||
HAVE_CONFIGFILE := 1
|
||||
HAVE_SCREENSHOTS := 1
|
||||
HAVE_REWIND := 1
|
||||
HAVE_PATCH := 1
|
||||
HAVE_CHEATS := 1
|
||||
HAVE_RGUI := 0
|
||||
HAVE_MATERIALUI := 0
|
||||
HAVE_XMB := 1
|
||||
|
||||
+48
-26
@@ -1,41 +1,49 @@
|
||||
BUILD_FOR_PCSX2 = 0
|
||||
DEBUG = 0
|
||||
HAVE_KERNEL_PRX = 0
|
||||
HAVE_LOGGER = 0
|
||||
HAVE_FILE_LOGGER = 0
|
||||
HAVE_THREADS = 0
|
||||
BIG_STACK = 0
|
||||
MUTE_WARNINGS = 1
|
||||
PS2_IP = 192.168.1.10
|
||||
PS2_IP = 192.168.1.150
|
||||
|
||||
TARGET = retroarchps2-debug.elf
|
||||
TARGET_RELEASE = retroarchps2.elf
|
||||
TARGET = retroarchps2.elf
|
||||
TARGET_RELEASE = retroarchps2-release.elf
|
||||
|
||||
# Lib CDVD
|
||||
CDVD_DIR = ps2/libcdvd
|
||||
|
||||
# Compile the IRXs first
|
||||
IRX_DIR = ps2/irx
|
||||
IRX_FILES = $(wildcard ps2/irx/*.c)
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
OPTIMIZE_LV := -O0 -g
|
||||
RARCH_DEFINES += -DDEBUG
|
||||
else
|
||||
OPTIMIZE_LV := -O3
|
||||
OPTIMIZE_LV := -O2
|
||||
LDFLAGS := -s
|
||||
endif
|
||||
|
||||
ifeq ($(MUTE_WARNINGS), 1)
|
||||
DISABLE_WARNINGS := -Wno-unused -Wno-format -Wno-format-truncation
|
||||
DISABLE_WARNINGS := -Wno-sign-compare -Wno-unused -Wno-parentheses
|
||||
endif
|
||||
|
||||
INCDIR = -I$(PS2DEV)/gsKit/include -I$(PS2SDK)/ports/include
|
||||
INCDIR += -Ips2/include -Ilibretro-common/include -Ideps -Ideps/stb -Ideps/7zip
|
||||
INCDIR = -I$(PS2DEV)/gsKit/include -I$(PS2SDK)/ports/include -I$(CDVD_DIR)/ee
|
||||
INCDIR += -Ips2 -Ips2/include -Ilibretro-common/include -Ideps -Ideps/stb -Ideps/7zip
|
||||
INCDIR += -Ideps/pthreads -Ideps/pthreads/platform/ps2 -Ideps/pthreads/platform/helper
|
||||
GPVAL = -G0
|
||||
CFLAGS = $(OPTIMIZE_LV) $(DISABLE_WARNINGS) -ffast-math -fsingle-precision-constant
|
||||
ASFLAGS = $(CFLAGS)
|
||||
|
||||
RARCH_DEFINES += -DPS2 -DHAVE_GRIFFIN=1 -DRARCH_INTERNAL -DHAVE_SCREENSHOTS -DHAVE_REWIND -DRARCH_CONSOLE -DHAVE_MENU -DHAVE_CONFIGFILE -DHAVE_PATCH -DHAVE_CHEATS -DHAVE_RGUI
|
||||
RARCH_DEFINES += -DHAVE_ZLIB -DHAVE_NO_BUILTINZLIB -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_FILTERS_BUILTIN -DHAVE_7ZIP -D_7ZIP_ST -DHAVE_CC_RESAMPLER -DHAVE_AUDIOMIXER
|
||||
RARCH_DEFINES += -DHAVE_DSP_FILTER
|
||||
RARCH_DEFINES += -DHAVE_VIDEO_FILTER
|
||||
RARCH_DEFINES += -DPS2 -DUSE_IOP_CTYPE_MACRO -D_MIPS_ARCH_R5900 -DHAVE_ZLIB -DHAVE_NO_BUILTINZLIB -DHAVE_RPNG -DHAVE_RJPEG
|
||||
RARCH_DEFINES += -DHAVE_GRIFFIN=1 -DRARCH_INTERNAL -DRARCH_CONSOLE -DHAVE_MENU -DHAVE_CONFIGFILE -DHAVE_RGUI -DHAVE_FILTERS_BUILTIN -DHAVE_7ZIP -DHAVE_CC_RESAMPLER
|
||||
|
||||
LDFLAGS += -L$(PS2DEV)/gsKit/lib -L$(PS2SDK)/ports/lib -L.
|
||||
# Lib cdvd is needed to get proper time
|
||||
LIBS += -lretro_ps2 -lpatches -lgskit -ldmakit -laudsrv -lmtap -lpadx -lz -lcdvd -lelf-loader
|
||||
LIBDIR =
|
||||
LDFLAGS += -L$(PS2SDK)/ports/lib -L$(PS2DEV)/gsKit/lib -L$(PS2SDK)/ee/lib -L$(CDVD_DIR)/lib -L.
|
||||
LIBS += -lretro_ps2 -lgskit -ldmakit -lgskit_toolkit -laudsrv -lmf -lpadx -lmtap -lmc -lhdd -lsdl -lfileXio -lz
|
||||
LIBS += -lcdvdfs -lpatches -lpoweroff
|
||||
|
||||
ifeq ($(BUILD_FOR_PCSX2), 1)
|
||||
RARCH_DEFINES += -DBUILD_FOR_PCSX2
|
||||
@@ -45,19 +53,31 @@ ifeq ($(HAVE_THREADS), 1)
|
||||
RARCH_DEFINES += -DHAVE_THREADS
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_FILE_LOGGER), 1)
|
||||
CFLAGS += -DHAVE_FILE_LOGGER
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_KERNEL_PRX), 1)
|
||||
CFLAGS += -DHAVE_KERNEL_PRX
|
||||
endif
|
||||
|
||||
ifeq ($(BIG_STACK), 1)
|
||||
CFLAGS += -DBIG_STACK
|
||||
endif
|
||||
|
||||
CFLAGS += $(RARCH_DEFINES)
|
||||
|
||||
# All the IRX objects
|
||||
EE_OBJS += $(IRX_DIR)/sio2man_irx.o $ $(IRX_DIR)/iomanX_irx.o $(IRX_DIR)/fileXio_irx.o
|
||||
EE_OBJS += $(IRX_DIR)/mcman_irx.o $(IRX_DIR)/mcserv_irx.o
|
||||
EE_OBJS += $(IRX_DIR)/usbd_irx.o $(IRX_DIR)/usbhdfsd_irx.o
|
||||
EE_OBJS += $(IRX_DIR)/libsd_irx.o $(IRX_DIR)/audsrv_irx.o
|
||||
EE_OBJS += $(IRX_DIR)/cdfs_irx.o
|
||||
EE_OBJS += $(IRX_DIR)/mtapman_irx.o $(IRX_DIR)/padman_irx.o
|
||||
EE_OBJS += $(IRX_DIR)/freemtap_irx.o $(IRX_DIR)/freepad_irx.o $(IRX_DIR)/freesio2_irx.o $(IRX_DIR)/iomanX_irx.o
|
||||
EE_OBJS += $(IRX_DIR)/fileXio_irx.o $(IRX_DIR)/mcman_irx.o $(IRX_DIR)/mcserv_irx.o $(IRX_DIR)/usbd_irx.o
|
||||
EE_OBJS += $(IRX_DIR)/usbhdfsd_irx.o $(IRX_DIR)/freesd_irx.o $(IRX_DIR)/audsrv_irx.o $(IRX_DIR)/poweroff_irx.o
|
||||
EE_OBJS += $(IRX_DIR)/cdvd_irx.o
|
||||
|
||||
# Missing objecst on the PS2SDK
|
||||
EE_OBJS += ps2/compat_files/ps2_devices.o
|
||||
EE_OBJS += ps2/compat_files/compat_ctype.o ps2/compat_files/time.o ps2/compat_files/ps2_devices.o
|
||||
EE_OBJS += ps2/compat_files/fileXio_cdvd.o ps2/compat_files/ps2_descriptor.o
|
||||
|
||||
#EE_OBJS = griffin/griffin.o bootstrap/ps2/kernel_functions.o
|
||||
EE_OBJS += griffin/griffin.o
|
||||
|
||||
EE_CFLAGS = $(CFLAGS)
|
||||
@@ -86,10 +106,7 @@ prepare:
|
||||
run:
|
||||
ps2client -h $(PS2_IP) execee host:$(EE_BIN)
|
||||
|
||||
sim:
|
||||
PCSX2 --elf=$(PWD)/$(EE_BIN) --nogui
|
||||
|
||||
debug: clean all run
|
||||
debug: clean prepare all run
|
||||
|
||||
package:
|
||||
ps2-packer $(EE_BIN) $(TARGET_RELEASE)
|
||||
@@ -98,4 +115,9 @@ release: clean all package
|
||||
|
||||
#Include preferences
|
||||
include $(PS2SDK)/samples/Makefile.pref
|
||||
include $(PS2SDK)/samples/Makefile.eeglobal_cpp
|
||||
include $(PS2SDK)/samples/Makefile.eeglobal
|
||||
|
||||
#Linking with C++
|
||||
$(EE_BIN): $(EE_OBJS) $(PS2SDK)/ee/startup/crt0.o
|
||||
$(EE_CXX) $(EE_NO_CRT) -T$(PS2SDK)/ee/startup/linkfile $(EE_CXXFLAGS) \
|
||||
-o $(EE_BIN) $(PS2SDK)/ee/startup/crt0.o $(CRTI_OBJ) $(CRTBEGIN_OBJ) $(EE_OBJS) $(CRTEND_OBJ) $(CRTN_OBJ) $(EE_LDFLAGS) $(EE_LIBS)
|
||||
@@ -1,97 +0,0 @@
|
||||
BUILD_FOR_PCSX2 = 0
|
||||
DEBUG = 0
|
||||
MUTE_WARNINGS = 1
|
||||
PS2_IP = 192.168.1.150
|
||||
|
||||
TARGET = raboot-debug.elf
|
||||
TARGET_RELEASE = raboot.elf
|
||||
|
||||
# Compile the IRXs first
|
||||
IRX_DIR = ps2/irx
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
OPTIMIZE_LV := -O0 -g
|
||||
RARCH_DEFINES += -DDEBUG
|
||||
else
|
||||
OPTIMIZE_LV := -O3
|
||||
LDFLAGS := -s
|
||||
endif
|
||||
|
||||
ifeq ($(MUTE_WARNINGS), 1)
|
||||
DISABLE_WARNINGS := -Wno-sign-compare -Wno-unused -Wno-parentheses
|
||||
endif
|
||||
|
||||
INCDIR = -Ilibretro-common/include
|
||||
INCDIR += -Ips2/include
|
||||
CFLAGS = $(OPTIMIZE_LV) $(DISABLE_WARNINGS) -ffast-math -fsingle-precision-constant
|
||||
ASFLAGS = $(CFLAGS)
|
||||
|
||||
RARCH_DEFINES += -DPS2 -DIS_SALAMANDER -DRARCH_CONSOLE
|
||||
|
||||
LIBDIR =
|
||||
LDFLAGS =
|
||||
LIBS = -lelf-loader -lpatches
|
||||
|
||||
ifeq ($(BUILD_FOR_PCSX2), 1)
|
||||
RARCH_DEFINES += -DBUILD_FOR_PCSX2
|
||||
endif
|
||||
|
||||
CFLAGS += $(RARCH_DEFINES)
|
||||
|
||||
EE_OBJS = frontend/frontend_salamander.o \
|
||||
frontend/frontend_driver.o \
|
||||
frontend/drivers/platform_ps2.o \
|
||||
libretro-common/file/file_path.o \
|
||||
libretro-common/file/file_path_io.o \
|
||||
libretro-common/string/stdstring.o \
|
||||
libretro-common/lists/string_list.o \
|
||||
libretro-common/lists/dir_list.o \
|
||||
libretro-common/file/retro_dirent.o \
|
||||
libretro-common/encodings/encoding_utf.o \
|
||||
libretro-common/compat/fopen_utf8.o \
|
||||
libretro-common/compat/compat_strl.o \
|
||||
libretro-common/compat/compat_strcasestr.o \
|
||||
libretro-common/file/config_file.o \
|
||||
libretro-common/streams/file_stream.o \
|
||||
libretro-common/vfs/vfs_implementation.o \
|
||||
libretro-common/hash/lrc_hash.o \
|
||||
libretro-common/time/rtime.o \
|
||||
verbosity.o \
|
||||
ps2/compat_files/ps2_devices.o
|
||||
|
||||
# Needed IRX objects
|
||||
EE_OBJS += $(IRX_DIR)/sio2man_irx.o $ $(IRX_DIR)/iomanX_irx.o $(IRX_DIR)/fileXio_irx.o
|
||||
EE_OBJS += $(IRX_DIR)/mcman_irx.o $(IRX_DIR)/mcserv_irx.o $(IRX_DIR)/usbd_irx.o $(IRX_DIR)/usbhdfsd_irx.o
|
||||
EE_OBJS += $(IRX_DIR)/cdfs_irx.o
|
||||
|
||||
EE_CFLAGS = $(CFLAGS)
|
||||
EE_CXXFLAGS = $(CFLAGS)
|
||||
EE_LDFLAGS = $(LDFLAGS)
|
||||
EE_LIBS = $(LIBS)
|
||||
EE_ASFLAGS = $(ASFLAGS)
|
||||
EE_INCS = $(INCDIR)
|
||||
EE_BIN = $(TARGET)
|
||||
EE_GPVAL = $(GPVAL)
|
||||
|
||||
all: irxdir $(EE_BIN)
|
||||
|
||||
irxdir:
|
||||
$(MAKE) -C $(IRX_DIR)
|
||||
|
||||
clean:
|
||||
rm -f $(EE_BIN) $(EE_OBJS)
|
||||
$(MAKE) -C $(IRX_DIR) clean
|
||||
|
||||
debug: clean all run
|
||||
|
||||
run:
|
||||
ps2client -h $(PS2_IP) execee host:$(EE_BIN)
|
||||
|
||||
package:
|
||||
ps2-packer $(EE_BIN) $(TARGET_RELEASE)
|
||||
|
||||
release: clean all package
|
||||
|
||||
#Include preferences
|
||||
include $(PS2SDK)/samples/Makefile.pref
|
||||
include $(PS2SDK)/samples/Makefile.eeglobal_cpp
|
||||
+207
@@ -0,0 +1,207 @@
|
||||
include version.all
|
||||
|
||||
#which compiler to build with - GCC or SNC
|
||||
#set to GCC for debug builds for use with debugger
|
||||
CELL_BUILD_TOOLS = SNC
|
||||
CELL_GPU_TYPE = RSX
|
||||
CELL_PSGL_VERSION = opt
|
||||
|
||||
ASSETS_DIR := media/assets
|
||||
|
||||
# options
|
||||
DOWNLOAD_SHADERS = 1
|
||||
STRIPPING_ENABLE = 0
|
||||
DEBUG = 0
|
||||
HAVE_GCMGL = 0
|
||||
HAVE_LOGGER = 0
|
||||
HAVE_FREETYPE = 0
|
||||
WHOLE_ARCHIVE_LINK = 0
|
||||
|
||||
CONTENT_ID_FULL = UP0001-SSNE10000_00-0000000000000001
|
||||
CONTENT_ID = SSNE10000
|
||||
|
||||
PC_DEVELOPMENT_IP_ADDRESS = "192.168.1.7"
|
||||
PC_DEVELOPMENT_UDP_PORT = 3490
|
||||
|
||||
CELL_MK_DIR ?= $(CELL_SDK)/samples/mk
|
||||
include $(CELL_MK_DIR)/sdk.makedef.mk
|
||||
|
||||
PPU_TARGET = retroarch_ps3.elf
|
||||
SALAMANDER_TARGET = retroarch-salamander_ps3.elf
|
||||
|
||||
EBOOT_PATH = pkg/ps3/USRDIR/EBOOT.BIN
|
||||
CORE_PATH = pkg/ps3/USRDIR/cores/CORE.SELF
|
||||
|
||||
LDDIRS = -L. -L$(CELL_SDK)/target/ppu/lib/PSGL/RSX/ultra-opt
|
||||
INCDIRS = -I. \
|
||||
-Idefines \
|
||||
-Ideps \
|
||||
-Ideps/stb \
|
||||
-Ideps/rcheevos/include \
|
||||
-Ilibretro-common/include \
|
||||
-Ilibretro-common/include/compat/zlib
|
||||
|
||||
# system platform
|
||||
system_platform = unix
|
||||
ifeq ($(shell uname -a),)
|
||||
EXE_EXT = .exe
|
||||
system_platform = win
|
||||
else ifneq ($(findstring Darwin,$(shell uname -a)),)
|
||||
system_platform = osx
|
||||
else ifneq ($(findstring MINGW,$(shell uname -a)),)
|
||||
system_platform = win
|
||||
endif
|
||||
|
||||
PKG_SCRIPT = tools/ps3/ps3py/pkg.py
|
||||
ifeq ($(shell uname), Linux)
|
||||
PKG_FINALIZE = package_finalize
|
||||
MAKE_SELF_WC = make_self_wc
|
||||
MAKE_SELF = make_self_npdrm
|
||||
PYTHON2 = python2
|
||||
GIT = git
|
||||
else
|
||||
PKG_FINALIZE = package_finalize.exe
|
||||
MAKE_SELF_WC = make_self_wc.exe
|
||||
MAKE_SELF = make_self_npdrm.exe
|
||||
PYTHON2 = python2.exe
|
||||
GIT = git.exe
|
||||
endif
|
||||
|
||||
PPU_SRCS = griffin/griffin.c
|
||||
|
||||
DEFINES += -DHAVE_VIDEO_LAYOUT
|
||||
DEFINES += -DHAVE_MENU -DHAVE_CONFIGFILE -DHAVE_GFX_WIDGETS -DHAVE_RGUI -DHAVE_XMB -DHAVE_OZONE -DHAVE_LIBRETRODB -DHAVE_MATERIALUI -DHAVE_SHADERPIPELINE -DRARCH_INTERNAL -DMSB_FIRST -DHAVE_OVERLAY -DHAVE_CC_RESAMPLER -DHAVE_STB_VORBIS -DHAVE_STB_FONT -DHAVE_RUNAHEAD -DHAVE_DR_MP3 -DHAVE_DR_FLAC
|
||||
DEFINES += -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_ASSETS -DHAVE_UPDATE_CORES
|
||||
|
||||
ifeq ($(DEX_BUILD), 1)
|
||||
DEFINES += -DDEX_BUILD
|
||||
endif
|
||||
|
||||
ifeq ($(CEX_BUILD), 1)
|
||||
DEFINES += -DCEX_BUILD
|
||||
endif
|
||||
|
||||
ifeq ($(ODE_BUILD), 1)
|
||||
DEFINES += -DODE_BUILD
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_GCMGL), 1)
|
||||
DEFINES += -DHAVE_GCMGL
|
||||
GL_LIBS := -L. -lrgl_ps3
|
||||
else
|
||||
GL_LIBS := -L$(CELL_SDK)/target/ppu/lib/PSGL/RSX/ultra-opt -lPSGL -lPSGLcgc
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_FREETYPE), 1)
|
||||
DEFINES += -DHAVE_FREETYPE
|
||||
FONT_LIBS := -lfontFT_stub -lfreetype_stub
|
||||
endif
|
||||
|
||||
ifeq ($(CELL_BUILD_TOOLS), SNC)
|
||||
PPU_CXXLD = $(CELL_SDK)/host-win32/sn/bin/ps3ppuld.exe
|
||||
PPU_CXX = $(CELL_SDK)/host-win32/sn/bin/ps3ppusnc.exe
|
||||
PPU_CC = $(CELL_SDK)/host-win32/sn/bin/ps3ppusnc.exe
|
||||
else ifneq ($(system_platform), win)
|
||||
PPU_CXX = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-g++.exe
|
||||
PPU_CC = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-gcc.exe
|
||||
PPU_CXXLD = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ld.exe
|
||||
PPU_CCLD = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ld.exe
|
||||
endif
|
||||
|
||||
ifeq ($(WHOLE_ARCHIVE_LINK), 1)
|
||||
WHOLE_START := -Wl, --whole-archive
|
||||
WHOLE_END := -Wl, --no-whole-archive
|
||||
endif
|
||||
|
||||
PPU_LDLIBS = $(FONT_LIBS) $(GL_LIBS) $(WHOLE_START) -lretro_ps3 $(WHOLE_END) -lcgc -lgcm_cmdasm -lgcm_sys_stub -lresc_stub -lm -lio_stub -lfs_stub -lsysutil_stub -lsysutil_game_stub -lsysutil_screenshot_stub -lsysutil_np_stub -lpngdec_stub -lsysmodule_stub -laudio_stub -lnet_stub -lnetctl_stub -lpthread
|
||||
|
||||
PPU_RANLIB = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ranlib.exe
|
||||
|
||||
DEFINES += -DHAVE_THREADS -DRARCH_CONSOLE -DHAVE_OPENGL -DHAVE_HEADSET -DHAVE_LANGEXTRA -DHAVE_OPENGLES -DHAVE_OPENGLES1 -DHAVE_PSGL -DHAVE_CG -DHAVE_CG_RUNTIME_COMPILER -DHAVE_SYSMODULES -DHAVE_SYSUTILS -DHAVE_RARCH_EXEC -DHAVE_RSOUND -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_RBMP -DHAVE_RTGA -DHAVE_7Z -D__CELLOS_LV2__ -DHAVE_NETWORKING=1 -DHAVE_SOCKET_LEGACY=1 -DHAVE_MOUSE -DHAVE_GRIFFIN=1 -DHAVE_MULTIMAN=1 -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT) -DHAVE_FILTERS_BUILTIN -DHAVE_CHEEVOS -DRC_DISABLE_LUA
|
||||
|
||||
#DEFINES += -DHAVE_IMAGEVIEWER
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
PPU_OPTIMIZE_LV := -O0 -g
|
||||
else
|
||||
PPU_OPTIMIZE_LV := -O2 -g
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_LOGGER), 1)
|
||||
DEFINES += -DHAVE_LOGGER
|
||||
endif
|
||||
|
||||
PPU_CFLAGS := $(PPU_OPTIMIZE_LV) $(INCDIRS) $(DEFINES)
|
||||
PPU_CXXFLAGS := $(PPU_OPTIMIZE_LV) $(INCDIRS) $(DEFINES)
|
||||
|
||||
EXIST_EBOOT_WILDCARD := $(wildcard $(EBOOT_PATH))
|
||||
EXIST_CORE_WILDCARD := $(wildcard $(CORE_PATH))
|
||||
|
||||
EBOOT_EXISTS = 1
|
||||
CORE_EXISTS = 1
|
||||
|
||||
ifneq ($(strip $(EXIST_EBOOT_WILDCARD)),)
|
||||
EBOOT_EXISTS = 0
|
||||
endif
|
||||
|
||||
ifneq ($(strip $(EXIST_CORE_WILDCARD)),)
|
||||
CORE_EXISTS = 0
|
||||
endif
|
||||
|
||||
include $(CELL_MK_DIR)/sdk.target.mk
|
||||
|
||||
MAKE_FSELF = $(CELL_SDK)/host-win32/bin/make_fself.exe
|
||||
MAKE_FSELF_NPDRM = $(CELL_SDK)/host-win32/bin/make_fself_npdrm.exe
|
||||
MAKE_PACKAGE_NPDRM = $(CELL_SDK)/host-win32/bin/make_package_npdrm.exe
|
||||
|
||||
.PHONY: create-npdrm-core create-core create-npdrm-salamander create-shaders clean-selfs create-salamander
|
||||
|
||||
create-npdrm-core:
|
||||
$(MAKE_FSELF_NPDRM) $(PPU_TARGET) $(CORE_PATH)
|
||||
|
||||
create-core:
|
||||
$(MAKE_SELF_WC) $(PPU_TARGET) $(CORE_PATH)
|
||||
|
||||
create-npdrm-salamander:
|
||||
$(MAKE_FSELF_NPDRM) $(SALAMANDER_TARGET) $(EBOOT_PATH)
|
||||
|
||||
create-salamander:
|
||||
$(MAKE_SELF) $(SALAMANDER_TARGET) $(EBOOT_PATH) $(CONTENT_ID_FULL)
|
||||
|
||||
copy-media-files:
|
||||
@cp -r $(ASSETS_DIR)/glui pkg/ps3/USRDIR/cores/assets
|
||||
@cp -r $(ASSETS_DIR)/xmb pkg/ps3/USRDIR/cores/assets
|
||||
|
||||
create-shaders:
|
||||
make -f Makefile.griffin platform=ps3 shaders-deploy
|
||||
|
||||
pkg: $(PPU_TARGET) create-shaders copy-media-files create-npdrm-salamander create-npdrm-core
|
||||
$(MAKE_PACKAGE_NPDRM) pkg/ps3/package.conf pkg/ps3
|
||||
|
||||
pkg-signed: $(PPU_TARGET) create-shaders copy-media-files create-salamander create-core
|
||||
$(PYTHON2) $(PKG_SCRIPT) --contentid $(CONTENT_ID_FULL) pkg/ps3 retroarch-ps3-cfw-$(PACKAGE_VERSION).pkg
|
||||
|
||||
pkg-signed-standalone: $(PPU_TARGET) create-shaders copy-media-files create-core
|
||||
$(MAKE_SELF) $(PPU_TARGET) $(EBOOT_PATH) $(CONTENT_ID)
|
||||
$(PYTHON2) $(PKG_SCRIPT) --contentid $(CONTENT_ID_FULL) pkg/ps3 retroarch-ps3-cfw-$(PACKAGE_VERSION).pkg
|
||||
|
||||
pkg-signed-cfw: $(PPU_TARGET) create-shaders copy-media-files create-salamander create-core
|
||||
$(PYTHON2) $(PKG_SCRIPT) --contentid $(CONTENT_ID_FULL) pkg/ps3 retroarch-ps3-cfw-$(PACKAGE_VERSION)-kmeaw.pkg
|
||||
$(PKG_FINALIZE) retroarch-ps3-cfw-$(PACKAGE_VERSION)-kmeaw.pkg
|
||||
|
||||
pkg-signed-cfw-standalone: $(PPU_TARGET) create-shaders copy-media-files create-core
|
||||
$(MAKE_SELF) $(PPU_TARGET) $(EBOOT_PATH) $(CONTENT_ID)
|
||||
$(PYTHON2) $(PKG_SCRIPT) --contentid $(CONTENT_ID_FULL) pkg/ps3 retroarch-ps3-cfw-$(PACKAGE_VERSION).pkg
|
||||
$(PKG_FINALIZE) retroarch-ps3-cfw-$(PACKAGE_VERSION)-kmeaw.pkg
|
||||
|
||||
clean-selfs:
|
||||
ifeq ($(EBOOT_EXISTS),1)
|
||||
@echo "WARNING: Couldn't find file to delete: [$(EBOOT_PATH)], skipping this step."
|
||||
else
|
||||
rm $(EBOOT_PATH)
|
||||
endif
|
||||
ifeq ($(CORE_EXISTS),1)
|
||||
@echo "WARNING: Couldn't find file to delete: [$(CORE_PATH)], skipping this step."
|
||||
else
|
||||
rm $(CORE_PATH)
|
||||
endif
|
||||
@@ -0,0 +1,196 @@
|
||||
include version.all
|
||||
|
||||
#which compiler to build with - GCC or SNC
|
||||
#set to GCC for debug builds for use with debugger
|
||||
CELL_BUILD_TOOLS = GCC
|
||||
CELL_GPU_TYPE = RSX
|
||||
CELL_PSGL_VERSION = ultra-opt
|
||||
|
||||
# options
|
||||
DOWNLOAD_SHADERS = 1
|
||||
STRIPPING_ENABLE = 0
|
||||
DEBUG = 0
|
||||
HAVE_GCMGL = 1
|
||||
HAVE_LOGGER = 0
|
||||
HAVE_FREETYPE = 0
|
||||
WHOLE_ARCHIVE_LINK = 0
|
||||
|
||||
CONTENT_ID_FULL = UP0001-SSNE10000_00-0000000000000001
|
||||
CONTENT_ID = SSNE10000
|
||||
|
||||
PC_DEVELOPMENT_IP_ADDRESS = "192.168.1.7"
|
||||
PC_DEVELOPMENT_UDP_PORT = 3490
|
||||
|
||||
CELL_MK_DIR ?= $(CELL_SDK)/samples/mk
|
||||
include $(CELL_MK_DIR)/sdk.makedef.mk
|
||||
|
||||
PPU_TARGET = retroarch_ps3.elf
|
||||
SALAMANDER_TARGET = retroarch-salamander_ps3.elf
|
||||
|
||||
EBOOT_PATH = pkg/ps3/USRDIR/EBOOT.BIN
|
||||
CORE_PATH = pkg/ps3/USRDIR/cores/CORE.SELF
|
||||
|
||||
LDDIRS = -L. -L$(CELL_SDK)/target/ppu/lib/PSGL/RSX/ultra-opt
|
||||
INCDIRS = -I. -Idefines -Ideps -Ideps/stb
|
||||
|
||||
# system platform
|
||||
system_platform = unix
|
||||
ifeq ($(shell uname -a),)
|
||||
EXE_EXT = .exe
|
||||
system_platform = win
|
||||
else ifneq ($(findstring Darwin,$(shell uname -a)),)
|
||||
system_platform = osx
|
||||
else ifneq ($(findstring MINGW,$(shell uname -a)),)
|
||||
system_platform = win
|
||||
endif
|
||||
|
||||
PKG_SCRIPT = tools/ps3/ps3py/pkg.py
|
||||
ifeq ($(shell uname), Linux)
|
||||
PKG_FINALIZE = package_finalize
|
||||
MAKE_SELF_WC = make_self_wc
|
||||
MAKE_SELF = make_self_npdrm
|
||||
PYTHON2 = python2
|
||||
GIT = git
|
||||
else
|
||||
PKG_FINALIZE = package_finalize.exe
|
||||
MAKE_SELF_WC = make_self_wc.exe
|
||||
MAKE_SELF = make_self_npdrm.exe
|
||||
PYTHON2 = python2.exe
|
||||
GIT = git.exe
|
||||
endif
|
||||
|
||||
PPU_SRCS = griffin/griffin.c
|
||||
|
||||
DEFINES += -DHAVE_RGUI -DHAVE_MATERIALUI -DHAVE_XMB -DHAVE_MENU -DRARCH_INTERNAL
|
||||
|
||||
ifeq ($(DEX_BUILD), 1)
|
||||
DEFINES += -DDEX_BUILD
|
||||
endif
|
||||
|
||||
ifeq ($(CEX_BUILD), 1)
|
||||
DEFINES += -DCEX_BUILD
|
||||
endif
|
||||
|
||||
ifeq ($(ODE_BUILD), 1)
|
||||
DEFINES += -DODE_BUILD
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_GCMGL), 1)
|
||||
DEFINES += -DHAVE_GCMGL
|
||||
GL_LIBS := -L. -lrgl_ps3
|
||||
else
|
||||
GL_LIBS := -L$(CELL_SDK)/target/ppu/lib/PSGL/RSX/ultra-opt -lPSGL -lPSGLcgc
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_FREETYPE), 1)
|
||||
DEFINES += -DHAVE_FREETYPE
|
||||
FONT_LIBS := -lfontFT_stub -lfreetype_stub
|
||||
endif
|
||||
|
||||
ifeq ($(CELL_BUILD_TOOLS), SNC)
|
||||
PPU_CXXLD = $(CELL_SDK)/host-win32/sn/bin/ps3ppuld.exe
|
||||
PPU_CXX = $(CELL_SDK)/host-win32/sn/bin/ps3ppusnc.exe
|
||||
PPU_CC = $(CELL_SDK)/host-win32/sn/bin/ps3ppusnc.exe
|
||||
else ifneq($(system_platform), win)
|
||||
PPU_CXX = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-g++.exe
|
||||
PPU_CC = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-gcc.exe
|
||||
PPU_CXXLD = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ld.exe
|
||||
PPU_CCLD = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ld.exe
|
||||
endif
|
||||
|
||||
ifeq ($(WHOLE_ARCHIVE_LINK), 1)
|
||||
WHOLE_START := -Wl, --whole-archive
|
||||
WHOLE_END := -Wl, --no-whole-archive
|
||||
endif
|
||||
|
||||
PPU_LDLIBS = $(FONT_LIBS) $(GL_LIBS) $(WHOLE_START) -lretro_ps3 $(WHOLE_END) -lcgc -lgcm_cmdasm -lgcm_sys_stub -lresc_stub -lm -lio_stub -lfs_stub -lsysutil_stub -lsysutil_game_stub -lsysutil_screenshot_stub -lsysutil_np_stub -lpngdec_stub -ljpgdec_stub -lsysmodule_stub -laudio_stub -lnet_stub -lnetctl_stub -lpthread
|
||||
|
||||
PPU_RANLIB = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ranlib.exe
|
||||
|
||||
#DEFINES += -DHAVE_VIDEO_LAYOUT
|
||||
DEFINES += -DHAVE_THREADS -DRARCH_CONSOLE -DHAVE_OPENGL -DHAVE_OVERLAY -DHAVE_HEADSET -DHAVE_OPENGLES -DHAVE_OPENGLES1 -DHAVE_PSGL -DHAVE_CG -DHAVE_CG_RUNTIME_COMPILER -DHAVE_SYSMODULES -DHAVE_SYSUTILS -DHAVE_RARCH_EXEC -DHAVE_RSOUND -DHAVE_ZLIB -DHAVE_RPNG -D__CELLOS_LV2__ -DHAVE_NETWORKING=1 -DHAVE_SOCKET_LEGACY=1 -DHAVE_MOUSE -DHAVE_GRIFFIN=1 -DHAVE_MULTIMAN=0 -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT) -DHAVE_STB_VORBIS
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
PPU_OPTIMIZE_LV := -O0 -g
|
||||
else
|
||||
PPU_OPTIMIZE_LV := -O3 -g
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_LOGGER), 1)
|
||||
DEFINES += -DHAVE_LOGGER
|
||||
endif
|
||||
|
||||
PPU_CFLAGS := $(PPU_OPTIMIZE_LV) $(INCDIRS) $(DEFINES)
|
||||
PPU_CXXFLAGS := $(PPU_OPTIMIZE_LV) $(INCDIRS) $(DEFINES)
|
||||
|
||||
EXIST_EBOOT_WILDCARD := $(wildcard $(EBOOT_PATH))
|
||||
EXIST_CORE_WILDCARD := $(wildcard $(CORE_PATH))
|
||||
|
||||
EBOOT_EXISTS = 1
|
||||
CORE_EXISTS = 1
|
||||
|
||||
ifneq ($(strip $(EXIST_EBOOT_WILDCARD)),)
|
||||
EBOOT_EXISTS = 0
|
||||
endif
|
||||
|
||||
ifneq ($(strip $(EXIST_CORE_WILDCARD)),)
|
||||
CORE_EXISTS = 0
|
||||
endif
|
||||
|
||||
include $(CELL_MK_DIR)/sdk.target.mk
|
||||
|
||||
MAKE_FSELF = $(CELL_SDK)/host-win32/bin/make_fself.exe
|
||||
MAKE_FSELF_NPDRM = $(CELL_SDK)/host-win32/bin/make_fself_npdrm.exe
|
||||
MAKE_PACKAGE_NPDRM = $(CELL_SDK)/host-win32/bin/make_package_npdrm.exe
|
||||
|
||||
.PHONY: create-npdrm-core create-core create-npdrm-salamander create-shaders clean-selfs create-salamander
|
||||
|
||||
create-npdrm-core:
|
||||
$(MAKE_FSELF_NPDRM) $(PPU_TARGET) $(CORE_PATH)
|
||||
|
||||
create-core:
|
||||
$(MAKE_SELF_WC) $(PPU_TARGET) $(CORE_PATH)
|
||||
|
||||
create-npdrm-salamander:
|
||||
$(MAKE_FSELF_NPDRM) $(SALAMANDER_TARGET) $(EBOOT_PATH)
|
||||
|
||||
create-salamander:
|
||||
$(MAKE_SELF) $(SALAMANDER_TARGET) $(EBOOT_PATH) $(CONTENT_ID_FULL)
|
||||
|
||||
copy-media-files:
|
||||
@cp -r $(ASSETS_DIR)/glui pkg/ps3/USRDIR/cores/assets
|
||||
@cp -r $(ASSETS_DIR)/xmb pkg/ps3/USRDIR/cores/assets
|
||||
|
||||
create-shaders:
|
||||
make -f Makefile.shaders deploy-ps3
|
||||
|
||||
pkg: $(PPU_TARGET) create-shaders copy-media-files create-npdrm-salamander create-npdrm-core
|
||||
$(MAKE_PACKAGE_NPDRM) pkg/ps3/package.conf pkg/ps3
|
||||
|
||||
pkg-signed: $(PPU_TARGET) create-shaders copy-media-files create-salamander create-core
|
||||
$(PYTHON2) $(PKG_SCRIPT) --contentid $(CONTENT_ID_FULL) pkg/ps3 retroarch-ps3-cfw-$(PACKAGE_VERSION).pkg
|
||||
|
||||
pkg-signed-standalone: $(PPU_TARGET) create-shaders copy-media-files create-core
|
||||
$(MAKE_SELF) $(PPU_TARGET) $(EBOOT_PATH) $(CONTENT_ID)
|
||||
$(PYTHON2) $(PKG_SCRIPT) --contentid $(CONTENT_ID_FULL) pkg/ps3 retroarch-ps3-cfw-$(PACKAGE_VERSION).pkg
|
||||
|
||||
pkg-signed-cfw: $(PPU_TARGET) create-shaders copy-media-files create-salamander create-core
|
||||
$(PYTHON2) $(PKG_SCRIPT) --contentid $(CONTENT_ID_FULL) pkg/ps3 retroarch-ps3-cfw-$(PACKAGE_VERSION)-kmeaw.pkg
|
||||
$(PKG_FINALIZE) retroarch-ps3-cfw-$(PACKAGE_VERSION)-kmeaw.pkg
|
||||
|
||||
pkg-signed-cfw-standalone: $(PPU_TARGET) create-shaders copy-media-files create-core
|
||||
$(MAKE_SELF) $(PPU_TARGET) $(EBOOT_PATH) $(CONTENT_ID)
|
||||
$(PYTHON2) $(PKG_SCRIPT) --contentid $(CONTENT_ID_FULL) pkg/ps3 retroarch-ps3-cfw-$(PACKAGE_VERSION).pkg
|
||||
$(PKG_FINALIZE) retroarch-ps3-cfw-$(PACKAGE_VERSION)-kmeaw.pkg
|
||||
|
||||
clean-selfs:
|
||||
ifeq ($(EBOOT_EXISTS),1)
|
||||
@echo "WARNING: Couldn't find file to delete: [$(EBOOT_PATH)], skipping this step."
|
||||
else
|
||||
rm $(EBOOT_PATH)
|
||||
endif
|
||||
ifeq ($(CORE_EXISTS),1)
|
||||
@echo "WARNING: Couldn't find file to delete: [$(CORE_PATH)], skipping this step."
|
||||
else
|
||||
rm $(CORE_PATH)
|
||||
endif
|
||||
@@ -0,0 +1,91 @@
|
||||
CELL_BUILD_TOOLS = GCC
|
||||
CELL_SDK ?= /usr/local/cell
|
||||
HAVE_LOGGER = 0
|
||||
CELL_MK_DIR ?= $(CELL_SDK)/samples/mk
|
||||
|
||||
include $(CELL_MK_DIR)/sdk.makedef.mk
|
||||
|
||||
# system platform
|
||||
system_platform = unix
|
||||
ifeq ($(shell uname -a),)
|
||||
EXE_EXT = .exe
|
||||
system_platform = win
|
||||
else ifneq ($(findstring Darwin,$(shell uname -a)),)
|
||||
system_platform = osx
|
||||
else ifneq ($(findstring MINGW,$(shell uname -a)),)
|
||||
system_platform = win
|
||||
endif
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
PPU_OPTIMIZE_LV := -O0 -g
|
||||
else
|
||||
PPU_OPTIMIZE_LV := -O2 -DNDEBUG
|
||||
endif
|
||||
|
||||
STRIP = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-strip.exe
|
||||
|
||||
INCFLAGS = -I. -Idefines -Ilibretro-common/include -Ilibretro-common/include/compat/zlib
|
||||
DEFINES = -D__CELLOS_LV2__ -DIS_SALAMANDER -DRARCH_CONSOLE -DHAVE_SYSUTILS -DHAVE_SYSMODULES -DHAVE_RARCH_EXEC
|
||||
|
||||
ifeq ($(DEX_BUILD), 1)
|
||||
DEFINES += -DDEX_BUILD
|
||||
endif
|
||||
|
||||
ifeq ($(CEX_BUILD), 1)
|
||||
DEFINES += -DCEX_BUILD
|
||||
endif
|
||||
|
||||
ifeq ($(ODE_BUILD), 1)
|
||||
DEFINES += -DODE_BUILD
|
||||
endif
|
||||
|
||||
PPU_CFLAGS := $(PPU_OPTIMIZE_LV) $(INCFLAGS) $(DEFINES)
|
||||
PPU_CXXFLAGS := $(PPU_OPTIMIZE_LV) $(INCFLAGS) $(DEFINES)
|
||||
|
||||
PPU_SRCS = frontend/frontend_salamander.c \
|
||||
frontend/frontend_driver.c \
|
||||
frontend/drivers/platform_ps3.c \
|
||||
libretro-common/file/file_path.c \
|
||||
libretro-common/file/file_path_io.c \
|
||||
libretro-common/lists/dir_list.c \
|
||||
libretro-common/lists/string_list.c \
|
||||
libretro-common/file/retro_dirent.c \
|
||||
libretro-common/hash/rhash.c \
|
||||
libretro-common/string/stdstring.c \
|
||||
libretro-common/encodings/encoding_utf.c \
|
||||
libretro-common/compat/compat_strl.c \
|
||||
libretro-common/compat/compat_strcasestr.c \
|
||||
libretro-common/compat/fopen_utf8.c \
|
||||
libretro-common/streams/file_stream.c \
|
||||
libretro-common/vfs/vfs_implementation.c \
|
||||
libretro-common/file/config_file.c \
|
||||
file_path_str.c \
|
||||
verbosity.c
|
||||
|
||||
ifeq ($(HAVE_LOGGER), 1)
|
||||
PPU_CFLAGS += -DHAVE_LOGGER
|
||||
PPU_SRCS += network/net_logger.c \
|
||||
libretro-common/net/net_compat.c \
|
||||
libretro-common/net/net_socket.c
|
||||
endif
|
||||
|
||||
PPU_TARGET = retroarch-salamander_ps3.elf
|
||||
|
||||
ifeq ($(CELL_BUILD_TOOLS),SNC)
|
||||
PPU_CFLAGS += -Xbranchless=1 -Xfastmath=1 -Xassumecorrectsign=1 -Xassumecorrectalignment=1 -Xunroll=1 -Xautovecreg=1
|
||||
PPU_CXXFLAGS += -Xbranchless=1 -Xfastmath=1 -Xassumecorrectsign=1 -Xassumecorrectalignment=1 -Xunroll=1 -Xautovecreg=1
|
||||
PPU_CXXLD = $(CELL_SDK)/host-win32/sn/bin/ps3ppuld.exe
|
||||
PPU_CLD = $(CELL_SDK)/host-win32/sn/bin/ps3ppuld.exe
|
||||
PPU_CC = $(CELL_SDK)/host-win32/sn/bin/ps3ppusnc.exe
|
||||
else
|
||||
PPU_CFLAGS += -std=gnu99
|
||||
PPU_CC = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-gcc.exe
|
||||
PPU_CLD = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ld.exe
|
||||
PPU_CXXLD = $(CELL_SDK)/host-win32/sn/bin/ps3ppuld.exe
|
||||
endif
|
||||
|
||||
PPU_LDLIBS += -lm -lnet_stub -lnetctl_stub -lio_stub -lsysmodule_stub -lsysutil_stub -lsysutil_game_stub -lfs_stub -lsysutil_np_stub
|
||||
|
||||
MAKE_FSELF = $(CELL_SDK)/host-win32/bin/make_fself.exe
|
||||
|
||||
include $(CELL_MK_DIR)/sdk.target.mk
|
||||
+4
-4
@@ -27,13 +27,13 @@ ELF_TARGET := retroarch_psl1ght.elf
|
||||
SELF_TARGET := $(ELF_TARGET:.elf=.self)
|
||||
CORE_PATH = pkg/psl1ght/pkg/USRDIR/cores/CORE.SELF
|
||||
|
||||
INCLUDE += -I. -Ips3/gcmgl/include/export -Ips3/include -Ideps -Ideps/stb -Ilibretro-common/include/compat/zlib -Ilibretro-common/include $(LIBPSL1GHT_INC) -Iinclude -Idefines
|
||||
INCLUDE += -I. -Ips3/gcmgl/include/export -Ips3/include -Ideps -Ideps/stb -Ilibretro-common/include/compat/zlib -Ilibretro-common/include $(LIBPSL1GHT_INC) -Iinclude
|
||||
LIBDIRS += -L.
|
||||
|
||||
MACHDEP := -D__PSL1GHT__ -mcpu=cell
|
||||
MACHDEP := -D__CELLOS_LV2__ -D__PSL1GHT__ -mcpu=cell
|
||||
CFLAGS += -Wall $(MACHDEP) $(INCLUDE)
|
||||
LDFLAGS := $(MACHDEP)
|
||||
LIBS := -lretro_psl1ght -laudio -lrsx -lgcm_sys -lnet -lio -lsysutil -lsysmodule -lm -ljpgdec -lpngdec -llv2 -lnet -lnetctl -lsysfs
|
||||
LIBS := -lretro_psl1ght -laudio -lrsx -lgcm_sys -lnet -lio -lsysutil -lsysmodule -lm -ljpgdec -lpngdec -llv2 -lnet -lnetctl
|
||||
|
||||
# system platform
|
||||
system_platform = unix
|
||||
@@ -66,7 +66,7 @@ endif
|
||||
SHARED_FLAGS :=
|
||||
|
||||
SHARED_FLAGS += -DHAVE_VIDEO_LAYOUT
|
||||
SHARED_FLAGS += -DHAVE_MENU -DHAVE_CONFIGFILE -DHAVE_PATCH -DHAVE_CHEATS -DRARCH_CONSOLE -DHAVE_OVERLAY -DHAVE_HEADSET -DHAVE_CG -DHAVE_CG_RUNTIME_COMPILER -DHAVE_GCMGL -DHAVE_SYSMODULES -DHAVE_SYSUTILS -DHAVE_RARCH_EXEC -DHAVE_MOUSE -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_GRIFFIN=1 -DHAVE_NETWORKING=1 -DHAVE_SOCKET_LEGACY=1 -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT) -Wno-char-subscripts -DHAVE_CC_RESAMPLER -DRARCH_INTERNAL -DHAVE_SCREENSHOTS -DHAVE_REWIND -DHAVE_MULTIMAN -DHAVE_RGUI
|
||||
SHARED_FLAGS += -DHAVE_MENU -DHAVE_CONFIGFILE -DRARCH_CONSOLE -DHAVE_OVERLAY -DHAVE_HEADSET -DHAVE_CG -DHAVE_CG_RUNTIME_COMPILER -DHAVE_GCMGL -DHAVE_SYSMODULES -DHAVE_SYSUTILS -DHAVE_RARCH_EXEC -DHAVE_MOUSE -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_GRIFFIN=1 -DHAVE_NETWORKING=1 -DHAVE_SOCKET_LEGACY=1 -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT) -Wno-char-subscripts -DHAVE_CC_RESAMPLER -DRARCH_INTERNAL -DHAVE_MULTIMAN -DHAVE_RGUI
|
||||
CFLAGS += -std=gnu99 $(SHARED_FLAGS)
|
||||
CXXFLAGS += $(SHARED_FLAGS)
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ EBOOT_PATH = pkg/psl1ght/pkg/USRDIR/EBOOT.BIN
|
||||
INCLUDE += -I. -Ips3/gcmgl/include/export -Ips3/include -Ideps -Ideps/stb -Ilibretro-common/include/compat/zlib -Ilibretro-common/include $(LIBPSL1GHT_INC) -Iinclude
|
||||
LIBDIRS += -L.
|
||||
|
||||
MACHDEP := -D__PSL1GHT__ -mcpu=cell -mhard-float -fmodulo-sched -ffunction-sections -fdata-sections
|
||||
MACHDEP := -D__CELLOS_LV2__ -D__PSL1GHT__ -mcpu=cell -mhard-float -fmodulo-sched -ffunction-sections -fdata-sections
|
||||
CFLAGS += -Wall $(MACHDEP) $(INCLUDE)
|
||||
LDFLAGS := $(MACHDEP)
|
||||
LIBS := -lgcm_sys -lrsx -lsysutil -lio -lnet -lsysmodule -lrt -llv2 -lm
|
||||
@@ -61,7 +61,7 @@ OBJ = frontend/frontend_salamander.o \
|
||||
libretro-common/lists/dir_list.o \
|
||||
libretro-common/lists/string_list.o \
|
||||
libretro-common/file/retro_dirent.o \
|
||||
libretro-common/hash/lrc_hash.o \
|
||||
libretro-common/hash/rhash.o \
|
||||
libretro-common/string/stdstring.o \
|
||||
libretro-common/encodings/encoding_utf.o \
|
||||
libretro-common/compat/compat_strl.o \
|
||||
@@ -70,8 +70,8 @@ OBJ = frontend/frontend_salamander.o \
|
||||
libretro-common/streams/file_stream.o \
|
||||
libretro-common/vfs/vfs_implementation.o \
|
||||
libretro-common/file/config_file.o \
|
||||
libretro-common/time/rtime.o \
|
||||
verbosity.o
|
||||
file_path_str.o \
|
||||
verbosity.o
|
||||
|
||||
ifeq ($(HAVE_LOGGER), 1)
|
||||
CFLAGS += -DHAVE_LOGGER
|
||||
|
||||
+7
-1
@@ -2,6 +2,8 @@ BUILD_PRX = 0
|
||||
PSP_LARGE_MEMORY = 1
|
||||
DEBUG = 0
|
||||
HAVE_KERNEL_PRX = 1
|
||||
HAVE_LOGGER = 0
|
||||
HAVE_FILE_LOGGER = 0
|
||||
HAVE_THREADS = 1
|
||||
BIG_STACK = 0
|
||||
WHOLE_ARCHIVE_LINK = 0
|
||||
@@ -23,7 +25,7 @@ INCDIR = deps deps/stb deps/7zip deps/pthreads deps/pthreads/platform/psp deps/p
|
||||
CFLAGS = $(OPTIMIZE_LV) -G0 -std=gnu99 -ffast-math -fsingle-precision-constant
|
||||
ASFLAGS = $(CFLAGS)
|
||||
|
||||
RARCH_DEFINES = -DPSP -D_MIPS_ARCH_ALLEGREX -DHAVE_LANGEXTRA -DHAVE_ZLIB -DHAVE_AUDIOMIXER -DHAVE_RWAV -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_GRIFFIN=1 -DRARCH_INTERNAL -DHAVE_SCREENSHOTS -DHAVE_REWIND -DRARCH_CONSOLE -DHAVE_MENU -DHAVE_CONFIGFILE -DHAVE_PATCH -DHAVE_CHEATS -DHAVE_RGUI -DHAVE_FILTERS_BUILTIN -DHAVE_DSP_FILTER -DHAVE_VIDEO_FILTER -DHAVE_7ZIP -D_7ZIP_ST -DHAVE_CC_RESAMPLER
|
||||
RARCH_DEFINES = -DPSP -D_MIPS_ARCH_ALLEGREX -DHAVE_LANGEXTRA -DHAVE_ZLIB -DHAVE_AUDIOMIXER -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_GRIFFIN=1 -DRARCH_INTERNAL -DRARCH_CONSOLE -DHAVE_MENU -DHAVE_CONFIGFILE -DHAVE_RGUI -DHAVE_FILTERS_BUILTIN -DHAVE_7ZIP -DHAVE_CC_RESAMPLER
|
||||
|
||||
LIBDIR =
|
||||
LDFLAGS =
|
||||
@@ -33,6 +35,10 @@ ifeq ($(HAVE_THREADS), 1)
|
||||
RARCH_DEFINES += -DHAVE_THREADS
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_FILE_LOGGER), 1)
|
||||
CFLAGS += -DHAVE_FILE_LOGGER
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_KERNEL_PRX), 1)
|
||||
CFLAGS += -DHAVE_KERNEL_PRX
|
||||
endif
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
BUILD_PRX = 0
|
||||
PSP_LARGE_MEMORY = 1
|
||||
HAVE_FILE_LOGGER = 0
|
||||
DEBUG = 0
|
||||
|
||||
TARGET = retroarchpsp_salamander
|
||||
@@ -20,6 +21,10 @@ LIBDIR =
|
||||
LDFLAGS =
|
||||
LIBS = -lstdc++ -lm -lpsppower
|
||||
|
||||
ifeq ($(HAVE_FILE_LOGGER), 1)
|
||||
CFLAGS += -DHAVE_FILE_LOGGER
|
||||
endif
|
||||
|
||||
CFLAGS += $(RARCH_DEFINES)
|
||||
|
||||
EXTRA_TARGETS = EBOOT.PBP
|
||||
@@ -43,8 +48,8 @@ OBJS = frontend/frontend_salamander.o \
|
||||
libretro-common/file/config_file.o \
|
||||
libretro-common/streams/file_stream.o \
|
||||
libretro-common/vfs/vfs_implementation.o \
|
||||
libretro-common/hash/lrc_hash.o \
|
||||
libretro-common/time/rtime.o \
|
||||
libretro-common/hash/rhash.o \
|
||||
file_path_str.o \
|
||||
verbosity.o \
|
||||
bootstrap/psp1/kernel_functions.o
|
||||
|
||||
|
||||
-229
@@ -1,229 +0,0 @@
|
||||
#########################
|
||||
## Toolchain variables ##
|
||||
#########################
|
||||
|
||||
# Default toolchain directory
|
||||
TOOLCHAIN_DIR=/opt/gcw0-toolchain
|
||||
|
||||
# All toolchain-related variables may be
|
||||
# overridden via the command line
|
||||
ifdef GCW0_CC
|
||||
CC = $(GCW0_CC)
|
||||
else
|
||||
CC = $(TOOLCHAIN_DIR)/usr/bin/mipsel-gcw0-linux-uclibc-gcc
|
||||
endif
|
||||
|
||||
ifdef GCW0_CXX
|
||||
CXX = $(GCW0_CXX)
|
||||
else
|
||||
CXX = $(TOOLCHAIN_DIR)/usr/bin/mipsel-gcw0-linux-uclibc-g++
|
||||
endif
|
||||
|
||||
ifdef GCW0_STRIP
|
||||
STRIP = $(GCW0_STRIP)
|
||||
else
|
||||
STRIP = $(TOOLCHAIN_DIR)/usr/bin/mipsel-gcw0-linux-uclibc-strip
|
||||
endif
|
||||
|
||||
GCW0_SDL_CONFIG ?= $(TOOLCHAIN_DIR)/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/bin/sdl-config
|
||||
GCW0_FREETYPE_CONFIG ?= $(TOOLCHAIN_DIR)/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/bin/freetype-config
|
||||
GCW0_MK_SQUASH_FS ?= $(TOOLCHAIN_DIR)/usr/bin/mksquashfs
|
||||
|
||||
GCW0_INC_DIR ?= $(TOOLCHAIN_DIR)/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/include
|
||||
GCW0_LIB_DIR ?= $(TOOLCHAIN_DIR)/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/lib
|
||||
|
||||
#########################
|
||||
#########################
|
||||
|
||||
PACKAGE_NAME = retroarch
|
||||
|
||||
DEBUG ?= 0
|
||||
|
||||
DINGUX = 1
|
||||
HAVE_SCREENSHOTS = 0
|
||||
HAVE_REWIND = 1
|
||||
HAVE_7ZIP = 1
|
||||
HAVE_AL = 1
|
||||
# ALSA freezes when switching back from menu
|
||||
HAVE_ALSA = 0
|
||||
HAVE_DSP_FILTER = 1
|
||||
HAVE_VIDEO_FILTER = 1
|
||||
HAVE_STATIC_VIDEO_FILTERS = 1
|
||||
HAVE_STATIC_AUDIO_FILTERS = 1
|
||||
HAVE_FILTERS_BUILTIN = 1
|
||||
HAVE_BUILTINMBEDTLS = 0
|
||||
HAVE_BUILTINZLIB = 1
|
||||
HAVE_C99 = 1
|
||||
HAVE_CC = 1
|
||||
HAVE_CC_RESAMPLER = 1
|
||||
HAVE_CHD = 1
|
||||
HAVE_COMMAND = 0
|
||||
HAVE_CXX = 1
|
||||
HAVE_DR_MP3 = 1
|
||||
HAVE_DYNAMIC = 1
|
||||
HAVE_EGL = 0
|
||||
HAVE_FREETYPE = 0
|
||||
HAVE_GDI = 1
|
||||
HAVE_GETADDRINFO = 0
|
||||
HAVE_GETOPT_LONG = 1
|
||||
HAVE_GLSL = 0
|
||||
HAVE_HID = 1
|
||||
HAVE_IBXM = 1
|
||||
HAVE_IMAGEVIEWER = 1
|
||||
HAVE_LANGEXTRA = 0
|
||||
HAVE_LIBRETRODB = 1
|
||||
HAVE_MENU = 1
|
||||
HAVE_MENU_COMMON = 1
|
||||
HAVE_GFX_WIDGETS = 0
|
||||
HAVE_MMAP = 1
|
||||
HAVE_OPENDINGUX_FBDEV = 0
|
||||
HAVE_OPENGL = 0
|
||||
HAVE_OPENGL1 = 0
|
||||
HAVE_OPENGLES = 0
|
||||
HAVE_OPENGLES3 = 0
|
||||
HAVE_OPENGL_CORE = 0
|
||||
HAVE_OPENSSL = 1
|
||||
HAVE_OVERLAY = 0
|
||||
HAVE_RBMP = 1
|
||||
HAVE_RJPEG = 1
|
||||
HAVE_RPILED = 0
|
||||
HAVE_RPNG = 1
|
||||
HAVE_RUNAHEAD = 1
|
||||
HAVE_SDL_DINGUX = 1
|
||||
HAVE_SHADERPIPELINE = 0
|
||||
HAVE_STB_FONT = 0
|
||||
HAVE_STB_IMAGE = 1
|
||||
HAVE_STB_VORBIS = 1
|
||||
HAVE_STDIN_CMD = 0
|
||||
HAVE_STRCASESTR = 1
|
||||
HAVE_THREADS = 1
|
||||
HAVE_UDEV = 1
|
||||
HAVE_RGUI = 1
|
||||
HAVE_MATERIALUI = 0
|
||||
HAVE_XMB = 0
|
||||
HAVE_OZONE = 0
|
||||
HAVE_ZLIB = 1
|
||||
HAVE_CONFIGFILE = 1
|
||||
HAVE_PATCH = 1
|
||||
HAVE_CHEATS = 1
|
||||
HAVE_CHEEVOS = 0
|
||||
HAVE_LIBSHAKE = 1
|
||||
|
||||
OS = Linux
|
||||
TARGET = retroarch
|
||||
OPK_NAME = retroarch_rg350.opk
|
||||
|
||||
OBJ :=
|
||||
LINK := $(CXX)
|
||||
DEF_FLAGS := -march=mips32 -mtune=mips32r2 -mhard-float -ffast-math -fomit-frame-pointer
|
||||
DEF_FLAGS += -mplt -mno-shared
|
||||
DEF_FLAGS += -ffunction-sections -fdata-sections
|
||||
DEF_FLAGS += -I. -Ideps -Ideps/stb -DDINGUX=1 -MMD
|
||||
DEF_FLAGS += -Wall -Wno-unused-variable
|
||||
DEF_FLAGS += -std=gnu99 -D_GNU_SOURCE -flto
|
||||
LIBS := -ldl -lz -lrt -ludev -pthread
|
||||
CFLAGS :=
|
||||
CXXFLAGS := -fno-exceptions -fno-rtti -std=c++11 -D__STDC_CONSTANT_MACROS
|
||||
ASFLAGS :=
|
||||
LDFLAGS := -Wl,--gc-sections
|
||||
INCLUDE_DIRS = -I$(GCW0_INC_DIR)
|
||||
LIBRARY_DIRS = -L$(GCW0_LIB_DIR)
|
||||
DEFINES := -DRARCH_INTERNAL -D_FILE_OFFSET_BITS=64 -UHAVE_STATIC_DUMMY
|
||||
DEFINES += -DHAVE_C99=1 -DHAVE_CXX=1
|
||||
DEFINES += -DHAVE_GETOPT_LONG=1 -DHAVE_STRCASESTR=1 -DHAVE_DYNAMIC=1
|
||||
DEFINES += -DHAVE_AL=1
|
||||
DEFINES += -DHAVE_FILTERS_BUILTIN
|
||||
DEFINES += -DHAVE_UDEV=1
|
||||
|
||||
SDL_DINGUX_CFLAGS := $(shell $(GCW0_SDL_CONFIG) --cflags)
|
||||
SDL_DINGUX_LIBS := $(shell $(GCW0_SDL_CONFIG) --libs)
|
||||
FREETYPE_CFLAGS := $(shell $(GCW0_FREETYPE_CONFIG) --cflags)
|
||||
FREETYPE_LIBS := $(shell $(GCW0_FREETYPE_CONFIG) --libs)
|
||||
AL_LIBS := -lopenal
|
||||
MMAP_LIBS = -lc
|
||||
|
||||
OBJDIR_BASE := obj-unix
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
OBJDIR := $(OBJDIR_BASE)/debug
|
||||
DEF_FLAGS += -O0 -g -DDEBUG -D_DEBUG
|
||||
else
|
||||
OBJDIR := $(OBJDIR_BASE)/release
|
||||
DEF_FLAGS += -O2 -DNDEBUG
|
||||
endif
|
||||
|
||||
include Makefile.common
|
||||
|
||||
DEF_FLAGS += $(INCLUDE_DIRS)
|
||||
LDFLAGS += $(CFLAGS) $(CXXFLAGS) $(DEF_FLAGS)
|
||||
CFLAGS += $(DEF_FLAGS)
|
||||
CXXFLAGS += $(DEF_FLAGS)
|
||||
|
||||
HEADERS = $(wildcard */*/*.h) $(wildcard */*.h) $(wildcard *.h)
|
||||
|
||||
Q := @
|
||||
|
||||
RARCH_OBJ := $(addprefix $(OBJDIR)/,$(OBJ))
|
||||
|
||||
define DESKTOP_ENTRY
|
||||
[Desktop Entry]
|
||||
Name=RetroArch
|
||||
Comment=Frontend for emulators, game engines
|
||||
Exec=retroarch
|
||||
Terminal=false
|
||||
Type=Application
|
||||
StartupNotify=true
|
||||
Icon=retroarch
|
||||
Categories=emulators;
|
||||
X-OD-NeedsDownscaling=true
|
||||
endef
|
||||
export DESKTOP_ENTRY
|
||||
|
||||
all: $(TARGET) opk
|
||||
|
||||
-include $(RARCH_OBJ:.o=.d)
|
||||
|
||||
SYMBOL_MAP := -Wl,-Map=output.map
|
||||
|
||||
$(TARGET): $(RARCH_OBJ)
|
||||
@$(if $(Q), $(shell echo echo LD $@),)
|
||||
$(Q)$(LINK) -o $@ $(RARCH_OBJ) $(LIBS) $(LDFLAGS) $(LIBRARY_DIRS)
|
||||
|
||||
$(OBJDIR)/%.o: %.c
|
||||
@mkdir -p $(dir $@)
|
||||
@$(if $(Q), $(shell echo echo CC $<),)
|
||||
$(Q)$(CC) $(CPPFLAGS) $(CFLAGS) $(DEFINES) -c -o $@ $<
|
||||
|
||||
$(OBJDIR)/%.o: %.cpp
|
||||
@mkdir -p $(dir $@)
|
||||
@$(if $(Q), $(shell echo echo CXX $<),)
|
||||
$(Q)$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) -MMD -c -o $@ $<
|
||||
|
||||
$(OBJDIR)/%.o: %.m
|
||||
@mkdir -p $(dir $@)
|
||||
@$(if $(Q), $(shell echo echo OBJC $<),)
|
||||
$(Q)$(CXX) $(OBJCFLAGS) $(DEFINES) -MMD -c -o $@ $<
|
||||
|
||||
$(OBJDIR)/%.o: %.S $(HEADERS)
|
||||
@mkdir -p $(dir $@)
|
||||
@$(if $(Q), $(shell echo echo AS $<),)
|
||||
$(Q)$(CC) $(CFLAGS) $(ASFLAGS) $(DEFINES) -c -o $@ $<
|
||||
|
||||
clean:
|
||||
rm -rf $(OBJDIR_BASE)
|
||||
rm -f $(TARGET)
|
||||
rm -f *.d
|
||||
rm -rf $(OPK_NAME)
|
||||
|
||||
opk: $(TARGET)
|
||||
echo "$$DESKTOP_ENTRY" > default.gcw0.desktop
|
||||
rm -f $(OPK_NAME)
|
||||
cp media/ico_src/icon32.png retroarch.png
|
||||
if [ $$STRIP_BIN -eq 1 ]; then $(STRIP) --strip-unneeded retroarch; fi
|
||||
$(GCW0_MK_SQUASH_FS) retroarch default.gcw0.desktop retroarch.png $(OPK_NAME) -all-root -no-xattrs -noappend -no-exports
|
||||
rm -f default.gcw0.desktop retroarch.png
|
||||
|
||||
.PHONY: all clean opk
|
||||
|
||||
print-%:
|
||||
@echo '$*=$($*)'
|
||||
@@ -1,229 +0,0 @@
|
||||
#########################
|
||||
## Toolchain variables ##
|
||||
#########################
|
||||
|
||||
# Default toolchain directory
|
||||
TOOLCHAIN_DIR=/opt/gcw0-toolchain
|
||||
|
||||
# All toolchain-related variables may be
|
||||
# overridden via the command line
|
||||
ifdef GCW0_CC
|
||||
CC = $(GCW0_CC)
|
||||
else
|
||||
CC = $(TOOLCHAIN_DIR)/usr/bin/mipsel-gcw0-linux-uclibc-gcc
|
||||
endif
|
||||
|
||||
ifdef GCW0_CXX
|
||||
CXX = $(GCW0_CXX)
|
||||
else
|
||||
CXX = $(TOOLCHAIN_DIR)/usr/bin/mipsel-gcw0-linux-uclibc-g++
|
||||
endif
|
||||
|
||||
ifdef GCW0_STRIP
|
||||
STRIP = $(GCW0_STRIP)
|
||||
else
|
||||
STRIP = $(TOOLCHAIN_DIR)/usr/bin/mipsel-gcw0-linux-uclibc-strip
|
||||
endif
|
||||
|
||||
GCW0_SDL_CONFIG ?= $(TOOLCHAIN_DIR)/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/bin/sdl-config
|
||||
GCW0_FREETYPE_CONFIG ?= $(TOOLCHAIN_DIR)/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/bin/freetype-config
|
||||
GCW0_MK_SQUASH_FS ?= $(TOOLCHAIN_DIR)/usr/bin/mksquashfs
|
||||
|
||||
GCW0_INC_DIR ?= $(TOOLCHAIN_DIR)/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/include
|
||||
GCW0_LIB_DIR ?= $(TOOLCHAIN_DIR)/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/lib
|
||||
|
||||
#########################
|
||||
#########################
|
||||
|
||||
PACKAGE_NAME = retroarch
|
||||
|
||||
DEBUG ?= 0
|
||||
|
||||
DINGUX = 1
|
||||
DINGUX_BETA = 1
|
||||
HAVE_SCREENSHOTS = 0
|
||||
HAVE_REWIND = 1
|
||||
HAVE_7ZIP = 1
|
||||
HAVE_AL = 1
|
||||
# ALSA freezes when switching back from menu
|
||||
HAVE_ALSA = 0
|
||||
HAVE_DSP_FILTER = 1
|
||||
HAVE_VIDEO_FILTER = 1
|
||||
HAVE_STATIC_VIDEO_FILTERS = 1
|
||||
HAVE_STATIC_AUDIO_FILTERS = 1
|
||||
HAVE_FILTERS_BUILTIN = 1
|
||||
HAVE_BUILTINMBEDTLS = 0
|
||||
HAVE_BUILTINZLIB = 1
|
||||
HAVE_C99 = 1
|
||||
HAVE_CC = 1
|
||||
HAVE_CC_RESAMPLER = 1
|
||||
HAVE_CHD = 1
|
||||
HAVE_COMMAND = 0
|
||||
HAVE_CXX = 1
|
||||
HAVE_DR_MP3 = 1
|
||||
HAVE_DYNAMIC = 1
|
||||
HAVE_EGL = 0
|
||||
HAVE_FREETYPE = 0
|
||||
HAVE_GDI = 1
|
||||
HAVE_GETADDRINFO = 0
|
||||
HAVE_GETOPT_LONG = 1
|
||||
HAVE_GLSL = 0
|
||||
HAVE_HID = 1
|
||||
HAVE_IBXM = 1
|
||||
HAVE_IMAGEVIEWER = 1
|
||||
HAVE_LANGEXTRA = 0
|
||||
HAVE_LIBRETRODB = 1
|
||||
HAVE_MENU = 1
|
||||
HAVE_MENU_COMMON = 1
|
||||
HAVE_GFX_WIDGETS = 0
|
||||
HAVE_MMAP = 1
|
||||
HAVE_OPENDINGUX_FBDEV = 0
|
||||
HAVE_OPENGL = 0
|
||||
HAVE_OPENGL1 = 0
|
||||
HAVE_OPENGLES = 0
|
||||
HAVE_OPENGLES3 = 0
|
||||
HAVE_OPENGL_CORE = 0
|
||||
HAVE_OPENSSL = 1
|
||||
HAVE_OVERLAY = 0
|
||||
HAVE_RBMP = 1
|
||||
HAVE_RJPEG = 1
|
||||
HAVE_RPILED = 0
|
||||
HAVE_RPNG = 1
|
||||
HAVE_RUNAHEAD = 1
|
||||
HAVE_SDL_DINGUX = 1
|
||||
HAVE_SHADERPIPELINE = 0
|
||||
HAVE_STB_FONT = 0
|
||||
HAVE_STB_IMAGE = 1
|
||||
HAVE_STB_VORBIS = 1
|
||||
HAVE_STDIN_CMD = 0
|
||||
HAVE_STRCASESTR = 1
|
||||
HAVE_THREADS = 1
|
||||
HAVE_UDEV = 1
|
||||
HAVE_RGUI = 1
|
||||
HAVE_MATERIALUI = 0
|
||||
HAVE_XMB = 0
|
||||
HAVE_OZONE = 0
|
||||
HAVE_ZLIB = 1
|
||||
HAVE_CONFIGFILE = 1
|
||||
HAVE_PATCH = 1
|
||||
HAVE_CHEATS = 1
|
||||
HAVE_CHEEVOS = 0
|
||||
HAVE_LIBSHAKE = 1
|
||||
|
||||
OS = Linux
|
||||
TARGET = retroarch
|
||||
OPK_NAME = retroarch_rg350_odbeta.opk
|
||||
|
||||
OBJ :=
|
||||
LINK := $(CXX)
|
||||
DEF_FLAGS := -mplt -mno-shared
|
||||
DEF_FLAGS += -ffunction-sections -fdata-sections
|
||||
DEF_FLAGS += -I. -Ideps -Ideps/stb -DDINGUX=1 -DDINGUX_BETA=1 -MMD
|
||||
DEF_FLAGS += -Wall -Wno-unused-variable
|
||||
DEF_FLAGS += -std=gnu99 -D_GNU_SOURCE -flto
|
||||
LIBS := -ldl -lz -lrt -ludev -pthread
|
||||
CFLAGS :=
|
||||
CXXFLAGS := -fno-exceptions -fno-rtti -std=c++11 -D__STDC_CONSTANT_MACROS
|
||||
ASFLAGS :=
|
||||
LDFLAGS := -Wl,--gc-sections
|
||||
INCLUDE_DIRS = -I$(GCW0_INC_DIR)
|
||||
LIBRARY_DIRS = -L$(GCW0_LIB_DIR)
|
||||
DEFINES := -DRARCH_INTERNAL -D_FILE_OFFSET_BITS=64 -UHAVE_STATIC_DUMMY
|
||||
DEFINES += -DHAVE_C99=1 -DHAVE_CXX=1
|
||||
DEFINES += -DHAVE_GETOPT_LONG=1 -DHAVE_STRCASESTR=1 -DHAVE_DYNAMIC=1
|
||||
DEFINES += -DHAVE_AL=1
|
||||
DEFINES += -DHAVE_FILTERS_BUILTIN
|
||||
DEFINES += -DHAVE_UDEV=1
|
||||
|
||||
SDL_DINGUX_CFLAGS := $(shell $(GCW0_SDL_CONFIG) --cflags)
|
||||
SDL_DINGUX_LIBS := $(shell $(GCW0_SDL_CONFIG) --libs)
|
||||
FREETYPE_CFLAGS := $(shell $(GCW0_FREETYPE_CONFIG) --cflags)
|
||||
FREETYPE_LIBS := $(shell $(GCW0_FREETYPE_CONFIG) --libs)
|
||||
AL_LIBS := -lopenal
|
||||
MMAP_LIBS = -lc
|
||||
|
||||
OBJDIR_BASE := obj-unix
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
OBJDIR := $(OBJDIR_BASE)/debug
|
||||
DEF_FLAGS += -O0 -g -DDEBUG -D_DEBUG
|
||||
else
|
||||
OBJDIR := $(OBJDIR_BASE)/release
|
||||
DEF_FLAGS += -O2 -DNDEBUG
|
||||
endif
|
||||
|
||||
include Makefile.common
|
||||
|
||||
DEF_FLAGS += $(INCLUDE_DIRS)
|
||||
LDFLAGS += $(CFLAGS) $(CXXFLAGS) $(DEF_FLAGS)
|
||||
CFLAGS += $(DEF_FLAGS)
|
||||
CXXFLAGS += $(DEF_FLAGS)
|
||||
|
||||
HEADERS = $(wildcard */*/*.h) $(wildcard */*.h) $(wildcard *.h)
|
||||
|
||||
Q := @
|
||||
|
||||
RARCH_OBJ := $(addprefix $(OBJDIR)/,$(OBJ))
|
||||
|
||||
define DESKTOP_ENTRY
|
||||
[Desktop Entry]
|
||||
Name=RetroArch
|
||||
Comment=Frontend for emulators, game engines
|
||||
Exec=retroarch
|
||||
Terminal=false
|
||||
Type=Application
|
||||
StartupNotify=true
|
||||
Icon=retroarch
|
||||
Categories=emulators;
|
||||
X-OD-NeedsDownscaling=true
|
||||
endef
|
||||
export DESKTOP_ENTRY
|
||||
|
||||
all: $(TARGET) opk
|
||||
|
||||
-include $(RARCH_OBJ:.o=.d)
|
||||
|
||||
SYMBOL_MAP := -Wl,-Map=output.map
|
||||
|
||||
$(TARGET): $(RARCH_OBJ)
|
||||
@$(if $(Q), $(shell echo echo LD $@),)
|
||||
$(Q)$(LINK) -o $@ $(RARCH_OBJ) $(LIBS) $(LDFLAGS) $(LIBRARY_DIRS)
|
||||
|
||||
$(OBJDIR)/%.o: %.c
|
||||
@mkdir -p $(dir $@)
|
||||
@$(if $(Q), $(shell echo echo CC $<),)
|
||||
$(Q)$(CC) $(CPPFLAGS) $(CFLAGS) $(DEFINES) -c -o $@ $<
|
||||
|
||||
$(OBJDIR)/%.o: %.cpp
|
||||
@mkdir -p $(dir $@)
|
||||
@$(if $(Q), $(shell echo echo CXX $<),)
|
||||
$(Q)$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) -MMD -c -o $@ $<
|
||||
|
||||
$(OBJDIR)/%.o: %.m
|
||||
@mkdir -p $(dir $@)
|
||||
@$(if $(Q), $(shell echo echo OBJC $<),)
|
||||
$(Q)$(CXX) $(OBJCFLAGS) $(DEFINES) -MMD -c -o $@ $<
|
||||
|
||||
$(OBJDIR)/%.o: %.S $(HEADERS)
|
||||
@mkdir -p $(dir $@)
|
||||
@$(if $(Q), $(shell echo echo AS $<),)
|
||||
$(Q)$(CC) $(CFLAGS) $(ASFLAGS) $(DEFINES) -c -o $@ $<
|
||||
|
||||
clean:
|
||||
rm -rf $(OBJDIR_BASE)
|
||||
rm -f $(TARGET)
|
||||
rm -f *.d
|
||||
rm -rf $(OPK_NAME)
|
||||
|
||||
opk: $(TARGET)
|
||||
echo "$$DESKTOP_ENTRY" > default.gcw0.desktop
|
||||
rm -f $(OPK_NAME)
|
||||
cp media/ico_src/icon32.png retroarch.png
|
||||
if [ $$STRIP_BIN -eq 1 ]; then $(STRIP) --strip-unneeded retroarch; fi
|
||||
$(GCW0_MK_SQUASH_FS) retroarch default.gcw0.desktop retroarch.png $(OPK_NAME) -all-root -no-xattrs -noappend -no-exports
|
||||
rm -f default.gcw0.desktop retroarch.png
|
||||
|
||||
.PHONY: all clean opk
|
||||
|
||||
print-%:
|
||||
@echo '$*=$($*)'
|
||||
+2
-9
@@ -6,18 +6,16 @@ WHOLE_ARCHIVE_LINK = 0
|
||||
|
||||
OBJ :=
|
||||
|
||||
DEFINES := -DSWITCH=1 -U__linux__ -U__linux -DRARCH_INTERNAL -DHAVE_SCREENSHOTS -DHAVE_DYNAMIC -DHAVE_REWIND
|
||||
DEFINES := -DSWITCH=1 -U__linux__ -U__linux -DRARCH_INTERNAL -DHAVE_DYNAMIC
|
||||
|
||||
ifeq ($(GRIFFIN_BUILD), 1)
|
||||
OBJ += griffin/griffin.o
|
||||
DEFINES += -DHAVE_GRIFFIN=1 -DHAVE_NEON -DHAVE_MATERIALUI -DHAVE_LIBRETRODB -DHAVE_CC_RESAMPLER
|
||||
DEFINES += -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_RBMP -DHAVE_RTGA
|
||||
DEFINES += -DHAVE_RUNAHEAD -DHAVE_DYNAMIC
|
||||
DEFINES += -DHAVE_CONFIGFILE -DHAVE_PATCH -DHAVE_CHEATS
|
||||
DEFINES += -DHAVE_CONFIGFILE
|
||||
else
|
||||
HAVE_REWIND = 1
|
||||
HAVE_AUDIOMIXER = 1
|
||||
HAVE_RWAV = 1
|
||||
HAVE_CC_RESAMPLER = 1
|
||||
HAVE_MENU_COMMON = 1
|
||||
HAVE_RTGA = 1
|
||||
@@ -26,8 +24,6 @@ else
|
||||
HAVE_RBMP = 1
|
||||
HAVE_RGUI = 1
|
||||
HAVE_ZLIB = 1
|
||||
HAVE_DSP_FILTER = 1
|
||||
HAVE_VIDEO_FILTER = 1
|
||||
HAVE_BUILTINZLIB = 1
|
||||
HAVE_LIBRETRODB = 1
|
||||
HAVE_MATERIALUI = 0 # enable later?
|
||||
@@ -38,9 +34,6 @@ else
|
||||
HAVE_CONFIGFILE = 1
|
||||
HAVE_RUNAHEAD = 1
|
||||
HAVE_DYNAMIC = 1
|
||||
HAVE_PATCH = 1
|
||||
HAVE_CHEATS = 1
|
||||
HAVE_IBXM = 1
|
||||
|
||||
include Makefile.common
|
||||
CFLAGS += $(DEF_FLAGS)
|
||||
|
||||
+10
-52
@@ -1,6 +1,5 @@
|
||||
TARGET := retroarch_vita
|
||||
DEBUG ?= 0
|
||||
HAVE_FILE_LOGGER = 1
|
||||
GRIFFIN_BUILD = 0
|
||||
WHOLE_ARCHIVE_LINK = 0
|
||||
|
||||
@@ -12,29 +11,24 @@ PC_DEVELOPMENT_UDP_PORT =
|
||||
|
||||
OBJ :=
|
||||
|
||||
SCE_LIBC_SIZE := 4194304
|
||||
DEFINES := -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_ASSETS
|
||||
INCDIRS :=
|
||||
|
||||
ifeq ($(GRIFFIN_BUILD), 1)
|
||||
OBJ += griffin/griffin.o
|
||||
DEFINES += -DHAVE_GRIFFIN=1
|
||||
DEFINES += -DHAVE_REWIND
|
||||
DEFINES += -DHAVE_NEON -DHAVE_MENU -DHAVE_CONFIGFILE -DHAVE_PATCH -DHAVE_CHEATS -DHAVE_XMB -DHAVE_MATERIALUI -DHAVE_LIBRETRODB DEFINES -DHAVE_KEYMAPPER
|
||||
DEFINES += -DHAVE_NEON -DHAVE_MENU -DHAVE_CONFIGFILE -DHAVE_XMB -DHAVE_MATERIALUI -DHAVE_LIBRETRODB DEFINES -DHAVE_KEYMAPPER
|
||||
DEFINES += -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_RBMP -DHAVE_RTGA -DHAVE_CC_RESAMPLER
|
||||
ifeq ($(DEBUG), 1)
|
||||
DEFINES += -DHAVE_NETLOGGER
|
||||
endif
|
||||
INCDIRS += -I. -Ideps/7zip -Ilibretro-common/include -Ilibretro-common/include/compat/zlib -Ideps/stb
|
||||
else
|
||||
HAVE_REWIND := 1
|
||||
|
||||
HAVE_UPDATE_ASSETS := 1
|
||||
HAVE_ONLINE_UPDATER := 1
|
||||
HAVE_NEON := 1
|
||||
HAVE_MATH_NEON := 1
|
||||
HAVE_DSP_FILTER := 1
|
||||
HAVE_VIDEO_FILTER := 1
|
||||
HAVE_SCREENSHOTS := 1
|
||||
HAVE_FILTERS_BUILTIN := 1
|
||||
HAVE_LANGEXTRA := 1
|
||||
HAVE_RPNG := 1
|
||||
@@ -43,28 +37,14 @@ else
|
||||
HAVE_RTGA := 1
|
||||
HAVE_ZLIB := 1
|
||||
HAVE_7ZIP := 1
|
||||
ifeq ($(HAVE_VITAGLES), 1)
|
||||
HAVE_VITA2D := 0
|
||||
HAVE_VITAGL := 0
|
||||
HAVE_VITAGLES := 1
|
||||
HAVE_OPENGL := 1
|
||||
HAVE_OPENGLES := 1
|
||||
HAVE_OPENGLES2 := 1
|
||||
HAVE_EGL := 1
|
||||
HAVE_GLSL := 1
|
||||
HAVE_SHADERPIPELINE := 1
|
||||
else
|
||||
HAVE_VITA2D := 1
|
||||
HAVE_VITAGL := 0
|
||||
endif
|
||||
HAVE_VITA2D := 1
|
||||
HAVE_VITAGL := 1
|
||||
HAVE_NETWORKING := 1
|
||||
HAVE_SOCKET_LEGACY := 1
|
||||
HAVE_MENU := 1
|
||||
HAVE_MENU_COMMON := 1
|
||||
HAVE_GFX_WIDGETS := 1
|
||||
HAVE_CONFIGFILE := 1
|
||||
HAVE_PATCH := 1
|
||||
HAVE_CHEATS := 1
|
||||
HAVE_OVERLAY := 1
|
||||
HAVE_VIDEO_LAYOUT := 0
|
||||
HAVE_MATERIALUI := 1
|
||||
@@ -80,7 +60,6 @@ else
|
||||
HAVE_STATIC_VIDEO_FILTERS = 1
|
||||
HAVE_STATIC_AUDIO_FILTERS = 1
|
||||
HAVE_AUDIOMIXER := 1
|
||||
HAVE_RWAV := 1
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
HAVE_NETLOGGER = 1
|
||||
@@ -112,7 +91,7 @@ LD := $(CXX)
|
||||
|
||||
LIBDIRS := -L.
|
||||
|
||||
ARCHFLAGS := -march=armv7-a -mfpu=neon -mfloat-abi=hard -DVITA -DSCE_LIBC_SIZE=$(SCE_LIBC_SIZE)
|
||||
ARCHFLAGS := -march=armv7-a -mfpu=neon -mfloat-abi=hard -DVITA
|
||||
CFLAGS += $(ARCHFLAGS) -mword-relocations -fno-optimize-sibling-calls -O2
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
@@ -123,9 +102,7 @@ ASFLAGS := $(CFLAGS)
|
||||
LDFLAGS := -Wl,-q
|
||||
|
||||
CFLAGS += -Wall -ffast-math -g
|
||||
CFLAGS += -DRARCH_INTERNAL -DHAVE_SCREENSHOTS -DRARCH_CONSOLE
|
||||
CFLAGS += -DHAVE_DSP_FILTER
|
||||
CFLAGS += -DHAVE_VIDEO_FILTER
|
||||
CFLAGS += -DRARCH_INTERNAL -DRARCH_CONSOLE
|
||||
CFLAGS += -DHAVE_FILTERS_BUILTIN $(DEFINES)
|
||||
|
||||
ifneq ($(PC_DEVELOPMENT_IP_ADDRESS),)
|
||||
@@ -145,15 +122,7 @@ CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions
|
||||
VITA_LIBS := -lSceDisplay_stub -lSceGxm_stub -lSceNet_stub -lSceNetCtl_stub -lSceAppUtil_stub \
|
||||
-lSceSysmodule_stub -lSceCtrl_stub -lSceHid_stub -lSceTouch_stub -lSceAudio_stub \
|
||||
-lScePower_stub -lSceRtc_stub -lSceCommonDialog_stub -lScePgf_stub -lSceMotion_stub \
|
||||
-lSceFiber_stub -lSceMotion_stub -lSceAppMgr_stub -lpthread -lpng -lz -lSceShaccCg_stub
|
||||
|
||||
ifeq ($(HAVE_VITAGLES), 1)
|
||||
VITA_LIBS += -llibScePiglet_stub -ltaihen_stub
|
||||
FSELF_FLAGS := -ss
|
||||
else
|
||||
VITA_LIBS += -lvitaGL -lvitashark
|
||||
FSELF_FLAGS := -s
|
||||
endif
|
||||
-lSceFiber_stub -lSceMotion_stub -lSceAppMgr_stub -lpthread -lpng -lz
|
||||
|
||||
LIBS := $(WHOLE_START) -lretro_vita $(WHOLE_END) $(VITA_LIBS) -lm -lc
|
||||
|
||||
@@ -186,13 +155,7 @@ all: $(TARGETS)
|
||||
|
||||
%.depend: ;
|
||||
|
||||
liblibScePiglet_stub.a:
|
||||
mkdir -p deps/Pigs-In-A-Blanket/piglet_stub/libScePiglet
|
||||
vita-libs-gen deps/Pigs-In-A-Blanket/piglet_stub/nids.yml deps/Pigs-In-A-Blanket/piglet_stub/libScePiglet
|
||||
make -C deps/Pigs-In-A-Blanket/piglet_stub/libScePiglet ARCH=arm-vita-eabi
|
||||
cp deps/Pigs-In-A-Blanket/piglet_stub/libScePiglet/liblibScePiglet_stub.a .
|
||||
|
||||
$(TARGET).elf: $(OBJ) libretro_vita.a liblibScePiglet_stub.a
|
||||
$(TARGET).elf: $(OBJ) libretro_vita.a
|
||||
$(LD) $(OBJ) $(LDFLAGS) $(LIBDIRS) $(LIBS) -o $@
|
||||
|
||||
%.velf: %.elf
|
||||
@@ -201,15 +164,14 @@ $(TARGET).elf: $(OBJ) libretro_vita.a liblibScePiglet_stub.a
|
||||
vita-elf-create $< $@
|
||||
|
||||
%.self: %.velf
|
||||
vita-make-fself -c $(FSELF_FLAGS) $< $@
|
||||
vita-make-fself -c -s $< $@
|
||||
|
||||
%.vpk: %.self
|
||||
vita-mksfoex -s TITLE_ID=$(VITA_TITLE_ID) "$(VITA_TITLE_NAME)" -d ATTRIBUTE2=12 param.sfo
|
||||
vita-pack-vpk -s param.sfo -b $< $@
|
||||
|
||||
clean:
|
||||
rm -f $(OBJ) $(TARGET).elf $(TARGET).elf.unstripped.elf $(TARGET).velf $(TARGET).self param.sfo $(TARGET).vpk
|
||||
rm -rf deps/Pigs-In-A-Blanket/piglet_stub/libScePiglet
|
||||
rm -f $(OBJ) $(TARGET).elf $(TARGET).elf.unstripped.elf $(TARGET).velf $(TARGET).self param.sfo $(TARGET).vpk
|
||||
rm -f $(OBJ:.o=.depend)
|
||||
|
||||
# Useful for developers
|
||||
@@ -219,10 +181,6 @@ vpksend: $(TARGET).vpk
|
||||
send: $(TARGET).self
|
||||
curl -T $< ftp://$(PSVITAIP):1337/ux0:/app/$(VITA_TITLE_ID)/eboot.bin
|
||||
|
||||
launch: $(TARGET).self
|
||||
curl -T $< ftp://$(PSVITAIP):1337/ux0:/app/$(VITA_TITLE_ID)/eboot.bin
|
||||
echo "launch $(VITA_TITLE_ID)" | nc ${PSVITAIP} 1338
|
||||
|
||||
.PHONY: clean all send vpksend
|
||||
.PRECIOUS: %.depend
|
||||
|
||||
|
||||
@@ -48,14 +48,14 @@ OBJS = frontend/frontend_salamander.o \
|
||||
libretro-common/file/config_file.o \
|
||||
libretro-common/streams/file_stream.o \
|
||||
libretro-common/vfs/vfs_implementation.o \
|
||||
libretro-common/hash/lrc_hash.o \
|
||||
libretro-common/time/rtime.o \
|
||||
libretro-common/hash/rhash.o \
|
||||
file_path_str.o \
|
||||
verbosity.o
|
||||
|
||||
all: $(TARGET).vpk
|
||||
|
||||
%.vpk: eboot.bin
|
||||
vita-mksfoex -s TITLE_ID=$(TITLE_ID) "RetroArch" -d ATTRIBUTE2=12 param.sfo
|
||||
vita-mksfoex -s TITLE_ID=$(TITLE_ID) "$(TARGET)" -d ATTRIBUTE2=12 param.sfo
|
||||
vita-pack-vpk -s param.sfo -b eboot.bin $@
|
||||
|
||||
eboot.bin: $(TARGET).velf
|
||||
|
||||
-385
@@ -1,385 +0,0 @@
|
||||
ROOT_DIR := .
|
||||
DEPS_DIR := $(ROOT_DIR)/deps
|
||||
DEBUG ?= 0
|
||||
HAVE_LOGGER = 0
|
||||
HAVE_FILE_LOGGER = 0
|
||||
HAVE_CC_RESAMPLER = 1
|
||||
WHOLE_ARCHIVE_LINK = 0
|
||||
BIG_STACK = 1
|
||||
PC_DEVELOPMENT_IP_ADDRESS = 255.255.255.255
|
||||
PC_DEVELOPMENT_UDP_PORT = 3490
|
||||
RARCH_CONSOLE = 0
|
||||
USBGECKO = 0
|
||||
|
||||
SPACE :=
|
||||
SPACE := $(SPACE) $(SPACE)
|
||||
BACKSLASH :=
|
||||
BACKSLASH := \$(BACKSLASH)
|
||||
filter_out1 = $(filter-out $(firstword $1),$1)
|
||||
filter_out2 = $(call filter_out1,$(call filter_out1,$1))
|
||||
|
||||
# system platform
|
||||
system_platform = unix
|
||||
ifeq ($(shell uname -s),)
|
||||
EXE_EXT = .exe
|
||||
system_platform = win
|
||||
else ifneq ($(findstring Darwin,$(shell uname -s)),)
|
||||
system_platform = osx
|
||||
else ifneq ($(findstring MINGW,$(shell uname -s)),)
|
||||
system_platform = win
|
||||
endif
|
||||
|
||||
TARGET_NAME := retroarch
|
||||
|
||||
INCLUDE :=
|
||||
LDFLAGS :=
|
||||
LIBDIRS :=
|
||||
|
||||
ifeq ($(LIBRETRO), nxengine)
|
||||
WHOLE_ARCHIVE_LINK = 1
|
||||
endif
|
||||
|
||||
ifeq ($(WHOLE_ARCHIVE_LINK), 1)
|
||||
WHOLE_START := -Wl,--whole-archive
|
||||
WHOLE_END := -Wl,--no-whole-archive
|
||||
endif
|
||||
|
||||
LIBS := $(WHOLE_START) -lretro_wii $(WHOLE_END)
|
||||
|
||||
libogc_platform := 1
|
||||
|
||||
EXTERNAL_LIBOGC ?= 0
|
||||
GX_PTHREAD_LEGACY ?= 1
|
||||
CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT)
|
||||
CXX = $(DEVKITPPC)/bin/powerpc-eabi-g++$(EXE_EXT)
|
||||
LD = $(DEVKITPPC)/bin/powerpc-eabi-ld$(EXE_EXT)
|
||||
ELF2DOL = $(DEVKITPPC)/bin/elf2dol$(EXE_EXT)
|
||||
EXT_TARGET := $(TARGET_NAME)_wii.dol
|
||||
EXT_INTER_TARGET := $(TARGET_NAME)_wii.elf
|
||||
|
||||
# Check whether ELF2DOL executable exists
|
||||
# (path has changed in more recent toolchains)
|
||||
ifeq ("$(wildcard $(ELF2DOL))","")
|
||||
ELF2DOL = $(DEVKITPRO)/tools/bin/elf2dol$(EXE_EXT)
|
||||
endif
|
||||
|
||||
INCLUDE += -I. -I$(DEVKITPRO)/libogc/include -Iwii/libogc/include
|
||||
|
||||
ifeq ($(EXTERNAL_LIBOGC), 1)
|
||||
CFLAGS += -DEXTERNAL_LIBOGC
|
||||
CXXFLAGS += -DEXTERNAL_LIBOGC
|
||||
LIBDIRS += -L$(DEVKITPRO)/libogc/lib/wii
|
||||
else
|
||||
CFLAGS += -DINTERNAL_LIBOGC
|
||||
CXXFLAGS += -DINTERNAL_LIBOGC
|
||||
LIBDIRS += -Lwii/libogc/libs/wii
|
||||
endif
|
||||
|
||||
ifeq ($(GX_PTHREAD_LEGACY), 1)
|
||||
CFLAGS += -DGX_PTHREAD_LEGACY
|
||||
CXXFLAGS += -DGX_PTHREAD_LEGACY
|
||||
endif
|
||||
|
||||
MACHDEP := -DHW_RVL -mrvl
|
||||
|
||||
LIBDIRS += -L.
|
||||
MACHDEP += -DGEKKO -mcpu=750 -meabi -mhard-float
|
||||
|
||||
LDFLAGS += $(MACHDEP) -Wl,-Map,$(notdir $(EXT_INTER_TARGET)).map,-wrap,malloc,-wrap,free,-wrap,memalign,-wrap,calloc,-wrap,realloc,-wrap,strdup,-wrap,strndup,-wrap,malloc_usable_size
|
||||
|
||||
ifeq ($(BIG_STACK), 1)
|
||||
LDFLAGS += -T bootstrap/gx/rvl.ld
|
||||
endif
|
||||
|
||||
ifeq ($(EXTERNAL_LIBOGC), 1)
|
||||
LIBS += -lfat
|
||||
endif
|
||||
|
||||
LIBS += -lwiiuse -lbte
|
||||
|
||||
ifeq ($(USBGECKO), 1)
|
||||
LIBS += -ldb
|
||||
endif
|
||||
|
||||
LIBS += -logc
|
||||
|
||||
CFLAGS += -DGEKKO -U__INT32_TYPE__ -U __UINT32_TYPE__ -D__INT32_TYPE__=int
|
||||
|
||||
HAVE_RUNAHEAD := 1
|
||||
HAVE_DSP_FILTER := 1
|
||||
HAVE_VIDEO_FILTER := 1
|
||||
HAVE_FILTERS_BUILTIN := 1
|
||||
HAVE_THREADS := 1
|
||||
HAVE_RPNG := 1
|
||||
HAVE_RJPEG := 1
|
||||
HAVE_RBMP := 1
|
||||
HAVE_RTGA := 1
|
||||
HAVE_IBXM := 1
|
||||
HAVE_OVERLAY := 1
|
||||
HAVE_VIDEO_LAYOUT := 0
|
||||
HAVE_ZLIB := 1
|
||||
HAVE_7ZIP := 1
|
||||
HAVE_CONFIGFILE := 1
|
||||
HAVE_PATCH := 1
|
||||
HAVE_CHEATS := 1
|
||||
HAVE_SCREENSHOTS := 1
|
||||
HAVE_REWIND := 1
|
||||
HAVE_AUDIOMIXER := 1
|
||||
HAVE_RWAV := 1
|
||||
RARCH_CONSOLE = 1
|
||||
|
||||
#HAVE_LANGEXTRA := 1
|
||||
HAVE_WIIUSB_HID := 1
|
||||
HAVE_RARCH_EXEC := 1
|
||||
HAVE_RSOUND := 1
|
||||
|
||||
APP_BOOTER_DIR = wii/app_booter
|
||||
PLATOBJS := $(APP_BOOTER_DIR)/app_booter.binobj
|
||||
|
||||
ifeq ($(USBGECKO), 1)
|
||||
CFLAGS += -DUSBGECKO
|
||||
endif
|
||||
|
||||
HAVE_CHEATS := 1
|
||||
|
||||
CFLAGS += -Wall -std=gnu99 $(MACHDEP) $(PLATCFLAGS) $(INCLUDE)
|
||||
INCLUDE += -I./libretro-common/include \
|
||||
-Ideps \
|
||||
-Ideps/stb
|
||||
|
||||
OBJ = griffin/griffin.o $(PLATOBJS)
|
||||
|
||||
ifeq ($(HAVE_GRIFFIN_CPP), 1)
|
||||
OBJ += griffin/griffin_cpp.o
|
||||
endif
|
||||
|
||||
ifeq ($(WANT_GLSLANG), 1)
|
||||
OBJ += griffin/griffin_glslang.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_LOGGER), 1)
|
||||
CFLAGS += -DHAVE_LOGGER
|
||||
CFLAGS += -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT)
|
||||
endif
|
||||
|
||||
CFLAGS += -DHAVE_SOCKET_LEGACY
|
||||
|
||||
ifeq ($(HAVE_KERNEL_PRX), 1)
|
||||
CFLAGS += -DHAVE_KERNEL_PRX
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_WIIUSB_HID), 1)
|
||||
CFLAGS += -DHAVE_WIIUSB_HID -DHAVE_HID
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_LIBRETRODB), 1)
|
||||
CFLAGS += -DHAVE_LIBRETRODB
|
||||
endif
|
||||
|
||||
ifeq ($(BIG_STACK),1)
|
||||
CFLAGS += -DBIG_STACK
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_RJPEG), 1)
|
||||
CFLAGS += -DHAVE_RJPEG
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_FILE_LOGGER), 1)
|
||||
CFLAGS += -DHAVE_FILE_LOGGER
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_RARCH_EXEC), 1)
|
||||
CFLAGS += -DHAVE_RARCH_EXEC
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_ZLIB), 1)
|
||||
CFLAGS += -DHAVE_ZLIB
|
||||
CFLAGS += -I./libretro-common/include/compat/zlib
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_RPNG), 1)
|
||||
CFLAGS += -DHAVE_RPNG
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_RBMP), 1)
|
||||
CFLAGS += -DHAVE_RBMP
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_RTGA), 1)
|
||||
CFLAGS += -DHAVE_RTGA
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_IMAGEVIEWER), 1)
|
||||
CFLAGS += -DHAVE_IMAGEVIEWER
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_BSV_MOVIE), 1)
|
||||
CFLAGS += -DHAVE_BSV_MOVIE
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_RUNAHEAD), 1)
|
||||
CFLAGS += -DHAVE_RUNAHEAD
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_7ZIP), 1)
|
||||
CFLAGS += -DHAVE_7ZIP -D_7ZIP_ST
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_SCREENSHOTS), 1)
|
||||
CFLAGS += -DHAVE_SCREENSHOTS
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_REWIND), 1)
|
||||
CFLAGS += -DHAVE_REWIND
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_AUDIOMIXER), 1)
|
||||
CFLAGS += -DHAVE_AUDIOMIXER
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_RWAV), 1)
|
||||
CFLAGS += -DHAVE_RWAV
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_OVERLAY), 1)
|
||||
CFLAGS += -DHAVE_OVERLAY
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_VIDEO_LAYOUT), 1)
|
||||
CFLAGS += -DHAVE_VIDEO_LAYOUT
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_NETWORKING), 1)
|
||||
CFLAGS += -DHAVE_NETWORKING
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_NETPLAYDISCOVERY), 1)
|
||||
CFLAGS += -DHAVE_NETPLAYDISCOVERY
|
||||
endif
|
||||
|
||||
ifeq ($(RARCH_CONSOLE), 1)
|
||||
CFLAGS += -DRARCH_CONSOLE
|
||||
endif
|
||||
|
||||
ifeq ($(RARCH_MOBILE), 1)
|
||||
CFLAGS += -DRARCH_MOBILE
|
||||
endif
|
||||
|
||||
CFLAGS += -std=gnu99 -DHAVE_RGUI -DHAVE_MENU -DHAVE_GRIFFIN=1 -Wno-char-subscripts -DRARCH_INTERNAL
|
||||
|
||||
ifeq ($(HAVE_MATERIALUI), 1)
|
||||
CFLAGS += -DHAVE_MATERIALUI
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_XMB), 1)
|
||||
CFLAGS += -DHAVE_XMB
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_STB_FONT), 1)
|
||||
CFLAGS += -DHAVE_STB_FONT
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_LANGEXTRA), 1)
|
||||
CFLAGS += -DHAVE_LANGEXTRA
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_DSP_FILTER), 1)
|
||||
CFLAGS += -DHAVE_DSP_FILTER
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_VIDEO_FILTER), 1)
|
||||
CFLAGS += -DHAVE_VIDEO_FILTER
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_FILTERS_BUILTIN), 1)
|
||||
CFLAGS += -DHAVE_FILTERS_BUILTIN
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_THREADS), 1)
|
||||
CFLAGS += -DHAVE_THREADS
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_CONFIGFILE), 1)
|
||||
CFLAGS += -DHAVE_CONFIGFILE
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_PATCH), 1)
|
||||
CFLAGS += -DHAVE_PATCH
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_CHEATS), 1)
|
||||
CFLAGS += -DHAVE_CHEATS
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_RSOUND), 1)
|
||||
CFLAGS += -DHAVE_RSOUND
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_GETOPT_LONG), 1)
|
||||
CFLAGS += -DHAVE_GETOPT_LONG=1
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_DYLIB), 1)
|
||||
CFLAGS += -DHAVE_DYLIB
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_NETWORK_CMD), 1)
|
||||
CFLAGS += -DHAVE_NETWORK_CMD
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_COMMAND), 1)
|
||||
CFLAGS += -DHAVE_COMMAND
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_STDIN_CMD), 1)
|
||||
CFLAGS += -DHAVE_STDIN_CMD
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_DYNAMIC), 1)
|
||||
CFLAGS += -DHAVE_DYNAMIC
|
||||
endif
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
CFLAGS += -O0 -g -DDEBUG
|
||||
else
|
||||
CFLAGS += -O3
|
||||
endif
|
||||
|
||||
OBJOUT = -o
|
||||
LINKOUT = -o
|
||||
LINK = $(CXX)
|
||||
|
||||
all: $(EXT_TARGET)
|
||||
|
||||
%.dol: %.elf
|
||||
$(ELF2DOL) $< $@
|
||||
|
||||
$(EXT_INTER_TARGET): $(OBJ)
|
||||
$(LINK) $(LINKOUT)$@ $(LDFLAGS) $(LIBDIRS) $(OBJ) $(PLATEXTRA) $(LIBS)
|
||||
|
||||
%.o: %.c
|
||||
$(CC) $(CFLAGS) -c $(OBJOUT)$@ $<
|
||||
|
||||
%.o: %.cpp
|
||||
$(CXX) $(CFLAGS) -c $(OBJOUT)$@ $<
|
||||
|
||||
%.o: %.S
|
||||
$(CC) $(CFLAGS) -c $(OBJOUT)$@ $<
|
||||
|
||||
%.binobj: %.bin
|
||||
$(LD) -r -b binary $(OBJOUT)$@ $<
|
||||
|
||||
$(APP_BOOTER_DIR)/app_booter.bin:
|
||||
export EXTERNAL_LIBOGC
|
||||
$(MAKE) -C $(APP_BOOTER_DIR)
|
||||
|
||||
clean:
|
||||
rm -f $(EXT_TARGET)
|
||||
rm -f $(EXT_INTER_TARGET)
|
||||
rm -f $(OBJ)
|
||||
$(MAKE) -C $(APP_BOOTER_DIR) clean
|
||||
|
||||
.PHONY: clean
|
||||
|
||||
print-%:
|
||||
@echo '$*=$($*)'
|
||||
+6
-19
@@ -3,11 +3,10 @@
|
||||
# Makefile for RetroArch Wii.
|
||||
##
|
||||
|
||||
DEBUG = 0
|
||||
HAVE_LOGGER = 0
|
||||
HAVE_FILE_LOGGER = 0
|
||||
EXTERNAL_LIBOGC ?= 0
|
||||
GX_PTHREAD_LEGACY ?= 1
|
||||
DEBUG = 0
|
||||
HAVE_LOGGER = 0
|
||||
HAVE_FILE_LOGGER = 0
|
||||
EXTERNAL_LIBOGC = 0
|
||||
|
||||
# system platform
|
||||
system_platform = unix
|
||||
@@ -28,12 +27,6 @@ CXX = $(DEVKITPPC)/bin/powerpc-eabi-g++$(EXE_EXT)
|
||||
LD = $(DEVKITPPC)/bin/powerpc-eabi-ld$(EXE_EXT)
|
||||
ELF2DOL = $(DEVKITPPC)/bin/elf2dol$(EXE_EXT)
|
||||
|
||||
# Check whether ELF2DOL executable exists
|
||||
# (path has changed in more recent toolchains)
|
||||
ifeq ("$(wildcard $(ELF2DOL))","")
|
||||
ELF2DOL = $(DEVKITPRO)/tools/bin/elf2dol$(EXE_EXT)
|
||||
endif
|
||||
|
||||
DOL_TARGET := retroarch-salamander_wii.dol
|
||||
ELF_TARGET := retroarch-salamander_wii.elf
|
||||
|
||||
@@ -46,11 +39,6 @@ INCLUDE += -Iwii/libogc/include
|
||||
LIBDIRS := -Lwii/libogc/libs/wii -L.
|
||||
endif
|
||||
|
||||
ifeq ($(GX_PTHREAD_LEGACY), 1)
|
||||
CFLAGS += -DGX_PTHREAD_LEGACY
|
||||
CXXFLAGS += -DGX_PTHREAD_LEGACY
|
||||
endif
|
||||
|
||||
MACHDEP := -DGEKKO -DHW_RVL -mrvl -mcpu=750 -meabi -mhard-float
|
||||
CFLAGS += -Wall -std=gnu99 $(MACHDEP) $(INCLUDE)
|
||||
LDFLAGS := $(MACHDEP) -Wl,-Map,$(notdir $(ELF_TARGET)).map
|
||||
@@ -69,7 +57,7 @@ OBJ = frontend/frontend_salamander.o \
|
||||
frontend/drivers/platform_wii.o \
|
||||
libretro-common/file/file_path.o \
|
||||
libretro-common/file/file_path_io.o \
|
||||
libretro-common/hash/lrc_hash.o \
|
||||
libretro-common/hash/rhash.o \
|
||||
libretro-common/string/stdstring.o \
|
||||
libretro-common/lists/string_list.o \
|
||||
libretro-common/lists/dir_list.o \
|
||||
@@ -81,7 +69,7 @@ OBJ = frontend/frontend_salamander.o \
|
||||
libretro-common/compat/compat_strcasestr.o \
|
||||
libretro-common/compat/fopen_utf8.o \
|
||||
libretro-common/file/config_file.o \
|
||||
libretro-common/time/rtime.o \
|
||||
file_path_str.o \
|
||||
verbosity.o \
|
||||
$(APP_BOOTER_DIR)/app_booter.binobj
|
||||
|
||||
@@ -139,7 +127,6 @@ $(ELF_TARGET): $(OBJ)
|
||||
$(LD) -r -b binary -o $@ $<
|
||||
|
||||
$(APP_BOOTER_DIR)/app_booter.bin:
|
||||
export EXTERNAL_LIBOGC
|
||||
$(MAKE) -C $(APP_BOOTER_DIR)
|
||||
|
||||
pkg: all
|
||||
|
||||
+6
-17
@@ -66,14 +66,13 @@ ifeq ($(SALAMANDER_BUILD),1)
|
||||
OBJ += libretro-common/file/config_file.o
|
||||
OBJ += libretro-common/streams/file_stream.o
|
||||
OBJ += libretro-common/vfs/vfs_implementation.o
|
||||
OBJ += libretro-common/hash/lrc_hash.o
|
||||
OBJ += libretro-common/time/rtime.o
|
||||
OBJ += libretro-common/hash/rhash.o
|
||||
OBJ += file_path_str.o
|
||||
OBJ += verbosity.o
|
||||
|
||||
# $(SALAMANDER_BUILD),0
|
||||
else
|
||||
DEFINES += -DRARCH_INTERNAL
|
||||
DEFINES += -DHAVE_SCREENSHOTS
|
||||
DEFINES += -DHAVE_KEYMAPPER
|
||||
DEFINES += -DHAVE_ONLINE_UPDATER
|
||||
DEFINES += -DHAVE_UPDATE_ASSETS
|
||||
@@ -98,7 +97,7 @@ endif
|
||||
OBJ += gfx/drivers/gx2_shaders/snowflake.o
|
||||
|
||||
ifeq ($(GRIFFIN_BUILD), 1)
|
||||
OBJ += griffin/griffin.o griffin/griffin_cpp.o
|
||||
OBJ += griffin/griffin.o
|
||||
|
||||
INCDIRS += -Ilibretro-common/include/compat/zlib
|
||||
# for stb, libfat, iosuhax
|
||||
@@ -108,9 +107,7 @@ endif
|
||||
INCDIRS += -Ideps/SPIRV-Cross
|
||||
|
||||
DEFINES += -DHAVE_AUDIOMIXER
|
||||
DEFINES += -DHAVE_RWAV
|
||||
DEFINES += -DHAVE_GRIFFIN=1 -DHAVE_MENU -DHAVE_GFX_WIDGETS -DHAVE_CONFIGFILE -DHAVE_PATCH -DHAVE_CHEATS -DHAVE_RGUI -DHAVE_LIBRETRODB
|
||||
DEFINES += -DHAVE_REWIND
|
||||
DEFINES += -DHAVE_GRIFFIN=1 -DHAVE_MENU -DHAVE_CONFIGFILE -DHAVE_RGUI -DHAVE_LIBRETRODB
|
||||
DEFINES += -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_RBMP -DHAVE_RTGA -DHAVE_CC_RESAMPLER
|
||||
DEFINES += -DHAVE_SPIRV_CROSS -DHAVE_SLANG
|
||||
DEFINES += -DHAVE_STB_FONT -DHAVE_STB_VORBIS -DHAVE_LANGEXTRA -DHAVE_LIBRETRODB -DHAVE_NETWORKING -DHAVE_NETPLAYDISCOVERY
|
||||
@@ -123,19 +120,13 @@ endif
|
||||
|
||||
# $(GRIFFIN_BUILD),0
|
||||
else
|
||||
HAVE_SCREENSHOTS = 1
|
||||
HAVE_AUDIOMIXER = 1
|
||||
HAVE_RWAV = 1
|
||||
HAVE_MENU_COMMON = 1
|
||||
HAVE_GFX_WIDGETS = 1
|
||||
HAVE_RTGA = 1
|
||||
HAVE_RPNG = 1
|
||||
HAVE_RJPEG = 1
|
||||
HAVE_RBMP = 1
|
||||
HAVE_CONFIGFILE = 1
|
||||
HAVE_PATCH = 1
|
||||
HAVE_REWIND = 1
|
||||
HAVE_CHEATS = 1
|
||||
HAVE_MENU = 1
|
||||
HAVE_RGUI = 1
|
||||
HAVE_7ZIP = 1
|
||||
@@ -156,8 +147,6 @@ endif
|
||||
HAVE_SPIRV_CROSS = 1
|
||||
HAVE_SLANG = 1
|
||||
HAVE_VIDEO_LAYOUT = 0
|
||||
HAVE_DSP_FILTER = 1
|
||||
HAVE_VIDEO_FILTER = 1
|
||||
HAVE_STATIC_VIDEO_FILTERS = 1
|
||||
HAVE_STATIC_AUDIO_FILTERS = 1
|
||||
WANT_LIBFAT = 1
|
||||
@@ -174,7 +163,7 @@ OBJ := $(addprefix $(BUILD_DIR)/,$(OBJ))
|
||||
#-----------------------------
|
||||
# Compile flags
|
||||
|
||||
DEFINES += -DWIIU -D__WUT__ -DHW_WUP -D__wiiu__
|
||||
DEFINES += -DWIIU -DMSB_FIRST -D__WUT__ -DHW_WUP -D__wiiu__
|
||||
DEFINES += -DHAVE_MAIN
|
||||
DEFINES += -DRARCH_CONSOLE
|
||||
|
||||
@@ -195,7 +184,7 @@ CFLAGS := -mcpu=750 -meabi -mhard-float
|
||||
CFLAGS += -ffast-math -Werror=implicit-function-declaration
|
||||
CFLAGS += -ffunction-sections -fdata-sections
|
||||
#CFLAGS += -fomit-frame-pointer -mword-relocations
|
||||
CFLAGS += -Wall
|
||||
#CFLAGS += -Wall
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
CFLAGS += -O0 -g
|
||||
|
||||
+8
-8
@@ -1,8 +1,6 @@
|
||||
TARGET = retroarch.exe
|
||||
|
||||
HAVE_SCREENSHOTS = 1
|
||||
HAVE_AUDIOMIXER = 1
|
||||
HAVE_RWAV = 1
|
||||
HAVE_DINPUT = 1
|
||||
HAVE_XAUDIO = 1
|
||||
HAVE_DSOUND = 1
|
||||
@@ -17,13 +15,8 @@ HAVE_COMMAND = 1
|
||||
HAVE_THREADS = 1
|
||||
HAVE_MENU = 1
|
||||
HAVE_CONFIGFILE = 1
|
||||
HAVE_PATCH = 1
|
||||
HAVE_REWIND = 1
|
||||
HAVE_CHEATS = 1
|
||||
HAVE_RGUI = 1
|
||||
HAVE_MATERIALUI = 1
|
||||
HAVE_DSP_FILTER = 1
|
||||
HAVE_VIDEO_FILTER = 1
|
||||
HAVE_7ZIP = 1
|
||||
HAVE_PYTHON = 0
|
||||
DYNAMIC = 1
|
||||
@@ -103,7 +96,7 @@ OS := Win32
|
||||
OBJ :=
|
||||
LIBS := -lm
|
||||
DEFINES :=
|
||||
DEFINES += -I. -Ilibretro-common/include -Ilibretro-common/include/compat/zlib -DRARCH_INTERNAL -DHAVE_SCREENSHOTS -DHAVE_OVERLAY
|
||||
DEFINES += -I. -Ilibretro-common/include -Ilibretro-common/include/compat/zlib -DRARCH_INTERNAL -DHAVE_OVERLAY
|
||||
#DEFINES += -DHAVE_VIDEO_LAYOUT
|
||||
LDFLAGS := -L. -static-libgcc
|
||||
|
||||
@@ -167,6 +160,13 @@ $(OBJDIR)/%.o: %.c
|
||||
@$(if $(Q), $(shell echo echo CC $<),)
|
||||
$(Q)$(CC) $(CFLAGS) $(DEFINES) -MMD -c -o $@ $<
|
||||
|
||||
.FORCE:
|
||||
|
||||
$(OBJDIR)/git_version.o: git_version.c .FORCE
|
||||
@-mkdir -p $(dir $@) || mkdir $(subst /,\,$(dir $@)) || echo .
|
||||
@$(if $(Q), $(shell echo echo CC $<),)
|
||||
$(Q)$(CC) $(CFLAGS) $(DEFINES) -MMD -c -o $@ $<
|
||||
|
||||
$(OBJDIR)/%.o: %.cpp | $(dir $@)
|
||||
@-mkdir -p $(dir $@) || mkdir $(subst /,\,$(dir $@)) || echo .
|
||||
@$(if $(Q), $(shell echo echo CXX $<),)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
[](https://travis-ci.org/libretro/RetroArch)
|
||||
[](https://scan.coverity.com/projects/retroarch)
|
||||
[](https://crowdin.com/project/retroarch)
|
||||
|
||||
# RetroArch
|
||||
|
||||
|
||||
@@ -30,4 +30,13 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
|
||||
RETRO_BEGIN_DECLS
|
||||
|
||||
bool is_accessibility_enabled(void);
|
||||
|
||||
bool accessibility_speak_priority(const char* speak_text, int priority);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
||||
@@ -30,7 +30,7 @@ RETRO_BEGIN_DECLS
|
||||
|
||||
#define AUDIO_MIXER_MAX_STREAMS 16
|
||||
|
||||
#define AUDIO_MIXER_MAX_SYSTEM_STREAMS (AUDIO_MIXER_MAX_STREAMS + 5)
|
||||
#define AUDIO_MIXER_MAX_SYSTEM_STREAMS (AUDIO_MIXER_MAX_STREAMS + 4)
|
||||
|
||||
/* do not define more than (MAX_SYSTEM_STREAMS - MAX_STREAMS) */
|
||||
enum audio_mixer_system_slot
|
||||
@@ -38,8 +38,7 @@ enum audio_mixer_system_slot
|
||||
AUDIO_MIXER_SYSTEM_SLOT_OK = AUDIO_MIXER_MAX_STREAMS,
|
||||
AUDIO_MIXER_SYSTEM_SLOT_CANCEL,
|
||||
AUDIO_MIXER_SYSTEM_SLOT_NOTICE,
|
||||
AUDIO_MIXER_SYSTEM_SLOT_BGM,
|
||||
AUDIO_MIXER_SYSTEM_SLOT_ACHIEVEMENT_UNLOCK
|
||||
AUDIO_MIXER_SYSTEM_SLOT_BGM
|
||||
};
|
||||
|
||||
enum audio_action
|
||||
@@ -77,11 +76,11 @@ enum audio_mixer_state
|
||||
|
||||
typedef struct audio_statistics
|
||||
{
|
||||
unsigned samples;
|
||||
float average_buffer_saturation;
|
||||
float std_deviation_percentage;
|
||||
float close_to_underrun;
|
||||
float close_to_blocking;
|
||||
unsigned samples;
|
||||
} audio_statistics_t;
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
@@ -31,16 +31,6 @@ typedef struct audio_thread
|
||||
sthread_t *thread;
|
||||
slock_t *lock;
|
||||
scond_t *cond;
|
||||
const char *device;
|
||||
unsigned *new_rate;
|
||||
|
||||
int inited;
|
||||
|
||||
/* Initialization options. */
|
||||
unsigned out_rate;
|
||||
unsigned latency;
|
||||
unsigned block_frames;
|
||||
|
||||
bool alive;
|
||||
bool stopped;
|
||||
bool stopped_ack;
|
||||
@@ -48,6 +38,14 @@ typedef struct audio_thread
|
||||
bool is_shutdown;
|
||||
bool use_float;
|
||||
|
||||
int inited;
|
||||
|
||||
/* Initialization options. */
|
||||
const char *device;
|
||||
unsigned *new_rate;
|
||||
unsigned out_rate;
|
||||
unsigned latency;
|
||||
unsigned block_frames;
|
||||
} audio_thread_t;
|
||||
|
||||
static void audio_thread_loop(void *data)
|
||||
|
||||
@@ -28,8 +28,8 @@ typedef struct alsa
|
||||
{
|
||||
snd_pcm_t *pcm;
|
||||
size_t buffer_size;
|
||||
unsigned int frame_bits;
|
||||
bool nonblock;
|
||||
unsigned int frame_bits;
|
||||
bool has_float;
|
||||
bool can_pause;
|
||||
bool is_paused;
|
||||
@@ -83,12 +83,12 @@ static void *alsa_init(const char *device, unsigned rate, unsigned latency,
|
||||
if (snd_pcm_hw_params_malloc(¶ms) < 0)
|
||||
goto error;
|
||||
|
||||
if (snd_pcm_hw_params_any(alsa->pcm, params) < 0)
|
||||
goto error;
|
||||
|
||||
alsa->has_float = find_float_format(alsa->pcm, params);
|
||||
format = alsa->has_float ? SND_PCM_FORMAT_FLOAT : SND_PCM_FORMAT_S16;
|
||||
|
||||
if (snd_pcm_hw_params_any(alsa->pcm, params) < 0)
|
||||
goto error;
|
||||
|
||||
if (snd_pcm_hw_params_set_access(
|
||||
alsa->pcm, params, SND_PCM_ACCESS_RW_INTERLEAVED) < 0)
|
||||
goto error;
|
||||
|
||||
@@ -29,18 +29,18 @@
|
||||
typedef struct alsa
|
||||
{
|
||||
uint8_t **buffer;
|
||||
snd_pcm_t *pcm;
|
||||
uint8_t *buffer_chunk;
|
||||
unsigned buffer_index;
|
||||
unsigned buffer_ptr;
|
||||
volatile unsigned buffered_blocks;
|
||||
|
||||
unsigned buf_size;
|
||||
unsigned buf_count;
|
||||
snd_pcm_t *pcm;
|
||||
bool nonblock;
|
||||
bool has_float;
|
||||
bool can_pause;
|
||||
bool is_paused;
|
||||
unsigned buf_size;
|
||||
unsigned buf_count;
|
||||
} alsa_qsa_t;
|
||||
|
||||
typedef long snd_pcm_sframes_t;
|
||||
|
||||
+14
-13
@@ -33,18 +33,20 @@
|
||||
typedef struct alsa_thread
|
||||
{
|
||||
snd_pcm_t *pcm;
|
||||
bool nonblock;
|
||||
bool is_paused;
|
||||
bool has_float;
|
||||
volatile bool thread_dead;
|
||||
|
||||
size_t buffer_size;
|
||||
size_t period_size;
|
||||
snd_pcm_uframes_t period_frames;
|
||||
|
||||
fifo_buffer_t *buffer;
|
||||
sthread_t *worker_thread;
|
||||
slock_t *fifo_lock;
|
||||
scond_t *cond;
|
||||
slock_t *cond_lock;
|
||||
size_t buffer_size;
|
||||
size_t period_size;
|
||||
snd_pcm_uframes_t period_frames;
|
||||
bool nonblock;
|
||||
bool is_paused;
|
||||
bool has_float;
|
||||
volatile bool thread_dead;
|
||||
} alsa_thread_t;
|
||||
|
||||
static void alsa_worker_thread(void *data)
|
||||
@@ -64,7 +66,7 @@ static void alsa_worker_thread(void *data)
|
||||
size_t fifo_size;
|
||||
snd_pcm_sframes_t frames;
|
||||
slock_lock(alsa->fifo_lock);
|
||||
avail = FIFO_READ_AVAIL(alsa->buffer);
|
||||
avail = fifo_read_avail(alsa->buffer);
|
||||
fifo_size = MIN(alsa->period_size, avail);
|
||||
fifo_read(alsa->buffer, buf, fifo_size);
|
||||
scond_signal(alsa->cond);
|
||||
@@ -173,11 +175,10 @@ static void *alsa_thread_init(const char *device,
|
||||
TRY_ALSA(snd_pcm_open(&alsa->pcm, alsa_dev, SND_PCM_STREAM_PLAYBACK, 0));
|
||||
|
||||
TRY_ALSA(snd_pcm_hw_params_malloc(¶ms));
|
||||
TRY_ALSA(snd_pcm_hw_params_any(alsa->pcm, params));
|
||||
|
||||
alsa->has_float = alsathread_find_float_format(alsa->pcm, params);
|
||||
format = alsa->has_float ? SND_PCM_FORMAT_FLOAT : SND_PCM_FORMAT_S16;
|
||||
|
||||
TRY_ALSA(snd_pcm_hw_params_any(alsa->pcm, params));
|
||||
TRY_ALSA(snd_pcm_hw_params_set_access(
|
||||
alsa->pcm, params, SND_PCM_ACCESS_RW_INTERLEAVED));
|
||||
TRY_ALSA(snd_pcm_hw_params_set_format(alsa->pcm, params, format));
|
||||
@@ -255,7 +256,7 @@ static ssize_t alsa_thread_write(void *data, const void *buf, size_t size)
|
||||
size_t write_amt;
|
||||
|
||||
slock_lock(alsa->fifo_lock);
|
||||
avail = FIFO_WRITE_AVAIL(alsa->buffer);
|
||||
avail = fifo_write_avail(alsa->buffer);
|
||||
write_amt = MIN(avail, size);
|
||||
|
||||
fifo_write(alsa->buffer, buf, write_amt);
|
||||
@@ -270,7 +271,7 @@ static ssize_t alsa_thread_write(void *data, const void *buf, size_t size)
|
||||
{
|
||||
size_t avail;
|
||||
slock_lock(alsa->fifo_lock);
|
||||
avail = FIFO_WRITE_AVAIL(alsa->buffer);
|
||||
avail = fifo_write_avail(alsa->buffer);
|
||||
|
||||
if (avail == 0)
|
||||
{
|
||||
@@ -333,7 +334,7 @@ static size_t alsa_thread_write_avail(void *data)
|
||||
if (alsa->thread_dead)
|
||||
return 0;
|
||||
slock_lock(alsa->fifo_lock);
|
||||
val = FIFO_WRITE_AVAIL(alsa->buffer);
|
||||
val = fifo_write_avail(alsa->buffer);
|
||||
slock_unlock(alsa->fifo_lock);
|
||||
return val;
|
||||
}
|
||||
|
||||
@@ -36,9 +36,9 @@ static void *audioio_init(const char *device, unsigned rate, unsigned latency,
|
||||
unsigned block_frames,
|
||||
unsigned *new_out_rate)
|
||||
{
|
||||
struct audio_info info;
|
||||
int *fd = (int*)calloc(1, sizeof(int));
|
||||
const char *audiodev = device ? device : DEFAULT_DEV;
|
||||
int *fd = (int*)calloc(1, sizeof(int));
|
||||
struct audio_info info;
|
||||
|
||||
if (!fd)
|
||||
return NULL;
|
||||
|
||||
@@ -38,16 +38,18 @@ typedef struct coreaudio
|
||||
{
|
||||
slock_t *lock;
|
||||
scond_t *cond;
|
||||
|
||||
#if (defined(__MACH__) && (defined(__ppc__) || defined(__ppc64__)))
|
||||
ComponentInstance dev;
|
||||
#else
|
||||
AudioComponentInstance dev;
|
||||
#endif
|
||||
fifo_buffer_t *buffer;
|
||||
size_t buffer_size;
|
||||
bool dev_alive;
|
||||
bool is_paused;
|
||||
|
||||
fifo_buffer_t *buffer;
|
||||
bool nonblock;
|
||||
size_t buffer_size;
|
||||
} coreaudio_t;
|
||||
|
||||
#if TARGET_OS_IOS
|
||||
@@ -101,7 +103,7 @@ static OSStatus audio_write_cb(void *userdata,
|
||||
|
||||
slock_lock(dev->lock);
|
||||
|
||||
if (FIFO_READ_AVAIL(dev->buffer) < write_avail)
|
||||
if (fifo_read_avail(dev->buffer) < write_avail)
|
||||
{
|
||||
*action_flags = kAudioUnitRenderAction_OutputIsSilence;
|
||||
|
||||
@@ -354,14 +356,14 @@ static ssize_t coreaudio_write(void *data, const void *buf_, size_t size)
|
||||
|
||||
slock_lock(dev->lock);
|
||||
|
||||
write_avail = FIFO_WRITE_AVAIL(dev->buffer);
|
||||
write_avail = fifo_write_avail(dev->buffer);
|
||||
if (write_avail > size)
|
||||
write_avail = size;
|
||||
|
||||
fifo_write(dev->buffer, buf, write_avail);
|
||||
buf += write_avail;
|
||||
buf += write_avail;
|
||||
written += write_avail;
|
||||
size -= write_avail;
|
||||
size -= write_avail;
|
||||
|
||||
if (dev->nonblock)
|
||||
{
|
||||
@@ -428,7 +430,7 @@ static size_t coreaudio_write_avail(void *data)
|
||||
coreaudio_t *dev = (coreaudio_t*)data;
|
||||
|
||||
slock_lock(dev->lock);
|
||||
avail = FIFO_WRITE_AVAIL(dev->buffer);
|
||||
avail = fifo_write_avail(dev->buffer);
|
||||
slock_unlock(dev->lock);
|
||||
|
||||
return avail;
|
||||
|
||||
+16
-17
@@ -23,7 +23,6 @@
|
||||
#include <memory.h>
|
||||
|
||||
#include "../../retroarch.h"
|
||||
#include "../../verbosity.h"
|
||||
|
||||
#pragma mark - ringbuffer
|
||||
|
||||
@@ -31,9 +30,9 @@ typedef struct ringbuffer
|
||||
{
|
||||
float *buffer;
|
||||
size_t cap;
|
||||
size_t write_ptr;
|
||||
size_t read_ptr;
|
||||
atomic_int len;
|
||||
size_t writePtr;
|
||||
size_t readPtr;
|
||||
} ringbuffer_t;
|
||||
|
||||
typedef ringbuffer_t * ringbuffer_h;
|
||||
@@ -45,7 +44,7 @@ static inline size_t rb_len(ringbuffer_h r)
|
||||
|
||||
static inline size_t rb_cap(ringbuffer_h r)
|
||||
{
|
||||
return (r->read_ptr + r->cap - r->write_ptr) % r->cap;
|
||||
return (r->readPtr + r->cap - r->writePtr) % r->cap;
|
||||
}
|
||||
|
||||
static inline size_t rb_avail(ringbuffer_h r)
|
||||
@@ -55,17 +54,17 @@ static inline size_t rb_avail(ringbuffer_h r)
|
||||
|
||||
static inline void rb_advance_write(ringbuffer_h r)
|
||||
{
|
||||
r->write_ptr = (r->write_ptr + 1) % r->cap;
|
||||
r->writePtr = (r->writePtr + 1) % r->cap;
|
||||
}
|
||||
|
||||
static inline void rb_advance_write_n(ringbuffer_h r, size_t n)
|
||||
{
|
||||
r->write_ptr = (r->write_ptr + n) % r->cap;
|
||||
r->writePtr = (r->writePtr + n) % r->cap;
|
||||
}
|
||||
|
||||
static inline void rb_advance_read(ringbuffer_h r)
|
||||
{
|
||||
r->read_ptr = (r->read_ptr + 1) % r->cap;
|
||||
r->readPtr = (r->readPtr + 1) % r->cap;
|
||||
}
|
||||
|
||||
static inline void rb_len_add(ringbuffer_h r, int n)
|
||||
@@ -80,11 +79,11 @@ static inline void rb_len_sub(ringbuffer_h r, int n)
|
||||
|
||||
static void rb_init(ringbuffer_h r, size_t cap)
|
||||
{
|
||||
r->buffer = malloc(cap * sizeof(float));
|
||||
r->cap = cap;
|
||||
r->buffer = malloc(cap * sizeof(float));
|
||||
r->cap = cap;
|
||||
atomic_init(&r->len, 0);
|
||||
r->write_ptr = 0;
|
||||
r->read_ptr = 0;
|
||||
r->writePtr = 0;
|
||||
r->readPtr = 0;
|
||||
}
|
||||
|
||||
static void rb_free(ringbuffer_h r)
|
||||
@@ -103,13 +102,13 @@ static void rb_write_data(ringbuffer_h r, const float *data, size_t len)
|
||||
size_t first_write = n;
|
||||
size_t rest_write = 0;
|
||||
|
||||
if (r->write_ptr + n > r->cap)
|
||||
if (r->writePtr + n > r->cap)
|
||||
{
|
||||
first_write = r->cap - r->write_ptr;
|
||||
rest_write = n - first_write;
|
||||
first_write = r->cap - r->writePtr;
|
||||
rest_write = n - first_write;
|
||||
}
|
||||
|
||||
memcpy(r->buffer + r->write_ptr, data, first_write*sizeof(float));
|
||||
memcpy(r->buffer + r->writePtr, data, first_write*sizeof(float));
|
||||
memcpy(r->buffer, data + first_write, rest_write*sizeof(float));
|
||||
|
||||
rb_advance_write_n(r, n);
|
||||
@@ -127,9 +126,9 @@ static void rb_read_data(ringbuffer_h r,
|
||||
int i = 0;
|
||||
for (; i < n/2; i++)
|
||||
{
|
||||
d0[i] = r->buffer[r->read_ptr];
|
||||
d0[i] = r->buffer[r->readPtr];
|
||||
rb_advance_read(r);
|
||||
d1[i] = r->buffer[r->read_ptr];
|
||||
d1[i] = r->buffer[r->readPtr];
|
||||
rb_advance_read(r);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint64_t cpu_ticks_last;
|
||||
|
||||
bool nonblock;
|
||||
bool playing;
|
||||
int16_t* l;
|
||||
int16_t* r;
|
||||
|
||||
@@ -34,8 +34,7 @@ typedef struct
|
||||
uint32_t pos;
|
||||
|
||||
uint32_t playpos;
|
||||
bool nonblock;
|
||||
bool playing;
|
||||
uint64_t cpu_ticks_last;
|
||||
} ctr_csnd_audio_t;
|
||||
|
||||
#define CTR_CSND_AUDIO_COUNT (1u << 11u)
|
||||
|
||||
@@ -22,11 +22,12 @@
|
||||
|
||||
typedef struct
|
||||
{
|
||||
ndspWaveBuf dsp_buf; /* TODO/FIXME - find out alignment */
|
||||
int channel;
|
||||
uint32_t pos;
|
||||
bool nonblock;
|
||||
bool playing;
|
||||
int channel;
|
||||
ndspWaveBuf dsp_buf;
|
||||
|
||||
uint32_t pos;
|
||||
} ctr_dsp_audio_t;
|
||||
|
||||
#define CTR_DSP_AUDIO_COUNT (1u << 11u)
|
||||
@@ -107,15 +108,6 @@ static ssize_t ctr_dsp_audio_write(void *data, const void *buf, size_t size)
|
||||
{
|
||||
do{
|
||||
svcSleepThread(100000);
|
||||
|
||||
/* Run aptMainLoop to update APT state if DSP state
|
||||
* changed, this prevents a hang on sleep. */
|
||||
if(!aptMainLoop())
|
||||
{
|
||||
command_event(CMD_EVENT_QUIT, NULL);
|
||||
return true;
|
||||
}
|
||||
|
||||
sample_pos = ndspChnGetSamplePos(ctr->channel);
|
||||
}while (((sample_pos - (ctr->pos + (size >>2))) & CTR_DSP_AUDIO_COUNT_MASK) > (CTR_DSP_AUDIO_COUNT >> 1)
|
||||
|| (((ctr->pos - (CTR_DSP_AUDIO_COUNT >> 4) - sample_pos) & CTR_DSP_AUDIO_COUNT_MASK) > (CTR_DSP_AUDIO_COUNT >> 1)));
|
||||
|
||||
@@ -1,339 +0,0 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2020 - Justin Weiss
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <3ds.h>
|
||||
#include <string.h>
|
||||
#include <malloc.h>
|
||||
#include <queues/fifo_queue.h>
|
||||
#include <rthreads/rthreads.h>
|
||||
|
||||
#include "../../retroarch.h"
|
||||
#include "../../ctr/ctr_debug.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
fifo_buffer_t* fifo;
|
||||
size_t fifo_size;
|
||||
|
||||
slock_t* fifo_lock;
|
||||
scond_t* fifo_avail;
|
||||
scond_t* fifo_done;
|
||||
sthread_t* thread;
|
||||
|
||||
volatile bool running;
|
||||
|
||||
bool nonblocking;
|
||||
bool playing;
|
||||
retro_time_t frame_time;
|
||||
int channel;
|
||||
ndspWaveBuf dsp_buf;
|
||||
|
||||
uint32_t pos;
|
||||
} ctr_dsp_thread_audio_t;
|
||||
|
||||
// PCM16 stereo
|
||||
#define DSP_BYTES_TO_SAMPLES(bytes) (bytes / (2 * sizeof(uint16_t)))
|
||||
#define DSP_SAMPLES_TO_BYTES(samples) (samples * 2 * sizeof(uint16_t))
|
||||
|
||||
static void ctr_dsp_audio_loop(void* data)
|
||||
{
|
||||
uint32_t pos, buf_pos;
|
||||
ctr_dsp_thread_audio_t *ctr = (ctr_dsp_thread_audio_t*)data;
|
||||
|
||||
if (!ctr)
|
||||
return;
|
||||
|
||||
while (1)
|
||||
{
|
||||
size_t buf_avail, avail, to_write;
|
||||
slock_lock(ctr->fifo_lock);
|
||||
|
||||
do {
|
||||
avail = FIFO_READ_AVAIL(ctr->fifo);
|
||||
|
||||
if (!avail) {
|
||||
scond_wait(ctr->fifo_avail, ctr->fifo_lock);
|
||||
}
|
||||
} while (!avail && ctr->running);
|
||||
|
||||
slock_unlock(ctr->fifo_lock);
|
||||
|
||||
if (!ctr->running)
|
||||
break;
|
||||
|
||||
pos = ctr->pos;
|
||||
buf_pos = DSP_SAMPLES_TO_BYTES(ndspChnGetSamplePos(ctr->channel));
|
||||
|
||||
buf_avail = buf_pos >= pos ? buf_pos - pos : ctr->fifo_size - pos;
|
||||
to_write = MIN(avail, buf_avail);
|
||||
|
||||
slock_lock(ctr->fifo_lock);
|
||||
|
||||
if (to_write > 0) {
|
||||
fifo_read(ctr->fifo, ctr->dsp_buf.data_pcm8 + pos, to_write);
|
||||
DSP_FlushDataCache(ctr->dsp_buf.data_pcm8 + pos, to_write);
|
||||
scond_signal(ctr->fifo_done);
|
||||
}
|
||||
|
||||
slock_unlock(ctr->fifo_lock);
|
||||
|
||||
if (buf_pos == pos) {
|
||||
svcSleepThread(100000);
|
||||
}
|
||||
|
||||
ctr->pos = (pos + to_write) % ctr->fifo_size;
|
||||
}
|
||||
}
|
||||
|
||||
static void ctr_dsp_thread_audio_free(void *data);
|
||||
|
||||
static void *ctr_dsp_thread_audio_init(const char *device, unsigned rate, unsigned latency,
|
||||
unsigned block_frames,
|
||||
unsigned *new_rate)
|
||||
{
|
||||
ctr_dsp_thread_audio_t *ctr = NULL;
|
||||
|
||||
(void)device;
|
||||
(void)rate;
|
||||
|
||||
if (ndspInit() < 0)
|
||||
return NULL;
|
||||
|
||||
ctr = (ctr_dsp_thread_audio_t*)calloc(1, sizeof(ctr_dsp_thread_audio_t));
|
||||
|
||||
if (!ctr)
|
||||
return NULL;
|
||||
|
||||
*new_rate = 32728;
|
||||
|
||||
ctr->running = true;
|
||||
ctr->channel = 0;
|
||||
|
||||
ndspSetOutputMode(NDSP_OUTPUT_STEREO);
|
||||
ndspSetClippingMode(NDSP_CLIP_SOFT); /* ?? */
|
||||
ndspSetOutputCount(2);
|
||||
ndspChnReset(ctr->channel);
|
||||
ndspChnSetFormat(ctr->channel, NDSP_FORMAT_STEREO_PCM16);
|
||||
ndspChnSetInterp(ctr->channel, NDSP_INTERP_NONE);
|
||||
ndspChnSetRate(ctr->channel, 32728.0f);
|
||||
ndspChnWaveBufClear(ctr->channel);
|
||||
|
||||
ctr->fifo_size = DSP_SAMPLES_TO_BYTES((*new_rate * MAX(latency, 8)) / 1000);
|
||||
|
||||
ctr->dsp_buf.data_pcm16 = linearAlloc(ctr->fifo_size);
|
||||
memset(ctr->dsp_buf.data_pcm16, 0, ctr->fifo_size);
|
||||
DSP_FlushDataCache(ctr->dsp_buf.data_pcm16, ctr->fifo_size);
|
||||
|
||||
ctr->dsp_buf.looping = true;
|
||||
ctr->dsp_buf.nsamples = DSP_BYTES_TO_SAMPLES(ctr->fifo_size);
|
||||
ndspChnWaveBufAdd(ctr->channel, &ctr->dsp_buf);
|
||||
|
||||
ctr->fifo = fifo_new(ctr->fifo_size);
|
||||
|
||||
if (!(ctr->fifo_lock = slock_new()) ||
|
||||
!(ctr->fifo_avail = scond_new()) ||
|
||||
!(ctr->fifo_done = scond_new()) ||
|
||||
!(ctr->thread = sthread_create(ctr_dsp_audio_loop, ctr)))
|
||||
{
|
||||
RARCH_LOG("[Audio]: thread creation failed.\n");
|
||||
ctr->running = false;
|
||||
ctr_dsp_thread_audio_free(ctr);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ctr->pos = 0;
|
||||
ctr->playing = true;
|
||||
|
||||
ctr->frame_time = (retro_time_t)roundf(1000000 * 4481134.0 / (*new_rate * 8192.0));
|
||||
|
||||
ndspSetMasterVol(1.0);
|
||||
|
||||
return ctr;
|
||||
}
|
||||
|
||||
static void ctr_dsp_thread_audio_free(void *data)
|
||||
{
|
||||
ctr_dsp_thread_audio_t* ctr = (ctr_dsp_thread_audio_t*)data;
|
||||
if (!ctr)
|
||||
return;
|
||||
|
||||
if (ctr->running)
|
||||
{
|
||||
ctr->running = false;
|
||||
scond_signal(ctr->fifo_avail);
|
||||
}
|
||||
|
||||
if (ctr->thread)
|
||||
sthread_join(ctr->thread);
|
||||
|
||||
scond_free(ctr->fifo_avail);
|
||||
scond_free(ctr->fifo_done);
|
||||
slock_free(ctr->fifo_lock);
|
||||
|
||||
if (ctr->fifo)
|
||||
{
|
||||
fifo_free(ctr->fifo);
|
||||
ctr->fifo = NULL;
|
||||
}
|
||||
|
||||
ndspChnWaveBufClear(ctr->channel);
|
||||
|
||||
linearFree(ctr->dsp_buf.data_pcm16);
|
||||
|
||||
free(ctr);
|
||||
ndspExit();
|
||||
ctr = NULL;
|
||||
}
|
||||
|
||||
static ssize_t ctr_dsp_thread_audio_write(void *data, const void *buf, size_t size)
|
||||
{
|
||||
size_t avail, written;
|
||||
ctr_dsp_thread_audio_t * ctr = (ctr_dsp_thread_audio_t*)data;
|
||||
|
||||
if (!ctr || !ctr->running)
|
||||
return 0;
|
||||
|
||||
if (ctr->nonblocking)
|
||||
{
|
||||
slock_lock(ctr->fifo_lock);
|
||||
avail = FIFO_WRITE_AVAIL(ctr->fifo);
|
||||
written = MIN(avail, size);
|
||||
if (written > 0)
|
||||
{
|
||||
fifo_write(ctr->fifo, buf, written);
|
||||
scond_signal(ctr->fifo_avail);
|
||||
}
|
||||
slock_unlock(ctr->fifo_lock);
|
||||
}
|
||||
else
|
||||
{
|
||||
written = 0;
|
||||
while (written < size && ctr->running)
|
||||
{
|
||||
slock_lock(ctr->fifo_lock);
|
||||
avail = FIFO_WRITE_AVAIL(ctr->fifo);
|
||||
if (avail == 0)
|
||||
{
|
||||
if (ctr->running)
|
||||
{
|
||||
/* Wait a maximum of one frame, skip the write if the thread is still busy */
|
||||
if (!scond_wait_timeout(ctr->fifo_done, ctr->fifo_lock, ctr->frame_time)) {
|
||||
slock_unlock(ctr->fifo_lock);
|
||||
break;
|
||||
}
|
||||
}
|
||||
slock_unlock(ctr->fifo_lock);
|
||||
}
|
||||
else
|
||||
{
|
||||
size_t write_amt = MIN(size - written, avail);
|
||||
fifo_write(ctr->fifo, (const char*)buf + written, write_amt);
|
||||
scond_signal(ctr->fifo_avail);
|
||||
slock_unlock(ctr->fifo_lock);
|
||||
written += write_amt;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return written;
|
||||
}
|
||||
|
||||
static bool ctr_dsp_thread_audio_stop(void *data)
|
||||
{
|
||||
ctr_dsp_thread_audio_t* ctr = (ctr_dsp_thread_audio_t*)data;
|
||||
|
||||
if (!ctr)
|
||||
return false;
|
||||
|
||||
ndspSetMasterVol(0.0);
|
||||
ctr->playing = false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool ctr_dsp_thread_audio_alive(void *data)
|
||||
{
|
||||
ctr_dsp_thread_audio_t* ctr = (ctr_dsp_thread_audio_t*)data;
|
||||
|
||||
if (!ctr)
|
||||
return false;
|
||||
|
||||
return ctr->playing;
|
||||
}
|
||||
|
||||
static bool ctr_dsp_thread_audio_start(void *data, bool is_shutdown)
|
||||
{
|
||||
ctr_dsp_thread_audio_t* ctr = (ctr_dsp_thread_audio_t*)data;
|
||||
|
||||
if (!ctr)
|
||||
return false;
|
||||
|
||||
/* Prevents restarting audio when the menu
|
||||
* is toggled off on shutdown */
|
||||
if (is_shutdown)
|
||||
return true;
|
||||
|
||||
ndspSetMasterVol(1.0);
|
||||
ctr->playing = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void ctr_dsp_thread_audio_set_nonblock_state(void *data, bool state)
|
||||
{
|
||||
ctr_dsp_thread_audio_t* ctr = (ctr_dsp_thread_audio_t*)data;
|
||||
if (ctr)
|
||||
ctr->nonblocking = state;
|
||||
}
|
||||
|
||||
static bool ctr_dsp_thread_audio_use_float(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return false;
|
||||
}
|
||||
|
||||
static size_t ctr_dsp_thread_audio_write_avail(void *data)
|
||||
{
|
||||
size_t val;
|
||||
ctr_dsp_thread_audio_t* ctr = (ctr_dsp_thread_audio_t*)data;
|
||||
|
||||
slock_lock(ctr->fifo_lock);
|
||||
val = FIFO_WRITE_AVAIL(ctr->fifo);
|
||||
slock_unlock(ctr->fifo_lock);
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
static size_t ctr_dsp_thread_audio_buffer_size(void *data)
|
||||
{
|
||||
ctr_dsp_thread_audio_t* ctr = (ctr_dsp_thread_audio_t*)data;
|
||||
return ctr->fifo_size;
|
||||
}
|
||||
|
||||
audio_driver_t audio_ctr_dsp_thread = {
|
||||
ctr_dsp_thread_audio_init,
|
||||
ctr_dsp_thread_audio_write,
|
||||
ctr_dsp_thread_audio_stop,
|
||||
ctr_dsp_thread_audio_start,
|
||||
ctr_dsp_thread_audio_alive,
|
||||
ctr_dsp_thread_audio_set_nonblock_state,
|
||||
ctr_dsp_thread_audio_free,
|
||||
ctr_dsp_thread_audio_use_float,
|
||||
"dsp_thread",
|
||||
NULL,
|
||||
NULL,
|
||||
ctr_dsp_thread_audio_write_avail,
|
||||
ctr_dsp_thread_audio_buffer_size
|
||||
};
|
||||
+15
-8
@@ -155,7 +155,7 @@ static DWORD CALLBACK dsound_thread(PVOID data)
|
||||
avail = write_avail(read_ptr, write_ptr, ds->buffer_size);
|
||||
|
||||
EnterCriticalSection(&ds->crit);
|
||||
fifo_avail = FIFO_READ_AVAIL(ds->buffer);
|
||||
fifo_avail = fifo_read_avail(ds->buffer);
|
||||
LeaveCriticalSection(&ds->crit);
|
||||
|
||||
if (avail < CHUNK_SIZE || ((fifo_avail < CHUNK_SIZE) && (avail < ds->buffer_size / 2)))
|
||||
@@ -303,8 +303,7 @@ static void dsound_free(void *data)
|
||||
free(ds);
|
||||
}
|
||||
|
||||
static BOOL CALLBACK enumerate_cb(LPGUID guid,
|
||||
LPCSTR desc, LPCSTR module, LPVOID context)
|
||||
static BOOL CALLBACK enumerate_cb(LPGUID guid, LPCSTR desc, LPCSTR module, LPVOID context)
|
||||
{
|
||||
union string_list_elem_attr attr;
|
||||
struct string_list *list = (struct string_list*)context;
|
||||
@@ -512,7 +511,7 @@ static ssize_t dsound_write(void *data, const void *buf_, size_t size)
|
||||
size_t avail;
|
||||
|
||||
EnterCriticalSection(&ds->crit);
|
||||
avail = FIFO_WRITE_AVAIL(ds->buffer);
|
||||
avail = fifo_write_avail(ds->buffer);
|
||||
if (avail > size)
|
||||
avail = size;
|
||||
|
||||
@@ -531,7 +530,7 @@ static ssize_t dsound_write(void *data, const void *buf_, size_t size)
|
||||
size_t avail;
|
||||
|
||||
EnterCriticalSection(&ds->crit);
|
||||
avail = FIFO_WRITE_AVAIL(ds->buffer);
|
||||
avail = fifo_write_avail(ds->buffer);
|
||||
if (avail > size)
|
||||
avail = size;
|
||||
|
||||
@@ -559,13 +558,21 @@ static size_t dsound_write_avail(void *data)
|
||||
dsound_t *ds = (dsound_t*)data;
|
||||
|
||||
EnterCriticalSection(&ds->crit);
|
||||
avail = FIFO_WRITE_AVAIL(ds->buffer);
|
||||
avail = fifo_write_avail(ds->buffer);
|
||||
LeaveCriticalSection(&ds->crit);
|
||||
return avail;
|
||||
}
|
||||
|
||||
static size_t dsound_buffer_size(void *data) { return 4 * 1024; }
|
||||
static bool dsound_use_float(void *data) { return false; }
|
||||
static size_t dsound_buffer_size(void *data)
|
||||
{
|
||||
return 4 * 1024;
|
||||
}
|
||||
|
||||
static bool dsound_use_float(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return false;
|
||||
}
|
||||
|
||||
static void *dsound_list_new(void *u)
|
||||
{
|
||||
|
||||
@@ -32,11 +32,13 @@
|
||||
|
||||
typedef struct
|
||||
{
|
||||
size_t write_ptr;
|
||||
uint32_t data[BLOCKS][CHUNK_FRAMES];
|
||||
|
||||
volatile unsigned dma_busy;
|
||||
volatile unsigned dma_next;
|
||||
volatile unsigned dma_write;
|
||||
size_t write_ptr;
|
||||
|
||||
bool nonblock;
|
||||
bool is_paused;
|
||||
} gx_audio_t;
|
||||
@@ -107,7 +109,7 @@ static INLINE void copy_swapped(uint32_t * restrict dst,
|
||||
{
|
||||
uint32_t s = *src++;
|
||||
*dst++ = (s >> 16) | (s << 16);
|
||||
} while (--size);
|
||||
}while(--size);
|
||||
}
|
||||
|
||||
static ssize_t gx_audio_write(void *data, const void *buf_, size_t size)
|
||||
|
||||
+74
-71
@@ -25,7 +25,6 @@
|
||||
#include <boolean.h>
|
||||
#include <rthreads/rthreads.h>
|
||||
|
||||
#include "../../configuration.h"
|
||||
#include "../../retroarch.h"
|
||||
#include "../../verbosity.h"
|
||||
|
||||
@@ -35,44 +34,23 @@ typedef struct jack
|
||||
{
|
||||
jack_client_t *client;
|
||||
jack_port_t *ports[2];
|
||||
jack_ringbuffer_t *buffer;
|
||||
jack_ringbuffer_t *buffer[2];
|
||||
volatile bool shutdown;
|
||||
bool nonblock;
|
||||
bool is_paused;
|
||||
|
||||
#ifdef HAVE_THREADS
|
||||
scond_t *cond;
|
||||
slock_t *cond_lock;
|
||||
#endif
|
||||
size_t buffer_size;
|
||||
volatile bool shutdown;
|
||||
bool nonblock;
|
||||
bool is_paused;
|
||||
} jack_t;
|
||||
|
||||
static size_t read_deinterleaved(float *dst[2], jack_nframes_t dst_offset,
|
||||
jack_ringbuffer_data_t buf, jack_nframes_t nframes)
|
||||
{
|
||||
int i;
|
||||
jack_nframes_t j, frames_avail;
|
||||
const float *src = (const float *)buf.buf;
|
||||
|
||||
if (nframes <= 0)
|
||||
return 0;
|
||||
|
||||
frames_avail = FRAMES(buf.len);
|
||||
nframes = nframes < frames_avail ? nframes : frames_avail;
|
||||
|
||||
for (j = 0; j < nframes; j++)
|
||||
for (i = 0; i < 2; i++)
|
||||
dst[i][dst_offset + j] = *src++;
|
||||
|
||||
return nframes;
|
||||
}
|
||||
|
||||
static int process_cb(jack_nframes_t nframes, void *data)
|
||||
{
|
||||
int i;
|
||||
jack_nframes_t read = 0;
|
||||
jack_nframes_t avail[2], min_avail;
|
||||
jack_t *jd = (jack_t*)data;
|
||||
jack_ringbuffer_data_t buf[2];
|
||||
float *dst[2];
|
||||
|
||||
if (nframes <= 0)
|
||||
{
|
||||
@@ -82,20 +60,23 @@ static int process_cb(jack_nframes_t nframes, void *data)
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (i = 0; i < 2; i++)
|
||||
dst[i] = (float *)jack_port_get_buffer(jd->ports[i], nframes);
|
||||
avail[0] = jack_ringbuffer_read_space(jd->buffer[0]);
|
||||
avail[1] = jack_ringbuffer_read_space(jd->buffer[1]);
|
||||
min_avail = ((avail[0] < avail[1]) ? avail[0] : avail[1]) / sizeof(jack_default_audio_sample_t);
|
||||
|
||||
jack_ringbuffer_get_read_vector(jd->buffer, buf);
|
||||
if (min_avail > nframes)
|
||||
min_avail = nframes;
|
||||
|
||||
for (i = 0; i < 2; i++)
|
||||
read += read_deinterleaved(dst, read, buf[i], nframes - read);
|
||||
{
|
||||
jack_nframes_t f;
|
||||
jack_default_audio_sample_t *out = (jack_default_audio_sample_t*)jack_port_get_buffer(jd->ports[i], nframes);
|
||||
|
||||
jack_ringbuffer_read_advance(jd->buffer, read * sizeof(float) * 2);
|
||||
|
||||
for (; read < nframes; read++)
|
||||
for (i = 0; i < 2; i++)
|
||||
dst[i][read] = 0.0f;
|
||||
jack_ringbuffer_read(jd->buffer[i], (char*)out, min_avail * sizeof(jack_default_audio_sample_t));
|
||||
|
||||
for (f = min_avail; f < nframes; f++)
|
||||
out[f] = 0.0f;
|
||||
}
|
||||
#ifdef HAVE_THREADS
|
||||
scond_signal(jd->cond);
|
||||
#endif
|
||||
@@ -115,13 +96,13 @@ static void shutdown_cb(void *data)
|
||||
#endif
|
||||
}
|
||||
|
||||
static int parse_ports(char **dest_ports, const char **jports)
|
||||
static int parse_ports(const char *audio_device,
|
||||
char **dest_ports, const char **jports)
|
||||
{
|
||||
int i;
|
||||
char *save = NULL;
|
||||
int parsed = 0;
|
||||
settings_t *settings = config_get_ptr();
|
||||
char *audio_device_cpy = strdup(settings->arrays.audio_device);
|
||||
char *audio_device_cpy = strdup(audio_device);
|
||||
const char *con = strtok_r(audio_device_cpy, ",", &save);
|
||||
|
||||
if (con)
|
||||
@@ -212,15 +193,17 @@ static void *ja_init(const char *device,
|
||||
jd->buffer_size = bufsize;
|
||||
|
||||
RARCH_LOG("[JACK]: Internal buffer size: %d frames.\n", (int)(bufsize / sizeof(jack_default_audio_sample_t)));
|
||||
|
||||
jd->buffer = jack_ringbuffer_create(bufsize);
|
||||
if (!jd->buffer)
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
RARCH_ERR("[JACK]: Failed to create buffers.\n");
|
||||
goto error;
|
||||
jd->buffer[i] = jack_ringbuffer_create(bufsize);
|
||||
if (!jd->buffer[i])
|
||||
{
|
||||
RARCH_ERR("[JACK]: Failed to create buffers.\n");
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
parsed = parse_ports(dest_ports, jports);
|
||||
parsed = parse_ports(device, dest_ports, jports);
|
||||
|
||||
if (jack_activate(jd->client) < 0)
|
||||
{
|
||||
@@ -252,46 +235,65 @@ error:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static ssize_t ja_write(void *data, const void *buf_, size_t size)
|
||||
static size_t write_buffer(jack_t *jd, const float *buf, size_t size)
|
||||
{
|
||||
jack_t *jd = (jack_t*)data;
|
||||
const char *buf = (const char *)buf_;
|
||||
size_t written = 0;
|
||||
int i;
|
||||
size_t j, written = 0;
|
||||
jack_default_audio_sample_t out_deinterleaved_buffer[2][AUDIO_CHUNK_SIZE_NONBLOCKING * AUDIO_MAX_RATIO];
|
||||
size_t frames = FRAMES(size);
|
||||
|
||||
while (size > 0)
|
||||
/* Avoid buffer overflow if a DSP plugin generated a huge number of frames. */
|
||||
if (frames > AUDIO_CHUNK_SIZE_NONBLOCKING * AUDIO_MAX_RATIO)
|
||||
frames = AUDIO_CHUNK_SIZE_NONBLOCKING * AUDIO_MAX_RATIO;
|
||||
|
||||
for (i = 0; i < 2; i++)
|
||||
for (j = 0; j < frames; j++)
|
||||
out_deinterleaved_buffer[i][j] = buf[j * 2 + i];
|
||||
|
||||
while (written < frames)
|
||||
{
|
||||
size_t avail, to_write;
|
||||
|
||||
size_t avail[2], min_avail, write_frames;
|
||||
if (jd->shutdown)
|
||||
return 0;
|
||||
|
||||
avail = jack_ringbuffer_write_space(jd->buffer);
|
||||
avail[0] = jack_ringbuffer_write_space(jd->buffer[0]);
|
||||
avail[1] = jack_ringbuffer_write_space(jd->buffer[1]);
|
||||
|
||||
to_write = size < avail ? size : avail;
|
||||
/* make sure to only write multiples of the sample size */
|
||||
to_write = (to_write / sizeof(float)) * sizeof(float);
|
||||
min_avail = avail[0] < avail[1] ? avail[0] : avail[1];
|
||||
min_avail /= sizeof(float);
|
||||
|
||||
if (to_write > 0)
|
||||
write_frames = frames - written > min_avail ? min_avail : frames - written;
|
||||
|
||||
if (write_frames > 0)
|
||||
{
|
||||
jack_ringbuffer_write(jd->buffer, buf, to_write);
|
||||
buf += to_write;
|
||||
size -= to_write;
|
||||
written += to_write;
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
jack_ringbuffer_write(jd->buffer[i], (const char*)&out_deinterleaved_buffer[i][written],
|
||||
write_frames * sizeof(jack_default_audio_sample_t));
|
||||
}
|
||||
written += write_frames;
|
||||
}
|
||||
else if (!jd->nonblock)
|
||||
{
|
||||
#ifdef HAVE_THREADS
|
||||
else
|
||||
{
|
||||
slock_lock(jd->cond_lock);
|
||||
scond_wait(jd->cond, jd->cond_lock);
|
||||
slock_unlock(jd->cond_lock);
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
|
||||
if (jd->nonblock)
|
||||
break;
|
||||
}
|
||||
|
||||
return written;
|
||||
return written * sizeof(float) * 2;
|
||||
}
|
||||
|
||||
static ssize_t ja_write(void *data, const void *buf, size_t size)
|
||||
{
|
||||
jack_t *jd = (jack_t*)data;
|
||||
|
||||
return write_buffer(jd, (const float*)buf, size);
|
||||
}
|
||||
|
||||
static bool ja_stop(void *data)
|
||||
@@ -338,8 +340,9 @@ static void ja_free(void *data)
|
||||
jack_client_close(jd->client);
|
||||
}
|
||||
|
||||
if (jd->buffer)
|
||||
jack_ringbuffer_free(jd->buffer);
|
||||
for (i = 0; i < 2; i++)
|
||||
if (jd->buffer[i])
|
||||
jack_ringbuffer_free(jd->buffer[i]);
|
||||
|
||||
#ifdef HAVE_THREADS
|
||||
if (jd->cond_lock)
|
||||
@@ -359,7 +362,7 @@ static bool ja_use_float(void *data)
|
||||
static size_t ja_write_avail(void *data)
|
||||
{
|
||||
jack_t *jd = (jack_t*)data;
|
||||
return jack_ringbuffer_write_space(jd->buffer);
|
||||
return jack_ringbuffer_write_space(jd->buffer[0]);
|
||||
}
|
||||
|
||||
static size_t ja_buffer_size(void *data)
|
||||
|
||||
@@ -43,14 +43,17 @@ typedef struct al
|
||||
ALuint source;
|
||||
ALuint *buffers;
|
||||
ALuint *res_buf;
|
||||
size_t res_ptr;
|
||||
ALenum format;
|
||||
size_t num_buffers;
|
||||
int rate;
|
||||
|
||||
uint8_t tmpbuf[BUFSIZE];
|
||||
size_t tmpbuf_ptr;
|
||||
|
||||
ALCdevice *handle;
|
||||
ALCcontext *ctx;
|
||||
size_t res_ptr;
|
||||
size_t num_buffers;
|
||||
size_t tmpbuf_ptr;
|
||||
int rate;
|
||||
ALenum format;
|
||||
uint8_t tmpbuf[BUFSIZE];
|
||||
|
||||
bool nonblock;
|
||||
bool is_paused;
|
||||
} al_t;
|
||||
|
||||
@@ -37,6 +37,9 @@ typedef struct sl
|
||||
{
|
||||
uint8_t **buffer;
|
||||
uint8_t *buffer_chunk;
|
||||
unsigned buffer_index;
|
||||
unsigned buffer_ptr;
|
||||
volatile unsigned buffered_blocks;
|
||||
|
||||
SLObjectItf engine_object;
|
||||
SLEngineItf engine;
|
||||
@@ -48,13 +51,10 @@ typedef struct sl
|
||||
|
||||
slock_t *lock;
|
||||
scond_t *cond;
|
||||
unsigned buf_size;
|
||||
unsigned buf_count;
|
||||
unsigned buffer_index;
|
||||
unsigned buffer_ptr;
|
||||
volatile unsigned buffered_blocks;
|
||||
bool nonblock;
|
||||
bool is_paused;
|
||||
unsigned buf_size;
|
||||
unsigned buf_count;
|
||||
} sl_t;
|
||||
|
||||
static void opensl_callback(SLAndroidSimpleBufferQueueItf bq, void *ctx)
|
||||
@@ -67,7 +67,7 @@ static void opensl_callback(SLAndroidSimpleBufferQueueItf bq, void *ctx)
|
||||
#define GOTO_IF_FAIL(x) do { \
|
||||
if ((res = (x)) != SL_RESULT_SUCCESS) \
|
||||
goto error; \
|
||||
} while (0)
|
||||
} while(0)
|
||||
|
||||
static void sl_free(void *data)
|
||||
{
|
||||
|
||||
+34
-44
@@ -42,27 +42,22 @@
|
||||
#define DEFAULT_OSS_DEV "/dev/dsp"
|
||||
#endif
|
||||
|
||||
typedef struct oss_audio
|
||||
{
|
||||
int fd;
|
||||
bool is_paused;
|
||||
} oss_audio_t;
|
||||
static bool oss_is_paused = false;
|
||||
|
||||
static void *oss_init(const char *device,
|
||||
unsigned rate, unsigned latency,
|
||||
static void *oss_init(const char *device, unsigned rate, unsigned latency,
|
||||
unsigned block_frames,
|
||||
unsigned *new_out_rate)
|
||||
{
|
||||
int frags, frag, channels, format, new_rate;
|
||||
oss_audio_t *ossaudio = (oss_audio_t*)calloc(1, sizeof(oss_audio_t));
|
||||
int *fd = (int*)calloc(1, sizeof(int));
|
||||
const char *oss_device = device ? device : DEFAULT_OSS_DEV;
|
||||
|
||||
if (!ossaudio)
|
||||
if (!fd)
|
||||
return NULL;
|
||||
|
||||
if ((ossaudio->fd = open(oss_device, O_WRONLY)) < 0)
|
||||
if ((*fd = open(oss_device, O_WRONLY)) < 0)
|
||||
{
|
||||
free(ossaudio);
|
||||
free(fd);
|
||||
perror("open");
|
||||
return NULL;
|
||||
}
|
||||
@@ -70,21 +65,21 @@ static void *oss_init(const char *device,
|
||||
frags = (latency * rate * 4) / (1000 * (1 << 10));
|
||||
frag = (frags << 16) | 10;
|
||||
|
||||
if (ioctl(ossaudio->fd, SNDCTL_DSP_SETFRAGMENT, &frag) < 0)
|
||||
if (ioctl(*fd, SNDCTL_DSP_SETFRAGMENT, &frag) < 0)
|
||||
RARCH_WARN("Cannot set fragment sizes. Latency might not be as expected ...\n");
|
||||
|
||||
channels = 2;
|
||||
format = is_little_endian() ? AFMT_S16_LE : AFMT_S16_BE;
|
||||
|
||||
if (ioctl(ossaudio->fd, SNDCTL_DSP_CHANNELS, &channels) < 0)
|
||||
if (ioctl(*fd, SNDCTL_DSP_CHANNELS, &channels) < 0)
|
||||
goto error;
|
||||
|
||||
if (ioctl(ossaudio->fd, SNDCTL_DSP_SETFMT, &format) < 0)
|
||||
if (ioctl(*fd, SNDCTL_DSP_SETFMT, &format) < 0)
|
||||
goto error;
|
||||
|
||||
new_rate = rate;
|
||||
|
||||
if (ioctl(ossaudio->fd, SNDCTL_DSP_SPEED, &new_rate) < 0)
|
||||
if (ioctl(*fd, SNDCTL_DSP_SPEED, &new_rate) < 0)
|
||||
goto error;
|
||||
|
||||
if (new_rate != (int)rate)
|
||||
@@ -93,12 +88,11 @@ static void *oss_init(const char *device,
|
||||
*new_out_rate = new_rate;
|
||||
}
|
||||
|
||||
return ossaudio;
|
||||
return fd;
|
||||
|
||||
error:
|
||||
close(ossaudio->fd);
|
||||
if (ossaudio)
|
||||
free(ossaudio);
|
||||
close(*fd);
|
||||
free(fd);
|
||||
perror("ioctl");
|
||||
return NULL;
|
||||
}
|
||||
@@ -106,14 +100,14 @@ error:
|
||||
static ssize_t oss_write(void *data, const void *buf, size_t size)
|
||||
{
|
||||
ssize_t ret;
|
||||
oss_audio_t *ossaudio = (oss_audio_t*)data;
|
||||
int *fd = (int*)data;
|
||||
|
||||
if (size == 0)
|
||||
return 0;
|
||||
|
||||
if ((ret = write(ossaudio->fd, buf, size)) < 0)
|
||||
if ((ret = write(*fd, buf, size)) < 0)
|
||||
{
|
||||
if (errno == EAGAIN && (fcntl(ossaudio->fd, F_GETFL) & O_NONBLOCK))
|
||||
if (errno == EAGAIN && (fcntl(*fd, F_GETFL) & O_NONBLOCK))
|
||||
return 0;
|
||||
|
||||
return -1;
|
||||
@@ -124,62 +118,58 @@ static ssize_t oss_write(void *data, const void *buf, size_t size)
|
||||
|
||||
static bool oss_stop(void *data)
|
||||
{
|
||||
oss_audio_t *ossaudio = (oss_audio_t*)data;
|
||||
int *fd = (int*)data;
|
||||
|
||||
if (ioctl(ossaudio->fd, SNDCTL_DSP_RESET, 0) < 0)
|
||||
if (ioctl(*fd, SNDCTL_DSP_RESET, 0) < 0)
|
||||
return false;
|
||||
|
||||
ossaudio->is_paused = true;
|
||||
oss_is_paused = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool oss_start(void *data, bool is_shutdown)
|
||||
{
|
||||
oss_audio_t *ossaudio = (oss_audio_t*)data;
|
||||
if (!ossaudio)
|
||||
return false;
|
||||
ossaudio->is_paused = false;
|
||||
(void)data;
|
||||
oss_is_paused = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool oss_alive(void *data)
|
||||
{
|
||||
oss_audio_t *ossaudio = (oss_audio_t*)data;
|
||||
return !ossaudio->is_paused;
|
||||
(void)data;
|
||||
return !oss_is_paused;
|
||||
}
|
||||
|
||||
static void oss_set_nonblock_state(void *data, bool state)
|
||||
{
|
||||
int rc;
|
||||
oss_audio_t *ossaudio = (oss_audio_t*)data;
|
||||
int *fd = (int*)data;
|
||||
|
||||
if (state)
|
||||
rc = fcntl(ossaudio->fd, F_SETFL,
|
||||
fcntl(ossaudio->fd, F_GETFL) | O_NONBLOCK);
|
||||
rc = fcntl(*fd, F_SETFL, fcntl(*fd, F_GETFL) | O_NONBLOCK);
|
||||
else
|
||||
rc = fcntl(ossaudio->fd, F_SETFL,
|
||||
fcntl(ossaudio->fd, F_GETFL) & (~O_NONBLOCK));
|
||||
rc = fcntl(*fd, F_SETFL, fcntl(*fd, F_GETFL) & (~O_NONBLOCK));
|
||||
if (rc != 0)
|
||||
RARCH_WARN("Could not set nonblocking on OSS file descriptor. Will not be able to fast-forward.\n");
|
||||
}
|
||||
|
||||
static void oss_free(void *data)
|
||||
{
|
||||
oss_audio_t *ossaudio = (oss_audio_t*)data;
|
||||
int *fd = (int*)data;
|
||||
|
||||
if (ioctl(ossaudio->fd, SNDCTL_DSP_RESET, 0) < 0)
|
||||
if (ioctl(*fd, SNDCTL_DSP_RESET, 0) < 0)
|
||||
return;
|
||||
|
||||
close(ossaudio->fd);
|
||||
free(data);
|
||||
close(*fd);
|
||||
free(fd);
|
||||
}
|
||||
|
||||
static size_t oss_write_avail(void *data)
|
||||
{
|
||||
audio_buf_info info;
|
||||
oss_audio_t *ossaudio = (oss_audio_t*)data;
|
||||
int *fd = (int*)data;
|
||||
|
||||
if (ioctl(ossaudio->fd, SNDCTL_DSP_GETOSPACE, &info) < 0)
|
||||
if (ioctl(*fd, SNDCTL_DSP_GETOSPACE, &info) < 0)
|
||||
{
|
||||
RARCH_ERR("[OSS]: SNDCTL_DSP_GETOSPACE failed ...\n");
|
||||
return 0;
|
||||
@@ -191,9 +181,9 @@ static size_t oss_write_avail(void *data)
|
||||
static size_t oss_buffer_size(void *data)
|
||||
{
|
||||
audio_buf_info info;
|
||||
oss_audio_t *ossaudio = (oss_audio_t*)data;
|
||||
int *fd = (int*)data;
|
||||
|
||||
if (ioctl(ossaudio->fd, SNDCTL_DSP_GETOSPACE, &info) < 0)
|
||||
if (ioctl(*fd, SNDCTL_DSP_GETOSPACE, &info) < 0)
|
||||
{
|
||||
RARCH_ERR("[OSS]: SNDCTL_DSP_GETOSPACE failed ...\n");
|
||||
return 1; /* Return something non-zero to avoid SIGFPE. */
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
#include <malloc.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <kernel.h>
|
||||
@@ -31,17 +32,26 @@ typedef struct ps2_audio
|
||||
/* TODO/FIXME - nonblock is not implemented */
|
||||
bool nonblock;
|
||||
bool running;
|
||||
|
||||
} ps2_audio_t;
|
||||
|
||||
static void audioConfigure(ps2_audio_t *ps2, unsigned rate)
|
||||
{
|
||||
int err;
|
||||
struct audsrv_fmt_t format;
|
||||
|
||||
format.bits = AUDIO_BITS;
|
||||
format.freq = rate;
|
||||
format.channels = AUDIO_CHANNELS;
|
||||
|
||||
audsrv_set_format(&format);
|
||||
err = audsrv_set_format(&format);
|
||||
|
||||
if (err)
|
||||
{
|
||||
printf("set format returned %d\n", err);
|
||||
printf("audsrv returned error string: %s\n", audsrv_get_error_string());
|
||||
}
|
||||
|
||||
audsrv_set_volume(MAX_VOLUME);
|
||||
}
|
||||
|
||||
|
||||
+76
-71
@@ -28,17 +28,17 @@
|
||||
|
||||
typedef struct
|
||||
{
|
||||
fifo_buffer_t *buffer;
|
||||
sys_ppu_thread_t thread;
|
||||
sys_lwmutex_t lock;
|
||||
sys_lwmutex_t cond_lock;
|
||||
sys_lwcond_t cond;
|
||||
uint32_t audio_port;
|
||||
bool nonblock;
|
||||
bool started;
|
||||
volatile bool quit_thread;
|
||||
} ps3_audio_t;
|
||||
fifo_buffer_t *buffer;
|
||||
|
||||
sys_ppu_thread_t thread;
|
||||
sys_lwmutex_t lock;
|
||||
sys_lwmutex_t cond_lock;
|
||||
sys_lwcond_t cond;
|
||||
} ps3_audio_t;
|
||||
|
||||
#ifdef __PSL1GHT__
|
||||
static void event_loop(void *data)
|
||||
@@ -46,34 +46,34 @@ static void event_loop(void *data)
|
||||
static void event_loop(uint64_t data)
|
||||
#endif
|
||||
{
|
||||
float out_tmp[AUDIO_BLOCK_SAMPLES * AUDIO_CHANNELS]
|
||||
float out_tmp[CELL_AUDIO_BLOCK_SAMPLES * AUDIO_CHANNELS]
|
||||
__attribute__((aligned(16)));
|
||||
sys_event_queue_t id;
|
||||
sys_ipc_key_t key;
|
||||
sys_event_t event;
|
||||
ps3_audio_t *aud = (ps3_audio_t*)(uintptr_t)data;
|
||||
|
||||
audioCreateNotifyEventQueue(&id, &key);
|
||||
audioSetNotifyEventQueue(key);
|
||||
cellAudioCreateNotifyEventQueue(&id, &key);
|
||||
cellAudioSetNotifyEventQueue(key);
|
||||
|
||||
while (!aud->quit_thread)
|
||||
{
|
||||
sysEventQueueReceive(id, &event, PS3_SYS_NO_TIMEOUT);
|
||||
sys_event_queue_receive(id, &event, SYS_NO_TIMEOUT);
|
||||
|
||||
sysLwMutexLock(&aud->lock, PS3_SYS_NO_TIMEOUT);
|
||||
if (FIFO_READ_AVAIL(aud->buffer) >= sizeof(out_tmp))
|
||||
sys_lwmutex_lock(&aud->lock, SYS_NO_TIMEOUT);
|
||||
if (fifo_read_avail(aud->buffer) >= sizeof(out_tmp))
|
||||
fifo_read(aud->buffer, out_tmp, sizeof(out_tmp));
|
||||
else
|
||||
memset(out_tmp, 0, sizeof(out_tmp));
|
||||
sysLwMutexUnlock(&aud->lock);
|
||||
sysLwCondSignal(&aud->cond);
|
||||
sys_lwmutex_unlock(&aud->lock);
|
||||
sys_lwcond_signal(&aud->cond);
|
||||
|
||||
audioAddData(aud->audio_port, out_tmp,
|
||||
AUDIO_BLOCK_SAMPLES, 1.0);
|
||||
cellAudioAddData(aud->audio_port, out_tmp,
|
||||
CELL_AUDIO_BLOCK_SAMPLES, 1.0);
|
||||
}
|
||||
|
||||
audioRemoveNotifyEventQueue(key);
|
||||
sysThreadExit(0);
|
||||
cellAudioRemoveNotifyEventQueue(key);
|
||||
sys_ppu_thread_exit(0);
|
||||
}
|
||||
|
||||
static void *ps3_audio_init(const char *device,
|
||||
@@ -81,63 +81,67 @@ static void *ps3_audio_init(const char *device,
|
||||
unsigned block_frames,
|
||||
unsigned *new_rate)
|
||||
{
|
||||
audioPortParam params;
|
||||
ps3_audio_t *data = NULL;
|
||||
CellAudioPortParam params;
|
||||
ps3_audio_t *data = calloc(1, sizeof(*data));
|
||||
if (!data)
|
||||
return NULL;
|
||||
|
||||
(void)latency;
|
||||
(void)device;
|
||||
(void)rate;
|
||||
|
||||
cellAudioInit();
|
||||
|
||||
params.numChannels = AUDIO_CHANNELS;
|
||||
params.numBlocks = AUDIO_BLOCKS;
|
||||
#if 0
|
||||
#ifdef HAVE_HEADSET
|
||||
if(global->console.sound.mode == SOUND_MODE_HEADSET)
|
||||
params.param_attrib = CELL_AUDIO_PORTATTR_OUT_SECONDARY;
|
||||
else
|
||||
#endif
|
||||
#endif
|
||||
params.param_attrib = 0;
|
||||
|
||||
if (cellAudioPortOpen(¶ms, &data->audio_port) != CELL_OK)
|
||||
{
|
||||
cellAudioQuit();
|
||||
free(data);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
data->buffer = fifo_new(CELL_AUDIO_BLOCK_SAMPLES *
|
||||
AUDIO_CHANNELS * AUDIO_BLOCKS * sizeof(float));
|
||||
|
||||
#ifdef __PSL1GHT__
|
||||
sys_lwmutex_attr_t lock_attr =
|
||||
sys_lwmutex_attr_t lock_attr =
|
||||
{SYS_LWMUTEX_ATTR_PROTOCOL, SYS_LWMUTEX_ATTR_RECURSIVE, "\0"};
|
||||
sys_lwmutex_attr_t cond_lock_attr =
|
||||
{SYS_LWMUTEX_ATTR_PROTOCOL, SYS_LWMUTEX_ATTR_RECURSIVE, "\0"};
|
||||
sys_lwcond_attr_t cond_attr = {"\0"};
|
||||
sys_lwcond_attribute_t cond_attr = {"\0"};
|
||||
#else
|
||||
sys_lwmutex_attr_t lock_attr;
|
||||
sys_lwmutex_attr_t cond_lock_attr;
|
||||
sys_lwcond_attr_t cond_attr;
|
||||
sys_lwmutex_attribute_t lock_attr;
|
||||
sys_lwmutex_attribute_t cond_lock_attr;
|
||||
sys_lwcond_attribute_t cond_attr;
|
||||
|
||||
sys_lwmutex_attribute_initialize(lock_attr);
|
||||
sys_lwmutex_attribute_initialize(cond_lock_attr);
|
||||
sys_lwcond_attribute_initialize(cond_attr);
|
||||
#endif
|
||||
|
||||
data = calloc(1, sizeof(*data));
|
||||
if (!data)
|
||||
return NULL;
|
||||
sys_lwmutex_create(&data->lock, &lock_attr);
|
||||
sys_lwmutex_create(&data->cond_lock, &cond_lock_attr);
|
||||
sys_lwcond_create(&data->cond, &data->cond_lock, &cond_attr);
|
||||
|
||||
audioInit();
|
||||
|
||||
params.numChannels = AUDIO_CHANNELS;
|
||||
params.numBlocks = AUDIO_BLOCKS;
|
||||
params.param_attrib = 0;
|
||||
#if 0
|
||||
#ifdef HAVE_HEADSET
|
||||
if(global->console.sound.mode == SOUND_MODE_HEADSET)
|
||||
params.param_attrib = CELL_AUDIO_PORTATTR_OUT_SECONDARY;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (audioPortOpen(¶ms, &data->audio_port) != CELL_OK)
|
||||
{
|
||||
audioQuit();
|
||||
free(data);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
data->buffer = fifo_new(AUDIO_BLOCK_SAMPLES *
|
||||
AUDIO_CHANNELS * AUDIO_BLOCKS * sizeof(float));
|
||||
|
||||
sysLwMutexCreate(&data->lock, &lock_attr);
|
||||
sysLwMutexCreate(&data->cond_lock, &cond_lock_attr);
|
||||
sysLwCondCreate(&data->cond, &data->cond_lock, &cond_attr);
|
||||
|
||||
audioPortStart(data->audio_port);
|
||||
cellAudioPortStart(data->audio_port);
|
||||
data->started = true;
|
||||
sysThreadCreate(&data->thread, event_loop,
|
||||
sys_ppu_thread_create(&data->thread, event_loop,
|
||||
#ifdef __PSL1GHT__
|
||||
data,
|
||||
#else
|
||||
(uint64_t)data,
|
||||
#endif
|
||||
1500, 0x1000, SYS_THREAD_CREATE_JOINABLE, (char*)"sound");
|
||||
1500, 0x1000, SYS_PPU_THREAD_CREATE_JOINABLE, (char*)"sound");
|
||||
|
||||
return data;
|
||||
}
|
||||
@@ -148,16 +152,16 @@ static ssize_t ps3_audio_write(void *data, const void *buf, size_t size)
|
||||
|
||||
if (aud->nonblock)
|
||||
{
|
||||
if (FIFO_WRITE_AVAIL(aud->buffer) < size)
|
||||
if (fifo_write_avail(aud->buffer) < size)
|
||||
return 0;
|
||||
}
|
||||
|
||||
while (FIFO_WRITE_AVAIL(aud->buffer) < size)
|
||||
sysLwCondWait(&aud->cond, 0);
|
||||
while (fifo_write_avail(aud->buffer) < size)
|
||||
sys_lwcond_wait(&aud->cond, 0);
|
||||
|
||||
sysLwMutexLock(&aud->lock, PS3_SYS_NO_TIMEOUT);
|
||||
sys_lwmutex_lock(&aud->lock, SYS_NO_TIMEOUT);
|
||||
fifo_write(aud->buffer, buf, size);
|
||||
sysLwMutexUnlock(&aud->lock);
|
||||
sys_lwmutex_unlock(&aud->lock);
|
||||
|
||||
return size;
|
||||
}
|
||||
@@ -167,7 +171,7 @@ static bool ps3_audio_stop(void *data)
|
||||
ps3_audio_t *aud = data;
|
||||
if (aud->started)
|
||||
{
|
||||
audioPortStop(aud->audio_port);
|
||||
cellAudioPortStop(aud->audio_port);
|
||||
aud->started = false;
|
||||
}
|
||||
return true;
|
||||
@@ -178,7 +182,7 @@ static bool ps3_audio_start(void *data, bool is_shutdown)
|
||||
ps3_audio_t *aud = data;
|
||||
if (!aud->started)
|
||||
{
|
||||
audioPortStart(aud->audio_port);
|
||||
cellAudioPortStart(aud->audio_port);
|
||||
aud->started = true;
|
||||
}
|
||||
return true;
|
||||
@@ -206,28 +210,29 @@ static void ps3_audio_free(void *data)
|
||||
|
||||
aud->quit_thread = true;
|
||||
ps3_audio_start(aud, false);
|
||||
sysThreadJoin(aud->thread, &val);
|
||||
sys_ppu_thread_join(aud->thread, &val);
|
||||
|
||||
ps3_audio_stop(aud);
|
||||
audioPortClose(aud->audio_port);
|
||||
audioQuit();
|
||||
cellAudioPortClose(aud->audio_port);
|
||||
cellAudioQuit();
|
||||
fifo_free(aud->buffer);
|
||||
|
||||
sysLwMutexDestroy(&aud->lock);
|
||||
sysLwMutexDestroy(&aud->cond_lock);
|
||||
sysLwCondDestroy(&aud->cond);
|
||||
sys_lwmutex_destroy(&aud->lock);
|
||||
sys_lwmutex_destroy(&aud->cond_lock);
|
||||
sys_lwcond_destroy(&aud->cond);
|
||||
|
||||
free(data);
|
||||
}
|
||||
|
||||
static bool ps3_audio_use_float(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return true;
|
||||
}
|
||||
|
||||
static size_t ps3_audio_write_avail(void *data)
|
||||
{
|
||||
/* TODO/FIXME - implement? */
|
||||
(void)data;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,23 +44,23 @@
|
||||
|
||||
typedef struct psp_audio
|
||||
{
|
||||
bool nonblock;
|
||||
|
||||
uint32_t* buffer;
|
||||
uint32_t* zeroBuffer;
|
||||
|
||||
SceUID thread;
|
||||
int rate;
|
||||
|
||||
volatile bool running;
|
||||
volatile uint16_t read_pos;
|
||||
volatile uint16_t write_pos;
|
||||
|
||||
sthread_t *worker_thread;
|
||||
slock_t *fifo_lock;
|
||||
scond_t *cond;
|
||||
slock_t *cond_lock;
|
||||
|
||||
SceUID thread;
|
||||
|
||||
int rate;
|
||||
|
||||
volatile uint16_t read_pos;
|
||||
volatile uint16_t write_pos;
|
||||
|
||||
volatile bool running;
|
||||
bool nonblock;
|
||||
} psp_audio_t;
|
||||
|
||||
#define AUDIO_OUT_COUNT 512u
|
||||
|
||||
@@ -105,11 +105,8 @@ static bool ra_alive(void *data)
|
||||
static void ra_set_nonblock_state(void *data, bool state)
|
||||
{
|
||||
roar_t *roar = (roar_t*)data;
|
||||
|
||||
if (roar_vs_blocking(roar->vss, (state) ? ROAR_VS_FALSE : ROAR_VS_TRUE, NULL) < 0)
|
||||
{
|
||||
RARCH_ERR("Can't set nonblocking. Will not be able to fast-forward.\n");
|
||||
}
|
||||
fprintf(stderr, "RetroArch [ERROR]: Can't set nonblocking. Will not be able to fast-forward.\n");
|
||||
roar->nonblocking = state;
|
||||
}
|
||||
|
||||
|
||||
+11
-10
@@ -27,20 +27,21 @@
|
||||
typedef struct rsd
|
||||
{
|
||||
rsound_t *rd;
|
||||
|
||||
fifo_buffer_t *buffer;
|
||||
slock_t *cond_lock;
|
||||
scond_t *cond;
|
||||
|
||||
bool nonblock;
|
||||
bool is_paused;
|
||||
volatile bool has_error;
|
||||
|
||||
fifo_buffer_t *buffer;
|
||||
|
||||
slock_t *cond_lock;
|
||||
scond_t *cond;
|
||||
} rsd_t;
|
||||
|
||||
static ssize_t rsound_audio_cb(void *data, size_t bytes, void *userdata)
|
||||
{
|
||||
rsd_t *rsd = (rsd_t*)userdata;
|
||||
size_t avail = FIFO_READ_AVAIL(rsd->buffer);
|
||||
rsd_t *rsd = (rsd_t*)userdata;
|
||||
|
||||
size_t avail = fifo_read_avail(rsd->buffer);
|
||||
size_t write_size = bytes > avail ? avail : bytes;
|
||||
fifo_read(rsd->buffer, data, write_size);
|
||||
scond_signal(rsd->cond);
|
||||
@@ -114,7 +115,7 @@ static ssize_t rs_write(void *data, const void *buf, size_t size)
|
||||
|
||||
rsd_callback_lock(rsd->rd);
|
||||
|
||||
avail = FIFO_WRITE_AVAIL(rsd->buffer);
|
||||
avail = fifo_write_avail(rsd->buffer);
|
||||
write_amt = avail > size ? size : avail;
|
||||
|
||||
fifo_write(rsd->buffer, buf, write_amt);
|
||||
@@ -129,7 +130,7 @@ static ssize_t rs_write(void *data, const void *buf, size_t size)
|
||||
size_t avail;
|
||||
rsd_callback_lock(rsd->rd);
|
||||
|
||||
avail = FIFO_WRITE_AVAIL(rsd->buffer);
|
||||
avail = fifo_write_avail(rsd->buffer);
|
||||
|
||||
if (avail == 0)
|
||||
{
|
||||
@@ -208,7 +209,7 @@ static size_t rs_write_avail(void *data)
|
||||
if (rsd->has_error)
|
||||
return 0;
|
||||
rsd_callback_lock(rsd->rd);
|
||||
val = FIFO_WRITE_AVAIL(rsd->buffer);
|
||||
val = fifo_write_avail(rsd->buffer);
|
||||
rsd_callback_unlock(rsd->rd);
|
||||
return val;
|
||||
}
|
||||
|
||||
+33
-26
@@ -30,69 +30,76 @@ void RWebAudioSetNonblockState(bool state);
|
||||
void RWebAudioFree(void);
|
||||
size_t RWebAudioWriteAvail(void);
|
||||
size_t RWebAudioBufferSize(void);
|
||||
|
||||
typedef struct rweb_audio
|
||||
{
|
||||
bool is_paused;
|
||||
} rweb_audio_t;
|
||||
static bool rwebaudio_is_paused;
|
||||
|
||||
static void rwebaudio_free(void *data)
|
||||
{
|
||||
RWebAudioFree();
|
||||
free(data);
|
||||
}
|
||||
|
||||
static void *rwebaudio_init(const char *device, unsigned rate, unsigned latency,
|
||||
unsigned block_frames,
|
||||
unsigned *new_rate)
|
||||
{
|
||||
rweb_audio_t *rwebaudio = (rweb_audio_t*)calloc(1, sizeof(rweb_audio_t));
|
||||
if (!rwebaudio)
|
||||
return NULL;
|
||||
if (RWebAudioInit(latency) == 1)
|
||||
void *data = RWebAudioInit(latency);
|
||||
|
||||
(void)device;
|
||||
(void)rate;
|
||||
|
||||
if (data)
|
||||
*new_rate = RWebAudioSampleRate();
|
||||
return rwebaudio;
|
||||
return data;
|
||||
}
|
||||
|
||||
static ssize_t rwebaudio_write(void *data, const void *buf, size_t size)
|
||||
{
|
||||
(void)data;
|
||||
return RWebAudioWrite(buf, size);
|
||||
}
|
||||
|
||||
static bool rwebaudio_stop(void *data)
|
||||
{
|
||||
rweb_audio_t *rwebaudio = (rweb_audio_t*)data;
|
||||
if (!rwebaudio)
|
||||
return false;
|
||||
rwebaudio->is_paused = true;
|
||||
(void)data;
|
||||
rwebaudio_is_paused = true;
|
||||
return RWebAudioStop();
|
||||
}
|
||||
|
||||
static void rwebaudio_set_nonblock_state(void *data, bool state)
|
||||
{
|
||||
(void)data;
|
||||
RWebAudioSetNonblockState(state);
|
||||
}
|
||||
|
||||
static bool rwebaudio_alive(void *data)
|
||||
{
|
||||
rweb_audio_t *rwebaudio = (rweb_audio_t*)data;
|
||||
if (!rwebaudio)
|
||||
return false;
|
||||
return !rwebaudio->is_paused;
|
||||
(void)data;
|
||||
return !rwebaudio_is_paused;
|
||||
}
|
||||
|
||||
static bool rwebaudio_start(void *data, bool is_shutdown)
|
||||
{
|
||||
rweb_audio_t *rwebaudio = (rweb_audio_t*)data;
|
||||
if (!rwebaudio)
|
||||
return false;
|
||||
rwebaudio->is_paused = false;
|
||||
(void)data;
|
||||
rwebaudio_is_paused = false;
|
||||
return RWebAudioStart();
|
||||
}
|
||||
|
||||
static size_t rwebaudio_write_avail(void *data) {return RWebAudioWriteAvail();}
|
||||
static size_t rwebaudio_buffer_size(void *data) {return RWebAudioBufferSize();}
|
||||
static bool rwebaudio_use_float(void *data) { return true; }
|
||||
static size_t rwebaudio_write_avail(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return RWebAudioWriteAvail();
|
||||
}
|
||||
|
||||
static size_t rwebaudio_buffer_size(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return RWebAudioBufferSize();
|
||||
}
|
||||
|
||||
static bool rwebaudio_use_float(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return true;
|
||||
}
|
||||
|
||||
audio_driver_t audio_rwebaudio = {
|
||||
rwebaudio_init,
|
||||
|
||||
+13
-16
@@ -33,19 +33,20 @@
|
||||
|
||||
typedef struct sdl_audio
|
||||
{
|
||||
bool nonblock;
|
||||
bool is_paused;
|
||||
|
||||
#ifdef HAVE_THREADS
|
||||
slock_t *lock;
|
||||
scond_t *cond;
|
||||
#endif
|
||||
fifo_buffer_t *buffer;
|
||||
bool nonblock;
|
||||
bool is_paused;
|
||||
} sdl_audio_t;
|
||||
|
||||
static void sdl_audio_cb(void *data, Uint8 *stream, int len)
|
||||
{
|
||||
sdl_audio_t *sdl = (sdl_audio_t*)data;
|
||||
size_t avail = FIFO_READ_AVAIL(sdl->buffer);
|
||||
size_t avail = fifo_read_avail(sdl->buffer);
|
||||
size_t write_size = len > (int)avail ? avail : len;
|
||||
|
||||
fifo_read(sdl->buffer, stream, write_size);
|
||||
@@ -74,24 +75,19 @@ static void *sdl_audio_init(const char *device,
|
||||
int frames;
|
||||
size_t bufsize;
|
||||
SDL_AudioSpec out;
|
||||
SDL_AudioSpec spec = {0};
|
||||
void *tmp = NULL;
|
||||
sdl_audio_t *sdl = NULL;
|
||||
uint32_t sdl_subsystem_flags = SDL_WasInit(0);
|
||||
SDL_AudioSpec spec = {0};
|
||||
void *tmp = NULL;
|
||||
sdl_audio_t *sdl = NULL;
|
||||
|
||||
(void)device;
|
||||
|
||||
/* Initialise audio subsystem, if required */
|
||||
if (sdl_subsystem_flags == 0)
|
||||
if (SDL_WasInit(0) == 0)
|
||||
{
|
||||
if (SDL_Init(SDL_INIT_AUDIO) < 0)
|
||||
return NULL;
|
||||
}
|
||||
else if ((sdl_subsystem_flags & SDL_INIT_AUDIO) == 0)
|
||||
{
|
||||
if (SDL_InitSubSystem(SDL_INIT_AUDIO) < 0)
|
||||
return NULL;
|
||||
}
|
||||
else if (SDL_InitSubSystem(SDL_INIT_AUDIO) < 0)
|
||||
return NULL;
|
||||
|
||||
sdl = (sdl_audio_t*)calloc(1, sizeof(*sdl));
|
||||
if (!sdl)
|
||||
@@ -155,7 +151,7 @@ static ssize_t sdl_audio_write(void *data, const void *buf, size_t size)
|
||||
size_t avail, write_amt;
|
||||
|
||||
SDL_LockAudio();
|
||||
avail = FIFO_WRITE_AVAIL(sdl->buffer);
|
||||
avail = fifo_write_avail(sdl->buffer);
|
||||
write_amt = avail > size ? size : avail;
|
||||
fifo_write(sdl->buffer, buf, write_amt);
|
||||
SDL_UnlockAudio();
|
||||
@@ -170,7 +166,7 @@ static ssize_t sdl_audio_write(void *data, const void *buf, size_t size)
|
||||
size_t avail;
|
||||
|
||||
SDL_LockAudio();
|
||||
avail = FIFO_WRITE_AVAIL(sdl->buffer);
|
||||
avail = fifo_write_avail(sdl->buffer);
|
||||
|
||||
if (avail == 0)
|
||||
{
|
||||
@@ -232,6 +228,7 @@ static void sdl_audio_free(void *data)
|
||||
sdl_audio_t *sdl = (sdl_audio_t*)data;
|
||||
|
||||
SDL_CloseAudio();
|
||||
SDL_QuitSubSystem(SDL_INIT_AUDIO);
|
||||
|
||||
if (sdl)
|
||||
{
|
||||
|
||||
@@ -29,11 +29,12 @@
|
||||
#define BUFFER_COUNT 3
|
||||
#endif
|
||||
|
||||
|
||||
#define SAMPLE_RATE 48000
|
||||
#define NUM_CHANNELS 2
|
||||
|
||||
#define SAMPLE_BUFFER_SIZE (((SAMPLE_RATE * NUM_CHANNELS * sizeof(uint16_t)) + 0xfff) & ~0xfff)
|
||||
static const int sample_rate = 48000;
|
||||
static const int max_num_samples = sample_rate;
|
||||
static const int num_channels = 2;
|
||||
#ifndef HAVE_LIBNX
|
||||
static const size_t sample_buffer_size = ((max_num_samples * num_channels * sizeof(uint16_t)) + 0xfff) & ~0xfff;
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -50,26 +51,24 @@ typedef struct
|
||||
#endif
|
||||
} switch_audio_t;
|
||||
|
||||
static uint32_t switch_audio_data_size(void)
|
||||
{
|
||||
#ifdef HAVE_LIBNX
|
||||
static uint32_t switch_audio_data_size(void)
|
||||
{
|
||||
static const int framerate = 1000 / 30;
|
||||
static const int sample_count = (SAMPLE_RATE / framerate);
|
||||
return (sample_count * NUM_CHANNELS * sizeof(uint16_t));
|
||||
}
|
||||
static const int framerate = 1000 / 30;
|
||||
static const int samplecount = (sample_rate / framerate);
|
||||
return (samplecount * num_channels * sizeof(uint16_t));
|
||||
#else
|
||||
static uint32_t switch_audio_data_size(void)
|
||||
{
|
||||
return SAMPLE_BUFFER_SIZE;
|
||||
}
|
||||
return sample_buffer_size;
|
||||
#endif
|
||||
}
|
||||
|
||||
static size_t switch_audio_buffer_size(void *data)
|
||||
{
|
||||
(void) data;
|
||||
#ifdef HAVE_LIBNX
|
||||
return (switch_audio_data_size() + 0xfff) & ~0xfff;
|
||||
#else
|
||||
return SAMPLE_BUFFER_SIZE;
|
||||
return sample_buffer_size;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -86,7 +85,7 @@ static ssize_t switch_audio_write(void *data, const void *buf, size_t size)
|
||||
uint32_t num;
|
||||
if (switch_audio_ipc_output_get_released_buffer(swa, num) != 0)
|
||||
{
|
||||
RARCH_ERR("[Audio]: Failed to get released buffer?\n");
|
||||
RARCH_LOG("Failed to get released buffer?\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -107,7 +106,7 @@ static ssize_t switch_audio_write(void *data, const void *buf, size_t size)
|
||||
num = 0;
|
||||
|
||||
#ifdef HAVE_LIBNX
|
||||
if (audoutWaitPlayFinish(&swa->current_buffer, &num, UINT64_MAX) != 0) { }
|
||||
if (audoutWaitPlayFinish(&swa->current_buffer, &num, U64_MAX) != 0) { }
|
||||
#else
|
||||
svcWaitSynchronization(&handle_idx, &swa->event, 1, 33333333);
|
||||
svcResetSignal(swa->event);
|
||||
@@ -124,11 +123,11 @@ static ssize_t switch_audio_write(void *data, const void *buf, size_t size)
|
||||
if (to_write > switch_audio_buffer_size(NULL) - swa->current_buffer->data_size)
|
||||
to_write = switch_audio_buffer_size(NULL) - swa->current_buffer->data_size;
|
||||
|
||||
#ifndef HAVE_LIBNX
|
||||
memcpy(((uint8_t*) swa->current_buffer->sample_data) + swa->current_buffer->data_size, buf, to_write);
|
||||
#else
|
||||
memcpy(((uint8_t*) swa->current_buffer->buffer) + swa->current_buffer->data_size, buf, to_write);
|
||||
#endif
|
||||
#ifndef HAVE_LIBNX
|
||||
memcpy(((uint8_t*) swa->current_buffer->sample_data) + swa->current_buffer->data_size, buf, to_write);
|
||||
#else
|
||||
memcpy(((uint8_t*) swa->current_buffer->buffer) + swa->current_buffer->data_size, buf, to_write);
|
||||
#endif
|
||||
swa->current_buffer->data_size += to_write;
|
||||
swa->current_buffer->buffer_size = switch_audio_buffer_size(NULL);
|
||||
|
||||
@@ -152,6 +151,7 @@ static bool switch_audio_stop(void *data)
|
||||
|
||||
/* TODO/FIXME - fix libnx codepath */
|
||||
#ifndef HAVE_LIBNX
|
||||
|
||||
if (!swa->is_paused)
|
||||
if (switch_audio_ipc_output_stop(swa) != 0)
|
||||
return false;
|
||||
@@ -211,7 +211,8 @@ static void switch_audio_free(void *data)
|
||||
|
||||
static bool switch_audio_use_float(void *data)
|
||||
{
|
||||
return false; /* force INT16 */
|
||||
(void) data;
|
||||
return false; /* force INT16 */
|
||||
}
|
||||
|
||||
static size_t switch_audio_write_avail(void *data)
|
||||
@@ -238,8 +239,8 @@ static void *switch_audio_init(const char *device,
|
||||
unsigned *new_rate)
|
||||
{
|
||||
unsigned i;
|
||||
#ifndef HAVE_LIBNX
|
||||
char names[8][0x20];
|
||||
#ifndef HAVE_LIBNX
|
||||
uint32_t num_names = 0;
|
||||
#endif
|
||||
switch_audio_t *swa = (switch_audio_t*) calloc(1, sizeof(*swa));
|
||||
@@ -266,16 +267,16 @@ static void *switch_audio_init(const char *device,
|
||||
if (audio_ipc_open_output(names[0], &swa->output) != 0)
|
||||
goto fail_audio_ipc;
|
||||
|
||||
if (swa->output.sample_rate != SAMPLE_RATE)
|
||||
if (swa->output.sample_rate != sample_rate)
|
||||
{
|
||||
RARCH_ERR("expected sample rate of %d, got sample rate of %d\n",
|
||||
SAMPLE_RATE, swa->output.sample_rate);
|
||||
sample_rate, swa->output.sample_rate);
|
||||
goto fail_audio_output;
|
||||
}
|
||||
|
||||
if (swa->output.num_channels != NUM_CHANNELS)
|
||||
if (swa->output.num_channels != num_channels)
|
||||
{
|
||||
RARCH_ERR("expected %d channels, got %d\n", NUM_CHANNELS,
|
||||
RARCH_ERR("expected %d channels, got %d\n", num_channels,
|
||||
swa->output.num_channels);
|
||||
goto fail_audio_output;
|
||||
}
|
||||
@@ -307,8 +308,7 @@ static void *switch_audio_init(const char *device,
|
||||
#else
|
||||
swa->buffers[i].ptr = &swa->buffers[i].sample_data;
|
||||
swa->buffers[i].unknown = 0;
|
||||
swa->buffers[i].sample_data = alloc_pages(SAMPLE_BUFFER_SIZE,
|
||||
switch_audio_buffer_size(NULL), NULL);
|
||||
swa->buffers[i].sample_data = alloc_pages(sample_buffer_size, switch_audio_buffer_size(NULL), NULL);
|
||||
|
||||
if (!swa->buffers[i].sample_data)
|
||||
goto fail_audio_output;
|
||||
|
||||
@@ -46,10 +46,6 @@ typedef AudioOutBuffer compat_audio_out_buffer;
|
||||
#define switch_audio_ipc_output_stop(a) audoutStopAudioOut()
|
||||
#define switch_audio_ipc_output_start(a) audoutStartAudioOut()
|
||||
|
||||
#ifndef UINT64_MAX
|
||||
#define UINT64_MAX U64_MAX
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
/* libtransistor definitions */
|
||||
|
||||
@@ -241,7 +241,7 @@ static ssize_t libnx_audren_audio_write(void *data,
|
||||
|
||||
if (aud->nonblock)
|
||||
{
|
||||
while (written < size)
|
||||
while(written < size)
|
||||
{
|
||||
written += libnx_audren_audio_append(
|
||||
aud, buf + written, size - written);
|
||||
@@ -251,7 +251,7 @@ static ssize_t libnx_audren_audio_write(void *data,
|
||||
}
|
||||
else
|
||||
{
|
||||
while (written < size)
|
||||
while(written < size)
|
||||
{
|
||||
written += libnx_audren_audio_append(
|
||||
aud, buf + written, size - written);
|
||||
|
||||
@@ -96,7 +96,7 @@ static void thread_job(void* data)
|
||||
if (current_wavebuf)
|
||||
{
|
||||
mutexLock(&aud->fifo_lock);
|
||||
available = aud->paused ? 0 : FIFO_READ_AVAIL(aud->fifo);
|
||||
available = aud->paused ? 0 : fifo_read_avail(aud->fifo);
|
||||
written_tmp = MIN(available, aud->buffer_size - current_size);
|
||||
dstbuf = current_pool_ptr + current_size;
|
||||
if (written_tmp > 0)
|
||||
@@ -295,7 +295,7 @@ static ssize_t libnx_audren_thread_audio_write(void *data,
|
||||
if (aud->nonblock)
|
||||
{
|
||||
mutexLock(&aud->fifo_lock);
|
||||
available = FIFO_WRITE_AVAIL(aud->fifo);
|
||||
available = fifo_write_avail(aud->fifo);
|
||||
written = MIN(available, size);
|
||||
if (written > 0)
|
||||
fifo_write(aud->fifo, buf, written);
|
||||
@@ -307,7 +307,7 @@ static ssize_t libnx_audren_thread_audio_write(void *data,
|
||||
while (written < size && aud->running)
|
||||
{
|
||||
mutexLock(&aud->fifo_lock);
|
||||
available = FIFO_WRITE_AVAIL(aud->fifo);
|
||||
available = fifo_write_avail(aud->fifo);
|
||||
if (available)
|
||||
{
|
||||
written_tmp = MIN(size - written, available);
|
||||
@@ -407,7 +407,7 @@ static size_t libnx_audren_thread_audio_write_avail(void *data)
|
||||
return 0;
|
||||
|
||||
mutexLock(&aud->fifo_lock);
|
||||
available = FIFO_WRITE_AVAIL(aud->fifo);
|
||||
available = fifo_write_avail(aud->fifo);
|
||||
mutexUnlock(&aud->fifo_lock);
|
||||
|
||||
return available;
|
||||
|
||||
@@ -35,9 +35,10 @@
|
||||
|
||||
#include "switch_audio_compat.h"
|
||||
|
||||
#define THREAD_STACK_SIZE (1024 * 8)
|
||||
#define THREAD_PREFERRED_CPU 2
|
||||
#define SAMPLE_SIZE sizeof(uint16_t)
|
||||
static const size_t thread_stack_size = 1024 * 8;
|
||||
static const int thread_preferred_cpu = 2;
|
||||
static const int channel_count = 2;
|
||||
static const size_t sample_size = sizeof(uint16_t);
|
||||
|
||||
#define AUDIO_BUFFER_COUNT 2
|
||||
|
||||
@@ -85,7 +86,7 @@ static void mainLoop(void* data)
|
||||
if (!released_out_buffer)
|
||||
{
|
||||
#ifdef HAVE_LIBNX
|
||||
rc = audoutWaitPlayFinish(&released_out_buffer, &released_out_count, UINT64_MAX);
|
||||
rc = audoutWaitPlayFinish(&released_out_buffer, &released_out_count, U64_MAX);
|
||||
#else
|
||||
uint32_t handle_idx = 0;
|
||||
svcWaitSynchronization(&handle_idx, &swa->event, 1, 33333333);
|
||||
@@ -106,7 +107,7 @@ static void mainLoop(void* data)
|
||||
|
||||
compat_mutex_lock(&swa->fifoLock);
|
||||
|
||||
avail = FIFO_READ_AVAIL(swa->fifo);
|
||||
avail = fifo_read_avail(swa->fifo);
|
||||
to_write = MIN(avail, buf_avail);
|
||||
if (to_write > 0)
|
||||
{
|
||||
@@ -206,7 +207,7 @@ static void *switch_thread_audio_init(const char *device, unsigned rate, unsigne
|
||||
#endif
|
||||
|
||||
*new_rate = swa->sampleRate;
|
||||
swa->fifoSize = (swa->sampleRate * SAMPLE_SIZE * swa->latency) / 1000;
|
||||
swa->fifoSize = (swa->sampleRate * sample_size * swa->latency) / 1000;
|
||||
|
||||
for (i = 0; i < AUDIO_BUFFER_COUNT; i++)
|
||||
{
|
||||
@@ -247,7 +248,7 @@ static void *switch_thread_audio_init(const char *device, unsigned rate, unsigne
|
||||
device, rate, swa->sampleRate, swa->latency, block_frames, swa->fifoSize);
|
||||
|
||||
svcGetThreadPriority(&prio, 0xffff8000);
|
||||
rc = compat_thread_create(&swa->thread, &mainLoop, (void*)swa, THREAD_STACK_SIZE, prio - 1, THREAD_PREFERRED_CPU);
|
||||
rc = compat_thread_create(&swa->thread, &mainLoop, (void*)swa, thread_stack_size, prio - 1, thread_preferred_cpu);
|
||||
|
||||
if (R_FAILED(rc))
|
||||
{
|
||||
@@ -348,7 +349,7 @@ static ssize_t switch_thread_audio_write(void *data, const void *buf, size_t siz
|
||||
if (swa->nonblock)
|
||||
{
|
||||
compat_mutex_lock(&swa->fifoLock);
|
||||
avail = FIFO_WRITE_AVAIL(swa->fifo);
|
||||
avail = fifo_write_avail(swa->fifo);
|
||||
written = MIN(avail, size);
|
||||
if (written > 0)
|
||||
fifo_write(swa->fifo, buf, written);
|
||||
@@ -360,7 +361,7 @@ static ssize_t switch_thread_audio_write(void *data, const void *buf, size_t siz
|
||||
while (written < size && swa->running)
|
||||
{
|
||||
compat_mutex_lock(&swa->fifoLock);
|
||||
avail = FIFO_WRITE_AVAIL(swa->fifo);
|
||||
avail = fifo_write_avail(swa->fifo);
|
||||
if (avail == 0)
|
||||
{
|
||||
compat_mutex_unlock(&swa->fifoLock);
|
||||
@@ -412,7 +413,7 @@ static size_t switch_thread_audio_write_avail(void *data)
|
||||
switch_thread_audio_t* swa = (switch_thread_audio_t*)data;
|
||||
|
||||
compat_mutex_lock(&swa->fifoLock);
|
||||
val = FIFO_WRITE_AVAIL(swa->fifo);
|
||||
val = fifo_write_avail(swa->fifo);
|
||||
compat_mutex_unlock(&swa->fifoLock);
|
||||
|
||||
return val;
|
||||
|
||||
+18
-15
@@ -1208,18 +1208,21 @@ static int pcm_mmap_begin(struct pcm *pcm, void **areas, unsigned int *offset,
|
||||
|
||||
static int pcm_mmap_commit(struct pcm *pcm, unsigned int offset, unsigned int frames)
|
||||
{
|
||||
int ret;
|
||||
int ret;
|
||||
|
||||
/* not used */
|
||||
(void) offset;
|
||||
/* not used */
|
||||
(void) offset;
|
||||
|
||||
/* update the application pointer in userspace and kernel */
|
||||
pcm_mmap_appl_forward(pcm, frames);
|
||||
ret = pcm_sync_ptr(pcm, 0);
|
||||
if (ret != 0)
|
||||
return ret;
|
||||
/* update the application pointer in userspace and kernel */
|
||||
pcm_mmap_appl_forward(pcm, frames);
|
||||
ret = pcm_sync_ptr(pcm, 0);
|
||||
if (ret != 0)
|
||||
{
|
||||
printf("%d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
return frames;
|
||||
return frames;
|
||||
}
|
||||
|
||||
static void pcm_mmap_appl_forward(struct pcm *pcm, int frames)
|
||||
@@ -1522,7 +1525,7 @@ static struct pcm_params *pcm_params_get(unsigned int card, unsigned int device,
|
||||
fd = open(fn, O_RDWR|O_NONBLOCK);
|
||||
if (fd < 0)
|
||||
{
|
||||
RARCH_ERR("[TINYALSA] Cannot open device '%s'\n", fn);
|
||||
fprintf(stderr, "cannot open device '%s'\n", fn);
|
||||
goto err_open;
|
||||
}
|
||||
|
||||
@@ -1535,7 +1538,7 @@ static struct pcm_params *pcm_params_get(unsigned int card, unsigned int device,
|
||||
param_init(params);
|
||||
if (ioctl(fd, SNDRV_PCM_IOCTL_HW_REFINE, params))
|
||||
{
|
||||
RARCH_ERR("[TINYALSA] SNDRV_PCM_IOCTL_HW_REFINE error (%d)\n", errno);
|
||||
fprintf(stderr, "SNDRV_PCM_IOCTL_HW_REFINE error (%d)\n", errno);
|
||||
goto err_hw_refine;
|
||||
}
|
||||
|
||||
@@ -2016,7 +2019,7 @@ static int pcm_mmap_transfer(struct pcm *pcm, const void *buffer, unsigned int b
|
||||
avail = pcm_avail_update(pcm);
|
||||
if (avail < 0)
|
||||
{
|
||||
RARCH_ERR("[TINYALSA] Cannot determine available mmap frames");
|
||||
fprintf(stderr, "cannot determine available mmap frames");
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -2026,7 +2029,7 @@ static int pcm_mmap_transfer(struct pcm *pcm, const void *buffer, unsigned int b
|
||||
{
|
||||
if (pcm_start(pcm) < 0)
|
||||
{
|
||||
RARCH_ERR("[TINYALSA] Start error: hw 0x%x app 0x%x avail 0x%x\n",
|
||||
fprintf(stderr, "start error: hw 0x%x app 0x%x avail 0x%x\n",
|
||||
(unsigned int)pcm->mmap_status->hw_ptr,
|
||||
(unsigned int)pcm->mmap_control->appl_ptr,
|
||||
avail);
|
||||
@@ -2049,7 +2052,7 @@ static int pcm_mmap_transfer(struct pcm *pcm, const void *buffer, unsigned int b
|
||||
{
|
||||
pcm->prepared = 0;
|
||||
pcm->running = 0;
|
||||
RARCH_ERR("[TINYALSA] Wait error: hw 0x%x app 0x%x avail 0x%x\n",
|
||||
fprintf(stderr, "wait error: hw 0x%x app 0x%x avail 0x%x\n",
|
||||
(unsigned int)pcm->mmap_status->hw_ptr,
|
||||
(unsigned int)pcm->mmap_control->appl_ptr,
|
||||
avail);
|
||||
@@ -2070,7 +2073,7 @@ static int pcm_mmap_transfer(struct pcm *pcm, const void *buffer, unsigned int b
|
||||
frames = pcm_mmap_transfer_areas(pcm, (void *)buffer, offset, frames);
|
||||
if (frames < 0)
|
||||
{
|
||||
RARCH_ERR("[TINYALSA] Write error: hw 0x%x app 0x%x avail 0x%x\n",
|
||||
fprintf(stderr, "write error: hw 0x%x app 0x%x avail 0x%x\n",
|
||||
(unsigned int)pcm->mmap_status->hw_ptr,
|
||||
(unsigned int)pcm->mmap_control->appl_ptr,
|
||||
avail);
|
||||
|
||||
+16
-16
@@ -28,16 +28,16 @@
|
||||
|
||||
typedef struct
|
||||
{
|
||||
bool exclusive;
|
||||
bool nonblock;
|
||||
bool running;
|
||||
size_t frame_size; /* 4 or 8 only */
|
||||
size_t engine_buffer_size;
|
||||
HANDLE write_event;
|
||||
IMMDevice *device;
|
||||
IAudioClient *client;
|
||||
IAudioRenderClient *renderer;
|
||||
fifo_buffer_t *buffer; /* NULL in unbuffered shared mode */
|
||||
size_t frame_size; /* 4 or 8 only */
|
||||
size_t engine_buffer_size;
|
||||
bool exclusive;
|
||||
bool nonblock;
|
||||
bool running;
|
||||
} wasapi_t;
|
||||
|
||||
static IMMDevice *wasapi_init_device(const char *id)
|
||||
@@ -632,7 +632,7 @@ static ssize_t wasapi_write_sh_buffer(wasapi_t *w, const void * data, size_t siz
|
||||
{
|
||||
ssize_t written = -1;
|
||||
UINT32 padding = 0;
|
||||
size_t write_avail = FIFO_WRITE_AVAIL(w->buffer);
|
||||
size_t write_avail = fifo_write_avail(w->buffer);
|
||||
|
||||
if (!write_avail)
|
||||
{
|
||||
@@ -643,7 +643,7 @@ static ssize_t wasapi_write_sh_buffer(wasapi_t *w, const void * data, size_t siz
|
||||
if (FAILED(_IAudioClient_GetCurrentPadding(w->client, &padding)))
|
||||
return -1;
|
||||
|
||||
read_avail = FIFO_READ_AVAIL(w->buffer);
|
||||
read_avail = fifo_read_avail(w->buffer);
|
||||
write_avail = w->engine_buffer_size - padding * w->frame_size;
|
||||
written = read_avail < write_avail ? read_avail : write_avail;
|
||||
if (written)
|
||||
@@ -651,7 +651,7 @@ static ssize_t wasapi_write_sh_buffer(wasapi_t *w, const void * data, size_t siz
|
||||
return -1;
|
||||
}
|
||||
|
||||
write_avail = FIFO_WRITE_AVAIL(w->buffer);
|
||||
write_avail = fifo_write_avail(w->buffer);
|
||||
written = size < write_avail ? size : write_avail;
|
||||
if (written)
|
||||
fifo_write(w->buffer, data, written);
|
||||
@@ -685,20 +685,20 @@ static ssize_t wasapi_write_sh(wasapi_t *w, const void * data, size_t size)
|
||||
|
||||
static ssize_t wasapi_write_sh_nonblock(wasapi_t *w, const void * data, size_t size)
|
||||
{
|
||||
size_t write_avail = 0;
|
||||
ssize_t written = -1;
|
||||
UINT32 padding = 0;
|
||||
size_t write_avail = 0;
|
||||
ssize_t written = -1;
|
||||
UINT32 padding = 0;
|
||||
|
||||
if (w->buffer)
|
||||
{
|
||||
write_avail = FIFO_WRITE_AVAIL(w->buffer);
|
||||
write_avail = fifo_write_avail(w->buffer);
|
||||
if (!write_avail)
|
||||
{
|
||||
size_t read_avail = 0;
|
||||
if (FAILED(_IAudioClient_GetCurrentPadding(w->client, &padding)))
|
||||
return -1;
|
||||
|
||||
read_avail = FIFO_READ_AVAIL(w->buffer);
|
||||
read_avail = fifo_read_avail(w->buffer);
|
||||
write_avail = w->engine_buffer_size - padding * w->frame_size;
|
||||
written = read_avail < write_avail ? read_avail : write_avail;
|
||||
if (written)
|
||||
@@ -706,7 +706,7 @@ static ssize_t wasapi_write_sh_nonblock(wasapi_t *w, const void * data, size_t s
|
||||
return -1;
|
||||
}
|
||||
|
||||
write_avail = FIFO_WRITE_AVAIL(w->buffer);
|
||||
write_avail = fifo_write_avail(w->buffer);
|
||||
written = size < write_avail ? size : write_avail;
|
||||
if (written)
|
||||
fifo_write(w->buffer, data, written);
|
||||
@@ -731,7 +731,7 @@ static ssize_t wasapi_write_sh_nonblock(wasapi_t *w, const void * data, size_t s
|
||||
static ssize_t wasapi_write_ex(wasapi_t *w, const void * data, size_t size, DWORD ms)
|
||||
{
|
||||
ssize_t written = 0;
|
||||
size_t write_avail = FIFO_WRITE_AVAIL(w->buffer);
|
||||
size_t write_avail = fifo_write_avail(w->buffer);
|
||||
|
||||
if (!write_avail)
|
||||
{
|
||||
@@ -890,7 +890,7 @@ static size_t wasapi_write_avail(void *wh)
|
||||
UINT32 padding = 0;
|
||||
|
||||
if (w->buffer)
|
||||
return FIFO_WRITE_AVAIL(w->buffer);
|
||||
return fifo_write_avail(w->buffer);
|
||||
|
||||
if (FAILED(_IAudioClient_GetCurrentPadding(w->client, &padding)))
|
||||
return 0;
|
||||
|
||||
+17
-13
@@ -31,10 +31,11 @@ typedef struct
|
||||
AXMVoice* mvoice;
|
||||
uint16_t* buffer_l;
|
||||
uint16_t* buffer_r;
|
||||
OSSpinLock spinlock;
|
||||
bool nonblock;
|
||||
|
||||
uint32_t pos;
|
||||
uint32_t written;
|
||||
bool nonblock;
|
||||
OSSpinLock spinlock;
|
||||
} ax_audio_t;
|
||||
|
||||
/* 3072 samples main buffer, 64ms total */
|
||||
@@ -186,8 +187,7 @@ static bool ax_audio_start(void* data, bool is_shutdown)
|
||||
/* Set back to playing on enough buffered data */
|
||||
if (ax->written > AX_AUDIO_SAMPLE_LOAD)
|
||||
{
|
||||
AXSetMultiVoiceCurrentOffset(ax->mvoice,
|
||||
ax_audio_limit(ax->pos - ax->written));
|
||||
AXSetMultiVoiceCurrentOffset(ax->mvoice, ax_audio_limit(ax->pos - ax->written));
|
||||
AXSetMultiVoiceState(ax->mvoice, AX_VOICE_STATE_PLAYING);
|
||||
}
|
||||
|
||||
@@ -206,12 +206,9 @@ static ssize_t ax_audio_write(void* data, const void* buf, size_t size)
|
||||
return 0;
|
||||
|
||||
if (count > AX_AUDIO_MAX_FREE)
|
||||
count = AX_AUDIO_MAX_FREE;
|
||||
count = AX_AUDIO_MAX_FREE;
|
||||
|
||||
count_avail = (
|
||||
(ax->written > AX_AUDIO_MAX_FREE)
|
||||
? 0
|
||||
: (AX_AUDIO_MAX_FREE - ax->written));
|
||||
count_avail = ((ax->written > AX_AUDIO_MAX_FREE) ? 0 : (AX_AUDIO_MAX_FREE - ax->written));
|
||||
|
||||
if (ax->nonblock)
|
||||
{
|
||||
@@ -222,7 +219,7 @@ static ssize_t ax_audio_write(void* data, const void* buf, size_t size)
|
||||
else if (count_avail < count)
|
||||
{
|
||||
/* Sync, wait for free memory */
|
||||
while (AXIsMultiVoiceRunning(ax->mvoice) && (count_avail < count))
|
||||
while(AXIsMultiVoiceRunning(ax->mvoice) && (count_avail < count))
|
||||
{
|
||||
OSYieldThread(); /* Gives threads with same priority time to run */
|
||||
count_avail = (ax->written > AX_AUDIO_MAX_FREE ? 0 : (AX_AUDIO_MAX_FREE - ax->written));
|
||||
@@ -304,17 +301,24 @@ static void ax_audio_set_nonblock_state(void* data, bool state)
|
||||
ax->nonblock = state;
|
||||
}
|
||||
|
||||
static bool ax_audio_use_float(void* data) { return false; }
|
||||
static bool ax_audio_use_float(void* data)
|
||||
{
|
||||
(void)data;
|
||||
return false;
|
||||
}
|
||||
|
||||
static size_t ax_audio_write_avail(void* data)
|
||||
{
|
||||
ax_audio_t* ax = (ax_audio_t*)data;
|
||||
|
||||
size_t ret = AX_AUDIO_COUNT - ax->written;
|
||||
|
||||
return (ret < AX_AUDIO_SAMPLE_COUNT ? 0 : ret);
|
||||
}
|
||||
|
||||
static size_t ax_audio_buffer_size(void* data)
|
||||
{
|
||||
(void)data;
|
||||
return AX_AUDIO_COUNT;
|
||||
}
|
||||
|
||||
@@ -331,6 +335,6 @@ audio_driver_t audio_ax =
|
||||
"AX",
|
||||
NULL, /* device_list_new */
|
||||
NULL, /* device_list_free */
|
||||
ax_audio_write_avail,
|
||||
ax_audio_buffer_size,
|
||||
NULL, /* write_avail */
|
||||
NULL, /* buffer_size */
|
||||
};
|
||||
+22
-32
@@ -60,9 +60,9 @@ typedef struct xaudio2 xaudio2_t;
|
||||
typedef struct
|
||||
{
|
||||
xaudio2_t *xa;
|
||||
size_t bufsize;
|
||||
bool nonblock;
|
||||
bool is_paused;
|
||||
size_t bufsize;
|
||||
} xa_t;
|
||||
|
||||
/* Forward declarations */
|
||||
@@ -180,10 +180,6 @@ static void xaudio2_free(xaudio2_t *handle)
|
||||
#else
|
||||
free(handle);
|
||||
#endif
|
||||
|
||||
#if !defined(_XBOX) && !defined(__WINRT__)
|
||||
CoUninitialize();
|
||||
#endif
|
||||
}
|
||||
|
||||
static xaudio2_t *xaudio2_new(unsigned samplerate, unsigned channels,
|
||||
@@ -192,28 +188,16 @@ static xaudio2_t *xaudio2_new(unsigned samplerate, unsigned channels,
|
||||
int32_t idx_found = -1;
|
||||
WAVEFORMATEX wfx = {0};
|
||||
struct string_list *list = NULL;
|
||||
xaudio2_t *handle = NULL;
|
||||
|
||||
#if !defined(_XBOX) && !defined(__WINRT__)
|
||||
if (FAILED(CoInitialize(NULL)))
|
||||
goto error;
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
handle = new xaudio2;
|
||||
xaudio2_t *handle = new xaudio2;
|
||||
#else
|
||||
handle = (xaudio2_t*)calloc(1, sizeof(*handle));
|
||||
xaudio2_t *handle = (xaudio2_t*)calloc(1, sizeof(*handle));
|
||||
#endif
|
||||
|
||||
if (!handle)
|
||||
{
|
||||
#if !defined(_XBOX) && !defined(__WINRT__)
|
||||
CoUninitialize();
|
||||
#endif
|
||||
goto error;
|
||||
}
|
||||
|
||||
list = (struct string_list*)xa_list_new(NULL);
|
||||
list = (struct string_list*)xa_list_new(NULL);
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
handle->lpVtbl = &voice_vtable;
|
||||
@@ -312,34 +296,34 @@ static void *xa_init(const char *device, unsigned rate, unsigned latency,
|
||||
unsigned *new_rate)
|
||||
{
|
||||
size_t bufsize;
|
||||
xa_t *xa = (xa_t*)calloc(1, sizeof(*xa));
|
||||
|
||||
xa_t *xa = (xa_t*)calloc(1, sizeof(*xa));
|
||||
if (!xa)
|
||||
return NULL;
|
||||
|
||||
if (latency < 8)
|
||||
latency = 8; /* Do not allow shenanigans. */
|
||||
latency = 8; /* Do not allow shenanigans. */
|
||||
|
||||
bufsize = latency * rate / 1000;
|
||||
|
||||
RARCH_LOG("[XAudio2]: Requesting %u ms latency, using %d ms latency.\n",
|
||||
latency, (int)bufsize * 1000 / rate);
|
||||
|
||||
bufsize = latency * rate / 1000;
|
||||
xa->bufsize = bufsize * 2 * sizeof(float);
|
||||
|
||||
xa->xa = xaudio2_new(rate, 2, xa->bufsize, device);
|
||||
if (!xa->xa)
|
||||
{
|
||||
RARCH_ERR("[XAudio2] Failed to init driver.\n");
|
||||
RARCH_ERR("Failed to init XAudio2.\n");
|
||||
free(xa);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
RARCH_LOG("[XAudio2]: Requesting %u ms latency, using %d ms latency.\n",
|
||||
latency, (int)bufsize * 1000 / rate);
|
||||
|
||||
return xa;
|
||||
}
|
||||
|
||||
static ssize_t xa_write(void *data, const void *buf, size_t size)
|
||||
{
|
||||
unsigned bytes = size;
|
||||
unsigned bytes;
|
||||
xa_t *xa = (xa_t*)data;
|
||||
xaudio2_t *handle = xa->xa;
|
||||
const uint8_t *buffer = (const uint8_t*)buf;
|
||||
@@ -351,9 +335,11 @@ static ssize_t xa_write(void *data, const void *buf, size_t size)
|
||||
if (avail == 0)
|
||||
return 0;
|
||||
if (avail < size)
|
||||
bytes = size = avail;
|
||||
size = avail;
|
||||
}
|
||||
|
||||
bytes = size;
|
||||
|
||||
while (bytes)
|
||||
{
|
||||
unsigned need = MIN(bytes, handle->bufsize - handle->bufptr);
|
||||
@@ -424,12 +410,16 @@ static void xa_set_nonblock_state(void *data, bool state)
|
||||
|
||||
static bool xa_start(void *data, bool is_shutdown)
|
||||
{
|
||||
xa_t *xa = (xa_t*)data;
|
||||
xa_t *xa = (xa_t*)data;
|
||||
xa->is_paused = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool xa_use_float(void *data) { return true; }
|
||||
static bool xa_use_float(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return true;
|
||||
}
|
||||
|
||||
static void xa_free(void *data)
|
||||
{
|
||||
|
||||
@@ -29,12 +29,6 @@
|
||||
|
||||
#include <audio/audio_resampler.h>
|
||||
|
||||
#if (defined(__ARM_NEON__) && !defined(DONT_WANT_ARM_OPTIMIZATIONS)) || defined(HAVE_NEON)
|
||||
#ifndef HAVE_ARM_NEON_OPTIMIZATIONS
|
||||
#define HAVE_ARM_NEON_OPTIMIZATIONS
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Since SSE and NEON don't provide support for trigonometric functions
|
||||
* we approximate those with polynoms
|
||||
*
|
||||
@@ -55,9 +49,10 @@
|
||||
|
||||
typedef struct rarch_CC_resampler
|
||||
{
|
||||
void (*process)(void *re, struct resampler_data *data);
|
||||
audio_frame_float_t buffer[4];
|
||||
|
||||
float distance;
|
||||
void (*process)(void *re, struct resampler_data *data);
|
||||
} rarch_CC_resampler_t;
|
||||
|
||||
#ifdef _MIPS_ARCH_ALLEGREX
|
||||
@@ -350,7 +345,7 @@ static void resampler_CC_upsample(void *re_, struct resampler_data *data)
|
||||
data->output_frames = outp - (audio_frame_float_t*)data->data_out;
|
||||
}
|
||||
|
||||
#elif defined(HAVE_ARM_NEON_OPTIMIZATIONS)
|
||||
#elif defined (__ARM_NEON__) && !defined(DONT_WANT_ARM_OPTIMIZATIONS)
|
||||
|
||||
#define CC_RESAMPLER_IDENT "NEON"
|
||||
|
||||
@@ -362,13 +357,13 @@ size_t resampler_CC_upsample_neon (float *outp, const float *inp,
|
||||
static void resampler_CC_downsample(void *re_, struct resampler_data *data)
|
||||
{
|
||||
data->output_frames = resampler_CC_downsample_neon(
|
||||
data->data_out, data->data_in, (struct rarch_CC_resampler*)re_, data->input_frames, data->ratio);
|
||||
data->data_out, data->data_in, re_, data->input_frames, data->ratio);
|
||||
}
|
||||
|
||||
static void resampler_CC_upsample(void *re_, struct resampler_data *data)
|
||||
{
|
||||
data->output_frames = resampler_CC_upsample_neon(
|
||||
data->data_out, data->data_in, (struct rarch_CC_resampler*)re_, data->input_frames, data->ratio);
|
||||
data->data_out, data->data_in, re_, data->input_frames, data->ratio);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
+32
-40
@@ -31,21 +31,16 @@
|
||||
|
||||
#include "drivers/rsound.h"
|
||||
|
||||
#ifdef __PS3__
|
||||
#ifdef __PSL1GHT__
|
||||
#include <sysmodule/sysmodule.h>
|
||||
#include <sys/systime.h>
|
||||
#include <net/net.h>
|
||||
#else
|
||||
#if defined(__CELLOS_LV2__)
|
||||
#include <cell/sysmodule.h>
|
||||
#include <sys/timer.h>
|
||||
#include <sys/sys_time.h>
|
||||
|
||||
/* Network headers */
|
||||
#include <netex/net.h>
|
||||
#include <netex/errno.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(GEKKO)
|
||||
#define NETWORK_COMPAT_HEADERS 1
|
||||
#elif defined(GEKKO)
|
||||
#include <network.h>
|
||||
#else
|
||||
#define NETWORK_COMPAT_HEADERS 1
|
||||
@@ -57,12 +52,8 @@
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/tcp.h>
|
||||
#include <arpa/inet.h>
|
||||
#ifdef __PS3__
|
||||
#ifdef __PSL1GHT__
|
||||
#include <net/poll.h>
|
||||
#else
|
||||
#ifdef __CELLOS_LV2__
|
||||
#include <sys/poll.h>
|
||||
#endif
|
||||
#else
|
||||
#include <poll.h>
|
||||
#endif
|
||||
@@ -116,7 +107,7 @@ enum rsd_conn_type
|
||||
#define RSD_ERR(fmt, args...)
|
||||
#define RSD_DEBUG(fmt, args...)
|
||||
|
||||
#if defined(__PS3__)
|
||||
#if defined(__CELLOS_LV2__)
|
||||
static int init_count = 0;
|
||||
#define pollfd_fd(x) x.fd
|
||||
#define net_send(a,b,c,d) send(a,b,c,d)
|
||||
@@ -263,7 +254,7 @@ static int rsnd_connect_server( rsound_t *rd )
|
||||
|
||||
/* Uses non-blocking IO since it performed more deterministic with poll()/send() */
|
||||
|
||||
#ifdef __PS3__
|
||||
#ifdef __CELLOS_LV2__
|
||||
setsockopt(rd->conn.socket, SOL_SOCKET, SO_NBIO, &i, sizeof(int));
|
||||
setsockopt(rd->conn.ctl_socket, SOL_SOCKET, SO_NBIO, &i, sizeof(int));
|
||||
#else
|
||||
@@ -709,11 +700,11 @@ static ssize_t rsnd_recv_chunk(int socket, void *buf, size_t size, int blocking)
|
||||
|
||||
static int rsnd_poll(struct pollfd *fd, int numfd, int timeout)
|
||||
{
|
||||
for (;;)
|
||||
for(;;)
|
||||
{
|
||||
if (socketpoll(fd, numfd, timeout) < 0)
|
||||
if ( socketpoll(fd, numfd, timeout) < 0 )
|
||||
{
|
||||
if (errno == EINTR)
|
||||
if ( errno == EINTR )
|
||||
continue;
|
||||
|
||||
perror("poll");
|
||||
@@ -734,8 +725,8 @@ static int64_t rsnd_get_time_usec(void)
|
||||
if (!QueryPerformanceCounter(&count))
|
||||
return 0;
|
||||
return count.QuadPart * 1000000 / freq.QuadPart;
|
||||
#elif defined(__PS3__)
|
||||
return sysGetSystemTime();
|
||||
#elif defined(__CELLOS_LV2__)
|
||||
return sys_time_get_system_time();
|
||||
#elif defined(GEKKO)
|
||||
return ticks_to_microsecs(gettime());
|
||||
#elif defined(__MACH__) // OSX doesn't have clock_gettime ...
|
||||
@@ -774,13 +765,13 @@ static void rsnd_drain(rsound_t *rd)
|
||||
delta /= 1000000;
|
||||
/* Calculates the amount of data we have in our virtual buffer. Only used to calculate delay. */
|
||||
slock_lock(rd->thread.mutex);
|
||||
rd->bytes_in_buffer = (int)((int64_t)rd->total_written + (int64_t)FIFO_READ_AVAIL(rd->fifo_buffer) - delta);
|
||||
rd->bytes_in_buffer = (int)((int64_t)rd->total_written + (int64_t)fifo_read_avail(rd->fifo_buffer) - delta);
|
||||
slock_unlock(rd->thread.mutex);
|
||||
}
|
||||
else
|
||||
{
|
||||
slock_lock(rd->thread.mutex);
|
||||
rd->bytes_in_buffer = FIFO_READ_AVAIL(rd->fifo_buffer);
|
||||
rd->bytes_in_buffer = fifo_read_avail(rd->fifo_buffer);
|
||||
slock_unlock(rd->thread.mutex);
|
||||
}
|
||||
}
|
||||
@@ -798,7 +789,7 @@ static size_t rsnd_fill_buffer(rsound_t *rd, const char *buf, size_t size)
|
||||
return 0;
|
||||
|
||||
slock_lock(rd->thread.mutex);
|
||||
if (FIFO_WRITE_AVAIL(rd->fifo_buffer) >= size)
|
||||
if ( fifo_write_avail(rd->fifo_buffer) >= size )
|
||||
{
|
||||
slock_unlock(rd->thread.mutex);
|
||||
break;
|
||||
@@ -895,7 +886,7 @@ static size_t rsnd_get_ptr(rsound_t *rd)
|
||||
{
|
||||
int ptr;
|
||||
slock_lock(rd->thread.mutex);
|
||||
ptr = FIFO_READ_AVAIL(rd->fifo_buffer);
|
||||
ptr = fifo_read_avail(rd->fifo_buffer);
|
||||
slock_unlock(rd->thread.mutex);
|
||||
|
||||
return ptr;
|
||||
@@ -947,15 +938,15 @@ static int rsnd_close_ctl(rsound_t *rd)
|
||||
int index = 0;
|
||||
char buf[RSD_PROTO_MAXSIZE*2] = {0};
|
||||
|
||||
for (;;)
|
||||
for(;;)
|
||||
{
|
||||
if (rsnd_poll(&fd, 1, 2000) < 0)
|
||||
if ( rsnd_poll(&fd, 1, 2000) < 0 )
|
||||
return -1;
|
||||
|
||||
if (fd.revents & POLLHUP)
|
||||
if ( fd.revents & POLLHUP )
|
||||
break;
|
||||
|
||||
if (fd.revents & POLLIN)
|
||||
else if ( fd.revents & POLLIN )
|
||||
{
|
||||
const char *subchar;
|
||||
|
||||
@@ -1069,7 +1060,7 @@ static int rsnd_update_server_info(rsound_t *rd)
|
||||
int delay = rsd_delay(rd);
|
||||
int delta = (int)(client_ptr - serv_ptr);
|
||||
slock_lock(rd->thread.mutex);
|
||||
delta += FIFO_READ_AVAIL(rd->fifo_buffer);
|
||||
delta += fifo_read_avail(rd->fifo_buffer);
|
||||
slock_unlock(rd->thread.mutex);
|
||||
|
||||
RSD_DEBUG("[RSound] Delay: %d, Delta: %d.\n", delay, delta);
|
||||
@@ -1111,7 +1102,7 @@ static void rsnd_thread ( void * thread_data )
|
||||
/* Two (;;) for loops! :3 Beware! */
|
||||
for (;;)
|
||||
{
|
||||
for (;;)
|
||||
for(;;)
|
||||
{
|
||||
_TEST_CANCEL();
|
||||
|
||||
@@ -1125,7 +1116,7 @@ static void rsnd_thread ( void * thread_data )
|
||||
|
||||
/* If the buffer is empty or we've stopped the stream, jump out of this for loop */
|
||||
slock_lock(rd->thread.mutex);
|
||||
if (FIFO_READ_AVAIL(rd->fifo_buffer) < rd->backend_info.chunk_size || !rd->thread_active)
|
||||
if ( fifo_read_avail(rd->fifo_buffer) < rd->backend_info.chunk_size || !rd->thread_active )
|
||||
{
|
||||
slock_unlock(rd->thread.mutex);
|
||||
break;
|
||||
@@ -1384,17 +1375,18 @@ int rsd_exec(rsound_t *rsound)
|
||||
|
||||
rsnd_stop_thread(rsound);
|
||||
|
||||
#ifdef __PS3__
|
||||
#if defined(__CELLOS_LV2__)
|
||||
int i = 0;
|
||||
setsockopt(rsound->conn.socket, SOL_SOCKET, SO_NBIO, &i, sizeof(int));
|
||||
#else
|
||||
fcntl(rsound->conn.socket, F_SETFL, O_NONBLOCK);
|
||||
#endif
|
||||
|
||||
/* Flush the buffer */
|
||||
if (FIFO_READ_AVAIL(rsound->fifo_buffer) > 0 )
|
||||
// Flush the buffer
|
||||
|
||||
if ( fifo_read_avail(rsound->fifo_buffer) > 0 )
|
||||
{
|
||||
char buffer[FIFO_READ_AVAIL(rsound->fifo_buffer)];
|
||||
char buffer[fifo_read_avail(rsound->fifo_buffer)];
|
||||
fifo_read(rsound->fifo_buffer, buffer, sizeof(buffer));
|
||||
if ( rsnd_send_chunk(fd, buffer, sizeof(buffer), 1) != (ssize_t)sizeof(buffer) )
|
||||
{
|
||||
@@ -1576,11 +1568,11 @@ int rsd_init(rsound_t** rsound)
|
||||
rsd_set_param(*rsound, RSD_HOST, RSD_DEFAULT_HOST);
|
||||
rsd_set_param(*rsound, RSD_PORT, RSD_DEFAULT_PORT);
|
||||
|
||||
#ifdef __PS3__
|
||||
#ifdef __CELLOS_LV2__
|
||||
if (init_count == 0)
|
||||
{
|
||||
sysModuleLoad(SYSMODULE_NET);
|
||||
netInitialize();
|
||||
cellSysmoduleLoadModule(CELL_SYSMODULE_NET);
|
||||
sys_net_initialize_network();
|
||||
init_count++;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,78 +0,0 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __BLUETOOTH_DRIVER__H
|
||||
#define __BLUETOOTH_DRIVER__H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <boolean.h>
|
||||
#include <retro_common_api.h>
|
||||
#include <lists/string_list.h>
|
||||
|
||||
RETRO_BEGIN_DECLS
|
||||
|
||||
enum rarch_bluetooth_ctl_state
|
||||
{
|
||||
RARCH_BLUETOOTH_CTL_NONE = 0,
|
||||
RARCH_BLUETOOTH_CTL_DESTROY,
|
||||
RARCH_BLUETOOTH_CTL_DEINIT,
|
||||
RARCH_BLUETOOTH_CTL_FIND_DRIVER,
|
||||
RARCH_BLUETOOTH_CTL_INIT
|
||||
};
|
||||
|
||||
typedef struct bluetooth_driver
|
||||
{
|
||||
void *(*init)(void);
|
||||
|
||||
void (*free)(void *data);
|
||||
|
||||
void (*scan)(void *data);
|
||||
void (*get_devices)(void *data, struct string_list *list);
|
||||
bool (*device_is_connected)(void *data, unsigned i);
|
||||
void (*device_get_sublabel)(void *data, char *s, unsigned i, size_t len);
|
||||
bool (*connect_device)(void *data, unsigned i);
|
||||
|
||||
const char *ident;
|
||||
} bluetooth_driver_t;
|
||||
|
||||
extern bluetooth_driver_t bluetooth_bluetoothctl;
|
||||
extern bluetooth_driver_t bluetooth_bluez;
|
||||
|
||||
/**
|
||||
* config_get_bluetooth_driver_options:
|
||||
*
|
||||
* Get an enumerated list of all bluetooth driver names,
|
||||
* separated by '|'.
|
||||
*
|
||||
* Returns: string listing of all bluetooth driver names,
|
||||
* separated by '|'.
|
||||
**/
|
||||
const char* config_get_bluetooth_driver_options(void);
|
||||
|
||||
void driver_bluetooth_scan(void);
|
||||
|
||||
void driver_bluetooth_get_devices(struct string_list *list);
|
||||
|
||||
bool driver_bluetooth_device_is_connected(unsigned i);
|
||||
|
||||
void driver_bluetooth_device_get_sublabel(char *s, unsigned i, size_t len);
|
||||
|
||||
bool driver_bluetooth_connect_device(unsigned i);
|
||||
|
||||
bool bluetooth_driver_ctl(enum rarch_bluetooth_ctl_state state, void *data);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
||||
@@ -1,215 +0,0 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <compat/strl.h>
|
||||
#include <configuration.h>
|
||||
|
||||
#include "../bluetooth_driver.h"
|
||||
#include "../../retroarch.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
bool bluetoothctl_cache[256];
|
||||
unsigned bluetoothctl_counter[256];
|
||||
struct string_list* lines;
|
||||
char command[256];
|
||||
} bluetoothctl_t;
|
||||
|
||||
static void *bluetoothctl_init(void)
|
||||
{
|
||||
return calloc(1, sizeof(bluetoothctl_t));
|
||||
}
|
||||
|
||||
static void bluetoothctl_free(void *data)
|
||||
{
|
||||
if (data)
|
||||
free(data);
|
||||
}
|
||||
|
||||
static void bluetoothctl_scan(void *data)
|
||||
{
|
||||
char line[512];
|
||||
union string_list_elem_attr attr;
|
||||
FILE *dev_file = NULL;
|
||||
bluetoothctl_t *btctl = (bluetoothctl_t*) data;
|
||||
|
||||
attr.i = 0;
|
||||
if (btctl->lines)
|
||||
free(btctl->lines);
|
||||
btctl->lines = string_list_new();
|
||||
|
||||
pclose(popen("bluetoothctl -- power on", "r"));
|
||||
|
||||
pclose(popen("bluetoothctl --timeout 10 scan on", "r"));
|
||||
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_BLUETOOTH_SCAN_COMPLETE),
|
||||
1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT,
|
||||
MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
|
||||
dev_file = popen("bluetoothctl -- devices", "r");
|
||||
|
||||
while (fgets(line, 512, dev_file))
|
||||
{
|
||||
size_t len = strlen(line);
|
||||
if (len > 0 && line[len-1] == '\n')
|
||||
line[--len] = '\0';
|
||||
|
||||
string_list_append(btctl->lines, line, attr);
|
||||
}
|
||||
|
||||
pclose(dev_file);
|
||||
}
|
||||
|
||||
static void bluetoothctl_get_devices(void *data, struct string_list* devices)
|
||||
{
|
||||
unsigned i;
|
||||
union string_list_elem_attr attr;
|
||||
bluetoothctl_t *btctl = (bluetoothctl_t*) data;
|
||||
|
||||
attr.i = 0;
|
||||
|
||||
if (!btctl->lines)
|
||||
return;
|
||||
|
||||
for (i = 0; i < btctl->lines->size; i++)
|
||||
{
|
||||
char device[64];
|
||||
const char *line = btctl->lines->elems[i].data;
|
||||
|
||||
/* bluetoothctl devices outputs lines of the format:
|
||||
* $ bluetoothctl devices
|
||||
* 'Device (mac address) (device name)'
|
||||
*/
|
||||
strlcpy(device, line+24, sizeof(device));
|
||||
string_list_append(devices, device, attr);
|
||||
}
|
||||
}
|
||||
|
||||
static bool bluetoothctl_device_is_connected(void *data, unsigned i)
|
||||
{
|
||||
bluetoothctl_t *btctl = (bluetoothctl_t*) data;
|
||||
char ln[512] = {0};
|
||||
char device[18] = {0};
|
||||
const char *line = btctl->lines->elems[i].data;
|
||||
FILE *command_file = NULL;
|
||||
|
||||
if (btctl->bluetoothctl_counter[i] == 60)
|
||||
{
|
||||
static struct string_list* list = NULL;
|
||||
btctl->bluetoothctl_counter[i] = 0;
|
||||
list = string_split(line, " ");
|
||||
if (!list)
|
||||
return false;
|
||||
|
||||
if (list->size == 0)
|
||||
{
|
||||
string_list_free(list);
|
||||
return false;
|
||||
}
|
||||
|
||||
strlcpy(device, list->elems[1].data, sizeof(device));
|
||||
string_list_free(list);
|
||||
|
||||
snprintf(btctl->command, sizeof(btctl->command), "\
|
||||
bluetoothctl -- info %s | grep 'Connected: yes'",
|
||||
device);
|
||||
|
||||
command_file = popen(btctl->command, "r");
|
||||
|
||||
while (fgets(ln, 512, command_file))
|
||||
{
|
||||
btctl->bluetoothctl_cache[i] = true;
|
||||
return true;
|
||||
}
|
||||
pclose(command_file);
|
||||
btctl->bluetoothctl_cache[i] = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
btctl->bluetoothctl_counter[i]++;
|
||||
return btctl->bluetoothctl_cache[i];
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool bluetoothctl_connect_device(void *data, unsigned idx)
|
||||
{
|
||||
unsigned i;
|
||||
bluetoothctl_t *btctl = (bluetoothctl_t*) data;
|
||||
char device[18] = {0};
|
||||
const char *line = btctl->lines->elems[idx].data;
|
||||
static struct string_list* list = NULL;
|
||||
|
||||
/* bluetoothctl devices outputs lines of the format:
|
||||
* $ bluetoothctl devices
|
||||
* 'Device (mac address) (device name)'
|
||||
*/
|
||||
list = string_split(line, " ");
|
||||
if (!list)
|
||||
return false;
|
||||
|
||||
if (list->size == 0)
|
||||
{
|
||||
string_list_free(list);
|
||||
return false;
|
||||
}
|
||||
|
||||
strlcpy(device, list->elems[1].data, sizeof(device));
|
||||
string_list_free(list);
|
||||
|
||||
snprintf(btctl->command, sizeof(btctl->command), "\
|
||||
bluetoothctl -- trust %s",
|
||||
device);
|
||||
|
||||
pclose(popen(btctl->command, "r"));
|
||||
|
||||
snprintf(btctl->command, sizeof(btctl->command), "\
|
||||
bluetoothctl -- pair %s",
|
||||
device);
|
||||
|
||||
pclose(popen(btctl->command, "r"));
|
||||
|
||||
snprintf(btctl->command, sizeof(btctl->command), "\
|
||||
bluetoothctl -- connect %s",
|
||||
device);
|
||||
|
||||
pclose(popen(btctl->command, "r"));
|
||||
|
||||
btctl->bluetoothctl_counter[idx] = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
static void bluetoothctl_device_get_sublabel(
|
||||
void *data, char *s, unsigned i, size_t len)
|
||||
{
|
||||
bluetoothctl_t *btctl = (bluetoothctl_t*) data;
|
||||
/* bluetoothctl devices outputs lines of the format:
|
||||
* $ bluetoothctl devices
|
||||
* 'Device (mac address) (device name)'
|
||||
*/
|
||||
const char *line = btctl->lines->elems[i].data;
|
||||
strlcpy(s, line+7, 18);
|
||||
}
|
||||
|
||||
bluetooth_driver_t bluetooth_bluetoothctl = {
|
||||
bluetoothctl_init,
|
||||
bluetoothctl_free,
|
||||
bluetoothctl_scan,
|
||||
bluetoothctl_get_devices,
|
||||
bluetoothctl_device_is_connected,
|
||||
bluetoothctl_device_get_sublabel,
|
||||
bluetoothctl_connect_device,
|
||||
"bluetoothctl",
|
||||
};
|
||||
@@ -1,616 +0,0 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <dbus/dbus.h>
|
||||
#include <compat/strl.h>
|
||||
#include <configuration.h>
|
||||
#include <retro_timers.h>
|
||||
#include <string/stdstring.h>
|
||||
|
||||
#include "../bluetooth_driver.h"
|
||||
#include "../../retroarch.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/* object path. usually looks like /org/bluez/hci0/dev_AA_BB_CC_DD_EE_FF
|
||||
* technically unlimited, but should be enough */
|
||||
char path[128];
|
||||
|
||||
/* for display purposes 64 bytes should be enough */
|
||||
char name[64];
|
||||
|
||||
/* MAC address, 17 bytes */
|
||||
char address[18];
|
||||
|
||||
/* freedesktop.org icon name
|
||||
* See bluez/src/dbus-common.c
|
||||
* Can be NULL */
|
||||
char icon[64];
|
||||
|
||||
int connected;
|
||||
int paired;
|
||||
int trusted;
|
||||
} device_info_t;
|
||||
|
||||
#define VECTOR_LIST_TYPE device_info_t
|
||||
#define VECTOR_LIST_NAME device_info
|
||||
#include "../../libretro-common/lists/vector_list.c"
|
||||
#undef VECTOR_LIST_TYPE
|
||||
#undef VECTOR_LIST_NAME
|
||||
|
||||
typedef struct
|
||||
{
|
||||
struct device_info_vector_list *devices;
|
||||
char adapter[256];
|
||||
DBusConnection* dbus_connection;
|
||||
bool bluez_cache[256];
|
||||
int bluez_cache_counter[256];
|
||||
} bluez_t;
|
||||
|
||||
static void *bluez_init (void)
|
||||
{
|
||||
return calloc(1, sizeof(bluez_t));
|
||||
}
|
||||
|
||||
static void bluez_free (void *data)
|
||||
{
|
||||
if (data)
|
||||
free(data);
|
||||
}
|
||||
|
||||
static int
|
||||
set_bool_property (
|
||||
bluez_t *bluez,
|
||||
const char *path,
|
||||
const char *arg_adapter,
|
||||
const char *arg_property,
|
||||
int value)
|
||||
{
|
||||
DBusError err;
|
||||
DBusMessage *message, *reply;
|
||||
DBusMessageIter req_iter, req_subiter;
|
||||
|
||||
dbus_error_init(&err);
|
||||
|
||||
message = dbus_message_new_method_call(
|
||||
"org.bluez",
|
||||
path,
|
||||
"org.freedesktop.DBus.Properties",
|
||||
"Set"
|
||||
);
|
||||
if (!message)
|
||||
return 1;
|
||||
|
||||
dbus_message_iter_init_append(message, &req_iter);
|
||||
if (!dbus_message_iter_append_basic(
|
||||
&req_iter, DBUS_TYPE_STRING, &arg_adapter))
|
||||
goto fault;
|
||||
if (!dbus_message_iter_append_basic(
|
||||
&req_iter, DBUS_TYPE_STRING, &arg_property))
|
||||
goto fault;
|
||||
if (!dbus_message_iter_open_container(
|
||||
&req_iter, DBUS_TYPE_VARIANT,
|
||||
DBUS_TYPE_BOOLEAN_AS_STRING, &req_subiter))
|
||||
goto fault;
|
||||
if (!dbus_message_iter_append_basic(
|
||||
&req_subiter, DBUS_TYPE_BOOLEAN, &value))
|
||||
goto fault;
|
||||
if (!dbus_message_iter_close_container(
|
||||
&req_iter, &req_subiter))
|
||||
goto fault;
|
||||
|
||||
reply = dbus_connection_send_with_reply_and_block(bluez->dbus_connection,
|
||||
message, 1000, &err);
|
||||
if (!reply)
|
||||
goto fault;
|
||||
dbus_message_unref(reply);
|
||||
dbus_message_unref(message);
|
||||
return 0;
|
||||
|
||||
fault:
|
||||
dbus_message_iter_abandon_container_if_open(&req_iter, &req_subiter);
|
||||
dbus_message_unref(message);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int get_bool_property(
|
||||
bluez_t *bluez,
|
||||
const char *path,
|
||||
const char *arg_adapter,
|
||||
const char *arg_property,
|
||||
int *value)
|
||||
{
|
||||
DBusMessage *message, *reply;
|
||||
DBusError err;
|
||||
DBusMessageIter root_iter, variant_iter;
|
||||
|
||||
dbus_error_init(&err);
|
||||
|
||||
message = dbus_message_new_method_call( "org.bluez", path,
|
||||
"org.freedesktop.DBus.Properties", "Get");
|
||||
if (!message)
|
||||
return 1;
|
||||
|
||||
if (!dbus_message_append_args(message,
|
||||
DBUS_TYPE_STRING, &arg_adapter,
|
||||
DBUS_TYPE_STRING, &arg_property,
|
||||
DBUS_TYPE_INVALID))
|
||||
return 1;
|
||||
|
||||
reply = dbus_connection_send_with_reply_and_block(bluez->dbus_connection,
|
||||
message, 1000, &err);
|
||||
|
||||
dbus_message_unref(message);
|
||||
|
||||
if (!reply)
|
||||
return 1;
|
||||
|
||||
if (!dbus_message_iter_init(reply, &root_iter))
|
||||
return 1;
|
||||
|
||||
if (DBUS_TYPE_VARIANT != dbus_message_iter_get_arg_type(&root_iter))
|
||||
return 1;
|
||||
|
||||
dbus_message_iter_recurse(&root_iter, &variant_iter);
|
||||
dbus_message_iter_get_basic(&variant_iter, value);
|
||||
|
||||
dbus_message_unref(reply);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int adapter_discovery (bluez_t *bluez, const char *method)
|
||||
{
|
||||
DBusMessage *message = dbus_message_new_method_call(
|
||||
"org.bluez", bluez->adapter,
|
||||
"org.bluez.Adapter1", method);
|
||||
if (!message)
|
||||
return 1;
|
||||
|
||||
if (!dbus_connection_send(bluez->dbus_connection, message, NULL))
|
||||
return 1;
|
||||
|
||||
dbus_connection_flush(bluez->dbus_connection);
|
||||
dbus_message_unref(message);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_managed_objects (bluez_t *bluez, DBusMessage **reply)
|
||||
{
|
||||
DBusMessage *message;
|
||||
DBusError err;
|
||||
|
||||
dbus_error_init(&err);
|
||||
|
||||
message = dbus_message_new_method_call("org.bluez", "/",
|
||||
"org.freedesktop.DBus.ObjectManager", "GetManagedObjects");
|
||||
if (!message)
|
||||
return 1;
|
||||
|
||||
*reply = dbus_connection_send_with_reply_and_block(bluez->dbus_connection,
|
||||
message, -1, &err);
|
||||
/* if (!reply) is done by the caller in this one */
|
||||
|
||||
dbus_message_unref(message);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int device_method (bluez_t *bluez, const char *path, const char *method)
|
||||
{
|
||||
DBusMessage *message, *reply;
|
||||
DBusError err;
|
||||
|
||||
dbus_error_init(&err);
|
||||
|
||||
message = dbus_message_new_method_call( "org.bluez", path,
|
||||
"org.bluez.Device1", method);
|
||||
if (!message)
|
||||
return 1;
|
||||
|
||||
reply = dbus_connection_send_with_reply_and_block(bluez->dbus_connection,
|
||||
message, 10000, &err);
|
||||
if (!reply)
|
||||
return 1;
|
||||
|
||||
dbus_connection_flush(bluez->dbus_connection);
|
||||
dbus_message_unref(message);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_default_adapter(bluez_t *bluez, DBusMessage *reply)
|
||||
{
|
||||
/* "...an application would discover the available adapters by
|
||||
* performing a ObjectManager.GetManagedObjects call and look for any
|
||||
* returned objects with an “org.bluez.Adapter1″ interface.
|
||||
* The concept of a default adapter was always a bit fuzzy and the
|
||||
* value could’t be changed, so if applications need something like it
|
||||
* they could e.g. just pick the first adapter they encounter in the
|
||||
* GetManagedObjects reply."
|
||||
* -- http://www.bluez.org/bluez-5-api-introduction-and-porting-guide/
|
||||
*/
|
||||
|
||||
DBusMessageIter root_iter;
|
||||
DBusMessageIter dict_1_iter, dict_2_iter;
|
||||
DBusMessageIter array_1_iter, array_2_iter;
|
||||
|
||||
char *obj_path, *interface_name;
|
||||
|
||||
/* a{oa{sa{sv}}} */
|
||||
if (!dbus_message_iter_init(reply, &root_iter))
|
||||
return 1;
|
||||
|
||||
/* a */
|
||||
if (DBUS_TYPE_ARRAY != dbus_message_iter_get_arg_type(&root_iter))
|
||||
return 1;
|
||||
dbus_message_iter_recurse(&root_iter, &array_1_iter);
|
||||
do
|
||||
{
|
||||
/* a{...} */
|
||||
if (DBUS_TYPE_DICT_ENTRY != dbus_message_iter_get_arg_type(&array_1_iter))
|
||||
return 1;
|
||||
dbus_message_iter_recurse(&array_1_iter, &dict_1_iter);
|
||||
|
||||
/* a{o...} */
|
||||
if (DBUS_TYPE_OBJECT_PATH != dbus_message_iter_get_arg_type(&dict_1_iter))
|
||||
return 1;
|
||||
dbus_message_iter_get_basic(&dict_1_iter, &obj_path);
|
||||
|
||||
if (!dbus_message_iter_next(&dict_1_iter))
|
||||
return 1;
|
||||
/* a{oa} */
|
||||
if (DBUS_TYPE_ARRAY != dbus_message_iter_get_arg_type(&dict_1_iter))
|
||||
return 1;
|
||||
dbus_message_iter_recurse(&dict_1_iter, &array_2_iter);
|
||||
do
|
||||
{
|
||||
/* empty array? */
|
||||
if (DBUS_TYPE_INVALID ==
|
||||
dbus_message_iter_get_arg_type(&array_2_iter))
|
||||
continue;
|
||||
|
||||
/* a{oa{...}} */
|
||||
if (DBUS_TYPE_DICT_ENTRY !=
|
||||
dbus_message_iter_get_arg_type(&array_2_iter))
|
||||
return 1;
|
||||
dbus_message_iter_recurse(&array_2_iter, &dict_2_iter);
|
||||
|
||||
/* a{oa{s...}} */
|
||||
if (DBUS_TYPE_STRING !=
|
||||
dbus_message_iter_get_arg_type(&dict_2_iter))
|
||||
return 1;
|
||||
dbus_message_iter_get_basic(&dict_2_iter, &interface_name);
|
||||
|
||||
if (string_is_equal(interface_name, "org.bluez.Adapter1"))
|
||||
{
|
||||
strlcpy(bluez->adapter, obj_path, 256);
|
||||
return 0;
|
||||
}
|
||||
} while (dbus_message_iter_next(&array_2_iter));
|
||||
} while (dbus_message_iter_next(&array_1_iter));
|
||||
|
||||
/* Couldn't find an adapter */
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int read_scanned_devices (bluez_t *bluez, DBusMessage *reply)
|
||||
{
|
||||
device_info_t device;
|
||||
DBusMessageIter root_iter;
|
||||
DBusMessageIter dict_1_iter, dict_2_iter, dict_3_iter;
|
||||
DBusMessageIter array_1_iter, array_2_iter, array_3_iter;
|
||||
DBusMessageIter variant_iter;
|
||||
char *obj_path, *interface_name, *interface_property_name;
|
||||
char *found_device_address, *found_device_name, *found_device_icon;
|
||||
|
||||
/* a{oa{sa{sv}}} */
|
||||
if (!dbus_message_iter_init(reply, &root_iter))
|
||||
return 1;
|
||||
|
||||
/* a */
|
||||
if (DBUS_TYPE_ARRAY != dbus_message_iter_get_arg_type(&root_iter))
|
||||
return 1;
|
||||
|
||||
dbus_message_iter_recurse(&root_iter, &array_1_iter);
|
||||
|
||||
do
|
||||
{
|
||||
/* a{...} */
|
||||
if (DBUS_TYPE_DICT_ENTRY !=
|
||||
dbus_message_iter_get_arg_type(&array_1_iter))
|
||||
return 1;
|
||||
|
||||
dbus_message_iter_recurse(&array_1_iter, &dict_1_iter);
|
||||
|
||||
/* a{o...} */
|
||||
if (DBUS_TYPE_OBJECT_PATH !=
|
||||
dbus_message_iter_get_arg_type(&dict_1_iter))
|
||||
return 1;
|
||||
|
||||
dbus_message_iter_get_basic(&dict_1_iter, &obj_path);
|
||||
|
||||
if (!dbus_message_iter_next(&dict_1_iter))
|
||||
return 1;
|
||||
|
||||
/* a{oa} */
|
||||
if (DBUS_TYPE_ARRAY !=
|
||||
dbus_message_iter_get_arg_type(&dict_1_iter))
|
||||
return 1;
|
||||
|
||||
dbus_message_iter_recurse(&dict_1_iter, &array_2_iter);
|
||||
do
|
||||
{
|
||||
/* empty array? */
|
||||
if (DBUS_TYPE_INVALID ==
|
||||
dbus_message_iter_get_arg_type(&array_2_iter))
|
||||
continue;
|
||||
|
||||
/* a{oa{...}} */
|
||||
if (DBUS_TYPE_DICT_ENTRY !=
|
||||
dbus_message_iter_get_arg_type(&array_2_iter))
|
||||
return 1;
|
||||
dbus_message_iter_recurse(&array_2_iter, &dict_2_iter);
|
||||
|
||||
/* a{oa{s...}} */
|
||||
if (DBUS_TYPE_STRING !=
|
||||
dbus_message_iter_get_arg_type(&dict_2_iter))
|
||||
return 1;
|
||||
dbus_message_iter_get_basic(&dict_2_iter, &interface_name);
|
||||
|
||||
if (!string_is_equal(interface_name, "org.bluez.Device1"))
|
||||
continue;
|
||||
|
||||
memset(&device, 0, sizeof(device));
|
||||
strlcpy(device.path, obj_path, 128);
|
||||
|
||||
if (!dbus_message_iter_next(&dict_2_iter))
|
||||
return 1;
|
||||
|
||||
/* a{oa{sa}} */
|
||||
if (DBUS_TYPE_ARRAY != dbus_message_iter_get_arg_type(&dict_2_iter))
|
||||
return 1;
|
||||
|
||||
dbus_message_iter_recurse(&dict_2_iter, &array_3_iter);
|
||||
|
||||
do {
|
||||
/* empty array? */
|
||||
if (DBUS_TYPE_INVALID ==
|
||||
dbus_message_iter_get_arg_type(&array_3_iter))
|
||||
continue;
|
||||
|
||||
/* a{oa{sa{...}}} */
|
||||
if (DBUS_TYPE_DICT_ENTRY !=
|
||||
dbus_message_iter_get_arg_type(&array_3_iter))
|
||||
return 1;
|
||||
dbus_message_iter_recurse(&array_3_iter, &dict_3_iter);
|
||||
|
||||
/* a{oa{sa{s...}}} */
|
||||
if (DBUS_TYPE_STRING !=
|
||||
dbus_message_iter_get_arg_type(&dict_3_iter))
|
||||
return 1;
|
||||
|
||||
dbus_message_iter_get_basic(&dict_3_iter,
|
||||
&interface_property_name);
|
||||
|
||||
if (!dbus_message_iter_next(&dict_3_iter))
|
||||
return 1;
|
||||
/* a{oa{sa{sv}}} */
|
||||
if (DBUS_TYPE_VARIANT !=
|
||||
dbus_message_iter_get_arg_type(&dict_3_iter))
|
||||
return 1;
|
||||
|
||||
/* Below, "Alias" property is used instead of "Name".
|
||||
* "This value ("Name") is only present for
|
||||
* completeness. It is better to always use
|
||||
* the Alias property when displaying the
|
||||
* devices name."
|
||||
* -- bluez/doc/device-api.txt
|
||||
*/
|
||||
|
||||
/* DBUS_TYPE_VARIANT is a container type */
|
||||
dbus_message_iter_recurse(&dict_3_iter, &variant_iter);
|
||||
if (string_is_equal(interface_property_name, "Address"))
|
||||
{
|
||||
dbus_message_iter_get_basic(&variant_iter,
|
||||
&found_device_address);
|
||||
strlcpy(device.address, found_device_address, 18);
|
||||
}
|
||||
else if (string_is_equal(interface_property_name, "Alias"))
|
||||
{
|
||||
dbus_message_iter_get_basic(&variant_iter,
|
||||
&found_device_name);
|
||||
strlcpy(device.name, found_device_name, 64);
|
||||
}
|
||||
else if (string_is_equal(interface_property_name, "Icon"))
|
||||
{
|
||||
dbus_message_iter_get_basic(&variant_iter,
|
||||
&found_device_icon);
|
||||
strlcpy(device.icon, found_device_icon, 64);
|
||||
}
|
||||
else if (string_is_equal(interface_property_name, "Connected"))
|
||||
{
|
||||
dbus_message_iter_get_basic(&variant_iter,
|
||||
&device.connected);
|
||||
}
|
||||
else if (string_is_equal(interface_property_name, "Paired"))
|
||||
{
|
||||
dbus_message_iter_get_basic(&variant_iter,
|
||||
&device.paired);
|
||||
}
|
||||
else if (string_is_equal(interface_property_name, "Trusted"))
|
||||
{
|
||||
dbus_message_iter_get_basic(&variant_iter,
|
||||
&device.trusted);
|
||||
}
|
||||
} while (dbus_message_iter_next(&array_3_iter));
|
||||
|
||||
if (!device_info_vector_list_append(bluez->devices, device))
|
||||
return 1;
|
||||
|
||||
} while (dbus_message_iter_next(&array_2_iter));
|
||||
} while (dbus_message_iter_next(&array_1_iter));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void bluez_dbus_connect(bluez_t *bluez)
|
||||
{
|
||||
DBusError err;
|
||||
dbus_error_init(&err);
|
||||
bluez->dbus_connection = dbus_bus_get_private(DBUS_BUS_SYSTEM, &err);
|
||||
}
|
||||
|
||||
static void bluez_dbus_disconnect(bluez_t *bluez)
|
||||
{
|
||||
if (!bluez->dbus_connection)
|
||||
return;
|
||||
|
||||
dbus_connection_close(bluez->dbus_connection);
|
||||
dbus_connection_unref(bluez->dbus_connection);
|
||||
bluez->dbus_connection = NULL;
|
||||
}
|
||||
|
||||
static void bluez_scan(void *data)
|
||||
{
|
||||
DBusError err;
|
||||
DBusMessage *reply;
|
||||
bluez_t *bluez = (bluez_t*)data;
|
||||
|
||||
bluez_dbus_connect(bluez);
|
||||
|
||||
if (get_managed_objects(bluez, &reply))
|
||||
return;
|
||||
if (!reply)
|
||||
return;
|
||||
|
||||
/* Get default adapter */
|
||||
if (get_default_adapter(bluez, reply))
|
||||
return;
|
||||
dbus_message_unref(reply);
|
||||
|
||||
/* Power device on */
|
||||
if (set_bool_property(bluez, bluez->adapter,
|
||||
"org.bluez.Adapter1", "Powered", 1))
|
||||
return;
|
||||
|
||||
/* Start discovery */
|
||||
if (adapter_discovery(bluez, "StartDiscovery"))
|
||||
return;
|
||||
|
||||
retro_sleep(10000);
|
||||
|
||||
/* Stop discovery */
|
||||
if (adapter_discovery(bluez, "StopDiscovery"))
|
||||
return;
|
||||
|
||||
/* Get scanned devices */
|
||||
if (get_managed_objects(bluez, &reply))
|
||||
return;
|
||||
if (!reply)
|
||||
return;
|
||||
|
||||
if (bluez->devices)
|
||||
device_info_vector_list_free(bluez->devices);
|
||||
bluez->devices = device_info_vector_list_new();
|
||||
|
||||
read_scanned_devices(bluez, reply);
|
||||
dbus_message_unref(reply);
|
||||
bluez_dbus_disconnect(bluez);
|
||||
}
|
||||
|
||||
static void bluez_get_devices(void *data,
|
||||
struct string_list* devices_string_list)
|
||||
{
|
||||
unsigned i;
|
||||
union string_list_elem_attr attr;
|
||||
bluez_t *bluez = (bluez_t*)data;
|
||||
|
||||
attr.i = 0;
|
||||
|
||||
if (!bluez->devices)
|
||||
return;
|
||||
|
||||
for (i = 0; i < bluez->devices->count; i++)
|
||||
{
|
||||
char device[64];
|
||||
strlcpy(device, bluez->devices->data[i].name, sizeof(device));
|
||||
string_list_append(devices_string_list, device, attr);
|
||||
}
|
||||
}
|
||||
|
||||
static bool bluez_device_is_connected(void *data, unsigned i)
|
||||
{
|
||||
int value;
|
||||
bluez_t *bluez = (bluez_t*)data;
|
||||
|
||||
if (bluez->bluez_cache_counter[i] == 60)
|
||||
{
|
||||
bluez->bluez_cache_counter[i] = 0;
|
||||
bluez_dbus_connect(bluez);
|
||||
|
||||
/* Device disappeared */
|
||||
if (get_bool_property(bluez, bluez->devices->data[i].path,
|
||||
"org.bluez.Device1", "Connected", &value))
|
||||
value = false;
|
||||
|
||||
bluez_dbus_disconnect(bluez);
|
||||
|
||||
bluez->bluez_cache[i] = value;
|
||||
return value;
|
||||
}
|
||||
|
||||
bluez->bluez_cache_counter[i]++;
|
||||
return bluez->bluez_cache[i];
|
||||
}
|
||||
|
||||
static void bluez_device_get_sublabel(
|
||||
void *data, char *s, unsigned i, size_t len)
|
||||
{
|
||||
bluez_t *bluez = (bluez_t*)data;
|
||||
strlcpy(s, bluez->devices->data[i].address, len);
|
||||
}
|
||||
|
||||
static bool bluez_connect_device(void *data, unsigned i)
|
||||
{
|
||||
bluez_t *bluez = (bluez_t*)data;
|
||||
bluez_dbus_connect(bluez);
|
||||
|
||||
/* Trust the device */
|
||||
if (set_bool_property(bluez, bluez->devices->data[i].path,
|
||||
"org.bluez.Device1", "Trusted", 1))
|
||||
return false;
|
||||
|
||||
/* Pair the device */
|
||||
device_method(bluez, bluez->devices->data[i].path, "Pair");
|
||||
|
||||
/* Can be "Already Exists" */
|
||||
/* Connect the device */
|
||||
if (device_method(bluez, bluez->devices->data[i].path, "Connect"))
|
||||
return false;
|
||||
|
||||
bluez_dbus_disconnect(bluez);
|
||||
bluez->bluez_cache_counter[i] = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
bluetooth_driver_t bluetooth_bluez = {
|
||||
bluez_init,
|
||||
bluez_free,
|
||||
bluez_scan,
|
||||
bluez_get_devices,
|
||||
bluez_device_is_connected,
|
||||
bluez_device_get_sublabel,
|
||||
bluez_connect_device,
|
||||
"bluez",
|
||||
};
|
||||
@@ -39,28 +39,25 @@ unsigned int read_system_buttons(void)
|
||||
|
||||
void exitspawn_kernel(const char *fileName, SceSize args, void *argp)
|
||||
{
|
||||
int k1;
|
||||
struct SceKernelLoadExecVSHParam game_param;
|
||||
|
||||
thread_active = 0;
|
||||
thread_active = 0;
|
||||
|
||||
memset(&game_param,0,sizeof(game_param));
|
||||
|
||||
game_param.size = sizeof(game_param);
|
||||
game_param.args = args;
|
||||
game_param.argp = argp;
|
||||
game_param.key = "game";
|
||||
game_param.size = sizeof(game_param);
|
||||
game_param.args = args;
|
||||
game_param.argp = argp;
|
||||
game_param.key = "game";
|
||||
game_param.vshmain_args_size = 0;
|
||||
game_param.vshmain_args = NULL;
|
||||
game_param.configfile = 0;
|
||||
game_param.unk4 = 0;
|
||||
game_param.unk5 = 0x10000;
|
||||
game_param.vshmain_args = NULL;
|
||||
game_param.configfile = 0;
|
||||
game_param.unk4 = 0;
|
||||
game_param.unk5 = 0x10000;
|
||||
|
||||
k1 = pspSdkSetK1(0);
|
||||
#if 0
|
||||
sceKernelSuspendAllUserThreads();
|
||||
#endif
|
||||
sceKernelLoadExecVSHMs2(fileName, &game_param);
|
||||
int k1 = pspSdkSetK1(0);
|
||||
//sceKernelSuspendAllUserThreads();
|
||||
int ret = sceKernelLoadExecVSHMs2(fileName, &game_param);
|
||||
pspSdkSetK1(k1);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <psp2/kernel/sysmem.h>
|
||||
#include <psp2/kernel/threadmgr.h>
|
||||
|
||||
#define RAM_THRESHOLD 0x1000000 // Memory left to the system for threads and other internal stuffs
|
||||
|
||||
int _newlib_heap_memblock;
|
||||
unsigned _newlib_heap_size;
|
||||
@@ -15,8 +16,6 @@ static int _newlib_vm_memblock;
|
||||
extern int _newlib_heap_size_user __attribute__((weak));
|
||||
extern int _newlib_vm_size_user __attribute__((weak));
|
||||
|
||||
#define ALIGN(x, a) (((x) + ((a) - 1)) & ~((a) - 1))
|
||||
|
||||
void * _sbrk_r(struct _reent *reent, ptrdiff_t incr) {
|
||||
if (sceKernelLockLwMutex((struct SceKernelLwMutexWork*)_newlib_sbrk_mutex, 1, 0) < 0)
|
||||
goto fail;
|
||||
@@ -38,8 +37,8 @@ void _init_vita_heap(void) {
|
||||
|
||||
int _newlib_vm_size = 0;
|
||||
if (&_newlib_vm_size_user != NULL) {
|
||||
_newlib_vm_size = ALIGN(_newlib_vm_size_user, 0x100000);
|
||||
_newlib_vm_memblock = sceKernelAllocMemBlockForVM("code", _newlib_vm_size);
|
||||
_newlib_vm_size = _newlib_vm_size_user;
|
||||
_newlib_vm_memblock = sceKernelAllocMemBlockForVM("code", _newlib_vm_size_user);
|
||||
|
||||
if (_newlib_vm_memblock < 0){
|
||||
//sceClibPrintf("sceKernelAllocMemBlockForVM failed\n");
|
||||
@@ -59,8 +58,6 @@ void _init_vita_heap(void) {
|
||||
info.size = sizeof(SceKernelFreeMemorySizeInfo);
|
||||
sceKernelGetFreeMemorySize(&info);
|
||||
|
||||
printf("sceKernelGetFreeMemorySize %x\n", info.size_user);
|
||||
|
||||
if (&_newlib_heap_size_user != NULL) {
|
||||
_newlib_heap_size = _newlib_heap_size_user;
|
||||
}else{
|
||||
|
||||
@@ -0,0 +1,229 @@
|
||||
// This provides support for __getreent() as well as implementation of our thread-related wrappers
|
||||
|
||||
#include <reent.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <vitasdk/utils.h>
|
||||
#include <psp2/kernel/threadmgr.h>
|
||||
|
||||
#define MAX_THREADS 256
|
||||
|
||||
typedef struct reent_for_thread {
|
||||
int thread_id;
|
||||
int needs_reclaim;
|
||||
void *tls_data_ext;
|
||||
void *pthread_data_ext;
|
||||
struct _reent reent;
|
||||
} reent_for_thread;
|
||||
|
||||
static reent_for_thread reent_list[MAX_THREADS];
|
||||
static int _newlib_reent_mutex;
|
||||
static struct _reent _newlib_global_reent;
|
||||
|
||||
#define TLS_REENT_THID_PTR(thid) sceKernelGetThreadTLSAddr(thid, 0x88)
|
||||
#define TLS_REENT_PTR sceKernelGetTLSAddr(0x88)
|
||||
|
||||
#define list_entry(ptr, type, member) \
|
||||
((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member)))
|
||||
|
||||
int __vita_delete_thread_reent(int thid)
|
||||
{
|
||||
struct reent_for_thread *for_thread;
|
||||
|
||||
// We only need to cleanup if reent is allocated, i.e. if it's on our TLS
|
||||
// We also don't need to clean up the global reent
|
||||
struct _reent **on_tls = NULL;
|
||||
|
||||
if (thid == 0)
|
||||
on_tls = TLS_REENT_PTR;
|
||||
else
|
||||
on_tls = TLS_REENT_THID_PTR(thid);
|
||||
|
||||
if (!*on_tls || *on_tls == &_newlib_global_reent)
|
||||
return 0;
|
||||
|
||||
for_thread = list_entry(*on_tls, struct reent_for_thread, reent);
|
||||
|
||||
// Remove from TLS
|
||||
*on_tls = 0;
|
||||
|
||||
// Set thread id to zero, which means the reent is free
|
||||
for_thread->thread_id = 0;
|
||||
|
||||
// We can't reclaim it here, will be done later in __getreent
|
||||
for_thread->needs_reclaim = 1;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int vitasdk_delete_thread_reent(int thid)
|
||||
{
|
||||
int res = 0;
|
||||
// Lock the list because we'll be modifying it
|
||||
sceKernelLockMutex(_newlib_reent_mutex, 1, NULL);
|
||||
|
||||
res = __vita_delete_thread_reent(thid);
|
||||
|
||||
sceKernelUnlockMutex(_newlib_reent_mutex, 1);
|
||||
return res;
|
||||
}
|
||||
|
||||
int _exit_thread_common(int exit_status, int (*exit_func)(int)) {
|
||||
int res = 0;
|
||||
int ret = 0;
|
||||
int thid = sceKernelGetThreadId();
|
||||
|
||||
// Lock the list because we'll be modifying it
|
||||
sceKernelLockMutex(_newlib_reent_mutex, 1, NULL);
|
||||
|
||||
res = __vita_delete_thread_reent(0);
|
||||
|
||||
ret = exit_func(exit_status);
|
||||
|
||||
if (res)
|
||||
{
|
||||
struct _reent **on_tls = TLS_REENT_PTR;
|
||||
struct reent_for_thread *for_thread = list_entry(*on_tls, struct reent_for_thread, reent);
|
||||
|
||||
for_thread->thread_id = thid;
|
||||
|
||||
// And put it back on TLS
|
||||
*on_tls = &for_thread->reent;
|
||||
}
|
||||
|
||||
sceKernelUnlockMutex(_newlib_reent_mutex, 1);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int vita_exit_thread(int exit_status) {
|
||||
return _exit_thread_common(exit_status, sceKernelExitThread);
|
||||
}
|
||||
|
||||
int vita_exit_delete_thread(int exit_status) {
|
||||
return _exit_thread_common(exit_status, sceKernelExitDeleteThread);
|
||||
}
|
||||
|
||||
static inline void __vita_clean_reent(void)
|
||||
{
|
||||
int i;
|
||||
SceKernelThreadInfo info;
|
||||
|
||||
for (i = 0; i < MAX_THREADS; ++i)
|
||||
{
|
||||
info.size = sizeof(SceKernelThreadInfo);
|
||||
|
||||
if (sceKernelGetThreadInfo(reent_list[i].thread_id, &info) < 0)
|
||||
{
|
||||
reent_list[i].thread_id = 0;
|
||||
reent_list[i].needs_reclaim = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static inline struct reent_for_thread *__vita_allocate_reent(void)
|
||||
{
|
||||
int i;
|
||||
struct reent_for_thread *free_reent = 0;
|
||||
|
||||
for (i = 0; i < MAX_THREADS; ++i)
|
||||
if (reent_list[i].thread_id == 0) {
|
||||
free_reent = &reent_list[i];
|
||||
break;
|
||||
}
|
||||
|
||||
return free_reent;
|
||||
}
|
||||
|
||||
struct _reent *__getreent_for_thread(int thid) {
|
||||
struct reent_for_thread *free_reent = 0;
|
||||
struct _reent *returned_reent = 0;
|
||||
|
||||
// A pointer to our reent should be on the TLS
|
||||
struct _reent **on_tls = NULL;
|
||||
|
||||
if (thid == 0)
|
||||
on_tls = TLS_REENT_PTR;
|
||||
else
|
||||
on_tls = TLS_REENT_THID_PTR(thid);
|
||||
|
||||
if (*on_tls) {
|
||||
return *on_tls;
|
||||
}
|
||||
|
||||
sceKernelLockMutex(_newlib_reent_mutex, 1, 0);
|
||||
|
||||
// If it's not on the TLS this means the thread doesn't have a reent allocated yet
|
||||
// We allocate one and put a pointer to it on the TLS
|
||||
free_reent = __vita_allocate_reent();
|
||||
|
||||
if (!free_reent) {
|
||||
// clean any hanging thread references
|
||||
__vita_clean_reent();
|
||||
|
||||
free_reent = __vita_allocate_reent();
|
||||
|
||||
if (!free_reent) {
|
||||
// we've exhausted all our resources
|
||||
__builtin_trap();
|
||||
}
|
||||
} else {
|
||||
// First, check if it needs to be cleaned up (if it came from another thread)
|
||||
if (free_reent->needs_reclaim) {
|
||||
_reclaim_reent(&free_reent->reent);
|
||||
free_reent->needs_reclaim = 0;
|
||||
}
|
||||
|
||||
memset(free_reent, 0, sizeof(struct reent_for_thread));
|
||||
|
||||
// Set it up
|
||||
if(thid==0){
|
||||
thid = sceKernelGetThreadId();
|
||||
}
|
||||
free_reent->thread_id = thid;
|
||||
_REENT_INIT_PTR(&free_reent->reent);
|
||||
returned_reent = &free_reent->reent;
|
||||
}
|
||||
|
||||
// Put it on TLS for faster access time
|
||||
*on_tls = returned_reent;
|
||||
|
||||
sceKernelUnlockMutex(_newlib_reent_mutex, 1);
|
||||
return returned_reent;
|
||||
}
|
||||
|
||||
struct _reent *__getreent(void) {
|
||||
return __getreent_for_thread(0);
|
||||
}
|
||||
|
||||
void *vitasdk_get_tls_data(SceUID thid)
|
||||
{
|
||||
struct reent_for_thread *for_thread;
|
||||
struct _reent *reent = __getreent_for_thread(thid);
|
||||
|
||||
for_thread = list_entry(reent, struct reent_for_thread, reent);
|
||||
return &for_thread->tls_data_ext;
|
||||
}
|
||||
|
||||
void *vitasdk_get_pthread_data(SceUID thid)
|
||||
{
|
||||
struct reent_for_thread *for_thread;
|
||||
struct _reent *reent = __getreent_for_thread(thid);
|
||||
|
||||
for_thread = list_entry(reent, struct reent_for_thread, reent);
|
||||
return &for_thread->pthread_data_ext;
|
||||
}
|
||||
|
||||
// Called from _start to set up the main thread reentrancy structure
|
||||
void _init_vita_reent(void) {
|
||||
memset(reent_list, 0, sizeof(reent_list));
|
||||
_newlib_reent_mutex = sceKernelCreateMutex("reent list access mutex", 0, 0, 0);
|
||||
reent_list[0].thread_id = sceKernelGetThreadId();
|
||||
_REENT_INIT_PTR(&reent_list[0].reent);
|
||||
*(struct _reent **)(TLS_REENT_PTR) = &reent_list[0].reent;
|
||||
_REENT_INIT_PTR(&_newlib_global_reent);
|
||||
}
|
||||
|
||||
void _free_vita_reent(void) {
|
||||
sceKernelDeleteMutex(_newlib_reent_mutex);
|
||||
}
|
||||
@@ -402,7 +402,7 @@ static bool v4l_poll(void *data,
|
||||
|
||||
if (preprocess_image(data))
|
||||
{
|
||||
if (frame_raw_cb)
|
||||
if (frame_raw_cb != NULL)
|
||||
frame_raw_cb(v4l->buffer_output, v4l->width,
|
||||
v4l->height, v4l->width * 4);
|
||||
return true;
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
#ifdef HAVE_MENU
|
||||
|
||||
#define CHEEVOS_MENU_BADGE_LIMIT 256
|
||||
/* TODO/FIXME - public global variables */
|
||||
static uintptr_t cheevos_badge_menu_texture_list[CHEEVOS_MENU_BADGE_LIMIT] = { 0 };
|
||||
|
||||
void cheevos_reset_menu_badges(void)
|
||||
@@ -36,8 +35,7 @@ void cheevos_reset_menu_badges(void)
|
||||
video_driver_texture_unload(&cheevos_badge_menu_texture_list[index]);
|
||||
}
|
||||
|
||||
memset(&cheevos_badge_menu_texture_list, 0,
|
||||
sizeof(cheevos_badge_menu_texture_list));
|
||||
memset(&cheevos_badge_menu_texture_list, 0, sizeof(cheevos_badge_menu_texture_list));
|
||||
}
|
||||
|
||||
void cheevos_set_menu_badge(int index, const char *badge, bool locked)
|
||||
@@ -50,14 +48,13 @@ void cheevos_set_menu_badge(int index, const char *badge, bool locked)
|
||||
if (!settings || !settings->bools.cheevos_badges_enable)
|
||||
cheevos_badge_menu_texture_list[index] = 0;
|
||||
else
|
||||
cheevos_badge_menu_texture_list[index] =
|
||||
cheevos_get_badge_texture(badge, locked);
|
||||
cheevos_badge_menu_texture_list[index] = cheevos_get_badge_texture(badge, locked);
|
||||
}
|
||||
|
||||
uintptr_t cheevos_get_menu_badge_texture(int index)
|
||||
{
|
||||
if (index < CHEEVOS_MENU_BADGE_LIMIT)
|
||||
return cheevos_badge_menu_texture_list[index];
|
||||
return cheevos_badge_menu_texture_list[index];
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -68,24 +65,19 @@ uintptr_t cheevos_get_badge_texture(const char *badge, bool locked)
|
||||
{
|
||||
char badge_file[24];
|
||||
char fullpath[PATH_MAX_LENGTH];
|
||||
uintptr_t tex = 0;
|
||||
uintptr_t tex;
|
||||
|
||||
if (!badge)
|
||||
return 0;
|
||||
|
||||
fullpath[0] = badge_file[0] = '\0';
|
||||
snprintf(badge_file, sizeof(badge_file), "%s%s.png", badge, locked ? "_lock" : "");
|
||||
|
||||
strlcpy(badge_file, badge, sizeof(badge_file));
|
||||
if (locked)
|
||||
strlcat(badge_file, "_lock", sizeof(badge_file));
|
||||
strlcat(badge_file, FILE_PATH_PNG_EXTENSION, sizeof(badge_file));
|
||||
|
||||
fill_pathname_application_special(fullpath, sizeof(fullpath),
|
||||
fill_pathname_application_special(fullpath,
|
||||
PATH_MAX_LENGTH * sizeof(char),
|
||||
APPLICATION_SPECIAL_DIRECTORY_THUMBNAILS_CHEEVOS_BADGES);
|
||||
|
||||
if (!gfx_display_reset_textures_list(badge_file, fullpath,
|
||||
&tex, TEXTURE_FILTER_MIPMAP_LINEAR, NULL, NULL))
|
||||
tex = 0;
|
||||
gfx_display_reset_textures_list(badge_file, fullpath,
|
||||
&tex, TEXTURE_FILTER_MIPMAP_LINEAR, NULL, NULL);
|
||||
|
||||
return tex;
|
||||
}
|
||||
File renamed without changes.
File diff suppressed because it is too large.
Load diff
@@ -37,47 +37,44 @@ typedef struct rcheevos_ctx_desc
|
||||
enum
|
||||
{
|
||||
RCHEEVOS_ACTIVE_SOFTCORE = 1 << 0,
|
||||
RCHEEVOS_ACTIVE_HARDCORE = 1 << 1,
|
||||
RCHEEVOS_ACTIVE_UNOFFICIAL = 1 << 2
|
||||
RCHEEVOS_ACTIVE_HARDCORE = 1 << 1
|
||||
};
|
||||
|
||||
bool rcheevos_load(const void *data);
|
||||
size_t rcheevos_get_serialize_size(void);
|
||||
bool rcheevos_get_serialized_data(void* buffer);
|
||||
bool rcheevos_set_serialized_data(void* buffer);
|
||||
|
||||
void rcheevos_reset_game(bool widgets_ready);
|
||||
void rcheevos_reset_game(void);
|
||||
|
||||
void rcheevos_populate_menu(void* data);
|
||||
void rcheevos_populate_hardcore_pause_menu(void* data);
|
||||
void rcheevos_populate_menu(void *data);
|
||||
void rcheevos_get_achievement_state(unsigned index, char* buffer, size_t buffer_size);
|
||||
|
||||
bool rcheevos_get_description(rcheevos_ctx_desc_t *desc);
|
||||
|
||||
void rcheevos_pause_hardcore(void);
|
||||
bool rcheevos_apply_cheats(bool *data_bool);
|
||||
|
||||
bool rcheevos_unload(void);
|
||||
|
||||
void rcheevos_hardcore_enabled_changed(void);
|
||||
void rcheevos_toggle_hardcore_paused(void);
|
||||
|
||||
void rcheevos_validate_config_settings(void);
|
||||
|
||||
void rcheevos_leaderboards_enabled_changed(void);
|
||||
bool rcheevos_toggle_hardcore_mode(void);
|
||||
|
||||
void rcheevos_test(void);
|
||||
|
||||
bool rcheevos_set_cheats(void);
|
||||
|
||||
void rcheevos_set_support_cheevos(bool state);
|
||||
|
||||
bool rcheevos_get_support_cheevos(void);
|
||||
|
||||
int rcheevos_get_console(void);
|
||||
|
||||
const char* rcheevos_get_hash(void);
|
||||
|
||||
const char *rcheevos_get_richpresence(void);
|
||||
|
||||
uint8_t* rcheevos_patch_address(unsigned address);
|
||||
|
||||
bool rcheevos_hardcore_active(void);
|
||||
extern bool rcheevos_loaded;
|
||||
extern bool rcheevos_hardcore_active;
|
||||
extern bool rcheevos_hardcore_paused;
|
||||
extern bool rcheevos_state_loaded_flag;
|
||||
extern int rcheevos_cheats_are_enabled;
|
||||
extern int rcheevos_cheats_were_enabled;
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
File renamed without changes.
@@ -0,0 +1,301 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2015-2018 - Andre Leiradella
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "fixup.h"
|
||||
#include "cheevos.h"
|
||||
#include "util.h"
|
||||
|
||||
#include "../retroarch.h"
|
||||
#include "../core.h"
|
||||
|
||||
#include "../deps/rcheevos/include/rcheevos.h"
|
||||
|
||||
static int rcheevos_cmpaddr(const void* e1, const void* e2)
|
||||
{
|
||||
const rcheevos_fixup_t* f1 = (const rcheevos_fixup_t*)e1;
|
||||
const rcheevos_fixup_t* f2 = (const rcheevos_fixup_t*)e2;
|
||||
|
||||
if (f1->address < f2->address)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
else if (f1->address > f2->address)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
static size_t rcheevos_var_reduce(size_t addr, size_t mask)
|
||||
{
|
||||
while (mask)
|
||||
{
|
||||
size_t tmp = (mask - 1) & ~mask;
|
||||
addr = (addr & tmp) | ((addr >> 1) & ~tmp);
|
||||
mask = (mask & (mask - 1)) >> 1;
|
||||
}
|
||||
|
||||
return addr;
|
||||
}
|
||||
|
||||
static size_t rcheevos_var_highest_bit(size_t n)
|
||||
{
|
||||
n |= n >> 1;
|
||||
n |= n >> 2;
|
||||
n |= n >> 4;
|
||||
n |= n >> 8;
|
||||
n |= n >> 16;
|
||||
|
||||
return n ^ (n >> 1);
|
||||
}
|
||||
|
||||
void rcheevos_fixup_init(rcheevos_fixups_t* fixups)
|
||||
{
|
||||
fixups->elements = NULL;
|
||||
fixups->capacity = fixups->count = 0;
|
||||
fixups->dirty = false;
|
||||
}
|
||||
|
||||
void rcheevos_fixup_destroy(rcheevos_fixups_t* fixups)
|
||||
{
|
||||
CHEEVOS_FREE(fixups->elements);
|
||||
rcheevos_fixup_init(fixups);
|
||||
}
|
||||
|
||||
const uint8_t* rcheevos_fixup_find(rcheevos_fixups_t* fixups, unsigned address, int console)
|
||||
{
|
||||
rcheevos_fixup_t key;
|
||||
rcheevos_fixup_t* found;
|
||||
const uint8_t* location;
|
||||
|
||||
if (fixups->dirty)
|
||||
{
|
||||
qsort(fixups->elements, fixups->count, sizeof(rcheevos_fixup_t), rcheevos_cmpaddr);
|
||||
fixups->dirty = false;
|
||||
}
|
||||
|
||||
key.address = address;
|
||||
found = (rcheevos_fixup_t*)bsearch(&key, fixups->elements, fixups->count, sizeof(rcheevos_fixup_t), rcheevos_cmpaddr);
|
||||
|
||||
if (found != NULL)
|
||||
{
|
||||
return found->location;
|
||||
}
|
||||
|
||||
if (fixups->count == fixups->capacity)
|
||||
{
|
||||
unsigned new_capacity = fixups->capacity == 0 ? 16 : fixups->capacity * 2;
|
||||
rcheevos_fixup_t* new_elements = (rcheevos_fixup_t*)
|
||||
realloc(fixups->elements, new_capacity * sizeof(rcheevos_fixup_t));
|
||||
|
||||
if (new_elements == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
fixups->elements = new_elements;
|
||||
fixups->capacity = new_capacity;
|
||||
}
|
||||
|
||||
fixups->elements[fixups->count].address = address;
|
||||
fixups->elements[fixups->count++].location = location =
|
||||
rcheevos_patch_address(address, console);
|
||||
fixups->dirty = true;
|
||||
|
||||
return location;
|
||||
}
|
||||
|
||||
const uint8_t* rcheevos_patch_address(unsigned address, int console)
|
||||
{
|
||||
rarch_system_info_t* system = runloop_get_system_info();
|
||||
const void* pointer = NULL;
|
||||
unsigned original_address = address;
|
||||
|
||||
if (console == RC_CONSOLE_NINTENDO)
|
||||
{
|
||||
if (address >= 0x0800 && address < 0x2000)
|
||||
{
|
||||
/* Address in the mirrorred RAM, adjust to real RAM. */
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "NES memory address in mirrorred RAM %X, adjusted to %X\n", address, address & 0x07ff);
|
||||
address &= 0x07ff;
|
||||
}
|
||||
}
|
||||
else if (console == RC_CONSOLE_GAMEBOY_COLOR)
|
||||
{
|
||||
if (address >= 0xe000 && address <= 0xfdff)
|
||||
{
|
||||
/* Address in the echo RAM, adjust to real RAM. */
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "GBC memory address in echo RAM %X, adjusted to %X\n", address, address - 0x2000);
|
||||
address -= 0x2000;
|
||||
}
|
||||
}
|
||||
|
||||
if (system->mmaps.num_descriptors != 0)
|
||||
{
|
||||
/* We have memory descriptors, use it. */
|
||||
const rarch_memory_descriptor_t* desc = NULL;
|
||||
const rarch_memory_descriptor_t* end = NULL;
|
||||
|
||||
/* Patch the address to correctly map it to the mmaps. */
|
||||
if (console == RC_CONSOLE_GAMEBOY_ADVANCE)
|
||||
{
|
||||
if (address < 0x8000)
|
||||
{
|
||||
/* Internal RAM. */
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "GBA memory address %X adjusted to %X\n", address, address + 0x3000000);
|
||||
address += 0x3000000;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Work RAM. */
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "GBA memory address %X adjusted to %X\n", address, address + 0x2000000 - 0x8000);
|
||||
address += 0x2000000 - 0x8000;
|
||||
}
|
||||
}
|
||||
else if (console == RC_CONSOLE_PC_ENGINE)
|
||||
{
|
||||
if (address < 0x002000)
|
||||
{
|
||||
/* RAM. */
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "PCE memory address %X adjusted to %X\n", address, address + 0x1f0000);
|
||||
address += 0x1f0000;
|
||||
}
|
||||
else if (address < 0x012000)
|
||||
{
|
||||
/* CD-ROM RAM. */
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "PCE memory address %X adjusted to %X\n", address, address + 0x100000 - 0x002000);
|
||||
address += 0x100000 - 0x002000;
|
||||
}
|
||||
else if (address < 0x042000)
|
||||
{
|
||||
/* Super System Card RAM. */
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "PCE memory address %X adjusted to %X\n", address, address + 0x0d0000 - 0x012000);
|
||||
address += 0x0d0000 - 0x012000;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* CD-ROM battery backed RAM. */
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "PCE memory address %X adjusted to %X\n", address, address + 0x1ee000 - 0x042000);
|
||||
address += 0x1ee000 - 0x042000;
|
||||
}
|
||||
}
|
||||
else if (console == RC_CONSOLE_SUPER_NINTENDO)
|
||||
{
|
||||
if (address < 0x020000)
|
||||
{
|
||||
/* Work RAM. */
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "SNES memory address %X adjusted to %X\n", address, address + 0x7e0000);
|
||||
address += 0x7e0000;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Save RAM. */
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "SNES memory address %X adjusted to %X\n", address, address + 0x006000 - 0x020000);
|
||||
address += 0x006000 - 0x020000;
|
||||
}
|
||||
}
|
||||
else if (console == RC_CONSOLE_SEGA_CD)
|
||||
{
|
||||
if (address < 0x010000)
|
||||
{
|
||||
/* Work RAM. */
|
||||
address += 0xFF0000;
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "Sega CD memory address %X adjusted to %X\n", original_address, address);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* CD-ROM peripheral RAM - exposed at virtual address to avoid banking */
|
||||
address += 0x80020000 - 0x010000;
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "Sega CD memory address %X adjusted to %X\n", original_address, address);
|
||||
}
|
||||
}
|
||||
|
||||
desc = system->mmaps.descriptors;
|
||||
end = desc + system->mmaps.num_descriptors;
|
||||
|
||||
for (; desc < end; desc++)
|
||||
{
|
||||
if (((desc->core.start ^ address) & desc->core.select) == 0)
|
||||
{
|
||||
pointer = desc->core.ptr;
|
||||
address -= desc->core.start;
|
||||
|
||||
if (desc->disconnect_mask)
|
||||
address = (unsigned)rcheevos_var_reduce(address & desc->disconnect_mask, desc->core.disconnect);
|
||||
|
||||
if (address >= desc->core.len)
|
||||
address -= rcheevos_var_highest_bit(address);
|
||||
|
||||
address += desc->core.offset;
|
||||
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "address %X set to descriptor %d at offset %X\n", original_address, (int)((desc - system->mmaps.descriptors) + 1), address);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
retro_ctx_memory_info_t meminfo;
|
||||
|
||||
switch (i)
|
||||
{
|
||||
case 0:
|
||||
meminfo.id = RETRO_MEMORY_SYSTEM_RAM;
|
||||
break;
|
||||
case 1:
|
||||
meminfo.id = RETRO_MEMORY_SAVE_RAM;
|
||||
break;
|
||||
case 2:
|
||||
meminfo.id = RETRO_MEMORY_VIDEO_RAM;
|
||||
break;
|
||||
case 3:
|
||||
meminfo.id = RETRO_MEMORY_RTC;
|
||||
break;
|
||||
}
|
||||
|
||||
core_get_memory(&meminfo);
|
||||
|
||||
if (address < meminfo.size)
|
||||
{
|
||||
pointer = meminfo.data;
|
||||
break;
|
||||
}
|
||||
|
||||
/**
|
||||
* HACK Subtract the correct amount of bytes to reach the save RAM as
|
||||
* it's size is not always set correctly in the core.
|
||||
*/
|
||||
if (i == 0 && console == RC_CONSOLE_NINTENDO)
|
||||
address -= 0x6000;
|
||||
else
|
||||
address -= meminfo.size;
|
||||
}
|
||||
}
|
||||
|
||||
if (pointer == NULL)
|
||||
{
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "address %X not supported\n", original_address);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return (const uint8_t*)pointer + address;
|
||||
}
|
||||
@@ -12,32 +12,36 @@
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __RARCH_CHEEVOS_MEMORY_H
|
||||
#define __RARCH_CHEEVOS_MEMORY_H
|
||||
|
||||
#ifndef __RARCH_CHEEVOS_FIXUP_H
|
||||
#define __RARCH_CHEEVOS_FIXUP_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <boolean.h>
|
||||
|
||||
#include <retro_common_api.h>
|
||||
|
||||
RETRO_BEGIN_DECLS
|
||||
|
||||
#define MAX_MEMORY_REGIONS 32
|
||||
typedef struct
|
||||
{
|
||||
unsigned address;
|
||||
const uint8_t* location;
|
||||
} rcheevos_fixup_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t* data[MAX_MEMORY_REGIONS];
|
||||
size_t size[MAX_MEMORY_REGIONS];
|
||||
size_t total_size;
|
||||
unsigned count;
|
||||
} rcheevos_memory_regions_t;
|
||||
rcheevos_fixup_t* elements;
|
||||
unsigned capacity, count;
|
||||
bool dirty;
|
||||
} rcheevos_fixups_t;
|
||||
|
||||
bool rcheevos_memory_init(rcheevos_memory_regions_t* regions, int console);
|
||||
void rcheevos_memory_destroy(rcheevos_memory_regions_t* regions);
|
||||
void rcheevos_fixup_init(rcheevos_fixups_t* fixups);
|
||||
void rcheevos_fixup_destroy(rcheevos_fixups_t* fixups);
|
||||
|
||||
uint8_t* rcheevos_memory_find(const rcheevos_memory_regions_t* regions,
|
||||
unsigned address);
|
||||
const uint8_t* rcheevos_fixup_find(rcheevos_fixups_t* fixups, unsigned address, int console);
|
||||
|
||||
const uint8_t* rcheevos_patch_address(unsigned address, int console);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
#include "hash.h"
|
||||
|
||||
uint32_t rcheevos_djb2(const char* str, size_t length)
|
||||
{
|
||||
const unsigned char* aux = (const unsigned char*)str;
|
||||
uint32_t hash = 5381;
|
||||
|
||||
while (length--)
|
||||
hash = ( hash << 5 ) + hash + *aux++;
|
||||
|
||||
return hash;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2015-2018 - Andre Leiradella
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __RARCH_CHEEVOS_HASH_H
|
||||
#define __RARCH_CHEEVOS_HASH_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#include <retro_common_api.h>
|
||||
|
||||
RETRO_BEGIN_DECLS
|
||||
|
||||
uint32_t rcheevos_djb2(const char* str, size_t length);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
||||
@@ -1,14 +1,13 @@
|
||||
#include "cheevos_parser.h"
|
||||
#include "parser.h"
|
||||
|
||||
#include "hash.h"
|
||||
#include "util.h"
|
||||
|
||||
#include <encodings/utf.h>
|
||||
#include <formats/rjson.h>
|
||||
#include <formats/jsonsax.h>
|
||||
#include <string/stdstring.h>
|
||||
#include <compat/strl.h>
|
||||
|
||||
#include "../deps/rcheevos/include/rcheevos.h"
|
||||
|
||||
/* C89 wants only int values in enums. */
|
||||
#define CHEEVOS_JSON_KEY_GAMEID 0xb4960eecU
|
||||
#define CHEEVOS_JSON_KEY_ACHIEVEMENTS 0x69749ae1U
|
||||
@@ -31,118 +30,114 @@
|
||||
#define CHEEVOS_JSON_KEY_SUCCESS 0x110461deU
|
||||
#define CHEEVOS_JSON_KEY_ERROR 0x0d2011cfU
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char* value;
|
||||
int is_key;
|
||||
size_t length;
|
||||
unsigned key_hash;
|
||||
} rcheevos_getvalueud_t;
|
||||
|
||||
#define CHEEVOS_RJSON_OPTIONS \
|
||||
/* Inside the field RichPresencePatch newlines are
|
||||
* encoded as '\r\n'. This will filter the \r out. */ \
|
||||
RJSON_OPTION_IGNORE_STRING_CARRIAGE_RETURN \
|
||||
/* This matches the behavior of the previously used
|
||||
* json parser. It is probably not required */ \
|
||||
| RJSON_OPTION_ALLOW_TRAILING_DATA
|
||||
|
||||
/*****************************************************************************
|
||||
Gets a value in a JSON
|
||||
*****************************************************************************/
|
||||
|
||||
static uint32_t rcheevos_djb2(const char* str, size_t length)
|
||||
typedef struct
|
||||
{
|
||||
const unsigned char* aux = (const unsigned char*)str;
|
||||
uint32_t hash = 5381;
|
||||
unsigned key_hash;
|
||||
int is_key;
|
||||
const char* value;
|
||||
size_t length;
|
||||
} rcheevos_getvalueud_t;
|
||||
|
||||
while (length--)
|
||||
hash = (hash << 5) + hash + *aux++;
|
||||
|
||||
return hash;
|
||||
}
|
||||
|
||||
static bool rcheevos_getvalue_key(void* userdata,
|
||||
static int rcheevos_getvalue_key(void* userdata,
|
||||
const char* name, size_t length)
|
||||
{
|
||||
rcheevos_getvalueud_t* ud = (rcheevos_getvalueud_t*)userdata;
|
||||
|
||||
ud->is_key = rcheevos_djb2(name, length) == ud->key_hash;
|
||||
return true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool rcheevos_getvalue_string(void* userdata,
|
||||
static int rcheevos_getvalue_string(void* userdata,
|
||||
const char* string, size_t length)
|
||||
{
|
||||
rcheevos_getvalueud_t* ud = (rcheevos_getvalueud_t*)userdata;
|
||||
|
||||
if (ud->is_key && ud->length > length)
|
||||
{
|
||||
strlcpy(ud->value, string, ud->length);
|
||||
ud->is_key = 2;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool rcheevos_getvalue_boolean(void* userdata, bool istrue)
|
||||
{
|
||||
rcheevos_getvalueud_t* ud = (rcheevos_getvalueud_t*)userdata;
|
||||
|
||||
if (ud->is_key)
|
||||
{
|
||||
if (istrue && ud->length > 4)
|
||||
{
|
||||
strlcpy(ud->value, "true", ud->length);
|
||||
ud->is_key = 2;
|
||||
return false;
|
||||
}
|
||||
if (!istrue && ud->length > 5)
|
||||
{
|
||||
strlcpy(ud->value, "false", ud->length);
|
||||
ud->is_key = 2;
|
||||
return false;
|
||||
}
|
||||
ud->value = string;
|
||||
ud->length = length;
|
||||
ud->is_key = 0;
|
||||
}
|
||||
|
||||
return true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool rcheevos_getvalue_null(void* userdata)
|
||||
static int rcheevos_getvalue_boolean(void* userdata, int istrue)
|
||||
{
|
||||
rcheevos_getvalueud_t* ud = (rcheevos_getvalueud_t*)userdata;
|
||||
|
||||
if (ud->is_key && ud->length > 4)
|
||||
if (ud->is_key)
|
||||
{
|
||||
strlcpy(ud->value, "null", ud->length);
|
||||
ud->is_key = 2;
|
||||
return false;
|
||||
if (istrue)
|
||||
{
|
||||
ud->value = "true";
|
||||
ud->length = 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
ud->value = "false";
|
||||
ud->length = 5;
|
||||
}
|
||||
|
||||
ud->is_key = 0;
|
||||
}
|
||||
|
||||
return true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rcheevos_getvalue_null(void* userdata)
|
||||
{
|
||||
rcheevos_getvalueud_t* ud = (rcheevos_getvalueud_t*)userdata;
|
||||
|
||||
if (ud->is_key )
|
||||
{
|
||||
ud->value = "null";
|
||||
ud->length = 4;
|
||||
ud->is_key = 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rcheevos_get_value(const char* json, unsigned key_hash,
|
||||
char* value, size_t length)
|
||||
{
|
||||
static const jsonsax_handlers_t handlers =
|
||||
{
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
rcheevos_getvalue_key,
|
||||
NULL,
|
||||
rcheevos_getvalue_string,
|
||||
rcheevos_getvalue_string, /* number */
|
||||
rcheevos_getvalue_boolean,
|
||||
rcheevos_getvalue_null
|
||||
};
|
||||
|
||||
rcheevos_getvalueud_t ud;
|
||||
|
||||
ud.key_hash = key_hash;
|
||||
ud.is_key = 0;
|
||||
ud.value = value;
|
||||
ud.length = length;
|
||||
ud.value = NULL;
|
||||
ud.length = 0;
|
||||
*value = 0;
|
||||
|
||||
rjson_parse_quick(json, &ud, CHEEVOS_RJSON_OPTIONS,
|
||||
rcheevos_getvalue_key,
|
||||
rcheevos_getvalue_string,
|
||||
rcheevos_getvalue_string, /* number */
|
||||
NULL, NULL, NULL, NULL,
|
||||
rcheevos_getvalue_boolean,
|
||||
rcheevos_getvalue_null, NULL);
|
||||
if ((jsonsax_parse(json, &handlers, (void*)&ud) == JSONSAX_OK)
|
||||
&& ud.value && ud.length < length)
|
||||
{
|
||||
strlcpy(value, ud.value, ud.length + 1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return (ud.is_key == 2 ? 0 : -1);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
@@ -179,16 +174,16 @@ typedef struct
|
||||
unsigned lboard_count;
|
||||
} rcheevos_countud_t;
|
||||
|
||||
static bool rcheevos_count_end_array(void* userdata)
|
||||
static int rcheevos_count_end_array(void* userdata)
|
||||
{
|
||||
rcheevos_countud_t* ud = (rcheevos_countud_t*)userdata;
|
||||
|
||||
ud->in_cheevos = 0;
|
||||
ud->in_lboards = 0;
|
||||
return true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool rcheevos_count_key(void* userdata,
|
||||
static int rcheevos_count_key(void* userdata,
|
||||
const char* name, size_t length)
|
||||
{
|
||||
rcheevos_countud_t* ud = (rcheevos_countud_t*)userdata;
|
||||
@@ -202,10 +197,10 @@ static bool rcheevos_count_key(void* userdata,
|
||||
else if (ud->field_hash == CHEEVOS_JSON_KEY_ERROR)
|
||||
ud->has_error = 1;
|
||||
|
||||
return true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool rcheevos_count_number(void* userdata,
|
||||
static int rcheevos_count_number(void* userdata,
|
||||
const char* number, size_t length)
|
||||
{
|
||||
rcheevos_countud_t* ud = (rcheevos_countud_t*)userdata;
|
||||
@@ -222,14 +217,30 @@ static bool rcheevos_count_number(void* userdata,
|
||||
else if (ud->in_lboards && ud->field_hash == CHEEVOS_JSON_KEY_ID)
|
||||
ud->lboard_count++;
|
||||
|
||||
return true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool rcheevos_count_cheevos(const char* json,
|
||||
static int rcheevos_count_cheevos(const char* json,
|
||||
unsigned* core_count, unsigned* unofficial_count,
|
||||
unsigned* lboard_count, int* has_error)
|
||||
{
|
||||
bool res;
|
||||
static const jsonsax_handlers_t handlers =
|
||||
{
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
rcheevos_count_end_array,
|
||||
rcheevos_count_key,
|
||||
NULL,
|
||||
NULL,
|
||||
rcheevos_count_number,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
int res;
|
||||
rcheevos_countud_t ud;
|
||||
ud.in_cheevos = 0;
|
||||
ud.in_lboards = 0;
|
||||
@@ -238,14 +249,7 @@ static bool rcheevos_count_cheevos(const char* json,
|
||||
ud.unofficial_count = 0;
|
||||
ud.lboard_count = 0;
|
||||
|
||||
|
||||
res = rjson_parse_quick(json, &ud, CHEEVOS_RJSON_OPTIONS,
|
||||
rcheevos_count_key,
|
||||
NULL,
|
||||
rcheevos_count_number,
|
||||
NULL, NULL, NULL,
|
||||
rcheevos_count_end_array,
|
||||
NULL, NULL, NULL);
|
||||
res = jsonsax_parse(json, &handlers, (void*)&ud);
|
||||
|
||||
*core_count = ud.core_count;
|
||||
*unofficial_count = ud.unofficial_count;
|
||||
@@ -259,92 +263,164 @@ static bool rcheevos_count_cheevos(const char* json,
|
||||
Parses the cheevos in the JSON
|
||||
*****************************************************************************/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
const char* string;
|
||||
size_t length;
|
||||
} rcheevos_field_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int in_cheevos;
|
||||
int in_lboards;
|
||||
int lboard_had_id;
|
||||
int is_game_id;
|
||||
int is_title;
|
||||
int is_console_id;
|
||||
int is_richpresence;
|
||||
unsigned core_count;
|
||||
unsigned unofficial_count;
|
||||
unsigned lboard_count;
|
||||
|
||||
unsigned cheevo_flags;
|
||||
const char* lboard_format;
|
||||
const char** field_string;
|
||||
unsigned* field_unsigned;
|
||||
|
||||
rcheevos_racheevo_t cheevo;
|
||||
rcheevos_ralboard_t lboard;
|
||||
rcheevos_field_t* field;
|
||||
rcheevos_field_t id, memaddr, title, desc, points, author;
|
||||
rcheevos_field_t modified, created, badge, flags, format;
|
||||
|
||||
rcheevos_rapatchdata_t* patchdata;
|
||||
} rcheevos_readud_t;
|
||||
|
||||
static bool rcheevos_new_cheevo(rcheevos_readud_t* ud)
|
||||
static char* rcheevos_unescape_string(const char* string, size_t length)
|
||||
{
|
||||
const char* end = string + length;
|
||||
char* buffer = (char*)malloc(length + 1);
|
||||
char* buffer_it = buffer;
|
||||
|
||||
if (buffer == NULL)
|
||||
return NULL;
|
||||
|
||||
while (string < end)
|
||||
{
|
||||
if (*string == '\\')
|
||||
{
|
||||
char escaped_char = string[1];
|
||||
switch (escaped_char)
|
||||
{
|
||||
case 'r': /* Ignore carriage return */
|
||||
string += 2;
|
||||
break;
|
||||
|
||||
case 'n': /* Accept newlines */
|
||||
*buffer_it++ = '\n';
|
||||
string += 2;
|
||||
break;
|
||||
|
||||
case 'u': /* Accept UTF-16 unicode characters */
|
||||
{
|
||||
#define MAX_SEQUENCES 16
|
||||
uint16_t utf16[MAX_SEQUENCES];
|
||||
char utf8[MAX_SEQUENCES * 4];
|
||||
uint8_t i, j;
|
||||
|
||||
for (i = 1; i < MAX_SEQUENCES - 1; i++)
|
||||
if (strncmp((string + 6 * i), "\\u", 2))
|
||||
break;
|
||||
|
||||
/* Get escaped hex values and add them to the string */
|
||||
for (j = 0; j < i; j++)
|
||||
{
|
||||
char temp[5];
|
||||
|
||||
string += 2;
|
||||
memcpy(temp, string, 4);
|
||||
temp[4] = '\0';
|
||||
utf16[j] = string_hex_to_unsigned(temp);
|
||||
string += 4;
|
||||
}
|
||||
utf16[j] = 0;
|
||||
|
||||
if (utf16_to_char_string(utf16, utf8, sizeof(utf8)))
|
||||
{
|
||||
memcpy(buffer_it, utf8, strlen(utf8));
|
||||
buffer_it += strlen(utf8);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
*buffer_it++ = escaped_char;
|
||||
string += 2;
|
||||
break;
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
*buffer_it++ = *string++;
|
||||
}
|
||||
}
|
||||
*buffer_it = '\0';
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
static int rcheevos_new_cheevo(rcheevos_readud_t* ud)
|
||||
{
|
||||
rcheevos_racheevo_t* cheevo = NULL;
|
||||
unsigned flags = (unsigned)strtol(ud->flags.string, NULL, 10);
|
||||
|
||||
if (ud->cheevo_flags == 3)
|
||||
if (flags == 3)
|
||||
cheevo = ud->patchdata->core + ud->core_count++;
|
||||
else if (ud->cheevo_flags == 5)
|
||||
else if (flags == 5)
|
||||
cheevo = ud->patchdata->unofficial + ud->unofficial_count++;
|
||||
ud->cheevo_flags = 0;
|
||||
else
|
||||
return 0;
|
||||
|
||||
if (!cheevo
|
||||
|| !ud->cheevo.title
|
||||
|| !ud->cheevo.description
|
||||
|| !ud->cheevo.badge
|
||||
|| !ud->cheevo.memaddr)
|
||||
cheevo->title = rcheevos_unescape_string(ud->title.string, ud->title.length);
|
||||
cheevo->description = rcheevos_unescape_string(ud->desc.string, ud->desc.length);
|
||||
cheevo->badge = rcheevos_unescape_string(ud->badge.string, ud->badge.length);
|
||||
cheevo->memaddr = rcheevos_unescape_string(ud->memaddr.string, ud->memaddr.length);
|
||||
cheevo->points = (unsigned)strtol(ud->points.string, NULL, 10);
|
||||
cheevo->id = (unsigned)strtol(ud->id.string, NULL, 10);
|
||||
|
||||
if ( !cheevo->title
|
||||
|| !cheevo->description
|
||||
|| !cheevo->badge
|
||||
|| !cheevo->memaddr)
|
||||
{
|
||||
CHEEVOS_FREE(ud->cheevo.title);
|
||||
CHEEVOS_FREE(ud->cheevo.description);
|
||||
CHEEVOS_FREE(ud->cheevo.badge);
|
||||
CHEEVOS_FREE(ud->cheevo.memaddr);
|
||||
memset(&ud->cheevo, 0, sizeof(ud->cheevo));
|
||||
return (cheevo ? false : true);
|
||||
CHEEVOS_FREE(cheevo->title);
|
||||
CHEEVOS_FREE(cheevo->description);
|
||||
CHEEVOS_FREE(cheevo->badge);
|
||||
CHEEVOS_FREE(cheevo->memaddr);
|
||||
return -1;
|
||||
}
|
||||
|
||||
*cheevo = ud->cheevo;
|
||||
memset(&ud->cheevo, 0, sizeof(ud->cheevo));
|
||||
|
||||
return true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool rcheevos_new_lboard(rcheevos_readud_t* ud)
|
||||
static int rcheevos_new_lboard(rcheevos_readud_t* ud)
|
||||
{
|
||||
rcheevos_ralboard_t* lboard = NULL;
|
||||
rcheevos_ralboard_t* lboard = ud->patchdata->lboards + ud->lboard_count++;
|
||||
|
||||
if (ud->lboard_had_id)
|
||||
lboard = ud->patchdata->lboards + ud->lboard_count++;
|
||||
ud->lboard_had_id = 0;
|
||||
lboard->title = rcheevos_unescape_string(ud->title.string, ud->title.length);
|
||||
lboard->description = rcheevos_unescape_string(ud->desc.string, ud->desc.length);
|
||||
lboard->format = rcheevos_unescape_string(ud->format.string, ud->format.length);
|
||||
lboard->mem = rcheevos_unescape_string(ud->memaddr.string, ud->memaddr.length);
|
||||
lboard->id = (unsigned)strtol(ud->id.string, NULL, 10);
|
||||
|
||||
if (!lboard
|
||||
|| !ud->lboard.title
|
||||
|| !ud->lboard.description
|
||||
|| !ud->lboard.mem)
|
||||
if ( !lboard->title
|
||||
|| !lboard->description
|
||||
|| !lboard->format
|
||||
|| !lboard->mem)
|
||||
{
|
||||
CHEEVOS_FREE(ud->lboard.title);
|
||||
CHEEVOS_FREE(ud->lboard.description);
|
||||
CHEEVOS_FREE(ud->lboard.mem);
|
||||
memset(&ud->lboard, 0, sizeof(ud->lboard));
|
||||
CHEEVOS_FREE(ud->lboard_format);
|
||||
ud->lboard_format = NULL;
|
||||
return (lboard ? false : true);
|
||||
CHEEVOS_FREE(lboard->title);
|
||||
CHEEVOS_FREE(lboard->description);
|
||||
CHEEVOS_FREE(lboard->format);
|
||||
CHEEVOS_FREE(lboard->mem);
|
||||
return -1;
|
||||
}
|
||||
|
||||
*lboard = ud->lboard;
|
||||
memset(&ud->lboard, 0, sizeof(ud->lboard));
|
||||
|
||||
if (ud->lboard_format)
|
||||
{
|
||||
lboard->format = rc_parse_format(ud->lboard_format);
|
||||
CHEEVOS_FREE(ud->lboard_format);
|
||||
ud->lboard_format = NULL;
|
||||
}
|
||||
|
||||
return true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool rcheevos_read_end_object(void* userdata)
|
||||
static int rcheevos_read_end_object(void* userdata)
|
||||
{
|
||||
rcheevos_readud_t* ud = (rcheevos_readud_t*)userdata;
|
||||
|
||||
@@ -354,26 +430,26 @@ static bool rcheevos_read_end_object(void* userdata)
|
||||
if (ud->in_lboards)
|
||||
return rcheevos_new_lboard(ud);
|
||||
|
||||
return true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool rcheevos_read_end_array(void* userdata)
|
||||
static int rcheevos_read_end_array(void* userdata)
|
||||
{
|
||||
rcheevos_readud_t* ud = (rcheevos_readud_t*)userdata;
|
||||
|
||||
ud->in_cheevos = 0;
|
||||
ud->in_lboards = 0;
|
||||
return true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool rcheevos_read_key(void* userdata,
|
||||
static int rcheevos_read_key(void* userdata,
|
||||
const char* name, size_t length)
|
||||
{
|
||||
rcheevos_readud_t* ud = (rcheevos_readud_t*)userdata;
|
||||
|
||||
int common = ud->in_cheevos || ud->in_lboards;
|
||||
uint32_t hash = rcheevos_djb2(name, length);
|
||||
ud->field_unsigned = NULL;
|
||||
ud->field_string = NULL;
|
||||
ud->field = NULL;
|
||||
|
||||
switch (hash)
|
||||
{
|
||||
@@ -384,121 +460,145 @@ static bool rcheevos_read_key(void* userdata,
|
||||
ud->in_lboards = 1;
|
||||
break;
|
||||
case CHEEVOS_JSON_KEY_CONSOLE_ID:
|
||||
ud->field_unsigned = &ud->patchdata->console_id;
|
||||
ud->is_console_id = 1;
|
||||
break;
|
||||
case CHEEVOS_JSON_KEY_RICHPRESENCE:
|
||||
ud->field_string = (const char**)&ud->patchdata->richpresence_script;
|
||||
ud->is_richpresence = 1;
|
||||
break;
|
||||
case CHEEVOS_JSON_KEY_ID:
|
||||
if (ud->in_cheevos)
|
||||
ud->field_unsigned = &ud->cheevo.id;
|
||||
else if (ud->in_lboards)
|
||||
{
|
||||
ud->field_unsigned = &ud->lboard.id;
|
||||
ud->lboard_had_id = 1;
|
||||
}
|
||||
if (common)
|
||||
ud->field = &ud->id;
|
||||
else
|
||||
ud->field_unsigned = &ud->patchdata->game_id;
|
||||
ud->is_game_id = 1;
|
||||
break;
|
||||
case CHEEVOS_JSON_KEY_MEMADDR:
|
||||
if (ud->in_cheevos)
|
||||
ud->field_string = &ud->cheevo.memaddr;
|
||||
ud->field = &ud->memaddr;
|
||||
break;
|
||||
case CHEEVOS_JSON_KEY_MEM:
|
||||
if (ud->in_lboards)
|
||||
ud->field_string = &ud->lboard.mem;
|
||||
ud->field = &ud->memaddr;
|
||||
break;
|
||||
case CHEEVOS_JSON_KEY_TITLE:
|
||||
if (ud->in_cheevos)
|
||||
ud->field_string = &ud->cheevo.title;
|
||||
else if (ud->in_lboards)
|
||||
ud->field_string = &ud->lboard.title;
|
||||
if (common)
|
||||
ud->field = &ud->title;
|
||||
else
|
||||
ud->field_string = (const char**)&ud->patchdata->title;
|
||||
ud->is_title = 1;
|
||||
break;
|
||||
case CHEEVOS_JSON_KEY_DESCRIPTION:
|
||||
if (ud->in_cheevos)
|
||||
ud->field_string = &ud->cheevo.description;
|
||||
else if (ud->in_lboards)
|
||||
ud->field_string = &ud->lboard.description;
|
||||
if (common)
|
||||
ud->field = &ud->desc;
|
||||
break;
|
||||
case CHEEVOS_JSON_KEY_POINTS:
|
||||
if (ud->in_cheevos)
|
||||
ud->field_unsigned = &ud->cheevo.points;
|
||||
ud->field = &ud->points;
|
||||
break;
|
||||
/* UNUSED
|
||||
case CHEEVOS_JSON_KEY_AUTHOR:
|
||||
if (ud->in_cheevos)
|
||||
ud->field_string = &ud->cheevo.author;
|
||||
ud->field = &ud->author;
|
||||
break;
|
||||
case CHEEVOS_JSON_KEY_MODIFIED:
|
||||
if (ud->in_cheevos)
|
||||
ud->field_string = &ud->cheevo.modified;
|
||||
ud->field = &ud->modified;
|
||||
break;
|
||||
case CHEEVOS_JSON_KEY_CREATED:
|
||||
if (ud->in_cheevos)
|
||||
ud->field_string = &ud->cheevo.created;
|
||||
break; */
|
||||
ud->field = &ud->created;
|
||||
break;
|
||||
case CHEEVOS_JSON_KEY_BADGENAME:
|
||||
if (ud->in_cheevos)
|
||||
ud->field_string = &ud->cheevo.badge;
|
||||
ud->field = &ud->badge;
|
||||
break;
|
||||
case CHEEVOS_JSON_KEY_FLAGS:
|
||||
if (ud->in_cheevos)
|
||||
ud->field_unsigned = &ud->cheevo_flags;
|
||||
ud->field = &ud->flags;
|
||||
break;
|
||||
case CHEEVOS_JSON_KEY_FORMAT:
|
||||
if (ud->in_lboards)
|
||||
ud->field_string = &ud->lboard_format;
|
||||
ud->field = &ud->format;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool rcheevos_read_string(void* userdata,
|
||||
static int rcheevos_read_string(void* userdata,
|
||||
const char* string, size_t length)
|
||||
{
|
||||
rcheevos_readud_t* ud = (rcheevos_readud_t*)userdata;
|
||||
|
||||
if (ud->field_string)
|
||||
if (ud->field)
|
||||
{
|
||||
if (*ud->field_string)
|
||||
CHEEVOS_FREE((*ud->field_string));
|
||||
*ud->field_string = strdup(string);
|
||||
ud->field_string = NULL;
|
||||
ud->field->string = string;
|
||||
ud->field->length = length;
|
||||
}
|
||||
else if (ud->is_title)
|
||||
{
|
||||
ud->patchdata->title = rcheevos_unescape_string(string, length);
|
||||
ud->is_title = 0;
|
||||
}
|
||||
else if (ud->is_richpresence)
|
||||
{
|
||||
ud->patchdata->richpresence_script = rcheevos_unescape_string(string, length);
|
||||
ud->is_richpresence = 0;
|
||||
}
|
||||
|
||||
return true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool rcheevos_read_number(void* userdata,
|
||||
static int rcheevos_read_number(void* userdata,
|
||||
const char* number, size_t length)
|
||||
{
|
||||
rcheevos_readud_t* ud = (rcheevos_readud_t*)userdata;
|
||||
|
||||
if (ud->field_unsigned)
|
||||
if (ud->field)
|
||||
{
|
||||
*ud->field_unsigned = (unsigned)strtol(number, NULL, 10);
|
||||
ud->field_unsigned = NULL;
|
||||
ud->field->string = number;
|
||||
ud->field->length = length;
|
||||
}
|
||||
else if (ud->is_game_id)
|
||||
{
|
||||
ud->patchdata->game_id = (unsigned)strtol(number, NULL, 10);
|
||||
ud->is_game_id = 0;
|
||||
}
|
||||
else if (ud->is_console_id)
|
||||
{
|
||||
ud->patchdata->console_id = (unsigned)strtol(number, NULL, 10);
|
||||
ud->is_console_id = 0;
|
||||
}
|
||||
|
||||
return true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int rcheevos_get_patchdata(const char* json, rcheevos_rapatchdata_t* patchdata)
|
||||
{
|
||||
static const jsonsax_handlers_t handlers =
|
||||
{
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
rcheevos_read_end_object,
|
||||
NULL,
|
||||
rcheevos_read_end_array,
|
||||
rcheevos_read_key,
|
||||
NULL,
|
||||
rcheevos_read_string,
|
||||
rcheevos_read_number,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
rcheevos_readud_t ud;
|
||||
bool res;
|
||||
int res;
|
||||
int has_error;
|
||||
|
||||
/* Count the number of achievements in the JSON file. */
|
||||
res = rcheevos_count_cheevos(json, &patchdata->core_count,
|
||||
&patchdata->unofficial_count, &patchdata->lboard_count, &has_error);
|
||||
|
||||
if (!res || has_error)
|
||||
if (res != JSONSAX_OK || has_error)
|
||||
return -1;
|
||||
|
||||
/* Allocate the achievements. */
|
||||
@@ -527,27 +627,19 @@ int rcheevos_get_patchdata(const char* json, rcheevos_rapatchdata_t* patchdata)
|
||||
patchdata->title = NULL;
|
||||
|
||||
/* Load the achievements. */
|
||||
memset(&ud, 0, sizeof(ud));
|
||||
ud.in_cheevos = 0;
|
||||
ud.in_lboards = 0;
|
||||
ud.is_game_id = 0;
|
||||
ud.is_title = 0;
|
||||
ud.is_console_id = 0;
|
||||
ud.is_richpresence = 0;
|
||||
ud.field = NULL;
|
||||
ud.core_count = 0;
|
||||
ud.unofficial_count = 0;
|
||||
ud.lboard_count = 0;
|
||||
ud.patchdata = patchdata;
|
||||
|
||||
res = rjson_parse_quick(json, &ud, CHEEVOS_RJSON_OPTIONS,
|
||||
rcheevos_read_key,
|
||||
rcheevos_read_string,
|
||||
rcheevos_read_number,
|
||||
NULL, rcheevos_read_end_object,
|
||||
NULL, rcheevos_read_end_array,
|
||||
NULL, NULL, NULL);
|
||||
|
||||
CHEEVOS_FREE(ud.cheevo.title);
|
||||
CHEEVOS_FREE(ud.cheevo.description);
|
||||
CHEEVOS_FREE(ud.cheevo.badge);
|
||||
CHEEVOS_FREE(ud.cheevo.memaddr);
|
||||
CHEEVOS_FREE(ud.lboard.title);
|
||||
CHEEVOS_FREE(ud.lboard.description);
|
||||
CHEEVOS_FREE(ud.lboard.mem);
|
||||
CHEEVOS_FREE(ud.lboard_format);
|
||||
|
||||
if (!res)
|
||||
if (jsonsax_parse(json, &handlers, (void*)&ud) != JSONSAX_OK)
|
||||
{
|
||||
rcheevos_free_patchdata(patchdata);
|
||||
return -1;
|
||||
@@ -592,6 +684,7 @@ void rcheevos_free_patchdata(rcheevos_rapatchdata_t* patchdata)
|
||||
{
|
||||
CHEEVOS_FREE(lboard->title);
|
||||
CHEEVOS_FREE(lboard->description);
|
||||
CHEEVOS_FREE(lboard->format);
|
||||
CHEEVOS_FREE(lboard->mem);
|
||||
}
|
||||
|
||||
@@ -606,8 +699,6 @@ void rcheevos_free_patchdata(rcheevos_rapatchdata_t* patchdata)
|
||||
patchdata->core = NULL;
|
||||
patchdata->unofficial = NULL;
|
||||
patchdata->lboards = NULL;
|
||||
patchdata->title = NULL;
|
||||
patchdata->richpresence_script = NULL;
|
||||
patchdata->core_count = 0;
|
||||
patchdata->unofficial_count = 0;
|
||||
patchdata->lboard_count = 0;
|
||||
@@ -624,23 +715,15 @@ typedef struct
|
||||
void* userdata;
|
||||
} rcheevos_deactivate_t;
|
||||
|
||||
static bool rcheevos_deactivate_elements_begin(void* userdata)
|
||||
static int rcheevos_deactivate_index(void* userdata, unsigned int index)
|
||||
{
|
||||
rcheevos_deactivate_t* ud = (rcheevos_deactivate_t*)userdata;
|
||||
|
||||
ud->is_element = 1;
|
||||
return true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool rcheevos_deactivate_elements_stop(void* userdata)
|
||||
{
|
||||
rcheevos_deactivate_t* ud = (rcheevos_deactivate_t*)userdata;
|
||||
|
||||
ud->is_element = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool rcheevos_deactivate_number(void* userdata,
|
||||
static int rcheevos_deactivate_number(void* userdata,
|
||||
const char* number, size_t length)
|
||||
{
|
||||
rcheevos_deactivate_t* ud = (rcheevos_deactivate_t*)userdata;
|
||||
@@ -648,30 +731,40 @@ static bool rcheevos_deactivate_number(void* userdata,
|
||||
|
||||
if (ud->is_element)
|
||||
{
|
||||
ud->is_element = 0;
|
||||
id = (unsigned)strtol(number, NULL, 10);
|
||||
|
||||
ud->unlock_cb(id, ud->userdata);
|
||||
}
|
||||
|
||||
return true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void rcheevos_deactivate_unlocks(const char* json, rcheevos_unlock_cb_t unlock_cb, void* userdata)
|
||||
{
|
||||
static const jsonsax_handlers_t handlers =
|
||||
{
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
rcheevos_deactivate_index,
|
||||
NULL,
|
||||
rcheevos_deactivate_number,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
rcheevos_deactivate_t ud;
|
||||
|
||||
ud.is_element = 0;
|
||||
ud.unlock_cb = unlock_cb;
|
||||
ud.userdata = userdata;
|
||||
|
||||
rjson_parse_quick(json, &ud, CHEEVOS_RJSON_OPTIONS,
|
||||
NULL, NULL,
|
||||
rcheevos_deactivate_number,
|
||||
rcheevos_deactivate_elements_stop,
|
||||
rcheevos_deactivate_elements_stop,
|
||||
rcheevos_deactivate_elements_begin,
|
||||
rcheevos_deactivate_elements_stop,
|
||||
NULL, NULL, NULL);
|
||||
jsonsax_parse(json, &handlers, (void*)&ud);
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
@@ -24,36 +24,33 @@
|
||||
|
||||
RETRO_BEGIN_DECLS
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
const char* title;
|
||||
const char* description;
|
||||
const char* badge;
|
||||
const char* memaddr;
|
||||
unsigned points;
|
||||
unsigned id;
|
||||
unsigned active;
|
||||
} rcheevos_racheevo_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
const char* title;
|
||||
const char* description;
|
||||
const char* format;
|
||||
const char* mem;
|
||||
unsigned id;
|
||||
unsigned format;
|
||||
} rcheevos_ralboard_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
unsigned game_id;
|
||||
unsigned console_id;
|
||||
char* title;
|
||||
|
||||
rcheevos_racheevo_t* core;
|
||||
rcheevos_racheevo_t* unofficial;
|
||||
rcheevos_ralboard_t* lboards;
|
||||
char* richpresence_script;
|
||||
|
||||
unsigned game_id;
|
||||
unsigned console_id;
|
||||
unsigned core_count;
|
||||
unsigned unofficial_count;
|
||||
unsigned lboard_count;
|
||||
@@ -32,7 +32,7 @@ End of setup
|
||||
*****************************************************************************/
|
||||
|
||||
#define RCHEEVOS_TAG "[RCHEEVOS]: "
|
||||
#define CHEEVOS_FREE(p) do { void* q = (void*)p; if (q) free(q); } while (0)
|
||||
#define CHEEVOS_FREE(p) do { void* q = (void*)p; if (q != NULL) free(q); } while (0)
|
||||
|
||||
#ifdef CHEEVOS_VERBOSE
|
||||
|
||||
-3017
File diff suppressed because it is too large.
Load diff
@@ -1,352 +0,0 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2015-2016 - Andre Leiradella
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "cheevos_memory.h"
|
||||
|
||||
#include "util.h"
|
||||
|
||||
#include "../retroarch.h"
|
||||
#include "../verbosity.h"
|
||||
|
||||
#include "../deps/rcheevos/include/rcheevos.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
uint8_t* rcheevos_memory_find(
|
||||
const rcheevos_memory_regions_t* regions, unsigned address)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < regions->count; ++i)
|
||||
{
|
||||
const size_t size = regions->size[i];
|
||||
if (address < size)
|
||||
{
|
||||
if (regions->data[i] == NULL)
|
||||
break;
|
||||
|
||||
return ®ions->data[i][address];
|
||||
}
|
||||
|
||||
address -= size;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static const char* rcheevos_memory_type(int type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case RC_MEMORY_TYPE_SAVE_RAM:
|
||||
return "SRAM";
|
||||
case RC_MEMORY_TYPE_VIDEO_RAM:
|
||||
return "VRAM";
|
||||
case RC_MEMORY_TYPE_UNUSED:
|
||||
return "UNUSED";
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return "SYSTEM RAM";
|
||||
}
|
||||
|
||||
static void rcheevos_memory_register_region(rcheevos_memory_regions_t* regions,
|
||||
int type, uint8_t* data, size_t size, const char* description)
|
||||
{
|
||||
if (size == 0)
|
||||
return;
|
||||
|
||||
if (regions->count == MAX_MEMORY_REGIONS)
|
||||
{
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "Too many memory memory regions to register\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!data && regions->count > 0 && !regions->data[regions->count - 1])
|
||||
{
|
||||
/* extend null region */
|
||||
regions->size[regions->count - 1] += size;
|
||||
}
|
||||
else if (data && regions->count > 0 &&
|
||||
data == (regions->data[regions->count - 1] + regions->size[regions->count - 1]))
|
||||
{
|
||||
/* extend non-null region */
|
||||
regions->size[regions->count - 1] += size;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* create new region */
|
||||
regions->data[regions->count] = data;
|
||||
regions->size[regions->count] = size;
|
||||
++regions->count;
|
||||
}
|
||||
|
||||
regions->total_size += size;
|
||||
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "Registered 0x%04X bytes of %s at $%06X (%s)\n", (unsigned)size,
|
||||
rcheevos_memory_type(type), (unsigned)(regions->total_size - size), description);
|
||||
}
|
||||
|
||||
static void rcheevos_memory_init_without_regions(
|
||||
rcheevos_memory_regions_t* regions)
|
||||
{
|
||||
/* no regions specified, assume system RAM followed by save RAM */
|
||||
char description[64];
|
||||
retro_ctx_memory_info_t meminfo;
|
||||
|
||||
snprintf(description, sizeof(description), "offset 0x%06x", 0);
|
||||
|
||||
meminfo.id = RETRO_MEMORY_SYSTEM_RAM;
|
||||
core_get_memory(&meminfo);
|
||||
rcheevos_memory_register_region(regions, RC_MEMORY_TYPE_SYSTEM_RAM, (uint8_t*)meminfo.data, meminfo.size, description);
|
||||
|
||||
meminfo.id = RETRO_MEMORY_SAVE_RAM;
|
||||
core_get_memory(&meminfo);
|
||||
rcheevos_memory_register_region(regions, RC_MEMORY_TYPE_SAVE_RAM, (uint8_t*)meminfo.data, meminfo.size, description);
|
||||
}
|
||||
|
||||
static const rarch_memory_descriptor_t* rcheevos_memory_get_descriptor(const rarch_memory_map_t* mmap, unsigned real_address)
|
||||
{
|
||||
const rarch_memory_descriptor_t* desc = mmap->descriptors;
|
||||
const rarch_memory_descriptor_t* end = desc + mmap->num_descriptors;
|
||||
|
||||
if (mmap->num_descriptors == 0)
|
||||
return NULL;
|
||||
|
||||
for (; desc < end; desc++)
|
||||
{
|
||||
if (desc->core.select == 0)
|
||||
{
|
||||
/* if select is 0, attempt to explcitly match the address */
|
||||
if (real_address >= desc->core.start && real_address < desc->core.start + desc->core.len)
|
||||
return desc;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* otherwise, attempt to match the address by matching the select bits */
|
||||
if (((desc->core.start ^ real_address) & desc->core.select) == 0)
|
||||
{
|
||||
/* sanity check - make sure the descriptor is large enough to hold the target address */
|
||||
if (real_address - desc->core.start < desc->core.len)
|
||||
return desc;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void rcheevos_memory_init_from_memory_map(rcheevos_memory_regions_t* regions, const rarch_memory_map_t* mmap, const rc_memory_regions_t* console_regions)
|
||||
{
|
||||
char description[64];
|
||||
unsigned i;
|
||||
uint8_t* region_start;
|
||||
uint8_t* desc_start;
|
||||
size_t desc_size;
|
||||
size_t offset;
|
||||
|
||||
for (i = 0; i < console_regions->num_regions; ++i)
|
||||
{
|
||||
const rc_memory_region_t* console_region = &console_regions->region[i];
|
||||
size_t console_region_size = console_region->end_address - console_region->start_address + 1;
|
||||
unsigned real_address = console_region->real_address;
|
||||
|
||||
while (console_region_size > 0)
|
||||
{
|
||||
const rarch_memory_descriptor_t* desc = rcheevos_memory_get_descriptor(mmap, real_address);
|
||||
if (!desc)
|
||||
{
|
||||
if (console_region->type != RC_MEMORY_TYPE_UNUSED)
|
||||
{
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "Could not map region starting at $%06X\n",
|
||||
real_address - console_region->real_address + console_region->start_address);
|
||||
}
|
||||
|
||||
rcheevos_memory_register_region(regions, console_region->type, NULL, console_region_size, "null filler");
|
||||
break;
|
||||
}
|
||||
|
||||
offset = real_address - desc->core.start;
|
||||
snprintf(description, sizeof(description),
|
||||
"descriptor %u, offset 0x%06X",
|
||||
(int)(desc - mmap->descriptors) + 1, (int)offset);
|
||||
|
||||
if (desc->core.ptr)
|
||||
{
|
||||
desc_start = (uint8_t*)desc->core.ptr + desc->core.offset;
|
||||
region_start = desc_start + offset;
|
||||
}
|
||||
else
|
||||
region_start = NULL;
|
||||
|
||||
desc_size = desc->core.len - offset;
|
||||
|
||||
if (console_region_size > desc_size)
|
||||
{
|
||||
if (desc_size == 0)
|
||||
{
|
||||
if (console_region->type != RC_MEMORY_TYPE_UNUSED)
|
||||
{
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "Could not map region starting at $%06X\n",
|
||||
real_address - console_region->real_address + console_region->start_address);
|
||||
}
|
||||
|
||||
rcheevos_memory_register_region(regions, console_region->type, NULL, console_region_size, "null filler");
|
||||
console_region_size = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
rcheevos_memory_register_region(regions, console_region->type, region_start, desc_size, description);
|
||||
console_region_size -= desc_size;
|
||||
real_address += desc_size;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
rcheevos_memory_register_region(regions, console_region->type, region_start, console_region_size, description);
|
||||
console_region_size = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static unsigned rcheevos_memory_console_region_to_ram_type(int region_type)
|
||||
{
|
||||
switch (region_type)
|
||||
{
|
||||
case RC_MEMORY_TYPE_SAVE_RAM:
|
||||
return RETRO_MEMORY_SAVE_RAM;
|
||||
case RC_MEMORY_TYPE_VIDEO_RAM:
|
||||
return RETRO_MEMORY_VIDEO_RAM;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return RETRO_MEMORY_SYSTEM_RAM;
|
||||
}
|
||||
|
||||
static void rcheevos_memory_init_from_unmapped_memory(rcheevos_memory_regions_t* regions, const rc_memory_regions_t* console_regions, int console)
|
||||
{
|
||||
char description[64];
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < console_regions->num_regions; ++i)
|
||||
{
|
||||
size_t offset;
|
||||
unsigned j;
|
||||
retro_ctx_memory_info_t meminfo;
|
||||
const rc_memory_region_t* console_region = &console_regions->region[i];
|
||||
const size_t console_region_size =
|
||||
console_region->end_address - console_region->start_address + 1;
|
||||
unsigned base_address = 0;
|
||||
|
||||
meminfo.id = rcheevos_memory_console_region_to_ram_type(console_region->type);
|
||||
|
||||
for (j = 0; j <= i; ++j)
|
||||
{
|
||||
const rc_memory_region_t* console_region2 = &console_regions->region[j];
|
||||
if (rcheevos_memory_console_region_to_ram_type(
|
||||
console_region2->type) == meminfo.id)
|
||||
{
|
||||
base_address = console_region2->start_address;
|
||||
break;
|
||||
}
|
||||
}
|
||||
offset = console_region->start_address - base_address;
|
||||
|
||||
core_get_memory(&meminfo);
|
||||
|
||||
if (offset < meminfo.size)
|
||||
{
|
||||
meminfo.size -= offset;
|
||||
|
||||
if (meminfo.data)
|
||||
{
|
||||
snprintf(description, sizeof(description),
|
||||
"offset 0x%06X", (int)offset);
|
||||
meminfo.data = (uint8_t*)meminfo.data + offset;
|
||||
}
|
||||
else
|
||||
snprintf(description, sizeof(description), "null filler");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (console_region->type != RC_MEMORY_TYPE_UNUSED)
|
||||
{
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "Could not map region starting at $%06X\n", console_region->start_address);
|
||||
}
|
||||
|
||||
meminfo.data = NULL;
|
||||
meminfo.size = 0;
|
||||
}
|
||||
|
||||
if (console_region_size > meminfo.size)
|
||||
{
|
||||
/* want more than what is available, take what we can and null fill the rest */
|
||||
rcheevos_memory_register_region(regions, console_region->type, (uint8_t*)meminfo.data, meminfo.size, description);
|
||||
rcheevos_memory_register_region(regions, console_region->type, NULL, console_region_size - meminfo.size, "null filler");
|
||||
}
|
||||
else
|
||||
{
|
||||
/* only take as much as we need */
|
||||
rcheevos_memory_register_region(regions, console_region->type, (uint8_t*)meminfo.data, console_region_size, description);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void rcheevos_memory_destroy(rcheevos_memory_regions_t* regions)
|
||||
{
|
||||
memset(regions, 0, sizeof(*regions));
|
||||
}
|
||||
|
||||
bool rcheevos_memory_init(rcheevos_memory_regions_t* regions, int console)
|
||||
{
|
||||
unsigned i;
|
||||
const rc_memory_regions_t* console_regions = rc_console_memory_regions(console);
|
||||
rcheevos_memory_regions_t new_regions;
|
||||
bool has_valid_region = false;
|
||||
|
||||
if (!regions)
|
||||
return false;
|
||||
|
||||
memset(&new_regions, 0, sizeof(new_regions));
|
||||
|
||||
if (console_regions == NULL || console_regions->num_regions == 0)
|
||||
{
|
||||
rcheevos_memory_init_without_regions(&new_regions);
|
||||
}
|
||||
else
|
||||
{
|
||||
rarch_system_info_t* system = runloop_get_system_info();
|
||||
if (system->mmaps.num_descriptors != 0)
|
||||
rcheevos_memory_init_from_memory_map(&new_regions, &system->mmaps, console_regions);
|
||||
else
|
||||
rcheevos_memory_init_from_unmapped_memory(&new_regions, console_regions, console);
|
||||
}
|
||||
|
||||
/* determine if any valid regions were found */
|
||||
for (i = 0; i < new_regions.count; i++)
|
||||
{
|
||||
if (new_regions.data[i])
|
||||
{
|
||||
has_valid_region = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
memcpy(regions, &new_regions, sizeof(*regions));
|
||||
return has_valid_region;
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<component type="desktop">
|
||||
<id>com.libretro.RetroArch</id>
|
||||
<launchable type="desktop-id">retroarch.desktop</launchable>
|
||||
<metadata_license>CC0-1.0</metadata_license>
|
||||
<name>RetroArch</name>
|
||||
<summary>Frontend for emulators, game engines and media players</summary>
|
||||
<description>
|
||||
<p>
|
||||
RetroArch is an open source and cross platform frontend/framework for emulators, game engines, video games, media players and other applications.
|
||||
</p>
|
||||
<p>
|
||||
While it can do many things besides this, it is most widely known for enabling you to run classic games on a wide range of computers and consoles through a slick graphical interface. Settings are also unified so configuration is done once and for all.
|
||||
</p>
|
||||
<p>
|
||||
In addition to this, you will soon be able to run original game discs (CDs) from RetroArch. We take videogame preservation seriously and want to ensure you can run your originally bought content on modern day PCs.
|
||||
</p>
|
||||
<p>
|
||||
RetroArch has advanced features like shaders, netplay, rewinding, next-frame response times, runahead, and more!
|
||||
</p>
|
||||
</description>
|
||||
<url type="homepage">https://www.retroarch.com/</url>
|
||||
<url type="bugtracker">https://github.com/libretro/RetroArch/issues</url>
|
||||
<url type="donation">https://www.retroarch.com/index.php?page=donate</url>
|
||||
<releases>
|
||||
<release version="1.9.0"/>
|
||||
</releases>
|
||||
<project_group>Libretro</project_group>
|
||||
<project_license>GPL-3.0</project_license>
|
||||
<developer_name>Libretro</developer_name>
|
||||
<screenshots>
|
||||
<screenshot type="default">
|
||||
<image>https://www.retroarch.com/images/xmb-tabs.png</image>
|
||||
</screenshot>
|
||||
<screenshot type="default">
|
||||
<image>https://www.retroarch.com/images/xmb-updater.png</image>
|
||||
</screenshot>
|
||||
<screenshot type="default">
|
||||
<image>https://www.retroarch.com/images/xmb-osk.png</image>
|
||||
</screenshot>
|
||||
<screenshot type="default">
|
||||
<image>https://www.retroarch.com/images/xmb-playlists.png</image>
|
||||
</screenshot>
|
||||
<screenshot type="default">
|
||||
<image>https://www.retroarch.com/images/xmb-metadata.png</image>
|
||||
</screenshot>
|
||||
</screenshots>
|
||||
</component>
|
||||
@@ -1,534 +0,0 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2017 - Daniel De Matteis
|
||||
* Copyright (C) 2021 - David G.F.
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
#ifdef HAVE_NETWORKING
|
||||
#include <net/net_compat.h>
|
||||
#include <net/net_socket.h>
|
||||
#endif
|
||||
#include <streams/stdin_stream.h>
|
||||
#include <string/stdstring.h>
|
||||
|
||||
#include "verbosity.h"
|
||||
#include "command.h"
|
||||
|
||||
#define CMD_BUF_SIZE 4096
|
||||
|
||||
#if defined(HAVE_COMMAND)
|
||||
|
||||
/* Generic command parse utilities */
|
||||
|
||||
static bool command_get_arg(const char *tok,
|
||||
const char **arg, unsigned *index)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(map); i++)
|
||||
{
|
||||
if (string_is_equal(tok, map[i].str))
|
||||
{
|
||||
if (arg)
|
||||
*arg = NULL;
|
||||
|
||||
if (index)
|
||||
*index = i;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(action_map); i++)
|
||||
{
|
||||
const char *str = strstr(tok, action_map[i].str);
|
||||
if (str == tok)
|
||||
{
|
||||
const char *argument = str + strlen(action_map[i].str);
|
||||
if (*argument != ' ' && *argument != '\0')
|
||||
return false;
|
||||
|
||||
if (arg)
|
||||
*arg = argument + 1;
|
||||
|
||||
if (index)
|
||||
*index = i;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static void command_parse_sub_msg(command_t *handle, const char *tok)
|
||||
{
|
||||
const char *arg = NULL;
|
||||
unsigned index = 0;
|
||||
|
||||
if (command_get_arg(tok, &arg, &index))
|
||||
{
|
||||
if (arg)
|
||||
{
|
||||
if (!action_map[index].action(handle, arg))
|
||||
RARCH_ERR("Command \"%s\" failed.\n", arg);
|
||||
}
|
||||
else
|
||||
handle->state[map[index].id] = true;
|
||||
}
|
||||
else
|
||||
RARCH_WARN("%s \"%s\" %s.\n",
|
||||
msg_hash_to_str(MSG_UNRECOGNIZED_COMMAND),
|
||||
tok,
|
||||
msg_hash_to_str(MSG_RECEIVED));
|
||||
}
|
||||
|
||||
static void command_parse_msg(
|
||||
command_t *handle, char *buf)
|
||||
{
|
||||
char *save = NULL;
|
||||
const char *tok = strtok_r(buf, "\n", &save);
|
||||
|
||||
while (tok)
|
||||
{
|
||||
command_parse_sub_msg(handle, tok);
|
||||
tok = strtok_r(NULL, "\n", &save);
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(HAVE_NETWORK_CMD)
|
||||
typedef struct
|
||||
{
|
||||
/* Network socket FD */
|
||||
int net_fd;
|
||||
/* Source address for the command received */
|
||||
struct sockaddr_storage cmd_source;
|
||||
/* Size of the previous structure in use */
|
||||
socklen_t cmd_source_len;
|
||||
} command_network_t;
|
||||
|
||||
static void network_command_reply(
|
||||
command_t *cmd,
|
||||
const char * data, size_t len)
|
||||
{
|
||||
command_network_t *netcmd = (command_network_t*)cmd->userptr;
|
||||
/* Respond (fire and forget since it's UDP) */
|
||||
sendto(netcmd->net_fd, data, len, 0,
|
||||
(struct sockaddr*)&netcmd->cmd_source, netcmd->cmd_source_len);
|
||||
}
|
||||
|
||||
static void network_command_free(command_t *handle)
|
||||
{
|
||||
command_network_t *netcmd = (command_network_t*)handle->userptr;
|
||||
|
||||
if (netcmd->net_fd >= 0)
|
||||
socket_close(netcmd->net_fd);
|
||||
|
||||
free(netcmd);
|
||||
free(handle);
|
||||
}
|
||||
|
||||
static void command_network_poll(command_t *handle)
|
||||
{
|
||||
fd_set fds;
|
||||
struct timeval tmp_tv = {0};
|
||||
command_network_t *netcmd = (command_network_t*)handle->userptr;
|
||||
|
||||
if (netcmd->net_fd < 0)
|
||||
return;
|
||||
|
||||
FD_ZERO(&fds);
|
||||
FD_SET(netcmd->net_fd, &fds);
|
||||
|
||||
if (socket_select(netcmd->net_fd + 1, &fds, NULL, NULL, &tmp_tv) <= 0)
|
||||
return;
|
||||
|
||||
if (!FD_ISSET(netcmd->net_fd, &fds))
|
||||
return;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
ssize_t ret;
|
||||
char buf[1024];
|
||||
|
||||
buf[0] = '\0';
|
||||
ret = recvfrom(netcmd->net_fd, buf, sizeof(buf) - 1, 0,
|
||||
(struct sockaddr*)&netcmd->cmd_source,
|
||||
&netcmd->cmd_source_len);
|
||||
|
||||
if (ret <= 0)
|
||||
break;
|
||||
|
||||
buf[ret] = '\0';
|
||||
|
||||
command_parse_msg(handle, buf);
|
||||
}
|
||||
}
|
||||
|
||||
command_t* command_network_new(uint16_t port)
|
||||
{
|
||||
struct addrinfo *res = NULL;
|
||||
command_t *cmd = (command_t*)calloc(1, sizeof(command_t));
|
||||
command_network_t *netcmd = (command_network_t*)calloc(
|
||||
1, sizeof(command_network_t));
|
||||
int fd = socket_init(
|
||||
(void**)&res, port, NULL, SOCKET_TYPE_DATAGRAM);
|
||||
|
||||
RARCH_LOG("%s %hu.\n",
|
||||
msg_hash_to_str(MSG_BRINGING_UP_COMMAND_INTERFACE_ON_PORT),
|
||||
(unsigned short)port);
|
||||
|
||||
if (fd < 0)
|
||||
goto error;
|
||||
|
||||
netcmd->net_fd = fd;
|
||||
cmd->userptr = netcmd;
|
||||
cmd->poll = command_network_poll;
|
||||
cmd->replier = network_command_reply;
|
||||
cmd->destroy = network_command_free;
|
||||
|
||||
if (!socket_nonblock(netcmd->net_fd))
|
||||
goto error;
|
||||
|
||||
if (!socket_bind(netcmd->net_fd, (void*)res))
|
||||
{
|
||||
RARCH_ERR("%s.\n",
|
||||
msg_hash_to_str(MSG_FAILED_TO_BIND_SOCKET));
|
||||
goto error;
|
||||
}
|
||||
|
||||
freeaddrinfo_retro(res);
|
||||
return cmd;
|
||||
|
||||
error:
|
||||
if (res)
|
||||
freeaddrinfo_retro(res);
|
||||
free(netcmd);
|
||||
free(cmd);
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(HAVE_STDIN_CMD)
|
||||
typedef struct
|
||||
{
|
||||
/* Buffer and pointer for stdin reads */
|
||||
size_t stdin_buf_ptr;
|
||||
char stdin_buf[CMD_BUF_SIZE];
|
||||
} command_stdin_t;
|
||||
|
||||
static void stdin_command_reply(
|
||||
command_t *cmd,
|
||||
const char * data, size_t len)
|
||||
{
|
||||
/* Just write to stdout! */
|
||||
fwrite(data, 1, len, stdout);
|
||||
}
|
||||
|
||||
static void stdin_command_free(command_t *handle)
|
||||
{
|
||||
free(handle->userptr);
|
||||
free(handle);
|
||||
}
|
||||
|
||||
static void command_stdin_poll(command_t *handle)
|
||||
{
|
||||
ptrdiff_t msg_len;
|
||||
char *last_newline = NULL;
|
||||
command_stdin_t *stdincmd = (command_stdin_t*)handle->userptr;
|
||||
ssize_t ret = read_stdin(
|
||||
stdincmd->stdin_buf + stdincmd->stdin_buf_ptr,
|
||||
CMD_BUF_SIZE - stdincmd->stdin_buf_ptr - 1);
|
||||
|
||||
if (ret == 0)
|
||||
return;
|
||||
|
||||
stdincmd->stdin_buf_ptr += ret;
|
||||
stdincmd->stdin_buf[stdincmd->stdin_buf_ptr] = '\0';
|
||||
|
||||
last_newline = strrchr(stdincmd->stdin_buf, '\n');
|
||||
|
||||
if (!last_newline)
|
||||
{
|
||||
/* We're receiving bogus data in pipe
|
||||
* (no terminating newline), flush out the buffer. */
|
||||
if (stdincmd->stdin_buf_ptr + 1 >= CMD_BUF_SIZE)
|
||||
{
|
||||
stdincmd->stdin_buf_ptr = 0;
|
||||
stdincmd->stdin_buf[0] = '\0';
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
*last_newline++ = '\0';
|
||||
msg_len = last_newline - stdincmd->stdin_buf;
|
||||
|
||||
command_parse_msg(handle, stdincmd->stdin_buf);
|
||||
|
||||
memmove(stdincmd->stdin_buf, last_newline,
|
||||
stdincmd->stdin_buf_ptr - msg_len);
|
||||
stdincmd->stdin_buf_ptr -= msg_len;
|
||||
}
|
||||
|
||||
command_t* command_stdin_new(void)
|
||||
{
|
||||
command_t *cmd;
|
||||
command_stdin_t *stdincmd;
|
||||
|
||||
#ifndef _WIN32
|
||||
#ifdef HAVE_NETWORKING
|
||||
if (!socket_nonblock(STDIN_FILENO))
|
||||
return NULL;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
cmd = (command_t*)calloc(1, sizeof(command_t));
|
||||
stdincmd = (command_stdin_t*)calloc(1, sizeof(command_stdin_t));
|
||||
cmd->userptr = stdincmd;
|
||||
cmd->poll = command_stdin_poll;
|
||||
cmd->replier = stdin_command_reply;
|
||||
cmd->destroy = stdin_command_free;
|
||||
|
||||
return cmd;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_LAKKA)
|
||||
#include <sys/un.h>
|
||||
#define MAX_USER_CONNECTIONS 4
|
||||
typedef struct
|
||||
{
|
||||
/* File descriptor for the domain socket */
|
||||
int sfd;
|
||||
/* Client sockets */
|
||||
int userfd[MAX_USER_CONNECTIONS];
|
||||
/* Last received user socket */
|
||||
int last_fd;
|
||||
} command_uds_t;
|
||||
|
||||
static void uds_command_reply(
|
||||
command_t *cmd,
|
||||
const char * data, size_t len)
|
||||
{
|
||||
command_uds_t *subcmd = (command_uds_t*)cmd->userptr;
|
||||
write(subcmd->last_fd, data, len);
|
||||
}
|
||||
|
||||
static void uds_command_free(command_t *handle)
|
||||
{
|
||||
int i;
|
||||
command_uds_t *udscmd = (command_uds_t*)handle->userptr;
|
||||
|
||||
for (i = 0; i < MAX_USER_CONNECTIONS; i++)
|
||||
if (udscmd->userfd[i] >= 0)
|
||||
socket_close(udscmd->userfd[i]);
|
||||
socket_close(udscmd->sfd);
|
||||
|
||||
free(handle->userptr);
|
||||
free(handle);
|
||||
}
|
||||
|
||||
static void command_uds_poll(command_t *handle)
|
||||
{
|
||||
int i;
|
||||
fd_set fds;
|
||||
command_uds_t *udscmd = (command_uds_t*)handle->userptr;
|
||||
int maxfd = udscmd->sfd;
|
||||
struct timeval tmp_tv = {0};
|
||||
|
||||
if (udscmd->sfd < 0)
|
||||
return;
|
||||
|
||||
FD_ZERO(&fds);
|
||||
FD_SET(udscmd->sfd, &fds);
|
||||
|
||||
for (i = 0; i < MAX_USER_CONNECTIONS; i++)
|
||||
{
|
||||
if (udscmd->userfd[i] >= 0)
|
||||
{
|
||||
maxfd = MAX(udscmd->userfd[i], maxfd);
|
||||
FD_SET(udscmd->userfd[i], &fds);
|
||||
}
|
||||
}
|
||||
|
||||
if (socket_select(maxfd + 1, &fds, NULL, NULL, &tmp_tv) <= 0)
|
||||
return;
|
||||
|
||||
/* Read data from clients and process commands */
|
||||
for (i = 0; i < MAX_USER_CONNECTIONS; i++)
|
||||
{
|
||||
if (udscmd->userfd[i] >= 0 && FD_ISSET(udscmd->userfd[i], &fds))
|
||||
{
|
||||
while (1)
|
||||
{
|
||||
char buf[2048];
|
||||
ssize_t ret = recv(udscmd->userfd[i], buf, sizeof(buf) - 1, 0);
|
||||
|
||||
if (ret < 0)
|
||||
break; /* no more data */
|
||||
if (!ret)
|
||||
{
|
||||
socket_close(udscmd->userfd[i]);
|
||||
udscmd->userfd[i] = -1;
|
||||
break;
|
||||
}
|
||||
|
||||
buf[ret] = 0;
|
||||
udscmd->last_fd = udscmd->userfd[i];
|
||||
command_parse_msg(handle, buf);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (FD_ISSET(udscmd->sfd, &fds))
|
||||
{
|
||||
/* Accepts new connections from clients */
|
||||
int cfd = accept(udscmd->sfd, NULL, NULL);
|
||||
if (cfd >= 0) {
|
||||
if (!socket_nonblock(cfd))
|
||||
socket_close(cfd);
|
||||
else {
|
||||
for (i = 0; i < MAX_USER_CONNECTIONS; i++)
|
||||
if (udscmd->userfd[i] < 0)
|
||||
{
|
||||
udscmd->userfd[i] = cfd;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
command_t* command_uds_new(void)
|
||||
{
|
||||
int i;
|
||||
command_t *cmd;
|
||||
command_uds_t *subcmd;
|
||||
struct sockaddr_un addr;
|
||||
const char *sp = "retroarch/cmd";
|
||||
socklen_t addrsz = offsetof(struct sockaddr_un, sun_path) + strlen(sp) + 1;
|
||||
int fd = socket(AF_UNIX, SOCK_STREAM, 0);
|
||||
if (fd < 0)
|
||||
return NULL;
|
||||
|
||||
/* use an abstract socket for simplicity */
|
||||
memset(&addr, 0, sizeof(addr));
|
||||
addr.sun_family = AF_UNIX;
|
||||
strcpy(&addr.sun_path[1], sp);
|
||||
|
||||
if (bind(fd, (struct sockaddr*)&addr, addrsz) < 0 ||
|
||||
listen(fd, MAX_USER_CONNECTIONS) < 0)
|
||||
{
|
||||
socket_close(fd);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!socket_nonblock(fd))
|
||||
{
|
||||
socket_close(fd);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
cmd = (command_t*)calloc(1, sizeof(command_t));
|
||||
subcmd = (command_uds_t*)calloc(1, sizeof(command_uds_t));
|
||||
subcmd->sfd = fd;
|
||||
subcmd->last_fd = -1;
|
||||
for (i = 0; i < MAX_USER_CONNECTIONS; i++)
|
||||
subcmd->userfd[i] = -1;
|
||||
|
||||
cmd->userptr = subcmd;
|
||||
cmd->poll = command_uds_poll;
|
||||
cmd->replier = uds_command_reply;
|
||||
cmd->destroy = uds_command_free;
|
||||
|
||||
return cmd;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/* Routines used to invoke retroarch command ... */
|
||||
|
||||
#ifdef HAVE_NETWORK_CMD
|
||||
static bool command_verify(const char *cmd)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
if (command_get_arg(cmd, NULL, NULL))
|
||||
return true;
|
||||
|
||||
RARCH_ERR("Command \"%s\" is not recognized by the program.\n", cmd);
|
||||
RARCH_ERR("\tValid commands:\n");
|
||||
for (i = 0; i < ARRAY_SIZE(map); i++)
|
||||
RARCH_ERR("\t\t%s\n", map[i].str);
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(action_map); i++)
|
||||
RARCH_ERR("\t\t%s %s\n", action_map[i].str, action_map[i].arg_desc);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool command_network_send(const char *cmd_)
|
||||
{
|
||||
char *command = NULL;
|
||||
char *save = NULL;
|
||||
const char *cmd = NULL;
|
||||
|
||||
if (!network_init())
|
||||
return false;
|
||||
|
||||
if (!(command = strdup(cmd_)))
|
||||
return false;
|
||||
|
||||
cmd = strtok_r(command, ";", &save);
|
||||
if (cmd)
|
||||
{
|
||||
uint16_t port = DEFAULT_NETWORK_CMD_PORT;
|
||||
const char *port_ = NULL;
|
||||
const char *host = strtok_r(NULL, ";", &save);
|
||||
if (host)
|
||||
port_ = strtok_r(NULL, ";", &save);
|
||||
else
|
||||
{
|
||||
#ifdef _WIN32
|
||||
host = "127.0.0.1";
|
||||
#else
|
||||
host = "localhost";
|
||||
#endif
|
||||
}
|
||||
|
||||
if (port_)
|
||||
port = strtoul(port_, NULL, 0);
|
||||
|
||||
RARCH_LOG("%s: \"%s\" to %s:%hu\n",
|
||||
msg_hash_to_str(MSG_SENDING_COMMAND),
|
||||
cmd, host, (unsigned short)port);
|
||||
|
||||
if (command_verify(cmd) && udp_send_packet(host, port, cmd))
|
||||
{
|
||||
free(command);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
free(command);
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,7 +1,7 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2021 - David G.F.
|
||||
* Copyright (C) 2016-2019 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
@@ -23,45 +23,19 @@
|
||||
#include <boolean.h>
|
||||
#include <retro_common_api.h>
|
||||
|
||||
#include "retroarch.h"
|
||||
#include "input/input_defines.h"
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
RETRO_BEGIN_DECLS
|
||||
|
||||
#define MAX_CMD_DRIVERS 3
|
||||
#define DEFAULT_NETWORK_CMD_PORT 55355
|
||||
typedef struct command command_t;
|
||||
|
||||
struct cmd_map
|
||||
typedef struct command_handle
|
||||
{
|
||||
const char *str;
|
||||
command_t *handle;
|
||||
unsigned id;
|
||||
};
|
||||
|
||||
struct command_handler;
|
||||
|
||||
typedef void (*command_poller_t)(struct command_handler *cmd);
|
||||
typedef void (*command_replier_t)(struct command_handler *cmd, const char * data, size_t len);
|
||||
typedef void (*command_destructor_t)(struct command_handler *cmd);
|
||||
|
||||
struct command_handler
|
||||
{
|
||||
/* Interface to poll the driver */
|
||||
command_poller_t poll;
|
||||
/* Interface to reply */
|
||||
command_replier_t replier;
|
||||
/* Interface to delete the underlying command */
|
||||
command_destructor_t destroy;
|
||||
/* Underlying command storage */
|
||||
void *userptr;
|
||||
/* State received */
|
||||
bool state[RARCH_BIND_LIST_END];
|
||||
};
|
||||
|
||||
typedef struct command_handler command_t;
|
||||
} command_handle_t;
|
||||
|
||||
enum event_command
|
||||
{
|
||||
@@ -74,7 +48,6 @@ enum event_command
|
||||
CMD_EVENT_LOAD_CORE,
|
||||
CMD_EVENT_LOAD_CORE_PERSIST,
|
||||
CMD_EVENT_UNLOAD_CORE,
|
||||
CMD_EVENT_CLOSE_CONTENT,
|
||||
CMD_EVENT_LOAD_STATE,
|
||||
/* Swaps the current state with what's on the undo load buffer */
|
||||
CMD_EVENT_UNDO_LOAD_STATE,
|
||||
@@ -200,6 +173,7 @@ enum event_command
|
||||
CMD_EVENT_AUDIO_REINIT,
|
||||
/* Resizes windowed scale. Will reinitialize video driver. */
|
||||
CMD_EVENT_RESIZE_WINDOWED_SCALE,
|
||||
CMD_EVENT_LOG_FILE_DEINIT,
|
||||
/* Toggles disk eject. */
|
||||
CMD_EVENT_DISK_EJECT_TOGGLE,
|
||||
/* Cycle to next disk. */
|
||||
@@ -229,7 +203,6 @@ enum event_command
|
||||
CMD_EVENT_OSK_TOGGLE,
|
||||
CMD_EVENT_RECORDING_TOGGLE,
|
||||
CMD_EVENT_STREAMING_TOGGLE,
|
||||
CMD_EVENT_RUNAHEAD_TOGGLE,
|
||||
CMD_EVENT_AI_SERVICE_TOGGLE,
|
||||
CMD_EVENT_BSV_RECORDING_TOGGLE,
|
||||
CMD_EVENT_SHADER_NEXT,
|
||||
@@ -238,25 +211,9 @@ enum event_command
|
||||
CMD_EVENT_CHEAT_INDEX_MINUS,
|
||||
CMD_EVENT_CHEAT_TOGGLE,
|
||||
CMD_EVENT_AI_SERVICE_CALL,
|
||||
CMD_EVENT_SAVE_FILES,
|
||||
CMD_EVENT_CONTROLLER_INIT
|
||||
CMD_EVENT_SAVE_FILES
|
||||
};
|
||||
|
||||
typedef struct command_handle
|
||||
{
|
||||
command_t *handle;
|
||||
unsigned id;
|
||||
} command_handle_t;
|
||||
|
||||
enum cmd_source_t
|
||||
{
|
||||
CMD_NONE = 0,
|
||||
CMD_STDIN,
|
||||
CMD_NETWORK
|
||||
};
|
||||
|
||||
struct rarch_state;
|
||||
|
||||
/**
|
||||
* command_event:
|
||||
* @cmd : Command index.
|
||||
@@ -267,107 +224,6 @@ struct rarch_state;
|
||||
**/
|
||||
bool command_event(enum event_command action, void *data);
|
||||
|
||||
/* Constructors for the supported drivers */
|
||||
command_t* command_network_new(uint16_t port);
|
||||
command_t* command_stdin_new(void);
|
||||
command_t* command_uds_new(void);
|
||||
|
||||
bool command_network_send(const char *cmd_);
|
||||
|
||||
/* These forward declarations need to be declared before
|
||||
* the global state is declared */
|
||||
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_SLANG) || defined(HAVE_HLSL)
|
||||
bool command_set_shader(command_t *cmd, const char *arg);
|
||||
#endif
|
||||
#if defined(HAVE_COMMAND)
|
||||
bool command_version(command_t *cmd, const char* arg);
|
||||
bool command_get_status(command_t *cmd, const char* arg);
|
||||
bool command_get_config_param(command_t *cmd, const char* arg);
|
||||
bool command_show_osd_msg(command_t *cmd, const char* arg);
|
||||
#ifdef HAVE_CHEEVOS
|
||||
bool command_read_ram(command_t *cmd, const char *arg);
|
||||
bool command_write_ram(command_t *cmd, const char *arg);
|
||||
#endif
|
||||
bool command_read_memory(command_t *cmd, const char *arg);
|
||||
bool command_write_memory(command_t *cmd, const char *arg);
|
||||
|
||||
struct cmd_action_map
|
||||
{
|
||||
const char *str;
|
||||
bool (*action)(command_t* cmd, const char *arg);
|
||||
const char *arg_desc;
|
||||
};
|
||||
|
||||
static const struct cmd_action_map action_map[] = {
|
||||
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_SLANG) || defined(HAVE_HLSL)
|
||||
{ "SET_SHADER", command_set_shader, "<shader path>" },
|
||||
#endif
|
||||
{ "VERSION", command_version, "No argument"},
|
||||
{ "GET_STATUS", command_get_status, "No argument" },
|
||||
{ "GET_CONFIG_PARAM", command_get_config_param, "<param name>" },
|
||||
{ "SHOW_MSG", command_show_osd_msg, "No argument" },
|
||||
#if defined(HAVE_CHEEVOS)
|
||||
/* These functions use achievement addresses and only work if a game with achievements is
|
||||
* loaded. READ_CORE_MEMORY and WRITE_CORE_MEMORY are preferred and use system addresses. */
|
||||
{ "READ_CORE_RAM", command_read_ram, "<address> <number of bytes>" },
|
||||
{ "WRITE_CORE_RAM", command_write_ram, "<address> <byte1> <byte2> ..." },
|
||||
#endif
|
||||
{ "READ_CORE_MEMORY", command_read_memory, "<address> <number of bytes>" },
|
||||
{ "WRITE_CORE_MEMORY",command_write_memory, "<address> <byte1> <byte2> ..." },
|
||||
};
|
||||
|
||||
static const struct cmd_map map[] = {
|
||||
{ "FAST_FORWARD", RARCH_FAST_FORWARD_KEY },
|
||||
{ "FAST_FORWARD_HOLD", RARCH_FAST_FORWARD_HOLD_KEY },
|
||||
{ "SLOWMOTION", RARCH_SLOWMOTION_KEY },
|
||||
{ "SLOWMOTION_HOLD", RARCH_SLOWMOTION_HOLD_KEY },
|
||||
{ "LOAD_STATE", RARCH_LOAD_STATE_KEY },
|
||||
{ "SAVE_STATE", RARCH_SAVE_STATE_KEY },
|
||||
{ "FULLSCREEN_TOGGLE", RARCH_FULLSCREEN_TOGGLE_KEY },
|
||||
{ "CLOSE_CONTENT", RARCH_CLOSE_CONTENT_KEY },
|
||||
{ "QUIT", RARCH_QUIT_KEY },
|
||||
{ "STATE_SLOT_PLUS", RARCH_STATE_SLOT_PLUS },
|
||||
{ "STATE_SLOT_MINUS", RARCH_STATE_SLOT_MINUS },
|
||||
{ "REWIND", RARCH_REWIND },
|
||||
{ "BSV_RECORD_TOGGLE", RARCH_BSV_RECORD_TOGGLE },
|
||||
{ "PAUSE_TOGGLE", RARCH_PAUSE_TOGGLE },
|
||||
{ "FRAMEADVANCE", RARCH_FRAMEADVANCE },
|
||||
{ "RESET", RARCH_RESET },
|
||||
{ "SHADER_NEXT", RARCH_SHADER_NEXT },
|
||||
{ "SHADER_PREV", RARCH_SHADER_PREV },
|
||||
{ "CHEAT_INDEX_PLUS", RARCH_CHEAT_INDEX_PLUS },
|
||||
{ "CHEAT_INDEX_MINUS", RARCH_CHEAT_INDEX_MINUS },
|
||||
{ "CHEAT_TOGGLE", RARCH_CHEAT_TOGGLE },
|
||||
{ "SCREENSHOT", RARCH_SCREENSHOT },
|
||||
{ "MUTE", RARCH_MUTE },
|
||||
{ "OSK", RARCH_OSK },
|
||||
{ "FPS_TOGGLE", RARCH_FPS_TOGGLE },
|
||||
{ "SEND_DEBUG_INFO", RARCH_SEND_DEBUG_INFO },
|
||||
{ "NETPLAY_HOST_TOGGLE", RARCH_NETPLAY_HOST_TOGGLE },
|
||||
{ "NETPLAY_GAME_WATCH", RARCH_NETPLAY_GAME_WATCH },
|
||||
{ "VOLUME_UP", RARCH_VOLUME_UP },
|
||||
{ "VOLUME_DOWN", RARCH_VOLUME_DOWN },
|
||||
{ "OVERLAY_NEXT", RARCH_OVERLAY_NEXT },
|
||||
{ "DISK_EJECT_TOGGLE", RARCH_DISK_EJECT_TOGGLE },
|
||||
{ "DISK_NEXT", RARCH_DISK_NEXT },
|
||||
{ "DISK_PREV", RARCH_DISK_PREV },
|
||||
{ "GRAB_MOUSE_TOGGLE", RARCH_GRAB_MOUSE_TOGGLE },
|
||||
{ "UI_COMPANION_TOGGLE", RARCH_UI_COMPANION_TOGGLE },
|
||||
{ "GAME_FOCUS_TOGGLE", RARCH_GAME_FOCUS_TOGGLE },
|
||||
{ "MENU_TOGGLE", RARCH_MENU_TOGGLE },
|
||||
{ "RECORDING_TOGGLE", RARCH_RECORDING_TOGGLE },
|
||||
{ "STREAMING_TOGGLE", RARCH_STREAMING_TOGGLE },
|
||||
{ "RUNAHEAD_TOGGLE", RARCH_RUNAHEAD_TOGGLE },
|
||||
{ "MENU_UP", RETRO_DEVICE_ID_JOYPAD_UP },
|
||||
{ "MENU_DOWN", RETRO_DEVICE_ID_JOYPAD_DOWN },
|
||||
{ "MENU_LEFT", RETRO_DEVICE_ID_JOYPAD_LEFT },
|
||||
{ "MENU_RIGHT", RETRO_DEVICE_ID_JOYPAD_RIGHT },
|
||||
{ "MENU_A", RETRO_DEVICE_ID_JOYPAD_A },
|
||||
{ "MENU_B", RETRO_DEVICE_ID_JOYPAD_B },
|
||||
{ "AI_SERVICE", RARCH_AI_SERVICE },
|
||||
};
|
||||
#endif
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
||||
Loaded 100 of 2340 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user