mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-08 17:28:49 -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,28 +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/[email protected]
|
||||
with:
|
||||
java-version: 1.8
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v2
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Crowdin Sync
|
||||
run: |
|
||||
cd intl
|
||||
python3 crowdin_sync.py
|
||||
+1
-4
@@ -8,7 +8,6 @@
|
||||
*.dol
|
||||
*.map
|
||||
*.swp
|
||||
*.cache
|
||||
.tmp
|
||||
.tmp.c
|
||||
.tmp.cxx
|
||||
@@ -77,9 +76,7 @@ convert_rumble.awk
|
||||
*~
|
||||
assets
|
||||
info
|
||||
content_history.lpl
|
||||
content_image_history.lpl
|
||||
content_music_history.lpl
|
||||
saves
|
||||
screenshots
|
||||
|
||||
@@ -177,7 +174,7 @@ retroarch_switch.nso
|
||||
|
||||
# PS2
|
||||
ps2/irx/*.c
|
||||
*.irx
|
||||
ps2/libcdvd/lib/
|
||||
|
||||
# Wayland
|
||||
gfx/common/wayland/idle-inhibit-unstable-v1.c
|
||||
|
||||
-12
@@ -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
|
||||
@@ -140,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"
|
||||
@@ -152,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"
|
||||
|
||||
+1
-232
@@ -1,249 +1,18 @@
|
||||
# Future
|
||||
|
||||
# 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
|
||||
- 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
|
||||
|
||||
@@ -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
|
||||
|
||||
+100
-227
@@ -19,12 +19,6 @@ ifeq ($(HAVE_CXX11), 1)
|
||||
CXXFLAGS += $(CXX11_CFLAGS)
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_SAPI), 1)
|
||||
LIBS += sapi.dll
|
||||
endif
|
||||
|
||||
|
||||
|
||||
ifeq ($(HAVE_GL_CONTEXT),)
|
||||
HAVE_GL_CONTEXT = 0
|
||||
HAVE_GL_MODERN = 0
|
||||
@@ -157,31 +151,10 @@ ifeq ($(TARGET), retroarch_3ds)
|
||||
OBJ += frontend/drivers/platform_ctr.o
|
||||
endif
|
||||
|
||||
# Git Version
|
||||
GIT_VERSION_CACHEDIR = $(if $(OBJDIR),$(OBJDIR),$(CURDIR))
|
||||
GIT_VERSION_CACHEFILE = $(GIT_VERSION_CACHEDIR)/git-version.cache
|
||||
# Git
|
||||
|
||||
ifneq (,$(wildcard .git/index)) # Building inside a Git repository?
|
||||
GIT_VERSION := $(shell git rev-parse --short HEAD 2>/dev/null)
|
||||
endif
|
||||
|
||||
ifneq (,$(wildcard $(GIT_VERSION_CACHEFILE))) # Cached Git version?
|
||||
GIT_VERSION_CACHE = $(shell cat "$(GIT_VERSION_CACHEFILE)" 2>/dev/null)
|
||||
endif
|
||||
|
||||
ifeq ($(GIT_VERSION),)
|
||||
ifneq ($(GIT_VERSION_CACHE),) # If no Git version, use cached if found
|
||||
GIT_VERSION = $(GIT_VERSION_CACHE)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(GIT_VERSION),) # Enable version_git.o?
|
||||
ifneq ($(GIT_VERSION),$(GIT_VERSION_CACHE)) # Update version_git.o?
|
||||
$(shell \
|
||||
mkdir -p "$(GIT_VERSION_CACHEDIR)" && \
|
||||
echo "$(GIT_VERSION)" > "$(GIT_VERSION_CACHEFILE)" && \
|
||||
touch version_git.c)
|
||||
endif
|
||||
GIT_VERSION := $(shell git rev-parse --short HEAD 2>/dev/null)
|
||||
ifneq ($(GIT_VERSION),)
|
||||
DEFINES += -DHAVE_GIT_VERSION -DGIT_VERSION=$(GIT_VERSION)
|
||||
OBJ += version_git.o
|
||||
endif
|
||||
@@ -196,28 +169,16 @@ OBJ += frontend/frontend_driver.o \
|
||||
msg_hash.o \
|
||||
intl/msg_hash_us.o \
|
||||
$(LIBRETRO_COMM_DIR)/queues/task_queue.o \
|
||||
tasks/task_content.o
|
||||
|
||||
ifeq ($(HAVE_PATCH), 1)
|
||||
DEFINES += -DHAVE_PATCH
|
||||
OBJ += tasks/task_patch.o
|
||||
endif
|
||||
|
||||
OBJ += \
|
||||
tasks/task_content.o \
|
||||
tasks/task_patch.o \
|
||||
tasks/task_save.o \
|
||||
tasks/task_file_transfer.o \
|
||||
tasks/task_image.o \
|
||||
tasks/task_playlist_manager.o \
|
||||
tasks/task_manual_content_scan.o \
|
||||
tasks/task_core_backup.o \
|
||||
$(LIBRETRO_COMM_DIR)/encodings/encoding_utf.o \
|
||||
$(LIBRETRO_COMM_DIR)/encodings/encoding_crc32.o
|
||||
|
||||
ifeq ($(HAVE_TRANSLATE), 1)
|
||||
OBJ += $(LIBRETRO_COMM_DIR)/encodings/encoding_base64.o
|
||||
endif
|
||||
|
||||
OBJ += \
|
||||
$(LIBRETRO_COMM_DIR)/encodings/encoding_crc32.o \
|
||||
$(LIBRETRO_COMM_DIR)/encodings/encoding_base64.o \
|
||||
$(LIBRETRO_COMM_DIR)/compat/fopen_utf8.o \
|
||||
$(LIBRETRO_COMM_DIR)/lists/file_list.o \
|
||||
$(LIBRETRO_COMM_DIR)/lists/dir_list.o \
|
||||
@@ -227,9 +188,8 @@ OBJ += \
|
||||
$(LIBRETRO_COMM_DIR)/streams/file_stream_transforms.o \
|
||||
$(LIBRETRO_COMM_DIR)/streams/interface_stream.o \
|
||||
$(LIBRETRO_COMM_DIR)/streams/memory_stream.o \
|
||||
$(LIBRETRO_COMM_DIR)/vfs/vfs_implementation.o
|
||||
|
||||
OBJ += \
|
||||
$(LIBRETRO_COMM_DIR)/vfs/vfs_implementation.o \
|
||||
$(LIBRETRO_COMM_DIR)/media/media_detect_cd.o \
|
||||
$(LIBRETRO_COMM_DIR)/lists/string_list.o \
|
||||
$(LIBRETRO_COMM_DIR)/string/stdstring.o \
|
||||
$(LIBRETRO_COMM_DIR)/memmap/memalign.o \
|
||||
@@ -259,6 +219,7 @@ OBJ += \
|
||||
file_path_str.o \
|
||||
$(LIBRETRO_COMM_DIR)/hash/rhash.o \
|
||||
input/common/input_hid_common.o \
|
||||
input/input_mapper.o \
|
||||
led/led_driver.o \
|
||||
gfx/video_coord_array.o \
|
||||
gfx/video_crt_switch.o \
|
||||
@@ -269,79 +230,45 @@ OBJ += \
|
||||
configuration.o \
|
||||
$(LIBRETRO_COMM_DIR)/dynamic/dylib.o \
|
||||
cores/dynamic_dummy.o \
|
||||
$(LIBRETRO_COMM_DIR)/queues/message_queue.o
|
||||
|
||||
ifeq ($(HAVE_REWIND), 1)
|
||||
DEFINES += -DHAVE_REWIND
|
||||
OBJ += managers/state_manager.o
|
||||
endif
|
||||
|
||||
OBJ += \
|
||||
$(LIBRETRO_COMM_DIR)/queues/message_queue.o \
|
||||
managers/state_manager.o \
|
||||
gfx/drivers_font_renderer/bitmapfont.o \
|
||||
tasks/task_autodetect.o \
|
||||
input/input_autodetect_builtin.o \
|
||||
input/input_keymaps.o \
|
||||
$(LIBRETRO_COMM_DIR)/queues/fifo_queue.o \
|
||||
$(LIBRETRO_COMM_DIR)/compat/compat_fnmatch.o \
|
||||
$(LIBRETRO_COMM_DIR)/compat/compat_posix_string.o
|
||||
|
||||
ifeq ($(HAVE_CHEATS), 1)
|
||||
DEFINES += -DHAVE_CHEATS
|
||||
OBJ += managers/cheat_manager.o
|
||||
endif
|
||||
|
||||
OBJ += \
|
||||
$(LIBRETRO_COMM_DIR)/compat/compat_posix_string.o \
|
||||
managers/cheat_manager.o \
|
||||
core_info.o \
|
||||
core_backup.o \
|
||||
$(LIBRETRO_COMM_DIR)/file/config_file.o \
|
||||
$(LIBRETRO_COMM_DIR)/file/config_file_userdata.o \
|
||||
runtime_file.o \
|
||||
disk_index_file.o
|
||||
|
||||
ifeq ($(HAVE_SCREENSHOTS), 1)
|
||||
DEFINES += -DHAVE_SCREENSHOTS
|
||||
OBJ += tasks/task_screenshot.o
|
||||
endif
|
||||
|
||||
OBJ += \
|
||||
disk_index_file.o \
|
||||
tasks/task_screenshot.o \
|
||||
tasks/task_powerstate.o \
|
||||
$(LIBRETRO_COMM_DIR)/gfx/scaler/scaler.o \
|
||||
$(LIBRETRO_COMM_DIR)/gfx/scaler/pixconv.o \
|
||||
$(LIBRETRO_COMM_DIR)/gfx/scaler/scaler_int.o \
|
||||
$(LIBRETRO_COMM_DIR)/gfx/scaler/scaler_filter.o \
|
||||
gfx/font_driver.o
|
||||
|
||||
ifeq ($(HAVE_VIDEO_FILTER), 1)
|
||||
DEFINES += -DHAVE_VIDEO_FILTER
|
||||
OBJ += gfx/video_filter.o
|
||||
endif
|
||||
|
||||
OBJ += $(LIBRETRO_COMM_DIR)/audio/resampler/audio_resampler.o
|
||||
|
||||
ifeq ($(HAVE_DSP_FILTER), 1)
|
||||
DEFINES += -DHAVE_DSP_FILTER
|
||||
OBJ += $(LIBRETRO_COMM_DIR)/audio/dsp_filter.o
|
||||
endif
|
||||
|
||||
OBJ += $(LIBRETRO_COMM_DIR)/audio/resampler/drivers/sinc_resampler.o
|
||||
|
||||
ifeq ($(HAVE_NEAREST_RESAMPLER), 1)
|
||||
DEFINES += -DHAVE_NEAREST_RESAMPLER
|
||||
OBJ += $(LIBRETRO_COMM_DIR)/audio/resampler/drivers/nearest_resampler.o
|
||||
endif
|
||||
|
||||
OBJ += \
|
||||
gfx/font_driver.o \
|
||||
gfx/video_filter.o \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/audio_resampler.o \
|
||||
$(LIBRETRO_COMM_DIR)/audio/dsp_filter.o \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/drivers/sinc_resampler.o \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/drivers/nearest_resampler.o \
|
||||
$(LIBRETRO_COMM_DIR)/utils/md5.o \
|
||||
playlist.o \
|
||||
$(LIBRETRO_COMM_DIR)/features/features_cpu.o \
|
||||
performance_counters.o \
|
||||
verbosity.o \
|
||||
$(LIBRETRO_COMM_DIR)/playlists/label_sanitization.o \
|
||||
$(LIBRETRO_COMM_DIR)/time/rtime.o \
|
||||
manual_content_scan.o \
|
||||
disk_control_interface.o
|
||||
|
||||
ifeq ($(HAVE_CONFIGFILE), 1)
|
||||
DEFINES += -DHAVE_CONFIGFILE
|
||||
OBJ += input/input_remapping.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_BLISSBOX), 1)
|
||||
@@ -356,10 +283,6 @@ ifeq ($(HAVE_AUDIOMIXER), 1)
|
||||
$(LIBRETRO_COMM_DIR)/audio/audio_mixer.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_BSV_MOVIE), 1)
|
||||
DEFINES += -DHAVE_BSV_MOVIE
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_RUNAHEAD), 1)
|
||||
DEFINES += -DHAVE_RUNAHEAD
|
||||
endif
|
||||
@@ -394,11 +317,7 @@ ifeq ($(HAVE_LANGEXTRA), 1)
|
||||
intl/msg_hash_cht.o \
|
||||
intl/msg_hash_ar.o \
|
||||
intl/msg_hash_el.o \
|
||||
intl/msg_hash_tr.o \
|
||||
intl/msg_hash_sk.o \
|
||||
intl/msg_hash_fa.o \
|
||||
intl/msg_hash_he.o \
|
||||
intl/msg_hash_ast.o
|
||||
intl/msg_hash_tr.o
|
||||
endif
|
||||
|
||||
ifneq ($(HAVE_GETOPT_LONG), 1)
|
||||
@@ -531,10 +450,6 @@ ifeq ($(HAVE_LIBRETRODB), 1)
|
||||
database_info.o \
|
||||
tasks/task_database.o \
|
||||
tasks/task_database_cue.o
|
||||
|
||||
ifeq ($(HAVE_MENU), 1)
|
||||
OBJ += menu/menu_explore.o
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_BUILTINMBEDTLS), 1)
|
||||
@@ -545,8 +460,7 @@ ifeq ($(HAVE_BUILTINMBEDTLS), 1)
|
||||
DEFINES += -DMBEDTLS_SSL_DEBUG_ALL
|
||||
endif
|
||||
|
||||
# MinGW requires this for some reason,
|
||||
# even though the include paths are relative to the source
|
||||
# MinGW requires this for some reason, even though the include paths are relative to the source
|
||||
INCLUDE_DIRS += -Ideps/mbedtls
|
||||
|
||||
OBJS_TLS_CRYPTO = deps/mbedtls/aes.o \
|
||||
@@ -561,20 +475,27 @@ ifeq ($(HAVE_BUILTINMBEDTLS), 1)
|
||||
deps/mbedtls/ccm.o \
|
||||
deps/mbedtls/cipher.o \
|
||||
deps/mbedtls/cipher_wrap.o \
|
||||
deps/mbedtls/cmac.o \
|
||||
deps/mbedtls/ctr_drbg.o \
|
||||
deps/mbedtls/des.o \
|
||||
deps/mbedtls/dhm.o \
|
||||
deps/mbedtls/ecdh.o \
|
||||
deps/mbedtls/ecdsa.o \
|
||||
deps/mbedtls/ecjpake.o \
|
||||
deps/mbedtls/ecp.o \
|
||||
deps/mbedtls/ecp_curves.o \
|
||||
deps/mbedtls/entropy.o \
|
||||
deps/mbedtls/entropy_poll.o \
|
||||
deps/mbedtls/error.o \
|
||||
deps/mbedtls/gcm.o \
|
||||
deps/mbedtls/havege.o \
|
||||
deps/mbedtls/hmac_drbg.o \
|
||||
deps/mbedtls/md.o \
|
||||
deps/mbedtls/md2.o \
|
||||
deps/mbedtls/md4.o \
|
||||
deps/mbedtls/md5.o \
|
||||
deps/mbedtls/md_wrap.o \
|
||||
deps/mbedtls/memory_buffer_alloc.o \
|
||||
deps/mbedtls/oid.o \
|
||||
deps/mbedtls/padlock.o \
|
||||
deps/mbedtls/pem.o \
|
||||
@@ -584,6 +505,7 @@ ifeq ($(HAVE_BUILTINMBEDTLS), 1)
|
||||
deps/mbedtls/pkcs5.o \
|
||||
deps/mbedtls/pkparse.o \
|
||||
deps/mbedtls/pkwrite.o \
|
||||
deps/mbedtls/platform.o \
|
||||
deps/mbedtls/ripemd160.o \
|
||||
deps/mbedtls/rsa.o \
|
||||
deps/mbedtls/sha1.o \
|
||||
@@ -591,9 +513,12 @@ ifeq ($(HAVE_BUILTINMBEDTLS), 1)
|
||||
deps/mbedtls/sha512.o \
|
||||
deps/mbedtls/threading.o \
|
||||
deps/mbedtls/timing.o \
|
||||
deps/mbedtls/version.o \
|
||||
deps/mbedtls/version_features.o \
|
||||
deps/mbedtls/xtea.o
|
||||
|
||||
OBJS_TLS_X509 = deps/mbedtls/certs.o \
|
||||
deps/mbedtls/pkcs11.o \
|
||||
deps/mbedtls/x509.o \
|
||||
deps/mbedtls/x509_create.o \
|
||||
deps/mbedtls/x509_crl.o \
|
||||
@@ -632,16 +557,6 @@ ifeq ($(HAVE_EMSCRIPTEN), 1)
|
||||
camera/drivers/rwebcam.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_BLUETOOTH), 1)
|
||||
OBJ += bluetooth/drivers/bluetoothctl.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_BLUETOOTH), 1)
|
||||
ifeq ($(HAVE_DBUS), 1)
|
||||
OBJ += bluetooth/drivers/bluez.o
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_LAKKA), 1)
|
||||
OBJ += wifi/drivers/connmanctl.o
|
||||
endif
|
||||
@@ -794,11 +709,8 @@ ifeq ($(HAVE_NEON),1)
|
||||
endif
|
||||
|
||||
OBJ += $(LIBRETRO_COMM_DIR)/audio/conversion/s16_to_float.o \
|
||||
$(LIBRETRO_COMM_DIR)/audio/conversion/float_to_s16.o
|
||||
|
||||
ifeq ($(HAVE_RWAV), 1)
|
||||
OBJ += $(LIBRETRO_COMM_DIR)/formats/wav/rwav.o
|
||||
endif
|
||||
$(LIBRETRO_COMM_DIR)/audio/conversion/float_to_s16.o \
|
||||
$(LIBRETRO_COMM_DIR)/formats/wav/rwav.o
|
||||
|
||||
ifeq ($(HAVE_NEON),1)
|
||||
OBJ += $(LIBRETRO_COMM_DIR)/audio/conversion/s16_to_float_neon.o \
|
||||
@@ -887,10 +799,6 @@ ifeq ($(HAVE_MENU), 1)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_BLUETOOTH), 1)
|
||||
DEFINES += -DHAVE_BLUETOOTH
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_LAKKA), 1)
|
||||
DEFINES += -DHAVE_LAKKA
|
||||
endif
|
||||
@@ -899,8 +807,18 @@ ifeq ($(HAVE_LAKKA_SWITCH), 1)
|
||||
DEFINES += -DHAVE_LAKKA_SWITCH
|
||||
endif
|
||||
|
||||
# Does not depend on HAVE_MENU
|
||||
ifeq ($(HAVE_SHADERS_COMMON), 1)
|
||||
OBJ += menu/menu_shader.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_MENU_COMMON), 1)
|
||||
OBJ += menu/menu_setting.o \
|
||||
OBJ += menu/menu_driver.o \
|
||||
menu/menu_setting.o \
|
||||
menu/widgets/menu_filebrowser.o \
|
||||
menu/widgets/menu_dialog.o \
|
||||
menu/widgets/menu_input_bind_dialog.o \
|
||||
menu/menu_cbs.o \
|
||||
menu/cbs/menu_cbs_ok.o \
|
||||
menu/cbs/menu_cbs_cancel.o \
|
||||
menu/cbs/menu_cbs_select.o \
|
||||
@@ -921,22 +839,14 @@ ifeq ($(HAVE_MENU_COMMON), 1)
|
||||
menu/menu_displaylist.o
|
||||
endif
|
||||
|
||||
OBJ += input/input_osk.o
|
||||
|
||||
ifeq ($(HAVE_GFX_WIDGETS), 1)
|
||||
OBJ += gfx/gfx_widgets.o
|
||||
|
||||
ifeq ($(HAVE_SCREENSHOTS), 1)
|
||||
OBJ += gfx/widgets/gfx_widget_screenshot.o
|
||||
endif
|
||||
|
||||
OBJ += \
|
||||
OBJ += gfx/gfx_widgets.o \
|
||||
gfx/widgets/gfx_widget_screenshot.o \
|
||||
gfx/widgets/gfx_widget_volume.o \
|
||||
gfx/widgets/gfx_widget_generic_message.o \
|
||||
gfx/widgets/gfx_widget_libretro_message.o \
|
||||
gfx/widgets/gfx_widget_progress_message.o \
|
||||
gfx/widgets/gfx_widget_load_content_animation.o
|
||||
ifeq ($(HAVE_CHEEVOS), 1)
|
||||
OBJ += gfx/widgets/gfx_widget_achievement_popup.o
|
||||
endif
|
||||
gfx/widgets/gfx_widget_libretro_message.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_OVERLAY), 1)
|
||||
@@ -1078,17 +988,11 @@ endif
|
||||
|
||||
ifeq ($(HAVE_WAYLAND), 1)
|
||||
OBJ += gfx/drivers_context/wayland_ctx.o \
|
||||
input/common/wayland_common.o \
|
||||
input/drivers/wayland_input.o \
|
||||
gfx/common/wayland/xdg-shell.o \
|
||||
gfx/common/wayland/xdg-shell-unstable-v6.o \
|
||||
gfx/common/wayland/idle-inhibit-unstable-v1.o \
|
||||
gfx/common/wayland/xdg-decoration-unstable-v1.o
|
||||
|
||||
ifeq ($(HAVE_VULKAN), 1)
|
||||
OBJ += gfx/drivers_context/wayland_vk_ctx.o
|
||||
endif
|
||||
|
||||
DEF_FLAGS += $(WAYLAND_CFLAGS) $(WAYLAND_CURSOR_CFLAGS)
|
||||
LIBS += $(WAYLAND_LIBS) $(WAYLAND_CURSOR_LIBS)
|
||||
|
||||
@@ -1106,22 +1010,13 @@ ifeq ($(HAVE_DINPUT), 1)
|
||||
HAVE_DX_COMMON = 1
|
||||
LIBS += -ldinput8 -lole32
|
||||
DEFINES += -DHAVE_DINPUT
|
||||
OBJ += input/drivers/dinput.o
|
||||
|
||||
ifeq ($(HAVE_XINPUT), 1)
|
||||
OBJ += input/drivers_joypad/dinput_hybrid_joypad.o
|
||||
else
|
||||
OBJ += input/drivers_joypad/dinput_joypad.o
|
||||
endif
|
||||
OBJ += input/drivers/dinput.o \
|
||||
input/drivers_joypad/dinput_joypad.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_XINPUT), 1)
|
||||
DEFINES += -DHAVE_XINPUT
|
||||
ifeq ($(HAVE_DINPUT), 1)
|
||||
OBJ += input/drivers_joypad/xinput_hybrid_joypad.o
|
||||
else
|
||||
OBJ += input/drivers_joypad/xinput_joypad.o
|
||||
endif
|
||||
OBJ += input/drivers_joypad/xinput_joypad.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_OPENDINGUX_FBDEV), 1)
|
||||
@@ -1144,9 +1039,6 @@ ifeq ($(HAVE_X11), 1)
|
||||
ifneq ($(HAVE_OPENGLES), 1)
|
||||
OBJ += gfx/drivers_context/x_ctx.o
|
||||
endif
|
||||
ifeq ($(HAVE_VULKAN), 1)
|
||||
OBJ += gfx/drivers_context/x_vk_ctx.o
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_XCB),1)
|
||||
@@ -1209,10 +1101,7 @@ ifeq ($(HAVE_PARPORT), 1)
|
||||
endif
|
||||
|
||||
ifneq ($(findstring Win32,$(OS)),)
|
||||
ifeq ($(HAVE_WINRAWINPUT), 1)
|
||||
DEFINES += -DHAVE_WINRAWINPUT
|
||||
OBJ += input/drivers/winraw_input.o
|
||||
endif
|
||||
OBJ += input/drivers/winraw_input.o
|
||||
endif
|
||||
|
||||
# Companion UI
|
||||
@@ -1251,8 +1140,8 @@ endif
|
||||
ifeq ($(HAVE_SIXEL), 1)
|
||||
DEFINES += -DHAVE_SIXEL
|
||||
INCLUDE_DIRS += -I/usr/include/sixel
|
||||
OBJ += gfx/drivers/sixel_gfx.o \
|
||||
gfx/drivers_font/sixel_font.o
|
||||
OBJ += gfx/drivers/sixel_gfx.o gfx/drivers_font/sixel_font.o \
|
||||
gfx/drivers_context/sixel_ctx.o
|
||||
LIBS += $(SIXEL_LIBS)
|
||||
DEF_FLAGS += $(SIXEL_CFLAGS)
|
||||
endif
|
||||
@@ -1271,7 +1160,8 @@ ifeq ($(HAVE_NETWORK_VIDEO), 1)
|
||||
endif
|
||||
|
||||
DEFINES += -DHAVE_NETWORK_VIDEO
|
||||
OBJ += gfx/drivers/network_gfx.o
|
||||
OBJ += gfx/drivers/network_gfx.o \
|
||||
gfx/drivers_context/network_ctx.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_PLAIN_DRM), 1)
|
||||
@@ -1655,15 +1545,12 @@ ifeq ($(HAVE_BUILTINGLSLANG), 1)
|
||||
|
||||
GLSLANG_SOURCES := \
|
||||
gfx/drivers_shader/glslang.cpp \
|
||||
$(DEPS_DIR)/glslang/glslang/SPIRV/GlslangToSpv.cpp \
|
||||
$(DEPS_DIR)/glslang/glslang/SPIRV/InReadableOrder.cpp \
|
||||
$(DEPS_DIR)/glslang/glslang/SPIRV/Logger.cpp \
|
||||
$(DEPS_DIR)/glslang/glslang/SPIRV/SpvBuilder.cpp \
|
||||
$(wildcard $(DEPS_DIR)/glslang/glslang/SPIRV/*.cpp) \
|
||||
$(wildcard $(DEPS_DIR)/glslang/glslang/glslang/GenericCodeGen/*.cpp) \
|
||||
$(wildcard $(DEPS_DIR)/glslang/glslang/OGLCompilersDLL/*.cpp) \
|
||||
$(wildcard $(DEPS_DIR)/glslang/glslang/glslang/MachineIndependent/*.cpp) \
|
||||
$(wildcard $(DEPS_DIR)/glslang/glslang/glslang/MachineIndependent/preprocessor/*.cpp) \
|
||||
$(DEPS_DIR)/glslang/glslang/glslang/OSDependent/$(GLSLANG_PLATFORM)/ossource.cpp
|
||||
$(wildcard $(DEPS_DIR)/glslang/glslang/glslang/OSDependent/$(GLSLANG_PLATFORM)/*.cpp)
|
||||
|
||||
ifneq ($(findstring Win32,$(OS)),)
|
||||
DEFINES += -DENABLE_HLSL
|
||||
@@ -1702,9 +1589,6 @@ endif
|
||||
|
||||
ifeq ($(WANT_WGL), 1)
|
||||
OBJ += gfx/drivers_context/wgl_ctx.o
|
||||
ifeq ($(HAVE_VULKAN),1)
|
||||
OBJ += gfx/drivers_context/w_vk_ctx.o
|
||||
endif
|
||||
LIBS += -lcomctl32
|
||||
endif
|
||||
|
||||
@@ -1776,6 +1660,7 @@ endif
|
||||
ifeq ($(HAVE_BUILTINZLIB), 1)
|
||||
HAVE_ZLIB_COMMON = 1
|
||||
OBJ += $(DEPS_DIR)/libz/adler32.o \
|
||||
$(DEPS_DIR)/libz/compress.o \
|
||||
$(DEPS_DIR)/libz/libz-crc32.o \
|
||||
$(DEPS_DIR)/libz/deflate.o \
|
||||
$(DEPS_DIR)/libz/gzclose.o \
|
||||
@@ -1786,6 +1671,7 @@ ifeq ($(HAVE_BUILTINZLIB), 1)
|
||||
$(DEPS_DIR)/libz/inflate.o \
|
||||
$(DEPS_DIR)/libz/inftrees.o \
|
||||
$(DEPS_DIR)/libz/trees.o \
|
||||
$(DEPS_DIR)/libz/uncompr.o \
|
||||
$(DEPS_DIR)/libz/zutil.o
|
||||
INCLUDE_DIRS += -I$(LIBRETRO_COMM_DIR)/include/compat/zlib
|
||||
else ifeq ($(HAVE_ZLIB),1)
|
||||
@@ -1795,8 +1681,7 @@ endif
|
||||
|
||||
ifeq ($(HAVE_ZLIB_COMMON), 1)
|
||||
OBJ += $(LIBRETRO_COMM_DIR)/file/archive_file_zlib.o \
|
||||
$(LIBRETRO_COMM_DIR)/streams/trans_stream_zlib.o \
|
||||
$(LIBRETRO_COMM_DIR)/streams/rzip_stream.o
|
||||
$(LIBRETRO_COMM_DIR)/streams/trans_stream_zlib.o
|
||||
DEFINES += -DHAVE_ZLIB
|
||||
HAVE_COMPRESSION = 1
|
||||
|
||||
@@ -1828,8 +1713,7 @@ ifeq ($(HAVE_CDROM), 1)
|
||||
|
||||
DEFINES += -DHAVE_CDROM
|
||||
OBJ += $(LIBRETRO_COMM_DIR)/cdrom/cdrom.o \
|
||||
$(LIBRETRO_COMM_DIR)/vfs/vfs_implementation_cdrom.o \
|
||||
$(LIBRETRO_COMM_DIR)/media/media_detect_cd.o
|
||||
$(LIBRETRO_COMM_DIR)/vfs/vfs_implementation_cdrom.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_RTGA), 1)
|
||||
@@ -1881,14 +1765,11 @@ endif
|
||||
ifeq ($(HAVE_ACCESSIBILITY), 1)
|
||||
DEFINES += -DHAVE_ACCESSIBILITY
|
||||
|
||||
ifeq ($(HAVE_SAPI), 1)
|
||||
ifneq ($(findstring Win32,$(OS)),)
|
||||
LIBS += -lsapi
|
||||
endif
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
|
||||
|
||||
# Things that depend on network availability
|
||||
@@ -1905,7 +1786,6 @@ ifeq ($(HAVE_NETWORKING), 1)
|
||||
tasks/task_http.o \
|
||||
tasks/task_netplay_lan_scan.o \
|
||||
tasks/task_netplay_nat_traversal.o \
|
||||
tasks/task_bluetooth.o \
|
||||
tasks/task_wifi.o \
|
||||
tasks/task_pl_thumbnail_download.o \
|
||||
tasks/task_netplay_find_content.o
|
||||
@@ -1936,41 +1816,38 @@ ifeq ($(HAVE_NETWORKING), 1)
|
||||
# Netplay
|
||||
DEFINES += -DHAVE_NETWORK_CMD
|
||||
OBJ += network/netplay/netplay_delta.o \
|
||||
network/netplay/netplay_handshake.o \
|
||||
network/netplay/netplay_init.o \
|
||||
network/netplay/netplay_io.o \
|
||||
network/netplay/netplay_keyboard.o \
|
||||
network/netplay/netplay_sync.o \
|
||||
network/netplay/netplay_discovery.o \
|
||||
network/netplay/netplay_buf.o \
|
||||
network/netplay/netplay_room_parse.o
|
||||
network/netplay/netplay_handshake.o \
|
||||
network/netplay/netplay_init.o \
|
||||
network/netplay/netplay_io.o \
|
||||
network/netplay/netplay_keyboard.o \
|
||||
network/netplay/netplay_sync.o \
|
||||
network/netplay/netplay_discovery.o \
|
||||
network/netplay/netplay_buf.o \
|
||||
network/netplay/netplay_room_parse.o
|
||||
|
||||
# RetroAchievements
|
||||
ifeq ($(HAVE_CHEEVOS), 1)
|
||||
DEFINES += -DHAVE_CHEEVOS
|
||||
INCLUDE_DIRS += -Ideps/rcheevos/include
|
||||
|
||||
OBJ += cheevos/cheevos.o \
|
||||
cheevos/badges.o \
|
||||
cheevos/fixup.o \
|
||||
cheevos/parser.o \
|
||||
cheevos/hash.o \
|
||||
OBJ += cheevos-new/cheevos.o \
|
||||
cheevos-new/badges.o \
|
||||
cheevos-new/fixup.o \
|
||||
cheevos-new/parser.o \
|
||||
cheevos-new/hash.o \
|
||||
$(LIBRETRO_COMM_DIR)/formats/cdfs/cdfs.o \
|
||||
deps/rcheevos/src/rcheevos/alloc.o \
|
||||
deps/rcheevos/src/rcheevos/compat.o \
|
||||
deps/rcheevos/src/rcheevos/condition.o \
|
||||
deps/rcheevos/src/rcheevos/condset.o \
|
||||
deps/rcheevos/src/rcheevos/consoleinfo.o \
|
||||
deps/rcheevos/src/rcheevos/format.o \
|
||||
deps/rcheevos/src/rcheevos/lboard.o \
|
||||
deps/rcheevos/src/rcheevos/memref.o \
|
||||
deps/rcheevos/src/rcheevos/operand.o \
|
||||
deps/rcheevos/src/rcheevos/richpresence.o \
|
||||
deps/rcheevos/src/rcheevos/runtime.o \
|
||||
deps/rcheevos/src/rcheevos/runtime_progress.o \
|
||||
deps/rcheevos/src/rcheevos/trigger.o \
|
||||
deps/rcheevos/src/rcheevos/condset.o \
|
||||
deps/rcheevos/src/rcheevos/condition.o \
|
||||
deps/rcheevos/src/rcheevos/operand.o \
|
||||
deps/rcheevos/src/rcheevos/term.o \
|
||||
deps/rcheevos/src/rcheevos/expression.o \
|
||||
deps/rcheevos/src/rcheevos/value.o \
|
||||
deps/rcheevos/src/rhash/hash.o \
|
||||
deps/rcheevos/src/rcheevos/lboard.o \
|
||||
deps/rcheevos/src/rcheevos/alloc.o \
|
||||
deps/rcheevos/src/rcheevos/format.o \
|
||||
deps/rcheevos/src/rcheevos/memref.o \
|
||||
deps/rcheevos/src/rcheevos/richpresence.o \
|
||||
deps/rcheevos/src/rurl/url.o
|
||||
|
||||
ifeq ($(HAVE_LUA), 1)
|
||||
@@ -2019,8 +1896,7 @@ ifeq ($(HAVE_NETWORKING), 1)
|
||||
ifeq ($(HAVE_DISCORD), 1)
|
||||
NEED_CXX_LINKER = 1
|
||||
DEFINES += -DHAVE_DISCORD
|
||||
INCLUDE_DIRS += -Ideps/discord-rpc/include \
|
||||
-Ideps/discord-rpc/thirdparty/rapidjson-1.1.0/include/
|
||||
INCLUDE_DIRS += -Ideps/discord-rpc/include/ -Ideps/discord-rpc/thirdparty/rapidjson-1.1.0/include/
|
||||
|
||||
ifneq ($(HAVE_THREADS), 1)
|
||||
DEFINES += -DDISCORD_DISABLE_IO_THREAD
|
||||
@@ -2028,7 +1904,8 @@ ifeq ($(HAVE_NETWORKING), 1)
|
||||
|
||||
OBJ += deps/discord-rpc/src/discord_rpc.o \
|
||||
deps/discord-rpc/src/rpc_connection.o \
|
||||
deps/discord-rpc/src/serialization.o
|
||||
deps/discord-rpc/src/serialization.o \
|
||||
discord/discord.o
|
||||
|
||||
ifneq ($(findstring Win32,$(OS)),)
|
||||
OBJ += deps/discord-rpc/src/discord_register_win.o \
|
||||
@@ -2076,7 +1953,8 @@ ifeq ($(HAVE_NETWORKING), 1)
|
||||
endif
|
||||
|
||||
ifneq ($(findstring FPGA,$(OS)),)
|
||||
OBJ += gfx/drivers/fpga_gfx.o
|
||||
OBJ += gfx/drivers/fpga_gfx.o \
|
||||
gfx/drivers_context/fpga_ctx.o
|
||||
endif
|
||||
|
||||
ifneq ($(findstring Win32,$(OS)),)
|
||||
@@ -2087,6 +1965,7 @@ ifneq ($(findstring Win32,$(OS)),)
|
||||
|
||||
ifeq ($(HAVE_GDI), 1)
|
||||
OBJ += gfx/drivers/gdi_gfx.o \
|
||||
gfx/drivers_context/gdi_ctx.o \
|
||||
gfx/drivers_font/gdi_font.o \
|
||||
gfx/drivers_display/gfx_display_gdi.o
|
||||
LIBS += -lmsimg32
|
||||
@@ -2202,14 +2081,8 @@ ifeq ($(HAVE_MATH_NEON), 1)
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_VITAGL), 1)
|
||||
INCLUDE_DIRS += -I$(DEPS_DIR)/vitaShaRK/source
|
||||
SOURCES := $(DEPS_DIR)/vitaShaRK/source
|
||||
OBJ += $(patsubst %.c,%.o,$(foreach dir,$(SOURCES), $(wildcard $(dir)/*.c)))
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_VITAGL), 1)
|
||||
DEFINES += -DHAVE_VITAGL -DSTB_DXT_IMPLEMENTATION -DSKIP_ERROR_HANDLING -DHAVE_SHARK
|
||||
INCLUDE_DIRS += -I$(DEPS_DIR)/vitaGL/source -I$(DEPS_DIR)/vitaShaRK/include
|
||||
DEFINES += -DHAVE_VITAGL -DTRANSPOSE_MATRICES
|
||||
INCLUDE_DIRS += -I$(DEPS_DIR)/vitaGL/source
|
||||
SOURCES := $(DEPS_DIR)/vitaGL/source $(DEPS_DIR)/vitaGL/source/utils
|
||||
OBJ += $(patsubst %.c,%.o,$(foreach dir,$(SOURCES), $(wildcard $(dir)/*.c)))
|
||||
endif
|
||||
|
||||
+2
-15
@@ -51,12 +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 -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_RBMP -DHAVE_RTGA
|
||||
DEFINES += -DHAVE_NETWORKING -DHAVE_CHEEVOS -DRC_DISABLE_LUA
|
||||
DEFINES += -DHAVE_PATCH -DHAVE_RWAV
|
||||
DEFINES += -DHAVE_SCREENSHOTS
|
||||
DEFINES += -DHAVE_REWIND
|
||||
#DEFINES += -DHAVE_SOCKET_LEGACY -DHAVE_THREADS
|
||||
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
|
||||
@@ -76,11 +72,6 @@ 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
|
||||
@@ -144,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
|
||||
|
||||
|
||||
@@ -38,7 +38,6 @@ OBJ := ctr/ctr_system.o \
|
||||
libretro-common/streams/file_stream.o \
|
||||
libretro-common/vfs/vfs_implementation.o \
|
||||
libretro-common/hash/rhash.o \
|
||||
libretro-common/time/rtime.o \
|
||||
file_path_str.o \
|
||||
verbosity.o
|
||||
|
||||
|
||||
+7
-6
@@ -4,14 +4,10 @@ PACKAGE_NAME = retroarch
|
||||
|
||||
DEBUG ?= 0
|
||||
|
||||
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
|
||||
@@ -66,8 +62,6 @@ HAVE_VIDEO_LAYOUT = 1
|
||||
HAVE_XMB = 1
|
||||
HAVE_ZLIB = 1
|
||||
HAVE_CONFIGFILE = 1
|
||||
HAVE_PATCH = 1
|
||||
HAVE_CHEATS = 1
|
||||
|
||||
OS = Linux
|
||||
TARGET = retroarch
|
||||
@@ -164,6 +158,13 @@ $(OBJDIR)/%.o: %.m
|
||||
@$(if $(Q), $(shell echo echo OBJC $<),)
|
||||
$(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 $<),)
|
||||
|
||||
@@ -9,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
|
||||
@@ -34,7 +30,6 @@ HAVE_STATIC_VIDEO_FILTERS = 1
|
||||
HAVE_STATIC_AUDIO_FILTERS = 1
|
||||
HAVE_STB_FONT = 1
|
||||
HAVE_CONFIGFILE = 1
|
||||
HAVE_CHEATS = 1
|
||||
|
||||
MEMORY = 134217728
|
||||
|
||||
|
||||
+18
-142
@@ -155,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
|
||||
@@ -191,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
|
||||
@@ -205,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
|
||||
@@ -250,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)
|
||||
@@ -277,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)
|
||||
@@ -319,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
|
||||
@@ -339,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
|
||||
@@ -365,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
|
||||
@@ -411,9 +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_CONFIGFILE := 1
|
||||
|
||||
EXT_TARGET := $(TARGET_NAME).exe
|
||||
EXT_INTER_TARGET := $(TARGET_NAME).exe
|
||||
@@ -463,9 +445,7 @@ else ifeq ($(platform), windows_msvc2005_x86)
|
||||
HAVE_DYNAMIC := 1
|
||||
HAVE_GRIFFIN_CPP := 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
|
||||
@@ -492,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
|
||||
@@ -520,9 +497,7 @@ else ifneq (,$(findstring windows_msvc2010,$(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
|
||||
@@ -572,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
|
||||
@@ -600,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
|
||||
@@ -656,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
|
||||
@@ -684,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
|
||||
@@ -740,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
|
||||
@@ -768,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
|
||||
@@ -839,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
|
||||
@@ -866,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
|
||||
|
||||
@@ -877,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
|
||||
@@ -910,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)))
|
||||
@@ -1047,10 +955,6 @@ 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
|
||||
@@ -1059,22 +963,10 @@ ifeq ($(HAVE_7ZIP), 1)
|
||||
CFLAGS += -DHAVE_7ZIP
|
||||
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
|
||||
@@ -1121,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
|
||||
@@ -1149,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
|
||||
|
||||
@@ -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
|
||||
|
||||
+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)
|
||||
|
||||
@@ -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
|
||||
|
||||
+37
-19
@@ -1,22 +1,28 @@
|
||||
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.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
|
||||
|
||||
@@ -24,20 +30,20 @@ ifeq ($(MUTE_WARNINGS), 1)
|
||||
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 -DHAVE_CC_RESAMPLER
|
||||
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 -lpoweroff -lgskit -ldmakit -laudsrv -lpadx -lmtap -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
|
||||
@@ -51,17 +57,27 @@ 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)/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)/cdfs_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)
|
||||
@@ -90,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)
|
||||
@@ -102,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,103 +0,0 @@
|
||||
BUILD_FOR_PCSX2 = 0
|
||||
DEBUG = 0
|
||||
HAVE_FILE_LOGGER = 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 = -lm -lelf-loader -lpatches -lpoweroff
|
||||
|
||||
ifeq ($(BUILD_FOR_PCSX2), 1)
|
||||
RARCH_DEFINES += -DBUILD_FOR_PCSX2
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_FILE_LOGGER), 1)
|
||||
CFLAGS += -DHAVE_FILE_LOGGER
|
||||
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/rhash.o \
|
||||
libretro-common/time/rtime.o \
|
||||
file_path_str.o \
|
||||
verbosity.o \
|
||||
ps2/compat_files/ps2_devices.o
|
||||
|
||||
# Needed IRX objects
|
||||
EE_OBJS += $(IRX_DIR)/freesio2_irx.o $(IRX_DIR)/iomanX_irx.o $(IRX_DIR)/cdfs_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)/poweroff_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
|
||||
+2
-2
@@ -70,7 +70,7 @@ endif
|
||||
PPU_SRCS = griffin/griffin.c
|
||||
|
||||
DEFINES += -DHAVE_VIDEO_LAYOUT
|
||||
DEFINES += -DHAVE_MENU -DHAVE_CONFIGFILE -DHAVE_PATCH -DHAVE_CHEATS -DHAVE_GFX_WIDGETS -DHAVE_RGUI -DHAVE_XMB -DHAVE_OZONE -DHAVE_LIBRETRODB -DHAVE_MATERIALUI -DHAVE_SHADERPIPELINE -DRARCH_INTERNAL -DHAVE_SCREENSHOTS -DHAVE_REWIND -DHAVE_OVERLAY -DHAVE_CC_RESAMPLER -DHAVE_STB_VORBIS -DHAVE_STB_FONT -DHAVE_RUNAHEAD -DHAVE_DR_MP3 -DHAVE_DR_FLAC
|
||||
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)
|
||||
@@ -117,7 +117,7 @@ PPU_LDLIBS = $(FONT_LIBS) $(GL_LIBS) $(WHOLE_START) -lretro_ps3 $(WHOLE_END) -l
|
||||
|
||||
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 -DHAVE_DSP_FILTER -DHAVE_VIDEO_FILTER
|
||||
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
|
||||
|
||||
|
||||
+1
-1
@@ -108,7 +108,7 @@ PPU_LDLIBS = $(FONT_LIBS) $(GL_LIBS) $(WHOLE_START) -lretro_ps3 $(WHOLE_END) -l
|
||||
PPU_RANLIB = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ranlib.exe
|
||||
|
||||
#DEFINES += -DHAVE_VIDEO_LAYOUT
|
||||
DEFINES += -DHAVE_THREADS -DHAVE_SCREENSHOTS -DHAVE_REWIND -DHAVE_PATCH -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
|
||||
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
|
||||
|
||||
@@ -59,7 +59,6 @@ PPU_SRCS = frontend/frontend_salamander.c \
|
||||
libretro-common/streams/file_stream.c \
|
||||
libretro-common/vfs/vfs_implementation.c \
|
||||
libretro-common/file/config_file.c \
|
||||
libretro-common/time/rtime.c \
|
||||
file_path_str.c \
|
||||
verbosity.c
|
||||
|
||||
|
||||
+1
-1
@@ -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)
|
||||
|
||||
|
||||
@@ -70,7 +70,6 @@ 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.c \
|
||||
file_path_str.o \
|
||||
verbosity.o
|
||||
|
||||
|
||||
+1
-1
@@ -25,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 -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 =
|
||||
|
||||
@@ -49,7 +49,6 @@ OBJS = frontend/frontend_salamander.o \
|
||||
libretro-common/streams/file_stream.o \
|
||||
libretro-common/vfs/vfs_implementation.o \
|
||||
libretro-common/hash/rhash.o \
|
||||
libretro-common/time/rtime.o \
|
||||
file_path_str.o \
|
||||
verbosity.o \
|
||||
bootstrap/psp1/kernel_functions.o
|
||||
|
||||
+2
-8
@@ -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,8 +34,6 @@ else
|
||||
HAVE_CONFIGFILE = 1
|
||||
HAVE_RUNAHEAD = 1
|
||||
HAVE_DYNAMIC = 1
|
||||
HAVE_PATCH = 1
|
||||
HAVE_CHEATS = 1
|
||||
|
||||
include Makefile.common
|
||||
CFLAGS += $(DEF_FLAGS)
|
||||
|
||||
+7
-28
@@ -1,6 +1,5 @@
|
||||
TARGET := retroarch_vita
|
||||
DEBUG ?= 0
|
||||
HAVE_FILE_LOGGER = 1
|
||||
GRIFFIN_BUILD = 0
|
||||
WHOLE_ARCHIVE_LINK = 0
|
||||
|
||||
@@ -18,22 +17,18 @@ 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
|
||||
@@ -50,8 +45,6 @@ else
|
||||
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
|
||||
@@ -67,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
|
||||
@@ -95,7 +87,7 @@ AR := $(PREFIX)ar
|
||||
OBJCOPY := $(PREFIX)objcopy
|
||||
STRIP := $(PREFIX)strip
|
||||
NM := $(PREFIX)nm
|
||||
LD := $(CC)
|
||||
LD := $(CXX)
|
||||
|
||||
LIBDIRS := -L.
|
||||
|
||||
@@ -110,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),)
|
||||
@@ -132,7 +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 -lstdc++ -lpthread -lpng -lz -lSceShaccCg_stub
|
||||
-lSceFiber_stub -lSceMotion_stub -lSceAppMgr_stub -lpthread -lpng -lz
|
||||
|
||||
LIBS := $(WHOLE_START) -lretro_vita $(WHOLE_END) $(VITA_LIBS) -lm -lc
|
||||
|
||||
@@ -165,13 +155,7 @@ all: $(TARGETS)
|
||||
|
||||
%.depend: ;
|
||||
|
||||
libSceShaccCg_stub.a:
|
||||
mkdir -p deps/vitaShaRK/SceShaccCg
|
||||
vita-libs-gen deps/vitaShaRK/SceShaccCg.yml deps/vitaShaRK/SceShaccCg
|
||||
make -C deps/vitaShaRK/SceShaccCg ARCH=arm-vita-eabi
|
||||
cp deps/vitaShaRK/SceShaccCg/libSceShaccCg_stub.a .
|
||||
|
||||
$(TARGET).elf: $(OBJ) libretro_vita.a libSceShaccCg_stub.a
|
||||
$(TARGET).elf: $(OBJ) libretro_vita.a
|
||||
$(LD) $(OBJ) $(LDFLAGS) $(LIBDIRS) $(LIBS) -o $@
|
||||
|
||||
%.velf: %.elf
|
||||
@@ -187,8 +171,7 @@ $(TARGET).elf: $(OBJ) libretro_vita.a libSceShaccCg_stub.a
|
||||
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 libSceShaccCg_stub.a
|
||||
rm -rf deps/vitaShaRK/SceShaccCg
|
||||
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
|
||||
@@ -198,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
|
||||
|
||||
|
||||
@@ -49,7 +49,6 @@ OBJS = frontend/frontend_salamander.o \
|
||||
libretro-common/streams/file_stream.o \
|
||||
libretro-common/vfs/vfs_implementation.o \
|
||||
libretro-common/hash/rhash.o \
|
||||
libretro-common/time/rtime.o \
|
||||
file_path_str.o \
|
||||
verbosity.o
|
||||
|
||||
|
||||
@@ -69,7 +69,6 @@ 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
|
||||
|
||||
+4
-16
@@ -67,14 +67,12 @@ ifeq ($(SALAMANDER_BUILD),1)
|
||||
OBJ += libretro-common/streams/file_stream.o
|
||||
OBJ += libretro-common/vfs/vfs_implementation.o
|
||||
OBJ += libretro-common/hash/rhash.o
|
||||
OBJ += libretro-common/time/rtime.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
|
||||
@@ -99,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
|
||||
@@ -109,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
|
||||
@@ -124,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
|
||||
@@ -157,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
|
||||
@@ -175,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
|
||||
|
||||
@@ -196,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
|
||||
|
||||
@@ -66,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);
|
||||
@@ -256,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);
|
||||
@@ -271,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)
|
||||
{
|
||||
@@ -334,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;
|
||||
}
|
||||
|
||||
@@ -103,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;
|
||||
|
||||
@@ -356,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)
|
||||
{
|
||||
@@ -430,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
-16
@@ -31,8 +31,8 @@ typedef struct ringbuffer
|
||||
float *buffer;
|
||||
size_t cap;
|
||||
atomic_int len;
|
||||
size_t write_ptr;
|
||||
size_t read_ptr;
|
||||
size_t writePtr;
|
||||
size_t readPtr;
|
||||
} ringbuffer_t;
|
||||
|
||||
typedef ringbuffer_t * ringbuffer_h;
|
||||
@@ -44,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)
|
||||
@@ -54,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)
|
||||
@@ -79,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)
|
||||
@@ -102,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);
|
||||
@@ -126,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);
|
||||
}
|
||||
|
||||
|
||||
+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)
|
||||
{
|
||||
|
||||
@@ -109,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)
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#include <boolean.h>
|
||||
#include <rthreads/rthreads.h>
|
||||
|
||||
#include "../../configuration.h"
|
||||
#include "../../retroarch.h"
|
||||
#include "../../verbosity.h"
|
||||
|
||||
@@ -97,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)
|
||||
@@ -204,7 +203,7 @@ static void *ja_init(const char *device,
|
||||
}
|
||||
}
|
||||
|
||||
parsed = parse_ports(dest_ports, jports);
|
||||
parsed = parse_ports(device, dest_ports, jports);
|
||||
|
||||
if (jack_activate(jd->client) < 0)
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -61,7 +61,7 @@ static void event_loop(uint64_t data)
|
||||
sys_event_queue_receive(id, &event, SYS_NO_TIMEOUT);
|
||||
|
||||
sys_lwmutex_lock(&aud->lock, SYS_NO_TIMEOUT);
|
||||
if (FIFO_READ_AVAIL(aud->buffer) >= sizeof(out_tmp))
|
||||
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));
|
||||
@@ -152,11 +152,11 @@ 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)
|
||||
while (fifo_write_avail(aud->buffer) < size)
|
||||
sys_lwcond_wait(&aud->cond, 0);
|
||||
|
||||
sys_lwmutex_lock(&aud->lock, SYS_NO_TIMEOUT);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -39,8 +39,9 @@ typedef struct rsd
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ typedef struct sdl_audio
|
||||
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);
|
||||
@@ -151,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();
|
||||
@@ -166,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)
|
||||
{
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -1525,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;
|
||||
}
|
||||
|
||||
@@ -1538,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;
|
||||
}
|
||||
|
||||
@@ -2019,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;
|
||||
}
|
||||
|
||||
@@ -2029,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);
|
||||
@@ -2052,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);
|
||||
@@ -2073,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);
|
||||
|
||||
+11
-11
@@ -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;
|
||||
|
||||
+14
-11
@@ -187,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);
|
||||
}
|
||||
|
||||
@@ -207,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)
|
||||
{
|
||||
@@ -223,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));
|
||||
@@ -305,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;
|
||||
}
|
||||
|
||||
@@ -332,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 */
|
||||
};
|
||||
@@ -410,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)
|
||||
{
|
||||
|
||||
+10
-9
@@ -765,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);
|
||||
}
|
||||
}
|
||||
@@ -789,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;
|
||||
@@ -886,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;
|
||||
@@ -1060,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);
|
||||
@@ -1116,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;
|
||||
@@ -1382,10 +1382,11 @@ int rsd_exec(rsound_t *rsound)
|
||||
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) )
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
@@ -55,7 +54,7 @@ void cheevos_set_menu_badge(int index, const char *badge, bool 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;
|
||||
}
|
||||
@@ -66,23 +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;
|
||||
|
||||
strlcpy(badge_file, badge, sizeof(badge_file));
|
||||
if (locked)
|
||||
strlcat(badge_file, "_lock", sizeof(badge_file));
|
||||
strlcat(badge_file, ".png", sizeof(badge_file));
|
||||
snprintf(badge_file, sizeof(badge_file), "%s%s.png", badge, locked ? "_lock" : "");
|
||||
|
||||
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
@@ -49,7 +49,7 @@ void rcheevos_get_achievement_state(unsigned index, char* buffer, size_t buffer_
|
||||
|
||||
bool rcheevos_get_description(rcheevos_ctx_desc_t *desc);
|
||||
|
||||
void rcheevos_pause_hardcore();
|
||||
bool rcheevos_apply_cheats(bool *data_bool);
|
||||
|
||||
bool rcheevos_unload(void);
|
||||
|
||||
@@ -57,6 +57,8 @@ 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);
|
||||
@@ -71,6 +73,8 @@ 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;
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -291,7 +291,7 @@ typedef struct
|
||||
static char* rcheevos_unescape_string(const char* string, size_t length)
|
||||
{
|
||||
const char* end = string + length;
|
||||
char* buffer = (char*)malloc(length + 1);
|
||||
char* buffer = (char*)malloc(length + 1);
|
||||
char* buffer_it = buffer;
|
||||
|
||||
if (buffer == NULL)
|
||||
@@ -329,19 +329,18 @@ static char* rcheevos_unescape_string(const char* string, size_t length)
|
||||
{
|
||||
char temp[5];
|
||||
|
||||
string += 2;
|
||||
string += 2;
|
||||
memcpy(temp, string, 4);
|
||||
temp[4] = '\0';
|
||||
utf16[j] = string_hex_to_unsigned(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)))
|
||||
{
|
||||
size_t utf8_len = strlen(utf8);
|
||||
memcpy(buffer_it, utf8, utf8_len);
|
||||
buffer_it += utf8_len;
|
||||
memcpy(buffer_it, utf8, strlen(utf8));
|
||||
buffer_it += strlen(utf8);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -350,10 +349,12 @@ static char* rcheevos_unescape_string(const char* string, size_t length)
|
||||
*buffer_it++ = escaped_char;
|
||||
string += 2;
|
||||
break;
|
||||
}
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
*buffer_it++ = *string++;
|
||||
}
|
||||
}
|
||||
*buffer_it = '\0';
|
||||
|
||||
File renamed without changes.
@@ -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
|
||||
|
||||
-314
@@ -1,314 +0,0 @@
|
||||
/* 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"
|
||||
#include "../deps/rcheevos/include/rconsoles.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;
|
||||
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)
|
||||
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)
|
||||
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;
|
||||
|
||||
switch (console)
|
||||
{
|
||||
case 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;
|
||||
}
|
||||
break;
|
||||
case 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;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
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. */
|
||||
switch (console)
|
||||
{
|
||||
case 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;
|
||||
}
|
||||
break;
|
||||
case 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;
|
||||
}
|
||||
break;
|
||||
case 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;
|
||||
}
|
||||
break;
|
||||
case 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);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
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 if (console == RC_CONSOLE_GAMEBOY_ADVANCE)
|
||||
{
|
||||
/* The RetroAchievements implementation of memory access
|
||||
* for GBA puts the save RAM first,
|
||||
* so the default looping behavior below is backwards.
|
||||
*
|
||||
* If the core doesn't expose a
|
||||
* memory map, say it isn't supported.
|
||||
*/
|
||||
pointer = NULL;
|
||||
}
|
||||
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 its size is not always
|
||||
* set correctly in the core.
|
||||
*/
|
||||
if (i == 0 && console == RC_CONSOLE_NINTENDO)
|
||||
address -= 0x6000;
|
||||
else
|
||||
address -= meminfo.size;
|
||||
}
|
||||
}
|
||||
|
||||
if (!pointer)
|
||||
{
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "address %X not supported\n", original_address);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return (const uint8_t*)pointer + address;
|
||||
}
|
||||
@@ -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>
|
||||
+55
-164
@@ -53,6 +53,48 @@
|
||||
#define DEFAULT_ASPECT_RATIO -1.0f
|
||||
#endif
|
||||
|
||||
#if defined(ANDROID)
|
||||
#define DEFAULT_MAX_PADS 8
|
||||
#define ANDROID_KEYBOARD_PORT DEFAULT_MAX_PADS
|
||||
#elif defined(_3DS)
|
||||
#define DEFAULT_MAX_PADS 1
|
||||
#elif defined(SWITCH) || defined(HAVE_LIBNX)
|
||||
#define DEFAULT_MAX_PADS 8
|
||||
#elif defined(WIIU)
|
||||
#ifdef WIIU_HID
|
||||
#define DEFAULT_MAX_PADS 16
|
||||
#else
|
||||
#define DEFAULT_MAX_PADS 5
|
||||
#endif
|
||||
#elif defined(DJGPP)
|
||||
#define DEFAULT_MAX_PADS 1
|
||||
#define DOS_KEYBOARD_PORT DEFAULT_MAX_PADS
|
||||
#elif defined(XENON)
|
||||
#define DEFAULT_MAX_PADS 4
|
||||
#elif defined(VITA) || defined(SN_TARGET_PSP2)
|
||||
#define DEFAULT_MAX_PADS 4
|
||||
#elif defined(PSP)
|
||||
#define DEFAULT_MAX_PADS 1
|
||||
#elif defined(PS2)
|
||||
#define DEFAULT_MAX_PADS 2
|
||||
#elif defined(GEKKO) || defined(HW_RVL)
|
||||
#define DEFAULT_MAX_PADS 4
|
||||
#elif defined(__linux__) || (defined(BSD) && !defined(__MACH__))
|
||||
#define DEFAULT_MAX_PADS 8
|
||||
#elif defined(__QNX__)
|
||||
#define DEFAULT_MAX_PADS 8
|
||||
#elif defined(__CELLOS_LV2__)
|
||||
#define DEFAULT_MAX_PADS 7
|
||||
#elif defined(_XBOX)
|
||||
#define DEFAULT_MAX_PADS 4
|
||||
#elif defined(HAVE_XINPUT) && !defined(HAVE_DINPUT)
|
||||
#define DEFAULT_MAX_PADS 4
|
||||
#elif defined(DINGUX)
|
||||
#define DEFAULT_MAX_PADS 2
|
||||
#else
|
||||
#define DEFAULT_MAX_PADS 16
|
||||
#endif
|
||||
|
||||
#if defined(GEKKO)
|
||||
#define DEFAULT_MOUSE_SCALE 1
|
||||
#endif
|
||||
@@ -76,8 +118,6 @@
|
||||
#ifdef HAVE_MATERIALUI
|
||||
/* Show icons to the left of each menu entry */
|
||||
#define DEFAULT_MATERIALUI_ICONS_ENABLE true
|
||||
/* Show system-specific icons in the playlists tab */
|
||||
#define DEFAULT_MATERIALUI_PLAYLIST_ICONS_ENABLE true
|
||||
#endif
|
||||
|
||||
/* Material UI colour theme */
|
||||
@@ -135,8 +175,6 @@
|
||||
|
||||
#define DEFAULT_CRT_SWITCH_CENTER_ADJUST 0
|
||||
|
||||
#define DEFAULT_CRT_SWITCH_PORCH_ADJUST 0
|
||||
|
||||
#define DEFAULT_HISTORY_LIST_ENABLE true
|
||||
|
||||
#define DEFAULT_PLAYLIST_ENTRY_RENAME true
|
||||
@@ -220,18 +258,6 @@
|
||||
#endif
|
||||
#define DEFAULT_CHECK_FIRMWARE_BEFORE_LOADING false
|
||||
|
||||
/* Specifies whether to 'reload' (fork and quit)
|
||||
* RetroArch when launching content with the
|
||||
* currently loaded core
|
||||
* > Only relevant on platforms without dynamic core
|
||||
* loading support
|
||||
* > Setting this to 'false' will decrease loading
|
||||
* times when required core is already running,
|
||||
* but may cause stability issues (if core misbehaves) */
|
||||
#ifndef HAVE_DYNAMIC
|
||||
#define DEFAULT_ALWAYS_RELOAD_CORE_ON_RUN_CONTENT true
|
||||
#endif
|
||||
|
||||
/* Forcibly disable composition.
|
||||
* Only valid on Windows Vista/7/8 for now. */
|
||||
#define DEFAULT_DISABLE_COMPOSITION false
|
||||
@@ -387,7 +413,6 @@
|
||||
#define DEFAULT_OZONE_COLOR_THEME 1
|
||||
#define DEFAULT_OZONE_COLLAPSE_SIDEBAR false
|
||||
#define DEFAULT_OZONE_TRUNCATE_PLAYLIST_NAME true
|
||||
#define DEFAULT_OZONE_SORT_AFTER_TRUNCATE_PLAYLIST_NAME true
|
||||
#define DEFAULT_OZONE_SCROLL_CONTENT_METADATA false
|
||||
#endif
|
||||
|
||||
@@ -492,8 +517,8 @@ static const bool menu_show_sublabels = true;
|
||||
|
||||
static const bool menu_scroll_fast = false;
|
||||
|
||||
#define DEFAULT_MENU_TICKER_TYPE (TICKER_TYPE_LOOP)
|
||||
static const float menu_ticker_speed = 2.0f;
|
||||
#define DEFAULT_MENU_TICKER_TYPE (TICKER_TYPE_BOUNCE)
|
||||
static const float menu_ticker_speed = 1.0f;
|
||||
|
||||
#define DEFAULT_MENU_TICKER_SMOOTH true
|
||||
|
||||
@@ -514,26 +539,12 @@ static const bool content_show_music = true;
|
||||
#if defined(HAVE_FFMPEG) || defined(HAVE_MPV)
|
||||
static const bool content_show_video = true;
|
||||
#endif
|
||||
#if defined(HAVE_NETWORKING)
|
||||
#if defined(_3DS)
|
||||
static const bool content_show_netplay = false;
|
||||
#else
|
||||
#ifdef HAVE_NETWORKING
|
||||
static const bool content_show_netplay = true;
|
||||
#endif
|
||||
#endif
|
||||
static const bool content_show_history = true;
|
||||
|
||||
/* Specifies 'add content' visibility when using
|
||||
* menus WITH a dedicated 'Import Content' tab */
|
||||
#define DEFAULT_MENU_CONTENT_SHOW_ADD true
|
||||
/* Specifies 'add content' visibility when using
|
||||
* menus WITHOUT a dedicated 'Import Content' tab */
|
||||
#define DEFAULT_MENU_CONTENT_SHOW_ADD_ENTRY MENU_ADD_CONTENT_ENTRY_DISPLAY_PLAYLISTS_TAB
|
||||
|
||||
static const bool content_show_add = true;
|
||||
static const bool content_show_playlists = true;
|
||||
#if defined(HAVE_LIBRETRODB)
|
||||
#define DEFAULT_MENU_CONTENT_SHOW_EXPLORE true
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_XMB
|
||||
static const unsigned xmb_alpha_factor = 75;
|
||||
@@ -585,7 +596,6 @@ static const bool rgui_shadows = false;
|
||||
static const unsigned rgui_particle_effect = RGUI_PARTICLE_EFFECT_NONE;
|
||||
#define DEFAULT_RGUI_PARTICLE_EFFECT_SPEED 1.0f
|
||||
static const bool rgui_extended_ascii = false;
|
||||
#define DEFAULT_RGUI_SWITCH_ICONS true
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
@@ -600,7 +610,7 @@ static const bool rgui_extended_ascii = false;
|
||||
static const bool default_game_specific_options = true;
|
||||
static const bool default_auto_overrides_enable = true;
|
||||
static const bool default_auto_remaps_enable = true;
|
||||
static const bool default_global_core_options = false;
|
||||
static const bool default_global_core_options = true;
|
||||
static const bool default_auto_shaders_enable = true;
|
||||
|
||||
static const bool default_sort_savefiles_enable = false;
|
||||
@@ -630,8 +640,6 @@ static const unsigned input_backtouch_enable = false;
|
||||
static const unsigned input_backtouch_toggle = false;
|
||||
#endif
|
||||
|
||||
#define DEFAULT_OVERLAY_ENABLE_AUTOPREFERRED true
|
||||
|
||||
#define DEFAULT_SHOW_PHYSICAL_INPUTS true
|
||||
|
||||
#define DEFAULT_ALL_USERS_CONTROL_MENU false
|
||||
@@ -742,56 +750,6 @@ static const bool audio_enable_menu_bgm = false;
|
||||
#define DEFAULT_MENU_ENABLE_WIDGETS false
|
||||
#endif
|
||||
|
||||
/* Display an animation when loading content
|
||||
* > Currently implemented only as a widget */
|
||||
#define DEFAULT_MENU_SHOW_LOAD_CONTENT_ANIMATION DEFAULT_MENU_ENABLE_WIDGETS
|
||||
|
||||
/* Display a notification when successfully
|
||||
* connecting/disconnecting an autoconfigured
|
||||
* controller
|
||||
* > Disabled by default on the Switch */
|
||||
#if defined(HAVE_LIBNX) && defined(HAVE_GFX_WIDGETS)
|
||||
#define DEFAULT_NOTIFICATION_SHOW_AUTOCONFIG false
|
||||
#else
|
||||
#define DEFAULT_NOTIFICATION_SHOW_AUTOCONFIG true
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_SCREENSHOTS)
|
||||
#define DEFAULT_NOTIFICATION_SHOW_SCREENSHOT_TAKEN true
|
||||
#else
|
||||
#define DEFAULT_NOTIFICATION_SHOW_SCREENSHOT_TAKEN false
|
||||
#endif
|
||||
|
||||
/* Display a notification when cheats are being
|
||||
* applied */
|
||||
#define DEFAULT_NOTIFICATION_SHOW_CHEATS_APPLIED true
|
||||
|
||||
/* Display a notification when loading an
|
||||
* input remap file */
|
||||
#define DEFAULT_NOTIFICATION_SHOW_REMAP_LOAD true
|
||||
|
||||
/* Display a notification when loading a
|
||||
* configuration override file */
|
||||
#define DEFAULT_NOTIFICATION_SHOW_CONFIG_OVERRIDE_LOAD true
|
||||
|
||||
/* Display a notification when automatically restoring
|
||||
* at launch the last used disk of multi-disk content */
|
||||
#define DEFAULT_NOTIFICATION_SHOW_SET_INITIAL_DISK true
|
||||
|
||||
/* Display a notification when fast forwarding
|
||||
* content */
|
||||
#define DEFAULT_NOTIFICATION_SHOW_FAST_FORWARD true
|
||||
|
||||
/*Display a notification when taking a screenshot*/
|
||||
#define DEFAULT_NOTIFICATION_SHOW_SCREENSHOT true
|
||||
|
||||
/*Desired duration of the screenshot notification*/
|
||||
#define DEFAULT_NOTIFICATION_SHOW_SCREENSHOT_DURATION 0
|
||||
|
||||
/* Display a white flashing effect with the desired
|
||||
* duration when taking a screenshot*/
|
||||
#define DEFAULT_NOTIFICATION_SHOW_SCREENSHOT_FLASH 0
|
||||
|
||||
/* Output samplerate. */
|
||||
#ifdef GEKKO
|
||||
#define DEFAULT_OUTPUT_RATE 32000
|
||||
@@ -845,10 +803,6 @@ static const bool audio_enable_menu_bgm = false;
|
||||
#define DEFAULT_WASAPI_SH_BUFFER_LENGTH -16
|
||||
#endif
|
||||
|
||||
/* Automatically mute audio when fast forward
|
||||
* is enabled */
|
||||
#define DEFAULT_AUDIO_FASTFORWARD_MUTE false
|
||||
|
||||
/* MISC */
|
||||
|
||||
/* Enables displaying the current frames per second. */
|
||||
@@ -857,9 +811,6 @@ static const bool audio_enable_menu_bgm = false;
|
||||
/* FPS display will be updated at the set interval (in frames) */
|
||||
#define DEFAULT_FPS_UPDATE_INTERVAL 256
|
||||
|
||||
/* Memory status display will be updated at the set interval (in frames) */
|
||||
#define DEFAULT_MEMORY_UPDATE_INTERVAL 256
|
||||
|
||||
/* Enables displaying the current frame count. */
|
||||
#define DEFAULT_FRAMECOUNT_SHOW false
|
||||
|
||||
@@ -960,23 +911,6 @@ static const bool savestate_auto_load = false;
|
||||
|
||||
static const bool savestate_thumbnail_enable = false;
|
||||
|
||||
/* When creating save (srm) files, compress
|
||||
* written data */
|
||||
#if defined(__WINRT__) || defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
|
||||
#define DEFAULT_SAVE_FILE_COMPRESSION true
|
||||
#else
|
||||
#define DEFAULT_SAVE_FILE_COMPRESSION false
|
||||
#endif
|
||||
|
||||
/* When creating save state files, compress
|
||||
* written data */
|
||||
#if defined(__WINRT__) || defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
|
||||
/* TODO/FIXME Apparently this is an issue on UWP for now, so disable it for now */
|
||||
#define DEFAULT_SAVESTATE_FILE_COMPRESSION false
|
||||
#else
|
||||
#define DEFAULT_SAVESTATE_FILE_COMPRESSION true
|
||||
#endif
|
||||
|
||||
/* Slowmotion ratio. */
|
||||
#define DEFAULT_SLOWMOTION_RATIO 3.0
|
||||
|
||||
@@ -1002,27 +936,10 @@ static const bool stdin_cmd_enable = false;
|
||||
|
||||
static const uint16_t network_remote_base_port = 55400;
|
||||
|
||||
#define DEFAULT_NETWORK_BUILDBOT_AUTO_EXTRACT_ARCHIVE true
|
||||
#define DEFAULT_NETWORK_BUILDBOT_SHOW_EXPERIMENTAL_CORES false
|
||||
|
||||
/* Automatically create a backup whenever a core is
|
||||
* updated via the online updater
|
||||
* > Enable by default on all modern platforms with
|
||||
* online updater support */
|
||||
#if defined(HAVE_ONLINE_UPDATER) && (defined(__i386__) || defined(__i486__) || defined(__i686__) || defined(__x86_64__) || defined(_M_X64) || defined(_WIN32) || defined(OSX) || defined(ANDROID) || defined(IOS))
|
||||
#define DEFAULT_CORE_UPDATER_AUTO_BACKUP true
|
||||
#else
|
||||
#define DEFAULT_CORE_UPDATER_AUTO_BACKUP false
|
||||
#endif
|
||||
/* Number of automatic core backups to retain
|
||||
* (oldest backup will be deleted when creating
|
||||
* a new one) */
|
||||
#define DEFAULT_CORE_UPDATER_AUTO_BACKUP_HISTORY_SIZE 1
|
||||
|
||||
#if defined(ANDROID) || defined(IOS)
|
||||
#define DEFAULT_NETWORK_ON_DEMAND_THUMBNAILS true
|
||||
static const bool network_on_demand_thumbnails = true;
|
||||
#else
|
||||
#define DEFAULT_NETWORK_ON_DEMAND_THUMBNAILS false
|
||||
static const bool network_on_demand_thumbnails = false;
|
||||
#endif
|
||||
|
||||
/* Number of entries that will be kept in content history playlist file. */
|
||||
@@ -1033,29 +950,22 @@ static const unsigned default_content_history_size = 200;
|
||||
static const int default_content_favorites_size = 200;
|
||||
|
||||
/* Sort all playlists (apart from histories) alphabetically */
|
||||
#define DEFAULT_PLAYLIST_SORT_ALPHABETICAL true
|
||||
static const bool playlist_sort_alphabetical = true;
|
||||
|
||||
/* File format to use when writing playlists to disk */
|
||||
#define DEFAULT_PLAYLIST_USE_OLD_FORMAT false
|
||||
|
||||
/* When creating/updating playlists, compress written data */
|
||||
#if defined(__WINRT__) || defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
|
||||
#define DEFAULT_PLAYLIST_COMPRESSION true
|
||||
#else
|
||||
#define DEFAULT_PLAYLIST_COMPRESSION false
|
||||
#endif
|
||||
static const bool playlist_use_old_format = false;
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
/* Specify when to display 'core name' inline on playlist entries */
|
||||
#define DEFAULT_PLAYLIST_SHOW_INLINE_CORE_NAME PLAYLIST_INLINE_CORE_DISPLAY_HIST_FAV
|
||||
static const unsigned playlist_show_inline_core_name = PLAYLIST_INLINE_CORE_DISPLAY_HIST_FAV;
|
||||
|
||||
/* Specifies which runtime record to use on playlist sublabels */
|
||||
#define DEFAULT_PLAYLIST_SUBLABEL_RUNTIME_TYPE PLAYLIST_RUNTIME_PER_CORE
|
||||
static const unsigned playlist_sublabel_runtime_type = PLAYLIST_RUNTIME_PER_CORE;
|
||||
|
||||
/* Specifies time/date display format for runtime 'last played' data */
|
||||
#define DEFAULT_PLAYLIST_SUBLABEL_LAST_PLAYED_STYLE PLAYLIST_LAST_PLAYED_STYLE_YMD_HMS
|
||||
|
||||
#define DEFAULT_PLAYLIST_ENTRY_REMOVE_ENABLE PLAYLIST_ENTRY_REMOVE_ENABLE_ALL
|
||||
static const unsigned playlist_entry_remove_enable = PLAYLIST_ENTRY_REMOVE_ENABLE_ALL;
|
||||
#endif
|
||||
|
||||
#define DEFAULT_SCAN_WITHOUT_CORE_MATCH false
|
||||
@@ -1070,8 +980,6 @@ static const int default_content_favorites_size = 200;
|
||||
|
||||
#define DEFAULT_PLAYLIST_FUZZY_ARCHIVE_MATCH false
|
||||
|
||||
#define DEFAULT_PLAYLIST_PORTABLE_PATHS false
|
||||
|
||||
/* Show Menu start-up screen on boot. */
|
||||
#define DEFAULT_MENU_SHOW_START_SCREEN true
|
||||
|
||||
@@ -1136,8 +1044,6 @@ static const unsigned input_bind_timeout = 5;
|
||||
|
||||
static const unsigned input_bind_hold = 2;
|
||||
|
||||
#define DEFAULT_INPUT_HOTKEY_BLOCK_DELAY 5
|
||||
|
||||
static const unsigned gfx_thumbnails_default = 3;
|
||||
|
||||
static const unsigned menu_left_thumbnails_default = 0;
|
||||
@@ -1145,8 +1051,7 @@ static const unsigned menu_left_thumbnails_default = 0;
|
||||
static const unsigned gfx_thumbnail_upscale_threshold = 0;
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
#define DEFAULT_MENU_TIMEDATE_STYLE MENU_TIMEDATE_STYLE_DDMM_HM
|
||||
#define DEFAULT_MENU_TIMEDATE_DATE_SEPARATOR MENU_TIMEDATE_DATE_SEPARATOR_HYPHEN
|
||||
static const unsigned menu_timedate_style = MENU_TIMEDATE_STYLE_DDMM_HM;
|
||||
#endif
|
||||
|
||||
static const bool xmb_vertical_thumbnails = false;
|
||||
@@ -1328,18 +1233,4 @@ static const bool enable_device_vibration = false;
|
||||
|
||||
#define DEFAULT_AI_SERVICE_URL "http://localhost:4404/"
|
||||
|
||||
#if defined(HAVE_FFMPEG) || defined(HAVE_MPV)
|
||||
#define DEFAULT_BUILTIN_MEDIAPLAYER_ENABLE true
|
||||
#else
|
||||
#define DEFAULT_BUILTIN_MEDIAPLAYER_ENABLE false
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_IMAGEVIEWER)
|
||||
#define DEFAULT_BUILTIN_IMAGEVIEWER_ENABLE true
|
||||
#else
|
||||
#define DEFAULT_BUILTIN_IMAGEVIEWER_ENABLE false
|
||||
#endif
|
||||
|
||||
#define DEFAULT_FILTER_BY_CURRENT_CORE false
|
||||
|
||||
#endif
|
||||
+221
-723
File diff suppressed because it is too large.
Load diff
+3
-50
@@ -131,7 +131,6 @@ typedef struct settings
|
||||
bool audio_rate_control;
|
||||
bool audio_wasapi_exclusive_mode;
|
||||
bool audio_wasapi_float_format;
|
||||
bool audio_fastforward_mute;
|
||||
|
||||
/* Input */
|
||||
bool input_remap_binds_enable;
|
||||
@@ -144,6 +143,7 @@ typedef struct settings
|
||||
bool input_overlay_auto_rotate;
|
||||
bool input_descriptor_label_show;
|
||||
bool input_descriptor_hide_unbound;
|
||||
bool input_all_users_control_menu;
|
||||
bool input_menu_swap_ok_cancel_buttons;
|
||||
bool input_backtouch_enable;
|
||||
bool input_backtouch_toggle;
|
||||
@@ -158,14 +158,6 @@ typedef struct settings
|
||||
/* Menu */
|
||||
bool filter_by_current_core;
|
||||
bool menu_enable_widgets;
|
||||
bool menu_show_load_content_animation;
|
||||
bool notification_show_autoconfig;
|
||||
bool notification_show_cheats_applied;
|
||||
bool notification_show_remap_load;
|
||||
bool notification_show_config_override_load;
|
||||
bool notification_show_set_initial_disk;
|
||||
bool notification_show_fast_forward;
|
||||
bool notification_show_screenshot;
|
||||
bool menu_widget_scale_auto;
|
||||
bool menu_show_start_screen;
|
||||
bool menu_pause_libretro;
|
||||
@@ -207,7 +199,6 @@ typedef struct settings
|
||||
bool menu_show_video_layout;
|
||||
#endif
|
||||
bool menu_materialui_icons_enable;
|
||||
bool menu_materialui_playlist_icons_enable;
|
||||
bool menu_materialui_show_nav_bar;
|
||||
bool menu_materialui_auto_rotate_nav_bar;
|
||||
bool menu_materialui_dual_thumbnail_list_view_enable;
|
||||
@@ -220,7 +211,6 @@ typedef struct settings
|
||||
bool menu_rgui_inline_thumbnails;
|
||||
bool menu_rgui_swap_thumbnails;
|
||||
bool menu_rgui_extended_ascii;
|
||||
bool menu_rgui_switch_icons;
|
||||
bool menu_xmb_shadows_enable;
|
||||
bool menu_xmb_vertical_thumbnails;
|
||||
bool menu_content_show_settings;
|
||||
@@ -232,7 +222,6 @@ typedef struct settings
|
||||
bool menu_content_show_history;
|
||||
bool menu_content_show_add;
|
||||
bool menu_content_show_playlists;
|
||||
bool menu_content_show_explore;
|
||||
bool menu_use_preferred_system_color_theme;
|
||||
bool menu_preferred_system_color_theme_set;
|
||||
bool menu_unified_controls;
|
||||
@@ -295,9 +284,7 @@ typedef struct settings
|
||||
|
||||
/* Network */
|
||||
bool network_buildbot_auto_extract_archive;
|
||||
bool network_buildbot_show_experimental_cores;
|
||||
bool network_on_demand_thumbnails;
|
||||
bool core_updater_auto_backup;
|
||||
|
||||
/* UI */
|
||||
bool ui_menubar_enable;
|
||||
@@ -316,15 +303,10 @@ typedef struct settings
|
||||
bool cheevos_badges_enable;
|
||||
bool cheevos_verbose_enable;
|
||||
bool cheevos_auto_screenshot;
|
||||
bool cheevos_start_active;
|
||||
bool cheevos_unlock_sound_enable;
|
||||
|
||||
/* Camera */
|
||||
bool camera_allow;
|
||||
|
||||
/* Bluetooth */
|
||||
bool bluetooth_allow;
|
||||
|
||||
/* WiFi */
|
||||
bool wifi_allow;
|
||||
|
||||
@@ -362,8 +344,6 @@ typedef struct settings
|
||||
bool savestate_auto_save;
|
||||
bool savestate_auto_load;
|
||||
bool savestate_thumbnail_enable;
|
||||
bool save_file_compression;
|
||||
bool savestate_file_compression;
|
||||
bool network_cmd_enable;
|
||||
bool stdin_cmd_enable;
|
||||
bool keymapper_enable;
|
||||
@@ -371,9 +351,6 @@ typedef struct settings
|
||||
bool network_remote_enable_user[MAX_USERS];
|
||||
bool load_dummy_on_core_shutdown;
|
||||
bool check_firmware_before_loading;
|
||||
#ifndef HAVE_DYNAMIC
|
||||
bool always_reload_core_on_run_content;
|
||||
#endif
|
||||
|
||||
bool game_specific_options;
|
||||
bool auto_overrides_enable;
|
||||
@@ -400,21 +377,18 @@ typedef struct settings
|
||||
|
||||
bool sustained_performance_mode;
|
||||
bool playlist_use_old_format;
|
||||
bool playlist_compression;
|
||||
bool content_runtime_log;
|
||||
bool content_runtime_log_aggregate;
|
||||
|
||||
bool playlist_sort_alphabetical;
|
||||
bool playlist_show_sublabels;
|
||||
bool playlist_fuzzy_archive_match;
|
||||
bool playlist_portable_paths;
|
||||
|
||||
bool quit_press_twice;
|
||||
bool vibrate_on_keypress;
|
||||
bool enable_device_vibration;
|
||||
bool ozone_collapse_sidebar;
|
||||
bool ozone_truncate_playlist_name;
|
||||
bool ozone_sort_after_truncate_playlist_name;
|
||||
bool ozone_scroll_content_metadata;
|
||||
|
||||
bool log_to_file;
|
||||
@@ -457,8 +431,6 @@ typedef struct settings
|
||||
|
||||
float input_overlay_opacity;
|
||||
float input_overlay_scale;
|
||||
float input_overlay_center_x;
|
||||
float input_overlay_center_y;
|
||||
|
||||
float slowmotion_ratio;
|
||||
float fastforward_ratio;
|
||||
@@ -475,7 +447,6 @@ typedef struct settings
|
||||
int state_slot;
|
||||
int audio_wasapi_sh_buffer_length;
|
||||
int crt_switch_center_adjust;
|
||||
int crt_switch_porch_adjust;
|
||||
#ifdef HAVE_VULKAN
|
||||
int vulkan_gpu_index;
|
||||
#endif
|
||||
@@ -499,7 +470,6 @@ typedef struct settings
|
||||
unsigned audio_latency;
|
||||
|
||||
unsigned fps_update_interval;
|
||||
unsigned memory_update_interval;
|
||||
|
||||
unsigned input_block_timeout;
|
||||
|
||||
@@ -515,7 +485,6 @@ typedef struct settings
|
||||
#ifdef GEKKO
|
||||
unsigned input_mouse_scale;
|
||||
#endif
|
||||
unsigned input_hotkey_block_delay;
|
||||
unsigned input_menu_toggle_gamepad_combo;
|
||||
unsigned input_keyboard_gamepad_mapping_type;
|
||||
unsigned input_poll_type_behavior;
|
||||
@@ -566,14 +535,11 @@ typedef struct settings
|
||||
unsigned video_overscan_correction_bottom;
|
||||
#endif
|
||||
unsigned video_shader_delay;
|
||||
unsigned notification_show_screenshot_duration;
|
||||
unsigned notification_show_screenshot_flash;
|
||||
|
||||
/* Accessibility */
|
||||
unsigned accessibility_narrator_speech_speed;
|
||||
|
||||
unsigned menu_timedate_style;
|
||||
unsigned menu_timedate_date_separator;
|
||||
unsigned gfx_thumbnails;
|
||||
unsigned menu_left_thumbnails;
|
||||
unsigned gfx_thumbnail_upscale_threshold;
|
||||
@@ -603,7 +569,6 @@ typedef struct settings
|
||||
unsigned menu_rgui_aspect_ratio_lock;
|
||||
unsigned menu_rgui_particle_effect;
|
||||
unsigned menu_ticker_type;
|
||||
unsigned menu_content_show_add_entry;
|
||||
|
||||
unsigned playlist_entry_remove_enable;
|
||||
unsigned playlist_show_inline_core_name;
|
||||
@@ -646,8 +611,6 @@ typedef struct settings
|
||||
unsigned ai_service_mode;
|
||||
unsigned ai_service_target_lang;
|
||||
unsigned ai_service_source_lang;
|
||||
|
||||
unsigned core_updater_auto_backup_history_size;
|
||||
} uints;
|
||||
|
||||
struct
|
||||
@@ -663,7 +626,6 @@ typedef struct settings
|
||||
char video_driver[32];
|
||||
char record_driver[32];
|
||||
char camera_driver[32];
|
||||
char bluetooth_driver[32];
|
||||
char wifi_driver[32];
|
||||
char led_driver[32];
|
||||
char location_driver[32];
|
||||
@@ -784,15 +746,6 @@ typedef struct settings
|
||||
**/
|
||||
const char *config_get_default_camera(void);
|
||||
|
||||
/**
|
||||
* config_get_default_bluetooth:
|
||||
*
|
||||
* Gets default bluetooth driver.
|
||||
*
|
||||
* Returns: Default bluetooth driver.
|
||||
**/
|
||||
const char *config_get_default_bluetooth(void);
|
||||
|
||||
/**
|
||||
* config_get_default_wifi:
|
||||
*
|
||||
@@ -906,11 +859,11 @@ bool config_load_remap(const char *directory_input_remapping,
|
||||
|
||||
/**
|
||||
* config_save_autoconf_profile:
|
||||
* @device_name : Input device name
|
||||
* @path : Path that shall be written to.
|
||||
* @user : Controller number to save
|
||||
* Writes a controller autoconf file to disk.
|
||||
**/
|
||||
bool config_save_autoconf_profile(const char *device_name, unsigned user);
|
||||
bool config_save_autoconf_profile(const char *path, unsigned user);
|
||||
|
||||
/**
|
||||
* config_save_file:
|
||||
|
||||
@@ -43,7 +43,7 @@ typedef struct content_ctx_info
|
||||
bool content_load_ram_file(unsigned slot);
|
||||
|
||||
/* Save a RAM state from memory to disk. */
|
||||
bool content_save_ram_file(unsigned slot, bool compress);
|
||||
bool content_save_ram_file(unsigned slot);
|
||||
|
||||
/* Load a state from disk to memory. */
|
||||
bool content_load_state(const char* path, bool load_to_backup_buffer, bool autoload);
|
||||
@@ -51,9 +51,6 @@ bool content_load_state(const char* path, bool load_to_backup_buffer, bool autol
|
||||
/* Save a state from memory to disk. */
|
||||
bool content_save_state(const char *path, bool save_to_disk, bool autosave);
|
||||
|
||||
/* Waits for any in-progress save state tasks to finish */
|
||||
void content_wait_for_save_state_task(void);
|
||||
|
||||
/* Copy a save state. */
|
||||
bool content_rename_state(const char *origin, const char *dest);
|
||||
|
||||
@@ -85,6 +82,9 @@ bool content_reset_savestate_backups(void);
|
||||
bool content_undo_load_buf_is_empty(void);
|
||||
bool content_undo_save_buf_is_empty(void);
|
||||
|
||||
/* Checks if launched from the commandline */
|
||||
bool content_launched_from_cli(void);
|
||||
|
||||
/* Clears the pending subsystem rom buffer */
|
||||
bool content_is_subsystem_pending_load(void);
|
||||
|
||||
|
||||
@@ -156,9 +156,7 @@ typedef struct retro_callbacks
|
||||
|
||||
bool core_set_default_callbacks(struct retro_callbacks *cbs);
|
||||
|
||||
#ifdef HAVE_REWIND
|
||||
bool core_set_rewind_callbacks(void);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_NETWORKING
|
||||
bool core_set_netplay_callbacks(void);
|
||||
|
||||
-767
@@ -1,767 +0,0 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2011-2017 - Daniel De Matteis
|
||||
* Copyright (C) 2014-2017 - Jean-André Santoni
|
||||
* Copyright (C) 2016-2019 - Brad Parker
|
||||
* Copyright (C) 2019-2020 - James Leaver
|
||||
*
|
||||
* 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 <string/stdstring.h>
|
||||
#include <lists/string_list.h>
|
||||
#include <file/file_path.h>
|
||||
#include <streams/interface_stream.h>
|
||||
#include <streams/file_stream.h>
|
||||
#include <lists/dir_list.h>
|
||||
#include <time/rtime.h>
|
||||
#include <retro_miscellaneous.h>
|
||||
|
||||
#include "frontend/frontend_driver.h"
|
||||
#include "file_path_special.h"
|
||||
#include "verbosity.h"
|
||||
|
||||
#include "core_backup.h"
|
||||
|
||||
/* Holds all entries in a core backup list */
|
||||
struct core_backup_list
|
||||
{
|
||||
size_t size;
|
||||
size_t capacity;
|
||||
core_backup_list_entry_t *entries;
|
||||
};
|
||||
|
||||
/*********************/
|
||||
/* Utility Functions */
|
||||
/*********************/
|
||||
|
||||
/* Generates backup directory path for specified core.
|
||||
* Returns false if 'core_path' and/or 'dir_core_assets'
|
||||
* are invalid, or a filesystem error occurs */
|
||||
static bool core_backup_get_backup_dir(
|
||||
const char *dir_libretro, const char *dir_core_assets,
|
||||
const char *core_filename,
|
||||
char *backup_dir, size_t len)
|
||||
{
|
||||
char *last_underscore = NULL;
|
||||
char core_file_id[PATH_MAX_LENGTH];
|
||||
char tmp[PATH_MAX_LENGTH];
|
||||
|
||||
core_file_id[0] = '\0';
|
||||
tmp[0] = '\0';
|
||||
|
||||
/* Extract core file 'ID' (name without extension + suffix)
|
||||
* from core path */
|
||||
if (string_is_empty(dir_libretro) ||
|
||||
string_is_empty(core_filename) ||
|
||||
(len < 1))
|
||||
return false;
|
||||
|
||||
strlcpy(core_file_id, core_filename, sizeof(core_file_id));
|
||||
|
||||
/* > Remove file extension */
|
||||
path_remove_extension(core_file_id);
|
||||
|
||||
if (string_is_empty(core_file_id))
|
||||
return false;
|
||||
|
||||
/* > Remove platform-specific file name suffix,
|
||||
* if required */
|
||||
last_underscore = strrchr(core_file_id, '_');
|
||||
|
||||
if (!string_is_empty(last_underscore))
|
||||
if (!string_is_equal(last_underscore, "_libretro"))
|
||||
*last_underscore = '\0';
|
||||
|
||||
if (string_is_empty(core_file_id))
|
||||
return false;
|
||||
|
||||
/* Get core backup directory
|
||||
* > If no assets directory is defined, use
|
||||
* core directory as a base */
|
||||
fill_pathname_join(tmp, string_is_empty(dir_core_assets) ?
|
||||
dir_libretro : dir_core_assets,
|
||||
"core_backups", sizeof(tmp));
|
||||
|
||||
fill_pathname_join(backup_dir, tmp,
|
||||
core_file_id, len);
|
||||
|
||||
if (string_is_empty(backup_dir))
|
||||
return false;
|
||||
|
||||
/* > Create directory, if required */
|
||||
if (!path_is_directory(backup_dir))
|
||||
{
|
||||
if (!path_mkdir(backup_dir))
|
||||
{
|
||||
RARCH_ERR("[core backup] Failed to create backup directory: %s.\n", backup_dir);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Generates a timestamped core backup file path from
|
||||
* the specified core path. Returns true if successful */
|
||||
bool core_backup_get_backup_path(
|
||||
const char *core_path, uint32_t crc, enum core_backup_mode backup_mode,
|
||||
const char *dir_core_assets, char *backup_path, size_t len)
|
||||
{
|
||||
int n;
|
||||
time_t current_time;
|
||||
struct tm time_info;
|
||||
const char *core_filename = NULL;
|
||||
char core_dir[PATH_MAX_LENGTH];
|
||||
char backup_dir[PATH_MAX_LENGTH];
|
||||
char backup_filename[PATH_MAX_LENGTH];
|
||||
|
||||
core_dir[0] = '\0';
|
||||
backup_dir[0] = '\0';
|
||||
backup_filename[0] = '\0';
|
||||
|
||||
/* Get core filename and parent directory */
|
||||
if (string_is_empty(core_path))
|
||||
return false;
|
||||
|
||||
core_filename = path_basename(core_path);
|
||||
|
||||
if (string_is_empty(core_filename))
|
||||
return false;
|
||||
|
||||
fill_pathname_parent_dir(core_dir, core_path, sizeof(core_dir));
|
||||
|
||||
if (string_is_empty(core_dir))
|
||||
return false;
|
||||
|
||||
/* Get backup directory */
|
||||
if (!core_backup_get_backup_dir(core_dir, dir_core_assets, core_filename,
|
||||
backup_dir, sizeof(backup_dir)))
|
||||
return false;
|
||||
|
||||
/* Get current time */
|
||||
time(¤t_time);
|
||||
rtime_localtime(¤t_time, &time_info);
|
||||
|
||||
/* Generate backup filename */
|
||||
n = snprintf(backup_filename, sizeof(backup_filename),
|
||||
"%s.%04u%02u%02uT%02u%02u%02u.%08x.%u%s",
|
||||
core_filename,
|
||||
(unsigned)time_info.tm_year + 1900,
|
||||
(unsigned)time_info.tm_mon + 1,
|
||||
(unsigned)time_info.tm_mday,
|
||||
(unsigned)time_info.tm_hour,
|
||||
(unsigned)time_info.tm_min,
|
||||
(unsigned)time_info.tm_sec,
|
||||
crc,
|
||||
(unsigned)backup_mode,
|
||||
file_path_str(FILE_PATH_CORE_BACKUP_EXTENSION));
|
||||
|
||||
if ((n < 0) || (n >= 128))
|
||||
n = 0; /* Silence GCC warnings... */
|
||||
|
||||
/* Build final path */
|
||||
fill_pathname_join(backup_path, backup_dir,
|
||||
backup_filename, len);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Returns detected type of specified core backup file */
|
||||
enum core_backup_type core_backup_get_backup_type(const char *backup_path)
|
||||
{
|
||||
const char *backup_ext = NULL;
|
||||
struct string_list *metadata_list = NULL;
|
||||
char core_ext[255];
|
||||
|
||||
core_ext[0] = '\0';
|
||||
|
||||
if (string_is_empty(backup_path) || !path_is_valid(backup_path))
|
||||
goto error;
|
||||
|
||||
/* Get backup file extension */
|
||||
backup_ext = path_get_extension(backup_path);
|
||||
|
||||
if (string_is_empty(backup_ext))
|
||||
goto error;
|
||||
|
||||
/* Get platform-specific dynamic library extension */
|
||||
if (!frontend_driver_get_core_extension(core_ext, sizeof(core_ext)))
|
||||
goto error;
|
||||
|
||||
/* Check if this is an archived backup */
|
||||
if (string_is_equal_noncase(backup_ext,
|
||||
file_path_str(FILE_PATH_CORE_BACKUP_EXTENSION_NO_DOT)))
|
||||
{
|
||||
const char *backup_filename = NULL;
|
||||
const char *src_ext = NULL;
|
||||
|
||||
/* Split the backup filename into its various
|
||||
* metadata components */
|
||||
backup_filename = path_basename(backup_path);
|
||||
|
||||
if (string_is_empty(backup_filename))
|
||||
goto error;
|
||||
|
||||
metadata_list = string_split(backup_filename, ".");
|
||||
|
||||
if (!metadata_list || (metadata_list->size != 6))
|
||||
goto error;
|
||||
|
||||
/* Get extension of source core file */
|
||||
src_ext = metadata_list->elems[1].data;
|
||||
|
||||
if (string_is_empty(src_ext))
|
||||
goto error;
|
||||
|
||||
/* Check whether extension is valid */
|
||||
if (!string_is_equal_noncase(src_ext, core_ext))
|
||||
goto error;
|
||||
|
||||
string_list_free(metadata_list);
|
||||
metadata_list = NULL;
|
||||
|
||||
return CORE_BACKUP_TYPE_ARCHIVE;
|
||||
}
|
||||
|
||||
/* Check if this is a plain dynamic library file */
|
||||
if (string_is_equal_noncase(backup_ext, core_ext))
|
||||
return CORE_BACKUP_TYPE_LIB;
|
||||
|
||||
error:
|
||||
if (metadata_list)
|
||||
{
|
||||
string_list_free(metadata_list);
|
||||
metadata_list = NULL;
|
||||
}
|
||||
|
||||
return CORE_BACKUP_TYPE_INVALID;
|
||||
}
|
||||
|
||||
/* Fetches crc value of specified core backup file.
|
||||
* Returns true if successful */
|
||||
bool core_backup_get_backup_crc(char *backup_path, uint32_t *crc)
|
||||
{
|
||||
struct string_list *metadata_list = NULL;
|
||||
enum core_backup_type backup_type;
|
||||
|
||||
if (string_is_empty(backup_path) || !crc)
|
||||
goto error;
|
||||
|
||||
/* Get backup type */
|
||||
backup_type = core_backup_get_backup_type(backup_path);
|
||||
|
||||
switch (backup_type)
|
||||
{
|
||||
case CORE_BACKUP_TYPE_ARCHIVE:
|
||||
{
|
||||
const char *backup_filename = NULL;
|
||||
const char *crc_str = NULL;
|
||||
|
||||
/* Split the backup filename into its various
|
||||
* metadata components */
|
||||
backup_filename = path_basename(backup_path);
|
||||
|
||||
if (string_is_empty(backup_filename))
|
||||
goto error;
|
||||
|
||||
metadata_list = string_split(backup_filename, ".");
|
||||
|
||||
if (!metadata_list || (metadata_list->size != 6))
|
||||
goto error;
|
||||
|
||||
/* Get crc string */
|
||||
crc_str = metadata_list->elems[3].data;
|
||||
|
||||
if (string_is_empty(crc_str))
|
||||
goto error;
|
||||
|
||||
/* Convert to an integer */
|
||||
*crc = (uint32_t)string_hex_to_unsigned(crc_str);
|
||||
|
||||
if (*crc == 0)
|
||||
goto error;
|
||||
|
||||
string_list_free(metadata_list);
|
||||
metadata_list = NULL;
|
||||
|
||||
}
|
||||
return true;
|
||||
case CORE_BACKUP_TYPE_LIB:
|
||||
{
|
||||
intfstream_t *backup_file = NULL;
|
||||
|
||||
/* This is a plain dynamic library file,
|
||||
* have to read file data to determine crc */
|
||||
|
||||
/* Open backup file */
|
||||
backup_file = intfstream_open_file(
|
||||
backup_path, RETRO_VFS_FILE_ACCESS_READ,
|
||||
RETRO_VFS_FILE_ACCESS_HINT_NONE);
|
||||
|
||||
if (backup_file)
|
||||
{
|
||||
bool success;
|
||||
|
||||
/* Get crc value */
|
||||
success = intfstream_get_crc(backup_file, crc);
|
||||
|
||||
/* Close backup file */
|
||||
intfstream_close(backup_file);
|
||||
free(backup_file);
|
||||
backup_file = NULL;
|
||||
|
||||
return success;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
/* Backup is invalid */
|
||||
break;
|
||||
}
|
||||
|
||||
error:
|
||||
if (metadata_list)
|
||||
{
|
||||
string_list_free(metadata_list);
|
||||
metadata_list = NULL;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Fetches core path associated with specified core
|
||||
* backup file. Returns detected type of backup
|
||||
* file - CORE_BACKUP_TYPE_INVALID indicates that
|
||||
* backup file cannot be restored/installed, or
|
||||
* arguments are otherwise invalid */
|
||||
enum core_backup_type core_backup_get_core_path(
|
||||
const char *backup_path, const char *dir_libretro,
|
||||
char *core_path, size_t len)
|
||||
{
|
||||
const char *backup_filename = NULL;
|
||||
char *core_filename = NULL;
|
||||
enum core_backup_type backup_type = CORE_BACKUP_TYPE_INVALID;
|
||||
|
||||
if (string_is_empty(backup_path) || string_is_empty(dir_libretro))
|
||||
return backup_type;
|
||||
|
||||
backup_filename = path_basename(backup_path);
|
||||
|
||||
if (string_is_empty(backup_filename))
|
||||
return backup_type;
|
||||
|
||||
/* Check backup type */
|
||||
switch (core_backup_get_backup_type(backup_path))
|
||||
{
|
||||
case CORE_BACKUP_TYPE_ARCHIVE:
|
||||
{
|
||||
char *period = NULL;
|
||||
|
||||
/* This is an archived backup with timestamp/crc
|
||||
* metadata in the filename */
|
||||
core_filename = strdup(backup_filename);
|
||||
|
||||
/* Find the location of the second period */
|
||||
period = strchr(core_filename, '.');
|
||||
if (!period || (*(++period) == '\0'))
|
||||
break;
|
||||
|
||||
period = strchr(period, '.');
|
||||
if (!period)
|
||||
break;
|
||||
|
||||
/* Trim everything after (and including) the
|
||||
* second period */
|
||||
*period = '\0';
|
||||
|
||||
if (string_is_empty(core_filename))
|
||||
break;
|
||||
|
||||
/* All good - build core path */
|
||||
fill_pathname_join(core_path, dir_libretro,
|
||||
core_filename, len);
|
||||
|
||||
backup_type = CORE_BACKUP_TYPE_ARCHIVE;
|
||||
}
|
||||
break;
|
||||
case CORE_BACKUP_TYPE_LIB:
|
||||
/* This is a plain dynamic library file */
|
||||
fill_pathname_join(core_path, dir_libretro,
|
||||
backup_filename, len);
|
||||
backup_type = CORE_BACKUP_TYPE_LIB;
|
||||
break;
|
||||
default:
|
||||
/* Backup is invalid */
|
||||
break;
|
||||
}
|
||||
|
||||
if (core_filename)
|
||||
{
|
||||
free(core_filename);
|
||||
core_filename = NULL;
|
||||
}
|
||||
|
||||
return backup_type;
|
||||
}
|
||||
|
||||
/*************************/
|
||||
/* Backup List Functions */
|
||||
/*************************/
|
||||
|
||||
/**************************************/
|
||||
/* Initialisation / De-Initialisation */
|
||||
/**************************************/
|
||||
|
||||
/* Parses backup file name and adds to backup list, if valid */
|
||||
static bool core_backup_add_entry(core_backup_list_t *backup_list,
|
||||
const char *core_filename, const char *backup_path)
|
||||
{
|
||||
char *backup_filename = NULL;
|
||||
core_backup_list_entry_t *entry = NULL;
|
||||
unsigned backup_mode = 0;
|
||||
|
||||
if (!backup_list ||
|
||||
string_is_empty(core_filename) ||
|
||||
string_is_empty(backup_path) ||
|
||||
(backup_list->size >= backup_list->capacity))
|
||||
goto error;
|
||||
|
||||
backup_filename = strdup(path_basename(backup_path));
|
||||
|
||||
if (string_is_empty(backup_filename))
|
||||
goto error;
|
||||
|
||||
/* Ensure base backup filename matches core */
|
||||
if (!string_starts_with(backup_filename, core_filename))
|
||||
goto error;
|
||||
|
||||
/* Remove backup file extension */
|
||||
path_remove_extension(backup_filename);
|
||||
|
||||
/* Parse backup filename metadata
|
||||
* - <core_filename>.<timestamp>.<crc>.<backup_mode>
|
||||
* - timestamp: YYYYMMDDTHHMMSS */
|
||||
entry = &backup_list->entries[backup_list->size];
|
||||
|
||||
if (sscanf(backup_filename + strlen(core_filename),
|
||||
".%04u%02u%02uT%02u%02u%02u.%08x.%u",
|
||||
&entry->date.year, &entry->date.month, &entry->date.day,
|
||||
&entry->date.hour, &entry->date.minute, &entry->date.second,
|
||||
&entry->crc, &backup_mode) != 8)
|
||||
goto error;
|
||||
|
||||
entry->backup_mode = (enum core_backup_mode)backup_mode;
|
||||
|
||||
/* Cache backup path */
|
||||
entry->backup_path = strdup(backup_path);
|
||||
backup_list->size++;
|
||||
|
||||
free(backup_filename);
|
||||
|
||||
return true;
|
||||
|
||||
error:
|
||||
if (backup_filename)
|
||||
free(backup_filename);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Creates a new core backup list containing entries
|
||||
* for all existing backup files.
|
||||
* Returns a handle to a new core_backup_list_t object
|
||||
* on success, otherwise returns NULL. */
|
||||
core_backup_list_t *core_backup_list_init(
|
||||
const char *core_path, const char *dir_core_assets)
|
||||
{
|
||||
size_t i;
|
||||
const char *core_filename = NULL;
|
||||
struct string_list *dir_list = NULL;
|
||||
core_backup_list_t *backup_list = NULL;
|
||||
core_backup_list_entry_t *entries = NULL;
|
||||
char core_dir[PATH_MAX_LENGTH];
|
||||
char backup_dir[PATH_MAX_LENGTH];
|
||||
|
||||
core_dir[0] = '\0';
|
||||
backup_dir[0] = '\0';
|
||||
|
||||
/* Get core filename and parent directory */
|
||||
if (string_is_empty(core_path))
|
||||
goto error;
|
||||
|
||||
core_filename = path_basename(core_path);
|
||||
|
||||
if (string_is_empty(core_filename))
|
||||
goto error;
|
||||
|
||||
fill_pathname_parent_dir(core_dir, core_path, sizeof(core_dir));
|
||||
|
||||
if (string_is_empty(core_dir))
|
||||
goto error;
|
||||
|
||||
/* Get backup directory */
|
||||
if (!core_backup_get_backup_dir(core_dir, dir_core_assets, core_filename,
|
||||
backup_dir, sizeof(backup_dir)))
|
||||
goto error;
|
||||
|
||||
/* Get backup file list */
|
||||
dir_list = dir_list_new(
|
||||
backup_dir,
|
||||
file_path_str(FILE_PATH_CORE_BACKUP_EXTENSION),
|
||||
false, /* include_dirs */
|
||||
false, /* include_hidden */
|
||||
false, /* include_compressed */
|
||||
false /* recursive */
|
||||
);
|
||||
|
||||
/* Sanity check */
|
||||
if (!dir_list)
|
||||
goto error;
|
||||
|
||||
if (dir_list->size < 1)
|
||||
goto error;
|
||||
|
||||
/* Ensure list is sorted in alphabetical order
|
||||
* > This corresponds to 'timestamp' order */
|
||||
dir_list_sort(dir_list, true);
|
||||
|
||||
/* Create core backup list */
|
||||
backup_list = (core_backup_list_t*)malloc(sizeof(*backup_list));
|
||||
|
||||
if (!backup_list)
|
||||
goto error;
|
||||
|
||||
backup_list->entries = NULL;
|
||||
backup_list->capacity = 0;
|
||||
backup_list->size = 0;
|
||||
|
||||
/* Create entries array
|
||||
* (Note: Set this to the full size of the directory
|
||||
* list - this may be larger than we need, but saves
|
||||
* many inefficiencies later) */
|
||||
entries = (core_backup_list_entry_t*)
|
||||
calloc(dir_list->size, sizeof(*entries));
|
||||
|
||||
if (!entries)
|
||||
goto error;
|
||||
|
||||
backup_list->entries = entries;
|
||||
backup_list->capacity = dir_list->size;
|
||||
|
||||
/* Loop over backup files and parse file names */
|
||||
for (i = 0; i < dir_list->size; i++)
|
||||
{
|
||||
const char *backup_path = dir_list->elems[i].data;
|
||||
core_backup_add_entry(backup_list, core_filename, backup_path);
|
||||
}
|
||||
|
||||
if (backup_list->size == 0)
|
||||
goto error;
|
||||
|
||||
string_list_free(dir_list);
|
||||
|
||||
return backup_list;
|
||||
|
||||
error:
|
||||
if (dir_list)
|
||||
string_list_free(dir_list);
|
||||
|
||||
if (backup_list)
|
||||
core_backup_list_free(backup_list);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Frees specified core backup list */
|
||||
void core_backup_list_free(core_backup_list_t *backup_list)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
if (!backup_list)
|
||||
return;
|
||||
|
||||
if (backup_list->entries)
|
||||
{
|
||||
for (i = 0; i < backup_list->size; i++)
|
||||
{
|
||||
core_backup_list_entry_t *entry = &backup_list->entries[i];
|
||||
|
||||
if (!entry)
|
||||
continue;
|
||||
|
||||
if (entry->backup_path)
|
||||
{
|
||||
free(entry->backup_path);
|
||||
entry->backup_path = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
free(backup_list->entries);
|
||||
backup_list->entries = NULL;
|
||||
}
|
||||
|
||||
free(backup_list);
|
||||
}
|
||||
|
||||
/***********/
|
||||
/* Getters */
|
||||
/***********/
|
||||
|
||||
/* Returns number of entries in core backup list */
|
||||
size_t core_backup_list_size(core_backup_list_t *backup_list)
|
||||
{
|
||||
if (!backup_list)
|
||||
return 0;
|
||||
|
||||
return backup_list->size;
|
||||
}
|
||||
|
||||
/* Returns number of entries of specified 'backup mode'
|
||||
* (manual or automatic) in core backup list */
|
||||
size_t core_backup_list_get_num_backups(
|
||||
core_backup_list_t *backup_list,
|
||||
enum core_backup_mode backup_mode)
|
||||
{
|
||||
size_t i;
|
||||
size_t num_backups = 0;
|
||||
|
||||
if (!backup_list || !backup_list->entries)
|
||||
return 0;
|
||||
|
||||
for (i = 0; i < backup_list->size; i++)
|
||||
{
|
||||
core_backup_list_entry_t *current_entry = &backup_list->entries[i];
|
||||
|
||||
if (current_entry &&
|
||||
(current_entry->backup_mode == backup_mode))
|
||||
num_backups++;
|
||||
}
|
||||
|
||||
return num_backups;
|
||||
}
|
||||
|
||||
/* Fetches core backup list entry corresponding
|
||||
* to the specified entry index.
|
||||
* Returns false if index is invalid. */
|
||||
bool core_backup_list_get_index(
|
||||
core_backup_list_t *backup_list,
|
||||
size_t idx,
|
||||
const core_backup_list_entry_t **entry)
|
||||
{
|
||||
if (!backup_list || !backup_list->entries || !entry)
|
||||
return false;
|
||||
|
||||
if (idx >= backup_list->size)
|
||||
return false;
|
||||
|
||||
*entry = &backup_list->entries[idx];
|
||||
|
||||
if (*entry)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Fetches core backup list entry corresponding
|
||||
* to the specified core crc checksum value.
|
||||
* Note that 'manual' and 'auto' backups are
|
||||
* considered independent - we only compare
|
||||
* crc values for the specified backup_mode.
|
||||
* Returns false if entry is not found. */
|
||||
bool core_backup_list_get_crc(
|
||||
core_backup_list_t *backup_list,
|
||||
uint32_t crc, enum core_backup_mode backup_mode,
|
||||
const core_backup_list_entry_t **entry)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
if (!backup_list || !backup_list->entries || !entry)
|
||||
return false;
|
||||
|
||||
for (i = 0; i < backup_list->size; i++)
|
||||
{
|
||||
core_backup_list_entry_t *current_entry = &backup_list->entries[i];
|
||||
|
||||
if (current_entry &&
|
||||
(current_entry->crc == crc) &&
|
||||
(current_entry->backup_mode == backup_mode))
|
||||
{
|
||||
*entry = current_entry;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Fetches a string representation of a backup
|
||||
* list entry timestamp.
|
||||
* Returns false in the event of an error */
|
||||
bool core_backup_list_get_entry_timestamp_str(
|
||||
const core_backup_list_entry_t *entry,
|
||||
enum core_backup_date_separator_type date_separator,
|
||||
char *timestamp, size_t len)
|
||||
{
|
||||
int n;
|
||||
const char *format_str = "";
|
||||
|
||||
if (!entry || (len < 20))
|
||||
return false;
|
||||
|
||||
/* Get time format string */
|
||||
switch (date_separator)
|
||||
{
|
||||
case CORE_BACKUP_DATE_SEPARATOR_SLASH:
|
||||
format_str = "%04u/%02u/%02u %02u:%02u:%02u";
|
||||
break;
|
||||
case CORE_BACKUP_DATE_SEPARATOR_PERIOD:
|
||||
format_str = "%04u.%02u.%02u %02u:%02u:%02u";
|
||||
break;
|
||||
default:
|
||||
format_str = "%04u-%02u-%02u %02u:%02u:%02u";
|
||||
break;
|
||||
}
|
||||
|
||||
n = snprintf(timestamp, len,
|
||||
format_str,
|
||||
entry->date.year,
|
||||
entry->date.month,
|
||||
entry->date.day,
|
||||
entry->date.hour,
|
||||
entry->date.minute,
|
||||
entry->date.second);
|
||||
|
||||
if ((n < 0) || (n >= 32))
|
||||
n = 0; /* Silence GCC warnings... */
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Fetches a string representation of a backup
|
||||
* list entry crc value.
|
||||
* Returns false in the event of an error */
|
||||
bool core_backup_list_get_entry_crc_str(
|
||||
const core_backup_list_entry_t *entry,
|
||||
char *crc, size_t len)
|
||||
{
|
||||
int n;
|
||||
|
||||
if (!entry || (len < 9))
|
||||
return false;
|
||||
|
||||
n = snprintf(crc, len, "%08x", entry->crc);
|
||||
|
||||
if ((n < 0) || (n >= 32))
|
||||
n = 0; /* Silence GCC warnings... */
|
||||
|
||||
return true;
|
||||
}
|
||||
-177
@@ -1,177 +0,0 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2011-2017 - Daniel De Matteis
|
||||
* Copyright (C) 2014-2017 - Jean-André Santoni
|
||||
* Copyright (C) 2016-2019 - Brad Parker
|
||||
* Copyright (C) 2019-2020 - James Leaver
|
||||
*
|
||||
* 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 __CORE_BACKUP_H
|
||||
#define __CORE_BACKUP_H
|
||||
|
||||
#include <retro_common_api.h>
|
||||
#include <libretro.h>
|
||||
|
||||
#include <boolean.h>
|
||||
|
||||
RETRO_BEGIN_DECLS
|
||||
|
||||
/* Defines the various types of supported core backup
|
||||
* file. Allows us to handle manual core installs
|
||||
* (via downloaded/compiled dynamic libraries dropped
|
||||
* in the 'downloads' folder) using the same task
|
||||
* interface as 'managed'/archived backups */
|
||||
enum core_backup_type
|
||||
{
|
||||
CORE_BACKUP_TYPE_INVALID = 0,
|
||||
CORE_BACKUP_TYPE_ARCHIVE,
|
||||
CORE_BACKUP_TYPE_LIB
|
||||
};
|
||||
|
||||
/* Used to distinguish manual and automatic
|
||||
* core backups */
|
||||
enum core_backup_mode
|
||||
{
|
||||
CORE_BACKUP_MODE_MANUAL = 0,
|
||||
CORE_BACKUP_MODE_AUTO
|
||||
};
|
||||
|
||||
/* Note: These must be kept synchronised with
|
||||
* 'enum menu_timedate_date_separator_type' in
|
||||
* 'menu_defines.h' */
|
||||
enum core_backup_date_separator_type
|
||||
{
|
||||
CORE_BACKUP_DATE_SEPARATOR_HYPHEN = 0,
|
||||
CORE_BACKUP_DATE_SEPARATOR_SLASH,
|
||||
CORE_BACKUP_DATE_SEPARATOR_PERIOD,
|
||||
CORE_BACKUP_DATE_SEPARATOR_LAST
|
||||
};
|
||||
|
||||
/* Holds all timestamp info for a core backup file */
|
||||
typedef struct
|
||||
{
|
||||
unsigned year;
|
||||
unsigned month;
|
||||
unsigned day;
|
||||
unsigned hour;
|
||||
unsigned minute;
|
||||
unsigned second;
|
||||
} core_backup_list_date_t;
|
||||
|
||||
/* Holds all info related to a core backup file */
|
||||
typedef struct
|
||||
{
|
||||
char *backup_path;
|
||||
core_backup_list_date_t date;
|
||||
uint32_t crc;
|
||||
enum core_backup_mode backup_mode;
|
||||
} core_backup_list_entry_t;
|
||||
|
||||
/* Prevent direct access to core_backup_list_t
|
||||
* members */
|
||||
typedef struct core_backup_list core_backup_list_t;
|
||||
|
||||
/*********************/
|
||||
/* Utility Functions */
|
||||
/*********************/
|
||||
|
||||
/* Generates a timestamped core backup file path from
|
||||
* the specified core path. Returns true if successful */
|
||||
bool core_backup_get_backup_path(
|
||||
const char *core_path, uint32_t crc, enum core_backup_mode backup_mode,
|
||||
const char *dir_core_assets, char *backup_path, size_t len);
|
||||
|
||||
/* Returns detected type of specified core backup file */
|
||||
enum core_backup_type core_backup_get_backup_type(const char *backup_path);
|
||||
|
||||
/* Fetches crc value of specified core backup file.
|
||||
* Returns true if successful */
|
||||
bool core_backup_get_backup_crc(char *backup_path, uint32_t *crc);
|
||||
|
||||
/* Fetches core path associated with specified core
|
||||
* backup file. Returns detected type of backup
|
||||
* file - CORE_BACKUP_TYPE_INVALID indicates that
|
||||
* backup file cannot be restored/installed, or
|
||||
* arguments are otherwise invalid */
|
||||
enum core_backup_type core_backup_get_core_path(
|
||||
const char *backup_path, const char *dir_libretro,
|
||||
char *core_path, size_t len);
|
||||
|
||||
/*************************/
|
||||
/* Backup List Functions */
|
||||
/*************************/
|
||||
|
||||
/**************************************/
|
||||
/* Initialisation / De-Initialisation */
|
||||
/**************************************/
|
||||
|
||||
/* Creates a new core backup list containing entries
|
||||
* for all existing backup files.
|
||||
* Returns a handle to a new core_backup_list_t object
|
||||
* on success, otherwise returns NULL. */
|
||||
core_backup_list_t *core_backup_list_init(
|
||||
const char *core_path, const char *dir_core_assets);
|
||||
|
||||
/* Frees specified core backup list */
|
||||
void core_backup_list_free(core_backup_list_t *backup_list);
|
||||
|
||||
/***********/
|
||||
/* Getters */
|
||||
/***********/
|
||||
|
||||
/* Returns number of entries in core backup list */
|
||||
size_t core_backup_list_size(core_backup_list_t *backup_list);
|
||||
|
||||
/* Returns number of entries of specified 'backup mode'
|
||||
* (manual or automatic) in core backup list */
|
||||
size_t core_backup_list_get_num_backups(
|
||||
core_backup_list_t *backup_list,
|
||||
enum core_backup_mode backup_mode);
|
||||
|
||||
/* Fetches core backup list entry corresponding
|
||||
* to the specified entry index.
|
||||
* Returns false if index is invalid. */
|
||||
bool core_backup_list_get_index(
|
||||
core_backup_list_t *backup_list,
|
||||
size_t idx,
|
||||
const core_backup_list_entry_t **entry);
|
||||
|
||||
/* Fetches core backup list entry corresponding
|
||||
* to the specified core crc checksum value.
|
||||
* Note that 'manual' and 'auto' backups are
|
||||
* considered independent - we only compare
|
||||
* crc values for the specified backup_mode.
|
||||
* Returns false if entry is not found. */
|
||||
bool core_backup_list_get_crc(
|
||||
core_backup_list_t *backup_list,
|
||||
uint32_t crc, enum core_backup_mode backup_mode,
|
||||
const core_backup_list_entry_t **entry);
|
||||
|
||||
/* Fetches a string representation of a backup
|
||||
* list entry timestamp.
|
||||
* Returns false in the event of an error */
|
||||
bool core_backup_list_get_entry_timestamp_str(
|
||||
const core_backup_list_entry_t *entry,
|
||||
enum core_backup_date_separator_type date_separator,
|
||||
char *timestamp, size_t len);
|
||||
|
||||
/* Fetches a string representation of a backup
|
||||
* list entry crc value.
|
||||
* Returns false in the event of an error */
|
||||
bool core_backup_list_get_entry_crc_str(
|
||||
const core_backup_list_entry_t *entry,
|
||||
char *crc, size_t len);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
||||
+199
-557
File diff suppressed because it is too large.
Load diff
+3
-76
@@ -35,29 +35,10 @@ typedef struct
|
||||
bool optional;
|
||||
} core_info_firmware_t;
|
||||
|
||||
/* Simple container/convenience struct for
|
||||
* holding the 'id' of a core file
|
||||
* > 'id' is the filename without extension or
|
||||
* platform-specific suffix
|
||||
* > 'id' is used for core info searches - enables
|
||||
* matching regardless of core file base path,
|
||||
* and is platform-independent (e.g. an Android
|
||||
* core file will be correctly identified on Linux)
|
||||
* > 'len' is used to cache the length of 'str', for
|
||||
* improved performance when performing string
|
||||
* comparisons */
|
||||
typedef struct
|
||||
{
|
||||
char *str;
|
||||
size_t len;
|
||||
} core_file_id_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
bool supports_no_game;
|
||||
bool database_match_archive_member;
|
||||
bool is_experimental;
|
||||
bool is_locked;
|
||||
size_t firmware_count;
|
||||
char *path;
|
||||
void *config_data;
|
||||
@@ -75,7 +56,6 @@ typedef struct
|
||||
char *databases;
|
||||
char *notes;
|
||||
char *required_hw_api;
|
||||
char *description;
|
||||
struct string_list *categories_list;
|
||||
struct string_list *databases_list;
|
||||
struct string_list *note_list;
|
||||
@@ -85,20 +65,9 @@ typedef struct
|
||||
struct string_list *licenses_list;
|
||||
struct string_list *required_hw_api_list;
|
||||
core_info_firmware_t *firmware;
|
||||
core_file_id_t core_file_id;
|
||||
void *userdata;
|
||||
} core_info_t;
|
||||
|
||||
/* A subset of core_info parameters required for
|
||||
* core updater tasks */
|
||||
typedef struct
|
||||
{
|
||||
bool is_experimental;
|
||||
char *display_name;
|
||||
char *description;
|
||||
char *licenses;
|
||||
} core_updater_info_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
core_info_t *list;
|
||||
@@ -129,18 +98,6 @@ enum core_info_list_qsort_type
|
||||
CORE_INFO_LIST_SORT_SYSTEM_NAME
|
||||
};
|
||||
|
||||
struct core_info_state
|
||||
{
|
||||
#ifdef HAVE_COMPRESSION
|
||||
const struct string_list *tmp_list;
|
||||
#endif
|
||||
const char *tmp_path;
|
||||
core_info_t *current;
|
||||
core_info_list_t *curr_list;
|
||||
};
|
||||
|
||||
typedef struct core_info_state core_info_state_t;
|
||||
|
||||
size_t core_info_list_num_info_files(core_info_list_t *list);
|
||||
|
||||
/* Non-reentrant, does not allocate. Returns pointer to internal state. */
|
||||
@@ -152,14 +109,6 @@ bool core_info_list_get_display_name(core_info_list_t *list,
|
||||
|
||||
bool core_info_get_display_name(const char *path, char *s, size_t len);
|
||||
|
||||
/* Returns core_info parameters required for
|
||||
* core updater tasks, read from specified file.
|
||||
* Returned core_updater_info_t object must be
|
||||
* freed using core_info_free_core_updater_info().
|
||||
* Returns NULL if 'path' is invalid. */
|
||||
core_updater_info_t *core_info_get_core_updater_info(const char *path);
|
||||
void core_info_free_core_updater_info(core_updater_info_t *info);
|
||||
|
||||
void core_info_get_name(const char *path, char *s, size_t len,
|
||||
const char *path_info, const char *dir_cores,
|
||||
const char *exts, bool show_hidden_files,
|
||||
@@ -167,7 +116,7 @@ void core_info_get_name(const char *path, char *s, size_t len,
|
||||
|
||||
core_info_t *core_info_get(core_info_list_t *list, size_t i);
|
||||
|
||||
void core_info_free_current_core(core_info_state_t *p_coreinfo);
|
||||
void core_info_free_current_core(void);
|
||||
|
||||
bool core_info_init_current_core(void);
|
||||
|
||||
@@ -183,11 +132,9 @@ bool core_info_get_list(core_info_list_t **core);
|
||||
bool core_info_list_update_missing_firmware(core_info_ctx_firmware_t *info,
|
||||
bool *set_missing_bios);
|
||||
|
||||
bool core_info_find(core_info_ctx_find_t *info);
|
||||
bool core_info_find(core_info_ctx_find_t *info, const char *name);
|
||||
|
||||
bool core_info_load(
|
||||
core_info_ctx_find_t *info,
|
||||
core_info_state_t *p_coreinfo);
|
||||
bool core_info_load(core_info_ctx_find_t *info);
|
||||
|
||||
bool core_info_database_supports_content_path(const char *database_path, const char *path);
|
||||
|
||||
@@ -202,26 +149,6 @@ bool core_info_list_get_info(core_info_list_t *core_info_list,
|
||||
|
||||
bool core_info_hw_api_supported(core_info_t *info);
|
||||
|
||||
/* Sets 'locked' status of specified core
|
||||
* > Returns true if successful
|
||||
* > Like all functions that access the cached
|
||||
* core info list this is *not* thread safe */
|
||||
bool core_info_set_core_lock(const char *core_path, bool lock);
|
||||
/* Fetches 'locked' status of specified core
|
||||
* > If 'validate_path' is 'true', will search
|
||||
* cached core info list for a corresponding
|
||||
* 'sanitised' core file path. This is *not*
|
||||
* thread safe
|
||||
* > If 'validate_path' is 'false', performs a
|
||||
* direct filesystem check. This *is* thread
|
||||
* safe, but validity of specified core path
|
||||
* must be checked externally */
|
||||
bool core_info_get_core_lock(const char *core_path, bool validate_path);
|
||||
|
||||
core_info_state_t *coreinfo_get_ptr(void);
|
||||
|
||||
bool core_info_core_file_id_is_equal(const char* core_path_a, const char* core_path_b);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif /* CORE_INFO_H_ */
|
||||
+22
-106
@@ -82,18 +82,6 @@ static void core_updater_list_free_entry(core_updater_list_entry_t *entry)
|
||||
free(entry->display_name);
|
||||
entry->display_name = NULL;
|
||||
}
|
||||
|
||||
if (entry->description)
|
||||
{
|
||||
free(entry->description);
|
||||
entry->description = NULL;
|
||||
}
|
||||
|
||||
if (entry->licenses_list)
|
||||
{
|
||||
string_list_free(entry->licenses_list);
|
||||
entry->licenses_list = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* Creates a new, empty core updater list.
|
||||
@@ -109,7 +97,7 @@ core_updater_list_t *core_updater_list_init(size_t max_size)
|
||||
return NULL;
|
||||
|
||||
/* Create core updater list */
|
||||
core_list = (core_updater_list_t*)malloc(sizeof(*core_list));
|
||||
core_list = (core_updater_list_t*)calloc(1, sizeof(*core_list));
|
||||
|
||||
if (!core_list)
|
||||
return NULL;
|
||||
@@ -422,11 +410,13 @@ static bool core_updater_list_set_paths(
|
||||
char remote_core_path[PATH_MAX_LENGTH];
|
||||
char local_core_path[PATH_MAX_LENGTH];
|
||||
char local_info_path[PATH_MAX_LENGTH];
|
||||
char display_name[255];
|
||||
bool is_archive;
|
||||
|
||||
remote_core_path[0] = '\0';
|
||||
local_core_path[0] = '\0';
|
||||
local_info_path[0] = '\0';
|
||||
display_name[0] = '\0';
|
||||
|
||||
if (!entry || string_is_empty(filename_str))
|
||||
return false;
|
||||
@@ -509,8 +499,10 @@ static bool core_updater_list_set_paths(
|
||||
last_underscore = (char*)strrchr(local_info_path, '_');
|
||||
|
||||
if (!string_is_empty(last_underscore))
|
||||
if (!string_is_equal(last_underscore, "_libretro"))
|
||||
{
|
||||
if (string_is_not_equal_fast(last_underscore, "_libretro", 9))
|
||||
*last_underscore = '\0';
|
||||
}
|
||||
|
||||
/* > Add proper file extension */
|
||||
strlcat(
|
||||
@@ -526,94 +518,29 @@ static bool core_updater_list_set_paths(
|
||||
|
||||
entry->local_info_path = strdup(local_info_path);
|
||||
|
||||
return true;
|
||||
}
|
||||
/* display_name
|
||||
* > Note: It's a bit rubbish that we have to
|
||||
* read the actual core info files here...
|
||||
* Would be better to cache this globally
|
||||
* (at present, we only cache info for
|
||||
* *installed* cores...) */
|
||||
if (path_is_valid(local_info_path))
|
||||
if (!core_info_get_display_name(
|
||||
local_info_path, display_name, sizeof(display_name)))
|
||||
display_name[0] = '\0';
|
||||
|
||||
/* Reads info file associated with core and
|
||||
* adds relevant information to updater list
|
||||
* entry */
|
||||
static bool core_updater_list_set_core_info(
|
||||
core_updater_list_entry_t *entry,
|
||||
const char *local_info_path,
|
||||
const char *filename_str)
|
||||
{
|
||||
core_updater_info_t *core_info = NULL;
|
||||
/* > If info file does not exist, just use
|
||||
* core filename */
|
||||
if (string_is_empty(display_name))
|
||||
strlcpy(display_name, filename_str, sizeof(display_name));
|
||||
|
||||
if (!entry ||
|
||||
string_is_empty(local_info_path) ||
|
||||
string_is_empty(filename_str))
|
||||
return false;
|
||||
|
||||
/* Clear any existing core info */
|
||||
if (entry->display_name)
|
||||
{
|
||||
free(entry->display_name);
|
||||
entry->display_name = NULL;
|
||||
}
|
||||
|
||||
if (entry->description)
|
||||
{
|
||||
free(entry->description);
|
||||
entry->description = NULL;
|
||||
}
|
||||
|
||||
if (entry->licenses_list)
|
||||
{
|
||||
/* Note: We can safely leave this as NULL if
|
||||
* the core info file is invalid */
|
||||
string_list_free(entry->licenses_list);
|
||||
entry->licenses_list = NULL;
|
||||
}
|
||||
|
||||
entry->is_experimental = false;
|
||||
|
||||
/* Read core info file
|
||||
* > Note: It's a bit rubbish that we have to
|
||||
* read the actual core info files here...
|
||||
* Would be better to cache this globally
|
||||
* (at present, we only cache info for
|
||||
* *installed* cores...) */
|
||||
core_info = core_info_get_core_updater_info(local_info_path);
|
||||
|
||||
if (core_info)
|
||||
{
|
||||
/* display_name + is_experimental */
|
||||
if (!string_is_empty(core_info->display_name))
|
||||
{
|
||||
entry->display_name = strdup(core_info->display_name);
|
||||
entry->is_experimental = core_info->is_experimental;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* If display name is blank, use core filename and
|
||||
* assume core is experimental (i.e. all 'fit for consumption'
|
||||
* cores must have a valid/complete core info file) */
|
||||
entry->display_name = strdup(filename_str);
|
||||
entry->is_experimental = true;
|
||||
}
|
||||
|
||||
/* description */
|
||||
if (!string_is_empty(core_info->description))
|
||||
entry->description = strdup(core_info->description);
|
||||
else
|
||||
entry->description = strdup("");
|
||||
|
||||
/* licenses_list */
|
||||
if (!string_is_empty(core_info->licenses))
|
||||
entry->licenses_list = string_split(core_info->licenses, "|");
|
||||
|
||||
/* Clean up */
|
||||
core_info_free_core_updater_info(core_info);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* If info file is missing, use core filename and
|
||||
* assume core is experimental (i.e. all 'fit for consumption'
|
||||
* cores must have a valid/complete core info file) */
|
||||
entry->display_name = strdup(filename_str);
|
||||
entry->is_experimental = true;
|
||||
entry->description = strdup("");
|
||||
}
|
||||
entry->display_name = strdup(display_name);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -649,15 +576,10 @@ static bool core_updater_list_push_entry(
|
||||
list_entry->remote_core_path = entry->remote_core_path;
|
||||
list_entry->local_core_path = entry->local_core_path;
|
||||
list_entry->local_info_path = entry->local_info_path;
|
||||
|
||||
/* Assign core info */
|
||||
list_entry->display_name = entry->display_name;
|
||||
list_entry->description = entry->description;
|
||||
list_entry->licenses_list = entry->licenses_list;
|
||||
list_entry->is_experimental = entry->is_experimental;
|
||||
|
||||
/* Copy crc */
|
||||
list_entry->crc = entry->crc;
|
||||
list_entry->crc = entry->crc;
|
||||
|
||||
/* Copy date */
|
||||
memcpy(&list_entry->date, &entry->date, sizeof(core_updater_list_date_t));
|
||||
@@ -722,12 +644,6 @@ static void core_updater_list_add_entry(
|
||||
filename_str))
|
||||
goto error;
|
||||
|
||||
if (!core_updater_list_set_core_info(
|
||||
&entry,
|
||||
entry.local_info_path,
|
||||
filename_str))
|
||||
goto error;
|
||||
|
||||
/* Add entry to list */
|
||||
if (!core_updater_list_push_entry(core_list, &entry))
|
||||
goto error;
|
||||
|
||||
@@ -26,8 +26,6 @@
|
||||
#include <retro_common_api.h>
|
||||
#include <libretro.h>
|
||||
|
||||
#include <lists/string_list.h>
|
||||
|
||||
#include <boolean.h>
|
||||
|
||||
RETRO_BEGIN_DECLS
|
||||
@@ -54,9 +52,6 @@ typedef struct
|
||||
char *local_core_path;
|
||||
char *local_info_path;
|
||||
char *display_name;
|
||||
char *description;
|
||||
struct string_list *licenses_list;
|
||||
bool is_experimental;
|
||||
uint32_t crc;
|
||||
core_updater_list_date_t date;
|
||||
} core_updater_list_entry_t;
|
||||
|
||||
@@ -144,7 +144,7 @@ void libretro_dummy_retro_get_system_av_info(
|
||||
refresh_rate = 60.0;
|
||||
|
||||
info->timing.fps = refresh_rate;
|
||||
info->timing.sample_rate = 48000.0;
|
||||
info->timing.sample_rate = 30000.0;
|
||||
|
||||
info->geometry.base_width = frame_buf_width;
|
||||
info->geometry.base_height = frame_buf_height;
|
||||
|
||||
@@ -126,6 +126,12 @@ else ifneq (,$(findstring win,$(platform)))
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_BIGENDIAN),1)
|
||||
CPUOPTS += -DHAVE_BIGENDIAN=1 -DMSB_FIRST
|
||||
else
|
||||
CPUOPTS += -DHAVE_BIGENDIAN=0
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_SSA), 1)
|
||||
LIBS += $(shell pkg-config libass --libs)
|
||||
DEFINES += -DHAVE_SSA
|
||||
|
||||
@@ -67,8 +67,6 @@ extern "C" {
|
||||
s ##_version() & 0xFF);
|
||||
|
||||
static bool reset_triggered;
|
||||
static bool libretro_supports_bitmasks = false;
|
||||
|
||||
static void fallback_log(enum retro_log_level level, const char *fmt, ...)
|
||||
{
|
||||
va_list va;
|
||||
@@ -195,20 +193,11 @@ static struct
|
||||
{
|
||||
unsigned width;
|
||||
unsigned height;
|
||||
|
||||
|
||||
double interpolate_fps;
|
||||
unsigned sample_rate;
|
||||
|
||||
float aspect;
|
||||
|
||||
struct
|
||||
{
|
||||
double time;
|
||||
unsigned hours;
|
||||
unsigned minutes;
|
||||
unsigned seconds;
|
||||
} duration;
|
||||
|
||||
} media;
|
||||
|
||||
#ifdef HAVE_SSA
|
||||
@@ -242,27 +231,10 @@ void CORE_PREFIX(retro_init)(void)
|
||||
reset_triggered = false;
|
||||
|
||||
av_register_all();
|
||||
|
||||
if (CORE_PREFIX(environ_cb)(RETRO_ENVIRONMENT_GET_INPUT_BITMASKS, NULL))
|
||||
libretro_supports_bitmasks = true;
|
||||
}
|
||||
|
||||
void CORE_PREFIX(retro_deinit)(void)
|
||||
{
|
||||
libretro_supports_bitmasks = false;
|
||||
|
||||
if (video_buffer)
|
||||
{
|
||||
video_buffer_destroy(video_buffer);
|
||||
video_buffer = NULL;
|
||||
}
|
||||
|
||||
if (tpool)
|
||||
{
|
||||
tpool_destroy(tpool);
|
||||
tpool = NULL;
|
||||
}
|
||||
}
|
||||
{}
|
||||
|
||||
unsigned CORE_PREFIX(retro_api_version)(void)
|
||||
{
|
||||
@@ -501,89 +473,23 @@ static void check_variables(bool firststart)
|
||||
static void seek_frame(int seek_frames)
|
||||
{
|
||||
char msg[256];
|
||||
struct retro_message_ext msg_obj = {0};
|
||||
int seek_frames_capped = seek_frames;
|
||||
unsigned seek_hours = 0;
|
||||
unsigned seek_minutes = 0;
|
||||
unsigned seek_seconds = 0;
|
||||
int8_t seek_progress = -1;
|
||||
struct retro_message msg_obj = {0};
|
||||
|
||||
msg[0] = '\0';
|
||||
|
||||
/* Handle resets + attempts to seek to a location
|
||||
* before the start of the video */
|
||||
if ((seek_frames < 0 && (unsigned)-seek_frames > frame_cnt) || reset_triggered)
|
||||
frame_cnt = 0;
|
||||
/* Handle backwards seeking */
|
||||
else if (seek_frames < 0)
|
||||
frame_cnt += seek_frames;
|
||||
/* Handle forwards seeking */
|
||||
else
|
||||
{
|
||||
double current_time = (double)frame_cnt / media.interpolate_fps;
|
||||
double seek_step_time = (double)seek_frames / media.interpolate_fps;
|
||||
double seek_target_time = current_time + seek_step_time;
|
||||
double seek_time_max = media.duration.time - 1.0;
|
||||
|
||||
seek_time_max = (seek_time_max > 0.0) ?
|
||||
seek_time_max : 0.0;
|
||||
|
||||
/* Ensure that we don't attempt to seek past
|
||||
* the end of the file */
|
||||
if (seek_target_time > seek_time_max)
|
||||
{
|
||||
seek_step_time = seek_time_max - current_time;
|
||||
|
||||
/* If seek would have taken us to the
|
||||
* end of the file, restart it instead
|
||||
* (less jarring for the user in case of
|
||||
* accidental seeking...) */
|
||||
if (seek_step_time < 0.0)
|
||||
seek_frames_capped = -1;
|
||||
else
|
||||
seek_frames_capped = (int)(seek_step_time * media.interpolate_fps);
|
||||
}
|
||||
|
||||
if (seek_frames_capped < 0)
|
||||
frame_cnt = 0;
|
||||
else
|
||||
frame_cnt += seek_frames_capped;
|
||||
}
|
||||
frame_cnt += seek_frames;
|
||||
|
||||
slock_lock(fifo_lock);
|
||||
do_seek = true;
|
||||
seek_time = frame_cnt / media.interpolate_fps;
|
||||
|
||||
/* Convert seek time to a printable format */
|
||||
seek_seconds = (unsigned)seek_time;
|
||||
seek_minutes = seek_seconds / 60;
|
||||
seek_seconds %= 60;
|
||||
seek_hours = seek_minutes / 60;
|
||||
seek_minutes %= 60;
|
||||
snprintf(msg, sizeof(msg), "Seek: %u s.", (unsigned)seek_time);
|
||||
msg_obj.msg = msg;
|
||||
msg_obj.frames = 180;
|
||||
CORE_PREFIX(environ_cb)(RETRO_ENVIRONMENT_SET_MESSAGE, &msg_obj);
|
||||
|
||||
snprintf(msg, sizeof(msg), "%02d:%02d:%02d / %02d:%02d:%02d",
|
||||
seek_hours, seek_minutes, seek_seconds,
|
||||
media.duration.hours, media.duration.minutes, media.duration.seconds);
|
||||
|
||||
/* Get current progress */
|
||||
if (media.duration.time > 0.0)
|
||||
{
|
||||
seek_progress = (int8_t)((100.0 * seek_time / media.duration.time) + 0.5);
|
||||
seek_progress = (seek_progress < -1) ? -1 : seek_progress;
|
||||
seek_progress = (seek_progress > 100) ? 100 : seek_progress;
|
||||
}
|
||||
|
||||
/* Send message to frontend */
|
||||
msg_obj.msg = msg;
|
||||
msg_obj.duration = 2000;
|
||||
msg_obj.priority = 3;
|
||||
msg_obj.level = RETRO_LOG_INFO;
|
||||
msg_obj.target = RETRO_MESSAGE_TARGET_OSD;
|
||||
msg_obj.type = RETRO_MESSAGE_TYPE_PROGRESS;
|
||||
msg_obj.progress = seek_progress;
|
||||
CORE_PREFIX(environ_cb)(RETRO_ENVIRONMENT_SET_MESSAGE_EXT, &msg_obj);
|
||||
|
||||
if (seek_frames_capped < 0)
|
||||
if (seek_frames < 0)
|
||||
{
|
||||
log_cb(RETRO_LOG_INFO, "[FFMPEG] Resetting PTS.\n");
|
||||
frames[0].pts = 0.0;
|
||||
@@ -616,7 +522,6 @@ void CORE_PREFIX(retro_run)(void)
|
||||
double min_pts;
|
||||
int16_t audio_buffer[2048];
|
||||
bool left, right, up, down, l, r;
|
||||
int16_t ret = 0;
|
||||
size_t to_read_frames = 0;
|
||||
int seek_frames = 0;
|
||||
bool updated = false;
|
||||
@@ -647,28 +552,20 @@ void CORE_PREFIX(retro_run)(void)
|
||||
|
||||
CORE_PREFIX(input_poll_cb)();
|
||||
|
||||
if (libretro_supports_bitmasks)
|
||||
ret = CORE_PREFIX(input_state_cb)(0, RETRO_DEVICE_JOYPAD,
|
||||
0, RETRO_DEVICE_ID_JOYPAD_MASK);
|
||||
else
|
||||
{
|
||||
unsigned i;
|
||||
for (i = RETRO_DEVICE_ID_JOYPAD_B; i <= RETRO_DEVICE_ID_JOYPAD_R; i++)
|
||||
if (CORE_PREFIX(input_state_cb)(0, RETRO_DEVICE_JOYPAD, 0, i))
|
||||
ret |= (1 << i);
|
||||
}
|
||||
|
||||
if (CORE_PREFIX(input_state_cb)(0, RETRO_DEVICE_MOUSE, 0, RETRO_DEVICE_ID_MOUSE_WHEELUP))
|
||||
ret |= (1 << RETRO_DEVICE_ID_JOYPAD_UP);
|
||||
if (CORE_PREFIX(input_state_cb)(0, RETRO_DEVICE_MOUSE, 0, RETRO_DEVICE_ID_MOUSE_WHEELDOWN))
|
||||
ret |= (1 << RETRO_DEVICE_ID_JOYPAD_DOWN);
|
||||
|
||||
left = ret & (1 << RETRO_DEVICE_ID_JOYPAD_LEFT);
|
||||
right = ret & (1 << RETRO_DEVICE_ID_JOYPAD_RIGHT);
|
||||
up = ret & (1 << RETRO_DEVICE_ID_JOYPAD_UP);
|
||||
down = ret & (1 << RETRO_DEVICE_ID_JOYPAD_DOWN);
|
||||
l = ret & (1 << RETRO_DEVICE_ID_JOYPAD_L);
|
||||
r = ret & (1 << RETRO_DEVICE_ID_JOYPAD_R);
|
||||
left = CORE_PREFIX(input_state_cb)(0, RETRO_DEVICE_JOYPAD, 0,
|
||||
RETRO_DEVICE_ID_JOYPAD_LEFT);
|
||||
right = CORE_PREFIX(input_state_cb)(0, RETRO_DEVICE_JOYPAD, 0,
|
||||
RETRO_DEVICE_ID_JOYPAD_RIGHT);
|
||||
up = CORE_PREFIX(input_state_cb)(0, RETRO_DEVICE_JOYPAD, 0,
|
||||
RETRO_DEVICE_ID_JOYPAD_UP) ||
|
||||
CORE_PREFIX(input_state_cb)(0, RETRO_DEVICE_MOUSE, 0, RETRO_DEVICE_ID_MOUSE_WHEELUP);
|
||||
down = CORE_PREFIX(input_state_cb)(0, RETRO_DEVICE_JOYPAD, 0,
|
||||
RETRO_DEVICE_ID_JOYPAD_DOWN) ||
|
||||
CORE_PREFIX(input_state_cb)(0, RETRO_DEVICE_MOUSE, 0, RETRO_DEVICE_ID_MOUSE_WHEELDOWN);
|
||||
l = CORE_PREFIX(input_state_cb)(0, RETRO_DEVICE_JOYPAD, 0,
|
||||
RETRO_DEVICE_ID_JOYPAD_L);
|
||||
r = CORE_PREFIX(input_state_cb)(0, RETRO_DEVICE_JOYPAD, 0,
|
||||
RETRO_DEVICE_ID_JOYPAD_R);
|
||||
|
||||
if (left && !last_left)
|
||||
seek_frames -= 10 * media.interpolate_fps;
|
||||
@@ -682,9 +579,7 @@ void CORE_PREFIX(retro_run)(void)
|
||||
if (l && !last_l && audio_streams_num > 0)
|
||||
{
|
||||
char msg[256];
|
||||
struct retro_message_ext msg_obj = {0};
|
||||
|
||||
msg[0] = '\0';
|
||||
struct retro_message msg_obj = {0};
|
||||
|
||||
slock_lock(decode_thread_lock);
|
||||
audio_streams_ptr = (audio_streams_ptr + 1) % audio_streams_num;
|
||||
@@ -692,36 +587,23 @@ void CORE_PREFIX(retro_run)(void)
|
||||
|
||||
snprintf(msg, sizeof(msg), "Audio Track #%d.", audio_streams_ptr);
|
||||
|
||||
msg_obj.msg = msg;
|
||||
msg_obj.duration = 3000;
|
||||
msg_obj.priority = 1;
|
||||
msg_obj.level = RETRO_LOG_INFO;
|
||||
msg_obj.target = RETRO_MESSAGE_TARGET_ALL;
|
||||
msg_obj.type = RETRO_MESSAGE_TYPE_NOTIFICATION;
|
||||
msg_obj.progress = -1;
|
||||
CORE_PREFIX(environ_cb)(RETRO_ENVIRONMENT_SET_MESSAGE_EXT, &msg_obj);
|
||||
msg_obj.msg = msg;
|
||||
msg_obj.frames = 180;
|
||||
CORE_PREFIX(environ_cb)(RETRO_ENVIRONMENT_SET_MESSAGE, &msg_obj);
|
||||
}
|
||||
else if (r && !last_r && subtitle_streams_num > 0)
|
||||
{
|
||||
char msg[256];
|
||||
struct retro_message_ext msg_obj = {0};
|
||||
|
||||
msg[0] = '\0';
|
||||
struct retro_message msg_obj = {0};
|
||||
|
||||
slock_lock(decode_thread_lock);
|
||||
subtitle_streams_ptr = (subtitle_streams_ptr + 1) % subtitle_streams_num;
|
||||
slock_unlock(decode_thread_lock);
|
||||
|
||||
snprintf(msg, sizeof(msg), "Subtitle Track #%d.", subtitle_streams_ptr);
|
||||
|
||||
msg_obj.msg = msg;
|
||||
msg_obj.duration = 3000;
|
||||
msg_obj.priority = 1;
|
||||
msg_obj.level = RETRO_LOG_INFO;
|
||||
msg_obj.target = RETRO_MESSAGE_TARGET_ALL;
|
||||
msg_obj.type = RETRO_MESSAGE_TYPE_NOTIFICATION;
|
||||
msg_obj.progress = -1;
|
||||
CORE_PREFIX(environ_cb)(RETRO_ENVIRONMENT_SET_MESSAGE_EXT, &msg_obj);
|
||||
msg_obj.msg = msg;
|
||||
msg_obj.frames = 180;
|
||||
CORE_PREFIX(environ_cb)(RETRO_ENVIRONMENT_SET_MESSAGE, &msg_obj);
|
||||
}
|
||||
|
||||
last_left = left;
|
||||
@@ -767,7 +649,7 @@ void CORE_PREFIX(retro_run)(void)
|
||||
to_read_bytes = to_read_frames * sizeof(int16_t) * 2;
|
||||
|
||||
slock_lock(fifo_lock);
|
||||
while (!decode_thread_dead && FIFO_READ_AVAIL(audio_decode_fifo) < to_read_bytes)
|
||||
while (!decode_thread_dead && fifo_read_avail(audio_decode_fifo) < to_read_bytes)
|
||||
{
|
||||
main_sleeping = true;
|
||||
scond_signal(fifo_decode_cond);
|
||||
@@ -776,7 +658,7 @@ void CORE_PREFIX(retro_run)(void)
|
||||
}
|
||||
|
||||
reading_pts = decode_last_audio_time -
|
||||
(double)FIFO_READ_AVAIL(audio_decode_fifo) / (media.sample_rate * sizeof(int16_t) * 2);
|
||||
(double)fifo_read_avail(audio_decode_fifo) / (media.sample_rate * sizeof(int16_t) * 2);
|
||||
expected_pts = (double)audio_frames / media.sample_rate;
|
||||
old_pts_bias = pts_bias;
|
||||
pts_bias = reading_pts - expected_pts;
|
||||
@@ -810,44 +692,38 @@ void CORE_PREFIX(retro_run)(void)
|
||||
frames[0] = tmp;
|
||||
}
|
||||
|
||||
#if defined(HAVE_OPENGL) || defined(HAVE_OPENGLES)
|
||||
if (use_gl)
|
||||
while (!decode_thread_dead && min_pts > frames[1].pts)
|
||||
{
|
||||
float mix_factor;
|
||||
int64_t pts = 0;
|
||||
|
||||
while (!decode_thread_dead && min_pts > frames[1].pts)
|
||||
if (!decode_thread_dead)
|
||||
video_buffer_wait_for_finished_slot(video_buffer);
|
||||
|
||||
if (!decode_thread_dead)
|
||||
{
|
||||
int64_t pts = 0;
|
||||
uint32_t *data = video_frame_temp_buffer;
|
||||
|
||||
if (!decode_thread_dead)
|
||||
video_buffer_wait_for_finished_slot(video_buffer);
|
||||
video_decoder_context_t *ctx = NULL;
|
||||
video_buffer_get_finished_slot(video_buffer, &ctx);
|
||||
pts = ctx->pts;
|
||||
|
||||
if (!decode_thread_dead)
|
||||
#if defined(HAVE_OPENGL) || defined(HAVE_OPENGLES)
|
||||
if (use_gl)
|
||||
{
|
||||
unsigned y;
|
||||
int stride, width;
|
||||
const uint8_t *src = NULL;
|
||||
video_decoder_context_t *ctx = NULL;
|
||||
uint32_t *data = NULL;
|
||||
|
||||
video_buffer_get_finished_slot(video_buffer, &ctx);
|
||||
pts = ctx->pts;
|
||||
|
||||
#ifdef HAVE_OPENGLES
|
||||
data = video_frame_temp_buffer;
|
||||
#else
|
||||
#ifndef HAVE_OPENGLES
|
||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, frames[1].pbo);
|
||||
#ifdef __MACH__
|
||||
data = (uint32_t*)glMapBuffer(GL_PIXEL_UNPACK_BUFFER, GL_WRITE_ONLY);
|
||||
data = (uint32_t*)glMapBuffer(GL_PIXEL_UNPACK_BUFFER, GL_WRITE_ONLY);
|
||||
#else
|
||||
data = (uint32_t*)glMapBufferRange(GL_PIXEL_UNPACK_BUFFER,
|
||||
data = (uint32_t*)glMapBufferRange(GL_PIXEL_UNPACK_BUFFER,
|
||||
0, media.width * media.height * sizeof(uint32_t), GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_BUFFER_BIT);
|
||||
#endif
|
||||
#endif
|
||||
src = ctx->target->data[0];
|
||||
stride = ctx->target->linesize[0];
|
||||
width = media.width * sizeof(uint32_t);
|
||||
for (y = 0; y < media.height; y++, src += stride, data += width/4)
|
||||
|
||||
const uint8_t *src = ctx->target->data[0];
|
||||
int stride = ctx->target->linesize[0];
|
||||
int width = media.width * sizeof(uint32_t);
|
||||
for (unsigned y = 0; y < media.height; y++, src += stride, data += width/4)
|
||||
memcpy(data, src, width);
|
||||
|
||||
#ifndef HAVE_OPENGLES
|
||||
@@ -865,13 +741,28 @@ void CORE_PREFIX(retro_run)(void)
|
||||
#ifndef HAVE_OPENGLES
|
||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
|
||||
#endif
|
||||
video_buffer_open_slot(video_buffer, ctx);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
const uint8_t *src = ctx->target->data[0];
|
||||
int stride = ctx->target->linesize[0];
|
||||
size_t width = media.width * sizeof(uint32_t);
|
||||
for (unsigned y = 0; y < media.height; y++, src += stride, data += width/4)
|
||||
memcpy(data, src, width);
|
||||
|
||||
frames[1].pts = av_q2d(fctx->streams[video_stream_index]->time_base) * pts;
|
||||
dupe = false;
|
||||
}
|
||||
video_buffer_open_slot(video_buffer, ctx);
|
||||
}
|
||||
|
||||
mix_factor = (min_pts - frames[0].pts) / (frames[1].pts - frames[0].pts);
|
||||
frames[1].pts = av_q2d(fctx->streams[video_stream_index]->time_base) * pts;
|
||||
}
|
||||
|
||||
#if defined(HAVE_OPENGL) || defined(HAVE_OPENGLES)
|
||||
if (use_gl)
|
||||
{
|
||||
float mix_factor = (min_pts - frames[0].pts) / (frames[1].pts - frames[0].pts);
|
||||
|
||||
if (!temporal_interpolation)
|
||||
mix_factor = 1.0f;
|
||||
@@ -913,36 +804,6 @@ void CORE_PREFIX(retro_run)(void)
|
||||
else
|
||||
#endif
|
||||
{
|
||||
while (!decode_thread_dead && min_pts > frames[1].pts)
|
||||
{
|
||||
int64_t pts = 0;
|
||||
|
||||
if (!decode_thread_dead)
|
||||
video_buffer_wait_for_finished_slot(video_buffer);
|
||||
|
||||
if (!decode_thread_dead)
|
||||
{
|
||||
unsigned y;
|
||||
const uint8_t *src;
|
||||
int stride, width;
|
||||
uint32_t *data = video_frame_temp_buffer;
|
||||
video_decoder_context_t *ctx = NULL;
|
||||
|
||||
video_buffer_get_finished_slot(video_buffer, &ctx);
|
||||
pts = ctx->pts;
|
||||
src = ctx->target->data[0];
|
||||
stride = ctx->target->linesize[0];
|
||||
width = media.width * sizeof(uint32_t);
|
||||
for (y = 0; y < media.height; y++, src += stride, data += width/4)
|
||||
memcpy(data, src, width);
|
||||
|
||||
dupe = false;
|
||||
video_buffer_open_slot(video_buffer, ctx);
|
||||
}
|
||||
|
||||
frames[1].pts = av_q2d(fctx->streams[video_stream_index]->time_base) * pts;
|
||||
}
|
||||
|
||||
CORE_PREFIX(video_cb)(dupe ? NULL : video_frame_temp_buffer,
|
||||
media.width, media.height, media.width * sizeof(uint32_t));
|
||||
}
|
||||
@@ -1310,28 +1171,6 @@ static bool init_media_info(void)
|
||||
av_q2d(vctx->sample_aspect_ratio) / vctx->height;
|
||||
}
|
||||
|
||||
if (fctx)
|
||||
{
|
||||
if (fctx->duration != AV_NOPTS_VALUE)
|
||||
{
|
||||
int64_t duration = fctx->duration + (fctx->duration <= INT64_MAX - 5000 ? 5000 : 0);
|
||||
media.duration.time = (double)(duration / AV_TIME_BASE);
|
||||
media.duration.seconds = (unsigned)media.duration.time;
|
||||
media.duration.minutes = media.duration.seconds / 60;
|
||||
media.duration.seconds %= 60;
|
||||
media.duration.hours = media.duration.minutes / 60;
|
||||
media.duration.minutes %= 60;
|
||||
}
|
||||
else
|
||||
{
|
||||
media.duration.time = 0.0;
|
||||
media.duration.hours = 0;
|
||||
media.duration.minutes = 0;
|
||||
media.duration.seconds = 0;
|
||||
log_cb(RETRO_LOG_ERROR, "[FFMPEG] Could not determine media duration\n");
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef HAVE_SSA
|
||||
if (sctx[0])
|
||||
{
|
||||
@@ -1638,8 +1477,7 @@ static int16_t *decode_audio(AVCodecContext *ctx, AVPacket *pkt,
|
||||
pts = frame->best_effort_timestamp;
|
||||
slock_lock(fifo_lock);
|
||||
|
||||
while (!decode_thread_dead &&
|
||||
FIFO_WRITE_AVAIL(audio_decode_fifo) < required_buffer)
|
||||
while (!decode_thread_dead && fifo_write_avail(audio_decode_fifo) < required_buffer)
|
||||
{
|
||||
if (!main_sleeping)
|
||||
scond_wait(fifo_decode_cond, fifo_lock);
|
||||
@@ -1711,7 +1549,7 @@ static void decode_thread(void *data)
|
||||
{
|
||||
unsigned i;
|
||||
bool eof = false;
|
||||
struct SwrContext *swr[(audio_streams_num > 0) ? audio_streams_num : 1];
|
||||
struct SwrContext *swr[audio_streams_num];
|
||||
AVFrame *aud_frame = NULL;
|
||||
size_t frame_size = 0;
|
||||
int16_t *audio_buffer = NULL;
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
#include "packet_buffer.h"
|
||||
|
||||
struct AVPacketNode
|
||||
{
|
||||
struct AVPacketNode {
|
||||
AVPacket *data;
|
||||
struct AVPacketNode *next;
|
||||
struct AVPacketNode *previous;
|
||||
};
|
||||
|
||||
typedef struct AVPacketNode AVPacketNode_t;
|
||||
|
||||
struct packet_buffer
|
||||
@@ -16,7 +14,7 @@ struct packet_buffer
|
||||
size_t size;
|
||||
};
|
||||
|
||||
packet_buffer_t *packet_buffer_create(void)
|
||||
packet_buffer_t *packet_buffer_create()
|
||||
{
|
||||
packet_buffer_t *b = (packet_buffer_t*)malloc(sizeof(packet_buffer_t));
|
||||
if (!b)
|
||||
|
||||
@@ -6,13 +6,7 @@
|
||||
#include <boolean.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#include <libavcodec/avcodec.h>
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <retro_miscellaneous.h>
|
||||
|
||||
|
||||
@@ -1,10 +1,4 @@
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#include <libavformat/avformat.h>
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <rthreads/rthreads.h>
|
||||
|
||||
@@ -12,7 +6,7 @@ extern "C" {
|
||||
|
||||
enum kbStatus
|
||||
{
|
||||
KB_OPEN = 0,
|
||||
KB_OPEN,
|
||||
KB_IN_PROGRESS,
|
||||
KB_FINISHED
|
||||
};
|
||||
@@ -29,41 +23,32 @@ struct video_buffer
|
||||
int64_t tail;
|
||||
};
|
||||
|
||||
video_buffer_t *video_buffer_create(
|
||||
size_t capacity, int frame_size, int width, int height)
|
||||
video_buffer_t *video_buffer_create(size_t capacity, int frame_size, int width, int height)
|
||||
{
|
||||
unsigned i;
|
||||
video_buffer_t *b = (video_buffer_t*)malloc(sizeof(video_buffer_t));
|
||||
if (!b)
|
||||
return NULL;
|
||||
|
||||
b->buffer = NULL;
|
||||
b->capacity = capacity;
|
||||
b->lock = NULL;
|
||||
b->open_cond = NULL;
|
||||
b->finished_cond = NULL;
|
||||
b->head = 0;
|
||||
b->tail = 0;
|
||||
b->status = (enum kbStatus*)malloc(sizeof(enum kbStatus) * capacity);
|
||||
memset(b, 0, sizeof(video_buffer_t));
|
||||
b->capacity = capacity;
|
||||
|
||||
b->status = (enum kbStatus*)malloc(sizeof(enum kbStatus) * capacity);
|
||||
if (!b->status)
|
||||
goto fail;
|
||||
for (int i = 0; i < capacity; i++)
|
||||
b->status[i] = KB_OPEN;
|
||||
|
||||
for (i = 0; i < capacity; i++)
|
||||
b->status[i] = KB_OPEN;
|
||||
|
||||
b->lock = slock_new();
|
||||
b->open_cond = scond_new();
|
||||
b->lock = slock_new();
|
||||
b->open_cond = scond_new();
|
||||
b->finished_cond = scond_new();
|
||||
if (!b->lock || !b->open_cond || !b->finished_cond)
|
||||
goto fail;
|
||||
|
||||
b->buffer = (video_decoder_context_t*)
|
||||
malloc(sizeof(video_decoder_context_t) * capacity);
|
||||
b->buffer = (video_decoder_context_t*)malloc(sizeof(video_decoder_context_t) * capacity);
|
||||
if (!b->buffer)
|
||||
goto fail;
|
||||
|
||||
for (i = 0; i < (unsigned)capacity; i++)
|
||||
for (int i = 0; i < capacity; i++)
|
||||
{
|
||||
b->buffer[i].index = i;
|
||||
b->buffer[i].pts = 0;
|
||||
@@ -73,16 +58,18 @@ video_buffer_t *video_buffer_create(
|
||||
b->buffer[i].hw_source = av_frame_alloc();
|
||||
#endif
|
||||
b->buffer[i].target = av_frame_alloc();
|
||||
b->buffer[i].frame_buf = (uint8_t*)av_malloc(frame_size);
|
||||
|
||||
avpicture_alloc((AVPicture*)b->buffer[i].target,
|
||||
avpicture_fill((AVPicture*)b->buffer[i].target, (const uint8_t*)b->buffer[i].frame_buf,
|
||||
PIX_FMT_RGB32, width, height);
|
||||
|
||||
if (!b->buffer[i].sws ||
|
||||
!b->buffer[i].source ||
|
||||
if (!b->buffer[i].sws ||
|
||||
!b->buffer[i].source ||
|
||||
#if LIBAVUTIL_VERSION_MAJOR > 55
|
||||
!b->buffer[i].hw_source ||
|
||||
#endif
|
||||
!b->buffer[i].target)
|
||||
!b->buffer[i].target ||
|
||||
!b->buffer[i].frame_buf)
|
||||
goto fail;
|
||||
}
|
||||
return b;
|
||||
@@ -94,7 +81,6 @@ fail:
|
||||
|
||||
void video_buffer_destroy(video_buffer_t *video_buffer)
|
||||
{
|
||||
unsigned i;
|
||||
if (!video_buffer)
|
||||
return;
|
||||
|
||||
@@ -103,25 +89,22 @@ void video_buffer_destroy(video_buffer_t *video_buffer)
|
||||
scond_free(video_buffer->finished_cond);
|
||||
free(video_buffer->status);
|
||||
if (video_buffer->buffer)
|
||||
{
|
||||
for (i = 0; i < video_buffer->capacity; i++)
|
||||
for (int i = 0; i < video_buffer->capacity; i++)
|
||||
{
|
||||
#if LIBAVUTIL_VERSION_MAJOR > 55
|
||||
#if LIBAVUTIL_VERSION_MAJOR > 55
|
||||
av_frame_free(&video_buffer->buffer[i].hw_source);
|
||||
#endif
|
||||
#endif
|
||||
av_frame_free(&video_buffer->buffer[i].source);
|
||||
avpicture_free((AVPicture*)video_buffer->buffer[i].target);
|
||||
av_frame_free(&video_buffer->buffer[i].target);
|
||||
av_freep(&video_buffer->buffer[i].frame_buf);
|
||||
sws_freeContext(video_buffer->buffer[i].sws);
|
||||
}
|
||||
}
|
||||
free(video_buffer->buffer);
|
||||
free(video_buffer);
|
||||
}
|
||||
|
||||
void video_buffer_clear(video_buffer_t *video_buffer)
|
||||
{
|
||||
unsigned i;
|
||||
if (!video_buffer)
|
||||
return;
|
||||
|
||||
@@ -132,14 +115,13 @@ void video_buffer_clear(video_buffer_t *video_buffer)
|
||||
|
||||
video_buffer->head = 0;
|
||||
video_buffer->tail = 0;
|
||||
for (i = 0; i < video_buffer->capacity; i++)
|
||||
for (int i = 0; i < video_buffer->capacity; i++)
|
||||
video_buffer->status[i] = KB_OPEN;
|
||||
|
||||
slock_unlock(video_buffer->lock);
|
||||
}
|
||||
|
||||
void video_buffer_get_open_slot(
|
||||
video_buffer_t *video_buffer, video_decoder_context_t **context)
|
||||
void video_buffer_get_open_slot(video_buffer_t *video_buffer, video_decoder_context_t **context)
|
||||
{
|
||||
slock_lock(video_buffer->lock);
|
||||
|
||||
@@ -154,8 +136,7 @@ void video_buffer_get_open_slot(
|
||||
slock_unlock(video_buffer->lock);
|
||||
}
|
||||
|
||||
void video_buffer_return_open_slot(
|
||||
video_buffer_t *video_buffer, video_decoder_context_t *context)
|
||||
void video_buffer_return_open_slot(video_buffer_t *video_buffer, video_decoder_context_t *context)
|
||||
{
|
||||
slock_lock(video_buffer->lock);
|
||||
|
||||
@@ -169,9 +150,7 @@ void video_buffer_return_open_slot(
|
||||
slock_unlock(video_buffer->lock);
|
||||
}
|
||||
|
||||
void video_buffer_open_slot(
|
||||
video_buffer_t *video_buffer,
|
||||
video_decoder_context_t *context)
|
||||
void video_buffer_open_slot(video_buffer_t *video_buffer, video_decoder_context_t *context)
|
||||
{
|
||||
slock_lock(video_buffer->lock);
|
||||
|
||||
@@ -186,9 +165,7 @@ void video_buffer_open_slot(
|
||||
slock_unlock(video_buffer->lock);
|
||||
}
|
||||
|
||||
void video_buffer_get_finished_slot(
|
||||
video_buffer_t *video_buffer,
|
||||
video_decoder_context_t **context)
|
||||
void video_buffer_get_finished_slot(video_buffer_t *video_buffer, video_decoder_context_t **context)
|
||||
{
|
||||
slock_lock(video_buffer->lock);
|
||||
|
||||
@@ -198,9 +175,7 @@ void video_buffer_get_finished_slot(
|
||||
slock_unlock(video_buffer->lock);
|
||||
}
|
||||
|
||||
void video_buffer_finish_slot(
|
||||
video_buffer_t *video_buffer,
|
||||
video_decoder_context_t *context)
|
||||
void video_buffer_finish_slot(video_buffer_t *video_buffer, video_decoder_context_t *context)
|
||||
{
|
||||
slock_lock(video_buffer->lock);
|
||||
|
||||
|
||||
@@ -6,27 +6,13 @@
|
||||
#include <boolean.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef RARCH_INTERNAL
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SSA
|
||||
#include <ass/ass.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <libavutil/frame.h>
|
||||
#include <libswscale/swscale.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <retro_miscellaneous.h>
|
||||
|
||||
RETRO_BEGIN_DECLS
|
||||
|
||||
+9
-18
@@ -37,32 +37,25 @@ void ctr_linear_free_pages(u32 pages);
|
||||
|
||||
void ctr_free_pages(u32 pages)
|
||||
{
|
||||
u32 linear_free_pages;
|
||||
u32 stack_free, stack_usage, stack_free_pages;
|
||||
|
||||
if(!pages)
|
||||
return;
|
||||
|
||||
linear_free_pages = ctr_get_linear_free() >> 12;
|
||||
u32 linear_free_pages = ctr_get_linear_free() >> 12;
|
||||
|
||||
if ((ctr_get_linear_unused() >> 12) > pages + 0x100)
|
||||
if((ctr_get_linear_unused() >> 12) > pages + 0x100)
|
||||
return ctr_linear_free_pages(pages);
|
||||
|
||||
#if 0
|
||||
if (linear_free_pages > pages + 0x400)
|
||||
if(linear_free_pages > pages + 0x400)
|
||||
return ctr_linear_free_pages(pages);
|
||||
#endif
|
||||
|
||||
stack_free = ctr_get_stack_free();
|
||||
stack_usage = __stacksize__ > stack_free
|
||||
? __stacksize__ - stack_free
|
||||
: 0;
|
||||
u32 stack_free = ctr_get_stack_free();
|
||||
u32 stack_usage = __stacksize__ > stack_free? __stacksize__ - stack_free: 0;
|
||||
|
||||
stack_free = stack_free > __stack_size_extra
|
||||
? __stack_size_extra
|
||||
: stack_free;
|
||||
stack_free = stack_free > __stack_size_extra ? __stack_size_extra : stack_free;
|
||||
|
||||
stack_free_pages = stack_free >> 12;
|
||||
u32 stack_free_pages = stack_free >> 12;
|
||||
|
||||
if(linear_free_pages + (stack_free_pages - (stack_usage >> 12)) > pages)
|
||||
{
|
||||
@@ -90,8 +83,7 @@ void ctr_free_pages(u32 pages)
|
||||
__stacksize__ -= stack_free_pages << 12;
|
||||
#if 0
|
||||
printf("s:0x%08X-->0x%08X(-0x%08X) \n", stack_free,
|
||||
stack_free - (stack_free_pages << 12),
|
||||
stack_free_pages << 12);
|
||||
stack_free - (stack_free_pages << 12), stack_free_pages << 12);
|
||||
DEBUG_HOLD();
|
||||
#endif
|
||||
}
|
||||
@@ -119,12 +111,11 @@ void* _sbrk_r(struct _reent *ptr, ptrdiff_t incr)
|
||||
{
|
||||
static u32 sbrk_top = 0;
|
||||
u32 tmp;
|
||||
int diff;
|
||||
|
||||
if (!sbrk_top)
|
||||
sbrk_top = __heapBase;
|
||||
|
||||
diff = ((sbrk_top + incr + 0xFFF) & ~0xFFF)
|
||||
int diff = ((sbrk_top + incr + 0xFFF) & ~0xFFF)
|
||||
- (__heapBase + __heap_size);
|
||||
|
||||
if (diff > 0)
|
||||
|
||||
+111
-154
@@ -15,53 +15,13 @@
|
||||
#define SVC_ACL_MASK(svc_id) (0x1 << ((svc_id) & 0x1F))
|
||||
#define THREAD_PAGE_ACL_OFFSET 0xF38
|
||||
|
||||
u32 __ctr_svchax = 0;
|
||||
u32 __ctr_svchax = 0;
|
||||
u32 __ctr_svchax_srv = 0;
|
||||
|
||||
extern void* __service_ptr;
|
||||
|
||||
typedef u32(*backdoor_fn)(u32 arg0, u32 arg1);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Handle started_event;
|
||||
Handle lock;
|
||||
volatile u32 target_kaddr;
|
||||
volatile u32 target_val;
|
||||
} mch2_thread_args_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
u32* stack_top;
|
||||
Handle handle;
|
||||
bool keep;
|
||||
mch2_thread_args_t args;
|
||||
} mch2_thread_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
u32 old_cpu_time_limit;
|
||||
bool isNew3DS;
|
||||
u32 kernel_fcram_mapping_offset;
|
||||
|
||||
Handle arbiter;
|
||||
volatile u32 alloc_address;
|
||||
volatile u32 alloc_size;
|
||||
u8* flush_buffer;
|
||||
|
||||
Handle dummy_threads_lock;
|
||||
Handle target_threads_lock;
|
||||
Handle main_thread_lock;
|
||||
u32* thread_page_va;
|
||||
u32 thread_page_kva;
|
||||
|
||||
u32 threads_limit;
|
||||
Handle alloc_thread;
|
||||
Handle poll_thread;
|
||||
mch2_thread_t threads[MCH2_THREAD_COUNT_MAX];
|
||||
} mch2_vars_t;
|
||||
|
||||
|
||||
__attribute((naked))
|
||||
static u32 svc_7b(backdoor_fn entry_fn, ...) /* can pass up to two arguments to entry_fn(...) */
|
||||
{
|
||||
@@ -86,7 +46,7 @@ static u32 svc_7b(backdoor_fn entry_fn, ...) /* can pass up to two arguments to
|
||||
|
||||
static void k_enable_all_svcs(u32 isNew3DS)
|
||||
{
|
||||
u32* thread_ACL = *(*(u32***)CURRENT_KTHREAD + 0x22) - 0x6;
|
||||
u32* thread_ACL = *(*(u32***)CURRENT_KTHREAD + 0x22) - 0x6;
|
||||
u32* process_ACL = *(u32**)CURRENT_KPROCESS + (isNew3DS ? 0x24 : 0x22);
|
||||
|
||||
memset(thread_ACL, 0xFF, 0x10);
|
||||
@@ -128,6 +88,45 @@ static u32 get_thread_page(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Handle started_event;
|
||||
Handle lock;
|
||||
volatile u32 target_kaddr;
|
||||
volatile u32 target_val;
|
||||
} mch2_thread_args_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
u32* stack_top;
|
||||
Handle handle;
|
||||
bool keep;
|
||||
mch2_thread_args_t args;
|
||||
} mch2_thread_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
u32 old_cpu_time_limit;
|
||||
bool isNew3DS;
|
||||
u32 kernel_fcram_mapping_offset;
|
||||
|
||||
Handle arbiter;
|
||||
volatile u32 alloc_address;
|
||||
volatile u32 alloc_size;
|
||||
u8* flush_buffer;
|
||||
|
||||
Handle dummy_threads_lock;
|
||||
Handle target_threads_lock;
|
||||
Handle main_thread_lock;
|
||||
u32* thread_page_va;
|
||||
u32 thread_page_kva;
|
||||
|
||||
u32 threads_limit;
|
||||
Handle alloc_thread;
|
||||
Handle poll_thread;
|
||||
mch2_thread_t threads[MCH2_THREAD_COUNT_MAX];
|
||||
} mch2_vars_t;
|
||||
|
||||
static void alloc_thread_entry(mch2_vars_t* mch2)
|
||||
{
|
||||
u32 tmp;
|
||||
@@ -163,7 +162,7 @@ static u32 get_first_free_basemem_page(bool isNew3DS)
|
||||
{
|
||||
s64 v1;
|
||||
int memused_base_linear; /* guessed */
|
||||
int memused_base = osGetMemRegionUsed(MEMREGION_BASE);
|
||||
int memused_base = osGetMemRegionUsed(MEMREGION_BASE);
|
||||
|
||||
svcGetSystemInfo(&v1, 2, 0);
|
||||
memused_base_linear = 0x6C000 + v1 +
|
||||
@@ -198,25 +197,13 @@ static void do_memchunkhax2(void)
|
||||
{
|
||||
static u8 flush_buffer[0x8000];
|
||||
static u8 thread_stacks[MCH2_THREAD_STACKS_SIZE];
|
||||
extern u32 __heapBase;
|
||||
extern u32 __heap_size;
|
||||
|
||||
int i;
|
||||
u32 tmp;
|
||||
u32 linear_buffer;
|
||||
u32 linear_address;
|
||||
u32 dst_memchunk;
|
||||
u32 mem_free;
|
||||
u32 fragmented_size;
|
||||
u32* mapped_page;
|
||||
volatile u32 *thread_ACL;
|
||||
u32 alloc_address_kaddr;
|
||||
u32 fragmented_address = 0;
|
||||
u32 linear_size = 0xF000;
|
||||
u32 skip_pages = 2;
|
||||
mch2_vars_t mch2 = {0};
|
||||
mch2_vars_t mch2 = {0};
|
||||
|
||||
mch2.flush_buffer = flush_buffer;
|
||||
mch2.threads_limit = get_threads_limit();
|
||||
mch2.flush_buffer = flush_buffer;
|
||||
mch2.threads_limit = get_threads_limit();
|
||||
mch2.kernel_fcram_mapping_offset = (osGetKernelVersion() > SYSTEM_VERSION(2, 40, 0)) ? 0xC0000000 : 0xD0000000;
|
||||
|
||||
for (i = 0; i < MCH2_THREAD_COUNT_MAX; i++)
|
||||
@@ -228,10 +215,8 @@ static void do_memchunkhax2(void)
|
||||
|
||||
for (i = 0; i < mch2.threads_limit; i++)
|
||||
{
|
||||
svcCreateThread(&mch2.threads[i].handle,
|
||||
(ThreadFunc)check_tls_thread_entry,
|
||||
(u32)&mch2.threads[i].keep,
|
||||
mch2.threads[i].stack_top, 0x18, 0);
|
||||
svcCreateThread(&mch2.threads[i].handle, (ThreadFunc)check_tls_thread_entry, (u32)&mch2.threads[i].keep,
|
||||
mch2.threads[i].stack_top, 0x18, 0);
|
||||
svcWaitSynchronization(mch2.threads[i].handle, U64_MAX);
|
||||
}
|
||||
|
||||
@@ -244,70 +229,61 @@ static void do_memchunkhax2(void)
|
||||
|
||||
for (i = 0; i < mch2.threads_limit; i++)
|
||||
if (!mch2.threads[i].keep)
|
||||
svcCreateThread(&mch2.threads[i].handle,
|
||||
(ThreadFunc)dummy_thread_entry,
|
||||
mch2.dummy_threads_lock,
|
||||
mch2.threads[i].stack_top, 0x3F - i, 0);
|
||||
svcCreateThread(&mch2.threads[i].handle, (ThreadFunc)dummy_thread_entry, mch2.dummy_threads_lock,
|
||||
mch2.threads[i].stack_top, 0x3F - i, 0);
|
||||
|
||||
svcSignalEvent(mch2.dummy_threads_lock);
|
||||
|
||||
for (i = mch2.threads_limit - 1; i >= 0; i--)
|
||||
{
|
||||
if (!mch2.threads[i].keep)
|
||||
{
|
||||
svcWaitSynchronization(mch2.threads[i].handle, U64_MAX);
|
||||
svcCloseHandle(mch2.threads[i].handle);
|
||||
mch2.threads[i].handle = 0;
|
||||
}
|
||||
}
|
||||
|
||||
svcCloseHandle(mch2.dummy_threads_lock);
|
||||
|
||||
mch2.arbiter = __sync_get_arbiter();
|
||||
u32 fragmented_address = 0;
|
||||
|
||||
svcControlMemory(&linear_buffer, 0, 0, 0x1000,
|
||||
MEMOP_ALLOC_LINEAR, MEMPERM_READ | MEMPERM_WRITE);
|
||||
mch2.arbiter = __sync_get_arbiter();
|
||||
|
||||
mch2.alloc_size = ((((linear_size - (skip_pages << 12))
|
||||
+ 0x1000) >> 13) << 12);
|
||||
u32 linear_buffer;
|
||||
svcControlMemory(&linear_buffer, 0, 0, 0x1000, MEMOP_ALLOC_LINEAR, MEMPERM_READ | MEMPERM_WRITE);
|
||||
|
||||
mem_free = osGetMemRegionFree(MEMREGION_APPLICATION);
|
||||
fragmented_size = mem_free - linear_size;
|
||||
u32 linear_size = 0xF000;
|
||||
u32 skip_pages = 2;
|
||||
mch2.alloc_size = ((((linear_size - (skip_pages << 12)) + 0x1000) >> 13) << 12);
|
||||
u32 mem_free = osGetMemRegionFree(MEMREGION_APPLICATION);
|
||||
|
||||
fragmented_address = __heapBase + __heap_size;
|
||||
mch2.alloc_address = fragmented_address + fragmented_size;
|
||||
u32 fragmented_size = mem_free - linear_size;
|
||||
extern u32 __heapBase;
|
||||
extern u32 __heap_size;
|
||||
fragmented_address = __heapBase + __heap_size;
|
||||
u32 linear_address;
|
||||
mch2.alloc_address = fragmented_address + fragmented_size;
|
||||
|
||||
svcControlMemory(&linear_address,
|
||||
0x0, 0x0, linear_size, MEMOP_ALLOC_LINEAR,
|
||||
MEMPERM_READ | MEMPERM_WRITE);
|
||||
svcControlMemory(&linear_address, 0x0, 0x0, linear_size, MEMOP_ALLOC_LINEAR,
|
||||
MEMPERM_READ | MEMPERM_WRITE);
|
||||
|
||||
if (fragmented_size)
|
||||
svcControlMemory(&tmp,
|
||||
(u32)fragmented_address, 0x0, fragmented_size, MEMOP_ALLOC,
|
||||
MEMPERM_READ | MEMPERM_WRITE);
|
||||
svcControlMemory(&tmp, (u32)fragmented_address, 0x0, fragmented_size, MEMOP_ALLOC,
|
||||
MEMPERM_READ | MEMPERM_WRITE);
|
||||
|
||||
if (skip_pages)
|
||||
svcControlMemory(&tmp,
|
||||
(u32)linear_address, 0x0, (skip_pages << 12), MEMOP_FREE,
|
||||
MEMPERM_DONTCARE);
|
||||
svcControlMemory(&tmp, (u32)linear_address, 0x0, (skip_pages << 12), MEMOP_FREE, MEMPERM_DONTCARE);
|
||||
|
||||
for (i = skip_pages; i < (linear_size >> 12) ; i += 2)
|
||||
svcControlMemory(&tmp,
|
||||
(u32)linear_address + (i << 12), 0x0, 0x1000,
|
||||
MEMOP_FREE, MEMPERM_DONTCARE);
|
||||
svcControlMemory(&tmp, (u32)linear_address + (i << 12), 0x0, 0x1000, MEMOP_FREE, MEMPERM_DONTCARE);
|
||||
|
||||
alloc_address_kaddr = osConvertVirtToPhys(
|
||||
(void*)linear_address) + mch2.kernel_fcram_mapping_offset;
|
||||
u32 alloc_address_kaddr = osConvertVirtToPhys((void*)linear_address) + mch2.kernel_fcram_mapping_offset;
|
||||
|
||||
mch2.thread_page_kva = get_first_free_basemem_page(mch2.isNew3DS)
|
||||
- 0x10000; /* skip down 16 pages */
|
||||
mch2.thread_page_kva = get_first_free_basemem_page(mch2.isNew3DS) - 0x10000; /* skip down 16 pages */
|
||||
((u32*)linear_buffer)[0] = 1;
|
||||
((u32*)linear_buffer)[1] = mch2.thread_page_kva;
|
||||
((u32*)linear_buffer)[2] = alloc_address_kaddr + (((mch2.alloc_size >> 12) - 3) << 13) + (skip_pages << 12);
|
||||
|
||||
dst_memchunk = linear_address
|
||||
+ (((mch2.alloc_size >> 12) - 2) << 13)
|
||||
+ (skip_pages << 12);
|
||||
u32 dst_memchunk = linear_address + (((mch2.alloc_size >> 12) - 2) << 13) + (skip_pages << 12);
|
||||
|
||||
memcpy(flush_buffer, flush_buffer + 0x4000, 0x4000);
|
||||
|
||||
@@ -315,21 +291,18 @@ static void do_memchunkhax2(void)
|
||||
GSPGPU_FlushDataCache((void*)linear_buffer, 16);
|
||||
memcpy(flush_buffer, flush_buffer + 0x4000, 0x4000);
|
||||
|
||||
/* can't clear gspEvents[GSPGPU_EVENT_PPF]),
|
||||
* directly so execute a dummy copy
|
||||
* and use gspWaitForEvent to clear it. */
|
||||
/* can't clear gspEvents[GSPGPU_EVENT_PPF]), directly so execute a dummy copy
|
||||
* and use gspWaitForEvent to clear it. */
|
||||
|
||||
/* LightEvent_Clear(&gspEvents[GSPGPU_EVENT_PPF]); */
|
||||
/* LightEvent_Clear(&gspEvents[GSPGPU_EVENT_PPF]); */
|
||||
GX_TextureCopy((void*)linear_buffer, 0, (void*)dst_memchunk, 0, 16, 8);
|
||||
gspWaitForEvent(GSPGPU_EVENT_PPF, false);
|
||||
|
||||
svcCreateThread(&mch2.alloc_thread,
|
||||
(ThreadFunc)alloc_thread_entry, (u32)&mch2,
|
||||
mch2.threads[MCH2_THREAD_COUNT_MAX - 1].stack_top, 0x3F, 1);
|
||||
svcCreateThread(&mch2.alloc_thread, (ThreadFunc)alloc_thread_entry, (u32)&mch2,
|
||||
mch2.threads[MCH2_THREAD_COUNT_MAX - 1].stack_top, 0x3F, 1);
|
||||
|
||||
while ((u32) svcArbitrateAddress(mch2.arbiter, mch2.alloc_address,
|
||||
ARBITRATION_WAIT_IF_LESS_THAN_TIMEOUT, 0,
|
||||
0) == 0xD9001814);
|
||||
while ((u32) svcArbitrateAddress(mch2.arbiter, mch2.alloc_address, ARBITRATION_WAIT_IF_LESS_THAN_TIMEOUT, 0,
|
||||
0) == 0xD9001814);
|
||||
|
||||
GX_TextureCopy((void*)linear_buffer, 0, (void*)dst_memchunk, 0, 16, 8);
|
||||
memcpy(flush_buffer, flush_buffer + 0x4000, 0x4000);
|
||||
@@ -338,9 +311,9 @@ static void do_memchunkhax2(void)
|
||||
svcWaitSynchronization(mch2.alloc_thread, U64_MAX);
|
||||
svcCloseHandle(mch2.alloc_thread);
|
||||
|
||||
mapped_page = (u32*)
|
||||
(mch2.alloc_address + mch2.alloc_size - 0x1000);
|
||||
thread_ACL = &mapped_page[THREAD_PAGE_ACL_OFFSET >> 2];
|
||||
u32* mapped_page = (u32*)(mch2.alloc_address + mch2.alloc_size - 0x1000);
|
||||
|
||||
volatile u32* thread_ACL = &mapped_page[THREAD_PAGE_ACL_OFFSET >> 2];
|
||||
|
||||
svcCreateEvent(&mch2.main_thread_lock, 0);
|
||||
svcCreateEvent(&mch2.target_threads_lock, 1);
|
||||
@@ -352,18 +325,16 @@ static void do_memchunkhax2(void)
|
||||
continue;
|
||||
|
||||
mch2.threads[i].args.started_event = mch2.main_thread_lock;
|
||||
mch2.threads[i].args.lock = mch2.target_threads_lock;
|
||||
mch2.threads[i].args.target_kaddr = 0;
|
||||
mch2.threads[i].args.lock = mch2.target_threads_lock;
|
||||
mch2.threads[i].args.target_kaddr = 0;
|
||||
|
||||
thread_ACL[0] = 0;
|
||||
thread_ACL[0] = 0;
|
||||
GSPGPU_FlushDataCache((void*)thread_ACL, 16);
|
||||
GSPGPU_InvalidateDataCache((void*)thread_ACL, 16);
|
||||
|
||||
svcClearEvent(mch2.main_thread_lock);
|
||||
svcCreateThread(&mch2.threads[i].handle,
|
||||
(ThreadFunc)target_thread_entry,
|
||||
(u32)&mch2.threads[i].args,
|
||||
mch2.threads[i].stack_top, 0x18, 0);
|
||||
svcCreateThread(&mch2.threads[i].handle, (ThreadFunc)target_thread_entry, (u32)&mch2.threads[i].args,
|
||||
mch2.threads[i].stack_top, 0x18, 0);
|
||||
svcWaitSynchronization(mch2.main_thread_lock, U64_MAX);
|
||||
|
||||
if (thread_ACL[0])
|
||||
@@ -371,10 +342,8 @@ static void do_memchunkhax2(void)
|
||||
thread_ACL[SVC_ACL_OFFSET(0x7B) >> 2] = SVC_ACL_MASK(0x7B);
|
||||
GSPGPU_FlushDataCache((void*)thread_ACL, 16);
|
||||
GSPGPU_InvalidateDataCache((void*)thread_ACL, 16);
|
||||
mch2.threads[i].args.target_kaddr = get_thread_page()
|
||||
+ THREAD_PAGE_ACL_OFFSET
|
||||
+ SVC_ACL_OFFSET(0x7B);
|
||||
mch2.threads[i].args.target_val = SVC_ACL_MASK(0x7B);
|
||||
mch2.threads[i].args.target_kaddr = get_thread_page() + THREAD_PAGE_ACL_OFFSET + SVC_ACL_OFFSET(0x7B);
|
||||
mch2.threads[i].args.target_val = SVC_ACL_MASK(0x7B);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -396,18 +365,14 @@ static void do_memchunkhax2(void)
|
||||
svcCloseHandle(mch2.target_threads_lock);
|
||||
svcCloseHandle(mch2.main_thread_lock);
|
||||
|
||||
svcControlMemory(&tmp, mch2.alloc_address, 0, mch2.alloc_size,
|
||||
MEMOP_FREE, MEMPERM_DONTCARE);
|
||||
svcControlMemory(&tmp, mch2.alloc_address, 0, mch2.alloc_size, MEMOP_FREE, MEMPERM_DONTCARE);
|
||||
write_kaddr(alloc_address_kaddr + linear_size - 0x3000 + 0x4, alloc_address_kaddr + linear_size - 0x1000);
|
||||
svcControlMemory(&tmp, (u32)fragmented_address, 0x0, fragmented_size,
|
||||
MEMOP_FREE, MEMPERM_DONTCARE);
|
||||
svcControlMemory(&tmp, (u32)fragmented_address, 0x0, fragmented_size, MEMOP_FREE, MEMPERM_DONTCARE);
|
||||
|
||||
for (i = 1 + skip_pages; i < (linear_size >> 12) ; i += 2)
|
||||
svcControlMemory(&tmp, (u32)linear_address + (i << 12), 0x0, 0x1000,
|
||||
MEMOP_FREE, MEMPERM_DONTCARE);
|
||||
svcControlMemory(&tmp, (u32)linear_address + (i << 12), 0x0, 0x1000, MEMOP_FREE, MEMPERM_DONTCARE);
|
||||
|
||||
svcControlMemory(&tmp, linear_buffer, 0, 0x1000, MEMOP_FREE,
|
||||
MEMPERM_DONTCARE);
|
||||
svcControlMemory(&tmp, linear_buffer, 0, 0x1000, MEMOP_FREE, MEMPERM_DONTCARE);
|
||||
|
||||
APT_SetAppCpuTimeLimit(mch2.old_cpu_time_limit);
|
||||
}
|
||||
@@ -453,8 +418,7 @@ static void memchunkhax1_write_pair(u32 val1, u32 val2)
|
||||
u32* next_ptr1;
|
||||
u32* prev_ptr6;
|
||||
|
||||
svcControlMemory(&linear_buffer, 0, 0, 0x10000,
|
||||
MEMOP_ALLOC_LINEAR, MEMPERM_READ | MEMPERM_WRITE);
|
||||
svcControlMemory(&linear_buffer, 0, 0, 0x10000, MEMOP_ALLOC_LINEAR, MEMPERM_READ | MEMPERM_WRITE);
|
||||
|
||||
flush_buffer = (u8*)(linear_buffer + 0x8000);
|
||||
|
||||
@@ -462,24 +426,23 @@ static void memchunkhax1_write_pair(u32 val1, u32 val2)
|
||||
svcControlMemory(&tmp, linear_buffer + 0x3000, 0, 0x2000, MEMOP_FREE, 0);
|
||||
svcControlMemory(&tmp, linear_buffer + 0x6000, 0, 0x1000, MEMOP_FREE, 0);
|
||||
|
||||
next_ptr1 = (u32*)(linear_buffer + 0x0004);
|
||||
next_ptr1 = (u32*)(linear_buffer + 0x0004);
|
||||
gspwn(linear_buffer + 0x0000, linear_buffer + 0x1000, 16, flush_buffer);
|
||||
|
||||
next_ptr3 = (u32*)(linear_buffer + 0x2004);
|
||||
prev_ptr3 = (u32*)(linear_buffer + 0x2008);
|
||||
next_ptr3 = (u32*)(linear_buffer + 0x2004);
|
||||
prev_ptr3 = (u32*)(linear_buffer + 0x2008);
|
||||
gspwn(linear_buffer + 0x2000, linear_buffer + 0x3000, 16, flush_buffer);
|
||||
|
||||
prev_ptr6 = (u32*)(linear_buffer + 0x5008);
|
||||
prev_ptr6 = (u32*)(linear_buffer + 0x5008);
|
||||
gspwn(linear_buffer + 0x5000, linear_buffer + 0x6000, 16, flush_buffer);
|
||||
|
||||
*next_ptr1 = *next_ptr3;
|
||||
*prev_ptr6 = *prev_ptr3;
|
||||
*next_ptr1 = *next_ptr3;
|
||||
*prev_ptr6 = *prev_ptr3;
|
||||
|
||||
*prev_ptr3 = val1 - 4;
|
||||
*next_ptr3 = val2;
|
||||
*prev_ptr3 = val1 - 4;
|
||||
*next_ptr3 = val2;
|
||||
gspwn(linear_buffer + 0x3000, linear_buffer + 0x2000, 16, flush_buffer);
|
||||
svcControlMemory(&tmp, 0, 0, 0x2000,
|
||||
MEMOP_ALLOC_LINEAR, MEMPERM_READ | MEMPERM_WRITE);
|
||||
svcControlMemory(&tmp, 0, 0, 0x2000, MEMOP_ALLOC_LINEAR, MEMPERM_READ | MEMPERM_WRITE);
|
||||
|
||||
gspwn(linear_buffer + 0x1000, linear_buffer + 0x0000, 16, flush_buffer);
|
||||
gspwn(linear_buffer + 0x6000, linear_buffer + 0x5000, 16, flush_buffer);
|
||||
@@ -487,6 +450,7 @@ static void memchunkhax1_write_pair(u32 val1, u32 val2)
|
||||
svcControlMemory(&tmp, linear_buffer + 0x0000, 0, 0x1000, MEMOP_FREE, 0);
|
||||
svcControlMemory(&tmp, linear_buffer + 0x2000, 0, 0x4000, MEMOP_FREE, 0);
|
||||
svcControlMemory(&tmp, linear_buffer + 0x7000, 0, 0x9000, MEMOP_FREE, 0);
|
||||
|
||||
}
|
||||
|
||||
static void do_memchunkhax1(void)
|
||||
@@ -494,9 +458,7 @@ static void do_memchunkhax1(void)
|
||||
u32 saved_vram_value = *(u32*)0x1F000008;
|
||||
|
||||
/* 0x1F000000 contains the enable bit for svc 0x7B */
|
||||
memchunkhax1_write_pair(get_thread_page()
|
||||
+ THREAD_PAGE_ACL_OFFSET
|
||||
+ SVC_ACL_OFFSET(0x7B), 0x1F000000);
|
||||
memchunkhax1_write_pair(get_thread_page() + THREAD_PAGE_ACL_OFFSET + SVC_ACL_OFFSET(0x7B), 0x1F000000);
|
||||
|
||||
write_kaddr(0x1F000008, saved_vram_value);
|
||||
}
|
||||
@@ -518,11 +480,9 @@ Result get_luma_version(u32 *major, u32 *minor)
|
||||
Result svchax_init(bool patch_srv)
|
||||
{
|
||||
bool isNew3DS;
|
||||
u32 kver;
|
||||
|
||||
APT_CheckNew3DS(&isNew3DS);
|
||||
|
||||
kver = osGetKernelVersion();
|
||||
u32 kver = osGetKernelVersion();
|
||||
|
||||
if (!__ctr_svchax)
|
||||
{
|
||||
@@ -531,11 +491,9 @@ Result svchax_init(bool patch_srv)
|
||||
u32 luma_major, luma_minor;
|
||||
|
||||
if (kver > SYSTEM_VERSION(2, 50, 11) &&
|
||||
(R_FAILED(get_luma_version(&luma_major, &luma_minor)
|
||||
|| luma_major < 8)))
|
||||
(R_FAILED(get_luma_version(&luma_major, &luma_minor) || luma_major < 8)))
|
||||
return -1;
|
||||
else if (kver > SYSTEM_VERSION(2, 46, 0)
|
||||
&& kver <= SYSTEM_VERSION(2, 50, 11))
|
||||
else if (kver > SYSTEM_VERSION(2, 46, 0) && kver <= SYSTEM_VERSION(2, 50, 11))
|
||||
do_memchunkhax2();
|
||||
else if (kver <= SYSTEM_VERSION(2, 46, 0))
|
||||
do_memchunkhax1();
|
||||
@@ -548,9 +506,8 @@ Result svchax_init(bool patch_srv)
|
||||
|
||||
if (patch_srv && !__ctr_svchax_srv)
|
||||
{
|
||||
u32 PID_kaddr = read_kaddr(CURRENT_KPROCESS)
|
||||
+ (isNew3DS ? 0xBC : (kver > SYSTEM_VERSION(2, 40, 0)) ? 0xB4 : 0xAC);
|
||||
u32 old_PID = read_kaddr(PID_kaddr);
|
||||
u32 PID_kaddr = read_kaddr(CURRENT_KPROCESS) + (isNew3DS ? 0xBC : (kver > SYSTEM_VERSION(2, 40, 0)) ? 0xB4 : 0xAC);
|
||||
u32 old_PID = read_kaddr(PID_kaddr);
|
||||
write_kaddr(PID_kaddr, 0);
|
||||
srvExit();
|
||||
srvInit();
|
||||
|
||||
+39
-41
@@ -10,7 +10,6 @@
|
||||
|
||||
#define CTR_APPMEMALLOC_PTR ((u32*)0x1FF80040)
|
||||
|
||||
/* Global variables */
|
||||
u32 __stacksize__ = 0x00400000;
|
||||
u32 __linear_heap_size = 0x01000000;
|
||||
|
||||
@@ -23,24 +22,22 @@ u32 __stack_size_extra;
|
||||
|
||||
extern u32 __linear_heap_size_hbl;
|
||||
extern u32 __heap_size_hbl;
|
||||
extern void* __service_ptr;
|
||||
|
||||
extern void (*__system_retAddr)(void);
|
||||
|
||||
/* Forward declarations */
|
||||
void envDestroyHandles(void);
|
||||
void __appExit(void);
|
||||
void __appExit();
|
||||
void __libc_fini_array(void);
|
||||
|
||||
void __appInit(void);
|
||||
void __appInit();
|
||||
void __libc_init_array(void);
|
||||
void __system_initSyscalls(void);
|
||||
void __system_initArgv(void);
|
||||
void __system_initArgv();
|
||||
|
||||
void __ctru_exit(int rc);
|
||||
int __libctru_gtod(struct _reent* ptr,
|
||||
struct timeval* tp, struct timezone* tz);
|
||||
int __libctru_gtod(struct _reent* ptr, struct timeval* tp, struct timezone* tz);
|
||||
void (*__system_retAddr)(void);
|
||||
extern void* __service_ptr;
|
||||
|
||||
Result __sync_init(void) __attribute__((weak));
|
||||
|
||||
@@ -82,8 +79,9 @@ void __attribute__((weak)) __libctru_init(void (*retAddr)(void))
|
||||
{
|
||||
/* Store the return address */
|
||||
__system_retAddr = NULL;
|
||||
if (envIsHomebrew())
|
||||
if (envIsHomebrew()) {
|
||||
__system_retAddr = retAddr;
|
||||
}
|
||||
|
||||
/* Initialize the synchronization subsystem */
|
||||
__sync_init();
|
||||
@@ -142,41 +140,37 @@ extern const char* __system_arglist;
|
||||
char __argv_hmac[0x20] = {0x1d, 0x78, 0xff, 0xb9, 0xc5, 0xbc, 0x78, 0xb7, 0xac, 0x29, 0x1d, 0x3e, 0x16, 0xd0, 0xcf, 0x53,
|
||||
0xef, 0x12, 0x58, 0x83, 0xb6, 0x9e, 0x2f, 0x79, 0x47, 0xf9, 0x35, 0x61, 0xeb, 0x50, 0xd7, 0x67};
|
||||
|
||||
Result APT_ReceiveDeliverArg_(void* param, size_t param_size,
|
||||
void* hmac, size_t hmac_size, u64* source_pid, bool* received)
|
||||
Result APT_ReceiveDeliverArg_(void* param, size_t param_size, void* hmac, size_t hmac_size, u64* source_pid, bool* received)
|
||||
{
|
||||
u32 cmdbuf[16];
|
||||
cmdbuf[0]=IPC_MakeHeader(0x35,2,0);
|
||||
cmdbuf[1]=param_size;
|
||||
cmdbuf[2]=hmac_size;
|
||||
|
||||
u32 saved_threadstorage[4];
|
||||
u32 *staticbufs;
|
||||
Result ret;
|
||||
u32* staticbufs = getThreadStaticBuffers();
|
||||
saved_threadstorage[0]=staticbufs[0];
|
||||
saved_threadstorage[1]=staticbufs[1];
|
||||
saved_threadstorage[2]=staticbufs[2];
|
||||
saved_threadstorage[3]=staticbufs[3];
|
||||
staticbufs[0]=IPC_Desc_StaticBuffer(param_size, 0);
|
||||
staticbufs[1]=(u32)param;
|
||||
staticbufs[2]=IPC_Desc_StaticBuffer(hmac_size, 2);
|
||||
staticbufs[3]=(u32)hmac;
|
||||
|
||||
cmdbuf[0] = IPC_MakeHeader(0x35,2,0);
|
||||
cmdbuf[1] = param_size;
|
||||
cmdbuf[2] = hmac_size;
|
||||
|
||||
staticbufs = getThreadStaticBuffers();
|
||||
saved_threadstorage[0] = staticbufs[0];
|
||||
saved_threadstorage[1] = staticbufs[1];
|
||||
saved_threadstorage[2] = staticbufs[2];
|
||||
saved_threadstorage[3] = staticbufs[3];
|
||||
staticbufs[0] = IPC_Desc_StaticBuffer(param_size, 0);
|
||||
staticbufs[1] = (u32)param;
|
||||
staticbufs[2] = IPC_Desc_StaticBuffer(hmac_size, 2);
|
||||
staticbufs[3] = (u32)hmac;
|
||||
|
||||
ret = aptSendCommand(cmdbuf);
|
||||
staticbufs[0] = saved_threadstorage[0];
|
||||
staticbufs[1] = saved_threadstorage[1];
|
||||
staticbufs[2] = saved_threadstorage[2];
|
||||
staticbufs[3] = saved_threadstorage[3];
|
||||
Result ret = aptSendCommand(cmdbuf);
|
||||
staticbufs[0]=saved_threadstorage[0];
|
||||
staticbufs[1]=saved_threadstorage[1];
|
||||
staticbufs[2]=saved_threadstorage[2];
|
||||
staticbufs[3]=saved_threadstorage[3];
|
||||
|
||||
if(R_FAILED(ret))
|
||||
return ret;
|
||||
|
||||
if(source_pid)
|
||||
*source_pid = ((u64*)cmdbuf)[1];
|
||||
*source_pid = ((u64*)cmdbuf)[1];
|
||||
if(received)
|
||||
*received = ((bool*)cmdbuf)[16];
|
||||
*received = ((bool*)cmdbuf)[16];
|
||||
|
||||
return cmdbuf[1];
|
||||
}
|
||||
@@ -208,15 +202,13 @@ void __system_initArgv(void)
|
||||
|
||||
if (__system_argc)
|
||||
{
|
||||
__system_argv = (char**)malloc(
|
||||
(__system_argc + 1) * sizeof(char**));
|
||||
__system_argv[0] = arg_struct->args;
|
||||
__system_argv = (char**) malloc((__system_argc + 1) * sizeof(char**));
|
||||
__system_argv[0] = arg_struct->args;
|
||||
for (i = 1; i < __system_argc; i++)
|
||||
__system_argv[i] = __system_argv[i - 1] + strlen(__system_argv[i - 1]) + 1;
|
||||
|
||||
i = __system_argc - 1;
|
||||
i = __system_argc - 1;
|
||||
__system_argc = 1;
|
||||
|
||||
while (i)
|
||||
{
|
||||
if(__system_argv[i] && isalnum(__system_argv[i][0])
|
||||
@@ -231,8 +223,8 @@ void __system_initArgv(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
__system_argc = 1;
|
||||
__system_argv = (char**) malloc(sizeof(char**) * 2);
|
||||
__system_argc = 1;
|
||||
__system_argv = (char**) malloc(sizeof(char**) * 2);
|
||||
__system_argv[0] = "sdmc:/retroarch/retroarch";
|
||||
}
|
||||
__system_argv[__system_argc] = NULL;
|
||||
@@ -277,6 +269,8 @@ void dump_result_value(Result val)
|
||||
printf("level : %u\n", res.level);
|
||||
}
|
||||
|
||||
bool select_pressed = false;
|
||||
|
||||
void wait_for_input(void)
|
||||
{
|
||||
printf("\n\nPress Start.\n\n");
|
||||
@@ -296,6 +290,10 @@ void wait_for_input(void)
|
||||
if (kDown & KEY_SELECT)
|
||||
exit(0);
|
||||
|
||||
#if 0
|
||||
select_pressed = true;
|
||||
#endif
|
||||
|
||||
svcSleepThread(1000000);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,12 +15,12 @@ static void (*launch_3dsx)(const char* path,
|
||||
static int exec_3dsx_actual(const char* path,
|
||||
const char** args, bool appendPath)
|
||||
{
|
||||
bool inited;
|
||||
bool fileExists;
|
||||
struct stat sBuff;
|
||||
argData_s newProgramArgs;
|
||||
unsigned int argChars = 0;
|
||||
unsigned int argNum = 0;
|
||||
unsigned int argNum = 0;
|
||||
bool fileExists;
|
||||
bool inited;
|
||||
|
||||
if (!path || path[0] == '\0')
|
||||
{
|
||||
@@ -51,8 +51,7 @@ static int exec_3dsx_actual(const char* path,
|
||||
newProgramArgs.dst += strlen(path) + 1;
|
||||
newProgramArgs.buf[0]++;
|
||||
}
|
||||
|
||||
while(args[argNum])
|
||||
while(args[argNum] != NULL)
|
||||
{
|
||||
strcpy(newProgramArgs.dst, args[argNum]);
|
||||
newProgramArgs.dst += strlen(args[argNum]) + 1;
|
||||
@@ -60,18 +59,18 @@ static int exec_3dsx_actual(const char* path,
|
||||
argNum++;
|
||||
}
|
||||
|
||||
inited = loader_Rosalina.init();
|
||||
launch_3dsx = loader_Rosalina.launchFile;
|
||||
inited = loader_Rosalina.init();
|
||||
launch_3dsx = loader_Rosalina.launchFile;
|
||||
|
||||
if (!inited)
|
||||
{
|
||||
inited = loader_Ninjhax2.init();
|
||||
inited = loader_Ninjhax2.init();
|
||||
launch_3dsx = loader_Ninjhax2.launchFile;
|
||||
}
|
||||
|
||||
if (!inited)
|
||||
{
|
||||
inited = loader_Ninjhax1.init();
|
||||
inited = loader_Ninjhax1.init();
|
||||
launch_3dsx = loader_Ninjhax1.launchFile;
|
||||
}
|
||||
|
||||
|
||||
+22
-32
@@ -6,10 +6,9 @@
|
||||
|
||||
#define FILE_CHUNK_SIZE 4096
|
||||
|
||||
typedef struct
|
||||
{
|
||||
u32 argc;
|
||||
char args[0x300 - 0x4];
|
||||
typedef struct{
|
||||
u32 argc;
|
||||
char args[0x300 - 0x4];
|
||||
}ciaParam;
|
||||
|
||||
char argvHmac[0x20] = {0x1d, 0x78, 0xff, 0xb9, 0xc5, 0xbc, 0x78, 0xb7, 0xac, 0x29, 0x1d, 0x3e, 0x16, 0xd0, 0xcf, 0x53, 0xef, 0x12, 0x58, 0x83, 0xb6, 0x9e, 0x2f, 0x79, 0x47, 0xf9, 0x35, 0x61, 0xeb, 0x50, 0xd7, 0x67};
|
||||
@@ -29,10 +28,11 @@ static int isCiaInstalled(u64 titleId, u16 version)
|
||||
u32 titlesToRetrieve;
|
||||
u32 titlesRetrieved;
|
||||
u64* titleIds;
|
||||
u32 titlesToCheck;
|
||||
AM_TitleEntry titleInfo;
|
||||
bool titleExists = false;
|
||||
Result failed = AM_GetTitleCount(MEDIATYPE_SD, &titlesToRetrieve);
|
||||
AM_TitleEntry titleInfo;
|
||||
Result failed;
|
||||
|
||||
failed = AM_GetTitleCount(MEDIATYPE_SD, &titlesToRetrieve);
|
||||
if (R_FAILED(failed))
|
||||
return -1;
|
||||
|
||||
@@ -44,7 +44,7 @@ static int isCiaInstalled(u64 titleId, u16 version)
|
||||
if (R_FAILED(failed))
|
||||
return -1;
|
||||
|
||||
for(titlesToCheck = 0; titlesToCheck < titlesRetrieved; titlesToCheck++)
|
||||
for(u32 titlesToCheck = 0; titlesToCheck < titlesRetrieved; titlesToCheck++)
|
||||
{
|
||||
if (titleIds[titlesToCheck] == titleId)
|
||||
{
|
||||
@@ -57,8 +57,7 @@ static int isCiaInstalled(u64 titleId, u16 version)
|
||||
|
||||
if (titleExists)
|
||||
{
|
||||
failed = AM_GetTitleInfo(MEDIATYPE_SD,
|
||||
1 /*titleCount*/, &titleId, &titleInfo);
|
||||
failed = AM_GetTitleInfo(MEDIATYPE_SD, 1 /*titleCount*/, &titleId, &titleInfo);
|
||||
if (R_FAILED(failed))
|
||||
return -1;
|
||||
|
||||
@@ -71,13 +70,15 @@ static int isCiaInstalled(u64 titleId, u16 version)
|
||||
|
||||
static int installCia(Handle ciaFile)
|
||||
{
|
||||
Result failed;
|
||||
Handle outputHandle;
|
||||
u64 fileSize;
|
||||
u64 fileOffset = 0;
|
||||
u32 bytesRead;
|
||||
u32 bytesWritten;
|
||||
u8 transferBuffer[FILE_CHUNK_SIZE];
|
||||
u64 fileOffset = 0;
|
||||
Result failed = AM_StartCiaInstall(MEDIATYPE_SD, &outputHandle);
|
||||
|
||||
failed = AM_StartCiaInstall(MEDIATYPE_SD, &outputHandle);
|
||||
if (R_FAILED(failed))
|
||||
return -1;
|
||||
|
||||
@@ -88,19 +89,14 @@ static int installCia(Handle ciaFile)
|
||||
while(fileOffset < fileSize)
|
||||
{
|
||||
u64 bytesRemaining = fileSize - fileOffset;
|
||||
failed = FSFILE_Read(ciaFile, &bytesRead,
|
||||
fileOffset, transferBuffer,
|
||||
bytesRemaining < FILE_CHUNK_SIZE
|
||||
? bytesRemaining
|
||||
: FILE_CHUNK_SIZE);
|
||||
failed = FSFILE_Read(ciaFile, &bytesRead, fileOffset, transferBuffer, bytesRemaining < FILE_CHUNK_SIZE ? bytesRemaining : FILE_CHUNK_SIZE);
|
||||
if (R_FAILED(failed))
|
||||
{
|
||||
AM_CancelCIAInstall(outputHandle);
|
||||
return -1;
|
||||
}
|
||||
|
||||
failed = FSFILE_Write(outputHandle, &bytesWritten,
|
||||
fileOffset, transferBuffer, bytesRead, 0);
|
||||
failed = FSFILE_Write(outputHandle, &bytesWritten, fileOffset, transferBuffer, bytesRead, 0);
|
||||
if (R_FAILED(failed))
|
||||
{
|
||||
AM_CancelCIAInstall(outputHandle);
|
||||
@@ -150,7 +146,6 @@ int exec_cia(const char* path, const char** args)
|
||||
}
|
||||
|
||||
inited = R_SUCCEEDED(amInit()) && R_SUCCEEDED(fsInit());
|
||||
|
||||
if (inited)
|
||||
{
|
||||
AM_TitleEntry ciaInfo;
|
||||
@@ -160,15 +155,12 @@ int exec_cia(const char* path, const char** args)
|
||||
ciaParam param;
|
||||
int argsLength;
|
||||
/* open CIA file */
|
||||
Result res = FSUSER_OpenArchive(&ciaArchive,
|
||||
ARCHIVE_SDMC, fsMakePath(PATH_EMPTY, ""));
|
||||
Result res = FSUSER_OpenArchive(&ciaArchive, ARCHIVE_SDMC, fsMakePath(PATH_EMPTY, ""));
|
||||
|
||||
if (R_FAILED(res))
|
||||
errorAndQuit("Cant open SD FS archive.");
|
||||
|
||||
res = FSUSER_OpenFile(&ciaFile,
|
||||
ciaArchive, fsMakePath(PATH_ASCII, path + 5/*skip "sdmc:"*/),
|
||||
FS_OPEN_READ, 0);
|
||||
res = FSUSER_OpenFile(&ciaFile, ciaArchive, fsMakePath(PATH_ASCII, path + 5/*skip "sdmc:"*/), FS_OPEN_READ, 0);
|
||||
if (R_FAILED(res))
|
||||
errorAndQuit("Cant open CIA file.");
|
||||
|
||||
@@ -193,11 +185,10 @@ int exec_cia(const char* path, const char** args)
|
||||
FSFILE_Close(ciaFile);
|
||||
FSUSER_CloseArchive(ciaArchive);
|
||||
|
||||
param.argc = 0;
|
||||
argsLength = 0;
|
||||
char *argLocation = param.args;
|
||||
|
||||
while(args[param.argc])
|
||||
param.argc = 0;
|
||||
argsLength = 0;
|
||||
char* argLocation = param.args;
|
||||
while(args[param.argc] != NULL)
|
||||
{
|
||||
strcpy(argLocation, args[param.argc]);
|
||||
argLocation += strlen(args[param.argc]) + 1;
|
||||
@@ -209,8 +200,7 @@ int exec_cia(const char* path, const char** args)
|
||||
if (R_FAILED(res))
|
||||
errorAndQuit("CIA cant run, cant prepare.");
|
||||
|
||||
res = APT_DoApplicationJump(¶m, sizeof(param.argc)
|
||||
+ argsLength, argvHmac);
|
||||
res = APT_DoApplicationJump(¶m, sizeof(param.argc) + argsLength, argvHmac);
|
||||
if (R_FAILED(res))
|
||||
errorAndQuit("CIA cant run, cant jump.");
|
||||
|
||||
|
||||
@@ -3,24 +3,20 @@
|
||||
Handle launchOpenFile(const char* path)
|
||||
{
|
||||
Handle file;
|
||||
Result res;
|
||||
ssize_t units;
|
||||
static uint16_t __utf16path[PATH_MAX+1];
|
||||
|
||||
if (strncmp(path, "sdmc:/", 6) == 0)
|
||||
path += 5;
|
||||
else if (*path != '/')
|
||||
return 0;
|
||||
|
||||
/* Convert the executable path to UTF-16 */
|
||||
units = utf8_to_utf16(__utf16path, (const uint8_t*)path, PATH_MAX);
|
||||
static uint16_t __utf16path[PATH_MAX+1];
|
||||
ssize_t units = utf8_to_utf16(__utf16path, (const uint8_t*)path, PATH_MAX);
|
||||
if (units < 0 || units >= PATH_MAX) return 0;
|
||||
__utf16path[units] = 0;
|
||||
|
||||
/* Open the file directly */
|
||||
FS_Path apath = { PATH_EMPTY, 1, (u8*)"" };
|
||||
FS_Path fpath = { PATH_UTF16, (units+1)*2, (u8*)__utf16path };
|
||||
res = FSUSER_OpenFileDirectly(&file, ARCHIVE_SDMC,
|
||||
apath, fpath, FS_OPEN_READ, 0);
|
||||
Result res = FSUSER_OpenFileDirectly(&file, ARCHIVE_SDMC, apath, fpath, FS_OPEN_READ, 0);
|
||||
return R_SUCCEEDED(res) ? file : 0;
|
||||
}
|
||||
@@ -9,32 +9,28 @@ static bool init(void)
|
||||
|
||||
static Result HBLDR_SetTarget(const char* path)
|
||||
{
|
||||
Result rc;
|
||||
u32 pathLen = strlen(path) + 1;
|
||||
u32* cmdbuf = getThreadCommandBuffer();
|
||||
|
||||
cmdbuf[0] = IPC_MakeHeader(2, 0, 2); /* 0x20002 */
|
||||
cmdbuf[1] = IPC_Desc_StaticBuffer(pathLen, 0);
|
||||
cmdbuf[2] = (u32)path;
|
||||
cmdbuf[0] = IPC_MakeHeader(2, 0, 2); /* 0x20002 */
|
||||
cmdbuf[1] = IPC_Desc_StaticBuffer(pathLen, 0);
|
||||
cmdbuf[2] = (u32)path;
|
||||
|
||||
rc = svcSendSyncRequest(hbldrHandle);
|
||||
if (R_SUCCEEDED(rc))
|
||||
rc = cmdbuf[1];
|
||||
Result rc = svcSendSyncRequest(hbldrHandle);
|
||||
if (R_SUCCEEDED(rc)) rc = cmdbuf[1];
|
||||
return rc;
|
||||
}
|
||||
|
||||
static Result HBLDR_SetArgv(const void* buffer, u32 size)
|
||||
{
|
||||
Result rc;
|
||||
u32* cmdbuf = getThreadCommandBuffer();
|
||||
|
||||
cmdbuf[0] = IPC_MakeHeader(3, 0, 2); /* 0x30002 */
|
||||
cmdbuf[1] = IPC_Desc_StaticBuffer(size, 1);
|
||||
cmdbuf[2] = (u32)buffer;
|
||||
cmdbuf[0] = IPC_MakeHeader(3, 0, 2); /* 0x30002 */
|
||||
cmdbuf[1] = IPC_Desc_StaticBuffer(size, 1);
|
||||
cmdbuf[2] = (u32)buffer;
|
||||
|
||||
rc = svcSendSyncRequest(hbldrHandle);
|
||||
if (R_SUCCEEDED(rc))
|
||||
rc = cmdbuf[1];
|
||||
Result rc = svcSendSyncRequest(hbldrHandle);
|
||||
if (R_SUCCEEDED(rc)) rc = cmdbuf[1];
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -43,8 +39,7 @@ static void deinit(void)
|
||||
svcCloseHandle(hbldrHandle);
|
||||
}
|
||||
|
||||
static void launchFile(const char* path,
|
||||
argData_s* args, executableMetadata_s* em)
|
||||
static void launchFile(const char* path, argData_s* args, executableMetadata_s* em)
|
||||
{
|
||||
if (strncmp(path, "sdmc:/",6) == 0)
|
||||
path += 5;
|
||||
|
||||
Loaded 100 of 1117 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user