Compare commits

...
Author SHA1 Message Date
twinaphex 7b6e564ba3 (Mac) Make separate default core dirs based on architecture - note -
we will also have to write to a separate config file per architecture -
that will have to come next
2021-08-28 14:32:17 +02:00
twinaphex b574780d99 (UWP) Updated icons courtesy of Danp142 2021-08-27 20:17:22 +02:00
Autechre 1a2ee91117 Merge pull request #12895 from jdgleaver/overlay-adc-fix
Fix overlay input when analog to digital mapping is enabled
2021-08-27 17:21:10 +02:00
jdgleaver bc6fec6e0c Fix overlay input when analog to digital mapping is enabled 2021-08-27 16:16:31 +01:00
Autechre ec06ab0941 Merge pull request #12890 from jdgleaver/custom-viewport-keyboard-entry
Allow 'Custom Aspect Ratio (X Position)/(Y Position)/(Width)/(Height)' to be entered manually via keyboard
2021-08-27 15:08:05 +02:00
jdgleaver 32e2aacd3c Allow 'Custom Aspect Ratio (X Position)/(Y Position)/(Width)/(Height)' to be entered manually via keyboard 2021-08-27 11:21:29 +01:00
twinaphex 7f08729a5e Revert "(gfx_display) Make gfx_display_set_fb_size - get rid of the small"
This reverts commit 618cfacd59.
2021-08-26 18:42:43 +02:00
twinaphex ea6139b234 Revert "(GX) Buildfix"
This reverts commit 96d87802cd.
2021-08-26 18:42:34 +02:00
twinaphex 96d87802cd (GX) Buildfix 2021-08-26 18:31:32 +02:00
twinaphex 618cfacd59 (gfx_display) Make gfx_display_set_fb_size - get rid of the small
getter/setter functions - also finally take this opportunity to stop
setting framebuffer width/height/pitch for menu drivers that don't
use a framebuffer texture at all
2021-08-26 18:26:44 +02:00
Autechre 6d9ee4c161 Merge pull request #12875 from libretro/coc-update
Add Code of Conduct
2021-08-26 15:37:14 +02:00
Stephanie Gawroriski 46b9432fb8 Include subject line inclusion. 2021-08-26 09:34:40 -04:00
Autechre c66bcc05cf Merge pull request #12878 from libretro/input-get-rid-of-getters-setters
Get rid of getters/setters in big driver files from now
2021-08-26 14:58:33 +02:00
Autechre 00b15c4e79 Merge pull request #12877 from jdgleaver/core-options-flush
Add option to (force-)write current core options to disk
2021-08-26 14:11:05 +02:00
twinaphex 597dbfdf9a Address issues pointed out 2021-08-26 14:01:37 +02:00
twinaphex af6b09d950 Fix some of the indenting; add NULL checks 2021-08-26 13:49:06 +02:00
twinaphex 0194ce91bf Get rid of getters/setters in big driver files from now 2021-08-26 13:27:44 +02:00
jdgleaver a6901dc85e Add option to (force-)write current core options to disk 2021-08-26 11:42:46 +01:00
Stephanie Gawroriski 8850a4984b Remove Discord and Twitter 2021-08-25 19:03:08 -04:00
Stephanie Gawroriski daef26f951 Create CODE_OF_CONDUCT.md 2021-08-25 18:55:32 -04:00
Autechre 5ca99fdb51 Merge pull request #12874 from libretro/social-update
Contributing guidelines update.
2021-08-25 21:16:48 +02:00
Autechre 23a06ef1a1 Merge pull request #12863 from sonninnos/config-ar
Default aspect ratio + sublabel correction
2021-08-25 17:29:25 +02:00
Stephanie Gawroriski cd3e818210 Add coding standards. 2021-08-25 10:54:04 -04:00
Twinaphex 619df7e11b remove HAVE_DISCORD from OSX OpenGL solution (RetroArch.xcodeproj) - we
cannot assume C++11 support here for backwards compatibility purposes
2021-08-25 13:03:19 +02:00
twinaphex df98bca9ae (Mac) Add Discord RPC support - untested 2021-08-25 09:56:00 +02:00
Autechre 10e1f5d72a Merge pull request #12871 from sonninnos/msvc-buildfix
MSVC buildfix
2021-08-25 00:37:40 +02:00
Autechre aac207b455 Merge pull request #12872 from sonninnos/c89-buildfix
C89 buildfix
2021-08-25 00:37:31 +02:00
sonninnos ca311246b1 C89 buildfix 2021-08-24 22:32:47 +03:00
sonninnos 22de07a662 MSVC buildfix 2021-08-24 22:28:13 +03:00
Autechre 2329a36f54 Merge pull request #12866 from sonninnos/resolution-list
Screen Resolution list sanitizing
2021-08-24 20:21:48 +02:00
Autechre ab3385c73d Merge pull request #12870 from sonninnos/menu-sound-sublabel
Add sublabel for 'Menu Sounds'
2021-08-24 20:18:34 +02:00
sonninnos f21f113678 Add sublabel for 'Menu Sounds' 2021-08-24 21:05:21 +03:00
sonninnos d5b1c3092f Screen Resolution list sanitizing 2021-08-24 20:01:19 +03:00
twinaphex d401816f41 Silence warnings 2021-08-24 18:47:29 +02:00
Autechre dbb74ba5ab Merge pull request #12823 from markwkidd/input-drivers
input_driver refactor
2021-08-24 18:45:20 +02:00
Autechre 4e188c0f26 Merge pull request #12830 from icculus/udev_keyboard_detect_fix
udev_input.c: Look for "ID_INPUT_KEY", not "ID_INPUT_KEYBOARD"
2021-08-24 18:42:38 +02:00
Autechre 376f06c993 Merge pull request #12841 from libretro/resampler-neon
(sinc) Add non-ASM ARM NEON intrinsics codepath for Sinc resampler
2021-08-24 17:52:34 +02:00
Autechre 1bd188c5a7 Merge pull request #12867 from jdgleaver/shader-parameter-check-fix
Highlight currently selected value in Shader Parameter drop-down lists
2021-08-24 16:49:51 +02:00
Autechre d3813dddb1 Merge pull request #12868 from sonninnos/winraw-overlay-fix
(WINRAW) Fix crash when overlay is enabled
2021-08-24 16:49:30 +02:00
sonninnos 957b71cfdc (WINRAW) Fix crash when overlay is enabled 2021-08-24 17:03:28 +03:00
jdgleaver d35200aa56 Highlight currently selected value in Shader Parameter drop-down lists 2021-08-24 14:45:57 +01:00
Autechre 919954c5be Merge pull request #12864 from sonninnos/rate-set-prefix
Print video-prefix in refresh rate set to log only
2021-08-24 11:28:24 +02:00
Autechre cc7247aecf Merge pull request #12855 from jdgleaver/core-info-cache-path
Remove core path from core info cache
2021-08-24 11:27:31 +02:00
Autechre 024dbb5008 Merge pull request #12862 from sonninnos/video-sublabels
Add missing sublabels for video options
2021-08-24 11:26:40 +02:00
Autechre 41afbc30ef Merge pull request #12859 from jdgleaver/refresh-rate-entry
Allow 'Vertical Refresh Rate' to be entered manually via keyboard
2021-08-24 11:26:24 +02:00
sonninnos 8d513f8199 Print video-prefix in refresh rate set to log only 2021-08-23 18:32:10 +03:00
sonninnos eb49458284 Default aspect ratio + sublabel correction 2021-08-23 18:13:46 +03:00
Autechre b2c87baa87 Merge pull request #12861 from jdgleaver/audio-menu-fix
Fix segfault when accessing 'Audio' menu on platforms without mixer support
2021-08-23 16:44:47 +02:00
sonninnos 71ca56e0fb Add missing sublabels for video options 2021-08-23 17:44:02 +03:00
jdgleaver f505d625a3 Fix segfault when accessing 'Audio' menu on platforms without mixer support 2021-08-23 15:37:29 +01:00
jdgleaver 6855b7f2b1 Allow 'Vertical Refresh Rate' to be entered manually via keyboard 2021-08-23 13:55:19 +01:00
Autechre 1ad0251da9 Merge pull request #12856 from jdgleaver/gfx-display-unused-vars
(gfx_display.c) Remove unused variables
2021-08-23 14:06:57 +02:00
Autechre e5d6d411be Merge pull request #12857 from jdgleaver/qt-video-settings-fix
(Qt) Fix segfault when accessing Video Options menu on non-Windows platforms
2021-08-23 13:56:33 +02:00
jdgleaver b0c5362da6 (Qt) Fix segfault when accessing Video Options menu on non-Windows platforms 2021-08-23 12:40:46 +01:00
jdgleaver 67bc91c1d0 (gfx_display.c) Remove unused variables 2021-08-23 12:11:00 +01:00
jdgleaver f0a510c8a6 Remove core path from core info cache 2021-08-23 11:47:08 +01:00
Autechre f2d574fd87 Merge pull request #12853 from nbarkhina/master
Fixed web player bug with filesystem and runtime
2021-08-23 11:00:10 +02:00
Neil Barkhina 8590e0e3fe Fixed web player bug with filesystem and runtime 2021-08-22 20:08:05 -04:00
Stephanie Gawroriski d44f3e1239 Update CONTRIBUTING.md 2021-08-22 19:24:14 -04:00
Stephanie Gawroriski 1855ce5fc7 Update CONTRIBUTING.md 2021-08-22 19:18:00 -04:00
Autechre fa5ec2d4b1 Update CHANGES.md 2021-08-22 18:18:55 +02:00
twinaphex bea512b70b Get rid of gfx_display_draw_texture - use gfx_display_draw_quad instead 2021-08-22 17:57:21 +02:00
twinaphex 54ae219302 Fix gfx_display_draw_texture - fixes D3D11/D3D12/D3D10 OSK issues 2021-08-22 17:17:09 +02:00
Stephanie Gawroriski 5ac7d89e36 Part 1 rework of contributing. 2021-08-21 20:28:12 -04:00
Autechre 755789f825 Merge pull request #12845 from sonninnos/winraw-analog-keybinds
(WINRAW) Add missing analog keybinds
2021-08-22 01:02:02 +02:00
Autechre 5f3cb1fae2 Merge pull request #12846 from sonninnos/sdl2-keycodes
(WINSDL2) Fix keyboard event keycodes
2021-08-22 01:01:40 +02:00
Autechre 9bd6051581 Merge pull request #12847 from Jamiras/cheevos_http_neg1
(cheevos) automatically retry 'http error code -1'
2021-08-22 01:01:15 +02:00
Jamiras df5a2c5160 automatically retry 'http error code -1' 2021-08-21 13:54:39 -06:00
sonninnos 2482a6f42a (WINSDL2) Fix keycodes 2021-08-21 22:27:08 +03:00
sonninnos 26d6c8243a (WINRAW) Add missing analog keybinds 2021-08-21 22:01:12 +03:00
twinaphex 4fae4ead73 Add workaround for MSVC 2021-08-21 20:05:44 +02:00
twinaphex 0f3ae9b03d Try lroundf instead 2021-08-21 19:54:39 +02:00
Autechre 5a65773b81 Merge pull request #12842 from sonninnos/playlist-manage
Relocate 'Manage Playlists' to top
2021-08-21 19:25:58 +02:00
sonninnos 559a173e8b Relocate 'Manage Playlists' to top 2021-08-21 20:18:12 +03:00
twinaphex 9a97eb47ad Fix typos 2021-08-21 19:11:21 +02:00
Autechre ac539f6316 Merge pull request #12840 from sonninnos/video-rate-59hz
Fix refresh rate 59Hz rounding
2021-08-21 18:54:43 +02:00
twinaphex ca26e50050 (sinc) Add non-ASM ARM NEON intrinsics codepath for Sinc resampler 2021-08-21 18:52:20 +02:00
twinaphex b620325714 Rename HAVE_ARM_NEON_OPTIMIZATIOn to HAVE_ARM_NEON_ASM_OPTIMIZATIONS,
rename DONT_WANT_ARM_OPTIMIZATIONS to DONT_WANT_ARM_NEON_OPTIMIZATIONS
2021-08-21 18:00:59 +02:00
sonninnos 1e4557c09a Fix refresh rate 59Hz rounding 2021-08-21 18:20:15 +03:00
Autechre 11d5d3170d Merge pull request #12833 from IlDucci/translationsupdatewithscript0
Fetch translations from Crowdin 20-Aug-2021
2021-08-21 14:35:57 +02:00
Autechre 21d3c13ed3 Merge pull request #12837 from sonninnos/ozone-check
(Ozone) Ensure the existence of values used in selection calculation
2021-08-21 14:33:14 +02:00
Autechre 393343c03c Merge pull request #12839 from sonninnos/refresh-rate-notifications
Fix double notifications with refresh rate settings
2021-08-21 14:32:55 +02:00
sonninnos 4f57b6f6fa Fix double notifications with refresh rate settings 2021-08-21 15:09:19 +03:00
sonninnos 7a6434ecb2 (Ozone) Ensure the existence of values used in selection calculation 2021-08-21 13:10:59 +03:00
Autechre b02ef55a92 Merge pull request #12836 from libretro/displayserver-refactors
Simplify win32_get_metrics
2021-08-21 03:07:42 +02:00
twinaphex 462137305b Simplify win32_get_metrics 2021-08-21 02:24:32 +02:00
twinaphex eb50d7dbb4 (UWP) Push temporary fixes for issue that happens when resizing on UWP
with latest Xbox Series dashboard; DXGIResizeBuffers passing 0, 0 as
width/height is apparently problematic as it changes 0, 0 to 8,8
instead,
breaking the program
2021-08-20 23:16:01 +02:00
twinaphex 77a17b213d Fullscreen resolution width/height settings no longer require
'advanced settings'
2021-08-20 15:18:03 +02:00
IlDucci ddd75d3bb9 Fetch translations from Crowdin 20-Aug-2021 2021-08-20 11:17:16 +02:00
twinaphex ffb59e5261 (UWP) Turn this back on again - seems to work fine on Xbox 2021-08-20 10:07:29 +02:00
Mark W. Kidd 5f834a8cb3 input_driver refactor 2021-08-19 20:02:39 -04:00
Ryan C. Gordon 9a6faa3ddd udev_input.c: Look for "ID_INPUT_KEY", not "ID_INPUT_KEYBOARD"
This fixes programs using /dev/uinput to create a virtual keyboard failing
to be detected on startup. Usual symptom is some sort of GPIO-based
controller that looks like a keyboard to the OS and can control
EmulationStation, but fails to work in-game unless you restart the program
while the game is running (in which case udev_input.c's hotplug code, which
was using the correct key, would pick it up).
2021-08-19 16:00:57 -04:00
Autechre 0c0de9f0ad Merge pull request #12828 from jdgleaver/ff-override-runahead-fix
Fix RETRO_ENVIRONMENT_SET_FASTFORWARDING_OVERRIDE callback when runahead is enabled
2021-08-19 17:17:13 +02:00
jdgleaver bbc121cd74 Fix RETRO_ENVIRONMENT_SET_FASTFORWARDING_OVERRIDE callback when runahead is enabled 2021-08-19 14:49:49 +01:00
Autechre 48bb705b03 Update CHANGES.md 2021-08-19 14:28:56 +02:00
twinaphex 78431d0700 (MSVC2017/2019 UWP) Define HAVE_TRANSLATE 2021-08-19 14:25:55 +02:00
Autechre 97144833cb Merge pull request #12819 from libretro/revert-12703-input-drivers
Revert "input refactoring: create input_driver.c"
2021-08-18 18:46:03 +02:00
Autechre ae327a769b Revert "input refactoring: create input_driver.c" 2021-08-18 18:45:53 +02:00
Autechre a66b1b3e48 Merge pull request #12703 from markwkidd/input-drivers
input refactoring: create input_driver.c
2021-08-18 18:17:43 +02:00
Autechre 5e879fa201 Merge pull request #12794 from DisasterMo/master
Add core options v1 to v2 conversion script
2021-08-18 18:17:26 +02:00
Autechre 80136dd3ec Merge pull request #12663 from Nargash/log_early
Starting logging and verbose mode before first config load
2021-08-18 18:17:03 +02:00
Autechre 2e82db6447 Merge pull request #12818 from mahoneyt944/patch-1
Allow mobile touch screen devices to use emscripten.
2021-08-18 17:49:56 +02:00
mahoneyt944 2802817239 Update config.def.h 2021-08-18 11:41:53 -04:00
Autechre 9750ebcf71 Merge pull request #12817 from jdgleaver/core-option-visibility-callback
Add environment callback for enabling core option menu visibility updates without toggling Quick Menu
2021-08-18 17:31:06 +02:00
jdgleaver 0e98b4ddea Add environment callback for enabling core option menu visibility updates without toggling Quick Menu 2021-08-18 16:08:26 +01:00
twinaphex 97b9a79fc0 Reproduced crash occurring on OSX upon entering 'Load Content'
menu, this fixes it
2021-08-18 16:10:19 +02:00
Autechre 3963039102 Update CONTRIBUTING.md 2021-08-18 02:45:48 +02:00
Autechre 4f26860bb4 Update CONTRIBUTING.md 2021-08-18 02:44:48 +02:00
Autechre 47b6d4a99d Update CONTRIBUTING.md 2021-08-18 02:44:21 +02:00
Autechre 52db47d0fd Update CHANGES.md 2021-08-17 20:24:23 +02:00
Autechre 92b330f2aa Merge pull request #12809 from Tatsuya79/patch-1
QT: windowed settings update
2021-08-17 19:19:50 +02:00
Tatsuya79 bf8f527143 QT: windowed settings update 2021-08-17 15:41:49 +02:00
Mark W. Kidd 5a8920c862 input_driver refactor 2021-08-17 08:56:29 -04:00
twinaphex dfea030f5b Revert "Update libretro.h header file"
This reverts commit f3458fb943.
2021-08-17 10:38:14 +02:00
Autechre e68e3e9bb3 Merge pull request #12806 from jdgleaver/window-size-cap
Add facility to cap maximum window size in windowed mode
2021-08-17 01:07:00 +02:00
twinaphex f3458fb943 Update libretro.h header file 2021-08-16 23:53:50 +02:00
Autechre d369e06a67 Merge pull request #12804 from tunip3/patch-1
add fix for beetle cores to change log
2021-08-16 19:21:07 +02:00
jdgleaver fa7dd0f6d9 Add facility to cap maximum window size in windowed mode 2021-08-16 17:49:11 +01:00
jdgleaver 0f142d531a Revert "Add extra video logs so we can see what goes on"
This reverts commit 6780f58444.
2021-08-16 17:49:11 +01:00
jdgleaver 6e7e8a7680 Revert "video_driver_init_internal - add more logs"
This reverts commit d0a08ce959.
2021-08-16 17:49:11 +01:00
jdgleaver c2b3ba907c Revert "video_driver_init_internal - refactor"
This reverts commit bba924e8d2.
2021-08-16 17:49:11 +01:00
tunip3 ece8ff8ad8 add fix for beetle cores to change log 2021-08-16 15:11:26 +01:00
Autechre 89f984400b Merge pull request #12803 from fjtrujy/ps2/FlickeringIssues
Solve flickering issues in cores with Frame Skip
2021-08-16 14:07:14 +02:00
Francisco Javier Trujillo Mata a442c5b14f Simplify logic for transparencies 2021-08-16 13:12:06 +02:00
twinaphex 6223ba47fd Bring back these tiny optimizations from foobar2k 2021-08-15 22:54:21 +02:00
twinaphex 1906a741c2 Rollback sinc resampler changes - themaister wasn't sure if these were
actual optimizations
2021-08-15 22:45:59 +02:00
twinaphex bba924e8d2 video_driver_init_internal - refactor 2021-08-15 21:57:44 +02:00
Autechre a6f44ab642 Merge pull request #12801 from fjtrujy/ps2/HDD_startup
Avoid to start HDD if user boot from different unit
2021-08-15 17:21:35 +02:00
Francisco Javier Trujillo Mata e999c65037 Avoid to start HDD if user boot from different unit 2021-08-15 17:04:52 +02:00
Michael Burgardt 2d934f4d53 Add core options v1 to v2 conversion script 2021-08-15 13:07:31 +02:00
twinaphex f5564120a4 Remove math-neon on frangarcj's recommendation - not used 2021-08-15 09:47:31 +02:00
Autechre b0ac722366 Update CHANGES.md 2021-08-14 21:04:29 +02:00
Autechre 757ce5e572 Update CHANGES.md 2021-08-14 20:58:23 +02:00
Autechre def35ebe8e Merge pull request #12799 from Jamiras/cheevos_inf_regions
(cheevos) support for more than 64 memory regions
2021-08-14 20:57:24 +02:00
Jamiras a0f3bf7432 support for more than 64 memory regions 2021-08-14 12:47:42 -06:00
twinaphex b837e053e9 (cheevos) Silence warning signed/unsigned mismatch 2021-08-14 19:17:23 +02:00
Autechre c8e183fb3c Merge pull request #12797 from QuarkTheAwesome/load-without-core-info
(WiiU) Add option for running without core info (emscripten-style)
2021-08-14 17:03:38 +02:00
Autechre 29510df156 Merge pull request #12798 from QuarkTheAwesome/wiiu-128k-slowpath
(WiiU) Slight filesystem optimisation
2021-08-14 17:03:10 +02:00
Ash Logan d9157c5dc7 (WiiU) Read up to 128k on the no-CFW unaligned slowpath
it may be the slowpath, but 16k is a bit rich
2021-08-14 20:29:24 +10:00
Ash Logan 692f4443f4 (WiiU) Add option for running without core info (emscripten-style)
Very useful when wiiloading a test binary or running in emulation
2021-08-14 20:26:14 +10:00
twinaphex d0a08ce959 video_driver_init_internal - add more logs 2021-08-14 08:36:47 +02:00
twinaphex 6780f58444 Add extra video logs so we can see what goes on 2021-08-14 08:11:17 +02:00
twinaphex a489f1275a (Ozone) Casting to unsigned caused an integer overflow and after float
promotion would lead to 'x' being a garbage value, leading to problems
when this value was passed to vkCmdSetViewport. This stops Vulkan
validation layers from complaining about it
2021-08-14 02:20:56 +02:00
Autechre 84f5ab96ea Merge pull request #12792 from IlDucci/translationsupdatewithscript
Fetch translations from Crowdin 13-Aug-2021
2021-08-13 23:22:09 +02:00
Autechre fe10d285ec Merge pull request #12793 from Xbox-Homebrew/master
fix loading arcade dat files
2021-08-13 22:07:59 +02:00
IlDucci 9ad6ebc879 Fetch translations from Crowdin 13-Aug-2021 2021-08-13 21:35:50 +02:00
Tunip3 4116cb6fa5 fix issue where filesizes where not returned properly, this fixes loading arcade dat files 2021-08-13 20:33:27 +01:00
twinaphex 14e974ea07 Silence warning on WiiU - unused variable 2021-08-13 18:17:22 +02:00
Autechre a6b0efa4f0 Merge pull request #12790 from jdgleaver/core-option-category-disable
Add option to disable core option categories
2021-08-13 17:58:29 +02:00
jdgleaver c4880ca840 Add option to disable core option categories 2021-08-13 16:18:02 +01:00
Autechre 1c4895b8bf Merge pull request #12789 from Xbox-Homebrew/master
Fix beetle cores on UWP and clean up the method in which drives are listed
2021-08-13 15:54:18 +02:00
twinaphex 1ca1d362bf Ifdef this for HAVE_NETWORKING - should fix Emscripten 2021-08-13 07:57:18 +02:00
Autechre beabcebe9d Merge pull request #12788 from Jamiras/cheevos_abr
(cheevos) prevent read past end of buffer
2021-08-13 01:09:10 +02:00
Jamiras 1e4af83e2a prevent read past end of buffer 2021-08-12 16:28:51 -06:00
Autechre 9e84c5c2c8 Merge pull request #12787 from sonninnos/win32-orig-refresh
(WIN32) Remember original refresh rate
2021-08-12 19:24:01 +02:00
Autechre 1c82fd29ef Merge pull request #12786 from sonninnos/resolution-dropdown
Resolution dropdown pop
2021-08-12 19:23:39 +02:00
Autechre f0bd4e9172 Merge pull request #12785 from sonninnos/win32-vulkan-cleanup
(WIN32/Vulkan) Refresh rate fixes + cleanups
2021-08-12 19:23:29 +02:00
twinaphex 05bf208f7d Was missing a header include for switch_performance_profiles.h 2021-08-12 19:03:42 +02:00
twinaphex e9e6607fc9 (libz) Clang does not like this at all - warning: possible misuse of comma operator here [-Wcomma] 2021-08-12 19:00:59 +02:00
twinaphex 5b3942eae7 * (PSP/Vita) Remove unused variables
* (Switch/libnx) remove dead code
* (Lakka/Switch/libnx) It was a mistake to include
  switch_performance_profiles.h inside lakka.h, it was creating warnings
for nearly every file. Instead, it gets optionally included for the
files that need it
2021-08-12 18:51:33 +02:00
twinaphex 148a489af5 Add TODO/FIXME note and exclude ifdef for now 2021-08-12 18:28:03 +02:00
twinaphex d28402b87d Current label and value seems too big for strings being spoken,
reduce them by half
2021-08-12 18:24:35 +02:00
twinaphex a736dd27d2 (platform_switch) arg_data/args don't seem used anywhere
(switch_thread_audio) Pass correct type to function
2021-08-12 18:22:09 +02:00
twinaphex ccb8ecec4d Simplify command_event_save_current_config 2021-08-12 18:16:50 +02:00
sonninnos f1c276b751 (WIN32) Remember original refresh rate 2021-08-12 19:15:55 +03:00
sonninnos ef31302bd5 Pop out of Screen Resolution option after selecting 2021-08-12 19:09:51 +03:00
twinaphex 28417a02b7 Reduce size of path_config_append_file - too big - see warning
configuration.c:3710:10: note: 'snprintf' output 2 or more bytes (assuming 4097) into a destination of size 4096
2021-08-12 17:39:27 +02:00
twinaphex cd69803427 Silence warnings on tvOS 2021-08-12 17:35:37 +02:00
sonninnos 11b0667e72 (WIN32/Vulkan) Refresh rate fixes + cleanups 2021-08-12 18:33:58 +03:00
twinaphex d4c62a177a Lower subsystem_path to 256 - hopefully gets rid of the warnings on Wii 2021-08-12 17:29:35 +02:00
Autechre 7c9817b582 Merge pull request #12784 from fjtrujy/ps2/HDDSupport
Add support of HDD for PS2
2021-08-12 17:17:30 +02:00
twinaphex 3ce8d14c2e More HAVE_NETWORKING buildfixes for Dingux 2021-08-12 17:14:08 +02:00
Twinaphex 57054a075d (macOS) Fix remaining build errors with netplay discovery ifdefs 2021-08-12 17:11:31 +02:00
twinaphex 027bbe0755 Forgot some more HAVE_NETWORKING ifdefs 2021-08-12 17:03:59 +02:00
twinaphex ac4adabeb9 Silence some unused variable warnings 2021-08-12 17:00:24 +02:00
twinaphex c76cb77202 Further buildfixes for platforms that don't support
HAVE_NETPLAYDISCOVERY
2021-08-12 16:52:43 +02:00
twinaphex d07e0da412 Improve HAVE_NETWORKING and HAVE_NETPLAYDISCOVERY ifdefs; remove
unused netplay lan scan rooms function
2021-08-12 16:44:07 +02:00
twinaphex 43b72ea23c Silence some warnings (unused variables) when HAVE_NETPLAYDISCOVERY
is not defined
2021-08-12 16:11:29 +02:00
twinaphex fbeb157bba Raise limit on stk_ident to avoid warning on Vita 2021-08-12 16:01:48 +02:00
Francisco Javier Trujillo Mata df89a6b604 Add support of HDD for PS2 2021-08-12 14:07:14 +02:00
twinaphex 8d7e8bb574 (Wii) Disable RSound support - will only cost RAM and is probably
not in use
2021-08-11 22:13:47 +02:00
twinaphex 20ef0667b0 Add initial webOS port courtesy of informatic/webosbrew/mariotaku 2021-08-11 20:04:11 +02:00
twinaphex c34982d695 Update CHANGES.md 2021-08-11 19:20:21 +02:00
Autechre 0c806447b5 Merge pull request #12780 from jdgleaver/database-crc-fix
(Database) Fix heap-buffer-overflow when fetching CRC values
2021-08-11 19:19:30 +02:00
twinaphex b375e08c67 (libretro-common) fill_pathname_abbreviated_or_relative - fix warning -
variable is uninitialized
2021-08-11 18:50:03 +02:00
jdgleaver b2a4620f3b (Database) Fix heap-buffer-overflow when fetching CRC values 2021-08-11 17:32:45 +01:00
twinaphex 013dd30bde We have to uniquely name pointer_status struct for both dinput
and winraw because otherwise Griffin builds will fail
2021-08-11 03:44:34 +02:00
Autechre 7e08c019bc Update CHANGES.md 2021-08-11 03:40:45 +02:00
Autechre 8dfaee370a Merge pull request #12779 from sonninnos/wasapi-nonblock
(WASAPI) Stop deactivating audio on fast forward
2021-08-11 03:37:20 +02:00
sonninnos c737947d74 (WASAPI) Stop deactivating audio on fast forward 2021-08-11 04:21:52 +03:00
Autechre 9a4597d7ba Merge pull request #12776 from fjtrujy/ps2_aspect_ratio
PS2 aspect ratio
2021-08-10 18:58:59 +02:00
Autechre 82e53d3db8 Merge pull request #12777 from jdgleaver/core-option-hash
Optimise core option/core option category look-ups using hash tables
2021-08-10 18:58:49 +02:00
Tunip3 59e36c51a3 simplify getting root drives 2021-08-10 17:31:59 +01:00
Tunip3 a4017e69e4 fix cd based beetle cores 2021-08-10 17:24:31 +01:00
Francisco Javier Trujillo Mata 8b1fa3bb59 Fixing missing deinit libraries in cores 2021-08-10 18:15:36 +02:00
Francisco Javier Trujillo Mata 2aeb0b079e Implement aspect_ratio and scaling integer to PS2 2021-08-10 18:14:02 +02:00
jdgleaver 2d9a1d2270 Optimise core option/core option category look-ups using hash tables 2021-08-10 16:14:23 +01:00
Tunip3 075783d4f7 Merge branch 'master' of https://github.com/Xbox-Homebrew/RetroArch 2021-08-10 15:45:25 +01:00
Tunip3 a2c378c594 add entry to git ignore 2021-08-10 15:45:14 +01:00
Autechre 9cd5e66b21 Merge pull request #12774 from jdgleaver/nested-list-fix
(nested_list) Fix heap-use-after-free errors due to pointer invalidation when resizing internal RBUF arrays
2021-08-10 00:31:40 +02:00
jdgleaver f58c7f69d9 (nested_list) Fix heap-use-after-free errors due to pointer invalidation when resizing internal RBUF arrays 2021-08-09 23:08:17 +01:00
twinaphex 406c8bee7b Silenc some warnings 2021-08-09 21:24:03 +02:00
twinaphex 13a2d2419f (PSL1GHT) Fix function prototype for 'button' pad driver
(Task save) Fix warning in platform port
2021-08-09 20:25:27 +02:00
Autechre c6e86caeed Merge pull request #12771 from jdgleaver/core-options-sample-unused-var
Remove unused variable in core options v2 sample template file
2021-08-09 18:08:12 +02:00
jdgleaver e42a1895af Remove unused variable in core options v2 sample template file 2021-08-09 17:02:11 +01:00
Autechre efffa2a76e Merge pull request #12769 from fjtrujy/DEBUG_SCREEN
Use printf_screen for make easier the debugging
2021-08-09 14:23:21 +02:00
Autechre 5b801bab46 Update CHANGES.md 2021-08-09 14:22:59 +02:00
Francisco Javier Trujillo Mata 187a73d93a Use printf_screen for make easier the debugging 2021-08-09 14:19:51 +02:00
Autechre ef3dbc8378 Merge pull request #12749 from jdgleaver/core-option-category
Add core option category support
2021-08-09 14:19:00 +02:00
Autechre 7e1fdafa47 Merge pull request #12767 from GiantEnemyCrab/linux-add-StartupWMClass-to-desktop-file
Add StartupWMClass to retroarch.desktop file
2021-08-09 14:18:40 +02:00
Autechre 92efe48db2 Merge pull request #12768 from Jamiras/cheevos_ctype_uchar
(cheevos) explicitly cast to unsigned char for ctype functions
2021-08-09 14:18:20 +02:00
jdgleaver 1f7532bf52 Add core options v2 template in 'libretro-common/samples/core_options/example_categories' 2021-08-09 12:23:43 +01:00
Brian Weiss 0e3fddf448 explicitly cast to unsigned char for ctype functions 2021-08-08 21:56:26 -06:00
GiantEnemyCrab 0515377d63 Add StartupWMClass to retroarch.desktop file 2021-08-08 23:14:56 -04:00
twinaphex 93e5fc60af Silence some warnings 2021-08-08 22:14:50 +02:00
twinaphex bb30dc3dee After gblues' change, the rest of the button function callbacks
for the other joypad drivers still had int16_t as the return type
instead of int32_t - fix this
2021-08-08 21:48:19 +02:00
Autechre 70ca111a53 Update CHANGES.md 2021-08-08 12:46:19 +02:00
Autechre 80225daee0 Merge pull request #12764 from gblues/gblues/fix-missing-buttons
WIIU: Fix L3/R3 buttons
2021-08-08 12:45:57 +02:00
Nathan Strong feb4f266fa WIIU: Fix L3/R3 buttons
== DETAILS
After a bisect, the culprit was changing the gamepad interface from
returing a single button (bool) to multiple (int16).

The issue is that the Wii U gamepad (and presumably the Pro controller too)
have more than 16 buttons, which means some buttons get lost. Notably, L3 (18)
and R3 (17).

The solution: use int32 instead of int16.

I did a test build and confirmed that this change restores L3/R3 functionality
with the gamepad. Don't have a pro controller to test, but it should work too.
2021-08-07 23:23:33 -07:00
Autechre 34758d15ef Update CHANGES.md 2021-08-08 00:49:23 +02:00
twinaphex 6fe45a451d (Metal raster font) Fix severe font driver leaks 2021-08-08 00:42:56 +02:00
twinaphex f7ad73b494 No more leak in CFSearchPathForDirectoriesInDomains 2021-08-07 21:25:18 +02:00
twinaphex 8e46e46a40 Simplify CFSearchpathForDirectoriesInDomains - one less leak - not
out of the woods yet though
2021-08-07 21:14:38 +02:00
twinaphex 722e36001f Simplify CFSearchPathForDirectoriesInDomains 2021-08-07 21:05:22 +02:00
twinaphex 8a037a3091 Cleanup CFSearchPathForDirectoriesInDomains 2021-08-07 20:35:27 +02:00
Autechre f129a55a8a Update CHANGES.md 2021-08-07 20:26:24 +02:00
Autechre 390f914357 Merge pull request #12573 from markwkidd/wayland-input
wayland input driver multimouse/multigun fixup
2021-08-07 20:25:23 +02:00
Autechre 980647c9b8 Update CHANGES.md 2021-08-07 19:43:56 +02:00
Autechre 87c1800cb8 Update CHANGES.md 2021-08-07 19:35:14 +02:00
Autechre 4c227afb0d Merge pull request #12757 from ComradeEcho/bugfix/controller-duplication-bug
macOS controller duplication bug
2021-08-07 19:34:09 +02:00
ComradeEcho 35c2ec993b Remove code that duplicates controllers 2021-08-07 11:43:50 -05:00
ComradeEcho 86b297e0fd Merge branch 'libretro:master' into bugfix/controller-duplication-bug 2021-08-07 11:31:50 -05:00
twinaphex b513a3d166 (OSX) Prevent crash on startup on OSX Platforms with no ARC
enabled - CFSearchPathForDirectoriesInDomains - CFTypeRef
returned by NSSearchPathForDIrectoriesInDomains should not
be freed
2021-08-07 18:24:46 +02:00
Autechre c19c6a3ca8 Update CHANGES.md 2021-08-07 16:20:07 +02:00
Autechre a40d1ce8b6 Merge pull request #12759 from fjtrujy/ps2_gfx_alpha
Implement Alpha for the PS2_GFX driver
2021-08-07 16:14:49 +02:00
Autechre d9312d09a8 Merge pull request #12758 from QuarkTheAwesome/wiiu-ic-invalidaterange
(WiiU) Add ICInvalidateRange
2021-08-07 12:38:01 +02:00
Ash Logan 97db0291d2 (WiiU) Add ICInvalidateRange 2021-08-07 15:42:12 +10:00
Adie ce4fce12c0 Implement changes to fix macOS controller duplication bug 2021-08-06 22:02:43 -05:00
Autechre 1661d4e969 Merge pull request #12756 from sonninnos/winraw-alt-sticky
(WINRAW) Alt sticky fix
2021-08-07 03:54:43 +02:00
twinaphex f459472f6d Fix leaks - we were not honoring the ownership policy/create rule
for various CoreFoundation functions with 'Copy' or 'Create' in the title
2021-08-07 03:46:08 +02:00
sonninnos 6170fc45ae (WINRAW) Cleanups 2021-08-07 04:31:32 +03:00
twinaphex c1ed271a12 (Mac/IOHIDManager) Fix leak of elements_raw and elements in iohidmanager_hid_device_add_device 2021-08-07 03:30:17 +02:00
twinaphex 84a83ef43c (7zip) Use int64_t 2021-08-07 03:26:08 +02:00
sonninnos 079070daf7 (WINRAW) Prevent Alt getting stuck when Alt-Tabbing 2021-08-07 04:24:20 +03:00
Autechre 110882903c Merge pull request #12755 from Jamiras/cheevos_no_signed_char
(cheevos) address warning when using -fno-signed-char
2021-08-07 02:59:34 +02:00
Brian Weiss a5f8053533 address warning when using -fno-signed-char 2021-08-06 18:33:31 -06:00
Autechre b0e7a4db6a Merge pull request #12754 from libretro/remove-7zip-typedef
(7zip) Use normal stdint.h types that don't conflict with PowerPC Mac's OSTypes.h
2021-08-07 02:17:35 +02:00
twinaphex 9700a009c5 (7zip) Use normal stdint.h types that don't conflict with PowerPC
Mac's OSTypes.h
2021-08-07 01:43:08 +02:00
Autechre 64244cd73f Merge pull request #12753 from sonninnos/winraw-pointer
(WINRAW) Add pointer status
2021-08-06 23:09:31 +02:00
sonninnos 2178f9d36f (WINRAW) Add pointer status 2021-08-06 23:12:38 +03:00
Autechre 26c2259b11 Merge pull request #12748 from sonninnos/default-mouse-index
Change default mouse index to port index
2021-08-06 18:17:14 +02:00
sonninnos 60e25c5e3b Change default mouse index to port index 2021-08-06 17:42:39 +03:00
jdgleaver fe1f311a35 Add core option category support 2021-08-06 15:33:47 +01:00
Francisco Javier Trujillo Mata 885f9bbcc3 Implement Alpha for the PS2_GFX driver 2021-08-06 14:29:37 +02:00
Autechre 7a0dc3c4ca Merge pull request #12746 from ComradeEcho/bugfix/fix-debug-logging
Fix debug-level logging output.
2021-08-06 13:10:08 +02:00
ComradeEcho a803f652ab Merge branch 'libretro:master' into bugfix/fix-debug-logging 2021-08-06 03:09:42 -05:00
Autechre a2fb0847ae Merge pull request #12743 from sonninnos/mouse-display-name
Friendly names for mice where available
2021-08-06 00:12:04 +02:00
sonninnos bd3533f05d Friendly names for mice where available 2021-08-06 00:21:17 +03:00
Autechre 5dcec3819e Merge pull request #12742 from sonninnos/content-info
Show content info label+path rows always
2021-08-05 22:48:23 +02:00
sonninnos a58676709a Show content info label+path rows always 2021-08-05 21:28:08 +03:00
Autechre c6af4089b4 Merge pull request #12740 from sonninnos/winraw-alt-fix
(WINRAW) Alt key fix
2021-08-05 15:08:54 +02:00
sonninnos 4e90b731d3 (WINRAW) Alt key fix 2021-08-05 15:24:41 +03:00
twinaphex 5dd06ccfcd Get rid of duplicate input_keyboard_line_complete occurrences 2021-08-04 21:33:17 +02:00
Autechre 7b75dc4f9b Merge pull request #12737 from sonninnos/winraw-oem-keys
(WINRAW) Change legacy virtual keys to scan codes
2021-08-04 20:14:37 +02:00
sonninnos 2c47d94bf5 (WINRAW) Change legacy virtual keys to scan codes 2021-08-04 19:23:56 +03:00
Autechre e5dc368e20 Merge pull request #12735 from schellingb/rmsgpack_fixwrapintwrite
libretro-db fix writing of numerical values
2021-08-04 15:08:14 +02:00
Autechre 49632bbde9 Merge pull request #12733 from schellingb/explore_fixcrc32read
Fix CRC32 reading in explore menu
2021-08-03 19:53:01 +02:00
Autechre e58b2c9b6b Merge pull request #12734 from schellingb/rmsgpack_fixreadbigendian
Fix libretro-db loading on big endian platforms
2021-08-03 19:30:40 +02:00
Bernhard Schelling 9956ff041e Fix libretro-db loading on big endian platforms
Wrong casting did read garbage data for numerical values on big endian platforms.
Numerical values are used for array/map lengths so this could easily cause random crashes during parsing but also later while using the data.
Use union to avoid strict aliasing warnings.
2021-08-04 01:20:25 +09:00
Bernhard Schelling 2d1a657ba8 libretro-db fix writing of numerical values
Correctly write map lengths between 16 and 65535 to just 2 bytes and not 4.
Fix writing of numerical values between -31 and -1.
Fix writing of numerical values less than 256 on big endian platforms.
2021-08-04 01:15:21 +09:00
Bernhard Schelling 39275e8ce3 Fix CRC32 reading in explore
If CRC32 contained a zero byte strlen doesn't work
2021-08-03 23:38:37 +09:00
twinaphex bdba803909 wnd_proc_common_internal - move out code that was only relevant for
Winraw and put it into the Winraw specialized function callback, delay
initialization of mod variable until we use it
2021-08-03 13:46:58 +02:00
Adie 327f220857 Fix debug-level logging definitions
Both INFO and DEBUGGING log functions were outputting [INFO] logs.
I switched the debug log function to output debug logs instead of info logs, and changed the output of debug logs from [VERBOSE] to [DEBUG]
2021-08-02 22:58:39 -05:00
Nargash c844705665 Enable verbosity and logging before initial config file load 2021-08-02 20:31:48 -05:00
Mark W. Kidd 109f4fafec wayland input driver fixups 2021-08-02 18:05:24 -04:00
Autechre 0527d77de1 Merge pull request #12729 from libretro/revert-12420-Ocean_Blue_Ozone_Colour_theme
Revert "I have added a new theme for Ozone (Ocean Blue)"
2021-08-02 17:14:55 +02:00
Autechre f9c0cb198c Revert "I have added a new theme for Ozone (Ocean Blue)" 2021-08-02 17:14:45 +02:00
twinaphex e596bf7925 Buildfix for previous commit 2021-08-02 16:19:26 +02:00
twinaphex 2af9441d35 Create separate wnd_proc functions for winraw 2021-08-02 16:14:58 +02:00
Autechre f4b79ad13d Merge pull request #12727 from Jamiras/reset_challenge
(cheevos) hide challenge indicators when resetting
2021-08-02 15:47:41 +02:00
Autechre 0c7650c525 Merge pull request #12728 from amtz/udev-input
Limit udev device scan to subsystem 'input'
2021-08-02 15:47:23 +02:00
amtz d0612f906d Limit udev device scan to subsystem 'input'
This change makes the call to 'udev_enumerate_scan_devices' much faster.
In particular, for some bluetooth devices, this function may implicitly
read its battery's virtual file 'uevent', e.g.

/sys/devices/*/usb1/1-1/*/bluetooth/hci0/*/power_supply/hid-*-battery/uevent

Reading this file may (for unknown reasons) block up to 10 seconds.
Since udev_enumerate_scan_devices is called 4 times (for keyboard,
mouse, touchpad, and joypad) during startup this may cause a
considerable delay.

Limiting the scan to subsystem 'input' yields the same devices but makes
the scan faster and does not read 'uevent' of the input controller's
power_supply.
2021-08-02 13:17:00 +02:00
Brian Weiss 05b36ec374 hide challenge indicators when resetting 2021-08-01 19:54:51 -06:00
Autechre 1df4fa70e8 Update CHANGES.md 2021-08-01 22:38:06 +02:00
twinaphex 9dd06996c5 Skip state_manager_event_{deinit/init} when core type is dummy 2021-08-01 22:31:44 +02:00
Autechre c427e9d9ba Merge pull request #12420 from SecularSteve/Ocean_Blue_Ozone_Colour_theme
I have added a new theme for Ozone (Ocean Blue)
2021-08-01 22:22:26 +02:00
Autechre 18cc6b4bd9 Merge pull request #12545 from DisasterMo/testing
Move MENU_ENUM_LABEL_VALUE_ACHIEVEMENT_PAUSE_MENU to lbl.h
2021-08-01 22:17:06 +02:00
Autechre 2aee034a24 Update CHANGES.md 2021-08-01 22:15:08 +02:00
Autechre 10d7e4c643 Merge pull request #12724 from sonninnos/winraw-devicechange
(WINRAW) Trigger joypad driver reinit on DEVICECHANGE
2021-08-01 22:14:08 +02:00
sonninnos 2962707d5f (WINRAW) Trigger joypad driver reinit on DEVICECHANGE 2021-08-01 22:35:27 +03:00
Autechre 15d28fe2eb Merge pull request #12723 from QuarkTheAwesome/wiiu-salamander-ci-img 2021-08-01 06:19:06 +02:00
Ash Logan fe694b8f96 (WiiU) Use -wiiu build image rather than -devkitpro for salamander
A modern devkitPPC causes broken binaries at the moment, and recent 
changes to the wiiu image (wiiurpxtool) are missing
2021-08-01 14:14:57 +10:00
Autechre 8b1e816f77 Merge pull request #12721 from Xbox-Homebrew/master
replace win32 functions with UWP safe variants in UWP vfs driver
2021-07-31 21:01:46 +02:00
tunip3 9224329450 restore publisher name to libretro in identity element 2021-07-31 20:00:41 +01:00
Autechre 984d8e2584 Merge pull request #12717 from IlDucci/translationsupdatewithscript
Fetch translations from Crowdin 30-Jul-2021
2021-07-31 19:58:16 +02:00
Autechre 87f7a7f94d Merge pull request #12718 from Jamiras/cheevos_none
(cheevos) add messages for unknown game and network error
2021-07-31 19:58:09 +02:00
Autechre 85c73d523c Merge pull request #12720 from QuarkTheAwesome/wiiu-compression
(WiiU) Add RPX compression
2021-07-31 19:57:52 +02:00
Tunip3 be1a768bca improve uwp fileio by using from app variants whereever possible 2021-07-31 04:36:08 +01:00
Ash Logan 93649d9147 (WiiU) Compress RPX files w/ wiiurpxtool
Should be available on the buildbot now
2021-07-31 10:26:37 +10:00
Ash Logan 902c115d48 (WiiU) Add elf2rpl to clean target 2021-07-31 10:26:37 +10:00
Jamiras bb6911077a add messages for unknown game and network error 2021-07-30 11:16:12 -06:00
IlDucci 33ac1856f2 Fetch translations from Crowdin 30-Jul-2021 2021-07-30 17:06:13 +02:00
twinaphex 78341e5824 (D3D12) Fix some header includes 2021-07-30 15:18:56 +02:00
twinaphex ab9a4a95b1 (D3D12) Fix some header includes - probably a mistake that wiiu_dbg.h
was added to the d3d12.c driver
2021-07-30 15:16:14 +02:00
twinaphex b3aafd2f86 This makes the Explore tab show up again 2021-07-30 14:17:03 +02:00
Autechre b4ccf23701 Merge pull request #12708 from sonninnos/auto-mouse-grab
'Automatic Mouse Grab' option
2021-07-30 13:44:01 +02:00
Autechre 742e195172 Merge pull request #12700 from Jamiras/rapi_client
(cheevos) move client code into separate file
2021-07-30 13:11:08 +02:00
Autechre f831fe9ad0 Merge pull request #12712 from jdgleaver/gitlab-retrofw
(.gitlab-ci.yml) Add RetroFW target
2021-07-29 14:44:46 +02:00
jdgleaver e90f352c2f (.gitlab-ci.yml) Add RetroFW target 2021-07-29 13:18:52 +01:00
Autechre 0c2299396c Merge pull request #12711 from Poligraf/retrofw
Add retrofw port
2021-07-29 13:41:13 +02:00
Poligraf 9000e81498 Add retrofw port 2021-07-29 22:16:59 +12:00
Autechre 4714af546b Merge pull request #12710 from R-YaTian/master
libnx: Fix split joycons mode
2021-07-29 07:22:42 +02:00
twinaphex a40edc40e9 Bump version to 1.9.8 2021-07-29 06:22:58 +02:00
R-YaTian 1d988d374a libnx: Fix split joycons 2021-07-29 12:18:11 +08:00
Autechre d53ff1cc9b Update CHANGES.md 2021-07-29 06:13:33 +02:00
sonninnos 149beaf061 'Automatic Mouse Grab' option 2021-07-29 02:16:43 +03:00
Autechre 910d729d50 Merge pull request #12661 from markwkidd/menu-input
consolidate menu_input.h declarations
2021-07-29 01:14:06 +02:00
p-sam 0f5f8798ea libnx: input fixes
- fix poll missing for controller 2-8
- fix layout not applied correctly and hangs when splitting joycons
2021-07-28 21:49:09 +02:00
twinaphex 09d496b534 Rewrite DISPLAYLIST_AUDIO_SETTINGS_LIST 2021-07-28 17:36:35 +02:00
Jamiras 5ac432026a add helper function for accessing connection method 2021-07-27 21:02:14 -06:00
Autechre 8e9587f451 Merge pull request #12698 from Xbox-Homebrew/master
turn off core info cache by default on UWP
2021-07-26 21:22:16 +02:00
tunip3 9de0cc1ffe turn off core info cache by default on UWP 2021-07-26 20:17:35 +01:00
Autechre 0faddc91f7 Merge pull request #12696 from jdgleaver/override-fix
Ensure that config overrides and remaps are unloaded upon core initialisation failure and when core calls RETRO_ENVIRONMENT_SHUTDOWN
2021-07-26 19:12:27 +02:00
jdgleaver d2f8af553d Ensure that config overrides and remaps are unloaded upon core initialisation failure and when core calls RETRO_ENVIRONMENT_SHUTDOWN 2021-07-26 16:14:35 +01:00
Autechre 5c2f79aa29 Merge pull request #12694 from Xbox-Homebrew/master
Workaround Explore tab crash
2021-07-25 16:43:36 +02:00
twinaphex 9e1ad64e89 (winraw_input.c) Fixed some typos and style nits 2021-07-25 16:36:48 +02:00
Autechre 0d36cf2a4a Merge pull request #12692 from alphanu1/master
Fixed absolute co-ords for CRT and non CRT users
2021-07-25 16:34:30 +02:00
tunip3 61aeb982fd make it so that the explore tab is disabled by default on winrt devices 2021-07-25 14:35:02 +01:00
Ben Templeman 48e4b02fad Fixed absolute co-ords for CRT and non crt users
Fixed typo

added delay between winraw rect change to fix roslution changing issues.

added more comments

added delay reset

Fixed typo

updated comments

added RECT size to log

updated logging
2021-07-25 11:06:34 +01:00
twinaphex 8373ac6746 Bump version to 1.9.7 2021-07-25 07:58:25 +02:00
Autechre 73342af8b6 Merge pull request #12691 from fjtrujy/ps2_font_driver
Ps2 font driver
2021-07-24 17:38:55 +02:00
Francisco Javier Trujillo Mata d972f66faa Remove not needed import and PCSX2 macro 2021-07-24 10:32:09 +02:00
Francisco Javier Trujillo Mata dadf49764b Implement proper ps2_font driver instead of using the font driver from gskit 2021-07-24 10:32:09 +02:00
Jamiras c9ca0489ed allow concurrent POST requests to same URL 2021-07-23 22:04:42 -06:00
Jamiras bb2cf59a12 Merge branch 'master' into rapi_client 2021-07-23 19:41:37 -06:00
Mark W. Kidd e3d2a9b614 Merge branch 'master' of http://github.com/markwkidd/retroarch into menu-input 2021-07-23 10:27:49 -04:00
Autechre 1071c93c82 Merge pull request #12609 from markwkidd/input-drivers
add source comments to input_drivers.h
2021-07-23 06:33:08 +02:00
Autechre 773c7ed5ee Merge pull request #12688 from fjtrujy/bdm
Use BDM for increasing up USB stability
2021-07-22 22:09:33 +02:00
Autechre a65a5c675a Merge pull request #12684 from jdgleaver/rs90-scaling
(RS90) Add optional approximate 'semi-linear' scaling filter
2021-07-22 16:56:14 +02:00
Autechre 0ffd876115 Merge pull request #12686 from HyperspaceMadness/Max_Shader_Parameters_Increased_to_1024
Max_Shader_Parameters_Increased_to_1024
2021-07-22 16:45:17 +02:00
Remi McGill fdee0f4e7e Max_Shader_Parameters_Increased_to_1024 2021-07-22 10:20:50 -04:00
Francisco Javier Trujillo Mata 7f411db808 Use BDM for increasing up USB speed 2021-07-22 00:03:18 +02:00
jdgleaver 218286aa99 (RS90) Add optional approximate 'semi-linear' scaling filter 2021-07-21 14:11:42 +01:00
Autechre d4d9129ad4 Merge pull request #12678 from QuarkTheAwesome/ozone-icons
(Ozone) Use Ozone icons instead of XMB Monochrome
2021-07-20 14:59:08 +02:00
Autechre be89054d07 Merge pull request #12681 from QuarkTheAwesome/gx2-scissorfix
(Wii U) Fix Ozone rendering error
2021-07-20 14:58:53 +02:00
Autechre 28043d88b0 Merge pull request #12682 from QuarkTheAwesome/wiiu-fontalias
(Wii U) Font rendering fixes
2021-07-20 14:58:34 +02:00
Ash Logan 60c32fe494 (Wii U) Render font lines with correct spacing
No idea about this one, borrowed code from the Vita and it makes 
multi-line rendering look correct again
2021-07-20 20:05:44 +10:00
Ash Logan 20e70f9caa (Wii U) Only sample alpha channel when rendering fonts
The font backend provides only the alpha channel for a given glyph, but 
we were sampling that channel for the r, g, b and a. Fix by hard-coding 
the sampled colour to white - the actually desired colour is multiplied 
in later.
2021-07-20 19:57:35 +10:00
Ash Logan 4621ed7dcc (Wii U) Display scissor doesn't use inverted coordinates
Unlike the draw callback, seems the scissor callback does *not*
have an inverted y-coordinate. Yay!
2021-07-20 18:51:53 +10:00
twinaphex 646cadba8c Another style nit 2021-07-20 05:23:12 +02:00
twinaphex edd9ed3619 Fix some style nits 2021-07-20 05:13:52 +02:00
Autechre 53a35e87c3 Merge pull request #12680 from jdgleaver/core-info-cache-auto-disable
Automatically disable core info cache when core info directory is read-only
2021-07-20 02:46:50 +02:00
Ash Logan e9a5625445 (Wii U/Vita) Use Ozone icons instead of XMB Monochrome
The Ozone icons are small pngs, 46x46, while the XMB Monochrome icons 
are 256x256, which do not look good on low-dpi screens when downscaled 
so extremely.
2021-07-20 08:59:16 +10:00
Mark W. Kidd 8038d899d6 add documentation to input_driver.h 2021-07-19 12:05:28 -04:00
jdgleaver e306dd8eeb Automatically disable core info cache when core info directory is read-only 2021-07-19 16:39:18 +01:00
Autechre 8db304328c Merge pull request #12679 from jdgleaver/rgui-start-fs-thumbs
(RGUI) Enable fullscreen thumbnail toggle using RetroPad 'start' button
2021-07-19 15:41:14 +02:00
jdgleaver af88aaee77 (RGUI) Enable fullscreen thumbnail toggle using RetroPad 'start' button 2021-07-19 14:15:28 +01:00
Autechre ea18d4ffcb Merge pull request #12676 from QuarkTheAwesome/kpad-fix
(Wii U) Fix inputs breaking when connecting/disconnecting remotes
2021-07-19 14:24:51 +02:00
Ash Logan 27b02d66aa (Wii U) Ignore some bogus KPAD results
This API is completely bonkers, seems to have no idea what the error 
conditions are
2021-07-19 16:59:41 +10:00
Autechre 8bde566019 Merge pull request #12664 from markwkidd/upnp-error
clarify netplay upnp port mapping status messages
2021-07-19 02:11:44 +02:00
Autechre 7cb5857ed3 Merge pull request #12675 from gouchi/have_extralang
intl: Add missing languages for the first startup
2021-07-19 02:11:28 +02:00
Autechre 48830e72df Merge pull request #12665 from embercold/fix-xdg-screensaver
Prevent xdg-screensaver's "Protocol error" messages
2021-07-19 02:04:11 +02:00
gouchi fcefefaeab intl: Add missing languages for the first startup 2021-07-18 22:40:01 +02:00
Autechre 21cf6b89a8 Merge pull request #12671 from QuarkTheAwesome/http-progress-fix
(task_http.c) Fix progress indication for large files on 32-bit systems
2021-07-18 22:16:18 +02:00
Autechre c007a81103 Merge pull request #12672 from QuarkTheAwesome/network-fixes
(Wii U) Network speed optimisations
2021-07-18 22:16:01 +02:00
Autechre 80fc5062c1 Merge pull request #12673 from QuarkTheAwesome/filesystem-opt
(Wii U) Filesystem optimisations
2021-07-18 22:15:41 +02:00
Jamiras da8f257323 log retry delay when automatically retrying network failure 2021-07-18 09:49:30 -06:00
Ash Logan e43f07b85b wiiu: Add fastpath for already aligned buffers 2021-07-18 22:33:26 +10:00
Ash Logan a3be19214e vfs: Use 128k vbufs for Wii U
We have loads of RAM and large vbufs are *very* beneficial
2021-07-18 22:33:17 +10:00
Ash Logan 90040117af deps/libfat: Increase cache size on Wii U
We got lotsa RAM! See 
https://github.com/aliaspider/wiiu/blob/5be1be8e66c60a6c7ffd3bb47bbd2a72077b3f12/libfat/common.h#L62-L66
2021-07-18 22:33:12 +10:00
Ash Logan 5887016db3 deps/libiosuhax: Update to wiiu-env/libiosuhax@69532cf 2021-07-18 22:33:06 +10:00
Ash Logan e5553bde4e wiiu: Network optimisations - WINSCALE, TCP sACK, large buffers
See code sample in https://github.com/devkitPro/wut/issues/169 and 
https://github.com/Laf111/WiiUFtpServer/blob/243078940681175ef2901415a5498f0d759d4c0e/src/net.c#L88
2021-07-18 21:02:56 +10:00
Ash Logan a35323ace9 (task_http.c) Use 100% as maximum, not minimum
With previous logic, any normal percentage would get MAX'd to 100% 
(max(70, 100) == 100). Correct math to use here is min
2021-07-18 14:47:25 +10:00
Ash Logan 6521bfcdc1 gitignore: Don't ignore some of the Wii U sources 2021-07-17 12:16:18 +10:00
Autechre e5bbd9488f Merge pull request #12666 from jdgleaver/odbeta-snes-scaling-fix
(OpenDingux Beta) Fix IPU scaling when running 256x224 (SNES/Genesis) content
2021-07-16 19:04:57 +02:00
jdgleaver 6b65daf07d (OpenDingux Beta) Fix IPU scaling when running 256x224 (SNES/Genesis) content 2021-07-16 17:48:03 +01:00
Mark W. Kidd 03f2d2376e clarify netplay upnp port mapping messages 2021-07-16 11:20:13 -04:00
Ember Cold 214a80b338 Prevent xdg-screensaver's "Protocol error" messages 2021-07-16 17:21:11 +03:00
Mark W. Kidd 64672b4b63 consolidate menu_input.h declarations 2021-07-15 14:19:38 -04:00
Autechre d1c03b22e3 Merge pull request #12660 from libretro/vitapig
Vita: wrong flags for not piglet version
2021-07-15 19:58:52 +02:00
Francisco José García García 260352aa9e Vita: wrong flags for not piglet version 2021-07-15 19:21:33 +02:00
Autechre 2ea76c6188 Merge pull request #12659 from jdgleaver/rs90-appdata-sd
(RS-90) Move appdata (retroarch) base directory to external microsd card
2021-07-15 18:50:22 +02:00
jdgleaver 9e100b752e (RS-90) Move appdata (retroarch) base directory to external microsd card 2021-07-15 16:56:23 +01:00
Autechre 23b8652656 Merge pull request #12655 from jdgleaver/rs90-disable-flags
(RS-90) Disable unnecessary/inappropriate build flags
2021-07-15 17:06:56 +02:00
Autechre c88226188f Merge pull request #12656 from jdgleaver/rs90-hide-video-filter
(RS-90) Hide 'Bilinear Filtering' video option
2021-07-15 17:06:39 +02:00
Autechre c3fee95273 Merge pull request #12657 from IlDucci/translationsupdatewithscript
Fetch translations from Crowdin 15-Jul-2021
2021-07-15 17:06:26 +02:00
IlDucci 7900ba604f Fetch translations from Crowdin 15-Jul-2021 2021-07-15 15:21:27 +02:00
jdgleaver 21228cfbd4 (RS-90) Hide 'Bilinear Filtering' video option 2021-07-15 11:53:07 +01:00
jdgleaver 0437659490 (RS-90) Disable unnecessary/inappropriate build flags 2021-07-15 11:15:55 +01:00
Autechre d8f780848a Merge pull request #12653 from jdgleaver/rs90-osd-fix
(RS-90) Fix offset of OSD text
2021-07-14 17:52:30 +02:00
jdgleaver 14580e5f6f (RS-90) Fix offset of OSD text 2021-07-14 16:44:30 +01:00
Autechre 0ad936f600 Merge pull request #12651 from jdgleaver/rgui-sublabel-length-fix
(RGUI) Fix sublabel length when menu clock is disabled
2021-07-14 17:39:29 +02:00
Autechre 607711d3f9 Merge pull request #12652 from jdgleaver/rs90-hide-clock
(RS-90) Disable menu clock by default
2021-07-14 17:39:23 +02:00
jdgleaver 7439f4d6d0 (RS-90) Disable menu clock by default 2021-07-14 15:27:07 +01:00
jdgleaver 137f18bed1 (RGUI) Fix sublabel length when menu clock is disabled 2021-07-14 15:03:29 +01:00
jdgleaver 7af4f6e84d (.gitlab-ci.yml) Add RS-90 target 2021-07-14 13:01:30 +02:00
Autechre b644a37622 Merge pull request #12647 from jdgleaver/dingux-frameskip-fix
(Dingux) Fix display when cores 'drop' frames
2021-07-13 21:42:02 +02:00
Autechre e1daabde65 Merge pull request #12592 from john-parton/feature/rs90
[DRAFT] RetroMini RS-90 Support
2021-07-13 20:25:27 +02:00
Autechre ec685d051e Merge pull request #12648 from jdgleaver/odbeta-alsa-default
(Dingux Beta) Use ALSA audio driver by default
2021-07-13 20:25:10 +02:00
John Parton f6aeb717ba Basic rs90 build
DINGUX_BETA has clock_gettime libogc
Add tinyalsa support to rs90
2021-07-13 11:36:48 -05:00
jdgleaver 54706bec8a (Dingux Beta) Use ALSA audio driver by default 2021-07-13 14:18:11 +01:00
jdgleaver eb259174b8 (Dingux) Fix display when cores 'drop' frames 2021-07-13 13:11:19 +01:00
Autechre 3bc06b0d57 Merge pull request #12588 from alphanu1/master
Fixed some Monitor index bugs ad updated to the latest SR2
2021-07-12 16:49:44 +02:00
Autechre 7f4f1d82bb Merge pull request #12644 from jdgleaver/fpu-fix
(Menu+Widgets) Add workaround for FPU bug that breaks scale factor comparisons on certain platforms (fixes XMB thumbnails on 32bit Linux/Windows)
2021-07-12 16:49:28 +02:00
Autechre b5c5508e62 Merge pull request #12643 from crystalct/master
First basic RSX driver for PSL1GHT
2021-07-12 15:12:57 +02:00
jdgleaver 7a3d78b1c0 (Menu+Widgets) Add workaround for FPU bug that breaks scale factor comparisons on certain platforms (fixes XMB thumbnails on 32bit Linux/Windows) 2021-07-12 12:14:55 +01:00
CrystalCT 89b46bc246 First basic RSX driver for PSL1GHT 2021-07-12 09:35:44 +02:00
Autechre 32ed7ed1d7 Merge pull request #12508 from CTCaer/unix-bl-bri-fix
plat: unix: correct backlight max_brightness path
2021-07-11 18:35:59 +02:00
Autechre e4fd172892 Merge pull request #12639 from MrHuu/master
(3DS) Add unique ID's
2021-07-11 17:38:21 +02:00
MrHuu 57c52e4fc7 (3DS) Add unique ID's
add lowresnx
add vice_xcbm5x0
add vice_xscpu64
2021-07-11 15:03:10 +02:00
Autechre bd04a6412d Merge pull request #12638 from MrHuu/master
(3DS) Add ID for genesis_plus_gx_wide core
2021-07-11 13:41:52 +02:00
MrHuu 902949ea94 (3DS) Add ID for genesis_plus_gx_wide core 2021-07-11 13:04:22 +02:00
Autechre 0570ed4ca3 Merge pull request #12634 from NicolasRoehm/patch-1
[Upd] error message
2021-07-11 01:14:41 +02:00
Nicolas Roehm b3c929499e [Upd] error message 2021-07-10 14:10:12 +02:00
Autechre 0d46eb9066 Merge pull request #12612 from guoyunhe/crowdin
Fetch translations from Crowdin
2021-07-09 16:39:49 +02:00
Autechre acf5c2e992 Merge pull request #12628 from markwkidd/nat-fix
implement natt fix from void()
2021-07-09 15:31:17 +02:00
Autechre 7b55b03c96 Merge pull request #12617 from markwkidd/input-cleanup
consolidate 'input define' enums to input_defines.h
2021-07-09 15:30:02 +02:00
Autechre 0216aab022 Merge pull request #12630 from sonninnos/av_info-log
AV_INFO logging details
2021-07-09 15:17:06 +02:00
sonninnos c10bac6558 AV_INFO logging details 2021-07-09 16:06:56 +03:00
Mark W. Kidd d4fb27a7a9 implement natt fix from void() 2021-07-08 22:52:19 -04:00
twinaphex 4803100dc4 (UWP/Xbox) Should fix display issues with Dolphin/PCSX2 on Xbox 2021-07-08 20:50:54 +02:00
Autechre ed3412c004 Merge pull request #12618 from markwkidd/input-remapping
consolidate and comment input_remapping.h
2021-07-08 14:22:51 +02:00
Autechre 63acb6173a Merge pull request #12619 from xenomorph-us/patch-1
HTTPS link to EditorConfig.org
2021-07-08 14:18:21 +02:00
Autechre 375eb4b852 Merge pull request #12459 from toshixm/fix_12103
Fix garbled path string
2021-07-08 12:05:07 +02:00
Autechre 7dba607d76 Merge pull request #12579 from grant2258/touchpad
udev fixes add pointer pressed to pointer device to allow udev users to access this device
2021-07-08 12:04:04 +02:00
Autechre 7d9d57dc50 Merge pull request #12564 from sonninnos/integer-overscale
Integer overscale option
2021-07-08 12:03:28 +02:00
Autechre 27fbb3f971 Merge pull request #12568 from john-parton/feature/enable-alsa-opendingux-beta
Re-enable alsa on opendingux beta
2021-07-08 11:33:00 +02:00
Autechre 9188c4a7f0 Merge pull request #12610 from confusedguy9/patch-1
Enable 7z support for Switch
2021-07-08 11:08:24 +02:00
Autechre ea7e9aaa61 Merge pull request #12616 from HyperspaceMadness/Aspect_Ratio_Full
Added Aspect Ratio Full
2021-07-08 11:07:45 +02:00
Autechre 9e85eec4a7 Merge pull request #12621 from JustMeDaFaq/master
Default to d3d11 on UWP builds
2021-07-08 11:07:29 +02:00
Jamiras 41e25902a1 use non-HTTPS until everything is converted 2021-07-08 00:57:35 -06:00
Jamiras bc4a9a3696 separate ping task handler from retry task handler 2021-07-08 00:52:19 -06:00
Jamiras 46ffe5f4b2 use case-corrected username for server calls 2021-07-08 00:33:45 -06:00
Jamiras 7aca71e625 convert to rapi 2021-07-07 23:51:45 -06:00
Jamiras f556eba0a3 move async API code to cheevos_client.c 2021-07-07 19:59:57 -06:00
Ben Templeman 197203d09b Fixed monitor index corruption on Windows and added correct fractal scalling. only used when required.
Updated log defines to match SR upstream.

Added new SR_CONFIG_PATHS for non Winddows and Linux systems.
Not that SR works on them but to fix RA compile issues

Updated SR2 code base to latest. Added supprt for windows monitor indexing.
Fixed monitor index bug where index 1 was not being used corretly
and "auto" was not being sent.

Updated swithres for x86 windows fix
fixed SR2 auto issue

Fixed auto monitor bug

Fixed monitor index corruption on Windows

Fixxed buffer size bug

Added correct fractal scalling. only used when required.
2021-07-07 18:06:47 +01:00
HyperspaceMadness d14c4d2883 Added Aspect Ratio Full
Fixes

Fixes

Moved ASPECT_RATIO_FULL to end of list, added TODO

Fixed Full Order

Fixed UI Visibility
2021-07-07 09:37:36 -04:00
Autechre 4954af9dc7 Merge pull request #12613 from mahoneyt944/patch-1
add mame2003 / mame2003-plus to web.libretro
2021-07-07 02:14:11 +02:00
Mark W. Kidd b17dd28ff2 consolidate and comment input_remapping.h 2021-07-06 16:13:43 -04:00
JustMeDaFaq 6e61eb084a Default to d3d11 on UWP builds
Even if compiled with ANGLE, lets default to d3d11 since ANGLE is calling D3D anyway. 
That makes cores like PCSX2 and Duckstation boot proper with default settings, ANGLE cores still switching automatically.
2021-07-06 19:51:42 +02:00
xenomorph-us d0212ec5aa HTTPS link to EditorConfig.org 2021-07-06 13:55:43 +09:00
Mark W. Kidd 523d7d6ee8 consolidate input defines 2021-07-05 15:18:17 -04:00
mahoneyt944 647e39afaa add mame2003 / mame2003-plus 2021-07-04 18:23:38 -04:00
Guo Yunhe 7b46cca917 Fetch translations from Crowdin 2021-07-04 21:43:39 +08:00
Autechre f93499181c Update CHANGES.md 2021-07-04 14:07:31 +02:00
confusedguy9 c31e0ba9b9 Enable 7z support for Switch 2021-07-04 14:46:41 +08:00
Autechre 4a6dc36b1c Update CHANGES.md 2021-07-04 02:39:40 +02:00
Autechre c6967f56bd Merge pull request #12606 from jdgleaver/hide-add-to-favourites
Hide 'Add to Favorites' when viewing an entry of the favorites playlist
2021-07-02 23:20:56 +02:00
jdgleaver 0e654c8e9e Hide 'Add to Favorites' when viewing an entry of the favorites playlist 2021-07-02 16:29:11 +01:00
Autechre e1270742b9 Merge pull request #12582 from markwkidd/input-drivers
add comments in order to document input_driver.h
2021-07-02 00:21:09 +02:00
Autechre 1c87853496 Merge pull request #12595 from IlDucci/translationsupdatewithscript
Fetch translations from Crowdin 30-Jun-2021
2021-07-01 09:03:32 +02:00
Autechre 119788593c Merge pull request #12598 from markwkidd/input-cleanup
remove unused enum input_device_type from input_driver.h
2021-07-01 04:29:51 +02:00
Mark W. Kidd fb2b3695d9 remove unused enum input_device_type 2021-06-30 19:05:56 -04:00
IlDucci aacf2bed34 Fetch translations from Crowdin 30-Jun-2021 2021-06-30 14:54:34 +02:00
Autechre badd588652 Merge pull request #12590 from jdgleaver/playlist-path-id-cache
(Playlist) Optimise scanning of large rom sets
2021-06-30 05:08:10 +02:00
Autechre a40c3767bb Merge pull request #12591 from jdgleaver/qt-default-core-fix
(Qt) Fix default core detection when playlist file name does not match 'db_name'
2021-06-30 05:07:57 +02:00
Mark W. Kidd b0831bf1a0 comment documentation for input_driver.h 2021-06-29 20:12:44 -04:00
jdgleaver d1f7d8af0d (Qt) Fix default core detection when playlist file name does not match 'db_name' 2021-06-29 16:51:20 +01:00
jdgleaver f7f007519c (Playlist) Optimise scanning of large rom sets 2021-06-29 14:50:19 +01:00
Autechre 92a098ee02 Merge pull request #12586 from jdgleaver/archive-delim-fix
Fix archive delimiter detection when file path contains no slashes
2021-06-29 00:10:46 +02:00
M4xw d00c2a6407 [Libnx] Style nits 2021-06-28 17:38:17 +02:00
M4xw 991b43d4ee [Libnx] Changed PSM Defines 2021-06-28 17:38:17 +02:00
p-sam ac8a977492 Replace deprecated HID APIs 2021-06-28 17:38:17 +02:00
p-sam 1bc588acbd Fix building with libnx 4.0.0 2021-06-28 17:38:17 +02:00
jdgleaver eafeb83d0b Fix archive delimiter detection when file path contains no slashes 2021-06-28 10:40:37 +01:00
Autechre 2e215bda5b Update CHANGES.md 2021-06-27 07:03:00 +02:00
twinaphex 0a5fd837a2 Bump up version to 1.9.6 2021-06-27 06:43:27 +02:00
Autechre edf10b576f Merge pull request #12580 from john-parton/bugfix/rg350_stripping
Remove bash-ism which was preventing strip from working on OpenDingux
2021-06-27 06:08:32 +02:00
twinaphex 46dcf1204e Revert "Backport tunip3 - replace win32 functions with UWP safe variants in UWP vfs driver"
This reverts commit 585af66b5c.
2021-06-27 05:39:48 +02:00
John Parton 5feeb362b1 Remove bash-ism which was preventing strip from working on OpenDingux 2021-06-26 21:08:22 -05:00
Grant d6a1c21fe1 udev fixes] 2021-06-26 23:09:47 +01:00
Autechre 67358fb145 Merge pull request #12578 from libretro/revert-12571-bugfix/rg350_stripping
Revert "Fix strip on rg350 and rg350_odbeta"
2021-06-26 23:45:13 +02:00
Autechre 41fbbda8e8 Revert "Fix strip on rg350 and rg350_odbeta" 2021-06-26 23:45:06 +02:00
John Parton b1b5148090 Enable Alsa/Alsa_thread on OpenDingux, but not alsa midi driver, keeping
openal the default audio driver
2021-06-26 14:54:42 -05:00
Autechre bd1d39d7fb Merge pull request #12571 from john-parton/bugfix/rg350_stripping
Fix strip on rg350 and rg350_odbeta
2021-06-26 19:09:45 +02:00
twinaphex b2c7fae912 desc.Flags should also be commented out for now 2021-06-26 05:46:37 +02:00
twinaphex 13e88ebe74 (D3D11) Disable tear control support for UWP for now 2021-06-26 05:40:41 +02:00
John Parton d5d6b1d91e Make stripping conditional again on rg350 builds (remove bashism) 2021-06-25 12:09:36 -05:00
John Parton 8915d82fd6 Always strip on rg350 and rg350_odbeta 2021-06-25 00:32:38 -05:00
Autechre 0785d4aa72 Merge pull request #12565 from Jamiras/measured_unlock
(cheevos) reset cached progress each time menu is opened
2021-06-24 05:48:23 +02:00
Jamiras 0744683c2b reset cached progress each time menu is opened 2021-06-23 17:29:12 -06:00
sonninnos b483f233d2 Integer overscale option 2021-06-24 00:56:52 +03:00
twinaphex 55afe18872 Move D3D11Draw call back for now - should make OSK work again and
shaders
2021-06-23 19:34:06 +02:00
Autechre f83e614b4e Merge pull request #12563 from IlDucci/translationsupdatewithscript2
'Fetch translations from Crowdin 23-Jun-2021'
2021-06-23 18:46:30 +02:00
Autechre 5dc070f041 Merge pull request #12562 from jdgleaver/input-adc-type-improvements
'Analog to Digital Type' usability improvements
2021-06-23 18:46:05 +02:00
twinaphex 585af66b5c Backport tunip3 - replace win32 functions with UWP safe variants in UWP vfs driver 2021-06-23 18:45:07 +02:00
IlDucci c8241f3f21 'Fetch translations from Crowdin 23-Jun-2021' 2021-06-23 16:00:53 +02:00
jdgleaver 3a82cf980d 'Analog to Digital Type' usability improvements 2021-06-23 14:28:45 +01:00
Autechre 7b47f5f49a Merge pull request #12556 from sonninnos/winraw-mouse
(WINRAW) Mouse access violation fix
2021-06-23 00:19:37 +02:00
Autechre 94e4b1883a Merge pull request #12557 from grant2258/logging
fix up logging that can confuse users
2021-06-23 00:18:40 +02:00
Grant c73592d379 skip mouse with no button errors and keep the rest 2021-06-22 23:00:50 +01:00
Grant 4ba0ba4c70 fix up logging that can confuse users 2021-06-22 22:06:19 +01:00
sonninnos 11dba60ea7 (WINRAW) Mouse access violation fix 2021-06-22 19:47:56 +03:00
twinaphex 97ad8cbfd2 Remove this code for Vulkan over X too 2021-06-22 18:26:32 +02:00
twinaphex b5be2006f2 Remove commented out code 2021-06-22 18:25:54 +02:00
Autechre 8ec39ca7ec Merge pull request #12550 from grant2258/fix_x11
fix x11 threaded videoc segfault
2021-06-22 18:24:32 +02:00
Autechre bd937eb49f Merge pull request #12536 from grant2258/udev
only add mouse if it has buttons and add vebose device friendly names
2021-06-22 17:23:19 +02:00
Autechre 23b810b820 Merge pull request #12552 from stenzek/fix-d3d11-again
(d3d11) Fix non-vsynced output without flip, black screens in fullscreen
2021-06-22 13:40:01 +02:00
Connor McLaughlin 322aeb4e46 (d3d11) Don't pass ALLOW_TEARING to present when unsupported 2021-06-22 14:04:32 +10:00
Connor McLaughlin ed2d6b1730 (d3d11) Don't draw content without a texture bound 2021-06-22 14:04:32 +10:00
Connor McLaughlin 9afa30af5e (d3d11) Disable DXGI's ALT+ENTER handling 2021-06-22 14:04:31 +10:00
Connor McLaughlin 5d3719df44 (gfx) Fix uninitialized variables in gfx_display_draw_cursor 2021-06-22 13:52:13 +10:00
twinaphex 3f00d2f041 (Resampler) Cleanups 2021-06-22 01:14:32 +02:00
twinaphex a30a86a09c (D3D11) Fixes Xbox again, do tear control checks only for non-UWP
- TODO/FIXME still has to be resolved, see comment at line 1362
2021-06-22 00:41:56 +02:00
Grant bd10e5bdc3 fix x11 threaded videoc segfault 2021-06-21 21:12:26 +01:00
twinaphex 0e1d5ba30e Silence some warnings; cleanup 2021-06-21 21:15:03 +02:00
Autechre 10f42d7034 Merge pull request #12549 from sonninnos/xmb-opacity
(XMB) Icon opacity fix
2021-06-21 20:48:19 +02:00
Autechre 6986caed5b Merge pull request #11388 from pjft/dual-lightgun
Change udev driver for dual lightgun support in X11
2021-06-21 18:06:35 +02:00
sonninnos c802a549f6 (XMB) Icon opacity fix 2021-06-21 16:46:58 +03:00
Autechre 0a75b51b29 Merge pull request #12534 from jdgleaver/input-port-remapping
Add support for mapping multiple controllers to a single input device
2021-06-21 15:28:34 +02:00
Autechre 0c64ac0bde Merge pull request #12423 from markwkidd/lightgun-bind
bind lightgun trigger to first mouse button by default
2021-06-21 14:12:25 +02:00
Autechre 15b0f5478f Merge pull request #12485 from Kopert/master
Add support for core and directory overrides of switchres.ini files
2021-06-21 14:12:15 +02:00
Autechre a6b0199204 Merge pull request #12511 from markwkidd/android-input-fix
[Android input driver] do not duplicate port 0 mouse and gun inputs to other ports
2021-06-21 14:12:02 +02:00
jdgleaver 973f5cda6d Add support for mapping multiple controllers to a single input device 2021-06-21 12:42:38 +01:00
twinaphex 46a318db45 C89 buildfix 2021-06-20 23:02:55 +02:00
Michael Burgardt 1657d67182 Move MENU_ENUM_LABEL_VALUE_ACHIEVEMENT_PAUSE_MENU to lbl.h 2021-06-20 22:15:31 +02:00
Autechre 7949a9c8ad Merge pull request #12528 from IlDucci/crowdinfix-20210615
Fix Encore Mode on Github, minor English change
2021-06-20 16:55:07 +02:00
Autechre 2ae11b7222 Merge pull request #12541 from sonninnos/xmb-dynamic
(XMB) Dynamic wallpaper improvement
2021-06-20 16:54:49 +02:00
Autechre f05c124c98 Merge pull request #12540 from sonninnos/d3d12
D3D12 Updates
2021-06-20 14:59:11 +02:00
Alcaro 5f182fa564 Don't send speech input as command line argument (#12539)
* Don't send speech input as command line argument

* Fix a C++-only construct, and simplify some stuff
2021-06-20 14:39:14 +02:00
Kopert c2d5003f80 Add support for switchres.ini core and directory overrides 2021-06-20 02:31:10 -03:00
Grant 6e2709d62a cleanup 2021-06-19 08:47:35 +01:00
Grant eef86d5f72 fix game focus mode 2021-06-19 07:59:06 +01:00
Grant 863aaa5b9d Revert "fix game focus mode on udev as well"
This reverts commit 54eed63418.
2021-06-19 07:44:02 +01:00
Grant 54eed63418 fix game focus mode on udev as well 2021-06-19 07:00:09 +01:00
sonninnos 7695298dfc (XMB) Dynamic wallpaper improvement 2021-06-18 23:03:34 +03:00
sonninnos 917fb1f796 D3D12 Updates:
- Relocated 'd3d12_gfx_sync()'
- Fixed swap interval option
- Cleanups
2021-06-18 21:54:36 +03:00
Jamiras 81075aa5fa put challenge indicator above leaderboard trackers (#12530) 2021-06-18 18:00:48 +02:00
Tony ff7982fbcd (XMB) Dynamic wallpaper fix (#12531) 2021-06-18 18:00:37 +02:00
Grant 7915b040a9 only add mouse if it ha buttons and add vebose device friendly names 2021-06-18 03:55:25 +01:00
twinaphex a129764f0d Change C++ comment to C 2021-06-17 05:45:59 +02:00
Alcaro aeddcb54e0 Plug this so-called high-risk vuln (#12533)
https://www.reddit.com/r/RetroArch/comments/o0p1vy/retroarch_for_windows_versions_190_194_highrisk/

https://labs.bishopfox.com/advisories/retroarch-for-windows-version-1.9.0
2021-06-17 05:44:17 +02:00
Michael BurgardtandMichael Burgardt 10f0073778 adjust h2json and json2h scripts to be comment agnostic (#12532)
Co-authored-by: Michael Burgardt <[email protected]>
2021-06-16 17:21:57 +02:00
twinaphex 8b6e58eebd Buildfix for D3D11 - courtesy of Stenzek 2021-06-16 16:07:38 +02:00
Tony 49bd8d2d27 (XAudio+DSound) Fail instead of crash (#12527) 2021-06-16 15:35:20 +02:00
Connor McLaughlin 946d87cf89 (gfx/d3d11) Don't use allow tearing flag with blit swap chains (#12529) 2021-06-16 15:19:27 +02:00
IlDucci 138d5b3a4e Fix Encore Mode on Github, minor English change
- Fixes the Encore Mode string being misread by the Crowdin scripts.
 - Minor change on MENU_ENUM_SUBLABEL_CRT_SWITCH_HIRES_MENU's structure (by @DisasterMo, he asked me to do so).
2021-06-15 11:33:50 +02:00
Víctor "IlDucci cdba9accdf [Localization] Manually updating the .h translation files (#12494)
Second attempt at manually updating the translations from Crowdin. Built locally today.

Huge thanks to @DisasterMo for helping with the required edits on the python files (not uploaded to avoid messing with guoyunhe's setup)!

Moving the comment that breaks the script to a better position.
2021-06-15 03:04:49 +02:00
tunip3 963350a0f2 Add expanded resources Rescap to increase performance of UWP version in app mode on Xbox (#12525)
* add expanded resources rescap

* add expanded resources rescap
2021-06-15 03:04:10 +02:00
Michael Burgardt dd48b65687 Fix Switchres menu texts (#12526) 2021-06-15 03:03:10 +02:00
jdgleaver 642d6c9fb8 (Ozone) Ensure sidebar display status is updated correctly when performing rapid menu navigation (#12524) 2021-06-14 13:58:39 +02:00
twinaphex 6738fa57aa Bump up version to 1.9.5 2021-06-13 03:07:51 +02:00
jdgleaver d40d7c389b (Dingux) Fix black screens when triggering gfx driver reinitialisation via menu actions (#12521) 2021-06-13 00:37:48 +02:00
jdgleaver 3c2e3f1ce9 Add enhanced search functionality to the 'Manage Cores' menu (#12516) 2021-06-11 21:17:32 +02:00
twinaphex 766c59d469 Apply this to make MSVC 2005 compile with new resampler 2021-06-11 12:07:16 +02:00
twinaphex 7492f5d60c Revert "Add HAVE_GRIFFIN fallback for now"
This reverts commit dc50ff584e.
2021-06-11 12:05:59 +02:00
twinaphex bd9c35d379 Revert "Rollback changes for now until we can get this compiling on MSVC 2005 on"
This reverts commit 08481e2a68.
2021-06-11 12:05:48 +02:00
Jamiras 5d4069cf8f update to rcheevos 10.1 (#12512) 2021-06-10 17:20:00 +02:00
dankcushions 0caeed6e1d Make alsathread default for all alsa devices with threads. (#12515) 2021-06-10 17:19:52 +02:00
Bernhard Schelling 98194ce135 Allow the 8 analog stick directions to be used as keys for core keyboard mappings (#12506) 2021-06-10 17:00:33 +02:00
Michael Burgardt 4dcda032d0 Added list entry enumeration to XMB (#12427) 2021-06-10 16:02:19 +02:00
Mark W. Kidd f74fddf3fd do not duplicate port 0 mouse and gun inputs to other ports 2021-06-09 17:20:13 -04:00
twinaphex 08481e2a68 Rollback changes for now until we can get this compiling on MSVC 2005 on
the commandline (it builds with the VS solution file but not CLI)
2021-06-09 16:39:43 +02:00
twinaphex dc50ff584e Add HAVE_GRIFFIN fallback for now 2021-06-09 16:33:32 +02:00
CTCaer 98be8f0c22 plat: unix: correct backlight max_brightness path
We are assuming that device has its backlight device symlinked to /sys/class/backlight/backlight so this should be stated.

Additionally any hardcoding should be disallowed and the symlink should be always used.
2021-06-09 13:16:37 +03:00
Tony 3647bdef0f (D3D) Logging + dupe code cleanups (#12501) 2021-06-09 06:33:14 +02:00
Jamiras 75fcd63b4a (cheevos) use common functionality moved into rcheevos (#12504)
* user rcheevos for disallowed_settings

* use rcheevos for memory map
2021-06-09 06:32:34 +02:00
Tony 27cacffe54 Fix frame delay limit in conf read (#12507) 2021-06-09 06:32:01 +02:00
Autechre 74d85e3269 Backport optimizations from foobar2K 2021-06-09 06:05:14 +02:00
twinaphex 9d92888846 Add else path for defining SR_CONFIG_PATH 2021-06-07 19:15:37 +02:00
jdgleaver adfabcb742 Fix '--disable-crtswitchres' configure option (#12500) 2021-06-07 17:39:18 +02:00
twinaphex 620302ddaa (Switchres) Fix debug 2021-06-07 15:59:39 +02:00
Autechre da9f87c63f Update CHANGES.md 2021-06-07 15:54:08 +02:00
Autechre fe2fd18aad Merge pull request #12496 from sonninnos/framedelay-range
Extend frame delay range
2021-06-07 15:53:09 +02:00
Autechre 1c61068291 Merge pull request #12498 from JustMeDaFaq/master
Fixing UWP builds
2021-06-07 15:52:55 +02:00
Autechre 681983d1b2 Merge pull request #12499 from fjtrujy/psp-remove-pthread
[PSP] Remove embedded PTE from RA and use the one provided by the toolchain
2021-06-07 15:52:35 +02:00
Francisco Javier Trujillo Mata ec627a9c00 Remove embedded PTE from RA and use the one provided by the toolchain 2021-06-07 12:48:13 +02:00
JustMeDaFaq 462cedb654 Update d3d12.c 2021-06-07 12:04:53 +02:00
JustMeDaFaq f1347829c2 Update d3d11.c 2021-06-07 12:03:58 +02:00
sonninnos b08169255d Extend frame delay range 2021-06-07 03:13:08 +03:00
Autechre 610b0b7095 Update CHANGES.md 2021-06-06 22:16:25 +02:00
Autechre caf3f3dadd Merge pull request #12480 from sonninnos/d3d-title
(D3D) Add common window title for D3D9+
2021-06-06 21:48:16 +02:00
sonninnos 04962e1741 (D3D) Add common window title for D3D9+ 2021-06-06 22:24:47 +03:00
Autechre 44e2530fbb Update CHANGES.md 2021-06-06 21:18:02 +02:00
Autechre 52b827155f Merge pull request #12479 from sonninnos/d3d-tearflag
(D3D11+12) Allow fastforward in fullscreen
2021-06-06 21:14:26 +02:00
Autechre 3eecf92f8f Merge pull request #12493 from alphanu1/master
Ver 0.10.0 SR2 (Switchres API) Implimantation
2021-06-06 18:32:58 +02:00
Ben 9184a9d04c Ver 0.10.0 SR2 (Switchres API) Implimantation
merged SR updates

Fixed sub labels

fixed PI compiile

Removed SR makefile
2021-06-06 09:05:10 -07:00
Autechre 5534fd7275 Merge pull request #12490 from Alcaro/patch-12
Shut up a string truncation warning
2021-06-05 21:19:48 +02:00
Alcaro 8e06aa2417 Shut up a string truncation warning 2021-06-05 20:53:45 +02:00
Autechre f57fcd4048 Merge pull request #12489 from Jamiras/cheevos_challenge_indicators
(cheevos) address travis errors
2021-06-05 17:37:06 +02:00
Autechre 4b4576ed62 Merge pull request #12457 from libretro/vita-sounds
VIta: Enable menu sounds
2021-06-05 17:31:22 +02:00
Jamiras 9f8092dc27 address travis errors 2021-06-05 08:10:14 -06:00
Autechre e40f0d308b Merge pull request #12488 from Jamiras/cheevos_challenge_indicators
(cheevos) challenge indicators
2021-06-05 16:02:38 +02:00
Autechre 2259e9b38e Merge pull request #12403 from alphanu1/master
New Switchres (CRT Resolution switching) For Retroarch
2021-06-05 00:27:00 +02:00
twinaphex e44f0749a1 Put this behind HAVE_LANGEXTRA 2021-06-04 20:50:21 +02:00
Jamiras 3fe52bb7fb add toggle/setting for challenge indicators 2021-06-04 12:32:01 -06:00
Autechre 2edc6d6e6a Update CHANGES.md 2021-06-04 20:20:46 +02:00
Autechre fce9da5e76 Merge pull request #12445 from toshixm/CJK_folding_rev2
Improve message wrapping with CJK languages
2021-06-04 20:14:55 +02:00
Ben 4b2f27eff8 Ver 0.9.2 SR2 (Switchres API) Implimantation
Fixed SR close match refresh bug.
Added menu high resolution option.
Fixed desktop restore bug cuusing endless resolution change requests.
Fixed file conflicts
Added destop restore resolution back in for manu only.
Pulled Switchres fixes.
Added better PI rsolution support.

Ver 0.7 SR2 (Switchres API) Implimantation

Removed HH experimetal check. This is better done via teh switchres.ini at present.
Fixed refresh rate bug. Now new resolution and refesh is added correctly.
Removed SR deinit from menu restore. Meanu now stays at last content resolution.

Ver 0.6.2 SR2 (Switchres API) Implimantation

Fixed super resolution bug casuing abnormal video size and aspect ratio
Fixed logging issue casuing seg falts on RA exit

Ver 0.6 SR2 (Switchres API) Implimantation

Ver 0.2 SR2 (Switchres API) Implimantation

Added forced super resolutions.
Added Multi-monitor/monitor selection support.
Added desktop resolution restore when switching back to menu only.
Added new menu items for 31KHz standard and 120hz monitor profiles.
Added new menu item INI. load monitor profile from switchrss.ini.
Fixed winraw driver. Coordinates new refreshed after a resolution change.
Fixed Menu aspect ratio in super resolutions.
Removed static glabals. These have been added to videocrt_switch struct.

Ver 0.1 SR2 (Switchres API) Implimantation

Removed old CRTSwitchRes method. Added new SR2 API implimantaion.
Resolution swithcing is now done by switchres libs. Both Linux and Windows
working with native and super resolutions. Working multi-monitor support
with monitor index selection. Working 31KHz support with standard and 120Hxz
modes. The monitor index selection is still done via the RA UI. Only choose
native and 15KHz form the CRT options in the RA UI as all options are now set
in the switchres.ini. All other CRT optoins in the RA UI currently do nothing.

Added SR wrapper to fix compile issues. Added back RPi functionality

Fixed windows resize/scaling issues on resolution change

Thanks @Calamity no more need for crt_switch_driver_refresh()

Fix broken case after prevous commit

Monitor preset options 15/31KHz now active. Added new meu option.

Moitor persets can now be choosen fom the RA UI. 15KHz and 31KHz will set
arcade_15 and aracde_31 respectivly. New option INI, if this is chosen your
monitor preset will be selected from your switchres.ini file.

Added 3KHhz, 120Hz. for old RA users. Renamed 31KHz to 31 KHz,  Standard

Fixed winraw input coordinates after switching resolution.

Code cleanup

Fixed menu aspect ratio issue

Added menu resolution restore after closing content

Fixed aspect ratio after menu resolution restore.

code clean up

Fxed menu Resulition Restore Aspect Ratio. When SR uses non integer scalled resolution.

super width bug with restoring menu resolution fix

added super resolution check after setting desktop resolutoion variables

when menu active only sr_deinit() used to restore desktop mode.

Fixed menu sr_deinit bug. now setting sr_active false

Removed static globals, added them to video_switch struct

Fixex compile bug due to comment //

Fixed compile issues doe to c++ comments in teh switchres_wrapper.h

Temporarily removed SR2 logging to fix compile isses for c90

added logging back in. Removed support for winnt and osx

Added define for C89. Disabled SR if defined C89

Removed all RA compile fixes fro C89 C90 etc. Swithing now working again.

Put Switchres behind HAVE_SR2. HAVE_SR2=no by default. --enable-sr2

Ver 0.5 SR2 Implimentation.

Ver 0.4 SR2 Implimantation.

Bake SR inside RA

Removed temporary log files

Disable switchres when C89/C99 builds.

Removed C89 and C90 checks for SR

Fixed switchres_wrapper.h location

Ver 0.3 SR2 Implimenation

Dissable logging for C89 __STDC__

Fix For RPi

fixed missing EOL

fixed RPi function definition

added vidrocrt_switch stuct to RPI funcion

fixed xoffset for RPi

Removed old RPi function call

SR disabled for videocore until VC4 switching ported

Reverted back to state 5c8a56c Bake SR inside RA

Use native win32 api for threads.

Fix static lib linking
LIBERROR would be defined twice otherwise + improper function names prefixed by __imp_

Added lidstc++ to makefile.common for switchres

Fixed RPi switching. Disabled Switchres for videocore unill it is ported.

removed RAA.log. Should not exist

Added check for when SR fails to set mode with an aspect ratio fix.

added video driver re init for RPi

GB, GBA and GBC core check, adjusted reseolutions and scale. Please turn on integer scalling in the RA UI

Added logas back in. Checking STDC verstion >= C11

Fixed c89 for loop declaration.

Code clean up. Added new functions

Fix resolution switching bug introduces with HH code clean up.

Fixed menu restore bug on closw content after code clean up

Moved SR logging to relevant RA logs

Update makefile. Checks for X11 and xrandr

fixed makefile

Use native win32 api for threads.

Fix static lib linking
LIBERROR would be defined twice otherwise + improper function names prefixed by __imp_

Update switchres_wrapper.* header comments

Update year copyright

DRMKMS: build only if libdrm has the required version

XRANDR: build only if xrandr is available

Simplified maklefile

Fixed RPI compile error with unsued functions.

As before

Disable Griffin. No switching support available. Never has been

Removed log file 1

Added Win32 static define

Added SR source

Removed Videocore check on destroy SR

Moved SR deinit to trigger earlier on RA exit.

Fixed compile error after upstream rebase

Fixed aspect ration bug cused by super resolutions. Temporarily disbabled SR logging

Re inabled runtim eSR loggind. Disableed all RARCH logging on retro_deinit_drivers

Removed srdeinit from menu restore. Menu stays in current reolution until a fix can be found

Fixed refresh rate changes when no reolution change is detected.

Forgot to add teh resolution cahge in with the refresh change oops

Fixed endless no detection log.

Removed HH check. This can been better adjusted using the switchres.ini

fixed compile issue

Added better PI crt switching and fixed typo

Pulled Swicthres fixes. Updated desktop restore resolution.

removed unused makefile

Lockec menu refresh to 60hz

fixed missing new line

Fixed file conflicts

Forced 640x480@60 for menu

Added high resolution menu option

Removed item logg checker

Fixed typos

Removed unused functions

Fixed SR close match refesh bug.

Fixed typo
2021-06-04 08:32:56 -07:00
Jamiras 7919a87b97 show challenge indicators 2021-06-03 19:53:17 -06:00
sonninnos 8584b122e1 (D3D11+12) Allow fastforward in fullscreen 2021-06-04 04:31:11 +03:00
Autechre ec7e528094 Merge pull request #12466 from christianhaitian/master
Add nmcli to wifi drivers
2021-06-03 20:08:42 +02:00
Autechre f0c9c542a2 Merge pull request #12469 from CTCaer/unix-sysfs-battery-fix
plat: unix: get better battery stats on sysfs nodes
2021-06-03 20:06:44 +02:00
Autechre 4ed88ec68a Merge pull request #12477 from jdgleaver/archive-hash-fix
Fix loading of archived content with file names containing '#' characters
2021-06-03 20:06:36 +02:00
Autechre 140b8f5e0a Merge pull request #12474 from Jamiras/cheevos_menu
(cheevos) group achievements by category in quick menu
2021-06-03 19:42:09 +02:00
jdgleaver b5df2b883a Fix loading of archived content with file names containing '#' characters 2021-06-03 16:40:13 +01:00
toshixm 4fab84ca9e improve message wrapping with CJK languages 2021-06-03 21:09:35 +09:00
Autechre d8a5505204 Merge pull request #12473 from jdgleaver/content-data-api
Add API extension for setting 'need_fullpath' based on content file extension and to request persistent frontend content data buffers
2021-06-03 13:11:56 +02:00
toshixm 1218aebfbf static allocation instead of malloc() 2021-06-03 15:26:33 +09:00
Autechre b81ec7d631 Merge pull request #12446 from toshixm/fix_12440
fix garbled characters when converting encodings
2021-06-03 00:17:53 +02:00
Jamiras f8479c2b5a address travis warnings 2021-06-02 06:37:54 -06:00
Jamiras 69f3dda90a sort recently unlocked so newest unlocks are first 2021-06-02 06:34:54 -06:00
Jamiras a06b303879 remove unused structure 2021-06-01 21:52:10 -06:00
Jamiras ef9beea9f8 use info icon for headers; use server default image while downloading badges 2021-06-01 21:27:02 -06:00
Jamiras cd8f6ede4e support for almost there, active challenge, and recently unlocked categories 2021-06-01 19:38:10 -06:00
Jamiras e76265e1aa group achievements by category 2021-06-01 15:23:18 -06:00
Autechre 6443d6f019 Merge pull request #12472 from meleu/master
CHEEVOS: relabel 'Start Active' with 'Encore Mode'
2021-06-01 17:59:09 +02:00
Jamiras 293e797146 move menu code to separate file 2021-06-01 09:02:12 -06:00
jdgleaver 55c855267e Add API extension for setting 'need_fullpath' based on content file extension and to request persistent frontend content data buffers 2021-06-01 15:28:39 +01:00
meleu 73a5ec9f42 relabel 'Start Active' with 'Encore Mode' 2021-06-01 08:16:03 -03:00
CTCaer 86f8670d0b plat: unix: get better battery stats on sysfs nodes
This addresses 2 issues:

1. Input controllers report battery supplies.
   That causes wrong charging status or capacities if they report percentages instead of levels.
   Such supplies normally report scope attributes that report Unknown or Device type of power supply.
   If reported value is System or the attribute is missing, it's considered a System supply and used.

2. Various systems have backup batteries.
   That causes the wrong capacity to be reported depending on order of node creation.
   This is addressed by keeping track of these and calculating an average.
2021-05-31 18:36:49 +03:00
Autechre 6772b89872 Update CHANGES.md 2021-05-31 16:15:09 +02:00
Autechre d95e46c2bd Merge pull request #12458 from CTCaer/x-monitor-swap-fullscreen-fix
X11: fix fullscreen when swapping monitors/resolution
2021-05-31 16:14:04 +02:00
Christian_Haitian 74d9f976a8 Add wifi configuration menu
Enable with --enable-wifi during
configuration before make.
Credit to valadaa48 for the
code and configuration.
2021-05-31 02:20:34 +00:00
Autechre b1a3ea72c9 Update CHANGES.md 2021-05-30 04:22:55 +02:00
Autechre ab888629a5 Merge pull request #12456 from libretro/pstvscaling
Vita: Fix scaling on PSTV when not using 720p
2021-05-30 04:22:31 +02:00
toshixm 935c7d0e2c use _wfullpath() instead of _fullpath() 2021-05-30 09:17:06 +09:00
CTCaer a8028d5e8e X11: fix fullscreen when swapping monitors/resolution
Most DEs have the tendency to lose focus when monitor is getting swapped or the resolution changes.
That causes X11 exiting fullscreen and setting a lower resolution to fit desktop.
Pushing the window back to top, automatically fixes that and X11 enforces fullscreen again and new max resolution.

Additionally, XConfigure events are now checked and preferred over XGetWindowAttributes.
That saves several to hundreds μs per frame.
2021-05-29 22:19:19 +03:00
Francisco José García García cc1e080dfe VIta: Enable menu sounds 2021-05-29 20:22:37 +02:00
Francisco José García García 35f7ef3cc2 Vita: Fix scaling on PSTV when not using 720p 2021-05-29 19:05:35 +02:00
toshixm 84975d71ea fix garbled characters when conveting to local encoding 2021-05-28 15:20:19 +09:00
SecularSteve c424315510 Made the text, icons and borders darker, fixed the sidebar gradient. 2021-05-23 22:44:42 +02:00
SecularSteve d75e53a11a Added new "Ocean Blue" theme for Ozone 2021-05-23 13:47:46 +02:00
markwkidd cea6b17391 bind trigger to first mouse button by default 2021-05-20 22:50:49 -04:00
SecularSteve d1300dbdb3 small fixes 2021-05-20 14:46:39 +02:00
SecularSteve b355217e6d small fixes 2021-05-20 14:45:21 +02:00
SecularSteve a6f8355c6f small fixes 2021-05-20 14:41:45 +02:00
SecularSteve ce474040af Added new "Ocean Blue" Ozone theme 2021-05-20 14:15:10 +02:00
SecularSteve 32f68e81d6 Added new "Ocean Blue" theme 2021-05-20 14:13:58 +02:00
SecularSteve 0bd49c59c6 Added new "Ocean Blue" theme 2021-05-20 14:11:00 +02:00
SecularSteve a1ff509276 Added new "Ocean Blue" theme (along with a small tutorial)
I also sorted all of floats of the other themes in order.
2021-05-20 14:10:13 +02:00
SecularSteve 8346c4eeff Added English hash for "Ocean Blue" 2021-05-20 14:00:17 +02:00
pjft 0a83817f25 Merge branch 'master' into dual-lightgun 2021-01-18 11:23:44 +00:00
pjft f8b4289811 Change udev driver for dual lightgun support in X11 2020-09-28 21:25:51 +01:00
631 changed files with 44526 additions and 32112 deletions

No files matched your search

+1 -1
View File
@@ -1,4 +1,4 @@
# EditorConfig: http://EditorConfig.org
# EditorConfig: https://EditorConfig.org
# Top-most EditorConfig file
root = true
+2 -2
View File
@@ -94,7 +94,6 @@ database
overlays
playlists
states
system
shaders/shaders_cg
shaders/shaders_glsl
shaders/shaders_slang
@@ -220,8 +219,9 @@ libretro-common/samples/streams/rzip/rzip
#VITA
param.sfo
*.S
*.wo
*.elf
*.self
*.vpk
/.vs
/deps/SPIRV-Cross/out/build/x64-Debug
+45 -1
View File
@@ -426,6 +426,50 @@ build-retroarch-dingux-odbeta-mips32:
- "cp -f libretro-common/audio/dsp_filters/*.dsp ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/audio"
- "cp -f gfx/video_filters/*.filt ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/video"
build-retroarch-rs90-odbeta-mips32:
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-dingux:odbeta
stage: build
variables:
MEDIA_PATH: .media
STRIP_BIN: 1
before_script:
- export NUMPROC=$(($(nproc)/3))
artifacts:
paths:
- retroarch
- retroarch_rs90_odbeta.opk
- ${MEDIA_PATH}
expire_in: 10 min
dependencies: []
script:
- "make -j$NUMPROC -f Makefile.rs90"
- "mkdir -p ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/audio"
- "mkdir -p ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/video"
- "cp -f libretro-common/audio/dsp_filters/*.dsp ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/audio"
- "cp -f gfx/video_filters/*.filt ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/video"
build-retroarch-retrofw-mips32:
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-dingux:odbeta
stage: build
variables:
MEDIA_PATH: .media
STRIP_BIN: 1
before_script:
- export NUMPROC=$(($(nproc)/3))
artifacts:
paths:
- retroarch
- retroarch_retrofw.opk
- ${MEDIA_PATH}
expire_in: 10 min
dependencies: []
script:
- "make -j$NUMPROC -f Makefile.retrofw"
- "mkdir -p ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/audio"
- "mkdir -p ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/video"
- "cp -f libretro-common/audio/dsp_filters/*.dsp ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/audio"
- "cp -f gfx/video_filters/*.filt ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/video"
build-retroarch-android-normal:
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-android:latest
stage: build
@@ -739,7 +783,7 @@ build-static-retroarch-wiiu:
- "mv .retroarch-precompiled/ retroarch-precompiled/"
build-static-retroarch-dummy-wiiu:
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-devkitpro:latest
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-wiiu:latest
stage: build
variables:
MEDIA_PATH: .media
+181
View File
@@ -1,5 +1,185 @@
# Future
# 1.9.8
- AUDIO/WINDOWS/WASAPI: Stop deactivating audio on fast forward
- CHEEVOS: Hide challenge indicators when resetting
- CHEEVOS: Support for more than 64 memory regions
- CHEEVOS: Automatically retry 'http error code -1'
- CONTENT INFORMATION: Show content info label+path rows always
- CORE OPTIONS: Core option categories implemented
- CORE OPTIONS: Add option to disable core option categories
- D3D10/11/12: Fix gfx_display_draw_texture - fixes OSK (On-Screen Keyboard) issues
- DATABASE: Fix heap-buffer-overflow when fetching CRC values
- DATABASE/EXPLORE: Fix CRC32 reading in explore menu
- DATABASE/LIBRETRODB: Fix writing of numerical values
- DATABASE/LIBRETRODB: Fix libretro-db loading on big endian platforms
- DUMMY CORE: Skip state_manager_event_{deinit/init} when core type is dummy, should skip warning spam 'Implementation uses threaded audio. Cannot use rewind..' when using rewind
- INPUT/UDEV: Limit udev device scan to subsystem 'input'
- INPUT/SDL2/WINDOWS: Fix keyboard event keycodes
- INPUT/WAYLAND: Fixes a bug where the first player's mouse, pointer, and lightgun are echoed to the other ports. Now, those other ports correctly report zero. In the future support for multiple mouselike devices will need to be added, which is a bigger project
- INPUT/WAYLAND: The driver now respects keyboard_mapping_blocked
- INPUT/WAYLAND: When possible, deprecated lightgun defines are replaced with the new ones. The coordinates are still using the old relative callbacks
- INPUT/WINRAW: Trigger joypad driver reinit on DEVICECHANGE - avoids fullscreen toggle
- INPUT/WINRAW: Alt sticky fix
- INPUT/WINRAW: Prevent Alt getting stuck when Alt-Tabbing
- INPUT/WINRAW: Add pointer status
- INPUT/WINRAW: Add missing analog keybinds
- LIBNX/SWITCH: Fix poll missing for controller 2-8
- LIBNX/SWITCH: Fix layout not applied correctly and hangs when splitting joycons
- LIBRETRO: Core options category API implemented
- LIBRETRO: Fix RETRO_ENVIRONMENT_SET_FASTFORWARDING_OVERRIDE callback when runahead is enabled
- LIBRETRO: Add environment callback for enabling core option menu visibility updates without toggling Quick Menu
- LOGGING: Starting logging and verbose mode before first config load
- LINUX: In some Linux Desktop Environments, like Budgie, task bar feature is unable to pin applications. With StartupWMClass= present in .desktop file, it is possible to pin the application
- LOCALIZATION: Fetch translations from Crowdin
- MENU: Relocate 'Manage Playlists' to top
- MENU: Fullscreen resolution width/height settings no longer require 'advanced settings'
- MENU/REFRESH RATE: Fix double notifications with refresh rate settings
- MENU/OZONE: Ensure the existence of values used in selection calculation
- MENU/OZONE/VULKAN: Casting to unsigned caused an integer overflow and after float promotion would lead to 'x' being a garbage value, leading to problems when this value was passed to vkCmdSetViewport. This stops Vulkan validation layers from complaining about it
- METAL: Fixed font driver memory leaks
- MOUSE: Change default mouse index to port index
- MOUSE: Friendly names for mice where available
- OSX: Fix some memory leaks
- OSX: Fix controller duplication bug
- PS2: Implement alpha for the video driver
- PS2: Aspect ratio handling
- RETROFW: Initial port
- UWP/XBOX: Enable Explore tab by default - seems to work fine
- UWP/XBOX: Fix startup issues with latest Xbox Dashboard updates - ANGLE cores still show up wrong
- UWP/XBOX: fix issue where files where opened as OPENALWAYS instead of OPENEXISTING this fixes beetle cores
- UWP/XBOX: fix issue where filesizes where not returned properly, this fixes loading arcade dat files
- UWP/TRANSLATION: Enabled translation services for both UWP MSVC2017 and 2019. No TTS speech yet.
- VIDEO: Fix refresh rate 59Hz rounding
- WINDOWS: Remember original refresh rate
- WINDOWS/VULKAN: Refresh rate fixes + cleanups
- WIIU: Fix L3/R3 buttons
- WIIU: Compress RPX libretro cores
- WIIU: Add ICInvalidateRange (necessary for JITs)
- WIIU: Slight filesystem optimisation
- WIIU: Add option for running without core info (emscripten-style)
# 1.9.7
- 3DS: Add unique ID's
- CRT/SWITCHRES: Fixed some Monitor index bugs ad updated to the latest SR2
- CRT/SWITCHRES: Fixed monitor index corruption on Windows and added correct fractal scaling. Only used when required
- CRT/SWITCHRES: Updated log defines to match SR upstream.
- CRT/SWITCHRES: Added new SR_CONFIG_PATHS for non Windows and Linux systems.
Not that SR works on them but to fix RA compile issues
- CRT/SWITCHRES: Updated SR2 code base to latest. Added supprt for windows monitor indexing. Fixed monitor index bug where index 1 was not being used correctly and "auto" was not being sent.
- CRT/SWITCHRES: Updated swithres for x86 windows fix
- CRT/SWITCHRES: fixed SR2 auto issue
- CRT/SWITCHRES: Fixed auto monitor bug
- CRT/SWITCHRES: Fixed monitor index corruption on Windows
- CRT/SWITCHRES: Fixed buffer size bug
- CRT/SWITCHRES: Added correct fractal scalling. only used when required.
- CORE INFO: Automatically disable core info cache when core info directory is read-only
- EMSCRIPTEN: add MAME2003 / MAME2003-plus to web.libretro
- INPUT/UDEV: udev fixes add pointer pressed to pointer device to allow udev users to access this device
- LIBNX/SWITCH: Enable 7zip support
- LINUX/XDG: Prevent xdg-screensaver's "Protocol error" messages
- LOCALIZATION: Fetch translations from Crowdin
- LOCALIZATION: Add missing languages for the first startup
- MENU/XMB/WIDGETS: Add workaround for FPU bug that breaks scale factor comparisons on certain platforms (fixes XMB thumbnails on 32bit Linux/Windows)
- MENU/RGUI: Enable fullscreen thumbnail toggle using RetroPad 'start' button
- MENU/RGUI: Fix sublabel length when menu clock is disabled
- NETWORK/HTTP: Fix HTTP progress indication for large files on 32-bit systems
- NETWORK/NATT: implement natt fix from void()
- OPENDINGUX: Fix display when cores 'drop' frames
- OPENDINGUX BETA: Use ALSA audio driver by default
- OPENDINGUX BETA: Fix IPU scaling when running 256x224 (SNES/Genesis) content
- PATHS: Fix garbled path string
- PS2: Implement proper ps2_font driver instead of using the font driver from gskit
- PS2: Use BDM for increasing up USB stability
- PS3: First basic RSX driver for PSL1GHT
- RS90: Initial port
- RS90: Fix offset of OSD text
- RS90: Disable menu clock by default
- RS90: Hide 'Bilinear Filtering' video option
- RS90: Move appdata (retroarch) base directory to external microsd card
- RS90: Add optional approximate 'semi-linear' scaling filter
- SHADERS: Max Shader Parameters increased to 1024
- VIDEO: Add 'Integer Scale Overlay' - Force integer scaling to round up to the next larger integer instead of rounding down
- VIDEO: New 'Full' aspect ratio added. This aspect ratio is useful when used with a shader which has a border in it. The aspect ratio is set to the full window area, so that the viewport spans the whole viewport. When using a border type shader like the Mega Bezel this allows the graphics to span the whole window regardless of the user's monitor aspect ratio
- VITA: Wrong flags for not piglet version
- UNIX: Correct backlight max_brightness path
- UWP/XBOX: Default to Direct3D11 driver on UWP builds
- UWP/XBOX: Do not use windowed mode on UWP/Xbox by default, set default resolution to 1920x1080 by default. Should fix display issues with Dolphin/PCSX2 on Xbox
- WIIU: Fix inputs breaking when connecting/disconnecting remotes
- WIIU: Input - ignore some bogus KPAD results
- WIIU: Font rendering fixes - render font lines with correct spacing, and only sample alpha channel when rendering fonts
- WIIU/NETWORK: Network speed optimisations - WINSCALE, TCP sACK, large buffers
- WIIU/LIBFAT: Increase cache size on WiiU
- WIIU/FILE IO: Filesystem optimisations - add fast path for already aligned buffers
- WIIU/FILE IO: Use 128K vbufs for WiiU - we have loads of RAM and large vbufs are very beneficial
- WIIU/MENU/OZONE: Fix Ozone rendering error (scissor fix)
- WIIU/MENU/OZONE: Use Ozone icons instead of XMB Monochrome
# 1.9.6
- ARCHIVE: Fix archive delimiter detection when file path contains no slashes
- ANDROID: Do not duplicate port 0 mouse and gun inputs to other ports
- AUDIO/XAUDIO2: Fail instead of crashing when disconnecting an audio device
- CHEEVOS: Reset cached progress each time menu is opened
- CRT/SWITCHRES: Add support for switchres.ini core and directory overrides
- D3D11: Don't use allow tearing flag with blit swap chains. Also disables the flip model if the allow tearing flag is not supported.
- D3D11: Disable DXGI's ALT+ENTER handling
- D3D11: Don't pass ALLOW_TEARING when unsupported
- D3D11: Fix non-vsynced output without flip, black screens in fullscreen
- D3D12: Relocated 'd3d12_gfx_sync'
- D3D12: Fixed swap interval option
- GFX: Fix uninitialized variables in gfx_display_draw_cursor
- HISTORY: Hide 'Add to Favorites' when viewing an entry of the favorites playlist
- INPUT: 'Analog to Digital Type' usability improvements
- INPUT: Add support for mapping multiple controllers to a single input device
- INPUT/REMAPPING: Add support for mapping multiple controllers to a single input device
- INPUT/LIGHTGUN: Bind lightgun trigger to first mouse button by default
- INPUT/WINDOWS/RAWINPUT: Mouse access violation fix
- INPUT/UDEV: Only add mouse if it has buttons and add vebose device friendly names
- INPUT/UDEV: Skip mouse with no button errors and keep the rest
- INPUT/UDEV: Fix Game Focus mode
- INPUT/UDEV/X11: Change udev driver for dual lightgun support in X11
- LIBNX/SWITCH: Update to libnx 4.0.0
- LOCALIZATION: Fetch translations from Crowdin
- LOCALIZATION: Fix Switchres menu texts
- MENU/OZONE: Ensure sidebar display status is updated correctly when performing rapid menu navigation
- MENU/XMB: Dynamic wallpaper fix
- MENU/XMB: Icon opacity fix
- MENU/QT/WIMP: Fix default core detection when playlist file name does not match 'db_name'
- PLAYLISTS: Optimise scanning of large rom sets
- SECURITY: Plug so-called high-risk vulnerability related to Powershell - avoid injection - don't send speech input as commandline argument
- UWP/XBOX: Add expanded resources Rescap to increase performance of UWP version in app mode on Xbox
- WINDOWS/INSTALLER: Add smarter isEmptyDir reference implementation that looks for subdirectories from NSIS documentation
- WINDOWS/INSTALLER: Register new function DirectorySet that is called when pressing the "Next" button on the MUI_PAGE_DIRECTORY, aka the install folder selection GUI. DirectorySet contains the criteria for an acceptable folder, which are:
- `IfFileExists "$INSTDIR\retroarch.exe"` returns 1
- `IfFileExists "$INSTDIR\*.*` returns 0, there is no existing folder
- `IfFileExists "$INSTDIR\*.*"` returns 1, there is a folder, and `isEmptyDir` returns 1, therefore the folder is empty, including of subdirectories
- X11: Fix threaded video segfault
# 1.9.5
- ALSATHREAD: Make alsathread default for all ALSA devices with threads
- ARCHIVE: Fix loading of archived content with file names containing '#' characters
- CHEEVOS: Upgrade to rcheevos 10.1
- CHEEVOS: Challenge indicators
- CHEEVOS: Group achievements by category in quick menu
- CHEEVOS: Relabel 'Start Active' with 'Encore Mode'
- D3D10: Window title should now update
- D3D11: Window title should now update
- D3D11: Allow fastforward in fullscreen
- D3D12: Window title should now update
- D3D12: Allow fastforward in fullscreen
- CRT/SWITCHRES: New implementation
- FONTS: Improve message wrapping with CJK languages
- FONTS: Fix garbled characters when converting encodings
- INPUT: Allow the 8 analog stick directions to be used as keys for core keyboard mappings
- LIBRETRO: Add API extension for setting 'need_fullpath' based on content file extension and to request persistent frontend content data buffers
- MENU/SEARCH: Add enhanced search functionality to the 'Manage Cores' menu
- OPENDINGUX: Fix black screens when triggering gfx driver initialisation via menu actions
- UNIX: Get better battery stats on sysfs nodes
- VIDEO: Extend Frame Delay range to 19 to accommodate PAL land too
- WIFI/LAKKA: Add nmcli to wifi drivers
- WIFI/LAKKA: Add wifi configuration menu
- X11: fix fullscreen when swapping monitors/resolution
# 1.9.4
- CHEEVOS: update rcheevos to v10.0.0
- CONTENT LOADING/FILE IO: Prevent unnecessary extraction (to disk) of compressed content files when need_fullpath is false
@@ -15,6 +195,7 @@
- PS3/PSL1GHT: Joypad driver works again
- PSTV: Fix Vita input driver for PSTV
- PSTV: Support for 720p on PSTV when using 'Unlock framebuffer' in Sharpscale plugin
- PSTV: Fix scaling on PSTV when not using 720p
- RPNG: Fix some memory corruption if processing broken input PNG file
- SECURITY: Fix CVE-2021-28927
+135
View File
@@ -0,0 +1,135 @@
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, caste, color, religion, or sexual identity
and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at:
* Via E-Mail to <libretro@gmail.com>, please include in the subject line
`RETROARCH COC` so that your e-mail may reach the correct party.
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series
of actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within
the community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.1, available at
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available
at [https://www.contributor-covenant.org/translations][translations].
[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations
+79 -44
View File
@@ -1,58 +1,93 @@
# Contributing to RetroArch
If you are a developer and want to contribute to the development of RetroArch, please read this.
If you have found a bug and want to submit a minor patch or a bug report, please read this as well.
If you are a developer who wishes to contribute to the development of _RetroArch_; or if you have
found a bug and wish to submit a minor patch and/or bug report, please read this document.
# Submitting a bug report
When submitting a bug report, make sure that the bug is local to RetroArch.
A bug in a libretro core or something deemed to be external is likely to be closed very fast.
If you still suspect a bug in RetroArch, make sure to test with several cores to make sure.
Active discussions happen on our [Discord](https://discordapp.com/invite/27Xxm2h), mostly within
the _Programming_ channel category. We value discussions that happen in real time around
these contributions.
If you have troubles building RetroArch on Linux/BSD/OSX, make sure to paste shell output of ./configure,
as well as config.log and shell output of make. If building on Windows, just paste shell output of make.
Please do note that contributors to _RetroArch_ do such contributions within their spare time.
We do prefer to keep a professional and non-aggressive atmosphere around the project, along
with any disagreements to be settled professionally without insults, name calling, or otherwise.
If there are any issues, we are willing to have discussions about it.
If the issue occurs during runtime, make sure to paste RetroArch's verbose log.
If using Phoenix frontend, you can find log in (File -> Show Log) after running.
In console, make sure to run with verbose (-v) flag.
## Submitting Bug Reports
# Pull Requests
Outside contributions are generally only accepted in the form of a pull request. The process is very simple.
Fork RetroArch, make your changes, and issue a pull request on GitHub. This can all be done within the browser.
The changes are reviewed, and might be merged in. If the pull request isn't acceptable at the time,
note that it's possible to continue pushing up commits to your branch.
Bug reports in _RetroArch_ may fall into one of two categories:
If you want to develop a larger feature,
we'd like to discuss this first (ideally on IRC) so that you don't risk developing something
that won't be merged. A pull request with a proof-of-concept is fine, but please indicate so.
* _RetroArch_ itself, the user interface and API around all of the various cores.
* Individual _Core_, of which interact with _RetroArch_.
When submitting a bug report, ensure that the report is submitted to the correct repository.
For _RetroArch_ itself, it is done by reporting a bug within the
[RetroArch](https://github.com/libretro/RetroArch) repository. For other cores, please use
the search function within the [libretro Organization](https://github.com/libretro) on
GitHub. Issues that are specific to a core and not _RetroArch_ are likely to be closed very
quickly. If an issue is suspected with _RetroArch_, please make sure to test with multiple
cores to be sure that is is not isolated.
If the issue occurs during runtime, please paste the verbose log output:
* If using the _Pheonix_ interface, the log will be in _File_ -> _Show Log_.
* If using the main interface, enable verbose logging with _Settings_ -> _Logging_ ->
_Logging Verbosity_. Ensure both _Log to File_ and _Timestamp log Files_ is enabled.
* Otherwise, run _RetroArch_ with the verbose (`-v`) flag.
If the error happens during compilation and/or building, paste the output of `./configure`
and `make` accordingly. If using an IDE, please paste any of the errors and log output.
## Submitting Pull Requests
Any and all contributions should be submitted through Pull Requests on
[GitHub](https://github.com/libretro/RetroArch/pulls). The process requires that you fork the
repository, make the appropriate changes, and then open a pull request on _GitHub_. If your
pull request is for a proof-of-concept then please indicate as such.
Your pull request will then be reviewed. There may be comments and requests for additional
changes to be made. It may also be possible that the changes will not be accepted. Otherwise, it
may be merged in when it is fully approved. The final approval of merge requests is at the
discretion of the project.
If you want to develop a larger feature or make broad changes, please do join our
[Discord](https://discordapp.com/invite/27Xxm2h) server to discuss. The discussion is
necessary to prevent the possibility of major work being done which will not be accepted at all.
## libretro API
If you wish to add functionality to libretro's API, it can take some time to merge in, because changes
to libretro API will affect other projects as well, and we highly value API/ABI stability.
Features will only be added when deemed *necessary* for a concrete libretro core to function properly.
Features will not be added on basis of hypothetical libretro implementations.
# Coding style
Having a consistent code style throughout the code base is highly valued.
Please look through the code to get a feel for the coding style.
A pull request may be asked to fix the coding style before submission.
In other cases, a pull request may be followed up with a "style nit commit".
If you wish to contribute additional functionality to _libretro_'s API, there are considerations
that must be accepted. Please note that because this API affects multiple different projects, we
highly value and require API and ABI stability and backwards-compatibility. Due to this
requirement, there will be additional scrutiny in reviews for this added functionality.
## Non-obvious things:
- Code should be both C89 and ISO C++ compatible. This dual requirement is for XBox360 and MSVC in general. Think of it as a C++ compatible subset of C99.
- Warnings are not allowed (-Wall). Make sure your code is warning-free. Note that warning sensitivity differs a bit across compiler versions.
- Using deprecated APIs is discouraged.
Any and all features will be added only when **necessary** for an existing _libretro_ core to
properly function. Hypothetical implementations of _libretro_ are not considered.
# Copyright Headers and AUTHORS
If you have contributed to a part of a source file (a chunk of code that's written by you),
you should add yourself to the copyright header in that file.
If you have contributed significantly
(a feature, a contribution you can "name", e.g. "Added audio driver foo"), you should add yourself to AUTHORS file.
We'd like your full name and email, and which features you have been part of.
## Coding style
# IRC
Active development happens on IRC. (#retroarch @ irc.freenode.org)
We value discussing things in "real-time".
We highly value a consistent code style throughout the entire code base, please make sure you look
through the existing code to get a feel for the coding style. When submitting a pull request, it may
be asked to fix any coding style issues before submission. In other cases, there may be a follow-up
pull request making the code style consistent.
# Commit Access
Contributors who show a track record of making good pull requests over time will eventually get commit access to the repo.
This typically happens when the "overhead" of looking through pull requests over time becomes a burden.
For full guidelines please see the [Coding Standards](https://docs.libretro.com/development/coding-standards/).
Some non-obvious things to be aware of:
- Code should be both C89 and ISO C++ compatible. This is a requirement for XBox 360 and MSVC to
properly build. Think of it as a C++ compatible subset of C99.
- There must be no warnings in your code (enabled by `-Wall` for GCC compilers), do also note that
different compilers may produce different warnings.
- Avoid using deprecated APIs, these will be removed in the future at some point.
## Copyright Headers and AUTHORS
If you have contributed a chunk of source code that is written to you, you should add yourself to
the copyright header in the file. If you have made a significant contribution you should add
yourself to the `AUTHORS` file, adding your full name, e-mail, and the feature you worked on.
## Commit Access
Contributors who show a good track record of pull requests over time may eventually
get commit access to the repository. This may happen when looking through pull requests
over long amounts of time becomes a burden.
+71 -23
View File
@@ -134,7 +134,7 @@ ifneq ($(findstring Darwin,$(OS)),)
MINVERFLAGS=
ifeq ($(shell uname -p),arm)
MINVERFLAGS = -mmacosx-version-min=10.15 -stdlib=libc++ # macOS (Metal, ARM 64bit)
MINVERFLAGS += -DDONT_WANT_ARM_OPTIMIZATIONS
MINVERFLAGS += -DDONT_WANT_ARM_ASM_OPTIMIZATIONS
else ifeq ($(HAVE_METAL),1)
MINVERFLAGS = -mmacosx-version-min=10.13 -stdlib=libc++ # macOS (Metal, x86 64bit)
else ifeq ($(shell uname -p),powerpc)
@@ -148,7 +148,7 @@ ifneq ($(findstring Darwin,$(OS)),)
# Build for a specific architecture when ARCH is defined as a switch
ifeq ($(ARCH),arm64)
MINVERFLAGS = -mmacosx-version-min=10.15 -stdlib=libc++ # macOS (Metal, ARM 64bit)
MINVERFLAGS += -DDONT_WANT_ARM_OPTIMIZATIONS
MINVERFLAGS += -DDONT_WANT_ARM_ASM_OPTIMIZATIONS
ARCHFLAGS = -arch arm64
else ifeq ($(ARCH),x86_64)
ifeq ($(HAVE_METAL),1)
@@ -277,6 +277,7 @@ OBJ += \
OBJ += \
$(LIBRETRO_COMM_DIR)/lists/linked_list.o \
$(LIBRETRO_COMM_DIR)/lists/nested_list.o \
$(LIBRETRO_COMM_DIR)/queues/generic_queue.o
ifneq ($(findstring Linux,$(OS)),)
@@ -301,10 +302,10 @@ OBJ += \
$(LIBRETRO_COMM_DIR)/file/file_path_io.o \
file_path_special.o \
$(LIBRETRO_COMM_DIR)/hash/lrc_hash.o \
input/input_driver.o \
input/common/input_hid_common.o \
led/led_driver.o \
gfx/video_coord_array.o \
gfx/video_crt_switch.o \
gfx/gfx_display.o \
gfx/gfx_animation.o \
gfx/gfx_thumbnail_path.o \
@@ -337,6 +338,7 @@ endif
OBJ += \
core_info.o \
core_backup.o \
core_option_manager.o \
$(LIBRETRO_COMM_DIR)/file/config_file.o \
$(LIBRETRO_COMM_DIR)/file/config_file_userdata.o \
runtime_file.o \
@@ -669,7 +671,7 @@ else ifeq ($(HAVE_BUILTINMBEDTLS), 1)
DEFINES += -DMBEDTLS_SSL_DEBUG_ALL
endif
# MinGW requires this for some reason,
# MinGW requires this for some reason,
# even though the include paths are relative to the source
INCLUDE_DIRS += -Ideps/mbedtls
@@ -771,6 +773,11 @@ ifeq ($(HAVE_LAKKA), 1)
OBJ += misc/cpufreq/cpufreq.o
endif
ifeq ($(HAVE_WIFI), 1)
OBJ += wifi/drivers/nmcli.o
DEFINES += -DHAVE_WIFI
endif
# Audio
ifeq ($(HAVE_COREAUDIO), 1)
@@ -825,7 +832,9 @@ ifeq ($(HAVE_ALSA), 1)
ifneq ($(HAVE_HAKCHI), 1)
ifneq ($(HAVE_SEGAM), 1)
OBJ += midi/drivers/alsa_midi.o
ifneq ($(DINGUX), 1)
OBJ += midi/drivers/alsa_midi.o
endif
endif
endif
@@ -1570,8 +1579,14 @@ else ifeq ($(HAVE_SDL), 1)
else ifeq ($(HAVE_SDL_DINGUX), 1)
HAVE_SDL_COMMON = 1
DEF_FLAGS += -DHAVE_SDL -DHAVE_SDL_DINGUX
OBJ += gfx/drivers/sdl_dingux_gfx.o \
input/drivers/sdl_dingux_input.o \
ifeq ($(RS90), 1)
OBJ += gfx/drivers/sdl_rs90_gfx.o
else
OBJ += gfx/drivers/sdl_dingux_gfx.o
endif
OBJ += input/drivers/sdl_dingux_input.o \
input/drivers_joypad/sdl_dingux_joypad.o
DEF_FLAGS += $(SDL_DINGUX_CFLAGS)
LIBS += $(SDL_DINGUX_LIBS)
@@ -2107,8 +2122,8 @@ ifeq ($(HAVE_NETWORKING), 1)
INCLUDE_DIRS += -Ideps/rcheevos/include
OBJ += cheevos/cheevos.o \
cheevos/badges.o \
cheevos/cheevos_memory.o \
cheevos/cheevos_client.o \
cheevos/cheevos_menu.o \
cheevos/cheevos_parser.o \
$(LIBRETRO_COMM_DIR)/formats/cdfs/cdfs.o \
deps/rcheevos/src/rcheevos/alloc.o \
@@ -2120,12 +2135,16 @@ ifeq ($(HAVE_NETWORKING), 1)
deps/rcheevos/src/rcheevos/lboard.o \
deps/rcheevos/src/rcheevos/memref.o \
deps/rcheevos/src/rcheevos/operand.o \
deps/rcheevos/src/rcheevos/rc_libretro.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/value.o \
deps/rcheevos/src/rhash/hash.o \
deps/rcheevos/src/rapi/rc_api_common.o \
deps/rcheevos/src/rapi/rc_api_runtime.o \
deps/rcheevos/src/rapi/rc_api_user.o \
deps/rcheevos/src/rurl/url.o
ifeq ($(HAVE_LUA), 1)
@@ -2269,6 +2288,39 @@ ifeq ($(HAVE_FFMPEG), 1)
INCLUDE_DIRS += -Iffmpeg
endif
# CRT mode switching
ifeq ($(HAVE_CRTSWITCHRES), 1)
INCLUDE_DIRS += -I$(DEPS_DIR)/switchres
OBJ += gfx/video_crt_switch.o \
$(DEPS_DIR)/switchres/monitor.o \
$(DEPS_DIR)/switchres/modeline.o \
$(DEPS_DIR)/switchres/switchres.o \
$(DEPS_DIR)/switchres/display.o \
$(DEPS_DIR)/switchres/custom_video.o \
$(DEPS_DIR)/switchres/log.o \
$(DEPS_DIR)/switchres/switchres_wrapper.o \
$(DEPS_DIR)/switchres/edid.o
ifneq ($(findstring Win32,$(OS)),)
OBJ += $(DEPS_DIR)/switchres/display_windows.o \
$(DEPS_DIR)/switchres/custom_video_ati_family.o \
$(DEPS_DIR)/switchres/custom_video_ati.o \
$(DEPS_DIR)/switchres/custom_video_adl.o \
$(DEPS_DIR)/switchres/custom_video_pstrip.o \
$(DEPS_DIR)/switchres/resync_windows.o
endif
ifneq ($(findstring Linux,$(OS)),)
OBJ += $(DEPS_DIR)/switchres/display_linux.o
ifeq ($(HAVE_X11)$(HAVE_XRANDR), 11)
OBJ += $(DEPS_DIR)/switchres/custom_video_xrandr.o
DEFINES += -DSR_WITH_XRANDR
endif
endif
ifneq ($(findstring Win32,$(OS)),)
DEFINES += -DSR_WIN32_STATIC
endif
LIBS += -lstdc++
endif
ifeq ($(HAVE_COMPRESSION), 1)
DEFINES += -DHAVE_COMPRESSION
OBJ += tasks/task_decompress.o
@@ -2286,9 +2338,9 @@ ifeq ($(HAVE_COCOA_COMMON),1)
OBJ += input/drivers/cocoa_input.o \
ui/drivers/ui_cocoa.o \
ui/drivers/cocoa/cocoa_common.o
ifeq ($(HAVE_OPENGL), 1)
DEFINES += -DGL_SILENCE_DEPRECATION
DEFINES += -DGL_SILENCE_DEPRECATION
OBJ += gfx/drivers_context/cocoa_gl_ctx.o
endif
ifeq ($(HAVE_VULKAN), 1)
@@ -2332,10 +2384,10 @@ endif
ifeq ($(WANT_IOSUHAX), 1)
DEFINES += -DHAVE_IOSUHAX
INCLUDE_DIRS += -I$(DEPS_DIR)/libiosuhax
OBJ += $(DEPS_DIR)/libiosuhax/iosuhax.o \
$(DEPS_DIR)/libiosuhax/iosuhax_devoptab.o \
$(DEPS_DIR)/libiosuhax/iosuhax_disc_interface.o
INCLUDE_DIRS += -I$(DEPS_DIR)/libiosuhax/include
OBJ += $(DEPS_DIR)/libiosuhax/source/iosuhax.o \
$(DEPS_DIR)/libiosuhax/source/iosuhax_devoptab.o \
$(DEPS_DIR)/libiosuhax/source/iosuhax_disc_interface.o
endif
ifeq ($(WANT_LIBFAT), 1)
@@ -2372,13 +2424,6 @@ ifneq ($(findstring Win32,$(OS)),)
OBJ += led/drivers/led_win32_keyboard.o
endif
ifeq ($(HAVE_MATH_NEON), 1)
DEFINES += -DHAVE_MATH_NEON
INCLUDE_DIRS += -I$(DEPS_DIR)/math-neon/source
SOURCES := $(DEPS_DIR)/math-neon/source
OBJ += $(patsubst %.c,%.o,$(foreach dir,$(SOURCES), $(wildcard $(dir)/*.c)))
endif
ifeq ($(HAVE_VITAGLES), 1)
DEFINES += -DHAVE_VITAGLES
INCLUDE_DIRS += -I$(DEPS_DIR)/Pigs-In-A-Blanket/include
@@ -2386,6 +2431,10 @@ ifeq ($(HAVE_VITAGLES), 1)
OBJ += $(patsubst %.c,%.o,$(foreach dir,$(SOURCES), $(wildcard $(dir)/*.c)))
endif
ifeq ($(HAVE_WEBOS), 1)
DEFINES += -DWEBOS
endif
#####################################
### Android Play Feature Delivery ###
### (Play Store build core ###
@@ -2443,4 +2492,3 @@ ifeq ($(HAVE_ODROIDGO2), 1)
endif
##################################
+1 -1
View File
@@ -490,7 +490,7 @@ else ifeq ($(platform), windows_msvc2005_x86)
CXX = cl.exe
LD = link.exe
PLATCFLAGS += -D_WIN32 -D_WIN32_WINNT=0x0410 -D__STDC_CONSTANT_MACROS -D_MBCS -D__SSE__
PLATCFLAGS += -D_WIN32 -D_WIN32_WINNT=0x0410 -D__STDC_CONSTANT_MACROS -D_MBCS
PLATCFLAGS += -DHAVE_OPENGL -DHAVE_OPENGL1 -DHAVE_GLSL -DHAVE_OZONE -DHAVE_GFX_WIDGETS -DHAVE_CC_RESAMPLER
PLATCFLAGS += -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_ASSETS -DHAVE_UPDATE_CORES -DHAVE_CDROM
PLATCFLAGS += -bigobj
+1
View File
@@ -32,6 +32,7 @@ HAVE_RTGA = 1
HAVE_RPNG = 1
HAVE_RJPEG = 1
HAVE_RBMP = 1
HAVE_7ZIP = 1
HAVE_ZLIB = 1
HAVE_BUILTINZLIB = 1
HAVE_LIBRETRODB = 1
+11 -5
View File
@@ -1,5 +1,6 @@
BUILD_FOR_PCSX2 = 0
DEBUG = 0
SCREEN_DEBUG = 0
HAVE_THREADS = 0
MUTE_WARNINGS = 1
PS2_IP = 192.168.1.10
@@ -24,18 +25,22 @@ endif
INCDIR = -I$(PS2DEV)/gsKit/include -I$(PS2SDK)/ports/include
INCDIR += -Ips2/include -Ilibretro-common/include -Ideps -Ideps/stb -Ideps/7zip
INCDIR += -Ideps/pthreads -Ideps/pthreads/platform/ps2 -Ideps/pthreads/platform/helper
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 += -DPS2 -DHAVE_GRIFFIN=1 -DRARCH_INTERNAL -DHAVE_SCREENSHOTS -DHAVE_REWIND -DRARCH_CONSOLE -DHAVE_MENU -DHAVE_CONFIGFILE -DHAVE_PATCH -DHAVE_CHEATS
RARCH_DEFINES += -DHAVE_ZLIB -DHAVE_NO_BUILTINZLIB -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_FILTERS_BUILTIN -DHAVE_7ZIP -D_7ZIP_ST -DHAVE_CC_RESAMPLER -DHAVE_AUDIOMIXER
RARCH_DEFINES += -DHAVE_VIDEO_FILTER -DHAVE_RGUI
RARCH_DEFINES += -DHAVE_DSP_FILTER
RARCH_DEFINES += -DHAVE_VIDEO_FILTER
LDFLAGS += -L$(PS2DEV)/gsKit/lib -L$(PS2SDK)/ports/lib -L.
# Lib cdvd is needed to get proper time
LIBS += -lretro_ps2 -lpatches -lgskit -ldmakit -laudsrv -lmtap -lpadx -lz -lcdvd -lelf-loader
LIBS += -lretro_ps2 -lpatches -lgskit -ldmakit -laudsrv -lmtap -lpadx -lz -lcdvd -lelf-loader -lfileXio -lpoweroff
ifeq ($(SCREEN_DEBUG), 1)
LIBS += -ldebug
RARCH_DEFINES += -DSCREEN_DEBUG
endif
ifeq ($(BUILD_FOR_PCSX2), 1)
RARCH_DEFINES += -DBUILD_FOR_PCSX2
@@ -50,9 +55,10 @@ CFLAGS += $(RARCH_DEFINES)
# All the IRX objects
EE_OBJS += $(IRX_DIR)/sio2man_irx.o $ $(IRX_DIR)/iomanX_irx.o $(IRX_DIR)/fileXio_irx.o
EE_OBJS += $(IRX_DIR)/mcman_irx.o $(IRX_DIR)/mcserv_irx.o
EE_OBJS += $(IRX_DIR)/usbd_irx.o $(IRX_DIR)/usbhdfsd_irx.o
EE_OBJS += $(IRX_DIR)/usbd_irx.o $(IRX_DIR)/bdm_irx.o $(IRX_DIR)/bdmfs_vfat_irx.o $(IRX_DIR)/usbmass_bd_irx.o
EE_OBJS += $(IRX_DIR)/libsd_irx.o $(IRX_DIR)/audsrv_irx.o
EE_OBJS += $(IRX_DIR)/cdfs_irx.o
EE_OBJS += $(IRX_DIR)/ps2dev9_irx.o $(IRX_DIR)/ps2atad_irx.o $(IRX_DIR)/ps2hdd_irx.o $(IRX_DIR)/ps2fs_irx.o $(IRX_DIR)/poweroff_irx.o
EE_OBJS += $(IRX_DIR)/mtapman_irx.o $(IRX_DIR)/padman_irx.o
# Missing objecst on the PS2SDK
+10 -2
View File
@@ -1,5 +1,6 @@
BUILD_FOR_PCSX2 = 0
DEBUG = 0
SCREEN_DEBUG = 0
MUTE_WARNINGS = 1
PS2_IP = 192.168.1.150
@@ -30,7 +31,12 @@ RARCH_DEFINES += -DPS2 -DIS_SALAMANDER -DRARCH_CONSOLE
LIBDIR =
LDFLAGS =
LIBS = -lelf-loader -lpatches
LIBS = -lelf-loader -lpatches -lfileXio -lpoweroff
ifeq ($(SCREEN_DEBUG), 1)
LIBS += -ldebug
RARCH_DEFINES += -DSCREEN_DEBUG
endif
ifeq ($(BUILD_FOR_PCSX2), 1)
RARCH_DEFINES += -DBUILD_FOR_PCSX2
@@ -61,8 +67,10 @@ EE_OBJS = frontend/frontend_salamander.o \
# Needed IRX objects
EE_OBJS += $(IRX_DIR)/sio2man_irx.o $ $(IRX_DIR)/iomanX_irx.o $(IRX_DIR)/fileXio_irx.o
EE_OBJS += $(IRX_DIR)/mcman_irx.o $(IRX_DIR)/mcserv_irx.o $(IRX_DIR)/usbd_irx.o $(IRX_DIR)/usbhdfsd_irx.o
EE_OBJS += $(IRX_DIR)/mcman_irx.o $(IRX_DIR)/mcserv_irx.o
EE_OBJS += $(IRX_DIR)/usbd_irx.o $(IRX_DIR)/bdm_irx.o $(IRX_DIR)/bdmfs_vfat_irx.o $(IRX_DIR)/usbmass_bd_irx.o
EE_OBJS += $(IRX_DIR)/cdfs_irx.o
EE_OBJS += $(IRX_DIR)/ps2dev9_irx.o $(IRX_DIR)/ps2atad_irx.o $(IRX_DIR)/ps2hdd_irx.o $(IRX_DIR)/ps2fs_irx.o $(IRX_DIR)/poweroff_irx.o
EE_CFLAGS = $(CFLAGS)
EE_CXXFLAGS = $(CFLAGS)
+1 -1
View File
@@ -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 -DHAVE_PATCH -DHAVE_CHEATS -DRARCH_CONSOLE -DHAVE_OVERLAY -DHAVE_HEADSET -DHAVE_CG -DHAVE_CG_RUNTIME_COMPILER -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
CFLAGS += -std=gnu99 $(SHARED_FLAGS)
CXXFLAGS += $(SHARED_FLAGS)
+2 -2
View File
@@ -19,7 +19,7 @@ ifeq ($(WHOLE_ARCHIVE_LINK), 1)
WHOLE_END := -Wl,--no-whole-archive
endif
INCDIR = deps deps/stb deps/7zip deps/pthreads deps/pthreads/platform/psp deps/pthreads/platform/helper libretro-common/include libretro-common/include/compat/zlib
INCDIR = deps deps/stb deps/7zip libretro-common/include libretro-common/include/compat/zlib
CFLAGS = $(OPTIMIZE_LV) -G0 -std=gnu99 -ffast-math -fsingle-precision-constant
ASFLAGS = $(CFLAGS)
@@ -27,7 +27,7 @@ RARCH_DEFINES = -DPSP -D_MIPS_ARCH_ALLEGREX -DHAVE_LANGEXTRA -DHAVE_ZLIB -DHAVE_
LIBDIR =
LDFLAGS =
LIBS = $(WHOLE_START) -lretro_psp1 $(WHOLE_END) -lstdc++ -lpspgu -lpspgum -lm -lpspaudio -lpspfpu -lpsppower -lpsprtc
LIBS = $(WHOLE_START) -lretro_psp1 $(WHOLE_END) -lstdc++ -lpspgu -lpspgum -lm -lpspaudio -lpspfpu -lpsppower -lpsprtc -lpthread-psp
ifeq ($(HAVE_THREADS), 1)
RARCH_DEFINES += -DHAVE_THREADS
+237
View File
@@ -0,0 +1,237 @@
#########################
## Toolchain variables ##
#########################
# Default toolchain directory
TOOLCHAIN_DIR=/opt/retrofw-toolchain
# All toolchain-related variables may be
# overridden via the command line
ifdef RETROFW_CC
CC = $(GCW0_CC)
else
CC = $(TOOLCHAIN_DIR)/usr/bin/mipsel-linux-gcc
endif
ifdef RETROFW_CXX
CXX = $(GCW0_CXX)
else
CXX = $(TOOLCHAIN_DIR)/usr/bin/mipsel-linux-g++
endif
ifdef RETROFW_STRIP
STRIP = $(GCW0_STRIP)
else
STRIP = $(TOOLCHAIN_DIR)/usr/bin/mipsel-linux-strip
endif
GCW0_SDL_CONFIG ?= $(TOOLCHAIN_DIR)/usr/mipsel-buildroot-linux-uclibc/sysroot/usr/bin/sdl-config
GCW0_FREETYPE_CONFIG ?= $(TOOLCHAIN_DIR)/usr/mipsel-buildroot-linux-uclibc/sysroot/usr/bin/freetype-config
#GCW0_MK_SQUASH_FS ?= $(TOOLCHAIN_DIR)/usr/bin/mksquashfs
GCW0_MK_SQUASH_FS ?= mksquashfs
GCW0_INC_DIR ?= $(TOOLCHAIN_DIR)/usr/mipsel-buildroot-linux-uclibc/sysroot/usr/include
GCW0_LIB_DIR ?= $(TOOLCHAIN_DIR)/usr/mipsel-buildroot-linux-uclibc/sysroot/usr/lib
#########################
#########################
PACKAGE_NAME = retroarch
RETROFW = 1
DEBUG ?= 0
DINGUX = 1
HAVE_SCREENSHOTS = 0
HAVE_REWIND = 1
HAVE_7ZIP = 1
HAVE_AL = 0
# ALSA freezes when switching back from menu
HAVE_ALSA = 0
HAVE_DSP_FILTER = 1
HAVE_VIDEO_FILTER = 1
HAVE_STATIC_VIDEO_FILTERS = 1
HAVE_STATIC_AUDIO_FILTERS = 1
HAVE_FILTERS_BUILTIN = 1
HAVE_BUILTINMBEDTLS = 0
HAVE_BUILTINZLIB = 1
HAVE_C99 = 1
HAVE_CC = 1
HAVE_CC_RESAMPLER = 1
HAVE_CHD = 1
HAVE_COMMAND = 0
HAVE_CXX = 1
HAVE_DR_MP3 = 1
HAVE_DYNAMIC = 1
HAVE_EGL = 0
HAVE_FREETYPE = 0
HAVE_GDI = 1
HAVE_GETADDRINFO = 0
HAVE_GETOPT_LONG = 1
HAVE_GLSL = 0
HAVE_HID = 1
HAVE_IBXM = 1
HAVE_IMAGEVIEWER = 1
HAVE_LANGEXTRA = 0
HAVE_LIBRETRODB = 1
HAVE_MENU = 1
HAVE_MENU_COMMON = 1
HAVE_GFX_WIDGETS = 0
HAVE_MMAP = 1
HAVE_OPENDINGUX_FBDEV = 0
HAVE_OPENGL = 0
HAVE_OPENGL1 = 0
HAVE_OPENGLES = 0
HAVE_OPENGLES3 = 0
HAVE_OPENGL_CORE = 0
HAVE_OPENSSL = 1
HAVE_OVERLAY = 0
HAVE_RBMP = 1
HAVE_RJPEG = 1
HAVE_RPILED = 0
HAVE_RPNG = 1
HAVE_RUNAHEAD = 0
HAVE_SDL_DINGUX = 1
HAVE_SHADERPIPELINE = 0
HAVE_STB_FONT = 0
HAVE_STB_IMAGE = 1
HAVE_STB_VORBIS = 1
HAVE_STDIN_CMD = 0
HAVE_STRCASESTR = 1
HAVE_THREADS = 1
HAVE_UDEV = 0
HAVE_RGUI = 1
HAVE_MATERIALUI = 0
HAVE_XMB = 0
HAVE_OZONE = 0
HAVE_ZLIB = 1
HAVE_CONFIGFILE = 1
HAVE_PATCH = 1
HAVE_CHEATS = 1
HAVE_CHEEVOS = 0
HAVE_LIBSHAKE = 0
#comment out for now not working
#HAVE_OSS =1
#HAVE_OSS_LIB =1
OS = Linux
TARGET = retroarch
OPK_NAME = retroarch_retrofw.opk
OBJ :=
LINK := $(CXX)
DEF_FLAGS := -march=mips32 -mtune=mips32 -mhard-float -ffast-math -fomit-frame-pointer
DEF_FLAGS += -mplt -mno-shared
DEF_FLAGS += -ffunction-sections -fdata-sections
DEF_FLAGS += -I. -Ideps -Ideps/stb -DDINGUX=1 -DRETROFW=1 -MMD
DEF_FLAGS += -Wall -Wno-unused-variable -flto
DEF_FLAGS += -std=gnu99 -D_GNU_SOURCE
LIBS := -ldl -lz -lrt -pthread
CFLAGS :=
CXXFLAGS := -fno-exceptions -fno-rtti -std=c++11 -D__STDC_CONSTANT_MACROS
ASFLAGS :=
LDFLAGS := -Wl,--gc-sections
INCLUDE_DIRS = -I$(GCW0_INC_DIR)
LIBRARY_DIRS = -L$(GCW0_LIB_DIR)
DEFINES := -DRARCH_INTERNAL -D_FILE_OFFSET_BITS=64 -UHAVE_STATIC_DUMMY
DEFINES += -DHAVE_C99=1 -DHAVE_CXX=1
DEFINES += -DHAVE_GETOPT_LONG=1 -DHAVE_STRCASESTR=1 -DHAVE_DYNAMIC=1
DEFINES += -DHAVE_FILTERS_BUILTIN
SDL_DINGUX_CFLAGS := $(shell $(GCW0_SDL_CONFIG) --cflags)
SDL_DINGUX_LIBS := $(shell $(GCW0_SDL_CONFIG) --libs)
FREETYPE_CFLAGS := $(shell $(GCW0_FREETYPE_CONFIG) --cflags)
FREETYPE_LIBS := $(shell $(GCW0_FREETYPE_CONFIG) --libs)
MMAP_LIBS = -lc
OBJDIR_BASE := obj-unix
ifeq ($(DEBUG), 1)
OBJDIR := $(OBJDIR_BASE)/debug
DEF_FLAGS += -O0 -g -DDEBUG -D_DEBUG
else
OBJDIR := $(OBJDIR_BASE)/release
DEF_FLAGS += -O2 -DNDEBUG
endif
include Makefile.common
DEF_FLAGS += $(INCLUDE_DIRS)
LDFLAGS += $(CFLAGS) $(CXXFLAGS) $(DEF_FLAGS)
CFLAGS += $(DEF_FLAGS)
CXXFLAGS += $(DEF_FLAGS)
HEADERS = $(wildcard */*/*.h) $(wildcard */*.h) $(wildcard *.h)
Q := @
RARCH_OBJ := $(addprefix $(OBJDIR)/,$(OBJ))
define DESKTOP_ENTRY
[Desktop Entry]
Name=RetroArch
Comment=Frontend for emulators, game engines
Exec=retroarch
Terminal=false
Type=Application
StartupNotify=true
Icon=retroarch
Categories=emulators;
X-OD-NeedsDownscaling=true
endef
export DESKTOP_ENTRY
all: $(TARGET) opk
-include $(RARCH_OBJ:.o=.d)
SYMBOL_MAP := -Wl,-Map=output.map
$(TARGET): $(RARCH_OBJ)
@$(if $(Q), $(shell echo echo LD $@),)
$(Q)$(LINK) -o $@ $(RARCH_OBJ) $(LIBS) $(LDFLAGS) $(LIBRARY_DIRS)
$(OBJDIR)/%.o: %.c
@mkdir -p $(dir $@)
@$(if $(Q), $(shell echo echo CC $<),)
$(Q)$(CC) $(CPPFLAGS) $(CFLAGS) $(DEFINES) -c -o $@ $<
$(OBJDIR)/%.o: %.cpp
@mkdir -p $(dir $@)
@$(if $(Q), $(shell echo echo CXX $<),)
$(Q)$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) -MMD -c -o $@ $<
$(OBJDIR)/%.o: %.m
@mkdir -p $(dir $@)
@$(if $(Q), $(shell echo echo OBJC $<),)
$(Q)$(CXX) $(OBJCFLAGS) $(DEFINES) -MMD -c -o $@ $<
$(OBJDIR)/%.o: %.S $(HEADERS)
@mkdir -p $(dir $@)
@$(if $(Q), $(shell echo echo AS $<),)
$(Q)$(CC) $(CFLAGS) $(ASFLAGS) $(DEFINES) -c -o $@ $<
clean:
rm -rf $(OBJDIR_BASE)
rm -f $(TARGET)
rm -f *.d
rm -rf $(OPK_NAME)
opk: $(TARGET)
echo "$$DESKTOP_ENTRY" > default.retrofw.desktop
rm -f $(OPK_NAME)
cp media/ico_src/icon32.png retroarch.png
chmod +x retroarch
chmod 777 retroarch
ifeq ($(STRIP_BIN),1)
$(STRIP) --strip-unneeded retroarch
endif
$(GCW0_MK_SQUASH_FS) retroarch default.retrofw.desktop retroarch.png $(OPK_NAME) -all-root -no-xattrs -noappend -no-exports
rm -f default.retrofw.desktop retroarch.png
.PHONY: all clean opk
print-%:
@echo '$*=$($*)'
+3 -1
View File
@@ -219,7 +219,9 @@ opk: $(TARGET)
echo "$$DESKTOP_ENTRY" > default.gcw0.desktop
rm -f $(OPK_NAME)
cp media/ico_src/icon32.png retroarch.png
if [ $$STRIP_BIN -eq 1 ]; then $(STRIP) --strip-unneeded retroarch; fi
ifeq ($(STRIP_BIN),1)
$(STRIP) --strip-unneeded retroarch
endif
$(GCW0_MK_SQUASH_FS) retroarch default.gcw0.desktop retroarch.png $(OPK_NAME) -all-root -no-xattrs -noappend -no-exports
rm -f default.gcw0.desktop retroarch.png
+6 -3
View File
@@ -45,8 +45,7 @@ HAVE_SCREENSHOTS = 0
HAVE_REWIND = 1
HAVE_7ZIP = 1
HAVE_AL = 1
# ALSA freezes when switching back from menu
HAVE_ALSA = 0
HAVE_ALSA = 1
HAVE_DSP_FILTER = 1
HAVE_VIDEO_FILTER = 1
HAVE_STATIC_VIDEO_FILTERS = 1
@@ -121,6 +120,7 @@ DEF_FLAGS += -ffunction-sections -fdata-sections
DEF_FLAGS += -I. -Ideps -Ideps/stb -DDINGUX=1 -DDINGUX_BETA=1 -MMD
DEF_FLAGS += -Wall -Wno-unused-variable
DEF_FLAGS += -std=gnu99 -D_GNU_SOURCE -flto
DEF_FLAGS += -lasound
LIBS := -ldl -lz -lrt -ludev -pthread
CFLAGS :=
CXXFLAGS := -fno-exceptions -fno-rtti -std=c++11 -D__STDC_CONSTANT_MACROS
@@ -134,6 +134,7 @@ DEFINES += -DHAVE_GETOPT_LONG=1 -DHAVE_STRCASESTR=1 -DHAVE_DYNAMIC=1
DEFINES += -DHAVE_AL=1
DEFINES += -DHAVE_FILTERS_BUILTIN
DEFINES += -DHAVE_UDEV=1
DEFINES += -DHAVE_ALSA
SDL_DINGUX_CFLAGS := $(shell $(GCW0_SDL_CONFIG) --cflags)
SDL_DINGUX_LIBS := $(shell $(GCW0_SDL_CONFIG) --libs)
@@ -219,7 +220,9 @@ opk: $(TARGET)
echo "$$DESKTOP_ENTRY" > default.gcw0.desktop
rm -f $(OPK_NAME)
cp media/ico_src/icon32.png retroarch.png
if [ $$STRIP_BIN -eq 1 ]; then $(STRIP) --strip-unneeded retroarch; fi
ifeq ($(STRIP_BIN),1)
$(STRIP) --strip-unneeded retroarch
endif
$(GCW0_MK_SQUASH_FS) retroarch default.gcw0.desktop retroarch.png $(OPK_NAME) -all-root -no-xattrs -noappend -no-exports
rm -f default.gcw0.desktop retroarch.png
+234
View File
@@ -0,0 +1,234 @@
#########################
## Toolchain variables ##
#########################
# Alpha toolchain
TOOLCHAIN_DIR=/opt/rs90-toolchain
# All toolchain-related variables may be
# overridden via the command line
ifdef GCW0_CC
CC = $(GCW0_CC)
else
CC = $(TOOLCHAIN_DIR)/usr/bin/mipsel-rs90-linux-musl-gcc
endif
ifdef GCW0_CXX
CXX = $(GCW0_CXX)
else
CXX = $(TOOLCHAIN_DIR)/usr/bin/mipsel-rs90-linux-musl-g++
endif
ifdef GCW0_STRIP
STRIP = $(GCW0_STRIP)
else
STRIP = $(TOOLCHAIN_DIR)/usr/bin/mipsel-rs90-linux-musl-strip
endif
GCW0_SDL_CONFIG ?= $(TOOLCHAIN_DIR)/usr/mipsel-rs90-linux-musl/sysroot/usr/bin/sdl-config
GCW0_FREETYPE_CONFIG ?= $(TOOLCHAIN_DIR)/usr/mipsel-rs90-linux-musl/sysroot/usr/bin/freetype-config
GCW0_MK_SQUASH_FS ?= $(TOOLCHAIN_DIR)/usr/bin/mksquashfs
GCW0_INC_DIR ?= $(TOOLCHAIN_DIR)/usr/mipsel-rs90-linux-musl/sysroot/usr/include
GCW0_LIB_DIR ?= $(TOOLCHAIN_DIR)/usr/mipsel-rs90-linux-musl/sysroot/usr/lib
#########################
#########################
PACKAGE_NAME = retroarch
DEBUG ?= 0
RS90 = 1
DINGUX = 1
DINGUX_BETA = 1
HAVE_SCREENSHOTS = 0
HAVE_REWIND = 0
HAVE_7ZIP = 1
HAVE_AL = 0
HAVE_ALSA = 1
HAVE_DSP_FILTER = 1
HAVE_VIDEO_FILTER = 1
HAVE_STATIC_VIDEO_FILTERS = 1
HAVE_STATIC_AUDIO_FILTERS = 1
HAVE_FILTERS_BUILTIN = 1
HAVE_BUILTINMBEDTLS = 0
HAVE_BUILTINZLIB = 1
HAVE_C99 = 1
HAVE_CC = 1
HAVE_CC_RESAMPLER = 1
HAVE_CHD = 0
HAVE_COMMAND = 0
HAVE_CXX = 1
HAVE_DR_MP3 = 0
HAVE_DYNAMIC = 1
HAVE_EGL = 0
HAVE_FREETYPE = 0
HAVE_GDI = 0
HAVE_GETADDRINFO = 0
HAVE_GETOPT_LONG = 1
HAVE_GLSL = 0
HAVE_HID = 0
HAVE_IBXM = 0
HAVE_IMAGEVIEWER = 0
HAVE_LANGEXTRA = 0
HAVE_LIBRETRODB = 1
HAVE_MENU = 1
HAVE_MENU_COMMON = 1
HAVE_GFX_WIDGETS = 0
HAVE_MMAP = 1
HAVE_OPENDINGUX_FBDEV = 0
HAVE_OPENGL = 0
HAVE_OPENGL1 = 0
HAVE_OPENGLES = 0
HAVE_OPENGLES3 = 0
HAVE_OPENGL_CORE = 0
HAVE_OPENSSL = 0
HAVE_OVERLAY = 0
HAVE_RBMP = 1
HAVE_RJPEG = 1
HAVE_RPILED = 0
HAVE_RPNG = 1
HAVE_RUNAHEAD = 0
HAVE_SDL_DINGUX = 1
HAVE_SHADERPIPELINE = 0
HAVE_STB_FONT = 0
HAVE_STB_IMAGE = 0
HAVE_STB_VORBIS = 0
HAVE_STDIN_CMD = 0
HAVE_STRCASESTR = 1
HAVE_THREADS = 1
HAVE_UDEV = 1
HAVE_RGUI = 1
HAVE_MATERIALUI = 0
HAVE_XMB = 0
HAVE_OZONE = 0
HAVE_ZLIB = 1
HAVE_CONFIGFILE = 1
HAVE_PATCH = 1
HAVE_CHEATS = 1
HAVE_CHEEVOS = 0
HAVE_LIBSHAKE = 0
HAVE_TINYALSA = 1
HAVE_NEAREST_RESAMPLER = 1
OS = Linux
TARGET = retroarch
OPK_NAME = retroarch_rs90_odbeta.opk
OBJ :=
LINK := $(CXX)
DEF_FLAGS := -mplt -mno-shared
DEF_FLAGS += -ffunction-sections -fdata-sections
DEF_FLAGS += -I. -Ideps -Ideps/stb -DRS90=1 -DDINGUX=1 -DDINGUX_BETA=1 -MMD
DEF_FLAGS += -Wall -Wno-unused-variable
DEF_FLAGS += -std=gnu99 -D_GNU_SOURopendinguxCE -flto -lasound
LIBS := -ldl -lz -lrt -ludev -pthread
CFLAGS :=
CXXFLAGS := -fno-exceptions -fno-rtti -std=c++11 -D__STDC_CONSTANT_MACROS
ASFLAGS :=
LDFLAGS := -Wl,--gc-sections
INCLUDE_DIRS = -I$(GCW0_INC_DIR)
LIBRARY_DIRS = -L$(GCW0_LIB_DIR)
DEFINES := -DRARCH_INTERNAL -D_FILE_OFFSET_BITS=64 -UHAVE_STATIC_DUMMY
DEFINES += -DHAVE_C99=1 -DHAVE_CXX=1
DEFINES += -DHAVE_GETOPT_LONG=1 -DHAVE_STRCASESTR=1 -DHAVE_DYNAMIC=1
DEFINES += -DHAVE_FILTERS_BUILTIN
DEFINES += -DHAVE_UDEV=1
DEFINES += -DHAVE_ALSA
DEFINES += -DCC_RESAMPLER_PRECISION=0
SDL_DINGUX_CFLAGS := $(shell $(GCW0_SDL_CONFIG) --cflags)
SDL_DINGUX_LIBS := $(shell $(GCW0_SDL_CONFIG) --libs)
FREETYPE_CFLAGS := $(shell $(GCW0_FREETYPE_CONFIG) --cflags)
FREETYPE_LIBS := $(shell $(GCW0_FREETYPE_CONFIG) --libs)
MMAP_LIBS = -lc
OBJDIR_BASE := obj-unix
ifeq ($(DEBUG), 1)
OBJDIR := $(OBJDIR_BASE)/debug
DEF_FLAGS += -O0 -g -DDEBUG -D_DEBUG
else
OBJDIR := $(OBJDIR_BASE)/release
DEF_FLAGS += -Ofast -DNDEBUG
endif
include Makefile.common
DEF_FLAGS += $(INCLUDE_DIRS)
LDFLAGS += $(CFLAGS) $(CXXFLAGS) $(DEF_FLAGS)
CFLAGS += $(DEF_FLAGS)
CXXFLAGS += $(DEF_FLAGS)
HEADERS = $(wildcard */*/*.h) $(wildcard */*.h) $(wildcard *.h)
Q := @
RARCH_OBJ := $(addprefix $(OBJDIR)/,$(OBJ))
define DESKTOP_ENTRY
[Desktop Entry]
Name=RetroArch
Comment=Frontend for emulators, game engines
Exec=retroarch
Terminal=false
Type=Application
StartupNotify=true
Icon=retroarch
Categories=emulators;
X-OD-NeedsDownscaling=true
endef
export DESKTOP_ENTRY
all: $(TARGET) opk
-include $(RARCH_OBJ:.o=.d)
SYMBOL_MAP := -Wl,-Map=output.map
$(TARGET): $(RARCH_OBJ)
@$(if $(Q), $(shell echo echo LD $@),)
$(Q)$(LINK) -o $@ $(RARCH_OBJ) $(LIBS) $(LDFLAGS) $(LIBRARY_DIRS)
$(OBJDIR)/%.o: %.c
@mkdir -p $(dir $@)
@$(if $(Q), $(shell echo echo CC $<),)
$(Q)$(CC) $(CPPFLAGS) $(CFLAGS) $(DEFINES) -c -o $@ $<
$(OBJDIR)/%.o: %.cpp
@mkdir -p $(dir $@)
@$(if $(Q), $(shell echo echo CXX $<),)
$(Q)$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) -MMD -c -o $@ $<
$(OBJDIR)/%.o: %.m
@mkdir -p $(dir $@)
@$(if $(Q), $(shell echo echo OBJC $<),)
$(Q)$(CXX) $(OBJCFLAGS) $(DEFINES) -MMD -c -o $@ $<
$(OBJDIR)/%.o: %.S $(HEADERS)
@mkdir -p $(dir $@)
@$(if $(Q), $(shell echo echo AS $<),)
$(Q)$(CC) $(CFLAGS) $(ASFLAGS) $(DEFINES) -c -o $@ $<
clean:
rm -rf $(OBJDIR_BASE)
rm -f $(TARGET)
rm -f *.d
rm -rf $(OPK_NAME)
opk: $(TARGET)
echo "$$DESKTOP_ENTRY" > default.rs90.desktop
rm -f $(OPK_NAME)
cp media/ico_src/icon32.png retroarch.png
ifeq ($STRIP_BIN, 1)
$(STRIP) --strip-unneeded retroarch
endif
$(GCW0_MK_SQUASH_FS) retroarch default.rs90.desktop retroarch.png $(OPK_NAME) -all-root -no-xattrs -noappend -no-exports
rm -f default.rs90.desktop retroarch.png
.PHONY: all clean opk
print-%:
@echo '$*=$($*)'
+6 -3
View File
@@ -13,7 +13,7 @@ PC_DEVELOPMENT_UDP_PORT =
OBJ :=
SCE_LIBC_SIZE := 4194304
DEFINES := -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_ASSETS
DEFINES := -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_ASSETS -DHAVE_STB_VORBIS
INCDIRS :=
ifeq ($(GRIFFIN_BUILD), 1)
@@ -31,7 +31,6 @@ else
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
@@ -112,7 +111,11 @@ LD := $(CXX)
LIBDIRS := -L.
ARCHFLAGS := -march=armv7-a -mfpu=neon -mfloat-abi=hard -DVITA -DSCE_LIBC_SIZE=$(SCE_LIBC_SIZE)
ARCHFLAGS := -march=armv7-a -mfpu=neon -mfloat-abi=hard -DVITA
ifeq ($(HAVE_VITAGLES), 1)
ARCHFLAGS += -DSCE_LIBC_SIZE=$(SCE_LIBC_SIZE)
endif
CFLAGS += $(ARCHFLAGS) -mword-relocations -fno-optimize-sibling-calls
ifeq ($(DEBUG), 1)
+242
View File
@@ -0,0 +1,242 @@
include version.all
$(call assert,$(call seq,$(TARGET_PREFIX),arm-webos-linux-gnueabi-),webOS SDK isn't setup properly. See https://github.com/webosbrew/meta-lg-webos-ndk#compile-program-by-command-line)
WEBOS_FREETYPE_CONFIG ?= $(SDKTARGETSYSROOT)/usr/bin/freetype-config
WEBOS_INC_DIR ?= $(SDKTARGETSYSROOT)/usr/include
WEBOS_LIB_DIR ?= $(SDKTARGETSYSROOT)/usr/lib
#########################
#########################
PACKAGE_NAME = com.retroarch
PACKAGE_VERSION := $(patsubst "%",%,$(RARCH_VERSION))
DEBUG ?= 0
HAVE_SCREENSHOTS = 0
HAVE_REWIND = 1
HAVE_7ZIP = 1
HAVE_ACCESSIBILITY = 1
HAVE_AL = 0
# ALSA freezes when switching back from menu
HAVE_ALSA = 0
HAVE_ANGLE = 0
HAVE_AUDIOIO = 0
HAVE_AUDIOMIXER = 1
HAVE_BLISSBOX = 0
HAVE_BSV_MOVIE = 1
HAVE_BUILTINBEARSSL = 0
HAVE_BUILTINFLAC = 1
HAVE_DSP_FILTER = 1
HAVE_VIDEO_FILTER = 1
HAVE_STATIC_VIDEO_FILTERS = 1
HAVE_STATIC_AUDIO_FILTERS = 1
HAVE_FILTERS_BUILTIN = 1
HAVE_BUILTINMBEDTLS = 1
HAVE_BUILTINZLIB = 1
HAVE_C99 = 1
HAVE_CC = 1
HAVE_CC_RESAMPLER = 1
HAVE_NEAREST_RESAMPLER = 1
HAVE_CHD = 1
HAVE_COMMAND = 1
HAVE_CXX = 1
HAVE_DR_MP3 = 1
HAVE_DYNAMIC = 1
HAVE_DYLIB = 1
HAVE_EGL = 0
HAVE_FREETYPE = 0
HAVE_GDI = 1
HAVE_GETADDRINFO = 1
HAVE_GETOPT_LONG = 1
HAVE_GLSL = 1
HAVE_GLSLANG = 0
HAVE_GLSLANG_HLSL = 0
HAVE_GLSLANG_OGLCOMPILER = 0
HAVE_GLSLANG_OSDEPENDENT = 0
HAVE_GLSLANG_SPIRV = 0
HAVE_GLSLANG_SPIRV_TOOLS = 0
HAVE_GLSLANG_SPIRV_TOOLS_OPT = 0
HAVE_HID = 1
HAVE_IBXM = 1
HAVE_IMAGEVIEWER = 1
HAVE_LANGEXTRA = 1
HAVE_LIBRETRODB = 1
HAVE_MENU = 1
HAVE_MENU_COMMON = 1
HAVE_NEON = 1
HAVE_NETPLAYDISCOVERY = 1
HAVE_NETPLAYDISCOVERY = 1
HAVE_NETWORK_CMD = 1
HAVE_NETWORKGAMEPAD = 1
HAVE_NETWORKING = 1
HAVE_GFX_WIDGETS = 1
HAVE_MMAP = 1
HAVE_ONLINE_UPDATER = 1
HAVE_OPENDINGUX_FBDEV = 0
HAVE_OPENGL = 0
HAVE_OPENGL1 = 0
HAVE_OPENGL_CORE = 0
HAVE_OPENGLES = 1
HAVE_OPENGLES3 = 0
HAVE_OPENGLES3_1 = 0
HAVE_OPENGLES3_2 = 0
HAVE_OPENSSL = 0
HAVE_OVERLAY = 1
HAVE_PULSE = 1
HAVE_RBMP = 1
HAVE_RJPEG = 1
HAVE_RPILED = 0
HAVE_RPNG = 1
HAVE_RUNAHEAD = 1
HAVE_SDL = 0
HAVE_SDL2 = 1
HAVE_SHADERPIPELINE = 1
HAVE_STB_FONT = 1
HAVE_STB_IMAGE = 1
HAVE_STB_VORBIS = 1
HAVE_STDIN_CMD = 0
HAVE_STRCASESTR = 1
HAVE_THREADS = 1
HAVE_UDEV = 0
HAVE_RGUI = 1
HAVE_MATERIALUI = 0
HAVE_XMB = 1
HAVE_OZONE = 1
HAVE_ZLIB = 1
HAVE_CONFIGFILE = 1
HAVE_PATCH = 1
HAVE_CHEATS = 1
HAVE_CHEEVOS = 1
HAVE_LIBSHAKE = 1
HAVE_UPDATE_ASSETS = 1
HAVE_UPDATE_CORES = 1
OS = Linux
TARGET = retroarch
OBJ :=
LINK := $(CXX)
DEF_FLAGS += -ffunction-sections -fdata-sections
DEF_FLAGS += -I. -Ideps -Ideps/stb -DWEBOS=1 -MMD
DEF_FLAGS += -Wall -Wno-unused-variable
LIBS := -ldl -lz -lrt -pthread
CFLAGS :=
CXXFLAGS := -fno-exceptions -fno-rtti -std=c++11 -D__STDC_CONSTANT_MACROS
ASFLAGS :=
LDFLAGS := -Wl,--gc-sections
INCLUDE_DIRS = -I$(WEBOS_INC_DIR)
LIBRARY_DIRS = -L$(WEBOS_LIB_DIR)
DEFINES := -DRARCH_INTERNAL -D_FILE_OFFSET_BITS=64 -UHAVE_STATIC_DUMMY
DEFINES += -DHAVE_C99=1 -DHAVE_CXX=1 -D_GNU_SOURCE
DEFINES += -DHAVE_GETOPT_LONG=1 -DHAVE_STRCASESTR=1 -DHAVE_DYNAMIC=1
DEFINES += -DHAVE_FILTERS_BUILTIN
DEFINES += -DHAVE_SDL2
DEFINES += -DHAVE_PULSE
DEFINES += -DHAVE_NETWORKING -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_ASSETS -DHAVE_UPDATE_CORES
SDL2_CFLAGS := $(shell pkg-config --cflags sdl2)
SDL2_LIBS := $(shell pkg-config --libs sdl2)
OPENGLES_LIBS = -lGLESv2
PULSE_LIBS = $(shell pkg-config --libs libpulse)
MMAP_LIBS = -lc
NEON_CFLAGS = -mfpu=neon
NEON_ASFLAGS = -mfpu=neon
NETWORKING_LIBS = -lc
OBJDIR_BASE := obj-unix
ifeq ($(DEBUG), 1)
OBJDIR := $(OBJDIR_BASE)/debug
DEF_FLAGS += -O0 -g -DDEBUG -D_DEBUG
else
OBJDIR := $(OBJDIR_BASE)/release
DEF_FLAGS += -O2 -DNDEBUG
endif
include Makefile.common
DEF_FLAGS += $(INCLUDE_DIRS)
LDFLAGS += $(CFLAGS) $(CXXFLAGS) $(DEF_FLAGS)
CFLAGS += $(DEF_FLAGS)
CXXFLAGS += $(DEF_FLAGS)
HEADERS = $(wildcard */*/*.h) $(wildcard */*.h) $(wildcard *.h)
Q := @
RARCH_OBJ := $(addprefix $(OBJDIR)/,$(OBJ))
define APPINFO
{
"id": "$(PACKAGE_NAME)",
"version": "$(PACKAGE_VERSION)",
"vendor": "webosbrew.org",
"title": "RetroArch",
"icon": "icon160.png",
"main": "retroarch",
"iconColor": "#333333",
"type": "native",
"appDescription": "Emulation frontend"
}
endef
export APPINFO
all: $(TARGET) ipk
-include $(RARCH_OBJ:.o=.d)
SYMBOL_MAP := -Wl,-Map=output.map
$(TARGET): $(RARCH_OBJ)
@$(if $(Q), $(shell echo echo LD $@),)
$(Q)$(LINK) -o $@ $(RARCH_OBJ) $(LIBS) $(LDFLAGS) $(LIBRARY_DIRS)
$(OBJDIR)/%.o: %.c
@mkdir -p $(dir $@)
@$(if $(Q), $(shell echo echo CC $<),)
$(Q)$(CC) $(CPPFLAGS) $(CFLAGS) $(DEFINES) -c -o $@ $<
$(OBJDIR)/%.o: %.cpp
@mkdir -p $(dir $@)
@$(if $(Q), $(shell echo echo CXX $<),)
$(Q)$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) -MMD -c -o $@ $<
$(OBJDIR)/%.o: %.m
@mkdir -p $(dir $@)
@$(if $(Q), $(shell echo echo OBJC $<),)
$(Q)$(CXX) $(OBJCFLAGS) $(DEFINES) -MMD -c -o $@ $<
$(OBJDIR)/%.o: %.S $(HEADERS)
@mkdir -p $(dir $@)
@$(if $(Q), $(shell echo echo AS $<),)
$(Q)$(CC) $(CFLAGS) $(ASFLAGS) $(DEFINES) -c -o $@ $<
clean:
rm -rf $(OBJDIR_BASE)
rm -f $(TARGET)
rm -f *.d
rm -rf webos/*.ipk
rm -rf webos/dist
ipk: $(TARGET)
rm -rf webos/dist
mkdir -p webos/dist/lib
echo "$$APPINFO" > webos/dist/appinfo.json
cp -t webos/dist -vf $(TARGET) webos/icon160.png
cp -t webos/dist/lib -vf $(WEBOS_LIB_DIR)/libstdc++.so.6
$(STRIP) webos/dist/$(TARGET)
cd webos && ares-package dist
install: ipk
ares-install webos/$(PACKAGE_NAME)_$(PACKAGE_VERSION)_$(ARCH).ipk
launch: install
ares-launch com.retroarch
.PHONY: all clean ipk
print-%:
@echo '$*=$($*)'
+1 -1
View File
@@ -131,7 +131,7 @@ RARCH_CONSOLE = 1
#HAVE_LANGEXTRA := 1
HAVE_WIIUSB_HID := 1
HAVE_RARCH_EXEC := 1
HAVE_RSOUND := 1
HAVE_RSOUND := 0
APP_BOOTER_DIR = wii/app_booter
PLATOBJS := $(APP_BOOTER_DIR)/app_booter.binobj
+15 -5
View File
@@ -11,6 +11,7 @@ HAVE_RUNAHEAD = 1
WIIU_LOG_RPX = 0
BUILD_DIR = objs/wiiu
PC_DEVELOPMENT_TCP_PORT ?=
LOAD_WITHOUT_CORE_INFO ?= 0
ifeq ($(SALAMANDER_BUILD),1)
BUILD_DIR := $(BUILD_DIR)-salamander
@@ -85,6 +86,9 @@ else
ifeq ($(HAVE_RUNAHEAD),1)
DEFINES += -DHAVE_RUNAHEAD
endif
ifeq ($(LOAD_WITHOUT_CORE_INFO),1)
DEFINES += -DLOAD_WITHOUT_CORE_INFO
endif
OBJ += wiiu/shader_utils.o
OBJ += gfx/drivers/gx2_shaders/tex.o
@@ -102,7 +106,7 @@ endif
INCDIRS += -Ilibretro-common/include/compat/zlib
# for stb, libfat, iosuhax
INCDIRS += -Ideps -Ideps/libfat/include -Ideps/libiosuhax
INCDIRS += -Ideps -Ideps/libfat/include -Ideps/libiosuhax/include
# pad_functions uses wiiu/input.h
INCDIRS += -Iinput/include
INCDIRS += -Ideps/SPIRV-Cross
@@ -327,17 +331,23 @@ $(BUILD_DIR)/$(TARGET).rpx.elf: $(OBJ) $(RPX_OBJ) libretro_wiiu.a wiiu/link_elf.
@$(if $(Q), echo LD $@,)
$(Q)$(LD) $(OBJ) $(RPX_OBJ) $(LDFLAGS) $(RPX_LDFLAGS) $(LIBDIRS) $(LIBS) -o $@
$(BUILD_DIR)/$(TARGET).rpx: $(BUILD_DIR)/$(TARGET).rpx.elf $(ELF2RPL) .$(TARGET).rpx.last
$(BUILD_DIR)/$(TARGET).large.rpx: $(BUILD_DIR)/$(TARGET).rpx.elf $(ELF2RPL) .$(TARGET).rpx.large.last
@$(if $(Q), echo ELF2RPL $@,)
@touch .$(TARGET).rpx.last
@touch .$(TARGET).rpx.large.last
$(Q)-$(ELF2RPL) $< $@
$(BUILD_DIR)/$(TARGET).rpx: $(BUILD_DIR)/$(TARGET).large.rpx .$(TARGET).rpx.last
@$(if $(Q), echo COMPRESS $@,)
@touch .$(TARGET).rpx.large.last
$(Q)wiiurpxtool -c $< $@
clean:
@$(if $(Q), echo $@,)
$(Q)rm -f $(OBJ) $(RPX_OBJ) $(HBL_ELF_OBJ) $(TARGET).elf $(TARGET).rpx.elf $(TARGET).rpx
$(Q)rm -f $(BUILD_DIR)/$(TARGET).elf $(BUILD_DIR)/$(TARGET).rpx.elf $(BUILD_DIR)/$(TARGET).rpx
$(Q)rm -f .$(TARGET).elf.last .$(TARGET).rpx.elf.last .$(TARGET).rpx.last
$(Q)rm -f $(BUILD_DIR)/$(TARGET).elf $(BUILD_DIR)/$(TARGET).rpx.elf $(BUILD_DIR)/$(TARGET).large.rpx $(BUILD_DIR)/$(TARGET).rpx
$(Q)rm -f .$(TARGET).elf.last .$(TARGET).rpx.elf.last .$(TARGET).rpx.large.last .$(TARGET).rpx.last
$(Q)rm -f $(OBJ:.o=.depend) $(RPX_OBJ:.o=.depend) $(HBL_ELF_OBJ:.o=.depend)
$(Q)$(MAKE) -C wiiu/wut/elf2rpl/ clean
.PHONY: clean all
.PRECIOUS: %.depend %.last
+2 -1
View File
@@ -546,7 +546,8 @@ static ssize_t dsound_write(void *data, const void *buf_, size_t size)
break;
if (avail == 0)
WaitForSingleObject(ds->event, INFINITE);
if (!(WaitForSingleObject(ds->event, 50) == WAIT_OBJECT_0))
return -1;
}
}
+1 -1
View File
@@ -49,7 +49,7 @@ static void *rwebaudio_init(const char *device, unsigned rate, unsigned latency,
rweb_audio_t *rwebaudio = (rweb_audio_t*)calloc(1, sizeof(rweb_audio_t));
if (!rwebaudio)
return NULL;
if (RWebAudioInit(latency) == 1)
if (RWebAudioInit(latency))
*new_rate = RWebAudioSampleRate();
return rwebaudio;
}
@@ -144,7 +144,7 @@ static void *libnx_audren_thread_audio_init(const char *device, unsigned rate, u
int mpid;
size_t mempool_size;
unsigned real_latency;
uint32_t thread_priority;
int32_t thread_priority;
RARCH_LOG("[Audio]: Using libnx_audren_thread driver\n");
+1 -1
View File
@@ -141,7 +141,7 @@ static void *switch_thread_audio_init(const char *device, unsigned rate, unsigne
{
Result rc;
unsigned i;
uint32_t prio;
int32_t prio;
#ifndef HAVE_LIBNX
char names[8][0x20];
uint32_t num_names = 0;
+1 -1
View File
@@ -736,7 +736,7 @@ static ssize_t wasapi_write_ex(wasapi_t *w, const void * data, size_t size, DWOR
if (!write_avail)
{
if (WaitForSingleObject(w->write_event, ms) != WAIT_OBJECT_0)
return -1;
return 0;
if (!wasapi_flush_buffer(w, w->engine_buffer_size))
return -1;
+2 -1
View File
@@ -371,7 +371,8 @@ static ssize_t xa_write(void *data, const void *buf, size_t size)
XAUDIO2_BUFFER xa2buffer;
while (handle->buffers == MAX_BUFFERS - 1)
WaitForSingleObject(handle->hEvent, INFINITE);
if (!(WaitForSingleObject(handle->hEvent, 50) == WAIT_OBJECT_0))
return -1;
xa2buffer.Flags = 0;
xa2buffer.AudioBytes = handle->bufsize;
+4 -4
View File
@@ -29,9 +29,9 @@
#include <audio/audio_resampler.h>
#if (defined(__ARM_NEON__) && !defined(DONT_WANT_ARM_OPTIMIZATIONS)) || defined(HAVE_NEON)
#ifndef HAVE_ARM_NEON_OPTIMIZATIONS
#define HAVE_ARM_NEON_OPTIMIZATIONS
#if (defined(__ARM_NEON__) && !defined(DONT_WANT_ARM_ASM_OPTIMIZATIONS)) || defined(HAVE_NEON)
#ifndef HAVE_ARM_NEON_ASM_OPTIMIZATIONS
#define HAVE_ARM_NEON_ASM_OPTIMIZATIONS
#endif
#endif
@@ -350,7 +350,7 @@ static void resampler_CC_upsample(void *re_, struct resampler_data *data)
data->output_frames = outp - (audio_frame_float_t*)data->data_out;
}
#elif defined(HAVE_ARM_NEON_OPTIMIZATIONS)
#elif defined(HAVE_ARM_NEON_ASM_OPTIMIZATIONS)
#define CC_RESAMPLER_IDENT "NEON"
+6 -6
View File
@@ -1341,8 +1341,8 @@ void cheat_manager_apply_rumble(struct item_cheat *cheat, unsigned int curr_valu
{
cheat->rumble_primary_end_time = current_time + (cheat->rumble_primary_duration * 1000);
cheat->rumble_secondary_end_time = current_time + (cheat->rumble_secondary_duration * 1000);
input_driver_set_rumble_state(cheat->rumble_port, RETRO_RUMBLE_STRONG, cheat->rumble_primary_strength);
input_driver_set_rumble_state(cheat->rumble_port, RETRO_RUMBLE_WEAK, cheat->rumble_secondary_strength);
input_set_rumble_state(cheat->rumble_port, RETRO_RUMBLE_STRONG, cheat->rumble_primary_strength);
input_set_rumble_state(cheat->rumble_port, RETRO_RUMBLE_WEAK, cheat->rumble_secondary_strength);
}
}
else
@@ -1354,24 +1354,24 @@ void cheat_manager_apply_rumble(struct item_cheat *cheat, unsigned int curr_valu
if (cheat->rumble_primary_end_time <= current_time)
{
if (cheat->rumble_primary_end_time != 0)
input_driver_set_rumble_state(cheat->rumble_port,
input_set_rumble_state(cheat->rumble_port,
RETRO_RUMBLE_STRONG, 0);
cheat->rumble_primary_end_time = 0;
}
else
{
input_driver_set_rumble_state(cheat->rumble_port,
input_set_rumble_state(cheat->rumble_port,
RETRO_RUMBLE_STRONG, cheat->rumble_primary_strength);
}
if (cheat->rumble_secondary_end_time <= current_time)
{
if (cheat->rumble_secondary_end_time != 0)
input_driver_set_rumble_state(cheat->rumble_port, RETRO_RUMBLE_WEAK, 0);
input_set_rumble_state(cheat->rumble_port, RETRO_RUMBLE_WEAK, 0);
cheat->rumble_secondary_end_time = 0;
}
else
input_driver_set_rumble_state(cheat->rumble_port, RETRO_RUMBLE_WEAK, cheat->rumble_secondary_strength);
input_set_rumble_state(cheat->rumble_port, RETRO_RUMBLE_WEAK, cheat->rumble_secondary_strength);
}
void cheat_manager_apply_retro_cheats(void)
-91
View File
@@ -1,91 +0,0 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2015-2016 - Andre Leiradella
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include <file/file_path.h>
#include "../file_path_special.h"
#include "../configuration.h"
#include "../gfx/gfx_display.h"
#include "badges.h"
#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)
{
int index;
for (index = 0; index < CHEEVOS_MENU_BADGE_LIMIT; ++index)
{
if (cheevos_badge_menu_texture_list[index])
video_driver_texture_unload(&cheevos_badge_menu_texture_list[index]);
}
memset(&cheevos_badge_menu_texture_list, 0,
sizeof(cheevos_badge_menu_texture_list));
}
void cheevos_set_menu_badge(int index, const char *badge, bool locked)
{
settings_t *settings = config_get_ptr();
if (index >= CHEEVOS_MENU_BADGE_LIMIT)
return;
if (!settings || !settings->bools.cheevos_badges_enable)
cheevos_badge_menu_texture_list[index] = 0;
else
cheevos_badge_menu_texture_list[index] =
cheevos_get_badge_texture(badge, locked);
}
uintptr_t cheevos_get_menu_badge_texture(int index)
{
if (index < CHEEVOS_MENU_BADGE_LIMIT)
return cheevos_badge_menu_texture_list[index];
return 0;
}
#endif
uintptr_t cheevos_get_badge_texture(const char *badge, bool locked)
{
char badge_file[24];
char fullpath[PATH_MAX_LENGTH];
uintptr_t tex = 0;
if (!badge)
return 0;
fullpath[0] = badge_file[0] = '\0';
strlcpy(badge_file, badge, sizeof(badge_file));
if (locked)
strlcat(badge_file, "_lock", sizeof(badge_file));
strlcat(badge_file, FILE_PATH_PNG_EXTENSION, sizeof(badge_file));
fill_pathname_application_special(fullpath, sizeof(fullpath),
APPLICATION_SPECIAL_DIRECTORY_THUMBNAILS_CHEEVOS_BADGES);
if (!gfx_display_reset_textures_list(badge_file, fullpath,
&tex, TEXTURE_FILTER_MIPMAP_LINEAR, NULL, NULL))
tex = 0;
return tex;
}
+278 -1107
View File
File diff suppressed because it is too large. Load diff
+7 -32
View File
@@ -21,64 +21,39 @@
#include <boolean.h>
#include "../verbosity.h"
#include <retro_common_api.h>
RETRO_BEGIN_DECLS
typedef struct rcheevos_ctx_desc
{
unsigned idx;
char *s;
size_t len;
} rcheevos_ctx_desc_t;
enum
{
RCHEEVOS_ACTIVE_SOFTCORE = 1 << 0,
RCHEEVOS_ACTIVE_HARDCORE = 1 << 1,
RCHEEVOS_ACTIVE_UNOFFICIAL = 1 << 2
};
bool rcheevos_load(const void *data);
size_t rcheevos_get_serialize_size(void);
bool rcheevos_get_serialized_data(void* buffer);
bool rcheevos_set_serialized_data(void* buffer);
void rcheevos_reset_game(bool widgets_ready);
void rcheevos_populate_menu(void* data);
void rcheevos_populate_hardcore_pause_menu(void* data);
void rcheevos_get_achievement_state(unsigned index, char* buffer, size_t buffer_size);
bool rcheevos_get_description(rcheevos_ctx_desc_t *desc);
void rcheevos_pause_hardcore(void);
bool rcheevos_unload(void);
void rcheevos_test(void);
void rcheevos_reset_game(bool widgets_ready);
void rcheevos_pause_hardcore(void);
void rcheevos_hardcore_enabled_changed(void);
void rcheevos_toggle_hardcore_paused(void);
bool rcheevos_hardcore_active(void);
void rcheevos_validate_config_settings(void);
void rcheevos_leaderboards_enabled_changed(void);
void rcheevos_test(void);
void rcheevos_set_support_cheevos(bool state);
bool rcheevos_get_support_cheevos(void);
const char* rcheevos_get_hash(void);
int rcheevos_get_richpresence(char buffer[], int buffer_size);
uintptr_t rcheevos_get_badge_texture(const char *badge, bool locked);
uint8_t* rcheevos_patch_address(unsigned address);
bool rcheevos_hardcore_active(void);
RETRO_END_DECLS
#endif /* __RARCH_CHEEVOS_CHEEVOS_H */
+675
View File
@@ -0,0 +1,675 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2019-2021 - Brian Weiss
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include "cheevos_client.h"
#include "cheevos.h"
#include "../configuration.h"
#include "../paths.h"
#include "../version.h"
#include <string/stdstring.h>
#include <features/features_cpu.h>
#include "../frontend/frontend_driver.h"
#include "../network/net_http_special.h"
#include "../tasks/tasks_internal.h"
#ifdef HAVE_DISCORD
#include "../network/discord.h"
#endif
#include "../deps/rcheevos/include/rc_api_runtime.h"
/* Define this macro to log URLs. */
#undef CHEEVOS_LOG_URLS
/* Define this macro to have the password and token logged.
* THIS WILL DISCLOSE THE USER'S PASSWORD, TAKE CARE! */
#undef CHEEVOS_LOG_PASSWORD
/* Number of usecs to wait between posting rich presence to the site. */
/* Keep consistent with SERVER_PING_FREQUENCY from RAIntegration. */
#define CHEEVOS_PING_FREQUENCY 2 * 60 * 1000000
/****************************
* data types *
****************************/
enum rcheevos_async_io_type
{
CHEEVOS_ASYNC_RICHPRESENCE = 0,
CHEEVOS_ASYNC_AWARD_ACHIEVEMENT,
CHEEVOS_ASYNC_SUBMIT_LBOARD
};
typedef void (*rcheevos_async_handler)(int id,
http_transfer_data_t *data, char buffer[], size_t buffer_size);
typedef struct rcheevos_async_io_request
{
rc_api_request_t request;
rcheevos_async_handler handler;
int id;
int attempt_count;
const char* success_message;
const char* failure_message;
const char* user_agent;
char type;
} rcheevos_async_io_request;
/****************************
* forward declarations *
****************************/
static retro_time_t rcheevos_client_prepare_ping(rcheevos_async_io_request* request);
static void rcheevos_async_http_task_callback(
retro_task_t* task, void* task_data, void* user_data, const char* error);
/****************************
* user agent construction *
****************************/
static int append_no_spaces(char* buffer, char* stop, const char* text)
{
char* ptr = buffer;
while (ptr < stop && *text)
{
if (*text == ' ')
{
*ptr++ = '_';
++text;
}
else
{
*ptr++ = *text++;
}
}
*ptr = '\0';
return (int)(ptr - buffer);
}
void rcheevos_get_user_agent(rcheevos_locals_t *locals,
char *buffer, size_t len)
{
struct retro_system_info *system = runloop_get_libretro_system_info();
char* ptr;
/* if we haven't calculated the non-changing portion yet, do so now
* [retroarch version + os version] */
if (!locals->user_agent_prefix[0])
{
const frontend_ctx_driver_t *frontend = frontend_get_ptr();
int major, minor;
char tmp[64];
if (frontend && frontend->get_os)
{
frontend->get_os(tmp, sizeof(tmp), &major, &minor);
snprintf(locals->user_agent_prefix, sizeof(locals->user_agent_prefix),
"RetroArch/%s (%s %d.%d)", PACKAGE_VERSION, tmp, major, minor);
}
else
{
snprintf(locals->user_agent_prefix, sizeof(locals->user_agent_prefix),
"RetroArch/%s", PACKAGE_VERSION);
}
}
/* append the non-changing portion */
ptr = buffer + strlcpy(buffer, locals->user_agent_prefix, len);
/* if a core is loaded, append its information */
if (system && !string_is_empty(system->library_name))
{
char* stop = buffer + len - 1;
const char* path = path_get(RARCH_PATH_CORE);
*ptr++ = ' ';
if (!string_is_empty(path))
{
append_no_spaces(ptr, stop, path_basename(path));
path_remove_extension(ptr);
ptr += strlen(ptr);
}
else
{
ptr += append_no_spaces(ptr, stop, system->library_name);
}
if (system->library_version)
{
*ptr++ = '/';
ptr += append_no_spaces(ptr, stop, system->library_version);
}
}
*ptr = '\0';
}
#ifdef CHEEVOS_LOG_URLS
#ifndef CHEEVOS_LOG_PASSWORD
static void rcheevos_filter_url_param(char* url, char* param)
{
char *next;
size_t param_len = strlen(param);
char *start = strchr(url, '?');
if (!start)
start = url;
else
++start;
do
{
next = strchr(start, '&');
if (start[param_len] == '=' && memcmp(start, param, param_len) == 0)
{
if (next)
strcpy_literal(start, next + 1);
else if (start > url)
start[-1] = '\0';
else
*start = '\0';
return;
}
if (!next)
return;
start = next + 1;
} while (1);
}
#endif
#endif
void rcheevos_log_url(const char* api, const char* url)
{
#ifdef CHEEVOS_LOG_URLS
#ifdef CHEEVOS_LOG_PASSWORD
CHEEVOS_LOG(RCHEEVOS_TAG "GET %s\n", url);
#else
char copy[256];
strlcpy(copy, url, sizeof(copy));
rcheevos_filter_url_param(copy, "p");
rcheevos_filter_url_param(copy, "t");
CHEEVOS_LOG(RCHEEVOS_TAG "GET %s\n", copy);
#endif
#else
(void)api;
(void)url;
#endif
}
static void rcheevos_log_post_url(const char* url, const char* post)
{
#ifdef CHEEVOS_LOG_URLS
#ifdef CHEEVOS_LOG_PASSWORD
if (post && post[0])
CHEEVOS_LOG(RCHEEVOS_TAG "POST %s %s\n", url, post);
else
CHEEVOS_LOG(RCHEEVOS_TAG "POST %s\n", url);
#else
if (post && post[0])
{
char post_copy[2048];
strlcpy(post_copy, post, sizeof(post_copy));
rcheevos_filter_url_param(post_copy, "p");
rcheevos_filter_url_param(post_copy, "t");
if (post_copy[0])
CHEEVOS_LOG(RCHEEVOS_TAG "POST %s %s\n", url, post_copy);
else
CHEEVOS_LOG(RCHEEVOS_TAG "POST %s\n", url);
}
else
{
CHEEVOS_LOG(RCHEEVOS_TAG "POST %s\n", url);
}
#endif
#else
(void)url;
(void)post;
#endif
}
/****************************
* dispatch *
****************************/
static void rcheevos_async_retry_request(retro_task_t* task)
{
rcheevos_async_io_request* request = (rcheevos_async_io_request*)
task->user_data;
/* the timer task has done its job. let it dispose itself */
task_set_finished(task, 1);
/* start a new task for the HTTP call */
task_push_http_post_transfer_with_user_agent(request->request.url,
request->request.post_data, true, "POST", request->user_agent,
rcheevos_async_http_task_callback, request);
}
static void rcheevos_async_retry_request_after_delay(rcheevos_async_io_request* request, const char* error)
{
retro_task_t* task = task_init();
/* Double the wait between each attempt until we hit
* a maximum delay of two minutes.
* 250ms -> 500ms -> 1s -> 2s -> 4s -> 8s -> 16s -> 32s -> 64s -> 120s -> 120s... */
retro_time_t retry_delay = (request->attempt_count > 8)
? (120 * 1000 * 1000)
: ((250 * 1000) << request->attempt_count);
CHEEVOS_ERR(RCHEEVOS_TAG "%s %u: %s (automatic retry in %dms)\n", request->failure_message,
request->id, error, (int)retry_delay / 1000);
task->when = cpu_features_get_time_usec() + retry_delay;
task->handler = rcheevos_async_retry_request;
task->user_data = request;
task->progress = -1;
++request->attempt_count;
task_queue_push(task);
}
static void rcheevos_async_request_failed(rcheevos_async_io_request* request, const char* error)
{
if (request->type == CHEEVOS_ASYNC_RICHPRESENCE && request->attempt_count > 0)
{
/* only retry the ping once (in case of network hiccup), otherwise let
* the timer handle it after the normal ping period has elapsed */
CHEEVOS_ERR(RCHEEVOS_TAG "%s %u: %s\n", request->failure_message,
request->id, error);
}
else
{
/* automatically retry the request */
rcheevos_async_retry_request_after_delay(request, error);
}
}
static void rcheevos_async_http_task_callback(
retro_task_t* task, void* task_data, void* user_data, const char* error)
{
rcheevos_async_io_request *request = (rcheevos_async_io_request*)user_data;
http_transfer_data_t *data = (http_transfer_data_t*)task_data;
char buffer[224];
if (error)
{
/* there was a communication error */
rcheevos_async_request_failed(request, error);
return;
}
if (!data)
{
/* Server did not return HTTP headers */
strlcpy(buffer, "Server communication error", sizeof(buffer));
}
else if (!data->data || !data->len)
{
if (data->status <= 0)
{
/* something occurred which prevented the response from being processed.
* assume the server request hasn't happened and try again. */
snprintf(buffer, sizeof(buffer), "task status code %d", data->status);
rcheevos_async_request_failed(request, buffer);
return;
}
if (data->status != 200)
{
/* Server returned an error via status code. */
snprintf(buffer, sizeof(buffer), "HTTP error code %d", data->status);
}
else
{
/* Server sent an empty response without an error status code */
strlcpy(buffer, "No response from server", sizeof(buffer));
}
}
else
{
buffer[0] = '\0'; /* indicate success unless handler provides error */
/* Call appropriate handler to process the response */
if (request->handler)
{
/* NOTE: data->data is not null-terminated. Most handlers assume the
* response is properly formatted or will encounter a parse failure
* before reading past the end of the data */
request->handler(request->id, data, buffer, sizeof(buffer));
}
}
if (!buffer[0])
{
/* success */
if (request->success_message)
{
CHEEVOS_LOG(RCHEEVOS_TAG "%s %u\n", request->success_message, request->id);
}
}
else
{
/* encountered an error */
char errbuf[256];
snprintf(errbuf, sizeof(errbuf), "%s %u: %s",
request->failure_message, request->id, buffer);
CHEEVOS_LOG(RCHEEVOS_TAG "%s\n", errbuf);
switch (request->type)
{
case CHEEVOS_ASYNC_RICHPRESENCE:
/* Don't bother informing user when
* rich presence update fails */
break;
default:
runloop_msg_queue_push(errbuf, 0, 5 * 60, false, NULL,
MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_ERROR);
break;
}
}
rc_api_destroy_request(&request->request);
/* rich presence request will be reused on next ping - reset the attempt
* counter. for all other request types, free the request object */
if (request->type == CHEEVOS_ASYNC_RICHPRESENCE)
request->attempt_count = 0;
else
free(request);
}
static void rcheevos_async_begin_request(rcheevos_async_io_request* request,
rcheevos_async_handler handler, char type, int id,
const char* success_message, const char* failure_message)
{
request->handler = handler;
request->type = type;
request->id = id;
request->success_message = success_message;
request->failure_message = failure_message;
request->attempt_count = 0;
if (!request->user_agent)
request->user_agent = get_rcheevos_locals()->user_agent_core;
rcheevos_log_post_url(request->request.url, request->request.post_data);
task_push_http_post_transfer_with_user_agent(request->request.url,
request->request.post_data, true, "POST", request->user_agent,
rcheevos_async_http_task_callback, request);
}
static bool rcheevos_async_succeeded(int result,
const rc_api_response_t* response, char buffer[], size_t buffer_size)
{
if (result != RC_OK)
{
strlcpy(buffer, rc_error_str(result), buffer_size);
return false;
}
if (!response->succeeded)
{
strlcpy(buffer, response->error_message, buffer_size);
return false;
}
return true;
}
/****************************
* ping *
****************************/
static retro_time_t rcheevos_client_prepare_ping(rcheevos_async_io_request* request)
{
const rcheevos_locals_t* rcheevos_locals = get_rcheevos_locals();
const settings_t *settings = config_get_ptr();
const bool cheevos_richpresence_enable =
settings->bools.cheevos_richpresence_enable;
rc_api_ping_request_t api_params;
char buffer[256] = "";
memset(&api_params, 0, sizeof(api_params));
api_params.username = rcheevos_locals->username;
api_params.api_token = rcheevos_locals->token;
api_params.game_id = request->id;
if (cheevos_richpresence_enable)
{
rcheevos_get_richpresence(buffer, sizeof(buffer));
api_params.rich_presence = buffer;
}
rc_api_init_ping_request(&request->request, &api_params);
rcheevos_log_post_url(request->request.url, request->request.post_data);
#ifdef HAVE_DISCORD
if (settings->bools.discord_enable && discord_is_ready())
discord_update(DISCORD_PRESENCE_RETROACHIEVEMENTS);
#endif
/* Update rich presence every two minutes */
if (cheevos_richpresence_enable)
return cpu_features_get_time_usec() + CHEEVOS_PING_FREQUENCY;
/* Send ping every four minutes */
return cpu_features_get_time_usec() + CHEEVOS_PING_FREQUENCY * 2;
}
static void rcheevos_async_ping_handler(retro_task_t* task)
{
rcheevos_async_io_request* request = (rcheevos_async_io_request*)
task->user_data;
const rcheevos_locals_t* rcheevos_locals = get_rcheevos_locals();
if (request->id != (int)rcheevos_locals->patchdata.game_id)
{
/* game changed; stop the recurring task - a new one will
* be scheduled if a new game is loaded */
task_set_finished(task, 1);
/* request->request was destroyed in rcheevos_async_http_task_callback */
free(request);
return;
}
/* update the request and set the task to fire again in
* two minutes */
task->when = rcheevos_client_prepare_ping(request);
/* start the HTTP request */
task_push_http_post_transfer_with_user_agent(request->request.url,
request->request.post_data, true, "POST", request->user_agent,
rcheevos_async_http_task_callback, request);
}
/****************************
* start session *
****************************/
void rcheevos_client_start_session(unsigned game_id)
{
rcheevos_locals_t* rcheevos_locals = get_rcheevos_locals();
/* the core won't change while a session is active, so only
* calculate the user agent once */
rcheevos_get_user_agent(rcheevos_locals,
rcheevos_locals->user_agent_core,
sizeof(rcheevos_locals->user_agent_core));
/* force non-HTTPS until everything uses RAPI */
rc_api_set_host("http://retroachievements.org");
/* schedule the first rich presence call in 30 seconds */
{
rcheevos_async_io_request *request = (rcheevos_async_io_request*)
calloc(1, sizeof(rcheevos_async_io_request));
if (!request)
{
CHEEVOS_LOG(RCHEEVOS_TAG "Failed to allocate rich presence request\n");
}
else
{
retro_task_t* task = task_init();
request->id = game_id;
request->type = CHEEVOS_ASYNC_RICHPRESENCE;
request->user_agent = rcheevos_locals->user_agent_core;
request->failure_message = "Error sending ping";
task->handler = rcheevos_async_ping_handler;
task->user_data = request;
task->progress = -1;
task->when = cpu_features_get_time_usec() +
CHEEVOS_PING_FREQUENCY / 4;
task_queue_push(task);
}
}
}
/****************************
* award achievement *
****************************/
static void rcheevos_async_award_achievement_callback(int id,
http_transfer_data_t *data, char buffer[], size_t buffer_size)
{
rc_api_award_achievement_response_t api_response;
int result = rc_api_process_award_achievement_response(&api_response, data->data);
if (rcheevos_async_succeeded(result, &api_response.response, buffer, buffer_size))
{
if (api_response.awarded_achievement_id != id)
{
snprintf(buffer, buffer_size, "Achievement %u awarded instead",
api_response.awarded_achievement_id);
}
else if (api_response.response.error_message)
{
/* previously unlocked achievements are returned as a "successful" error */
CHEEVOS_LOG(RCHEEVOS_TAG "Achievement %u: %s\n",
id, api_response.response.error_message);
}
}
rc_api_destroy_award_achievement_response(&api_response);
}
void rcheevos_client_award_achievement(unsigned achievement_id)
{
rcheevos_async_io_request *request = (rcheevos_async_io_request*)
calloc(1, sizeof(rcheevos_async_io_request));
if (!request)
{
CHEEVOS_LOG(RCHEEVOS_TAG "Failed to allocate unlock request for achievement %u\n",
achievement_id);
}
else
{
const rcheevos_locals_t* rcheevos_locals = get_rcheevos_locals();
rc_api_award_achievement_request_t api_params;
memset(&api_params, 0, sizeof(api_params));
api_params.username = rcheevos_locals->username;
api_params.api_token = rcheevos_locals->token;
api_params.achievement_id = achievement_id;
api_params.hardcore = rcheevos_locals->hardcore_active ? 1 : 0;
api_params.game_hash = rcheevos_locals->hash;
rc_api_init_award_achievement_request(&request->request, &api_params);
rcheevos_async_begin_request(request,
rcheevos_async_award_achievement_callback,
CHEEVOS_ASYNC_AWARD_ACHIEVEMENT, achievement_id,
"Awarded achievement",
"Error awarding achievement");
}
}
/****************************
* submit leaderboard *
****************************/
static void rcheevos_async_submit_lboard_entry_callback(int id,
http_transfer_data_t* data, char buffer[], size_t buffer_size)
{
rc_api_submit_lboard_entry_response_t api_response;
int result = rc_api_process_submit_lboard_entry_response(&api_response, data->data);
if (rcheevos_async_succeeded(result, &api_response.response, buffer, buffer_size))
{
/* not currently doing anything with the response */
}
rc_api_destroy_submit_lboard_entry_response(&api_response);
}
void rcheevos_client_submit_lboard_entry(unsigned leaderboard_id, int value)
{
rcheevos_async_io_request *request = (rcheevos_async_io_request*)
calloc(1, sizeof(rcheevos_async_io_request));
if (!request)
{
CHEEVOS_LOG(RCHEEVOS_TAG "Failed to allocate request for lboard %u submit\n",
leaderboard_id);
}
else
{
const rcheevos_locals_t* rcheevos_locals = get_rcheevos_locals();
rc_api_submit_lboard_entry_request_t api_params;
memset(&api_params, 0, sizeof(api_params));
api_params.username = rcheevos_locals->username;
api_params.api_token = rcheevos_locals->token;
api_params.leaderboard_id = leaderboard_id;
api_params.score = value;
api_params.game_hash = rcheevos_locals->hash;
rc_api_init_submit_lboard_entry_request(&request->request, &api_params);
rcheevos_async_begin_request(request,
rcheevos_async_submit_lboard_entry_callback,
CHEEVOS_ASYNC_SUBMIT_LBOARD, leaderboard_id,
"Submitted leaderboard",
"Error submitting leaderboard");
}
}
+10 -13
View File
@@ -1,5 +1,5 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2015-2018 - Andre Leiradella
* Copyright (C) 2019-2021 - Brian Weiss
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
@@ -13,23 +13,20 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __RARCH_CHEEVOS_BADGE_H
#define __RARCH_CHEEVOS_BADGE_H
#ifndef __RARCH_CHEEVOS_CLIENT_H
#define __RARCH_CHEEVOS_CLIENT_H
#include <stdint.h>
#include <retro_common_api.h>
#include <boolean.h>
#include "cheevos_locals.h"
RETRO_BEGIN_DECLS
#ifdef HAVE_MENU
void cheevos_reset_menu_badges(void);
void cheevos_set_menu_badge(int index, const char *badge, bool locked);
uintptr_t cheevos_get_menu_badge_texture(int index);
#endif
void rcheevos_client_start_session(unsigned game_id);
void rcheevos_client_award_achievement(unsigned achievement_id);
void rcheevos_client_submit_lboard_entry(unsigned leaderboard_id, int value);
uintptr_t cheevos_get_badge_texture(const char* badge, bool locked);
void rcheevos_log_url(const char* api, const char* url);
void rcheevos_get_user_agent(rcheevos_locals_t *locals, char *buffer, size_t len);
RETRO_END_DECLS
#endif
#endif /* __RARCH_CHEEVOS_MENU_H */
+161
View File
@@ -0,0 +1,161 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2015-2018 - Andre Leiradella
* Copyright (C) 2019-2021 - Brian Weiss
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __RARCH_CHEEVOS_LOCALS_H
#define __RARCH_CHEEVOS_LOCALS_H
#include "../deps/rcheevos/include/rc_runtime.h"
#include "../deps/rcheevos/src/rcheevos/rc_libretro.h"
#include <../command.h>
#include <../verbosity.h>
#include <boolean.h>
#include <queues/task_queue.h>
#ifdef HAVE_THREADS
#include <rthreads/rthreads.h>
#endif
#include <retro_common_api.h>
RETRO_BEGIN_DECLS
/************************************************************************
* Logging *
************************************************************************/
/* Define this macro to get extra-verbose log for cheevos. */
#define CHEEVOS_VERBOSE
#define RCHEEVOS_TAG "[RCHEEVOS]: "
#define CHEEVOS_FREE(p) do { void* q = (void*)p; if (q) free(q); } while (0)
#ifdef CHEEVOS_VERBOSE
#define CHEEVOS_LOG RARCH_LOG
#define CHEEVOS_ERR RARCH_ERR
#else
void rcheevos_log(const char *fmt, ...);
#define CHEEVOS_LOG rcheevos_log
#define CHEEVOS_ERR RARCH_ERR
#endif
/************************************************************************
* State *
************************************************************************/
enum
{
RCHEEVOS_ACTIVE_SOFTCORE = 1 << 0,
RCHEEVOS_ACTIVE_HARDCORE = 1 << 1,
RCHEEVOS_ACTIVE_UNOFFICIAL = 1 << 2
};
typedef struct rcheevos_racheevo_t
{
const char* title;
const char* description;
const char* badge;
const char* memaddr;
unsigned id;
unsigned points;
retro_time_t unlock_time;
uint8_t active;
#ifdef HAVE_MENU
uint8_t menu_bucket;
uint8_t menu_progress;
uint8_t menu_badge_grayscale;
uintptr_t menu_badge_texture;
#endif
} rcheevos_racheevo_t;
typedef struct rcheevos_ralboard_t
{
const char* title;
const char* description;
const char* mem;
unsigned id;
unsigned format;
} rcheevos_ralboard_t;
typedef struct rcheevos_rapatchdata_t
{
char* title;
rcheevos_racheevo_t* core;
rcheevos_racheevo_t* unofficial;
rcheevos_ralboard_t* lboards;
char* richpresence_script;
unsigned game_id;
unsigned console_id;
unsigned core_count;
unsigned unofficial_count;
unsigned lboard_count;
} rcheevos_rapatchdata_t;
#ifdef HAVE_MENU
typedef struct rcheevos_menuitem_t
{
rcheevos_racheevo_t* cheevo;
enum msg_hash_enums state_label_idx;
} rcheevos_menuitem_t;
void rcheevos_menu_reset_badges(void);
#endif
typedef struct rcheevos_locals_t
{
rc_runtime_t runtime; /* rcheevos runtime state */
rcheevos_rapatchdata_t patchdata; /* achievement/leaderboard data from the server */
rc_libretro_memory_regions_t memory;/* achievement addresses to core memory mappings */
retro_task_t* task; /* load task */
#ifdef HAVE_THREADS
slock_t* task_lock; /* mutex for starting/stopping load task */
enum event_command queued_command; /* action queued by background thread to be run on main thread */
#endif
char username[32]; /* case-corrected username */
char token[32]; /* user's session token */
char hash[33]; /* retroachievements hash for current content */
char user_agent_prefix[128]; /* RetroArch/OS version information */
char user_agent_core[256]; /* RetroArch/OS/Core version information */
#ifdef HAVE_MENU
rcheevos_menuitem_t* menuitems; /* array of items for the achievements quick menu */
unsigned menuitem_capacity; /* maximum number of items in the menuitems array */
unsigned menuitem_count; /* current number of items in the menuitems array */
#endif
bool hardcore_active; /* hardcore functionality is active */
bool loaded; /* load task has completed */
bool core_supports; /* false if core explicitly disables achievements */
bool network_error; /* hash lookup or login failed with network error */
bool leaderboards_enabled; /* leaderboards are enabled */
bool leaderboard_notifications; /* leaderboard notifications are enabled */
bool leaderboard_trackers; /* leaderboard trackers are enabled */
} rcheevos_locals_t;
rcheevos_locals_t* get_rcheevos_locals(void);
RETRO_END_DECLS
#endif /* __RARCH_CHEEVOS_LOCALS_H */
-352
View File
@@ -1,352 +0,0 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2015-2016 - Andre Leiradella
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include "cheevos_memory.h"
#include "util.h"
#include "../retroarch.h"
#include "../verbosity.h"
#include "../deps/rcheevos/include/rcheevos.h"
#include <stdio.h>
uint8_t* rcheevos_memory_find(
const rcheevos_memory_regions_t* regions, unsigned address)
{
unsigned i;
for (i = 0; i < regions->count; ++i)
{
const size_t size = regions->size[i];
if (address < size)
{
if (regions->data[i] == NULL)
break;
return &regions->data[i][address];
}
address -= size;
}
return NULL;
}
static const char* rcheevos_memory_type(int type)
{
switch (type)
{
case RC_MEMORY_TYPE_SAVE_RAM:
return "SRAM";
case RC_MEMORY_TYPE_VIDEO_RAM:
return "VRAM";
case RC_MEMORY_TYPE_UNUSED:
return "UNUSED";
default:
break;
}
return "SYSTEM RAM";
}
static void rcheevos_memory_register_region(rcheevos_memory_regions_t* regions,
int type, uint8_t* data, size_t size, const char* description)
{
if (size == 0)
return;
if (regions->count == MAX_MEMORY_REGIONS)
{
CHEEVOS_LOG(RCHEEVOS_TAG "Too many memory memory regions to register\n");
return;
}
if (!data && regions->count > 0 && !regions->data[regions->count - 1])
{
/* extend null region */
regions->size[regions->count - 1] += size;
}
else if (data && regions->count > 0 &&
data == (regions->data[regions->count - 1] + regions->size[regions->count - 1]))
{
/* extend non-null region */
regions->size[regions->count - 1] += size;
}
else
{
/* create new region */
regions->data[regions->count] = data;
regions->size[regions->count] = size;
++regions->count;
}
regions->total_size += size;
CHEEVOS_LOG(RCHEEVOS_TAG "Registered 0x%04X bytes of %s at $%06X (%s)\n", (unsigned)size,
rcheevos_memory_type(type), (unsigned)(regions->total_size - size), description);
}
static void rcheevos_memory_init_without_regions(
rcheevos_memory_regions_t* regions)
{
/* no regions specified, assume system RAM followed by save RAM */
char description[64];
retro_ctx_memory_info_t meminfo;
snprintf(description, sizeof(description), "offset 0x%06x", 0);
meminfo.id = RETRO_MEMORY_SYSTEM_RAM;
core_get_memory(&meminfo);
rcheevos_memory_register_region(regions, RC_MEMORY_TYPE_SYSTEM_RAM, (uint8_t*)meminfo.data, meminfo.size, description);
meminfo.id = RETRO_MEMORY_SAVE_RAM;
core_get_memory(&meminfo);
rcheevos_memory_register_region(regions, RC_MEMORY_TYPE_SAVE_RAM, (uint8_t*)meminfo.data, meminfo.size, description);
}
static const rarch_memory_descriptor_t* rcheevos_memory_get_descriptor(const rarch_memory_map_t* mmap, unsigned real_address)
{
const rarch_memory_descriptor_t* desc = mmap->descriptors;
const rarch_memory_descriptor_t* end = desc + mmap->num_descriptors;
if (mmap->num_descriptors == 0)
return NULL;
for (; desc < end; desc++)
{
if (desc->core.select == 0)
{
/* if select is 0, attempt to explcitly match the address */
if (real_address >= desc->core.start && real_address < desc->core.start + desc->core.len)
return desc;
}
else
{
/* otherwise, attempt to match the address by matching the select bits */
if (((desc->core.start ^ real_address) & desc->core.select) == 0)
{
/* sanity check - make sure the descriptor is large enough to hold the target address */
if (real_address - desc->core.start < desc->core.len)
return desc;
}
}
}
return NULL;
}
void rcheevos_memory_init_from_memory_map(rcheevos_memory_regions_t* regions, const rarch_memory_map_t* mmap, const rc_memory_regions_t* console_regions)
{
char description[64];
unsigned i;
uint8_t* region_start;
uint8_t* desc_start;
size_t desc_size;
size_t offset;
for (i = 0; i < console_regions->num_regions; ++i)
{
const rc_memory_region_t* console_region = &console_regions->region[i];
size_t console_region_size = console_region->end_address - console_region->start_address + 1;
unsigned real_address = console_region->real_address;
while (console_region_size > 0)
{
const rarch_memory_descriptor_t* desc = rcheevos_memory_get_descriptor(mmap, real_address);
if (!desc)
{
if (console_region->type != RC_MEMORY_TYPE_UNUSED)
{
CHEEVOS_LOG(RCHEEVOS_TAG "Could not map region starting at $%06X\n",
real_address - console_region->real_address + console_region->start_address);
}
rcheevos_memory_register_region(regions, console_region->type, NULL, console_region_size, "null filler");
break;
}
offset = real_address - desc->core.start;
snprintf(description, sizeof(description),
"descriptor %u, offset 0x%06X",
(int)(desc - mmap->descriptors) + 1, (int)offset);
if (desc->core.ptr)
{
desc_start = (uint8_t*)desc->core.ptr + desc->core.offset;
region_start = desc_start + offset;
}
else
region_start = NULL;
desc_size = desc->core.len - offset;
if (console_region_size > desc_size)
{
if (desc_size == 0)
{
if (console_region->type != RC_MEMORY_TYPE_UNUSED)
{
CHEEVOS_LOG(RCHEEVOS_TAG "Could not map region starting at $%06X\n",
real_address - console_region->real_address + console_region->start_address);
}
rcheevos_memory_register_region(regions, console_region->type, NULL, console_region_size, "null filler");
console_region_size = 0;
}
else
{
rcheevos_memory_register_region(regions, console_region->type, region_start, desc_size, description);
console_region_size -= desc_size;
real_address += desc_size;
}
}
else
{
rcheevos_memory_register_region(regions, console_region->type, region_start, console_region_size, description);
console_region_size = 0;
}
}
}
}
static unsigned rcheevos_memory_console_region_to_ram_type(int region_type)
{
switch (region_type)
{
case RC_MEMORY_TYPE_SAVE_RAM:
return RETRO_MEMORY_SAVE_RAM;
case RC_MEMORY_TYPE_VIDEO_RAM:
return RETRO_MEMORY_VIDEO_RAM;
default:
break;
}
return RETRO_MEMORY_SYSTEM_RAM;
}
static void rcheevos_memory_init_from_unmapped_memory(rcheevos_memory_regions_t* regions, const rc_memory_regions_t* console_regions, int console)
{
char description[64];
unsigned i;
for (i = 0; i < console_regions->num_regions; ++i)
{
size_t offset;
unsigned j;
retro_ctx_memory_info_t meminfo;
const rc_memory_region_t* console_region = &console_regions->region[i];
const size_t console_region_size =
console_region->end_address - console_region->start_address + 1;
unsigned base_address = 0;
meminfo.id = rcheevos_memory_console_region_to_ram_type(console_region->type);
for (j = 0; j <= i; ++j)
{
const rc_memory_region_t* console_region2 = &console_regions->region[j];
if (rcheevos_memory_console_region_to_ram_type(
console_region2->type) == meminfo.id)
{
base_address = console_region2->start_address;
break;
}
}
offset = console_region->start_address - base_address;
core_get_memory(&meminfo);
if (offset < meminfo.size)
{
meminfo.size -= offset;
if (meminfo.data)
{
snprintf(description, sizeof(description),
"offset 0x%06X", (int)offset);
meminfo.data = (uint8_t*)meminfo.data + offset;
}
else
snprintf(description, sizeof(description), "null filler");
}
else
{
if (console_region->type != RC_MEMORY_TYPE_UNUSED)
{
CHEEVOS_LOG(RCHEEVOS_TAG "Could not map region starting at $%06X\n", console_region->start_address);
}
meminfo.data = NULL;
meminfo.size = 0;
}
if (console_region_size > meminfo.size)
{
/* want more than what is available, take what we can and null fill the rest */
rcheevos_memory_register_region(regions, console_region->type, (uint8_t*)meminfo.data, meminfo.size, description);
rcheevos_memory_register_region(regions, console_region->type, NULL, console_region_size - meminfo.size, "null filler");
}
else
{
/* only take as much as we need */
rcheevos_memory_register_region(regions, console_region->type, (uint8_t*)meminfo.data, console_region_size, description);
}
}
}
void rcheevos_memory_destroy(rcheevos_memory_regions_t* regions)
{
memset(regions, 0, sizeof(*regions));
}
bool rcheevos_memory_init(rcheevos_memory_regions_t* regions, int console)
{
unsigned i;
const rc_memory_regions_t* console_regions = rc_console_memory_regions(console);
rcheevos_memory_regions_t new_regions;
bool has_valid_region = false;
if (!regions)
return false;
memset(&new_regions, 0, sizeof(new_regions));
if (console_regions == NULL || console_regions->num_regions == 0)
{
rcheevos_memory_init_without_regions(&new_regions);
}
else
{
rarch_system_info_t* system = runloop_get_system_info();
if (system->mmaps.num_descriptors != 0)
rcheevos_memory_init_from_memory_map(&new_regions, &system->mmaps, console_regions);
else
rcheevos_memory_init_from_unmapped_memory(&new_regions, console_regions, console);
}
/* determine if any valid regions were found */
for (i = 0; i < new_regions.count; i++)
{
if (new_regions.data[i])
{
has_valid_region = true;
break;
}
}
memcpy(regions, &new_regions, sizeof(*regions));
return has_valid_region;
}
+725
View File
@@ -0,0 +1,725 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2019-2021 - Brian Weiss
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include "cheevos_locals.h"
#include "../gfx/gfx_display.h"
#ifdef HAVE_MENU
#include "cheevos.h"
#include "../deps/rcheevos/include/rc_runtime_types.h"
#include "../file_path_special.h"
#include "../menu/menu_driver.h"
#include "../menu/menu_entries.h"
#include <features/features_cpu.h>
enum rcheevos_menuitem_bucket
{
RCHEEVOS_MENUITEM_BUCKET_UNKNOWN = 0,
RCHEEVOS_MENUITEM_BUCKET_LOCKED,
RCHEEVOS_MENUITEM_BUCKET_UNLOCKED,
RCHEEVOS_MENUITEM_BUCKET_UNSUPPORTED,
RCHEEVOS_MENUITEM_BUCKET_RECENTLY_UNLOCKED,
RCHEEVOS_MENUITEM_BUCKET_ACTIVE_CHALLENGE,
RCHEEVOS_MENUITEM_BUCKET_ALMOST_THERE
};
static void rcheevos_menu_update_bucket(rcheevos_racheevo_t* cheevo)
{
cheevo->menu_progress = 0;
if (!cheevo->memaddr)
{
/* non-active unsupported achievement */
cheevo->menu_bucket = RCHEEVOS_MENUITEM_BUCKET_UNSUPPORTED;
}
else if (!(cheevo->active & RCHEEVOS_ACTIVE_HARDCORE))
{
/* non-active unlocked in hardcore achievement */
cheevo->menu_bucket = RCHEEVOS_MENUITEM_BUCKET_UNLOCKED;
}
else
{
const rcheevos_locals_t* rcheevos_locals = get_rcheevos_locals();
rc_trigger_t* trigger;
if (!rcheevos_locals->hardcore_active && !(cheevo->active & RCHEEVOS_ACTIVE_SOFTCORE))
{
/* non-active unlocked in softcore achievement in softcore mode */
cheevo->menu_bucket = RCHEEVOS_MENUITEM_BUCKET_UNLOCKED;
return;
}
/* active achievement */
cheevo->menu_bucket = RCHEEVOS_MENUITEM_BUCKET_LOCKED;
trigger = rc_runtime_get_achievement(&rcheevos_locals->runtime, cheevo->id);
if (trigger)
{
if (trigger->measured_value && trigger->measured_target)
{
const unsigned long clamped_value = (unsigned long)
MIN(trigger->measured_value, trigger->measured_target);
cheevo->menu_progress =
(uint8_t)((clamped_value * 100) / trigger->measured_target);
}
if (trigger->state == RC_TRIGGER_STATE_PRIMED)
cheevo->menu_bucket = RCHEEVOS_MENUITEM_BUCKET_ACTIVE_CHALLENGE;
else if (cheevo->menu_progress >= 80)
cheevo->menu_bucket = RCHEEVOS_MENUITEM_BUCKET_ALMOST_THERE;
}
}
}
static void rcheevos_menu_update_buckets(bool cheevos_test_unofficial)
{
const rcheevos_locals_t* rcheevos_locals = get_rcheevos_locals();
rcheevos_racheevo_t* cheevo = rcheevos_locals->patchdata.core;
rcheevos_racheevo_t* stop = cheevo + rcheevos_locals->patchdata.core_count;
while (cheevo < stop)
{
rcheevos_menu_update_bucket(cheevo);
++cheevo;
}
if (cheevos_test_unofficial)
{
cheevo = rcheevos_locals->patchdata.unofficial;
stop = cheevo + rcheevos_locals->patchdata.unofficial_count;
while (cheevo < stop)
{
rcheevos_menu_update_bucket(cheevo);
++cheevo;
}
}
}
bool rcheevos_menu_get_state(unsigned menu_offset, char *buffer, size_t len)
{
const rcheevos_locals_t* rcheevos_locals = get_rcheevos_locals();
if (menu_offset < rcheevos_locals->menuitem_count)
{
const rcheevos_menuitem_t* menuitem = &rcheevos_locals->menuitems[menu_offset];
const rcheevos_racheevo_t* cheevo = menuitem->cheevo;
if (cheevo)
{
if (cheevo->menu_progress)
{
snprintf(buffer, len, "%s - %d%%",
msg_hash_to_str(menuitem->state_label_idx),
cheevo->menu_progress);
}
else
{
strlcpy(buffer, msg_hash_to_str(menuitem->state_label_idx), len);
}
return true;
}
}
if (buffer)
buffer[0] = '\0';
return false;
}
bool rcheevos_menu_get_sublabel(unsigned menu_offset, char *buffer, size_t len)
{
const rcheevos_locals_t* rcheevos_locals = get_rcheevos_locals();
if (menu_offset < rcheevos_locals->menuitem_count)
{
const rcheevos_racheevo_t* cheevo = rcheevos_locals->menuitems[menu_offset].cheevo;
if (cheevo && buffer)
{
strlcpy(buffer, cheevo->description, len);
return true;
}
}
if (buffer)
buffer[0] = '\0';
return false;
}
void rcheevos_menu_reset_badges(void)
{
const rcheevos_locals_t* rcheevos_locals = get_rcheevos_locals();
rcheevos_racheevo_t* cheevo = rcheevos_locals->patchdata.core;
rcheevos_racheevo_t* stop = cheevo + rcheevos_locals->patchdata.core_count;
while (cheevo < stop)
{
if (cheevo->menu_badge_texture)
video_driver_texture_unload(&cheevo->menu_badge_texture);
++cheevo;
}
cheevo = rcheevos_locals->patchdata.unofficial;
stop = cheevo + rcheevos_locals->patchdata.unofficial_count;
while (cheevo < stop)
{
if (cheevo->menu_badge_texture)
video_driver_texture_unload(&cheevo->menu_badge_texture);
++cheevo;
}
}
static rcheevos_menuitem_t* rcheevos_menu_allocate(
rcheevos_locals_t* rcheevos_locals, rcheevos_racheevo_t* cheevo)
{
rcheevos_menuitem_t* menuitem;
if (rcheevos_locals->menuitem_count == rcheevos_locals->menuitem_capacity)
{
if (rcheevos_locals->menuitems)
{
rcheevos_menuitem_t* new_menuitems;
rcheevos_locals->menuitem_capacity += 32;
new_menuitems = (rcheevos_menuitem_t*)realloc(rcheevos_locals->menuitems,
rcheevos_locals->menuitem_capacity * sizeof(rcheevos_menuitem_t));
if (new_menuitems)
{
rcheevos_locals->menuitems = new_menuitems;
}
else
{
/* realloc failed */
CHEEVOS_ERR(RCHEEVOS_TAG " could not allocate space for %u menu items\n",
rcheevos_locals->menuitem_capacity);
rcheevos_locals->menuitem_capacity -= 32;
return NULL;
}
}
else
{
rcheevos_locals->menuitem_capacity = 64;
rcheevos_locals->menuitems = (rcheevos_menuitem_t*)
malloc(rcheevos_locals->menuitem_capacity * sizeof(rcheevos_menuitem_t));
if (!rcheevos_locals->menuitems)
{
/* malloc failed */
CHEEVOS_ERR(RCHEEVOS_TAG " could not allocate space for %u menu items\n",
rcheevos_locals->menuitem_capacity);
rcheevos_locals->menuitem_capacity = 0;
return NULL;
}
}
}
menuitem = &rcheevos_locals->menuitems[rcheevos_locals->menuitem_count++];
menuitem->cheevo = cheevo;
menuitem->state_label_idx = MSG_UNKNOWN;
return menuitem;
}
static void rcheevos_menu_append_header(rcheevos_locals_t* rcheevos_locals,
enum msg_hash_enums label)
{
rcheevos_menuitem_t* menuitem = rcheevos_menu_allocate(rcheevos_locals, NULL);
if (menuitem)
menuitem->state_label_idx = label;
}
static void rcheevos_menu_update_badge(rcheevos_racheevo_t* cheevo)
{
bool badge_grayscale = false;
switch (cheevo->menu_bucket)
{
case RCHEEVOS_MENUITEM_BUCKET_LOCKED:
case RCHEEVOS_MENUITEM_BUCKET_UNSUPPORTED:
case RCHEEVOS_MENUITEM_BUCKET_ALMOST_THERE:
case RCHEEVOS_MENUITEM_BUCKET_ACTIVE_CHALLENGE:
badge_grayscale = true;
break;
default:
badge_grayscale = false;
break;
}
if (!cheevo->menu_badge_texture || cheevo->menu_badge_grayscale != badge_grayscale)
{
uintptr_t new_badge_texture =
rcheevos_get_badge_texture(cheevo->badge, badge_grayscale);
if (new_badge_texture)
{
if (cheevo->menu_badge_texture)
video_driver_texture_unload(&cheevo->menu_badge_texture);
cheevo->menu_badge_texture = new_badge_texture;
cheevo->menu_badge_grayscale = badge_grayscale;
}
/* menu_badge_grayscale is overloaded such that any value greater than 1 indicates
* the server default image is being used */
else if (cheevo->menu_badge_grayscale < 2)
{
if (cheevo->menu_badge_texture)
video_driver_texture_unload(&cheevo->menu_badge_texture);
/* requested badge is not available, check for server default */
cheevo->menu_badge_texture =
rcheevos_get_badge_texture("00000", false);
if (cheevo->menu_badge_texture)
cheevo->menu_badge_grayscale = 2;
}
}
}
static void rcheevos_menu_append_items(rcheevos_locals_t* rcheevos_locals,
bool cheevos_test_unofficial, enum rcheevos_menuitem_bucket bucket)
{
const settings_t *settings = config_get_ptr();
rcheevos_racheevo_t* cheevo = rcheevos_locals->patchdata.core;
rcheevos_racheevo_t* stop = cheevo + rcheevos_locals->patchdata.core_count;
bool processing_unofficial = false;
const unsigned first_index = rcheevos_locals->menuitem_count;
do
{
if (cheevo == stop)
{
if (!cheevos_test_unofficial || processing_unofficial)
break;
processing_unofficial = true;
cheevo = rcheevos_locals->patchdata.unofficial;
stop = cheevo + rcheevos_locals->patchdata.unofficial_count;
continue;
}
if (cheevo->menu_bucket == bucket)
{
rcheevos_menuitem_t* menuitem = rcheevos_menu_allocate(rcheevos_locals, cheevo);
if (!menuitem)
return;
switch (cheevo->menu_bucket)
{
case RCHEEVOS_MENUITEM_BUCKET_UNSUPPORTED:
menuitem->state_label_idx = MENU_ENUM_LABEL_VALUE_CHEEVOS_UNSUPPORTED_ENTRY;
break;
case RCHEEVOS_MENUITEM_BUCKET_RECENTLY_UNLOCKED:
{
/* insert the item such that the unlock times are descending */
unsigned entry_index = rcheevos_locals->menuitem_count - 1;
while (entry_index > first_index)
{
rcheevos_menuitem_t* prev_menuitem = menuitem - 1;
if (prev_menuitem->cheevo->unlock_time >= cheevo->unlock_time)
break;
memcpy(menuitem, prev_menuitem, sizeof(rcheevos_menuitem_t));
menuitem = prev_menuitem;
--entry_index;
}
menuitem->cheevo = cheevo;
}
/* fallthrough to RCHEEVOS_MENUITEM_BUCKET_UNLOCKED */
case RCHEEVOS_MENUITEM_BUCKET_UNLOCKED:
if (!(cheevo->active & RCHEEVOS_ACTIVE_HARDCORE))
menuitem->state_label_idx = MENU_ENUM_LABEL_VALUE_CHEEVOS_UNLOCKED_ENTRY_HARDCORE;
else
menuitem->state_label_idx = MENU_ENUM_LABEL_VALUE_CHEEVOS_UNLOCKED_ENTRY;
break;
case RCHEEVOS_MENUITEM_BUCKET_ALMOST_THERE:
{
/* insert the item such that the progresses are descending */
unsigned entry_index = rcheevos_locals->menuitem_count - 1;
while (entry_index > first_index)
{
rcheevos_menuitem_t* prev_menuitem = menuitem - 1;
if (prev_menuitem->cheevo->menu_progress >= cheevo->menu_progress)
break;
memcpy(menuitem, prev_menuitem, sizeof(rcheevos_menuitem_t));
menuitem = prev_menuitem;
--entry_index;
}
menuitem->cheevo = cheevo;
}
/* fallthrough to default */
default:
if (processing_unofficial)
menuitem->state_label_idx = MENU_ENUM_LABEL_VALUE_CHEEVOS_UNOFFICIAL_ENTRY;
else if (!(cheevo->active & RCHEEVOS_ACTIVE_SOFTCORE))
menuitem->state_label_idx = MENU_ENUM_LABEL_VALUE_CHEEVOS_UNLOCKED_ENTRY;
else
menuitem->state_label_idx = MENU_ENUM_LABEL_VALUE_CHEEVOS_LOCKED_ENTRY;
break;
}
if (cheevo->badge && cheevo->badge[0] && settings &&
settings->bools.cheevos_badges_enable)
{
rcheevos_menu_update_badge(cheevo);
}
}
++cheevo;
} while (true);
}
uintptr_t rcheevos_menu_get_badge_texture(unsigned menu_offset)
{
const rcheevos_locals_t* rcheevos_locals = get_rcheevos_locals();
if (menu_offset < rcheevos_locals->menuitem_count)
{
rcheevos_racheevo_t* cheevo = rcheevos_locals->menuitems[menu_offset].cheevo;
if (cheevo)
{
/* if we're using the placeholder badge, check to see if the real badge
* has become available (do this roughly once a second) */
if (cheevo->menu_badge_grayscale >= 2)
{
if (++cheevo->menu_badge_grayscale == 64)
{
cheevo->menu_badge_grayscale = 2;
rcheevos_menu_update_badge(cheevo);
}
}
return cheevo->menu_badge_texture;
}
}
return 0;
}
void rcheevos_menu_populate_hardcore_pause_submenu(void* data)
{
const rcheevos_locals_t* rcheevos_locals = get_rcheevos_locals();
menu_displaylist_info_t* info = (menu_displaylist_info_t*)data;
const settings_t* settings = config_get_ptr();
const bool cheevos_hardcore_mode_enable = settings->bools.cheevos_hardcore_mode_enable;
if (cheevos_hardcore_mode_enable && rcheevos_locals->loaded)
{
if (rcheevos_locals->hardcore_active)
{
menu_entries_append_enum(info->list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ACHIEVEMENT_PAUSE_CANCEL),
msg_hash_to_str(MENU_ENUM_SUBLABEL_ACHIEVEMENT_PAUSE_CANCEL),
MENU_ENUM_LABEL_ACHIEVEMENT_PAUSE_CANCEL,
MENU_SETTING_ACTION_CLOSE, 0, 0);
menu_entries_append_enum(info->list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ACHIEVEMENT_PAUSE),
msg_hash_to_str(MENU_ENUM_LABEL_ACHIEVEMENT_PAUSE),
MENU_ENUM_LABEL_ACHIEVEMENT_PAUSE,
MENU_SETTING_ACTION_PAUSE_ACHIEVEMENTS, 0, 0);
}
else
{
menu_entries_append_enum(info->list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ACHIEVEMENT_RESUME_CANCEL),
msg_hash_to_str(MENU_ENUM_SUBLABEL_ACHIEVEMENT_RESUME_CANCEL),
MENU_ENUM_LABEL_ACHIEVEMENT_RESUME_CANCEL,
MENU_SETTING_ACTION_CLOSE, 0, 0);
menu_entries_append_enum(info->list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ACHIEVEMENT_RESUME),
msg_hash_to_str(MENU_ENUM_LABEL_ACHIEVEMENT_RESUME),
MENU_ENUM_LABEL_ACHIEVEMENT_RESUME,
MENU_SETTING_ACTION_RESUME_ACHIEVEMENTS, 0, 0);
}
}
}
void rcheevos_menu_populate(void* data)
{
menu_displaylist_info_t* info = (menu_displaylist_info_t*)data;
rcheevos_locals_t* rcheevos_locals = get_rcheevos_locals();
const settings_t* settings = config_get_ptr();
const bool cheevos_test_unofficial = settings->bools.cheevos_test_unofficial;
unsigned num_locked = 0;
unsigned num_unlocked = 0;
unsigned num_recently_unlocked = 0;
unsigned num_unsupported = 0;
unsigned num_active_challenges = 0;
unsigned num_almost_there = 0;
if (rcheevos_locals->loaded)
{
const retro_time_t now = cpu_features_get_time_usec();
const retro_time_t recent_unlock_time = now - (10 * 60 * 1000000); /* 10 minutes ago */
bool processing_unofficial = false;
rcheevos_racheevo_t* cheevo = NULL;
rcheevos_racheevo_t* stop = NULL;
/* first menu item is the Pause/Resume Hardcore option (unless hardcore is disabled) */
if (settings->bools.cheevos_enable && settings->bools.cheevos_hardcore_mode_enable)
{
if (rcheevos_locals->hardcore_active)
menu_entries_append_enum(info->list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ACHIEVEMENT_PAUSE),
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ACHIEVEMENT_PAUSE_MENU),
MENU_ENUM_LABEL_ACHIEVEMENT_PAUSE_MENU,
MENU_SETTING_ACTION_PAUSE_ACHIEVEMENTS, 0, 0);
else
menu_entries_append_enum(info->list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ACHIEVEMENT_RESUME),
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ACHIEVEMENT_PAUSE_MENU),
MENU_ENUM_LABEL_ACHIEVEMENT_PAUSE_MENU,
MENU_SETTING_ACTION_RESUME_ACHIEVEMENTS, 0, 0);
}
/* update the bucket for each achievement */
rcheevos_menu_update_buckets(cheevos_test_unofficial);
/* count items in each bucket */
cheevo = rcheevos_locals->patchdata.core;
stop = cheevo + rcheevos_locals->patchdata.core_count;
do
{
if (cheevo == stop)
{
if (!cheevos_test_unofficial || processing_unofficial)
break;
processing_unofficial = true;
cheevo = rcheevos_locals->patchdata.unofficial;
stop = cheevo + rcheevos_locals->patchdata.unofficial_count;
continue;
}
switch (cheevo->menu_bucket)
{
case RCHEEVOS_MENUITEM_BUCKET_UNLOCKED:
if (cheevo->unlock_time && cheevo->unlock_time >= recent_unlock_time)
{
cheevo->menu_bucket = RCHEEVOS_MENUITEM_BUCKET_RECENTLY_UNLOCKED;
++num_recently_unlocked;
}
else
{
++num_unlocked;
}
break;
case RCHEEVOS_MENUITEM_BUCKET_LOCKED:
++num_locked;
break;
case RCHEEVOS_MENUITEM_BUCKET_UNSUPPORTED:
++num_unsupported;
break;
case RCHEEVOS_MENUITEM_BUCKET_ACTIVE_CHALLENGE:
++num_active_challenges;
break;
case RCHEEVOS_MENUITEM_BUCKET_ALMOST_THERE:
++num_almost_there;
break;
}
++cheevo;
} while(true);
if (!rcheevos_locals->menuitems)
{
/* reserve space for all achievements and up to 6 headers before we need to realloc */
rcheevos_locals->menuitem_capacity = rcheevos_locals->patchdata.core_count + 6;
if (cheevos_test_unofficial)
rcheevos_locals->menuitem_capacity += rcheevos_locals->patchdata.unofficial_count;
rcheevos_locals->menuitems = (rcheevos_menuitem_t*)
malloc(rcheevos_locals->menuitem_capacity * sizeof(rcheevos_menuitem_t));
if (!rcheevos_locals->menuitems)
rcheevos_locals->menuitem_capacity = 0;
}
}
/* reset menu */
rcheevos_locals->menuitem_count = 0;
/* active challenges */
if (num_active_challenges)
{
rcheevos_menu_append_header(rcheevos_locals,
MENU_ENUM_LABEL_VALUE_CHEEVOS_ACTIVE_CHALLENGES_ENTRY);
rcheevos_menu_append_items(rcheevos_locals, cheevos_test_unofficial,
RCHEEVOS_MENUITEM_BUCKET_ACTIVE_CHALLENGE);
}
/* recently unlocked */
if (num_recently_unlocked)
{
rcheevos_menu_append_header(rcheevos_locals,
MENU_ENUM_LABEL_VALUE_CHEEVOS_RECENTLY_UNLOCKED_ENTRY);
rcheevos_menu_append_items(rcheevos_locals, cheevos_test_unofficial,
RCHEEVOS_MENUITEM_BUCKET_RECENTLY_UNLOCKED);
}
/* almost there */
if (num_almost_there)
{
rcheevos_menu_append_header(rcheevos_locals,
MENU_ENUM_LABEL_VALUE_CHEEVOS_ALMOST_THERE_ENTRY);
rcheevos_menu_append_items(rcheevos_locals, cheevos_test_unofficial,
RCHEEVOS_MENUITEM_BUCKET_ALMOST_THERE);
}
/* locked */
if (num_locked)
{
if (rcheevos_locals->menuitem_count > 0)
{
rcheevos_menu_append_header(rcheevos_locals,
MENU_ENUM_LABEL_VALUE_CHEEVOS_LOCKED_ENTRY);
}
rcheevos_menu_append_items(rcheevos_locals, cheevos_test_unofficial,
RCHEEVOS_MENUITEM_BUCKET_LOCKED);
}
/* unlocked */
if (num_unlocked)
{
if (rcheevos_locals->menuitem_count > 0)
{
rcheevos_menu_append_header(rcheevos_locals,
MENU_ENUM_LABEL_VALUE_CHEEVOS_UNLOCKED_ENTRY);
}
rcheevos_menu_append_items(rcheevos_locals, cheevos_test_unofficial,
RCHEEVOS_MENUITEM_BUCKET_UNLOCKED);
}
if (rcheevos_locals->menuitem_count > 0)
{
/* convert to menu entries */
rcheevos_menuitem_t* menuitem = rcheevos_locals->menuitems;
rcheevos_menuitem_t* stop = menuitem + rcheevos_locals->menuitem_count;
char buffer[128];
unsigned idx = 0;
do
{
if (menuitem->cheevo)
{
menu_entries_append_enum(info->list, menuitem->cheevo->title,
menuitem->cheevo->description,
MENU_ENUM_LABEL_CHEEVOS_LOCKED_ENTRY,
MENU_SETTINGS_CHEEVOS_START + idx, 0, 0);
}
else
{
snprintf(buffer, sizeof(buffer), "----- %s -----",
msg_hash_to_str(menuitem->state_label_idx));
menu_entries_append_enum(info->list, buffer, "",
MENU_ENUM_LABEL_CHEEVOS_LOCKED_ENTRY,
MENU_SETTINGS_CHEEVOS_START + idx, 0, 0);
}
++idx;
++menuitem;
} while (menuitem != stop);
}
else
{
/* no achievements found */
if (!rcheevos_locals->core_supports)
{
menu_entries_append_enum(info->list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CANNOT_ACTIVATE_ACHIEVEMENTS_WITH_THIS_CORE),
msg_hash_to_str(MENU_ENUM_LABEL_CANNOT_ACTIVATE_ACHIEVEMENTS_WITH_THIS_CORE),
MENU_ENUM_LABEL_CANNOT_ACTIVATE_ACHIEVEMENTS_WITH_THIS_CORE,
FILE_TYPE_NONE, 0, 0);
}
else if (rcheevos_locals->network_error)
{
menu_entries_append_enum(info->list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETWORK_ERROR),
msg_hash_to_str(MENU_ENUM_LABEL_NETWORK_ERROR),
MENU_ENUM_LABEL_NETWORK_ERROR,
FILE_TYPE_NONE, 0, 0);
}
else if (!rcheevos_locals->patchdata.game_id)
{
menu_entries_append_enum(info->list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_UNKNOWN_GAME),
msg_hash_to_str(MENU_ENUM_LABEL_UNKNOWN_GAME),
MENU_ENUM_LABEL_UNKNOWN_GAME,
FILE_TYPE_NONE, 0, 0);
}
else if (!rcheevos_locals->token[0])
{
menu_entries_append_enum(info->list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NOT_LOGGED_IN),
msg_hash_to_str(MENU_ENUM_LABEL_NOT_LOGGED_IN),
MENU_ENUM_LABEL_NOT_LOGGED_IN,
FILE_TYPE_NONE, 0, 0);
}
else
{
menu_entries_append_enum(info->list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_ACHIEVEMENTS_TO_DISPLAY),
msg_hash_to_str(MENU_ENUM_LABEL_NO_ACHIEVEMENTS_TO_DISPLAY),
MENU_ENUM_LABEL_NO_ACHIEVEMENTS_TO_DISPLAY,
FILE_TYPE_NONE, 0, 0);
}
}
}
#endif /* HAVE_MENU */
uintptr_t rcheevos_get_badge_texture(const char *badge, bool locked)
{
char badge_file[24];
char fullpath[PATH_MAX_LENGTH];
uintptr_t tex = 0;
if (!badge)
return 0;
snprintf(badge_file, sizeof(badge_file), "%s%s%s", badge,
locked ? "_lock" : "", FILE_PATH_PNG_EXTENSION);
fill_pathname_application_special(fullpath, sizeof(fullpath),
APPLICATION_SPECIAL_DIRECTORY_THUMBNAILS_CHEEVOS_BADGES);
if (!gfx_display_reset_textures_list(badge_file, fullpath,
&tex, TEXTURE_FILTER_MIPMAP_LINEAR, NULL, NULL))
{
tex = 0;
}
return tex;
}
@@ -1,5 +1,6 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2015-2018 - Andre Leiradella
* Copyright (C) 2019-2021 - Brian Weiss
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
@@ -12,33 +13,29 @@
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __RARCH_CHEEVOS_MEMORY_H
#define __RARCH_CHEEVOS_MEMORY_H
#ifndef __RARCH_CHEEVOS_MENU_H
#define __RARCH_CHEEVOS_MENU_H
#ifdef HAVE_MENU
#include <stdint.h>
#include <stdlib.h>
#include <boolean.h>
#include <retro_common_api.h>
RETRO_BEGIN_DECLS
#define MAX_MEMORY_REGIONS 32
typedef struct
{
uint8_t* data[MAX_MEMORY_REGIONS];
size_t size[MAX_MEMORY_REGIONS];
size_t total_size;
unsigned count;
} rcheevos_memory_regions_t;
bool rcheevos_memory_init(rcheevos_memory_regions_t* regions, int console);
void rcheevos_memory_destroy(rcheevos_memory_regions_t* regions);
uint8_t* rcheevos_memory_find(const rcheevos_memory_regions_t* regions,
unsigned address);
void rcheevos_menu_populate(void* data);
void rcheevos_menu_populate_hardcore_pause_submenu(void* data);
bool rcheevos_menu_get_state(unsigned menu_offset, char* buffer, size_t buffer_size);
bool rcheevos_menu_get_sublabel(unsigned menu_offset, char* buffer, size_t buffer_size);
uintptr_t rcheevos_menu_get_badge_texture(unsigned menu_offset);
RETRO_END_DECLS
#endif
#endif /* HAVE_MENU */
#endif /* __RARCH_CHEEVOS_MENU_H */
+6 -3
View File
@@ -1,6 +1,6 @@
#include "cheevos_parser.h"
#include "util.h"
#include "cheevos_locals.h"
#include <encodings/utf.h>
#include <formats/rjson.h>
@@ -23,6 +23,7 @@
#define CHEEVOS_JSON_KEY_BADGENAME 0x887685d9U
#define CHEEVOS_JSON_KEY_CONSOLE_ID 0x071656e5U
#define CHEEVOS_JSON_KEY_TOKEN 0x0e2dbd26U
#define CHEEVOS_JSON_KEY_USERNAME 0x7c8da264U
#define CHEEVOS_JSON_KEY_FLAGS 0x0d2e96b2U
#define CHEEVOS_JSON_KEY_LEADERBOARDS 0xf1247d2dU
#define CHEEVOS_JSON_KEY_RICHPRESENCE 0xf18dd230U
@@ -149,14 +150,16 @@ static int rcheevos_get_value(const char* json, unsigned key_hash,
Returns the token or the error message
*****************************************************************************/
int rcheevos_get_token(const char* json, char* token, size_t length)
int rcheevos_get_token(const char* json, char* username, size_t username_length,
char* token, size_t length)
{
rcheevos_get_value(json, CHEEVOS_JSON_KEY_ERROR, token, length);
if (!string_is_empty(token))
return -1;
return rcheevos_get_value(json, CHEEVOS_JSON_KEY_TOKEN, token, length);
return rcheevos_get_value(json, CHEEVOS_JSON_KEY_TOKEN, token, length) +
rcheevos_get_value(json, CHEEVOS_JSON_KEY_USERNAME, username, username_length);
}
int rcheevos_get_json_error(const char* json, char* token, size_t length)
+4 -41
View File
@@ -16,53 +16,16 @@
#ifndef __RARCH_CHEEVOS_PARSER_H
#define __RARCH_CHEEVOS_PARSER_H
#include <stdint.h>
#include <stddef.h>
#include <boolean.h>
#include <retro_common_api.h>
#include "cheevos_locals.h"
RETRO_BEGIN_DECLS
typedef struct
{
const char* title;
const char* description;
const char* badge;
const char* memaddr;
unsigned points;
unsigned id;
unsigned active;
} rcheevos_racheevo_t;
typedef struct
{
const char* title;
const char* description;
const char* mem;
unsigned id;
unsigned format;
} rcheevos_ralboard_t;
typedef struct
{
char* title;
rcheevos_racheevo_t* core;
rcheevos_racheevo_t* unofficial;
rcheevos_ralboard_t* lboards;
char* richpresence_script;
unsigned game_id;
unsigned console_id;
unsigned core_count;
unsigned unofficial_count;
unsigned lboard_count;
} rcheevos_rapatchdata_t;
typedef void (*rcheevos_unlock_cb_t)(unsigned id, void* userdata);
int rcheevos_get_json_error(const char* json, char* token, size_t length);
int rcheevos_get_token(const char* json, char* token, size_t length);
int rcheevos_get_token(const char* json, char* username, size_t username_length,
char* token, size_t length);
int rcheevos_get_patchdata(const char* json, rcheevos_rapatchdata_t* patchdata);
void rcheevos_free_patchdata(rcheevos_rapatchdata_t* patchdata);
-53
View File
@@ -1,53 +0,0 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2015-2016 - Andre Leiradella
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __RARCH_CHEEVOS_UTIL_H
#define __RARCH_CHEEVOS_UTIL_H
#include <retro_common_api.h>
RETRO_BEGIN_DECLS
/*****************************************************************************
Setup - mainly for debugging
*****************************************************************************/
/* Define this macro to get extra-verbose log for cheevos. */
#define CHEEVOS_VERBOSE
/*****************************************************************************
End of setup
*****************************************************************************/
#define RCHEEVOS_TAG "[RCHEEVOS]: "
#define CHEEVOS_FREE(p) do { void* q = (void*)p; if (q) free(q); } while (0)
#ifdef CHEEVOS_VERBOSE
#define CHEEVOS_LOG RARCH_LOG
#define CHEEVOS_ERR RARCH_ERR
#else
#define CHEEVOS_LOG rcheevos_log
#define CHEEVOS_ERR RARCH_ERR
void rcheevos_log(const char *fmt, ...);
#endif
RETRO_END_DECLS
#endif /* __RARCH_CHEEVOS_UTIL_H */
+103 -25
View File
@@ -66,7 +66,7 @@
#elif defined(_XBOX1) || defined(GEKKO) || defined(ANDROID)
#define DEFAULT_ASPECT_RATIO 1.3333f
#else
#define DEFAULT_ASPECT_RATIO -1.0f
#define DEFAULT_ASPECT_RATIO 1.3333f
#endif
#if defined(GEKKO)
@@ -75,7 +75,7 @@
#define DEFAULT_TOUCH_SCALE 1
#if defined(RARCH_MOBILE) || defined(HAVE_LIBNX) || defined(__WINRT__)
#if defined(RARCH_MOBILE) || defined(HAVE_LIBNX) || defined(__WINRT__) || defined(EMSCRIPTEN)
#define DEFAULT_POINTER_ENABLE true
#else
#define DEFAULT_POINTER_ENABLE false
@@ -157,6 +157,8 @@
#define DEFAULT_CRT_SWITCH_PORCH_ADJUST 0
#define DEFAULT_CRT_SWITCH_HIRES_MENU true
#define DEFAULT_HISTORY_LIST_ENABLE true
#define DEFAULT_PLAYLIST_ENTRY_RENAME true
@@ -199,51 +201,88 @@
/* To start in Fullscreen, or not. */
#if defined(HAVE_STEAM) || defined(DINGUX)
/* Start in fullscreen mode for Steam and
* Dingux builds */
#if defined(HAVE_STEAM) || defined(DINGUX) || defined(__WINRT__) || defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
/* Start in fullscreen mode for Steam and Dingux
* WinRT and Winapi Family builds */
#define DEFAULT_FULLSCREEN true
#else
#define DEFAULT_FULLSCREEN false
#endif
/* To use windowed mode or not when going fullscreen. */
#define DEFAULT_WINDOWED_FULLSCREEN true
#if defined(__WINRT__) || defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
/* Do not use windowed mode for WinRT and Winapi Family builds on the Xbox UWP with fixed resolution shrinks the image into the left top corner of the screen with some libretro cores */
#define DEFAULT_WINDOWED_FULLSCREEN false
#else
#define DEFAULT_WINDOWED_FULLSCREEN true
#endif
/* Which monitor to prefer. 0 is any monitor, 1 and up selects
* specific monitors, 1 being the first monitor. */
#define DEFAULT_MONITOR_INDEX 0
/* Window */
/* Window size. A value of 0 uses window scale
* multiplied by the core framebuffer size. */
#define DEFAULT_WINDOW_WIDTH 1280
/* DEFAULT_WINDOW_DECORATIONS:
Whether to show the usual window decorations like border, titlebar etc. */
#ifdef WEBOS
#define DEFAULT_WINDOW_DECORATIONS false
#else
#define DEFAULT_WINDOW_DECORATIONS true
#endif
/* Amount of transparency to use for the main window.
* 1 is the most transparent while 100 is opaque. */
#define DEFAULT_WINDOW_OPACITY 100
/* DEFAULT_WINDOW_SAVE_POSITIONS:
* Whether to remember window positions
* NOTE: Only enabled for desktop Windows
* at present. */
#define DEFAULT_WINDOW_SAVE_POSITIONS false
/* Whether to use custom (fixed size)
* window dimensions in windowed mode. */
#ifdef WEBOS
#define DEFAULT_WINDOW_CUSTOM_SIZE_ENABLE true
#else
#define DEFAULT_WINDOW_CUSTOM_SIZE_ENABLE false
#endif
/* Window dimensions when using a fixed size
* window. A value of 0 disables fixed size
* windows, using nominal dimensions of
* window scale multiplied by the core
* framebuffer size. */
#if defined(WEBOS)
#define DEFAULT_WINDOW_WIDTH 1920
#define DEFAULT_WINDOW_HEIGHT 1080
#else
#define DEFAULT_WINDOW_WIDTH 1280
#define DEFAULT_WINDOW_HEIGHT 720
#endif
/* Maximum auto-set window dimensions
* when not using a fixed size window */
#define DEFAULT_WINDOW_AUTO_WIDTH_MAX 1920
#define DEFAULT_WINDOW_AUTO_HEIGHT_MAX 1080
/* Fullscreen resolution. A value of 0 uses the desktop
* resolution. */
#if defined(DINGUX)
#define DEFAULT_FULLSCREEN_X 320
#define DEFAULT_FULLSCREEN_Y 240
#elif defined(__WINRT__) || defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
#define DEFAULT_FULLSCREEN_X 1920
#define DEFAULT_FULLSCREEN_Y 1080
#else
#define DEFAULT_FULLSCREEN_X 0
#define DEFAULT_FULLSCREEN_Y 0
#endif
/* Force 4k resolution */
#define DEFAULT_FORCE_RESOLUTION false
/* Number of threads to use for video recording */
#define DEFAULT_VIDEO_RECORD_THREADS 2
/* Amount of transparency to use for the main window.
* 1 is the most transparent while 100 is opaque.
*/
#define DEFAULT_WINDOW_OPACITY 100
/* Whether to show the usual window decorations like border, titlebar etc. */
#define DEFAULT_WINDOW_DECORATIONS true
#if defined(RARCH_CONSOLE) || defined(__APPLE__)
#define DEFAULT_LOAD_DUMMY_ON_CORE_SHUTDOWN false
#else
@@ -251,6 +290,10 @@
#endif
#define DEFAULT_CHECK_FIRMWARE_BEFORE_LOADING false
/* Specifies whether cores are allowed to
* present core options in category submenus */
#define DEFAULT_CORE_OPTION_CATEGORY_ENABLE true
/* Specifies whether to cache core info
* into a single (compressed) file for improved
* load times on platforms with slow IO */
@@ -294,6 +337,7 @@
* Can reduce latency at cost of higher risk of stuttering.
*/
#define DEFAULT_FRAME_DELAY 0
#define MAXIMUM_FRAME_DELAY 19
/* Inserts black frame(s) inbetween frames.
* Useful for Higher Hz monitors (set to multiples of 60 Hz) who want to play 60 Hz
@@ -377,8 +421,10 @@
/* Only scale in integer steps.
* The base size depends on system-reported geometry and aspect ratio.
* If video_force_aspect is not set, X/Y will be integer scaled independently.
* Overscale rounds up instead of down, default is downscale.
*/
#define DEFAULT_SCALE_INTEGER false
#define DEFAULT_SCALE_INTEGER_OVERSCALE false
/* Controls aspect ratio handling. */
@@ -401,12 +447,22 @@
#define DEFAULT_DINGUX_IPU_KEEP_ASPECT true
/* Sets image filtering method when using the
* IPU hardware scaler in Dingux devices */
#if defined(RETROFW)
#define DEFAULT_DINGUX_IPU_FILTER_TYPE DINGUX_IPU_FILTER_NEAREST
#else
#define DEFAULT_DINGUX_IPU_FILTER_TYPE DINGUX_IPU_FILTER_BICUBIC
#endif
#if defined(DINGUX_BETA)
/* Sets refresh rate of integral LCD panel
* in Dingux devices */
#define DEFAULT_DINGUX_REFRESH_RATE DINGUX_REFRESH_RATE_60HZ
#endif
#if defined(RS90)
/* Sets image filtering method on the RS90
* when integer scaling is disabled */
#define DEFAULT_DINGUX_RS90_SOFTFILTER_TYPE DINGUX_RS90_SOFTFILTER_POINT
#endif
#endif
/* Save configuration file on exit. */
@@ -540,6 +596,9 @@ static const bool quick_menu_show_start_streaming = true;
static const bool quick_menu_show_set_core_association = true;
static const bool quick_menu_show_reset_core_association = true;
static const bool quick_menu_show_options = true;
#define DEFAULT_QUICK_MENU_SHOW_CORE_OPTIONS_FLUSH false
static const bool quick_menu_show_controls = true;
static const bool quick_menu_show_cheats = true;
static const bool quick_menu_show_shaders = true;
@@ -726,7 +785,9 @@ static const bool default_savefiles_in_content_dir = false;
static const bool default_systemfiles_in_content_dir = false;
static const bool default_screenshots_in_content_dir = false;
#if defined(_XBOX1) || defined(__PS3__) || defined(_XBOX360) || defined(DINGUX)
#if defined(RS90) || defined(RETROFW)
#define DEFAULT_MENU_TOGGLE_GAMEPAD_COMBO INPUT_TOGGLE_START_SELECT
#elif defined(_XBOX1) || defined(__PS3__) || defined(_XBOX360) || defined(DINGUX)
#define DEFAULT_MENU_TOGGLE_GAMEPAD_COMBO INPUT_TOGGLE_L3_R3
#elif defined(PS2) || defined(PSP)
#define DEFAULT_MENU_TOGGLE_GAMEPAD_COMBO INPUT_TOGGLE_HOLD_START
@@ -777,6 +838,8 @@ static const unsigned input_backtouch_toggle = false;
/* Font size for on-screen messages. */
#if defined(DINGUX)
#define DEFAULT_FONT_SIZE 12
#elif defined(PS2)
#define DEFAULT_FONT_SIZE 16
#else
#define DEFAULT_FONT_SIZE 32
#endif
@@ -932,7 +995,7 @@ static const bool audio_enable_menu_bgm = false;
/* Output samplerate. */
#ifdef GEKKO
#define DEFAULT_OUTPUT_RATE 32000
#elif defined(_3DS)
#elif defined(_3DS) || defined(RETROFW)
#define DEFAULT_OUTPUT_RATE 32730
#else
#define DEFAULT_OUTPUT_RATE 48000
@@ -943,7 +1006,7 @@ static const bool audio_enable_menu_bgm = false;
/* Desired audio latency in milliseconds. Might not be honored
* if driver can't provide given latency. */
#if defined(ANDROID) || defined(EMSCRIPTEN)
#if defined(ANDROID) || defined(EMSCRIPTEN) || defined(RETROFW)
/* For most Android devices, 64ms is way too low. */
#define DEFAULT_OUT_LATENCY 128
#else
@@ -1016,6 +1079,13 @@ static const bool audio_enable_menu_bgm = false;
/* When set, all enabled cheats are auto-applied when a game is loaded. */
#define DEFAULT_APPLY_CHEATS_AFTER_LOAD false
#if defined(RETROFW)
/*RETROFW jz4760 has signficant slowdown with default settings */
#define DEFAULT_REWIND_BUFFER_SIZE (1 << 20)
#define DEFAULT_REWIND_BUFFER_SIZE_STEP 1
#define DEFAULT_REWIND_GRANULARITY 6
#else
/* The buffer size for the rewind buffer. This needs to be about
* 15-20MB per minute. Very game dependant. */
#define DEFAULT_REWIND_BUFFER_SIZE (20 << 20) /* 20MiB */
@@ -1025,9 +1095,9 @@ static const bool audio_enable_menu_bgm = false;
/* How many frames to rewind at a time. */
#define DEFAULT_REWIND_GRANULARITY 1
#endif
/* Pause gameplay when gameplay loses focus. */
#ifdef EMSCRIPTEN
#if defined(EMSCRIPTEN) || defined(WEBOS)
#define DEFAULT_PAUSE_NONACTIVE false
#else
#define DEFAULT_PAUSE_NONACTIVE true
@@ -1309,6 +1379,14 @@ static const unsigned menu_left_thumbnails_default = 0;
static const unsigned gfx_thumbnail_upscale_threshold = 0;
#ifdef HAVE_MENU
#if defined(RS90)
/* The RS-90 has a hardware clock that is neither
* configurable nor persistent, rendering it useless.
* We therefore hide it in the menu by default. */
#define DEFAULT_MENU_TIMEDATE_ENABLE false
#else
#define DEFAULT_MENU_TIMEDATE_ENABLE true
#endif
#define DEFAULT_MENU_TIMEDATE_STYLE MENU_TIMEDATE_STYLE_DDMM_HM
#define DEFAULT_MENU_TIMEDATE_DATE_SEPARATOR MENU_TIMEDATE_DATE_SEPARATOR_HYPHEN
#endif
+4 -4
View File
@@ -195,7 +195,7 @@ static const struct retro_keybind retro_keybinds_1[] = {
NULL, NULL,
AXIS_NONE, AXIS_NONE, AXIS_NONE,
MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_TRIGGER, RETROK_UNKNOWN,
RARCH_LIGHTGUN_TRIGGER, NO_BTN, NO_BTN, 0,
RARCH_LIGHTGUN_TRIGGER, RETRO_DEVICE_ID_MOUSE_LEFT, NO_BTN, 0,
true
},
{
@@ -750,7 +750,7 @@ static const struct retro_keybind retro_keybinds_1[] = {
NULL, NULL,
AXIS_NONE, AXIS_NONE, AXIS_NONE,
MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_TRIGGER, RETROK_UNKNOWN,
RARCH_LIGHTGUN_TRIGGER, NO_BTN, NO_BTN, 0,
RARCH_LIGHTGUN_TRIGGER, RETRO_DEVICE_ID_MOUSE_LEFT, NO_BTN, 0,
true
},
{
@@ -1304,7 +1304,7 @@ static const struct retro_keybind retro_keybinds_1[] = {
NULL, NULL,
AXIS_NONE, AXIS_NONE, AXIS_NONE,
MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_TRIGGER, RETROK_UNKNOWN,
RARCH_LIGHTGUN_TRIGGER, NO_BTN, NO_BTN, 0,
RARCH_LIGHTGUN_TRIGGER, RETRO_DEVICE_ID_MOUSE_LEFT, NO_BTN, 0,
true
},
{
@@ -1872,7 +1872,7 @@ static const struct retro_keybind retro_keybinds_rest[] = {
NULL, NULL,
AXIS_NONE, AXIS_NONE, AXIS_NONE,
MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_TRIGGER, RETROK_UNKNOWN,
RARCH_LIGHTGUN_TRIGGER, NO_BTN, NO_BTN, 0,
RARCH_LIGHTGUN_TRIGGER, RETRO_DEVICE_ID_MOUSE_LEFT, NO_BTN, 0,
true
},
{
+148 -40
View File
@@ -45,7 +45,6 @@
#include "paths.h"
#include "retroarch.h"
#include "verbosity.h"
#include "lakka.h"
#include "gfx/gfx_animation.h"
@@ -58,6 +57,12 @@
#include "uwp/uwp_func.h"
#endif
#include "lakka.h"
#if defined(HAVE_LAKKA) || defined(HAVE_LIBNX)
#include "switch_performance_profiles.h"
#endif
enum video_driver_enum
{
VIDEO_GL = 0,
@@ -70,6 +75,7 @@ enum video_driver_enum
VIDEO_SDL,
VIDEO_SDL2,
VIDEO_SDL_DINGUX,
VIDEO_SDL_RS90,
VIDEO_EXT,
VIDEO_WII,
VIDEO_WIIU,
@@ -213,6 +219,7 @@ enum bluetooth_driver_enum
enum wifi_driver_enum
{
WIFI_CONNMANCTL = BLUETOOTH_NULL + 1,
WIFI_NMCLI,
WIFI_NULL
};
@@ -259,6 +266,9 @@ static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_GL;
#else
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_METAL;
#endif
#elif defined(__WINRT__) || defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
/* Lets default to D3D11 in UWP, even when its compiled with ANGLE, since ANGLE is just calling D3D anyway.*/
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_D3D11;
#elif defined(HAVE_OPENGL1) && defined(_MSC_VER) && (_MSC_VER <= 1600)
/* On Windows XP and earlier, use gl1 by default
* (regular opengl has compatibility issues with
@@ -307,7 +317,11 @@ static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_SDL;
#elif defined(HAVE_SDL2)
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_SDL2;
#elif defined(HAVE_SDL_DINGUX)
#if defined(RS90)
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_SDL_RS90;
#else
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_SDL_DINGUX;
#endif
#elif defined(_WIN32) && !defined(_XBOX)
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_GDI;
#elif defined(DJGPP)
@@ -338,9 +352,13 @@ static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_PS3;
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_CTR;
#elif defined(SWITCH)
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_SWITCH;
#elif defined(DINGUX_BETA) && defined(HAVE_ALSA)
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_ALSA;
#elif defined(DINGUX) && defined(HAVE_AL)
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_AL;
#elif defined(HAVE_PULSE)
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_PULSE;
#elif defined(HAVE_ALSA) && defined(HAVE_VIDEOCORE)
#elif defined(HAVE_ALSA) && defined(HAVE_THREADS)
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_ALSATHREAD;
#elif defined(HAVE_ALSA)
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_ALSA;
@@ -382,7 +400,9 @@ static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_EXT;
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_NULL;
#endif
#if defined(PSP) || defined(EMSCRIPTEN)
#if defined(RS90)
static const enum audio_resampler_driver_enum AUDIO_DEFAULT_RESAMPLER_DRIVER = AUDIO_RESAMPLER_NEAREST;
#elif defined(PSP) || defined(EMSCRIPTEN)
static const enum audio_resampler_driver_enum AUDIO_DEFAULT_RESAMPLER_DRIVER = AUDIO_RESAMPLER_CC;
#else
static const enum audio_resampler_driver_enum AUDIO_DEFAULT_RESAMPLER_DRIVER = AUDIO_RESAMPLER_SINC;
@@ -396,7 +416,7 @@ static const enum record_driver_enum RECORD_DEFAULT_DRIVER = RECORD_NULL;
#ifdef HAVE_WINMM
static const enum midi_driver_enum MIDI_DEFAULT_DRIVER = MIDI_WINMM;
#elif defined(HAVE_ALSA) && !defined(HAVE_HAKCHI) && !defined(HAVE_SEGAM)
#elif defined(HAVE_ALSA) && !defined(HAVE_HAKCHI) && !defined(HAVE_SEGAM) && !defined(DINGUX)
static const enum midi_driver_enum MIDI_DEFAULT_DRIVER = MIDI_ALSA;
#else
static const enum midi_driver_enum MIDI_DEFAULT_DRIVER = MIDI_NULL;
@@ -412,6 +432,8 @@ static const enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_XINPUT;
static const enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_ANDROID;
#elif defined(EMSCRIPTEN) && defined(HAVE_SDL2)
static const enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_SDL2;
#elif defined(WEBOS) && defined(HAVE_SDL2)
static const enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_SDL2;
#elif defined(EMSCRIPTEN)
static const enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_RWEBINPUT;
#elif defined(_WIN32) && defined(HAVE_DINPUT)
@@ -464,6 +486,8 @@ static const enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_XINPUT;
static const enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_GX;
#elif defined(WIIU)
static const enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_WIIU;
#elif defined(WEBOS)
static const enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_SDL;
#elif defined(_XBOX)
static const enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_XDK;
#elif defined(PS2)
@@ -846,6 +870,8 @@ const char *config_get_default_video(void)
return "xvideo";
case VIDEO_SDL_DINGUX:
return "sdl_dingux";
case VIDEO_SDL_RS90:
return "sdl_rs90";
case VIDEO_SDL:
return "sdl";
case VIDEO_SDL2:
@@ -1090,6 +1116,8 @@ const char *config_get_default_wifi(void)
{
case WIFI_CONNMANCTL:
return "connmanctl";
case WIFI_NMCLI:
return "nmcli";
case WIFI_NULL:
break;
}
@@ -1457,6 +1485,7 @@ static struct config_bool_setting *populate_settings_bool(
SETTING_BOOL("frame_time_counter_reset_after_load_state", &settings->bools.frame_time_counter_reset_after_load_state, true, false, false);
SETTING_BOOL("frame_time_counter_reset_after_save_state", &settings->bools.frame_time_counter_reset_after_save_state, true, false, false);
SETTING_BOOL("crt_switch_resolution_use_custom_refresh_rate", &settings->bools.crt_switch_custom_refresh_enable, true, false, false);
SETTING_BOOL("crt_switch_hires_menu", &settings->bools.crt_switch_hires_menu, true, false, true);
SETTING_BOOL("ui_companion_start_on_boot", &settings->bools.ui_companion_start_on_boot, true, ui_companion_start_on_boot, false);
SETTING_BOOL("ui_companion_enable", &settings->bools.ui_companion_enable, true, ui_companion_enable, false);
SETTING_BOOL("ui_companion_toggle", &settings->bools.ui_companion_toggle, false, ui_companion_toggle, false);
@@ -1494,7 +1523,12 @@ static struct config_bool_setting *populate_settings_bool(
SETTING_BOOL("input_descriptor_hide_unbound", &settings->bools.input_descriptor_hide_unbound, true, input_descriptor_hide_unbound, false);
SETTING_BOOL("load_dummy_on_core_shutdown", &settings->bools.load_dummy_on_core_shutdown, true, DEFAULT_LOAD_DUMMY_ON_CORE_SHUTDOWN, false);
SETTING_BOOL("check_firmware_before_loading", &settings->bools.check_firmware_before_loading, true, DEFAULT_CHECK_FIRMWARE_BEFORE_LOADING, false);
SETTING_BOOL("core_option_category_enable", &settings->bools.core_option_category_enable, true, DEFAULT_CORE_OPTION_CATEGORY_ENABLE, false);
#if defined(__WINRT__) || defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
SETTING_BOOL("core_info_cache_enable", &settings->bools.core_info_cache_enable, false, DEFAULT_CORE_INFO_CACHE_ENABLE, false);
#else
SETTING_BOOL("core_info_cache_enable", &settings->bools.core_info_cache_enable, true, DEFAULT_CORE_INFO_CACHE_ENABLE, false);
#endif
#ifndef HAVE_DYNAMIC
SETTING_BOOL("always_reload_core_on_run_content", &settings->bools.always_reload_core_on_run_content, true, DEFAULT_ALWAYS_RELOAD_CORE_ON_RUN_CONTENT, false);
#endif
@@ -1526,6 +1560,7 @@ static struct config_bool_setting *populate_settings_bool(
SETTING_BOOL("video_windowed_fullscreen", &settings->bools.video_windowed_fullscreen, true, DEFAULT_WINDOWED_FULLSCREEN, false);
SETTING_BOOL("video_crop_overscan", &settings->bools.video_crop_overscan, true, DEFAULT_CROP_OVERSCAN, false);
SETTING_BOOL("video_scale_integer", &settings->bools.video_scale_integer, true, DEFAULT_SCALE_INTEGER, false);
SETTING_BOOL("video_scale_integer_overscale", &settings->bools.video_scale_integer_overscale, true, DEFAULT_SCALE_INTEGER_OVERSCALE, false);
SETTING_BOOL("video_smooth", &settings->bools.video_smooth, true, DEFAULT_VIDEO_SMOOTH, false);
SETTING_BOOL("video_ctx_scaling", &settings->bools.video_ctx_scaling, true, DEFAULT_VIDEO_CTX_SCALING, false);
SETTING_BOOL("video_force_aspect", &settings->bools.video_force_aspect, true, DEFAULT_FORCE_ASPECT, false);
@@ -1537,9 +1572,6 @@ static struct config_bool_setting *populate_settings_bool(
SETTING_BOOL("auto_screenshot_filename", &settings->bools.auto_screenshot_filename, true, DEFAULT_AUTO_SCREENSHOT_FILENAME, false);
SETTING_BOOL("video_force_srgb_disable", &settings->bools.video_force_srgb_disable, true, false, false);
SETTING_BOOL("video_fullscreen", &settings->bools.video_fullscreen, true, DEFAULT_FULLSCREEN, false);
#ifdef __WINRT__
SETTING_BOOL("video_force_resolution", &settings->bools.video_force_resolution, true, DEFAULT_FORCE_RESOLUTION, false);
#endif
SETTING_BOOL("bundle_assets_extract_enable", &settings->bools.bundle_assets_extract_enable, true, DEFAULT_BUNDLE_ASSETS_EXTRACT_ENABLE, false);
SETTING_BOOL("video_vsync", &settings->bools.video_vsync, true, DEFAULT_VSYNC, false);
SETTING_BOOL("video_adaptive_vsync", &settings->bools.video_adaptive_vsync, true, DEFAULT_ADAPTIVE_VSYNC, false);
@@ -1606,7 +1638,7 @@ static struct config_bool_setting *populate_settings_bool(
SETTING_BOOL("menu_insert_disk_resume", &settings->bools.menu_insert_disk_resume, true, DEFAULT_MENU_INSERT_DISK_RESUME, false);
SETTING_BOOL("menu_mouse_enable", &settings->bools.menu_mouse_enable, true, DEFAULT_MOUSE_ENABLE, false);
SETTING_BOOL("menu_pointer_enable", &settings->bools.menu_pointer_enable, true, DEFAULT_POINTER_ENABLE, false);
SETTING_BOOL("menu_timedate_enable", &settings->bools.menu_timedate_enable, true, true, false);
SETTING_BOOL("menu_timedate_enable", &settings->bools.menu_timedate_enable, true, DEFAULT_MENU_TIMEDATE_ENABLE, false);
SETTING_BOOL("menu_battery_level_enable", &settings->bools.menu_battery_level_enable, true, true, false);
SETTING_BOOL("menu_core_enable", &settings->bools.menu_core_enable, true, true, false);
SETTING_BOOL("menu_show_sublabels", &settings->bools.menu_show_sublabels, true, menu_show_sublabels, false);
@@ -1651,6 +1683,7 @@ static struct config_bool_setting *populate_settings_bool(
SETTING_BOOL("quick_menu_show_set_core_association", &settings->bools.quick_menu_show_set_core_association, true, quick_menu_show_set_core_association, false);
SETTING_BOOL("quick_menu_show_reset_core_association", &settings->bools.quick_menu_show_reset_core_association, true, quick_menu_show_reset_core_association, false);
SETTING_BOOL("quick_menu_show_options", &settings->bools.quick_menu_show_options, true, quick_menu_show_options, false);
SETTING_BOOL("quick_menu_show_core_options_flush", &settings->bools.quick_menu_show_core_options_flush, true, DEFAULT_QUICK_MENU_SHOW_CORE_OPTIONS_FLUSH, false);
SETTING_BOOL("quick_menu_show_controls", &settings->bools.quick_menu_show_controls, true, quick_menu_show_controls, false);
SETTING_BOOL("quick_menu_show_cheats", &settings->bools.quick_menu_show_cheats, true, quick_menu_show_cheats, false);
SETTING_BOOL("quick_menu_show_shaders", &settings->bools.quick_menu_show_shaders, true, quick_menu_show_shaders, false);
@@ -1739,6 +1772,7 @@ static struct config_bool_setting *populate_settings_bool(
SETTING_BOOL("cheevos_enable", &settings->bools.cheevos_enable, true, DEFAULT_CHEEVOS_ENABLE, false);
SETTING_BOOL("cheevos_test_unofficial", &settings->bools.cheevos_test_unofficial, true, false, false);
SETTING_BOOL("cheevos_hardcore_mode_enable", &settings->bools.cheevos_hardcore_mode_enable, true, false, false);
SETTING_BOOL("cheevos_challenge_indicators", &settings->bools.cheevos_challenge_indicators, true, true, false);
SETTING_BOOL("cheevos_richpresence_enable", &settings->bools.cheevos_richpresence_enable, true, true, false);
SETTING_BOOL("cheevos_unlock_sound_enable", &settings->bools.cheevos_unlock_sound_enable, true, false, false);
SETTING_BOOL("cheevos_verbose_enable", &settings->bools.cheevos_verbose_enable, true, false, false);
@@ -1792,6 +1826,7 @@ static struct config_bool_setting *populate_settings_bool(
SETTING_BOOL("show_hidden_files", &settings->bools.show_hidden_files, true, DEFAULT_SHOW_HIDDEN_FILES, false);
SETTING_BOOL("use_last_start_directory", &settings->bools.use_last_start_directory, true, DEFAULT_USE_LAST_START_DIRECTORY, false);
SETTING_BOOL("input_autodetect_enable", &settings->bools.input_autodetect_enable, true, input_autodetect_enable, false);
SETTING_BOOL("input_auto_mouse_grab", &settings->bools.input_auto_mouse_grab, true, false, false);
#if defined(HAVE_DINPUT) || defined(HAVE_WINRAWINPUT)
SETTING_BOOL("input_nowinkey_enable", &settings->bools.input_nowinkey_enable, true, false, false);
#endif
@@ -1809,7 +1844,8 @@ static struct config_bool_setting *populate_settings_bool(
SETTING_BOOL("video_msg_bgcolor_enable", &settings->bools.video_msg_bgcolor_enable, true, message_bgcolor_enable, false);
SETTING_BOOL("video_window_show_decorations", &settings->bools.video_window_show_decorations, true, DEFAULT_WINDOW_DECORATIONS, false);
SETTING_BOOL("video_window_save_positions", &settings->bools.video_window_save_positions, true, false, false);
SETTING_BOOL("video_window_save_positions", &settings->bools.video_window_save_positions, true, DEFAULT_WINDOW_SAVE_POSITIONS, false);
SETTING_BOOL("video_window_custom_size_enable", &settings->bools.video_window_custom_size_enable, true, DEFAULT_WINDOW_CUSTOM_SIZE_ENABLE, false);
SETTING_BOOL("sustained_performance_mode", &settings->bools.sustained_performance_mode, true, sustained_performance_mode, false);
@@ -1904,7 +1940,7 @@ static struct config_float_setting *populate_settings_float(
SETTING_FLOAT("video_font_size", &settings->floats.video_font_size, true, DEFAULT_FONT_SIZE, false);
SETTING_FLOAT("fastforward_ratio", &settings->floats.fastforward_ratio, true, DEFAULT_FASTFORWARD_RATIO, false);
SETTING_FLOAT("slowmotion_ratio", &settings->floats.slowmotion_ratio, true, DEFAULT_SLOWMOTION_RATIO, false);
SETTING_FLOAT("input_axis_threshold", input_driver_get_float(INPUT_ACTION_AXIS_THRESHOLD), true, DEFAULT_AXIS_THRESHOLD, false);
SETTING_FLOAT("input_axis_threshold", &settings->floats.input_axis_threshold, true, DEFAULT_AXIS_THRESHOLD, false);
SETTING_FLOAT("input_analog_deadzone", &settings->floats.input_analog_deadzone, true, DEFAULT_ANALOG_DEADZONE, false);
SETTING_FLOAT("input_analog_sensitivity", &settings->floats.input_analog_sensitivity, true, DEFAULT_ANALOG_SENSITIVITY, false);
SETTING_FLOAT("video_msg_bgcolor_opacity", &settings->floats.video_msg_bgcolor_opacity, true, message_bgcolor_opacity, false);
@@ -1935,7 +1971,7 @@ static struct config_uint_setting *populate_settings_uint(
SETTING_UINT("input_duty_cycle", &settings->uints.input_turbo_duty_cycle, true, turbo_duty_cycle, false);
SETTING_UINT("input_turbo_mode", &settings->uints.input_turbo_mode, true, turbo_mode, false);
SETTING_UINT("input_turbo_default_button", &settings->uints.input_turbo_default_button, true, turbo_default_btn, false);
SETTING_UINT("input_max_users", input_driver_get_uint(INPUT_ACTION_MAX_USERS), true, input_max_users, false);
SETTING_UINT("input_max_users", &settings->uints.input_max_users, true, input_max_users, false);
SETTING_UINT("fps_update_interval", &settings->uints.fps_update_interval, true, DEFAULT_FPS_UPDATE_INTERVAL, false);
SETTING_UINT("memory_update_interval", &settings->uints.memory_update_interval, true, DEFAULT_MEMORY_UPDATE_INTERVAL, false);
SETTING_UINT("input_menu_toggle_gamepad_combo", &settings->uints.input_menu_toggle_gamepad_combo, true, DEFAULT_MENU_TOGGLE_GAMEPAD_COMBO, false);
@@ -2094,8 +2130,10 @@ static struct config_uint_setting *populate_settings_uint(
SETTING_UINT("video_stream_scale_factor", &settings->uints.video_stream_scale_factor, true, 1, false);
SETTING_UINT("video_windowed_position_x", &settings->uints.window_position_x, true, 0, false);
SETTING_UINT("video_windowed_position_y", &settings->uints.window_position_y, true, 0, false);
SETTING_UINT("video_windowed_position_width", &settings->uints.window_position_width, true, DEFAULT_WINDOW_WIDTH, false);
SETTING_UINT("video_windowed_position_height", &settings->uints.window_position_height, true, DEFAULT_WINDOW_HEIGHT, false);
SETTING_UINT("video_windowed_position_width", &settings->uints.window_position_width, true, DEFAULT_WINDOW_WIDTH, false);
SETTING_UINT("video_windowed_position_height", &settings->uints.window_position_height, true, DEFAULT_WINDOW_HEIGHT, false);
SETTING_UINT("video_window_auto_width_max", &settings->uints.window_auto_width_max, true, DEFAULT_WINDOW_AUTO_WIDTH_MAX, false);
SETTING_UINT("video_window_auto_height_max", &settings->uints.window_auto_height_max, true, DEFAULT_WINDOW_AUTO_HEIGHT_MAX, false);
SETTING_UINT("ai_service_mode", &settings->uints.ai_service_mode, true, DEFAULT_AI_SERVICE_MODE, false);
SETTING_UINT("ai_service_target_lang", &settings->uints.ai_service_target_lang, true, 0, false);
SETTING_UINT("ai_service_source_lang", &settings->uints.ai_service_source_lang, true, 0, false);
@@ -2115,6 +2153,9 @@ static struct config_uint_setting *populate_settings_uint(
#if defined(DINGUX_BETA)
SETTING_UINT("video_dingux_refresh_rate", &settings->uints.video_dingux_refresh_rate, true, DEFAULT_DINGUX_REFRESH_RATE, false);
#endif
#if defined(RS90)
SETTING_UINT("video_dingux_rs90_softfilter_type", &settings->uints.video_dingux_rs90_softfilter_type, true, DEFAULT_DINGUX_RS90_SOFTFILTER_TYPE, false);
#endif
#endif
#ifdef HAVE_MENU
@@ -2430,10 +2471,8 @@ void config_set_defaults(void *data)
#endif
input_config_reset();
#ifdef HAVE_CONFIGFILE
input_remapping_deinit();
input_remapping_set_defaults();
#endif
input_remapping_set_defaults(false);
/* Verify that binds are in proper order. */
for (i = 0; i < MAX_USERS; i++)
@@ -2456,14 +2495,14 @@ void config_set_defaults(void *data)
for (i = 0; i < MAX_USERS; i++)
{
settings->uints.input_joypad_map[i] = i;
settings->uints.input_joypad_index[i] = i;
#ifdef SWITCH /* Switch prefered default dpad mode */
settings->uints.input_analog_dpad_mode[i] = ANALOG_DPAD_LSTICK;
#else
settings->uints.input_analog_dpad_mode[i] = ANALOG_DPAD_NONE;
#endif
input_config_set_device(i, RETRO_DEVICE_JOYPAD);
settings->uints.input_mouse_index[i] = 0;
settings->uints.input_mouse_index[i] = i;
}
video_driver_reset_custom_viewport();
@@ -3047,6 +3086,7 @@ static bool config_load_file(global_t *global,
bool ret = false;
unsigned tmp_uint = 0;
bool tmp_bool = false;
static bool first_load = true;
unsigned msg_color = 0;
char *save = NULL;
char *override_username = NULL;
@@ -3138,13 +3178,24 @@ static bool config_load_file(global_t *global,
settings->bools.network_remote_enable_user[i], tmp_bool);
}
#endif
if (config_get_bool(conf, "log_verbosity", &tmp_bool))
/* Set verbosity according to config only if the 'v' command line argument was not used
* or if it is not the first config load. */
if (config_get_bool(conf, "log_verbosity", &tmp_bool) &&
(!retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_VERBOSITY, NULL) ||
!first_load))
{
if (tmp_bool)
verbosity_enable();
else
verbosity_disable();
}
/* On first config load, make sure log_to_file is true if 'log-file' command line
* argument was used. */
if (retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_LOG_TO_FILE, NULL) &&
first_load)
{
configuration_set_bool(settings,settings->bools.log_to_file,true);
}
if (config_get_uint(conf, "frontend_log_level", &tmp_uint))
{
verbosity_set_log_level(tmp_uint);
@@ -3191,7 +3242,7 @@ static bool config_load_file(global_t *global,
buf[0] = '\0';
snprintf(buf, sizeof(buf), "input_player%u_joypad_index", i + 1);
CONFIG_GET_INT_BASE(conf, settings, uints.input_joypad_map[i], buf);
CONFIG_GET_INT_BASE(conf, settings, uints.input_joypad_index[i], buf);
snprintf(buf, sizeof(buf), "input_player%u_analog_dpad_mode", i + 1);
CONFIG_GET_INT_BASE(conf, settings, uints.input_analog_dpad_mode[i], buf);
@@ -3275,8 +3326,8 @@ static bool config_load_file(global_t *global,
if (settings->uints.video_hard_sync_frames > 3)
settings->uints.video_hard_sync_frames = 3;
if (settings->uints.video_frame_delay > 15)
settings->uints.video_frame_delay = 15;
if (settings->uints.video_frame_delay > MAXIMUM_FRAME_DELAY)
settings->uints.video_frame_delay = MAXIMUM_FRAME_DELAY;
settings->uints.video_swap_interval = MAX(settings->uints.video_swap_interval, 1);
settings->uints.video_swap_interval = MIN(settings->uints.video_swap_interval, 4);
@@ -3575,6 +3626,7 @@ end:
free(path_settings);
if (size_settings)
free(size_settings);
first_load = false;
return ret;
}
@@ -3851,9 +3903,7 @@ bool config_load_remap(const char *directory_input_remapping,
FILE_PATH_REMAP_EXTENSION,
sizeof(game_path));
#ifdef HAVE_CONFIGFILE
input_remapping_set_defaults();
#endif
input_remapping_set_defaults(false);
/* If a game remap file exists, load it. */
if ((new_conf = config_file_new_from_path_to_string(game_path)))
@@ -3923,15 +3973,15 @@ success:
*/
static void config_parse_file(global_t *global)
{
const char *config_path = path_get(RARCH_PATH_CONFIG);
if (path_is_empty(RARCH_PATH_CONFIG))
{
RARCH_LOG("[Config]: Loading default config.\n");
}
else
RARCH_LOG("[Config]: Loading config from: \"%s\".\n", config_path);
{
const char *config_path = path_get(RARCH_PATH_CONFIG);
RARCH_LOG("[Config]: Loading config from: \"%s\".\n", config_path);
if (!config_load_file(global, config_path, config_get_ptr()))
{
RARCH_ERR("[Config]: Couldn't find config at path: \"%s\".\n",
@@ -4224,7 +4274,7 @@ bool config_save_file(const char *path)
snprintf(cfg, sizeof(cfg), "input_device_p%u", i + 1);
config_set_int(conf, cfg, settings->uints.input_device[i]);
snprintf(cfg, sizeof(cfg), "input_player%u_joypad_index", i + 1);
config_set_int(conf, cfg, settings->uints.input_joypad_map[i]);
config_set_int(conf, cfg, settings->uints.input_joypad_index[i]);
snprintf(cfg, sizeof(cfg), "input_libretro_device_p%u", i + 1);
config_set_int(conf, cfg, input_config_get_device(i));
snprintf(cfg, sizeof(cfg), "input_player%u_analog_dpad_mode", i + 1);
@@ -4487,11 +4537,11 @@ bool config_save_overrides(enum override_type type, void *data)
config_set_int(conf, cfg, overrides->uints.input_device[i]);
}
if (settings->uints.input_joypad_map[i]
!= overrides->uints.input_joypad_map[i])
if (settings->uints.input_joypad_index[i]
!= overrides->uints.input_joypad_index[i])
{
snprintf(cfg, sizeof(cfg), "input_player%u_joypad_index", i + 1);
config_set_int(conf, cfg, overrides->uints.input_joypad_map[i]);
config_set_int(conf, cfg, overrides->uints.input_joypad_index[i]);
}
}
@@ -4604,7 +4654,7 @@ bool input_remapping_load_file(void *data, const char *path)
if (!string_is_empty(global->name.remapfile))
{
input_remapping_deinit();
input_remapping_set_defaults();
input_remapping_set_defaults(false);
}
global->name.remapfile = strdup(path);
@@ -4612,9 +4662,6 @@ bool input_remapping_load_file(void *data, const char *path)
{
char s1[32], s2[32], s3[32];
global->old_analog_dpad_mode[i] = settings->uints.input_analog_dpad_mode[i];
global->old_libretro_device[i] = settings->uints.input_libretro_device[i];
s1[0] = '\0';
s2[0] = '\0';
s3[0] = '\0';
@@ -4658,10 +4705,13 @@ bool input_remapping_load_file(void *data, const char *path)
}
else
{
char stk_ident[128];
char stk_ident[256];
char key_ident[128];
int stk_remap = -1;
int key_remap = -1;
stk_ident[0] = '\0';
key_ident[0] = '\0';
fill_pathname_join_delim(stk_ident, s3,
key_string, '$', sizeof(stk_ident));
@@ -4680,6 +4730,15 @@ bool input_remapping_load_file(void *data, const char *path)
configuration_set_uint(settings,
settings->uints.input_remap_ids[i][j], stk_remap);
}
fill_pathname_join_delim(key_ident, s2,
key_string, '_', sizeof(key_ident));
if (!config_get_int(conf, key_ident, &key_remap))
key_remap = RETROK_UNKNOWN;
configuration_set_uint(settings,
settings->uints.input_keymapper_ids[i][j], key_remap);
}
}
@@ -4688,8 +4747,18 @@ bool input_remapping_load_file(void *data, const char *path)
snprintf(s1, sizeof(s1), "input_libretro_device_p%u", i + 1);
CONFIG_GET_INT_BASE(conf, settings, uints.input_libretro_device[i], s1);
snprintf(s1, sizeof(s1), "input_remap_port_p%u", i + 1);
CONFIG_GET_INT_BASE(conf, settings, uints.input_remap_ports[i], s1);
}
input_remapping_update_port_map();
/* Whenever a remap file is loaded, subsequent
* changes to global remap-related parameters
* must be reset at the next core deinitialisation */
input_remapping_enable_global_config_restore();
return true;
}
@@ -4712,8 +4781,8 @@ bool input_remapping_save_file(const char *path)
"a", "x", "l", "r", "l2", "r2",
"l3", "r3", "l_x+", "l_x-", "l_y+", "l_y-", "r_x+", "r_x-", "r_y+", "r_y-" };
config_file_t *conf = NULL;
unsigned max_users = *(input_driver_get_uint(INPUT_ACTION_MAX_USERS));
settings_t *settings = config_get_ptr();
unsigned max_users = settings->uints.input_max_users;
const char *dir_input_remapping = settings->paths.directory_input_remapping;
remap_file[0] = '\0';
@@ -4728,14 +4797,38 @@ bool input_remapping_save_file(const char *path)
return false;
}
for (i = 0; i < max_users; i++)
for (i = 0; i < MAX_USERS; i++)
{
char s1[32], s2[32], s3[32];
bool skip_port = true;
char s1[32];
char s2[32];
char s3[32];
s1[0] = '\0';
s2[0] = '\0';
s3[0] = '\0';
/* We must include all mapped ports + all those
* with an index less than max_users */
if (i < max_users)
skip_port = false;
else
{
/* Check whether current port is mapped
* to an input device */
for (j = 0; j < max_users; j++)
{
if (i == settings->uints.input_remap_ports[j])
{
skip_port = false;
break;
}
}
}
if (skip_port)
continue;
snprintf(s1, sizeof(s1), "input_player%u_btn", i + 1);
snprintf(s2, sizeof(s2), "input_player%u_key", i + 1);
snprintf(s3, sizeof(s3), "input_player%u_stk", i + 1);
@@ -4777,6 +4870,7 @@ bool input_remapping_save_file(const char *path)
{
char stk_ident[128];
unsigned remap_id = settings->uints.input_remap_ids[i][j];
unsigned keymap_id = settings->uints.input_keymapper_ids[i][j];
const char *key_string = key_strings[j];
stk_ident[0] = '\0';
fill_pathname_join_delim(stk_ident, s3,
@@ -4793,12 +4887,26 @@ bool input_remapping_save_file(const char *path)
config_set_int(conf, stk_ident,
settings->uints.input_remap_ids[i][j]);
}
if (keymap_id != RETROK_UNKNOWN)
{
char key_ident[128];
key_ident[0] = '\0';
fill_pathname_join_delim(key_ident, s2,
key_string, '_', sizeof(key_ident));
config_set_int(conf, key_ident,
settings->uints.input_keymapper_ids[i][j]);
}
}
snprintf(s1, sizeof(s1), "input_libretro_device_p%u", i + 1);
config_set_int(conf, s1, input_config_get_device(i));
snprintf(s1, sizeof(s1), "input_player%u_analog_dpad_mode", i + 1);
config_set_int(conf, s1, settings->uints.input_analog_dpad_mode[i]);
snprintf(s1, sizeof(s1), "input_remap_port_p%u", i + 1);
config_set_int(conf, s1, settings->uints.input_remap_ports[i]);
}
ret = config_file_write(conf, remap_file, true);
+19 -5
View File
@@ -67,7 +67,9 @@ enum crt_switch_type
{
CRT_SWITCH_NONE = 0,
CRT_SWITCH_15KHZ,
CRT_SWITCH_31KHZ
CRT_SWITCH_31KHZ,
CRT_SWITCH_32_120,
CRT_SWITCH_INI
};
enum override_type
@@ -120,7 +122,7 @@ typedef struct settings
unsigned placeholder;
unsigned input_split_joycon[MAX_USERS];
unsigned input_joypad_map[MAX_USERS];
unsigned input_joypad_index[MAX_USERS];
unsigned input_device[MAX_USERS];
unsigned input_mouse_index[MAX_USERS];
/* Set by autoconfiguration in joypad_autoconfig_dir.
@@ -128,9 +130,10 @@ typedef struct settings
unsigned input_libretro_device[MAX_USERS];
unsigned input_analog_dpad_mode[MAX_USERS];
unsigned input_keymapper_ids[MAX_USERS][RARCH_CUSTOM_BIND_LIST_END];
unsigned input_remap_ports[MAX_USERS];
unsigned input_remap_ids[MAX_USERS][RARCH_CUSTOM_BIND_LIST_END];
unsigned input_keymapper_ids[MAX_USERS][RARCH_CUSTOM_BIND_LIST_END];
unsigned input_remap_port_map[MAX_USERS][MAX_USERS + 1];
unsigned led_map[MAX_LEDS];
@@ -162,6 +165,7 @@ typedef struct settings
unsigned input_poll_type_behavior;
unsigned input_dingux_rumble_gain;
unsigned input_auto_game_focus;
unsigned input_max_users;
unsigned netplay_port;
unsigned netplay_input_latency_frames_min;
@@ -206,6 +210,7 @@ typedef struct settings
unsigned video_3ds_display_mode;
unsigned video_dingux_ipu_filter_type;
unsigned video_dingux_refresh_rate;
unsigned video_dingux_rs90_softfilter_type;
#ifdef HAVE_VIDEO_LAYOUT
unsigned video_layout_selected_view;
#endif
@@ -278,6 +283,8 @@ typedef struct settings
unsigned window_position_y;
unsigned window_position_width;
unsigned window_position_height;
unsigned window_auto_width_max;
unsigned window_auto_height_max;
unsigned video_record_threads;
@@ -346,6 +353,7 @@ typedef struct settings
float slowmotion_ratio;
float fastforward_ratio;
float input_analog_deadzone;
float input_axis_threshold;
float input_analog_sensitivity;
} floats;
@@ -494,6 +502,7 @@ typedef struct settings
bool video_aspect_ratio_auto;
bool video_dingux_ipu_keep_aspect;
bool video_scale_integer;
bool video_scale_integer_overscale;
bool video_shader_enable;
bool video_shader_watch_files;
bool video_shader_remember_last_dir;
@@ -517,7 +526,6 @@ typedef struct settings
#ifdef HAVE_VIDEO_LAYOUT
bool video_layout_enable;
#endif
bool video_force_resolution;
/* Accessibility */
bool accessibility_enable;
@@ -553,6 +561,7 @@ typedef struct settings
bool input_backtouch_toggle;
bool input_small_keyboard_enable;
bool input_keyboard_gamepad_enable;
bool input_auto_mouse_grab;
#if defined(HAVE_DINPUT) || defined(HAVE_WINRAWINPUT)
bool input_nowinkey_enable;
#endif
@@ -684,6 +693,7 @@ typedef struct settings
bool quick_menu_show_set_core_association;
bool quick_menu_show_reset_core_association;
bool quick_menu_show_options;
bool quick_menu_show_core_options_flush;
bool quick_menu_show_controls;
bool quick_menu_show_cheats;
bool quick_menu_show_shaders;
@@ -697,6 +707,7 @@ typedef struct settings
bool kiosk_mode_enable;
bool crt_switch_custom_refresh_enable;
bool crt_switch_hires_menu;
/* Netplay */
bool netplay_public_announce;
@@ -732,6 +743,7 @@ typedef struct settings
bool cheevos_auto_screenshot;
bool cheevos_start_active;
bool cheevos_unlock_sound_enable;
bool cheevos_challenge_indicators;
/* Camera */
bool camera_allow;
@@ -786,6 +798,7 @@ typedef struct settings
bool network_remote_enable_user[MAX_USERS];
bool load_dummy_on_core_shutdown;
bool check_firmware_before_loading;
bool core_option_category_enable;
bool core_info_cache_enable;
#ifndef HAVE_DYNAMIC
bool always_reload_core_on_run_content;
@@ -817,6 +830,7 @@ typedef struct settings
bool video_window_show_decorations;
bool video_window_save_positions;
bool video_window_custom_size_enable;
bool sustained_performance_mode;
bool playlist_use_old_format;
+4
View File
@@ -124,6 +124,10 @@ bool content_set_subsystem_by_name(const char* subsystem_name);
/* Get the current subsystem "friendly name" */
void content_get_subsystem_friendly_name(const char* subsystem_name, char* subsystem_friendly_name, size_t len);
/* Sets overrides which modify frontend handling of
* specific content file types */
bool content_file_override_set(const struct retro_system_content_info_override *overrides);
RETRO_END_DECLS
#endif
+23 -24
View File
@@ -159,9 +159,7 @@ static bool CCJSONObjectMemberHandler(void *context, const char *pValue, size_t
}
break;
case 'p':
if (string_is_equal(pValue, "path"))
pCtx->current_string_val = &pCtx->core_info->path;
else if (string_is_equal(pValue, "permissions"))
if (string_is_equal(pValue, "permissions"))
{
pCtx->current_string_val = &pCtx->core_info->permissions;
pCtx->current_string_list_val = &pCtx->core_info->permissions_list;
@@ -732,17 +730,18 @@ end:
return core_info_cache_list;
}
static void core_info_cache_write(core_info_cache_list_t *list, const char *info_dir)
static bool core_info_cache_write(core_info_cache_list_t *list, const char *info_dir)
{
intfstream_t *file = NULL;
rjsonwriter_t *writer = NULL;
bool success = false;
char file_path[PATH_MAX_LENGTH];
size_t i, j;
file_path[0] = '\0';
if (!list)
return;
return false;
/* Open info cache file */
if (string_is_empty(info_dir))
@@ -763,7 +762,7 @@ static void core_info_cache_write(core_info_cache_list_t *list, const char *info
if (!file)
{
RARCH_ERR("[Core Info] Failed to write to core info cache file: %s\n", file_path);
return;
return false;
}
/* Write info cache */
@@ -814,14 +813,6 @@ static void core_info_cache_write(core_info_cache_list_t *list, const char *info
rjsonwriter_add_start_object(writer);
rjsonwriter_add_newline(writer);
rjsonwriter_add_spaces(writer, 6);
rjsonwriter_add_string(writer, "path");
rjsonwriter_add_colon(writer);
rjsonwriter_add_space(writer);
rjsonwriter_add_string(writer, info->path);
rjsonwriter_add_comma(writer);
rjsonwriter_add_newline(writer);
rjsonwriter_add_spaces(writer, 6);
rjsonwriter_add_string(writer, "display_name");
rjsonwriter_add_colon(writer);
@@ -1068,6 +1059,7 @@ static void core_info_cache_write(core_info_cache_list_t *list, const char *info
rjsonwriter_free(writer);
RARCH_LOG("[Core Info] Wrote to cache file: %s\n", file_path);
success = true;
/* Remove 'force refresh' file, if required */
file_path[0] = '\0';
@@ -1086,6 +1078,7 @@ end:
free(file);
list->refresh = false;
return success;
}
static void core_info_check_uninstalled(core_info_cache_list_t *list)
@@ -1774,7 +1767,8 @@ static core_info_list_t *core_info_list_new(const char *path,
const char *libretro_info_dir,
const char *exts,
bool dir_show_hidden_files,
bool enable_cache)
bool enable_cache,
bool *cache_supported)
{
size_t i;
core_path_list_t *path_list = NULL;
@@ -1809,18 +1803,13 @@ static core_info_list_t *core_info_list_new(const char *path,
core_info_list->list = core_info;
core_info_list->count = path_list->core_list->size;
#if !defined(IOS)
/* Read core info cache, if enabled
* > This functionality is hard disabled on iOS/tvOS,
* where core path changes on every install
* (invalidating any cached parameters) */
/* Read core info cache, if enabled */
if (enable_cache)
{
core_info_cache_list = core_info_cache_read(info_dir);
if (!core_info_cache_list)
goto error;
}
#endif
for (i = 0; i < path_list->core_list->size; i++)
{
@@ -1847,6 +1836,12 @@ static core_info_list_t *core_info_list_new(const char *path,
if (info_cache)
{
core_info_copy(info_cache, info);
/* Core path is 'dynamic', and cannot
* be cached (i.e. core directory may
* change between runs) */
if (info->path)
free(info->path);
info->path = strdup(base_path);
/* Core lock status is 'dynamic', and
* cannot be cached */
info->is_locked = core_info_path_is_locked(path_list->lock_list,
@@ -1906,12 +1901,14 @@ static core_info_list_t *core_info_list_new(const char *path,
* a refresh)
* > Write new cache to disk if updates are
* required */
*cache_supported = true;
if (core_info_cache_list)
{
core_info_check_uninstalled(core_info_cache_list);
if (core_info_cache_list->refresh)
core_info_cache_write(core_info_cache_list, info_dir);
*cache_supported = core_info_cache_write(
core_info_cache_list, info_dir);
core_info_cache_list_free(core_info_cache_list);
}
@@ -2104,14 +2101,16 @@ void core_info_deinit_list(void)
}
bool core_info_init_list(const char *path_info, const char *dir_cores,
const char *exts, bool dir_show_hidden_files, bool enable_cache)
const char *exts, bool dir_show_hidden_files,
bool enable_cache, bool *cache_supported)
{
core_info_state_t *p_coreinfo = coreinfo_get_ptr();
if (!(p_coreinfo->curr_list = core_info_list_new(dir_cores,
!string_is_empty(path_info) ? path_info : dir_cores,
exts,
dir_show_hidden_files,
enable_cache)))
enable_cache,
cache_supported)))
return false;
return true;
}
+2 -1
View File
@@ -157,7 +157,8 @@ bool core_info_get_current_core(core_info_t **core);
void core_info_deinit_list(void);
bool core_info_init_list(const char *path_info, const char *dir_cores,
const char *exts, bool show_hidden_files, bool enable_cache);
const char *exts, bool show_hidden_files,
bool enable_cache, bool *cache_supported);
bool core_info_get_list(core_info_list_t **core);
File diff suppressed because it is too large. Load diff
+374 -29
View File
@@ -22,6 +22,7 @@
#include <boolean.h>
#include <retro_common_api.h>
#include <lists/string_list.h>
#include <lists/nested_list.h>
#include "retroarch.h"
@@ -30,99 +31,443 @@ RETRO_BEGIN_DECLS
struct core_option
{
char *desc;
char *desc_categorized;
char *info;
char *info_categorized;
char *key;
char *category_key;
struct string_list *vals;
struct string_list *val_labels;
/* opt_idx: option index, used for internal
* bookkeeping */
size_t opt_idx;
/* default_index, index: correspond to
* option *value* indices */
size_t default_index;
size_t index;
uint32_t key_hash;
bool visible;
};
struct core_catagory
{
char *key;
char *desc;
char *info;
uint32_t key_hash;
};
/* TODO/FIXME: This struct should be made
* 'private', with restricted access to its
* members via interface functions. This
* requires significant refactoring... */
struct core_option_manager
{
config_file_t *conf;
char conf_path[PATH_MAX_LENGTH];
struct core_catagory *cats;
struct core_option *opts;
nested_list_t *option_map;
size_t cats_size;
size_t size;
bool updated;
};
typedef struct core_option_manager core_option_manager_t;
/*********************/
/* Option Conversion */
/*********************/
/**
* core_option_manager_set_default:
* @opt : pointer to core option manager object.
* @idx : index of core option to be reset to defaults.
* core_option_manager_convert_v1:
*
* Reset core option specified by @idx and sets default value for option.
* @options_v1 : an array of retro_core_option_definition
* structs
*
* Converts an array of core option v1 definitions into
* a v2 core options struct. Returned pointer must be
* freed using core_option_manager_free_converted().
*
* Returns: Valid pointer to a new v2 core options struct
* if successful, otherwise NULL.
**/
void core_option_manager_set_default(core_option_manager_t *opt, size_t idx);
struct retro_core_options_v2 *core_option_manager_convert_v1(
const struct retro_core_option_definition *options_v1);
/**
* core_option_manager_convert_v1_intl:
*
* @options_v1_intl : pointer to a retro_core_options_intl
* struct
*
* Converts a v1 'international' core options definition
* struct into a v2 core options struct. Returned pointer
* must be freed using core_option_manager_free_converted().
*
* Returns: Valid pointer to a new v2 core options struct
* if successful, otherwise NULL.
**/
struct retro_core_options_v2 *core_option_manager_convert_v1_intl(
const struct retro_core_options_intl *options_v1_intl);
/**
* core_option_manager_convert_v2_intl:
*
* @options_v2_intl : pointer to a retro_core_options_v2_intl
* struct
*
* Converts a v2 'international' core options struct
* into a regular v2 core options struct. Returned pointer
* must be freed using core_option_manager_free_converted().
*
* Returns: Valid pointer to a new v2 core options struct
* if successful, otherwise NULL.
**/
struct retro_core_options_v2 *core_option_manager_convert_v2_intl(
const struct retro_core_options_v2_intl *options_v2_intl);
/**
* core_option_manager_free_converted:
*
* @options_v2 : pointer to a retro_core_options_v2
* struct
*
* Frees the pointer returned by any
* core_option_manager_convert_*() function.
**/
void core_option_manager_free_converted(
struct retro_core_options_v2 *options_v2);
/**************************************/
/* Initialisation / De-Initialisation */
/**************************************/
/**
* core_option_manager_new_vars:
*
* @conf_path : Filesystem path to write core option
* config file to
* @src_conf_path : Filesystem path from which to load
* initial config settings.
* @vars : Pointer to core option variable array
* handle
*
* Legacy version of core_option_manager_new().
* Creates and initializes a core manager handle.
*
* Returns: handle to new core manager handle if successful,
* otherwise NULL.
**/
core_option_manager_t *core_option_manager_new_vars(
const char *conf_path, const char *src_conf_path,
const struct retro_variable *vars);
/**
* core_option_manager_new:
*
* @conf_path : Filesystem path to write core option
* config file to
* @src_conf_path : Filesystem path from which to load
* initial config settings.
* @options_v2 : Pointer to retro_core_options_v2 struct
* @categorized : Flag specifying whether core option
* category information should be read
* from @options_v2
*
* Creates and initializes a core manager handle. Parses
* information from a retro_core_options_v2 struct.
* If @categorized is false, all option category
* assignments will be ignored.
*
* Returns: handle to new core manager handle if successful,
* otherwise NULL.
**/
core_option_manager_t *core_option_manager_new(
const char *conf_path, const char *src_conf_path,
const struct retro_core_options_v2 *options_v2,
bool categorized);
/**
* core_option_manager_free:
*
* @opt : options manager handle
*
* Frees specified core options manager handle.
**/
void core_option_manager_free(core_option_manager_t *opt);
/********************/
/* Category Getters */
/********************/
/**
* core_option_manager_get_category_desc:
*
* @opt : options manager handle
* @key : core option category id string
*
* Fetches the 'description' text of the core option
* category identified by @key (used as the
* category label in the menu).
*
* Returns: description string (menu label) of the
* specified option category if successful,
* otherwise NULL.
**/
const char *core_option_manager_get_category_desc(core_option_manager_t *opt,
const char *key);
/**
* core_option_manager_get_category_info:
*
* @opt : options manager handle
* @key : core option category id string
*
* Fetches the 'info' text of the core option
* category identified by @key (used as the category
* sublabel in the menu).
*
* Returns: information string (menu sublabel) of
* the specified option category if successful,
* otherwise NULL.
**/
const char *core_option_manager_get_category_info(core_option_manager_t *opt,
const char *key);
/**
* core_option_manager_get_category_visible:
*
* @opt : options manager handle
* @key : core option category id string
*
* Queries whether the core option category
* identified by @key should be displayed in
* the frontend menu. (A category is deemed to
* be visible if at least one of the options
* in the category is visible)
*
* Returns: true if option category should be
* displayed by the frontend, otherwise false.
**/
bool core_option_manager_get_category_visible(core_option_manager_t *opt,
const char *key);
/******************/
/* Option Getters */
/******************/
/**
* core_option_manager_get_idx:
*
* @opt : options manager handle
* @key : core option key string (variable to query
* in RETRO_ENVIRONMENT_GET_VARIABLE)
* @idx : index of core option corresponding
* to @key
*
* Fetches the index of the core option identified
* by the specified @key.
*
* Returns: true if option matching the specified
* key was found, otherwise false.
**/
bool core_option_manager_get_idx(core_option_manager_t *opt,
const char *key, size_t *idx);
/**
* core_option_manager_get_desc:
* @opt : options manager handle
* @idx : idx identifier of the option
*
* Gets description for an option.
* @opt : options manager handle
* @idx : core option index
* @categorized : flag specifying whether to
* fetch the categorised description
* or the legacy fallback
*
* Returns: Description for an option.
* Fetches the 'description' of the core option at
* index @idx (used as the option label in the menu).
* If menu has option category support, @categorized
* should be true. (At present, only the Qt interface
* requires @categorized to be false)
*
* Returns: description string (menu label) of the
* specified option if successful, otherwise NULL.
**/
const char *core_option_manager_get_desc(core_option_manager_t *opt,
size_t idx);
size_t idx, bool categorized);
/**
* core_option_manager_get_info:
* @opt : options manager handle
* @idx : idx identifier of the option
*
* Gets information text for an option.
* @opt : options manager handle
* @idx : core option index
* @categorized : flag specifying whether to
* fetch the categorised information
* or the legacy fallback
*
* Returns: Information text for an option.
* Fetches the 'info' text of the core option at
* index @idx (used as the option sublabel in the
* menu). If menu has option category support,
* @categorized should be true. (At present, only
* the Qt interface requires @categorized to be false)
*
* Returns: information string (menu sublabel) of the
* specified option if successful, otherwise NULL.
**/
const char *core_option_manager_get_info(core_option_manager_t *opt,
size_t idx);
size_t idx, bool categorized);
/**
* core_option_manager_get_val:
* @opt : options manager handle
* @idx : idx identifier of the option
*
* Gets value for an option.
* @opt : options manager handle
* @idx : core option index
*
* Returns: Value for an option.
* Fetches the string representation of the current
* value of the core option at index @idx.
*
* Returns: core option value string if successful,
* otherwise NULL.
**/
const char *core_option_manager_get_val(core_option_manager_t *opt,
size_t idx);
/**
* core_option_manager_get_val_label:
* @opt : options manager handle
* @idx : idx identifier of the option
*
* Gets value label for an option.
* @opt : options manager handle
* @idx : core option index
*
* Returns: Value label for an option.
* Fetches the 'label' text (used for display purposes
* in the menu) for the current value of the core
* option at index @idx.
*
* Returns: core option value label string if
* successful, otherwise NULL.
**/
const char *core_option_manager_get_val_label(core_option_manager_t *opt,
size_t idx);
/**
* core_option_manager_get_visible:
* @opt : options manager handle
* @idx : idx identifier of the option
*
* Gets whether option should be visible when displaying
* core options in the frontend
* @opt : options manager handle
* @idx : core option index
*
* Returns: 'true' if option should be displayed by the frontend.
* Queries whether the core option at index @idx
* should be displayed in the frontend menu.
*
* Returns: true if option should be displayed by
* the frontend, otherwise false.
**/
bool core_option_manager_get_visible(core_option_manager_t *opt,
size_t idx);
/******************/
/* Option Setters */
/******************/
/**
* core_option_manager_set_val:
*
* @opt : options manager handle
* @idx : core option index
* @val_idx : index of the value to set
* @refresh_menu : flag specifying whether menu
* should be refreshed if changes
* to option visibility are detected
*
* Sets the core option at index @idx to the
* option value corresponding to @val_idx.
* After setting the option value, a request
* will be made for the core to update the
* in-menu visibility of all options; if
* visibility changes are detected and
* @refresh_menu is true, the menu will be
* redrawn.
**/
void core_option_manager_set_val(core_option_manager_t *opt,
size_t idx, size_t val_idx);
size_t idx, size_t val_idx, bool refresh_menu);
/**
* core_option_manager_adjust_val:
*
* @opt : options manager handle
* @idx : core option index
* @adjustment : offset to apply from current
* value index
* @refresh_menu : flag specifying whether menu
* should be refreshed if changes
* to option visibility are detected
*
* Modifies the value of the core option at
* index @idx by incrementing the current option
* value index by @adjustment.
* After setting the option value, a request
* will be made for the core to update the
* in-menu visibility of all options; if
* visibility changes are detected and
* @refresh_menu is true, the menu will be
* redrawn.
**/
void core_option_manager_adjust_val(core_option_manager_t* opt,
size_t idx, int adjustment, bool refresh_menu);
/**
* core_option_manager_set_default:
*
* @opt : options manager handle
* @idx : core option index
* @refresh_menu : flag specifying whether menu
* should be refreshed if changes
* to option visibility are detected
*
* Resets the core option at index @idx to
* its default value.
* After setting the option value, a request
* will be made for the core to update the
* in-menu visibility of all options; if
* visibility changes are detected and
* @refresh_menu is true, the menu will be
* redrawn.
**/
void core_option_manager_set_default(core_option_manager_t *opt,
size_t idx, bool refresh_menu);
/**
* core_option_manager_set_visible:
*
* @opt : options manager handle
* @key : core option key string (variable to query
* in RETRO_ENVIRONMENT_GET_VARIABLE)
* @visible : flag specifying whether option should
* be shown in the menu
*
* Sets the in-menu visibility of the core option
* identified by the specified @key.
**/
void core_option_manager_set_visible(core_option_manager_t *opt,
const char *key, bool visible);
/**********************/
/* Configuration File */
/**********************/
/**
* core_option_manager_flush:
*
* @opt : options manager handle
* @conf : configuration file handle
*
* Writes all core option key-pair values from the
* specified core option manager handle to the
* specified configuration file struct.
**/
void core_option_manager_flush(core_option_manager_t *opt,
config_file_t *conf);
RETRO_END_DECLS
+17 -2
View File
@@ -281,8 +281,23 @@ static int database_cursor_iterate(libretrodb_cursor_t *cur,
else if (string_is_equal(str, "size"))
db_info->size = (unsigned)val->val.uint_;
else if (string_is_equal(str, "crc"))
db_info->crc32 = swap_if_little32(
*(uint32_t*)val->val.binary.buff);
{
switch (val->val.binary.len)
{
case 1:
db_info->crc32 = *(uint8_t*)val->val.binary.buff;
break;
case 2:
db_info->crc32 = swap_if_little16(*(uint16_t*)val->val.binary.buff);
break;
case 4:
db_info->crc32 = swap_if_little32(*(uint32_t*)val->val.binary.buff);
break;
default:
db_info->crc32 = 0;
break;
}
}
else if (string_is_equal(str, "sha1"))
db_info->sha1 = bin_to_hex_alloc(
(uint8_t*)val->val.binary.buff, val->val.binary.len);
+33 -33
View File
@@ -24,15 +24,15 @@ typedef struct
typedef struct
{
size_t PropsOffset;
UInt32 MethodID;
uint32_t MethodID;
Byte NumStreams;
Byte PropsSize;
} CSzCoderInfo;
typedef struct
{
UInt32 InIndex;
UInt32 OutIndex;
uint32_t InIndex;
uint32_t OutIndex;
} CSzBond;
#define SZ_NUM_CODERS_IN_FOLDER_MAX 4
@@ -41,11 +41,11 @@ typedef struct
typedef struct
{
UInt32 NumCoders;
UInt32 NumBonds;
UInt32 NumPackStreams;
UInt32 UnpackStream;
UInt32 PackStreams[SZ_NUM_PACK_STREAMS_IN_FOLDER_MAX];
uint32_t NumCoders;
uint32_t NumBonds;
uint32_t NumPackStreams;
uint32_t UnpackStream;
uint32_t PackStreams[SZ_NUM_PACK_STREAMS_IN_FOLDER_MAX];
CSzBond Bonds[SZ_NUM_BONDS_IN_FOLDER_MAX];
CSzCoderInfo Coders[SZ_NUM_CODERS_IN_FOLDER_MAX];
} CSzFolder;
@@ -55,20 +55,20 @@ SRes SzGetNextFolderItem(CSzFolder *f, CSzData *sd);
typedef struct
{
UInt32 Low;
UInt32 High;
uint32_t Low;
uint32_t High;
} CNtfsFileTime;
typedef struct
{
Byte *Defs; /* MSB 0 bit numbering */
UInt32 *Vals;
uint32_t *Vals;
} CSzBitUi32s;
typedef struct
{
Byte *Defs; /* MSB 0 bit numbering */
/* UInt64 *Vals; */
/* uint64_t *Vals; */
CNtfsFileTime *Vals;
} CSzBitUi64s;
@@ -78,25 +78,25 @@ typedef struct
typedef struct
{
UInt32 NumPackStreams;
UInt32 NumFolders;
uint32_t NumPackStreams;
uint32_t NumFolders;
UInt64 *PackPositions; /* NumPackStreams + 1 */
uint64_t *PackPositions; /* NumPackStreams + 1 */
CSzBitUi32s FolderCRCs; /* NumFolders */
size_t *FoCodersOffsets; /* NumFolders + 1 */
UInt32 *FoStartPackStreamIndex; /* NumFolders + 1 */
UInt32 *FoToCoderUnpackSizes; /* NumFolders + 1 */
uint32_t *FoStartPackStreamIndex; /* NumFolders + 1 */
uint32_t *FoToCoderUnpackSizes; /* NumFolders + 1 */
Byte *FoToMainUnpackSizeIndex; /* NumFolders */
UInt64 *CoderUnpackSizes; /* for all coders in all folders */
uint64_t *CoderUnpackSizes; /* for all coders in all folders */
Byte *CodersData;
} CSzAr;
UInt64 SzAr_GetFolderUnpackSize(const CSzAr *p, UInt32 folderIndex);
uint64_t SzAr_GetFolderUnpackSize(const CSzAr *p, uint32_t folderIndex);
SRes SzAr_DecodeFolder(const CSzAr *p, UInt32 folderIndex,
ILookInStream *stream, UInt64 startPos,
SRes SzAr_DecodeFolder(const CSzAr *p, uint32_t folderIndex,
ILookInStream *stream, uint64_t startPos,
Byte *outBuffer, size_t outSize,
ISzAllocPtr allocMain);
@@ -104,12 +104,12 @@ typedef struct
{
CSzAr db;
UInt64 startPosAfterHeader;
UInt64 dataPos;
uint64_t startPosAfterHeader;
uint64_t dataPos;
UInt32 NumFiles;
uint32_t NumFiles;
UInt64 *UnpackPositions; /* NumFiles + 1 */
uint64_t *UnpackPositions; /* NumFiles + 1 */
/* Byte *IsEmptyFiles; */
Byte *IsDirs;
CSzBitUi32s CRCs;
@@ -119,8 +119,8 @@ typedef struct
CSzBitUi64s MTime;
CSzBitUi64s CTime;
UInt32 *FolderToFile; /* NumFolders + 1 */
UInt32 *FileToFolder; /* NumFiles */
uint32_t *FolderToFile; /* NumFolders + 1 */
uint32_t *FileToFolder; /* NumFiles */
size_t *FileNameOffsets; /* in 2-byte steps */
Byte *FileNames; /* UTF-16-LE */
@@ -132,8 +132,8 @@ typedef struct
void SzArEx_Init(CSzArEx *p);
void SzArEx_Free(CSzArEx *p, ISzAllocPtr alloc);
UInt64 SzArEx_GetFolderStreamPos(const CSzArEx *p, UInt32 folderIndex, UInt32 indexInFolder);
int SzArEx_GetFolderFullPackSize(const CSzArEx *p, UInt32 folderIndex, UInt64 *resSize);
uint64_t SzArEx_GetFolderStreamPos(const CSzArEx *p, uint32_t folderIndex, uint32_t indexInFolder);
int SzArEx_GetFolderFullPackSize(const CSzArEx *p, uint32_t folderIndex, uint64_t *resSize);
/*
if dest == NULL, the return value specifies the required size of the buffer,
@@ -141,11 +141,11 @@ if dest == NULL, the return value specifies the required size of the buffer,
if dest != NULL, the return value specifies the number of 16-bit characters that
are written to the dest, including the null-terminating character. */
size_t SzArEx_GetFileNameUtf16(const CSzArEx *p, size_t fileIndex, UInt16 *dest);
size_t SzArEx_GetFileNameUtf16(const CSzArEx *p, size_t fileIndex, uint16_t *dest);
/*
size_t SzArEx_GetFullNameLen(const CSzArEx *p, size_t fileIndex);
UInt16 *SzArEx_GetFullNameUtf16_Back(const CSzArEx *p, size_t fileIndex, UInt16 *dest);
uint16_t *SzArEx_GetFullNameUtf16_Back(const CSzArEx *p, size_t fileIndex, uint16_t *dest);
*/
@@ -173,8 +173,8 @@ UInt16 *SzArEx_GetFullNameUtf16_Back(const CSzArEx *p, size_t fileIndex, UInt16
SRes SzArEx_Extract(
const CSzArEx *db,
ILookInStream *inStream,
UInt32 fileIndex, /* index of file */
UInt32 *blockIndex, /* index of solid block */
uint32_t fileIndex, /* index of file */
uint32_t *blockIndex, /* index of solid block */
Byte **outBuffer, /* pointer to pointer to output buffer (allocated with allocMain) */
size_t *outBufferSize, /* buffer size for output buffer */
size_t *offset, /* offset of stream for required file in *outBuffer */
+142 -142
View File
@@ -70,7 +70,7 @@ static SRes SzBitUi32s_Alloc(CSzBitUi32s *p, size_t num, ISzAllocPtr alloc)
else
{
MY_ALLOC(Byte, p->Defs, (num + 7) >> 3, alloc);
MY_ALLOC(UInt32, p->Vals, num, alloc);
MY_ALLOC(uint32_t, p->Vals, num, alloc);
}
return SZ_OK;
}
@@ -190,11 +190,11 @@ static int TestSignatureCandidate(const Byte *testBytes)
#define SZ_READ_32(dest) if (sd.Size < 4) return SZ_ERROR_ARCHIVE; \
dest = GetUi32(sd.Data); SKIP_DATA2(sd, 4);
static MY_NO_INLINE SRes ReadNumber(CSzData *sd, UInt64 *value)
static MY_NO_INLINE SRes ReadNumber(CSzData *sd, uint64_t *value)
{
Byte firstByte, mask;
unsigned i;
UInt32 v;
uint32_t v;
SZ_READ_BYTE(firstByte);
if ((firstByte & 0x80) == 0)
@@ -205,33 +205,33 @@ static MY_NO_INLINE SRes ReadNumber(CSzData *sd, UInt64 *value)
SZ_READ_BYTE(v);
if ((firstByte & 0x40) == 0)
{
*value = (((UInt32)firstByte & 0x3F) << 8) | v;
*value = (((uint32_t)firstByte & 0x3F) << 8) | v;
return SZ_OK;
}
SZ_READ_BYTE(mask);
*value = v | ((UInt32)mask << 8);
*value = v | ((uint32_t)mask << 8);
mask = 0x20;
for (i = 2; i < 8; i++)
{
Byte b;
if ((firstByte & mask) == 0)
{
UInt64 highPart = (unsigned)firstByte & (unsigned)(mask - 1);
uint64_t highPart = (unsigned)firstByte & (unsigned)(mask - 1);
*value |= (highPart << (8 * i));
return SZ_OK;
}
SZ_READ_BYTE(b);
*value |= ((UInt64)b << (8 * i));
*value |= ((uint64_t)b << (8 * i));
mask >>= 1;
}
return SZ_OK;
}
static MY_NO_INLINE SRes SzReadNumber32(CSzData *sd, UInt32 *value)
static MY_NO_INLINE SRes SzReadNumber32(CSzData *sd, uint32_t *value)
{
Byte firstByte;
UInt64 value64;
uint64_t value64;
if (sd->Size == 0)
return SZ_ERROR_ARCHIVE;
firstByte = *sd->Data;
@@ -243,11 +243,11 @@ static MY_NO_INLINE SRes SzReadNumber32(CSzData *sd, UInt32 *value)
return SZ_OK;
}
RINOK(ReadNumber(sd, &value64));
if (value64 >= (UInt32)0x80000000 - 1)
if (value64 >= (uint32_t)0x80000000 - 1)
return SZ_ERROR_UNSUPPORTED;
if (value64 >= ((UInt64)(1) << ((sizeof(size_t) - 1) * 8 + 4)))
if (value64 >= ((uint64_t)(1) << ((sizeof(size_t) - 1) * 8 + 4)))
return SZ_ERROR_UNSUPPORTED;
*value = (UInt32)value64;
*value = (uint32_t)value64;
return SZ_OK;
}
@@ -255,7 +255,7 @@ static MY_NO_INLINE SRes SzReadNumber32(CSzData *sd, UInt32 *value)
static SRes SkipData(CSzData *sd)
{
UInt64 size;
uint64_t size;
RINOK(ReadNumber(sd, &size));
if (size > sd->Size)
return SZ_ERROR_ARCHIVE;
@@ -263,11 +263,11 @@ static SRes SkipData(CSzData *sd)
return SZ_OK;
}
static SRes WaitId(CSzData *sd, UInt32 id)
static SRes WaitId(CSzData *sd, uint32_t id)
{
for (;;)
{
UInt64 type;
uint64_t type;
RINOK(ReadID(sd, &type));
if (type == id)
return SZ_OK;
@@ -277,9 +277,9 @@ static SRes WaitId(CSzData *sd, UInt32 id)
}
}
static SRes RememberBitVector(CSzData *sd, UInt32 numItems, const Byte **v)
static SRes RememberBitVector(CSzData *sd, uint32_t numItems, const Byte **v)
{
UInt32 numBytes = (numItems + 7) >> 3;
uint32_t numBytes = (numItems + 7) >> 3;
if (numBytes > sd->Size)
return SZ_ERROR_ARCHIVE;
*v = sd->Data;
@@ -287,11 +287,11 @@ static SRes RememberBitVector(CSzData *sd, UInt32 numItems, const Byte **v)
return SZ_OK;
}
static UInt32 CountDefinedBits(const Byte *bits, UInt32 numItems)
static uint32_t CountDefinedBits(const Byte *bits, uint32_t numItems)
{
Byte b = 0;
unsigned m = 0;
UInt32 sum = 0;
uint32_t sum = 0;
for (; numItems != 0; numItems--)
{
if (m == 0)
@@ -305,11 +305,11 @@ static UInt32 CountDefinedBits(const Byte *bits, UInt32 numItems)
return sum;
}
static MY_NO_INLINE SRes ReadBitVector(CSzData *sd, UInt32 numItems, Byte **v, ISzAllocPtr alloc)
static MY_NO_INLINE SRes ReadBitVector(CSzData *sd, uint32_t numItems, Byte **v, ISzAllocPtr alloc)
{
Byte allAreDefined;
Byte *v2;
UInt32 numBytes = (numItems + 7) >> 3;
uint32_t numBytes = (numItems + 7) >> 3;
*v = NULL;
SZ_READ_BYTE(allAreDefined);
if (numBytes == 0)
@@ -328,18 +328,18 @@ static MY_NO_INLINE SRes ReadBitVector(CSzData *sd, UInt32 numItems, Byte **v, I
{
unsigned numBits = (unsigned)numItems & 7;
if (numBits != 0)
v2[(size_t)numBytes - 1] = (Byte)((((UInt32)1 << numBits) - 1) << (8 - numBits));
v2[(size_t)numBytes - 1] = (Byte)((((uint32_t)1 << numBits) - 1) << (8 - numBits));
}
return SZ_OK;
}
static MY_NO_INLINE SRes ReadUi32s(CSzData *sd2, UInt32 numItems, CSzBitUi32s *crcs, ISzAllocPtr alloc)
static MY_NO_INLINE SRes ReadUi32s(CSzData *sd2, uint32_t numItems, CSzBitUi32s *crcs, ISzAllocPtr alloc)
{
UInt32 i;
uint32_t i;
CSzData sd;
UInt32 *vals;
uint32_t *vals;
const Byte *defs;
MY_ALLOC_ZE(UInt32, crcs->Vals, numItems, alloc);
MY_ALLOC_ZE(uint32_t, crcs->Vals, numItems, alloc);
sd = *sd2;
defs = crcs->Defs;
vals = crcs->Vals;
@@ -354,17 +354,17 @@ static MY_NO_INLINE SRes ReadUi32s(CSzData *sd2, UInt32 numItems, CSzBitUi32s *c
return SZ_OK;
}
static SRes ReadBitUi32s(CSzData *sd, UInt32 numItems, CSzBitUi32s *crcs, ISzAllocPtr alloc)
static SRes ReadBitUi32s(CSzData *sd, uint32_t numItems, CSzBitUi32s *crcs, ISzAllocPtr alloc)
{
SzBitUi32s_Free(crcs, alloc);
RINOK(ReadBitVector(sd, numItems, &crcs->Defs, alloc));
return ReadUi32s(sd, numItems, crcs, alloc);
}
static SRes SkipBitUi32s(CSzData *sd, UInt32 numItems)
static SRes SkipBitUi32s(CSzData *sd, uint32_t numItems)
{
Byte allAreDefined;
UInt32 numDefined = numItems;
uint32_t numDefined = numItems;
SZ_READ_BYTE(allAreDefined);
if (!allAreDefined)
{
@@ -385,14 +385,14 @@ static SRes ReadPackInfo(CSzAr *p, CSzData *sd, ISzAllocPtr alloc)
RINOK(SzReadNumber32(sd, &p->NumPackStreams));
RINOK(WaitId(sd, k7zIdSize));
MY_ALLOC(UInt64, p->PackPositions, (size_t)p->NumPackStreams + 1, alloc);
MY_ALLOC(uint64_t, p->PackPositions, (size_t)p->NumPackStreams + 1, alloc);
{
UInt64 sum = 0;
UInt32 i;
UInt32 numPackStreams = p->NumPackStreams;
uint64_t sum = 0;
uint32_t i;
uint32_t numPackStreams = p->NumPackStreams;
for (i = 0; i < numPackStreams; i++)
{
UInt64 packSize;
uint64_t packSize;
p->PackPositions[i] = sum;
RINOK(ReadNumber(sd, &packSize));
sum += packSize;
@@ -404,7 +404,7 @@ static SRes ReadPackInfo(CSzAr *p, CSzData *sd, ISzAllocPtr alloc)
for (;;)
{
UInt64 type;
uint64_t type;
RINOK(ReadID(sd, &type));
if (type == k7zIdEnd)
return SZ_OK;
@@ -431,8 +431,8 @@ static SRes SzReadSwitch(CSzData *sd)
SRes SzGetNextFolderItem(CSzFolder *f, CSzData *sd)
{
UInt32 numCoders, i;
UInt32 numInStreams = 0;
uint32_t numCoders, i;
uint32_t numInStreams = 0;
const Byte *dataStart = sd->Data;
f->NumCoders = 0;
@@ -449,7 +449,7 @@ SRes SzGetNextFolderItem(CSzFolder *f, CSzData *sd)
Byte mainByte;
CSzCoderInfo *coder = f->Coders + i;
unsigned idSize, j;
UInt64 id;
uint64_t id;
SZ_READ_BYTE(mainByte);
if ((mainByte & 0xC0) != 0)
@@ -467,9 +467,9 @@ SRes SzGetNextFolderItem(CSzFolder *f, CSzData *sd)
sd->Data++;
sd->Size--;
}
if (id > (UInt32)0xFFFFFFFF)
if (id > (uint32_t)0xFFFFFFFF)
return SZ_ERROR_UNSUPPORTED;
coder->MethodID = (UInt32)id;
coder->MethodID = (uint32_t)id;
coder->NumStreams = 1;
coder->PropsOffset = 0;
@@ -477,7 +477,7 @@ SRes SzGetNextFolderItem(CSzFolder *f, CSzData *sd)
if ((mainByte & 0x10) != 0)
{
UInt32 numStreams;
uint32_t numStreams;
RINOK(SzReadNumber32(sd, &numStreams));
if (numStreams > k_NumCodersStreams_in_Folder_MAX)
@@ -496,7 +496,7 @@ SRes SzGetNextFolderItem(CSzFolder *f, CSzData *sd)
if ((mainByte & 0x20) != 0)
{
UInt32 propsSize = 0;
uint32_t propsSize = 0;
RINOK(SzReadNumber32(sd, &propsSize));
if (propsSize > sd->Size)
return SZ_ERROR_ARCHIVE;
@@ -519,7 +519,7 @@ SRes SzGetNextFolderItem(CSzFolder *f, CSzData *sd)
*/
{
Byte streamUsed[k_NumCodersStreams_in_Folder_MAX];
UInt32 numBonds, numPackStreams;
uint32_t numBonds, numPackStreams;
numBonds = numCoders - 1;
if (numInStreams < numBonds)
@@ -581,7 +581,7 @@ SRes SzGetNextFolderItem(CSzFolder *f, CSzData *sd)
else
for (i = 0; i < numPackStreams; i++)
{
UInt32 index;
uint32_t index;
RINOK(SzReadNumber32(sd, &index));
if (index >= numInStreams || streamUsed[index])
return SZ_ERROR_ARCHIVE;
@@ -596,7 +596,7 @@ SRes SzGetNextFolderItem(CSzFolder *f, CSzData *sd)
}
static MY_NO_INLINE SRes SkipNumbers(CSzData *sd2, UInt32 num)
static MY_NO_INLINE SRes SkipNumbers(CSzData *sd2, uint32_t num)
{
CSzData sd;
sd = *sd2;
@@ -633,13 +633,13 @@ static MY_NO_INLINE SRes SkipNumbers(CSzData *sd2, UInt32 num)
static SRes ReadUnpackInfo(CSzAr *p,
CSzData *sd2,
UInt32 numFoldersMax,
const CBuf *tempBufs, UInt32 numTempBufs,
uint32_t numFoldersMax,
const CBuf *tempBufs, uint32_t numTempBufs,
ISzAllocPtr alloc)
{
CSzData sd;
UInt32 fo, numFolders, numCodersOutStreams, packStreamIndex;
uint32_t fo, numFolders, numCodersOutStreams, packStreamIndex;
const Byte *startBufPtr;
Byte external;
@@ -655,7 +655,7 @@ static SRes ReadUnpackInfo(CSzAr *p,
sd = *sd2;
else
{
UInt32 index;
uint32_t index;
RINOK(SzReadNumber32(sd2, &index));
if (index >= numTempBufs)
return SZ_ERROR_ARCHIVE;
@@ -664,8 +664,8 @@ static SRes ReadUnpackInfo(CSzAr *p,
}
MY_ALLOC(size_t, p->FoCodersOffsets, (size_t)numFolders + 1, alloc);
MY_ALLOC(UInt32, p->FoStartPackStreamIndex, (size_t)numFolders + 1, alloc);
MY_ALLOC(UInt32, p->FoToCoderUnpackSizes, (size_t)numFolders + 1, alloc);
MY_ALLOC(uint32_t, p->FoStartPackStreamIndex, (size_t)numFolders + 1, alloc);
MY_ALLOC(uint32_t, p->FoToCoderUnpackSizes, (size_t)numFolders + 1, alloc);
MY_ALLOC_ZE(Byte, p->FoToMainUnpackSizeIndex, (size_t)numFolders, alloc);
startBufPtr = sd.Data;
@@ -675,7 +675,7 @@ static SRes ReadUnpackInfo(CSzAr *p,
for (fo = 0; fo < numFolders; fo++)
{
UInt32 numCoders, ci, numInStreams = 0;
uint32_t numCoders, ci, numInStreams = 0;
p->FoCodersOffsets[fo] = sd.Data - startBufPtr;
@@ -687,7 +687,7 @@ static SRes ReadUnpackInfo(CSzAr *p,
{
Byte mainByte;
unsigned idSize;
UInt32 coderInStreams;
uint32_t coderInStreams;
SZ_READ_BYTE_2(mainByte);
if ((mainByte & 0xC0) != 0)
@@ -703,7 +703,7 @@ static SRes ReadUnpackInfo(CSzAr *p,
if ((mainByte & 0x10) != 0)
{
UInt32 coderOutStreams;
uint32_t coderOutStreams;
RINOK(SzReadNumber32(&sd, &coderInStreams));
RINOK(SzReadNumber32(&sd, &coderOutStreams));
if (coderInStreams > k_Scan_NumCodersStreams_in_Folder_MAX || coderOutStreams != 1)
@@ -714,7 +714,7 @@ static SRes ReadUnpackInfo(CSzAr *p,
if ((mainByte & 0x20) != 0)
{
UInt32 propsSize;
uint32_t propsSize;
RINOK(SzReadNumber32(&sd, &propsSize));
if (propsSize > sd.Size)
return SZ_ERROR_ARCHIVE;
@@ -723,16 +723,16 @@ static SRes ReadUnpackInfo(CSzAr *p,
}
{
UInt32 indexOfMainStream = 0;
UInt32 numPackStreams = 1;
uint32_t indexOfMainStream = 0;
uint32_t numPackStreams = 1;
if (numCoders != 1 || numInStreams != 1)
{
Byte streamUsed[k_Scan_NumCodersStreams_in_Folder_MAX];
Byte coderUsed[k_Scan_NumCoders_MAX];
UInt32 i;
UInt32 numBonds = numCoders - 1;
uint32_t i;
uint32_t numBonds = numCoders - 1;
if (numInStreams < numBonds)
return SZ_ERROR_ARCHIVE;
@@ -746,7 +746,7 @@ static SRes ReadUnpackInfo(CSzAr *p,
for (i = 0; i < numBonds; i++)
{
UInt32 index;
uint32_t index;
RINOK(SzReadNumber32(&sd, &index));
if (index >= numInStreams || streamUsed[index])
@@ -764,7 +764,7 @@ static SRes ReadUnpackInfo(CSzAr *p,
if (numPackStreams != 1)
for (i = 0; i < numPackStreams; i++)
{
UInt32 index;
uint32_t index;
RINOK(SzReadNumber32(&sd, &index));
if (index >= numInStreams || streamUsed[index])
return SZ_ERROR_ARCHIVE;
@@ -812,9 +812,9 @@ static SRes ReadUnpackInfo(CSzAr *p,
RINOK(WaitId(&sd, k7zIdCodersUnpackSize));
MY_ALLOC_ZE(UInt64, p->CoderUnpackSizes, (size_t)numCodersOutStreams, alloc);
MY_ALLOC_ZE(uint64_t, p->CoderUnpackSizes, (size_t)numCodersOutStreams, alloc);
{
UInt32 i;
uint32_t i;
for (i = 0; i < numCodersOutStreams; i++)
{
RINOK(ReadNumber(&sd, p->CoderUnpackSizes + i));
@@ -823,7 +823,7 @@ static SRes ReadUnpackInfo(CSzAr *p,
for (;;)
{
UInt64 type;
uint64_t type;
RINOK(ReadID(&sd, &type));
if (type == k7zIdEnd)
{
@@ -840,7 +840,7 @@ static SRes ReadUnpackInfo(CSzAr *p,
}
UInt64 SzAr_GetFolderUnpackSize(const CSzAr *p, UInt32 folderIndex)
uint64_t SzAr_GetFolderUnpackSize(const CSzAr *p, uint32_t folderIndex)
{
return p->CoderUnpackSizes[p->FoToCoderUnpackSizes[folderIndex] + p->FoToMainUnpackSizeIndex[folderIndex]];
}
@@ -848,8 +848,8 @@ UInt64 SzAr_GetFolderUnpackSize(const CSzAr *p, UInt32 folderIndex)
typedef struct
{
UInt32 NumTotalSubStreams;
UInt32 NumSubDigests;
uint32_t NumTotalSubStreams;
uint32_t NumSubDigests;
CSzData sdNumSubStreams;
CSzData sdSizes;
CSzData sdCRCs;
@@ -858,24 +858,24 @@ typedef struct
static SRes ReadSubStreamsInfo(CSzAr *p, CSzData *sd, CSubStreamInfo *ssi)
{
UInt64 type = 0;
UInt32 numSubDigests = 0;
UInt32 numFolders = p->NumFolders;
UInt32 numUnpackStreams = numFolders;
UInt32 numUnpackSizesInData = 0;
uint64_t type = 0;
uint32_t numSubDigests = 0;
uint32_t numFolders = p->NumFolders;
uint32_t numUnpackStreams = numFolders;
uint32_t numUnpackSizesInData = 0;
for (;;)
{
RINOK(ReadID(sd, &type));
if (type == k7zIdNumUnpackStream)
{
UInt32 i;
uint32_t i;
ssi->sdNumSubStreams.Data = sd->Data;
numUnpackStreams = 0;
numSubDigests = 0;
for (i = 0; i < numFolders; i++)
{
UInt32 numStreams;
uint32_t numStreams;
RINOK(SzReadNumber32(sd, &numStreams));
if (numUnpackStreams > numUnpackStreams + numStreams)
return SZ_ERROR_UNSUPPORTED;
@@ -931,12 +931,12 @@ static SRes ReadSubStreamsInfo(CSzAr *p, CSzData *sd, CSubStreamInfo *ssi)
static SRes SzReadStreamsInfo(CSzAr *p,
CSzData *sd,
UInt32 numFoldersMax, const CBuf *tempBufs, UInt32 numTempBufs,
UInt64 *dataOffset,
uint32_t numFoldersMax, const CBuf *tempBufs, uint32_t numTempBufs,
uint64_t *dataOffset,
CSubStreamInfo *ssi,
ISzAllocPtr alloc)
{
UInt64 type;
uint64_t type;
SzData_Clear(&ssi->sdSizes);
SzData_Clear(&ssi->sdCRCs);
@@ -973,13 +973,13 @@ static SRes SzReadAndDecodePackedStreams(
ILookInStream *inStream,
CSzData *sd,
CBuf *tempBufs,
UInt32 numFoldersMax,
UInt64 baseOffset,
uint32_t numFoldersMax,
uint64_t baseOffset,
CSzAr *p,
ISzAllocPtr allocTemp)
{
UInt64 dataStartPos;
UInt32 fo;
uint64_t dataStartPos;
uint32_t fo;
CSubStreamInfo ssi;
RINOK(SzReadStreamsInfo(p, sd, numFoldersMax, NULL, 0, &dataStartPos, &ssi, allocTemp));
@@ -994,7 +994,7 @@ static SRes SzReadAndDecodePackedStreams(
for (fo = 0; fo < p->NumFolders; fo++)
{
CBuf *tempBuf = tempBufs + fo;
UInt64 unpackSize = SzAr_GetFolderUnpackSize(p, fo);
uint64_t unpackSize = SzAr_GetFolderUnpackSize(p, fo);
if ((size_t)unpackSize != unpackSize)
return SZ_ERROR_MEM;
if (!Buf_Create(tempBuf, (size_t)unpackSize, allocTemp))
@@ -1011,7 +1011,7 @@ static SRes SzReadAndDecodePackedStreams(
return SZ_OK;
}
static SRes SzReadFileNames(const Byte *data, size_t size, UInt32 numFiles, size_t *offsets)
static SRes SzReadFileNames(const Byte *data, size_t size, uint32_t numFiles, size_t *offsets)
{
size_t pos = 0;
*offsets++ = 0;
@@ -1028,7 +1028,7 @@ static SRes SzReadFileNames(const Byte *data, size_t size, UInt32 numFiles, size
return SZ_ERROR_ARCHIVE;
for (p = data + pos;
#ifdef _WIN32
*(const UInt16 *)p != 0
*(const uint16_t *)p != 0
#else
p[0] != 0 || p[1] != 0
#endif
@@ -1040,13 +1040,13 @@ static SRes SzReadFileNames(const Byte *data, size_t size, UInt32 numFiles, size
return (pos == size) ? SZ_OK : SZ_ERROR_ARCHIVE;
}
static MY_NO_INLINE SRes ReadTime(CSzBitUi64s *p, UInt32 num,
static MY_NO_INLINE SRes ReadTime(CSzBitUi64s *p, uint32_t num,
CSzData *sd2,
const CBuf *tempBufs, UInt32 numTempBufs,
const CBuf *tempBufs, uint32_t numTempBufs,
ISzAllocPtr alloc)
{
CSzData sd;
UInt32 i;
uint32_t i;
CNtfsFileTime *vals;
Byte *defs;
Byte external;
@@ -1058,7 +1058,7 @@ static MY_NO_INLINE SRes ReadTime(CSzBitUi64s *p, UInt32 num,
sd = *sd2;
else
{
UInt32 index;
uint32_t index;
RINOK(SzReadNumber32(sd2, &index));
if (index >= numTempBufs)
return SZ_ERROR_ARCHIVE;
@@ -1095,7 +1095,7 @@ static SRes SzReadHeader2(
CSzArEx *p, /* allocMain */
CSzData *sd,
ILookInStream *inStream,
CBuf *tempBufs, UInt32 *numTempBufs,
CBuf *tempBufs, uint32_t *numTempBufs,
ISzAllocPtr allocMain,
ISzAllocPtr allocTemp
)
@@ -1103,7 +1103,7 @@ static SRes SzReadHeader2(
CSubStreamInfo ssi;
{
UInt64 type;
uint64_t type;
SzData_Clear(&ssi.sdSizes);
SzData_Clear(&ssi.sdCRCs);
@@ -1118,7 +1118,7 @@ static SRes SzReadHeader2(
{
for (;;)
{
UInt64 type2;
uint64_t type2;
RINOK(ReadID(sd, &type2));
if (type2 == k7zIdEnd)
break;
@@ -1145,7 +1145,7 @@ static SRes SzReadHeader2(
if (type == k7zIdMainStreamsInfo)
{
RINOK(SzReadStreamsInfo(&p->db, sd, (UInt32)1 << 30, tempBufs, *numTempBufs,
RINOK(SzReadStreamsInfo(&p->db, sd, (uint32_t)1 << 30, tempBufs, *numTempBufs,
&p->dataPos, &ssi, allocMain));
p->dataPos += p->startPosAfterHeader;
RINOK(ReadID(sd, &type));
@@ -1161,8 +1161,8 @@ static SRes SzReadHeader2(
}
{
UInt32 numFiles = 0;
UInt32 numEmptyStreams = 0;
uint32_t numFiles = 0;
uint32_t numEmptyStreams = 0;
const Byte *emptyStreams = NULL;
const Byte *emptyFiles = NULL;
@@ -1171,8 +1171,8 @@ static SRes SzReadHeader2(
for (;;)
{
UInt64 type;
UInt64 size;
uint64_t type;
uint64_t size;
RINOK(ReadID(sd, &type));
if (type == k7zIdEnd)
break;
@@ -1180,7 +1180,7 @@ static SRes SzReadHeader2(
if (size > sd->Size)
return SZ_ERROR_ARCHIVE;
if (type >= ((UInt32)1 << 8))
if (type >= ((uint32_t)1 << 8))
{
SKIP_DATA(sd, size);
}
@@ -1200,7 +1200,7 @@ static SRes SzReadHeader2(
}
else
{
UInt32 index;
uint32_t index;
RINOK(SzReadNumber32(sd, &index));
if (index >= *numTempBufs)
return SZ_ERROR_ARCHIVE;
@@ -1244,7 +1244,7 @@ static SRes SzReadHeader2(
sdPtr = sd;
else
{
UInt32 index;
uint32_t index;
RINOK(SzReadNumber32(sd, &index));
if (index >= *numTempBufs)
return SZ_ERROR_ARCHIVE;
@@ -1279,7 +1279,7 @@ static SRes SzReadHeader2(
for (;;)
{
UInt64 type;
uint64_t type;
RINOK(ReadID(sd, &type));
if (type == k7zIdEnd)
break;
@@ -1287,24 +1287,24 @@ static SRes SzReadHeader2(
}
{
UInt32 i;
UInt32 emptyFileIndex = 0;
UInt32 folderIndex = 0;
UInt32 remSubStreams = 0;
UInt32 numSubStreams = 0;
UInt64 unpackPos = 0;
uint32_t i;
uint32_t emptyFileIndex = 0;
uint32_t folderIndex = 0;
uint32_t remSubStreams = 0;
uint32_t numSubStreams = 0;
uint64_t unpackPos = 0;
const Byte *digestsDefs = NULL;
const Byte *digestsVals = NULL;
UInt32 digestsValsIndex = 0;
UInt32 digestIndex;
uint32_t digestsValsIndex = 0;
uint32_t digestIndex;
Byte allDigestsDefined = 0;
Byte isDirMask = 0;
Byte crcMask = 0;
Byte mask = 0x80;
MY_ALLOC(UInt32, p->FolderToFile, p->db.NumFolders + 1, allocMain);
MY_ALLOC_ZE(UInt32, p->FileToFolder, p->NumFiles, allocMain);
MY_ALLOC(UInt64, p->UnpackPositions, p->NumFiles + 1, allocMain);
MY_ALLOC(uint32_t, p->FolderToFile, p->db.NumFolders + 1, allocMain);
MY_ALLOC_ZE(uint32_t, p->FileToFolder, p->NumFiles, allocMain);
MY_ALLOC(uint64_t, p->UnpackPositions, p->NumFiles + 1, allocMain);
MY_ALLOC_ZE(Byte, p->IsDirs, (p->NumFiles + 7) >> 3, allocMain);
RINOK(SzBitUi32s_Alloc(&p->CRCs, p->NumFiles, allocMain));
@@ -1328,7 +1328,7 @@ static SRes SzReadHeader2(
{
if (mask == 0)
{
UInt32 byteIndex = (i - 1) >> 3;
uint32_t byteIndex = (i - 1) >> 3;
p->IsDirs[byteIndex] = isDirMask;
p->CRCs.Defs[byteIndex] = crcMask;
isDirMask = 0;
@@ -1351,7 +1351,7 @@ static SRes SzReadHeader2(
isDirMask |= mask;
if (remSubStreams == 0)
{
p->FileToFolder[i] = (UInt32)-1;
p->FileToFolder[i] = (uint32_t)-1;
continue;
}
}
@@ -1372,7 +1372,7 @@ static SRes SzReadHeader2(
if (numSubStreams != 0)
break;
{
UInt64 folderUnpackSize = SzAr_GetFolderUnpackSize(&p->db, folderIndex);
uint64_t folderUnpackSize = SzAr_GetFolderUnpackSize(&p->db, folderIndex);
unpackPos += folderUnpackSize;
if (unpackPos < folderUnpackSize)
return SZ_ERROR_ARCHIVE;
@@ -1389,8 +1389,8 @@ static SRes SzReadHeader2(
if (--remSubStreams == 0)
{
UInt64 folderUnpackSize = SzAr_GetFolderUnpackSize(&p->db, folderIndex);
UInt64 startFolderUnpackPos = p->UnpackPositions[p->FolderToFile[folderIndex]];
uint64_t folderUnpackSize = SzAr_GetFolderUnpackSize(&p->db, folderIndex);
uint64_t startFolderUnpackPos = p->UnpackPositions[p->FolderToFile[folderIndex]];
if (folderUnpackSize < unpackPos - startFolderUnpackPos)
return SZ_ERROR_ARCHIVE;
unpackPos = startFolderUnpackPos + folderUnpackSize;
@@ -1413,7 +1413,7 @@ static SRes SzReadHeader2(
}
else
{
UInt64 v;
uint64_t v;
RINOK(ReadNumber(&ssi.sdSizes, &v));
unpackPos += v;
if (unpackPos < v)
@@ -1429,7 +1429,7 @@ static SRes SzReadHeader2(
if (mask != 0x80)
{
UInt32 byteIndex = (i - 1) >> 3;
uint32_t byteIndex = (i - 1) >> 3;
p->IsDirs[byteIndex] = isDirMask;
p->CRCs.Defs[byteIndex] = crcMask;
}
@@ -1451,7 +1451,7 @@ static SRes SzReadHeader2(
return SZ_ERROR_ARCHIVE;
/*
{
UInt64 folderUnpackSize = SzAr_GetFolderUnpackSize(&p->db, folderIndex);
uint64_t folderUnpackSize = SzAr_GetFolderUnpackSize(&p->db, folderIndex);
unpackPos += folderUnpackSize;
if (unpackPos < folderUnpackSize)
return SZ_ERROR_ARCHIVE;
@@ -1475,8 +1475,8 @@ static SRes SzReadHeader(
ISzAllocPtr allocMain,
ISzAllocPtr allocTemp)
{
UInt32 i;
UInt32 numTempBufs = 0;
uint32_t i;
uint32_t numTempBufs = 0;
SRes res;
CBuf tempBufs[NUM_ADDITIONAL_STREAMS_MAX];
@@ -1505,10 +1505,10 @@ static SRes SzArEx_Open2(
ISzAllocPtr allocTemp)
{
Byte header[k7zStartHeaderSize];
Int64 startArcPos;
UInt64 nextHeaderOffset, nextHeaderSize;
int64_t startArcPos;
uint64_t nextHeaderOffset, nextHeaderSize;
size_t nextHeaderSizeT;
UInt32 nextHeaderCRC;
uint32_t nextHeaderCRC;
CBuf buf;
SRes res;
@@ -1541,11 +1541,11 @@ static SRes SzArEx_Open2(
return SZ_ERROR_NO_ARCHIVE;
{
Int64 pos = 0;
int64_t pos = 0;
RINOK(ILookInStream_Seek(inStream, &pos, SZ_SEEK_END));
if ((UInt64)pos < startArcPos + nextHeaderOffset ||
(UInt64)pos < startArcPos + k7zStartHeaderSize + nextHeaderOffset ||
(UInt64)pos < startArcPos + k7zStartHeaderSize + nextHeaderOffset + nextHeaderSize)
if ((uint64_t)pos < startArcPos + nextHeaderOffset ||
(uint64_t)pos < startArcPos + k7zStartHeaderSize + nextHeaderOffset ||
(uint64_t)pos < startArcPos + k7zStartHeaderSize + nextHeaderOffset + nextHeaderSize)
return SZ_ERROR_INPUT_EOF;
}
@@ -1562,7 +1562,7 @@ static SRes SzArEx_Open2(
if (CrcCalc(buf.data, nextHeaderSizeT) == nextHeaderCRC)
{
CSzData sd;
UInt64 type;
uint64_t type;
sd.Data = buf.data;
sd.Size = buf.size;
@@ -1635,8 +1635,8 @@ SRes SzArEx_Open(CSzArEx *p, ILookInStream *inStream,
SRes SzArEx_Extract(
const CSzArEx *p,
ILookInStream *inStream,
UInt32 fileIndex,
UInt32 *blockIndex,
uint32_t fileIndex,
uint32_t *blockIndex,
Byte **tempBuf,
size_t *outBufferSize,
size_t *offset,
@@ -1644,13 +1644,13 @@ SRes SzArEx_Extract(
ISzAllocPtr allocMain,
ISzAllocPtr allocTemp)
{
UInt32 folderIndex = p->FileToFolder[fileIndex];
uint32_t folderIndex = p->FileToFolder[fileIndex];
SRes res = SZ_OK;
*offset = 0;
*outSizeProcessed = 0;
if (folderIndex == (UInt32)-1)
if (folderIndex == (uint32_t)-1)
{
ISzAlloc_Free(allocMain, *tempBuf);
*blockIndex = folderIndex;
@@ -1661,9 +1661,9 @@ SRes SzArEx_Extract(
if (*tempBuf == NULL || *blockIndex != folderIndex)
{
UInt64 unpackSizeSpec = SzAr_GetFolderUnpackSize(&p->db, folderIndex);
uint64_t unpackSizeSpec = SzAr_GetFolderUnpackSize(&p->db, folderIndex);
/*
UInt64 unpackSizeSpec =
uint64_t unpackSizeSpec =
p->UnpackPositions[p->FolderToFile[(size_t)folderIndex + 1]] -
p->UnpackPositions[p->FolderToFile[folderIndex]];
*/
@@ -1695,7 +1695,7 @@ SRes SzArEx_Extract(
if (res == SZ_OK)
{
UInt64 unpackPos = p->UnpackPositions[fileIndex];
uint64_t unpackPos = p->UnpackPositions[fileIndex];
*offset = (size_t)(unpackPos - p->UnpackPositions[p->FolderToFile[folderIndex]]);
*outSizeProcessed = (size_t)(p->UnpackPositions[(size_t)fileIndex + 1] - unpackPos);
if (*offset + *outSizeProcessed > *outBufferSize)
@@ -1709,7 +1709,7 @@ SRes SzArEx_Extract(
}
size_t SzArEx_GetFileNameUtf16(const CSzArEx *p, size_t fileIndex, UInt16 *dest)
size_t SzArEx_GetFileNameUtf16(const CSzArEx *p, size_t fileIndex, uint16_t *dest)
{
size_t offs = p->FileNameOffsets[fileIndex];
size_t len = p->FileNameOffsets[fileIndex + 1] - offs;
@@ -1732,17 +1732,17 @@ size_t SzArEx_GetFullNameLen(const CSzArEx *p, size_t fileIndex)
len = 0;
for (;;)
{
UInt32 parent = (UInt32)(Int32)-1;
uint32_t parent = (uint32_t)(Int32)-1;
len += p->FileNameOffsets[fileIndex + 1] - p->FileNameOffsets[fileIndex];
if SzBitWithVals_Check(&p->Parents, fileIndex)
parent = p->Parents.Vals[fileIndex];
if (parent == (UInt32)(Int32)-1)
if (parent == (uint32_t)(Int32)-1)
return len;
fileIndex = parent;
}
}
UInt16 *SzArEx_GetFullNameUtf16_Back(const CSzArEx *p, size_t fileIndex, UInt16 *dest)
uint16_t *SzArEx_GetFullNameUtf16_Back(const CSzArEx *p, size_t fileIndex, uint16_t *dest)
{
BoolInt needSlash;
if (!p->FileNameOffsets)
@@ -1753,7 +1753,7 @@ UInt16 *SzArEx_GetFullNameUtf16_Back(const CSzArEx *p, size_t fileIndex, UInt16
needSlash = False;
for (;;)
{
UInt32 parent = (UInt32)(Int32)-1;
uint32_t parent = (uint32_t)(Int32)-1;
size_t curLen = p->FileNameOffsets[fileIndex + 1] - p->FileNameOffsets[fileIndex];
SzArEx_GetFileNameUtf16(p, fileIndex, dest - curLen);
if (needSlash)
@@ -1763,7 +1763,7 @@ UInt16 *SzArEx_GetFullNameUtf16_Back(const CSzArEx *p, size_t fileIndex, UInt16
if SzBitWithVals_Check(&p->Parents, fileIndex)
parent = p->Parents.Vals[fileIndex];
if (parent == (UInt32)(Int32)-1)
if (parent == (uint32_t)(Int32)-1)
return dest;
fileIndex = parent;
}
+15 -15
View File
@@ -15,36 +15,36 @@
#define CRC_UINT32_SWAP(v) ((v >> 24) | ((v >> 8) & 0xFF00) | ((v << 8) & 0xFF0000) | (v << 24))
UInt32 MY_FAST_CALL CrcUpdateT1_BeT4(UInt32 v, const void *data, size_t size, const UInt32 *table);
UInt32 MY_FAST_CALL CrcUpdateT1_BeT8(UInt32 v, const void *data, size_t size, const UInt32 *table);
uint32_t MY_FAST_CALL CrcUpdateT1_BeT4(uint32_t v, const void *data, size_t size, const uint32_t *table);
uint32_t MY_FAST_CALL CrcUpdateT1_BeT8(uint32_t v, const void *data, size_t size, const uint32_t *table);
#endif
#ifndef MY_CPU_BE
UInt32 MY_FAST_CALL CrcUpdateT4(UInt32 v, const void *data, size_t size, const UInt32 *table);
UInt32 MY_FAST_CALL CrcUpdateT8(UInt32 v, const void *data, size_t size, const UInt32 *table);
uint32_t MY_FAST_CALL CrcUpdateT4(uint32_t v, const void *data, size_t size, const uint32_t *table);
uint32_t MY_FAST_CALL CrcUpdateT8(uint32_t v, const void *data, size_t size, const uint32_t *table);
#endif
typedef UInt32 (MY_FAST_CALL *CRC_FUNC)(UInt32 v, const void *data, size_t size, const UInt32 *table);
typedef uint32_t (MY_FAST_CALL *CRC_FUNC)(uint32_t v, const void *data, size_t size, const uint32_t *table);
CRC_FUNC g_CrcUpdateT4;
CRC_FUNC g_CrcUpdateT8;
CRC_FUNC g_CrcUpdate;
UInt32 g_CrcTable[256 * CRC_NUM_TABLES];
uint32_t g_CrcTable[256 * CRC_NUM_TABLES];
UInt32 MY_FAST_CALL CrcUpdate(UInt32 v, const void *data, size_t size)
uint32_t MY_FAST_CALL CrcUpdate(uint32_t v, const void *data, size_t size)
{
return g_CrcUpdate(v, data, size, g_CrcTable);
}
UInt32 MY_FAST_CALL CrcCalc(const void *data, size_t size)
uint32_t MY_FAST_CALL CrcCalc(const void *data, size_t size)
{
return g_CrcUpdate(CRC_INIT_VAL, data, size, g_CrcTable) ^ CRC_INIT_VAL;
}
#define CRC_UPDATE_BYTE_2(crc, b) (table[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8))
UInt32 MY_FAST_CALL CrcUpdateT1(UInt32 v, const void *data, size_t size, const UInt32 *table)
uint32_t MY_FAST_CALL CrcUpdateT1(uint32_t v, const void *data, size_t size, const uint32_t *table)
{
const Byte *p = (const Byte *)data;
const Byte *pEnd = p + size;
@@ -55,18 +55,18 @@ UInt32 MY_FAST_CALL CrcUpdateT1(UInt32 v, const void *data, size_t size, const U
void MY_FAST_CALL CrcGenerateTable()
{
UInt32 i;
uint32_t i;
for (i = 0; i < 256; i++)
{
UInt32 r = i;
uint32_t r = i;
unsigned j;
for (j = 0; j < 8; j++)
r = (r >> 1) ^ (kCrcPoly & ((UInt32)0 - (r & 1)));
r = (r >> 1) ^ (kCrcPoly & ((uint32_t)0 - (r & 1)));
g_CrcTable[i] = r;
}
for (i = 256; i < 256 * CRC_NUM_TABLES; i++)
{
UInt32 r = g_CrcTable[(size_t)i - 256];
uint32_t r = g_CrcTable[(size_t)i - 256];
g_CrcTable[i] = g_CrcTable[r & 0xFF] ^ (r >> 8);
}
@@ -93,7 +93,7 @@ void MY_FAST_CALL CrcGenerateTable()
#else
{
#ifndef MY_CPU_BE
UInt32 k = 0x01020304;
uint32_t k = 0x01020304;
const Byte *p = (const Byte *)&k;
if (p[0] == 4 && p[1] == 3)
{
@@ -111,7 +111,7 @@ void MY_FAST_CALL CrcGenerateTable()
{
for (i = 256 * CRC_NUM_TABLES - 1; i >= 256; i--)
{
UInt32 x = g_CrcTable[(size_t)i - 256];
uint32_t x = g_CrcTable[(size_t)i - 256];
g_CrcTable[i] = CRC_UINT32_SWAP(x);
}
g_CrcUpdateT4 = CrcUpdateT1_BeT4;
+3 -3
View File
@@ -8,7 +8,7 @@
EXTERN_C_BEGIN
extern UInt32 g_CrcTable[];
extern uint32_t g_CrcTable[];
/* Call CrcGenerateTable one time before other CRC functions */
void MY_FAST_CALL CrcGenerateTable(void);
@@ -17,8 +17,8 @@ void MY_FAST_CALL CrcGenerateTable(void);
#define CRC_GET_DIGEST(crc) ((crc) ^ CRC_INIT_VAL)
#define CRC_UPDATE_BYTE(crc, b) (g_CrcTable[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8))
UInt32 MY_FAST_CALL CrcUpdate(UInt32 crc, const void *data, size_t size);
UInt32 MY_FAST_CALL CrcCalc(const void *data, size_t size);
uint32_t MY_FAST_CALL CrcUpdate(uint32_t crc, const void *data, size_t size);
uint32_t MY_FAST_CALL CrcCalc(const void *data, size_t size);
EXTERN_C_END
+12 -12
View File
@@ -9,14 +9,14 @@
#define CRC_UPDATE_BYTE_2(crc, b) (table[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8))
UInt32 MY_FAST_CALL CrcUpdateT4(UInt32 v, const void *data, size_t size, const UInt32 *table)
uint32_t MY_FAST_CALL CrcUpdateT4(uint32_t v, const void *data, size_t size, const uint32_t *table)
{
const Byte *p = (const Byte *)data;
for (; size > 0 && ((unsigned)(ptrdiff_t)p & 3) != 0; size--, p++)
v = CRC_UPDATE_BYTE_2(v, *p);
for (; size >= 4; size -= 4, p += 4)
{
v ^= *(const UInt32 *)p;
v ^= *(const uint32_t *)p;
v =
(table + 0x300)[((v ) & 0xFF)]
^ (table + 0x200)[((v >> 8) & 0xFF)]
@@ -28,21 +28,21 @@ UInt32 MY_FAST_CALL CrcUpdateT4(UInt32 v, const void *data, size_t size, const U
return v;
}
UInt32 MY_FAST_CALL CrcUpdateT8(UInt32 v, const void *data, size_t size, const UInt32 *table)
uint32_t MY_FAST_CALL CrcUpdateT8(uint32_t v, const void *data, size_t size, const uint32_t *table)
{
const Byte *p = (const Byte *)data;
for (; size > 0 && ((unsigned)(ptrdiff_t)p & 7) != 0; size--, p++)
v = CRC_UPDATE_BYTE_2(v, *p);
for (; size >= 8; size -= 8, p += 8)
{
UInt32 d;
v ^= *(const UInt32 *)p;
uint32_t d;
v ^= *(const uint32_t *)p;
v =
(table + 0x700)[((v ) & 0xFF)]
^ (table + 0x600)[((v >> 8) & 0xFF)]
^ (table + 0x500)[((v >> 16) & 0xFF)]
^ (table + 0x400)[((v >> 24))];
d = *((const UInt32 *)p + 1);
d = *((const uint32_t *)p + 1);
v ^=
(table + 0x300)[((d ) & 0xFF)]
^ (table + 0x200)[((d >> 8) & 0xFF)]
@@ -63,7 +63,7 @@ UInt32 MY_FAST_CALL CrcUpdateT8(UInt32 v, const void *data, size_t size, const U
#define CRC_UPDATE_BYTE_2_BE(crc, b) (table[(((crc) >> 24) ^ (b))] ^ ((crc) << 8))
UInt32 MY_FAST_CALL CrcUpdateT1_BeT4(UInt32 v, const void *data, size_t size, const UInt32 *table)
uint32_t MY_FAST_CALL CrcUpdateT1_BeT4(uint32_t v, const void *data, size_t size, const uint32_t *table)
{
const Byte *p = (const Byte *)data;
table += 0x100;
@@ -72,7 +72,7 @@ UInt32 MY_FAST_CALL CrcUpdateT1_BeT4(UInt32 v, const void *data, size_t size, co
v = CRC_UPDATE_BYTE_2_BE(v, *p);
for (; size >= 4; size -= 4, p += 4)
{
v ^= *(const UInt32 *)p;
v ^= *(const uint32_t *)p;
v =
(table + 0x000)[((v ) & 0xFF)]
^ (table + 0x100)[((v >> 8) & 0xFF)]
@@ -84,7 +84,7 @@ UInt32 MY_FAST_CALL CrcUpdateT1_BeT4(UInt32 v, const void *data, size_t size, co
return CRC_UINT32_SWAP(v);
}
UInt32 MY_FAST_CALL CrcUpdateT1_BeT8(UInt32 v, const void *data, size_t size, const UInt32 *table)
uint32_t MY_FAST_CALL CrcUpdateT1_BeT8(uint32_t v, const void *data, size_t size, const uint32_t *table)
{
const Byte *p = (const Byte *)data;
table += 0x100;
@@ -93,14 +93,14 @@ UInt32 MY_FAST_CALL CrcUpdateT1_BeT8(UInt32 v, const void *data, size_t size, co
v = CRC_UPDATE_BYTE_2_BE(v, *p);
for (; size >= 8; size -= 8, p += 8)
{
UInt32 d;
v ^= *(const UInt32 *)p;
uint32_t d;
v ^= *(const uint32_t *)p;
v =
(table + 0x400)[((v ) & 0xFF)]
^ (table + 0x500)[((v >> 8) & 0xFF)]
^ (table + 0x600)[((v >> 16) & 0xFF)]
^ (table + 0x700)[((v >> 24))];
d = *((const UInt32 *)p + 1);
d = *((const uint32_t *)p + 1);
v ^=
(table + 0x000)[((d ) & 0xFF)]
^ (table + 0x100)[((d >> 8) & 0xFF)]
+26 -26
View File
@@ -43,7 +43,7 @@ typedef struct
const Byte *cur;
const Byte *end;
const Byte *begin;
UInt64 processed;
uint64_t processed;
BoolInt extra;
SRes res;
const ILookInStream *inStream;
@@ -70,7 +70,7 @@ static Byte ReadByte(const IByteIn *pp)
return 0;
}
static SRes SzDecodePpmd(const Byte *props, unsigned propsSize, UInt64 inSize, const ILookInStream *inStream,
static SRes SzDecodePpmd(const Byte *props, unsigned propsSize, uint64_t inSize, const ILookInStream *inStream,
Byte *outBuffer, SizeT outSize, ISzAllocPtr allocMain)
{
CPpmd7 ppmd;
@@ -89,7 +89,7 @@ static SRes SzDecodePpmd(const Byte *props, unsigned propsSize, UInt64 inSize, c
{
unsigned order = props[0];
UInt32 memSize = GetUi32(props + 1);
uint32_t memSize = GetUi32(props + 1);
if (order < PPMD7_MIN_ORDER ||
order > PPMD7_MAX_ORDER ||
memSize < PPMD7_MIN_MEM_SIZE ||
@@ -131,7 +131,7 @@ static SRes SzDecodePpmd(const Byte *props, unsigned propsSize, UInt64 inSize, c
#endif
static SRes SzDecodeLzma(const Byte *props, unsigned propsSize, UInt64 inSize, ILookInStream *inStream,
static SRes SzDecodeLzma(const Byte *props, unsigned propsSize, uint64_t inSize, ILookInStream *inStream,
Byte *outBuffer, SizeT outSize, ISzAllocPtr allocMain)
{
CLzmaDec state;
@@ -191,7 +191,7 @@ static SRes SzDecodeLzma(const Byte *props, unsigned propsSize, UInt64 inSize, I
#ifndef _7Z_NO_METHOD_LZMA2
static SRes SzDecodeLzma2(const Byte *props, unsigned propsSize, UInt64 inSize, ILookInStream *inStream,
static SRes SzDecodeLzma2(const Byte *props, unsigned propsSize, uint64_t inSize, ILookInStream *inStream,
Byte *outBuffer, SizeT outSize, ISzAllocPtr allocMain)
{
CLzma2Dec state;
@@ -250,7 +250,7 @@ static SRes SzDecodeLzma2(const Byte *props, unsigned propsSize, UInt64 inSize,
#endif
static SRes SzDecodeCopy(UInt64 inSize, ILookInStream *inStream, Byte *outBuffer)
static SRes SzDecodeCopy(uint64_t inSize, ILookInStream *inStream, Byte *outBuffer)
{
while (inSize > 0)
{
@@ -269,7 +269,7 @@ static SRes SzDecodeCopy(UInt64 inSize, ILookInStream *inStream, Byte *outBuffer
return SZ_OK;
}
static BoolInt IS_MAIN_METHOD(UInt32 m)
static BoolInt IS_MAIN_METHOD(uint32_t m)
{
switch (m)
{
@@ -290,8 +290,8 @@ static BoolInt IS_SUPPORTED_CODER(const CSzCoderInfo *c)
{
return
c->NumStreams == 1
/* && c->MethodID <= (UInt32)0xFFFFFFFF */
&& IS_MAIN_METHOD((UInt32)c->MethodID);
/* && c->MethodID <= (uint32_t)0xFFFFFFFF */
&& IS_MAIN_METHOD((uint32_t)c->MethodID);
}
#define IS_BCJ2(c) ((c)->MethodID == k_BCJ2 && (c)->NumStreams == 4)
@@ -316,7 +316,7 @@ static SRes CheckSupportedFolder(const CSzFolder *f)
{
const CSzCoderInfo *c = &f->Coders[1];
if (
/* c->MethodID > (UInt32)0xFFFFFFFF || */
/* c->MethodID > (uint32_t)0xFFFFFFFF || */
c->NumStreams != 1
|| f->NumPackStreams != 1
|| f->PackStreams[0] != 0
@@ -324,7 +324,7 @@ static SRes CheckSupportedFolder(const CSzFolder *f)
|| f->Bonds[0].InIndex != 1
|| f->Bonds[0].OutIndex != 0)
return SZ_ERROR_UNSUPPORTED;
switch ((UInt32)c->MethodID)
switch ((uint32_t)c->MethodID)
{
case k_Delta:
case k_BCJ:
@@ -369,13 +369,13 @@ static SRes CheckSupportedFolder(const CSzFolder *f)
static SRes SzFolder_Decode2(const CSzFolder *folder,
const Byte *propsData,
const UInt64 *unpackSizes,
const UInt64 *packPositions,
ILookInStream *inStream, UInt64 startPos,
const uint64_t *unpackSizes,
const uint64_t *packPositions,
ILookInStream *inStream, uint64_t startPos,
Byte *outBuffer, SizeT outSize, ISzAllocPtr allocMain,
Byte *tempBuf[])
{
UInt32 ci;
uint32_t ci;
SizeT tempSizes[3] = { 0, 0, 0};
SizeT tempSize3 = 0;
Byte *tempBuf3 = 0;
@@ -386,17 +386,17 @@ static SRes SzFolder_Decode2(const CSzFolder *folder,
{
const CSzCoderInfo *coder = &folder->Coders[ci];
if (IS_MAIN_METHOD((UInt32)coder->MethodID))
if (IS_MAIN_METHOD((uint32_t)coder->MethodID))
{
UInt32 si = 0;
UInt64 offset;
UInt64 inSize;
uint32_t si = 0;
uint64_t offset;
uint64_t inSize;
Byte *outBufCur = outBuffer;
SizeT outSizeCur = outSize;
if (folder->NumCoders == 4)
{
UInt32 indices[] = { 3, 2, 0 };
UInt64 unpackSize = unpackSizes[ci];
uint32_t indices[] = { 3, 2, 0 };
uint64_t unpackSize = unpackSizes[ci];
si = indices[ci];
if (ci < 2)
{
@@ -451,8 +451,8 @@ static SRes SzFolder_Decode2(const CSzFolder *folder,
}
else if (coder->MethodID == k_BCJ2)
{
UInt64 offset = packPositions[1];
UInt64 s3Size = packPositions[2] - offset;
uint64_t offset = packPositions[1];
uint64_t s3Size = packPositions[2] - offset;
if (ci != 3)
return SZ_ERROR_UNSUPPORTED;
@@ -522,7 +522,7 @@ static SRes SzFolder_Decode2(const CSzFolder *folder,
{
case k_BCJ:
{
UInt32 state;
uint32_t state;
x86_Convert_Init(state);
x86_Convert(outBuffer, outSize, 0, &state, 0);
break;
@@ -546,8 +546,8 @@ static SRes SzFolder_Decode2(const CSzFolder *folder,
}
SRes SzAr_DecodeFolder(const CSzAr *p, UInt32 folderIndex,
ILookInStream *inStream, UInt64 startPos,
SRes SzAr_DecodeFolder(const CSzAr *p, uint32_t folderIndex,
ILookInStream *inStream, uint64_t startPos,
Byte *outBuffer, size_t outSize,
ISzAllocPtr allocMain)
{
+6 -6
View File
@@ -166,14 +166,14 @@ WRes File_Write(CSzFile *p, const void *data, size_t *size)
#endif
}
WRes File_Seek(CSzFile *p, Int64 *pos, ESzSeek origin)
WRes File_Seek(CSzFile *p, int64_t *pos, ESzSeek origin)
{
#ifdef USE_WINDOWS_FILE
LARGE_INTEGER value;
DWORD moveMethod;
value.LowPart = (DWORD)*pos;
value.HighPart = (LONG)((UInt64)*pos >> 16 >> 16); /* for case when UInt64 is 32-bit only */
value.HighPart = (LONG)((uint64_t)*pos >> 16 >> 16); /* for case when uint64_t is 32-bit only */
switch (origin)
{
case SZ_SEEK_SET: moveMethod = FILE_BEGIN; break;
@@ -188,7 +188,7 @@ WRes File_Seek(CSzFile *p, Int64 *pos, ESzSeek origin)
if (res != NO_ERROR)
return res;
}
*pos = ((Int64)value.HighPart << 32) | value.LowPart;
*pos = ((int64_t)value.HighPart << 32) | value.LowPart;
return 0;
#else
@@ -209,7 +209,7 @@ WRes File_Seek(CSzFile *p, Int64 *pos, ESzSeek origin)
#endif
}
WRes File_GetLength(CSzFile *p, UInt64 *length)
WRes File_GetLength(CSzFile *p, uint64_t *length)
{
#ifdef USE_WINDOWS_FILE
@@ -221,7 +221,7 @@ WRes File_GetLength(CSzFile *p, UInt64 *length)
if (res != NO_ERROR)
return res;
}
*length = (((UInt64)sizeHigh) << 32) + sizeLow;
*length = (((uint64_t)sizeHigh) << 32) + sizeLow;
return 0;
#else
@@ -258,7 +258,7 @@ static SRes FileInStream_Read(const ISeekInStream *pp, void *buf, size_t *size)
return (File_Read(&p->file, buf, size) == 0) ? SZ_OK : SZ_ERROR_READ;
}
static SRes FileInStream_Seek(const ISeekInStream *pp, Int64 *pos, ESzSeek origin)
static SRes FileInStream_Seek(const ISeekInStream *pp, int64_t *pos, ESzSeek origin)
{
CFileInStream *p = CONTAINER_FROM_VTBL(pp, CFileInStream, vt);
return File_Seek(&p->file, pos, origin);
+2 -2
View File
@@ -46,8 +46,8 @@ WRes File_Read(CSzFile *p, void *data, size_t *size);
/* writes *size bytes */
WRes File_Write(CSzFile *p, const void *data, size_t *size);
WRes File_Seek(CSzFile *p, Int64 *pos, ESzSeek origin);
WRes File_GetLength(CSzFile *p, UInt64 *length);
WRes File_Seek(CSzFile *p, int64_t *pos, ESzSeek origin);
WRes File_GetLength(CSzFile *p, uint64_t *length);
/* ---------- FileInStream ---------- */
+3 -3
View File
@@ -35,9 +35,9 @@ SRes SeqInStream_ReadByte(const ISeqInStream *stream, Byte *buf)
SRes LookInStream_SeekTo(const ILookInStream *stream, UInt64 offset)
SRes LookInStream_SeekTo(const ILookInStream *stream, uint64_t offset)
{
Int64 t = offset;
int64_t t = offset;
return ILookInStream_Seek(stream, &t, SZ_SEEK_SET);
}
@@ -134,7 +134,7 @@ static SRes LookToRead2_Read(const ILookInStream *pp, void *buf, size_t *size)
return SZ_OK;
}
static SRes LookToRead2_Seek(const ILookInStream *pp, Int64 *pos, ESzSeek origin)
static SRes LookToRead2_Seek(const ILookInStream *pp, int64_t *pos, ESzSeek origin)
{
GET_LookToRead2
p->pos = p->size = 0;
+7 -23
View File
@@ -4,11 +4,8 @@
#ifndef __7Z_TYPES_H
#define __7Z_TYPES_H
#ifdef _WIN32
/* #include <windows.h> */
#endif
#include <stddef.h>
#include <stdint.h>
#ifndef EXTERN_C_BEGIN
#ifdef __cplusplus
@@ -67,15 +64,6 @@ typedef int WRes;
typedef unsigned char Byte;
#endif
typedef short Int16;
typedef unsigned short UInt16;
#if defined(_LZMA_UINT32_IS_ULONG) && !defined(__LP64__)
typedef long Int32;
typedef unsigned long UInt32;
#else
typedef int Int32;
typedef unsigned int UInt32;
#endif
#ifdef _SZ_NO_INT_64
@@ -83,24 +71,20 @@ typedef unsigned int UInt32;
NOTES: Some code will work incorrectly in that case! */
typedef long Int64;
typedef unsigned long UInt64;
#else
#if defined(_MSC_VER) || defined(__BORLANDC__)
typedef __int64 Int64;
typedef unsigned __int64 UInt64;
#define UINT64_CONST(n) n
#else
typedef long long int Int64;
typedef unsigned long long int UInt64;
#define UINT64_CONST(n) n ## ULL
#endif
#endif
#ifdef _LZMA_NO_SYSTEM_SIZE_T
typedef UInt32 SizeT;
typedef uint32_t SizeT;
#else
typedef size_t SizeT;
#endif
@@ -204,7 +188,7 @@ typedef struct ISeekInStream ISeekInStream;
struct ISeekInStream
{
SRes (*Read)(const ISeekInStream *p, void *buf, size_t *size); /* same as ISeqInStream::Read */
SRes (*Seek)(const ISeekInStream *p, Int64 *pos, ESzSeek origin);
SRes (*Seek)(const ISeekInStream *p, int64_t *pos, ESzSeek origin);
};
#define ISeekInStream_Read(p, buf, size) (p)->Read(p, buf, size)
#define ISeekInStream_Seek(p, pos, origin) (p)->Seek(p, pos, origin)
@@ -222,7 +206,7 @@ struct ILookInStream
SRes (*Read)(const ILookInStream *p, void *buf, size_t *size);
/* reads directly (without buffer). It's same as ISeqInStream::Read */
SRes (*Seek)(const ILookInStream *p, Int64 *pos, ESzSeek origin);
SRes (*Seek)(const ILookInStream *p, int64_t *pos, ESzSeek origin);
};
#define ILookInStream_Look(p, buf, size) (p)->Look(p, buf, size)
@@ -232,7 +216,7 @@ struct ILookInStream
SRes LookInStream_LookRead(const ILookInStream *stream, void *buf, size_t *size);
SRes LookInStream_SeekTo(const ILookInStream *stream, UInt64 offset);
SRes LookInStream_SeekTo(const ILookInStream *stream, uint64_t offset);
/* reads via ILookInStream::Read */
SRes LookInStream_Read2(const ILookInStream *stream, void *buf, size_t size, SRes errorType);
@@ -281,9 +265,9 @@ typedef struct ICompressProgress ICompressProgress;
struct ICompressProgress
{
SRes (*Progress)(const ICompressProgress *p, UInt64 inSize, UInt64 outSize);
SRes (*Progress)(const ICompressProgress *p, uint64_t inSize, uint64_t outSize);
/* Returns: result. (result != SZ_OK) means break.
Value (UInt64)(Int64)-1 for size means unknown value. */
Value (uint64_t)(int64_t)-1 for size means unknown value. */
};
#define ICompressProgress_Progress(p, inSize, outSize) (p)->Progress(p, inSize, outSize)
+7 -7
View File
@@ -6,10 +6,10 @@
#include "Bcj2.h"
#include "CpuArch.h"
#define CProb UInt16
#define CProb uint16_t
#undef kTopValue
#define kTopValue ((UInt32)1 << 24)
#define kTopValue ((uint32_t)1 << 24)
#define kNumModelBits 11
#undef kBitModelTotal
#define kBitModelTotal (1 << kNumModelBits)
@@ -78,7 +78,7 @@ SRes Bcj2Dec_Decode(CBcj2Dec *p)
p->bufs[p->state] = cur + 4;
{
UInt32 val;
uint32_t val;
Byte *dest;
SizeT rem;
@@ -176,7 +176,7 @@ SRes Bcj2Dec_Decode(CBcj2Dec *p)
{
p->temp[3] = src[-1];
p->bufs[BCJ2_STREAM_MAIN] = src;
p->ip += (UInt32)num;
p->ip += (uint32_t)num;
p->dest += num;
p->state =
p->bufs[BCJ2_STREAM_MAIN] ==
@@ -187,7 +187,7 @@ SRes Bcj2Dec_Decode(CBcj2Dec *p)
}
{
UInt32 bound, ttt;
uint32_t bound, ttt;
CProb *prob;
Byte b = src[0];
Byte prev = (Byte)(num == 0 ? p->temp[3] : src[-1]);
@@ -195,7 +195,7 @@ SRes Bcj2Dec_Decode(CBcj2Dec *p)
p->temp[3] = b;
p->bufs[BCJ2_STREAM_MAIN] = src + 1;
num++;
p->ip += (UInt32)num;
p->ip += (uint32_t)num;
p->dest += num;
prob = p->probs + (unsigned)(b == 0xE8 ? 2 + (unsigned)prev : (b == 0xE9 ? 1 : 0));
@@ -212,7 +212,7 @@ SRes Bcj2Dec_Decode(CBcj2Dec *p)
}
{
UInt32 val;
uint32_t val;
unsigned cj = (p->temp[3] == 0xE8) ? BCJ2_STREAM_CALL : BCJ2_STREAM_JUMP;
const Byte *cur = p->bufs[cj];
Byte *dest;
+15 -15
View File
@@ -68,11 +68,11 @@ typedef struct
unsigned state; /* BCJ2_STREAM_MAIN has more priority than BCJ2_STATE_ORIG */
UInt32 ip;
uint32_t ip;
Byte temp[4];
UInt32 range;
UInt32 code;
UInt16 probs[2 + 256];
uint32_t range;
uint32_t code;
uint16_t probs[2 + 256];
} CBcj2Dec;
void Bcj2Dec_Init(CBcj2Dec *p);
@@ -104,28 +104,28 @@ typedef struct
Byte prevByte;
Byte cache;
UInt32 range;
UInt64 low;
UInt64 cacheSize;
uint32_t range;
uint64_t low;
uint64_t cacheSize;
UInt32 ip;
uint32_t ip;
/* 32-bit ralative offset in JUMP/CALL commands is
- (mod 4 GB) in 32-bit mode
- signed Int32 in 64-bit mode
We use (mod 4 GB) check for fileSize.
Use fileSize up to 2 GB, if you want to support 32-bit and 64-bit code conversion. */
UInt32 fileIp;
UInt32 fileSize; /* (fileSize <= ((UInt32)1 << 31)), 0 means no_limit */
UInt32 relatLimit; /* (relatLimit <= ((UInt32)1 << 31)), 0 means desable_conversion */
uint32_t fileIp;
uint32_t fileSize; /* (fileSize <= ((uint32_t)1 << 31)), 0 means no_limit */
uint32_t relatLimit; /* (relatLimit <= ((uint32_t)1 << 31)), 0 means desable_conversion */
UInt32 tempTarget;
uint32_t tempTarget;
unsigned tempPos;
Byte temp[4 * 2];
unsigned flushPos;
UInt16 probs[2 + 256];
uint16_t probs[2 + 256];
} CBcj2Enc;
void Bcj2Enc_Init(CBcj2Enc *p);
@@ -136,10 +136,10 @@ void Bcj2Enc_Encode(CBcj2Enc *p);
#define BCJ2_RELAT_LIMIT_NUM_BITS 26
#define BCJ2_RELAT_LIMIT ((UInt32)1 << BCJ2_RELAT_LIMIT_NUM_BITS)
#define BCJ2_RELAT_LIMIT ((uint32_t)1 << BCJ2_RELAT_LIMIT_NUM_BITS)
/* limit for CBcj2Enc::fileSize variable */
#define BCJ2_FileSize_MAX ((UInt32)1 << 31)
#define BCJ2_FileSize_MAX ((uint32_t)1 << 31)
EXTERN_C_END
+35 -35
View File
@@ -6,7 +6,7 @@
#include "CpuArch.h"
#include "Bra.h"
SizeT ARM_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
SizeT ARM_Convert(Byte *data, SizeT size, uint32_t ip, int encoding)
{
Byte *p;
const Byte *lim;
@@ -28,9 +28,9 @@ SizeT ARM_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
break;
}
{
UInt32 v = GetUi32(p - 4);
uint32_t v = GetUi32(p - 4);
v <<= 2;
v += ip + (UInt32)(p - data);
v += ip + (uint32_t)(p - data);
v >>= 2;
v &= 0x00FFFFFF;
v |= 0xEB000000;
@@ -49,9 +49,9 @@ SizeT ARM_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
break;
}
{
UInt32 v = GetUi32(p - 4);
uint32_t v = GetUi32(p - 4);
v <<= 2;
v -= ip + (UInt32)(p - data);
v -= ip + (uint32_t)(p - data);
v >>= 2;
v &= 0x00FFFFFF;
v |= 0xEB000000;
@@ -61,7 +61,7 @@ SizeT ARM_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
}
SizeT ARMT_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
SizeT ARMT_Convert(Byte *data, SizeT size, uint32_t ip, int encoding)
{
Byte *p;
const Byte *lim;
@@ -73,10 +73,10 @@ SizeT ARMT_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
for (;;)
{
UInt32 b1;
uint32_t b1;
for (;;)
{
UInt32 b3;
uint32_t b3;
if (p > lim)
return p - data;
b1 = p[1];
@@ -87,15 +87,15 @@ SizeT ARMT_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
break;
}
{
UInt32 v =
((UInt32)b1 << 19)
+ (((UInt32)p[1] & 0x7) << 8)
+ (((UInt32)p[-2] << 11))
uint32_t v =
((uint32_t)b1 << 19)
+ (((uint32_t)p[1] & 0x7) << 8)
+ (((uint32_t)p[-2] << 11))
+ (p[0]);
p += 2;
{
UInt32 cur = (ip + (UInt32)(p - data)) >> 1;
uint32_t cur = (ip + (uint32_t)(p - data)) >> 1;
v += cur;
}
@@ -108,10 +108,10 @@ SizeT ARMT_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
for (;;)
{
UInt32 b1;
uint32_t b1;
for (;;)
{
UInt32 b3;
uint32_t b3;
if (p > lim)
return p - data;
b1 = p[1];
@@ -122,21 +122,21 @@ SizeT ARMT_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
break;
}
{
UInt32 v =
((UInt32)b1 << 19)
+ (((UInt32)p[1] & 0x7) << 8)
+ (((UInt32)p[-2] << 11))
uint32_t v =
((uint32_t)b1 << 19)
+ (((uint32_t)p[1] & 0x7) << 8)
+ (((uint32_t)p[-2] << 11))
+ (p[0]);
p += 2;
{
UInt32 cur = (ip + (UInt32)(p - data)) >> 1;
uint32_t cur = (ip + (uint32_t)(p - data)) >> 1;
v -= cur;
}
/*
SetUi16(p - 4, (UInt16)(((v >> 11) & 0x7FF) | 0xF000));
SetUi16(p - 2, (UInt16)(v | 0xF800));
SetUi16(p - 4, (uint16_t)(((v >> 11) & 0x7FF) | 0xF000));
SetUi16(p - 2, (uint16_t)(v | 0xF800));
*/
p[-4] = (Byte)(v >> 11);
@@ -148,7 +148,7 @@ SizeT ARMT_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
}
SizeT PPC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
SizeT PPC_Convert(Byte *data, SizeT size, uint32_t ip, int encoding)
{
Byte *p;
const Byte *lim;
@@ -169,11 +169,11 @@ SizeT PPC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
break;
}
{
UInt32 v = GetBe32(p - 4);
uint32_t v = GetBe32(p - 4);
if (encoding)
v += ip + (UInt32)(p - data);
v += ip + (uint32_t)(p - data);
else
v -= ip + (UInt32)(p - data);
v -= ip + (uint32_t)(p - data);
v &= 0x03FFFFFF;
v |= 0x48000000;
SetBe32(p - 4, v);
@@ -182,7 +182,7 @@ SizeT PPC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
}
SizeT SPARC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
SizeT SPARC_Convert(Byte *data, SizeT size, uint32_t ip, int encoding)
{
Byte *p;
const Byte *lim;
@@ -200,10 +200,10 @@ SizeT SPARC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
/*
v = GetBe32(p);
p += 4;
m = v + ((UInt32)5 << 29);
m ^= (UInt32)7 << 29;
m += (UInt32)1 << 22;
if ((m & ((UInt32)0x1FF << 23)) == 0)
m = v + ((uint32_t)5 << 29);
m ^= (uint32_t)7 << 29;
m += (uint32_t)1 << 22;
if ((m & ((uint32_t)0x1FF << 23)) == 0)
break;
*/
p += 4;
@@ -212,15 +212,15 @@ SizeT SPARC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
break;
}
{
UInt32 v = GetBe32(p - 4);
uint32_t v = GetBe32(p - 4);
v <<= 2;
if (encoding)
v += ip + (UInt32)(p - data);
v += ip + (uint32_t)(p - data);
else
v -= ip + (UInt32)(p - data);
v -= ip + (uint32_t)(p - data);
v &= 0x01FFFFFF;
v -= (UInt32)1 << 24;
v -= (uint32_t)1 << 24;
v ^= 0xFF000000;
v >>= 2;
v |= 0x40000000;
+7 -7
View File
@@ -40,7 +40,7 @@ in CALL instructions to increase the compression ratio.
Example:
UInt32 ip = 0;
uint32_t ip = 0;
for ()
{
; size must be >= Alignment + LookAhead, if it's not last block
@@ -52,12 +52,12 @@ in CALL instructions to increase the compression ratio.
*/
#define x86_Convert_Init(state) { state = 0; }
SizeT x86_Convert(Byte *data, SizeT size, UInt32 ip, UInt32 *state, int encoding);
SizeT ARM_Convert(Byte *data, SizeT size, UInt32 ip, int encoding);
SizeT ARMT_Convert(Byte *data, SizeT size, UInt32 ip, int encoding);
SizeT PPC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding);
SizeT SPARC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding);
SizeT IA64_Convert(Byte *data, SizeT size, UInt32 ip, int encoding);
SizeT x86_Convert(Byte *data, SizeT size, uint32_t ip, uint32_t *state, int encoding);
SizeT ARM_Convert(Byte *data, SizeT size, uint32_t ip, int encoding);
SizeT ARMT_Convert(Byte *data, SizeT size, uint32_t ip, int encoding);
SizeT PPC_Convert(Byte *data, SizeT size, uint32_t ip, int encoding);
SizeT SPARC_Convert(Byte *data, SizeT size, uint32_t ip, int encoding);
SizeT IA64_Convert(Byte *data, SizeT size, uint32_t ip, int encoding);
EXTERN_C_END
+5 -5
View File
@@ -7,10 +7,10 @@
#define Test86MSByte(b) ((((b) + 1) & 0xFE) == 0)
SizeT x86_Convert(Byte *data, SizeT size, UInt32 ip, UInt32 *state, int encoding)
SizeT x86_Convert(Byte *data, SizeT size, uint32_t ip, uint32_t *state, int encoding)
{
SizeT pos = 0;
UInt32 mask = *state & 7;
uint32_t mask = *state & 7;
if (size < 5)
return 0;
size -= 4;
@@ -48,8 +48,8 @@ SizeT x86_Convert(Byte *data, SizeT size, UInt32 ip, UInt32 *state, int encoding
if (Test86MSByte(p[4]))
{
UInt32 v = ((UInt32)p[4] << 24) | ((UInt32)p[3] << 16) | ((UInt32)p[2] << 8) | ((UInt32)p[1]);
UInt32 cur = ip + (UInt32)pos;
uint32_t v = ((uint32_t)p[4] << 24) | ((uint32_t)p[3] << 16) | ((uint32_t)p[2] << 8) | ((uint32_t)p[1]);
uint32_t cur = ip + (uint32_t)pos;
pos += 5;
if (encoding)
v += cur;
@@ -60,7 +60,7 @@ SizeT x86_Convert(Byte *data, SizeT size, UInt32 ip, UInt32 *state, int encoding
unsigned sh = (mask & 6) << 2;
if (Test86MSByte((Byte)(v >> sh)))
{
v ^= (((UInt32)0x100 << sh) - 1);
v ^= (((uint32_t)0x100 << sh) - 1);
if (encoding)
v += cur;
else
+6 -6
View File
@@ -6,7 +6,7 @@
#include "CpuArch.h"
#include "Bra.h"
SizeT IA64_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
SizeT IA64_Convert(Byte *data, SizeT size, uint32_t ip, int encoding)
{
SizeT i;
if (size < 16)
@@ -15,7 +15,7 @@ SizeT IA64_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
i = 0;
do
{
unsigned m = ((UInt32)0x334B0000 >> (data[i] & 0x1E)) & 3;
unsigned m = ((uint32_t)0x334B0000 >> (data[i] & 0x1E)) & 3;
if (m)
{
m++;
@@ -23,7 +23,7 @@ SizeT IA64_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
{
Byte *p = data + (i + (size_t)m * 5 - 8);
if (((p[3] >> m) & 15) == 5
&& (((p[-1] | ((UInt32)p[0] << 8)) >> m) & 0x70) == 0)
&& (((p[-1] | ((uint32_t)p[0] << 8)) >> m) & 0x70) == 0)
{
unsigned raw = GetUi32(p);
unsigned v = raw >> m;
@@ -31,15 +31,15 @@ SizeT IA64_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
v <<= 4;
if (encoding)
v += ip + (UInt32)i;
v += ip + (uint32_t)i;
else
v -= ip + (UInt32)i;
v -= ip + (uint32_t)i;
v >>= 4;
v &= 0x1FFFFF;
v += 0x700000;
v &= 0x8FFFFF;
raw &= ~((UInt32)0x8FFFFF << m);
raw &= ~((uint32_t)0x8FFFFF << m);
raw |= (v << m);
SetUi32(p, raw);
}
+12 -12
View File
@@ -16,7 +16,7 @@
#endif
#if defined(USE_ASM) && !defined(MY_CPU_AMD64)
static UInt32 CheckFlag(UInt32 flag)
static uint32_t CheckFlag(uint32_t flag)
{
#ifdef _MSC_VER
__asm pushfd;
@@ -55,13 +55,13 @@ static UInt32 CheckFlag(UInt32 flag)
#define CHECK_CPUID_IS_SUPPORTED
#endif
void MyCPUID(UInt32 function, UInt32 *a, UInt32 *b, UInt32 *c, UInt32 *d)
void MyCPUID(uint32_t function, uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d)
{
#ifdef USE_ASM
#ifdef _MSC_VER
UInt32 a2, b2, c2, d2;
uint32_t a2, b2, c2, d2;
__asm xor EBX, EBX;
__asm xor ECX, ECX;
__asm xor EDX, EDX;
@@ -123,7 +123,7 @@ BoolInt x86cpuid_CheckAndRead(Cx86cpuid *p)
return True;
}
static const UInt32 kVendors[][3] =
static const uint32_t kVendors[][3] =
{
{ 0x756E6547, 0x49656E69, 0x6C65746E},
{ 0x68747541, 0x69746E65, 0x444D4163},
@@ -135,7 +135,7 @@ int x86cpuid_GetFirm(const Cx86cpuid *p)
unsigned i;
for (i = 0; i < sizeof(kVendors) / sizeof(kVendors[i]); i++)
{
const UInt32 *v = kVendors[i];
const uint32_t *v = kVendors[i];
if (v[0] == p->vendor[0] &&
v[1] == p->vendor[1] &&
v[2] == p->vendor[2])
@@ -144,11 +144,11 @@ int x86cpuid_GetFirm(const Cx86cpuid *p)
return -1;
}
BoolInt CPU_Is_InOrder()
BoolInt CPU_Is_InOrder(void)
{
Cx86cpuid p;
int firm;
UInt32 family, model;
uint32_t family, model;
if (!x86cpuid_CheckAndRead(&p))
return True;
@@ -175,7 +175,7 @@ BoolInt CPU_Is_InOrder()
#if !defined(MY_CPU_AMD64) && defined(_WIN32)
#include <windows.h>
static BoolInt CPU_Sys_Is_SSE_Supported()
static BoolInt CPU_Sys_Is_SSE_Supported(void)
{
OSVERSIONINFO vi;
vi.dwOSVersionInfoSize = sizeof(vi);
@@ -188,7 +188,7 @@ static BoolInt CPU_Sys_Is_SSE_Supported()
#define CHECK_SYS_SSE_SUPPORT
#endif
BoolInt CPU_Is_Aes_Supported()
BoolInt CPU_Is_Aes_Supported(void)
{
Cx86cpuid p;
CHECK_SYS_SSE_SUPPORT
@@ -197,19 +197,19 @@ BoolInt CPU_Is_Aes_Supported()
return (p.c >> 25) & 1;
}
BoolInt CPU_IsSupported_PageGB()
BoolInt CPU_IsSupported_PageGB(void)
{
Cx86cpuid cpuid;
if (!x86cpuid_CheckAndRead(&cpuid))
return False;
{
UInt32 d[4] = { 0 };
uint32_t d[4] = { 0 };
MyCPUID(0x80000000, &d[0], &d[1], &d[2], &d[3]);
if (d[0] < 0x80000001)
return False;
}
{
UInt32 d[4] = { 0 };
uint32_t d[4] = { 0 };
MyCPUID(0x80000001, &d[0], &d[1], &d[2], &d[3]);
return (d[3] >> 26) & 1;
}
+42 -42
View File
@@ -198,41 +198,41 @@ MY_CPU_LE_UNALIGN means that CPU is LITTLE ENDIAN and CPU supports unaligned mem
#ifdef MY_CPU_LE_UNALIGN
#define GetUi16(p) (*(const UInt16 *)(const void *)(p))
#define GetUi32(p) (*(const UInt32 *)(const void *)(p))
#define GetUi64(p) (*(const UInt64 *)(const void *)(p))
#define GetUi16(p) (*(const uint16_t *)(const void *)(p))
#define GetUi32(p) (*(const uint32_t *)(const void *)(p))
#define GetUi64(p) (*(const uint64_t *)(const void *)(p))
#define SetUi16(p, v) { *(UInt16 *)(p) = (v); }
#define SetUi32(p, v) { *(UInt32 *)(p) = (v); }
#define SetUi64(p, v) { *(UInt64 *)(p) = (v); }
#define SetUi16(p, v) { *(uint16_t *)(p) = (v); }
#define SetUi32(p, v) { *(uint32_t *)(p) = (v); }
#define SetUi64(p, v) { *(uint64_t *)(p) = (v); }
#else
#define GetUi16(p) ( (UInt16) ( \
#define GetUi16(p) ( (uint16_t) ( \
((const Byte *)(p))[0] | \
((UInt16)((const Byte *)(p))[1] << 8) ))
((uint16_t)((const Byte *)(p))[1] << 8) ))
#define GetUi32(p) ( \
((const Byte *)(p))[0] | \
((UInt32)((const Byte *)(p))[1] << 8) | \
((UInt32)((const Byte *)(p))[2] << 16) | \
((UInt32)((const Byte *)(p))[3] << 24))
((uint32_t)((const Byte *)(p))[1] << 8) | \
((uint32_t)((const Byte *)(p))[2] << 16) | \
((uint32_t)((const Byte *)(p))[3] << 24))
#define GetUi64(p) (GetUi32(p) | ((UInt64)GetUi32(((const Byte *)(p)) + 4) << 32))
#define GetUi64(p) (GetUi32(p) | ((uint64_t)GetUi32(((const Byte *)(p)) + 4) << 32))
#define SetUi16(p, v) { Byte *_ppp_ = (Byte *)(p); UInt32 _vvv_ = (v); \
#define SetUi16(p, v) { Byte *_ppp_ = (Byte *)(p); uint32_t _vvv_ = (v); \
_ppp_[0] = (Byte)_vvv_; \
_ppp_[1] = (Byte)(_vvv_ >> 8); }
#define SetUi32(p, v) { Byte *_ppp_ = (Byte *)(p); UInt32 _vvv_ = (v); \
#define SetUi32(p, v) { Byte *_ppp_ = (Byte *)(p); uint32_t _vvv_ = (v); \
_ppp_[0] = (Byte)_vvv_; \
_ppp_[1] = (Byte)(_vvv_ >> 8); \
_ppp_[2] = (Byte)(_vvv_ >> 16); \
_ppp_[3] = (Byte)(_vvv_ >> 24); }
#define SetUi64(p, v) { Byte *_ppp2_ = (Byte *)(p); UInt64 _vvv2_ = (v); \
SetUi32(_ppp2_ , (UInt32)_vvv2_); \
SetUi32(_ppp2_ + 4, (UInt32)(_vvv2_ >> 32)); }
#define SetUi64(p, v) { Byte *_ppp2_ = (Byte *)(p); uint64_t _vvv2_ = (v); \
SetUi32(_ppp2_ , (uint32_t)_vvv2_); \
SetUi32(_ppp2_ + 4, (uint32_t)(_vvv2_ >> 32)); }
#endif
@@ -252,33 +252,33 @@ MY_CPU_LE_UNALIGN means that CPU is LITTLE ENDIAN and CPU supports unaligned mem
#pragma intrinsic(_byteswap_ulong)
#pragma intrinsic(_byteswap_uint64)
/* #define GetBe16(p) _byteswap_ushort(*(const UInt16 *)(const Byte *)(p)) */
#define GetBe32(p) _byteswap_ulong(*(const UInt32 *)(const Byte *)(p))
#define GetBe64(p) _byteswap_uint64(*(const UInt64 *)(const Byte *)(p))
/* #define GetBe16(p) _byteswap_ushort(*(const uint16_t *)(const Byte *)(p)) */
#define GetBe32(p) _byteswap_ulong(*(const uint32_t *)(const Byte *)(p))
#define GetBe64(p) _byteswap_uint64(*(const uint64_t *)(const Byte *)(p))
#define SetBe32(p, v) (*(UInt32 *)(void *)(p)) = _byteswap_ulong(v)
#define SetBe32(p, v) (*(uint32_t *)(void *)(p)) = _byteswap_ulong(v)
#elif defined(MY_CPU_LE_UNALIGN) && ( \
(defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))) \
|| (defined(__clang__) && MY__has_builtin(__builtin_bswap16)) )
/* #define GetBe16(p) __builtin_bswap16(*(const UInt16 *)(const Byte *)(p)) */
#define GetBe32(p) __builtin_bswap32(*(const UInt32 *)(const Byte *)(p))
#define GetBe64(p) __builtin_bswap64(*(const UInt64 *)(const Byte *)(p))
/* #define GetBe16(p) __builtin_bswap16(*(const uint16_t *)(const Byte *)(p)) */
#define GetBe32(p) __builtin_bswap32(*(const uint32_t *)(const Byte *)(p))
#define GetBe64(p) __builtin_bswap64(*(const uint64_t *)(const Byte *)(p))
#define SetBe32(p, v) (*(UInt32 *)(void *)(p)) = __builtin_bswap32(v)
#define SetBe32(p, v) (*(uint32_t *)(void *)(p)) = __builtin_bswap32(v)
#else
#define GetBe32(p) ( \
((UInt32)((const Byte *)(p))[0] << 24) | \
((UInt32)((const Byte *)(p))[1] << 16) | \
((UInt32)((const Byte *)(p))[2] << 8) | \
((uint32_t)((const Byte *)(p))[0] << 24) | \
((uint32_t)((const Byte *)(p))[1] << 16) | \
((uint32_t)((const Byte *)(p))[2] << 8) | \
((const Byte *)(p))[3] )
#define GetBe64(p) (((UInt64)GetBe32(p) << 32) | GetBe32(((const Byte *)(p)) + 4))
#define GetBe64(p) (((uint64_t)GetBe32(p) << 32) | GetBe32(((const Byte *)(p)) + 4))
#define SetBe32(p, v) { Byte *_ppp_ = (Byte *)(p); UInt32 _vvv_ = (v); \
#define SetBe32(p, v) { Byte *_ppp_ = (Byte *)(p); uint32_t _vvv_ = (v); \
_ppp_[0] = (Byte)(_vvv_ >> 24); \
_ppp_[1] = (Byte)(_vvv_ >> 16); \
_ppp_[2] = (Byte)(_vvv_ >> 8); \
@@ -289,8 +289,8 @@ MY_CPU_LE_UNALIGN means that CPU is LITTLE ENDIAN and CPU supports unaligned mem
#ifndef GetBe16
#define GetBe16(p) ( (UInt16) ( \
((UInt16)((const Byte *)(p))[0] << 8) | \
#define GetBe16(p) ( (uint16_t) ( \
((uint16_t)((const Byte *)(p))[0] << 8) | \
((const Byte *)(p))[1] ))
#endif
@@ -301,12 +301,12 @@ MY_CPU_LE_UNALIGN means that CPU is LITTLE ENDIAN and CPU supports unaligned mem
typedef struct
{
UInt32 maxFunc;
UInt32 vendor[3];
UInt32 ver;
UInt32 b;
UInt32 c;
UInt32 d;
uint32_t maxFunc;
uint32_t vendor[3];
uint32_t ver;
uint32_t b;
uint32_t c;
uint32_t d;
} Cx86cpuid;
enum
@@ -316,7 +316,7 @@ enum
CPU_FIRM_VIA
};
void MyCPUID(UInt32 function, UInt32 *a, UInt32 *b, UInt32 *c, UInt32 *d);
void MyCPUID(uint32_t function, uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d);
BoolInt x86cpuid_CheckAndRead(Cx86cpuid *p);
int x86cpuid_GetFirm(const Cx86cpuid *p);
@@ -325,9 +325,9 @@ int x86cpuid_GetFirm(const Cx86cpuid *p);
#define x86cpuid_GetModel(ver) (((ver >> 12) & 0xF0) | ((ver >> 4) & 0xF))
#define x86cpuid_GetStepping(ver) (ver & 0xF)
BoolInt CPU_Is_InOrder();
BoolInt CPU_Is_Aes_Supported();
BoolInt CPU_IsSupported_PageGB();
BoolInt CPU_Is_InOrder(void);
BoolInt CPU_Is_Aes_Supported(void);
BoolInt CPU_IsSupported_PageGB(void);
#endif
+93 -93
View File
@@ -9,10 +9,10 @@
#include "LzHash.h"
#define kEmptyHashValue 0
#define kMaxValForNormalize ((UInt32)0xFFFFFFFF)
#define kMaxValForNormalize ((uint32_t)0xFFFFFFFF)
#define kNormalizeStepMin (1 << 10) /* it must be power of 2 */
#define kNormalizeMask (~(UInt32)(kNormalizeStepMin - 1))
#define kMaxHistorySize ((UInt32)7 << 29)
#define kNormalizeMask (~(uint32_t)(kNormalizeStepMin - 1))
#define kMaxHistorySize ((uint32_t)7 << 29)
#define kStartMaxLen 3
@@ -27,9 +27,9 @@ static void LzInWindow_Free(CMatchFinder *p, ISzAllocPtr alloc)
/* keepSizeBefore + keepSizeAfter + keepSizeReserv must be < 4G) */
static int LzInWindow_Create(CMatchFinder *p, UInt32 keepSizeReserv, ISzAllocPtr alloc)
static int LzInWindow_Create(CMatchFinder *p, uint32_t keepSizeReserv, ISzAllocPtr alloc)
{
UInt32 blockSize = p->keepSizeBefore + p->keepSizeAfter + keepSizeReserv;
uint32_t blockSize = p->keepSizeBefore + p->keepSizeAfter + keepSizeReserv;
if (p->directInput)
{
p->blockSize = blockSize;
@@ -46,9 +46,9 @@ static int LzInWindow_Create(CMatchFinder *p, UInt32 keepSizeReserv, ISzAllocPtr
Byte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p) { return p->buffer; }
UInt32 MatchFinder_GetNumAvailableBytes(CMatchFinder *p) { return p->streamPos - p->pos; }
uint32_t MatchFinder_GetNumAvailableBytes(CMatchFinder *p) { return p->streamPos - p->pos; }
void MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue)
void MatchFinder_ReduceOffsets(CMatchFinder *p, uint32_t subValue)
{
p->posLimit -= subValue;
p->pos -= subValue;
@@ -64,9 +64,9 @@ static void MatchFinder_ReadBlock(CMatchFinder *p)
if (p->directInput)
{
UInt32 curSize = 0xFFFFFFFF - (p->streamPos - p->pos);
uint32_t curSize = 0xFFFFFFFF - (p->streamPos - p->pos);
if (curSize > p->directInputRem)
curSize = (UInt32)p->directInputRem;
curSize = (uint32_t)p->directInputRem;
p->directInputRem -= curSize;
p->streamPos += curSize;
if (p->directInputRem == 0)
@@ -89,7 +89,7 @@ static void MatchFinder_ReadBlock(CMatchFinder *p)
p->streamEndWasReached = 1;
return;
}
p->streamPos += (UInt32)size;
p->streamPos += (uint32_t)size;
if (p->streamPos - p->pos > p->keepSizeAfter)
return;
}
@@ -142,15 +142,15 @@ void MatchFinder_Construct(CMatchFinder *p)
p->bufferBase = NULL;
p->directInput = 0;
p->hash = NULL;
p->expectedDataSize = (UInt64)(Int64)-1;
p->expectedDataSize = (uint64_t)(int64_t)-1;
MatchFinder_SetDefaultSettings(p);
for (i = 0; i < 256; i++)
{
UInt32 r = (UInt32)i;
uint32_t r = (uint32_t)i;
unsigned j;
for (j = 0; j < 8; j++)
r = (r >> 1) ^ (kCrcPoly & ((UInt32)0 - (r & 1)));
r = (r >> 1) ^ (kCrcPoly & ((uint32_t)0 - (r & 1)));
p->crc[i] = r;
}
}
@@ -175,11 +175,11 @@ static CLzRef* AllocRefs(size_t num, ISzAllocPtr alloc)
return (CLzRef *)ISzAlloc_Alloc(alloc, sizeInBytes);
}
int MatchFinder_Create(CMatchFinder *p, UInt32 historySize,
UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter,
int MatchFinder_Create(CMatchFinder *p, uint32_t historySize,
uint32_t keepAddBufferBefore, uint32_t matchMaxLen, uint32_t keepAddBufferAfter,
ISzAllocPtr alloc)
{
UInt32 sizeReserv;
uint32_t sizeReserv;
if (historySize > kMaxHistorySize)
{
@@ -188,8 +188,8 @@ int MatchFinder_Create(CMatchFinder *p, UInt32 historySize,
}
sizeReserv = historySize >> 1;
if (historySize >= ((UInt32)3 << 30)) sizeReserv = historySize >> 3;
else if (historySize >= ((UInt32)2 << 30)) sizeReserv = historySize >> 2;
if (historySize >= ((uint32_t)3 << 30)) sizeReserv = historySize >> 3;
else if (historySize >= ((uint32_t)2 << 30)) sizeReserv = historySize >> 2;
sizeReserv += (keepAddBufferBefore + matchMaxLen + keepAddBufferAfter) / 2 + (1 << 19);
@@ -200,8 +200,8 @@ int MatchFinder_Create(CMatchFinder *p, UInt32 historySize,
if (LzInWindow_Create(p, sizeReserv, alloc))
{
UInt32 newCyclicBufferSize = historySize + 1;
UInt32 hs;
uint32_t newCyclicBufferSize = historySize + 1;
uint32_t hs;
p->matchMaxLen = matchMaxLen;
{
p->fixedHashSize = 0;
@@ -211,7 +211,7 @@ int MatchFinder_Create(CMatchFinder *p, UInt32 historySize,
{
hs = historySize;
if (hs > p->expectedDataSize)
hs = (UInt32)p->expectedDataSize;
hs = (uint32_t)p->expectedDataSize;
if (hs != 0)
hs--;
hs |= (hs >> 1);
@@ -270,8 +270,8 @@ int MatchFinder_Create(CMatchFinder *p, UInt32 historySize,
static void MatchFinder_SetLimits(CMatchFinder *p)
{
UInt32 limit = kMaxValForNormalize - p->pos;
UInt32 limit2 = p->cyclicBufferSize - p->cyclicBufferPos;
uint32_t limit = kMaxValForNormalize - p->pos;
uint32_t limit2 = p->cyclicBufferSize - p->cyclicBufferPos;
if (limit2 < limit)
limit = limit2;
@@ -289,7 +289,7 @@ static void MatchFinder_SetLimits(CMatchFinder *p)
limit = limit2;
{
UInt32 lenLimit = p->streamPos - p->pos;
uint32_t lenLimit = p->streamPos - p->pos;
if (lenLimit > p->matchMaxLen)
lenLimit = p->matchMaxLen;
p->lenLimit = lenLimit;
@@ -342,17 +342,17 @@ void MatchFinder_Init(CMatchFinder *p)
}
static UInt32 MatchFinder_GetSubValue(CMatchFinder *p)
static uint32_t MatchFinder_GetSubValue(CMatchFinder *p)
{
return (p->pos - p->historySize - 1) & kNormalizeMask;
}
void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, size_t numItems)
void MatchFinder_Normalize3(uint32_t subValue, CLzRef *items, size_t numItems)
{
size_t i;
for (i = 0; i < numItems; i++)
{
UInt32 value = items[i];
uint32_t value = items[i];
if (value <= subValue)
value = kEmptyHashValue;
else
@@ -363,7 +363,7 @@ void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, size_t numItems)
static void MatchFinder_Normalize(CMatchFinder *p)
{
UInt32 subValue = MatchFinder_GetSubValue(p);
uint32_t subValue = MatchFinder_GetSubValue(p);
MatchFinder_Normalize3(subValue, p->hash, p->numRefs);
MatchFinder_ReduceOffsets(p, subValue);
}
@@ -386,15 +386,15 @@ static void MatchFinder_CheckLimits(CMatchFinder *p)
(lenLimit > maxLen)
*/
MY_FORCE_INLINE
static UInt32 * Hc_GetMatchesSpec(unsigned lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son,
UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue,
UInt32 *distances, unsigned maxLen)
static uint32_t * Hc_GetMatchesSpec(unsigned lenLimit, uint32_t curMatch, uint32_t pos, const Byte *cur, CLzRef *son,
uint32_t _cyclicBufferPos, uint32_t _cyclicBufferSize, uint32_t cutValue,
uint32_t *distances, unsigned maxLen)
{
/*
son[_cyclicBufferPos] = curMatch;
for (;;)
{
UInt32 delta = pos - curMatch;
uint32_t delta = pos - curMatch;
if (cutValue-- == 0 || delta >= _cyclicBufferSize)
return distances;
{
@@ -402,7 +402,7 @@ static UInt32 * Hc_GetMatchesSpec(unsigned lenLimit, UInt32 curMatch, UInt32 pos
curMatch = son[_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)];
if (pb[maxLen] == cur[maxLen] && *pb == *cur)
{
UInt32 len = 0;
uint32_t len = 0;
while (++len != lenLimit)
if (pb[len] != cur[len])
break;
@@ -423,7 +423,7 @@ static UInt32 * Hc_GetMatchesSpec(unsigned lenLimit, UInt32 curMatch, UInt32 pos
son[_cyclicBufferPos] = curMatch;
do
{
UInt32 delta = pos - curMatch;
uint32_t delta = pos - curMatch;
if (delta >= _cyclicBufferSize)
break;
{
@@ -437,7 +437,7 @@ static UInt32 * Hc_GetMatchesSpec(unsigned lenLimit, UInt32 curMatch, UInt32 pos
{
if (++c == lim)
{
distances[0] = (UInt32)(lim - cur);
distances[0] = (uint32_t)(lim - cur);
distances[1] = delta - 1;
return distances + 2;
}
@@ -447,7 +447,7 @@ static UInt32 * Hc_GetMatchesSpec(unsigned lenLimit, UInt32 curMatch, UInt32 pos
if (maxLen < len)
{
maxLen = len;
distances[0] = (UInt32)len;
distances[0] = (uint32_t)len;
distances[1] = delta - 1;
distances += 2;
}
@@ -462,16 +462,16 @@ static UInt32 * Hc_GetMatchesSpec(unsigned lenLimit, UInt32 curMatch, UInt32 pos
MY_FORCE_INLINE
UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son,
UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue,
UInt32 *distances, UInt32 maxLen)
uint32_t * GetMatchesSpec1(uint32_t lenLimit, uint32_t curMatch, uint32_t pos, const Byte *cur, CLzRef *son,
uint32_t _cyclicBufferPos, uint32_t _cyclicBufferSize, uint32_t cutValue,
uint32_t *distances, uint32_t maxLen)
{
CLzRef *ptr0 = son + ((size_t)_cyclicBufferPos << 1) + 1;
CLzRef *ptr1 = son + ((size_t)_cyclicBufferPos << 1);
unsigned len0 = 0, len1 = 0;
for (;;)
{
UInt32 delta = pos - curMatch;
uint32_t delta = pos - curMatch;
if (cutValue-- == 0 || delta >= _cyclicBufferSize)
{
*ptr0 = *ptr1 = kEmptyHashValue;
@@ -481,7 +481,7 @@ UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byt
CLzRef *pair = son + ((size_t)(_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)) << 1);
const Byte *pb = cur - delta;
unsigned len = (len0 < len1 ? len0 : len1);
UInt32 pair0 = pair[0];
uint32_t pair0 = pair[0];
if (pb[len] == cur[len])
{
if (++len != lenLimit && pb[len] == cur[len])
@@ -490,8 +490,8 @@ UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byt
break;
if (maxLen < len)
{
maxLen = (UInt32)len;
*distances++ = (UInt32)len;
maxLen = (uint32_t)len;
*distances++ = (uint32_t)len;
*distances++ = delta - 1;
if (len == lenLimit)
{
@@ -519,15 +519,15 @@ UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byt
}
}
static void SkipMatchesSpec(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son,
UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue)
static void SkipMatchesSpec(uint32_t lenLimit, uint32_t curMatch, uint32_t pos, const Byte *cur, CLzRef *son,
uint32_t _cyclicBufferPos, uint32_t _cyclicBufferSize, uint32_t cutValue)
{
CLzRef *ptr0 = son + ((size_t)_cyclicBufferPos << 1) + 1;
CLzRef *ptr1 = son + ((size_t)_cyclicBufferPos << 1);
unsigned len0 = 0, len1 = 0;
for (;;)
{
UInt32 delta = pos - curMatch;
uint32_t delta = pos - curMatch;
if (cutValue-- == 0 || delta >= _cyclicBufferSize)
{
*ptr0 = *ptr1 = kEmptyHashValue;
@@ -574,12 +574,12 @@ static void SkipMatchesSpec(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const
p->buffer++; \
if (++p->pos == p->posLimit) MatchFinder_CheckLimits(p);
#define MOVE_POS_RET MOVE_POS return (UInt32)offset;
#define MOVE_POS_RET MOVE_POS return (uint32_t)offset;
static void MatchFinder_MovePos(CMatchFinder *p) { MOVE_POS; }
#define GET_MATCHES_HEADER2(minLen, ret_op) \
unsigned lenLimit; UInt32 hv; const Byte *cur; UInt32 curMatch; \
unsigned lenLimit; uint32_t hv; const Byte *cur; uint32_t curMatch; \
lenLimit = (unsigned)p->lenLimit; { if (lenLimit < minLen) { MatchFinder_MovePos(p); ret_op; }} \
cur = p->buffer;
@@ -589,11 +589,11 @@ static void MatchFinder_MovePos(CMatchFinder *p) { MOVE_POS; }
#define MF_PARAMS(p) p->pos, p->buffer, p->son, p->cyclicBufferPos, p->cyclicBufferSize, p->cutValue
#define GET_MATCHES_FOOTER(offset, maxLen) \
offset = (unsigned)(GetMatchesSpec1((UInt32)lenLimit, curMatch, MF_PARAMS(p), \
distances + offset, (UInt32)maxLen) - distances); MOVE_POS_RET;
offset = (unsigned)(GetMatchesSpec1((uint32_t)lenLimit, curMatch, MF_PARAMS(p), \
distances + offset, (uint32_t)maxLen) - distances); MOVE_POS_RET;
#define SKIP_FOOTER \
SkipMatchesSpec((UInt32)lenLimit, curMatch, MF_PARAMS(p)); MOVE_POS;
SkipMatchesSpec((uint32_t)lenLimit, curMatch, MF_PARAMS(p)); MOVE_POS;
#define UPDATE_maxLen { \
ptrdiff_t diff = (ptrdiff_t)0 - d2; \
@@ -602,7 +602,7 @@ static void MatchFinder_MovePos(CMatchFinder *p) { MOVE_POS; }
for (; c != lim; c++) if (*(c + diff) != *c) break; \
maxLen = (unsigned)(c - cur); }
static UInt32 Bt2_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
static uint32_t Bt2_MatchFinder_GetMatches(CMatchFinder *p, uint32_t *distances)
{
unsigned offset;
GET_MATCHES_HEADER(2)
@@ -613,7 +613,7 @@ static UInt32 Bt2_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
GET_MATCHES_FOOTER(offset, 1)
}
UInt32 Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
uint32_t Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, uint32_t *distances)
{
unsigned offset;
GET_MATCHES_HEADER(3)
@@ -624,11 +624,11 @@ UInt32 Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
GET_MATCHES_FOOTER(offset, 2)
}
static UInt32 Bt3_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
static uint32_t Bt3_MatchFinder_GetMatches(CMatchFinder *p, uint32_t *distances)
{
UInt32 h2, d2, pos;
uint32_t h2, d2, pos;
unsigned maxLen, offset;
UInt32 *hash;
uint32_t *hash;
GET_MATCHES_HEADER(3)
HASH3_CALC;
@@ -649,12 +649,12 @@ static UInt32 Bt3_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
if (d2 < p->cyclicBufferSize && *(cur - d2) == *cur)
{
UPDATE_maxLen
distances[0] = (UInt32)maxLen;
distances[0] = (uint32_t)maxLen;
distances[1] = d2 - 1;
offset = 2;
if (maxLen == lenLimit)
{
SkipMatchesSpec((UInt32)lenLimit, curMatch, MF_PARAMS(p));
SkipMatchesSpec((uint32_t)lenLimit, curMatch, MF_PARAMS(p));
MOVE_POS_RET;
}
}
@@ -662,11 +662,11 @@ static UInt32 Bt3_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
GET_MATCHES_FOOTER(offset, maxLen)
}
static UInt32 Bt4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
static uint32_t Bt4_MatchFinder_GetMatches(CMatchFinder *p, uint32_t *distances)
{
UInt32 h2, h3, d2, d3, pos;
uint32_t h2, h3, d2, d3, pos;
unsigned maxLen, offset;
UInt32 *hash;
uint32_t *hash;
GET_MATCHES_HEADER(4)
HASH4_CALC;
@@ -705,10 +705,10 @@ static UInt32 Bt4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
if (offset != 0)
{
UPDATE_maxLen
distances[(size_t)offset - 2] = (UInt32)maxLen;
distances[(size_t)offset - 2] = (uint32_t)maxLen;
if (maxLen == lenLimit)
{
SkipMatchesSpec((UInt32)lenLimit, curMatch, MF_PARAMS(p));
SkipMatchesSpec((uint32_t)lenLimit, curMatch, MF_PARAMS(p));
MOVE_POS_RET;
}
}
@@ -720,10 +720,10 @@ static UInt32 Bt4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
}
/*
static UInt32 Bt5_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
static uint32_t Bt5_MatchFinder_GetMatches(CMatchFinder *p, uint32_t *distances)
{
UInt32 h2, h3, h4, d2, d3, d4, maxLen, offset, pos;
UInt32 *hash;
uint32_t h2, h3, h4, d2, d3, d4, maxLen, offset, pos;
uint32_t *hash;
GET_MATCHES_HEADER(5)
HASH5_CALC;
@@ -796,11 +796,11 @@ static UInt32 Bt5_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
}
*/
static UInt32 Hc4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
static uint32_t Hc4_MatchFinder_GetMatches(CMatchFinder *p, uint32_t *distances)
{
UInt32 h2, h3, d2, d3, pos;
uint32_t h2, h3, d2, d3, pos;
unsigned maxLen, offset;
UInt32 *hash;
uint32_t *hash;
GET_MATCHES_HEADER(4)
HASH4_CALC;
@@ -838,7 +838,7 @@ static UInt32 Hc4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
if (offset != 0)
{
UPDATE_maxLen
distances[(size_t)offset - 2] = (UInt32)maxLen;
distances[(size_t)offset - 2] = (uint32_t)maxLen;
if (maxLen == lenLimit)
{
p->son[p->cyclicBufferPos] = curMatch;
@@ -855,10 +855,10 @@ static UInt32 Hc4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
}
/*
static UInt32 Hc5_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
static uint32_t Hc5_MatchFinder_GetMatches(CMatchFinder *p, uint32_t *distances)
{
UInt32 h2, h3, h4, d2, d3, d4, maxLen, offset, pos
UInt32 *hash;
uint32_t h2, h3, h4, d2, d3, d4, maxLen, offset, pos
uint32_t *hash;
GET_MATCHES_HEADER(5)
HASH5_CALC;
@@ -927,13 +927,13 @@ static UInt32 Hc5_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
if (maxLen < 4)
maxLen = 4;
offset = (UInt32)(Hc_GetMatchesSpec(lenLimit, curMatch, MF_PARAMS(p),
offset = (uint32_t)(Hc_GetMatchesSpec(lenLimit, curMatch, MF_PARAMS(p),
distances + offset, maxLen) - (distances));
MOVE_POS_RET
}
*/
UInt32 Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
uint32_t Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, uint32_t *distances)
{
unsigned offset;
GET_MATCHES_HEADER(3)
@@ -945,7 +945,7 @@ UInt32 Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
MOVE_POS_RET
}
static void Bt2_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
static void Bt2_MatchFinder_Skip(CMatchFinder *p, uint32_t num)
{
do
{
@@ -958,7 +958,7 @@ static void Bt2_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
while (--num != 0);
}
void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, uint32_t num)
{
do
{
@@ -971,12 +971,12 @@ void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
while (--num != 0);
}
static void Bt3_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
static void Bt3_MatchFinder_Skip(CMatchFinder *p, uint32_t num)
{
do
{
UInt32 h2;
UInt32 *hash;
uint32_t h2;
uint32_t *hash;
SKIP_HEADER(3)
HASH3_CALC;
hash = p->hash;
@@ -988,12 +988,12 @@ static void Bt3_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
while (--num != 0);
}
static void Bt4_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
static void Bt4_MatchFinder_Skip(CMatchFinder *p, uint32_t num)
{
do
{
UInt32 h2, h3;
UInt32 *hash;
uint32_t h2, h3;
uint32_t *hash;
SKIP_HEADER(4)
HASH4_CALC;
hash = p->hash;
@@ -1007,12 +1007,12 @@ static void Bt4_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
}
/*
static void Bt5_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
static void Bt5_MatchFinder_Skip(CMatchFinder *p, uint32_t num)
{
do
{
UInt32 h2, h3, h4;
UInt32 *hash;
uint32_t h2, h3, h4;
uint32_t *hash;
SKIP_HEADER(5)
HASH5_CALC;
hash = p->hash;
@@ -1027,12 +1027,12 @@ static void Bt5_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
}
*/
static void Hc4_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
static void Hc4_MatchFinder_Skip(CMatchFinder *p, uint32_t num)
{
do
{
UInt32 h2, h3;
UInt32 *hash;
uint32_t h2, h3;
uint32_t *hash;
SKIP_HEADER(4)
HASH4_CALC;
hash = p->hash;
@@ -1047,12 +1047,12 @@ static void Hc4_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
}
/*
static void Hc5_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
static void Hc5_MatchFinder_Skip(CMatchFinder *p, uint32_t num)
{
do
{
UInt32 h2, h3, h4;
UInt32 *hash;
uint32_t h2, h3, h4;
uint32_t *hash;
SKIP_HEADER(5)
HASH5_CALC;
hash = p->hash;
@@ -1068,7 +1068,7 @@ static void Hc5_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
}
*/
void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, uint32_t num)
{
do
{
+33 -33
View File
@@ -8,47 +8,47 @@
EXTERN_C_BEGIN
typedef UInt32 CLzRef;
typedef uint32_t CLzRef;
typedef struct _CMatchFinder
{
Byte *buffer;
UInt32 pos;
UInt32 posLimit;
UInt32 streamPos;
UInt32 lenLimit;
uint32_t pos;
uint32_t posLimit;
uint32_t streamPos;
uint32_t lenLimit;
UInt32 cyclicBufferPos;
UInt32 cyclicBufferSize; /* it must be = (historySize + 1) */
uint32_t cyclicBufferPos;
uint32_t cyclicBufferSize; /* it must be = (historySize + 1) */
Byte streamEndWasReached;
Byte btMode;
Byte bigHash;
Byte directInput;
UInt32 matchMaxLen;
uint32_t matchMaxLen;
CLzRef *hash;
CLzRef *son;
UInt32 hashMask;
UInt32 cutValue;
uint32_t hashMask;
uint32_t cutValue;
Byte *bufferBase;
ISeqInStream *stream;
UInt32 blockSize;
UInt32 keepSizeBefore;
UInt32 keepSizeAfter;
uint32_t blockSize;
uint32_t keepSizeBefore;
uint32_t keepSizeAfter;
UInt32 numHashBytes;
uint32_t numHashBytes;
size_t directInputRem;
UInt32 historySize;
UInt32 fixedHashSize;
UInt32 hashSizeSum;
uint32_t historySize;
uint32_t fixedHashSize;
uint32_t hashSizeSum;
SRes result;
UInt32 crc[256];
uint32_t crc[256];
size_t numRefs;
UInt64 expectedDataSize;
uint64_t expectedDataSize;
} CMatchFinder;
#define Inline_MatchFinder_GetPointerToCurrentPos(p) ((p)->buffer)
@@ -71,16 +71,16 @@ void MatchFinder_Construct(CMatchFinder *p);
historySize <= 3 GB
keepAddBufferBefore + matchMaxLen + keepAddBufferAfter < 511MB
*/
int MatchFinder_Create(CMatchFinder *p, UInt32 historySize,
UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter,
int MatchFinder_Create(CMatchFinder *p, uint32_t historySize,
uint32_t keepAddBufferBefore, uint32_t matchMaxLen, uint32_t keepAddBufferAfter,
ISzAllocPtr alloc);
void MatchFinder_Free(CMatchFinder *p, ISzAllocPtr alloc);
void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, size_t numItems);
void MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue);
void MatchFinder_Normalize3(uint32_t subValue, CLzRef *items, size_t numItems);
void MatchFinder_ReduceOffsets(CMatchFinder *p, uint32_t subValue);
UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *buffer, CLzRef *son,
UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 _cutValue,
UInt32 *distances, UInt32 maxLen);
uint32_t * GetMatchesSpec1(uint32_t lenLimit, uint32_t curMatch, uint32_t pos, const Byte *buffer, CLzRef *son,
uint32_t _cyclicBufferPos, uint32_t _cyclicBufferSize, uint32_t _cutValue,
uint32_t *distances, uint32_t maxLen);
/*
Conditions:
@@ -89,10 +89,10 @@ Conditions:
*/
typedef void (*Mf_Init_Func)(void *object);
typedef UInt32 (*Mf_GetNumAvailableBytes_Func)(void *object);
typedef uint32_t (*Mf_GetNumAvailableBytes_Func)(void *object);
typedef const Byte * (*Mf_GetPointerToCurrentPos_Func)(void *object);
typedef UInt32 (*Mf_GetMatches_Func)(void *object, UInt32 *distances);
typedef void (*Mf_Skip_Func)(void *object, UInt32);
typedef uint32_t (*Mf_GetMatches_Func)(void *object, uint32_t *distances);
typedef void (*Mf_Skip_Func)(void *object, uint32_t);
typedef struct _IMatchFinder
{
@@ -110,11 +110,11 @@ void MatchFinder_Init_HighHash(CMatchFinder *p);
void MatchFinder_Init_3(CMatchFinder *p, int readData);
void MatchFinder_Init(CMatchFinder *p);
UInt32 Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances);
UInt32 Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances);
uint32_t Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, uint32_t *distances);
uint32_t Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, uint32_t *distances);
void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num);
void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num);
void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, uint32_t num);
void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, uint32_t num);
EXTERN_C_END
+13 -13
View File
@@ -12,45 +12,45 @@
#define kFix4HashSize (kHash2Size + kHash3Size)
#define kFix5HashSize (kHash2Size + kHash3Size + kHash4Size)
#define HASH2_CALC hv = cur[0] | ((UInt32)cur[1] << 8);
#define HASH2_CALC hv = cur[0] | ((uint32_t)cur[1] << 8);
#define HASH3_CALC { \
UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
uint32_t temp = p->crc[cur[0]] ^ cur[1]; \
h2 = temp & (kHash2Size - 1); \
hv = (temp ^ ((UInt32)cur[2] << 8)) & p->hashMask; }
hv = (temp ^ ((uint32_t)cur[2] << 8)) & p->hashMask; }
#define HASH4_CALC { \
UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
uint32_t temp = p->crc[cur[0]] ^ cur[1]; \
h2 = temp & (kHash2Size - 1); \
temp ^= ((UInt32)cur[2] << 8); \
temp ^= ((uint32_t)cur[2] << 8); \
h3 = temp & (kHash3Size - 1); \
hv = (temp ^ (p->crc[cur[3]] << 5)) & p->hashMask; }
#define HASH5_CALC { \
UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
uint32_t temp = p->crc[cur[0]] ^ cur[1]; \
h2 = temp & (kHash2Size - 1); \
temp ^= ((UInt32)cur[2] << 8); \
temp ^= ((uint32_t)cur[2] << 8); \
h3 = temp & (kHash3Size - 1); \
temp ^= (p->crc[cur[3]] << 5); \
h4 = temp & (kHash4Size - 1); \
hv = (temp ^ (p->crc[cur[4]] << 3)) & p->hashMask; }
/* #define HASH_ZIP_CALC hv = ((cur[0] | ((UInt32)cur[1] << 8)) ^ p->crc[cur[2]]) & 0xFFFF; */
#define HASH_ZIP_CALC hv = ((cur[2] | ((UInt32)cur[0] << 8)) ^ p->crc[cur[1]]) & 0xFFFF;
/* #define HASH_ZIP_CALC hv = ((cur[0] | ((uint32_t)cur[1] << 8)) ^ p->crc[cur[2]]) & 0xFFFF; */
#define HASH_ZIP_CALC hv = ((cur[2] | ((uint32_t)cur[0] << 8)) ^ p->crc[cur[1]]) & 0xFFFF;
#define MT_HASH2_CALC \
h2 = (p->crc[cur[0]] ^ cur[1]) & (kHash2Size - 1);
#define MT_HASH3_CALC { \
UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
uint32_t temp = p->crc[cur[0]] ^ cur[1]; \
h2 = temp & (kHash2Size - 1); \
h3 = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); }
h3 = (temp ^ ((uint32_t)cur[2] << 8)) & (kHash3Size - 1); }
#define MT_HASH4_CALC { \
UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
uint32_t temp = p->crc[cur[0]] ^ cur[1]; \
h2 = temp & (kHash2Size - 1); \
temp ^= ((UInt32)cur[2] << 8); \
temp ^= ((uint32_t)cur[2] << 8); \
h3 = temp & (kHash3Size - 1); \
h4 = (temp ^ (p->crc[cur[3]] << 5)) & (kHash4Size - 1); }
+14 -14
View File
@@ -32,7 +32,7 @@
#define LZMA2_IS_UNCOMPRESSED_STATE(p) (((p)->control & (1 << 7)) == 0)
#define LZMA2_LCLP_MAX 4
#define LZMA2_DIC_SIZE_FROM_PROP(p) (((UInt32)2 | ((p) & 1)) << ((p) / 2 + 11))
#define LZMA2_DIC_SIZE_FROM_PROP(p) (((uint32_t)2 | ((p) & 1)) << ((p) / 2 + 11))
#ifdef SHOW_DEBUG_INFO
#define PRF(x) x
@@ -56,7 +56,7 @@ typedef enum
static SRes Lzma2Dec_GetOldProps(Byte prop, Byte *props)
{
UInt32 dicSize;
uint32_t dicSize;
if (prop > 40)
return SZ_ERROR_UNSUPPORTED;
dicSize = (prop == 40) ? 0xFFFFFFFF : LZMA2_DIC_SIZE_FROM_PROP(prop);
@@ -116,26 +116,26 @@ static ELzma2State Lzma2Dec_UpdateState(CLzma2Dec *p, Byte b)
if (b < p->needInitLevel)
return LZMA2_STATE_ERROR;
p->needInitLevel = 0;
p->unpackSize = (UInt32)(b & 0x1F) << 16;
p->unpackSize = (uint32_t)(b & 0x1F) << 16;
}
return LZMA2_STATE_UNPACK0;
case LZMA2_STATE_UNPACK0:
p->unpackSize |= (UInt32)b << 8;
p->unpackSize |= (uint32_t)b << 8;
return LZMA2_STATE_UNPACK1;
case LZMA2_STATE_UNPACK1:
p->unpackSize |= (UInt32)b;
p->unpackSize |= (uint32_t)b;
p->unpackSize++;
PRF(printf(" %7u", (unsigned)p->unpackSize));
return LZMA2_IS_UNCOMPRESSED_STATE(p) ? LZMA2_STATE_DATA : LZMA2_STATE_PACK0;
case LZMA2_STATE_PACK0:
p->packSize = (UInt32)b << 8;
p->packSize = (uint32_t)b << 8;
return LZMA2_STATE_PACK1;
case LZMA2_STATE_PACK1:
p->packSize |= (UInt32)b;
p->packSize |= (uint32_t)b;
p->packSize++;
/* if (p->packSize < 5) return LZMA2_STATE_ERROR; */
PRF(printf(" %5u", (unsigned)p->packSize));
@@ -166,7 +166,7 @@ static void LzmaDec_UpdateWithUncompressed(CLzmaDec *p, const Byte *src, SizeT s
p->dicPos += size;
if (p->checkDicSize == 0 && p->prop.dicSize - p->processedPos <= size)
p->checkDicSize = p->prop.dicSize;
p->processedPos += (UInt32)size;
p->processedPos += (uint32_t)size;
}
void LzmaDec_InitDicAndState(CLzmaDec *p, BoolInt initDic, BoolInt initState);
@@ -245,7 +245,7 @@ SRes Lzma2Dec_DecodeToDic(CLzma2Dec *p, SizeT dicLimit,
src += inCur;
*srcLen += inCur;
p->unpackSize -= (UInt32)inCur;
p->unpackSize -= (uint32_t)inCur;
p->state = (p->unpackSize == 0) ? LZMA2_STATE_CONTROL : LZMA2_STATE_DATA_CONT;
}
else
@@ -267,9 +267,9 @@ SRes Lzma2Dec_DecodeToDic(CLzma2Dec *p, SizeT dicLimit,
src += inCur;
*srcLen += inCur;
p->packSize -= (UInt32)inCur;
p->packSize -= (uint32_t)inCur;
outCur = p->decoder.dicPos - dicPos;
p->unpackSize -= (UInt32)outCur;
p->unpackSize -= (uint32_t)outCur;
if (res != 0)
break;
@@ -371,7 +371,7 @@ ELzma2ParseStatus Lzma2Dec_Parse(CLzma2Dec *p,
src += inCur;
*srcLen += inCur;
outSize -= inCur;
p->unpackSize -= (UInt32)inCur;
p->unpackSize -= (uint32_t)inCur;
p->state = (p->unpackSize == 0) ? LZMA2_STATE_CONTROL : LZMA2_STATE_DATA_CONT;
}
else
@@ -400,7 +400,7 @@ ELzma2ParseStatus Lzma2Dec_Parse(CLzma2Dec *p,
src += inCur;
*srcLen += inCur;
p->packSize -= (UInt32)inCur;
p->packSize -= (uint32_t)inCur;
if (p->packSize == 0)
{
@@ -408,7 +408,7 @@ ELzma2ParseStatus Lzma2Dec_Parse(CLzma2Dec *p,
if (rem > p->unpackSize)
rem = p->unpackSize;
p->decoder.dicPos += rem;
p->unpackSize -= (UInt32)rem;
p->unpackSize -= (uint32_t)rem;
outSize -= rem;
if (p->unpackSize == 0)
p->state = LZMA2_STATE_CONTROL;
+2 -2
View File
@@ -17,8 +17,8 @@ typedef struct
Byte needInitLevel;
Byte isExtraMode;
Byte _pad_;
UInt32 packSize;
UInt32 unpackSize;
uint32_t packSize;
uint32_t unpackSize;
CLzmaDec decoder;
} CLzma2Dec;
+38 -38
View File
@@ -9,7 +9,7 @@
#include "LzmaDec.h"
#define kNumTopBits 24
#define kTopValue ((UInt32)1 << kNumTopBits)
#define kTopValue ((uint32_t)1 << kNumTopBits)
#define kNumBitModelTotalBits 11
#define kBitModelTotal (1 << kNumBitModelTotalBits)
@@ -19,7 +19,7 @@
#define NORMALIZE if (range < kTopValue) { range <<= 8; code = (code << 8) | (*buf++); }
#define IF_BIT_0(p) ttt = *(p); NORMALIZE; bound = (range >> kNumBitModelTotalBits) * (UInt32)ttt; if (code < bound)
#define IF_BIT_0(p) ttt = *(p); NORMALIZE; bound = (range >> kNumBitModelTotalBits) * (uint32_t)ttt; if (code < bound)
#define UPDATE_0(p) range = bound; *(p) = (CLzmaProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits));
#define UPDATE_1(p) range -= bound; code -= bound; *(p) = (CLzmaProb)(ttt - (ttt >> kNumMoveBits));
#define GET_BIT2(p, i, A0, A1) IF_BIT_0(p) \
@@ -66,7 +66,7 @@
#define NORMALIZE_CHECK if (range < kTopValue) { if (buf >= bufLimit) return DUMMY_ERROR; range <<= 8; code = (code << 8) | (*buf++); }
#define IF_BIT_0_CHECK(p) ttt = *(p); NORMALIZE_CHECK; bound = (range >> kNumBitModelTotalBits) * (UInt32)ttt; if (code < bound)
#define IF_BIT_0_CHECK(p) ttt = *(p); NORMALIZE_CHECK; bound = (range >> kNumBitModelTotalBits) * (uint32_t)ttt; if (code < bound)
#define UPDATE_0_CHECK range = bound;
#define UPDATE_1_CHECK range -= bound; code -= bound;
#define GET_BIT2_CHECK(p, i, A0, A1) IF_BIT_0_CHECK(p) \
@@ -155,7 +155,7 @@
#define LZMA_LIT_SIZE 0x300
#define LzmaProps_GetNumProbs(p) (NUM_BASE_PROBS + ((UInt32)LZMA_LIT_SIZE << ((p)->lc + (p)->lp)))
#define LzmaProps_GetNumProbs(p) (NUM_BASE_PROBS + ((uint32_t)LZMA_LIT_SIZE << ((p)->lc + (p)->lp)))
#define CALC_POS_STATE(processedPos, pbMask) (((processedPos) & (pbMask)) << 4)
@@ -219,7 +219,7 @@ int MY_FAST_CALL LZMA_DECODE_REAL(CLzmaDec *p, SizeT limit, const Byte *bufLimit
{
CLzmaProb *probs = GET_PROBS;
unsigned state = (unsigned)p->state;
UInt32 rep0 = p->reps[0], rep1 = p->reps[1], rep2 = p->reps[2], rep3 = p->reps[3];
uint32_t rep0 = p->reps[0], rep1 = p->reps[1], rep2 = p->reps[2], rep3 = p->reps[3];
unsigned pbMask = ((unsigned)1 << (p->prop.pb)) - 1;
unsigned lc = p->prop.lc;
unsigned lpMask = ((unsigned)0x100 << p->prop.lp) - ((unsigned)0x100 >> lc);
@@ -228,18 +228,18 @@ int MY_FAST_CALL LZMA_DECODE_REAL(CLzmaDec *p, SizeT limit, const Byte *bufLimit
SizeT dicBufSize = p->dicBufSize;
SizeT dicPos = p->dicPos;
UInt32 processedPos = p->processedPos;
UInt32 checkDicSize = p->checkDicSize;
uint32_t processedPos = p->processedPos;
uint32_t checkDicSize = p->checkDicSize;
unsigned len = 0;
const Byte *buf = p->buf;
UInt32 range = p->range;
UInt32 code = p->code;
uint32_t range = p->range;
uint32_t code = p->code;
do
{
CLzmaProb *prob;
UInt32 bound;
uint32_t bound;
unsigned ttt;
unsigned posState = CALC_POS_STATE(processedPos, pbMask);
@@ -250,7 +250,7 @@ int MY_FAST_CALL LZMA_DECODE_REAL(CLzmaDec *p, SizeT limit, const Byte *bufLimit
UPDATE_0(prob);
prob = probs + Literal;
if (processedPos != 0 || checkDicSize != 0)
prob += (UInt32)3 * ((((processedPos << 8) + dic[(dicPos == 0 ? dicBufSize : dicPos) - 1]) & lpMask) << lc);
prob += (uint32_t)3 * ((((processedPos << 8) + dic[(dicPos == 0 ? dicBufSize : dicPos) - 1]) & lpMask) << lc);
processedPos++;
if (state < kNumLitStates)
@@ -339,7 +339,7 @@ int MY_FAST_CALL LZMA_DECODE_REAL(CLzmaDec *p, SizeT limit, const Byte *bufLimit
}
else
{
UInt32 distance;
uint32_t distance;
UPDATE_1(prob);
prob = probs + IsRepG1 + state;
IF_BIT_0(prob)
@@ -443,7 +443,7 @@ int MY_FAST_CALL LZMA_DECODE_REAL(CLzmaDec *p, SizeT limit, const Byte *bufLimit
if (state >= kNumStates)
{
UInt32 distance;
uint32_t distance;
prob = probs + PosSlot +
((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) << kNumPosSlotBits);
TREE_6_DECODE(prob, distance);
@@ -457,7 +457,7 @@ int MY_FAST_CALL LZMA_DECODE_REAL(CLzmaDec *p, SizeT limit, const Byte *bufLimit
distance <<= numDirectBits;
prob = probs + SpecPos;
{
UInt32 m = 1;
uint32_t m = 1;
distance++;
do
{
@@ -476,9 +476,9 @@ int MY_FAST_CALL LZMA_DECODE_REAL(CLzmaDec *p, SizeT limit, const Byte *bufLimit
range >>= 1;
{
UInt32 t;
uint32_t t;
code -= range;
t = (0 - ((UInt32)code >> 31)); /* (UInt32)((Int32)code >> 31) */
t = (0 - ((uint32_t)code >> 31)); /* (uint32_t)((Int32)code >> 31) */
distance = (distance << 1) + (t + 1);
code += range & t;
}
@@ -502,7 +502,7 @@ int MY_FAST_CALL LZMA_DECODE_REAL(CLzmaDec *p, SizeT limit, const Byte *bufLimit
REV_BIT_LAST (prob, i, 8);
distance |= i;
}
if (distance == (UInt32)0xFFFFFFFF)
if (distance == (uint32_t)0xFFFFFFFF)
{
len = kMatchSpecLenStart;
state -= kNumStates;
@@ -539,7 +539,7 @@ int MY_FAST_CALL LZMA_DECODE_REAL(CLzmaDec *p, SizeT limit, const Byte *bufLimit
curLen = ((rem < len) ? (unsigned)rem : len);
pos = dicPos - rep0 + (dicPos < rep0 ? dicBufSize : 0);
processedPos += (UInt32)curLen;
processedPos += (uint32_t)curLen;
len -= curLen;
if (curLen <= dicBufSize - pos)
@@ -572,14 +572,14 @@ int MY_FAST_CALL LZMA_DECODE_REAL(CLzmaDec *p, SizeT limit, const Byte *bufLimit
p->buf = buf;
p->range = range;
p->code = code;
p->remainLen = (UInt32)len;
p->remainLen = (uint32_t)len;
p->dicPos = dicPos;
p->processedPos = processedPos;
p->reps[0] = rep0;
p->reps[1] = rep1;
p->reps[2] = rep2;
p->reps[3] = rep3;
p->state = (UInt32)state;
p->state = (uint32_t)state;
return SZ_OK;
}
@@ -601,8 +601,8 @@ static void MY_FAST_CALL LzmaDec_WriteRem(CLzmaDec *p, SizeT limit)
if (p->checkDicSize == 0 && p->prop.dicSize - p->processedPos <= len)
p->checkDicSize = p->prop.dicSize;
p->processedPos += (UInt32)len;
p->remainLen -= (UInt32)len;
p->processedPos += (uint32_t)len;
p->remainLen -= (uint32_t)len;
while (len != 0)
{
len--;
@@ -628,7 +628,7 @@ static int MY_FAST_CALL LzmaDec_DecodeReal2(CLzmaDec *p, SizeT limit, const Byte
SizeT limit2 = limit;
if (p->checkDicSize == 0)
{
UInt32 rem = p->prop.dicSize - p->processedPos;
uint32_t rem = p->prop.dicSize - p->processedPos;
if (limit - p->dicPos > rem)
limit2 = p->dicPos + rem;
@@ -659,8 +659,8 @@ typedef enum
static ELzmaDummy LzmaDec_TryDummy(const CLzmaDec *p, const Byte *buf, SizeT inSize)
{
UInt32 range = p->range;
UInt32 code = p->code;
uint32_t range = p->range;
uint32_t code = p->code;
const Byte *bufLimit = buf + inSize;
const CLzmaProb *probs = GET_PROBS;
unsigned state = (unsigned)p->state;
@@ -668,7 +668,7 @@ static ELzmaDummy LzmaDec_TryDummy(const CLzmaDec *p, const Byte *buf, SizeT inS
{
const CLzmaProb *prob;
UInt32 bound;
uint32_t bound;
unsigned ttt;
unsigned posState = CALC_POS_STATE(p->processedPos, (1 << p->prop.pb) - 1);
@@ -681,7 +681,7 @@ static ELzmaDummy LzmaDec_TryDummy(const CLzmaDec *p, const Byte *buf, SizeT inS
prob = probs + Literal;
if (p->checkDicSize != 0 || p->processedPos != 0)
prob += ((UInt32)LZMA_LIT_SIZE *
prob += ((uint32_t)LZMA_LIT_SIZE *
((((p->processedPos) & ((1 << (p->prop.lp)) - 1)) << p->prop.lc) +
(p->dic[(p->dicPos == 0 ? p->dicBufSize : p->dicPos) - 1] >> (8 - p->prop.lc))));
@@ -892,10 +892,10 @@ SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit, const Byte *src, SizeT *sr
return SZ_OK;
}
p->code =
((UInt32)p->tempBuf[1] << 24)
| ((UInt32)p->tempBuf[2] << 16)
| ((UInt32)p->tempBuf[3] << 8)
| ((UInt32)p->tempBuf[4]);
((uint32_t)p->tempBuf[1] << 24)
| ((uint32_t)p->tempBuf[2] << 16)
| ((uint32_t)p->tempBuf[3] << 8)
| ((uint32_t)p->tempBuf[4]);
p->range = 0xFFFFFFFF;
p->tempBufSize = 0;
@@ -1079,13 +1079,13 @@ void LzmaDec_Free(CLzmaDec *p, ISzAllocPtr alloc)
SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size)
{
UInt32 dicSize;
uint32_t dicSize;
Byte d;
if (size < LZMA_PROPS_SIZE)
return SZ_ERROR_UNSUPPORTED;
else
dicSize = data[1] | ((UInt32)data[2] << 8) | ((UInt32)data[3] << 16) | ((UInt32)data[4] << 24);
dicSize = data[1] | ((uint32_t)data[2] << 8) | ((uint32_t)data[3] << 16) | ((uint32_t)data[4] << 24);
if (dicSize < LZMA_DIC_MIN)
dicSize = LZMA_DIC_MIN;
@@ -1105,7 +1105,7 @@ SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size)
static SRes LzmaDec_AllocateProbs2(CLzmaDec *p, const CLzmaProps *propNew, ISzAllocPtr alloc)
{
UInt32 numProbs = LzmaProps_GetNumProbs(propNew);
uint32_t numProbs = LzmaProps_GetNumProbs(propNew);
if (!p->probs || numProbs != p->numProbs)
{
LzmaDec_FreeProbs(p, alloc);
@@ -1135,10 +1135,10 @@ SRes LzmaDec_Allocate(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAll
RINOK(LzmaDec_AllocateProbs2(p, &propNew, alloc));
{
UInt32 dictSize = propNew.dicSize;
SizeT mask = ((UInt32)1 << 12) - 1;
if (dictSize >= ((UInt32)1 << 30)) mask = ((UInt32)1 << 22) - 1;
else if (dictSize >= ((UInt32)1 << 22)) mask = ((UInt32)1 << 20) - 1;;
uint32_t dictSize = propNew.dicSize;
SizeT mask = ((uint32_t)1 << 12) - 1;
if (dictSize >= ((uint32_t)1 << 30)) mask = ((uint32_t)1 << 22) - 1;
else if (dictSize >= ((uint32_t)1 << 22)) mask = ((uint32_t)1 << 20) - 1;;
dicBufSize = ((SizeT)dictSize + mask) & ~mask;
if (dicBufSize < dictSize)
dicBufSize = dictSize;
+11 -11
View File
@@ -14,9 +14,9 @@ EXTERN_C_BEGIN
typedef
#ifdef _LZMA_PROB32
UInt32
uint32_t
#else
UInt16
uint16_t
#endif
CLzmaProb;
@@ -31,7 +31,7 @@ typedef struct _CLzmaProps
Byte lp;
Byte pb;
Byte _pad_;
UInt32 dicSize;
uint32_t dicSize;
} CLzmaProps;
/* LzmaProps_Decode - decodes properties
@@ -60,15 +60,15 @@ typedef struct
SizeT dicBufSize;
SizeT dicPos;
const Byte *buf;
UInt32 range;
UInt32 code;
UInt32 processedPos;
UInt32 checkDicSize;
UInt32 reps[4];
UInt32 state;
UInt32 remainLen;
uint32_t range;
uint32_t code;
uint32_t processedPos;
uint32_t checkDicSize;
uint32_t reps[4];
uint32_t state;
uint32_t remainLen;
UInt32 numProbs;
uint32_t numProbs;
unsigned tempBufSize;
Byte tempBuf[LZMA_REQUIRED_INPUT_MAX];
} CLzmaDec;
+184 -184
View File
File diff suppressed because it is too large. Load diff
+5 -5
View File
@@ -13,7 +13,7 @@ EXTERN_C_BEGIN
typedef struct _CLzmaEncProps
{
int level; /* 0 <= level <= 9 */
UInt32 dictSize; /* (1 << 12) <= dictSize <= (1 << 27) for 32-bit version
uint32_t dictSize; /* (1 << 12) <= dictSize <= (1 << 27) for 32-bit version
(1 << 12) <= dictSize <= (3 << 29) for 64-bit version
default = (1 << 24) */
int lc; /* 0 <= lc <= 8, default = 3 */
@@ -23,17 +23,17 @@ typedef struct _CLzmaEncProps
int fb; /* 5 <= fb <= 273, default = 32 */
int btMode; /* 0 - hashChain Mode, 1 - binTree mode - normal, default = 1 */
int numHashBytes; /* 2, 3 or 4, default = 4 */
UInt32 mc; /* 1 <= mc <= (1 << 30), default = 32 */
uint32_t mc; /* 1 <= mc <= (1 << 30), default = 32 */
unsigned writeEndMark; /* 0 - do not write EOPM, 1 - write EOPM, default = 0 */
int numThreads; /* 1 or 2, default = 2 */
UInt64 reduceSize; /* estimated size of data that will be compressed. default = (UInt64)(Int64)-1.
uint64_t reduceSize; /* estimated size of data that will be compressed. default = (uint64_t)(int64_t)-1.
Encoder uses this value to reduce dictionary size */
} CLzmaEncProps;
void LzmaEncProps_Init(CLzmaEncProps *p);
void LzmaEncProps_Normalize(CLzmaEncProps *p);
UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2);
uint32_t LzmaEncProps_GetDictSize(const CLzmaEncProps *props2);
/* ---------- CLzmaEncHandle Interface ---------- */
@@ -55,7 +55,7 @@ CLzmaEncHandle LzmaEnc_Create(ISzAllocPtr alloc);
void LzmaEnc_Destroy(CLzmaEncHandle p, ISzAllocPtr alloc, ISzAllocPtr allocBig);
SRes LzmaEnc_SetProps(CLzmaEncHandle p, const CLzmaEncProps *props);
void LzmaEnc_SetDataSize(CLzmaEncHandle p, UInt64 expectedDataSiize);
void LzmaEnc_SetDataSize(CLzmaEncHandle p, uint64_t expectedDataSiize);
SRes LzmaEnc_WriteProperties(CLzmaEncHandle p, Byte *properties, SizeT *size);
unsigned LzmaEnc_IsWriteEndMark(CLzmaEncHandle p);
+2 -2
View File
@@ -13,7 +13,7 @@ struct BaseConnectionUnix : public BaseConnection {
int sock{-1};
};
static BaseConnectionUnix Connection;
static BaseConnectionUnix ConnectionUnix;
static sockaddr_un PipeAddr{};
#ifdef MSG_NOSIGNAL
static int MsgFlags = MSG_NOSIGNAL;
@@ -34,7 +34,7 @@ static const char* GetTempPath(void)
/*static*/ BaseConnection* BaseConnection::Create()
{
PipeAddr.sun_family = AF_UNIX;
return &Connection;
return &ConnectionUnix;
}
/*static*/ void BaseConnection::Destroy(BaseConnection*& c)
+2 -2
View File
@@ -63,8 +63,8 @@
/* Platform specific options */
#if defined (__wiiu__)
#define DEFAULT_CACHE_PAGES 4
#define DEFAULT_SECTORS_PAGE 64
#define DEFAULT_CACHE_PAGES 512
#define DEFAULT_SECTORS_PAGE 128
#if 0
#define USE_LWP_LOCK
#define USE_RTC_TIME
+25
View File
@@ -0,0 +1,25 @@
name: Publish Docker Image
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Get release version
id: get_release_tag
run: |
echo RELEASE_VERSION=$(echo $(date '+%Y%m%d')) >> $GITHUB_ENV
echo REPOSITORY_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}' | sed -e "s/:refs//" | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
echo REPOSITORY_OWNER=$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $1}' | sed 's/[^a-zA-Z0-9]//g' | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: ${{ env.REPOSITORY_OWNER }}/${{ env.REPOSITORY_NAME }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
snapshot: true
cache: true
tags: "latest, ${{ env.RELEASE_VERSION }}"
+5
View File
@@ -0,0 +1,5 @@
/*.a
/build
*.bz2
release/
lib/
+29
View File
@@ -0,0 +1,29 @@
language: cpp
os: linux
sudo: false
dist: trusty
env:
global:
- DEVKITPRO=/opt/devkitpro
- DEVKITPPC=/opt/devkitpro/devkitPPC
cache:
directories:
- "$HOME/.local"
- "$DEVKITPRO"
addons:
apt:
packages:
- p7zip-full
before_install:
- mkdir -p "${DEVKITPRO}"
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then wget https://github.com/devkitPro/pacman/releases/download/devkitpro-pacman-1.0.1/devkitpro-pacman.deb -O /tmp/devkitpro-pacman.deb; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo dpkg -i /tmp/devkitpro-pacman.deb; fi
- yes | sudo dkp-pacman -Syu devkitPPC --needed
script:
- make && make install
+9
View File
@@ -0,0 +1,9 @@
FROM wiiuenv/devkitppc:20210101
WORKDIR tmp_build
COPY . .
RUN make clean && make && mkdir -p /artifacts/wut/usr && cp -r lib /artifacts/wut/usr && cp -r include /artifacts/wut/usr
WORKDIR /artifacts
FROM scratch
COPY --from=0 /artifacts /artifacts
+157
View File
@@ -0,0 +1,157 @@
#-------------------------------------------------------------------------------
.SUFFIXES:
#-------------------------------------------------------------------------------
ifeq ($(strip $(DEVKITPRO)),)
$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=<path to>/devkitpro")
endif
TOPDIR ?= $(CURDIR)
include $(DEVKITPRO)/wut/share/wut_rules
export VER_MAJOR := 1
export VER_MINOR := 0
export VER_PATCH := 0
VERSION := $(VER_MAJOR).$(VER_MINOR).$(VER_PATCH)
#-------------------------------------------------------------------------------
# TARGET is the name of the output
# BUILD is the directory where object files & intermediate files will be placed
# SOURCES is a list of directories containing source code
# DATA is a list of directories containing data files
# INCLUDES is a list of directories containing header files
#-------------------------------------------------------------------------------
TARGET := $(notdir $(CURDIR))
BUILD := build
SOURCES := source
DATA := data
INCLUDES := source \
include \
#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------
CFLAGS := -Wall -Werror -save-temps \
-ffunction-sections -fdata-sections \
$(MACHDEP) \
$(BUILD_CFLAGS)
CFLAGS += $(INCLUDE) -D__WIIU__ -D__WUT__
CXXFLAGS := $(CFLAGS) -std=gnu++17
ASFLAGS := $(MACHDEP)
LDFLAGS = $(ARCH) -Wl,--gc-sections
LIBS :=
#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
# include and lib
#---------------------------------------------------------------------------------
LIBDIRS := $(PORTLIBS) $(WUT_ROOT)
#---------------------------------------------------------------------------------
# no real need to edit anything past this point unless you need to add additional
# rules for different file extensions
#---------------------------------------------------------------------------------
ifneq ($(BUILD),$(notdir $(CURDIR)))
#---------------------------------------------------------------------------------
export TOPDIR := $(CURDIR)
export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
$(foreach dir,$(DATA),$(CURDIR)/$(dir))
CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
DEFFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.def)))
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))
#---------------------------------------------------------------------------------
# use CXX for linking C++ projects, CC for standard C
#---------------------------------------------------------------------------------
ifeq ($(strip $(CPPFILES)),)
#---------------------------------------------------------------------------------
export LD := $(CC)
#---------------------------------------------------------------------------------
else
#---------------------------------------------------------------------------------
export LD := $(CXX)
#---------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------
export OFILES_BIN := $(addsuffix .o,$(BINFILES))
export OFILES_SRC := $(DEFFILES:.def=.o) $(SFILES:.s=.o) $(CFILES:.c=.o) $(CPPFILES:.cpp=.o)
export OFILES := $(OFILES_BIN) $(OFILES_SRC)
export HFILES := $(addsuffix .h,$(subst .,_,$(BINFILES)))
export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
-I.
.PHONY: all dist-bin dist-src dist install clean
#---------------------------------------------------------------------------------
all: lib/libiosuhax.a
dist-bin: all
@tar --exclude=*~ -cjf libiosuhax-$(VERSION).tar.bz2 include lib
dist-src:
@tar --exclude=*~ -cjf libiosuhax-src-$(VERSION).tar.bz2 include source Makefile
dist: dist-src dist-bin
install: dist-bin
mkdir -p $(DESTDIR)$(DEVKITPRO)/wut/usr
bzip2 -cd libiosuhax-$(VERSION).tar.bz2 | tar -xf - -C $(DESTDIR)$(DEVKITPRO)/wut/usr
lib:
@[ -d $@ ] || mkdir -p $@
release:
@[ -d $@ ] || mkdir -p $@
lib/libiosuhax.a :$(SOURCES) $(INCLUDES) | lib release
@$(MAKE) BUILD=release OUTPUT=$(CURDIR)/$@ \
BUILD_CFLAGS="-DNDEBUG=1 -O2 -s" \
DEPSDIR=$(CURDIR)/release \
--no-print-directory -C release \
-f $(CURDIR)/Makefile
#---------------------------------------------------------------------------------
clean:
@echo clean ...
@rm -rf release lib
#---------------------------------------------------------------------------------
else
DEPENDS := $(OFILES:.o=.d)
#---------------------------------------------------------------------------------
# main targets
#---------------------------------------------------------------------------------
$(OUTPUT) : $(OFILES)
$(OFILES_SRC) : $(HFILES)
#---------------------------------------------------------------------------------
%_bin.h %.bin.o : %.bin
#---------------------------------------------------------------------------------
@echo $(notdir $<)
@$(bin2o)
-include $(DEPENDS)
#---------------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------------
+10
View File
@@ -0,0 +1,10 @@
[![Build Status](https://travis-ci.org/dimok789/libiosuhax.svg)](https://travis-ci.org/dimok789/libiosuhax)
# libiosuhax
A PPC library to access IOSUHAX from PPC and a devoptab for any device or path.
It's only compatible to RPX-Files.
## Building
Make you to have [wut](https://github.com/devkitPro/wut/) installed and use the following command for build:
```
make install
```
+112 -109
View File
@@ -1,109 +1,112 @@
/***************************************************************************
* Copyright (C) 2016
* by Dimok
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any
* damages arising from the use of this software.
*
* Permission is granted to anyone to use this software for any
* purpose, including commercial applications, and to alter it and
* redistribute it freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you
* must not claim that you wrote the original software. If you use
* this software in a product, an acknowledgment in the product
* documentation would be appreciated but is not required.
*
* 2. Altered source versions must be plainly marked as such, and
* must not be misrepresented as being the original software.
*
* 3. This notice may not be removed or altered from any source
* distribution.
***************************************************************************/
#ifndef _LIB_IOSUHAX_H_
#define _LIB_IOSUHAX_H_
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
#define IOS_ERROR_UNKNOWN_VALUE 0xFFFFFFD6
#define IOS_ERROR_INVALID_ARG 0xFFFFFFE3
#define IOS_ERROR_INVALID_SIZE 0xFFFFFFE9
#define IOS_ERROR_UNKNOWN 0xFFFFFFF7
#define IOS_ERROR_NOEXISTS 0xFFFFFFFA
typedef struct
{
uint32_t flag;
uint32_t permission;
uint32_t owner_id;
uint32_t group_id;
uint32_t size; // size in bytes
uint32_t physsize; // physical size on disk in bytes
uint32_t unk[3];
uint32_t id;
uint32_t ctime;
uint32_t mtime;
uint32_t unk2[0x0D];
}fileStat_s;
typedef struct
{
fileStat_s stat;
char name[0x100];
}directoryEntry_s;
#define DIR_ENTRY_IS_DIRECTORY 0x80000000
#define FSA_MOUNTFLAGS_BINDMOUNT (1 << 0)
#define FSA_MOUNTFLAGS_GLOBAL (1 << 1)
int IOSUHAX_Open(const char *dev); // if dev == NULL the default path /dev/iosuhax will be used
int IOSUHAX_Close(void);
int IOSUHAX_memwrite(uint32_t address, const uint8_t * buffer, uint32_t size); // IOSU external input
int IOSUHAX_memread(uint32_t address, uint8_t * out_buffer, uint32_t size); // IOSU external output
int IOSUHAX_memcpy(uint32_t dst, uint32_t src, uint32_t size); // IOSU internal memcpy only
int IOSUHAX_SVC(uint32_t svc_id, uint32_t * args, uint32_t arg_cnt);
int IOSUHAX_FSA_Open();
int IOSUHAX_FSA_Close(int fsaFd);
int IOSUHAX_FSA_Mount(int fsaFd, const char* device_path, const char* volume_path, uint32_t flags, const char* arg_string, int arg_string_len);
int IOSUHAX_FSA_Unmount(int fsaFd, const char* path, uint32_t flags);
int IOSUHAX_FSA_FlushVolume(int fsaFd, const char* volume_path);
int IOSUHAX_FSA_GetDeviceInfo(int fsaFd, const char* device_path, int type, uint32_t* out_data);
int IOSUHAX_FSA_MakeDir(int fsaFd, const char* path, uint32_t flags);
int IOSUHAX_FSA_OpenDir(int fsaFd, const char* path, int* outHandle);
int IOSUHAX_FSA_ReadDir(int fsaFd, int handle, directoryEntry_s* out_data);
int IOSUHAX_FSA_RewindDir(int fsaFd, int dirHandle);
int IOSUHAX_FSA_CloseDir(int fsaFd, int handle);
int IOSUHAX_FSA_ChangeDir(int fsaFd, const char *path);
int IOSUHAX_FSA_OpenFile(int fsaFd, const char* path, const char* mode, int* outHandle);
int IOSUHAX_FSA_ReadFile(int fsaFd, void* data, uint32_t size, uint32_t cnt, int fileHandle, uint32_t flags);
int IOSUHAX_FSA_WriteFile(int fsaFd, const void* data, uint32_t size, uint32_t cnt, int fileHandle, uint32_t flags);
int IOSUHAX_FSA_StatFile(int fsaFd, int fileHandle, fileStat_s* out_data);
int IOSUHAX_FSA_CloseFile(int fsaFd, int fileHandle);
int IOSUHAX_FSA_SetFilePos(int fsaFd, int fileHandle, uint32_t position);
int IOSUHAX_FSA_GetStat(int fsaFd, const char *path, fileStat_s* out_data);
int IOSUHAX_FSA_Remove(int fsaFd, const char *path);
int IOSUHAX_FSA_ChangeMode(int fsaFd, const char* path, int mode);
int IOSUHAX_FSA_RawOpen(int fsaFd, const char* device_path, int* outHandle);
int IOSUHAX_FSA_RawRead(int fsaFd, void* data, uint32_t block_size, uint32_t block_cnt, uint64_t sector_offset, int device_handle);
int IOSUHAX_FSA_RawWrite(int fsaFd, const void* data, uint32_t block_size, uint32_t block_cnt, uint64_t sector_offset, int device_handle);
int IOSUHAX_FSA_RawClose(int fsaFd, int device_handle);
#ifdef __cplusplus
}
#endif
#endif
/***************************************************************************
* Copyright (C) 2016
* by Dimok
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any
* damages arising from the use of this software.
*
* Permission is granted to anyone to use this software for any
* purpose, including commercial applications, and to alter it and
* redistribute it freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you
* must not claim that you wrote the original software. If you use
* this software in a product, an acknowledgment in the product
* documentation would be appreciated but is not required.
*
* 2. Altered source versions must be plainly marked as such, and
* must not be misrepresented as being the original software.
*
* 3. This notice may not be removed or altered from any source
* distribution.
***************************************************************************/
#ifndef _LIB_IOSUHAX_H_
#define _LIB_IOSUHAX_H_
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
#define IOS_ERROR_UNKNOWN_VALUE 0xFFFFFFD6
#define IOS_ERROR_INVALID_ARG 0xFFFFFFE3
#define IOS_ERROR_INVALID_SIZE 0xFFFFFFE9
#define IOS_ERROR_UNKNOWN 0xFFFFFFF7
#define IOS_ERROR_NOEXISTS 0xFFFFFFFA
typedef struct
{
uint32_t flag;
uint32_t permission;
uint32_t owner_id;
uint32_t group_id;
uint32_t size; // size in bytes
uint32_t physsize; // physical size on disk in bytes
uint32_t unk[3];
uint32_t id;
uint32_t ctime;
uint32_t mtime;
uint32_t unk2[0x0D];
}fileStat_s;
typedef struct
{
fileStat_s stat;
char name[0x100];
}directoryEntry_s;
#define DIR_ENTRY_IS_DIRECTORY 0x80000000
#define FSA_MOUNTFLAGS_BINDMOUNT (1 << 0)
#define FSA_MOUNTFLAGS_GLOBAL (1 << 1)
int IOSUHAX_Open(const char *dev); // if dev == NULL the default path /dev/iosuhax will be used
int IOSUHAX_Close(void);
int IOSUHAX_memwrite(uint32_t address, const uint8_t * buffer, uint32_t size); // IOSU external input
int IOSUHAX_memread(uint32_t address, uint8_t * out_buffer, uint32_t size); // IOSU external output
int IOSUHAX_memcpy(uint32_t dst, uint32_t src, uint32_t size); // IOSU internal memcpy only
int IOSUHAX_kern_write32(uint32_t address, uint32_t value);
int IOSUHAX_kern_read32(uint32_t address, uint32_t* out_buffer, uint32_t count);
int IOSUHAX_SVC(uint32_t svc_id, uint32_t * args, uint32_t arg_cnt);
int IOSUHAX_FSA_Open();
int IOSUHAX_FSA_Close(int fsaFd);
int IOSUHAX_FSA_Mount(int fsaFd, const char* device_path, const char* volume_path, uint32_t flags, const char* arg_string, int arg_string_len);
int IOSUHAX_FSA_Unmount(int fsaFd, const char* path, uint32_t flags);
int IOSUHAX_FSA_FlushVolume(int fsaFd, const char* volume_path);
int IOSUHAX_FSA_GetDeviceInfo(int fsaFd, const char* device_path, int type, uint32_t* out_data);
int IOSUHAX_FSA_MakeDir(int fsaFd, const char* path, uint32_t flags);
int IOSUHAX_FSA_OpenDir(int fsaFd, const char* path, int* outHandle);
int IOSUHAX_FSA_ReadDir(int fsaFd, int handle, directoryEntry_s* out_data);
int IOSUHAX_FSA_RewindDir(int fsaFd, int dirHandle);
int IOSUHAX_FSA_CloseDir(int fsaFd, int handle);
int IOSUHAX_FSA_ChangeDir(int fsaFd, const char *path);
int IOSUHAX_FSA_OpenFile(int fsaFd, const char* path, const char* mode, int* outHandle);
int IOSUHAX_FSA_ReadFile(int fsaFd, void* data, uint32_t size, uint32_t cnt, int fileHandle, uint32_t flags);
int IOSUHAX_FSA_WriteFile(int fsaFd, const void* data, uint32_t size, uint32_t cnt, int fileHandle, uint32_t flags);
int IOSUHAX_FSA_StatFile(int fsaFd, int fileHandle, fileStat_s* out_data);
int IOSUHAX_FSA_CloseFile(int fsaFd, int fileHandle);
int IOSUHAX_FSA_SetFilePos(int fsaFd, int fileHandle, uint32_t position);
int IOSUHAX_FSA_GetStat(int fsaFd, const char *path, fileStat_s* out_data);
int IOSUHAX_FSA_Remove(int fsaFd, const char *path);
int IOSUHAX_FSA_ChangeMode(int fsaFd, const char* path, int mode);
int IOSUHAX_FSA_RawOpen(int fsaFd, const char* device_path, int* outHandle);
int IOSUHAX_FSA_RawRead(int fsaFd, void* data, uint32_t block_size, uint32_t block_cnt, uint64_t sector_offset, int device_handle);
int IOSUHAX_FSA_RawWrite(int fsaFd, const void* data, uint32_t block_size, uint32_t block_cnt, uint64_t sector_offset, int device_handle);
int IOSUHAX_FSA_RawClose(int fsaFd, int device_handle);
#ifdef __cplusplus
}
#endif
#endif
@@ -1,42 +1,42 @@
/***************************************************************************
* Copyright (C) 2015
* by Dimok
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any
* damages arising from the use of this software.
*
* Permission is granted to anyone to use this software for any
* purpose, including commercial applications, and to alter it and
* redistribute it freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you
* must not claim that you wrote the original software. If you use
* this software in a product, an acknowledgment in the product
* documentation would be appreciated but is not required.
*
* 2. Altered source versions must be plainly marked as such, and
* must not be misrepresented as being the original software.
*
* 3. This notice may not be removed or altered from any source
* distribution.
***************************************************************************/
#ifndef __IOSUHAX_DEVOPTAB_H_
#define __IOSUHAX_DEVOPTAB_H_
#ifdef __cplusplus
extern "C" {
#endif
//! virtual name example: sd or odd (for sd:/ or odd:/ access)
//! fsaFd: fd received by IOSUHAX_FSA_Open();
//! dev_path: (optional) if a device should be mounted to the mount_path. If NULL no IOSUHAX_FSA_Mount is not executed.
//! mount_path: path to map to virtual device name
int mount_fs(const char *virt_name, int fsaFd, const char *dev_path, const char *mount_path);
int unmount_fs(const char *virt_name);
#ifdef __cplusplus
}
#endif
#endif // __IOSUHAX_DEVOPTAB_H_
/***************************************************************************
* Copyright (C) 2015
* by Dimok
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any
* damages arising from the use of this software.
*
* Permission is granted to anyone to use this software for any
* purpose, including commercial applications, and to alter it and
* redistribute it freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you
* must not claim that you wrote the original software. If you use
* this software in a product, an acknowledgment in the product
* documentation would be appreciated but is not required.
*
* 2. Altered source versions must be plainly marked as such, and
* must not be misrepresented as being the original software.
*
* 3. This notice may not be removed or altered from any source
* distribution.
***************************************************************************/
#ifndef __IOSUHAX_DEVOPTAB_H_
#define __IOSUHAX_DEVOPTAB_H_
#ifdef __cplusplus
extern "C" {
#endif
//! virtual name example: sd or odd (for sd:/ or odd:/ access)
//! fsaFd: fd received by IOSUHAX_FSA_Open();
//! dev_path: (optional) if a device should be mounted to the mount_path. If NULL no IOSUHAX_FSA_Mount is not executed.
//! mount_path: path to map to virtual device name
int mount_fs(const char *virt_name, int fsaFd, const char *dev_path, const char *mount_path);
int unmount_fs(const char *virt_name);
#ifdef __cplusplus
}
#endif
#endif // __IOSUHAX_DEVOPTAB_H_
@@ -1,73 +1,73 @@
/***************************************************************************
* Copyright (C) 2016
* by Dimok
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any
* damages arising from the use of this software.
*
* Permission is granted to anyone to use this software for any
* purpose, including commercial applications, and to alter it and
* redistribute it freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you
* must not claim that you wrote the original software. If you use
* this software in a product, an acknowledgment in the product
* documentation would be appreciated but is not required.
*
* 2. Altered source versions must be plainly marked as such, and
* must not be misrepresented as being the original software.
*
* 3. This notice may not be removed or altered from any source
* distribution.
***************************************************************************/
#ifndef _IOSUHAX_DISC_INTERFACE_H_
#define _IOSUHAX_DISC_INTERFACE_H_
#include <stdint.h>
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
#define DEVICE_TYPE_WII_U_SD (('W'<<24)|('U'<<16)|('S'<<8)|'D')
#define DEVICE_TYPE_WII_U_USB (('W'<<24)|('U'<<16)|('S'<<8)|'B')
#define FEATURE_WII_U_SD 0x00001000
#define FEATURE_WII_U_USB 0x00002000
#ifndef OGC_DISC_IO_INCLUDE
typedef uint32_t sec_t;
#define FEATURE_MEDIUM_CANREAD 0x00000001
#define FEATURE_MEDIUM_CANWRITE 0x00000002
typedef bool (* FN_MEDIUM_STARTUP)(void) ;
typedef bool (* FN_MEDIUM_ISINSERTED)(void) ;
typedef bool (* FN_MEDIUM_READSECTORS)(uint32_t sector, uint32_t numSectors, void* buffer) ;
typedef bool (* FN_MEDIUM_WRITESECTORS)(uint32_t sector, uint32_t numSectors, const void* buffer) ;
typedef bool (* FN_MEDIUM_CLEARSTATUS)(void) ;
typedef bool (* FN_MEDIUM_SHUTDOWN)(void) ;
struct DISC_INTERFACE_STRUCT {
unsigned long ioType ;
unsigned long features ;
FN_MEDIUM_STARTUP startup ;
FN_MEDIUM_ISINSERTED isInserted ;
FN_MEDIUM_READSECTORS readSectors ;
FN_MEDIUM_WRITESECTORS writeSectors ;
FN_MEDIUM_CLEARSTATUS clearStatus ;
FN_MEDIUM_SHUTDOWN shutdown ;
} ;
typedef struct DISC_INTERFACE_STRUCT DISC_INTERFACE ;
#endif
extern const DISC_INTERFACE IOSUHAX_sdio_disc_interface;
extern const DISC_INTERFACE IOSUHAX_usb_disc_interface;
#ifdef __cplusplus
}
#endif
#endif
/***************************************************************************
* Copyright (C) 2016
* by Dimok
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any
* damages arising from the use of this software.
*
* Permission is granted to anyone to use this software for any
* purpose, including commercial applications, and to alter it and
* redistribute it freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you
* must not claim that you wrote the original software. If you use
* this software in a product, an acknowledgment in the product
* documentation would be appreciated but is not required.
*
* 2. Altered source versions must be plainly marked as such, and
* must not be misrepresented as being the original software.
*
* 3. This notice may not be removed or altered from any source
* distribution.
***************************************************************************/
#ifndef _IOSUHAX_DISC_INTERFACE_H_
#define _IOSUHAX_DISC_INTERFACE_H_
#include <stdint.h>
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
#define DEVICE_TYPE_WII_U_SD (('W'<<24)|('U'<<16)|('S'<<8)|'D')
#define DEVICE_TYPE_WII_U_USB (('W'<<24)|('U'<<16)|('S'<<8)|'B')
#define FEATURE_WII_U_SD 0x00001000
#define FEATURE_WII_U_USB 0x00002000
#ifndef OGC_DISC_IO_INCLUDE
typedef uint32_t sec_t;
#define FEATURE_MEDIUM_CANREAD 0x00000001
#define FEATURE_MEDIUM_CANWRITE 0x00000002
typedef bool (* FN_MEDIUM_STARTUP)(void) ;
typedef bool (* FN_MEDIUM_ISINSERTED)(void) ;
typedef bool (* FN_MEDIUM_READSECTORS)(uint32_t sector, uint32_t numSectors, void* buffer) ;
typedef bool (* FN_MEDIUM_WRITESECTORS)(uint32_t sector, uint32_t numSectors, const void* buffer) ;
typedef bool (* FN_MEDIUM_CLEARSTATUS)(void) ;
typedef bool (* FN_MEDIUM_SHUTDOWN)(void) ;
struct DISC_INTERFACE_STRUCT {
unsigned long ioType ;
unsigned long features ;
FN_MEDIUM_STARTUP startup ;
FN_MEDIUM_ISINSERTED isInserted ;
FN_MEDIUM_READSECTORS readSectors ;
FN_MEDIUM_WRITESECTORS writeSectors ;
FN_MEDIUM_CLEARSTATUS clearStatus ;
FN_MEDIUM_SHUTDOWN shutdown ;
} ;
typedef struct DISC_INTERFACE_STRUCT DISC_INTERFACE ;
#endif
extern const DISC_INTERFACE IOSUHAX_sdio_disc_interface;
extern const DISC_INTERFACE IOSUHAX_usb_disc_interface;
#ifdef __cplusplus
}
#endif
#endif
-51
View File
@@ -1,51 +0,0 @@
#ifndef __OS_FUNCTIONS_H_
#define __OS_FUNCTIONS_H_
#ifdef __cplusplus
extern "C" {
#endif
#define OS_MUTEX_SIZE 44
// RetroArch mod: use existing headers; prevents conflicts in griffin
#include <wiiu/os.h>
#include <wiiu/ios.h>
#if 0
#ifndef __WUT__
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! Mutex functions
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
extern void (* OSInitMutex)(void* mutex);
extern void (* OSLockMutex)(void* mutex);
extern void (* OSUnlockMutex)(void* mutex);
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! IOS function
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
extern int (*IOS_Ioctl)(int fd, unsigned int request, void *input_buffer,unsigned int input_buffer_len, void *output_buffer, unsigned int output_buffer_len);
extern int (*IOS_Open)(char *path, unsigned int mode);
extern int (*IOS_Close)(int fd);
#else
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! Mutex functions
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
extern void OSInitMutex(void* mutex);
extern void OSLockMutex(void* mutex);
extern void OSUnlockMutex(void* mutex);
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! IOS function
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
extern int IOS_Ioctl(int fd, unsigned int request, void *input_buffer,unsigned int input_buffer_len, void *output_buffer, unsigned int output_buffer_len);
extern int IOS_Open(char *path, unsigned int mode);
extern int IOS_Close(int fd);
#endif // __WUT__
#ifdef __cplusplus
}
#endif
#endif // 0
#endif // __OS_FUNCTIONS_H_
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -1,262 +1,262 @@
/***************************************************************************
* Copyright (C) 2016
* by Dimok
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any
* damages arising from the use of this software.
*
* Permission is granted to anyone to use this software for any
* purpose, including commercial applications, and to alter it and
* redistribute it freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you
* must not claim that you wrote the original software. If you use
* this software in a product, an acknowledgment in the product
* documentation would be appreciated but is not required.
*
* 2. Altered source versions must be plainly marked as such, and
* must not be misrepresented as being the original software.
*
* 3. This notice may not be removed or altered from any source
* distribution.
***************************************************************************/
#include <string.h>
#include <malloc.h>
#include "iosuhax.h"
#include "iosuhax_disc_interface.h"
#define FSA_REF_SD 0x01
#define FSA_REF_USB 0x02
static int initialized = 0;
static int fsaFdSd = 0;
static int fsaFdUsb = 0;
static int sdioFd = 0;
static int usbFd = 0;
static void IOSUHAX_disc_io_initialize(void)
{
if(initialized == 0)
{
initialized = 1;
fsaFdSd = -1;
fsaFdUsb = -1;
sdioFd = -1;
usbFd = -1;
}
}
static bool IOSUHAX_disc_io_fsa_open(int fsaFd)
{
IOSUHAX_disc_io_initialize();
if(IOSUHAX_Open(NULL) < 0)
return false;
if(fsaFd == FSA_REF_SD)
{
if(fsaFdSd < 0)
{
fsaFdSd = IOSUHAX_FSA_Open();
}
if(fsaFdSd >= 0)
return true;
}
else if(fsaFd == FSA_REF_USB)
{
if(fsaFdUsb < 0)
{
fsaFdUsb = IOSUHAX_FSA_Open();
}
if(fsaFdUsb >= 0)
return true;
}
return false;
}
static void IOSUHAX_disc_io_fsa_close(int fsaFd)
{
if(fsaFd == FSA_REF_SD)
{
if(fsaFdSd >= 0)
{
IOSUHAX_FSA_Close(fsaFdSd);
fsaFdSd = -1;
}
}
else if(fsaFd == FSA_REF_USB)
{
if(fsaFdUsb >= 0)
{
IOSUHAX_FSA_Close(fsaFdUsb);
fsaFdUsb = -1;
}
}
}
static bool IOSUHAX_sdio_startup(void)
{
if(!IOSUHAX_disc_io_fsa_open(FSA_REF_SD))
return false;
if(sdioFd < 0)
{
int res = IOSUHAX_FSA_RawOpen(fsaFdSd, "/dev/sdcard01", &sdioFd);
if(res < 0)
{
IOSUHAX_disc_io_fsa_close(FSA_REF_SD);
sdioFd = -1;
}
}
return (sdioFd >= 0);
}
static bool IOSUHAX_sdio_isInserted(void)
{
//! TODO: check for SD card inserted with IOSUHAX_FSA_GetDeviceInfo()
return initialized && (fsaFdSd >= 0) && (sdioFd >= 0);
}
static bool IOSUHAX_sdio_clearStatus(void)
{
return true;
}
static bool IOSUHAX_sdio_shutdown(void)
{
if(!IOSUHAX_sdio_isInserted())
return false;
IOSUHAX_FSA_RawClose(fsaFdSd, sdioFd);
IOSUHAX_disc_io_fsa_close(FSA_REF_SD);
sdioFd = -1;
return true;
}
static bool IOSUHAX_sdio_readSectors(uint32_t sector, uint32_t numSectors, void* buffer)
{
if(!IOSUHAX_sdio_isInserted() || !buffer)
return false;
int res = IOSUHAX_FSA_RawRead(fsaFdSd, buffer, 512, numSectors, sector, sdioFd);
if(res < 0)
{
return false;
}
return true;
}
static bool IOSUHAX_sdio_writeSectors(uint32_t sector, uint32_t numSectors, const void* buffer)
{
if(!IOSUHAX_sdio_isInserted() || !buffer)
return false;
int res = IOSUHAX_FSA_RawWrite(fsaFdSd, buffer, 512, numSectors, sector, sdioFd);
if(res < 0)
{
return false;
}
return true;
}
const DISC_INTERFACE IOSUHAX_sdio_disc_interface =
{
DEVICE_TYPE_WII_U_SD,
FEATURE_MEDIUM_CANREAD | FEATURE_MEDIUM_CANWRITE | FEATURE_WII_U_SD,
IOSUHAX_sdio_startup,
IOSUHAX_sdio_isInserted,
IOSUHAX_sdio_readSectors,
IOSUHAX_sdio_writeSectors,
IOSUHAX_sdio_clearStatus,
IOSUHAX_sdio_shutdown
};
static bool IOSUHAX_usb_startup(void)
{
if(!IOSUHAX_disc_io_fsa_open(FSA_REF_USB))
return false;
if(usbFd < 0)
{
int res = IOSUHAX_FSA_RawOpen(fsaFdUsb, "/dev/usb01", &usbFd);
if(res < 0)
{
res = IOSUHAX_FSA_RawOpen(fsaFdUsb, "/dev/usb02", &usbFd);
if(res < 0)
{
IOSUHAX_disc_io_fsa_close(FSA_REF_USB);
usbFd = -1;
}
}
}
return (usbFd >= 0);
}
static bool IOSUHAX_usb_isInserted(void)
{
return initialized && (fsaFdUsb >= 0) && (usbFd >= 0);
}
static bool IOSUHAX_usb_clearStatus(void)
{
return true;
}
static bool IOSUHAX_usb_shutdown(void)
{
if(!IOSUHAX_usb_isInserted())
return false;
IOSUHAX_FSA_RawClose(fsaFdUsb, usbFd);
IOSUHAX_disc_io_fsa_close(FSA_REF_USB);
usbFd = -1;
return true;
}
static bool IOSUHAX_usb_readSectors(uint32_t sector, uint32_t numSectors, void* buffer)
{
if(!IOSUHAX_usb_isInserted() || !buffer)
return false;
int res = IOSUHAX_FSA_RawRead(fsaFdUsb, buffer, 512, numSectors, sector, usbFd);
if(res < 0)
{
return false;
}
return true;
}
static bool IOSUHAX_usb_writeSectors(uint32_t sector, uint32_t numSectors, const void* buffer)
{
if(!IOSUHAX_usb_isInserted() || !buffer)
return false;
int res = IOSUHAX_FSA_RawWrite(fsaFdUsb, buffer, 512, numSectors, sector, usbFd);
if(res < 0)
{
return false;
}
return true;
}
const DISC_INTERFACE IOSUHAX_usb_disc_interface =
{
DEVICE_TYPE_WII_U_USB,
FEATURE_MEDIUM_CANREAD | FEATURE_MEDIUM_CANWRITE | FEATURE_WII_U_USB,
IOSUHAX_usb_startup,
IOSUHAX_usb_isInserted,
IOSUHAX_usb_readSectors,
IOSUHAX_usb_writeSectors,
IOSUHAX_usb_clearStatus,
IOSUHAX_usb_shutdown
};
/***************************************************************************
* Copyright (C) 2016
* by Dimok
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any
* damages arising from the use of this software.
*
* Permission is granted to anyone to use this software for any
* purpose, including commercial applications, and to alter it and
* redistribute it freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you
* must not claim that you wrote the original software. If you use
* this software in a product, an acknowledgment in the product
* documentation would be appreciated but is not required.
*
* 2. Altered source versions must be plainly marked as such, and
* must not be misrepresented as being the original software.
*
* 3. This notice may not be removed or altered from any source
* distribution.
***************************************************************************/
#include <string.h>
#include <malloc.h>
#include "iosuhax.h"
#include "iosuhax_disc_interface.h"
#define FSA_REF_SD 0x01
#define FSA_REF_USB 0x02
static int initialized = 0;
static int fsaFdSd = 0;
static int fsaFdUsb = 0;
static int sdioFd = 0;
static int usbFd = 0;
static void IOSUHAX_disc_io_initialize(void)
{
if(initialized == 0)
{
initialized = 1;
fsaFdSd = -1;
fsaFdUsb = -1;
sdioFd = -1;
usbFd = -1;
}
}
static bool IOSUHAX_disc_io_fsa_open(int fsaFd)
{
IOSUHAX_disc_io_initialize();
if(IOSUHAX_Open(NULL) < 0)
return false;
if(fsaFd == FSA_REF_SD)
{
if(fsaFdSd < 0)
{
fsaFdSd = IOSUHAX_FSA_Open();
}
if(fsaFdSd >= 0)
return true;
}
else if(fsaFd == FSA_REF_USB)
{
if(fsaFdUsb < 0)
{
fsaFdUsb = IOSUHAX_FSA_Open();
}
if(fsaFdUsb >= 0)
return true;
}
return false;
}
static void IOSUHAX_disc_io_fsa_close(int fsaFd)
{
if(fsaFd == FSA_REF_SD)
{
if(fsaFdSd >= 0)
{
IOSUHAX_FSA_Close(fsaFdSd);
fsaFdSd = -1;
}
}
else if(fsaFd == FSA_REF_USB)
{
if(fsaFdUsb >= 0)
{
IOSUHAX_FSA_Close(fsaFdUsb);
fsaFdUsb = -1;
}
}
}
static bool IOSUHAX_sdio_startup(void)
{
if(!IOSUHAX_disc_io_fsa_open(FSA_REF_SD))
return false;
if(sdioFd < 0)
{
int res = IOSUHAX_FSA_RawOpen(fsaFdSd, "/dev/sdcard01", &sdioFd);
if(res < 0)
{
IOSUHAX_disc_io_fsa_close(FSA_REF_SD);
sdioFd = -1;
}
}
return (sdioFd >= 0);
}
static bool IOSUHAX_sdio_isInserted(void)
{
//! TODO: check for SD card inserted with IOSUHAX_FSA_GetDeviceInfo()
return initialized && (fsaFdSd >= 0) && (sdioFd >= 0);
}
static bool IOSUHAX_sdio_clearStatus(void)
{
return true;
}
static bool IOSUHAX_sdio_shutdown(void)
{
if(!IOSUHAX_sdio_isInserted())
return false;
IOSUHAX_FSA_RawClose(fsaFdSd, sdioFd);
IOSUHAX_disc_io_fsa_close(FSA_REF_SD);
sdioFd = -1;
return true;
}
static bool IOSUHAX_sdio_readSectors(uint32_t sector, uint32_t numSectors, void* buffer)
{
if(!IOSUHAX_sdio_isInserted())
return false;
int res = IOSUHAX_FSA_RawRead(fsaFdSd, buffer, 512, numSectors, sector, sdioFd);
if(res < 0)
{
return false;
}
return true;
}
static bool IOSUHAX_sdio_writeSectors(uint32_t sector, uint32_t numSectors, const void* buffer)
{
if(!IOSUHAX_sdio_isInserted())
return false;
int res = IOSUHAX_FSA_RawWrite(fsaFdSd, buffer, 512, numSectors, sector, sdioFd);
if(res < 0)
{
return false;
}
return true;
}
const DISC_INTERFACE IOSUHAX_sdio_disc_interface =
{
DEVICE_TYPE_WII_U_SD,
FEATURE_MEDIUM_CANREAD | FEATURE_MEDIUM_CANWRITE | FEATURE_WII_U_SD,
IOSUHAX_sdio_startup,
IOSUHAX_sdio_isInserted,
IOSUHAX_sdio_readSectors,
IOSUHAX_sdio_writeSectors,
IOSUHAX_sdio_clearStatus,
IOSUHAX_sdio_shutdown
};
static bool IOSUHAX_usb_startup(void)
{
if(!IOSUHAX_disc_io_fsa_open(FSA_REF_USB))
return false;
if(usbFd < 0)
{
int res = IOSUHAX_FSA_RawOpen(fsaFdUsb, "/dev/usb01", &usbFd);
if(res < 0)
{
res = IOSUHAX_FSA_RawOpen(fsaFdUsb, "/dev/usb02", &usbFd);
if(res < 0)
{
IOSUHAX_disc_io_fsa_close(FSA_REF_USB);
usbFd = -1;
}
}
}
return (usbFd >= 0);
}
static bool IOSUHAX_usb_isInserted(void)
{
return initialized && (fsaFdUsb >= 0) && (usbFd >= 0);
}
static bool IOSUHAX_usb_clearStatus(void)
{
return true;
}
static bool IOSUHAX_usb_shutdown(void)
{
if(!IOSUHAX_usb_isInserted())
return false;
IOSUHAX_FSA_RawClose(fsaFdUsb, usbFd);
IOSUHAX_disc_io_fsa_close(FSA_REF_USB);
usbFd = -1;
return true;
}
static bool IOSUHAX_usb_readSectors(uint32_t sector, uint32_t numSectors, void* buffer)
{
if(!IOSUHAX_usb_isInserted())
return false;
int res = IOSUHAX_FSA_RawRead(fsaFdUsb, buffer, 512, numSectors, sector, usbFd);
if(res < 0)
{
return false;
}
return true;
}
static bool IOSUHAX_usb_writeSectors(uint32_t sector, uint32_t numSectors, const void* buffer)
{
if(!IOSUHAX_usb_isInserted())
return false;
int res = IOSUHAX_FSA_RawWrite(fsaFdUsb, buffer, 512, numSectors, sector, usbFd);
if(res < 0)
{
return false;
}
return true;
}
const DISC_INTERFACE IOSUHAX_usb_disc_interface =
{
DEVICE_TYPE_WII_U_USB,
FEATURE_MEDIUM_CANREAD | FEATURE_MEDIUM_CANWRITE | FEATURE_WII_U_USB,
IOSUHAX_usb_startup,
IOSUHAX_usb_isInserted,
IOSUHAX_usb_readSectors,
IOSUHAX_usb_writeSectors,
IOSUHAX_usb_clearStatus,
IOSUHAX_usb_shutdown
};
+28
View File
@@ -0,0 +1,28 @@
#ifndef __OS_FUNCTIONS_H_
#define __OS_FUNCTIONS_H_
#ifdef __cplusplus
extern "C" {
#endif
#define OS_MUTEX_SIZE 44
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! Mutex functions
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
extern void OSInitMutex(void* mutex);
extern void OSLockMutex(void* mutex);
extern void OSUnlockMutex(void* mutex);
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! IOS function
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
extern int IOS_Ioctl(int fd, unsigned int request, void *input_buffer,unsigned int input_buffer_len, void *output_buffer, unsigned int output_buffer_len);
extern int IOS_Open(char *path, unsigned int mode);
extern int IOS_Close(int fd);
#ifdef __cplusplus
}
#endif
#endif // __OS_FUNCTIONS_H_
+82 -60
View File
@@ -43,6 +43,7 @@ extern const SceGxmProgram texture_tint_f_gxp;
static vita2d_video_mode_data video_mode_data;
static vita2d_video_mode video_mode_initial;
static SceGxmMultisampleMode current_msaa = SCE_GXM_MULTISAMPLE_4X;
static int pgf_module_was_loaded = 0;
@@ -157,6 +158,8 @@ vita2d_video_mode_data vita2d_get_video_mode_data(){
}
static int vita2d_switch_video_mode(vita2d_video_mode video_mode){
int i,x,y,err;
if(video_mode > video_mode_initial)
return -1;
switch (video_mode)
@@ -164,7 +167,7 @@ static int vita2d_switch_video_mode(vita2d_video_mode video_mode){
case VITA2D_VIDEO_MODE_960x544:
video_mode_data.width = 960;
video_mode_data.height = 544;
video_mode_data.stride = 1280;
video_mode_data.stride = 960;
break;
case VITA2D_VIDEO_MODE_1280x720:
@@ -181,6 +184,65 @@ static int vita2d_switch_video_mode(vita2d_video_mode video_mode){
clip_rect_x_max = video_mode_data.width;
clip_rect_y_max = video_mode_data.height;
if(renderTarget != NULL){
sceGxmDestroyRenderTarget(renderTarget);
for (i = 0; i < DISPLAY_BUFFER_COUNT; i++) {
// clear the buffer then deallocate
memset(displayBufferData[i], 0, video_mode_data.height*video_mode_data.stride*4);
gpu_free(displayBufferUid[i]);
}
}
// allocate memory and sync objects for display buffers
for (i = 0; i < DISPLAY_BUFFER_COUNT; i++) {
// allocate memory for display
displayBufferData[i] = gpu_alloc(
SCE_KERNEL_MEMBLOCK_TYPE_USER_CDRAM_RW,
4*video_mode_data.stride*video_mode_data.height,
SCE_GXM_COLOR_SURFACE_ALIGNMENT,
SCE_GXM_MEMORY_ATTRIB_READ | SCE_GXM_MEMORY_ATTRIB_WRITE,
&displayBufferUid[i]);
// memset the buffer to black
for (y = 0; y < video_mode_data.height; y++) {
unsigned int *row = (unsigned int *)displayBufferData[i] + y*video_mode_data.stride;
for (x = 0; x < video_mode_data.width; x++) {
row[x] = 0xff000000;
}
}
// initialize a color surface for this display buffer
err = sceGxmColorSurfaceInit(
&displaySurface[i],
DISPLAY_COLOR_FORMAT,
SCE_GXM_COLOR_SURFACE_LINEAR,
(current_msaa == SCE_GXM_MULTISAMPLE_NONE) ? SCE_GXM_COLOR_SURFACE_SCALE_NONE : SCE_GXM_COLOR_SURFACE_SCALE_MSAA_DOWNSCALE,
SCE_GXM_OUTPUT_REGISTER_SIZE_32BIT,
video_mode_data.width,
video_mode_data.height,
video_mode_data.stride,
displayBufferData[i]);
}
// set up parameters
SceGxmRenderTargetParams renderTargetParams;
memset(&renderTargetParams, 0, sizeof(SceGxmRenderTargetParams));
renderTargetParams.flags = 0;
renderTargetParams.width = video_mode_data.width;
renderTargetParams.height = video_mode_data.height;
renderTargetParams.scenesPerFrame = 1;
renderTargetParams.multisampleMode = current_msaa;
renderTargetParams.multisampleLocations = 0;
renderTargetParams.driverMemBlock = -1; // Invalid UID
// create the render target
err = sceGxmCreateRenderTarget(&renderTargetParams, &renderTarget);
VITA2D_DEBUG("sceGxmCreateRenderTarget(): 0x%08X\n", err);
matrix_init_orthographic(_vita2d_ortho_matrix, 0.0f, video_mode_data.width, video_mode_data.height, 0.0f, 0.0f, 1.0f);
return 0;
@@ -198,7 +260,7 @@ static void display_callback(const void *callback_data)
framebuf.pixelformat = DISPLAY_PIXEL_FORMAT;
framebuf.width = video_mode_data.width;
framebuf.height = video_mode_data.height;
if(sceDisplaySetFrameBuf(&framebuf, SCE_DISPLAY_SETBUF_NEXTFRAME)<0){
if(sceDisplaySetFrameBuf(&framebuf, SCE_DISPLAY_SETBUF_NEXTFRAME) == SCE_DISPLAY_ERROR_INVALID_RESOLUTION){
if(video_mode_initial)
vita2d_switch_video_mode(VITA2D_VIDEO_MODE_960x544);
}
@@ -258,7 +320,7 @@ static void _vita2d_make_fragment_programs(vita2d_fragment_programs *out,
static int vita2d_init_internal(unsigned int temp_pool_size, SceGxmMultisampleMode msaa, vita2d_video_mode video_mode)
{
int err;
unsigned int i, x, y;
unsigned int i;
UNUSED(err);
if (vita2d_initialized) {
@@ -267,12 +329,7 @@ static int vita2d_init_internal(unsigned int temp_pool_size, SceGxmMultisampleMo
}
video_mode_initial = video_mode;
err = vita2d_switch_video_mode(video_mode);
if(err<0){
VITA2D_DEBUG("vita2d_switch_video_mode(): 0x%08X\n", err);
return err;
}
current_msaa = msaa;
SceGxmInitializeParams initializeParams;
memset(&initializeParams, 0, sizeof(SceGxmInitializeParams));
@@ -329,51 +386,18 @@ static int vita2d_init_internal(unsigned int temp_pool_size, SceGxmMultisampleMo
err = sceGxmCreateContext(&contextParams, &_vita2d_context);
VITA2D_DEBUG("sceGxmCreateContext(): 0x%08X\n", err);
// set up parameters
SceGxmRenderTargetParams renderTargetParams;
memset(&renderTargetParams, 0, sizeof(SceGxmRenderTargetParams));
renderTargetParams.flags = 0;
renderTargetParams.width = video_mode_data.width;
renderTargetParams.height = video_mode_data.height;
renderTargetParams.scenesPerFrame = 1;
renderTargetParams.multisampleMode = msaa;
renderTargetParams.multisampleLocations = 0;
renderTargetParams.driverMemBlock = -1; // Invalid UID
err = vita2d_switch_video_mode(video_mode);
if(err<0){
VITA2D_DEBUG("vita2d_switch_video_mode(): 0x%08X\n", err);
return err;
}
// create the render target
err = sceGxmCreateRenderTarget(&renderTargetParams, &renderTarget);
VITA2D_DEBUG("sceGxmCreateRenderTarget(): 0x%08X\n", err);
vita2d_display_data displayData;
displayData.address = displayBufferData[0];
display_callback(&displayData);
// allocate memory and sync objects for display buffers
for (i = 0; i < DISPLAY_BUFFER_COUNT; i++) {
// allocate memory for display
displayBufferData[i] = gpu_alloc(
SCE_KERNEL_MEMBLOCK_TYPE_USER_CDRAM_RW,
4*video_mode_data.stride*video_mode_data.height,
SCE_GXM_COLOR_SURFACE_ALIGNMENT,
SCE_GXM_MEMORY_ATTRIB_READ | SCE_GXM_MEMORY_ATTRIB_WRITE,
&displayBufferUid[i]);
// memset the buffer to black
for (y = 0; y < video_mode_data.height; y++) {
unsigned int *row = (unsigned int *)displayBufferData[i] + y*video_mode_data.stride;
for (x = 0; x < video_mode_data.width; x++) {
row[x] = 0xff000000;
}
}
// initialize a color surface for this display buffer
err = sceGxmColorSurfaceInit(
&displaySurface[i],
DISPLAY_COLOR_FORMAT,
SCE_GXM_COLOR_SURFACE_LINEAR,
(msaa == SCE_GXM_MULTISAMPLE_NONE) ? SCE_GXM_COLOR_SURFACE_SCALE_NONE : SCE_GXM_COLOR_SURFACE_SCALE_MSAA_DOWNSCALE,
SCE_GXM_OUTPUT_REGISTER_SIZE_32BIT,
video_mode_data.width,
video_mode_data.height,
video_mode_data.stride,
displayBufferData[i]);
// create a sync object that we will associate with this buffer
err = sceGxmSyncObjectCreate(&displayBufferSync[i]);
}
@@ -383,11 +407,11 @@ static int vita2d_init_internal(unsigned int temp_pool_size, SceGxmMultisampleMo
const unsigned int alignedHeight = ALIGN(video_mode_data.height, SCE_GXM_TILE_SIZEY);
unsigned int sampleCount = alignedWidth*alignedHeight;
unsigned int depthStrideInSamples = alignedWidth;
if (msaa == SCE_GXM_MULTISAMPLE_4X) {
if (current_msaa == SCE_GXM_MULTISAMPLE_4X) {
// samples increase in X and Y
sampleCount *= 4;
depthStrideInSamples *= 2;
} else if (msaa == SCE_GXM_MULTISAMPLE_2X) {
} else if (current_msaa == SCE_GXM_MULTISAMPLE_2X) {
// samples increase in Y only
sampleCount *= 2;
}
@@ -572,7 +596,7 @@ static int vita2d_init_internal(unsigned int temp_pool_size, SceGxmMultisampleMo
shaderPatcher,
clearFragmentProgramId,
SCE_GXM_OUTPUT_REGISTER_FORMAT_UCHAR4,
msaa,
current_msaa,
NULL,
clearVertexProgramGxp,
&clearFragmentProgram);
@@ -731,8 +755,8 @@ static int vita2d_init_internal(unsigned int temp_pool_size, SceGxmMultisampleMo
VITA2D_DEBUG("texture sceGxmShaderPatcherCreateVertexProgram(): 0x%08X\n", err);
// Create variations of the fragment program based on blending mode
_vita2d_make_fragment_programs(&_vita2d_fragmentPrograms.blend_mode_normal, &blend_info, msaa);
_vita2d_make_fragment_programs(&_vita2d_fragmentPrograms.blend_mode_add, &blend_info_add, msaa);
_vita2d_make_fragment_programs(&_vita2d_fragmentPrograms.blend_mode_normal, &blend_info, current_msaa);
_vita2d_make_fragment_programs(&_vita2d_fragmentPrograms.blend_mode_add, &blend_info_add, current_msaa);
// Default to "normal" blending mode (non-additive)
vita2d_set_blend_mode_add(0);
@@ -770,10 +794,6 @@ static int vita2d_init_internal(unsigned int temp_pool_size, SceGxmMultisampleMo
if (pgf_module_was_loaded != SCE_SYSMODULE_LOADED)
sceSysmoduleLoadModule(SCE_SYSMODULE_PGF);
vita2d_display_data displayData;
displayData.address = displayBufferData[backBufferIndex];
display_callback(&displayData);
vita2d_initialized = 1;
return 1;
}
@@ -795,7 +815,8 @@ int vita2d_init_advanced_with_msaa(unsigned int temp_pool_size, SceGxmMultisampl
void vita2d_wait_rendering_done()
{
sceGxmFinish(_vita2d_context);
if(vita2d_initialized)
sceGxmFinish(_vita2d_context);
}
int vita2d_fini()
@@ -857,6 +878,7 @@ int vita2d_fini()
// destroy the render target
sceGxmDestroyRenderTarget(renderTarget);
renderTarget = NULL;
// destroy the _vita2d_context
sceGxmDestroyContext(_vita2d_context);
+4 -2
View File
@@ -1511,7 +1511,8 @@ static uInt longest_match(deflate_state *s, IPos cur_match)
* are always equal when the other bytes match, given that
* the hash keys are equal and that HASH_BITS >= 8.
*/
scan += 2, match++;
scan += 2;
match++;
Assert(*scan == *match, "match[2]?");
/* We check for insufficient lookahead only every 8th comparison;
@@ -1585,7 +1586,8 @@ static uInt longest_match(s, cur_match)
* are always equal when the other bytes match, given that
* the hash keys are equal and that HASH_BITS >= 8.
*/
scan += 2, match += 2;
scan += 2;
match += 2;
Assert(*scan == *match, "match[2]?");
/* We check for insufficient lookahead only every 8th comparison;
+31 -11
View File
@@ -262,7 +262,11 @@ static void gen_bitlen(deflate_state *s, tree_desc *desc)
for (h = s->heap_max+1; h < HEAP_SIZE; h++) {
n = s->heap[h];
bits = tree[tree[n].Dad].Len + 1;
if (bits > max_length) bits = max_length, overflow++;
if (bits > max_length)
{
bits = max_length;
overflow++;
}
tree[n].Len = (ush)bits;
/* We overwrite tree[n].Dad which is no longer needed */
@@ -373,7 +377,8 @@ static void build_tree(deflate_state *s, tree_desc *desc)
* heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].
* heap[0] is not used.
*/
s->heap_len = 0, s->heap_max = HEAP_SIZE;
s->heap_len = 0;
s->heap_max = HEAP_SIZE;
for (n = 0; n < elems; n++) {
if (tree[n].Freq != 0) {
@@ -456,7 +461,11 @@ static void scan_tree (deflate_state *s, ct_data *tree, int max_code)
int max_count = 7; /* max repeat count */
int min_count = 4; /* min repeat count */
if (nextlen == 0) max_count = 138, min_count = 3;
if (nextlen == 0)
{
max_count = 138;
min_count = 3;
}
tree[max_code+1].Len = (ush)0xffff; /* guard */
for (n = 0; n <= max_code; n++) {
@@ -475,11 +484,14 @@ static void scan_tree (deflate_state *s, ct_data *tree, int max_code)
}
count = 0; prevlen = curlen;
if (nextlen == 0) {
max_count = 138, min_count = 3;
max_count = 138;
min_count = 3;
} else if (curlen == nextlen) {
max_count = 6, min_count = 3;
max_count = 6;
min_count = 3;
} else {
max_count = 7, min_count = 4;
max_count = 7;
min_count = 4;
}
}
}
@@ -499,7 +511,11 @@ static void send_tree (deflate_state *s, ct_data *tree, int max_code)
int min_count = 4; /* min repeat count */
/* tree[max_code+1].Len = -1; */ /* guard already set */
if (nextlen == 0) max_count = 138, min_count = 3;
if (nextlen == 0)
{
max_count = 138;
min_count = 3;
}
for (n = 0; n <= max_code; n++) {
curlen = nextlen; nextlen = tree[n+1].Len;
@@ -523,11 +539,14 @@ static void send_tree (deflate_state *s, ct_data *tree, int max_code)
}
count = 0; prevlen = curlen;
if (nextlen == 0) {
max_count = 138, min_count = 3;
max_count = 138;
min_count = 3;
} else if (curlen == nextlen) {
max_count = 6, min_count = 3;
max_count = 6;
min_count = 3;
} else {
max_count = 7, min_count = 4;
max_count = 7;
min_count = 4;
}
}
}
@@ -842,7 +861,8 @@ void ZLIB_INTERNAL _tr_flush_block(deflate_state *s, charf *buf, ulg stored_len,
register unsigned res = 0;
do {
res |= codes & 1;
codes >>= 1, res <<= 1;
codes >>= 1;
res <<= 1;
} while (--len > 0);
return res >> 1;
}
-17
View File
@@ -1,17 +0,0 @@
# Auto detect text files and perform LF normalization
* text=auto
# Custom for Visual Studio
*.cs diff=csharp
# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
-26
View File
@@ -1,26 +0,0 @@
*.o
*.a
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msm
*.msp
# Windows shortcuts
*.lnk
# =========================
# Operating System Files
# =========================
-29
View File
@@ -1,29 +0,0 @@
TARGET := libmathneon
SOURCES := source
LIBS = -lc -lm -lSceGxm_stub -lSceDisplay_stub
CFILES := $(foreach dir,$(SOURCES), $(wildcard $(dir)/*.c))
CGFILES := $(foreach dir,$(SHADERS), $(wildcard $(dir)/*.cg))
HEADERS := $(CGFILES:.cg=.h)
OBJS := $(CFILES:.c=.o)
PREFIX = arm-vita-eabi
CC = $(PREFIX)-gcc
AR = $(PREFIX)-gcc-ar
CFLAGS = -g -Wl,-q -O2 -ffast-math -mtune=cortex-a9 -mfpu=neon -flto -ftree-vectorize
ASFLAGS = $(CFLAGS)
all: $(TARGET).a
$(TARGET).a: $(OBJS)
$(AR) -rc $@ $^
clean:
@rm -rf $(TARGET).a $(TARGET).elf $(OBJS)
install: $(TARGET).a
@mkdir -p $(VITASDK)/$(PREFIX)/lib/
cp $(TARGET).a $(VITASDK)/$(PREFIX)/lib/
@mkdir -p $(VITASDK)/$(PREFIX)/include/
cp source/math_neon.h $(VITASDK)/$(PREFIX)/include/
Loaded 100 of 631 files, more files were not shown because too many files have changed in this diff. Show more