Compare commits

...
229 Commits
Author SHA1 Message Date
Autechre 36802f7133 Update CHANGES.md 2020-05-06 02:13:22 +02:00
Autechre ca782bd015 Update CHANGES.md 2020-05-06 02:13:01 +02:00
Autechre 7b3aaa6bbb Merge pull request #10570 from MrHuu/patch-7
(3DS) re-Enable 7z support
2020-05-05 18:02:34 +02:00
MrHuu 16d12e804c (3DS) re-Enable 7z support
Adds missing HAVE_7ZIP definition for griffin builds.

I have no issues with this. Browsing and loading .7z files works as it should.
Unless there's a specific reason this was removed, it can be enabled.
2020-05-05 12:25:13 +02:00
Autechre 25be09acd3 Merge pull request #10564 from jdgleaver/3ds-filter-fix
(3DS) Disable video filter if upscaled resolution exceeds hardware limits
2020-05-04 19:28:42 +02:00
Autechre 621e220177 Merge pull request #10569 from jdgleaver/3ds-font-fix
(3DS) Fix font driver
2020-05-04 19:28:10 +02:00
jdgleaver a305a48a11 (3DS) Fix font driver 2020-05-04 16:57:44 +01:00
hizzlekizzle 877a7f8d6c Merge pull request #10563 from phcoder/radir
psl1ght: Fix cores info path
2020-05-04 09:54:36 -05:00
jdgleaver 702bc18128 (3DS) Disable video filter if upscaled resolution exceeds hardware limits 2020-05-04 11:52:53 +01:00
Vladimir Serbinenko afe68f9cd8 psl1ght: Fix cores info path 2020-05-04 11:43:47 +02:00
Autechre 3ecde62930 Merge pull request #10550 from guoyunhe/unify-show-hide
unify "show/hide" -> "show or hide"
2020-05-01 21:17:01 +02:00
Guo Yunhe ab7c2f23cf unify "show/hide" -> "show or hide" 2020-05-01 21:17:52 +03:00
Autechre 0554e3cb3d Merge pull request #10549 from Alcaro/patch-4
Fix copypasted typo
2020-05-01 18:42:06 +02:00
Alcaro c9dcc18fa4 Fix copypasted typo 2020-05-01 17:46:18 +02:00
Autechre 43c521de44 Merge pull request #10548 from jdgleaver/qt-volume-settings
(Qt) Add 'audio mixer volume' and 'mute when fast-forwarding' settings options
2020-05-01 17:30:05 +02:00
jdgleaver 4ef5eb1eb2 (Qt) Add 'audio mixer volume' and 'mute when fast-forwarding' settings options 2020-05-01 13:58:20 +01:00
Autechre 1a07476138 Merge pull request #10547 from jdgleaver/fast-forward-mute
Add option to mute audio when fast-forwarding
2020-05-01 14:11:31 +02:00
jdgleaver 3f2ba2e791 Add option to mute audio when fast-forwarding 2020-05-01 12:19:31 +01:00
hizzlekizzle 9dc963e15a Merge pull request #10544 from jdgleaver/glcore-shader-fix
(glcore/slang) Set filter and wrap mode correctly when intialising shader textures
2020-04-30 15:45:45 -05:00
Autechre fb28c79e13 Merge pull request #10545 from aschain/maylashN64-fix
Fix for mayflash N64 adapter
2020-04-30 20:09:45 +02:00
A Schain 1e751d00ea In case last hatswitch does not match cookie
For the mayflash N64 adapter, I was getting a BAD EXC ADDRESS (in mac OS 10.13) for this line (tmp was NULL). Retroarch would crash in the gui if I pressed a button from the DPAD on controller 2. With this change, it no longer crashes in the gui and still registers the button push.
2020-04-30 13:27:44 -04:00
jdgleaver 548c5dc925 (glcore/slang) Set filter and wrap mode correctly when intialising shader textures 2020-04-30 17:04:02 +01:00
Autechre 9c100ded3a Merge pull request #10535 from jdgleaver/ozone-metadata-toggle
(Ozone) Enable second thumbnail/content metadata toggle using RetroPad 'select'
2020-04-30 15:52:51 +02:00
Autechre 5160f35bd8 Merge pull request #10531 from altiereslima/master
Update msg_hash_pt_br.h
2020-04-30 15:00:53 +02:00
Autechre 34d3641d0a Merge pull request #10534 from ShadowOne333/patch-2
Update and fix meta.xml file for the WiiU release
2020-04-30 15:00:38 +02:00
Autechre 4198a0d3a8 Merge pull request #10536 from karlforshaw/master
Advise against using -s and -S variables on the command line.
2020-04-30 14:59:46 +02:00
Autechre 8f0ef54455 Merge pull request #10539 from trioan/buildfix
MSVC Buildfix
2020-04-30 14:19:23 +02:00
Autechre e92331cf1f Merge pull request #10542 from jdgleaver/screenshot-fix
(task_screenshot) Fix heap-use-after-free error when widgets are disabled
2020-04-30 14:17:21 +02:00
jdgleaver 3a3c4f60bf (task_screenshot) Fix heap-use-after-free error when widgets are disabled 2020-04-30 11:25:53 +01:00
jdgleaver 19a8a815f0 (Ozone) Hide thumbnail button hints when viewing file browser lists 2020-04-30 09:57:44 +01:00
trioan 35bf716766 (MSVC 2012) Buildfix 2020-04-29 19:45:48 -05:00
trioan 3883616d93 (MSVC 2013) Buildfix 2020-04-29 19:45:32 -05:00
trioan de0b34aa0a (MSVC 2015) Buildfix 2020-04-29 22:59:20 +00:00
trioan e14fc1b087 (MSVC 2017) Buildfix 2020-04-29 22:55:22 +00:00
hizzlekizzle 53d07b30cc Merge pull request #10515 from im-4-potato/master
US Translation: Style changes and more cleanup
2020-04-29 17:49:28 -05:00
jdgleaver 0b294faa71 (Ozone) Refactor footer display 2020-04-29 17:54:49 +01:00
twinaphex d995fa045a (GDI) Get rid of unused functions 2020-04-29 18:40:48 +02:00
Karl Forshaw 5ed60cde04 Advise against using -s and -S variables on the command line.
Signed-off-by: Karl Forshaw <[email protected]>
2020-04-29 13:39:12 +01:00
twinaphex bb27496e2e Prevent NULL pointer dereference 2020-04-29 14:38:11 +02:00
twinaphex 9b8c596057 (GL Core) Buildfix for video context drivers that dont
implement this callback
2020-04-29 13:50:21 +02:00
jdgleaver 30555f8132 (Ozone) Enable second thumbnail/content metadata toggle using RetroPad 'select' 2020-04-29 12:29:42 +01:00
Shadow a319db9119 Typo fix
Typo fix
2020-04-28 21:36:13 -07:00
Shadow b5eabf633a Update and fix meta.xml file for the WiiU release
This change makes it so the information from the meta.xml file parsed for the WiiU's Homebrew Launcher is displayed properly.
2020-04-28 21:20:30 -07:00
altiereslima a27912b816 Update msg_hash_pt_br.h 2020-04-28 18:13:47 -03:00
twinaphex 156d3629e6 libretro-common Update 2020-04-28 16:26:26 +02:00
twinaphex 4f9a3f6813 Update 2020-04-28 16:25:00 +02:00
Autechre 3b6b067fe5 Merge pull request #10530 from jdgleaver/compress-states-default
Enable save state compression by default
2020-04-28 12:53:26 +02:00
jdgleaver 1ac544b612 Enable save state compression by default 2020-04-28 11:37:16 +01:00
Autechre e3a78e0ecf Merge pull request #10529 from jdgleaver/ozone-touch-fix
(Ozone) Fix undefined behaviour when using touch screen to change input remaps
2020-04-28 12:02:28 +02:00
jdgleaver 58e6ca9ad4 (Ozone) Fix undefined behaviour when using touch screen to change input remaps 2020-04-28 10:46:19 +01:00
im-4-potato 0c40b2b3ef Merge remote-tracking branch 'upstream/master' 2020-04-27 14:55:08 -07:00
Autechre 6642868b86 Merge pull request #10518 from guoyunhe/patch-5
Unify mixer settings strings
2020-04-27 23:06:13 +02:00
twinaphex 14c63e0cd5 Bump version number 2020-04-27 23:05:30 +02:00
im-4-potato fcb4933671 US Translation: A few fixes for Title Case 2020-04-27 13:43:55 -07:00
im-4-potato 571d9708e1 US Translation: Sync with other changes 2020-04-27 13:18:30 -07:00
Autechre bd319de5cf Merge pull request #10517 from guoyunhe/patch-4
Force Aspect -> Force Aspect Ratio
2020-04-27 20:30:13 +02:00
Autechre 78a67bd775 Merge pull request #10516 from guoyunhe/patch-3
Framerate -> Refresh Rate
2020-04-27 20:29:57 +02:00
Autechre 3744f2454c Merge pull request #10519 from julianaito/master
Remove OpenBSD/macppc specific quirk
2020-04-27 20:29:40 +02:00
Autechre 39aae2872d Merge pull request #10525 from libretro/set_gamepad_bitwise_fix
Added small fix to set_gamepad_input_override bit logic.
2020-04-27 20:28:54 +02:00
Autechre e9a35c1cab Merge pull request #10524 from jdgleaver/config-write-on-change
Only write config files to disk when parameters change
2020-04-27 19:35:55 +02:00
Barry Rowe d87fa1799e Added small fix to set_gamepad_input_override bit logic. 2020-04-27 10:16:11 -07:00
jdgleaver 9eb8472805 Only write config files to disk when parameters change 2020-04-27 17:06:35 +01:00
im-4-potato 6921ca44a7 US Translation: More Fixes 2020-04-26 17:07:06 -07:00
im-4-potato 7b4a4d1da4 US Translation: More Fixes 2020-04-26 17:00:59 -07:00
im-4-potato 60cfbce48b US Translation: More fixes 2020-04-26 14:51:20 -07:00
im-4-potato 3e3a84a602 US Translation: More fixes 2020-04-26 12:36:47 -07:00
Charlène Wendling 0e4857c8f6 Remove OpenBSD/macppc specific quirk
OpenBSD/macppc moved to clang and __mftb() is not available anymore,
leading to undefined references errors. It's fixed with #10383 already.
2020-04-26 14:13:59 +02:00
im-4-potato 68021903c9 US Translation: More minor fixes 2020-04-26 03:15:24 -07:00
im-4-potato f803ee2c0b US Translation: A few more "save state" fixes 2020-04-26 03:00:16 -07:00
Guo Yunhe c40f2ae5bb Unify mixer settings strings 2020-04-26 12:14:57 +03:00
Guo Yunhe 8d71714446 Update msg_hash_us.h 2020-04-26 11:36:18 +03:00
Guo Yunhe cc6a5a6077 Update msg_hash_us.h 2020-04-26 09:37:34 +03:00
Guo Yunhe 004588d627 Update msg_hash_us.h 2020-04-26 09:30:49 +03:00
Guo Yunhe 49d0045434 Force Aspect -> Force Aspect Ratio 2020-04-26 09:24:11 +03:00
Guo Yunhe f5c7b1bf73 Framerate -> Refresh Rate
Based on the key and context, here should be `refresh rate` instead of `frame rate`.
2020-04-26 08:55:48 +03:00
im-4-potato 6972492fb4 US Translation: Changes tabs back to spaces 2020-04-25 20:52:10 -07:00
im-4-potato 311a7d40d2 US Translation: Style changes and more cleanup 2020-04-25 20:40:29 -07:00
twinaphex c88ffa56ff (Vulkan) Fix crash 2020-04-25 17:44:13 +02:00
Autechre 05b1785f24 Merge pull request #10511 from WeedyWeedSmoker/International-translations-fix-formatting
International: Fix formatting for all languages & Remove untranslated strings
2020-04-25 16:15:56 +02:00
Weedy Weed Smoker 9b99393c20 International: Fix 2020-04-25 20:43:42 +07:00
Weedy Weed Smoker 38c70d5705 International: Remove untranslated strings + fixes 2020-04-25 19:26:25 +07:00
Weedy Weed Smoker 8def289271 International: Formatting fix for all languages 2020-04-25 19:24:22 +07:00
Autechre 88abadce43 Merge pull request #10505 from WeedyWeedSmoker/Japanese-translation-update
Japanese: Fix multi-line strings
2020-04-24 20:44:11 +02:00
Weedy Weed Smoker 7f7680da6e Japanese: Remove extraneous spaces 2020-04-25 00:45:23 +07:00
Weedy Weed Smoker 7b71f22e85 Japanese: Fix multi-line strings 2020-04-25 00:16:36 +07:00
Autechre c4d6c9541c Merge pull request #10504 from altiereslima/master
Update msg_hash_pt_br.h
2020-04-24 07:50:09 +02:00
altiereslima 5a468c8b3e Update msg_hash_pt_br.h 2020-04-23 21:37:01 -03:00
altiereslima 12e68bf477 Update msg_hash_pt_br.h 2020-04-23 21:19:52 -03:00
Autechre 1040e57c94 Merge pull request #10498 from WeedyWeedSmoker/French-translation-update
French: Add optional playlist compression
2020-04-24 01:10:59 +02:00
Autechre b18219687c Merge pull request #10500 from jdgleaver/vulkan-stats-fix
(Vulkan) Fix display of statistics text
2020-04-24 01:10:52 +02:00
Autechre e6fcf73a1e Merge pull request #10501 from maksun/patch-1
[Retroarch] Tiny glitch when displaying version
2020-04-24 01:10:43 +02:00
maksun b92ac7d439 [Retroarch] Tiny issue when displaying version
Just two lines to fix #10445
2020-04-23 19:48:51 +02:00
jdgleaver 0e3026d41f (Vulkan) Fix display of statistics text 2020-04-23 17:48:15 +01:00
Weedy Weed Smoker 3346124d21 French: Add optional playlist compression 2020-04-23 19:41:20 +07:00
Autechre 89c405b196 Merge pull request #10487 from jdgleaver/playlist-compression
Add optional playlist compression
2020-04-23 13:30:58 +02:00
jdgleaver 69305fda96 (playlist.c) Remove unused variable 2020-04-23 12:04:08 +01:00
jdgleaver 8cf629b3c2 (playlist.c) Minor clean-ups 2020-04-23 11:55:17 +01:00
jdgleaver 25c6499c5d (playlist.c) Omit whitespace when writing compressed JSON format playlists 2020-04-23 10:49:16 +01:00
twinaphex bdf9969c7e Update libretro-common 2020-04-23 07:20:06 +02:00
Autechre 62c2842c86 Merge pull request #10478 from WeedyWeedSmoker/French-translation-update
French: Add optional save (SRAM) file compression, Clean up and organize FR translation & Formatting
2020-04-23 04:23:23 +02:00
Autechre e8fe4e26ff Merge pull request #10497 from yoshisuga/ios_tvos_audio_session_fix
[iOS] [tvOS] Fix audio getting cut off on interruption
2020-04-23 04:18:13 +02:00
Autechre 1085e553d5 Merge pull request #10496 from altiereslima/master
Update Portuguese Brazilian Translation
2020-04-23 02:43:08 +02:00
altiereslima e38808b17c Update Portuguese Brazilian Translation 2020-04-22 20:32:09 -03:00
Autechre 21f15d5cbd Merge pull request #10490 from phcoder/msb
Remove manual MSB_FIRST definitions and switch to retro_endianness.h
2020-04-22 21:16:45 +02:00
Autechre 0c42b643a9 Merge pull request #10491 from QuarkTheAwesome/master
[WiiU] Warning fixes+devkitPPC updates
2020-04-22 21:16:33 +02:00
Autechre 28bf33cd78 Merge pull request #10493 from QuarkTheAwesome/gfx-display-wiiu-patch
WiiU: gfx_display: fix non-vertex coordinates in draws using tex shader
2020-04-22 21:16:17 +02:00
Autechre 7f0f36fb7a Merge pull request #10495 from MrHuu/patch-6
(3DS) Add ID for TGB-Dual
2020-04-22 21:15:26 +02:00
MrHuu 941b369016 (3DS) Add ID for TGB-Dual
Add unique id for TGB-Dual .cia build
2020-04-22 21:07:42 +02:00
Yoshi Sugawara a85ed986de Set audio session category to ambient so sound does not get cut off on interruption (phone call/playing back audio) 2020-04-22 08:54:57 -10:00
Weedy Weed Smoker 21d0320e42 French: Add optional save (SRAM) file compression 2020-04-22 21:19:24 +07:00
hizzlekizzle 843503e92a Merge pull request #10492 from phcoder/3ids
IDs for uzem and neocd
2020-04-22 09:12:02 -05:00
Ash Logan 08dfd58994 WiiU: Enable -Wall
This is the standard, according to CONTRIBUTING.md
2020-04-22 23:37:18 +10:00
Ash Logan ed24d05752 WiiU: gfx_display: fix non-vertex coordinates in draws using tex shader
This second case is hit when there's a quad with different-coloured 
corners, since the tex shader is needed to support that. In the quad 
case, there are no vertexes, and the ->x,y,width,height fields are used 
instead.

Fixes #8519.
2020-04-22 23:35:46 +10:00
Vladimir Serbinenko 28d30064b6 IDs for uzem and neocd 2020-04-22 13:44:23 +02:00
Ash Logan 7bac0220dc libfat: Remove st_spare for new devkitPPC versions
slurped from 
https://github.com/devkitPro/libfat/commit/d6bb60a4baa360946c32588a829f908607d85780
2020-04-22 10:56:49 +10:00
Autechre cb510f04d8 Merge pull request #10488 from MrHuu/patch-5
(3DS) Allow control bindings for multiple players
2020-04-22 01:08:34 +02:00
MrHuu 92dc0dc6d0 (3DS) Allow button presses up to INPUT_MAX_USERS
This enables the 3DS to bind and use buttons and axis for users up to the maximum set by 'Max Users' in the input settings menu.
2020-04-21 20:52:49 +02:00
jdgleaver fa9290cf1e Add optional playlist compression 2020-04-21 16:44:26 +01:00
Vladimir Serbinenko 1fcdddf579 Remove manual MSB_FIRST definitions and switch to retro_endianness.h 2020-04-21 04:16:55 +02:00
Autechre ce4c750326 Merge pull request #10484 from Tatsuya79/patch-3
qt: add saveram compression option
2020-04-21 02:03:21 +02:00
Tatsuya79 ce99109001 qt: add saveram compression option 2020-04-21 01:50:05 +02:00
twinaphex 8a15f0094a Bugfix 2020-04-21 00:49:02 +02:00
twinaphex 3a2a365ec9 (libretro-common) Fix retro_endianness.h 2020-04-21 00:46:48 +02:00
Autechre 3529f2da4c Merge pull request #10481 from jdgleaver/save-compression
Add optional save (SRAM) file compression
2020-04-21 00:25:58 +02:00
twinaphex 64bbe5b646 (MSVC 2010) Buildfix 2020-04-21 00:20:31 +02:00
hizzlekizzle 2427d90f48 Merge pull request #10482 from jdgleaver/font-fix
(WiiU/3DS) Fix font driver horizontal text alignment
2020-04-20 14:50:21 -05:00
jdgleaver 6c49ae5152 (WiiU/3DS) Fix font driver horizontal text alignment 2020-04-20 16:20:21 +01:00
jdgleaver 0d1fd657ab Add optional save (SRAM) file compression 2020-04-20 12:48:40 +01:00
Weedy Weed Smoker b4cadb1a16 Caught another formatting error… 2020-04-20 06:49:17 +07:00
Weedy Weed Smoker a2192b14db Caught a formatting error… 2020-04-20 06:18:39 +07:00
Weedy Weed Smoker ae467486ba French: Translate all FIXME tagged elements too 2020-04-20 05:25:07 +07:00
Weedy Weed Smoker 88d162452a French: Clean up and organize FR translation 2020-04-20 04:53:17 +07:00
twinaphex 3fa60d08de Update libretro-common 2020-04-19 20:44:22 +02:00
twinaphex 1eb612135b Revert "Revert "Take this out - cores that need usleep and such - address it in""
This reverts commit 7e3a400cb7.
2020-04-19 19:18:53 +02:00
twinaphex 7e3a400cb7 Revert "Take this out - cores that need usleep and such - address it in"
This reverts commit 48b6b4ca8e.
2020-04-19 18:54:05 +02:00
twinaphex 48b6b4ca8e Take this out - cores that need usleep and such - address it in
the core itself, or rewrite the reference so it uses libretro-common
sleeping functions instead
2020-04-19 18:15:47 +02:00
Autechre c2319b3a21 Merge pull request #10470 from jdgleaver/ai-service-menu-hide
AI Service Menu - Hide redundant entries when service is disabled
2020-04-18 18:01:06 +02:00
twinaphex 9a50205867 Add this around ifdefs 2020-04-18 17:59:27 +02:00
jdgleaver b1503bc7c8 AI Service Menu - Hide redundant entries when service is disabled 2020-04-18 14:06:35 +01:00
im4potatoandim-4-potato d5d4c1a319 msg_hash_us.h: Clean up and organize US translation (#10460)
* msg_hash_us.h: Clean up and organize US translation

* msg_hash_us.h: More cleanup

* msg_hash_us.h: Update to latest version after syncing with upstream

* msg_hash_us.h: Removed indents from preprocessor lines

Co-authored-by: im-4-potato <[email protected]>
2020-04-17 21:07:51 -05:00
Barry Rowe 8988e2d34b Added additional return to accessibility_speak_windows 2020-04-17 14:07:28 -07:00
Autechre 9588eb451b Merge pull request #10467 from jdgleaver/ai-fixes2
More build fixes
2020-04-17 18:40:29 +02:00
Autechre acfa3fc4d4 Merge pull request #10465 from jdgleaver/rzip-stream-additions
Expand functionality of 'rzip_stream' interface
2020-04-17 18:40:14 +02:00
jdgleaver 6ef5fa1aa5 More build fixes 2020-04-17 17:08:12 +01:00
Autechre af140741bc Merge pull request #10466 from jdgleaver/ai-fixes
Build fixes
2020-04-17 17:50:29 +02:00
jdgleaver ddc860d4b0 Build fixes 2020-04-17 16:42:37 +01:00
jdgleaver c1f4a7536a Expand functionality of 'rzip_stream' interface 2020-04-17 16:18:16 +01:00
twinaphex b91c342ff4 Buildfix MSVC 2010 2020-04-17 16:40:39 +02:00
twinaphex 352519c91e Another builfdix 2020-04-17 16:32:10 +02:00
twinaphex f3b82dc998 Buildfix 2020-04-17 16:29:23 +02:00
twinaphex 9f3a2db44e Merge branch 'master' of https://github.com/libretro/RetroArch 2020-04-17 16:24:39 +02:00
Autechre 018a0baed6 Merge pull request #10401 from libretro/accessibility_menu_fixes
Accessibility menu fixes
2020-04-17 03:19:17 +02:00
Autechre ddaeb2b24b Merge pull request #10458 from WeedyWeedSmoker/French-translation-update
French: Add optional save state compression, corrections, formatting
2020-04-17 01:51:44 +02:00
Autechre 51183787af Merge pull request #10459 from AlexKornitzer/feature/cocoa-fix
ui_cocoa: fix mouse input for cocoa
2020-04-17 01:49:38 +02:00
Autechre 2e3b6c5a17 Merge pull request #10463 from phcoder/kbl1ght
Implement psl1ght keyboard
2020-04-17 01:49:18 +02:00
Autechre f5a8e16109 Merge pull request #10462 from phcoder/f1x
platform_unix: Fix overflow when computing total memory on i386
2020-04-17 01:48:59 +02:00
Autechre 950cd41dfa Merge pull request #10448 from CrewMdk/patch-2
Updated spanish language translation
2020-04-17 01:48:32 +02:00
Autechre 0b86348711 Merge pull request #10461 from Tatsuya79/patch-2
qt: add savestate compression option
2020-04-17 01:48:15 +02:00
Autechre c8555924e0 Merge pull request #10464 from phcoder/vitasleep
Add usleep and sleep on Vita.
2020-04-17 01:47:56 +02:00
Vladimir Serbinenko a029cb9fc5 Add usleep and sleep on Vita.
libstdc++ links against them under some circumstances. This is needed for
neocd
2020-04-17 00:58:01 +02:00
Vladimir Serbinenko 5b668ae421 Implement psl1ght keyboard 2020-04-17 00:56:23 +02:00
Vladimir Serbinenko 99e9a1ea0d platform_unix: Fix overflow when computing total memory on i386 2020-04-17 00:54:06 +02:00
Tatsuya79 56159976af qt: add savestate compression option 2020-04-17 00:10:02 +02:00
Alex Kornitzer ac4b49f1c2 ui_cocoa: fix mouse input for cocoa
This brings back two lines of code that have been removed over time but
appear to be required in order for mouse input to work on macOS.
2020-04-16 22:01:40 +01:00
Weedy Weed Smoker 875bb8bda3 International: Formatting corrections 2020-04-17 03:52:25 +07:00
Weedy Weed Smoker c76e46d930 French: Corrections for clarity 2020-04-17 03:50:58 +07:00
Weedy Weed Smoker baf67a7dff French: Add optional save state compression 2020-04-17 03:49:34 +07:00
Barry Rowe adb5c4c7dd Moved SAPI code into a define. 2020-04-16 11:57:39 -07:00
Autechre 5303ecee22 Merge pull request #10454 from jdgleaver/save-state-compression
Add optional save state compression
2020-04-15 20:41:30 +02:00
jdgleaver 233456df47 Add optional save state compression 2020-04-15 15:48:41 +01:00
CrewMdk 725ee77383 Updated spanish language translation
The latest additions from English to Spanish have been added.
2020-04-13 20:18:53 -05:00
Barry Rowe 289be872f3 Added in auto-translate support, fixes for ozone and glui accessibility, and support for nvda and SAPI narration. 2020-04-13 17:46:08 -07:00
Autechre 910da74519 Merge pull request #10442 from WeedyWeedSmoker/French-translation-update
French: Add optional per-playlist alphabetical sorting
2020-04-13 02:56:00 +02:00
Weedy Weed Smoker 2e0f85ac93 French: Add per-playlist alphabetical sorting 2020-04-13 01:35:49 +07:00
Autechre ef2e51b4f6 Merge pull request #10434 from jdgleaver/per-playlist-sort
(Playlist Management) Add optional per-playlist alphabetical sorting
2020-04-12 14:02:56 +02:00
Autechre af3980ff66 Merge pull request #10420 from m4tsa/libnx_update
Fix the single breaking change from libnx 3.1.0
2020-04-11 18:10:08 +02:00
Mats A e3cbd2e62f add define to keep compat with previous libnx release 2020-04-11 18:07:59 +02:00
Autechre d98731d5d9 Merge pull request #10415 from LordeIlluminati/LordeIlluminati-patch-1
Update msg_hash_pt_br.h
2020-04-11 14:41:10 +02:00
Autechre ca4328b53c Merge pull request #10437 from valadaa48/oga_perf_fix
oga_gfx: move non-inlined function out of loop
2020-04-11 14:40:35 +02:00
Autechre 26bed1e264 Merge pull request #10429 from phcoder/f1x
Fix psl1ght compilation
2020-04-11 14:26:30 +02:00
jdgleaver 4dec80e9e3 Style nits 2020-04-11 13:00:24 +01:00
valadaa48 587a425f77 oga_gfx: move non-inlined function out of loop 2020-04-11 02:30:39 +00:00
hizzlekizzle 8096ced303 Merge pull request #10433 from felinben/translation
Update retroarch.desktop for German
2020-04-10 19:47:09 -05:00
Linux User 86e8aeaaa5 Update retroarch.desktop for German 2020-04-10 17:41:19 +01:00
jdgleaver 223cae66c1 (Playlist Management) Add optional per-playlist alphabetical sorting 2020-04-10 17:07:49 +01:00
hizzlekizzle d6058bba82 Merge pull request #10430 from Alcaro/patch-3
intl/README.md: Fix typo
2020-04-09 16:24:29 -05:00
Alcaro 3249c10215 intl/README.md: Fix typo 2020-04-09 21:07:17 +02:00
Vladimir Serbinenko c957e07399 Fix psl1ght compilation
pkg.py is not necessatily in path
mftb works better than posix on psl1ght
2020-04-09 15:53:38 +02:00
Autechre df1fefd775 Merge pull request #10421 from jdgleaver/playlist-fixes
Improve handling of 'broken' playlists
2020-04-09 14:17:01 +02:00
Autechre d521945479 Merge pull request #10425 from jdgleaver/ozone-font-alignemnt
(Ozone) Enable proper vertical text alignment + thumbnail display improvements
2020-04-09 14:16:46 +02:00
Autechre 74fb8cb7b2 Merge pull request #10426 from jdgleaver/ozone-pointer-fix
(Ozone) Pointer input fixes
2020-04-09 13:38:08 +02:00
jdgleaver 887999904b (Ozone) Pointer input fixes 2020-04-08 17:09:38 +01:00
jdgleaver 545e5fd6ab (Ozone) Enable proper vertical text alignment + thumbnail display improvements 2020-04-08 15:15:39 +01:00
Jeff Sousa ac5e151d1e Update msg_hash_pt_br.h 2020-04-08 09:16:46 -03:00
Jeff Sousa c8d269e5de Update msg_hash_pt_br.h 2020-04-08 09:15:15 -03:00
Jeff Sousa e7173e974b Update msg_hash_pt_br.h 2020-04-08 09:10:34 -03:00
Jeff Sousa 7b0d527ffe Update msg_hash_pt_br.h 2020-04-08 08:46:57 -03:00
Mats A 6f5f600f47 rename U64_MAX to UINT64_MAX due to libnx changes 2020-04-07 13:23:06 +02:00
jdgleaver ad8a1174f7 Improve handling of 'broken' playlists 2020-04-07 12:00:16 +01:00
Jeff Sousa 24b5e5234f Update msg_hash_pt_br.h 2020-04-07 01:37:00 -03:00
LordeIlluminati 1d438d8d06 Update msg_hash_pt_br.h 2020-04-07 00:43:16 -03:00
LordeIlluminati 891372c4b1 Update msg_hash_pt_br.h 2020-04-07 00:24:29 -03:00
LordeIlluminati 3de030ba74 Update msg_hash_pt_br.h 2020-04-06 22:37:34 -03:00
LordeIlluminati a6dd70a320 Update msg_hash_pt_br.h 2020-04-06 22:31:15 -03:00
LordeIlluminati ffe79897e5 Update msg_hash_pt_br.h 2020-04-06 19:13:03 -03:00
Autechre b01aabf7d1 Merge pull request #10411 from jdgleaver/widget-text-alignment
Widget text improvements
2020-04-06 15:37:58 +02:00
Autechre 304e13ac16 Merge pull request #10412 from jdgleaver/task-fix
Fix task deadlocks
2020-04-06 15:25:25 +02:00
jdgleaver c1d41e190c (task_queue) Add warning about the usage of 'task_queue_remove()' 2020-04-06 14:16:24 +01:00
jdgleaver 13df7795fc Fix task deadlocks 2020-04-06 13:51:22 +01:00
jdgleaver f559798750 Widget text improvements 2020-04-06 11:39:30 +01:00
twinaphex e88568625c Merge branch 'master' of https://github.com/libretro/RetroArch 2020-04-06 01:04:23 +02:00
Autechre 0716fa02d6 Update CHANGES.md 2020-04-05 13:12:18 +02:00
Autechre 325a8a4cbd Merge pull request #10394 from CrewMdk/patch-1
Updated spanish language translation
2020-04-05 13:06:39 +02:00
Autechre b0820ca1db Merge pull request #10386 from jdgleaver/rgui-downscale
(RGUI) Enable automatic menu size reduction when running at low resolutions (down to 256x192)
2020-04-05 13:06:30 +02:00
Autechre 8d44c0c752 Merge pull request #10397 from Jamiras/cheevos_gba_no_mmap
[cheevos] report non-memorymap gba cores as unsupported
2020-04-05 13:06:15 +02:00
Autechre 5b5a086fd3 Merge pull request #10398 from Jamiras/cheevos_null_check
[cheevos] prevent null reference rendering achievement list while closing application
2020-04-05 13:05:59 +02:00
Autechre f7e6d9e7b8 Merge pull request #10399 from Jamiras/thread_queue_unfinished
fix race condition where task could momentarily not be in the queue when reordering
2020-04-05 13:05:49 +02:00
Autechre 1f43533ff9 Merge pull request #10400 from yoshisuga/yoshisuga/tvos_no_overlay
tvOS: Disable overlays for tvOS, fix app icon
2020-04-05 13:05:30 +02:00
Yoshi Sugawara 4f5616cb91 tvOS: Disable overlays for tvOS, fix app icon 2020-04-04 08:22:24 -10:00
Jamiras 23ba478f82 fix race condition where task could momentarily not be in the queue when reordering 2020-04-04 09:37:55 -06:00
Jamiras ff3b033815 prevent null reference rendering achievement list while closing emulator 2020-04-04 09:28:11 -06:00
Jamiras a08840de6d report non-memorymap gba cores as unsupported 2020-04-04 09:13:10 -06:00
CrewMdk ed34643f01 Updated spanish language translation 2020-04-03 20:36:06 -06:00
jdgleaver a9c496e01f (RGUI) Enable automatic menu size reduction when running at low resolutions (down to 256x192) 2020-04-02 16:54:39 +01:00
twinaphex a9154373fc Merge branch 'master' of https://github.com/libretro/RetroArch 2020-04-02 02:13:12 +02:00
twinaphex 92c472c227 Merge branch 'master' of https://github.com/libretro/RetroArch 2020-03-29 06:01:31 +02:00
twinaphex 4589fde775 Simplify video_context_driver_translate_aspect 2020-03-28 05:44:58 +01:00
twinaphex 8b8d9e0841 Style nits 2020-03-28 05:40:16 +01:00
twinaphex 19c68fad43 Take out cb_update_window_title and cb_get_metrics 2020-03-28 05:36:31 +01:00
156 changed files with 111783 additions and 88341 deletions

No files matched your search

+66 -1
View File
@@ -1,18 +1,83 @@
# Future
# 1.8.6
- 3DS: Add IDs for UZEM, TGB Dual, and NeoCD
- 3DS: Fix font driver horizontal text alignment
- 3DS: Allow button presses up to INPUT_MAX_USERS - this enables the 3DS to bind and use buttons and axis for users up to the maximum set by 'Max Users' in the input settings menu.
- 3DS: Disable video filter if upscaled resolution exceeds hardware limits. The 3DS has a maximum video buffer size of 2048x2048. This is sufficient for every core that it supports, but when using software video filters the core output resolution is doubled. This is made worse by the fact that the video filter upscaling buffer size is dependent upon the maximum output resolution of the core - which in some cases is very large indeed (e.g. pcsx-rearmed sets a maximum width of 1024, for enhanced resolution support). The 3DS has very limited 'linear memory' for graphics buffer purposes, and a large base core buffer + video filter buffer can easily exceed this - which may also disable video output, or cause a crash. This PR very simply adds a 3DS-specific check to the video filter initialisation: if the resultant upscaling buffer exceeds the hardware limitation, then the filter is automatically disabled.
- 3DS/FONT/BUGFIX: Text colour was wrong: the RGBA channels were muddled, and R was always set to 255
- 3DS/FONT/BUGFIX: When drawing multiline strings, the line spacing was completely incorrect
- 3DS/FONT: Improves the appearance of the drop shadow effect on notification text.
- 3DS/ARCHIVE/7Z: Re-enable 7zip support.
- ARCHIVE/ZIP: Expand functionality of 'rzip_stream' interface. This PR expands the functionality of the new rzip_stream archived stream interface such that it now has almost complete feature parity with the standard file_stream interface, and can therefore be used as a drop-in replacement in most situations
- AI SERVICE: Hide redundant entries when service is disabled
- AI SERVICE: Added in auto-translate support
- AI SERVICE: support for NVDA and SAPI narration
- AUTOCONFIG: Use correct port index in input device configured/disconnected notifications
- CHD: Fixes a crash caused by ignoring the return value from one of the CHD library functions.
- BUGFIX: Fix race condition where task could momentarily not be in the queue when reordering
- CHEEVOS/BUGFIX: Prevent null reference rendering achievement list while closing application
- CHEEVOS/BUGFIX: Report non-memorymap GBA cores as unsupported
- COMMANDLINE: Advise against using -s and -S variables on the command line. …
- CONFIG FILE: Only write config files to disk when parameters change
- CONFIG FILE/BUGFIX: RetroArch no longer crashes when attempting to save a config file after 'unsetting' a parameter (currently, this can be triggered quite easily by manipulating input remaps)
- CONFIG FILE/BUGFIX: When using Material UI, RetroArch no longer modifies the wrong setting (or segfaults...) when tapping entries in the Quick Menu > Controls input remapping submenu
- CONFIG FILE/BUGFIX: Quite a few real and potential memory leaks have been fixed.
- CHD: Fixes a crash caused by ignoring the return value from one of the CHD library functions
- FASTFORWARDING: A new Mute When Fast-Forwarding option has been added under Settings > Audio. When enabled, users can fast forward without having to listen to distorted audio.
- GLCORE/SLANG: Set filter and wrap mode correctly when intialising shader textures. Before, the glcore shader driver did not correctly initialise loaded textures. The texture filtering and wrap mode were forced on texture creation, but these settings were not recorded - subsequent updates would set garbage values, that would resolve to linear filtering OFF and wrap mode = CLAMP_TO_EDGE.
- LOCALIZATION: Update Japanese translation
- LOCALIZATION: Update Spanish translation
- LOCALIZATION: Update Portuguese Brazilian translation
- IOS: Set audio session category to ambient so sound does not get cut off on interruption (phone call/playing back audio)
- MAC/IOHIDMANAGER/BUGFIX: Fix for Mayflash N64 adapter. In case last hatswitch does not match cookie. For the mayflash N64 adapter, I was getting a BAD EXC ADDRESS (in mac OS 10.13) for this line (tmp was NULL). Retroarch would crash in the gui if I pressed a button from the DPAD on controller 2. With this change, it no longer crashes in the gui and still registers the button push.
- MAC/COCOA: Fix mouse input - this brings back two lines of code that have been removed over time but
appear to be required in order for mouse input to work on macOS
- METAL/BUGFIX: GPU capture on Metal/OSX/NVidia could crash
- METAL/BUGFIX: Taking screenshots could capture black frames. Resulting PNG screenshots were black.
- METAL/BUGFIX: Corrupted image due to incorrect viewport copy when taking screenshot
- MENU: Prevent font-related segfaults when using extremely small scales/window sizes
- MENU: Fix 'gfx_display_draw_texture_slice()'
- MENU/FONT: Enable correct vertical alignment of text (+ font rendering fixes)
- MENU/RGUI: Enable automatic menu size reduction when running at low resolutions (down to 256x192)
- MENU/OZONE: Update timedate style options for Last Played sublabel metadata
- MENU/OZONE: Hide 'Menu Color Theme' setting when 'Use preferred system color theme' is enabled
- MENU/OZONE: Fix thumbnail switching via 'scan' button functionality
- MENU/OZONE: Prevent glitches when rendering Ozone's selection cursor
- MENU/OZONE: Enable proper vertical text alignment + thumbnail display improvements
- MENU/OZONE: Enable second thumbnail/content metadata toggle using RetroPad 'select'
- MENU/OZONE: Refactor footer display
- MENU/OZONE: Hide thumbnail button hints when viewing file browser lists
- MENU/OZONE/INPUT/BUGFIX: Fix undefined behaviour when using touch screen to change input remaps
- MENU/OZONE/INPUT/BUGFIX: It turns out that Windows reports negative pointer coordinates when the mouse cursor goes beyond the left hand edge of the RetroArch window (this doesn't happen on Linux, so I never encountered this issue before!). As a result, if Ozone is currently not showing the sidebar (menu depth > 1), moving the cursor off the left edge of the window generates a false positive 'cursor in sidebar' event - which breaks menu navigation, as described in #10419. With this PR, we now handle 'cursor in sidebar' status correctly in all cases
- MENU/OZONE/INPUT/BUGFIX: Pointer input is now correctly disabled when message boxes are displayed
- MENU/XMB: Fix thumbnail switching via 'scan' button functionality
- ODROID GO ADVANCE: Add DRM HW context driver
- PSL1GHT: Initial port
- PSL1GHT/KEYBOARD: Implement PSL1GHT keyboard
- PLAYLIST/BUGFIX: Improve handling of 'broken' playlists - RetroArch will no longer segfault when attempting to run content via a playlist entry with missing path or core path fields.
- PLAYLIST/BUGFIX: Improve handling of 'broken' playlists - when a playlist entry has either core path and/or core name set to NULL, DETECT or an empty string, attempting to load content will fallback to the normal 'core selection' code (currently this happens only if both core path and core name are DETECT - this is wholly inadequate!)
- PLAYLIST/BUGFIX: RetroArch will no longer segfault when attempting to fetch content runtime information when core path is NULL
- PLAYLIST/BUGFIX: Core name + runtime info will only be displayed on playlists and in the Information submenu if both the core path and core name fields are 'valid' (i.e. not NULL or DETECT)
- PLAYLIST/BUGFIX: When handling entries with missing path fields, the menu sorting order now matches that of the playlist sorting order (at present, everything goes out of sync when paths are empty). Moreover, entries with missing path fields can now be 'selected', so users can remove them (currently, hitting A on such an entry immediately tries - and fails - to load the content, so the only way to remove the broken entry is via the Playlist Management > Clean Playlist feature)
- PLAYLIST: Add optional per-playlist alphabetical sorting
- PLAYLIST: Omit whitespace when writing compressed JSON format playlists
- PLAYLIST: Add optional playlist compression
- QNX: Support analog sticks
- SAVESTATES: Add optional save state compression (enabled by default now)
- SRAM: Add optional save (SRAM) file compression
- SCANNER: Prevent redundant playlist entries when handling M3U content
- SCANNER/ANDROID: Fix content scanner being unable to identify certain games from CHD images (raw data sector/subcode)
- TASKS/BUGFIX: Fix task deadlocks
- TASKS/SCREENSHOT/BUGFIX: Fix heap-use-after-free error when widgets are disabled
- TVOS: Disable overlays for tvOS, fix app icon
- VIDEO/WIDGETS/BUGFIX: The font ascender/descender metrics added in #10375 are now used to achieve 'pixel perfect' vertical text alignment
- VIDEO/WIDGETS/BUGFIX: Message queue text now uses its own dedicated font. Previously, a single (larger) font was used for all active widgets, and this was scaled down for message queue items. This 'squished' the text a little; more importantly, when using the stb font renderers (on Android. etc.) it caused ugly artefacts around the edges of glyphs due to pixel interpolation errors. Now that a correctly sized font is used, the message queue is always rendered cleanly.
- VIDEO/WIDGETS/BUGFIX: Previously, each widget font was 'flushed' (font_driver_flush()) at least once a frame. This is quite a slow operation. Now we only flush fonts if they have actually been used.
- VULKAN/BUGFIX: Fix display of statistics text
- UNIX/BUGFIX: Fix overflow when computing total memory on i386
- WIIU/BUGFIX: Fix font driver horizontal text alignment
- WIIU/BUGFIX: Fix non-vertex coordinates in draws using tex shader
- WIIU/BUGFIX: Update and fix meta.xml file for the WiiU release. This change makes it so the information from the meta.xml file parsed for the WiiU's Homebrew Launcher is displayed properly.
# 1.8.5
- 3DS: Keep the bottom screen hidden on sleep/wakeup. When the 3DS wakes back up after being closed, the bottom screen needs to be reinitialized. Adding the condition here will cause the screen to be turned on or off based on the state of ctr_bottom_screen_enabled, as you'd expect
+21 -1
View File
@@ -19,6 +19,16 @@ ifeq ($(HAVE_CXX11), 1)
CXXFLAGS += $(CXX11_CFLAGS)
endif
ifeq ($(HAVE_NVDA), 1)
LIBS += nvdaControllerClient64.dll
endif
ifeq ($(HAVE_SAPI), 1)
LIBS += sapi.dll
endif
ifeq ($(HAVE_GL_CONTEXT),)
HAVE_GL_CONTEXT = 0
HAVE_GL_MODERN = 0
@@ -1681,7 +1691,8 @@ endif
ifeq ($(HAVE_ZLIB_COMMON), 1)
OBJ += $(LIBRETRO_COMM_DIR)/file/archive_file_zlib.o \
$(LIBRETRO_COMM_DIR)/streams/trans_stream_zlib.o
$(LIBRETRO_COMM_DIR)/streams/trans_stream_zlib.o \
$(LIBRETRO_COMM_DIR)/streams/rzip_stream.o
DEFINES += -DHAVE_ZLIB
HAVE_COMPRESSION = 1
@@ -1764,7 +1775,16 @@ endif
# Accessibility
ifeq ($(HAVE_ACCESSIBILITY), 1)
DEFINES += -DHAVE_ACCESSIBILITY
ifeq ($(HAVE_SAPI), 1)
ifneq ($(findstring Win32,$(OS)),)
LIBS += -lsapi
endif
endif
endif
# Things that depend on network availability
+1 -1
View File
@@ -51,7 +51,7 @@ DEFINES :=
ifeq ($(GRIFFIN_BUILD), 1)
OBJ += griffin/griffin.o
DEFINES += -DHAVE_GRIFFIN=1 -DHAVE_MENU -DHAVE_CONFIGFILE -DHAVE_RGUI -DHAVE_XMB -DHAVE_MATERIALUI -DHAVE_LIBRETRODB -DHAVE_CC_RESAMPLER
DEFINES += -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_RBMP -DHAVE_RTGA
DEFINES += -DHAVE_ZLIB -DHAVE_7ZIP -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_RBMP -DHAVE_RTGA
#DEFINES += -DHAVE_NETWORKING -DHAVE_CHEEVOS -DRC_DISABLE_LUA -DHAVE_SOCKET_LEGACY -DHAVE_THREADS
#-DHAVE_SSL -DHAVE_BUILTINMBEDTLS -DMBEDTLS_SSL_DEBUG_ALL
#ssl is currently incompatible with griffin due to use of the "static" flag on repeating functions that will conflict when included in one file
+1 -1
View File
@@ -155,7 +155,7 @@ else ifeq ($(libogc_platform), 1)
endif
LIBDIRS += -L.
MACHDEP += -DGEKKO -mcpu=750 -meabi -mhard-float -DMSB_FIRST
MACHDEP += -DGEKKO -mcpu=750 -meabi -mhard-float
ifeq ($(platform), ngc)
LDFLAGS += $(MACHDEP) -Wl,-Map,$(notdir $(EXT_INTER_TARGET)).map
+1 -1
View File
@@ -70,7 +70,7 @@ endif
PPU_SRCS = griffin/griffin.c
DEFINES += -DHAVE_VIDEO_LAYOUT
DEFINES += -DHAVE_MENU -DHAVE_CONFIGFILE -DHAVE_GFX_WIDGETS -DHAVE_RGUI -DHAVE_XMB -DHAVE_OZONE -DHAVE_LIBRETRODB -DHAVE_MATERIALUI -DHAVE_SHADERPIPELINE -DRARCH_INTERNAL -DMSB_FIRST -DHAVE_OVERLAY -DHAVE_CC_RESAMPLER -DHAVE_STB_VORBIS -DHAVE_STB_FONT -DHAVE_RUNAHEAD -DHAVE_DR_MP3 -DHAVE_DR_FLAC
DEFINES += -DHAVE_MENU -DHAVE_CONFIGFILE -DHAVE_GFX_WIDGETS -DHAVE_RGUI -DHAVE_XMB -DHAVE_OZONE -DHAVE_LIBRETRODB -DHAVE_MATERIALUI -DHAVE_SHADERPIPELINE -DRARCH_INTERNAL -DHAVE_OVERLAY -DHAVE_CC_RESAMPLER -DHAVE_STB_VORBIS -DHAVE_STB_FONT -DHAVE_RUNAHEAD -DHAVE_DR_MP3 -DHAVE_DR_FLAC
DEFINES += -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_ASSETS -DHAVE_UPDATE_CORES
ifeq ($(DEX_BUILD), 1)
+2 -2
View File
@@ -163,7 +163,7 @@ OBJ := $(addprefix $(BUILD_DIR)/,$(OBJ))
#-----------------------------
# Compile flags
DEFINES += -DWIIU -DMSB_FIRST -D__WUT__ -DHW_WUP -D__wiiu__
DEFINES += -DWIIU -D__WUT__ -DHW_WUP -D__wiiu__
DEFINES += -DHAVE_MAIN
DEFINES += -DRARCH_CONSOLE
@@ -184,7 +184,7 @@ CFLAGS := -mcpu=750 -meabi -mhard-float
CFLAGS += -ffast-math -Werror=implicit-function-declaration
CFLAGS += -ffunction-sections -fdata-sections
#CFLAGS += -fomit-frame-pointer -mword-relocations
#CFLAGS += -Wall
CFLAGS += -Wall
ifeq ($(DEBUG), 1)
CFLAGS += -O0 -g
+1 -1
View File
@@ -106,7 +106,7 @@ static ssize_t switch_audio_write(void *data, const void *buf, size_t size)
num = 0;
#ifdef HAVE_LIBNX
if (audoutWaitPlayFinish(&swa->current_buffer, &num, U64_MAX) != 0) { }
if (audoutWaitPlayFinish(&swa->current_buffer, &num, UINT64_MAX) != 0) { }
#else
svcWaitSynchronization(&handle_idx, &swa->event, 1, 33333333);
svcResetSignal(swa->event);
+4
View File
@@ -46,6 +46,10 @@ typedef AudioOutBuffer compat_audio_out_buffer;
#define switch_audio_ipc_output_stop(a) audoutStopAudioOut()
#define switch_audio_ipc_output_start(a) audoutStartAudioOut()
#ifndef UINT64_MAX
#define UINT64_MAX U64_MAX
#endif
#else
/* libtransistor definitions */
+1 -1
View File
@@ -86,7 +86,7 @@ static void mainLoop(void* data)
if (!released_out_buffer)
{
#ifdef HAVE_LIBNX
rc = audoutWaitPlayFinish(&released_out_buffer, &released_out_count, U64_MAX);
rc = audoutWaitPlayFinish(&released_out_buffer, &released_out_count, UINT64_MAX);
#else
uint32_t handle_idx = 0;
svcWaitSynchronization(&handle_idx, &swa->event, 1, 33333333);
+2 -2
View File
@@ -1133,12 +1133,12 @@ void rcheevos_get_achievement_state(unsigned index, char *buffer, size_t buffer_
if (index < rcheevos_locals.patchdata.core_count)
{
enum_idx = MENU_ENUM_LABEL_VALUE_CHEEVOS_LOCKED_ENTRY;
cheevo = &rcheevos_locals.core[index];
cheevo = rcheevos_locals.core ? &rcheevos_locals.core[index] : NULL;
}
else
{
enum_idx = MENU_ENUM_LABEL_VALUE_CHEEVOS_UNOFFICIAL_ENTRY;
cheevo = &rcheevos_locals.unofficial[index - rcheevos_locals.patchdata.core_count];
cheevo = rcheevos_locals.unofficial ? &rcheevos_locals.unofficial[index - rcheevos_locals.patchdata.core_count] : NULL;
}
if (!cheevo || !cheevo->trigger)
+8
View File
@@ -248,6 +248,14 @@ const uint8_t* rcheevos_patch_address(unsigned address, int console)
}
}
}
else if (console == RC_CONSOLE_GAMEBOY_ADVANCE)
{
/* The RetroAchievements implementation of memory access for GBA puts the save RAM first,
* so the default looping behavior below is backwards. If the core doesn't expose a
* memory map, say it isn't supported.
*/
pointer = NULL;
}
else
{
unsigned i;
+20 -5
View File
@@ -803,6 +803,10 @@ static const bool audio_enable_menu_bgm = false;
#define DEFAULT_WASAPI_SH_BUFFER_LENGTH -16
#endif
/* Automatically mute audio when fast forward
* is enabled */
#define DEFAULT_AUDIO_FASTFORWARD_MUTE false
/* MISC */
/* Enables displaying the current frames per second. */
@@ -911,6 +915,14 @@ static const bool savestate_auto_load = false;
static const bool savestate_thumbnail_enable = false;
/* When creating save (srm) files, compress
* written data */
#define DEFAULT_SAVE_FILE_COMPRESSION false
/* When creating save state files, compress
* written data */
#define DEFAULT_SAVESTATE_FILE_COMPRESSION true
/* Slowmotion ratio. */
#define DEFAULT_SLOWMOTION_RATIO 3.0
@@ -950,22 +962,25 @@ static const unsigned default_content_history_size = 200;
static const int default_content_favorites_size = 200;
/* Sort all playlists (apart from histories) alphabetically */
static const bool playlist_sort_alphabetical = true;
#define DEFAULT_PLAYLIST_SORT_ALPHABETICAL true
/* File format to use when writing playlists to disk */
static const bool playlist_use_old_format = false;
#define DEFAULT_PLAYLIST_USE_OLD_FORMAT false
/* When creating/updating playlists, compress written data */
#define DEFAULT_PLAYLIST_COMPRESSION false
#ifdef HAVE_MENU
/* Specify when to display 'core name' inline on playlist entries */
static const unsigned playlist_show_inline_core_name = PLAYLIST_INLINE_CORE_DISPLAY_HIST_FAV;
#define DEFAULT_PLAYLIST_SHOW_INLINE_CORE_NAME PLAYLIST_INLINE_CORE_DISPLAY_HIST_FAV
/* Specifies which runtime record to use on playlist sublabels */
static const unsigned playlist_sublabel_runtime_type = PLAYLIST_RUNTIME_PER_CORE;
#define DEFAULT_PLAYLIST_SUBLABEL_RUNTIME_TYPE PLAYLIST_RUNTIME_PER_CORE
/* Specifies time/date display format for runtime 'last played' data */
#define DEFAULT_PLAYLIST_SUBLABEL_LAST_PLAYED_STYLE PLAYLIST_LAST_PLAYED_STYLE_YMD_HMS
static const unsigned playlist_entry_remove_enable = PLAYLIST_ENTRY_REMOVE_ENABLE_ALL;
#define DEFAULT_PLAYLIST_ENTRY_REMOVE_ENABLE PLAYLIST_ENTRY_REMOVE_ENABLE_ALL
#endif
#define DEFAULT_SCAN_WITHOUT_CORE_MATCH false
+10 -5
View File
@@ -1432,6 +1432,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
#ifdef HAVE_AUDIOMIXER
SETTING_BOOL("audio_mixer_mute_enable", audio_get_bool_ptr(AUDIO_ACTION_MIXER_MUTE_ENABLE), true, false, false);
#endif
SETTING_BOOL("audio_fastforward_mute", &settings->bools.audio_fastforward_mute, true, DEFAULT_AUDIO_FASTFORWARD_MUTE, false);
SETTING_BOOL("location_allow", &settings->bools.location_allow, true, false, false);
SETTING_BOOL("video_font_enable", &settings->bools.video_font_enable, true, DEFAULT_FONT_ENABLE, false);
SETTING_BOOL("core_updater_auto_extract_archive", &settings->bools.network_buildbot_auto_extract_archive, true, true, false);
@@ -1614,6 +1615,8 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
SETTING_BOOL("savestate_auto_save", &settings->bools.savestate_auto_save, true, savestate_auto_save, false);
SETTING_BOOL("savestate_auto_load", &settings->bools.savestate_auto_load, true, savestate_auto_load, false);
SETTING_BOOL("savestate_thumbnail_enable", &settings->bools.savestate_thumbnail_enable, true, savestate_thumbnail_enable, false);
SETTING_BOOL("save_file_compression", &settings->bools.save_file_compression, true, DEFAULT_SAVE_FILE_COMPRESSION, false);
SETTING_BOOL("savestate_file_compression", &settings->bools.savestate_file_compression, true, DEFAULT_SAVESTATE_FILE_COMPRESSION, false);
SETTING_BOOL("history_list_enable", &settings->bools.history_list_enable, true, DEFAULT_HISTORY_LIST_ENABLE, false);
SETTING_BOOL("playlist_entry_rename", &settings->bools.playlist_entry_rename, true, DEFAULT_PLAYLIST_ENTRY_RENAME, false);
SETTING_BOOL("game_specific_options", &settings->bools.game_specific_options, true, default_game_specific_options, false);
@@ -1648,11 +1651,12 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
SETTING_BOOL("video_3ds_lcd_bottom", &settings->bools.video_3ds_lcd_bottom, true, video_3ds_lcd_bottom, false);
#endif
SETTING_BOOL("playlist_use_old_format", &settings->bools.playlist_use_old_format, true, playlist_use_old_format, false);
SETTING_BOOL("playlist_use_old_format", &settings->bools.playlist_use_old_format, true, DEFAULT_PLAYLIST_USE_OLD_FORMAT, false);
SETTING_BOOL("playlist_compression", &settings->bools.playlist_compression, true, DEFAULT_PLAYLIST_COMPRESSION, false);
SETTING_BOOL("content_runtime_log", &settings->bools.content_runtime_log, true, DEFAULT_CONTENT_RUNTIME_LOG, false);
SETTING_BOOL("content_runtime_log_aggregate", &settings->bools.content_runtime_log_aggregate, true, DEFAULT_CONTENT_RUNTIME_LOG_AGGREGATE, false);
SETTING_BOOL("playlist_show_sublabels", &settings->bools.playlist_show_sublabels, true, DEFAULT_PLAYLIST_SHOW_SUBLABELS, false);
SETTING_BOOL("playlist_sort_alphabetical", &settings->bools.playlist_sort_alphabetical, true, playlist_sort_alphabetical, false);
SETTING_BOOL("playlist_sort_alphabetical", &settings->bools.playlist_sort_alphabetical, true, DEFAULT_PLAYLIST_SORT_ALPHABETICAL, false);
SETTING_BOOL("playlist_fuzzy_archive_match", &settings->bools.playlist_fuzzy_archive_match, true, DEFAULT_PLAYLIST_FUZZY_ARCHIVE_MATCH, false);
SETTING_BOOL("quit_press_twice", &settings->bools.quit_press_twice, true, DEFAULT_QUIT_PRESS_TWICE, false);
@@ -1894,9 +1898,9 @@ static struct config_uint_setting *populate_settings_uint(settings_t *settings,
#endif
#ifdef HAVE_MENU
SETTING_UINT("playlist_entry_remove_enable", &settings->uints.playlist_entry_remove_enable, true, playlist_entry_remove_enable, false);
SETTING_UINT("playlist_show_inline_core_name", &settings->uints.playlist_show_inline_core_name, true, playlist_show_inline_core_name, false);
SETTING_UINT("playlist_sublabel_runtime_type", &settings->uints.playlist_sublabel_runtime_type, true, playlist_sublabel_runtime_type, false);
SETTING_UINT("playlist_entry_remove_enable", &settings->uints.playlist_entry_remove_enable, true, DEFAULT_PLAYLIST_ENTRY_REMOVE_ENABLE, false);
SETTING_UINT("playlist_show_inline_core_name", &settings->uints.playlist_show_inline_core_name, true, DEFAULT_PLAYLIST_SHOW_INLINE_CORE_NAME, false);
SETTING_UINT("playlist_sublabel_runtime_type", &settings->uints.playlist_sublabel_runtime_type, true, DEFAULT_PLAYLIST_SUBLABEL_RUNTIME_TYPE, false);
SETTING_UINT("playlist_sublabel_last_played_style", &settings->uints.playlist_sublabel_last_played_style, true, DEFAULT_PLAYLIST_SUBLABEL_LAST_PLAYED_STYLE, false);
#endif
@@ -4245,6 +4249,7 @@ bool config_save_overrides(enum override_type type, void *data)
free(override_directory);
free(core_path);
free(game_path);
free(content_path);
return ret;
}
+4
View File
@@ -131,6 +131,7 @@ typedef struct settings
bool audio_rate_control;
bool audio_wasapi_exclusive_mode;
bool audio_wasapi_float_format;
bool audio_fastforward_mute;
/* Input */
bool input_remap_binds_enable;
@@ -344,6 +345,8 @@ typedef struct settings
bool savestate_auto_save;
bool savestate_auto_load;
bool savestate_thumbnail_enable;
bool save_file_compression;
bool savestate_file_compression;
bool network_cmd_enable;
bool stdin_cmd_enable;
bool keymapper_enable;
@@ -377,6 +380,7 @@ typedef struct settings
bool sustained_performance_mode;
bool playlist_use_old_format;
bool playlist_compression;
bool content_runtime_log;
bool content_runtime_log_aggregate;
+1 -1
View File
@@ -43,7 +43,7 @@ typedef struct content_ctx_info
bool content_load_ram_file(unsigned slot);
/* Save a RAM state from memory to disk. */
bool content_save_ram_file(unsigned slot);
bool content_save_ram_file(unsigned slot, bool compress);
/* Load a state from disk to memory. */
bool content_load_state(const char* path, bool load_to_backup_buffer, bool autoload);
+78 -60
View File
@@ -140,15 +140,17 @@ static void core_info_list_resolve_all_firmware(
snprintf(desc_key, sizeof(desc_key), "firmware%u_desc", c);
snprintf(opt_key, sizeof(opt_key), "firmware%u_opt", c);
if (config_get_string(config, path_key, &tmp) && !string_is_empty(tmp))
if (config_get_string(config, path_key, &tmp))
{
info->firmware[c].path = strdup(tmp);
if (!string_is_empty(tmp))
info->firmware[c].path = strdup(tmp);
free(tmp);
tmp = NULL;
}
if (config_get_string(config, desc_key, &tmp) && !string_is_empty(tmp))
if (config_get_string(config, desc_key, &tmp))
{
info->firmware[c].desc = strdup(tmp);
if (!string_is_empty(tmp))
info->firmware[c].desc = strdup(tmp);
free(tmp);
tmp = NULL;
}
@@ -315,48 +317,48 @@ static core_info_list_t *core_info_list_new(const char *path,
{
char *tmp = NULL;
if (config_get_string(conf, "display_name", &tmp)
&& !string_is_empty(tmp))
if (config_get_string(conf, "display_name", &tmp))
{
core_info[i].display_name = strdup(tmp);
if (!string_is_empty(tmp))
core_info[i].display_name = strdup(tmp);
free(tmp);
tmp = NULL;
}
if (config_get_string(conf, "display_version", &tmp)
&& !string_is_empty(tmp))
if (config_get_string(conf, "display_version", &tmp))
{
core_info[i].display_version = strdup(tmp);
if (!string_is_empty(tmp))
core_info[i].display_version = strdup(tmp);
free(tmp);
tmp = NULL;
}
if (config_get_string(conf, "corename", &tmp)
&& !string_is_empty(tmp))
if (config_get_string(conf, "corename", &tmp))
{
core_info[i].core_name = strdup(tmp);
if (!string_is_empty(tmp))
core_info[i].core_name = strdup(tmp);
free(tmp);
tmp = NULL;
}
if (config_get_string(conf, "systemname", &tmp)
&& !string_is_empty(tmp))
if (config_get_string(conf, "systemname", &tmp))
{
core_info[i].systemname = strdup(tmp);
if (!string_is_empty(tmp))
core_info[i].systemname = strdup(tmp);
free(tmp);
tmp = NULL;
}
if (config_get_string(conf, "systemid", &tmp)
&& !string_is_empty(tmp))
if (config_get_string(conf, "systemid", &tmp))
{
core_info[i].system_id = strdup(tmp);
if (!string_is_empty(tmp))
core_info[i].system_id = strdup(tmp);
free(tmp);
tmp = NULL;
}
if (config_get_string(conf, "manufacturer", &tmp)
&& !string_is_empty(tmp))
if (config_get_string(conf, "manufacturer", &tmp))
{
core_info[i].system_manufacturer = strdup(tmp);
if (!string_is_empty(tmp))
core_info[i].system_manufacturer = strdup(tmp);
free(tmp);
tmp = NULL;
}
@@ -367,87 +369,103 @@ static core_info_list_t *core_info_list_new(const char *path,
core_info[i].firmware_count = count;
}
if (config_get_string(conf, "supported_extensions", &tmp)
&& !string_is_empty(tmp))
if (config_get_string(conf, "supported_extensions", &tmp))
{
core_info[i].supported_extensions = strdup(tmp);
core_info[i].supported_extensions_list =
string_split(core_info[i].supported_extensions, "|");
if (!string_is_empty(tmp))
{
core_info[i].supported_extensions = strdup(tmp);
core_info[i].supported_extensions_list =
string_split(core_info[i].supported_extensions, "|");
}
free(tmp);
tmp = NULL;
}
if (config_get_string(conf, "authors", &tmp)
&& !string_is_empty(tmp))
if (config_get_string(conf, "authors", &tmp))
{
core_info[i].authors = strdup(tmp);
core_info[i].authors_list =
string_split(core_info[i].authors, "|");
if (!string_is_empty(tmp))
{
core_info[i].authors = strdup(tmp);
core_info[i].authors_list =
string_split(core_info[i].authors, "|");
}
free(tmp);
tmp = NULL;
}
if (config_get_string(conf, "permissions", &tmp)
&& !string_is_empty(tmp))
if (config_get_string(conf, "permissions", &tmp))
{
core_info[i].permissions = strdup(tmp);
core_info[i].permissions_list =
string_split(core_info[i].permissions, "|");
if (!string_is_empty(tmp))
{
core_info[i].permissions = strdup(tmp);
core_info[i].permissions_list =
string_split(core_info[i].permissions, "|");
}
free(tmp);
tmp = NULL;
}
if (config_get_string(conf, "license", &tmp)
&& !string_is_empty(tmp))
if (config_get_string(conf, "license", &tmp))
{
core_info[i].licenses = strdup(tmp);
core_info[i].licenses_list =
string_split(core_info[i].licenses, "|");
if (!string_is_empty(tmp))
{
core_info[i].licenses = strdup(tmp);
core_info[i].licenses_list =
string_split(core_info[i].licenses, "|");
}
free(tmp);
tmp = NULL;
}
if (config_get_string(conf, "categories", &tmp)
&& !string_is_empty(tmp))
if (config_get_string(conf, "categories", &tmp))
{
core_info[i].categories = strdup(tmp);
core_info[i].categories_list =
string_split(core_info[i].categories, "|");
if (!string_is_empty(tmp))
{
core_info[i].categories = strdup(tmp);
core_info[i].categories_list =
string_split(core_info[i].categories, "|");
}
free(tmp);
tmp = NULL;
}
if (config_get_string(conf, "database", &tmp)
&& !string_is_empty(tmp))
if (config_get_string(conf, "database", &tmp))
{
core_info[i].databases = strdup(tmp);
core_info[i].databases_list =
string_split(core_info[i].databases, "|");
if (!string_is_empty(tmp))
{
core_info[i].databases = strdup(tmp);
core_info[i].databases_list =
string_split(core_info[i].databases, "|");
}
free(tmp);
tmp = NULL;
}
if (config_get_string(conf, "notes", &tmp)
&& !string_is_empty(tmp))
if (config_get_string(conf, "notes", &tmp))
{
core_info[i].notes = strdup(tmp);
core_info[i].note_list = string_split(core_info[i].notes, "|");
if (!string_is_empty(tmp))
{
core_info[i].notes = strdup(tmp);
core_info[i].note_list = string_split(core_info[i].notes, "|");
}
free(tmp);
tmp = NULL;
}
if (config_get_string(conf, "required_hw_api", &tmp)
&& !string_is_empty(tmp))
if (config_get_string(conf, "required_hw_api", &tmp))
{
core_info[i].required_hw_api = strdup(tmp);
core_info[i].required_hw_api_list = string_split(core_info[i].required_hw_api, "|");
if (!string_is_empty(tmp))
{
core_info[i].required_hw_api = strdup(tmp);
core_info[i].required_hw_api_list = string_split(core_info[i].required_hw_api, "|");
}
free(tmp);
tmp = NULL;
-6
View File
@@ -126,12 +126,6 @@ else ifneq (,$(findstring win,$(platform)))
endif
endif
ifeq ($(HAVE_BIGENDIAN),1)
CPUOPTS += -DHAVE_BIGENDIAN=1 -DMSB_FIRST
else
CPUOPTS += -DHAVE_BIGENDIAN=0
endif
ifeq ($(HAVE_SSA), 1)
LIBS += $(shell pkg-config libass --libs)
DEFINES += -DHAVE_SSA
+1
View File
@@ -4,6 +4,7 @@
#ifndef __CPU_ARCH_H
#define __CPU_ARCH_H
#include <retro_endianness.h>
#include "7zTypes.h"
#ifdef __cplusplus
-5
View File
@@ -1162,19 +1162,14 @@ void _FAT_directory_entryStat (PARTITION* partition, DIR_ENTRY* entry, struct st
0,
u8array_to_u16 (entry->entryData, DIR_ENTRY_aDate)
);
st->st_spare1 = 0;
st->st_mtime = _FAT_filetime_to_time_t (
u8array_to_u16 (entry->entryData, DIR_ENTRY_mTime),
u8array_to_u16 (entry->entryData, DIR_ENTRY_mDate)
);
st->st_spare2 = 0;
st->st_ctime = _FAT_filetime_to_time_t (
u8array_to_u16 (entry->entryData, DIR_ENTRY_cTime),
u8array_to_u16 (entry->entryData, DIR_ENTRY_cDate)
);
st->st_spare3 = 0;
st->st_blksize = partition->bytesPerSector; /* Prefered file I/O block size */
st->st_blocks = (st->st_size + partition->bytesPerSector - 1) / partition->bytesPerSector; /* File size in blocks */
st->st_spare4[0] = 0;
st->st_spare4[1] = 0;
}
+1
View File
@@ -812,6 +812,7 @@ enum
#endif /* __STB_INCLUDE_STB_TRUETYPE_H__ */
#include <retro_assert.h>
#include <retro_endianness.h>
/* IMPLEMENTATION */
+3 -3
View File
@@ -260,8 +260,8 @@ for f in `ls -v *_${platform}.${EXT}`; do
if [ $platform = "psl1ght" ] ; then
mv -fv ../retroarch_psl1ght.self ../pkg/psl1ght/pkg/USRDIR/cores/"${name}_libretro_${platform}.SELF"
if [ -d ../../dist/info ]; then
mkdir -p ../pkg/psl1ght/USRDIR/cores/info
cp -fv ../../dist/info/"${name}_libretro.info" ../pkg/psl1ght/USRDIR/pkg/cores/info/"${name}_libretro.info"
mkdir -p ../pkg/psl1ght/pkg/USRDIR/cores/info
cp -fv ../../dist/info/"${name}_libretro.info" ../pkg/psl1ght/pkg/USRDIR/cores/info/"${name}_libretro.info"
fi
elif [ $platform = "ps3" ] ; then
if [ $PLATFORM = "ode-ps3" ] ; then
@@ -428,7 +428,7 @@ elif [ $PLATFORM = "cex-ps3" ] ; then
find ../tools/ps3/ps3py/build -name '*.dll' -exec cp {} ../tools/ps3/ps3py \;
../tools/ps3/ps3py/pkg.py --contentid UP0001-SSNE10000_00-0000000000000001 ../pkg/${platform}/SSNE10000/ ../pkg/${platform}/RetroArch.PS3.CEX.PS3.pkg
elif [ $PLATFORM = "psl1ght" ] ; then
pkg.py --contentid UP0001-SSNE10001_00-0000000000000001 ../pkg/psl1ght/pkg/ ../pkg/psl1ght/RetroArch.PSL1GHT.pkg
${PS3DEV}/bin/pkg.py --contentid UP0001-SSNE10001_00-0000000000000001 ../pkg/psl1ght/pkg/ ../pkg/psl1ght/RetroArch.PSL1GHT.pkg
elif [ $PLATFORM = "ode-ps3" ] ; then
rsync -av ../pkg/${platform}_iso/PS3_GAME/USRDIR/cores/*.SELF ../pkg/${platform}/${PLATFORM}/
$SCETOOL_PATH $SCETOOL_FLAGS_ODE ../retroarch-salamander_${platform}.elf ../pkg/${platform}_iso/PS3_GAME/USRDIR/EBOOT.BIN
+2 -2
View File
@@ -2091,8 +2091,8 @@ static void frontend_unix_exitspawn(char *s, size_t len, char *args)
static uint64_t frontend_unix_get_mem_total(void)
{
long pages = sysconf(_SC_PHYS_PAGES);
long page_size = sysconf(_SC_PAGE_SIZE);
uint64_t pages = sysconf(_SC_PHYS_PAGES);
uint64_t page_size = sysconf(_SC_PAGE_SIZE);
return pages * page_size;
}
+210 -17
View File
@@ -51,6 +51,10 @@
#include "../../msg_hash.h"
#include "platform_win32.h"
#ifdef HAVE_NVDA
#include "../../nvdaController.h"
#endif
#ifndef SM_SERVERR2
#define SM_SERVERR2 89
#endif
@@ -717,6 +721,74 @@ static bool frontend_win32_set_fork(enum frontend_fork fork_mode)
#endif
#if defined(_WIN32) && !defined(_XBOX)
static const char *accessibility_win_language_id(const char* language)
{
if (string_is_equal(language,"en"))
return "409";
else if (string_is_equal(language,"it"))
return "410";
else if (string_is_equal(language,"sv"))
return "041d";
else if (string_is_equal(language,"fr"))
return "040c";
else if (string_is_equal(language,"de"))
return "407";
else if (string_is_equal(language,"he"))
return "040d";
else if (string_is_equal(language,"id"))
return "421";
else if (string_is_equal(language,"es"))
return "040a";
else if (string_is_equal(language,"nl"))
return "413";
else if (string_is_equal(language,"ro"))
return "418";
else if (string_is_equal(language,"pt_pt"))
return "816";
else if (string_is_equal(language,"pt_bt") || string_is_equal(language,"pt"))
return "416";
else if (string_is_equal(language,"th"))
return "041e";
else if (string_is_equal(language,"ja"))
return "411";
else if (string_is_equal(language,"sk"))
return "041b";
else if (string_is_equal(language,"hi"))
return "439";
else if (string_is_equal(language,"ar"))
return "401";
else if (string_is_equal(language,"hu"))
return "040e";
else if (string_is_equal(language,"zh_tw") || string_is_equal(language,"zh"))
return "804";
else if (string_is_equal(language,"el"))
return "408";
else if (string_is_equal(language,"ru"))
return "419";
else if (string_is_equal(language,"nb"))
return "414";
else if (string_is_equal(language,"da"))
return "406";
else if (string_is_equal(language,"fi"))
return "040b";
else if (string_is_equal(language,"zh_hk"))
return "0c04";
else if (string_is_equal(language,"zh_cn"))
return "804";
else if (string_is_equal(language,"tr"))
return "041f";
else if (string_is_equal(language,"ko"))
return "412";
else if (string_is_equal(language,"pl"))
return "415";
else if (string_is_equal(language,"cs"))
return "405";
else
return "";
}
static const char *accessibility_win_language_code(const char* language)
{
if (string_is_equal(language,"en"))
@@ -730,9 +802,9 @@ static const char *accessibility_win_language_code(const char* language)
else if (string_is_equal(language,"de"))
return "Microsoft Stefan Desktop";
else if (string_is_equal(language,"he"))
return "Microsoft Hemant Desktop";
else if (string_is_equal(language,"id"))
return "Microsoft Asaf Desktop";
else if (string_is_equal(language,"id"))
return "Microsoft Andika Desktop";
else if (string_is_equal(language,"es"))
return "Microsoft Pablo Desktop";
else if (string_is_equal(language,"nl"))
@@ -806,13 +878,69 @@ static bool create_win32_process(char* cmd)
return true;
}
#ifdef HAVE_SAPI
#define COBJMACROS
#include <sapi.h>
#include <ole2.h>
#endif
#ifdef HAVE_SAPI
static ISpVoice* pVoice = NULL;
#endif
#ifdef HAVE_NVDA
bool USE_POWERSHELL = false;
bool USE_NVDA = true;
#else
bool USE_POWERSHELL = true;
bool USE_NVDA = false;
#endif
bool USE_NVDA_BRAILLE = false;
static bool is_narrator_running_windows(void)
{
DWORD status = 0;
if (pi_set == false)
if (USE_POWERSHELL)
{
if (pi_set == false)
return false;
if (GetExitCodeProcess(g_pi.hProcess, &status))
{
if (status == STILL_ACTIVE)
return true;
}
return false;
if (GetExitCodeProcess(&g_pi, &status) && status == STILL_ACTIVE)
return true;
}
#ifdef HAVE_NVDA
else if (USE_NVDA)
{
long res = nvdaController_testIfRunning();
if (res != 0)
{
/* The running nvda service wasn't found, so revert
back to the powershell method
*/
RARCH_LOG("Error communicating with NVDA\n");
USE_POWERSHELL = true;
USE_NVDA = false;
return false;
}
return false;
}
#endif
#ifdef HAVE_SAPI
else
{
SPVOICESTATUS pStatus;
if (pVoice)
{
ISpVoice_GetStatus(pVoice, &pStatus, NULL);
if (pStatus.dwRunningState == SPRS_IS_SPEAKING)
return true;
}
}
#endif
return false;
}
@@ -822,9 +950,12 @@ static bool accessibility_speak_windows(int speed,
char cmd[1200];
const char *voice = get_user_language_iso639_1(true);
const char *language = accessibility_win_language_code(voice);
const char *langid = accessibility_win_language_id(voice);
bool res = false;
const char* speeds[10] = {"-10", "-7.5", "-5", "-2.5", "0", "2", "4", "6", "8", "10"};
HRESULT hr;
if (speed < 1)
speed = 1;
else if (speed > 10)
@@ -836,21 +967,83 @@ static bool accessibility_speak_windows(int speed,
return true;
}
if (strlen(language) > 0)
snprintf(cmd, sizeof(cmd),
"powershell.exe -NoProfile -WindowStyle Hidden -Command \"Add-Type -AssemblyName System.Speech; $synth = New-Object System.Speech.Synthesis.SpeechSynthesizer; $synth.SelectVoice(\\\"%s\\\"); $synth.Rate = %s; $synth.Speak(\\\"%s\\\");\"", language, speeds[speed-1], (char*) speak_text);
else
snprintf(cmd, sizeof(cmd),
"powershell.exe -NoProfile -WindowStyle Hidden -Command \"Add-Type -AssemblyName System.Speech; $synth = New-Object System.Speech.Synthesis.SpeechSynthesizer; $synth.Rate = %s; $synth.Speak(\\\"%s\\\");\"", speeds[speed-1], (char*) speak_text);
if (pi_set)
terminate_win32_process(g_pi);
res = create_win32_process(cmd);
if (!res)
if (USE_POWERSHELL)
{
pi_set = false;
if (strlen(language) > 0)
snprintf(cmd, sizeof(cmd),
"powershell.exe -NoProfile -WindowStyle Hidden -Command \"Add-Type -AssemblyName System.Speech; $synth = New-Object System.Speech.Synthesis.SpeechSynthesizer; $synth.SelectVoice(\\\"%s\\\"); $synth.Rate = %s; $synth.Speak(\\\"%s\\\");\"", language, speeds[speed-1], (char*) speak_text);
else
snprintf(cmd, sizeof(cmd),
"powershell.exe -NoProfile -WindowStyle Hidden -Command \"Add-Type -AssemblyName System.Speech; $synth = New-Object System.Speech.Synthesis.SpeechSynthesizer; $synth.Rate = %s; $synth.Speak(\\\"%s\\\");\"", speeds[speed-1], (char*) speak_text);
if (pi_set)
terminate_win32_process(g_pi);
res = create_win32_process(cmd);
if (!res)
{
pi_set = false;
return true;
}
pi_set = true;
return true;
}
pi_set = true;
#ifdef HAVE_NVDA
else if (USE_NVDA)
{
long res = nvdaController_testIfRunning();
const size_t cSize = strlen(speak_text) + 1;
wchar_t *wc = malloc(sizeof(wchar_t) * cSize);
mbstowcs(wc, speak_text, cSize);
if (res != 0)
{
RARCH_LOG("Error communicating with NVDA\n");
return false;
}
else
{
nvdaController_cancelSpeech();
}
if (USE_NVDA_BRAILLE)
nvdaController_brailleMessage(wc);
else
{
nvdaController_speakText(wc);
}
return true;
}
#endif
#ifdef HAVE_SAPI
else
{
/* stop the old voice if running */
if (pVoice)
{
CoUninitialize();
ISpVoice_Release(pVoice);
}
pVoice = NULL;
/* Play the new voice */
if (FAILED(CoInitialize(NULL)))
return NULL;
hr = CoCreateInstance(&CLSID_SpVoice, NULL,
CLSCTX_ALL, &IID_ISpVoice, (void **)&pVoice);
if (SUCCEEDED(hr))
{
wchar_t wtext[1200];
snprintf(cmd, sizeof(cmd),
"<rate speed=\"%s\"/><volume level=\"80\"/><lang langid=\"%s\"/>%s", speeds[speed], langid, speak_text);
mbstowcs(wtext, speak_text, sizeof(wtext));
hr = ISpVoice_Speak(pVoice, wtext, SPF_ASYNC /*SVSFlagsAsync*/, NULL);
}
return true;
}
#endif
return true;
}
#endif
-3
View File
@@ -793,9 +793,6 @@ static bool drm_gfx_frame(void *data, const void *frame, unsigned width,
menu_driver_frame(video_info);
#endif
video_info->cb_update_window_title(
video_info->context_data);
/* Update main surface: locate free page, blit and flip. */
drm_surface_update(_drmvars, frame, _drmvars->main_surface);
return true;
+6 -24
View File
@@ -349,8 +349,9 @@ static bool gdi_gfx_frame(void *data, const void *frame,
InvalidateRect(hwnd, NULL, false);
video_info->cb_update_window_title(
video_info->context_data);
if (gdi->ctx_driver->update_window_title)
gdi->ctx_driver->update_window_title(
video_info->context_data);
return true;
}
@@ -490,25 +491,6 @@ static void gdi_set_texture_frame(void *data,
}
}
static void gdi_get_video_output_size(void *data,
unsigned *width, unsigned *height)
{
gfx_ctx_size_t size_data;
size_data.width = width;
size_data.height = height;
video_context_driver_get_video_output_size(&size_data);
}
static void gdi_get_video_output_prev(void *data)
{
video_context_driver_get_video_output_prev();
}
static void gdi_get_video_output_next(void *data)
{
video_context_driver_get_video_output_next();
}
static void gdi_set_video_mode(void *data, unsigned width, unsigned height,
bool fullscreen)
{
@@ -589,9 +571,9 @@ static const video_poke_interface_t gdi_poke_interface = {
gdi_set_video_mode,
win32_get_refresh_rate,
NULL,
gdi_get_video_output_size,
gdi_get_video_output_prev,
gdi_get_video_output_next,
NULL, /* get_video_output_size */
NULL, /* get_video_output_prev */
NULL, /* get_video_output_next */
NULL,
NULL,
NULL,
+5 -4
View File
@@ -3065,8 +3065,8 @@ static bool gl2_frame(void *data, const void *frame,
font_driver_render_msg(gl, msg, NULL, NULL);
}
if (video_info->cb_update_window_title)
video_info->cb_update_window_title(context_data);
if (gl->ctx_driver->update_window_title)
gl->ctx_driver->update_window_title(context_data);
/* Reset state which could easily mess up libretro core. */
if (gl->hw_render_fbo_init)
@@ -3100,12 +3100,13 @@ static bool gl2_frame(void *data, const void *frame,
&& !runloop_is_slowmotion
&& !runloop_is_paused)
{
video_info->cb_swap_buffers(context_data);
if (gl->ctx_driver->swap_buffers)
gl->ctx_driver->swap_buffers(context_data);
glClear(GL_COLOR_BUFFER_BIT);
}
#endif
video_info->cb_swap_buffers(context_data);
gl->ctx_driver->swap_buffers(context_data);
/* check if we are fast forwarding or in menu, if we are ignore hard sync */
if ( gl->have_sync
+5 -4
View File
@@ -869,8 +869,9 @@ static bool gl1_gfx_frame(void *data, const void *frame,
if (msg)
font_driver_render_msg(gl1, msg, NULL, NULL);
video_info->cb_update_window_title(
video_info->context_data);
if (gl1->ctx_driver->update_window_title)
gl1->ctx_driver->update_window_title(
video_info->context_data);
/* Screenshots. */
if (gl1->readback_buffer_screenshot)
@@ -888,12 +889,12 @@ static bool gl1_gfx_frame(void *data, const void *frame,
&& !video_info->runloop_is_slowmotion
&& !video_info->runloop_is_paused)
{
video_info->cb_swap_buffers(video_info->context_data);
gl1->ctx_driver->swap_buffers(video_info->context_data);
glClear(GL_COLOR_BUFFER_BIT);
}
#endif
video_info->cb_swap_buffers(video_info->context_data);
gl1->ctx_driver->swap_buffers(video_info->context_data);
/* check if we are fast forwarding or in menu, if we are ignore hard sync */
if (video_info->hard_sync
+4 -3
View File
@@ -1949,7 +1949,8 @@ static bool gl_core_frame(void *data, const void *frame,
font_driver_render_msg(gl, msg, NULL, NULL);
}
video_info->cb_update_window_title(context_data);
if (gl->ctx_driver->update_window_title)
gl->ctx_driver->update_window_title(context_data);
if (gl->readback_buffer_screenshot)
{
@@ -1973,11 +1974,11 @@ static bool gl_core_frame(void *data, const void *frame,
&& !runloop_is_slowmotion
&& !runloop_is_paused)
{
video_info->cb_swap_buffers(context_data);
gl->ctx_driver->swap_buffers(context_data);
glClear(GL_COLOR_BUFFER_BIT);
}
video_info->cb_swap_buffers(context_data);
gl->ctx_driver->swap_buffers(context_data);
if (video_info->hard_sync &&
!input_driver_nonblock_state &&
+4 -2
View File
@@ -176,6 +176,7 @@ static void render_msg(oga_video_t* vid, go2_surface_t* surface, const char* msg
const struct font_atlas* atlas = vid->font_driver->get_atlas(vid->font);
int msg_width = get_message_width(vid, msg);
int dest_x = MAX(0, width - get_message_width(vid, msg));
int dest_stride = go2_surface_stride_get(surface);
const char* c = msg;
while (*c) {
@@ -202,7 +203,7 @@ static void render_msg(oga_video_t* vid, go2_surface_t* surface, const char* msg
*(dest++) = px;
}
}
dest += go2_surface_stride_get(surface) - g->advance_x * bpp;
dest += dest_stride - g->advance_x * bpp;
source += atlas->width - g->width;
}
@@ -239,10 +240,11 @@ static bool oga_gfx_frame(void *data, const void *frame, unsigned width,
uint8_t* dst = (uint8_t*)go2_surface_map(dst_surface);
int yy = height;
int stride = width * bpp;
int dst_stride = go2_surface_stride_get(dst_surface);
while (yy > 0) {
memcpy(dst, src, stride);
src += pitch;
dst += go2_surface_stride_get(dst_surface);
dst += dst_stride;
--yy;
}
+4 -3
View File
@@ -454,9 +454,10 @@ static bool vg_frame(void *data, const void *frame,
vg_draw_message(vg, msg);
#endif
video_info->cb_update_window_title(
video_info->context_data);
video_info->cb_swap_buffers(video_info->context_data);
if (vg->ctx_driver->update_window_title)
vg->ctx_driver->update_window_title(video_info->context_data);
vg->ctx_driver->swap_buffers(video_info->context_data);
return true;
}
-3
View File
@@ -229,9 +229,6 @@ static bool vga_gfx_frame(void *data, const void *frame,
if (msg)
font_driver_render_msg(data, msg, NULL, NULL);
video_info->cb_update_window_title(
video_info->context_data);
return true;
}
+7 -5
View File
@@ -1659,7 +1659,7 @@ static void vulkan_inject_black_frame(vk_t *vk, video_frame_info_t *video_info,
slock_unlock(vk->context->queue_lock);
#endif
video_info->cb_swap_buffers(context_data);
vk->ctx_driver->swap_buffers(context_data);
}
static bool vulkan_frame(void *data, const void *frame,
@@ -1686,7 +1686,6 @@ static bool vulkan_frame(void *data, const void *frame,
struct font_params *osd_params = (struct font_params*)
&video_info->osd_stat_params;
VkCommandBufferBeginInfo begin_info = {
VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO };
VkRenderPassBeginInfo rp_info = {
@@ -1974,7 +1973,7 @@ static bool vulkan_frame(void *data, const void *frame,
if (osd_params)
font_driver_render_msg(vk,
stat_text,
&osd_params, NULL);
osd_params, NULL);
}
#endif
@@ -2116,10 +2115,13 @@ static bool vulkan_frame(void *data, const void *frame,
slock_unlock(vk->context->queue_lock);
#endif
video_info->cb_swap_buffers(context_data);
vk->ctx_driver->swap_buffers(context_data);
if (!vk->context->swap_interval_emulation_lock)
video_info->cb_update_window_title(context_data);
{
if (vk->ctx_driver->update_window_title)
vk->ctx_driver->update_window_title(context_data);
}
/* Handle spurious swapchain invalidations as soon as we can,
* i.e. right after swap buffers. */
+15 -8
View File
@@ -89,6 +89,7 @@ static void gfx_display_wiiu_draw(gfx_display_ctx_draw_t *draw,
}
}
/* TODO come up with a better check for "not all vertexes are the same color" */
else if (draw->coords->vertex || draw->coords->color[0] != draw->coords->color[12])
{
if (wiiu->vertex_cache_tex.current + 4 > wiiu->vertex_cache_tex.size)
@@ -106,14 +107,20 @@ static void gfx_display_wiiu_draw(gfx_display_ctx_draw_t *draw,
if (!draw->coords->vertex)
{
v[0].pos.x = 0.0f;
v[0].pos.y = 1.0f;
v[1].pos.x = 1.0f;
v[1].pos.y = 1.0f;
v[2].pos.x = 0.0f;
v[2].pos.y = 0.0f;
v[3].pos.x = 1.0f;
v[3].pos.y = 0.0f;
/* Convert the libretro bottom-up coordinate system to GX2 - low y at
the top of the screen, large y at the bottom
The compiler will optimise 90% of this out anyway */
float y = -(draw->y + draw->height - video_height);
/* Remember: this is a triangle strip, not a quad, draw in a Z shape
Bottom-left, right, top-left, right */
v[0].pos.x = (draw->x ) / video_width;
v[0].pos.y = (y + draw->height) / video_height;
v[1].pos.x = (draw->x + draw->width ) / video_width;
v[1].pos.y = (y + draw->height) / video_height;
v[2].pos.x = (draw->x ) / video_width;
v[2].pos.y = (y ) / video_height;
v[3].pos.x = (draw->x + draw->width ) / video_width;
v[3].pos.y = (y ) / video_height;
}
else
{
+9 -9
View File
@@ -243,7 +243,7 @@ static void ctr_font_render_line(
GPU_TEVSOURCES(GPU_TEXTURE0, GPU_CONSTANT, 0),
GPU_TEVSOURCES(GPU_TEXTURE0, GPU_CONSTANT, 0),
0,
GPU_TEVOPERANDS(GPU_TEVOP_RGB_SRC_R, GPU_TEVOP_RGB_SRC_ALPHA, 0),
GPU_TEVOPERANDS(GPU_TEVOP_RGB_SRC_ALPHA, 0, 0),
GPU_MODULATE, GPU_MODULATE,
color);
@@ -329,7 +329,7 @@ static void ctr_font_render_message(
return;
}
line_height = scale / line_metrics->height;
line_height = (float)line_metrics->height * scale / (float)height;
for (;;)
{
@@ -369,8 +369,8 @@ static void ctr_font_render_msg(
alpha, r_dark, g_dark, b_dark, alpha_dark;
ctr_font_t * font = (ctr_font_t*)data;
ctr_video_t *ctr = (ctr_video_t*)userdata;
unsigned width = ctr->vp.width;
unsigned height = ctr->vp.height;
unsigned width = ctr->vp.full_width;
unsigned height = ctr->vp.full_height;
settings_t *settings = config_get_ptr();
float video_msg_pos_x = settings->floats.video_msg_pos_x;
float video_msg_pos_y = settings->floats.video_msg_pos_y;
@@ -397,7 +397,7 @@ static void ctr_font_render_msg(
b = FONT_COLOR_GET_BLUE(params->color);
alpha = FONT_COLOR_GET_ALPHA(params->color);
color = params->color;
color = COLOR_ABGR(r, g, b, alpha);
}
else
{
@@ -412,10 +412,10 @@ static void ctr_font_render_msg(
alpha = 255;
color = COLOR_ABGR(r, g, b, alpha);
drop_x = -2;
drop_y = -2;
drop_mod = 0.3f;
drop_alpha = 1.0f;
drop_x = 1;
drop_y = -1;
drop_mod = 0.0f;
drop_alpha = 0.75f;
}
max_glyphs = strlen(msg);
+2 -2
View File
@@ -299,8 +299,8 @@ static void wiiu_font_render_msg(
alpha, r_dark, g_dark, b_dark, alpha_dark;
wiiu_video_t *wiiu = (wiiu_video_t*)userdata;
wiiu_font_t *font = (wiiu_font_t*)data;
unsigned width = wiiu->vp.width;
unsigned height = wiiu->vp.height;
unsigned width = wiiu->vp.full_width;
unsigned height = wiiu->vp.full_height;
settings_t *settings = config_get_ptr();
float video_msg_pos_x = settings->floats.video_msg_pos_x;
float video_msg_pos_y = settings->floats.video_msg_pos_y;
+17 -7
View File
@@ -431,7 +431,7 @@ public:
unsigned width, unsigned height,
bool linear,
bool mipmap,
GLenum address);
gl_core_filter_chain_address address);
~StaticTexture();
StaticTexture(StaticTexture&&) = delete;
@@ -449,17 +449,27 @@ private:
StaticTexture::StaticTexture(string id_, GLuint image_,
unsigned width, unsigned height, bool linear, bool mipmap,
GLenum address)
gl_core_filter_chain_address address)
: id(std::move(id_)), image(image_)
{
texture.texture.width = width;
GLenum gl_address = address_to_gl(address);
texture.filter = GL_CORE_FILTER_CHAIN_NEAREST;
texture.mip_filter = GL_CORE_FILTER_CHAIN_NEAREST;
texture.address = address;
texture.texture.width = width;
texture.texture.height = height;
texture.texture.format = 0;
texture.texture.image = image;
texture.texture.image = image;
if (linear)
texture.filter = GL_CORE_FILTER_CHAIN_LINEAR;
if (mipmap && linear)
texture.mip_filter = GL_CORE_FILTER_CHAIN_LINEAR;
glBindTexture(GL_TEXTURE_2D, image);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, address);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, address);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, gl_address);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, gl_address);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, linear ? GL_LINEAR : GL_NEAREST);
if (linear && mipmap)
@@ -2126,7 +2136,7 @@ static unique_ptr<gl_core_shader::StaticTexture> gl_core_filter_chain_load_lut(
tex, image.width, image.height,
shader->filter != RARCH_FILTER_NEAREST,
levels > 1,
gl_core_shader::address_to_gl(gl_core_shader::wrap_to_address(shader->wrap))));
gl_core_shader::wrap_to_address(shader->wrap)));
}
static bool gl_core_filter_chain_load_luts(
+242 -211
View File
@@ -16,6 +16,7 @@
*/
#include <retro_miscellaneous.h>
#include <retro_inline.h>
#include <lists/file_list.h>
#include <queues/fifo_queue.h>
@@ -74,21 +75,29 @@ static float color_task_progress_bar[16] = COLOR_HEX_TO_FLOAT(0x22B14C, 1.0f);
static uint64_t gfx_widgets_frame_count = 0;
/* Font data */
static font_data_t *font_regular = NULL;
static font_data_t *font_bold = NULL;
font_data_t* gfx_widgets_get_font_regular(void)
typedef struct
{
return font_regular;
gfx_widget_font_data_t regular;
gfx_widget_font_data_t bold;
gfx_widget_font_data_t msg_queue;
} gfx_widget_fonts_t;
static gfx_widget_fonts_t gfx_widget_fonts;
gfx_widget_font_data_t* gfx_widgets_get_font_regular(void)
{
return &gfx_widget_fonts.regular;
}
font_data_t* gfx_widgets_get_font_bold(void)
gfx_widget_font_data_t* gfx_widgets_get_font_bold(void)
{
return font_bold;
return &gfx_widget_fonts.bold;
}
static video_font_raster_block_t font_raster_regular;
static video_font_raster_block_t font_raster_bold;
gfx_widget_font_data_t* gfx_widgets_get_font_msg_queue(void)
{
return &gfx_widget_fonts.msg_queue;
}
static float gfx_widgets_pure_white[16] = {
1.00, 1.00, 1.00, 1.00,
@@ -288,19 +297,12 @@ static uintptr_t ai_service_overlay_texture = 0;
/* Metrics */
#define BASE_FONT_SIZE 32.0f
#define MSG_QUEUE_FONT_SIZE (BASE_FONT_SIZE * 0.69f)
static float last_scale_factor = 0.0f;
static float msg_queue_text_scale_factor = 0.0f;
static float widget_font_size = 0.0f;
float gfx_widgets_get_font_size(void)
{
return widget_font_size;
}
static unsigned simple_widget_padding = 0;
static unsigned simple_widget_height = 0;
static unsigned glyph_width = 0;
unsigned gfx_widgets_get_padding(void)
{
@@ -312,16 +314,10 @@ unsigned gfx_widgets_get_height(void)
return simple_widget_height;
}
unsigned gfx_widgets_get_glyph_width(void)
{
return glyph_width;
}
static unsigned msg_queue_height;
static unsigned msg_queue_icon_size_x;
static unsigned msg_queue_icon_size_y;
static unsigned msg_queue_spacing;
static unsigned msg_queue_glyph_width;
static unsigned msg_queue_rect_start_x;
static unsigned msg_queue_internal_icon_size;
static unsigned msg_queue_internal_icon_offset;
@@ -332,7 +328,6 @@ static unsigned msg_queue_default_rect_width;
static unsigned msg_queue_task_text_start_x;
static unsigned msg_queue_regular_padding_x;
static unsigned msg_queue_regular_text_start;
static unsigned msg_queue_regular_text_base_y;
static unsigned msg_queue_task_rect_start_x;
static unsigned msg_queue_task_hourglass_x;
@@ -463,8 +458,8 @@ void gfx_widgets_msg_queue_push(
msg_widget->unfolded = true;
msg_widget->width = font_driver_get_message_width(
font_regular, title, msg_widget->msg_len,
msg_queue_text_scale_factor) + simple_widget_padding/2;
gfx_widget_fonts.msg_queue.font, title, msg_widget->msg_len, 1) +
simple_widget_padding/2;
task->frontend_userdata = msg_widget;
@@ -481,9 +476,8 @@ void gfx_widgets_msg_queue_push(
? msg_queue_default_rect_width_menu_alive
: msg_queue_default_rect_width;
unsigned text_width = font_driver_get_message_width(
font_regular, title, title_length, msg_queue_text_scale_factor);
msg_widget->text_height = msg_queue_text_scale_factor
* widget_font_size;
gfx_widget_fonts.msg_queue.font, title, title_length, 1);
msg_widget->text_height = gfx_widget_fonts.msg_queue.line_height;
/* Text is too wide, split it into two lines */
if (text_width > width)
@@ -497,13 +491,10 @@ void gfx_widgets_msg_queue_push(
word_wrap(msg, msg, (title_length * width) / text_width,
false, 2);
msg_widget->text_height *= 2.5f;
msg_widget->text_height *= 2;
}
else
{
width = text_width;
msg_widget->text_height *= 1.35f;
}
width = text_width;
msg_widget->msg = msg;
msg_widget->msg_len = (unsigned)strlen(msg);
@@ -525,7 +516,7 @@ void gfx_widgets_msg_queue_push(
{
unsigned len = (unsigned)strlen(task->title);
unsigned new_width = font_driver_get_message_width(
font_regular, task->title, len, msg_queue_text_scale_factor);
gfx_widget_fonts.msg_queue.font, task->title, len, 1);
if (msg_widget->msg_new)
{
@@ -850,6 +841,47 @@ static void gfx_widgets_draw_icon_blend(
}
#endif
void gfx_widgets_draw_text(
gfx_widget_font_data_t* font_data,
const char *text,
float x, float y,
int width, int height,
uint32_t color,
enum text_alignment text_align,
bool draw_outside)
{
if (!font_data || string_is_empty(text))
return;
gfx_display_draw_text(
font_data->font,
text,
x, y,
width, height,
color,
text_align,
1.0f,
false,
0.0f,
draw_outside);
font_data->usage_count++;
}
void gfx_widgets_flush_text(
unsigned video_width, unsigned video_height,
gfx_widget_font_data_t* font_data)
{
/* Flushing is slow - only do it if font
* has actually been used */
if (!font_data || (font_data->usage_count == 0))
return;
font_driver_flush(video_width, video_height, font_data->font);
font_data->raster_block.carr.coords.vertices = 0;
font_data->usage_count = 0;
}
float gfx_widgets_get_thumbnail_scale_factor(
const float dst_width, const float dst_height,
const float image_width, const float image_height)
@@ -1084,7 +1116,7 @@ static int gfx_widgets_draw_indicator(
unsigned height = simple_widget_height;
const char *txt = msg_hash_to_str(msg);
width = font_driver_get_message_width(font_regular, txt, (unsigned)strlen(txt), 1) + simple_widget_padding*2;
width = font_driver_get_message_width(gfx_widget_fonts.regular.font, txt, (unsigned)strlen(txt), 1) + simple_widget_padding*2;
gfx_display_draw_quad(userdata,
video_width, video_height,
@@ -1094,14 +1126,12 @@ static int gfx_widgets_draw_indicator(
gfx_widgets_backdrop_orig
);
gfx_display_draw_text(font_regular,
txt,
top_right_x_advance - width + simple_widget_padding, widget_font_size + simple_widget_padding/4,
video_width, video_height,
0xFFFFFFFF, TEXT_ALIGN_LEFT,
1.0f,
false, 0, false
);
gfx_widgets_draw_text(&gfx_widget_fonts.regular,
txt,
top_right_x_advance - width + simple_widget_padding, y + (height / 2.0f) + gfx_widget_fonts.regular.line_centre_offset,
video_width, video_height,
0xFFFFFFFF, TEXT_ALIGN_LEFT,
false);
}
return width;
@@ -1120,6 +1150,7 @@ static void gfx_widgets_draw_task_msg(
unsigned rect_y;
unsigned rect_width;
unsigned rect_height;
float text_y_base;
float *msg_queue_current_background;
float *msg_queue_current_bar;
@@ -1131,7 +1162,7 @@ static void gfx_widgets_draw_task_msg(
if (msg->msg_new)
draw_msg_new = !string_is_equal(msg->msg_new, msg->msg);
task_percentage_offset = glyph_width * (msg->task_error ? 12 : 5) + simple_widget_padding * 1.25f; /*11 = strlen("Task failed")+1 */
task_percentage_offset = gfx_widget_fonts.msg_queue.glyph_width * (msg->task_error ? 12 : 5) + simple_widget_padding * 1.25f; /*11 = strlen("Task failed")+1 */
if (msg->task_finished)
{
@@ -1210,64 +1241,52 @@ static void gfx_widgets_draw_task_msg(
gfx_display_blend_end(userdata);
/* Text */
text_y_base = video_height - msg->offset_y + msg_queue_height/4.0f + gfx_widget_fonts.msg_queue.line_centre_offset;
if (draw_msg_new)
{
font_driver_flush(video_width, video_height, font_regular);
font_raster_regular.carr.coords.vertices = 0;
gfx_widgets_flush_text(video_width, video_height, &gfx_widget_fonts.msg_queue);
gfx_display_scissor_begin(userdata,
video_width, video_height,
rect_x, rect_y, rect_width, rect_height);
gfx_display_draw_text(font_regular,
msg->msg_new,
gfx_widgets_draw_text(&gfx_widget_fonts.msg_queue,
msg->msg_new,
msg_queue_task_text_start_x,
text_y_base - msg_queue_height/2.0f + msg->msg_transition_animation,
video_width, video_height,
text_color,
TEXT_ALIGN_LEFT,
true);
}
gfx_widgets_draw_text(&gfx_widget_fonts.msg_queue,
msg->msg,
msg_queue_task_text_start_x,
video_height - msg->offset_y + msg_queue_text_scale_factor * widget_font_size + msg_queue_height/4 - widget_font_size/2.25f - msg_queue_height/2 + msg->msg_transition_animation,
text_y_base + msg->msg_transition_animation,
video_width, video_height,
text_color,
TEXT_ALIGN_LEFT,
msg_queue_text_scale_factor,
false,
0,
true
);
}
gfx_display_draw_text(font_regular,
msg->msg,
msg_queue_task_text_start_x,
video_height - msg->offset_y + msg_queue_text_scale_factor * widget_font_size + msg_queue_height/4 - widget_font_size/2.25f + msg->msg_transition_animation,
video_width, video_height,
text_color,
TEXT_ALIGN_LEFT,
msg_queue_text_scale_factor,
false,
0,
true
);
true);
if (draw_msg_new)
{
font_driver_flush(video_width, video_height, font_regular);
font_raster_regular.carr.coords.vertices = 0;
gfx_widgets_flush_text(video_width, video_height, &gfx_widget_fonts.msg_queue);
gfx_display_scissor_end(userdata,
video_width, video_height);
}
/* Progress text */
text_color = COLOR_TEXT_ALPHA(0xFFFFFF00, (unsigned)(msg->alpha/2*255.0f));
gfx_display_draw_text(font_regular,
gfx_widgets_draw_text(&gfx_widget_fonts.msg_queue,
task_percentage,
msg_queue_rect_start_x - msg_queue_icon_size_x + rect_width - msg_queue_glyph_width,
video_height - msg->offset_y + msg_queue_text_scale_factor * widget_font_size + msg_queue_height/4 - widget_font_size/2.25f,
msg_queue_rect_start_x - msg_queue_icon_size_x + rect_width - gfx_widget_fonts.msg_queue.glyph_width,
text_y_base,
video_width, video_height,
text_color,
TEXT_ALIGN_RIGHT,
msg_queue_text_scale_factor,
false,
0,
true
);
true);
}
static void gfx_widgets_draw_regular_msg(
@@ -1290,11 +1309,9 @@ static void gfx_widgets_draw_regular_msg(
if (!msg->unfolded || msg->unfolding)
{
font_driver_flush(video_width, video_height, font_regular);
font_driver_flush(video_width, video_height, font_bold);
font_raster_regular.carr.coords.vertices = 0;
font_raster_bold.carr.coords.vertices = 0;
gfx_widgets_flush_text(video_width, video_height, &gfx_widget_fonts.regular);
gfx_widgets_flush_text(video_width, video_height, &gfx_widget_fonts.bold);
gfx_widgets_flush_text(video_width, video_height, &gfx_widget_fonts.msg_queue);
gfx_display_scissor_begin(userdata,
video_width, video_height,
@@ -1333,23 +1350,20 @@ static void gfx_widgets_draw_regular_msg(
/* Text */
text_color = COLOR_TEXT_ALPHA(0xFFFFFF00, (unsigned)(msg->alpha*255.0f));
gfx_display_draw_text(font_regular,
gfx_widgets_draw_text(&gfx_widget_fonts.msg_queue,
msg->msg,
msg_queue_regular_text_start - ((1.0f-msg->unfold) * msg->width/2),
video_height - msg->offset_y + msg_queue_regular_text_base_y - msg->text_height/2,
video_height - msg->offset_y + (msg_queue_height - msg->text_height)/2.0f + gfx_widget_fonts.msg_queue.line_ascender,
video_width, video_height,
text_color,
TEXT_ALIGN_LEFT,
msg_queue_text_scale_factor, false, 0, true
);
true);
if (!msg->unfolded || msg->unfolding)
{
font_driver_flush(video_width, video_height, font_regular);
font_driver_flush(video_width, video_height, font_bold);
font_raster_regular.carr.coords.vertices = 0;
font_raster_bold.carr.coords.vertices = 0;
gfx_widgets_flush_text(video_width, video_height, &gfx_widget_fonts.regular);
gfx_widgets_flush_text(video_width, video_height, &gfx_widget_fonts.bold);
gfx_widgets_flush_text(video_width, video_height, &gfx_widget_fonts.msg_queue);
gfx_display_scissor_end(userdata,
video_width, video_height);
@@ -1439,27 +1453,23 @@ static void gfx_widgets_draw_load_content_animation(
);
gfx_display_blend_end(userdata);
/* Text */
gfx_display_draw_text(font_bold,
load_content_animation_content_name,
video_width / 2,
video_height / 2 + (175 + 25) * last_scale_factor + text_offset,
video_width,
video_height,
text_color,
TEXT_ALIGN_CENTER,
1,
false,
0,
false
);
/* Text
* TODO/FIXME: Check vertical alignment - where is
* this text actually meant to go...? */
gfx_widgets_draw_text(&gfx_widget_fonts.bold,
load_content_animation_content_name,
video_width / 2,
video_height / 2 + (175 + 25) * last_scale_factor + text_offset + gfx_widget_fonts.bold.line_centre_offset,
video_width,
video_height,
text_color,
TEXT_ALIGN_CENTER,
false);
/* Flush text layer */
font_driver_flush(video_width, video_height, font_regular);
font_driver_flush(video_width, video_height, font_bold);
font_raster_regular.carr.coords.vertices = 0;
font_raster_bold.carr.coords.vertices = 0;
gfx_widgets_flush_text(video_width, video_height, &gfx_widget_fonts.regular);
gfx_widgets_flush_text(video_width, video_height, &gfx_widget_fonts.bold);
gfx_widgets_flush_text(video_width, video_height, &gfx_widget_fonts.msg_queue);
/* Everything disappears */
gfx_widgets_draw_backdrop(userdata,
@@ -1468,6 +1478,18 @@ static void gfx_widgets_draw_load_content_animation(
#endif
}
static void INLINE gfx_widgets_font_bind(gfx_widget_font_data_t *font_data)
{
font_driver_bind_block(font_data->font, &font_data->raster_block);
font_data->raster_block.carr.coords.vertices = 0;
font_data->usage_count = 0;
}
static void INLINE gfx_widgets_font_unbind(gfx_widget_font_data_t *font_data)
{
font_driver_bind_block(font_data->font, NULL);
}
void gfx_widgets_frame(void *data)
{
/* (Pointless) optimisation: allocating these
@@ -1512,11 +1534,9 @@ void gfx_widgets_frame(void *data)
gfx_display_set_viewport(video_width, video_height);
/* Font setup */
font_driver_bind_block(font_regular, &font_raster_regular);
font_driver_bind_block(font_bold, &font_raster_bold);
font_raster_regular.carr.coords.vertices = 0;
font_raster_bold.carr.coords.vertices = 0;
gfx_widgets_font_bind(&gfx_widget_fonts.regular);
gfx_widgets_font_bind(&gfx_widget_fonts.bold);
gfx_widgets_font_bind(&gfx_widget_fonts.msg_queue);
#ifdef HAVE_TRANSLATE
/* AI Service overlay */
@@ -1650,33 +1670,30 @@ void gfx_widgets_frame(void *data)
gfx_widgets_backdrop_orig);
/* Title */
gfx_display_draw_text(font_regular,
msg_hash_to_str(MSG_ACHIEVEMENT_UNLOCKED),
cheevo_height + simple_widget_padding - unfold_offet,
widget_font_size * 1.9f + cheevo_y,
video_width, video_height,
TEXT_COLOR_FAINT,
TEXT_ALIGN_LEFT,
1, false, 0, true
);
gfx_widgets_draw_text(&gfx_widget_fonts.regular,
msg_hash_to_str(MSG_ACHIEVEMENT_UNLOCKED),
cheevo_height + simple_widget_padding - unfold_offet,
cheevo_y + gfx_widget_fonts.regular.line_height + gfx_widget_fonts.regular.line_ascender,
video_width, video_height,
TEXT_COLOR_FAINT,
TEXT_ALIGN_LEFT,
true);
/* Title */
/* Cheevo name */
/* TODO: is a ticker necessary ? */
gfx_display_draw_text(font_regular,
cheevo_popup_queue[cheevo_popup_queue_read_index].title,
cheevo_height + simple_widget_padding - unfold_offet, widget_font_size * 2.9f + cheevo_y,
video_width, video_height,
TEXT_COLOR_INFO,
TEXT_ALIGN_LEFT,
1, false, 0, true
);
gfx_widgets_draw_text(&gfx_widget_fonts.regular,
cheevo_popup_queue[cheevo_popup_queue_read_index].title,
cheevo_height + simple_widget_padding - unfold_offet,
cheevo_y + cheevo_height - gfx_widget_fonts.regular.line_height - gfx_widget_fonts.regular.line_descender,
video_width, video_height,
TEXT_COLOR_INFO,
TEXT_ALIGN_LEFT,
true);
if (scissor_me_timbers)
{
font_driver_flush(video_width, video_height, font_regular);
font_raster_regular.carr.coords.vertices = 0;
gfx_widgets_flush_text(video_width, video_height, &gfx_widget_fonts.regular);
gfx_display_scissor_end(userdata,
video_width, video_height);
}
@@ -1710,7 +1727,7 @@ void gfx_widgets_frame(void *data)
{
const char *text = *gfx_widgets_fps_text == '\0' ? "N/A" : gfx_widgets_fps_text;
int text_width = font_driver_get_message_width(font_regular, text, (unsigned)strlen(text), 1.0f);
int text_width = font_driver_get_message_width(gfx_widget_fonts.regular.font, text, (unsigned)strlen(text), 1.0f);
int total_width = text_width + simple_widget_padding * 2;
int fps_text_x = top_right_x_advance - simple_widget_padding - text_width;
@@ -1729,14 +1746,13 @@ void gfx_widgets_frame(void *data)
gfx_widgets_backdrop_orig
);
gfx_display_draw_text(font_regular,
text,
fps_text_x, widget_font_size + simple_widget_padding/4,
video_width, video_height,
0xFFFFFFFF,
TEXT_ALIGN_LEFT,
1, false,0, true
);
gfx_widgets_draw_text(&gfx_widget_fonts.regular,
text,
fps_text_x, simple_widget_height/2.0f + gfx_widget_fonts.regular.line_centre_offset,
video_width, video_height,
0xFFFFFFFF,
TEXT_ALIGN_LEFT,
true);
}
/* Indicators */
@@ -1754,7 +1770,7 @@ void gfx_widgets_frame(void *data)
video_width,
video_height,
gfx_widgets_icons_textures[MENU_WIDGETS_ICON_FAST_FORWARD], (fps_show ? simple_widget_height : 0), top_right_x_advance,
MSG_PAUSED);
MSG_FAST_FORWARD);
if (widgets_is_rewinding)
top_right_x_advance -= gfx_widgets_draw_indicator(
@@ -1788,13 +1804,16 @@ void gfx_widgets_frame(void *data)
else
#endif
{
font_driver_flush(video_width, video_height, font_regular);
font_driver_flush(video_width, video_height, font_bold);
font_raster_regular.carr.coords.vertices = 0;
font_raster_bold.carr.coords.vertices = 0;
gfx_widgets_flush_text(video_width, video_height, &gfx_widget_fonts.regular);
gfx_widgets_flush_text(video_width, video_height, &gfx_widget_fonts.bold);
gfx_widgets_flush_text(video_width, video_height, &gfx_widget_fonts.msg_queue);
}
/* Unbind fonts */
gfx_widgets_font_unbind(&gfx_widget_fonts.regular);
gfx_widgets_font_unbind(&gfx_widget_fonts.bold);
gfx_widgets_font_unbind(&gfx_widget_fonts.msg_queue);
gfx_display_unset_viewport(video_width, video_height);
}
@@ -1861,71 +1880,80 @@ void gfx_widgets_deinit(void)
gfx_widgets_free();
}
static void gfx_widgets_font_init(
gfx_widget_font_data_t *font_data,
bool is_threaded, char *font_path, float font_size)
{
float scaled_size = font_size * last_scale_factor;
int glyph_width = 0;
/* Free existing font */
if (font_data->font)
{
gfx_display_font_free(font_data->font);
font_data->font = NULL;
}
/* Get approximate glyph width */
font_data->glyph_width = scaled_size * (3.0f / 4.0f);
/* Create font */
font_data->font = gfx_display_font_file(font_path, scaled_size, is_threaded);
/* Get font metadata */
glyph_width = font_driver_get_message_width(font_data->font, "a", 1, 1.0f);
if (glyph_width > 0)
font_data->glyph_width = (float)glyph_width;
font_data->line_height = (float)font_driver_get_line_height(font_data->font, 1.0f);
font_data->line_ascender = (float)font_driver_get_line_ascender(font_data->font, 1.0f);
font_data->line_descender = (float)font_driver_get_line_descender(font_data->font, 1.0f);
font_data->line_centre_offset = (float)font_driver_get_line_centre_offset(font_data->font, 1.0f);
font_data->usage_count = 0;
}
static void gfx_widgets_layout(
bool is_threaded, const char *dir_assets, char *font_path)
{
size_t i;
int font_height = 0;
/* Base font size must be determined first
* > Note that size must be at least 2,
* otherwise gfx_display_font_file() will
* generate a heap-buffer-overflow */
widget_font_size = BASE_FONT_SIZE * last_scale_factor;
widget_font_size = (widget_font_size > 2.0f) ? widget_font_size : 2.0f;
/* Initialise fonts */
/* > Free existing */
if (font_regular)
{
gfx_display_font_free(font_regular);
font_regular = NULL;
}
if (font_bold)
{
gfx_display_font_free(font_bold);
font_bold = NULL;
}
/* > Create new */
if (string_is_empty(font_path))
{
char ozone_path[PATH_MAX_LENGTH];
char font_path[PATH_MAX_LENGTH];
char font_file[PATH_MAX_LENGTH];
ozone_path[0] = '\0';
font_path[0] = '\0';
font_file[0] = '\0';
/* Base path */
fill_pathname_join(ozone_path, dir_assets, "ozone", sizeof(ozone_path));
/* Create regular font */
fill_pathname_join(font_path, ozone_path, "regular.ttf", sizeof(font_path));
font_regular = gfx_display_font_file(font_path, widget_font_size, is_threaded);
fill_pathname_join(font_file, ozone_path, "regular.ttf", sizeof(font_file));
gfx_widgets_font_init(&gfx_widget_fonts.regular, is_threaded, font_file, BASE_FONT_SIZE);
/* Create bold font */
fill_pathname_join(font_path, ozone_path, "bold.ttf", sizeof(font_path));
font_bold = gfx_display_font_file(font_path, widget_font_size, is_threaded);
fill_pathname_join(font_file, ozone_path, "bold.ttf", sizeof(font_file));
gfx_widgets_font_init(&gfx_widget_fonts.bold, is_threaded, font_file, BASE_FONT_SIZE);
/* Create msg_queue font */
fill_pathname_join(font_file, ozone_path, "regular.ttf", sizeof(font_file));
gfx_widgets_font_init(&gfx_widget_fonts.msg_queue, is_threaded, font_file, MSG_QUEUE_FONT_SIZE);
}
else
{
/* Load fonts from user-supplied path */
font_regular = gfx_display_font_file(font_path, widget_font_size, is_threaded);
font_bold = gfx_display_font_file(font_path, widget_font_size, is_threaded);
gfx_widgets_font_init(&gfx_widget_fonts.regular, is_threaded, font_path, BASE_FONT_SIZE);
gfx_widgets_font_init(&gfx_widget_fonts.bold, is_threaded, font_path, BASE_FONT_SIZE);
gfx_widgets_font_init(&gfx_widget_fonts.msg_queue, is_threaded, font_path, MSG_QUEUE_FONT_SIZE);
}
/* > Get actual font size */
font_height = font_driver_get_line_height(font_regular, 1.0f);
if (font_height > 0)
widget_font_size = (float)font_height;
/* Calculate dimensions */
simple_widget_padding = widget_font_size * 2.0f/3.0f;
simple_widget_height = widget_font_size + simple_widget_padding;
glyph_width = font_driver_get_message_width(font_regular, "a", 1, 1);
simple_widget_padding = gfx_widget_fonts.regular.line_height * 2.0f/3.0f;
simple_widget_height = gfx_widget_fonts.regular.line_height + simple_widget_padding;
msg_queue_height = widget_font_size * 2.5f;
msg_queue_height = gfx_widget_fonts.msg_queue.line_height * 2.5f * (BASE_FONT_SIZE / MSG_QUEUE_FONT_SIZE);
if (msg_queue_has_icons)
{
@@ -1938,9 +1966,7 @@ static void gfx_widgets_layout(
msg_queue_icon_size_y = 0;
}
msg_queue_text_scale_factor = 0.69f;
msg_queue_spacing = msg_queue_height / 3;
msg_queue_glyph_width = glyph_width * msg_queue_text_scale_factor;
msg_queue_rect_start_x = msg_queue_spacing + msg_queue_icon_size_x;
msg_queue_internal_icon_size = msg_queue_icon_size_y;
msg_queue_internal_icon_offset = (msg_queue_icon_size_y - msg_queue_internal_icon_size)/2;
@@ -1957,16 +1983,15 @@ static void gfx_widgets_layout(
msg_queue_task_text_start_x = msg_queue_task_rect_start_x + msg_queue_height/2;
if (!gfx_widgets_icons_textures[MENU_WIDGETS_ICON_HOURGLASS])
msg_queue_task_text_start_x -= msg_queue_glyph_width*2;
msg_queue_task_text_start_x -= gfx_widget_fonts.msg_queue.glyph_width * 2.0f;
msg_queue_regular_text_start = msg_queue_rect_start_x + msg_queue_regular_padding_x;
msg_queue_regular_text_base_y = widget_font_size * msg_queue_text_scale_factor + msg_queue_height/2;
msg_queue_task_hourglass_x = msg_queue_rect_start_x - msg_queue_icon_size_x;
generic_message_height = widget_font_size * 2;
generic_message_height = gfx_widget_fonts.regular.line_height * 2.0f;
msg_queue_default_rect_width_menu_alive = msg_queue_glyph_width * 40;
msg_queue_default_rect_width_menu_alive = gfx_widget_fonts.msg_queue.glyph_width * 40.0f;
msg_queue_default_rect_width = last_video_width - msg_queue_regular_text_start - (2 * simple_widget_padding);
#ifdef HAVE_MENU
@@ -2065,6 +2090,15 @@ static void gfx_widgets_context_reset(bool is_threaded,
video_driver_monitor_reset();
}
static void INLINE gfx_widgets_font_free(gfx_widget_font_data_t *font_data)
{
if (font_data->font)
gfx_display_font_free(font_data->font);
font_data->font = NULL;
font_data->usage_count = 0;
}
static void gfx_widgets_context_destroy(void)
{
size_t i;
@@ -2092,13 +2126,9 @@ static void gfx_widgets_context_destroy(void)
msg_queue_icon_rect = 0;
/* Fonts */
if (font_regular)
gfx_display_font_free(font_regular);
if (font_bold)
gfx_display_font_free(font_bold);
font_regular = NULL;
font_bold = NULL;
gfx_widgets_font_free(&gfx_widget_fonts.regular);
gfx_widgets_font_free(&gfx_widget_fonts.bold);
gfx_widgets_font_free(&gfx_widget_fonts.msg_queue);
}
#ifdef HAVE_CHEEVOS
@@ -2198,8 +2228,9 @@ static void gfx_widgets_free(void)
#endif
/* Font */
video_coord_array_free(&font_raster_regular.carr);
video_coord_array_free(&font_raster_bold.carr);
video_coord_array_free(&gfx_widget_fonts.regular.raster_block.carr);
video_coord_array_free(&gfx_widget_fonts.bold.raster_block.carr);
video_coord_array_free(&gfx_widget_fonts.msg_queue.raster_block.carr);
font_driver_bind_block(NULL, NULL);
}
@@ -2439,10 +2470,10 @@ static void gfx_widgets_achievement_unfold(void *userdata)
static void gfx_widgets_start_achievement_notification(void)
{
gfx_animation_ctx_entry_t entry;
cheevo_height = widget_font_size * 4;
cheevo_height = gfx_widget_fonts.regular.line_height * 4;
cheevo_width = MAX(
font_driver_get_message_width(font_regular, msg_hash_to_str(MSG_ACHIEVEMENT_UNLOCKED), 0, 1),
font_driver_get_message_width(font_regular, cheevo_popup_queue[cheevo_popup_queue_read_index].title, 0, 1)
font_driver_get_message_width(gfx_widget_fonts.regular.font, msg_hash_to_str(MSG_ACHIEVEMENT_UNLOCKED), 0, 1),
font_driver_get_message_width(gfx_widget_fonts.regular.font, cheevo_popup_queue[cheevo_popup_queue_read_index].title, 0, 1)
);
cheevo_width += simple_widget_padding * 2;
cheevo_y = (float)(-(int)cheevo_height);
+30 -4
View File
@@ -88,14 +88,27 @@ struct gfx_widget
void (*frame)(void* data);
};
/* This structure holds all objects + metadata
* corresponding to a particular font */
typedef struct
{
font_data_t *font;
video_font_raster_block_t raster_block;
unsigned glyph_width;
float line_height;
float line_ascender;
float line_descender;
float line_centre_offset;
size_t usage_count;
} gfx_widget_font_data_t;
gfx_animation_ctx_tag gfx_widgets_get_generic_tag(void);
float* gfx_widgets_get_pure_white(void);
unsigned gfx_widgets_get_padding(void);
unsigned gfx_widgets_get_height(void);
unsigned gfx_widgets_get_glyph_width(void);
float gfx_widgets_get_font_size(void);
font_data_t* gfx_widgets_get_font_regular(void);
font_data_t* gfx_widgets_get_font_bold(void);
gfx_widget_font_data_t* gfx_widgets_get_font_regular(void);
gfx_widget_font_data_t* gfx_widgets_get_font_bold(void);
gfx_widget_font_data_t* gfx_widgets_get_font_msg_queue(void);
float* gfx_widgets_get_backdrop_orig(void);
unsigned gfx_widgets_get_last_video_width(void);
unsigned gfx_widgets_get_last_video_height(void);
@@ -117,6 +130,19 @@ void gfx_widgets_draw_icon(
float rotation, float scale_factor,
float *color);
void gfx_widgets_draw_text(
gfx_widget_font_data_t* font_data,
const char *text,
float x, float y,
int width, int height,
uint32_t color,
enum text_alignment text_align,
bool draw_outside);
void gfx_widgets_flush_text(
unsigned video_width, unsigned video_height,
gfx_widget_font_data_t* font_data);
typedef struct gfx_widget gfx_widget_t;
extern const gfx_widget_t gfx_widget_screenshot;
+1
View File
@@ -37,6 +37,7 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <retro_endianness.h>
#ifdef RARCH_INTERNAL
#define softfilter_get_implementation twoxbr_get_implementation
+2
View File
@@ -18,6 +18,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <retro_endianness.h>
#ifdef RARCH_INTERNAL
#define softfilter_get_implementation epx_get_implementation
#define softfilter_thread_data epx_softfilter_thread_data
+4
View File
@@ -643,6 +643,10 @@ bool video_shader_write_preset(const char *path,
config_file_t *conf;
bool ret;
/* Note: We always create a new/blank config
* file here. Loading and updating an existing
* file could leave us with unwanted/invalid
* parameters. */
if (!(conf = config_file_new_alloc()))
return false;
+13 -13
View File
@@ -88,14 +88,14 @@ static void gfx_widget_generic_message_frame(void* data)
if (state->alpha > 0.0f)
{
video_frame_info_t* video_info = (video_frame_info_t*)data;
void* userdata = video_info->userdata;
unsigned video_width = video_info->width;
unsigned video_height = video_info->height;
video_frame_info_t* video_info = (video_frame_info_t*)data;
void* userdata = video_info->userdata;
unsigned video_width = video_info->width;
unsigned video_height = video_info->height;
unsigned height = gfx_widgets_get_generic_message_height();
unsigned text_color = COLOR_TEXT_ALPHA(0xffffffff, (unsigned)(state->alpha*255.0f));
gfx_widget_font_data_t* font_regular = gfx_widgets_get_font_regular();
unsigned height = gfx_widgets_get_generic_message_height();
unsigned text_color = COLOR_TEXT_ALPHA(0xffffffff, (unsigned)(state->alpha*255.0f));
gfx_display_set_alpha(gfx_widgets_get_backdrop_orig(), state->alpha);
gfx_display_draw_quad(userdata,
@@ -105,12 +105,12 @@ static void gfx_widget_generic_message_frame(void* data)
video_width, video_height,
gfx_widgets_get_backdrop_orig());
gfx_display_draw_text(gfx_widgets_get_font_regular(), state->message,
video_width/2,
video_height - height/2 + gfx_widgets_get_font_size()/4,
video_width, video_height,
text_color, TEXT_ALIGN_CENTER,
1, false, 0, false);
gfx_widgets_draw_text(font_regular, state->message,
video_width/2,
video_height - height/2.0f + font_regular->line_centre_offset,
video_width, video_height,
text_color, TEXT_ALIGN_CENTER,
false);
}
}
+17 -17
View File
@@ -64,8 +64,9 @@ static void gfx_widget_libretro_message_fadeout(void *userdata)
void gfx_widget_set_libretro_message(const char *msg, unsigned duration)
{
gfx_widget_libretro_message_state_t* state = gfx_widget_libretro_message_get_state();
gfx_animation_ctx_tag tag = (uintptr_t) &state->timer;
gfx_widget_font_data_t* font_regular = gfx_widgets_get_font_regular();
gfx_timer_ctx_entry_t timer;
gfx_animation_ctx_tag tag = (uintptr_t) &state->timer;
if (!gfx_widgets_active())
return;
@@ -85,7 +86,7 @@ void gfx_widget_set_libretro_message(const char *msg, unsigned duration)
gfx_timer_start(&state->timer, &timer);
/* Compute text width */
state->width = font_driver_get_message_width(gfx_widgets_get_font_regular(), msg, (unsigned)strlen(msg), 1) + gfx_widgets_get_padding() * 2;
state->width = font_driver_get_message_width(font_regular->font, msg, (unsigned)strlen(msg), 1) + gfx_widgets_get_padding() * 2;
}
static void gfx_widget_libretro_message_frame(void *data)
@@ -94,15 +95,14 @@ static void gfx_widget_libretro_message_frame(void *data)
if (state->alpha > 0.0f)
{
video_frame_info_t* video_info = (video_frame_info_t*)data;
void* userdata = video_info->userdata;
unsigned video_width = video_info->width;
unsigned video_height = video_info->height;
unsigned height = gfx_widgets_get_generic_message_height();
float* backdrop_orign = gfx_widgets_get_backdrop_orig();
unsigned text_color = COLOR_TEXT_ALPHA(0xffffffff, (unsigned)(state->alpha*255.0f));
video_frame_info_t* video_info = (video_frame_info_t*)data;
void* userdata = video_info->userdata;
unsigned video_width = video_info->width;
unsigned video_height = video_info->height;
unsigned height = gfx_widgets_get_generic_message_height();
float* backdrop_orign = gfx_widgets_get_backdrop_orig();
unsigned text_color = COLOR_TEXT_ALPHA(0xffffffff, (unsigned)(state->alpha*255.0f));
gfx_widget_font_data_t* font_regular = gfx_widgets_get_font_regular();
gfx_display_set_alpha(backdrop_orign, state->alpha);
@@ -113,12 +113,12 @@ static void gfx_widget_libretro_message_frame(void *data)
video_width, video_height,
backdrop_orign);
gfx_display_draw_text(gfx_widgets_get_font_regular(), state->message,
gfx_widgets_get_padding(),
video_height - height/2 + gfx_widgets_get_font_size()/4,
video_width, video_height,
text_color, TEXT_ALIGN_LEFT,
1, false, 0, false);
gfx_widgets_draw_text(font_regular, state->message,
gfx_widgets_get_padding(),
video_height - height/2 + font_regular->line_centre_offset,
video_width, video_height,
text_color, TEXT_ALIGN_LEFT,
false);
}
}
+27 -34
View File
@@ -150,19 +150,14 @@ static void gfx_widget_screenshot_free(void)
static void gfx_widget_screenshot_frame(void* data)
{
video_frame_info_t *video_info = (video_frame_info_t*)data;
void *userdata = video_info->userdata;
unsigned video_width = video_info->width;
unsigned video_height = video_info->height;
unsigned padding = gfx_widgets_get_padding();
float font_size = gfx_widgets_get_font_size();
font_data_t* font_regular = gfx_widgets_get_font_regular();
float* pure_white = gfx_widgets_get_pure_white();
video_frame_info_t *video_info = (video_frame_info_t*)data;
void *userdata = video_info->userdata;
unsigned video_width = video_info->width;
unsigned video_height = video_info->height;
gfx_widget_font_data_t* font_regular = gfx_widgets_get_font_regular();
float* pure_white = gfx_widgets_get_pure_white();
gfx_widget_screenshot_state_t* state = gfx_widget_screenshot_get_ptr();
int padding = (state->height - (font_regular->line_height * 2.0f)) / 2.0f;
/* Screenshot */
if (state->loaded)
@@ -193,14 +188,14 @@ static void gfx_widget_screenshot_frame(void* data)
0, 1, pure_white
);
gfx_display_draw_text(font_regular,
msg_hash_to_str(MSG_SCREENSHOT_SAVED),
state->thumbnail_width + padding, font_size * 1.9f + state->y,
video_width, video_height,
TEXT_COLOR_FAINT,
TEXT_ALIGN_LEFT,
1, false, 0, true
);
gfx_widgets_draw_text(font_regular,
msg_hash_to_str(MSG_SCREENSHOT_SAVED),
state->thumbnail_width + padding,
padding + font_regular->line_ascender + state->y,
video_width, video_height,
TEXT_COLOR_FAINT,
TEXT_ALIGN_LEFT,
true);
ticker.idx = gfx_animation_get_ticker_idx();
ticker.len = state->shotname_length;
@@ -210,14 +205,14 @@ static void gfx_widget_screenshot_frame(void* data)
gfx_animation_ticker(&ticker);
gfx_display_draw_text(font_regular,
shotname,
state->thumbnail_width + padding, font_size * 2.9f + state->y,
video_width, video_height,
TEXT_COLOR_INFO,
TEXT_ALIGN_LEFT,
1, false, 0, true
);
gfx_widgets_draw_text(font_regular,
shotname,
state->thumbnail_width + padding,
state->height - padding - font_regular->line_descender + state->y,
video_width, video_height,
TEXT_COLOR_INFO,
TEXT_ALIGN_LEFT,
true);
}
/* Flash effect */
@@ -240,10 +235,8 @@ static void gfx_widget_screenshot_iterate(unsigned width, unsigned height, bool
bool is_threaded)
{
gfx_widget_screenshot_state_t* state = gfx_widget_screenshot_get_ptr();
float font_size = gfx_widgets_get_font_size();
unsigned padding = gfx_widgets_get_padding();
unsigned glyph_width = gfx_widgets_get_glyph_width();
unsigned padding = gfx_widgets_get_padding();
gfx_widget_font_data_t* font_regular = gfx_widgets_get_font_regular();
/* Load screenshot and start its animation */
if (state->filename[0] != '\0')
@@ -258,7 +251,7 @@ static void gfx_widget_screenshot_iterate(unsigned width, unsigned height, bool
"", &state->texture, TEXTURE_FILTER_MIPMAP_LINEAR,
&state->texture_width, &state->texture_height);
state->height = font_size * 4;
state->height = font_regular->line_height * 4;
state->width = width;
state->scale_factor = gfx_widgets_get_thumbnail_scale_factor(
@@ -269,7 +262,7 @@ static void gfx_widget_screenshot_iterate(unsigned width, unsigned height, bool
state->thumbnail_width = state->texture_width * state->scale_factor;
state->thumbnail_height = state->texture_height * state->scale_factor;
state->shotname_length = (width - state->thumbnail_width - padding*2) / glyph_width;
state->shotname_length = (width - state->thumbnail_width - padding*2) / font_regular->glyph_width;
state->y = 0.0f;
+31 -29
View File
@@ -102,13 +102,12 @@ static void gfx_widget_volume_frame(void* data)
char msg[255];
char percentage_msg[255];
gfx_widget_font_data_t* font_regular = gfx_widgets_get_font_regular();
void *userdata = video_info->userdata;
unsigned video_width = video_info->width;
unsigned video_height = video_info->height;
font_data_t* font_regular = gfx_widgets_get_font_regular();
float font_size = gfx_widgets_get_font_size();
unsigned padding = gfx_widgets_get_padding();
float* backdrop_orig = gfx_widgets_get_backdrop_orig();
@@ -120,15 +119,22 @@ static void gfx_widget_volume_frame(void* data)
unsigned text_color_db = COLOR_TEXT_ALPHA(TEXT_COLOR_FAINT, (unsigned)(state->text_alpha*255.0f));
unsigned bar_x = icon_size;
unsigned bar_height = font_size / 2;
unsigned bar_height = font_regular->line_height / 2;
unsigned bar_width = state->widget_width - bar_x - padding;
unsigned bar_y = state->widget_height / 2 + bar_height/2;
unsigned bar_y = state->widget_height / 2 + bar_height;
float *bar_background = NULL;
float *bar_foreground = NULL;
float bar_percentage = 0.0f;
unsigned volume_text_y = bar_y - (font_size / 3);
/* Note: Volume + percentage text has no component
* that extends below the baseline, so we shift
* the text down by the font descender to achieve
* better spacing */
unsigned volume_text_y = (bar_y / 2.0f) + font_regular->line_centre_offset + font_regular->line_descender;
msg[0] = '\0';
percentage_msg[0] = '\0';
if (state->mute)
volume_icon = state->textures[ICON_MUTE];
@@ -201,13 +207,12 @@ static void gfx_widget_volume_frame(void* data)
if (!state->textures[ICON_MUTE])
{
const char *text = msg_hash_to_str(MSG_AUDIO_MUTED);
gfx_display_draw_text(font_regular,
text,
state->widget_width/2, state->widget_height/2 + font_size / 3,
video_width, video_height,
text_color, TEXT_ALIGN_CENTER,
1, false, 0, true
);
gfx_widgets_draw_text(font_regular,
text,
state->widget_width/2, state->widget_height/2.0f + font_regular->line_centre_offset,
video_width, video_height,
text_color, TEXT_ALIGN_CENTER,
true);
}
}
else
@@ -241,23 +246,21 @@ static void gfx_widget_volume_frame(void* data)
snprintf(percentage_msg, sizeof(percentage_msg), "%d%%",
(int)(state->percent * 100.0f));
gfx_display_draw_text(font_regular,
msg,
state->widget_width - padding, volume_text_y,
video_width, video_height,
text_color_db,
TEXT_ALIGN_RIGHT,
1, false, 0, false
);
gfx_widgets_draw_text(font_regular,
msg,
state->widget_width - padding, volume_text_y,
video_width, video_height,
text_color_db,
TEXT_ALIGN_RIGHT,
false);
gfx_display_draw_text(font_regular,
gfx_widgets_draw_text(font_regular,
percentage_msg,
icon_size, volume_text_y,
video_width, video_height,
text_color,
TEXT_ALIGN_LEFT,
1, false, 0, false
);
false);
}
}
}
@@ -304,12 +307,11 @@ void gfx_widget_volume_update_and_show(float new_volume, bool mute)
static void gfx_widget_volume_layout(bool is_threaded, const char *dir_assets, char *font_path)
{
gfx_widget_volume_state_t* state = gfx_widget_volume_get_ptr();
gfx_widget_volume_state_t* state = gfx_widget_volume_get_ptr();
unsigned last_video_width = gfx_widgets_get_last_video_width();
gfx_widget_font_data_t* font_regular = gfx_widgets_get_font_regular();
float font_size = gfx_widgets_get_font_size();
unsigned last_video_width = gfx_widgets_get_last_video_width();
state->widget_height = font_size * 4;
state->widget_height = font_regular->line_height * 4;
state->widget_width = state->widget_height * 4;
/* Volume widget cannot exceed screen width
+1
View File
@@ -128,6 +128,7 @@ COMPRESSION
#ifdef HAVE_ZLIB
#include "../libretro-common/streams/trans_stream_zlib.c"
#include "../libretro-common/streams/rzip_stream.c"
#endif
/*============================================================
+4
View File
@@ -18,6 +18,10 @@
#define HAVE_COMPRESSION 1
#endif
#if defined(_WIN32) && !defined(_XBOX)
#define WIN32_LEAN_AND_MEAN
#endif
#if defined(_MSC_VER)
#include <string.h>
#include <compat/posix_string.h>
+1
View File
@@ -21,6 +21,7 @@
#include <boolean.h>
#include <retro_environment.h>
#include <retro_miscellaneous.h>
#include <retro_endianness.h>
#include "joypad_connection.h"
#include "../input_defines.h"
+1 -1
View File
@@ -51,7 +51,7 @@ static int16_t ctr_input_state(void *data,
{
ctr_input_t *ctr = (ctr_input_t*)data;
if (port > 0)
if (port >= MENU_ENUM_LABEL_VALUE_INPUT_MAX_USERS)
return 0;
switch (device)
+141 -1
View File
@@ -55,14 +55,85 @@ typedef struct ps3_input
unsigned mice_connected;
#endif
const input_device_driver_t *joypad;
KbInfo kbinfo;
KbData kbdata[MAX_KB_PORT_NUM];
int connected[MAX_KB_PORT_NUM];
} ps3_input_t;
static void connect_keyboard(ps3_input_t *ps3, int port)
{
ioKbSetCodeType(port, KB_CODETYPE_RAW);
ioKbSetReadMode(port, KB_RMODE_INPUTCHAR);
ps3->connected[port] = 1;
}
static void disconnect_keyboard(ps3_input_t *ps3, int port)
{
ps3->connected[port] = 0;
}
static void ps3_input_poll(void *data)
{
ps3_input_t *ps3 = (ps3_input_t*)data;
KbData last_kbdata[MAX_KB_PORT_NUM];
if (ps3 && ps3->joypad)
ps3->joypad->poll();
ioKbGetInfo(&ps3->kbinfo);
for (int i = 0; i < MAX_KB_PORT_NUM; i++) {
if(ps3->kbinfo.status[i] && !ps3->connected[i])
connect_keyboard(ps3, i);
// if(!ps3->kbinfo.status[i] && ps3->connected[i])
// disconnect_keyboard(ps3, i);
}
memcpy(last_kbdata, ps3->kbdata, sizeof(last_kbdata));
for (int i = 0; i < MAX_KB_PORT_NUM; i++) {
if(ps3->kbinfo.status[i])
ioKbRead(i, &ps3->kbdata[i]);
}
for (int i = 0; i < MAX_KB_PORT_NUM; i++) {
/* Set keyboard modifier based on shift,ctrl and alt state */
uint16_t mod = 0;
if (ps3->kbdata[i].mkey._KbMkeyU._KbMkeyS.l_alt || ps3->kbdata[i].mkey._KbMkeyU._KbMkeyS.r_alt)
mod |= RETROKMOD_ALT;
if (ps3->kbdata[i].mkey._KbMkeyU._KbMkeyS.l_ctrl || ps3->kbdata[i].mkey._KbMkeyU._KbMkeyS.r_ctrl)
mod |= RETROKMOD_CTRL;
if (ps3->kbdata[i].mkey._KbMkeyU._KbMkeyS.l_shift || ps3->kbdata[i].mkey._KbMkeyU._KbMkeyS.r_shift)
mod |= RETROKMOD_SHIFT;
/* TODO: windows keys. */
for (int j = 0; j < last_kbdata[i].nb_keycode; j++) {
int code = last_kbdata[i].keycode[j];
int newly_depressed = 1;
for (int k = 0; k < MAX_KB_PORT_NUM; i++)
if (ps3->kbdata[i].keycode[k] == code) {
newly_depressed = 0;
break;
}
if (newly_depressed) {
unsigned keyboardcode = input_keymaps_translate_keysym_to_rk(code);
input_keyboard_event(false, keyboardcode, keyboardcode, mod, RETRO_DEVICE_KEYBOARD);
}
}
for (int j = 0; j < ps3->kbdata[i].nb_keycode; j++) {
int code = ps3->kbdata[i].keycode[j];
int newly_pressed = 1;
for (int k = 0; k < MAX_KB_PORT_NUM; i++)
if (last_kbdata[i].keycode[k] == code) {
newly_pressed = 0;
break;
}
if (newly_pressed) {
unsigned keyboardcode = input_keymaps_translate_keysym_to_rk(code);
input_keyboard_event(true, keyboardcode, keyboardcode, mod, RETRO_DEVICE_KEYBOARD);
}
}
}
}
#ifdef HAVE_MOUSE
@@ -74,6 +145,46 @@ static int16_t ps3_mouse_device_state(ps3_input_t *ps3,
#endif
static int mod_table[] = {
RETROK_RSUPER,
RETROK_RALT,
RETROK_RSHIFT,
RETROK_RCTRL,
RETROK_LSUPER,
RETROK_LALT,
RETROK_LSHIFT,
RETROK_LCTRL
};
static bool
psl1ght_keyboard_port_input_pressed(ps3_input_t *ps3, unsigned id)
{
if (id >= RETROK_LAST || id == 0)
return false;
for (int i = 0; i < 8; i++) {
if (id == mod_table[i]) {
for (int j = 0; j < MAX_KB_PORT_NUM; j++) {
if(ps3->kbinfo.status[j] && (ps3->kbdata[j].mkey._KbMkeyU.mkeys &
(1 << i)))
return true;
}
return false;
}
}
int code = rarch_keysym_lut[id];
if (code == 0)
return false;
for (int i = 0; i < MAX_KB_PORT_NUM; i++) {
if(ps3->kbinfo.status[i])
for (int j = 0; j < ps3->kbdata[i].nb_keycode; j++) {
if (ps3->kbdata[i].keycode[j] == code)
return true;
}
}
return false;
}
static int16_t ps3_input_state(void *data,
rarch_joypad_info_t *joypad_info,
const struct retro_keybind **binds,
@@ -112,6 +223,9 @@ static int16_t ps3_input_state(void *data,
ret |= (1 << i);
continue;
}
else if (psl1ght_keyboard_port_input_pressed(ps3, binds[port][i].key))
ret |= (1 << i);
}
return ret;
@@ -129,12 +243,16 @@ static int16_t ps3_input_state(void *data,
return true;
if (((float)abs(ps3->joypad->axis(joypad_info->joy_idx, joyaxis)) / 0x8000) > joypad_info->axis_threshold)
return true;
if (psl1ght_keyboard_port_input_pressed(ps3, binds[port][id].key))
return true;
}
break;
case RETRO_DEVICE_ANALOG:
if (binds[port])
return input_joypad_analog(ps3->joypad, joypad_info, port, idx, id, binds[port]);
break;
case RETRO_DEVICE_KEYBOARD:
return (psl1ght_keyboard_port_input_pressed(ps3, id));
}
return 0;
@@ -142,7 +260,8 @@ static int16_t ps3_input_state(void *data,
static void ps3_input_free_input(void *data)
{
RARCH_LOG("alive " __FILE__ ":%d\n", __LINE__);
ioPadEnd();
ioKbEnd();
}
static void* ps3_input_init(const char *joypad_driver)
@@ -156,6 +275,26 @@ static void* ps3_input_init(const char *joypad_driver)
if (ps3->joypad)
ps3->joypad->init(ps3);
/* Keyboard */
input_keymaps_init_keyboard_lut(rarch_key_map_psl1ght);
int status;
status = ioKbInit(MAX_KB_PORT_NUM);
RARCH_LOG("Calling ioKbInit(%d) returned %d\r\n", MAX_KB_PORT_NUM, status);
status = ioKbGetInfo(&ps3->kbinfo);
RARCH_LOG("Calling ioKbGetInfo() returned %d\r\n", status);
RARCH_LOG("KbInfo:\r\nMax Kbs: %u\r\nConnected Kbs: %u\r\nInfo Field: %08x\r\n", ps3->kbinfo.max, ps3->kbinfo.connected, ps3->kbinfo.info);
for (int i = 0; i < MAX_KB_PORT_NUM; i++) {
if(ps3->kbinfo.status[i]) {
connect_keyboard(ps3, i);
}
}
return ps3;
}
@@ -166,6 +305,7 @@ static uint64_t ps3_input_get_capabilities(void *data)
#ifdef HAVE_MOUSE
(1 << RETRO_DEVICE_MOUSE) |
#endif
(1 << RETRO_DEVICE_KEYBOARD) |
(1 << RETRO_DEVICE_JOYPAD) |
(1 << RETRO_DEVICE_ANALOG);
}
+1 -1
View File
@@ -290,7 +290,7 @@ static void iohidmanager_hid_device_input_callback(void *data, IOReturn result,
while (tmp && tmp->cookie != (IOHIDElementCookie)cookie)
tmp = tmp->next;
if (tmp->cookie == (IOHIDElementCookie)cookie)
if (tmp && tmp->cookie == (IOHIDElementCookie)cookie)
{
CFIndex min = IOHIDElementGetLogicalMin(element);
CFIndex range = IOHIDElementGetLogicalMax(element) - min;
+132
View File
@@ -41,6 +41,10 @@
#include <sys/keycodes.h>
#endif
#ifdef __PSL1GHT__
#include <io/kb.h>
#endif
#if defined(HAVE_SDL) || defined(HAVE_SDL2)
#include "SDL.h"
#endif
@@ -1649,6 +1653,134 @@ const struct rarch_key_map rarch_key_map_dos[] = {
};
#endif
#ifdef __PSL1GHT__
const struct rarch_key_map rarch_key_map_psl1ght[] = {
{ KB_RAWKEY_A, RETROK_a },
{ KB_RAWKEY_B, RETROK_b },
{ KB_RAWKEY_C, RETROK_c },
{ KB_RAWKEY_D, RETROK_d },
{ KB_RAWKEY_E, RETROK_e },
{ KB_RAWKEY_F, RETROK_f },
{ KB_RAWKEY_G, RETROK_g },
{ KB_RAWKEY_H, RETROK_h },
{ KB_RAWKEY_I, RETROK_i },
{ KB_RAWKEY_J, RETROK_j },
{ KB_RAWKEY_K, RETROK_k },
{ KB_RAWKEY_L, RETROK_l },
{ KB_RAWKEY_M, RETROK_m },
{ KB_RAWKEY_N, RETROK_n },
{ KB_RAWKEY_O, RETROK_o },
{ KB_RAWKEY_P, RETROK_p },
{ KB_RAWKEY_Q, RETROK_q },
{ KB_RAWKEY_R, RETROK_r },
{ KB_RAWKEY_S, RETROK_s },
{ KB_RAWKEY_T, RETROK_t },
{ KB_RAWKEY_U, RETROK_u },
{ KB_RAWKEY_V, RETROK_v },
{ KB_RAWKEY_W, RETROK_w },
{ KB_RAWKEY_X, RETROK_x },
{ KB_RAWKEY_Y, RETROK_y },
{ KB_RAWKEY_Z, RETROK_z },
{ KB_RAWKEY_BS, RETROK_BACKSPACE },
{ KB_RAWKEY_TAB, RETROK_TAB },
{ KB_RAWKEY_ENTER, RETROK_RETURN },
{ KB_RAWKEY_PAUSE, RETROK_PAUSE },
{ KB_RAWKEY_ESCAPE, RETROK_ESCAPE },
{ KB_RAWKEY_SPACE, RETROK_SPACE },
{ KB_RAWKEY_QUOTATION_101, RETROK_QUOTE },
{ KB_RAWKEY_COMMA, RETROK_COMMA },
{ KB_RAWKEY_MINUS, RETROK_MINUS },
{ KB_RAWKEY_PERIOD, RETROK_PERIOD },
{ KB_RAWKEY_SLASH, RETROK_SLASH },
{ KB_RAWKEY_0, RETROK_0 },
{ KB_RAWKEY_1, RETROK_1 },
{ KB_RAWKEY_2, RETROK_2 },
{ KB_RAWKEY_3, RETROK_3 },
{ KB_RAWKEY_4, RETROK_4 },
{ KB_RAWKEY_5, RETROK_5 },
{ KB_RAWKEY_6, RETROK_6 },
{ KB_RAWKEY_7, RETROK_7 },
{ KB_RAWKEY_8, RETROK_8 },
{ KB_RAWKEY_9, RETROK_9 },
{ KB_RAWKEY_SEMICOLON, RETROK_SEMICOLON },
{ KB_RAWKEY_EQUAL_101, RETROK_EQUALS },
{ KB_RAWKEY_LEFT_BRACKET_101, RETROK_LEFTBRACKET },
{ KB_RAWKEY_BACKSLASH_101, RETROK_BACKSLASH },
{ KB_RAWKEY_RIGHT_BRACKET_101, RETROK_RIGHTBRACKET },
{ KB_RAWKEY_DELETE, RETROK_DELETE },
{ KB_RAWKEY_KPAD_0, RETROK_KP0 },
{ KB_RAWKEY_KPAD_1, RETROK_KP1 },
{ KB_RAWKEY_KPAD_2, RETROK_KP2 },
{ KB_RAWKEY_KPAD_3, RETROK_KP3 },
{ KB_RAWKEY_KPAD_4, RETROK_KP4 },
{ KB_RAWKEY_KPAD_5, RETROK_KP5 },
{ KB_RAWKEY_KPAD_6, RETROK_KP6 },
{ KB_RAWKEY_KPAD_7, RETROK_KP7 },
{ KB_RAWKEY_KPAD_8, RETROK_KP8 },
{ KB_RAWKEY_KPAD_9, RETROK_KP9 },
{ KB_RAWKEY_KPAD_PERIOD, RETROK_KP_PERIOD },
{ KB_RAWKEY_KPAD_SLASH, RETROK_KP_DIVIDE },
{ KB_RAWKEY_KPAD_ASTERISK, RETROK_KP_MULTIPLY },
{ KB_RAWKEY_KPAD_MINUS, RETROK_KP_MINUS },
{ KB_RAWKEY_KPAD_PLUS, RETROK_KP_PLUS },
{ KB_RAWKEY_KPAD_ENTER, RETROK_KP_ENTER },
{ KB_RAWKEY_UP_ARROW, RETROK_UP },
{ KB_RAWKEY_DOWN_ARROW, RETROK_DOWN },
{ KB_RAWKEY_RIGHT_ARROW, RETROK_RIGHT },
{ KB_RAWKEY_LEFT_ARROW, RETROK_LEFT },
{ KB_RAWKEY_INSERT, RETROK_INSERT },
{ KB_RAWKEY_HOME, RETROK_HOME },
{ KB_RAWKEY_END, RETROK_END },
{ KB_RAWKEY_PAGE_UP, RETROK_PAGEUP },
{ KB_RAWKEY_PAGE_DOWN, RETROK_PAGEDOWN },
{ KB_RAWKEY_F1, RETROK_F1 },
{ KB_RAWKEY_F2, RETROK_F2 },
{ KB_RAWKEY_F3, RETROK_F3 },
{ KB_RAWKEY_F4, RETROK_F4 },
{ KB_RAWKEY_F5, RETROK_F5 },
{ KB_RAWKEY_F6, RETROK_F6 },
{ KB_RAWKEY_F7, RETROK_F7 },
{ KB_RAWKEY_F8, RETROK_F8 },
{ KB_RAWKEY_F9, RETROK_F9 },
{ KB_RAWKEY_F10, RETROK_F10 },
{ KB_RAWKEY_F11, RETROK_F11 },
{ KB_RAWKEY_F12, RETROK_F12 },
{ KB_RAWKEY_KPAD_NUMLOCK, RETROK_NUMLOCK },
{ KB_RAWKEY_CAPS_LOCK, RETROK_CAPSLOCK },
{ KB_RAWKEY_SCROLL_LOCK, RETROK_SCROLLOCK },
{ KB_RAWKEY_PAUSE, RETROK_BREAK },
/*
{ KB_RAWKEY_HASHTILDE, RETROK_HASH },
{ KB_RAWKEY_KPLEFTPAREN, RETROK_LEFTPAREN },
{ KB_RAWKEY_KPRIGHTPAREN, RETROK_RIGHTPAREN },
{ KB_RAWKEY_LEFTMETA, RETROK_LMETA },
{ KB_RAWKEY_RIGHTMETA, RETROK_RMETA },
{ KB_RAWKEY_COMPOSE, RETROK_COMPOSE },
{ KB_RAWKEY_HELP, RETROK_HELP },
{ KB_RAWKEY_POWER, RETROK_POWER },
{ KB_RAWKEY_UNDO, RETROK_UNDO },
{ KB_RAWKEY_KPAD_EQUAL, RETROK_KP_EQUALS },
KB_RAWKEY_PRINTSCREEN
KB_RAWKEY_APPLICATION
KB_RAWKEY_106_KANJI
KB_RAWKEY_KANA
KB_RAWKEY_HENKAN
KB_RAWKEY_MUHENKAN
KB_RAWKEY_ACCENT_CIRCONFLEX_106
KB_RAWKEY_ATMARK_106
KB_RAWKEY_LEFT_BRACKET_106
KB_RAWKEY_RIGHT_BRACKET_106
KB_RAWKEY_COLON_106
KB_RAWKEY_BACKSLASH_106
KB_RAWKEY_YEN_106 */
{ 0, RETROK_UNKNOWN }
};
#endif
#if defined(_WIN32) && _WIN32_WINNT >= 0x0501 && !defined(__WINRT__)
const struct rarch_key_map rarch_key_map_winraw[] = {
{ VK_BACK, RETROK_BACKSPACE },
+9
View File
@@ -40,6 +40,7 @@
#endif
#include "../configuration.h"
#include "../retroarch.h"
void input_mapper_poll(input_mapper_t *handle,
void *ol_pointer,
@@ -124,6 +125,14 @@ void input_mapper_poll(input_mapper_t *handle,
remap_valid = (current_button_value == 1) &&
(j != remap_button) && (remap_button != RARCH_UNMAPPED);
#ifdef HAVE_ACCESSIBILITY
/* gamepad override */
if (i==0 && get_gamepad_input_override() & (1<<j))
{
BIT256_SET(handle->buttons[i], j);
}
#endif
if (remap_valid)
{
if (remap_button < RARCH_FIRST_CUSTOM_BIND)
+1 -1
View File
@@ -3,7 +3,7 @@
## Steps
- Developers update strings in `msg_hash_us.h`.
- Developers (can set a cron job) run `./h2json.py msg_hash_us.h` to generate `msg_hash_us.json`. It is just a convenient format that is supported by Weblate/Crowdin/Transifex and doesn't need to be inversion control.
- Developers (can set a cron job) run `./h2json.py msg_hash_us.h` to generate `msg_hash_us.json`. It is just a convenient format that is supported by Weblate/Crowdin/Transifex and doesn't need to be in version control.
- Developers (can set a cron job) upload `msg_hash_us.json` to Weblate/Crowdin/Transifex.
- Translators translate strings on Weblate/Crowdin/Transifex.
- Developers (can set a cron job) download `msg_hash_xx.json` files.
+2 -2
View File
@@ -1,4 +1,4 @@
/* RetroArch - A frontend for libretro.
/* RetroArch - A frontend for libretro.
* Copyright (C) 2011-2017 - Daniel De Matteis
* Copyright (C) 2016-2019 - Brad Parker
*
@@ -30,7 +30,7 @@
/* https://support.microsoft.com/en-us/kb/980263 */
#pragma execution_character_set("utf-8")
#endif
#pragma warning(disable: 4566)
#pragma warning(disable:4566)
#endif
int menu_hash_get_help_ar_enum(enum msg_hash_enums msg, char *s, size_t len)
+149 -87
View File
@@ -7,96 +7,158 @@
#endif
MSG_HASH(
MENU_ENUM_LABEL_VALUE_CONFIGURATIONS_LIST,
"ملفات التكوين"
)
MENU_ENUM_LABEL_VALUE_CONFIGURATIONS_LIST,
"ملفات التكوين"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_AUDIO_DRIVER,
"نظام تشغيل الصوت"
)
MENU_ENUM_LABEL_VALUE_AUDIO_DRIVER,
"نظام تشغيل الصوت"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_AUDIO_SETTINGS,
"الصوت"
)
MENU_ENUM_LABEL_VALUE_AUDIO_SETTINGS,
"الصوت"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_CAMERA_DRIVER,
"نظام تشغيل الكاميرا"
)
MENU_ENUM_LABEL_VALUE_CAMERA_DRIVER,
"نظام تشغيل الكاميرا"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_CONFIGURATIONS,
"تحميل ملف التكوين"
)
MENU_ENUM_LABEL_VALUE_CONFIGURATIONS,
"تحميل ملف التكوين"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_CONFIGURATION_SETTINGS,
"ملفات التكوين"
)
MENU_ENUM_LABEL_VALUE_CONFIGURATION_SETTINGS,
"ملفات التكوين"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_CONFIG_SAVE_ON_EXIT,
"Save Configuration on Exit"
)
MSG_HASH(MENU_ENUM_LABEL_VALUE_CONTENT_SETTINGS,
"القائمة السريعة")
MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_LIST,
"تحميل الكور")
MSG_HASH(MENU_ENUM_LABEL_VALUE_DIRECTORY_SETTINGS,
"الدلائل")
MSG_HASH(MENU_ENUM_LABEL_VALUE_DRIVER_SETTINGS,
"أنظمة التشغيل")
MSG_HASH(MENU_ENUM_LABEL_VALUE_HELP,
"مساعدة")
MSG_HASH(MENU_ENUM_LABEL_VALUE_HELP_LIST,
"مساعدة")
MSG_HASH(MENU_ENUM_LABEL_VALUE_INFORMATION,
"معلومات")
MSG_HASH(MENU_ENUM_LABEL_VALUE_INFORMATION_LIST,
"معلومات")
MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_DRIVER,
"نظام تشغيل أجهزة الادخال")
MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_SETTINGS,
"أجهزة الادخال")
MSG_HASH(MENU_ENUM_LABEL_VALUE_JOYPAD_DRIVER,
"نظام تشغيل الجوي باد")
MSG_HASH(MENU_ENUM_LABEL_VALUE_LANG_ARABIC,
"عربى")
MSG_HASH(MENU_ENUM_LABEL_VALUE_LOAD_CONTENT_LIST,
"تحميل المحتوى")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MAIN_MENU,
"القائمة الرئيسية")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_DRIVER,
"نظام تشغيل القائمة")
MSG_HASH(MENU_ENUM_LABEL_VALUE_NETWORK_SETTINGS,
"الشبكة")
MSG_HASH(MENU_ENUM_LABEL_VALUE_ONLINE_UPDATER,
"التحديث عبر الانترنت")
MSG_HASH(MENU_ENUM_LABEL_VALUE_ONSCREEN_DISPLAY_SETTINGS,
"العرض على الشاشة")
MSG_HASH(MENU_ENUM_LABEL_VALUE_PLAYLISTS_TAB,
"قوائم التشغيل")
MSG_HASH(MENU_ENUM_LABEL_VALUE_PLAYLIST_DIRECTORY,
"قائمة التشغيل")
MSG_HASH(MENU_ENUM_LABEL_VALUE_PLAYLIST_SETTINGS,
"قوائم التشغيل")
MSG_HASH(MENU_ENUM_LABEL_VALUE_PRIVACY_SETTINGS,
"خصوصية")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QUIT_RETROARCH,
"إنهاء البرنامج")
MSG_HASH(MENU_ENUM_LABEL_VALUE_RECORD_DRIVER,
"نظام تشغيل التسجيل")
MSG_HASH(MENU_ENUM_LABEL_VALUE_RETRO_ACHIEVEMENTS_SETTINGS,
"الإنجازات")
MSG_HASH(MENU_ENUM_LABEL_VALUE_SAVING_SETTINGS,
"الحفظ")
MSG_HASH(MENU_ENUM_LABEL_VALUE_USER_INTERFACE_SETTINGS,
"واجهة المستخدم")
MSG_HASH(MENU_ENUM_LABEL_VALUE_USER_SETTINGS,
"المستخدم")
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_DRIVER,
"نظام تشغيل الفيديو")
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SETTINGS,
"الفيديو")
MSG_HASH(MENU_ENUM_LABEL_VALUE_WIFI_DRIVER,
"نظام تشغيل الواي-فاي")
MSG_HASH(MENU_ENUM_SUBLABEL_DRIVER_SETTINGS,
"تغيير أنظمة التشغيل المستخدمة من قبل البرنامج.")
MSG_HASH(MENU_ENUM_LABEL_VALUE_DELETE_PLAYLIST,
"إحذف قائمة التشغيل")
MENU_ENUM_LABEL_VALUE_CONTENT_SETTINGS,
"القائمة السريعة"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_CORE_LIST,
"تحميل الكور"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_DIRECTORY_SETTINGS,
"الدلائل"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_DRIVER_SETTINGS,
"أنظمة التشغيل"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_HELP,
"مساعدة"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_HELP_LIST,
"مساعدة"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_INFORMATION,
"معلومات"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_INFORMATION_LIST,
"معلومات"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_INPUT_DRIVER,
"نظام تشغيل أجهزة الادخال"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_INPUT_SETTINGS,
"أجهزة الادخال"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_JOYPAD_DRIVER,
"نظام تشغيل الجوي باد"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_LANG_ARABIC,
"عربى"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_LOAD_CONTENT_LIST,
"تحميل المحتوى"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_MAIN_MENU,
"القائمة الرئيسية"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_MENU_DRIVER,
"نظام تشغيل القائمة"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_NETWORK_SETTINGS,
"الشبكة"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_ONLINE_UPDATER,
"التحديث عبر الانترنت"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_ONSCREEN_DISPLAY_SETTINGS,
"العرض على الشاشة"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_PLAYLISTS_TAB,
"قوائم التشغيل"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_PLAYLIST_DIRECTORY,
"قائمة التشغيل"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_PLAYLIST_SETTINGS,
"قوائم التشغيل"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_PRIVACY_SETTINGS,
"خصوصية"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_QUIT_RETROARCH,
"إنهاء البرنامج"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_RECORD_DRIVER,
"نظام تشغيل التسجيل"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_RETRO_ACHIEVEMENTS_SETTINGS,
"الإنجازات"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_SAVING_SETTINGS,
"الحفظ"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_USER_INTERFACE_SETTINGS,
"واجهة المستخدم"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_USER_SETTINGS,
"المستخدم"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_VIDEO_DRIVER,
"نظام تشغيل الفيديو"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_VIDEO_SETTINGS,
"الفيديو"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_WIFI_DRIVER,
"نظام تشغيل الواي-فاي"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_DRIVER_SETTINGS,
"تغيير أنظمة التشغيل المستخدمة من قبل البرنامج."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_DELETE_PLAYLIST,
"إحذف قائمة التشغيل"
)
+5954 -3615
View File
File diff suppressed because it is too large. Load diff
+4240 -2425
View File
File diff suppressed because it is too large. Load diff
+5551 -3339
View File
File diff suppressed because it is too large. Load diff
+3267 -3295
View File
File diff suppressed because it is too large. Load diff
+8049 -7969
View File
File diff suppressed because it is too large. Load diff
+10718 -10284
View File
File diff suppressed because it is too large. Load diff
+6016 -3610
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -25,7 +25,7 @@
#include "../verbosity.h"
#if defined(_MSC_VER) && !defined(_XBOX)
#if (_MSC_VER >= 1700 && _MSC_VER < 1910)
#if (_MSC_VER >= 1700 && _MSC_VER < 1900)
/* https://support.microsoft.com/en-us/kb/980263 */
#pragma execution_character_set("utf-8")
#endif
+2101 -2229
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -28,7 +28,7 @@
#include "../configuration.h"
#if defined(_MSC_VER) && !defined(_XBOX)
#if (_MSC_VER >= 1700 && _MSC_VER < 1910)
#if (_MSC_VER >= 1700 && _MSC_VER < 1900)
/* https://support.microsoft.com/en-us/kb/980263 */
#pragma execution_character_set("utf-8")
#endif
+7599 -7598
View File
File diff suppressed because it is too large. Load diff
+4458 -2214
View File
File diff suppressed because it is too large. Load diff
+2686 -2502
View File
File diff suppressed because it is too large. Load diff
+7038 -4349
View File
File diff suppressed because it is too large. Load diff
+2 -2
View File
@@ -1864,9 +1864,9 @@ int menu_hash_get_help_pt_br_enum(enum msg_hash_enums msg, char *s, size_t len)
case MENU_ENUM_LABEL_VIDEO_CTX_SCALING:
snprintf(s, len,
#ifdef HAVE_ODROIDGO2
"RGA scaling and bicubic filtering. May break widgets."
"Escala RGA e filtragem bicúbica. Pode quebrar os widgets."
#else
"Hardware context scaling (if available)."
"Escala de contexto de hardware (se disponível)."
#endif
);
break;
+8045 -7982
View File
File diff suppressed because it is too large. Load diff
+5068 -3519
View File
File diff suppressed because it is too large. Load diff
+5550 -3149
View File
File diff suppressed because it is too large. Load diff
+7085 -7281
View File
File diff suppressed because it is too large. Load diff
+10732 -10358
View File
File diff suppressed because it is too large. Load diff
+911 -598
View File
File diff suppressed because it is too large. Load diff
+4 -4
View File
@@ -43,7 +43,7 @@
#include <lv2/systime.h>
#endif
#if defined(__CELLOS_LV2__) || ( defined(__OpenBSD__) && defined(__powerpc__) )
#if defined(__CELLOS_LV2__)
#ifndef _PPU_INTRINSICS_H
#include <ppu_intrinsics.h>
#endif
@@ -171,7 +171,7 @@ retro_perf_tick_t cpu_features_get_perf_counter(void)
tv_sec = (long)((ularge.QuadPart - epoch) / 10000000L);
tv_usec = (long)(system_time.wMilliseconds * 1000);
time_ticks = (1000000 * tv_sec + tv_usec);
#elif defined(_POSIX_MONOTONIC_CLOCK) || defined(__QNX__) || defined(ANDROID) || defined(__MACH__) || defined(__PSL1GHT__)
#elif defined(_POSIX_MONOTONIC_CLOCK) || defined(__QNX__) || defined(ANDROID) || defined(__MACH__)
struct timespec tv = {0};
if (ra_clock_gettime(CLOCK_MONOTONIC, &tv) == 0)
time_ticks = (retro_perf_tick_t)tv.tv_sec * 1000000000 +
@@ -185,7 +185,7 @@ retro_perf_tick_t cpu_features_get_perf_counter(void)
time_ticks = (retro_perf_tick_t)a | ((retro_perf_tick_t)d << 32);
#elif defined(__ARM_ARCH_6__)
__asm__ volatile( "mrc p15, 0, %0, c9, c13, 0" : "=r"(time_ticks) );
#elif defined(__CELLOS_LV2__) || defined(_XBOX360) || defined(__powerpc__) || defined(__ppc__) || defined(__POWERPC__)
#elif defined(__CELLOS_LV2__) || defined(_XBOX360) || defined(__powerpc__) || defined(__ppc__) || defined(__POWERPC__) || defined(__PSL1GHT__)
time_ticks = __mftb();
#elif defined(GEKKO)
time_ticks = gettime();
@@ -240,7 +240,7 @@ retro_time_t cpu_features_get_time_usec(void)
return ticks_to_us(OSGetSystemTime());
#elif defined(SWITCH) || defined(HAVE_LIBNX)
return (svcGetSystemTick() * 10) / 192;
#elif defined(_POSIX_MONOTONIC_CLOCK) || defined(__QNX__) || defined(ANDROID) || defined(__MACH__) || defined(__PSL1GHT__)
#elif defined(_POSIX_MONOTONIC_CLOCK) || defined(__QNX__) || defined(ANDROID) || defined(__MACH__)
struct timespec tv = {0};
if (ra_clock_gettime(CLOCK_MONOTONIC, &tv) < 0)
return 0;
+85 -20
View File
@@ -74,7 +74,17 @@ static config_file_t *config_file_new_internal(
static int config_sort_compare_func(struct config_entry_list *a,
struct config_entry_list *b)
{
return (a && b) ? strcasecmp(a->key, b->key) : 0;
if (a && b)
{
if (a->key && b->key)
return strcasecmp(a->key, b->key);
else if (a->key)
return 1;
else if (b->key)
return -1;
}
return 0;
}
/* https://stackoverflow.com/questions/7685/merge-sort-a-linked-list */
@@ -206,12 +216,19 @@ static char *extract_value(char *line, bool is_value)
while (isspace((int)*line))
line++;
/* Note: From this point on, an empty value
* string is valid - and in this case, strdup("")
* will be returned
* > If we instead return NULL, the the entry
* is ignored completely - which means we cannot
* track *changes* in entry value */
/* We have a full string. Read until next ". */
if (*line == '"')
{
line++;
if (*line == '"')
return NULL;
return strdup("");
tok = strtok_r(line, "\"", &save);
}
/* We don't have that. Read until next space. */
@@ -220,7 +237,7 @@ static char *extract_value(char *line, bool is_value)
if (tok && *tok)
return strdup(tok);
return NULL;
return strdup("");
}
/* Move semantics? */
@@ -342,7 +359,7 @@ static bool parse_line(config_file_t *conf,
char *include_line = comment + STRLEN_CONST("include ");
char *path = extract_value(include_line, false);
if (!path)
if (string_is_empty(path))
return false;
if (conf->include_depth >= MAX_INCLUDE_DEPTH)
@@ -548,7 +565,8 @@ config_file_t *config_file_new_from_string(const char *from_string,
conf->last = NULL;
conf->includes = NULL;
conf->include_depth = 0;
conf->guaranteed_no_duplicates = false ;
conf->guaranteed_no_duplicates = false;
conf->modified = false;
if (!string_is_empty(path))
conf->path = strdup(path);
@@ -640,7 +658,8 @@ config_file_t *config_file_new_alloc(void)
conf->last = NULL;
conf->includes = NULL;
conf->include_depth = 0;
conf->guaranteed_no_duplicates = false ;
conf->guaranteed_no_duplicates = false;
conf->modified = false;
return conf;
}
@@ -804,7 +823,7 @@ bool config_get_string(config_file_t *conf, const char *key, char **str)
{
const struct config_entry_list *entry = config_get_entry(conf, key, NULL);
if (!entry)
if (!entry || !entry->value)
return false;
*str = strdup(entry->value);
@@ -869,20 +888,44 @@ bool config_get_bool(config_file_t *conf, const char *key, bool *in)
void config_set_string(config_file_t *conf, const char *key, const char *val)
{
struct config_entry_list *last = (conf->guaranteed_no_duplicates && conf->last) ? conf->last : conf->entries;
struct config_entry_list *entry = conf->guaranteed_no_duplicates?NULL:config_get_entry(conf, key, &last);
struct config_entry_list *last = NULL;
struct config_entry_list *entry = NULL;
if (entry && !entry->readonly)
if (!conf || !key || !val)
return;
last = (conf->guaranteed_no_duplicates && conf->last) ?
conf->last : conf->entries;
entry = conf->guaranteed_no_duplicates ?
NULL : config_get_entry(conf, key, &last);
if (entry)
{
/* An entry corresponding to 'key' already exists
* > Check if it's read only */
if (entry->readonly)
return;
/* Check whether value is currently set */
if (entry->value)
{
/* Do nothing if value is unchanged */
if (string_is_equal(entry->value, val))
return;
/* Value is to be updated
* > Free existing */
free(entry->value);
entry->value = strdup(val);
}
/* Update value */
entry->value = strdup(val);
conf->modified = true;
return;
}
if (!val)
return;
/* Entry corresponding to 'key' does not exist
* > Create new entry */
entry = (struct config_entry_list*)malloc(sizeof(*entry));
if (!entry)
return;
@@ -891,6 +934,7 @@ void config_set_string(config_file_t *conf, const char *key, const char *val)
entry->key = strdup(key);
entry->value = strdup(val);
entry->next = NULL;
conf->modified = true;
if (last)
last->next = entry;
@@ -902,16 +946,27 @@ void config_set_string(config_file_t *conf, const char *key, const char *val)
void config_unset(config_file_t *conf, const char *key)
{
struct config_entry_list *last = conf->entries;
struct config_entry_list *entry = config_get_entry(conf, key, &last);
struct config_entry_list *last = NULL;
struct config_entry_list *entry = NULL;
if (!conf || !key)
return;
last = conf->entries;
entry = config_get_entry(conf, key, &last);
if (!entry)
return;
entry->key = NULL;
entry->value = NULL;
free(entry->key);
free(entry->value);
if (entry->key)
free(entry->key);
if (entry->value)
free(entry->value);
entry->key = NULL;
entry->value = NULL;
conf->modified = true;
}
void config_set_path(config_file_t *conf, const char *entry, const char *val)
@@ -1003,6 +1058,12 @@ void config_set_bool(config_file_t *conf, const char *key, bool val)
bool config_file_write(config_file_t *conf, const char *path, bool sort)
{
if (!conf)
return false;
if (!conf->modified)
return true;
if (!string_is_empty(path))
{
#ifdef ORBIS
@@ -1030,6 +1091,10 @@ bool config_file_write(config_file_t *conf, const char *path, bool sort)
if (buf)
free(buf);
#endif
/* Only update modified flag if config file
* is actually written to disk */
conf->modified = false;
}
else
config_file_dump(conf, stdout, sort);
+7 -5
View File
@@ -611,7 +611,7 @@ bool path_is_absolute(const char *path)
|| strstr(path, ":\\")
|| strstr(path, ":\\\\"))
return true;
#elif defined(__wiiu__)
#elif defined(__wiiu__) || defined(VITA)
if (strstr(path, ":/"))
return true;
#endif
@@ -764,7 +764,7 @@ end:
size_t path_relative_to(char *out,
const char *path, const char *base, size_t size)
{
size_t i;
size_t i, j;
const char *trimmed_path, *trimmed_base;
#ifdef _WIN32
@@ -776,9 +776,11 @@ size_t path_relative_to(char *out,
#endif
/* Trim common beginning */
for (i = 0; path[i] && base[i] && path[i] == base[i]; )
i++;
trimmed_path = path+i;
for (i = 0, j = 0; path[i] && base[i] && path[i] == base[i]; i++)
if (path[i] == path_default_slash_c())
j = i + 1;
trimmed_path = path+j;
trimmed_base = base+i;
/* Each segment of base turns into ".." */
+7 -2
View File
@@ -90,8 +90,13 @@ bool image_texture_color_convert(unsigned r_shift,
uint8_t r = (uint8_t)(col >> 16);
uint8_t g = (uint8_t)(col >> 8);
uint8_t b = (uint8_t)(col >> 0);
pixels[i] = (a << a_shift) |
(r << r_shift) | (g << g_shift) | (b << b_shift);
/* Explicitly cast these to uint32_t to prevent
* ASAN runtime error: left shift of 255 by 24 places
* cannot be represented in type 'int' */
pixels[i] = ((uint32_t)a << a_shift) |
((uint32_t)r << r_shift) |
((uint32_t)g << g_shift) |
((uint32_t)b << b_shift);
}
return true;
@@ -59,6 +59,7 @@ struct config_file
struct config_entry_list *last;
unsigned include_depth;
bool guaranteed_no_duplicates;
bool modified;
struct config_include_list *includes;
};
+423 -99
View File
@@ -31,40 +31,100 @@
#define SWAP16 _byteswap_ushort
#define SWAP32 _byteswap_ulong
#else
#define SWAP16(x) ((uint16_t)( \
(((uint16_t)(x) & 0x00ff) << 8) | \
(((uint16_t)(x) & 0xff00) >> 8) \
))
#define SWAP32(x) ((uint32_t)( \
(((uint32_t)(x) & 0x000000ff) << 24) | \
(((uint32_t)(x) & 0x0000ff00) << 8) | \
(((uint32_t)(x) & 0x00ff0000) >> 8) | \
(((uint32_t)(x) & 0xff000000) >> 24) \
))
static INLINE uint16_t SWAP16(uint16_t x)
{
return ((x & 0x00ff) << 8) |
((x & 0xff00) >> 8);
}
static INLINE uint32_t SWAP32(uint32_t x)
{
return ((x & 0x000000ff) << 24) |
((x & 0x0000ff00) << 8) |
((x & 0x00ff0000) >> 8) |
((x & 0xff000000) >> 24);
}
#endif
#if defined(_MSC_VER) && _MSC_VER <= 1200
#define SWAP64(val) \
((((uint64_t)(val) & 0x00000000000000ff) << 56) \
| (((uint64_t)(val) & 0x000000000000ff00) << 40) \
| (((uint64_t)(val) & 0x0000000000ff0000) << 24) \
| (((uint64_t)(val) & 0x00000000ff000000) << 8) \
| (((uint64_t)(val) & 0x000000ff00000000) >> 8) \
| (((uint64_t)(val) & 0x0000ff0000000000) >> 24) \
| (((uint64_t)(val) & 0x00ff000000000000) >> 40) \
| (((uint64_t)(val) & 0xff00000000000000) >> 56))
static INLINE uint64_t SWAP64(uint64_t val)
{
return
((val & 0x00000000000000ff) << 56)
| ((val & 0x000000000000ff00) << 40)
| ((val & 0x0000000000ff0000) << 24)
| ((val & 0x00000000ff000000) << 8)
| ((val & 0x000000ff00000000) >> 8)
| ((val & 0x0000ff0000000000) >> 24)
| ((val & 0x00ff000000000000) >> 40)
| ((val & 0xff00000000000000) >> 56);
}
#else
#define SWAP64(val) \
((((uint64_t)(val) & 0x00000000000000ffULL) << 56) \
| (((uint64_t)(val) & 0x000000000000ff00ULL) << 40) \
| (((uint64_t)(val) & 0x0000000000ff0000ULL) << 24) \
| (((uint64_t)(val) & 0x00000000ff000000ULL) << 8) \
| (((uint64_t)(val) & 0x000000ff00000000ULL) >> 8) \
| (((uint64_t)(val) & 0x0000ff0000000000ULL) >> 24) \
| (((uint64_t)(val) & 0x00ff000000000000ULL) >> 40) \
| (((uint64_t)(val) & 0xff00000000000000ULL) >> 56))
static INLINE uint64_t SWAP64(uint64_t val)
{
return ((val & 0x00000000000000ffULL) << 56)
| ((val & 0x000000000000ff00ULL) << 40)
| ((val & 0x0000000000ff0000ULL) << 24)
| ((val & 0x00000000ff000000ULL) << 8)
| ((val & 0x000000ff00000000ULL) >> 8)
| ((val & 0x0000ff0000000000ULL) >> 24)
| ((val & 0x00ff000000000000ULL) >> 40)
| ((val & 0xff00000000000000ULL) >> 56);
}
#endif
#if defined (LSB_FIRST) || defined (MSB_FIRST)
# warning Defining MSB_FIRST and LSB_FIRST in compile options is deprecated
# undef LSB_FIRST
# undef MSB_FIRST
#endif
#ifdef _MSC_VER
#include <winsock2.h>
#endif
#ifdef _MSC_VER
#if _M_IX86 || _M_AMD64 || _M_ARM || _M_ARM64
#define LSB_FIRST 1
#elif _M_PPC
#define MSB_FIRST 1
#else
/* MSVC can run on _M_ALPHA and _M_IA64 too, but they're both bi-endian; need to find what mode MSVC runs them at */
#error "unknown platform, can't determine endianness"
#endif
#else
#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
#define MSB_FIRST 1
#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
#define LSB_FIRST 1
#else
#error "Invalid endianness macros"
#endif
#endif
#if defined(MSB_FIRST) && defined(LSB_FIRST)
# error "Bug in LSB_FIRST/MSB_FIRST definition"
#endif
#if !defined(MSB_FIRST) && !defined(LSB_FIRST)
# error "Bug in LSB_FIRST/MSB_FIRST definition"
#endif
#ifdef MSB_FIRST
# define RETRO_IS_BIG_ENDIAN 1
# define RETRO_IS_LITTLE_ENDIAN 0
/* For compatibility */
# define WORDS_BIGENDIAN 1
#else
# define RETRO_IS_BIG_ENDIAN 0
# define RETRO_IS_LITTLE_ENDIAN 1
/* For compatibility */
# undef WORDS_BIGENDIAN
#endif
/**
* is_little_endian:
*
@@ -73,23 +133,7 @@
* Returns: greater than 0 if little-endian,
* otherwise big-endian.
**/
#if defined(MSB_FIRST)
#define is_little_endian() (0)
#elif defined(__x86_64) || defined(__i386) || defined(_M_IX86) || defined(_M_X64)
#define is_little_endian() (1)
#else
static INLINE uint8_t is_little_endian(void)
{
union
{
uint16_t x;
uint8_t y[2];
} u;
u.x = 1;
return u.y[0];
}
#endif
#define is_little_endian() RETRO_IS_LITTLE_ENDIAN
/**
* swap_if_big64:
@@ -101,17 +145,10 @@ static INLINE uint8_t is_little_endian(void)
* otherwise returns same value.
**/
#if defined(MSB_FIRST)
#if RETRO_IS_BIG_ENDIAN
#define swap_if_big64(val) (SWAP64(val))
#elif defined(__x86_64) || defined(__i386) || defined(_M_IX86) || defined(_M_X64)
#elif RETRO_IS_LITTLE_ENDIAN
#define swap_if_big64(val) (val)
#else
static INLINE uint64_t swap_if_big64(uint64_t val)
{
if (is_little_endian())
return val;
return SWAP64(val);
}
#endif
/**
@@ -124,17 +161,10 @@ static INLINE uint64_t swap_if_big64(uint64_t val)
* otherwise returns same value.
**/
#if defined(MSB_FIRST)
#if RETRO_IS_BIG_ENDIAN
#define swap_if_big32(val) (SWAP32(val))
#elif defined(__x86_64) || defined(__i386) || defined(_M_IX86) || defined(_M_X64)
#elif RETRO_IS_LITTLE_ENDIAN
#define swap_if_big32(val) (val)
#else
static INLINE uint32_t swap_if_big32(uint32_t val)
{
if (is_little_endian())
return val;
return SWAP32(val);
}
#endif
/**
@@ -147,17 +177,10 @@ static INLINE uint32_t swap_if_big32(uint32_t val)
* otherwise returns same value.
**/
#if defined(MSB_FIRST)
#if RETRO_IS_BIG_ENDIAN
#define swap_if_little64(val) (val)
#elif defined(__x86_64) || defined(__i386) || defined(_M_IX86) || defined(_M_X64)
#elif RETRO_IS_LITTLE_ENDIAN
#define swap_if_little64(val) (SWAP64(val))
#else
static INLINE uint64_t swap_if_little64(uint64_t val)
{
if (is_little_endian())
return SWAP64(val);
return val;
}
#endif
/**
@@ -170,17 +193,10 @@ static INLINE uint64_t swap_if_little64(uint64_t val)
* otherwise returns same value.
**/
#if defined(MSB_FIRST)
#if RETRO_IS_BIG_ENDIAN
#define swap_if_little32(val) (val)
#elif defined(__x86_64) || defined(__i386) || defined(_M_IX86) || defined(_M_X64)
#elif RETRO_IS_LITTLE_ENDIAN
#define swap_if_little32(val) (SWAP32(val))
#else
static INLINE uint32_t swap_if_little32(uint32_t val)
{
if (is_little_endian())
return SWAP32(val);
return val;
}
#endif
/**
@@ -193,17 +209,10 @@ static INLINE uint32_t swap_if_little32(uint32_t val)
* otherwise returns same value.
**/
#if defined(MSB_FIRST)
#if RETRO_IS_BIG_ENDIAN
#define swap_if_big16(val) (SWAP16(val))
#elif defined(__x86_64) || defined(__i386) || defined(_M_IX86) || defined(_M_X64)
#elif RETRO_IS_LITTLE_ENDIAN
#define swap_if_big16(val) (val)
#else
static INLINE uint16_t swap_if_big16(uint16_t val)
{
if (is_little_endian())
return val;
return SWAP16(val);
}
#endif
/**
@@ -216,17 +225,10 @@ static INLINE uint16_t swap_if_big16(uint16_t val)
* otherwise returns same value.
**/
#if defined(MSB_FIRST)
#if RETRO_IS_BIG_ENDIAN
#define swap_if_little16(val) (val)
#elif defined(__x86_64) || defined(__i386) || defined(_M_IX86) || defined(_M_X64)
#elif RETRO_IS_LITTLE_ENDIAN
#define swap_if_little16(val) (SWAP16(val))
#else
static INLINE uint16_t swap_if_little16(uint16_t val)
{
if (is_little_endian())
return SWAP16(val);
return val;
}
#endif
/**
@@ -255,4 +257,326 @@ static INLINE uint32_t load32be(const uint32_t *addr)
return swap_if_little32(*addr);
}
/**
* retro_cpu_to_le16:
* @val : unsigned 16-bit value
*
* Convert unsigned 16-bit value from system to little-endian.
*
* Returns: Little-endian representation of val.
**/
#define retro_cpu_to_le16(val) swap_if_big16(val)
/**
* retro_cpu_to_le32:
* @val : unsigned 32-bit value
*
* Convert unsigned 32-bit value from system to little-endian.
*
* Returns: Little-endian representation of val.
**/
#define retro_cpu_to_le32(val) swap_if_big32(val)
/**
* retro_cpu_to_le64:
* @val : unsigned 64-bit value
*
* Convert unsigned 64-bit value from system to little-endian.
*
* Returns: Little-endian representation of val.
**/
#define retro_cpu_to_le64(val) swap_if_big64(val)
/**
* retro_le_to_cpu16:
* @val : unsigned 16-bit value
*
* Convert unsigned 16-bit value from little-endian to native.
*
* Returns: Native representation of little-endian val.
**/
#define retro_le_to_cpu16(val) swap_if_big16(val)
/**
* retro_le_to_cpu32:
* @val : unsigned 32-bit value
*
* Convert unsigned 32-bit value from little-endian to native.
*
* Returns: Native representation of little-endian val.
**/
#define retro_le_to_cpu32(val) swap_if_big32(val)
/**
* retro_le_to_cpu16:
* @val : unsigned 64-bit value
*
* Convert unsigned 64-bit value from little-endian to native.
*
* Returns: Native representation of little-endian val.
**/
#define retro_le_to_cpu64(val) swap_if_big64(val)
/**
* retro_cpu_to_be16:
* @val : unsigned 16-bit value
*
* Convert unsigned 16-bit value from system to big-endian.
*
* Returns: Big-endian representation of val.
**/
#define retro_cpu_to_be16(val) swap_if_little16(val)
/**
* retro_cpu_to_be32:
* @val : unsigned 32-bit value
*
* Convert unsigned 32-bit value from system to big-endian.
*
* Returns: Big-endian representation of val.
**/
#define retro_cpu_to_be32(val) swap_if_little32(val)
/**
* retro_cpu_to_be64:
* @val : unsigned 64-bit value
*
* Convert unsigned 64-bit value from system to big-endian.
*
* Returns: Big-endian representation of val.
**/
#define retro_cpu_to_be64(val) swap_if_little64(val)
/**
* retro_be_to_cpu16:
* @val : unsigned 16-bit value
*
* Convert unsigned 16-bit value from big-endian to native.
*
* Returns: Native representation of big-endian val.
**/
#define retro_be_to_cpu16(val) swap_if_little16(val)
/**
* retro_be_to_cpu32:
* @val : unsigned 32-bit value
*
* Convert unsigned 32-bit value from big-endian to native.
*
* Returns: Native representation of big-endian val.
**/
#define retro_be_to_cpu32(val) swap_if_little32(val)
/**
* retro_be_to_cpu64:
* @val : unsigned 64-bit value
*
* Convert unsigned 64-bit value from big-endian to native.
*
* Returns: Native representation of big-endian val.
**/
#define retro_be_to_cpu64(val) swap_if_little64(val)
#ifdef __GNUC__
/* This attribute means that the same memory may be referred through
pointers to different size of the object (aliasing). E.g. that u8 *
and u32 * may actually be pointing to the same object. */
#define MAY_ALIAS __attribute__((__may_alias__))
#else
#define MAY_ALIAS
#endif
#pragma pack(push, 1)
struct retro_unaligned_uint16_s
{
uint16_t val;
} MAY_ALIAS;
struct retro_unaligned_uint32_s
{
uint32_t val;
} MAY_ALIAS;
struct retro_unaligned_uint64_s
{
uint64_t val;
} MAY_ALIAS;
#pragma pack(pop)
typedef struct retro_unaligned_uint16_s retro_unaligned_uint16_t;
typedef struct retro_unaligned_uint32_s retro_unaligned_uint32_t;
typedef struct retro_unaligned_uint64_s retro_unaligned_uint64_t;
/* L-value references to unaligned pointers. */
#define retro_unaligned16(p) (((retro_unaligned_uint16_t *)p)->val)
#define retro_unaligned32(p) (((retro_unaligned_uint32_t *)p)->val)
#define retro_unaligned64(p) (((retro_unaligned_uint64_t *)p)->val)
/**
* retro_get_unaligned_16be:
* @addr : pointer to unsigned 16-bit value
*
* Convert unsigned unaligned 16-bit value from big-endian to native.
*
* Returns: Native representation of big-endian val.
**/
static INLINE uint16_t retro_get_unaligned_16be(void *addr) {
return retro_be_to_cpu16(retro_unaligned16(addr));
}
/**
* retro_get_unaligned_32be:
* @addr : pointer to unsigned 32-bit value
*
* Convert unsigned unaligned 32-bit value from big-endian to native.
*
* Returns: Native representation of big-endian val.
**/
static INLINE uint32_t retro_get_unaligned_32be(void *addr) {
return retro_be_to_cpu32(retro_unaligned32(addr));
}
/**
* retro_get_unaligned_64be:
* @addr : pointer to unsigned 64-bit value
*
* Convert unsigned unaligned 64-bit value from big-endian to native.
*
* Returns: Native representation of big-endian val.
**/
static INLINE uint64_t retro_get_unaligned_64be(void *addr) {
return retro_be_to_cpu64(retro_unaligned64(addr));
}
/**
* retro_get_unaligned_16le:
* @addr : pointer to unsigned 16-bit value
*
* Convert unsigned unaligned 16-bit value from little-endian to native.
*
* Returns: Native representation of little-endian val.
**/
static INLINE uint16_t retro_get_unaligned_16le(void *addr) {
return retro_le_to_cpu16(retro_unaligned16(addr));
}
/**
* retro_get_unaligned_32le:
* @addr : pointer to unsigned 32-bit value
*
* Convert unsigned unaligned 32-bit value from little-endian to native.
*
* Returns: Native representation of little-endian val.
**/
static INLINE uint32_t retro_get_unaligned_32le(void *addr) {
return retro_le_to_cpu32(retro_unaligned32(addr));
}
/**
* retro_get_unaligned_64le:
* @addr : pointer to unsigned 64-bit value
*
* Convert unsigned unaligned 64-bit value from little-endian to native.
*
* Returns: Native representation of little-endian val.
**/
static INLINE uint64_t retro_get_unaligned_64le(void *addr) {
return retro_le_to_cpu64(retro_unaligned64(addr));
}
/**
* retro_set_unaligned_16le:
* @addr : pointer to unsigned 16-bit value
* @val : value to store
*
* Convert native value to unsigned unaligned 16-bit little-endian value
*
**/
static INLINE void retro_set_unaligned_16le(void *addr, uint16_t v) {
retro_unaligned16(addr) = retro_cpu_to_le16(v);
}
/**
* retro_set_unaligned_32le:
* @addr : pointer to unsigned 32-bit value
* @val : value to store
*
* Convert native value to unsigned unaligned 32-bit little-endian value
*
**/
static INLINE void retro_set_unaligned_32le(void *addr, uint32_t v) {
retro_unaligned32(addr) = retro_cpu_to_le32(v);
}
/**
* retro_set_unaligned_32le:
* @addr : pointer to unsigned 32-bit value
* @val : value to store
*
* Convert native value to unsigned unaligned 32-bit little-endian value
*
**/
static INLINE void retro_set_unaligned_64le(void *addr, uint64_t v) {
retro_unaligned64(addr) = retro_cpu_to_le64(v);
}
/**
* retro_set_unaligned_16be:
* @addr : pointer to unsigned 16-bit value
* @val : value to store
*
* Convert native value to unsigned unaligned 16-bit big-endian value
*
**/
static INLINE void retro_set_unaligned_16be(void *addr, uint16_t v) {
retro_unaligned16(addr) = retro_cpu_to_be16(v);
}
/**
* retro_set_unaligned_32be:
* @addr : pointer to unsigned 32-bit value
* @val : value to store
*
* Convert native value to unsigned unaligned 32-bit big-endian value
*
**/
static INLINE void retro_set_unaligned_32be(void *addr, uint32_t v) {
retro_unaligned32(addr) = retro_cpu_to_be32(v);
}
/**
* retro_set_unaligned_32be:
* @addr : pointer to unsigned 32-bit value
* @val : value to store
*
* Convert native value to unsigned unaligned 32-bit big-endian value
*
**/
static INLINE void retro_set_unaligned_64be(void *addr, uint64_t v) {
retro_unaligned64(addr) = retro_cpu_to_be64(v);
}
#endif
@@ -36,7 +36,8 @@ enum intfstream_type
{
INTFSTREAM_FILE = 0,
INTFSTREAM_MEMORY,
INTFSTREAM_CHD
INTFSTREAM_CHD,
INTFSTREAM_RZIP
};
typedef struct intfstream_internal intfstream_internal_t, intfstream_t;
@@ -74,6 +75,9 @@ int64_t intfstream_read(intfstream_internal_t *intf,
int64_t intfstream_write(intfstream_internal_t *intf,
const void *s, uint64_t len);
int intfstream_printf(intfstream_internal_t *intf,
const char* format, ...);
int64_t intfstream_get_ptr(intfstream_internal_t *intf);
char *intfstream_gets(intfstream_internal_t *intf,
@@ -88,6 +92,8 @@ void intfstream_rewind(intfstream_internal_t *intf);
int64_t intfstream_tell(intfstream_internal_t *intf);
int intfstream_eof(intfstream_internal_t *intf);
void intfstream_putc(intfstream_internal_t *intf, int c);
int intfstream_close(intfstream_internal_t *intf);
@@ -100,7 +106,9 @@ uint32_t intfstream_get_offset_to_start(intfstream_internal_t *intf);
uint32_t intfstream_get_frame_size(intfstream_internal_t *intf);
intfstream_t* intfstream_open_file(const char *path,
bool intfstream_is_compressed(intfstream_internal_t *intf);
intfstream_t *intfstream_open_file(const char *path,
unsigned mode, unsigned hints);
intfstream_t *intfstream_open_memory(void *data,
@@ -112,6 +120,9 @@ intfstream_t *intfstream_open_writable_memory(void *data,
intfstream_t *intfstream_open_chd_track(const char *path,
unsigned mode, unsigned hints, int32_t track);
intfstream_t *intfstream_open_rzip_file(const char *path,
unsigned mode);
RETRO_END_DECLS
#endif
@@ -0,0 +1,188 @@
/* Copyright (C) 2010-2020 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (rzip_stream.h).
* ---------------------------------------------------------------------------------------
*
* Permission is hereby granted, free of charge,
* to any person obtaining a copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef _LIBRETRO_SDK_FILE_RZIP_STREAM_H
#define _LIBRETRO_SDK_FILE_RZIP_STREAM_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdarg.h>
#include <retro_common_api.h>
RETRO_BEGIN_DECLS
/* Rudimentary interface for streaming data to/from a
* zlib-compressed chunk-based RZIP archive file.
*
* This is somewhat less efficient than using regular
* gzip code, but this is by design - the intention here
* is to create an interface that integrates seamlessly
* with normal RetroArch functionality, using only
* standard/existing libretro-common routines.
* (Actual efficiency is pretty good, regardless:
* archived file size is almost identical to a solid
* zip file, and compression/decompression speed is
* not substantially worse than external archiving tools;
* it is certainly acceptable for use in real-time
* frontend applications)
*
* When reading existing files, uncompressed content
* is handled automatically. File type (compressed/
* uncompressed) is detected via the RZIP header.
*
* ## RZIP file format:
*
* <file id header>: 8 bytes
* - [#][R][Z][I][P][v][file format version][#]
* <uncompressed chunk size>: 4 bytes, little endian order
* - nominal (maximum) size of each uncompressed
* chunk, in bytes
* <total uncompressed data size>: 8 bytes, little endian order
* <size of next compressed chunk>: 4 bytes, little endian order
* - size on-disk of next compressed data
* chunk, in bytes
* <next compressed chunk>: n bytes of zlib compressed data
* ...
* <size of next compressed chunk> : repeated until end of file
* <next compressed chunk> :
*
*/
/* Prevent direct access to rzipstream_t members */
typedef struct rzipstream rzipstream_t;
/* File Open */
/* Opens a new or existing RZIP file
* > Supported 'mode' values are:
* - RETRO_VFS_FILE_ACCESS_READ
* - RETRO_VFS_FILE_ACCESS_WRITE
* > When reading, 'path' may reference compressed
* or uncompressed data
* Returns NULL if arguments are invalid, file
* is invalid or an IO error occurs */
rzipstream_t* rzipstream_open(const char *path, unsigned mode);
/* File Read */
/* Reads (a maximum of) 'len' bytes from an RZIP file.
* Returns actual number of bytes read, or -1 in
* the event of an error */
int64_t rzipstream_read(rzipstream_t *stream, void *data, int64_t len);
/* Reads next character from an RZIP file.
* Returns character value, or EOF if no data
* remains.
* Note: Always returns EOF if file is open
* for writing. */
int rzipstream_getc(rzipstream_t *stream);
/* Reads one line from an RZIP file and stores it
* in the character array pointed to by 's'.
* It stops reading when either (len-1) characters
* are read, the newline character is read, or the
* end-of-file is reached, whichever comes first.
* On success, returns 's'. In the event of an error,
* or if end-of-file is reached and no characters
* have been read, returns NULL. */
char* rzipstream_gets(rzipstream_t *stream, char *s, size_t len);
/* Reads all data from file specified by 'path' and
* copies it to 'buf'.
* - 'buf' will be allocated and must be free()'d manually.
* - Allocated 'buf' size is equal to 'len'.
* Returns false in the event of an error */
bool rzipstream_read_file(const char *path, void **buf, int64_t *len);
/* File Write */
/* Writes 'len' bytes to an RZIP file.
* Returns actual number of bytes written, or -1
* in the event of an error */
int64_t rzipstream_write(rzipstream_t *stream, const void *data, int64_t len);
/* Writes a single character to an RZIP file.
* Returns character written, or EOF in the event
* of an error */
int rzipstream_putc(rzipstream_t *stream, int c);
/* Writes a variable argument list to an RZIP file.
* Ugly 'internal' function, required to enable
* 'printf' support in the higher level 'interface_stream'.
* Returns actual number of bytes written, or -1
* in the event of an error */
int rzipstream_vprintf(rzipstream_t *stream, const char* format, va_list args);
/* Writes formatted output to an RZIP file.
* Returns actual number of bytes written, or -1
* in the event of an error */
int rzipstream_printf(rzipstream_t *stream, const char* format, ...);
/* Writes contents of 'data' buffer to file
* specified by 'path'.
* Returns false in the event of an error */
bool rzipstream_write_file(const char *path, const void *data, int64_t len);
/* File Control */
/* Sets file position to the beginning of the
* specified RZIP file.
* Note: It is not recommended to rewind a file
* that is open for writing, since the caller
* may end up with a file containing junk data
* at the end (harmless, but a waste of space). */
void rzipstream_rewind(rzipstream_t *stream);
/* File Status */
/* Returns total size (in bytes) of the *uncompressed*
* data in an RZIP file.
* (If reading an uncompressed file, this corresponds
* to the 'physical' file size in bytes)
* Returns -1 in the event of a error. */
int64_t rzipstream_get_size(rzipstream_t *stream);
/* Returns EOF when no further *uncompressed* data
* can be read from an RZIP file. */
int rzipstream_eof(rzipstream_t *stream);
/* Returns the offset of the current byte of *uncompressed*
* data relative to the beginning of an RZIP file.
* Returns -1 in the event of a error. */
int64_t rzipstream_tell(rzipstream_t *stream);
/* Returns true if specified RZIP file contains
* compressed content */
bool rzipstream_is_compressed(rzipstream_t *stream);
/* File Close */
/* Closes RZIP file. If file is open for writing,
* flushes any remaining buffered data to disk.
* Returns -1 in the event of a error. */
int rzipstream_close(rzipstream_t *stream);
RETRO_END_DECLS
#endif
+49 -44
View File
@@ -25,51 +25,56 @@ static void (*co_swap)(cothread_t, cothread_t) = 0;
#ifdef _WIN32
/* ABI: Win64 */
/* On windows handle is allocated by malloc and there it's guaranteed to
have at least 16-byte alignment. Hence we don't need to align
it in order to use movaps. */
static unsigned char co_swap_function[] = {
0x48, 0x89, 0x22, /* mov [rdx],rsp */
0x48, 0x8b, 0x21, /* mov rsp,[rcx] */
0x58, /* pop rax */
0x48, 0x89, 0x6a, 0x08, /* mov [rdx+0x8],rbp */
0x48, 0x89, 0x72, 0x10, /* mov [rdx+0x10],rsi */
0x48, 0x89, 0x7a, 0x18, /* mov [rdx+0x18],rdi */
0x48, 0x89, 0x5a, 0x20, /* mov [rdx+0x20],rbx */
0x4c, 0x89, 0x62, 0x28, /* mov [rdx+0x28],r12 */
0x4c, 0x89, 0x6a, 0x30, /* mov [rdx+0x30],r13 */
0x4c, 0x89, 0x72, 0x38, /* mov [rdx+0x38],r14 */
0x4c, 0x89, 0x7a, 0x40, /* mov [rdx+0x40],r15 */
0x48, 0x81, 0xc2, 0x80, 0x00, 0x00, 0x00, /* add rdx,0x80 */
0x48, 0x83, 0xe2, 0xf0, /* and rdx,-0x10 */
0x0f, 0x29, 0x32, /* movaps [rdx],xmm6 */
0x0f, 0x29, 0x7a, 0x10, /* movaps [rdx+0x10],xmm7 */
0x44, 0x0f, 0x29, 0x42, 0x20, /* movaps [rdx+0x20],xmm8 */
0x44, 0x0f, 0x29, 0x4a, 0x30, /* movaps [rdx+0x30],xmm9 */
0x44, 0x0f, 0x29, 0x52, 0x40, /* movaps [rdx+0x40],xmm10 */
0x44, 0x0f, 0x29, 0x5a, 0x50, /* movaps [rdx+0x50],xmm11 */
0x44, 0x0f, 0x29, 0x62, 0x60, /* movaps [rdx+0x60],xmm12 */
0x44, 0x0f, 0x29, 0x6a, 0x70, /* movaps [rdx+0x70],xmm13 */
0x44, 0x0f, 0x29, 0xb2, 0x80, 0x00, 0x00, 0x00, /* movaps [rdx+0x80],xmm14 */
0x44, 0x0f, 0x29, 0xba, 0x90, 0x00, 0x00, 0x00, /* movaps [rdx+0x90],xmm15 */
0x48, 0x8b, 0x69, 0x08, /* mov rbp,[rcx+0x8] */
0x48, 0x8b, 0x71, 0x10, /* mov rsi,[rcx+0x10] */
0x48, 0x8b, 0x79, 0x18, /* mov rdi,[rcx+0x18] */
0x48, 0x8b, 0x59, 0x20, /* mov rbx,[rcx+0x20] */
0x4c, 0x8b, 0x61, 0x28, /* mov r12,[rcx+0x28] */
0x4c, 0x8b, 0x69, 0x30, /* mov r13,[rcx+0x30] */
0x4c, 0x8b, 0x71, 0x38, /* mov r14,[rcx+0x38] */
0x4c, 0x8b, 0x79, 0x40, /* mov r15,[rcx+0x40] */
0x48, 0x81, 0xc1, 0x80, 0x00, 0x00, 0x00, /* add rcx,0x80 */
0x48, 0x83, 0xe1, 0xf0, /* and rcx,-0x10 */
0x0f, 0x29, 0x31, /* movaps [rcx],xmm6 */
0x0f, 0x29, 0x79, 0x10, /* movaps [rcx+0x10],xmm7 */
0x44, 0x0f, 0x29, 0x41, 0x20, /* movaps [rcx+0x20],xmm8 */
0x44, 0x0f, 0x29, 0x49, 0x30, /* movaps [rcx+0x30],xmm9 */
0x44, 0x0f, 0x29, 0x51, 0x40, /* movaps [rcx+0x40],xmm10 */
0x44, 0x0f, 0x29, 0x59, 0x50, /* movaps [rcx+0x50],xmm11 */
0x44, 0x0f, 0x29, 0x61, 0x60, /* movaps [rcx+0x60],xmm12 */
0x44, 0x0f, 0x29, 0x69, 0x70, /* movaps [rcx+0x70],xmm13 */
0x44, 0x0f, 0x29, 0xb1, 0x80, 0x00, 0x00, 0x00, /* movaps [rcx+0x80],xmm14 */
0x44, 0x0f, 0x29, 0xb9, 0x90, 0x00, 0x00, 0x00, /* movaps [rcx+0x90],xmm15 */
0xff, 0xe0, /* jmp rax */
0x48, 0x89, 0x22, /* mov [rdx],rsp */
0x48, 0x8b, 0x21, /* mov rsp,[rcx] */
0x58, /* pop rax */
0x48, 0x89, 0x6a, 0x08, /* mov [rdx+ 8],rbp */
0x48, 0x89, 0x72, 0x10, /* mov [rdx+16],rsi */
0x48, 0x89, 0x7a, 0x18, /* mov [rdx+24],rdi */
0x48, 0x89, 0x5a, 0x20, /* mov [rdx+32],rbx */
0x4c, 0x89, 0x62, 0x28, /* mov [rdx+40],r12 */
0x4c, 0x89, 0x6a, 0x30, /* mov [rdx+48],r13 */
0x4c, 0x89, 0x72, 0x38, /* mov [rdx+56],r14 */
0x4c, 0x89, 0x7a, 0x40, /* mov [rdx+64],r15 */
#if !defined(LIBCO_NO_SSE)
0x0f, 0x29, 0x72, 0x50, /* movaps [rdx+ 80],xmm6 */
0x0f, 0x29, 0x7a, 0x60, /* movaps [rdx+ 96],xmm7 */
0x44, 0x0f, 0x29, 0x42, 0x70, /* movaps [rdx+112],xmm8 */
0x48, 0x83, 0xc2, 0x70, /* add rdx,112 */
0x44, 0x0f, 0x29, 0x4a, 0x10, /* movaps [rdx+ 16],xmm9 */
0x44, 0x0f, 0x29, 0x52, 0x20, /* movaps [rdx+ 32],xmm10 */
0x44, 0x0f, 0x29, 0x5a, 0x30, /* movaps [rdx+ 48],xmm11 */
0x44, 0x0f, 0x29, 0x62, 0x40, /* movaps [rdx+ 64],xmm12 */
0x44, 0x0f, 0x29, 0x6a, 0x50, /* movaps [rdx+ 80],xmm13 */
0x44, 0x0f, 0x29, 0x72, 0x60, /* movaps [rdx+ 96],xmm14 */
0x44, 0x0f, 0x29, 0x7a, 0x70, /* movaps [rdx+112],xmm15 */
#endif
0x48, 0x8b, 0x69, 0x08, /* mov rbp,[rcx+ 8] */
0x48, 0x8b, 0x71, 0x10, /* mov rsi,[rcx+16] */
0x48, 0x8b, 0x79, 0x18, /* mov rdi,[rcx+24] */
0x48, 0x8b, 0x59, 0x20, /* mov rbx,[rcx+32] */
0x4c, 0x8b, 0x61, 0x28, /* mov r12,[rcx+40] */
0x4c, 0x8b, 0x69, 0x30, /* mov r13,[rcx+48] */
0x4c, 0x8b, 0x71, 0x38, /* mov r14,[rcx+56] */
0x4c, 0x8b, 0x79, 0x40, /* mov r15,[rcx+64] */
#if !defined(LIBCO_NO_SSE)
0x0f, 0x28, 0x71, 0x50, /* movaps xmm6, [rcx+ 80] */
0x0f, 0x28, 0x79, 0x60, /* movaps xmm7, [rcx+ 96] */
0x44, 0x0f, 0x28, 0x41, 0x70, /* movaps xmm8, [rcx+112] */
0x48, 0x83, 0xc1, 0x70, /* add rcx,112 */
0x44, 0x0f, 0x28, 0x49, 0x10, /* movaps xmm9, [rcx+ 16] */
0x44, 0x0f, 0x28, 0x51, 0x20, /* movaps xmm10,[rcx+ 32] */
0x44, 0x0f, 0x28, 0x59, 0x30, /* movaps xmm11,[rcx+ 48] */
0x44, 0x0f, 0x28, 0x61, 0x40, /* movaps xmm12,[rcx+ 64] */
0x44, 0x0f, 0x28, 0x69, 0x50, /* movaps xmm13,[rcx+ 80] */
0x44, 0x0f, 0x28, 0x71, 0x60, /* movaps xmm14,[rcx+ 96] */
0x44, 0x0f, 0x28, 0x79, 0x70, /* movaps xmm15,[rcx+112] */
#endif
0xff, 0xe0, /* jmp rax */
};
#include <windows.h>
+20 -12
View File
@@ -313,23 +313,20 @@ static scond_t *worker_cond = NULL;
static sthread_t *worker_thread = NULL;
static bool worker_continue = true; /* use running_lock when touching it */
/* 'queue_lock' must be held for the duration of this function */
static void task_queue_remove(task_queue_t *queue, retro_task_t *task)
{
retro_task_t *t = NULL;
retro_task_t *front = NULL;
slock_lock(queue_lock);
front = queue->front;
slock_unlock(queue_lock);
/* Remove first element if needed */
if (task == front)
{
slock_lock(queue_lock);
queue->front = task->next;
if (queue->back == task) /* if only element, also update back */
queue->back = NULL;
slock_unlock(queue_lock);
task->next = NULL;
return;
}
@@ -348,10 +345,8 @@ static void task_queue_remove(task_queue_t *queue, retro_task_t *task)
/* When removing the tail of the queue, update the tail pointer */
if (queue->back == task)
{
slock_lock(queue_lock);
if (queue->back == task)
queue->back = t;
slock_unlock(queue_lock);
}
break;
}
@@ -506,18 +501,31 @@ static void threaded_worker(void *userdata)
finished = task->finished;
slock_unlock(property_lock);
slock_lock(running_lock);
task_queue_remove(&tasks_running, task);
slock_unlock(running_lock);
/* Update queue */
if (!finished)
{
/* Re-add task to running queue */
retro_task_threaded_push_running(task);
/* Move the task to the back of the queue */
/* mimics retro_task_threaded_push_running, but also includes a task_queue_remove */
slock_lock(running_lock);
slock_lock(queue_lock);
if (task->next != NULL) /* do nothing if only item in queue */
{
task_queue_remove(&tasks_running, task);
task_queue_put(&tasks_running, task);
scond_signal(worker_cond);
}
slock_unlock(queue_lock);
slock_unlock(running_lock);
}
else
{
/* Remove task from running queue */
slock_lock(running_lock);
slock_lock(queue_lock);
task_queue_remove(&tasks_running, task);
slock_unlock(queue_lock);
slock_unlock(running_lock);
/* Add task to finished queue */
slock_lock(finished_lock);
task_queue_put(&tasks_finished, task);
+194 -2
View File
@@ -28,6 +28,9 @@
#ifdef HAVE_CHD
#include <streams/chd_stream.h>
#endif
#if defined(HAVE_ZLIB)
#include <streams/rzip_stream.h>
#endif
struct intfstream_internal
{
@@ -55,6 +58,12 @@ struct intfstream_internal
chdstream_t *fp;
} chd;
#endif
#if defined(HAVE_ZLIB)
struct
{
rzipstream_t *fp;
} rzip;
#endif
};
int64_t intfstream_get_size(intfstream_internal_t *intf)
@@ -73,6 +82,12 @@ int64_t intfstream_get_size(intfstream_internal_t *intf)
return chdstream_get_size(intf->chd.fp);
#else
break;
#endif
case INTFSTREAM_RZIP:
#if defined(HAVE_ZLIB)
return rzipstream_get_size(intf->rzip.fp);
#else
break;
#endif
}
@@ -99,6 +114,9 @@ bool intfstream_resize(intfstream_internal_t *intf, intfstream_info_t *info)
#ifdef HAVE_CHD
#endif
break;
case INTFSTREAM_RZIP:
/* Unsupported */
return false;
}
return true;
@@ -130,6 +148,15 @@ bool intfstream_open(intfstream_internal_t *intf, const char *path,
break;
#else
return false;
#endif
case INTFSTREAM_RZIP:
#if defined(HAVE_ZLIB)
intf->rzip.fp = rzipstream_open(path, mode);
if (!intf->rzip.fp)
return false;
break;
#else
return false;
#endif
}
@@ -147,6 +174,7 @@ int intfstream_flush(intfstream_internal_t *intf)
return filestream_flush(intf->file.fp);
case INTFSTREAM_MEMORY:
case INTFSTREAM_CHD:
case INTFSTREAM_RZIP:
/* Should we stub this for these interfaces? */
break;
}
@@ -173,6 +201,12 @@ int intfstream_close(intfstream_internal_t *intf)
#ifdef HAVE_CHD
if (intf->chd.fp)
chdstream_close(intf->chd.fp);
#endif
return 0;
case INTFSTREAM_RZIP:
#if defined(HAVE_ZLIB)
if (intf->rzip.fp)
return rzipstream_close(intf->rzip.fp);
#endif
return 0;
}
@@ -209,6 +243,8 @@ void *intfstream_init(intfstream_info_t *info)
#else
goto error;
#endif
case INTFSTREAM_RZIP:
break;
}
return intf;
@@ -252,6 +288,9 @@ int64_t intfstream_seek(intfstream_internal_t *intf, int64_t offset, int whence)
#else
break;
#endif
case INTFSTREAM_RZIP:
/* Unsupported */
break;
}
return -1;
@@ -273,6 +312,12 @@ int64_t intfstream_read(intfstream_internal_t *intf, void *s, uint64_t len)
return chdstream_read(intf->chd.fp, s, len);
#else
break;
#endif
case INTFSTREAM_RZIP:
#if defined(HAVE_ZLIB)
return rzipstream_read(intf->rzip.fp, s, len);
#else
break;
#endif
}
@@ -293,6 +338,46 @@ int64_t intfstream_write(intfstream_internal_t *intf,
return memstream_write(intf->memory.fp, s, len);
case INTFSTREAM_CHD:
return -1;
case INTFSTREAM_RZIP:
#if defined(HAVE_ZLIB)
return rzipstream_write(intf->rzip.fp, s, len);
#else
return -1;
#endif
}
return 0;
}
int intfstream_printf(intfstream_internal_t *intf,
const char* format, ...)
{
va_list vl;
int result;
if (!intf)
return 0;
switch (intf->type)
{
case INTFSTREAM_FILE:
va_start(vl, format);
result = filestream_vprintf(intf->file.fp, format, vl);
va_end(vl);
return result;
case INTFSTREAM_MEMORY:
return -1;
case INTFSTREAM_CHD:
return -1;
case INTFSTREAM_RZIP:
#if defined(HAVE_ZLIB)
va_start(vl, format);
result = rzipstream_vprintf(intf->rzip.fp, format, vl);
va_end(vl);
return result;
#else
return -1;
#endif
}
return 0;
@@ -311,6 +396,8 @@ int64_t intfstream_get_ptr(intfstream_internal_t* intf)
return memstream_get_ptr(intf->memory.fp);
case INTFSTREAM_CHD:
return -1;
case INTFSTREAM_RZIP:
return -1;
}
return 0;
@@ -335,6 +422,12 @@ char *intfstream_gets(intfstream_internal_t *intf,
return chdstream_gets(intf->chd.fp, buffer, len);
#else
break;
#endif
case INTFSTREAM_RZIP:
#if defined(HAVE_ZLIB)
return rzipstream_gets(intf->rzip.fp, buffer, len);
#else
break;
#endif
}
@@ -357,6 +450,12 @@ int intfstream_getc(intfstream_internal_t *intf)
return chdstream_getc(intf->chd.fp);
#else
break;
#endif
case INTFSTREAM_RZIP:
#if defined(HAVE_ZLIB)
return rzipstream_getc(intf->rzip.fp);
#else
break;
#endif
}
@@ -379,6 +478,40 @@ int64_t intfstream_tell(intfstream_internal_t *intf)
return (int64_t)chdstream_tell(intf->chd.fp);
#else
break;
#endif
case INTFSTREAM_RZIP:
#if defined(HAVE_ZLIB)
return (int64_t)rzipstream_tell(intf->rzip.fp);
#else
break;
#endif
}
return -1;
}
int intfstream_eof(intfstream_internal_t *intf)
{
if (!intf)
return -1;
switch (intf->type)
{
case INTFSTREAM_FILE:
return filestream_eof(intf->file.fp);
case INTFSTREAM_MEMORY:
/* TODO: Add this functionality to
* memory_stream interface */
break;
case INTFSTREAM_CHD:
/* TODO: Add this functionality to
* chd_stream interface */
break;
case INTFSTREAM_RZIP:
#if defined(HAVE_ZLIB)
return rzipstream_eof(intf->rzip.fp);
#else
break;
#endif
}
@@ -398,6 +531,11 @@ void intfstream_rewind(intfstream_internal_t *intf)
case INTFSTREAM_CHD:
#ifdef HAVE_CHD
chdstream_rewind(intf->chd.fp);
#endif
break;
case INTFSTREAM_RZIP:
#if defined(HAVE_ZLIB)
rzipstream_rewind(intf->rzip.fp);
#endif
break;
}
@@ -418,6 +556,12 @@ void intfstream_putc(intfstream_internal_t *intf, int c)
break;
case INTFSTREAM_CHD:
break;
case INTFSTREAM_RZIP:
#if defined(HAVE_ZLIB)
rzipstream_putc(intf->rzip.fp, c);
#else
break;
#endif
}
}
@@ -447,6 +591,30 @@ uint32_t intfstream_get_frame_size(intfstream_internal_t *intf)
return 0;
}
bool intfstream_is_compressed(intfstream_internal_t *intf)
{
if (!intf)
return false;
switch (intf->type)
{
case INTFSTREAM_FILE:
return false;
case INTFSTREAM_MEMORY:
return false;
case INTFSTREAM_CHD:
return true;
case INTFSTREAM_RZIP:
#if defined(HAVE_ZLIB)
return rzipstream_is_compressed(intf->rzip.fp);
#else
break;
#endif
}
return false;
}
intfstream_t* intfstream_open_file(const char *path,
unsigned mode, unsigned hints)
{
@@ -531,8 +699,6 @@ error:
return NULL;
}
intfstream_t *intfstream_open_chd_track(const char *path,
unsigned mode, unsigned hints, int32_t track)
{
@@ -560,3 +726,29 @@ error:
}
return NULL;
}
intfstream_t* intfstream_open_rzip_file(const char *path,
unsigned mode)
{
intfstream_info_t info;
intfstream_t *fd = NULL;
info.type = INTFSTREAM_RZIP;
fd = (intfstream_t*)intfstream_init(&info);
if (!fd)
return NULL;
if (!intfstream_open(fd, path, mode, RETRO_VFS_FILE_ACCESS_HINT_NONE))
goto error;
return fd;
error:
if (fd)
{
intfstream_close(fd);
free(fd);
}
return NULL;
}
File diff suppressed because it is too large. Load diff
+2
View File
@@ -670,6 +670,7 @@ generic_deferred_push_clear_general(deferred_push_dropdown_box_list_playlist_def
generic_deferred_push_clear_general(deferred_push_dropdown_box_list_playlist_label_display_mode, PUSH_DEFAULT, DISPLAYLIST_DROPDOWN_LIST_PLAYLIST_LABEL_DISPLAY_MODE)
generic_deferred_push_clear_general(deferred_push_dropdown_box_list_playlist_right_thumbnail_mode, PUSH_DEFAULT, DISPLAYLIST_DROPDOWN_LIST_PLAYLIST_RIGHT_THUMBNAIL_MODE)
generic_deferred_push_clear_general(deferred_push_dropdown_box_list_playlist_left_thumbnail_mode, PUSH_DEFAULT, DISPLAYLIST_DROPDOWN_LIST_PLAYLIST_LEFT_THUMBNAIL_MODE)
generic_deferred_push_clear_general(deferred_push_dropdown_box_list_playlist_sort_mode, PUSH_DEFAULT, DISPLAYLIST_DROPDOWN_LIST_PLAYLIST_SORT_MODE)
generic_deferred_push_clear_general(deferred_push_dropdown_box_list_manual_content_scan_system_name, PUSH_DEFAULT, DISPLAYLIST_DROPDOWN_LIST_MANUAL_CONTENT_SCAN_SYSTEM_NAME)
generic_deferred_push_clear_general(deferred_push_dropdown_box_list_manual_content_scan_core_name, PUSH_DEFAULT, DISPLAYLIST_DROPDOWN_LIST_MANUAL_CONTENT_SCAN_CORE_NAME)
generic_deferred_push_clear_general(deferred_push_dropdown_box_list_disk_index, PUSH_DEFAULT, DISPLAYLIST_DROPDOWN_LIST_DISK_INDEX)
@@ -699,6 +700,7 @@ static int menu_cbs_init_bind_deferred_push_compare_label(
{MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_PLAYLIST_LABEL_DISPLAY_MODE, deferred_push_dropdown_box_list_playlist_label_display_mode},
{MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_PLAYLIST_RIGHT_THUMBNAIL_MODE, deferred_push_dropdown_box_list_playlist_right_thumbnail_mode},
{MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_PLAYLIST_LEFT_THUMBNAIL_MODE, deferred_push_dropdown_box_list_playlist_left_thumbnail_mode},
{MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_PLAYLIST_SORT_MODE, deferred_push_dropdown_box_list_playlist_sort_mode},
{MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_DISK_INDEX, deferred_push_dropdown_box_list_disk_index},
{MENU_ENUM_LABEL_DEFERRED_BROWSE_URL_LIST, deferred_push_browse_url_list},
{MENU_ENUM_LABEL_DEFERRED_BROWSE_URL_START, deferred_push_browse_url_start},
+39
View File
@@ -1189,6 +1189,41 @@ static void menu_action_setting_disp_set_label_playlist_left_thumbnail_mode(
len);
}
static void menu_action_setting_disp_set_label_playlist_sort_mode(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
char *s, size_t len,
const char *path,
char *s2, size_t len2)
{
enum playlist_sort_mode sort_mode;
playlist_t *playlist = playlist_get_cached();
if (!playlist)
return;
sort_mode = playlist_get_sort_mode(playlist);
*w = 19;
strlcpy(s2, path, len2);
switch (sort_mode)
{
case PLAYLIST_SORT_MODE_ALPHABETICAL:
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_PLAYLIST_MANAGER_SORT_MODE_ALPHABETICAL), len);
break;
case PLAYLIST_SORT_MODE_OFF:
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_PLAYLIST_MANAGER_SORT_MODE_OFF), len);
break;
case PLAYLIST_SORT_MODE_DEFAULT:
default:
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_PLAYLIST_MANAGER_SORT_MODE_DEFAULT), len);
break;
}
}
static void menu_action_setting_disp_set_label_core_options(file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
@@ -1509,6 +1544,10 @@ static int menu_cbs_init_bind_get_string_representation_compare_label(
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_playlist_left_thumbnail_mode);
break;
case MENU_ENUM_LABEL_PLAYLIST_MANAGER_SORT_MODE:
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_playlist_sort_mode);
break;
case MENU_ENUM_LABEL_MANUAL_CONTENT_SCAN_DIR:
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_manual_content_scan_dir);
+38 -3
View File
@@ -390,6 +390,7 @@ static int playlist_association_left(unsigned type, const char *label,
size_t i, next, current = 0;
settings_t *settings = config_get_ptr();
bool playlist_use_old_format = settings->bools.playlist_use_old_format;
bool playlist_compression = settings->bools.playlist_compression;
playlist_t *playlist = playlist_get_cached();
core_info_list_t *core_info_list = NULL;
core_info_t *core_info = NULL;
@@ -448,7 +449,8 @@ static int playlist_association_left(unsigned type, const char *label,
/* Update playlist */
playlist_set_default_core_path(playlist, core_info->path);
playlist_set_default_core_name(playlist, core_info->display_name);
playlist_write_file(playlist, playlist_use_old_format);
playlist_write_file(
playlist, playlist_use_old_format, playlist_compression);
return 0;
}
@@ -459,6 +461,7 @@ static int playlist_label_display_mode_left(unsigned type, const char *label,
enum playlist_label_display_mode label_display_mode;
settings_t *settings = config_get_ptr();
bool playlist_use_old_format = settings->bools.playlist_use_old_format;
bool playlist_compression = settings->bools.playlist_compression;
playlist_t *playlist = playlist_get_cached();
if (!playlist)
@@ -472,7 +475,8 @@ static int playlist_label_display_mode_left(unsigned type, const char *label,
label_display_mode = LABEL_DISPLAY_MODE_KEEP_REGION_AND_DISC_INDEX;
playlist_set_label_display_mode(playlist, label_display_mode);
playlist_write_file(playlist, playlist_use_old_format);
playlist_write_file(
playlist, playlist_use_old_format, playlist_compression);
return 0;
}
@@ -482,6 +486,7 @@ static void playlist_thumbnail_mode_left(playlist_t *playlist, enum playlist_thu
{
settings_t *settings = config_get_ptr();
bool playlist_use_old_format = settings->bools.playlist_use_old_format;
bool playlist_compression = settings->bools.playlist_compression;
enum playlist_thumbnail_mode thumbnail_mode =
playlist_get_thumbnail_mode(playlist, thumbnail_id);
@@ -491,7 +496,8 @@ static void playlist_thumbnail_mode_left(playlist_t *playlist, enum playlist_thu
thumbnail_mode = PLAYLIST_THUMBNAIL_MODE_BOXARTS;
playlist_set_thumbnail_mode(playlist, thumbnail_id, thumbnail_mode);
playlist_write_file(playlist, playlist_use_old_format);
playlist_write_file(
playlist, playlist_use_old_format, playlist_compression);
}
static int playlist_right_thumbnail_mode_left(unsigned type, const char *label,
@@ -520,6 +526,32 @@ static int playlist_left_thumbnail_mode_left(unsigned type, const char *label,
return 0;
}
static int playlist_sort_mode_left(unsigned type, const char *label,
bool wraparound)
{
enum playlist_sort_mode sort_mode;
settings_t *settings = config_get_ptr();
bool playlist_use_old_format = settings->bools.playlist_use_old_format;
bool playlist_compression = settings->bools.playlist_compression;
playlist_t *playlist = playlist_get_cached();
if (!playlist)
return -1;
sort_mode = playlist_get_sort_mode(playlist);
if (sort_mode > PLAYLIST_SORT_MODE_DEFAULT)
sort_mode = (enum playlist_sort_mode)((int)sort_mode - 1);
else if (wraparound)
sort_mode = PLAYLIST_SORT_MODE_OFF;
playlist_set_sort_mode(playlist, sort_mode);
playlist_write_file(
playlist, playlist_use_old_format, playlist_compression);
return 0;
}
static int manual_content_scan_system_name_left(
unsigned type, const char *label,
bool wraparound)
@@ -924,6 +956,9 @@ static int menu_cbs_init_bind_left_compare_label(menu_file_list_cbs_t *cbs,
case MENU_ENUM_LABEL_PLAYLIST_MANAGER_LEFT_THUMBNAIL_MODE:
BIND_ACTION_LEFT(cbs, playlist_left_thumbnail_mode_left);
break;
case MENU_ENUM_LABEL_PLAYLIST_MANAGER_SORT_MODE:
BIND_ACTION_LEFT(cbs, playlist_sort_mode_left);
break;
case MENU_ENUM_LABEL_MANUAL_CONTENT_SCAN_SYSTEM_NAME:
BIND_ACTION_LEFT(cbs, manual_content_scan_system_name_left);
break;
+155 -52
View File
@@ -187,6 +187,8 @@ static enum msg_hash_enums action_ok_dl_to_enum(unsigned lbl)
return MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_PLAYLIST_RIGHT_THUMBNAIL_MODE;
case ACTION_OK_DL_DROPDOWN_BOX_LIST_PLAYLIST_LEFT_THUMBNAIL_MODE:
return MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_PLAYLIST_LEFT_THUMBNAIL_MODE;
case ACTION_OK_DL_DROPDOWN_BOX_LIST_PLAYLIST_SORT_MODE:
return MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_PLAYLIST_SORT_MODE;
case ACTION_OK_DL_DROPDOWN_BOX_LIST_MANUAL_CONTENT_SCAN_SYSTEM_NAME:
return MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_MANUAL_CONTENT_SCAN_SYSTEM_NAME;
case ACTION_OK_DL_DROPDOWN_BOX_LIST_MANUAL_CONTENT_SCAN_CORE_NAME:
@@ -524,6 +526,15 @@ int generic_action_ok_displaylist_push(const char *path,
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_PLAYLIST_LEFT_THUMBNAIL_MODE;
dl_type = DISPLAYLIST_GENERIC;
break;
case ACTION_OK_DL_DROPDOWN_BOX_LIST_PLAYLIST_SORT_MODE:
info.type = type;
info.directory_ptr = idx;
info_path = path;
info_label = msg_hash_to_str(
MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_PLAYLIST_SORT_MODE);
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_PLAYLIST_SORT_MODE;
dl_type = DISPLAYLIST_GENERIC;
break;
case ACTION_OK_DL_DROPDOWN_BOX_LIST_MANUAL_CONTENT_SCAN_SYSTEM_NAME:
info.type = type;
info.directory_ptr = idx;
@@ -1211,9 +1222,13 @@ static bool menu_content_playlist_load(playlist_t *playlist, size_t idx)
char path[PATH_MAX_LENGTH];
const struct playlist_entry *entry = NULL;
path[0] = '\0';
playlist_get_index(playlist, idx, &entry);
path[0] = '\0';
if (!entry || string_is_empty(entry->path))
return false;
strlcpy(path, entry->path, sizeof(path));
playlist_resolve_path(PLAYLIST_LOAD, path, sizeof(path));
@@ -2014,15 +2029,21 @@ static int action_ok_playlist_entry_collection(const char *path,
{
char new_path[PATH_MAX_LENGTH];
char new_core_path[PATH_MAX_LENGTH];
size_t selection_ptr = 0;
bool playlist_initialized = false;
playlist_t *playlist = NULL;
playlist_t *tmp_playlist = NULL;
const struct playlist_entry *entry = NULL;
unsigned i = 0;
menu_handle_t *menu = menu_driver_get_ptr();
settings_t *settings = config_get_ptr();
bool playlist_use_old_format = settings->bools.playlist_use_old_format;
size_t selection_ptr = 0;
bool playlist_initialized = false;
playlist_t *playlist = NULL;
playlist_t *tmp_playlist = NULL;
const struct playlist_entry *entry = NULL;
unsigned i = 0;
menu_handle_t *menu = menu_driver_get_ptr();
settings_t *settings = config_get_ptr();
bool playlist_use_old_format = settings->bools.playlist_use_old_format;
bool playlist_compression = settings->bools.playlist_compression;
bool playlist_sort_alphabetical = settings->bools.playlist_sort_alphabetical;
const char *path_content_history = settings->paths.path_content_history;
const char *path_content_music_history = settings->paths.path_content_music_history;
const char *path_content_video_history = settings->paths.path_content_video_history;
const char *path_content_image_history = settings->paths.path_content_image_history;
if (!menu)
return menu_cbs_exit();
@@ -2033,12 +2054,31 @@ static int action_ok_playlist_entry_collection(const char *path,
if (!tmp_playlist)
{
/* If playlist is not cached, have to load
* it here
* > Since the menu will always sort playlists
* based on current user config, have to do
* the same here - otherwise entry_idx may
* go out of sync... */
bool is_content_history = string_is_equal(menu->db_playlist_file, path_content_history) ||
string_is_equal(menu->db_playlist_file, path_content_music_history) ||
string_is_equal(menu->db_playlist_file, path_content_video_history) ||
string_is_equal(menu->db_playlist_file, path_content_image_history);
enum playlist_sort_mode current_sort_mode;
tmp_playlist = playlist_init(
menu->db_playlist_file, COLLECTION_SIZE);
if (!tmp_playlist)
return menu_cbs_exit();
current_sort_mode = playlist_get_sort_mode(tmp_playlist);
if (!is_content_history &&
((playlist_sort_alphabetical && (current_sort_mode == PLAYLIST_SORT_MODE_DEFAULT)) ||
(current_sort_mode == PLAYLIST_SORT_MODE_ALPHABETICAL)))
playlist_qsort(tmp_playlist);
playlist_initialized = true;
}
@@ -2061,6 +2101,8 @@ static int action_ok_playlist_entry_collection(const char *path,
{
RARCH_LOG("[playlist] subsystem not found in implementation\n");
/* TODO: Add OSD message telling users that content can't be loaded */
if (playlist_initialized)
playlist_free(tmp_playlist);
return 0;
}
@@ -2071,18 +2113,25 @@ static int action_ok_playlist_entry_collection(const char *path,
NULL, &content_info,
CORE_TYPE_PLAIN, NULL, NULL);
/* TODO: update playlist entry? move to first position I guess? */
if (playlist_initialized)
playlist_free(tmp_playlist);
return 1;
}
/* Is the core path / name of the playlist entry not yet filled in? */
if ( string_is_equal(entry->core_path, "DETECT")
&& string_is_equal(entry->core_name, "DETECT"))
/* Check whether playlist already has core path/name
* assignments
* > Both core name and core path must be valid */
if ( string_is_empty(entry->core_path)
|| string_is_empty(entry->core_name)
|| string_is_equal(entry->core_path, "DETECT")
|| string_is_equal(entry->core_name, "DETECT"))
{
core_info_ctx_find_t core_info;
const char *entry_path = NULL;
const char *default_core_path =
playlist_get_default_core_path(playlist);
bool found_associated_core = false;
struct playlist_entry update_entry = {0};
if (!string_is_empty(default_core_path))
{
@@ -2108,26 +2157,20 @@ static int action_ok_playlist_entry_collection(const char *path,
return ret;
}
tmp_playlist = playlist_get_cached();
update_entry.core_path = (char*)default_core_path;
update_entry.core_name = core_info.inf->display_name;
if (tmp_playlist)
{
struct playlist_entry entry = {0};
entry.core_path = (char*)default_core_path;
entry.core_name = core_info.inf->display_name;
command_playlist_update_write(
tmp_playlist,
selection_ptr,
&entry,
playlist_use_old_format);
}
command_playlist_update_write(
playlist,
selection_ptr,
&update_entry,
playlist_use_old_format,
playlist_compression);
}
else
{
strlcpy(new_core_path, entry->core_path, sizeof(new_core_path));
playlist_resolve_path(PLAYLIST_LOAD, new_core_path, sizeof(new_core_path));
playlist_resolve_path(PLAYLIST_LOAD, new_core_path, sizeof(new_core_path));
}
if (!playlist || !menu_content_playlist_load(playlist, selection_ptr))
@@ -2145,6 +2188,10 @@ static int action_ok_playlist_entry_collection(const char *path,
strlcpy(new_path, entry->path, sizeof(new_path));
playlist_resolve_path(PLAYLIST_LOAD, new_path, sizeof(new_path));
if (playlist_initialized)
playlist_free(tmp_playlist);
return default_action_ok_load_content_from_playlist_from_menu(
new_core_path, new_path, entry->label);
}
@@ -2160,6 +2207,7 @@ static int action_ok_playlist_entry(const char *path,
playlist_t *playlist = playlist_get_cached();
menu_handle_t *menu = menu_driver_get_ptr();
bool playlist_use_old_format = settings->bools.playlist_use_old_format;
bool playlist_compression = settings->bools.playlist_compression;
new_core_path[0] = '\0';
@@ -2172,8 +2220,13 @@ static int action_ok_playlist_entry(const char *path,
entry_label = entry->label;
if ( string_is_equal(entry->core_path, "DETECT")
&& string_is_equal(entry->core_name, "DETECT"))
/* Check whether playlist already has core path/name
* assignments
* > Both core name and core path must be valid */
if ( string_is_empty(entry->core_path)
|| string_is_empty(entry->core_name)
|| string_is_equal(entry->core_path, "DETECT")
|| string_is_equal(entry->core_name, "DETECT"))
{
core_info_ctx_find_t core_info;
const char *default_core_path =
@@ -2208,11 +2261,11 @@ static int action_ok_playlist_entry(const char *path,
command_playlist_update_write(NULL,
selection_ptr,
&entry,
playlist_use_old_format);
playlist_use_old_format,
playlist_compression);
}
}
else if (!string_is_empty(entry->core_path))
else
{
strlcpy(new_core_path, entry->core_path, sizeof(new_core_path));
playlist_resolve_path(PLAYLIST_LOAD, new_core_path, sizeof(new_core_path));
@@ -2243,6 +2296,7 @@ static int action_ok_playlist_entry_start_content(const char *path,
playlist_t *playlist = playlist_get_cached();
menu_handle_t *menu = menu_driver_get_ptr();
bool playlist_use_old_format = settings->bools.playlist_use_old_format;
bool playlist_compression = settings->bools.playlist_compression;
if (!playlist || !menu)
return menu_cbs_exit();
@@ -2251,8 +2305,13 @@ static int action_ok_playlist_entry_start_content(const char *path,
playlist_get_index(playlist, selection_ptr, &entry);
if ( string_is_equal(entry->core_path, "DETECT")
&& string_is_equal(entry->core_name, "DETECT"))
/* Check whether playlist already has core path/name
* assignments
* > Both core name and core path must be valid */
if ( string_is_empty(entry->core_path)
|| string_is_empty(entry->core_name)
|| string_is_equal(entry->core_path, "DETECT")
|| string_is_equal(entry->core_name, "DETECT"))
{
core_info_ctx_find_t core_info;
char new_core_path[PATH_MAX_LENGTH];
@@ -2293,7 +2352,8 @@ static int action_ok_playlist_entry_start_content(const char *path,
playlist,
selection_ptr,
&entry,
playlist_use_old_format);
playlist_use_old_format,
playlist_compression);
}
}
@@ -2557,6 +2617,7 @@ static int action_ok_audio_add_to_mixer_and_collection(const char *path,
menu_handle_t *menu = menu_driver_get_ptr();
bool playlist_fuzzy_archive_match = settings->bools.playlist_fuzzy_archive_match;
bool playlist_use_old_format = settings->bools.playlist_use_old_format;
bool playlist_compression = settings->bools.playlist_compression;
combined_path[0] = '\0';
@@ -2573,7 +2634,8 @@ static int action_ok_audio_add_to_mixer_and_collection(const char *path,
command_playlist_push_write(g_defaults.music_history, &entry,
playlist_fuzzy_archive_match,
playlist_use_old_format);
playlist_use_old_format,
playlist_compression);
if (filestream_exists(combined_path))
task_push_audio_mixer_load(combined_path,
@@ -2593,6 +2655,7 @@ static int action_ok_audio_add_to_mixer_and_collection_and_play(const char *path
settings_t *settings = config_get_ptr();
bool playlist_fuzzy_archive_match = settings->bools.playlist_fuzzy_archive_match;
bool playlist_use_old_format = settings->bools.playlist_use_old_format;
bool playlist_compression = settings->bools.playlist_compression;
combined_path[0] = '\0';
@@ -2609,8 +2672,8 @@ static int action_ok_audio_add_to_mixer_and_collection_and_play(const char *path
command_playlist_push_write(g_defaults.music_history, &entry,
playlist_fuzzy_archive_match,
playlist_use_old_format
);
playlist_use_old_format,
playlist_compression);
if (filestream_exists(combined_path))
task_push_audio_mixer_load_and_play(combined_path,
@@ -2672,6 +2735,7 @@ static void menu_input_st_string_cb_rename_entry(void *userdata,
{
settings_t *settings = config_get_ptr();
bool playlist_use_old_format = settings->bools.playlist_use_old_format;
bool playlist_compression = settings->bools.playlist_compression;
if (str && *str)
{
const char *label = menu_input_dialog_get_buffer();
@@ -2687,7 +2751,8 @@ static void menu_input_st_string_cb_rename_entry(void *userdata,
command_playlist_update_write(NULL,
menu_input_dialog_get_kb_idx(),
&entry,
playlist_use_old_format);
playlist_use_old_format,
playlist_compression);
}
}
@@ -3278,6 +3343,7 @@ static int action_ok_core_deferred_set(const char *new_core_path,
const char *path_dir_libretro = settings->paths.directory_libretro;
bool show_hidden_files = settings->bools.show_hidden_files;
bool playlist_use_old_format = settings->bools.playlist_use_old_format;
bool playlist_compression = settings->bools.playlist_compression;
ext_name[0] = '\0';
core_display_name[0] = '\0';
@@ -3310,7 +3376,8 @@ static int action_ok_core_deferred_set(const char *new_core_path,
NULL,
menu->scratchpad.unsigned_var,
&entry,
playlist_use_old_format);
playlist_use_old_format,
playlist_compression);
/* Provide visual feedback */
strlcpy(msg, msg_hash_to_str(MSG_SET_CORE_ASSOCIATION), sizeof(msg));
@@ -4898,6 +4965,7 @@ static int action_ok_delete_entry(const char *path,
char *def_conf_fav_path = NULL;
settings_t *settings = config_get_ptr();
bool playlist_use_old_format = settings->bools.playlist_use_old_format;
bool playlist_compression = settings->bools.playlist_compression;
playlist_t *playlist = playlist_get_cached();
menu_handle_t *menu = menu_driver_get_ptr();
@@ -4933,7 +5001,8 @@ static int action_ok_delete_entry(const char *path,
if (playlist)
{
playlist_delete_index(playlist, menu->rpl_entry_selection_ptr);
playlist_write_file(playlist, playlist_use_old_format);
playlist_write_file(
playlist, playlist_use_old_format, playlist_compression);
}
new_selection_ptr = menu_navigation_get_selection();
@@ -5804,6 +5873,7 @@ static int action_ok_push_dropdown_item_playlist_default_core(const char *path,
const char* core_name = path;
settings_t *settings = config_get_ptr();
bool playlist_use_old_format = settings->bools.playlist_use_old_format;
bool playlist_compression = settings->bools.playlist_compression;
/* Get core list */
core_info_get_list(&core_info_list);
@@ -5853,7 +5923,8 @@ static int action_ok_push_dropdown_item_playlist_default_core(const char *path,
}
/* In all cases, update file on disk */
playlist_write_file(playlist, playlist_use_old_format);
playlist_write_file(
playlist, playlist_use_old_format, playlist_compression);
return action_cancel_pop_default(NULL, NULL, 0, 0);
}
@@ -5866,11 +5937,13 @@ static int action_ok_push_dropdown_item_playlist_label_display_mode(
settings_t *settings = config_get_ptr();
playlist_t *playlist = playlist_get_cached();
bool playlist_use_old_format = settings->bools.playlist_use_old_format;
bool playlist_compression = settings->bools.playlist_compression;
playlist_set_label_display_mode(playlist, (enum playlist_label_display_mode)idx);
/* In all cases, update file on disk */
playlist_write_file(playlist, playlist_use_old_format);
playlist_write_file(
playlist, playlist_use_old_format, playlist_compression);
return action_cancel_pop_default(NULL, NULL, 0, 0);
}
@@ -5880,13 +5953,15 @@ static int generic_set_thumbnail_mode(enum playlist_thumbnail_id thumbnail_id, s
settings_t *settings = config_get_ptr();
playlist_t *playlist = playlist_get_cached();
bool playlist_use_old_format = settings->bools.playlist_use_old_format;
bool playlist_compression = settings->bools.playlist_compression;
if (!playlist)
return -1;
playlist_set_thumbnail_mode(playlist, thumbnail_id,
(enum playlist_thumbnail_mode)idx);
playlist_write_file(playlist, playlist_use_old_format);
playlist_write_file(
playlist, playlist_use_old_format, playlist_compression);
return action_cancel_pop_default(NULL, NULL, 0, 0);
}
@@ -5903,6 +5978,22 @@ static int action_ok_push_dropdown_item_playlist_left_thumbnail_mode(const char
return generic_set_thumbnail_mode(PLAYLIST_THUMBNAIL_LEFT, idx);
}
static int action_ok_push_dropdown_item_playlist_sort_mode(
const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
settings_t *settings = config_get_ptr();
playlist_t *playlist = playlist_get_cached();
bool playlist_use_old_format = settings->bools.playlist_use_old_format;
bool playlist_compression = settings->bools.playlist_compression;
playlist_set_sort_mode(playlist, (enum playlist_sort_mode)idx);
playlist_write_file(
playlist, playlist_use_old_format, playlist_compression);
return action_cancel_pop_default(NULL, NULL, 0, 0);
}
static int action_ok_push_dropdown_item_manual_content_scan_system_name(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
@@ -6171,6 +6262,20 @@ static int action_ok_playlist_right_thumbnail_mode(const char *path,
ACTION_OK_DL_DROPDOWN_BOX_LIST_PLAYLIST_RIGHT_THUMBNAIL_MODE);
}
static int action_ok_playlist_left_thumbnail_mode(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
return generic_dropdown_box_list(idx,
ACTION_OK_DL_DROPDOWN_BOX_LIST_PLAYLIST_LEFT_THUMBNAIL_MODE);
}
static int action_ok_playlist_sort_mode(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
return generic_dropdown_box_list(idx,
ACTION_OK_DL_DROPDOWN_BOX_LIST_PLAYLIST_SORT_MODE);
}
static int action_ok_remappings_port_list(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
@@ -6195,13 +6300,6 @@ static int action_ok_shader_preset_parameter_dropdown_box_list(const char *path,
ACTION_OK_DL_DROPDOWN_BOX_LIST_SHADER_PRESET_PARAMETER);
}
static int action_ok_playlist_left_thumbnail_mode(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
return generic_dropdown_box_list(idx,
ACTION_OK_DL_DROPDOWN_BOX_LIST_PLAYLIST_LEFT_THUMBNAIL_MODE);
}
static int action_ok_manual_content_scan_system_name(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
@@ -6749,6 +6847,7 @@ static int menu_cbs_init_bind_ok_compare_label(menu_file_list_cbs_t *cbs,
{MENU_ENUM_LABEL_PLAYLIST_MANAGER_LABEL_DISPLAY_MODE, action_ok_playlist_label_display_mode},
{MENU_ENUM_LABEL_PLAYLIST_MANAGER_RIGHT_THUMBNAIL_MODE,action_ok_playlist_right_thumbnail_mode},
{MENU_ENUM_LABEL_PLAYLIST_MANAGER_LEFT_THUMBNAIL_MODE,action_ok_playlist_left_thumbnail_mode},
{MENU_ENUM_LABEL_PLAYLIST_MANAGER_SORT_MODE, action_ok_playlist_sort_mode},
{MENU_ENUM_LABEL_UPDATE_ASSETS, action_ok_update_assets},
{MENU_ENUM_LABEL_UPDATE_CORE_INFO_FILES, action_ok_update_core_info_files},
{MENU_ENUM_LABEL_UPDATE_OVERLAYS, action_ok_update_overlays},
@@ -6915,6 +7014,7 @@ static int menu_cbs_init_bind_ok_compare_label(menu_file_list_cbs_t *cbs,
{MENU_ENUM_LABEL_PLAYLIST_MANAGER_LABEL_DISPLAY_MODE, action_ok_playlist_label_display_mode},
{MENU_ENUM_LABEL_PLAYLIST_MANAGER_RIGHT_THUMBNAIL_MODE, action_ok_playlist_right_thumbnail_mode},
{MENU_ENUM_LABEL_PLAYLIST_MANAGER_LEFT_THUMBNAIL_MODE, action_ok_playlist_left_thumbnail_mode},
{MENU_ENUM_LABEL_PLAYLIST_MANAGER_SORT_MODE, action_ok_playlist_sort_mode},
{MENU_ENUM_LABEL_MANUAL_CONTENT_SCAN_SYSTEM_NAME, action_ok_manual_content_scan_system_name},
{MENU_ENUM_LABEL_MANUAL_CONTENT_SCAN_CORE_NAME, action_ok_manual_content_scan_core_name},
{MENU_ENUM_LABEL_MANUAL_CONTENT_SCAN_DAT_FILE, action_ok_manual_content_scan_dat_file},
@@ -7059,6 +7159,9 @@ static int menu_cbs_init_bind_ok_compare_type(menu_file_list_cbs_t *cbs,
case MENU_SETTING_DROPDOWN_ITEM_PLAYLIST_LEFT_THUMBNAIL_MODE:
BIND_ACTION_OK(cbs, action_ok_push_dropdown_item_playlist_left_thumbnail_mode);
break;
case MENU_SETTING_DROPDOWN_ITEM_PLAYLIST_SORT_MODE:
BIND_ACTION_OK(cbs, action_ok_push_dropdown_item_playlist_sort_mode);
break;
case MENU_SETTING_DROPDOWN_ITEM_MANUAL_CONTENT_SCAN_SYSTEM_NAME:
BIND_ACTION_OK(cbs, action_ok_push_dropdown_item_manual_content_scan_system_name);
break;
+40 -4
View File
@@ -475,13 +475,15 @@ static int action_right_video_resolution(unsigned type, const char *label,
static int playlist_association_right(unsigned type, const char *label,
bool wraparound)
{ char core_path[PATH_MAX_LENGTH];
{
char core_path[PATH_MAX_LENGTH];
size_t i, next, current = 0;
core_info_list_t *core_info_list = NULL;
core_info_t *core_info = NULL;
settings_t *settings = config_get_ptr();
playlist_t *playlist = playlist_get_cached();
bool playlist_use_old_format = settings->bools.playlist_use_old_format;
bool playlist_compression = settings->bools.playlist_compression;
core_path[0] = '\0';
@@ -544,7 +546,8 @@ static int playlist_association_right(unsigned type, const char *label,
/* Update playlist */
playlist_set_default_core_path(playlist, core_info->path);
playlist_set_default_core_name(playlist, core_info->display_name);
playlist_write_file(playlist, playlist_use_old_format);
playlist_write_file(
playlist, playlist_use_old_format, playlist_compression);
return 0;
}
@@ -556,6 +559,7 @@ static int playlist_label_display_mode_right(unsigned type, const char *label,
settings_t *settings = config_get_ptr();
playlist_t *playlist = playlist_get_cached();
bool playlist_use_old_format = settings->bools.playlist_use_old_format;
bool playlist_compression = settings->bools.playlist_compression;
if (!playlist)
return -1;
@@ -568,7 +572,8 @@ static int playlist_label_display_mode_right(unsigned type, const char *label,
label_display_mode = LABEL_DISPLAY_MODE_DEFAULT;
playlist_set_label_display_mode(playlist, label_display_mode);
playlist_write_file(playlist, playlist_use_old_format);
playlist_write_file(
playlist, playlist_use_old_format, playlist_compression);
return 0;
}
@@ -578,6 +583,7 @@ static void playlist_thumbnail_mode_right(playlist_t *playlist, enum playlist_th
{
settings_t *settings = config_get_ptr();
bool playlist_use_old_format = settings->bools.playlist_use_old_format;
bool playlist_compression = settings->bools.playlist_compression;
enum playlist_thumbnail_mode thumbnail_mode =
playlist_get_thumbnail_mode(playlist, thumbnail_id);
@@ -587,7 +593,8 @@ static void playlist_thumbnail_mode_right(playlist_t *playlist, enum playlist_th
thumbnail_mode = PLAYLIST_THUMBNAIL_MODE_DEFAULT;
playlist_set_thumbnail_mode(playlist, thumbnail_id, thumbnail_mode);
playlist_write_file(playlist, playlist_use_old_format);
playlist_write_file(
playlist, playlist_use_old_format, playlist_compression);
}
static int playlist_right_thumbnail_mode_right(unsigned type, const char *label,
@@ -616,6 +623,32 @@ static int playlist_left_thumbnail_mode_right(unsigned type, const char *label,
return 0;
}
static int playlist_sort_mode_right(unsigned type, const char *label,
bool wraparound)
{
enum playlist_sort_mode sort_mode;
settings_t *settings = config_get_ptr();
playlist_t *playlist = playlist_get_cached();
bool playlist_use_old_format = settings->bools.playlist_use_old_format;
bool playlist_compression = settings->bools.playlist_compression;
if (!playlist)
return -1;
sort_mode = playlist_get_sort_mode(playlist);
if (sort_mode < PLAYLIST_SORT_MODE_OFF)
sort_mode = (enum playlist_sort_mode)((int)sort_mode + 1);
else if (wraparound)
sort_mode = PLAYLIST_SORT_MODE_DEFAULT;
playlist_set_sort_mode(playlist, sort_mode);
playlist_write_file(
playlist, playlist_use_old_format, playlist_compression);
return 0;
}
static int manual_content_scan_system_name_right(unsigned type, const char *label,
bool wraparound)
{
@@ -1036,6 +1069,9 @@ static int menu_cbs_init_bind_right_compare_label(menu_file_list_cbs_t *cbs,
case MENU_ENUM_LABEL_PLAYLIST_MANAGER_LEFT_THUMBNAIL_MODE:
BIND_ACTION_RIGHT(cbs, playlist_left_thumbnail_mode_right);
break;
case MENU_ENUM_LABEL_PLAYLIST_MANAGER_SORT_MODE:
BIND_ACTION_RIGHT(cbs, playlist_sort_mode_right);
break;
case MENU_ENUM_LABEL_MANUAL_CONTENT_SCAN_SYSTEM_NAME:
BIND_ACTION_RIGHT(cbs, manual_content_scan_system_name_right);
break;
+47 -12
View File
@@ -297,8 +297,10 @@ static int action_start_playlist_association(
const char *path, const char *label,
unsigned type, size_t idx, size_t entry_idx)
{
settings_t *settings = config_get_ptr();
playlist_t *playlist = playlist_get_cached();
settings_t *settings = config_get_ptr();
bool playlist_use_old_format = settings->bools.playlist_use_old_format;
bool playlist_compression = settings->bools.playlist_compression;
playlist_t *playlist = playlist_get_cached();
if (!playlist)
return -1;
@@ -306,7 +308,8 @@ static int action_start_playlist_association(
/* Set default core path + name to DETECT */
playlist_set_default_core_path(playlist, file_path_str(FILE_PATH_DETECT));
playlist_set_default_core_name(playlist, file_path_str(FILE_PATH_DETECT));
playlist_write_file(playlist, settings->bools.playlist_use_old_format);
playlist_write_file(
playlist, playlist_use_old_format, playlist_compression);
return 0;
}
@@ -315,15 +318,18 @@ static int action_start_playlist_label_display_mode(
const char *path, const char *label,
unsigned type, size_t idx, size_t entry_idx)
{
settings_t *settings = config_get_ptr();
playlist_t *playlist = playlist_get_cached();
settings_t *settings = config_get_ptr();
bool playlist_use_old_format = settings->bools.playlist_use_old_format;
bool playlist_compression = settings->bools.playlist_compression;
playlist_t *playlist = playlist_get_cached();
if (!playlist)
return -1;
/* Set label display mode to the default */
playlist_set_label_display_mode(playlist, LABEL_DISPLAY_MODE_DEFAULT);
playlist_write_file(playlist, settings->bools.playlist_use_old_format);
playlist_write_file(
playlist, playlist_use_old_format, playlist_compression);
return 0;
}
@@ -332,15 +338,18 @@ static int action_start_playlist_right_thumbnail_mode(
const char *path, const char *label,
unsigned type, size_t idx, size_t entry_idx)
{
settings_t *settings = config_get_ptr();
playlist_t *playlist = playlist_get_cached();
settings_t *settings = config_get_ptr();
bool playlist_use_old_format = settings->bools.playlist_use_old_format;
bool playlist_compression = settings->bools.playlist_compression;
playlist_t *playlist = playlist_get_cached();
if (!playlist)
return -1;
/* Set thumbnail_mode to default value */
playlist_set_thumbnail_mode(playlist, PLAYLIST_THUMBNAIL_RIGHT, PLAYLIST_THUMBNAIL_MODE_DEFAULT);
playlist_write_file(playlist, settings->bools.playlist_use_old_format);
playlist_write_file(
playlist, playlist_use_old_format, playlist_compression);
return 0;
}
@@ -349,15 +358,38 @@ static int action_start_playlist_left_thumbnail_mode(
const char *path, const char *label,
unsigned type, size_t idx, size_t entry_idx)
{
settings_t *settings = config_get_ptr();
playlist_t *playlist = playlist_get_cached();
settings_t *settings = config_get_ptr();
bool playlist_use_old_format = settings->bools.playlist_use_old_format;
bool playlist_compression = settings->bools.playlist_compression;
playlist_t *playlist = playlist_get_cached();
if (!playlist)
return -1;
/* Set thumbnail_mode to default value */
playlist_set_thumbnail_mode(playlist, PLAYLIST_THUMBNAIL_LEFT, PLAYLIST_THUMBNAIL_MODE_DEFAULT);
playlist_write_file(playlist, settings->bools.playlist_use_old_format);
playlist_write_file(
playlist, playlist_use_old_format, playlist_compression);
return 0;
}
static int action_start_playlist_sort_mode(
const char *path, const char *label,
unsigned type, size_t idx, size_t entry_idx)
{
settings_t *settings = config_get_ptr();
bool playlist_use_old_format = settings->bools.playlist_use_old_format;
bool playlist_compression = settings->bools.playlist_compression;
playlist_t *playlist = playlist_get_cached();
if (!playlist)
return -1;
/* Set sort mode to the default */
playlist_set_sort_mode(playlist, PLAYLIST_SORT_MODE_DEFAULT);
playlist_write_file(
playlist, playlist_use_old_format, playlist_compression);
return 0;
}
@@ -500,6 +532,9 @@ static int menu_cbs_init_bind_start_compare_label(menu_file_list_cbs_t *cbs)
case MENU_ENUM_LABEL_PLAYLIST_MANAGER_LEFT_THUMBNAIL_MODE:
BIND_ACTION_START(cbs, action_start_playlist_left_thumbnail_mode);
break;
case MENU_ENUM_LABEL_PLAYLIST_MANAGER_SORT_MODE:
BIND_ACTION_START(cbs, action_start_playlist_sort_mode);
break;
case MENU_ENUM_LABEL_MANUAL_CONTENT_SCAN_DIR:
BIND_ACTION_START(cbs, action_start_manual_content_scan_dir);
break;
+29 -2
View File
@@ -146,6 +146,7 @@ default_sublabel_macro(action_bind_sublabel_playlist_manager_list, MENU_
default_sublabel_macro(action_bind_sublabel_playlist_manager_default_core, MENU_ENUM_SUBLABEL_PLAYLIST_MANAGER_DEFAULT_CORE)
default_sublabel_macro(action_bind_sublabel_playlist_manager_reset_cores, MENU_ENUM_SUBLABEL_PLAYLIST_MANAGER_RESET_CORES)
default_sublabel_macro(action_bind_sublabel_playlist_manager_label_display_mode, MENU_ENUM_SUBLABEL_PLAYLIST_MANAGER_LABEL_DISPLAY_MODE)
default_sublabel_macro(action_bind_sublabel_playlist_manager_sort_mode, MENU_ENUM_SUBLABEL_PLAYLIST_MANAGER_SORT_MODE)
default_sublabel_macro(action_bind_sublabel_playlist_manager_clean_playlist, MENU_ENUM_SUBLABEL_PLAYLIST_MANAGER_CLEAN_PLAYLIST)
default_sublabel_macro(action_bind_sublabel_delete_playlist, MENU_ENUM_SUBLABEL_DELETE_PLAYLIST)
default_sublabel_macro(action_bind_sublabel_network_settings_list, MENU_ENUM_SUBLABEL_NETWORK_SETTINGS)
@@ -249,6 +250,7 @@ default_sublabel_macro(action_bind_sublabel_audio_mute, MENU_
#ifdef HAVE_AUDIOMIXER
default_sublabel_macro(action_bind_sublabel_audio_mixer_mute, MENU_ENUM_SUBLABEL_AUDIO_MIXER_MUTE)
#endif
default_sublabel_macro(action_bind_sublabel_audio_fastforward_mute, MENU_ENUM_SUBLABEL_AUDIO_FASTFORWARD_MUTE)
default_sublabel_macro(action_bind_sublabel_camera_allow, MENU_ENUM_SUBLABEL_CAMERA_ALLOW)
default_sublabel_macro(action_bind_sublabel_location_allow, MENU_ENUM_SUBLABEL_LOCATION_ALLOW)
default_sublabel_macro(action_bind_sublabel_input_max_users, MENU_ENUM_SUBLABEL_INPUT_MAX_USERS)
@@ -380,6 +382,8 @@ default_sublabel_macro(action_bind_sublabel_perfcnt_enable, MENU_
default_sublabel_macro(action_bind_sublabel_savestate_auto_save, MENU_ENUM_SUBLABEL_SAVESTATE_AUTO_SAVE)
default_sublabel_macro(action_bind_sublabel_savestate_auto_load, MENU_ENUM_SUBLABEL_SAVESTATE_AUTO_LOAD)
default_sublabel_macro(action_bind_sublabel_savestate_thumbnail_enable, MENU_ENUM_SUBLABEL_SAVESTATE_THUMBNAIL_ENABLE)
default_sublabel_macro(action_bind_sublabel_save_file_compression, MENU_ENUM_SUBLABEL_SAVE_FILE_COMPRESSION)
default_sublabel_macro(action_bind_sublabel_savestate_file_compression, MENU_ENUM_SUBLABEL_SAVESTATE_FILE_COMPRESSION)
default_sublabel_macro(action_bind_sublabel_autosave_interval, MENU_ENUM_SUBLABEL_AUTOSAVE_INTERVAL)
default_sublabel_macro(action_bind_sublabel_input_remap_binds_enable, MENU_ENUM_SUBLABEL_INPUT_REMAP_BINDS_ENABLE)
default_sublabel_macro(action_bind_sublabel_input_autodetect_enable, MENU_ENUM_SUBLABEL_INPUT_AUTODETECT_ENABLE)
@@ -756,6 +760,8 @@ default_sublabel_macro(action_bind_sublabel_menu_ticker_smooth,
default_sublabel_macro(action_bind_sublabel_playlist_show_inline_core_name, MENU_ENUM_SUBLABEL_PLAYLIST_SHOW_INLINE_CORE_NAME)
default_sublabel_macro(action_bind_sublabel_playlist_sort_alphabetical, MENU_ENUM_SUBLABEL_PLAYLIST_SORT_ALPHABETICAL)
default_sublabel_macro(action_bind_sublabel_playlist_fuzzy_archive_match, MENU_ENUM_SUBLABEL_PLAYLIST_FUZZY_ARCHIVE_MATCH)
default_sublabel_macro(action_bind_sublabel_playlist_use_old_format, MENU_ENUM_SUBLABEL_PLAYLIST_USE_OLD_FORMAT)
default_sublabel_macro(action_bind_sublabel_playlist_compression, MENU_ENUM_SUBLABEL_PLAYLIST_COMPRESSION)
default_sublabel_macro(action_bind_sublabel_menu_rgui_full_width_layout, MENU_ENUM_SUBLABEL_MENU_RGUI_FULL_WIDTH_LAYOUT)
default_sublabel_macro(action_bind_sublabel_menu_rgui_extended_ascii, MENU_ENUM_SUBLABEL_MENU_RGUI_EXTENDED_ASCII)
default_sublabel_macro(action_bind_sublabel_thumbnails_updater_list, MENU_ENUM_SUBLABEL_THUMBNAILS_UPDATER_LIST)
@@ -1103,9 +1109,12 @@ static int action_bind_sublabel_playlist_entry(
/* Read playlist entry */
playlist_get_index(playlist, i, &entry);
/* Only add sublabel if a core is currently assigned */
/* Only add sublabel if a core is currently assigned
* > Both core name and core path must be valid */
if ( string_is_empty(entry->core_name) ||
string_is_equal(entry->core_name, "DETECT"))
string_is_equal(entry->core_name, "DETECT") ||
string_is_empty(entry->core_path) ||
string_is_equal(entry->core_path, "DETECT"))
return 0;
/* Add core name */
@@ -2323,6 +2332,12 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
case MENU_ENUM_LABEL_SAVESTATE_THUMBNAIL_ENABLE:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_savestate_thumbnail_enable);
break;
case MENU_ENUM_LABEL_SAVE_FILE_COMPRESSION:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_save_file_compression);
break;
case MENU_ENUM_LABEL_SAVESTATE_FILE_COMPRESSION:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_savestate_file_compression);
break;
case MENU_ENUM_LABEL_SAVESTATE_AUTO_SAVE:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_savestate_auto_save);
break;
@@ -2683,6 +2698,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_audio_mixer_mute);
#endif
break;
case MENU_ENUM_LABEL_AUDIO_FASTFORWARD_MUTE:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_audio_fastforward_mute);
break;
case MENU_ENUM_LABEL_AUDIO_LATENCY:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_audio_latency);
break;
@@ -2925,6 +2943,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
case MENU_ENUM_LABEL_PLAYLIST_MANAGER_LABEL_DISPLAY_MODE:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_playlist_manager_label_display_mode);
break;
case MENU_ENUM_LABEL_PLAYLIST_MANAGER_SORT_MODE:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_playlist_manager_sort_mode);
break;
case MENU_ENUM_LABEL_PLAYLIST_MANAGER_CLEAN_PLAYLIST:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_playlist_manager_clean_playlist);
break;
@@ -3271,6 +3292,12 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
case MENU_ENUM_LABEL_PLAYLIST_FUZZY_ARCHIVE_MATCH:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_playlist_fuzzy_archive_match);
break;
case MENU_ENUM_LABEL_PLAYLIST_USE_OLD_FORMAT:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_playlist_use_old_format);
break;
case MENU_ENUM_LABEL_PLAYLIST_COMPRESSION:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_playlist_compression);
break;
case MENU_ENUM_LABEL_MENU_RGUI_FULL_WIDTH_LAYOUT:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_rgui_full_width_layout);
break;
+2
View File
@@ -428,6 +428,7 @@ default_title_macro(action_get_title_dropdown_video_shader_parameter_item, MENU
default_title_macro(action_get_title_dropdown_video_shader_preset_parameter_item, MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PARAMETERS)
default_title_macro(action_get_title_dropdown_playlist_default_core_item, MENU_ENUM_LABEL_VALUE_PLAYLIST_MANAGER_DEFAULT_CORE)
default_title_macro(action_get_title_dropdown_playlist_label_display_mode_item, MENU_ENUM_LABEL_VALUE_PLAYLIST_MANAGER_LABEL_DISPLAY_MODE)
default_title_macro(action_get_title_dropdown_playlist_sort_mode_item, MENU_ENUM_LABEL_VALUE_PLAYLIST_MANAGER_SORT_MODE)
default_title_macro(action_get_title_manual_content_scan_list, MENU_ENUM_LABEL_VALUE_MANUAL_CONTENT_SCAN_LIST)
default_title_macro(action_get_title_dropdown_manual_content_scan_system_name_item, MENU_ENUM_LABEL_VALUE_MANUAL_CONTENT_SCAN_SYSTEM_NAME)
default_title_macro(action_get_title_dropdown_manual_content_scan_core_name_item, MENU_ENUM_LABEL_VALUE_MANUAL_CONTENT_SCAN_CORE_NAME)
@@ -1367,6 +1368,7 @@ int menu_cbs_init_bind_title(menu_file_list_cbs_t *cbs,
{MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_VIDEO_SHADER_NUM_PASSES, action_get_title_dropdown_video_shader_num_pass_item},
{MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_PLAYLIST_DEFAULT_CORE, action_get_title_dropdown_playlist_default_core_item},
{MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_PLAYLIST_LABEL_DISPLAY_MODE, action_get_title_dropdown_playlist_label_display_mode_item},
{MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_PLAYLIST_SORT_MODE, action_get_title_dropdown_playlist_sort_mode_item},
{MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_PLAYLIST_RIGHT_THUMBNAIL_MODE, action_get_title_thumbnails},
{MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_PLAYLIST_LEFT_THUMBNAIL_MODE, action_get_title_left_thumbnails},
{MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_MANUAL_CONTENT_SCAN_SYSTEM_NAME, action_get_title_dropdown_manual_content_scan_system_name_item},
+17 -4
View File
@@ -6436,10 +6436,17 @@ static void materialui_populate_entries(
mui->is_dropdown_list = string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST)) ||
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_SPECIAL)) ||
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_RESOLUTION)) ||
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_VIDEO_SHADER_PARAMETER)) ||
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_VIDEO_SHADER_PRESET_PARAMETER)) ||
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_VIDEO_SHADER_NUM_PASSES)) ||
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_PLAYLIST_DEFAULT_CORE)) ||
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_PLAYLIST_LABEL_DISPLAY_MODE)) ||
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_PLAYLIST_RIGHT_THUMBNAIL_MODE)) ||
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_PLAYLIST_LEFT_THUMBNAIL_MODE));
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_PLAYLIST_LEFT_THUMBNAIL_MODE)) ||
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_PLAYLIST_SORT_MODE)) ||
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_MANUAL_CONTENT_SCAN_SYSTEM_NAME)) ||
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_MANUAL_CONTENT_SCAN_CORE_NAME)) ||
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_DISK_INDEX));
}
/* If this is a playlist, then cache it */
@@ -6806,7 +6813,7 @@ static enum menu_action materialui_parse_menu_entry_action(
(materialui_list_get_size(mui, MENU_LIST_PLAIN) == 1))
{
materialui_switch_tabs(mui, NULL, action);
new_action = MENU_ACTION_NOOP;
new_action = MENU_ACTION_ACCESSIBILITY_SPEAK_TITLE_LABEL;
}
else
{
@@ -7662,8 +7669,14 @@ static int materialui_pointer_up(void *userdata,
menu_navigation_set_selection(ptr);
/* Perform a MENU_ACTION_SELECT on currently
* active item */
return materialui_menu_entry_action(mui, entry, (size_t)ptr, MENU_ACTION_SELECT);
* active item
* > Note that we still use 'selection'
* (i.e. old selection value) here. This
* ensures that materialui_menu_entry_action()
* registers any change due to the above automatic
* 'pointer item' activation, and thus operates
* on the correct target entry */
return materialui_menu_entry_action(mui, entry, selection, MENU_ACTION_SELECT);
}
else
{
+599 -264
View File
File diff suppressed because it is too large. Load diff
+40 -27
View File
@@ -86,27 +86,46 @@ enum ozone_onscreen_entry_position_type
OZONE_ONSCREEN_ENTRY_CENTRE
};
/* This structure holds all objects + metadata
* corresponding to a particular font */
typedef struct
{
font_data_t *font;
video_font_raster_block_t raster_block;
int glyph_width;
int line_height;
int line_ascender;
int line_centre_offset;
} ozone_font_data_t;
/* Container for a footer text label */
typedef struct
{
const char *str;
int width;
} ozone_footer_label_t;
struct ozone_handle
{
struct
{
font_data_t *footer;
font_data_t *title;
font_data_t *time;
font_data_t *entries_label;
font_data_t *entries_sublabel;
font_data_t *sidebar;
ozone_font_data_t footer;
ozone_font_data_t title;
ozone_font_data_t time;
ozone_font_data_t entries_label;
ozone_font_data_t entries_sublabel;
ozone_font_data_t sidebar;
} fonts;
struct
{
video_font_raster_block_t footer;
video_font_raster_block_t title;
video_font_raster_block_t time;
video_font_raster_block_t entries_label;
video_font_raster_block_t entries_sublabel;
video_font_raster_block_t sidebar;
} raster_blocks;
unsigned lanuage;
ozone_footer_label_t ok;
ozone_footer_label_t back;
ozone_footer_label_t search;
ozone_footer_label_t fullscreen_thumbs;
ozone_footer_label_t metadata_toggle;
} footer_labels;
uintptr_t textures[OZONE_THEME_TEXTURE_LAST];
uintptr_t icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_LAST];
@@ -142,6 +161,7 @@ struct ozone_handle
float thumbnail_bar_position;
float fullscreen_thumbnail_alpha;
float left_thumbnail_alpha;
} animations;
bool fade_direction; /* false = left to right, true = right to left */
@@ -157,20 +177,6 @@ struct ozone_handle
bool draw_sidebar;
float sidebar_offset;
unsigned title_font_glyph_width;
unsigned entry_font_glyph_width;
unsigned sublabel_font_glyph_width;
unsigned footer_font_glyph_width;
unsigned sidebar_font_glyph_width;
unsigned time_font_glyph_width;
unsigned title_font_glyph_height;
unsigned entry_font_glyph_height;
unsigned sublabel_font_glyph_height;
unsigned footer_font_glyph_height;
unsigned sidebar_font_glyph_height;
unsigned time_font_glyph_height;
ozone_theme_t *theme;
struct {
@@ -289,6 +295,8 @@ struct ozone_handle
unsigned selection_lastplayed_lines;
bool selection_core_is_viewer;
bool force_metadata_display;
bool is_db_manager_list;
bool is_file_list;
bool is_quick_menu;
@@ -304,6 +312,7 @@ typedef struct ozone_node
unsigned height;
unsigned position_y;
bool wrap;
unsigned sublabel_lines;
char *fullpath;
/* Console tabs */
@@ -388,4 +397,8 @@ unsigned ozone_count_lines(const char *str);
void ozone_update_content_metadata(ozone_handle_t *ozone);
void ozone_font_flush(
unsigned video_width, unsigned video_height,
ozone_font_data_t *font_data);
#endif
Loaded 100 of 156 files, more files were not shown because too many files have changed in this diff. Show more